@rsalmn/extremerouter 0.8.6 → 0.8.7

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 (1106) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -8
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/routes-manifest.json +12 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +3 -3
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +3 -3
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +2 -2
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  94. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  105. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  108. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  109. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  110. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
  112. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  114. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  115. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/breaker/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/breaker/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  136. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  142. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  148. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  150. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  152. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  160. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +3 -3
  162. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  164. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  166. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  168. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/combos/lab/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/lab/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/combos/simulate/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/combos/simulate/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js +2 -2
  180. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/health/overview/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/health/overview/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  194. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +5 -5
  206. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -0
  222. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -0
  223. package/app/.next-cli-build/server/app/api/models/catalog-sync/route_client-reference-manifest.js +1 -0
  224. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  241. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/oauth/zcode/import/route.js +1 -0
  273. package/app/.next-cli-build/server/app/api/oauth/zcode/import/route.js.nft.json +1 -0
  274. package/app/.next-cli-build/server/app/api/oauth/zcode/import/route_client-reference-manifest.js +1 -0
  275. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  276. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +2 -2
  298. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/providers/capture/launch/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/providers/capture/launch/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/providers/capture/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/capture/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/providers/felo-capture/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/providers/felo-capture/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  344. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  346. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  350. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  352. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/smart-routing/active/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/smart-routing/active/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/smart-routing/history/route.js +2 -2
  368. package/app/.next-cli-build/server/app/api/smart-routing/history/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/smart-routing/lab/route.js +2 -2
  370. package/app/.next-cli-build/server/app/api/smart-routing/lab/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/smart-routing/stream/route.js +2 -2
  372. package/app/.next-cli-build/server/app/api/smart-routing/stream/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +2 -2
  376. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  382. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  404. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  430. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  442. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  444. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  445. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  446. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  447. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  448. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  449. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  450. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  451. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  452. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  453. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  454. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  455. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  456. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  457. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  458. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  460. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  461. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  462. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  463. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  464. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  465. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  466. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  467. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  468. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  469. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  470. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  471. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  472. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  473. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  474. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  475. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  476. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  478. package/app/.next-cli-build/server/app/callback.html +1 -1
  479. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  480. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  481. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
  483. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  486. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  487. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +7 -7
  491. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
  492. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
  494. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  496. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  499. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  500. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  501. package/app/.next-cli-build/server/app/index.html +1 -1
  502. package/app/.next-cli-build/server/app/index.rsc +6 -6
  503. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  505. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
  507. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  508. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  509. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  510. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  511. package/app/.next-cli-build/server/app/landing.html +1 -1
  512. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  513. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  514. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
  516. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  517. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  518. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/login/page.js +2 -2
  520. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  521. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  522. package/app/.next-cli-build/server/app/login.html +1 -1
  523. package/app/.next-cli-build/server/app/login.rsc +7 -7
  524. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  525. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
  527. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  528. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  529. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  531. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  532. package/app/.next-cli-build/server/app/page.js +2 -2
  533. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  534. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  535. package/app/.next-cli-build/server/app-paths-manifest.json +10 -8
  536. package/app/.next-cli-build/server/chunks/1194.js +1 -1
  537. package/app/.next-cli-build/server/chunks/1241.js +1 -1
  538. package/app/.next-cli-build/server/chunks/1350.js +2 -2
  539. package/app/.next-cli-build/server/chunks/1411.js +9 -0
  540. package/app/.next-cli-build/server/chunks/1429.js +1 -1
  541. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  542. package/app/.next-cli-build/server/chunks/1891.js +1 -1
  543. package/app/.next-cli-build/server/chunks/212.js +1 -1
  544. package/app/.next-cli-build/server/chunks/2409.js +1 -1
  545. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  546. package/app/.next-cli-build/server/chunks/3552.js +1 -0
  547. package/app/.next-cli-build/server/chunks/3593.js +1 -1
  548. package/app/.next-cli-build/server/chunks/3841.js +1 -1
  549. package/app/.next-cli-build/server/chunks/4046.js +1 -1
  550. package/app/.next-cli-build/server/chunks/4109.js +1 -1
  551. package/app/.next-cli-build/server/chunks/412.js +1 -1
  552. package/app/.next-cli-build/server/chunks/4502.js +5 -5
  553. package/app/.next-cli-build/server/chunks/4739.js +1 -1
  554. package/app/.next-cli-build/server/chunks/4780.js +1 -1
  555. package/app/.next-cli-build/server/chunks/4957.js +1 -0
  556. package/app/.next-cli-build/server/chunks/5050.js +2 -0
  557. package/app/.next-cli-build/server/chunks/507.js +1 -1
  558. package/app/.next-cli-build/server/chunks/5253.js +1 -1
  559. package/app/.next-cli-build/server/chunks/5258.js +1 -1
  560. package/app/.next-cli-build/server/chunks/5330.js +11 -11
  561. package/app/.next-cli-build/server/chunks/5473.js +9 -0
  562. package/app/.next-cli-build/server/chunks/5604.js +13 -0
  563. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  564. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  565. package/app/.next-cli-build/server/chunks/5628.js +1 -1
  566. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  567. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  568. package/app/.next-cli-build/server/chunks/6182.js +1 -1
  569. package/app/.next-cli-build/server/chunks/6488.js +1 -0
  570. package/app/.next-cli-build/server/chunks/6777.js +1 -1
  571. package/app/.next-cli-build/server/chunks/6878.js +1 -1
  572. package/app/.next-cli-build/server/chunks/698.js +1 -1
  573. package/app/.next-cli-build/server/chunks/7016.js +2 -2
  574. package/app/.next-cli-build/server/chunks/7566.js +2 -2
  575. package/app/.next-cli-build/server/chunks/7765.js +2 -2
  576. package/app/.next-cli-build/server/chunks/7815.js +1 -0
  577. package/app/.next-cli-build/server/chunks/7965.js +1 -1
  578. package/app/.next-cli-build/server/chunks/8048.js +1 -1
  579. package/app/.next-cli-build/server/chunks/809.js +1 -1
  580. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  581. package/app/.next-cli-build/server/chunks/8266.js +1 -1
  582. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  583. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  584. package/app/.next-cli-build/server/chunks/8802.js +2 -2
  585. package/app/.next-cli-build/server/chunks/885.js +14 -14
  586. package/app/.next-cli-build/server/chunks/8895.js +6 -6
  587. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  588. package/app/.next-cli-build/server/chunks/9903.js +1 -1
  589. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  590. package/app/.next-cli-build/server/middleware.js +6 -6
  591. package/app/.next-cli-build/server/pages/404.html +1 -1
  592. package/app/.next-cli-build/server/pages/500.html +1 -1
  593. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  594. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  595. package/app/.next-cli-build/static/BmLJ5bmQbpsF-jvZIwr9t/_buildManifest.js +1 -0
  596. package/app/.next-cli-build/static/chunks/1321-184fe0dd34faf680.js +1 -0
  597. package/app/.next-cli-build/static/chunks/2563-a547c8ef699e1791.js +1 -0
  598. package/app/.next-cli-build/static/chunks/5497-9caed03337b37e47.js +7 -0
  599. package/app/.next-cli-build/static/chunks/705-eaa2de0fd5964be4.js +1 -0
  600. package/app/.next-cli-build/static/chunks/{9622-fcd7c93a94eaa38f.js → 9622-d0f22be4f1ef8011.js} +6 -6
  601. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/alerts/{page-812b19e92ea94f14.js → page-3527fe022102a692.js} +1 -1
  602. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-9a0e996c5bc5a169.js → page-fe59538aa4add719.js} +1 -1
  603. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-0e1d5c3cf52823c3.js → page-1849f671db0f9fe9.js} +1 -1
  604. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-3122fd2735ba291c.js → page-0e903eb34158c8a8.js} +1 -1
  605. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-8406e79b31e512bb.js +3 -0
  606. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-81ef4c324f201832.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-72670cb4cac6b97d.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/health/{page-1c94a0710d61767e.js → page-d71cb9f910cb5d13.js} +1 -1
  609. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-9e98db59d6b1d05f.js → page-94341b277cf27462.js} +1 -1
  610. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-026721fa921475e0.js → page-558f5601f8df1d4d.js} +1 -1
  611. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-ec37860600228def.js → page-6effc5c0f2b1d72e.js} +1 -1
  612. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/{page-99c8024bece93467.js → page-05b05e6f6136829d.js} +1 -1
  613. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-825c8673e6351d02.js → page-95375c7b40f99306.js} +1 -1
  614. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-65072e4024bb73b6.js → page-4549c187375b9192.js} +1 -1
  615. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/{page-b92bc7ebaa0813b2.js → page-bb459e518dfa9f70.js} +1 -1
  616. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-cc5141ff81040e89.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-625485e32264e15b.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-09b1b5beae8435cd.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-9eea89b85926cfd8.js → page-776433cfd87f123a.js} +3 -3
  620. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-aaaaeede554f51a5.js → page-1f67fe5d69805df2.js} +1 -1
  621. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-5d9d7d47216375ea.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-70bfba02b4fc414f.js → page-c561cab29785310a.js} +1 -1
  623. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-140fef4b235b4792.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-17bcf4e0db497e3a.js → page-acf6cde3210c179a.js} +1 -1
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-6e8f34517990d858.js → page-c3ae0ab7f0d0634d.js} +1 -1
  626. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-d9e35b679b85696a.js → page-cb12854a23416b01.js} +1 -1
  627. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-55b0738c2d201462.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-20cc41f2e1307f06.js → layout-66efb163e888cd6b.js} +1 -1
  629. package/app/.next-cli-build/static/chunks/app/_global-error/page-bf747ebfcd7e601c.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-bf747ebfcd7e601c.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-bf747ebfcd7e601c.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-bf747ebfcd7e601c.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-bf747ebfcd7e601c.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-bf747ebfcd7e601c.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-bf747ebfcd7e601c.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-bf747ebfcd7e601c.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-bf747ebfcd7e601c.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/breaker/route-bf747ebfcd7e601c.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/cache/route-bf747ebfcd7e601c.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-bf747ebfcd7e601c.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-bf747ebfcd7e601c.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-bf747ebfcd7e601c.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-bf747ebfcd7e601c.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-bf747ebfcd7e601c.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-bf747ebfcd7e601c.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-bf747ebfcd7e601c.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-bf747ebfcd7e601c.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-bf747ebfcd7e601c.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-bf747ebfcd7e601c.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-bf747ebfcd7e601c.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-bf747ebfcd7e601c.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-bf747ebfcd7e601c.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-bf747ebfcd7e601c.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-bf747ebfcd7e601c.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-bf747ebfcd7e601c.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-bf747ebfcd7e601c.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-bf747ebfcd7e601c.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/combos/lab/route-bf747ebfcd7e601c.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/combos/route-bf747ebfcd7e601c.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/combos/simulate/route-bf747ebfcd7e601c.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-bf747ebfcd7e601c.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-bf747ebfcd7e601c.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-bf747ebfcd7e601c.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-bf747ebfcd7e601c.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-bf747ebfcd7e601c.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/health/overview/route-bf747ebfcd7e601c.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-bf747ebfcd7e601c.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/health/route-bf747ebfcd7e601c.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-bf747ebfcd7e601c.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/init/route-bf747ebfcd7e601c.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-bf747ebfcd7e601c.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/keys/route-bf747ebfcd7e601c.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/locale/route-bf747ebfcd7e601c.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-bf747ebfcd7e601c.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-bf747ebfcd7e601c.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-bf747ebfcd7e601c.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-bf747ebfcd7e601c.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-bf747ebfcd7e601c.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-bf747ebfcd7e601c.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-bf747ebfcd7e601c.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-bf747ebfcd7e601c.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-bf747ebfcd7e601c.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-bf747ebfcd7e601c.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-bf747ebfcd7e601c.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-bf747ebfcd7e601c.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/models/route-bf747ebfcd7e601c.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/models/test/route-bf747ebfcd7e601c.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-bf747ebfcd7e601c.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-bf747ebfcd7e601c.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-bf747ebfcd7e601c.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-bf747ebfcd7e601c.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-bf747ebfcd7e601c.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-bf747ebfcd7e601c.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/oauth/freebuff/import/route-bf747ebfcd7e601c.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-bf747ebfcd7e601c.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-bf747ebfcd7e601c.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-bf747ebfcd7e601c.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-bf747ebfcd7e601c.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-bf747ebfcd7e601c.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-bf747ebfcd7e601c.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-bf747ebfcd7e601c.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-bf747ebfcd7e601c.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-bf747ebfcd7e601c.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-bf747ebfcd7e601c.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-bf747ebfcd7e601c.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-bf747ebfcd7e601c.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-bf747ebfcd7e601c.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/oauth/zcode/import/route-bf747ebfcd7e601c.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-bf747ebfcd7e601c.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-bf747ebfcd7e601c.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/pricing/route-bf747ebfcd7e601c.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-bf747ebfcd7e601c.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-bf747ebfcd7e601c.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-bf747ebfcd7e601c.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-bf747ebfcd7e601c.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/felo-profile/route-bf747ebfcd7e601c.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-bf747ebfcd7e601c.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-bf747ebfcd7e601c.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-bf747ebfcd7e601c.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-bf747ebfcd7e601c.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-bf747ebfcd7e601c.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-bf747ebfcd7e601c.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-bf747ebfcd7e601c.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-bf747ebfcd7e601c.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-bf747ebfcd7e601c.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-bf747ebfcd7e601c.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-bf747ebfcd7e601c.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-bf747ebfcd7e601c.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zai-profile/route-bf747ebfcd7e601c.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-bf747ebfcd7e601c.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/providers/capture/launch/route-bf747ebfcd7e601c.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/providers/capture/route-bf747ebfcd7e601c.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-bf747ebfcd7e601c.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/launch/route-bf747ebfcd7e601c.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/route-bf747ebfcd7e601c.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-bf747ebfcd7e601c.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/providers/route-bf747ebfcd7e601c.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-bf747ebfcd7e601c.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-bf747ebfcd7e601c.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-bf747ebfcd7e601c.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-bf747ebfcd7e601c.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-bf747ebfcd7e601c.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-bf747ebfcd7e601c.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-bf747ebfcd7e601c.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-bf747ebfcd7e601c.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-bf747ebfcd7e601c.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-bf747ebfcd7e601c.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-bf747ebfcd7e601c.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-bf747ebfcd7e601c.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-bf747ebfcd7e601c.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-bf747ebfcd7e601c.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/settings/route-bf747ebfcd7e601c.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-bf747ebfcd7e601c.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/smart-routing/active/route-bf747ebfcd7e601c.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/smart-routing/history/route-bf747ebfcd7e601c.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/smart-routing/lab/route-bf747ebfcd7e601c.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/smart-routing/stream/route-bf747ebfcd7e601c.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-bf747ebfcd7e601c.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-bf747ebfcd7e601c.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/tags/route-bf747ebfcd7e601c.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-bf747ebfcd7e601c.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-bf747ebfcd7e601c.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-bf747ebfcd7e601c.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-bf747ebfcd7e601c.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-bf747ebfcd7e601c.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-bf747ebfcd7e601c.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-bf747ebfcd7e601c.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-bf747ebfcd7e601c.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-bf747ebfcd7e601c.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-bf747ebfcd7e601c.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-bf747ebfcd7e601c.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-bf747ebfcd7e601c.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-bf747ebfcd7e601c.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-bf747ebfcd7e601c.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-bf747ebfcd7e601c.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-bf747ebfcd7e601c.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-bf747ebfcd7e601c.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-bf747ebfcd7e601c.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-bf747ebfcd7e601c.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-bf747ebfcd7e601c.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-bf747ebfcd7e601c.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-bf747ebfcd7e601c.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-bf747ebfcd7e601c.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-bf747ebfcd7e601c.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-bf747ebfcd7e601c.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-bf747ebfcd7e601c.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-bf747ebfcd7e601c.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-bf747ebfcd7e601c.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-bf747ebfcd7e601c.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-bf747ebfcd7e601c.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-bf747ebfcd7e601c.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-bf747ebfcd7e601c.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-bf747ebfcd7e601c.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-bf747ebfcd7e601c.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-bf747ebfcd7e601c.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-bf747ebfcd7e601c.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-bf747ebfcd7e601c.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-bf747ebfcd7e601c.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-bf747ebfcd7e601c.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-bf747ebfcd7e601c.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/v1/route-bf747ebfcd7e601c.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-bf747ebfcd7e601c.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-bf747ebfcd7e601c.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-bf747ebfcd7e601c.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-bf747ebfcd7e601c.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/version/route-bf747ebfcd7e601c.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-bf747ebfcd7e601c.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/version/update/route-bf747ebfcd7e601c.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/{page-bc142d42a8a549b4.js → page-baf12d16760e9b90.js} +1 -1
  810. package/app/.next-cli-build/static/chunks/app/{layout-0e3fdd66d189006c.js → layout-155acd4a482252b8.js} +1 -1
  811. package/app/.next-cli-build/static/chunks/app/login/{page-4b39978fc147efa3.js → page-089f2be5081e9c05.js} +1 -1
  812. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-bf747ebfcd7e601c.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/page-bf747ebfcd7e601c.js +1 -0
  814. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-bf747ebfcd7e601c.js +1 -0
  815. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-bf747ebfcd7e601c.js +1 -0
  816. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-bf747ebfcd7e601c.js +1 -0
  817. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-bf747ebfcd7e601c.js +1 -0
  818. package/app/.next-cli-build/static/css/8a8ea9ee79a01730.css +1 -0
  819. package/app/package.json +1 -1
  820. package/app/public/providers/ai21.png +0 -0
  821. package/app/public/providers/aimlapi.png +0 -0
  822. package/app/public/providers/ainative.png +0 -0
  823. package/app/public/providers/aion.png +0 -0
  824. package/app/public/providers/alibaba-cn.svg +1 -11
  825. package/app/public/providers/alibaba.svg +1 -11
  826. package/app/public/providers/alitp-intl.svg +1 -0
  827. package/app/public/providers/anyapi.png +0 -0
  828. package/app/public/providers/arcee-ai.png +0 -0
  829. package/app/public/providers/auriko.svg +61 -4
  830. package/app/public/providers/azure-ai.svg +23 -4
  831. package/app/public/providers/bai.png +0 -0
  832. package/app/public/providers/baseten.png +0 -0
  833. package/app/public/providers/blackbox-web.png +0 -0
  834. package/app/public/providers/bluesminds.png +0 -0
  835. package/app/public/providers/bytez.png +0 -0
  836. package/app/public/providers/charm-hyper.png +0 -0
  837. package/app/public/providers/chatanywhere.svg +1 -4
  838. package/app/public/providers/cheaperinference.png +0 -0
  839. package/app/public/providers/chenzk.png +0 -0
  840. package/app/public/providers/clarifai.svg +1 -4
  841. package/app/public/providers/cloudcode-one.svg +12 -3
  842. package/app/public/providers/conol-web.png +0 -0
  843. package/app/public/providers/crof.png +0 -0
  844. package/app/public/providers/datarobot.png +0 -0
  845. package/app/public/providers/digitalocean.svg +1 -4
  846. package/app/public/providers/dit.svg +9 -3
  847. package/app/public/providers/docker-model-runner.svg +1 -1
  848. package/app/public/providers/duckduckgo-web.svg +1 -7
  849. package/app/public/providers/dxnt.svg +9 -3
  850. package/app/public/providers/gemini-business.svg +1 -1
  851. package/app/public/providers/gitlab.svg +1 -0
  852. package/app/public/providers/hailuo-web.svg +1 -1
  853. package/app/public/providers/heroku.svg +15 -3
  854. package/app/public/providers/huggingchat.svg +1 -9
  855. package/app/public/providers/kimi-desktop.svg +1 -9
  856. package/app/public/providers/kimi-web.svg +1 -8
  857. package/app/public/providers/lm-studio.svg +1 -1
  858. package/app/public/providers/meta-llama.svg +1 -4
  859. package/app/public/providers/modal.svg +1 -4
  860. package/app/public/providers/modelscope.svg +1 -4
  861. package/app/public/providers/notion-web.svg +1 -1
  862. package/app/public/providers/oci.svg +19 -3
  863. package/app/public/providers/ollama-cloud.svg +1 -4
  864. package/app/public/providers/orcarouter.png +0 -0
  865. package/app/public/providers/ovhcloud.svg +1 -4
  866. package/app/public/providers/perplexity-agent.svg +1 -13
  867. package/app/public/providers/poe-web.svg +1 -8
  868. package/app/public/providers/qwen-cloud.svg +1 -1
  869. package/app/public/providers/qwen-web.svg +1 -6
  870. package/app/public/providers/qwencloud.svg +1 -6
  871. package/app/public/providers/sap.svg +1 -4
  872. package/app/public/providers/scaleway.svg +1 -4
  873. package/app/public/providers/snowflake.svg +1 -4
  874. package/app/public/providers/triton.svg +1 -1
  875. package/app/public/providers/vllm.svg +1 -1
  876. package/app/public/providers/wandb.svg +1 -4
  877. package/app/public/providers/watsonx.svg +50 -3
  878. package/app/public/providers/zai-web.svg +1 -7
  879. package/app/public/providers/zcode.png +0 -0
  880. package/app/src/lib/db/migrate.js +6 -3
  881. package/app/src/mitm/server.js +2 -2
  882. package/package.json +1 -1
  883. package/src/cli/menus/providers.js +6 -0
  884. package/app/.next-cli-build/server/chunks/3988.js +0 -1
  885. package/app/.next-cli-build/server/chunks/422.js +0 -9
  886. package/app/.next-cli-build/server/chunks/6306.js +0 -1
  887. package/app/.next-cli-build/server/chunks/874.js +0 -9
  888. package/app/.next-cli-build/server/chunks/9703.js +0 -14
  889. package/app/.next-cli-build/static/FP2YsqoRbzETOIHRfld7X/_buildManifest.js +0 -1
  890. package/app/.next-cli-build/static/chunks/1321-a387932dc3179f86.js +0 -1
  891. package/app/.next-cli-build/static/chunks/5497-c6d8b48c8828240a.js +0 -7
  892. package/app/.next-cli-build/static/chunks/705-42ad329bbe0c47df.js +0 -1
  893. package/app/.next-cli-build/static/chunks/9497-d27e455b90c7936e.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-a84afe4d66f3439a.js +0 -3
  895. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-9850fafcf9dd605b.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-9879594c5128cd91.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-d3be818ebce4ade2.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-5ef2d54550eda9da.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-d208597b457fee58.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-1f465a9d64823fe6.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-e249d28461673557.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-7ea08e0acef52ce3.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/_global-error/page-d93feb6893aee449.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-d93feb6893aee449.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-d93feb6893aee449.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-d93feb6893aee449.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-d93feb6893aee449.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-d93feb6893aee449.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-d93feb6893aee449.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-d93feb6893aee449.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-d93feb6893aee449.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/breaker/route-d93feb6893aee449.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/cache/route-d93feb6893aee449.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-d93feb6893aee449.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-d93feb6893aee449.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-d93feb6893aee449.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-d93feb6893aee449.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-d93feb6893aee449.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-d93feb6893aee449.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-d93feb6893aee449.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-d93feb6893aee449.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-d93feb6893aee449.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-d93feb6893aee449.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-d93feb6893aee449.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-d93feb6893aee449.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-d93feb6893aee449.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-d93feb6893aee449.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-d93feb6893aee449.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-d93feb6893aee449.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-d93feb6893aee449.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-d93feb6893aee449.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/combos/lab/route-d93feb6893aee449.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/combos/route-d93feb6893aee449.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/combos/simulate/route-d93feb6893aee449.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-d93feb6893aee449.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-d93feb6893aee449.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-d93feb6893aee449.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-d93feb6893aee449.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-d93feb6893aee449.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/health/overview/route-d93feb6893aee449.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-d93feb6893aee449.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/health/route-d93feb6893aee449.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-d93feb6893aee449.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/init/route-d93feb6893aee449.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-d93feb6893aee449.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/keys/route-d93feb6893aee449.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/locale/route-d93feb6893aee449.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-d93feb6893aee449.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-d93feb6893aee449.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-d93feb6893aee449.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-d93feb6893aee449.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-d93feb6893aee449.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-d93feb6893aee449.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-d93feb6893aee449.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-d93feb6893aee449.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-d93feb6893aee449.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-d93feb6893aee449.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-d93feb6893aee449.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/models/route-d93feb6893aee449.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/models/test/route-d93feb6893aee449.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-d93feb6893aee449.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-d93feb6893aee449.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-d93feb6893aee449.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-d93feb6893aee449.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-d93feb6893aee449.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-d93feb6893aee449.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/oauth/freebuff/import/route-d93feb6893aee449.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-d93feb6893aee449.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-d93feb6893aee449.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-d93feb6893aee449.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-d93feb6893aee449.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-d93feb6893aee449.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-d93feb6893aee449.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-d93feb6893aee449.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-d93feb6893aee449.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-d93feb6893aee449.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-d93feb6893aee449.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-d93feb6893aee449.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-d93feb6893aee449.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-d93feb6893aee449.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-d93feb6893aee449.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-d93feb6893aee449.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/pricing/route-d93feb6893aee449.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-d93feb6893aee449.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-d93feb6893aee449.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-d93feb6893aee449.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-d93feb6893aee449.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/felo-profile/route-d93feb6893aee449.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-d93feb6893aee449.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-d93feb6893aee449.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-d93feb6893aee449.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-d93feb6893aee449.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-d93feb6893aee449.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-d93feb6893aee449.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-d93feb6893aee449.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-d93feb6893aee449.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-d93feb6893aee449.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-d93feb6893aee449.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-d93feb6893aee449.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-d93feb6893aee449.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zai-profile/route-d93feb6893aee449.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-d93feb6893aee449.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/providers/capture/launch/route-d93feb6893aee449.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/providers/capture/route-d93feb6893aee449.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-d93feb6893aee449.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/launch/route-d93feb6893aee449.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/route-d93feb6893aee449.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-d93feb6893aee449.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/providers/route-d93feb6893aee449.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-d93feb6893aee449.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-d93feb6893aee449.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-d93feb6893aee449.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-d93feb6893aee449.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-d93feb6893aee449.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-d93feb6893aee449.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-d93feb6893aee449.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-d93feb6893aee449.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-d93feb6893aee449.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-d93feb6893aee449.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-d93feb6893aee449.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-d93feb6893aee449.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-d93feb6893aee449.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-d93feb6893aee449.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/settings/route-d93feb6893aee449.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-d93feb6893aee449.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/smart-routing/active/route-d93feb6893aee449.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/smart-routing/history/route-d93feb6893aee449.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/smart-routing/lab/route-d93feb6893aee449.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/smart-routing/stream/route-d93feb6893aee449.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-d93feb6893aee449.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-d93feb6893aee449.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/tags/route-d93feb6893aee449.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-d93feb6893aee449.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-d93feb6893aee449.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-d93feb6893aee449.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-d93feb6893aee449.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-d93feb6893aee449.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-d93feb6893aee449.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-d93feb6893aee449.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-d93feb6893aee449.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-d93feb6893aee449.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-d93feb6893aee449.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-d93feb6893aee449.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-d93feb6893aee449.js +0 -1
  1045. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-d93feb6893aee449.js +0 -1
  1046. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-d93feb6893aee449.js +0 -1
  1047. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-d93feb6893aee449.js +0 -1
  1048. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-d93feb6893aee449.js +0 -1
  1049. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-d93feb6893aee449.js +0 -1
  1050. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-d93feb6893aee449.js +0 -1
  1051. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-d93feb6893aee449.js +0 -1
  1052. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-d93feb6893aee449.js +0 -1
  1053. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-d93feb6893aee449.js +0 -1
  1054. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-d93feb6893aee449.js +0 -1
  1055. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-d93feb6893aee449.js +0 -1
  1056. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-d93feb6893aee449.js +0 -1
  1057. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-d93feb6893aee449.js +0 -1
  1058. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-d93feb6893aee449.js +0 -1
  1059. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-d93feb6893aee449.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-d93feb6893aee449.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-d93feb6893aee449.js +0 -1
  1062. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-d93feb6893aee449.js +0 -1
  1063. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-d93feb6893aee449.js +0 -1
  1064. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-d93feb6893aee449.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-d93feb6893aee449.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-d93feb6893aee449.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-d93feb6893aee449.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-d93feb6893aee449.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-d93feb6893aee449.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-d93feb6893aee449.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-d93feb6893aee449.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-d93feb6893aee449.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/v1/route-d93feb6893aee449.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-d93feb6893aee449.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-d93feb6893aee449.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-d93feb6893aee449.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-d93feb6893aee449.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/version/route-d93feb6893aee449.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-d93feb6893aee449.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/version/update/route-d93feb6893aee449.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-d93feb6893aee449.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/page-d93feb6893aee449.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-d93feb6893aee449.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-d93feb6893aee449.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-d93feb6893aee449.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-d93feb6893aee449.js +0 -1
  1087. package/app/.next-cli-build/static/css/d30ee18d498368cc.css +0 -1
  1088. package/app/public/providers/ai21.svg +0 -4
  1089. package/app/public/providers/aimlapi.svg +0 -4
  1090. package/app/public/providers/ainative.svg +0 -4
  1091. package/app/public/providers/aion.svg +0 -4
  1092. package/app/public/providers/anyapi.svg +0 -4
  1093. package/app/public/providers/arcee-ai.svg +0 -4
  1094. package/app/public/providers/bai.svg +0 -4
  1095. package/app/public/providers/baseten.svg +0 -4
  1096. package/app/public/providers/blackbox-web.svg +0 -6
  1097. package/app/public/providers/bluesminds.svg +0 -4
  1098. package/app/public/providers/bytez.svg +0 -4
  1099. package/app/public/providers/charm-hyper.svg +0 -4
  1100. package/app/public/providers/cheaperinference.svg +0 -4
  1101. package/app/public/providers/chenzk.svg +0 -4
  1102. package/app/public/providers/conol-web.svg +0 -1
  1103. package/app/public/providers/crof.svg +0 -4
  1104. package/app/public/providers/datarobot.svg +0 -4
  1105. package/app/public/providers/orcarouter.svg +0 -4
  1106. /package/app/.next-cli-build/static/{FP2YsqoRbzETOIHRfld7X → BmLJ5bmQbpsF-jvZIwr9t}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},90155:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>en});var a=s(95155),l=s(12115),i=s(73321),n=s(98500),r=s.n(n),o=s(35497),d=s(88105),c=s(28777),m=s(11059),x=s(25171),p=s(73006);let u=new Map;async function h(e,t={}){if(!e?.url||!e?.type)return[];let s=t.connectionId?`${e.url}::${t.connectionId}`:e.url,a=u.get(s);if(a&&Date.now()<a.expiresAt)return a.data;try{let a=new URLSearchParams({url:e.url,type:e.type});t.connectionId&&a.set("connectionId",t.connectionId);let l=await fetch(`/api/providers/suggested-models?${a}`);if(!l.ok)return[];let i=(await l.json()).data??[];return u.set(s,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}var f=s(8247),g=s(14051),b=s.n(g),y=s(22269);let v=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},90155:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>en});var a=s(95155),l=s(12115),i=s(73321),n=s(98500),r=s.n(n),o=s(35497),d=s(88105),c=s(28777),m=s(11059),x=s(2106),p=s(73006);let u=new Map;async function h(e,t={}){if(!e?.url||!e?.type)return[];let s=t.connectionId?`${e.url}::${t.connectionId}`:e.url,a=u.get(s);if(a&&Date.now()<a.expiresAt)return a.data;try{let a=new URLSearchParams({url:e.url,type:e.type});t.connectionId&&a.set("connectionId",t.connectionId);let l=await fetch(`/api/providers/suggested-models?${a}`);if(!l.ok)return[];let i=(await l.json()).data??[];return u.set(s,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}var f=s(8247),g=s(14051),b=s.n(g),y=s(22269);let v=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function j({isOpen:e,provider:t,providerName:s,isCompatible:i,isAnthropic:n,authType:r,authHint:c,website:m,proxyPools:x,error:p,onSave:u,onBulkDone:h,onClose:f}){let g="__none__",b="ollama-local"===t,N="cookie"===r,w="xai"===t&&!N,k="tokenrouter"===t,C=N?"Cookie Value":"API Key",S=N?"grok-web"===t?"sso=xxxxx... or just the raw value":"zai-web"===t?'Paste the "token" value from chat.z.ai Local Storage (DevTools → Application → Local Storage → chat.z.ai)':"eyJhbGciOi...":w?"xai-...":"",A="azure"===t,$="cloudflare-ai"===t,T=d.Q2?.[t]?.regions||null,E=d.Q2?.[t]?.defaultRegion||T?.[0]?.id||"",[I,P]=(0,l.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:""}),[O,z]=(0,l.useState)(""),[M,D]=(0,l.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[_,R]=(0,l.useState)({accountId:""}),[U,L]=(0,l.useState)(E),[q,K]=(0,l.useState)(!1),[F,J]=(0,l.useState)(null),[B,W]=(0,l.useState)(!1),[G,H]=(0,l.useState)("single"),[Q,V]=(0,l.useState)(""),[Z,X]=(0,l.useState)(null),Y=()=>b&&I.ollamaHostUrl.trim()?{baseUrl:I.ollamaHostUrl.trim()}:A?{azureEndpoint:M.azureEndpoint,apiVersion:M.apiVersion,deployment:M.deployment,organization:M.organization}:$?{accountId:_.accountId}:k&&O.trim()?{mgmtKey:O.trim()}:T&&U?{region:U}:void 0,ee=async()=>{K(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:I.apiKey,providerSpecificData:Y()})}),s=await e.json();J(s.valid?"success":"failed")}catch{J("failed")}finally{K(!1)}},et=async()=>{if(t&&(b||I.apiKey)&&(b||I.name)&&(!i||I.defaultModel.trim())){W(!0);try{let e=!1;try{K(!0),J(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:I.apiKey,providerSpecificData:Y()})});e=!!(await s.json()).valid,J(e?"success":"failed")}catch{J("failed")}finally{K(!1)}await u({name:I.name||(b?"Ollama Local":""),apiKey:I.apiKey,defaultModel:i?I.defaultModel.trim():void 0,priority:I.priority,proxyPoolId:I.proxyPoolId===g?null:I.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Y()})}finally{W(!1)}}},es=async()=>{let e=Q.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;W(!0),X(null);let s=0,a=0;for(let l=0;l<e.length;l++){let i=e[l].split("|"),n=i.length>=2?i.slice(1).join("|").trim():i[0].trim(),r=i.length>=2?i[0].trim():"Key",o=`${r} ${l+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:n,name:o,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}W(!1),X({success:s,failed:a}),s>0&&h&&h()};return t?(0,a.jsx)(o.aF,{isOpen:e,title:`Add ${s||t} ${C}`,onClose:f,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{size:"sm",variant:"single"===G?"primary":"ghost",onClick:()=>{H("single"),X(null)},children:"Single"}),(0,a.jsx)(o.$n,{size:"sm",variant:"bulk"===G?"primary":"ghost",onClick:()=>{H("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===G&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:v,value:Q,onChange:e=>V(e.target.value)}),Z&&(0,a.jsxs)("div",{className:`text-sm font-medium ${Z.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",Z.success," added",Z.failed>0?`, ✗ ${Z.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:es,fullWidth:!0,disabled:B||!Q.trim(),children:B?"Adding...":"Add All Keys"}),(0,a.jsx)(o.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===G&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.pd,{label:"Name",value:I.name,onChange:e=>P({...I,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.pd,{label:"Ollama Host URL",value:I.ollamaHostUrl,onChange:e=>P({...I,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(o.$n,{onClick:ee,disabled:q||B,variant:"secondary",children:q?"Checking...":"Check"})})]}),!b&&(0,a.jsxs)("div",{className:"flex gap-2",children:[N?(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-text-muted",children:C}),(0,a.jsx)("textarea",{value:I.apiKey,onChange:e=>P({...I,apiKey:e.target.value}),placeholder:S,rows:5,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",className:"w-full rounded-lg border border-border bg-input px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary font-mono resize-y"})]}):(0,a.jsx)(o.pd,{label:C,type:"password",value:I.apiKey,onChange:e=>P({...I,apiKey:e.target.value}),placeholder:S,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(o.$n,{onClick:ee,disabled:!I.apiKey||q||B,variant:"secondary",children:q?"Checking...":"Check"})})]}),w&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),"felo-web"===t?(0,a.jsx)(o.v$,{onCaptured:e=>P(t=>({...t,apiKey:e}))}):y.S[t]?(0,a.jsx)(o.HU,{provider:t,label:y.S[t].label,onCaptured:e=>P(t=>({...t,apiKey:e}))}):null,N&&c&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[c,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),T&&(0,a.jsx)(o.l6,{label:"Region",value:U,onChange:e=>L(e.target.value),options:T.map(e=>({value:e.id,label:e.label}))}),i&&(0,a.jsx)(o.pd,{label:"Default Model",value:I.defaultModel,onChange:e=>P({...I,defaultModel:e.target.value}),placeholder:n?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),F&&(0,a.jsx)(o.Ex,{variant:"success"===F?"success":"error",children:"success"===F?"Valid":"Invalid"}),p&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:p}),i&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),k&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"TokenRouter Management Key (optional)"}),(0,a.jsx)(o.pd,{label:"Management Key",type:"password",value:O,onChange:e=>z(e.target.value),placeholder:"your_management_key..."}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"The management key is separate from the chat API key (sk-...) and is required for Quota Tracker to read your wallet balance. Without it, chat still works but quota tracking is disabled. Get it from the TokenRouter dashboard."})]}),$&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(o.pd,{label:"Account ID",value:_.accountId,onChange:e=>R({..._,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),A&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(o.pd,{label:"Azure Endpoint",value:M.azureEndpoint,onChange:e=>D({...M,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(o.pd,{label:"Deployment Name",value:M.deployment,onChange:e=>D({...M,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(o.pd,{label:"API Version",value:M.apiVersion,onChange:e=>D({...M,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(o.pd,{label:"Organization",value:M.organization,onChange:e=>D({...M,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(o.pd,{label:"Priority",type:"number",value:I.priority,onChange:e=>P({...I,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(o.l6,{label:"Proxy Pool",value:I.proxyPoolId,onChange:e=>P({...I,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(x||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(x||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:et,fullWidth:!0,disabled:B||!b&&(!I.name||!I.apiKey)||i&&!I.defaultModel.trim()||A&&(!M.azureEndpoint||!M.deployment||!M.organization)||$&&!_.accountId,children:B?"Saving...":"Save"}),(0,a.jsx)(o.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function N({isOpen:e,node:t,onSave:s,onClose:i,isAnthropic:n}){let[r,d]=(0,l.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,l.useState)(!1),[x,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&d({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,n]);let v=async()=>{if(r.name.trim()&&r.prefix.trim()&&r.baseUrl.trim()){m(!0);try{let e={name:r.name,prefix:r.prefix,baseUrl:r.baseUrl};n||(e.apiType=r.apiType),await s(e)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:r.baseUrl,apiKey:x,type:n?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{g(!1)}};return t?(0,a.jsx)(o.aF,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:i,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(o.pd,{label:"Name",value:r.name,onChange:e=>d({...r,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(o.pd,{label:"Prefix",value:r.prefix,onChange:e=>d({...r,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,a.jsx)(o.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:r.apiType,onChange:e=>d({...r,apiType:e.target.value})}),(0,a.jsx)(o.pd,{label:"Base URL",value:r.baseUrl,onChange:e=>d({...r,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>p(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(o.$n,{onClick:j,disabled:!x||f||!r.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.jsx)(o.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),b&&(0,a.jsx)(o.Ex,{variant:"success"===b?"success":"error",children:"success"===b?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:v,fullWidth:!0,disabled:!r.name.trim()||!r.prefix.trim()||!r.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(o.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:i,onClose:n}){let[r,d]=(0,l.useState)(""),[c,m]=(0,l.useState)(null),[x,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{e&&(d(""),m(null),p(""))},[e]);let f=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},g=async()=>{let e=f(r.trim());if(e){m("testing"),p("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),p(a.error||"")}catch(e){m("error"),p(e.message)}}},b=async()=>{let e=f(r.trim());if(e&&!u){h(!0);try{await i(e)}finally{h(!1)}}};return(0,a.jsx)(o.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:r,onChange:e=>{d(e.target.value),m(null),p("")},onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(o.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:g,disabled:!r.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(r.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:x||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(o.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(o.$n,{onClick:b,fullWidth:!0,size:"sm",disabled:!r.trim()||u,children:u?"Adding...":"Add Model"})]})]})})}j.propTypes={isOpen:b().bool.isRequired,provider:b().string,providerName:b().string,isCompatible:b().bool,isAnthropic:b().bool,authType:b().string,authHint:b().string,website:b().string,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string})),error:b().string,onSave:b().func.isRequired,onBulkDone:b().func,onClose:b().func.isRequired},N.propTypes={isOpen:b().bool.isRequired,node:b().shape({id:b().string,name:b().string,prefix:b().string,apiType:b().string,baseUrl:b().string}),onSave:b().func.isRequired,onClose:b().func.isRequired,isAnthropic:b().bool},w.propTypes={isOpen:b().bool.isRequired,providerAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,onSave:b().func.isRequired,onClose:b().func.isRequired};let k=`[
3
+ sk-key-only-auto-named`;function j({isOpen:e,provider:t,providerName:s,isCompatible:i,isAnthropic:n,authType:r,authHint:c,website:m,proxyPools:x,error:p,onSave:u,onBulkDone:h,onClose:f}){let g="__none__",b="ollama-local"===t,N="cookie"===r,w="xai"===t&&!N,k="tokenrouter"===t,C=N?"Cookie Value":"API Key",S=N?"grok-web"===t?"sso=xxxxx... or just the raw value":"zai-web"===t?'Paste the "token" value from chat.z.ai Local Storage (DevTools → Application → Local Storage → chat.z.ai)':"eyJhbGciOi...":w?"xai-...":"",A="azure"===t,$="cloudflare-ai"===t,T=d.Q2?.[t]?.regions||null,E=d.Q2?.[t]?.defaultRegion||T?.[0]?.id||"",[I,P]=(0,l.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:""}),[O,z]=(0,l.useState)(""),[M,D]=(0,l.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[_,R]=(0,l.useState)({accountId:""}),[U,L]=(0,l.useState)(E),[K,q]=(0,l.useState)(!1),[F,J]=(0,l.useState)(null),[B,W]=(0,l.useState)(!1),[G,H]=(0,l.useState)("single"),[Q,V]=(0,l.useState)(""),[Z,X]=(0,l.useState)(null),Y=()=>b&&I.ollamaHostUrl.trim()?{baseUrl:I.ollamaHostUrl.trim()}:A?{azureEndpoint:M.azureEndpoint,apiVersion:M.apiVersion,deployment:M.deployment,organization:M.organization}:$?{accountId:_.accountId}:(k||w)&&O.trim()?{mgmtKey:O.trim()}:T&&U?{region:U}:void 0,ee=async()=>{q(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:I.apiKey,providerSpecificData:Y()})}),s=await e.json();J(s.valid?"success":"failed")}catch{J("failed")}finally{q(!1)}},et=async()=>{if(t&&(b||I.apiKey)&&(b||I.name)&&(!i||I.defaultModel.trim())){W(!0);try{let e=!1;try{q(!0),J(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:I.apiKey,providerSpecificData:Y()})});e=!!(await s.json()).valid,J(e?"success":"failed")}catch{J("failed")}finally{q(!1)}await u({name:I.name||(b?"Ollama Local":""),apiKey:I.apiKey,defaultModel:i?I.defaultModel.trim():void 0,priority:I.priority,proxyPoolId:I.proxyPoolId===g?null:I.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Y()})}finally{W(!1)}}},es=async()=>{let e=Q.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;W(!0),X(null);let s=0,a=0;for(let l=0;l<e.length;l++){let i=e[l].split("|"),n=i.length>=2?i.slice(1).join("|").trim():i[0].trim(),r=i.length>=2?i[0].trim():"Key",o=`${r} ${l+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:n,name:o,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}W(!1),X({success:s,failed:a}),s>0&&h&&h()};return t?(0,a.jsx)(o.aF,{isOpen:e,title:`Add ${s||t} ${C}`,onClose:f,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{size:"sm",variant:"single"===G?"primary":"ghost",onClick:()=>{H("single"),X(null)},children:"Single"}),(0,a.jsx)(o.$n,{size:"sm",variant:"bulk"===G?"primary":"ghost",onClick:()=>{H("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===G&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:v,value:Q,onChange:e=>V(e.target.value)}),Z&&(0,a.jsxs)("div",{className:`text-sm font-medium ${Z.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",Z.success," added",Z.failed>0?`, ✗ ${Z.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:es,fullWidth:!0,disabled:B||!Q.trim(),children:B?"Adding...":"Add All Keys"}),(0,a.jsx)(o.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===G&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.pd,{label:"Name",value:I.name,onChange:e=>P({...I,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.pd,{label:"Ollama Host URL",value:I.ollamaHostUrl,onChange:e=>P({...I,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(o.$n,{onClick:ee,disabled:K||B,variant:"secondary",children:K?"Checking...":"Check"})})]}),!b&&(0,a.jsxs)("div",{className:"flex gap-2",children:[N?(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-text-muted",children:C}),(0,a.jsx)("textarea",{value:I.apiKey,onChange:e=>P({...I,apiKey:e.target.value}),placeholder:S,rows:5,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",className:"w-full rounded-lg border border-border bg-input px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary font-mono resize-y"})]}):(0,a.jsx)(o.pd,{label:C,type:"password",value:I.apiKey,onChange:e=>P({...I,apiKey:e.target.value}),placeholder:S,className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(o.$n,{onClick:ee,disabled:!I.apiKey||K||B,variant:"secondary",children:K?"Checking...":"Check"})})]}),w&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),"felo-web"===t?(0,a.jsx)(o.v$,{onCaptured:e=>P(t=>({...t,apiKey:e}))}):y.S[t]?(0,a.jsx)(o.HU,{provider:t,label:y.S[t].label,onCaptured:e=>P(t=>({...t,apiKey:e}))}):null,N&&c&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[c,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),T&&(0,a.jsx)(o.l6,{label:"Region",value:U,onChange:e=>L(e.target.value),options:T.map(e=>({value:e.id,label:e.label}))}),i&&(0,a.jsx)(o.pd,{label:"Default Model",value:I.defaultModel,onChange:e=>P({...I,defaultModel:e.target.value}),placeholder:n?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),F&&(0,a.jsx)(o.Ex,{variant:"success"===F?"success":"error",children:"success"===F?"Valid":"Invalid"}),p&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:p}),i&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),k&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"TokenRouter Management Key (optional)"}),(0,a.jsx)(o.pd,{label:"Management Key",type:"password",value:O,onChange:e=>z(e.target.value),placeholder:"your_management_key..."}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"The management key is separate from the chat API key (sk-...) and is required for Quota Tracker to read your wallet balance. Without it, chat still works but quota tracking is disabled. Get it from the TokenRouter dashboard."})]}),w&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"xAI Management Key (optional)"}),(0,a.jsx)(o.pd,{label:"Management Key",type:"password",value:O,onChange:e=>z(e.target.value),placeholder:"xai-mgmt-..."}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-2",children:"Optional. Separate from the chat API key (xai-...). Used by Quota Tracker to probe the xAI Management API when available. Without it, Quota Tracker still shows local gateway spend for this connection. Create one at console.x.ai → Settings → Management Keys."})]}),$&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(o.pd,{label:"Account ID",value:_.accountId,onChange:e=>R({..._,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),A&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(o.pd,{label:"Azure Endpoint",value:M.azureEndpoint,onChange:e=>D({...M,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(o.pd,{label:"Deployment Name",value:M.deployment,onChange:e=>D({...M,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(o.pd,{label:"API Version",value:M.apiVersion,onChange:e=>D({...M,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(o.pd,{label:"Organization",value:M.organization,onChange:e=>D({...M,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(o.pd,{label:"Priority",type:"number",value:I.priority,onChange:e=>P({...I,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(o.l6,{label:"Proxy Pool",value:I.proxyPoolId,onChange:e=>P({...I,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(x||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(x||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:et,fullWidth:!0,disabled:B||!b&&(!I.name||!I.apiKey)||i&&!I.defaultModel.trim()||A&&(!M.azureEndpoint||!M.deployment||!M.organization)||$&&!_.accountId,children:B?"Saving...":"Save"}),(0,a.jsx)(o.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function N({isOpen:e,node:t,onSave:s,onClose:i,isAnthropic:n}){let[r,d]=(0,l.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,l.useState)(!1),[x,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(null);(0,l.useEffect)(()=>{t&&d({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,n]);let v=async()=>{if(r.name.trim()&&r.prefix.trim()&&r.baseUrl.trim()){m(!0);try{let e={name:r.name,prefix:r.prefix,baseUrl:r.baseUrl};n||(e.apiType=r.apiType),await s(e)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:r.baseUrl,apiKey:x,type:n?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{g(!1)}};return t?(0,a.jsx)(o.aF,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:i,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(o.pd,{label:"Name",value:r.name,onChange:e=>d({...r,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(o.pd,{label:"Prefix",value:r.prefix,onChange:e=>d({...r,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,a.jsx)(o.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:r.apiType,onChange:e=>d({...r,apiType:e.target.value})}),(0,a.jsx)(o.pd,{label:"Base URL",value:r.baseUrl,onChange:e=>d({...r,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>p(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(o.$n,{onClick:j,disabled:!x||f||!r.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.jsx)(o.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),b&&(0,a.jsx)(o.Ex,{variant:"success"===b?"success":"error",children:"success"===b?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:v,fullWidth:!0,disabled:!r.name.trim()||!r.prefix.trim()||!r.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(o.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:i,onClose:n}){let[r,d]=(0,l.useState)(""),[c,m]=(0,l.useState)(null),[x,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{e&&(d(""),m(null),p(""))},[e]);let f=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},g=async()=>{let e=f(r.trim());if(e){m("testing"),p("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),p(a.error||"")}catch(e){m("error"),p(e.message)}}},b=async()=>{let e=f(r.trim());if(e&&!u){h(!0);try{await i(e)}finally{h(!1)}}};return(0,a.jsx)(o.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:r,onChange:e=>{d(e.target.value),m(null),p("")},onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(o.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:g,disabled:!r.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(r.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:x||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(o.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(o.$n,{onClick:b,fullWidth:!0,size:"sm",disabled:!r.trim()||u,children:u?"Adding...":"Add Model"})]})]})})}j.propTypes={isOpen:b().bool.isRequired,provider:b().string,providerName:b().string,isCompatible:b().bool,isAnthropic:b().bool,authType:b().string,authHint:b().string,website:b().string,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string})),error:b().string,onSave:b().func.isRequired,onBulkDone:b().func,onClose:b().func.isRequired},N.propTypes={isOpen:b().bool.isRequired,node:b().shape({id:b().string,name:b().string,prefix:b().string,apiType:b().string,baseUrl:b().string}),onSave:b().func.isRequired,onClose:b().func.isRequired,isAnthropic:b().bool},w.propTypes={isOpen:b().bool.isRequired,providerAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,onSave:b().func.isRequired,onClose:b().func.isRequired};let k=`[
4
4
  {
5
5
  "accessToken": "eyJhbGc...",
6
6
  "refreshToken": "rt_...",
7
7
  "idToken": "eyJhbGc...",
8
8
  "email": "user@example.com"
9
9
  }
10
- ]`;function C({isOpen:e,onClose:t,onSuccess:s}){let[i,n]=(0,l.useState)(""),[r,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),h=()=>{r||(n(""),m(""),u(null),t())},f=async()=>{var e;let t;m(""),u(null);let a=i.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,p.Tl)("Invalid JSON")}: ${e.message}`);return}let l=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!l||0===l.length)return void m((0,p.Tl)("No accounts found in input"));d(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:l})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,p.Tl)("Request failed"))}finally{d(!1)}},g=x?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(o.aF,{isOpen:e,title:(0,p.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,p.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.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:k,value:i,onChange:e=>n(e.target.value),disabled:r}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),x&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${x.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",x.success," ",(0,p.Tl)("added"),x.failed>0?`, ✗ ${x.failed} ${(0,p.Tl)("failed")}`:""]}),g.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:f,fullWidth:!0,disabled:r||!i.trim(),children:r?(0,p.Tl)("Importing..."):(0,p.Tl)("Import All")}),(0,a.jsx)(o.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:r,children:(0,p.Tl)("Close")})]})]})})}function S({providerId:e,hours:t=24}){let[s,i]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e)return;let s=!1,a=async()=>{try{let a=await fetch(`/api/providers/${e}/health-timeline?hours=${t}`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();s||i(l.timeline||[])}catch{}};a();let l=setInterval(a,6e4),n=()=>{document.hidden?clearInterval(l):(clearInterval(l),a(),l=setInterval(a,6e4))};return document.addEventListener("visibilitychange",n),()=>{s=!0,clearInterval(l),document.removeEventListener("visibilitychange",n)}},[e,t]),!s)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] animate-pulse",children:"monitor_heart"}),"Loading health timeline..."]});if(0===s.length||s.every(e=>0===e.ok&&0===e.err))return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"monitor_heart"}),"No request history yet."]});let n=s.length,r=s.reduce((e,t)=>e+t.ok+t.err,0),o=s.reduce((e,t)=>e+t.err,0),d=Math.max(...s.map(e=>e.ok+e.err),1),c=Math.max(...s.map(e=>e.latency),1),m=Math.max(6*n,120),x=Math.max(m/n-1,2),p=s.filter(e=>e.latency>0).map((e,t)=>{let s=t/Math.max(n-1,1)*m,a=32-e.latency/c*19.2-2;return`${s.toFixed(1)},${a.toFixed(1)}`}),u=p.length>1?`M${p.join(" L")}`:"",h=r>0?Math.round((r-o)/r*100):null;return(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted",children:"Health (24h)"}),null!==h&&(0,a.jsxs)("span",{className:`text-[10px] font-bold ${h>=90?"text-success":h>=70?"text-warning":"text-danger"}`,children:[h,"% success \xb7 ",r," requests \xb7 ",o," errors"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block size-2 rounded-sm bg-success"})," OK"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block size-2 rounded-sm bg-danger"})," Error"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block h-0.5 w-3 bg-info"})," Latency"]})]})]}),(0,a.jsxs)("svg",{width:m,height:32,className:"overflow-visible",children:[s.map((e,t)=>{let s=m/n*t;if(0===e.ok+e.err)return null;let l=e.ok/d*32,i=e.err/d*32;return(0,a.jsxs)("g",{children:[(0,a.jsx)("rect",{x:s,y:32-l-i,width:x,height:i,rx:.5,className:"fill-danger/60"}),(0,a.jsx)("rect",{x:s,y:32-l,width:x,height:l,rx:.5,className:"fill-success/60"})]},t)}),u&&(0,a.jsx)("path",{d:u,fill:"none",strokeWidth:1,className:"stroke-info",strokeDasharray:"2 2"})]})]})}C.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func};var A=s(67098),$=s(5772);function T({providerInfo:e,providerId:t,connections:s,modelCount:l,headerIconPath:i,headerImgError:n,setHeaderImgError:o}){let d=e.notice?.apiKeyUrl||e.notice?.signupUrl||e.website,c=[e.authModes?e.authModes.includes("oauth")&&e.authModes.includes("apikey")?"OAuth + API Key":"oauth"===e.authModes[0]?"OAuth":"cookie"===e.authModes[0]?"Cookie":"API Key":"oauth"===e.authType?"OAuth":"cookie"===e.authType?"Cookie":"API Key"];s.length>0&&c.push(`${s.length} connection${1===s.length?"":"s"}`),l>0&&c.push(`${l} model${1===l?"":"s"}`);let m=e.color||"#6366f1";return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"mt-4 flex min-w-0 items-center gap-4",children:[(0,a.jsx)("div",{className:"flex size-14 shrink-0 items-center justify-center rounded-xl",style:{backgroundColor:`${m}15`},children:n?(0,a.jsx)("span",{className:"text-base font-bold",style:{color:m},children:e.textIcon||e.id?.slice(0,2).toUpperCase()}):(0,a.jsx)($.default,{src:i,alt:e.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>o(!0)})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight text-text-main",children:e.name}),d&&(0,a.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e.notice?.apiKeyUrl?"Get API Key":"Sign up"]}),"moonshot"===t&&(0,a.jsxs)("a",{href:"https://www.kimi.com/activities/viral-referral/share?scenario=invite&from=share_poster&invitation_code=BPGXZR",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-full bg-primary/12 px-3 py-1 text-xs font-semibold text-primary ring-1 ring-primary/20 transition-colors hover:bg-primary/20",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"celebration"}),"Get KIMI K3 For Free"]})]}),(0,a.jsx)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-text-muted",children:c.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[t>0&&(0,a.jsx)("span",{className:"text-text-muted/40",children:"\xb7"}),e]},t))})]})]}),e.deprecated&&(0,a.jsxs)("div",{className:"mt-4 flex items-start gap-2 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mt-0.5 shrink-0 text-[16px] text-yellow-500",children:"warning"}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-red-600 dark:text-yellow-400",children:e.deprecationNotice})]}),e.notice?.text&&!e.deprecated&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2 rounded-lg border border-info/30 bg-info/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[16px] text-info",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-info",children:e.notice.text}),e.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e.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 →"})]})]})}var E=s(31474);function I({title:e,icon:t,count:s,defaultExpanded:i=!0,actions:n=null,children:r,className:o}){let[d,c]=(0,l.useState)(i);return(0,a.jsxs)("div",{className:(0,E.cn)("overflow-hidden rounded-panel border border-border-subtle bg-panel shadow-[var(--shadow-soft)]",o),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-4 py-3",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),className:"flex min-w-0 items-center gap-2 text-left","aria-expanded":d,children:[t&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted",children:t}),(0,a.jsx)("h2",{className:"truncate text-sm font-semibold text-text-main",children:e}),null!=s&&(0,a.jsx)("span",{className:"shrink-0 rounded-full bg-black/5 px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-text-muted dark:bg-white/10",children:s}),(0,a.jsx)("span",{className:(0,E.cn)("material-symbols-outlined text-[18px] text-text-muted transition-transform",d&&"rotate-180"),children:"expand_more"})]}),n&&(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:n})]}),d&&(0,a.jsx)("div",{className:"border-t border-border-subtle",children:r})]})}var P=s(70217);function O({until:e}){let[t,s]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function z({connection:e,proxyPools:t,isOAuth:s,isFirst:i,isLast:n,onMoveUp:r,onMoveDown:d,onToggleActive:c,onUpdateProxy:m,onEdit:x,onDelete:p,oneByOneStatus:u=null,autoPing:h=null}){let[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1),v=(0,l.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,w=N?j.get(N):null,k=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||k,S=w?`Pool: ${w.name}`:N?`Pool: ${N} (inactive/missing)`:k?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",$="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);$=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{$=t}}let T=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E="default";w?.isActive===!0?E="success":(N||k)&&(E="error"),(0,l.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let I=async e=>{y(!0);try{await m("__none__"===e?null:e)}finally{y(!1),g(!1)}},M=e.authType||(s?"oauth":"apikey"),D="oauth"===M,_="cookie"===M,R=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(D?"OAuth Account":_?"Cookie Account":"API Key"),U=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[L,q]=(0,l.useState)(!1),K=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{q(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=K?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[K]);let F="unavailable"!==e.testStatus||L?e.testStatus:"active",J=()=>u?"queued"===u.state?"queued":"testing"===u.state?"testing":"success"===u.state?"success":"failed"===u.state?u.error?`failed: ${u.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:r,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:_?"cookie":D?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:R}),U&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:U}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(o.Ex,{variant:(0,P.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,a.jsx)(o.Ex,{variant:"default",size:"sm",children:D?"OAuth":_?"Cookie":"API Key"}),C&&(0,a.jsx)(o.Ex,{variant:E,size:"sm",children:"Proxy"}),L&&!1!==e.isActive&&(0,a.jsx)(O,{until:K}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),J()&&(0,a.jsx)(o.Ex,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:J()})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),$&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:$}),T&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:T,children:["no_proxy: ",T]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:b?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>I(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,a.jsx)(o.m_,{text:A,children:(0,a.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}O.propTypes={until:b().string.isRequired},z.propTypes={connection:b().shape({id:b().string,name:b().string,email:b().string,displayName:b().string,modelLockUntil:b().string,testStatus:b().string,isActive:b().bool,lastError:b().string,priority:b().number,globalPriority:b().number}).isRequired,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string,proxyUrl:b().string,noProxy:b().string,isActive:b().bool})),isOAuth:b().bool.isRequired,isFirst:b().bool.isRequired,isLast:b().bool.isRequired,onMoveUp:b().func.isRequired,onMoveDown:b().func.isRequired,onToggleActive:b().func.isRequired,onUpdateProxy:b().func,onEdit:b().func.isRequired,onDelete:b().func.isRequired,oneByOneStatus:b().shape({state:b().string,error:b().string}),autoPing:b().shape({on:b().bool,onToggle:b().func,provider:b().string})};let M={healthy:{variant:"success",label:"Pool healthy",icon:"shield"},degraded:{variant:"warning",label:"Pool degraded",icon:"warning"},exhausted:{variant:"error",label:"Pool exhausted",icon:"error"}};function D({providerId:e}){let[t,s]=(0,l.useState)(null);if((0,l.useEffect)(()=>{let t;if(!e)return;let a=!1,l=async()=>{try{let t=await fetch(`/api/providers/${e}/vault-pool`,{cache:"no-store"});if(!t.ok)return;let l=await t.json();a||s(l)}catch{}};l();let i=()=>{t||(t=setInterval(l,1e4))},n=()=>{t&&(clearInterval(t),t=null)},r=()=>document.hidden?n():i();return i(),document.addEventListener("visibilitychange",r),()=>{a=!0,n(),document.removeEventListener("visibilitychange",r)}},[e]),!t||!t.hasPool)return null;let i=M[t.status]||M.healthy;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",title:"Admin-provided shared key pool. Keys are hidden; only counts are shown.",children:[(0,a.jsx)(o.Ex,{variant:i.variant,size:"sm",icon:i.icon,children:i.label}),(0,a.jsxs)(o.Ex,{variant:"info",size:"sm",icon:"key",children:[t.total," pool keys"]}),(0,a.jsxs)(o.Ex,{variant:"success",size:"sm",icon:"check_circle",children:[t.available," available"]}),t.rateLimited>0&&(0,a.jsxs)(o.Ex,{variant:"warning",size:"sm",icon:"schedule",children:[t.rateLimited," cooling"]})]})}function _({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(null),[r,d]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/zai-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}else if(400===a.status||401===a.status){let e=await a.json().catch(()=>({}));t||n(e?.message||"Z.ai profile unavailable")}}catch{}t||d(!1)})(),()=>{t=!0}},[e]),r)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"Z"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[t.isGuest?(0,a.jsx)(o.Ex,{variant:"warning",size:"sm",icon:"person",children:"Guest — GLM-4.7 only"}):(0,a.jsx)(o.Ex,{variant:"success",size:"sm",icon:"check_circle",children:"Signed in"}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"Z.ai web session"})]})]})]}):i?(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"badge"}),(0,a.jsx)("span",{className:"min-w-0",children:i})]}):null}function R({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);if((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/freebuff-profile`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();t||s(l)}catch{}t||n(!1)})(),()=>{t=!0}},[e]),i)return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]});if(!t)return null;let r=t.expires?new Date(t.expires):null,d=r?Math.ceil((r.getTime()-Date.now())/864e5):null,c=null!==d&&d<=3;return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"F"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),r&&(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] text-text-muted",children:"schedule"}),(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["Session expires ",r.toLocaleDateString()]}),null!==d&&(0,a.jsxs)(o.Ex,{variant:c?"warning":"success",size:"sm",children:[d,"d left"]})]})]})]})}function U({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(null),[r,d]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/felo-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}else if(400===a.status||401===a.status){let e=await a.json().catch(()=>({}));t||n(e?.message||"Felo profile unavailable")}}catch{}t||d(!1)})(),()=>{t=!0}},[e]),r)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"F"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),t.uid&&(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Felo"}),(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["UID: ",t.uid]})]})]})]}):i?(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"badge"}),(0,a.jsx)("span",{className:"min-w-0",children:i})]}):null}function L({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);if((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/v0-profile`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();t||s(l)}catch{}t||n(!1)})(),()=>{t=!0}},[e]),i)return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]});if(!t?.profile&&!t?.balance)return null;let{profile:r,balance:d}=t;return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[r?.image?(0,a.jsx)("img",{src:r.image,alt:r.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:r?.name?.charAt(0)?.toUpperCase()||"v"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:r?.name||"User"}),r?.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:r.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[r?.plan&&(0,a.jsx)(o.Ex,{variant:"v0-free"===r.plan?"default":"primary",size:"sm",children:"v0-free"===r.plan?"Free":r.plan}),r?.teamName&&(0,a.jsx)("span",{className:"truncate text-[11px] text-text-muted",children:r.teamName})]})]}),d&&(0,a.jsxs)("div",{className:"flex shrink-0 flex-col items-end",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"bolt"}),(0,a.jsx)("span",{className:"font-mono text-sm font-bold text-text-main",children:d.remaining}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["/",d.total||"?"]})]}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"credits left"})]})]})}function q({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/qwencloud-profile`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();t||s(l)}catch{}t||n(!1)})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"Q"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[t.channelId&&(0,a.jsxs)(o.Ex,{variant:"info",size:"sm",children:["Region: ",t.channelId]}),t.uid&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["UID: ",t.uid]})]})]})]}):null}function K({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/inxora-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"I"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[t.plan&&(0,a.jsx)(o.Ex,{variant:"FREE"===t.plan?"default":"primary",size:"sm",children:t.plan}),!1===t.isActive&&(0,a.jsx)(o.Ex,{variant:"danger",size:"sm",children:"Inactive"})]})]})]}):null}function F({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/onemin-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:"1M"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:"1min.ai"}),t.plan&&(0,a.jsx)(o.Ex,{variant:"primary",size:"sm",children:t.plan})]}),null!=t.credits&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Credits: ",Number(t.credits).toLocaleString(void 0,{maximumFractionDigits:2})]})]})]}):null}function J({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/onemin-api-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:"1M"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:"1min.ai (API)"}),t.plan&&(0,a.jsx)(o.Ex,{variant:"primary",size:"sm",children:t.plan})]}),null!=t.credits&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Credits: ",Number(t.credits).toLocaleString(void 0,{maximumFractionDigits:2})]})]})]}):null}function B({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/agnes-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:"AG"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:"Agnes"}),t.username&&(0,a.jsxs)(o.Ex,{variant:"primary",size:"sm",children:["@",t.username]})]}),null!=t.credits&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Credits: ",Number(t.credits).toLocaleString()]})]})]}):null}function W({connectionId:e,cookie:t,currentPlan:s="free",onPlanChanged:i}){let n,[r,d]=(0,l.useState)([]),[c,m]=(0,l.useState)(s),[x,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(null),v=(n=String(t||"").match(/ctoken=([^;]+)/),n?.[1]||"");(0,l.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/providers/zenmux-free/zenmux-plans",{cache:"no-store"});if(!t.ok)return;let s=await t.json();!e&&Array.isArray(s.plans)&&d(s.plans)}catch{}})(),()=>{e=!0}},[]),(0,l.useEffect)(()=>{if(!v)return;let e=!1;return h(!0),(async()=>{try{let t=await fetch("/api/providers/zenmux-free/zenmux-plans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ctoken:v})});if(!t.ok)return;let a=await t.json();!e&&a.planKey&&(p(a.planKey),s&&"free"!==s||m(a.planKey))}catch{}finally{e||h(!1)}})(),()=>{e=!0}},[v,s]);let j=async t=>{let a=t.target.value;m(a),g(!0),y(null);try{if(!(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{zenmuxPlan:a}})})).ok)throw Error("Failed to save plan");i?.(a)}catch(e){y(e.message),m(s)}finally{g(!1)}},N=x&&x===c;return 0===r.length?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"ZenMux Plan"}),(0,a.jsx)("select",{value:c,onChange:j,disabled:!0,className:"appearance-none rounded-brand border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-muted [-webkit-appearance:none] [-moz-appearance:none]",children:(0,a.jsxs)("option",{value:c,children:[c," (loading…)"]})})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"ZenMux Plan"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("select",{value:c,onChange:j,disabled:f,title:"Select your ZenMux subscription plan. Models from this plan will be available.",className:"appearance-none rounded-brand border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 disabled:opacity-50",children:r.map(e=>(0,a.jsxs)("option",{value:e.planKey,children:[e.name," (",e.modelCount," models",e.price>0?`, $${e.price}/mo`:", free",")"]},e.planKey))}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"})})]}),u&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Detecting…"}),N&&!u&&(0,a.jsx)(o.Ex,{variant:"success",size:"sm",icon:"check_circle",dot:!0,children:"Auto-detected"}),f&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Saving…"}),b&&(0,a.jsx)(o.Ex,{variant:"error",size:"sm",icon:"error",children:b})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted",children:x?`Plan auto-detected from your ctoken: ${x}. You can override manually if needed.`:"Select your ZenMux subscription plan. Models available depend on your plan."})]})}let G=[{key:"now",label:"Now",desc:"Real-time streaming — no waiting",savings:"0%"},{key:"soon",label:"Soon",desc:"Short delay, small discount",savings:"~10%"},{key:"later",label:"Later",desc:"~15 min wait, ~50% cheaper",savings:"~50%"},{key:"anytime",label:"Anytime",desc:"Best-effort, up to 65% cheaper",savings:"up to 65%"}];function H({connectionId:e,currentWindow:t="now",onWindowChanged:s}){let[i,n]=(0,l.useState)(t),[r,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(null),x=async a=>{let l=a.target.value;n(l),d(!0),m(null);try{if(!(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{completionWindow:l}})})).ok)throw Error("Failed to save window");s?.(l)}catch(e){m(e.message),n(t)}finally{d(!1)}},p=G.find(e=>e.key===i)||G[0],u="now"!==i;return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Completion Window"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("select",{value:i,onChange:x,disabled:r,title:"Pick a completion window. Longer windows cost less but wait longer.",className:"appearance-none rounded-brand border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 disabled:opacity-50",children:G.map(e=>(0,a.jsxs)("option",{value:e.key,children:[e.label," (",e.savings," off)"]},e.key))}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"})})]}),u&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",icon:"schedule",dot:!0,children:"Async"}),r&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Saving…"}),c&&(0,a.jsx)(o.Ex,{variant:"error",size:"sm",icon:"error",children:c})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted",children:[p.desc,u&&" — results polled automatically with keep-alive heartbeats."]})]})}var Q=s(4823);function V({providerId:e,isOAuth:t,isCompatible:s,isFreeNoAuth:l,hasDualAuthModes:i,oauthConnectionLabel:n,apiKeyConnectionLabel:r,thinkingConfig:d,AUTO_PING_SETTINGS_KEYS:c,connections:m,proxyPools:x,selectedConnectionIds:u,selectedConnections:h,allSelected:f,oneByOneRunning:g,oneByOneStopping:b,oneByOneCurrentConnectionId:y,oneByOneResults:v,oneByOneSummary:j,providerStrategy:N,providerStickyLimit:w,thinkingMode:k,autoPing:C,showBulkProxyModal:S,bulkUpdatingProxy:A,activePools:$,selectedProxySummary:T,handleSwapPriority:E,handleUpdateConnectionStatus:I,handleDelete:P,handleBulkDelete:O,handleRunOneByOneTest:M,handleStopOneByOneTest:G,handleRoundRobinToggle:Z,handleStickyLimitChange:X,handleThinkingModeChange:Y,handleAutoPingConnection:ee,triggerOAuthConnection:et,triggerApiKeyConnection:es,triggerAddConnection:ea,toggleSelectConnection:el,toggleSelectAllConnections:ei,openBulkProxyModal:en,closeBulkProxyModal:er,applyProxyAssignments:eo,handleApplySinglePool:ed,handleApplyOneToOne:ec,fetchConnections:em,setSelectedConnection:ex,setShowEditModal:ep,setShowBulkProxyModal:eu,setShowIFlowCookieModal:eh,setShowBulkImportCodex:ef,setConnections:eg}){return l?(0,a.jsx)(Q.default,{providerId:e}):(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 border-b border-border-subtle px-4 py-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Connections"}),m.length>0&&(0,a.jsx)("span",{className:"rounded-full bg-black/5 px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-text-muted dark:bg-white/10",children:m.length})]}),(0,a.jsx)(D,{providerId:e}),"zai-web"===e&&m.length>0&&(0,a.jsx)(_,{connectionId:m[0].id}),"felo-web"===e&&m.length>0&&(0,a.jsx)(U,{connectionId:m[0].id}),"freebuff-web"===e&&m.length>0&&(0,a.jsx)(R,{connectionId:m[0].id}),"v0-vercel-web"===e&&m.length>0&&(0,a.jsx)(L,{connectionId:m[0].id}),"qwencloud"===e&&m.length>0&&(0,a.jsx)(q,{connectionId:m[0].id}),"inxorastudio-web"===e&&m.length>0&&(0,a.jsx)(K,{connectionId:m[0].id}),"1min"===e&&m.length>0&&(0,a.jsx)(F,{connectionId:m[0].id}),"1min-api"===e&&m.length>0&&(0,a.jsx)(J,{connectionId:m[0].id}),"agnes-web"===e&&m.length>0&&(0,a.jsx)(B,{connectionId:m[0].id})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[m.length>0&&x.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:en,children:"Apply Proxy"}),m.length>0&&u.length>0&&(0,a.jsxs)(o.$n,{size:"sm",variant:"danger",icon:"delete",onClick:O,children:["Delete (",u.length,")"]}),m.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:g?"progress_activity":"sync",onClick:M,disabled:g,className:g?"animate-pulse":"",children:g?"Testing...":"Test All"}),g&&(0,a.jsx)(o.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:G,disabled:b,children:b?"Stopping":"Stop"})]}),d&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Thinking"}),(0,a.jsx)("select",{value:k,onChange:e=>Y(e.target.value),className:"h-7 rounded-lg border border-border bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-surface-2 dark:border-white/10 dark:bg-white/[0.03]",children:d.options.map(e=>(0,a.jsx)("option",{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Round Robin"}),(0,a.jsx)(o.lM,{checked:"round-robin"===N,onChange:Z}),"round-robin"===N&&(0,a.jsx)("input",{type:"number",min:1,value:w,onChange:e=>X(e.target.value),placeholder:"1",className:"w-12 rounded-lg border border-border bg-black/[0.02] px-1.5 py-0.5 text-xs text-text-primary outline-none dark:border-white/10 dark:bg-white/[0.03]",title:"Sticky limit (requests per account before rotating)"})]}),"zenmux-free"===e&&m.length>0&&(0,a.jsx)(W,{connectionId:m[0].id,cookie:m[0].apiKey||"",currentPlan:m[0].providerSpecificData?.zenmuxPlan||"free",onPlanChanged:em}),"marathon"===e&&m.length>0&&(0,a.jsx)(H,{connectionId:m[0].id,currentWindow:m[0].providerSpecificData?.completionWindow||"now",onWindowChanged:em})]})]}),0===m.length?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 px-4 py-8 text-center",children:[(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:t?"lock":"key"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:"No connections yet"}),i&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Choose ",n," or ",r]})]}),(0,a.jsx)("div",{className:"flex flex-wrap justify-center gap-2",children:i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:et,children:n}),(0,a.jsx)(o.$n,{size:"sm",icon:"key",onClick:es,children:r})]}):(0,a.jsxs)(a.Fragment,{children:[!s&&"iflow"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>eh(!0),children:"Cookie"}),"codex"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ef(!0),children:(0,p.Tl)("Bulk Add")}),(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:ea,children:s?"Add API Key":"iflow"===e?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)("div",{className:"flex flex-col",children:[j&&(0,a.jsxs)("div",{className:"border-b border-border-subtle px-4 py-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"checklist"}),(0,a.jsxs)("span",{className:"font-medium text-text-main",children:[j.completed,"/",j.total]})]}),j.passed>0&&(0,a.jsxs)("span",{className:"text-success",children:["✓ ",j.passed]}),j.failed>0&&(0,a.jsxs)("span",{className:"text-danger",children:["✗ ",j.failed]}),j.stopped&&(0,a.jsx)("span",{className:"text-warning",children:"Stopped"}),g&&y&&(0,a.jsxs)("span",{className:"truncate text-text-muted",children:["Testing: ",m.find(e=>e.id===y)?.name||y]})]}),j.total>0&&(0,a.jsx)("div",{className:"mt-1.5 h-1 overflow-hidden rounded-full bg-surface-2",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${j.completed/j.total*100}%`}})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-border-subtle px-4 py-2",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:f,onChange:ei,className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]}),u.length>0&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[u.length," selected"]})]}),(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-border-subtle",children:m.map((s,l)=>{let i;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-2 sm:pl-3",children:(0,a.jsx)("input",{type:"checkbox",checked:(i=s.id,u.includes(i)),onChange:()=>el(s.id),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)(z,{connection:s,proxyPools:x,isOAuth:t,isFirst:0===l,isLast:l===m.length-1,onMoveUp:()=>E(l,l-1),onMoveDown:()=>E(l,l+1),onToggleActive:e=>I(s.id,e),autoPing:c[e]&&"oauth"===s.authType?{on:!0===C.connections[s.id],onToggle:e=>ee(s.id,e),provider:e}:null,onUpdateProxy:async e=>{try{(await fetch(`/api/providers/${s.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e||null})})).ok&&eg(t=>t.map(t=>t.id===s.id?{...t,providerSpecificData:{...t.providerSpecificData,proxyPoolId:e||null}}:t))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ex(s),ep(!0)},onDelete:()=>P(s.id),oneByOneStatus:v[s.id]||null})})]},s.id)})}),!s&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border-subtle px-4 py-3",children:["iflow"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>eh(!0),children:"Cookie"}),"codex"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ef(!0),children:(0,p.Tl)("Bulk Add")}),i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:et,children:n}),(0,a.jsx)(o.$n,{size:"sm",icon:"key",onClick:es,children:r})]}):(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:ea,children:"Add"})]})]}),(0,a.jsx)(o.aF,{isOpen:S,onClose:er,title:`Apply Proxy (${m.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[T&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:T}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:ec,disabled:A||0===$.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>ed(null),disabled:A,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),x.map(e=>(0,a.jsxs)("button",{onClick:()=>ed(e.id),disabled:A||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),A&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(o.$n,{onClick:er,variant:"ghost",fullWidth:!0,disabled:A,children:"Cancel"})]})})]})}let Z=[{value:"auto",label:"Auto",hint:"No override"},{value:"none",label:"Off",hint:"Disable thinking"},{value:"minimal",label:"Minimal",hint:"512 tokens"},{value:"low",label:"Low",hint:"1,024 tokens"},{value:"medium",label:"Medium",hint:"8,192 tokens"},{value:"high",label:"High",hint:"24,576 tokens"},{value:"xhigh",label:"X-High",hint:"32,768 tokens"},{value:"max",label:"Max",hint:"128,000 tokens"}];function X({caps:e,selectedLevel:t,onSelect:s}){let[i,n]=(0,l.useState)(!1),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!i)return;let e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let o=e?.thinkingLevels,d=Z.filter(t=>"auto"===t.value||(o?o.includes(t.value):"none"===t.value?e?.thinkingCanDisable!==!1:"max"!==t.value||e?.thinkingMaxEffort===!0)),c=d.find(e=>e.value===t)||d[0];return(0,a.jsxs)("div",{className:"relative",ref:r,children:[(0,a.jsx)("button",{onClick:()=>n(e=>!e),title:`Thinking: ${c.label}${c.hint?` (${c.hint})`:""}`,className:`rounded p-0.5 transition-colors ${"auto"!==t?"text-primary":"text-text-muted hover:bg-sidebar hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"psychology"})}),i&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[140px] rounded-lg border border-border bg-panel shadow-[var(--shadow-warm)]",children:[(0,a.jsx)("div",{className:"px-2 py-1.5 border-b border-border-subtle",children:(0,a.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-text-muted",children:"Thinking Level"})}),d.map(e=>(0,a.jsxs)("button",{onClick:()=>{s(e.value),n(!1)},className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-xs transition-colors hover:bg-sidebar ${e.value===t?"text-primary font-semibold":"text-text-main"}`,children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:e.hint})]},e.value))]})]})}function Y({model:e,fullModel:t,alias:s,copied:i,onCopy:n,testStatus:r,isCustom:d,isFree:c,onDeleteAlias:m,onTest:x,isTesting:p,onDisable:u,caps:h}){let[f,g]=(0,l.useState)("auto"),b="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0,y=!!h?.reasoning,v="auto"!==f&&"none"!==f?`${t}(${f})`:"none"===f?`${t}(none)`:t;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:b?{color:b}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:v}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(o.nh,{caps:h,colorOverride:"text-text-muted/70",size:12})]})]}),y&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)(X,{caps:h,selectedLevel:f,onSelect:g}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:"Thinking"})]}),x&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:x,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>n(v,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),d?(0,a.jsx)("button",{onClick:m,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function ee({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:l="llm",includeLegacyAliases:i=!0}){let n=new Set(a.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(l&&e!==l||n.has(t.id))continue;let a=`${s}/${t.id}`;r.has(a)||(r.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!i)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||n.has(t)||r.has(s)||(r.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:l||"llm"}))}return o}Y.propTypes={model:b().shape({id:b().string.isRequired}).isRequired,fullModel:b().string.isRequired,alias:b().string,copied:b().string,onCopy:b().func.isRequired,testStatus:b().oneOf(["ok","error"]),isCustom:b().bool,isFree:b().bool,onDeleteAlias:b().func,onTest:b().func,isTesting:b().bool,onDisable:b().func,caps:b().object};var et=s(5507);function es({modelId:e,fullModel:t,copied:s,onCopy:l,onDeleteAlias:i,onTest:n,testStatus:r,isTesting:o}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function ea({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:i,copied:n,onCopy:r,onDeleteAlias:d,onAddCustomModel:c,onDeleteCustomModel:m,connections:x,isAnthropic:p}){let[u,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1),[v,j]=(0,l.useState)(null),[N,w]=(0,l.useState)({}),k=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();w(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=ee({customModels:i,modelAliases:s,providerAlias:e,type:"llm"}),S=C.length>20,A=(0,l.useRef)(null),[$,T]=(0,l.useState)(0),[E,I]=(0,l.useState)(480),P=(0,l.useMemo)(()=>{let e=Array(C.length),t=0;for(let s=0;s<C.length;s++)e[s]=t,t+=66;return{offsets:e,total:t}},[C.length]),{start:O,end:z}=(0,l.useMemo)(()=>(0,et.$7)(P.offsets,P.total,$,E,4),[P,$,E]);(0,l.useEffect)(()=>{let e=A.current;if(!e)return;let t=Math.max(0,P.total-E);e.scrollTop>t&&(e.scrollTop=t,T(t))},[P.total,E,$]),(0,l.useEffect)(()=>{let e=A.current;if(!e||"u"<typeof ResizeObserver)return;let t=()=>I(e.clientHeight||480);t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[S,C.length]);let M=(0,l.useCallback)(e=>T(e.currentTarget.scrollTop),[]),D=Math.min(O,C.length),_=Math.min(z,C.length-1),R=D>=C.length?P.total:P.offsets[D],U=_+1<C.length?Math.max(0,P.total-P.offsets[_+1]):0,L=async()=>{if(!u.trim()||f)return;let e=u.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await c(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},q=async()=>{if(b)return;let e=x.find(e=>!1!==e.isActive);if(e){y(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let l=0;for(let e of a){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await c(t),l+=1))}0===l&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{y(!1)}}},K=x.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",p?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&L(),placeholder:p?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:L,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"download",onClick:q,disabled:!K||b,children:b?"Importing...":"Import from /models"})]}),!K&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,a.jsxs)("div",{ref:S?A:void 0,onScroll:S?M:void 0,className:S?"max-h-[480px] overflow-y-auto flex flex-col gap-3 pr-1":"flex flex-col gap-3",children:[S&&R>0&&(0,a.jsx)("div",{style:{height:R},"aria-hidden":!0}),C.slice(D,_+1).map(({id:s,alias:l,source:i})=>(0,a.jsx)(es,{modelId:s,fullModel:`${t}/${s}`,copied:n,onCopy:r,onDeleteAlias:()=>"custom"===i?m(s):d(l),onTest:x.length>0?()=>k(s):void 0,testStatus:N[s],isTesting:v===s},`${i}-${e}/${s}`)),S&&U>0&&(0,a.jsx)("div",{style:{height:U},"aria-hidden":!0})]})]})}function el({providerId:e,isCompatible:t,isAnthropicCompatible:s,isFreeNoAuth:l,providerStorageAlias:i,providerDisplayAlias:n,models:r,kiloFreeModels:m,modelAliases:x,customModels:u,disabledModelIds:h,modelTestResults:f,testingModelIds:g,testingAllModels:b,modelsTestError:y,modelSearchQuery:v,connections:j,suggestedModels:N,importingQoderModels:w,copied:k,getCaps:C,copy:S,handleTestModel:A,handleTestAllModels:$,handleDisableModel:T,handleEnableModel:E,handleDisableAll:I,handleEnableAll:P,handleSetAlias:O,handleDeleteAlias:z,handleAddCustomModel:M,handleDeleteCustomModel:D,handleImportQoderModels:_,setModelSearchQuery:R,setShowAddCustomModel:U}){let L,q,K;if(t)return(0,a.jsx)("div",{className:"px-4 py-3",children:(0,a.jsx)(ea,{providerStorageAlias:i,providerDisplayAlias:n,modelAliases:x,customModels:u,copied:k,onCopy:S,onSetAlias:O,onDeleteAlias:z,onAddCustomModel:e=>M(e,"llm",i),onDeleteCustomModel:e=>D(e,"llm",i),connections:j,isAnthropic:s})});let F=[...r,...m.filter(e=>!r.some(t=>t.id===e.id))].filter(e=>{let t=(0,c.CP)(e);return!t||"llm"===t}),J=new Set(h),B=F.filter(e=>!J.has(e.id)),W=F.filter(e=>J.has(e.id)),G=ee({customModels:u,modelAliases:x,providerAlias:i,builtInModels:r,type:"llm"}),H=v.trim().toLowerCase(),Q=(e,t="")=>!H||e.toLowerCase().includes(H)||String(t).toLowerCase().includes(H),V=B.filter(e=>Q(e.id,e.name)),Z=G.filter(e=>Q(e.id,e.name)),X=F.map(e=>e.id).filter(e=>!h.includes(e)),et=X.filter(e=>!H||e.toLowerCase().includes(H));return(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border-subtle px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:P,children:"Active All"}),X.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>I(X),children:"Disable All"}),(j.length>0||l)&&et.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"primary",icon:b?"progress_activity":"play_arrow",onClick:()=>$(et),disabled:b,className:b?"animate-pulse":"",children:b?"Testing...":`Test All (${et.length})`})]}),(0,a.jsx)("div",{className:"sm:w-56",children:(0,a.jsx)(o.pd,{type:"search",placeholder:"Search models...",value:v,onChange:e=>R(e.target.value),className:"w-full"})})]}),(0,a.jsxs)("div",{className:"px-4 py-3",children:[d.Q2[e]?.capabilities?.toolUse===!1&&(0,a.jsxs)("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-warning/20 bg-warning/[0.04] px-3 py-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"info"}),(0,a.jsxs)("p",{className:"text-[11px] leading-relaxed text-text-muted",children:["Cookie-based provider — these models run through a browser chat endpoint and"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:"cannot execute tool/function calls"}),"."," ","Smart Routing combos will exclude them from tool-calling pools and use them only for research intents."]})]}),!!y&&(0,a.jsx)("p",{className:"mb-3 break-words text-xs text-danger",children:y}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[Z.map(t=>(0,a.jsx)(Y,{model:{id:t.id,name:t.name},fullModel:`${n}/${t.id}`,alias:t.alias,copied:k,onCopy:S,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===t.source?D(t.id,"llm",i):z(t.alias)},testStatus:f[t.id],onTest:j.length>0||l?()=>A(t.id):void 0,isTesting:g.has(t.id),isCustom:!0,isFree:!1,caps:C(`${e}/${t.id}`)},`${t.source}-${t.fullModel}`)),V.map(t=>{let s=`${i}/${t.id}`,r=`${e}/${t.id}`,o=Object.entries(x).find(([,e])=>e===s||e===r)?.[0];return(0,a.jsx)(Y,{model:t,fullModel:`${n}/${t.id}`,alias:o,copied:k,onCopy:S,onSetAlias:e=>O(t.id,e,i),onDeleteAlias:()=>z(o),testStatus:f[t.id],onTest:j.length>0||l?()=>A(t.id):void 0,isTesting:g.has(t.id),isFree:t.isFree,onDisable:()=>T(t.id),caps:C(`${e}/${t.id}`)},t.id)})]}),v.trim()&&0===V.length&&0===Z.length&&(0,a.jsxs)("p",{className:"w-full py-4 text-center text-sm text-text-muted",children:["No models match “",v,"”"]}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,a.jsxs)("button",{onClick:()=>U(!0),className:"flex items-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",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===e&&j.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:_,disabled:w,className:"flex items-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-info transition-colors hover:border-blue-500 hover:bg-blue-500/5 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:w?{animation:"spin 1s linear infinite"}:void 0,children:w?"progress_activity":"download"}),w?(0,p.Tl)("Fetching..."):(0,p.Tl)("Fetch Qoder Models")]})]}),N.length>0&&(L=new Set([...Object.values(x),...G.map(e=>e.fullModel)]),q=new Set(r.map(e=>e.id)),0===(K=N.filter(e=>!L.has(`${i}/${e.id}`)&&!q.has(e.id))).length?null:(0,a.jsxs)("div",{className:"mt-3 w-full",children:[(0,a.jsx)("p",{className:"mb-2 text-[10px] uppercase tracking-wide text-text-muted",children:"Suggested free models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await M(e.id,"llm",i)},className:"flex items-center gap-1 rounded-lg border border-border px-2.5 py-1.5 text-xs text-text-muted transition-colors hover:border-primary/40 hover:bg-primary/5 hover:text-primary",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),W.length>0&&(0,a.jsxs)("div",{className:"mt-3 w-full",children:[(0,a.jsxs)("p",{className:"mb-2 text-[10px] uppercase tracking-wide text-text-muted",children:["Disabled (",W.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:W.map(e=>(0,a.jsxs)("button",{onClick:()=>E(e.id),className:"flex items-center gap-1 rounded-lg border border-dashed border-border px-2.5 py-1.5 text-xs text-text-muted transition-colors hover:border-primary/40 hover:bg-primary/5 hover:text-primary",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})]})}ea.propTypes={providerStorageAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,modelAliases:b().object.isRequired,customModels:b().arrayOf(b().object),copied:b().string,onCopy:b().func.isRequired,onDeleteAlias:b().func.isRequired,onAddCustomModel:b().func.isRequired,onDeleteCustomModel:b().func.isRequired,connections:b().arrayOf(b().shape({id:b().string,isActive:b().bool})).isRequired,isAnthropic:b().bool};let ei={claude:"claudeAutoPing",codex:"codexAutoPing"};function en(){let e=(0,i.useParams)(),t=(0,i.useRouter)(),s=e.id,{getCaps:n}=(0,x.y)(),{markSeen:u}=(0,A.P)("providers");(0,l.useEffect)(()=>{s&&u(s)},[s,u]);let[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)(!0),[k,$]=(0,l.useState)(null),[E,P]=(0,l.useState)([]),[O,z]=(0,l.useState)(!1),[M,D]=(0,l.useState)(!1),[_,R]=(0,l.useState)(!1),[U,L]=(0,l.useState)(""),[q,K]=(0,l.useState)(!1),[F,J]=(0,l.useState)(!1),[B,W]=(0,l.useState)(!1),[G,H]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(null),[X,Y]=(0,l.useState)({}),[ee,et]=(0,l.useState)([]),[es,ea]=(0,l.useState)(!1),[en,er]=(0,l.useState)({}),[eo,ed]=(0,l.useState)(""),[ec,em]=(0,l.useState)(()=>new Set),[ex,ep]=(0,l.useState)(""),[eu,eh]=(0,l.useState)(!1),[ef,eg]=(0,l.useState)(!1),[eb,ey]=(0,l.useState)([]),[ev,ej]=(0,l.useState)("__none__"),[eN,ew]=(0,l.useState)(!1),[ek,eC]=(0,l.useState)(null),[eS,eA]=(0,l.useState)(""),[e$,eT]=(0,l.useState)("auto"),[eE,eI]=(0,l.useState)({enabled:!1,connections:{}}),[eP,eO]=(0,l.useState)([]),[ez,eM]=(0,l.useState)([]),[eD,e_]=(0,l.useState)([]),[eR,eU]=(0,l.useState)(null),[eL,eq]=(0,l.useState)(!1),[eK,eF]=(0,l.useState)(!1),[eJ,eB]=(0,l.useState)(!1),[eW,eG]=(0,l.useState)(null),[eH,eQ]=(0,l.useState)({}),[eV,eZ]=(0,l.useState)(null),eX=(0,l.useRef)(!1),[eY,e0]=(0,l.useState)(!1),{copied:e1,copy:e2}=(0,m.C)(),e5="ag_risk_confirmed",e3=["1min","qwen-web"],e4=()=>{z(!0)},e8=()=>{"antigravity"===s&&"true"!==window.localStorage.getItem(e5)?eq(!0):te||e3.includes(s)?e4():(L(""),R(!0))},e6=()=>{L(""),R(!0)},e7=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:d.zN[s]||d.fg[s]||d.IS[s]||d.nJ[s]||d.br[s],e9=e7?.authModes||[],te=(!!d.zN[s]||!!d.IS[s]||e9.includes("oauth"))&&e7?.hasOAuth!==!1,tt=!!d.fg[s]||e9.includes("apikey")||e7?.hasOAuth===!1,ts=!!d.IS[s]?.noAuth,ta=(0,c.KC)(s),tl=(0,d.wG)(s),ti=(0,d.mq)(s),tn=(0,d.gb)(s),tr=ti||tn,to=!tr&&te&&tt,td="xai"===s?"Grok Build OAuth":"OAuth",tc="xai"===s?"xAI API Key":"API Key",tm=d.Q2[s]?.thinkingConfig||d.s9.extended,tx=tr?s:tl,tp=tr?k?.prefix||s:tl,tu=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}`,{cache:"no-store"}),t=await e.json();e.ok&&e_(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tx]),th=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tx,ids:[e]})})).ok&&await tu()}catch(e){console.log("Error disabling model:",e)}},tf=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling model:",e)}},tg=async e=>{e.length&&eU({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eU(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tx,ids:e})})).ok&&await tu()}catch(e){console.log("Error disabling all models:",e)}}})},tb=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling all models:",e)}},ty=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Y(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tv=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&et(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,l.useEffect)(()=>{"kilocode"===s&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eM(e.models)}).catch(()=>{})},[s]);let tj=(0,l.useCallback)(async()=>{try{let[e,t,a,l]=await Promise.all([fetch("/api/providers",{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"})]),i=await e.json(),n=await t.json(),r=await a.json(),o=l.ok?await l.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===s);b(e)}a.ok&&P(r.proxyPools||[]);let d=(o.providerStrategies||{})[s]||{};eC(d.fallbackStrategy||null),eA(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[s]||{};eT(c.mode||"auto");let m=ei[s],x=m&&o[m]||{};if(eI({enabled:!0===x.enabled,connections:x.connections||{}}),t.ok){let e=(n.nodes||[]).find(e=>e.id===s)||null;if(!e&&tr)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===s)||null))break}$(e)}}catch(e){console.log("Error fetching connections:",e)}finally{v(!1)}},[s,tr]),tN=async e=>{try{let t=await fetch(`/api/provider-nodes/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&($(a.node),await tj(),W(!1))}catch(e){console.log("Error updating provider node:",e)}},tw=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),l=(a.ok?await a.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let n={...l};0===Object.keys(i).length?delete n[s]:n[s]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("Error saving provider strategy:",e)}},tk=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[s]={mode:e}:delete a[s],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)}},tC=async e=>{let t=ei[s];if(t){eI(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,l.useEffect)(()=>{tj(),ty(),tv(),tu()},[tj,ty,tv,tu]),(0,l.useEffect)(()=>{let e=(d.zN[s]||d.fg[s]||d.IS[s]||d.nJ[s]||d.br[s])?.modelsFetcher;if(!e)return void eO([]);let t=!1,a=g.find(e=>!1!==e.isActive);return h(e,{connectionId:a?.id}).then(e=>{t||eO(e)}),()=>{t=!0}},[s,g]);let tS=async(e,t,s=tl)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await ty();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tA=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ty()}catch(e){console.log("Error deleting alias:",e)}},t$=async(e,t="llm",s=tx)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tv(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tT=async(e,t="llm",s=tx)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tv(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tE=async()=>{if(eY)return;let e=g.find(e=>!1!==e.isActive);if(!e)return void alert((0,p.Tl)("Please add an active Qoder connection first"));e0(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,p.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,p.Tl)("No models returned"));let l=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");ee.some(e=>e.providerAlias===tx&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(X).includes(`${tx}/${s}`)||(await t$(s,"llm",tx),l+=1)}0===l?alert((0,p.Tl)("All models already exist, no new models added")):alert((0,p.Tl)("Successfully added")+` ${l} `+(0,p.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,p.Tl)("Error fetching models")+": "+e.message)}finally{e0(!1)}},tI=async()=>{if(eK||0===g.length)return;let e=Object.fromEntries(g.map(e=>[e.id,{state:"queued",error:null}]));eX.current=!1,eF(!0),eB(!1),eG(null),eQ(e),eZ({total:g.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<g.length;e+=1){if(eX.current){eZ({total:g.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=g[e];eG(a.id),eQ(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),l=await e.json(),i=!!l.valid;i?t+=1:s+=1,eQ(e=>({...e,[a.id]:{state:i?"success":"failed",error:i?null:l.error||null}}))}catch(e){s+=1,eQ(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eZ({total:g.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<g.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eG(null),eF(!1),eB(!1),eX.current=!1}},tP=async e=>{eU({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eU(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tO=()=>{tj(),z(!1)},tz=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:s,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tj(),R(!1);return}L(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}},tM=async e=>{try{(await fetch(`/api/providers/${Q.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tj(),J(!1))}catch(e){console.log("Error updating connection:",e)}},tD=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t_=async(e,t)=>{let s=[...g];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tj()}},tR=g.filter(e=>eb.includes(e.id)),tU=g.length>0&&eb.length===g.length;(0,l.useEffect)(()=>{ey(e=>e.filter(e=>g.some(t=>t.id===e)))},[g]);let tL=(()=>{if(0===tR.length)return"";let e=new Set(tR.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=E.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),tq=async e=>{ew(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tj(),H(!1)}finally{ew(!1)}},tK=E.filter(e=>!0===e.isActive),tF=async e=>{if(!ec.has(e)){em(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:`${tx}/${e}`})}),s=await t.json();er(t=>({...t,[e]:s.ok?"ok":"error"})),ed(s.ok?"":s.error||"Model not reachable")}catch{er(t=>({...t,[e]:"error"})),ed("Network error")}finally{em(t=>{let s=new Set(t);return s.delete(e),s})}}},tJ=async e=>{eu||0===e.length||(eh(!0),ed(""),await Promise.all(e.map(e=>tF(e))),eh(!1))};if(y)return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.Qv,{}),(0,a.jsx)(o.Qv,{})]});if(!e7)return(0,a.jsxs)("div",{className:"py-20 text-center",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(r(),{href:"/dashboard/providers",className:"mt-4 inline-block text-primary",children:"Back to Providers"})]});let tB=(0,f.k)(e7.id,e7.apiType);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,a.jsx)(T,{providerInfo:e7,providerId:s,connections:g,modelCount:ta.length,headerIconPath:tB,headerImgError:es,setHeaderImgError:ea}),"kimi-desktop"===s&&(0,a.jsx)(o.P1,{}),tr&&k&&(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tn?"Anthropic Compatible":"OpenAI Compatible"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tn?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tn?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>{L(""),R(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>W(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{eU({title:"Delete Compatible Node",message:`Delete this ${tn?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eU(null);try{(await fetch(`/api/provider-nodes/${s}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),(0,a.jsx)(I,{title:"Connections",icon:"cable",count:g.length,defaultExpanded:!0,children:(0,a.jsx)(V,{providerId:s,isOAuth:te,isCompatible:tr,isFreeNoAuth:ts,hasDualAuthModes:to,oauthConnectionLabel:td,apiKeyConnectionLabel:tc,thinkingConfig:tm,AUTO_PING_SETTINGS_KEYS:ei,connections:g,proxyPools:E,selectedConnectionIds:eb,selectedConnections:tR,allSelected:tU,oneByOneRunning:eK,oneByOneStopping:eJ,oneByOneCurrentConnectionId:eW,oneByOneResults:eH,oneByOneSummary:eV,providerStrategy:ek,providerStickyLimit:eS,thinkingMode:e$,autoPing:eE,showBulkProxyModal:G,bulkUpdatingProxy:eN,activePools:tK,selectedProxySummary:tL,handleSwapPriority:t_,handleUpdateConnectionStatus:tD,handleDelete:tP,handleBulkDelete:()=>{let e=eb.length;0!==e&&eU({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eU(null);let e=0,t=[...eb];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),ey([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},handleRunOneByOneTest:tI,handleStopOneByOneTest:()=>{eK&&(eX.current=!0,eB(!0))},handleRoundRobinToggle:e=>{let t=e?"round-robin":null,s=e?eS||"1":eS;e&&!eS&&eA("1"),eC(t),tw(t,s)},handleStickyLimitChange:e=>{eA(e),tw("round-robin",e)},handleThinkingModeChange:e=>{eT(e),tk(e)},handleAutoPingConnection:(e,t)=>{tC({...eE,connections:{...eE.connections,[e]:t}})},triggerOAuthConnection:e8,triggerApiKeyConnection:e6,triggerAddConnection:()=>{te||e3.includes(s)?e8():e6()},toggleSelectConnection:e=>{ey(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},toggleSelectAllConnections:()=>{tU?ey([]):ey(g.map(e=>e.id))},openBulkProxyModal:()=>{if(0===tR.length)return;let e=[...new Set(tR.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"))];ej(1===e.length?e[0]:"__none__"),H(!0)},closeBulkProxyModal:()=>{eN||H(!1)},applyProxyAssignments:tq,handleApplySinglePool:e=>tq(g.map(t=>({connectionId:t.id,proxyPoolId:e}))),handleApplyOneToOne:()=>{let e=E.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tq(g.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},fetchConnections:tj,setSelectedConnection:Z,setShowEditModal:J,setShowBulkProxyModal:H,setShowIFlowCookieModal:D,setShowBulkImportCodex:K,setConnections:b})}),(0,a.jsx)(I,{title:"Health",icon:"monitoring",defaultExpanded:!1,children:(0,a.jsx)("div",{className:"px-4 py-3",children:(0,a.jsx)(S,{providerId:s})})}),(0,a.jsx)(I,{title:"Models",icon:"apps",count:ta.length,defaultExpanded:!0,children:(0,a.jsx)(el,{providerId:s,isCompatible:tr,isAnthropicCompatible:tn,isFreeNoAuth:ts,providerStorageAlias:tx,providerDisplayAlias:tp,models:ta,kiloFreeModels:ez,modelAliases:X,customModels:ee,disabledModelIds:eD,modelTestResults:en,testingModelIds:ec,testingAllModels:eu,modelsTestError:eo,modelSearchQuery:ex,connections:g,suggestedModels:eP,importingQoderModels:eY,copied:e1,getCaps:n,copy:e2,handleTestModel:tF,handleTestAllModels:tJ,handleDisableModel:th,handleEnableModel:tf,handleDisableAll:tg,handleEnableAll:tb,handleSetAlias:tS,handleDeleteAlias:tA,handleAddCustomModel:t$,handleDeleteCustomModel:tT,handleImportQoderModels:tE,setModelSearchQuery:ep,setShowAddCustomModel:eg})}),"kiro"===s?(0,a.jsx)(o.Mh,{isOpen:O,providerInfo:e7,onSuccess:tO,onClose:()=>z(!1)}):"cursor"===s?(0,a.jsx)(o.G9,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"1min"===s?(0,a.jsx)(o.CG,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"qwen-web"===s?(0,a.jsx)(o.F8,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"wp-studio"===s?(0,a.jsx)(o.V1,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"zed"===s?(0,a.jsx)(o.TE,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"kimi-desktop"===s?(0,a.jsx)(o.QT,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"gitlab"===s?(0,a.jsx)(o.vj,{isOpen:O,providerInfo:e7,onSuccess:tO,onClose:()=>z(!1)}):(0,a.jsx)(o.LF,{isOpen:O,provider:s,providerInfo:e7,onSuccess:tO,onClose:()=>z(!1)}),"iflow"===s&&(0,a.jsx)(o.vE,{isOpen:M,onSuccess:()=>{tj(),D(!1)},onClose:()=>D(!1)}),(0,a.jsx)(j,{isOpen:_,provider:s,providerName:e7.name,isCompatible:tr,isAnthropic:tn,authType:e7?.authType,authHint:e7?.authHint,website:e7?.website,proxyPools:E,error:U,onSave:tz,onBulkDone:tj,onClose:()=>{L(""),R(!1)}}),(0,a.jsx)(o.wI,{isOpen:F,connection:Q,proxyPools:E,onSave:tM,onClose:()=>J(!1)}),tr&&(0,a.jsx)(N,{isOpen:B,node:k,onSave:tN,onClose:()=>W(!1),isAnthropic:tn}),!tr&&(0,a.jsx)(w,{isOpen:ef,providerAlias:tx,providerDisplayAlias:tp,onSave:async e=>{await t$(e,"llm",tx),eg(!1)},onClose:()=>eg(!1)}),"codex"===s&&(0,a.jsx)(C,{isOpen:q,onClose:()=>K(!1),onSuccess:tj}),(0,a.jsx)(o.uo,{isOpen:eL,onClose:()=>eq(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eq(!1),te)?e4():e6()},title:"Risk Notice",message:e7?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(o.uo,{isOpen:!!eR,onClose:()=>eU(null),onConfirm:eR?.onConfirm,title:eR?.title||"Confirm",message:eR?.message,variant:"danger"})]})}},90809:(e,t,s)=>{Promise.resolve().then(s.bind(s,90155))}},e=>{e.O(0,[27,5772,9497,705,1321,5497,8441,3794,7358],()=>e(e.s=90809)),_N_E=e.O()}]);
10
+ ]`;function C({isOpen:e,onClose:t,onSuccess:s}){let[i,n]=(0,l.useState)(""),[r,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),h=()=>{r||(n(""),m(""),u(null),t())},f=async()=>{var e;let t;m(""),u(null);let a=i.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,p.Tl)("Invalid JSON")}: ${e.message}`);return}let l=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!l||0===l.length)return void m((0,p.Tl)("No accounts found in input"));d(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:l})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,p.Tl)("Request failed"))}finally{d(!1)}},g=x?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(o.aF,{isOpen:e,title:(0,p.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,p.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.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:k,value:i,onChange:e=>n(e.target.value),disabled:r}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),x&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${x.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",x.success," ",(0,p.Tl)("added"),x.failed>0?`, ✗ ${x.failed} ${(0,p.Tl)("failed")}`:""]}),g.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.$n,{onClick:f,fullWidth:!0,disabled:r||!i.trim(),children:r?(0,p.Tl)("Importing..."):(0,p.Tl)("Import All")}),(0,a.jsx)(o.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:r,children:(0,p.Tl)("Close")})]})]})})}function S({providerId:e,hours:t=24}){let[s,i]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e)return;let s=!1,a=async()=>{try{let a=await fetch(`/api/providers/${e}/health-timeline?hours=${t}`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();s||i(l.timeline||[])}catch{}};a();let l=setInterval(a,6e4),n=()=>{document.hidden?clearInterval(l):(clearInterval(l),a(),l=setInterval(a,6e4))};return document.addEventListener("visibilitychange",n),()=>{s=!0,clearInterval(l),document.removeEventListener("visibilitychange",n)}},[e,t]),!s)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] animate-pulse",children:"monitor_heart"}),"Loading health timeline..."]});if(0===s.length||s.every(e=>0===e.ok&&0===e.err))return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"monitor_heart"}),"No request history yet."]});let n=s.length,r=s.reduce((e,t)=>e+t.ok+t.err,0),o=s.reduce((e,t)=>e+t.err,0),d=Math.max(...s.map(e=>e.ok+e.err),1),c=Math.max(...s.map(e=>e.latency),1),m=Math.max(6*n,120),x=Math.max(m/n-1,2),p=s.filter(e=>e.latency>0).map((e,t)=>{let s=t/Math.max(n-1,1)*m,a=32-e.latency/c*19.2-2;return`${s.toFixed(1)},${a.toFixed(1)}`}),u=p.length>1?`M${p.join(" L")}`:"",h=r>0?Math.round((r-o)/r*100):null;return(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted",children:"Health (24h)"}),null!==h&&(0,a.jsxs)("span",{className:`text-[10px] font-bold ${h>=90?"text-success":h>=70?"text-warning":"text-danger"}`,children:[h,"% success \xb7 ",r," requests \xb7 ",o," errors"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block size-2 rounded-sm bg-success"})," OK"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block size-2 rounded-sm bg-danger"})," Error"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block h-0.5 w-3 bg-info"})," Latency"]})]})]}),(0,a.jsxs)("svg",{width:m,height:32,className:"overflow-visible",children:[s.map((e,t)=>{let s=m/n*t;if(0===e.ok+e.err)return null;let l=e.ok/d*32,i=e.err/d*32;return(0,a.jsxs)("g",{children:[(0,a.jsx)("rect",{x:s,y:32-l-i,width:x,height:i,rx:.5,className:"fill-danger/60"}),(0,a.jsx)("rect",{x:s,y:32-l,width:x,height:l,rx:.5,className:"fill-success/60"})]},t)}),u&&(0,a.jsx)("path",{d:u,fill:"none",strokeWidth:1,className:"stroke-info",strokeDasharray:"2 2"})]})]})}C.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func};var A=s(67098),$=s(5772);function T({providerInfo:e,providerId:t,connections:s,modelCount:l,headerIconPath:i,headerImgError:n,setHeaderImgError:o}){let d=e.notice?.apiKeyUrl||e.notice?.signupUrl||e.website,c=[e.authModes?e.authModes.includes("oauth")&&e.authModes.includes("apikey")?"OAuth + API Key":"oauth"===e.authModes[0]?"OAuth":"cookie"===e.authModes[0]?"Cookie":"API Key":"oauth"===e.authType?"OAuth":"cookie"===e.authType?"Cookie":"API Key"];s.length>0&&c.push(`${s.length} connection${1===s.length?"":"s"}`),l>0&&c.push(`${l} model${1===l?"":"s"}`);let m=e.color||"#6366f1";return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"mt-4 flex min-w-0 items-center gap-4",children:[(0,a.jsx)("div",{className:"flex size-14 shrink-0 items-center justify-center rounded-xl",style:{backgroundColor:`${m}15`},children:n?(0,a.jsx)("span",{className:"text-base font-bold",style:{color:m},children:e.textIcon||e.id?.slice(0,2).toUpperCase()}):(0,a.jsx)($.default,{src:i,alt:e.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>o(!0)})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight text-text-main",children:e.name}),d&&(0,a.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e.notice?.apiKeyUrl?"Get API Key":"Sign up"]}),"moonshot"===t&&(0,a.jsxs)("a",{href:"https://www.kimi.com/activities/viral-referral/share?scenario=invite&from=share_poster&invitation_code=BPGXZR",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-full bg-primary/12 px-3 py-1 text-xs font-semibold text-primary ring-1 ring-primary/20 transition-colors hover:bg-primary/20",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"celebration"}),"Get KIMI K3 For Free"]})]}),(0,a.jsx)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-text-muted",children:c.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[t>0&&(0,a.jsx)("span",{className:"text-text-muted/40",children:"\xb7"}),e]},t))})]})]}),e.deprecated&&(0,a.jsxs)("div",{className:"mt-4 flex items-start gap-2 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mt-0.5 shrink-0 text-[16px] text-yellow-500",children:"warning"}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-red-600 dark:text-yellow-400",children:e.deprecationNotice})]}),e.notice?.text&&!e.deprecated&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2 rounded-lg border border-info/30 bg-info/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[16px] text-info",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-info",children:e.notice.text}),e.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e.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 →"})]})]})}var E=s(31474);function I({title:e,icon:t,count:s,defaultExpanded:i=!0,actions:n=null,children:r,className:o}){let[d,c]=(0,l.useState)(i);return(0,a.jsxs)("div",{className:(0,E.cn)("overflow-hidden rounded-panel border border-border-subtle bg-panel shadow-[var(--shadow-soft)]",o),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-4 py-3",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),className:"flex min-w-0 items-center gap-2 text-left","aria-expanded":d,children:[t&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted",children:t}),(0,a.jsx)("h2",{className:"truncate text-sm font-semibold text-text-main",children:e}),null!=s&&(0,a.jsx)("span",{className:"shrink-0 rounded-full bg-black/5 px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-text-muted dark:bg-white/10",children:s}),(0,a.jsx)("span",{className:(0,E.cn)("material-symbols-outlined text-[18px] text-text-muted transition-transform",d&&"rotate-180"),children:"expand_more"})]}),n&&(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:n})]}),d&&(0,a.jsx)("div",{className:"border-t border-border-subtle",children:r})]})}var P=s(70217);function O({until:e}){let[t,s]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function z({connection:e,proxyPools:t,isOAuth:s,isFirst:i,isLast:n,onMoveUp:r,onMoveDown:d,onToggleActive:c,onUpdateProxy:m,onEdit:x,onDelete:p,oneByOneStatus:u=null,autoPing:h=null}){let[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1),v=(0,l.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,w=N?j.get(N):null,k=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||k,S=w?`Pool: ${w.name}`:N?`Pool: ${N} (inactive/missing)`:k?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",$="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);$=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{$=t}}let T=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E="default";w?.isActive===!0?E="success":(N||k)&&(E="error"),(0,l.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let I=async e=>{y(!0);try{await m("__none__"===e?null:e)}finally{y(!1),g(!1)}},M=e.authType||(s?"oauth":"apikey"),D="oauth"===M,_="cookie"===M,R=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(D?"OAuth Account":_?"Cookie Account":"API Key"),U=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[L,K]=(0,l.useState)(!1),q=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{K(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=q?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[q]);let F="unavailable"!==e.testStatus||L?e.testStatus:"active",J=()=>u?"queued"===u.state?"queued":"testing"===u.state?"testing":"success"===u.state?"success":"failed"===u.state?u.error?`failed: ${u.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:r,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:_?"cookie":D?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:R}),U&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:U}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(o.Ex,{variant:(0,P.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,a.jsx)(o.Ex,{variant:"default",size:"sm",children:D?"OAuth":_?"Cookie":"API Key"}),C&&(0,a.jsx)(o.Ex,{variant:E,size:"sm",children:"Proxy"}),L&&!1!==e.isActive&&(0,a.jsx)(O,{until:q}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),J()&&(0,a.jsx)(o.Ex,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:J()})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),$&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:$}),T&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:T,children:["no_proxy: ",T]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:b?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>I(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,a.jsx)(o.m_,{text:A,children:(0,a.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}O.propTypes={until:b().string.isRequired},z.propTypes={connection:b().shape({id:b().string,name:b().string,email:b().string,displayName:b().string,modelLockUntil:b().string,testStatus:b().string,isActive:b().bool,lastError:b().string,priority:b().number,globalPriority:b().number}).isRequired,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string,proxyUrl:b().string,noProxy:b().string,isActive:b().bool})),isOAuth:b().bool.isRequired,isFirst:b().bool.isRequired,isLast:b().bool.isRequired,onMoveUp:b().func.isRequired,onMoveDown:b().func.isRequired,onToggleActive:b().func.isRequired,onUpdateProxy:b().func,onEdit:b().func.isRequired,onDelete:b().func.isRequired,oneByOneStatus:b().shape({state:b().string,error:b().string}),autoPing:b().shape({on:b().bool,onToggle:b().func,provider:b().string})};let M={healthy:{variant:"success",label:"Pool healthy",icon:"shield"},degraded:{variant:"warning",label:"Pool degraded",icon:"warning"},exhausted:{variant:"error",label:"Pool exhausted",icon:"error"}};function D({providerId:e}){let[t,s]=(0,l.useState)(null);if((0,l.useEffect)(()=>{let t;if(!e)return;let a=!1,l=async()=>{try{let t=await fetch(`/api/providers/${e}/vault-pool`,{cache:"no-store"});if(!t.ok)return;let l=await t.json();a||s(l)}catch{}};l();let i=()=>{t||(t=setInterval(l,1e4))},n=()=>{t&&(clearInterval(t),t=null)},r=()=>document.hidden?n():i();return i(),document.addEventListener("visibilitychange",r),()=>{a=!0,n(),document.removeEventListener("visibilitychange",r)}},[e]),!t||!t.hasPool)return null;let i=M[t.status]||M.healthy;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",title:"Admin-provided shared key pool. Keys are hidden; only counts are shown.",children:[(0,a.jsx)(o.Ex,{variant:i.variant,size:"sm",icon:i.icon,children:i.label}),(0,a.jsxs)(o.Ex,{variant:"info",size:"sm",icon:"key",children:[t.total," pool keys"]}),(0,a.jsxs)(o.Ex,{variant:"success",size:"sm",icon:"check_circle",children:[t.available," available"]}),t.rateLimited>0&&(0,a.jsxs)(o.Ex,{variant:"warning",size:"sm",icon:"schedule",children:[t.rateLimited," cooling"]})]})}function _({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(null),[r,d]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/zai-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}else if(400===a.status||401===a.status){let e=await a.json().catch(()=>({}));t||n(e?.message||"Z.ai profile unavailable")}}catch{}t||d(!1)})(),()=>{t=!0}},[e]),r)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"Z"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[t.isGuest?(0,a.jsx)(o.Ex,{variant:"warning",size:"sm",icon:"person",children:"Guest — GLM-4.7 only"}):(0,a.jsx)(o.Ex,{variant:"success",size:"sm",icon:"check_circle",children:"Signed in"}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"Z.ai web session"})]})]})]}):i?(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"badge"}),(0,a.jsx)("span",{className:"min-w-0",children:i})]}):null}function R({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);if((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/freebuff-profile`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();t||s(l)}catch{}t||n(!1)})(),()=>{t=!0}},[e]),i)return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]});if(!t)return null;let r=t.expires?new Date(t.expires):null,d=r?Math.ceil((r.getTime()-Date.now())/864e5):null,c=null!==d&&d<=3;return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"F"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),r&&(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] text-text-muted",children:"schedule"}),(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["Session expires ",r.toLocaleDateString()]}),null!==d&&(0,a.jsxs)(o.Ex,{variant:c?"warning":"success",size:"sm",children:[d,"d left"]})]})]})]})}function U({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(null),[r,d]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/felo-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}else if(400===a.status||401===a.status){let e=await a.json().catch(()=>({}));t||n(e?.message||"Felo profile unavailable")}}catch{}t||d(!1)})(),()=>{t=!0}},[e]),r)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"F"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),t.uid&&(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Felo"}),(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["UID: ",t.uid]})]})]})]}):i?(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"badge"}),(0,a.jsx)("span",{className:"min-w-0",children:i})]}):null}function L({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);if((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/v0-profile`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();t||s(l)}catch{}t||n(!1)})(),()=>{t=!0}},[e]),i)return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]});if(!t?.profile&&!t?.balance)return null;let{profile:r,balance:d}=t;return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[r?.image?(0,a.jsx)("img",{src:r.image,alt:r.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:r?.name?.charAt(0)?.toUpperCase()||"v"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:r?.name||"User"}),r?.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:r.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[r?.plan&&(0,a.jsx)(o.Ex,{variant:"v0-free"===r.plan?"default":"primary",size:"sm",children:"v0-free"===r.plan?"Free":r.plan}),r?.teamName&&(0,a.jsx)("span",{className:"truncate text-[11px] text-text-muted",children:r.teamName})]})]}),d&&(0,a.jsxs)("div",{className:"flex shrink-0 flex-col items-end",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"bolt"}),(0,a.jsx)("span",{className:"font-mono text-sm font-bold text-text-main",children:d.remaining}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["/",d.total||"?"]})]}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"credits left"})]})]})}function K({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/qwencloud-profile`,{cache:"no-store"});if(!a.ok)return;let l=await a.json();t||s(l)}catch{}t||n(!1)})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[t.image?(0,a.jsx)("img",{src:t.image,alt:t.name,className:"size-9 rounded-full object-cover ring-2 ring-border-subtle"}):(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"Q"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[t.channelId&&(0,a.jsxs)(o.Ex,{variant:"info",size:"sm",children:["Region: ",t.channelId]}),t.uid&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted",children:["UID: ",t.uid]})]})]})]}):null}function q({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/inxora-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:t.name?.charAt(0)?.toUpperCase()||"I"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:t.name}),t.email&&(0,a.jsx)("span",{className:"truncate text-xs text-text-muted",children:t.email})]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5",children:[t.plan&&(0,a.jsx)(o.Ex,{variant:"FREE"===t.plan?"default":"primary",size:"sm",children:t.plan}),!1===t.isActive&&(0,a.jsx)(o.Ex,{variant:"danger",size:"sm",children:"Inactive"})]})]})]}):null}function F({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/onemin-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:"1M"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:"1min.ai"}),t.plan&&(0,a.jsx)(o.Ex,{variant:"primary",size:"sm",children:t.plan})]}),null!=t.credits&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Credits: ",Number(t.credits).toLocaleString(void 0,{maximumFractionDigits:2})]})]})]}):null}function J({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/onemin-api-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:"1M"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:"1min.ai (API)"}),t.plan&&(0,a.jsx)(o.Ex,{variant:"primary",size:"sm",children:t.plan})]}),null!=t.credits&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Credits: ",Number(t.credits).toLocaleString(void 0,{maximumFractionDigits:2})]})]})]}):null}function B({connectionId:e}){let[t,s]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0);return((0,l.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e}/agnes-profile`,{cache:"no-store"});if(a.ok){let e=await a.json();t||s(e)}}catch{}finally{t||n(!1)}})(),()=>{t=!0}},[e]),i)?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-sidebar"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("div",{className:"h-3 w-32 animate-pulse rounded bg-sidebar"}),(0,a.jsx)("div",{className:"h-2 w-48 animate-pulse rounded bg-sidebar"})]})]}):t?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,a.jsx)("div",{className:"flex size-9 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary",children:"AG"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:"Agnes"}),t.username&&(0,a.jsxs)(o.Ex,{variant:"primary",size:"sm",children:["@",t.username]})]}),null!=t.credits&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Credits: ",Number(t.credits).toLocaleString()]})]})]}):null}function W({connectionId:e,cookie:t,currentPlan:s="free",onPlanChanged:i}){let n,[r,d]=(0,l.useState)([]),[c,m]=(0,l.useState)(s),[x,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(null),v=(n=String(t||"").match(/ctoken=([^;]+)/),n?.[1]||"");(0,l.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/providers/zenmux-free/zenmux-plans",{cache:"no-store"});if(!t.ok)return;let s=await t.json();!e&&Array.isArray(s.plans)&&d(s.plans)}catch{}})(),()=>{e=!0}},[]),(0,l.useEffect)(()=>{if(!v)return;let e=!1;return h(!0),(async()=>{try{let t=await fetch("/api/providers/zenmux-free/zenmux-plans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ctoken:v})});if(!t.ok)return;let a=await t.json();!e&&a.planKey&&(p(a.planKey),s&&"free"!==s||m(a.planKey))}catch{}finally{e||h(!1)}})(),()=>{e=!0}},[v,s]);let j=async t=>{let a=t.target.value;m(a),g(!0),y(null);try{if(!(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{zenmuxPlan:a}})})).ok)throw Error("Failed to save plan");i?.(a)}catch(e){y(e.message),m(s)}finally{g(!1)}},N=x&&x===c;return 0===r.length?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"ZenMux Plan"}),(0,a.jsx)("select",{value:c,onChange:j,disabled:!0,className:"appearance-none rounded-brand border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-muted [-webkit-appearance:none] [-moz-appearance:none]",children:(0,a.jsxs)("option",{value:c,children:[c," (loading…)"]})})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"ZenMux Plan"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("select",{value:c,onChange:j,disabled:f,title:"Select your ZenMux subscription plan. Models from this plan will be available.",className:"appearance-none rounded-brand border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 disabled:opacity-50",children:r.map(e=>(0,a.jsxs)("option",{value:e.planKey,children:[e.name," (",e.modelCount," models",e.price>0?`, $${e.price}/mo`:", free",")"]},e.planKey))}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"})})]}),u&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Detecting…"}),N&&!u&&(0,a.jsx)(o.Ex,{variant:"success",size:"sm",icon:"check_circle",dot:!0,children:"Auto-detected"}),f&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Saving…"}),b&&(0,a.jsx)(o.Ex,{variant:"error",size:"sm",icon:"error",children:b})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted",children:x?`Plan auto-detected from your ctoken: ${x}. You can override manually if needed.`:"Select your ZenMux subscription plan. Models available depend on your plan."})]})}let G=[{key:"now",label:"Now",desc:"Real-time streaming — no waiting",savings:"0%"},{key:"soon",label:"Soon",desc:"Short delay, small discount",savings:"~10%"},{key:"later",label:"Later",desc:"~15 min wait, ~50% cheaper",savings:"~50%"},{key:"anytime",label:"Anytime",desc:"Best-effort, up to 65% cheaper",savings:"up to 65%"}];function H({connectionId:e,currentWindow:t="now",onWindowChanged:s}){let[i,n]=(0,l.useState)(t),[r,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(null),x=async a=>{let l=a.target.value;n(l),d(!0),m(null);try{if(!(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSpecificData:{completionWindow:l}})})).ok)throw Error("Failed to save window");s?.(l)}catch(e){m(e.message),n(t)}finally{d(!1)}},p=G.find(e=>e.key===i)||G[0],u="now"!==i;return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Completion Window"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("select",{value:i,onChange:x,disabled:r,title:"Pick a completion window. Longer windows cost less but wait longer.",className:"appearance-none rounded-brand border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 disabled:opacity-50",children:G.map(e=>(0,a.jsxs)("option",{value:e.key,children:[e.label," (",e.savings," off)"]},e.key))}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"})})]}),u&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",icon:"schedule",dot:!0,children:"Async"}),r&&(0,a.jsx)(o.Ex,{variant:"info",size:"sm",children:"Saving…"}),c&&(0,a.jsx)(o.Ex,{variant:"error",size:"sm",icon:"error",children:c})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted",children:[p.desc,u&&" — results polled automatically with keep-alive heartbeats."]})]})}var Q=s(4823);function V({providerId:e,isOAuth:t,isCompatible:s,isFreeNoAuth:l,hasDualAuthModes:i,oauthConnectionLabel:n,apiKeyConnectionLabel:r,thinkingConfig:d,AUTO_PING_SETTINGS_KEYS:c,connections:m,proxyPools:x,selectedConnectionIds:u,selectedConnections:h,allSelected:f,oneByOneRunning:g,oneByOneStopping:b,oneByOneCurrentConnectionId:y,oneByOneResults:v,oneByOneSummary:j,providerStrategy:N,providerStickyLimit:w,thinkingMode:k,autoPing:C,showBulkProxyModal:S,bulkUpdatingProxy:A,activePools:$,selectedProxySummary:T,handleSwapPriority:E,handleUpdateConnectionStatus:I,handleDelete:P,handleBulkDelete:O,handleRunOneByOneTest:M,handleStopOneByOneTest:G,handleRoundRobinToggle:Z,handleStickyLimitChange:X,handleThinkingModeChange:Y,handleAutoPingConnection:ee,triggerOAuthConnection:et,triggerApiKeyConnection:es,triggerAddConnection:ea,toggleSelectConnection:el,toggleSelectAllConnections:ei,openBulkProxyModal:en,closeBulkProxyModal:er,applyProxyAssignments:eo,handleApplySinglePool:ed,handleApplyOneToOne:ec,fetchConnections:em,setSelectedConnection:ex,setShowEditModal:ep,setShowBulkProxyModal:eu,setShowIFlowCookieModal:eh,setShowBulkImportCodex:ef,setConnections:eg}){return l?(0,a.jsx)(Q.default,{providerId:e}):(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 border-b border-border-subtle px-4 py-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Connections"}),m.length>0&&(0,a.jsx)("span",{className:"rounded-full bg-black/5 px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-text-muted dark:bg-white/10",children:m.length})]}),(0,a.jsx)(D,{providerId:e}),"zai-web"===e&&m.length>0&&(0,a.jsx)(_,{connectionId:m[0].id}),"felo-web"===e&&m.length>0&&(0,a.jsx)(U,{connectionId:m[0].id}),"freebuff-web"===e&&m.length>0&&(0,a.jsx)(R,{connectionId:m[0].id}),"v0-vercel-web"===e&&m.length>0&&(0,a.jsx)(L,{connectionId:m[0].id}),"qwencloud"===e&&m.length>0&&(0,a.jsx)(K,{connectionId:m[0].id}),"inxorastudio-web"===e&&m.length>0&&(0,a.jsx)(q,{connectionId:m[0].id}),"1min"===e&&m.length>0&&(0,a.jsx)(F,{connectionId:m[0].id}),"1min-api"===e&&m.length>0&&(0,a.jsx)(J,{connectionId:m[0].id}),"agnes-web"===e&&m.length>0&&(0,a.jsx)(B,{connectionId:m[0].id})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[m.length>0&&x.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:en,children:"Apply Proxy"}),m.length>0&&u.length>0&&(0,a.jsxs)(o.$n,{size:"sm",variant:"danger",icon:"delete",onClick:O,children:["Delete (",u.length,")"]}),m.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:g?"progress_activity":"sync",onClick:M,disabled:g,className:g?"animate-pulse":"",children:g?"Testing...":"Test All"}),g&&(0,a.jsx)(o.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:G,disabled:b,children:b?"Stopping":"Stop"})]}),d&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Thinking"}),(0,a.jsx)("select",{value:k,onChange:e=>Y(e.target.value),className:"h-7 rounded-lg border border-border bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-surface-2 dark:border-white/10 dark:bg-white/[0.03]",children:d.options.map(e=>(0,a.jsx)("option",{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Round Robin"}),(0,a.jsx)(o.lM,{checked:"round-robin"===N,onChange:Z}),"round-robin"===N&&(0,a.jsx)("input",{type:"number",min:1,value:w,onChange:e=>X(e.target.value),placeholder:"1",className:"w-12 rounded-lg border border-border bg-black/[0.02] px-1.5 py-0.5 text-xs text-text-primary outline-none dark:border-white/10 dark:bg-white/[0.03]",title:"Sticky limit (requests per account before rotating)"})]}),"zenmux-free"===e&&m.length>0&&(0,a.jsx)(W,{connectionId:m[0].id,cookie:m[0].apiKey||"",currentPlan:m[0].providerSpecificData?.zenmuxPlan||"free",onPlanChanged:em}),"marathon"===e&&m.length>0&&(0,a.jsx)(H,{connectionId:m[0].id,currentWindow:m[0].providerSpecificData?.completionWindow||"now",onWindowChanged:em})]})]}),0===m.length?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 px-4 py-8 text-center",children:[(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:t?"lock":"key"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:"No connections yet"}),i&&(0,a.jsxs)("p",{className:"mt-0.5 text-xs text-text-muted",children:["Choose ",n," or ",r]})]}),(0,a.jsx)("div",{className:"flex flex-wrap justify-center gap-2",children:i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:et,children:n}),(0,a.jsx)(o.$n,{size:"sm",icon:"key",onClick:es,children:r})]}):(0,a.jsxs)(a.Fragment,{children:[!s&&"iflow"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>eh(!0),children:"Cookie"}),"codex"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ef(!0),children:(0,p.Tl)("Bulk Add")}),(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:ea,children:s?"Add API Key":"iflow"===e?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)("div",{className:"flex flex-col",children:[j&&(0,a.jsxs)("div",{className:"border-b border-border-subtle px-4 py-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"checklist"}),(0,a.jsxs)("span",{className:"font-medium text-text-main",children:[j.completed,"/",j.total]})]}),j.passed>0&&(0,a.jsxs)("span",{className:"text-success",children:["✓ ",j.passed]}),j.failed>0&&(0,a.jsxs)("span",{className:"text-danger",children:["✗ ",j.failed]}),j.stopped&&(0,a.jsx)("span",{className:"text-warning",children:"Stopped"}),g&&y&&(0,a.jsxs)("span",{className:"truncate text-text-muted",children:["Testing: ",m.find(e=>e.id===y)?.name||y]})]}),j.total>0&&(0,a.jsx)("div",{className:"mt-1.5 h-1 overflow-hidden rounded-full bg-surface-2",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${j.completed/j.total*100}%`}})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-border-subtle px-4 py-2",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:f,onChange:ei,className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]}),u.length>0&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[u.length," selected"]})]}),(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-border-subtle",children:m.map((s,l)=>{let i;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-2 sm:pl-3",children:(0,a.jsx)("input",{type:"checkbox",checked:(i=s.id,u.includes(i)),onChange:()=>el(s.id),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)(z,{connection:s,proxyPools:x,isOAuth:t,isFirst:0===l,isLast:l===m.length-1,onMoveUp:()=>E(l,l-1),onMoveDown:()=>E(l,l+1),onToggleActive:e=>I(s.id,e),autoPing:c[e]&&"oauth"===s.authType?{on:!0===C.connections[s.id],onToggle:e=>ee(s.id,e),provider:e}:null,onUpdateProxy:async e=>{try{(await fetch(`/api/providers/${s.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e||null})})).ok&&eg(t=>t.map(t=>t.id===s.id?{...t,providerSpecificData:{...t.providerSpecificData,proxyPoolId:e||null}}:t))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ex(s),ep(!0)},onDelete:()=>P(s.id),oneByOneStatus:v[s.id]||null})})]},s.id)})}),!s&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border-subtle px-4 py-3",children:["iflow"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>eh(!0),children:"Cookie"}),"codex"===e&&(0,a.jsx)(o.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ef(!0),children:(0,p.Tl)("Bulk Add")}),i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:et,children:n}),(0,a.jsx)(o.$n,{size:"sm",icon:"key",onClick:es,children:r})]}):(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:ea,children:"Add"})]})]}),(0,a.jsx)(o.aF,{isOpen:S,onClose:er,title:`Apply Proxy (${m.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[T&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:T}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:ec,disabled:A||0===$.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>ed(null),disabled:A,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),x.map(e=>(0,a.jsxs)("button",{onClick:()=>ed(e.id),disabled:A||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),A&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(o.$n,{onClick:er,variant:"ghost",fullWidth:!0,disabled:A,children:"Cancel"})]})})]})}let Z=[{value:"auto",label:"Auto",hint:"No override"},{value:"none",label:"Off",hint:"Disable thinking"},{value:"minimal",label:"Minimal",hint:"512 tokens"},{value:"low",label:"Low",hint:"1,024 tokens"},{value:"medium",label:"Medium",hint:"8,192 tokens"},{value:"high",label:"High",hint:"24,576 tokens"},{value:"xhigh",label:"X-High",hint:"32,768 tokens"},{value:"max",label:"Max",hint:"128,000 tokens"}];function X({caps:e,selectedLevel:t,onSelect:s}){let[i,n]=(0,l.useState)(!1),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!i)return;let e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let o=e?.thinkingLevels,d=Z.filter(t=>"auto"===t.value||(o?o.includes(t.value):"none"===t.value?e?.thinkingCanDisable!==!1:"max"!==t.value||e?.thinkingMaxEffort===!0)),c=d.find(e=>e.value===t)||d[0];return(0,a.jsxs)("div",{className:"relative",ref:r,children:[(0,a.jsx)("button",{onClick:()=>n(e=>!e),title:`Thinking: ${c.label}${c.hint?` (${c.hint})`:""}`,className:`rounded p-0.5 transition-colors ${"auto"!==t?"text-primary":"text-text-muted hover:bg-sidebar hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"psychology"})}),i&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[140px] rounded-lg border border-border bg-panel shadow-[var(--shadow-warm)]",children:[(0,a.jsx)("div",{className:"px-2 py-1.5 border-b border-border-subtle",children:(0,a.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-text-muted",children:"Thinking Level"})}),d.map(e=>(0,a.jsxs)("button",{onClick:()=>{s(e.value),n(!1)},className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-xs transition-colors hover:bg-sidebar ${e.value===t?"text-primary font-semibold":"text-text-main"}`,children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:e.hint})]},e.value))]})]})}function Y({model:e,fullModel:t,alias:s,copied:i,onCopy:n,testStatus:r,isCustom:d,isFree:c,onDeleteAlias:m,onTest:x,isTesting:p,onDisable:u,caps:h}){let[f,g]=(0,l.useState)("auto"),b="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0,y=!!h?.reasoning,v="auto"!==f&&"none"!==f?`${t}(${f})`:"none"===f?`${t}(none)`:t;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:b?{color:b}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:v}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(o.nh,{caps:h,colorOverride:"text-text-muted/70",size:12})]})]}),y&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)(X,{caps:h,selectedLevel:f,onSelect:g}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:"Thinking"})]}),x&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:x,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>n(v,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),d?(0,a.jsx)("button",{onClick:m,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function ee({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:l="llm",includeLegacyAliases:i=!0}){let n=new Set(a.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(l&&e!==l||n.has(t.id))continue;let a=`${s}/${t.id}`;r.has(a)||(r.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!i)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||n.has(t)||r.has(s)||(r.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:l||"llm"}))}return o}Y.propTypes={model:b().shape({id:b().string.isRequired}).isRequired,fullModel:b().string.isRequired,alias:b().string,copied:b().string,onCopy:b().func.isRequired,testStatus:b().oneOf(["ok","error"]),isCustom:b().bool,isFree:b().bool,onDeleteAlias:b().func,onTest:b().func,isTesting:b().bool,onDisable:b().func,caps:b().object};var et=s(5507);function es({modelId:e,fullModel:t,copied:s,onCopy:l,onDeleteAlias:i,onTest:n,testStatus:r,isTesting:o}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function ea({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:i,copied:n,onCopy:r,onDeleteAlias:d,onAddCustomModel:c,onDeleteCustomModel:m,connections:x,isAnthropic:p}){let[u,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1),[v,j]=(0,l.useState)(null),[N,w]=(0,l.useState)({}),k=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();w(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=ee({customModels:i,modelAliases:s,providerAlias:e,type:"llm"}),S=C.length>20,A=(0,l.useRef)(null),[$,T]=(0,l.useState)(0),[E,I]=(0,l.useState)(480),P=(0,l.useMemo)(()=>{let e=Array(C.length),t=0;for(let s=0;s<C.length;s++)e[s]=t,t+=66;return{offsets:e,total:t}},[C.length]),{start:O,end:z}=(0,l.useMemo)(()=>(0,et.$7)(P.offsets,P.total,$,E,4),[P,$,E]);(0,l.useEffect)(()=>{let e=A.current;if(!e)return;let t=Math.max(0,P.total-E);e.scrollTop>t&&(e.scrollTop=t,T(t))},[P.total,E,$]),(0,l.useEffect)(()=>{let e=A.current;if(!e||"u"<typeof ResizeObserver)return;let t=()=>I(e.clientHeight||480);t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[S,C.length]);let M=(0,l.useCallback)(e=>T(e.currentTarget.scrollTop),[]),D=Math.min(O,C.length),_=Math.min(z,C.length-1),R=D>=C.length?P.total:P.offsets[D],U=_+1<C.length?Math.max(0,P.total-P.offsets[_+1]):0,L=async()=>{if(!u.trim()||f)return;let e=u.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await c(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},K=async()=>{if(b)return;let e=x.find(e=>!1!==e.isActive);if(e){y(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let l=0;for(let e of a){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await c(t),l+=1))}0===l&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{y(!1)}}},q=x.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",p?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&L(),placeholder:p?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:L,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"download",onClick:K,disabled:!q||b,children:b?"Importing...":"Import from /models"})]}),!q&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,a.jsxs)("div",{ref:S?A:void 0,onScroll:S?M:void 0,className:S?"max-h-[480px] overflow-y-auto flex flex-col gap-3 pr-1":"flex flex-col gap-3",children:[S&&R>0&&(0,a.jsx)("div",{style:{height:R},"aria-hidden":!0}),C.slice(D,_+1).map(({id:s,alias:l,source:i})=>(0,a.jsx)(es,{modelId:s,fullModel:`${t}/${s}`,copied:n,onCopy:r,onDeleteAlias:()=>"custom"===i?m(s):d(l),onTest:x.length>0?()=>k(s):void 0,testStatus:N[s],isTesting:v===s},`${i}-${e}/${s}`)),S&&U>0&&(0,a.jsx)("div",{style:{height:U},"aria-hidden":!0})]})]})}function el({providerId:e,isCompatible:t,isAnthropicCompatible:s,isFreeNoAuth:l,providerStorageAlias:i,providerDisplayAlias:n,models:r,kiloFreeModels:m,modelAliases:x,customModels:u,disabledModelIds:h,modelTestResults:f,testingModelIds:g,testingAllModels:b,modelsTestError:y,modelSearchQuery:v,connections:j,suggestedModels:N,importingQoderModels:w,copied:k,getCaps:C,copy:S,handleTestModel:A,handleTestAllModels:$,handleDisableModel:T,handleEnableModel:E,handleDisableAll:I,handleEnableAll:P,handleSetAlias:O,handleDeleteAlias:z,handleAddCustomModel:M,handleDeleteCustomModel:D,handleImportQoderModels:_,setModelSearchQuery:R,setShowAddCustomModel:U}){let L,K,q;if(t)return(0,a.jsx)("div",{className:"px-4 py-3",children:(0,a.jsx)(ea,{providerStorageAlias:i,providerDisplayAlias:n,modelAliases:x,customModels:u,copied:k,onCopy:S,onSetAlias:O,onDeleteAlias:z,onAddCustomModel:e=>M(e,"llm",i),onDeleteCustomModel:e=>D(e,"llm",i),connections:j,isAnthropic:s})});let F=[...r,...m.filter(e=>!r.some(t=>t.id===e.id))].filter(e=>{let t=(0,c.CP)(e);return!t||"llm"===t}),J=new Set(h),B=F.filter(e=>!J.has(e.id)),W=F.filter(e=>J.has(e.id)),G=ee({customModels:u,modelAliases:x,providerAlias:i,builtInModels:r,type:"llm"}),H=v.trim().toLowerCase(),Q=(e,t="")=>!H||e.toLowerCase().includes(H)||String(t).toLowerCase().includes(H),V=B.filter(e=>Q(e.id,e.name)),Z=G.filter(e=>Q(e.id,e.name)),X=F.map(e=>e.id).filter(e=>!h.includes(e)),et=X.filter(e=>!H||e.toLowerCase().includes(H));return(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border-subtle px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:P,children:"Active All"}),X.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>I(X),children:"Disable All"}),(j.length>0||l)&&et.length>0&&(0,a.jsx)(o.$n,{size:"sm",variant:"primary",icon:b?"progress_activity":"play_arrow",onClick:()=>$(et),disabled:b,className:b?"animate-pulse":"",children:b?"Testing...":`Test All (${et.length})`})]}),(0,a.jsx)("div",{className:"sm:w-56",children:(0,a.jsx)(o.pd,{type:"search",placeholder:"Search models...",value:v,onChange:e=>R(e.target.value),className:"w-full"})})]}),(0,a.jsxs)("div",{className:"px-4 py-3",children:[d.Q2[e]?.capabilities?.toolUse===!1&&(0,a.jsxs)("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-warning/20 bg-warning/[0.04] px-3 py-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-warning",children:"info"}),(0,a.jsxs)("p",{className:"text-[11px] leading-relaxed text-text-muted",children:["Cookie-based provider — these models run through a browser chat endpoint and"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:"cannot execute tool/function calls"}),"."," ","Smart Routing combos will exclude them from tool-calling pools and use them only for research intents."]})]}),!!y&&(0,a.jsx)("p",{className:"mb-3 break-words text-xs text-danger",children:y}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[Z.map(t=>(0,a.jsx)(Y,{model:{id:t.id,name:t.name},fullModel:`${n}/${t.id}`,alias:t.alias,copied:k,onCopy:S,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===t.source?D(t.id,"llm",i):z(t.alias)},testStatus:f[t.id],onTest:j.length>0||l?()=>A(t.id):void 0,isTesting:g.has(t.id),isCustom:!0,isFree:!1,caps:C(`${e}/${t.id}`)},`${t.source}-${t.fullModel}`)),V.map(t=>{let s=`${i}/${t.id}`,r=`${e}/${t.id}`,o=Object.entries(x).find(([,e])=>e===s||e===r)?.[0];return(0,a.jsx)(Y,{model:t,fullModel:`${n}/${t.id}`,alias:o,copied:k,onCopy:S,onSetAlias:e=>O(t.id,e,i),onDeleteAlias:()=>z(o),testStatus:f[t.id],onTest:j.length>0||l?()=>A(t.id):void 0,isTesting:g.has(t.id),isFree:t.isFree,onDisable:()=>T(t.id),caps:C(`${e}/${t.id}`)},t.id)})]}),v.trim()&&0===V.length&&0===Z.length&&(0,a.jsxs)("p",{className:"w-full py-4 text-center text-sm text-text-muted",children:["No models match “",v,"”"]}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,a.jsxs)("button",{onClick:()=>U(!0),className:"flex items-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",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===e&&j.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:_,disabled:w,className:"flex items-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-info transition-colors hover:border-blue-500 hover:bg-blue-500/5 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:w?{animation:"spin 1s linear infinite"}:void 0,children:w?"progress_activity":"download"}),w?(0,p.Tl)("Fetching..."):(0,p.Tl)("Fetch Qoder Models")]})]}),N.length>0&&(L=new Set([...Object.values(x),...G.map(e=>e.fullModel)]),K=new Set(r.map(e=>e.id)),0===(q=N.filter(e=>!L.has(`${i}/${e.id}`)&&!K.has(e.id))).length?null:(0,a.jsxs)("div",{className:"mt-3 w-full",children:[(0,a.jsx)("p",{className:"mb-2 text-[10px] uppercase tracking-wide text-text-muted",children:"Suggested free models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:q.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await M(e.id,"llm",i)},className:"flex items-center gap-1 rounded-lg border border-border px-2.5 py-1.5 text-xs text-text-muted transition-colors hover:border-primary/40 hover:bg-primary/5 hover:text-primary",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),W.length>0&&(0,a.jsxs)("div",{className:"mt-3 w-full",children:[(0,a.jsxs)("p",{className:"mb-2 text-[10px] uppercase tracking-wide text-text-muted",children:["Disabled (",W.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:W.map(e=>(0,a.jsxs)("button",{onClick:()=>E(e.id),className:"flex items-center gap-1 rounded-lg border border-dashed border-border px-2.5 py-1.5 text-xs text-text-muted transition-colors hover:border-primary/40 hover:bg-primary/5 hover:text-primary",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})]})}ea.propTypes={providerStorageAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,modelAliases:b().object.isRequired,customModels:b().arrayOf(b().object),copied:b().string,onCopy:b().func.isRequired,onDeleteAlias:b().func.isRequired,onAddCustomModel:b().func.isRequired,onDeleteCustomModel:b().func.isRequired,connections:b().arrayOf(b().shape({id:b().string,isActive:b().bool})).isRequired,isAnthropic:b().bool};let ei={claude:"claudeAutoPing",codex:"codexAutoPing"};function en(){let e=(0,i.useParams)(),t=(0,i.useRouter)(),s=e.id,{getCaps:n}=(0,x.y)(),{markSeen:u}=(0,A.P)("providers");(0,l.useEffect)(()=>{s&&u(s)},[s,u]);let[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)(!0),[k,$]=(0,l.useState)(null),[E,P]=(0,l.useState)([]),[O,z]=(0,l.useState)(!1),[M,D]=(0,l.useState)(!1),[_,R]=(0,l.useState)(!1),[U,L]=(0,l.useState)(""),[K,q]=(0,l.useState)(!1),[F,J]=(0,l.useState)(!1),[B,W]=(0,l.useState)(!1),[G,H]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)(null),[X,Y]=(0,l.useState)({}),[ee,et]=(0,l.useState)([]),[es,ea]=(0,l.useState)(!1),[en,er]=(0,l.useState)({}),[eo,ed]=(0,l.useState)(""),[ec,em]=(0,l.useState)(()=>new Set),[ex,ep]=(0,l.useState)(""),[eu,eh]=(0,l.useState)(!1),[ef,eg]=(0,l.useState)(!1),[eb,ey]=(0,l.useState)([]),[ev,ej]=(0,l.useState)("__none__"),[eN,ew]=(0,l.useState)(!1),[ek,eC]=(0,l.useState)(null),[eS,eA]=(0,l.useState)(""),[e$,eT]=(0,l.useState)("auto"),[eE,eI]=(0,l.useState)({enabled:!1,connections:{}}),[eP,eO]=(0,l.useState)([]),[ez,eM]=(0,l.useState)([]),[eD,e_]=(0,l.useState)([]),[eR,eU]=(0,l.useState)(null),[eL,eK]=(0,l.useState)(!1),[eq,eF]=(0,l.useState)(!1),[eJ,eB]=(0,l.useState)(!1),[eW,eG]=(0,l.useState)(null),[eH,eQ]=(0,l.useState)({}),[eV,eZ]=(0,l.useState)(null),eX=(0,l.useRef)(!1),[eY,e0]=(0,l.useState)(!1),{copied:e1,copy:e2}=(0,m.C)(),e5="ag_risk_confirmed",e3=["1min","qwen-web"],e4=()=>{z(!0)},e8=()=>{"antigravity"===s&&"true"!==window.localStorage.getItem(e5)?eK(!0):te||e3.includes(s)?e4():(L(""),R(!0))},e6=()=>{L(""),R(!0)},e7=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:d.zN[s]||d.fg[s]||d.IS[s]||d.nJ[s]||d.br[s],e9=e7?.authModes||[],te=(!!d.zN[s]||!!d.IS[s]||e9.includes("oauth"))&&e7?.hasOAuth!==!1,tt=!!d.fg[s]||e9.includes("apikey")||e7?.hasOAuth===!1,ts=!!d.IS[s]?.noAuth,ta=(0,c.KC)(s),tl=(0,d.wG)(s),ti=(0,d.mq)(s),tn=(0,d.gb)(s),tr=ti||tn,to=!tr&&te&&tt,td="xai"===s?"Grok Build OAuth":"OAuth",tc="xai"===s?"xAI API Key":"API Key",tm=d.Q2[s]?.thinkingConfig||d.s9.extended,tx=tr?s:tl,tp=tr?k?.prefix||s:tl,tu=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}`,{cache:"no-store"}),t=await e.json();e.ok&&e_(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tx]),th=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tx,ids:[e]})})).ok&&await tu()}catch(e){console.log("Error disabling model:",e)}},tf=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling model:",e)}},tg=async e=>{e.length&&eU({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eU(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tx,ids:e})})).ok&&await tu()}catch(e){console.log("Error disabling all models:",e)}}})},tb=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error enabling all models:",e)}},ty=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Y(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tv=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&et(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,l.useEffect)(()=>{"kilocode"===s&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eM(e.models)}).catch(()=>{})},[s]);let tj=(0,l.useCallback)(async()=>{try{let[e,t,a,l]=await Promise.all([fetch("/api/providers",{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"})]),i=await e.json(),n=await t.json(),r=await a.json(),o=l.ok?await l.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===s);b(e)}a.ok&&P(r.proxyPools||[]);let d=(o.providerStrategies||{})[s]||{};eC(d.fallbackStrategy||null),eA(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[s]||{};eT(c.mode||"auto");let m=ei[s],x=m&&o[m]||{};if(eI({enabled:!0===x.enabled,connections:x.connections||{}}),t.ok){let e=(n.nodes||[]).find(e=>e.id===s)||null;if(!e&&tr)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===s)||null))break}$(e)}}catch(e){console.log("Error fetching connections:",e)}finally{v(!1)}},[s,tr]),tN=async e=>{try{let t=await fetch(`/api/provider-nodes/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&($(a.node),await tj(),W(!1))}catch(e){console.log("Error updating provider node:",e)}},tw=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),l=(a.ok?await a.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let n={...l};0===Object.keys(i).length?delete n[s]:n[s]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("Error saving provider strategy:",e)}},tk=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[s]={mode:e}:delete a[s],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)}},tC=async e=>{let t=ei[s];if(t){eI(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,l.useEffect)(()=>{tj(),ty(),tv(),tu()},[tj,ty,tv,tu]),(0,l.useEffect)(()=>{let e=(d.zN[s]||d.fg[s]||d.IS[s]||d.nJ[s]||d.br[s])?.modelsFetcher;if(!e)return void eO([]);let t=!1,a=g.find(e=>!1!==e.isActive);return h(e,{connectionId:a?.id}).then(e=>{t||eO(e)}),()=>{t=!0}},[s,g]);let tS=async(e,t,s=tl)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await ty();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tA=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ty()}catch(e){console.log("Error deleting alias:",e)}},t$=async(e,t="llm",s=tx)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tv(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tT=async(e,t="llm",s=tx)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tv(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tE=async()=>{if(eY)return;let e=g.find(e=>!1!==e.isActive);if(!e)return void alert((0,p.Tl)("Please add an active Qoder connection first"));e0(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,p.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,p.Tl)("No models returned"));let l=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");ee.some(e=>e.providerAlias===tx&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(X).includes(`${tx}/${s}`)||(await t$(s,"llm",tx),l+=1)}0===l?alert((0,p.Tl)("All models already exist, no new models added")):alert((0,p.Tl)("Successfully added")+` ${l} `+(0,p.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,p.Tl)("Error fetching models")+": "+e.message)}finally{e0(!1)}},tI=async()=>{if(eq||0===g.length)return;let e=Object.fromEntries(g.map(e=>[e.id,{state:"queued",error:null}]));eX.current=!1,eF(!0),eB(!1),eG(null),eQ(e),eZ({total:g.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<g.length;e+=1){if(eX.current){eZ({total:g.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=g[e];eG(a.id),eQ(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),l=await e.json(),i=!!l.valid;i?t+=1:s+=1,eQ(e=>({...e,[a.id]:{state:i?"success":"failed",error:i?null:l.error||null}}))}catch(e){s+=1,eQ(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eZ({total:g.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<g.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eG(null),eF(!1),eB(!1),eX.current=!1}},tP=async e=>{eU({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eU(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tO=()=>{tj(),z(!1)},tz=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:s,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tj(),R(!1);return}L(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}},tM=async e=>{try{(await fetch(`/api/providers/${Q.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tj(),J(!1))}catch(e){console.log("Error updating connection:",e)}},tD=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t_=async(e,t)=>{let s=[...g];[s[e],s[t]]=[s[t],s[e]],b(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tj()}},tR=g.filter(e=>eb.includes(e.id)),tU=g.length>0&&eb.length===g.length;(0,l.useEffect)(()=>{ey(e=>e.filter(e=>g.some(t=>t.id===e)))},[g]);let tL=(()=>{if(0===tR.length)return"";let e=new Set(tR.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=E.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),tK=async e=>{ew(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tj(),H(!1)}finally{ew(!1)}},tq=E.filter(e=>!0===e.isActive),tF=async e=>{if(!ec.has(e)){em(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:`${tx}/${e}`})}),s=await t.json();er(t=>({...t,[e]:s.ok?"ok":"error"})),ed(s.ok?"":s.error||"Model not reachable")}catch{er(t=>({...t,[e]:"error"})),ed("Network error")}finally{em(t=>{let s=new Set(t);return s.delete(e),s})}}},tJ=async e=>{eu||0===e.length||(eh(!0),ed(""),await Promise.all(e.map(e=>tF(e))),eh(!1))};if(y)return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.Qv,{}),(0,a.jsx)(o.Qv,{})]});if(!e7)return(0,a.jsxs)("div",{className:"py-20 text-center",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(r(),{href:"/dashboard/providers",className:"mt-4 inline-block text-primary",children:"Back to Providers"})]});let tB=(0,f.k)(e7.id,e7.apiType);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,a.jsx)(T,{providerInfo:e7,providerId:s,connections:g,modelCount:ta.length,headerIconPath:tB,headerImgError:es,setHeaderImgError:ea}),"kimi-desktop"===s&&(0,a.jsx)(o.P1,{}),tr&&k&&(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tn?"Anthropic Compatible":"OpenAI Compatible"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tn?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tn?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>{L(""),R(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>W(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{eU({title:"Delete Compatible Node",message:`Delete this ${tn?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eU(null);try{(await fetch(`/api/provider-nodes/${s}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),(0,a.jsx)(I,{title:"Connections",icon:"cable",count:g.length,defaultExpanded:!0,children:(0,a.jsx)(V,{providerId:s,isOAuth:te,isCompatible:tr,isFreeNoAuth:ts,hasDualAuthModes:to,oauthConnectionLabel:td,apiKeyConnectionLabel:tc,thinkingConfig:tm,AUTO_PING_SETTINGS_KEYS:ei,connections:g,proxyPools:E,selectedConnectionIds:eb,selectedConnections:tR,allSelected:tU,oneByOneRunning:eq,oneByOneStopping:eJ,oneByOneCurrentConnectionId:eW,oneByOneResults:eH,oneByOneSummary:eV,providerStrategy:ek,providerStickyLimit:eS,thinkingMode:e$,autoPing:eE,showBulkProxyModal:G,bulkUpdatingProxy:eN,activePools:tq,selectedProxySummary:tL,handleSwapPriority:t_,handleUpdateConnectionStatus:tD,handleDelete:tP,handleBulkDelete:()=>{let e=eb.length;0!==e&&eU({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eU(null);let e=0,t=[...eb];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}b(e=>e.filter(e=>!t.includes(e.id))),ey([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},handleRunOneByOneTest:tI,handleStopOneByOneTest:()=>{eq&&(eX.current=!0,eB(!0))},handleRoundRobinToggle:e=>{let t=e?"round-robin":null,s=e?eS||"1":eS;e&&!eS&&eA("1"),eC(t),tw(t,s)},handleStickyLimitChange:e=>{eA(e),tw("round-robin",e)},handleThinkingModeChange:e=>{eT(e),tk(e)},handleAutoPingConnection:(e,t)=>{tC({...eE,connections:{...eE.connections,[e]:t}})},triggerOAuthConnection:e8,triggerApiKeyConnection:e6,triggerAddConnection:()=>{te||e3.includes(s)?e8():e6()},toggleSelectConnection:e=>{ey(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},toggleSelectAllConnections:()=>{tU?ey([]):ey(g.map(e=>e.id))},openBulkProxyModal:()=>{if(0===tR.length)return;let e=[...new Set(tR.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"))];ej(1===e.length?e[0]:"__none__"),H(!0)},closeBulkProxyModal:()=>{eN||H(!1)},applyProxyAssignments:tK,handleApplySinglePool:e=>tK(g.map(t=>({connectionId:t.id,proxyPoolId:e}))),handleApplyOneToOne:()=>{let e=E.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tK(g.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},fetchConnections:tj,setSelectedConnection:Z,setShowEditModal:J,setShowBulkProxyModal:H,setShowIFlowCookieModal:D,setShowBulkImportCodex:q,setConnections:b})}),(0,a.jsx)(I,{title:"Health",icon:"monitoring",defaultExpanded:!1,children:(0,a.jsx)("div",{className:"px-4 py-3",children:(0,a.jsx)(S,{providerId:s})})}),(0,a.jsx)(I,{title:"Models",icon:"apps",count:ta.length,defaultExpanded:!0,children:(0,a.jsx)(el,{providerId:s,isCompatible:tr,isAnthropicCompatible:tn,isFreeNoAuth:ts,providerStorageAlias:tx,providerDisplayAlias:tp,models:ta,kiloFreeModels:ez,modelAliases:X,customModels:ee,disabledModelIds:eD,modelTestResults:en,testingModelIds:ec,testingAllModels:eu,modelsTestError:eo,modelSearchQuery:ex,connections:g,suggestedModels:eP,importingQoderModels:eY,copied:e1,getCaps:n,copy:e2,handleTestModel:tF,handleTestAllModels:tJ,handleDisableModel:th,handleEnableModel:tf,handleDisableAll:tg,handleEnableAll:tb,handleSetAlias:tS,handleDeleteAlias:tA,handleAddCustomModel:t$,handleDeleteCustomModel:tT,handleImportQoderModels:tE,setModelSearchQuery:ep,setShowAddCustomModel:eg})}),"kiro"===s?(0,a.jsx)(o.Mh,{isOpen:O,providerInfo:e7,onSuccess:tO,onClose:()=>z(!1)}):"cursor"===s?(0,a.jsx)(o.G9,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"1min"===s?(0,a.jsx)(o.CG,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"qwen-web"===s?(0,a.jsx)(o.F8,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"wp-studio"===s?(0,a.jsx)(o.V1,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"zed"===s?(0,a.jsx)(o.TE,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"kimi-desktop"===s?(0,a.jsx)(o.QT,{isOpen:O,onSuccess:tO,onClose:()=>z(!1)}):"gitlab"===s?(0,a.jsx)(o.vj,{isOpen:O,providerInfo:e7,onSuccess:tO,onClose:()=>z(!1)}):(0,a.jsx)(o.LF,{isOpen:O,provider:s,providerInfo:e7,onSuccess:tO,onClose:()=>z(!1)}),"iflow"===s&&(0,a.jsx)(o.vE,{isOpen:M,onSuccess:()=>{tj(),D(!1)},onClose:()=>D(!1)}),(0,a.jsx)(j,{isOpen:_,provider:s,providerName:e7.name,isCompatible:tr,isAnthropic:tn,authType:e7?.authType,authHint:e7?.authHint,website:e7?.website,proxyPools:E,error:U,onSave:tz,onBulkDone:tj,onClose:()=>{L(""),R(!1)}}),(0,a.jsx)(o.wI,{isOpen:F,connection:Q,proxyPools:E,onSave:tM,onClose:()=>J(!1)}),tr&&(0,a.jsx)(N,{isOpen:B,node:k,onSave:tN,onClose:()=>W(!1),isAnthropic:tn}),!tr&&(0,a.jsx)(w,{isOpen:ef,providerAlias:tx,providerDisplayAlias:tp,onSave:async e=>{await t$(e,"llm",tx),eg(!1)},onClose:()=>eg(!1)}),"codex"===s&&(0,a.jsx)(C,{isOpen:K,onClose:()=>q(!1),onSuccess:tj}),(0,a.jsx)(o.uo,{isOpen:eL,onClose:()=>eK(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eK(!1),te)?e4():e6()},title:"Risk Notice",message:e7?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(o.uo,{isOpen:!!eR,onClose:()=>eU(null),onConfirm:eR?.onConfirm,title:eR?.title||"Confirm",message:eR?.message,variant:"danger"})]})}},90809:(e,t,s)=>{Promise.resolve().then(s.bind(s,90155))}},e=>{e.O(0,[27,5772,2563,705,1321,5497,8441,3794,7358],()=>e(e.s=90809)),_N_E=e.O()}]);