9router 0.5.69 → 0.5.75

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 (920) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +14 -12
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/routes-manifest.json +12 -0
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/_global-error/page.js +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  87. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  88. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  89. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  113. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  119. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  121. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  125. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  129. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  137. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -0
  233. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -0
  234. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route_client-reference-manifest.js +1 -0
  235. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +4 -0
  236. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -0
  237. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route_client-reference-manifest.js +1 -0
  238. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  271. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  279. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  281. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  283. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  285. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  289. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  291. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  293. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  351. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  365. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  405. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  407. package/app/.next-cli-build/server/app/callback.html +1 -1
  408. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  409. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  410. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  411. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
  412. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  414. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
  415. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  416. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  419. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
  420. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  421. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  424. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
  425. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  426. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  429. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
  430. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  431. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  434. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
  435. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  436. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  438. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  439. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  440. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  441. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  444. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
  445. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  446. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  449. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
  450. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  451. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  454. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
  455. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  456. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  459. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  460. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  461. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  464. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  465. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  466. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  468. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  469. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
  470. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  471. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  473. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  476. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  477. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  478. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
  480. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  482. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
  483. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  484. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  486. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  487. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  488. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  489. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  491. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  492. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
  493. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  494. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  497. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  498. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  499. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  500. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  501. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  502. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
  503. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  504. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  505. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  506. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  507. package/app/.next-cli-build/server/app/index.html +1 -1
  508. package/app/.next-cli-build/server/app/index.rsc +4 -4
  509. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  510. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  511. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  512. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  513. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  514. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  515. package/app/.next-cli-build/server/app/landing.html +1 -1
  516. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  517. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  518. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
  520. package/app/.next-cli-build/server/app/login/page.js +1 -1
  521. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  522. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  523. package/app/.next-cli-build/server/app/login.html +1 -1
  524. package/app/.next-cli-build/server/app/login.rsc +5 -5
  525. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  526. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  527. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  528. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  529. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  530. package/app/.next-cli-build/server/app/page.js +1 -1
  531. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  532. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  533. package/app/.next-cli-build/server/app-paths-manifest.json +14 -12
  534. package/app/.next-cli-build/server/chunks/1998.js +1 -1
  535. package/app/.next-cli-build/server/chunks/24.js +1 -1
  536. package/app/.next-cli-build/server/chunks/318.js +23 -15
  537. package/app/.next-cli-build/server/chunks/3225.js +1 -1
  538. package/app/.next-cli-build/server/chunks/3490.js +1 -0
  539. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  540. package/app/.next-cli-build/server/chunks/3558.js +1 -1
  541. package/app/.next-cli-build/server/chunks/3753.js +1 -1
  542. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  543. package/app/.next-cli-build/server/chunks/4037.js +1 -1
  544. package/app/.next-cli-build/server/chunks/412.js +5 -5
  545. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  546. package/app/.next-cli-build/server/chunks/4152.js +1 -0
  547. package/app/.next-cli-build/server/chunks/436.js +1 -1
  548. package/app/.next-cli-build/server/chunks/4572.js +1 -1
  549. package/app/.next-cli-build/server/chunks/4884.js +3 -3
  550. package/app/.next-cli-build/server/chunks/{3193.js → 5285.js} +51 -51
  551. package/app/.next-cli-build/server/chunks/5615.js +21 -2
  552. package/app/.next-cli-build/server/chunks/6922.js +1 -1
  553. package/app/.next-cli-build/server/chunks/7011.js +1 -1
  554. package/app/.next-cli-build/server/chunks/7211.js +1 -1
  555. package/app/.next-cli-build/server/chunks/7220.js +1 -0
  556. package/app/.next-cli-build/server/chunks/7524.js +1 -0
  557. package/app/.next-cli-build/server/chunks/8236.js +1 -1
  558. package/app/.next-cli-build/server/chunks/827.js +1 -1
  559. package/app/.next-cli-build/server/chunks/8402.js +1 -1
  560. package/app/.next-cli-build/server/chunks/8416.js +1 -0
  561. package/app/.next-cli-build/server/chunks/8499.js +6 -6
  562. package/app/.next-cli-build/server/chunks/8628.js +1 -0
  563. package/app/.next-cli-build/server/chunks/8635.js +1 -1
  564. package/app/.next-cli-build/server/chunks/869.js +1 -1
  565. package/app/.next-cli-build/server/chunks/8895.js +5 -11
  566. package/app/.next-cli-build/server/chunks/9128.js +1 -0
  567. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  568. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  569. package/app/.next-cli-build/server/middleware.js +2 -2
  570. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  571. package/app/.next-cli-build/server/pages/404.html +1 -1
  572. package/app/.next-cli-build/server/pages/500.html +1 -1
  573. package/app/.next-cli-build/static/chunks/1321-b7836dc184959aa5.js +1 -0
  574. package/app/.next-cli-build/static/chunks/{5497-f014d674ae071743.js → 5497-a3aa1159d255e86a.js} +5 -5
  575. package/app/.next-cli-build/static/chunks/{6639-6558955a29787152.js → 6656-3e958a8d18a3ea5f.js} +11 -11
  576. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-7293b5299c891da8.js → page-24512774d91a05e4.js} +1 -1
  577. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-c2368ce674af4465.js → page-b7c2a57627806825.js} +1 -1
  578. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-f9d699c7c93151ee.js → page-17fb707c4ec980fc.js} +1 -1
  579. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-ff6932f680f13961.js → page-9f4b1df6277439bd.js} +4 -4
  580. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-4b5054e85975122f.js +1 -0
  581. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-7a7d70c435e777c7.js → layout-d80bf51e8e0a4c80.js} +1 -1
  582. package/app/.next-cli-build/static/chunks/app/_global-error/page-b01550c0e5fd888b.js +1 -0
  583. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-b01550c0e5fd888b.js +1 -0
  584. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-b01550c0e5fd888b.js +1 -0
  585. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-b01550c0e5fd888b.js +1 -0
  586. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-b01550c0e5fd888b.js +1 -0
  587. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-b01550c0e5fd888b.js +1 -0
  588. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-b01550c0e5fd888b.js +1 -0
  589. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-b01550c0e5fd888b.js +1 -0
  590. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-b01550c0e5fd888b.js +1 -0
  591. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-b01550c0e5fd888b.js +1 -0
  592. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-b01550c0e5fd888b.js +1 -0
  593. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-b01550c0e5fd888b.js +1 -0
  594. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-b01550c0e5fd888b.js +1 -0
  595. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-b01550c0e5fd888b.js +1 -0
  596. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-b01550c0e5fd888b.js +1 -0
  597. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-b01550c0e5fd888b.js +1 -0
  598. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-b01550c0e5fd888b.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-b01550c0e5fd888b.js +1 -0
  600. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-b01550c0e5fd888b.js +1 -0
  601. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-b01550c0e5fd888b.js +1 -0
  602. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-b01550c0e5fd888b.js +1 -0
  603. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-b01550c0e5fd888b.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-b01550c0e5fd888b.js +1 -0
  605. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-b01550c0e5fd888b.js +1 -0
  606. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-b01550c0e5fd888b.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-b01550c0e5fd888b.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-b01550c0e5fd888b.js +1 -0
  609. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-b01550c0e5fd888b.js +1 -0
  610. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-b01550c0e5fd888b.js +1 -0
  611. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-b01550c0e5fd888b.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-b01550c0e5fd888b.js +1 -0
  613. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-b01550c0e5fd888b.js +1 -0
  614. package/app/.next-cli-build/static/chunks/app/api/combos/route-b01550c0e5fd888b.js +1 -0
  615. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-b01550c0e5fd888b.js +1 -0
  616. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-b01550c0e5fd888b.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-b01550c0e5fd888b.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-b01550c0e5fd888b.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-b01550c0e5fd888b.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-b01550c0e5fd888b.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/health/route-b01550c0e5fd888b.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/init/route-b01550c0e5fd888b.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-b01550c0e5fd888b.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/keys/route-b01550c0e5fd888b.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/locale/route-b01550c0e5fd888b.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-b01550c0e5fd888b.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-b01550c0e5fd888b.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-b01550c0e5fd888b.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-b01550c0e5fd888b.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-b01550c0e5fd888b.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-b01550c0e5fd888b.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-b01550c0e5fd888b.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-b01550c0e5fd888b.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-b01550c0e5fd888b.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-b01550c0e5fd888b.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-b01550c0e5fd888b.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-b01550c0e5fd888b.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/models/route-b01550c0e5fd888b.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/models/test/route-b01550c0e5fd888b.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-b01550c0e5fd888b.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-b01550c0e5fd888b.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-b01550c0e5fd888b.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-b01550c0e5fd888b.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-b01550c0e5fd888b.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-b01550c0e5fd888b.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-b01550c0e5fd888b.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-b01550c0e5fd888b.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-b01550c0e5fd888b.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-b01550c0e5fd888b.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-b01550c0e5fd888b.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-b01550c0e5fd888b.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-b01550c0e5fd888b.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-b01550c0e5fd888b.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-b01550c0e5fd888b.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-b01550c0e5fd888b.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/pricing/route-b01550c0e5fd888b.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-b01550c0e5fd888b.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-b01550c0e5fd888b.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-b01550c0e5fd888b.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-b01550c0e5fd888b.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-b01550c0e5fd888b.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-b01550c0e5fd888b.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-b01550c0e5fd888b.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-b01550c0e5fd888b.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-b01550c0e5fd888b.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/providers/route-b01550c0e5fd888b.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-b01550c0e5fd888b.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-b01550c0e5fd888b.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-b01550c0e5fd888b.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-b01550c0e5fd888b.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-b01550c0e5fd888b.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-b01550c0e5fd888b.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-b01550c0e5fd888b.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-b01550c0e5fd888b.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-b01550c0e5fd888b.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-b01550c0e5fd888b.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-b01550c0e5fd888b.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-b01550c0e5fd888b.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-b01550c0e5fd888b.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-b01550c0e5fd888b.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-b01550c0e5fd888b.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-b01550c0e5fd888b.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-b01550c0e5fd888b.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-b01550c0e5fd888b.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-b01550c0e5fd888b.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-b01550c0e5fd888b.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/settings/route-b01550c0e5fd888b.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-b01550c0e5fd888b.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/tags/route-b01550c0e5fd888b.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-b01550c0e5fd888b.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-b01550c0e5fd888b.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-b01550c0e5fd888b.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-b01550c0e5fd888b.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-b01550c0e5fd888b.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-b01550c0e5fd888b.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-b01550c0e5fd888b.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-b01550c0e5fd888b.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-b01550c0e5fd888b.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-b01550c0e5fd888b.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-b01550c0e5fd888b.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-b01550c0e5fd888b.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-b01550c0e5fd888b.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-b01550c0e5fd888b.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-b01550c0e5fd888b.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-b01550c0e5fd888b.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-b01550c0e5fd888b.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-b01550c0e5fd888b.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-b01550c0e5fd888b.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-b01550c0e5fd888b.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-b01550c0e5fd888b.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-b01550c0e5fd888b.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-b01550c0e5fd888b.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-b01550c0e5fd888b.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-b01550c0e5fd888b.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-b01550c0e5fd888b.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-b01550c0e5fd888b.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-b01550c0e5fd888b.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-b01550c0e5fd888b.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-b01550c0e5fd888b.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-b01550c0e5fd888b.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-b01550c0e5fd888b.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-b01550c0e5fd888b.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-b01550c0e5fd888b.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-b01550c0e5fd888b.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-b01550c0e5fd888b.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-b01550c0e5fd888b.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/v1/route-b01550c0e5fd888b.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-b01550c0e5fd888b.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-b01550c0e5fd888b.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-b01550c0e5fd888b.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-b01550c0e5fd888b.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-b01550c0e5fd888b.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-b01550c0e5fd888b.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-b01550c0e5fd888b.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-b01550c0e5fd888b.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/version/route-b01550c0e5fd888b.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-b01550c0e5fd888b.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/version/update/route-b01550c0e5fd888b.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-b01550c0e5fd888b.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/page-b01550c0e5fd888b.js +1 -0
  741. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-b01550c0e5fd888b.js +1 -0
  742. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-b01550c0e5fd888b.js +1 -0
  743. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-b01550c0e5fd888b.js +1 -0
  744. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-b01550c0e5fd888b.js +1 -0
  745. package/app/.next-cli-build/static/lT_m29PZoyMEswZrqhKVs/_buildManifest.js +1 -0
  746. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  747. package/app/package.json +1 -1
  748. package/app/src/lib/oauth/providers/xiaomi-mimo.js +123 -0
  749. package/package.json +1 -1
  750. package/src/cli/utils/modelSelector.js +182 -45
  751. package/app/.next-cli-build/server/chunks/2051.js +0 -1
  752. package/app/.next-cli-build/server/chunks/2112.js +0 -1
  753. package/app/.next-cli-build/server/chunks/3284.js +0 -1
  754. package/app/.next-cli-build/server/chunks/5612.js +0 -1
  755. package/app/.next-cli-build/server/chunks/9381.js +0 -1
  756. package/app/.next-cli-build/static/chunks/1321-cb0ab4daf4a3ef56.js +0 -1
  757. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-abfc8e5e87ff975b.js +0 -1
  758. package/app/.next-cli-build/static/chunks/app/_global-error/page-abd10cc0f71d8acf.js +0 -1
  759. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-abd10cc0f71d8acf.js +0 -1
  760. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-abd10cc0f71d8acf.js +0 -1
  761. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-abd10cc0f71d8acf.js +0 -1
  762. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-abd10cc0f71d8acf.js +0 -1
  763. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-abd10cc0f71d8acf.js +0 -1
  764. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-abd10cc0f71d8acf.js +0 -1
  765. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-abd10cc0f71d8acf.js +0 -1
  766. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-abd10cc0f71d8acf.js +0 -1
  767. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-abd10cc0f71d8acf.js +0 -1
  768. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-abd10cc0f71d8acf.js +0 -1
  769. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-abd10cc0f71d8acf.js +0 -1
  770. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-abd10cc0f71d8acf.js +0 -1
  771. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-abd10cc0f71d8acf.js +0 -1
  772. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-abd10cc0f71d8acf.js +0 -1
  773. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-abd10cc0f71d8acf.js +0 -1
  774. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-abd10cc0f71d8acf.js +0 -1
  775. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-abd10cc0f71d8acf.js +0 -1
  776. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-abd10cc0f71d8acf.js +0 -1
  777. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-abd10cc0f71d8acf.js +0 -1
  778. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-abd10cc0f71d8acf.js +0 -1
  779. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-abd10cc0f71d8acf.js +0 -1
  780. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-abd10cc0f71d8acf.js +0 -1
  781. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-abd10cc0f71d8acf.js +0 -1
  782. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-abd10cc0f71d8acf.js +0 -1
  783. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-abd10cc0f71d8acf.js +0 -1
  784. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-abd10cc0f71d8acf.js +0 -1
  785. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-abd10cc0f71d8acf.js +0 -1
  786. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-abd10cc0f71d8acf.js +0 -1
  787. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-abd10cc0f71d8acf.js +0 -1
  788. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-abd10cc0f71d8acf.js +0 -1
  789. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-abd10cc0f71d8acf.js +0 -1
  790. package/app/.next-cli-build/static/chunks/app/api/combos/route-abd10cc0f71d8acf.js +0 -1
  791. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-abd10cc0f71d8acf.js +0 -1
  792. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-abd10cc0f71d8acf.js +0 -1
  793. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-abd10cc0f71d8acf.js +0 -1
  794. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-abd10cc0f71d8acf.js +0 -1
  795. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-abd10cc0f71d8acf.js +0 -1
  796. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-abd10cc0f71d8acf.js +0 -1
  797. package/app/.next-cli-build/static/chunks/app/api/health/route-abd10cc0f71d8acf.js +0 -1
  798. package/app/.next-cli-build/static/chunks/app/api/init/route-abd10cc0f71d8acf.js +0 -1
  799. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-abd10cc0f71d8acf.js +0 -1
  800. package/app/.next-cli-build/static/chunks/app/api/keys/route-abd10cc0f71d8acf.js +0 -1
  801. package/app/.next-cli-build/static/chunks/app/api/locale/route-abd10cc0f71d8acf.js +0 -1
  802. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-abd10cc0f71d8acf.js +0 -1
  803. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-abd10cc0f71d8acf.js +0 -1
  804. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-abd10cc0f71d8acf.js +0 -1
  805. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-abd10cc0f71d8acf.js +0 -1
  806. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-abd10cc0f71d8acf.js +0 -1
  807. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-abd10cc0f71d8acf.js +0 -1
  808. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-abd10cc0f71d8acf.js +0 -1
  809. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-abd10cc0f71d8acf.js +0 -1
  810. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-abd10cc0f71d8acf.js +0 -1
  811. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-abd10cc0f71d8acf.js +0 -1
  812. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-abd10cc0f71d8acf.js +0 -1
  813. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-abd10cc0f71d8acf.js +0 -1
  814. package/app/.next-cli-build/static/chunks/app/api/models/route-abd10cc0f71d8acf.js +0 -1
  815. package/app/.next-cli-build/static/chunks/app/api/models/test/route-abd10cc0f71d8acf.js +0 -1
  816. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-abd10cc0f71d8acf.js +0 -1
  817. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-abd10cc0f71d8acf.js +0 -1
  818. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-abd10cc0f71d8acf.js +0 -1
  819. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-abd10cc0f71d8acf.js +0 -1
  820. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-abd10cc0f71d8acf.js +0 -1
  821. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-abd10cc0f71d8acf.js +0 -1
  822. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-abd10cc0f71d8acf.js +0 -1
  823. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-abd10cc0f71d8acf.js +0 -1
  824. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-abd10cc0f71d8acf.js +0 -1
  825. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-abd10cc0f71d8acf.js +0 -1
  826. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-abd10cc0f71d8acf.js +0 -1
  827. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-abd10cc0f71d8acf.js +0 -1
  828. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-abd10cc0f71d8acf.js +0 -1
  829. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-abd10cc0f71d8acf.js +0 -1
  830. package/app/.next-cli-build/static/chunks/app/api/pricing/route-abd10cc0f71d8acf.js +0 -1
  831. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-abd10cc0f71d8acf.js +0 -1
  832. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-abd10cc0f71d8acf.js +0 -1
  833. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-abd10cc0f71d8acf.js +0 -1
  834. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-abd10cc0f71d8acf.js +0 -1
  835. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-abd10cc0f71d8acf.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-abd10cc0f71d8acf.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-abd10cc0f71d8acf.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-abd10cc0f71d8acf.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-abd10cc0f71d8acf.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/api/providers/route-abd10cc0f71d8acf.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-abd10cc0f71d8acf.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-abd10cc0f71d8acf.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-abd10cc0f71d8acf.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-abd10cc0f71d8acf.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-abd10cc0f71d8acf.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-abd10cc0f71d8acf.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-abd10cc0f71d8acf.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-abd10cc0f71d8acf.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-abd10cc0f71d8acf.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-abd10cc0f71d8acf.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-abd10cc0f71d8acf.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-abd10cc0f71d8acf.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-abd10cc0f71d8acf.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-abd10cc0f71d8acf.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-abd10cc0f71d8acf.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-abd10cc0f71d8acf.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-abd10cc0f71d8acf.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-abd10cc0f71d8acf.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-abd10cc0f71d8acf.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-abd10cc0f71d8acf.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/settings/route-abd10cc0f71d8acf.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-abd10cc0f71d8acf.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/tags/route-abd10cc0f71d8acf.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-abd10cc0f71d8acf.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-abd10cc0f71d8acf.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-abd10cc0f71d8acf.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-abd10cc0f71d8acf.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-abd10cc0f71d8acf.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-abd10cc0f71d8acf.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-abd10cc0f71d8acf.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-abd10cc0f71d8acf.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-abd10cc0f71d8acf.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-abd10cc0f71d8acf.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-abd10cc0f71d8acf.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-abd10cc0f71d8acf.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-abd10cc0f71d8acf.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-abd10cc0f71d8acf.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-abd10cc0f71d8acf.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-abd10cc0f71d8acf.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-abd10cc0f71d8acf.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-abd10cc0f71d8acf.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-abd10cc0f71d8acf.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-abd10cc0f71d8acf.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-abd10cc0f71d8acf.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-abd10cc0f71d8acf.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-abd10cc0f71d8acf.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-abd10cc0f71d8acf.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-abd10cc0f71d8acf.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-abd10cc0f71d8acf.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-abd10cc0f71d8acf.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-abd10cc0f71d8acf.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-abd10cc0f71d8acf.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-abd10cc0f71d8acf.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-abd10cc0f71d8acf.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-abd10cc0f71d8acf.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-abd10cc0f71d8acf.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-abd10cc0f71d8acf.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-abd10cc0f71d8acf.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-abd10cc0f71d8acf.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-abd10cc0f71d8acf.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/v1/route-abd10cc0f71d8acf.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-abd10cc0f71d8acf.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-abd10cc0f71d8acf.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-abd10cc0f71d8acf.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-abd10cc0f71d8acf.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-abd10cc0f71d8acf.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-abd10cc0f71d8acf.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-abd10cc0f71d8acf.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-abd10cc0f71d8acf.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/version/route-abd10cc0f71d8acf.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-abd10cc0f71d8acf.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/version/update/route-abd10cc0f71d8acf.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-abd10cc0f71d8acf.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/page-abd10cc0f71d8acf.js +0 -1
  915. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-abd10cc0f71d8acf.js +0 -1
  916. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-abd10cc0f71d8acf.js +0 -1
  917. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-abd10cc0f71d8acf.js +0 -1
  918. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-abd10cc0f71d8acf.js +0 -1
  919. package/app/.next-cli-build/static/fKNEeW0xW0FqZn_GGs3Oo/_buildManifest.js +0 -1
  920. /package/app/.next-cli-build/static/{fKNEeW0xW0FqZn_GGs3Oo → lT_m29PZoyMEswZrqhKVs}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{50498:(e,t,a)=>{Promise.resolve().then(a.bind(a,85309))},85309:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var l=a(95155),s=a(12115),i=a(98500),r=a.n(i),d=a(35497),o=a(3534),c=a(28777),n=a(23276);let u="https://9router.com";function x({toolId:e,machineId:t}){let a=o.dM[e],[i,v]=(0,s.useState)([]),[m,h]=(0,s.useState)(!0),[p,f]=(0,s.useState)({}),[b,E]=(0,s.useState)(!1),[j,P]=(0,s.useState)(!1),[g,w]=(0,s.useState)(""),[k,N]=(0,s.useState)(!1),[S,y]=(0,s.useState)(""),[A,M]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,a,l,s]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();v(e.connections||[])}if(a.ok){let e=await a.json();E(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),N(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),y(e.tailscale?.tunnelUrl||"")}if(s.ok){let e=await s.json();M(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let $=()=>i.filter(e=>!1!==e.isActive),_=(0,s.useCallback)((e,t,a)=>{f(l=>l[e]?.[t]===a?l:{...l,[e]:{...l[e],[t]:a}})},[]);return a?(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:a.name}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:a.description})]}),m?(0,l.jsx)(d.Qv,{}):(()=>{let t,s,i,r=(t=$(),s=[],i=new Set,t.forEach(e=>{let t=c.Xg[e.provider]||e.provider,a=(0,c.KC)(e.provider);if(a.forEach(a=>{let l=`${t}/${a.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))}),0===a.length){let a=e.providerSpecificData?.prefix||t,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(t=>t.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${a}/model-id`}),l.forEach(t=>{let l=`${a}/${t.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${a}/${t.id}`,provider:e.provider,alias:a,connectionName:e.name,modelId:t.id}))})}}),s).length>0,d={tool:a,isExpanded:!0,onToggle:()=>{},baseUrl:j&&g?g:b&&u?u:window.location.origin,apiKeys:A,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S};switch(e){case"claude":return(0,l.jsx)(n.Tk,{...d,activeProviders:$(),modelMappings:p[e]||{},onModelMappingChange:(t,a)=>_(e,t,a),hasActiveProviders:r,cloudEnabled:b});case"codex":return(0,l.jsx)(n.Ah,{...d,activeProviders:$(),cloudEnabled:b});case"opencode":return(0,l.jsx)(n.qO,{...d,activeProviders:$(),cloudEnabled:b});case"cowork":return(0,l.jsx)(n.Q6,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b,cloudUrl:u,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S});case"droid":return(0,l.jsx)(n.ZM,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"openclaw":return(0,l.jsx)(n.yZ,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"hermes":return(0,l.jsx)(n.RF,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"cline":return(0,l.jsx)(n.aG,{...d,activeProviders:$(),cloudEnabled:b});case"kilo":return(0,l.jsx)(n.c9,{...d,activeProviders:$(),cloudEnabled:b});case"deepseek-tui":return(0,l.jsx)(n.lF,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"jcode":return(0,l.jsx)(n.mW,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"grok-build":return(0,l.jsx)(n.E_,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});default:return(0,l.jsx)(n.a7,{toolId:e,...d,activeProviders:$(),cloudEnabled:b,tunnelEnabled:j})}})()]}):(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6639,8441,3794,7358],()=>e(e.s=50498)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{50498:(e,t,a)=>{Promise.resolve().then(a.bind(a,85309))},85309:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var l=a(95155),s=a(12115),i=a(98500),r=a.n(i),d=a(35497),o=a(3534),c=a(28777),n=a(23683);let u="https://9router.com";function x({toolId:e,machineId:t}){let a=o.dM[e],[i,v]=(0,s.useState)([]),[m,h]=(0,s.useState)(!0),[p,f]=(0,s.useState)({}),[b,E]=(0,s.useState)(!1),[j,P]=(0,s.useState)(!1),[g,w]=(0,s.useState)(""),[k,N]=(0,s.useState)(!1),[S,y]=(0,s.useState)(""),[A,M]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,a,l,s]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();v(e.connections||[])}if(a.ok){let e=await a.json();E(e.cloudEnabled||!1)}if(l.ok){let e=await l.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),N(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),y(e.tailscale?.tunnelUrl||"")}if(s.ok){let e=await s.json();M(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let $=()=>i.filter(e=>!1!==e.isActive),_=(0,s.useCallback)((e,t,a)=>{f(l=>l[e]?.[t]===a?l:{...l,[e]:{...l[e],[t]:a}})},[]);return a?(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:a.name}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:a.description})]}),m?(0,l.jsx)(d.Qv,{}):(()=>{let t,s,i,r=(t=$(),s=[],i=new Set,t.forEach(e=>{let t=c.Xg[e.provider]||e.provider,a=(0,c.KC)(e.provider);if(a.forEach(a=>{let l=`${t}/${a.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))}),0===a.length){let a=e.providerSpecificData?.prefix||t,l=[];e.defaultModel&&l.push({id:e.defaultModel,name:e.defaultModel}),(e.providerSpecificData?.customModels||[]).forEach(e=>{e?.id&&!l.some(t=>t.id===e.id)&&l.push({id:e.id,name:e.name||e.id})}),0===l.length&&"active"===e.testStatus&&l.push({id:"model-id",name:`${a}/model-id`}),l.forEach(t=>{let l=`${a}/${t.id}`;i.has(l)||(i.add(l),s.push({value:l,label:`${a}/${t.id}`,provider:e.provider,alias:a,connectionName:e.name,modelId:t.id}))})}}),s).length>0,d={tool:a,isExpanded:!0,onToggle:()=>{},baseUrl:j&&g?g:b&&u?u:window.location.origin,apiKeys:A,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S};switch(e){case"claude":return(0,l.jsx)(n.Tk,{...d,activeProviders:$(),modelMappings:p[e]||{},onModelMappingChange:(t,a)=>_(e,t,a),hasActiveProviders:r,cloudEnabled:b});case"codex":return(0,l.jsx)(n.Ah,{...d,activeProviders:$(),cloudEnabled:b});case"opencode":return(0,l.jsx)(n.qO,{...d,activeProviders:$(),cloudEnabled:b});case"cowork":return(0,l.jsx)(n.Q6,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b,cloudUrl:u,tunnelEnabled:j,tunnelPublicUrl:g,tailscaleEnabled:k,tailscaleUrl:S});case"droid":return(0,l.jsx)(n.ZM,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"openclaw":return(0,l.jsx)(n.yZ,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"hermes":return(0,l.jsx)(n.RF,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"cline":return(0,l.jsx)(n.aG,{...d,activeProviders:$(),cloudEnabled:b});case"kilo":return(0,l.jsx)(n.c9,{...d,activeProviders:$(),cloudEnabled:b});case"deepseek-tui":return(0,l.jsx)(n.lF,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"jcode":return(0,l.jsx)(n.mW,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});case"grok-build":return(0,l.jsx)(n.E_,{...d,activeProviders:$(),hasActiveProviders:r,cloudEnabled:b});default:return(0,l.jsx)(n.a7,{toolId:e,...d,activeProviders:$(),cloudEnabled:b,tunnelEnabled:j})}})()]}):(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,l.jsxs)(r(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=50498)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{25403:(e,s,l)=>{Promise.resolve().then(l.bind(l,75882))},75882:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var t=l(95155),a=l(12115),i=l(35497),r=l(3534),c=l(23276),n=l(98500),o=l.n(n),d=l(5772);function x({toolId:e,tool:s,status:l}){let a=s?.configType==="guide"?{label:"Guide",cls:"bg-blue-500/10 text-blue-600 dark:text-blue-400"}:l?l.installed?l.has9Router?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-gray-500/10 text-gray-500"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,t.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(i.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${a.cls}`,children:a.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)({});if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{})]});let d=Object.entries(r.dM),g=Object.entries(r.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:d.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:n[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:g.map(([e,s])=>(0,t.jsx)(c.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6639,8441,3794,7358],()=>e(e.s=25403)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{25403:(e,s,l)=>{Promise.resolve().then(l.bind(l,75882))},75882:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var t=l(95155),a=l(12115),i=l(35497),r=l(3534),c=l(23683),n=l(98500),o=l.n(n),d=l(5772);function x({toolId:e,tool:s,status:l}){let a=s?.configType==="guide"?{label:"Guide",cls:"bg-blue-500/10 text-blue-600 dark:text-blue-400"}:l?l.installed?l.has9Router?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-gray-500/10 text-gray-500"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,t.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(i.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${a.cls}`,children:a.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)({});if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{}),(0,t.jsx)(i.Qv,{})]});let d=Object.entries(r.dM),g=Object.entries(r.wn);return(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:d.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:n[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:g.map(([e,s])=>(0,t.jsx)(c.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=25403)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,t)=>{"use strict";t.d(s,{default:()=>d});var a=t(95155),i=t(12115),n=t(3534),l=t(28777),o=t(88105),r=t(23276);function d(){let[e,s]=(0,i.useState)([]),[t,d]=(0,i.useState)([]),[c,u]=(0,i.useState)({}),[h,p]=(0,i.useState)(!1),[w,f]=(0,i.useState)(null),[y,x]=(0,i.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,i.useEffect)(()=>{g(),v(),m(),S()},[]);let g=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let t=await e.json();s(t.connections||[])}}catch{}},v=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();d(s.keys||[])}}catch{}},m=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},S=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();p(s.cloudEnabled||!1)}}catch{}},b=()=>e.filter(e=>!1!==e.isActive),k=Object.entries(n.wn);return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:"⚠️ MITM intercepts HTTPS traffic of IDE tools (Antigravity, GitHub Copilot, Kiro) via local CA to redirect requests to your providers. May violate ToS → account ban. Use at your own risk."})]}),(0,a.jsx)(r.tA,{apiKeys:t,cloudEnabled:h,onStatusChange:x}),(0,a.jsx)("div",{className:"grid gap-3 sm:gap-4",children:k.map(([e,s])=>(0,a.jsx)(r.kn,{tool:s,isExpanded:w===e,onToggle:()=>f(w===e?null:e),serverRunning:y.running,dnsActive:y.dnsStatus?.[e]||!1,hasCachedPassword:y.hasCachedPassword||!1,needsSudoPassword:!1!==y.needsSudoPassword,isWin:!0===y.isWin,apiKeys:t,activeProviders:b(),hasActiveProviders:b().some(e=>(0,l.KC)(e.provider).length>0||(0,o.mq)(e.provider)||(0,o.gb)(e.provider)),modelAliases:c,cloudEnabled:h,onDnsChange:e=>x(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},34008:(e,s,t)=>{Promise.resolve().then(t.bind(t,23879))}},e=>{e.O(0,[4614,5772,1321,705,5497,6639,8441,3794,7358],()=>e(e.s=34008)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6607],{23879:(e,s,t)=>{"use strict";t.d(s,{default:()=>d});var a=t(95155),i=t(12115),n=t(3534),l=t(28777),o=t(88105),r=t(23683);function d(){let[e,s]=(0,i.useState)([]),[t,d]=(0,i.useState)([]),[c,u]=(0,i.useState)({}),[h,p]=(0,i.useState)(!1),[w,f]=(0,i.useState)(null),[y,x]=(0,i.useState)({running:!1,certExists:!1,dnsStatus:{},hasCachedPassword:!1});(0,i.useEffect)(()=>{g(),v(),m(),S()},[]);let g=async()=>{try{let e=await fetch("/api/providers");if(e.ok){let t=await e.json();s(t.connections||[])}}catch{}},v=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let s=await e.json();d(s.keys||[])}}catch{}},m=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let s=await e.json();u(s.aliases||{})}}catch{}},S=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();p(s.cloudEnabled||!1)}}catch{}},b=()=>e.filter(e=>!1!==e.isActive),k=Object.entries(n.wn);return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:"⚠️ MITM intercepts HTTPS traffic of IDE tools (Antigravity, GitHub Copilot, Kiro) via local CA to redirect requests to your providers. May violate ToS → account ban. Use at your own risk."})]}),(0,a.jsx)(r.tA,{apiKeys:t,cloudEnabled:h,onStatusChange:x}),(0,a.jsx)("div",{className:"grid gap-3 sm:gap-4",children:k.map(([e,s])=>(0,a.jsx)(r.kn,{tool:s,isExpanded:w===e,onToggle:()=>f(w===e?null:e),serverRunning:y.running,dnsActive:y.dnsStatus?.[e]||!1,hasCachedPassword:y.hasCachedPassword||!1,needsSudoPassword:!1!==y.needsSudoPassword,isWin:!0===y.isWin,apiKeys:t,activeProviders:b(),hasActiveProviders:b().some(e=>(0,l.KC)(e.provider).length>0||(0,o.mq)(e.provider)||(0,o.gb)(e.provider)),modelAliases:c,cloudEnabled:h,onDnsChange:e=>x(s=>({...s,dnsStatus:e.dnsStatus??s.dnsStatus}))},e))})]})}},34008:(e,s,t)=>{Promise.resolve().then(t.bind(t,23879))}},e=>{e.O(0,[4614,5772,1321,705,5497,6656,8441,3794,7358],()=>e(e.s=34008)),_N_E=e.O()}]);
@@ -1,10 +1,10 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})},77458:(e,t,s)=>{Promise.resolve().then(s.bind(s,80873))},80873:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>G});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);let h=["none","low","medium","high"],f=["none","thinking"],g=["none","low","medium","high","max"],y={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":g,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":h,zai:f,qwen:h,kimi:g,deepseek:["none","high","max"],minimax:f,hunyuan:h,step:h},b=["none","minimal","low","medium","high","xhigh","max"],v=[{provider:"codex",pattern:"*gpt-6*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:b},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]}];function j(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!s)return null;let[,i,a]=s,l=Number(i),r=void 0===a?null:Number(a);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=v.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),a=i?.levels||y[s.thinkingFormat]||h;return!1===s.thinkingCanDisable&&(a=a.filter(e=>"none"!==e)),a}var k=s(11059),w=s(929),N=s(73006);let C=new Map;async function S(e){if(!e?.url||!e?.type)return[];let t=C.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return C.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function A({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(a&&e!==a||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)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||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var T=s(14051),$=s.n(T);function O({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.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,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.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:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,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,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.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,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function P({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.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"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.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,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[k,w]=(0,a.useState)({}),N=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}`})}),i=await s.json();w(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=A({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!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 i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"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,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(P,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:k[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:$().shape({id:$().string.isRequired}).isRequired,fullModel:$().string.isRequired,alias:$().string,copied:$().string,onCopy:$().func.isRequired,testStatus:$().oneOf(["ok","error"]),isCustom:$().bool,isFree:$().bool,onDeleteAlias:$().func,onTest:$().func,isTesting:$().bool,onDisable:$().func,caps:$().object,thinkingSuffix:$().string},$().string.isRequired,$().string.isRequired,$().string,$().func.isRequired,$().func.isRequired,$().func,$().oneOf(["ok","error"]),$().bool,$().string.isRequired,$().object.isRequired,$().arrayOf($().object),$().string,$().func.isRequired,$().func.isRequired,$().func.isRequired,$().func.isRequired,E.propTypes={providerStorageAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,modelAliases:$().object.isRequired,customModels:$().arrayOf($().object),copied:$().string,onCopy:$().func.isRequired,onDeleteAlias:$().func.isRequired,onAddCustomModel:$().func.isRequired,onDeleteCustomModel:$().func.isRequired,connections:$().arrayOf($().shape({id:$().string,isActive:$().bool})).isRequired,isAnthropic:$().bool};var I=s(70217);function D({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function R({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),k=e.providerSpecificData?.proxyPoolId||null,w=k?j.get(k):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!k||N,S=w?`Pool: ${w.name}`:k?`Pool: ${k} (inactive/missing)`:N?`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.",T="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";w?.isActive===!0?O="success":(k||N)&&(O="error"),(0,a.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 P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),_="oauth"===E,U="cookie"===E,q=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":U?"Cookie Account":"API Key"),z=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,[K,J]=(0,a.useState)(!1),M=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{J(!!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=M?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[M]);let F="unavailable"!==e.testStatus||K?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.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,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:U?"cookie":_?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:q}),z&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:z}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,I.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:_?"OAuth":U?"Cookie":"API Key"}),C&&(0,i.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),K&&!1!==e.isActive&&(0,i.jsx)(D,{until:M}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),T&&(0,i.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,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:v,children:[(0,i.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:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,i.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,i.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!k?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${k===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,i.jsx)(c.m_,{text:A,children:(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,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,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}D.propTypes={until:$().string.isRequired},R.propTypes={connection:$().shape({id:$().string,name:$().string,email:$().string,displayName:$().string,modelLockUntil:$().string,testStatus:$().string,isActive:$().bool,lastError:$().string,priority:$().number,globalPriority:$().number}).isRequired,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string,proxyUrl:$().string,noProxy:$().string,isActive:$().bool})),isOAuth:$().bool.isRequired,isFirst:$().bool.isRequired,isLast:$().bool.isRequired,onMoveUp:$().func.isRequired,onMoveDown:$().func.isRequired,onToggleActive:$().func.isRequired,onUpdateProxy:$().func,onEdit:$().func.isRequired,onDelete:$().func.isRequired,oneByOneStatus:$().shape({state:$().string,error:$().string}),autoPing:$().shape({on:$().bool,onToggle:$().func,provider:$().string})};let _=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})},77458:(e,t,s)=>{Promise.resolve().then(s.bind(s,80873))},80873:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>H});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);let h=["none","low","medium","high"],f=["none","thinking"],g=["none","low","medium","high","max"],y={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":g,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":h,zai:f,qwen:h,kimi:g,deepseek:["none","high","max"],minimax:f,hunyuan:h,step:h},b=["none","minimal","low","medium","high","xhigh","max"],v=[{provider:"codex",pattern:"*gpt-6*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:b},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]}];function j(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!s)return null;let[,i,a]=s,l=Number(i),r=void 0===a?null:Number(a);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=v.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),a=i?.levels||y[s.thinkingFormat]||h;return!1===s.thinkingCanDisable&&(a=a.filter(e=>"none"!==e)),a}var w=s(11059),k=s(929),N=s(73006);let C=new Map;async function S(e){if(!e?.url||!e?.type)return[];let t=C.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return C.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function A({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(a&&e!==a||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)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||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var T=s(14051),$=s.n(T);function O({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.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,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.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:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,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,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.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,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function P({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.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"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.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,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=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}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=A({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!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 i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"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,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(P,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:$().shape({id:$().string.isRequired}).isRequired,fullModel:$().string.isRequired,alias:$().string,copied:$().string,onCopy:$().func.isRequired,testStatus:$().oneOf(["ok","error"]),isCustom:$().bool,isFree:$().bool,onDeleteAlias:$().func,onTest:$().func,isTesting:$().bool,onDisable:$().func,caps:$().object,thinkingSuffix:$().string},$().string.isRequired,$().string.isRequired,$().string,$().func.isRequired,$().func.isRequired,$().func,$().oneOf(["ok","error"]),$().bool,$().string.isRequired,$().object.isRequired,$().arrayOf($().object),$().string,$().func.isRequired,$().func.isRequired,$().func.isRequired,$().func.isRequired,E.propTypes={providerStorageAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,modelAliases:$().object.isRequired,customModels:$().arrayOf($().object),copied:$().string,onCopy:$().func.isRequired,onDeleteAlias:$().func.isRequired,onAddCustomModel:$().func.isRequired,onDeleteCustomModel:$().func.isRequired,connections:$().arrayOf($().shape({id:$().string,isActive:$().bool})).isRequired,isAnthropic:$().bool};var I=s(70217);function D({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function R({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),w=e.providerSpecificData?.proxyPoolId||null,k=w?j.get(w):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!w||N,S=k?`Pool: ${k.name}`:w?`Pool: ${w} (inactive/missing)`:N?`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.",T="";if(k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";k?.isActive===!0?O="success":(w||N)&&(O="error"),(0,a.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 P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),_="oauth"===E,U="cookie"===E,q=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":U?"Cookie Account":"API Key"),z=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,[K,J]=(0,a.useState)(!1),M=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{J(!!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=M?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[M]);let F="unavailable"!==e.testStatus||K?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.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,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:U?"cookie":_?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:q}),z&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:z}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,I.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:_?"OAuth":U?"Cookie":"API Key"}),C&&(0,i.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),K&&!1!==e.isActive&&(0,i.jsx)(D,{until:M}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),T&&(0,i.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,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:v,children:[(0,i.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:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,i.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,i.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,i.jsx)(c.m_,{text:A,children:(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,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,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}D.propTypes={until:$().string.isRequired},R.propTypes={connection:$().shape({id:$().string,name:$().string,email:$().string,displayName:$().string,modelLockUntil:$().string,testStatus:$().string,isActive:$().bool,lastError:$().string,priority:$().number,globalPriority:$().number}).isRequired,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string,proxyUrl:$().string,noProxy:$().string,isActive:$().bool})),isOAuth:$().bool.isRequired,isFirst:$().bool.isRequired,isLast:$().bool.isRequired,onMoveUp:$().func.isRequired,onMoveDown:$().func.isRequired,onToggleActive:$().func.isRequired,onUpdateProxy:$().func,onEdit:$().func.isRequired,onDelete:$().func.isRequired,oneByOneStatus:$().shape({state:$().string,error:$().string}),autoPing:$().shape({on:$().bool,onToggle:$().func,provider:$().string})};let _=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function U({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,k=v?"Cookie Value":"qoder"===t?"Personal Access Token (PAT)":"API Key",w="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.regions||null,S=m.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[A,T]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[$,O]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[P,E]=(0,a.useState)({accountId:""}),[I,D]=(0,a.useState)(S),[R,q]=(0,a.useState)(!1),[z,K]=(0,a.useState)(null),[J,M]=(0,a.useState)(!1),F=N?`name1|sk-key1|acc123456
3
+ sk-key-only-auto-named`;function U({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t?"Personal Access Token (PAT)":"API Key",k="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.regions||null,S=m.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[A,T]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[$,O]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[P,E]=(0,a.useState)({accountId:""}),[I,D]=(0,a.useState)(S),[R,q]=(0,a.useState)(!1),[z,K]=(0,a.useState)(null),[J,M]=(0,a.useState)(!1),F=N?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
5
5
  sk-key-only-auto-named`:"qoder"===t?`name1|pt-xxxxx
6
6
  name2|pt-yyyyy
7
- pt-only-auto-named`:_,[L,W]=(0,a.useState)("single"),[B,G]=(0,a.useState)(""),[H,Q]=(0,a.useState)(null),V=()=>b&&A.ollamaHostUrl.trim()?{baseUrl:A.ollamaHostUrl.trim()}:w?{azureEndpoint:$.azureEndpoint,apiVersion:$.apiVersion,deployment:$.deployment,organization:$.organization}:N?{accountId:P.accountId}:C&&I?{region:I}:void 0,Z=async()=>{q(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:V()})}),s=await e.json();K(s.valid?"success":"failed")}catch{K("failed")}finally{q(!1)}},X=async()=>{if(t&&(b||A.apiKey)&&(b||A.name)&&(!l||A.defaultModel.trim())){M(!0);try{let e=!1;try{q(!0),K(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:V()})});e=!!(await s.json()).valid,K(e?"success":"failed")}catch{K("failed")}finally{q(!1)}await h({name:A.name||(b?"Ollama Local":""),apiKey:A.apiKey,defaultModel:l?A.defaultModel.trim():void 0,priority:A.priority,proxyPoolId:A.proxyPoolId===y?null:A.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:V()})}finally{M(!1)}}},Y=async()=>{let e=B.split("\n");if(!e.length)return;let s=function(e,t,s={}){let{isCloudflareAi:i=!1}=s,a=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,s="string"==typeof t?t.trim():"";if(!s)continue;let r=function(e,t={}){let{isCloudflareAi:s=!1}=t,i=e.split("|");if(s&&i.length>=3){let e=i[0].trim();return{baseName:e||"Key",apiKey:i.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:i[i.length-1].trim()}}}return i.length>=2?{baseName:i[0].trim()||"Key",apiKey:i.slice(1).join("|").trim()}:{baseName:"Key",apiKey:i[0].trim()}}(s,{isCloudflareAi:i});if(!r||!r.apiKey)continue;let n=r.baseName,o=1;for(;e=`${n} ${o}`,a.has(e.toLowerCase());)o+=1;a.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,x,{isCloudflareAi:N});if(!s.length)return;M(!0),Q(null);let i=0,a=0;for(let e of s)try{let s=!1;try{let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});s=!!(await i.json().catch(()=>({}))).valid}catch{s=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:s?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?i++:a++}catch{a++}M(!1),Q({success:i,failed:a}),i>0&&f&&f()};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Add ${s||t} ${k}`,onClose:g,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{size:"sm",variant:"single"===L?"primary":"ghost",onClick:()=>{W("single"),Q(null)},children:"Single"}),(0,i.jsx)(c.$n,{size:"sm",variant:"bulk"===L?"primary":"ghost",onClick:()=>{W("bulk"),Q(null)},children:"Bulk Add"})]}),"bulk"===L&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t?(0,i.jsxs)(i.Fragment,{children:["One PAT per line. Format: ",(0,i.jsx)("code",{children:"name|pt-..."})," or just ",(0,i.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,i.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:F,value:B,onChange:e=>G(e.target.value)}),H&&(0,i.jsxs)("div",{className:`text-sm font-medium ${H.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",H.success," added",H.failed>0?`, ✗ ${H.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:Y,fullWidth:!0,disabled:J||!B.trim(),children:J?"Adding...":"Add All Keys"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===L&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.pd,{label:"Name",value:A.name,onChange:e=>T({...A,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"Ollama Host URL",value:A.ollamaHostUrl,onChange:e=>T({...A,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:Z,disabled:R||J,variant:"secondary",children:R?"Checking...":"Check"})})]}),!b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:k,type:v?"text":"password",value:A.apiKey,onChange:e=>T({...A,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"qoder"===t?"pt-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:Z,disabled:!A.apiKey||R||J,variant:"secondary",children:R?"Checking...":"Check"})})]}),j&&(0,i.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."}),v&&o&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[o,d&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",d.replace(/^https?:\/\//,"")]})]})]}),C&&(0,i.jsx)(c.l6,{label:"Region",value:I,onChange:e=>D(e.target.value),options:C.map(e=>({value:e.id,label:e.label}))}),l&&(0,i.jsx)(c.pd,{label:"Default Model",value:A.defaultModel,onChange:e=>T({...A,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),z&&(0,i.jsx)(c.Ex,{variant:"success"===z?"success":"error",children:"success"===z?"Valid":"Invalid"}),u&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),l&&(0,i.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."}),N&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(c.pd,{label:"Account ID",value:P.accountId,onChange:e=>E({...P,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),w&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"Azure Endpoint",value:$.azureEndpoint,onChange:e=>O({...$,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(c.pd,{label:"Deployment Name",value:$.deployment,onChange:e=>O({...$,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(c.pd,{label:"API Version",value:$.apiVersion,onChange:e=>O({...$,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(c.pd,{label:"Organization",value:$.organization,onChange:e=>O({...$,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(c.pd,{label:"Priority",type:"number",value:A.priority,onChange:e=>T({...A,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(c.l6,{label:"Proxy Pool",value:A.proxyPoolId,onChange:e=>T({...A,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:X,fullWidth:!0,disabled:J||!b&&(!A.name||!A.apiKey)||l&&!A.defaultModel.trim()||w&&(!$.azureEndpoint||!$.deployment||!$.organization)||N&&!P.accountId,children:J?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function q({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){m(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};r||(e.apiType=n.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:n.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(c.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(c.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,i.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,i.jsx)(c.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:j,disabled:!p||f||!n.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(c.pd,{label:"Model ID (optional)",value:x,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."}),y&&(0,i.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}U.propTypes={isOpen:$().bool.isRequired,provider:$().string,providerName:$().string,isCompatible:$().bool,isAnthropic:$().bool,authType:$().string,authHint:$().string,website:$().string,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string})),error:$().string,existingNames:$().arrayOf($().string),onSave:$().func.isRequired,onBulkDone:$().func,onClose:$().func.isRequired},q.propTypes={isOpen:$().bool.isRequired,node:$().shape({id:$().string,name:$().string,prefix:$().string,apiType:$().string,baseUrl:$().string}),onSave:$().func.isRequired,onClose:$().func.isRequired,isAnthropic:$().bool};let z=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function K({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[n,o]=(0,a.useState)(""),[d,m]=(0,a.useState)(z),[u,x]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(o(""),m(z()),x(null),f(""))},[e]);let b=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},v=async()=>{let e=b(n.trim());if(e){x("testing"),f("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await s.json();x(i.ok?"ok":"error"),f(i.error||"")}catch(e){x("error"),f(e.message)}}},j=async()=>{let e=b(n.trim());if(e&&!g){y(!0);try{await l(e,d)}finally{y(!1)}}};return(0,i.jsx)(c.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:n,onChange:e=>{o(e.target.value),x(null),f("")},onKeyDown:e=>{"Enter"===e.key&&v()},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,i.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===u,onClick:v,disabled:!n.trim()||"testing"===u,children:"testing"===u?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:b(n.trim())||"model-id"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([e,t])=>(0,i.jsx)(c.lM,{checked:!!d[e],onChange:t=>m(s=>({...s,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),"ok"===u&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===u&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:h||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(c.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,size:"sm",disabled:!n.trim()||g,children:g?"Adding...":"Add Model"})]})]})})}K.propTypes={isOpen:$().bool.isRequired,providerAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,onSave:$().func.isRequired,onClose:$().func.isRequired};let J=`[
7
+ pt-only-auto-named`:_,[L,W]=(0,a.useState)("single"),[B,H]=(0,a.useState)(""),[G,Q]=(0,a.useState)(null),V=()=>b&&A.ollamaHostUrl.trim()?{baseUrl:A.ollamaHostUrl.trim()}:k?{azureEndpoint:$.azureEndpoint,apiVersion:$.apiVersion,deployment:$.deployment,organization:$.organization}:N?{accountId:P.accountId}:C&&I?{region:I}:void 0,Z=async()=>{q(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:V()})}),s=await e.json();K(s.valid?"success":"failed")}catch{K("failed")}finally{q(!1)}},X=async()=>{if(t&&(b||A.apiKey)&&(b||A.name)&&(!l||A.defaultModel.trim())){M(!0);try{let e=!1;try{q(!0),K(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:V()})});e=!!(await s.json()).valid,K(e?"success":"failed")}catch{K("failed")}finally{q(!1)}await h({name:A.name||(b?"Ollama Local":""),apiKey:A.apiKey,defaultModel:l?A.defaultModel.trim():void 0,priority:A.priority,proxyPoolId:A.proxyPoolId===y?null:A.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:V()})}finally{M(!1)}}},Y=async()=>{let e=B.split("\n");if(!e.length)return;let s=function(e,t,s={}){let{isCloudflareAi:i=!1}=s,a=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,s="string"==typeof t?t.trim():"";if(!s)continue;let r=function(e,t={}){let{isCloudflareAi:s=!1}=t,i=e.split("|");if(s&&i.length>=3){let e=i[0].trim();return{baseName:e||"Key",apiKey:i.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:i[i.length-1].trim()}}}return i.length>=2?{baseName:i[0].trim()||"Key",apiKey:i.slice(1).join("|").trim()}:{baseName:"Key",apiKey:i[0].trim()}}(s,{isCloudflareAi:i});if(!r||!r.apiKey)continue;let n=r.baseName,o=1;for(;e=`${n} ${o}`,a.has(e.toLowerCase());)o+=1;a.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,x,{isCloudflareAi:N});if(!s.length)return;M(!0),Q(null);let i=0,a=0;for(let e of s)try{let s=!1;try{let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});s=!!(await i.json().catch(()=>({}))).valid}catch{s=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:s?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?i++:a++}catch{a++}M(!1),Q({success:i,failed:a}),i>0&&f&&f()};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Add ${s||t} ${w}`,onClose:g,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{size:"sm",variant:"single"===L?"primary":"ghost",onClick:()=>{W("single"),Q(null)},children:"Single"}),(0,i.jsx)(c.$n,{size:"sm",variant:"bulk"===L?"primary":"ghost",onClick:()=>{W("bulk"),Q(null)},children:"Bulk Add"})]}),"bulk"===L&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t?(0,i.jsxs)(i.Fragment,{children:["One PAT per line. Format: ",(0,i.jsx)("code",{children:"name|pt-..."})," or just ",(0,i.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,i.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:F,value:B,onChange:e=>H(e.target.value)}),G&&(0,i.jsxs)("div",{className:`text-sm font-medium ${G.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",G.success," added",G.failed>0?`, ✗ ${G.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:Y,fullWidth:!0,disabled:J||!B.trim(),children:J?"Adding...":"Add All Keys"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===L&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.pd,{label:"Name",value:A.name,onChange:e=>T({...A,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"Ollama Host URL",value:A.ollamaHostUrl,onChange:e=>T({...A,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:Z,disabled:R||J,variant:"secondary",children:R?"Checking...":"Check"})})]}),!b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:w,type:v?"text":"password",value:A.apiKey,onChange:e=>T({...A,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"qoder"===t?"pt-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:Z,disabled:!A.apiKey||R||J,variant:"secondary",children:R?"Checking...":"Check"})})]}),j&&(0,i.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."}),v&&o&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[o,d&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",d.replace(/^https?:\/\//,"")]})]})]}),C&&(0,i.jsx)(c.l6,{label:"Region",value:I,onChange:e=>D(e.target.value),options:C.map(e=>({value:e.id,label:e.label}))}),l&&(0,i.jsx)(c.pd,{label:"Default Model",value:A.defaultModel,onChange:e=>T({...A,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),z&&(0,i.jsx)(c.Ex,{variant:"success"===z?"success":"error",children:"success"===z?"Valid":"Invalid"}),u&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),l&&(0,i.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."}),N&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(c.pd,{label:"Account ID",value:P.accountId,onChange:e=>E({...P,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),k&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"Azure Endpoint",value:$.azureEndpoint,onChange:e=>O({...$,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(c.pd,{label:"Deployment Name",value:$.deployment,onChange:e=>O({...$,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(c.pd,{label:"API Version",value:$.apiVersion,onChange:e=>O({...$,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(c.pd,{label:"Organization",value:$.organization,onChange:e=>O({...$,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(c.pd,{label:"Priority",type:"number",value:A.priority,onChange:e=>T({...A,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(c.l6,{label:"Proxy Pool",value:A.proxyPoolId,onChange:e=>T({...A,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:X,fullWidth:!0,disabled:J||!b&&(!A.name||!A.apiKey)||l&&!A.defaultModel.trim()||k&&(!$.azureEndpoint||!$.deployment||!$.organization)||N&&!P.accountId,children:J?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function q({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){m(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};r||(e.apiType=n.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:n.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(c.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(c.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,i.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,i.jsx)(c.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:j,disabled:!p||f||!n.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(c.pd,{label:"Model ID (optional)",value:x,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."}),y&&(0,i.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}U.propTypes={isOpen:$().bool.isRequired,provider:$().string,providerName:$().string,isCompatible:$().bool,isAnthropic:$().bool,authType:$().string,authHint:$().string,website:$().string,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string})),error:$().string,existingNames:$().arrayOf($().string),onSave:$().func.isRequired,onBulkDone:$().func,onClose:$().func.isRequired},q.propTypes={isOpen:$().bool.isRequired,node:$().shape({id:$().string,name:$().string,prefix:$().string,apiType:$().string,baseUrl:$().string}),onSave:$().func.isRequired,onClose:$().func.isRequired,isAnthropic:$().bool};let z=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function K({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[n,o]=(0,a.useState)(""),[d,m]=(0,a.useState)(z),[u,x]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(o(""),m(z()),x(null),f(""))},[e]);let b=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},v=async()=>{let e=b(n.trim());if(e){x("testing"),f("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await s.json();x(i.ok?"ok":"error"),f(i.error||"")}catch(e){x("error"),f(e.message)}}},j=async()=>{let e=b(n.trim());if(e&&!g){y(!0);try{await l(e,d)}finally{y(!1)}}};return(0,i.jsx)(c.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:n,onChange:e=>{o(e.target.value),x(null),f("")},onKeyDown:e=>{"Enter"===e.key&&v()},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,i.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===u,onClick:v,disabled:!n.trim()||"testing"===u,children:"testing"===u?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:b(n.trim())||"model-id"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([e,t])=>(0,i.jsx)(c.lM,{checked:!!d[e],onChange:t=>m(s=>({...s,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),"ok"===u&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===u&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:h||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(c.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,size:"sm",disabled:!n.trim()||g,children:g?"Adding...":"Add Model"})]})]})})}K.propTypes={isOpen:$().bool.isRequired,providerAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,onSave:$().func.isRequired,onClose:$().func.isRequired};let J=`[
8
8
  {
9
9
  "accessToken": "eyJhbGc...",
10
10
  "refreshToken": "rt_...",
@@ -24,4 +24,4 @@ pt-only-auto-named`:_,[L,W]=(0,a.useState)("single"),[B,G]=(0,a.useState)(""),[H
24
24
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
25
  "email": "account2@example.com"
26
26
  }
27
- ]`;function L(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function W({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,N.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=L(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,N.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,N.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=L(l)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,N.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{o(!1)}},k=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,N.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,N.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,N.Tl)("Loaded")," ",f.accountsCount," ",(0,N.Tl)("account(s) from")," ",f.filesCount," ",(0,N.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,N.Tl)("failed")]}),k.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:k.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}let B={claude:"claudeAutoPing",codex:"codexAutoPing"};function G(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),r=t.id,{getCaps:u}=(0,w.y)(),[x,h]=(0,a.useState)([]),[f,g]=(0,a.useState)(!0),[y,b]=(0,a.useState)(null),[v,C]=(0,a.useState)([]),[T,$]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!1),[D,_]=(0,a.useState)(!1),[z,J]=(0,a.useState)(""),[F,L]=(0,a.useState)(!1),[G,H]=(0,a.useState)(!1),[Q,V]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)(!1),[et,es]=(0,a.useState)(null),[ei,ea]=(0,a.useState)({}),[el,er]=(0,a.useState)([]),[en,eo]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)({}),[em,ep]=(0,a.useState)(""),[eu,ex]=(0,a.useState)(()=>new Set),[eh,ef]=(0,a.useState)(!1),[eg,ey]=(0,a.useState)([]),[eb,ev]=(0,a.useState)("__none__"),[ej,ek]=(0,a.useState)(!1),[ew,eN]=(0,a.useState)(null),[eC,eS]=(0,a.useState)(""),[eA,eT]=(0,a.useState)("auto"),[e$,eO]=(0,a.useState)({enabled:!1,connections:{}}),[eP,eE]=(0,a.useState)([]),[eI,eD]=(0,a.useState)([]),[eR,e_]=(0,a.useState)([]),[eU,eq]=(0,a.useState)([]),[ez,eK]=(0,a.useState)(null),[eJ,eM]=(0,a.useState)(!1),[eF,eL]=(0,a.useState)(!1),[eW,eB]=(0,a.useState)(!1),[eG,eH]=(0,a.useState)(null),[eQ,eV]=(0,a.useState)({}),[eZ,eX]=(0,a.useState)(null),eY=(0,a.useRef)(!1),[e0,e1]=(0,a.useState)(!1),{copied:e2,copy:e5}=(0,k.C)(),e3="ag_risk_confirmed",e4=()=>{$(!0)},e6=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(e3)?eM(!0):tt?e4():(J(""),_(!0))},e7=()=>{J(""),_(!0)},e8=()=>{tt?e6():e7()},e9=y?{id:y.id,name:y.name||("anthropic-compatible"===y.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===y.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===y.type?"AC":"OC",apiType:y.apiType,baseUrl:y.baseUrl,type:y.type}:m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r]||m.br[r],te=e9?.authModes||[],tt=!!m.zN[r]||!!m.IS[r]||te.includes("oauth"),ts=!!m.fg[r]||te.includes("apikey"),ti=!!m.IS[r]?.noAuth,ta=(0,p.KC)(r),tl="cursor"===r&&eI.length>0?eI:ta,tr=(0,m.wG)(r),tn=(0,m.mq)(r),to=(0,m.gb)(r),td=tn||to,tc=!td&&tt&&ts,tm="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"OAuth",tp="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"qoder"===r?"PAT":"API Key",tu=e=>{if(!eA||"auto"===eA)return null;let t=j(r,e);return t&&t.includes(eA)?eA:null},tx=td?r:tr,th=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=j(r,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tl)s(e.id);for(let e of eR)s(e.id);for(let e of el)e.providerAlias===tx&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tf=td?y?.prefix||r:tr,tg=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}`,{cache:"no-store"}),t=await e.json();e.ok&&eq(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tx]),ty=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tx,ids:[e]})})).ok&&await tg()}catch(e){console.log("Error disabling model:",e)}},tb=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tg()}catch(e){console.log("Error enabling model:",e)}},tv=async e=>{e.length&&eK({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eK(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tx,ids:e})})).ok&&await tg()}catch(e){console.log("Error disabling all models:",e)}}})},tj=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tx)}`,{method:"DELETE"})).ok&&await tg()}catch(e){console.log("Error enabling all models:",e)}},tk=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ea(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tw=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&er(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e_(e.models)}).catch(()=>{})},[r]);let tN=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=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"})]),a=await e.json(),l=await t.json(),n=await s.json(),o=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===r);h(e)}s.ok&&C(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};eN(d.fallbackStrategy||null),eS(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};eT(c.mode||"auto");let m=B[r],p=m&&o[m]||{};if(eO({enabled:!0===p.enabled,connections:p.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&td)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}b(e)}}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},[r,td]),tC=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(b(s.node),await tN(),X(!1))}catch(e){console.log("Error updating provider node:",e)}},tS=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[r]:l[r]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tA=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[r]={mode:e}:delete s[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tT=async e=>{let t=B[r];if(t){eO(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,a.useEffect)(()=>{tN(),tk(),tw(),tg()},[tN,tk,tw,tg]),(0,a.useEffect)(()=>{if("cursor"!==r)return void eD([]);let e=x.find(e=>!1!==e.isActive);if(!e?.id)return void eD([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:s})=>{!t&&e&&Array.isArray(s.models)&&s.models.length>0&&eD(s.models)}).catch(()=>{}),()=>{t=!0}},[r,x]),(0,a.useEffect)(()=>{let e=(m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r])?.modelsFetcher;e&&S(e).then(eE)},[r]);let t$=async(e,t,s=tr)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tk();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tO=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tk()}catch(e){console.log("Error deleting alias:",e)}},tP=async(e,t="llm",s=tx,i)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{}})});if(a.ok)await tw(),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)}},tE=async(e,t="llm",s=tx)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tw(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tI=async()=>{if(e0)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Qoder connection first"));e1(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");el.some(e=>e.providerAlias===tx&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ei).includes(`${tx}/${s}`)||(await tP(s,"llm",tx),a+=1)}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{e1(!1)}},tD=async()=>{if(eF||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));eY.current=!1,eL(!0),eB(!1),eH(null),eV(e),eX({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<x.length;e+=1){if(eY.current){eX({total:x.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=x[e];eH(i.id),eV(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,eV(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,eV(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}eX({total:x.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eH(null),eL(!1),eB(!1),eY.current=!1}},tR=async e=>{eK({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eK(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},t_=()=>{tN(),$(!1)},tU=async e=>{J("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tN(),_(!1);return}J(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),J("Failed to save connection")}},tq=async e=>{try{(await fetch(`/api/providers/${et.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tN(),V(!1))}catch(e){console.log("Error updating connection:",e)}},tz=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tK=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(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 tN()}},tJ=x.filter(e=>eg.includes(e.id)),tM=x.length>0&&eg.length===x.length;(0,a.useEffect)(()=>{ey(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===tJ.length)return;let e=new Set(tJ.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=v.find(e=>e.id===t);return s?.name}})();let tF=()=>{ej||ee(!1)},tL=async e=>{ek(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).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 tN(),ee(!1)}finally{ek(!1)}},tW=e=>tL(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),tB=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:x.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,eg.includes(s)),onChange:()=>{var t;return t=e.id,void ey(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(R,{connection:e,proxyPools:v,isOAuth:tt,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>tK(t,t-1),onMoveDown:()=>tK(t,t+1),onToggleActive:t=>tz(e.id,t),autoPing:B[r]&&"oauth"===e.authType?{on:!0===e$.connections[e.id],onToggle:t=>{var s;return s=e.id,void tT({...e$,connections:{...e$.connections,[s]:t}})},provider:r}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{es(e),V(!0)},onDelete:()=>tR(e.id),oneByOneStatus:eQ[e.id]||null})})]},e.id)})}),tG=v.filter(e=>!0===e.isActive),tH=(0,i.jsx)(c.aF,{isOpen:Y,onClose:tF,title:`Apply Proxy (${x.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=v.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tL(x.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:ej||0===tG.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>tW(null),disabled:ej,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),v.map(e=>(0,i.jsxs)("button",{onClick:()=>tW(e.id),disabled:ej||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ej&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:tF,variant:"ghost",fullWidth:!0,disabled:ej,children:"Cancel"})]})}),tQ=async e=>{if(!eu.has(e)){ex(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();ec(t=>({...t,[e]:s.ok?"ok":"error"})),ep(s.ok?"":s.error||"Model not reachable")}catch{ec(t=>({...t,[e]:"error"})),ep("Network error")}finally{ex(t=>{let s=new Set(t);return s.delete(e),s})}}};if(f)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!e9)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let tV=()=>tn&&e9.apiType?"responses"===e9.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":to?"/providers/anthropic-m.png":(0,d.HY)(e9.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e9.color}15`},children:en||!tV()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:e9.color},children:e9.textIcon||e9.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:tV(),alt:e9.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(e9.id),eo(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e9.name}),(e9.notice?.apiKeyUrl||e9.notice?.signupUrl||e9.website)&&(0,i.jsxs)("a",{href:e9.notice?.apiKeyUrl||e9.notice?.signupUrl||e9.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e9.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),e9.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e9.deprecationNotice})]}),e9.notice?.text&&!e9.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e9.notice.text}),e9.notice.apiKeyUrl&&(0,i.jsx)("a",{href:e9.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 →"})]}),td&&y&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:to?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[to?"Messages API":"responses"===y.apiType?"Responses API":"Chat Completions"," \xb7 ",(y.baseUrl||"").replace(/\/$/,""),"/",to?"messages":"responses"===y.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{J(""),_(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>X(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eK({title:"Delete Compatible Node",message:`Delete this ${to?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eK(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),ti?(0,i.jsx)(c.gw,{providerId:r}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[x.length>0&&v.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ee(!0),children:"Apply Proxy"}),x.length>0&&(0,i.jsxs)(i.Fragment,{children:[eg.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eg.length;0!==e&&eK({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eK(null);let e=0,t=[...eg];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}h(e=>e.filter(e=>!t.includes(e.id))),ey([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eg.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tD,disabled:eF,children:eF?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eF&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eF&&(eY.current=!0,eB(!0))},disabled:eW,children:eW?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===ew,onChange:e=>{let t=e?"round-robin":null,s=e?eC||"1":eC;e&&!eC&&eS("1"),eN(t),tS(t,s)}}),"round-robin"===ew&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eC,onChange:e=>{var t;eS(t=e.target.value),tS("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tt?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tc&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tm," or ",tp,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tc?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e6,children:tm}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:e7,children:tp})]}):(0,i.jsxs)(i.Fragment,{children:[!td&&"iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>L(!0),children:(0,N.Tl)("Bulk Add")}),"grok-cli"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>H(!0),children:(0,N.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:e8,children:td?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[eZ&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",eZ.total]}),(0,i.jsxs)("span",{children:["Completed: ",eZ.completed]}),(0,i.jsxs)("span",{children:["Passed: ",eZ.passed]}),(0,i.jsxs)("span",{children:["Failed: ",eZ.failed]}),eZ.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eF&&eG&&(0,i.jsxs)("span",{children:["Running: ",x.find(e=>e.id===eG)?.name||eG]})]})}),x.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:tM,onChange:()=>{tM?ey([]):ey(x.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tB,!td&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>L(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),"grok-cli"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>H(!0),title:(0,N.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tc?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e6,className:"w-full sm:w-auto",children:tm}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:e7,className:"w-full sm:w-auto",children:tp})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:e8,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),th&&(0,i.jsx)("select",{value:eA,onChange:e=>{var t;eT(t=e.target.value),tA(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:th.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!td&&(e=[...tl,...eR.filter(e=>!tl.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eU.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eU.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tj,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tv(e),children:"Disable All"})]}))]}),!!em&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:em}),(()=>{let e,t,s;if(td)return(0,i.jsx)(E,{providerStorageAlias:tx,providerDisplayAlias:tf,modelAliases:ei,customModels:el,copied:e2,onCopy:e5,onSetAlias:t$,onDeleteAlias:tO,onAddCustomModel:e=>tP(e,"llm",tx),onDeleteCustomModel:e=>tE(e,"llm",tx),connections:x,isAnthropic:to});let a=[...tl,...eR.filter(e=>!tl.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eU),n=a.filter(e=>!l.has(e.id)),o=a.filter(e=>l.has(e.id)),d=A({customModels:el,modelAliases:ei,providerAlias:tx,builtInModels:tl,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(O,{model:{id:e.id,name:e.name},fullModel:`${tf}/${e.id}`,alias:e.alias,copied:e2,onCopy:e5,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tE(e.id,"llm",tx):tO(e.alias)},testStatus:ed[e.id],onTest:x.length>0||ti?()=>tQ(e.id):void 0,isTesting:eu.has(e.id),isCustom:!0,isFree:!1,caps:u(`${r}/${e.id}`),thinkingSuffix:tu(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tx}/${e.id}`,s=`${r}/${e.id}`,a=Object.entries(ei).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(O,{model:e,fullModel:`${tf}/${e.id}`,alias:a,copied:e2,onCopy:e5,onSetAlias:t=>t$(e.id,t,tx),onDeleteAlias:()=>tO(a),testStatus:ed[e.id],onTest:x.length>0||ti?()=>tQ(e.id):void 0,isTesting:eu.has(e.id),isFree:e.isFree,onDisable:()=>ty(e.id),caps:u(`${r}/${e.id}`),thinkingSuffix:tu(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ef(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===r&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tI,disabled:e0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e0?{animation:"spin 1s linear infinite"}:void 0,children:e0?"progress_activity":"download"}),e0?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Qoder Models")]}),eP.length>0&&(e=new Set([...Object.values(ei),...d.map(e=>e.fullModel)]),t=new Set(tl.map(e=>e.id)),0===(s=eP.filter(s=>!e.has(`${tx}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tP(e.id,"llm",tx)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,i.jsxs)("button",{onClick:()=>tb(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tH,"kiro"===r?(0,i.jsx)(c.Mh,{isOpen:T,providerInfo:e9,onSuccess:t_,onClose:()=>$(!1)}):"cursor"===r?(0,i.jsx)(c.G9,{isOpen:T,onSuccess:t_,onClose:()=>$(!1)}):"gitlab"===r?(0,i.jsx)(c.vj,{isOpen:T,providerInfo:e9,onSuccess:t_,onClose:()=>$(!1)}):(0,i.jsx)(c.LF,{isOpen:T,provider:r,providerInfo:e9,onSuccess:t_,onClose:()=>$(!1)}),"iflow"===r&&(0,i.jsx)(c.vE,{isOpen:P,onSuccess:()=>{tN(),I(!1)},onClose:()=>I(!1)}),(0,i.jsx)(U,{isOpen:D,provider:r,providerName:e9.name,isCompatible:td,isAnthropic:to,authType:e9?.authType,authHint:e9?.authHint,website:e9?.website,proxyPools:v,error:z,existingNames:x.map(e=>e.name).filter(Boolean),onSave:tU,onBulkDone:tN,onClose:()=>{J(""),_(!1)}}),(0,i.jsx)(c.wI,{isOpen:Q,connection:et,proxyPools:v,onSave:tq,onClose:()=>V(!1)}),td&&(0,i.jsx)(q,{isOpen:Z,node:y,onSave:tC,onClose:()=>X(!1),isAnthropic:to}),!td&&(0,i.jsx)(K,{isOpen:eh,providerAlias:tx,providerDisplayAlias:tf,onSave:async(e,t)=>{await tP(e,"llm",tx,t),ef(!1)},onClose:()=>ef(!1)}),"codex"===r&&(0,i.jsx)(M,{isOpen:F,onClose:()=>L(!1),onSuccess:tN}),"grok-cli"===r&&(0,i.jsx)(W,{isOpen:G,onClose:()=>H(!1),onSuccess:tN}),(0,i.jsx)(c.uo,{isOpen:eJ,onClose:()=>eM(!1),onConfirm:()=>{(window.localStorage.setItem(e3,"true"),eM(!1),tt)?e4():e7()},title:"Risk Notice",message:e9?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!ez,onClose:()=>eK(null),onConfirm:ez?.onConfirm,title:ez?.title||"Confirm",message:ez?.message,variant:"danger"})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=77458)),_N_E=e.O()}]);
27
+ ]`;function L(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function W({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,N.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=L(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,N.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,N.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=L(l)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,N.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,N.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,N.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,N.Tl)("Loaded")," ",f.accountsCount," ",(0,N.Tl)("account(s) from")," ",f.filesCount," ",(0,N.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,N.Tl)("failed")]}),w.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}let B={claude:"claudeAutoPing",codex:"codexAutoPing"};function H(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),r=t.id,{getCaps:u}=(0,k.y)(),[x,h]=(0,a.useState)([]),[f,g]=(0,a.useState)(!0),[y,b]=(0,a.useState)(null),[v,C]=(0,a.useState)([]),[T,$]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!1),[D,_]=(0,a.useState)(!1),[z,J]=(0,a.useState)(!1),[F,L]=(0,a.useState)(""),[H,G]=(0,a.useState)(!1),[Q,V]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)(!1),[et,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(null),[el,er]=(0,a.useState)({}),[en,eo]=(0,a.useState)([]),[ed,ec]=(0,a.useState)(!1),[em,ep]=(0,a.useState)({}),[eu,ex]=(0,a.useState)(""),[eh,ef]=(0,a.useState)(()=>new Set),[eg,ey]=(0,a.useState)(!1),[eb,ev]=(0,a.useState)([]),[ej,ew]=(0,a.useState)("__none__"),[ek,eN]=(0,a.useState)(!1),[eC,eS]=(0,a.useState)(null),[eA,eT]=(0,a.useState)(""),[e$,eO]=(0,a.useState)("auto"),[eP,eE]=(0,a.useState)({enabled:!1,connections:{}}),[eI,eD]=(0,a.useState)([]),[eR,e_]=(0,a.useState)([]),[eU,eq]=(0,a.useState)([]),[ez,eK]=(0,a.useState)([]),[eJ,eM]=(0,a.useState)(null),[eF,eL]=(0,a.useState)(!1),[eW,eB]=(0,a.useState)(!1),[eH,eG]=(0,a.useState)(!1),[eQ,eV]=(0,a.useState)(null),[eZ,eX]=(0,a.useState)({}),[eY,e0]=(0,a.useState)(null),e1=(0,a.useRef)(!1),[e2,e5]=(0,a.useState)(!1),[e4,e3]=(0,a.useState)(!1),{copied:e6,copy:e7}=(0,w.C)(),e8="ag_risk_confirmed",e9=()=>{$(!0)},te=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(e8)?eL(!0):"xiaomi-mimo"===r?I(!0):tl?e9():(L(""),J(!0))},tt=()=>{L(""),J(!0)},ts=()=>{tl?te():tt()},ti=y?{id:y.id,name:y.name||("anthropic-compatible"===y.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===y.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===y.type?"AC":"OC",apiType:y.apiType,baseUrl:y.baseUrl,type:y.type}:m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r]||m.br[r],ta=ti?.authModes||[],tl=!!m.zN[r]||!!m.IS[r]||ta.includes("oauth"),tr=!!m.fg[r]||ta.includes("apikey"),tn=!!m.IS[r]?.noAuth,to=(0,p.KC)(r),td="cursor"===r&&eR.length>0?eR:to,tc=(0,m.wG)(r),tm=(0,m.mq)(r),tp=(0,m.gb)(r),tu=tm||tp,tx=!tu&&tl&&tr,th="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"OAuth",tf="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"qoder"===r?"PAT":"API Key",tg=e=>{if(!e$||"auto"===e$)return null;let t=j(r,e);return t&&t.includes(e$)?e$:null},ty=tu?r:tc,tb=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=j(r,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of td)s(e.id);for(let e of eU)s(e.id);for(let e of en)e.providerAlias===ty&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tv=tu?y?.prefix||r:tc,tj=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ty)}`,{cache:"no-store"}),t=await e.json();e.ok&&eK(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[ty]),tw=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ty,ids:[e]})})).ok&&await tj()}catch(e){console.log("Error disabling model:",e)}},tk=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ty)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tj()}catch(e){console.log("Error enabling model:",e)}},tN=async e=>{e.length&&eM({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eM(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:ty,ids:e})})).ok&&await tj()}catch(e){console.log("Error disabling all models:",e)}}})},tC=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(ty)}`,{method:"DELETE"})).ok&&await tj()}catch(e){console.log("Error enabling all models:",e)}},tS=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&er(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tA=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eo(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eq(e.models)}).catch(()=>{})},[r]);let tT=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=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"})]),a=await e.json(),l=await t.json(),n=await s.json(),o=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===r);h(e)}s.ok&&C(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};eS(d.fallbackStrategy||null),eT(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};eO(c.mode||"auto");let m=B[r],p=m&&o[m]||{};if(eE({enabled:!0===p.enabled,connections:p.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&tu)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}b(e)}}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},[r,tu]),t$=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(b(s.node),await tT(),ee(!1))}catch(e){console.log("Error updating provider node:",e)}},tO=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[r]:l[r]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tP=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[r]={mode:e}:delete s[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tE=async e=>{let t=B[r];if(t){eE(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,a.useEffect)(()=>{tT(),tS(),tA(),tj()},[tT,tS,tA,tj]),(0,a.useEffect)(()=>{if("cursor"!==r)return void e_([]);let e=x.find(e=>!1!==e.isActive);if(!e?.id)return void e_([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:s})=>{!t&&e&&Array.isArray(s.models)&&s.models.length>0&&e_(s.models)}).catch(()=>{}),()=>{t=!0}},[r,x]),(0,a.useEffect)(()=>{let e=(m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r])?.modelsFetcher;e&&S(e).then(eD)},[r]);let tI=async(e,t,s=tc)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tS();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tD=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tS()}catch(e){console.log("Error deleting alias:",e)}},tR=async(e,t="llm",s=ty,i)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{}})});if(a.ok)await tA(),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)}},t_=async(e,t="llm",s=ty)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await tA(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tU=async()=>{if(e2)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Qoder connection first"));e5(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");en.some(e=>e.providerAlias===ty&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(el).includes(`${ty}/${s}`)||(await tR(s,"llm",ty),a+=1)}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{e5(!1)}},tq=async()=>{if(e4)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,N.Tl)("Please add an active Cline connection first"));e3(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,N.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,N.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;t&&(en.some(e=>e.providerAlias===ty&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(el).includes(`${ty}/${t}`)||(await tR(t,"llm",ty),a+=1))}0===a?alert((0,N.Tl)("All models already exist, no new models added")):alert((0,N.Tl)("Successfully added")+` ${a} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,N.Tl)("Error fetching models")+": "+e.message)}finally{e3(!1)}},tz=async()=>{if(eW||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));e1.current=!1,eB(!0),eG(!1),eV(null),eX(e),e0({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<x.length;e+=1){if(e1.current){e0({total:x.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=x[e];eV(i.id),eX(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,eX(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,eX(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e0({total:x.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eV(null),eB(!1),eG(!1),e1.current=!1}},tK=async e=>{eM({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eM(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tJ=()=>{tT(),$(!1)},tM=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tT(),J(!1);return}L(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}},tF=async e=>{try{(await fetch(`/api/providers/${ei.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tT(),X(!1))}catch(e){console.log("Error updating connection:",e)}},tL=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tW=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(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 tT()}},tB=x.filter(e=>eb.includes(e.id)),tH=x.length>0&&eb.length===x.length;(0,a.useEffect)(()=>{ev(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===tB.length)return;let e=new Set(tB.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=v.find(e=>e.id===t);return s?.name}})();let tG=()=>{ek||es(!1)},tQ=async e=>{eN(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).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 tT(),es(!1)}finally{eN(!1)}},tV=e=>tQ(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),tZ=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:x.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,eb.includes(s)),onChange:()=>{var t;return t=e.id,void ev(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(R,{connection:e,proxyPools:v,isOAuth:tl,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>tW(t,t-1),onMoveDown:()=>tW(t,t+1),onToggleActive:t=>tL(e.id,t),autoPing:B[r]&&"oauth"===e.authType?{on:!0===eP.connections[e.id],onToggle:t=>{var s;return s=e.id,void tE({...eP,connections:{...eP.connections,[s]:t}})},provider:r}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ea(e),X(!0)},onDelete:()=>tK(e.id),oneByOneStatus:eZ[e.id]||null})})]},e.id)})}),tX=v.filter(e=>!0===e.isActive),tY=(0,i.jsx)(c.aF,{isOpen:et,onClose:tG,title:`Apply Proxy (${x.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=v.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tQ(x.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:ek||0===tX.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>tV(null),disabled:ek,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),v.map(e=>(0,i.jsxs)("button",{onClick:()=>tV(e.id),disabled:ek||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ek&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:tG,variant:"ghost",fullWidth:!0,disabled:ek,children:"Cancel"})]})}),t0=async e=>{if(!eh.has(e)){ef(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${ty}/${e}`})}),s=await t.json();ep(t=>({...t,[e]:s.ok?"ok":"error"})),ex(s.ok?"":s.error||"Model not reachable")}catch{ep(t=>({...t,[e]:"error"})),ex("Network error")}finally{ef(t=>{let s=new Set(t);return s.delete(e),s})}}};if(f)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!ti)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let t1=()=>tm&&ti.apiType?"responses"===ti.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tp?"/providers/anthropic-m.png":(0,d.HY)(ti.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${ti.color}15`},children:ed||!t1()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:ti.color},children:ti.textIcon||ti.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:t1(),alt:ti.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(ti.id),ec(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:ti.name}),(ti.notice?.apiKeyUrl||ti.notice?.signupUrl||ti.website)&&(0,i.jsxs)("a",{href:ti.notice?.apiKeyUrl||ti.notice?.signupUrl||ti.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),ti.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),ti.deprecated&&(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:ti.deprecationNotice})]}),ti.notice?.text&&!ti.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:ti.notice.text}),ti.notice.apiKeyUrl&&(0,i.jsx)("a",{href:ti.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 →"})]}),tu&&y&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tp?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tp?"Messages API":"responses"===y.apiType?"Responses API":"Chat Completions"," \xb7 ",(y.baseUrl||"").replace(/\/$/,""),"/",tp?"messages":"responses"===y.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{L(""),J(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ee(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eM({title:"Delete Compatible Node",message:`Delete this ${tp?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eM(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tn?(0,i.jsx)(c.gw,{providerId:r}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[x.length>0&&v.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>es(!0),children:"Apply Proxy"}),x.length>0&&(0,i.jsxs)(i.Fragment,{children:[eb.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eb.length;0!==e&&eM({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eM(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}h(e=>e.filter(e=>!t.includes(e.id))),ev([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eb.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tz,disabled:eW,children:eW?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eW&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eW&&(e1.current=!0,eG(!0))},disabled:eH,children:eH?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===eC,onChange:e=>{let t=e?"round-robin":null,s=e?eA||"1":eA;e&&!eA&&eT("1"),eS(t),tO(t,s)}}),"round-robin"===eC&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eA,onChange:e=>{var t;eT(t=e.target.value),tO("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tl?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tx&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",th," or ",tf,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tx?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:te,children:th}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:tt,children:tf})]}):(0,i.jsxs)(i.Fragment,{children:[!tu&&"iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>_(!0),children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>G(!0),children:(0,N.Tl)("Bulk Add")}),"grok-cli"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>V(!0),children:(0,N.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:ts,children:tu?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[eY&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",eY.total]}),(0,i.jsxs)("span",{children:["Completed: ",eY.completed]}),(0,i.jsxs)("span",{children:["Passed: ",eY.passed]}),(0,i.jsxs)("span",{children:["Failed: ",eY.failed]}),eY.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eW&&eQ&&(0,i.jsxs)("span",{children:["Running: ",x.find(e=>e.id===eQ)?.name||eQ]})]})}),x.length>0&&(0,i.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:tH,onChange:()=>{tH?ev([]):ev(x.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tZ,!tu&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>_(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>G(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),"grok-cli"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>V(!0),title:(0,N.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tx?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:te,className:"w-full sm:w-auto",children:th}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:tt,className:"w-full sm:w-auto",children:tf})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:ts,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tb&&(0,i.jsx)("select",{value:e$,onChange:e=>{var t;eO(t=e.target.value),tP(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tb.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tu&&(e=[...td,...eU.filter(e=>!td.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!ez.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[ez.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tC,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tN(e),children:"Disable All"})]}))]}),!!eu&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eu}),(()=>{let e,t,s;if(tu)return(0,i.jsx)(E,{providerStorageAlias:ty,providerDisplayAlias:tv,modelAliases:el,customModels:en,copied:e6,onCopy:e7,onSetAlias:tI,onDeleteAlias:tD,onAddCustomModel:e=>tR(e,"llm",ty),onDeleteCustomModel:e=>t_(e,"llm",ty),connections:x,isAnthropic:tp});let a=[...td,...eU.filter(e=>!td.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(ez),n=a.filter(e=>!l.has(e.id)),o=a.filter(e=>l.has(e.id)),d=A({customModels:en,modelAliases:el,providerAlias:ty,builtInModels:td,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(O,{model:{id:e.id,name:e.name},fullModel:`${tv}/${e.id}`,alias:e.alias,copied:e6,onCopy:e7,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t_(e.id,"llm",ty):tD(e.alias)},testStatus:em[e.id],onTest:x.length>0||tn?()=>t0(e.id):void 0,isTesting:eh.has(e.id),isCustom:!0,isFree:!1,caps:u(`${r}/${e.id}`),thinkingSuffix:tg(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${ty}/${e.id}`,s=`${r}/${e.id}`,a=Object.entries(el).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(O,{model:e,fullModel:`${tv}/${e.id}`,alias:a,copied:e6,onCopy:e7,onSetAlias:t=>tI(e.id,t,ty),onDeleteAlias:()=>tD(a),testStatus:em[e.id],onTest:x.length>0||tn?()=>t0(e.id):void 0,isTesting:eh.has(e.id),isFree:e.isFree,onDisable:()=>tw(e.id),caps:u(`${r}/${e.id}`),thinkingSuffix:tg(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ey(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===r&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tU,disabled:e2,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e2?{animation:"spin 1s linear infinite"}:void 0,children:e2?"progress_activity":"download"}),e2?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Qoder Models")]}),("cline"===r||"clinepass"===r)&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tq,disabled:e4,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:e4?{animation:"spin 1s linear infinite"}:void 0,children:e4?"progress_activity":"download"}),e4?(0,N.Tl)("Fetching..."):(0,N.Tl)("Import from /models")]}),eI.length>0&&(e=new Set([...Object.values(el),...d.map(e=>e.fullModel)]),t=new Set(td.map(e=>e.id)),0===(s=eI.filter(s=>!e.has(`${ty}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tR(e.id,"llm",ty)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,i.jsxs)("button",{onClick:()=>tk(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tY,"kiro"===r?(0,i.jsx)(c.Mh,{isOpen:T,providerInfo:ti,onSuccess:tJ,onClose:()=>$(!1)}):"cursor"===r?(0,i.jsx)(c.G9,{isOpen:T,onSuccess:tJ,onClose:()=>$(!1)}):"gitlab"===r?(0,i.jsx)(c.vj,{isOpen:T,providerInfo:ti,onSuccess:tJ,onClose:()=>$(!1)}):(0,i.jsx)(c.LF,{isOpen:T,provider:r,providerInfo:ti,onSuccess:tJ,onClose:()=>$(!1)}),(0,i.jsx)(c.LH,{isOpen:P,onSuccess:tJ,onClose:()=>I(!1)}),"iflow"===r&&(0,i.jsx)(c.vE,{isOpen:D,onSuccess:()=>{tT(),_(!1)},onClose:()=>_(!1)}),(0,i.jsx)(U,{isOpen:z,provider:r,providerName:ti.name,isCompatible:tu,isAnthropic:tp,authType:ti?.authType,authHint:ti?.authHint,website:ti?.website,proxyPools:v,error:F,existingNames:x.map(e=>e.name).filter(Boolean),onSave:tM,onBulkDone:tT,onClose:()=>{L(""),J(!1)}}),(0,i.jsx)(c.wI,{isOpen:Z,connection:ei,proxyPools:v,onSave:tF,onClose:()=>X(!1)}),tu&&(0,i.jsx)(q,{isOpen:Y,node:y,onSave:t$,onClose:()=>ee(!1),isAnthropic:tp}),!tu&&(0,i.jsx)(K,{isOpen:eg,providerAlias:ty,providerDisplayAlias:tv,onSave:async(e,t)=>{await tR(e,"llm",ty,t),ey(!1)},onClose:()=>ey(!1)}),"codex"===r&&(0,i.jsx)(M,{isOpen:H,onClose:()=>G(!1),onSuccess:tT}),"grok-cli"===r&&(0,i.jsx)(W,{isOpen:Q,onClose:()=>V(!1),onSuccess:tT}),(0,i.jsx)(c.uo,{isOpen:eF,onClose:()=>eL(!1),onConfirm:()=>{(window.localStorage.setItem(e8,"true"),eL(!1),tl)?e9():tt()},title:"Risk Notice",message:ti?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eJ,onClose:()=>eM(null),onConfirm:eJ?.onConfirm,title:eJ?.title||"Confirm",message:eJ?.message,variant:"danger"})]})}}},e=>{e.O(0,[4614,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=77458)),_N_E=e.O()}]);