@hilbras/omnihilbras 2.6.0 → 2.7.0

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 (975) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +21 -19
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/react-loadable-manifest.json +1 -1
  5. package/app/.next-cli-build/routes-manifest.json +12 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +5 -5
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  76. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  88. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  89. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  90. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  91. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  120. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  124. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +2 -2
  126. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  140. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  146. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js +2 -2
  150. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +3 -3
  154. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  156. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  160. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/models/chat/route.js +1 -0
  216. package/app/.next-cli-build/server/app/api/models/chat/route.js.nft.json +1 -0
  217. package/app/.next-cli-build/server/app/api/models/chat/route_client-reference-manifest.js +1 -0
  218. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/models/test-batch/route.js +2 -0
  227. package/app/.next-cli-build/server/app/api/models/test-batch/route.js.nft.json +1 -0
  228. package/app/.next-cli-build/server/app/api/models/test-batch/route_client-reference-manifest.js +1 -0
  229. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  236. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  260. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  266. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/web-session/[id]/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/providers/web-session/[id]/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  306. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  308. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +2 -2
  310. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  314. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  316. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  318. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  320. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  322. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  324. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  326. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  328. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  330. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  346. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +2 -2
  436. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  442. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  444. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  445. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  446. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  447. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  448. package/app/.next-cli-build/server/app/callback.html +1 -1
  449. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  450. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  451. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  452. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  453. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  455. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +5 -5
  456. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  457. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  458. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  460. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
  461. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  462. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  463. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  465. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +5 -5
  466. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  467. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  468. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  470. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +5 -5
  471. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  472. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  475. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +5 -5
  476. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  477. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  478. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  480. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +5 -5
  481. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  482. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  485. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +5 -5
  486. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  487. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  488. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  490. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +5 -5
  491. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  492. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  493. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  495. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +5 -5
  496. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  497. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  500. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +5 -5
  501. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  502. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  503. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  505. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +5 -5
  506. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  507. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  508. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/quota.rsc +5 -5
  510. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +5 -5
  511. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +5 -5
  512. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  517. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  518. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  519. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  520. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  521. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  523. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +5 -5
  524. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  525. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  526. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  527. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  528. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +5 -5
  529. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  530. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  532. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  533. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +5 -5
  534. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  535. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  536. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  537. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  538. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +5 -5
  539. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  540. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  541. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  542. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  543. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +5 -5
  544. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  545. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  546. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  547. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  548. package/app/.next-cli-build/server/app/index.html +1 -1
  549. package/app/.next-cli-build/server/app/index.rsc +5 -5
  550. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  551. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  552. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  553. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  554. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  555. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  556. package/app/.next-cli-build/server/app/landing.html +1 -1
  557. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  558. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  559. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  561. package/app/.next-cli-build/server/app/login/page.js +1 -1
  562. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  563. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  564. package/app/.next-cli-build/server/app/login.html +1 -1
  565. package/app/.next-cli-build/server/app/login.rsc +5 -5
  566. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  567. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  568. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  569. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  570. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  571. package/app/.next-cli-build/server/app/page.js +1 -1
  572. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  573. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  574. package/app/.next-cli-build/server/app-paths-manifest.json +21 -19
  575. package/app/.next-cli-build/server/chunks/1329.js +1 -1
  576. package/app/.next-cli-build/server/chunks/3390.js +1 -0
  577. package/app/.next-cli-build/server/chunks/3770.js +1 -1
  578. package/app/.next-cli-build/server/chunks/3799.js +1 -1
  579. package/app/.next-cli-build/server/chunks/4049.js +1 -1
  580. package/app/.next-cli-build/server/chunks/412.js +1 -1
  581. package/app/.next-cli-build/server/chunks/436.js +1 -1
  582. package/app/.next-cli-build/server/chunks/4663.js +1 -1
  583. package/app/.next-cli-build/server/chunks/5245.js +1 -1
  584. package/app/.next-cli-build/server/chunks/5299.js +2 -2
  585. package/app/.next-cli-build/server/chunks/615.js +1 -1
  586. package/app/.next-cli-build/server/chunks/827.js +1 -1
  587. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  588. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  589. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  590. package/app/.next-cli-build/server/middleware.js +4 -4
  591. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  592. package/app/.next-cli-build/server/pages/404.html +1 -1
  593. package/app/.next-cli-build/server/pages/500.html +1 -1
  594. package/app/.next-cli-build/static/chunks/5497-3c3d55a9b2b370b0.js +7 -0
  595. package/app/.next-cli-build/static/chunks/{85-c9d2b6e00b6ee6eb.js → 85-83d08704177e2de9.js} +1 -1
  596. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-5830aae99fea0caa.js +27 -0
  597. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-3276d4952049b42b.js +1 -0
  598. package/app/.next-cli-build/static/chunks/app/_global-error/page-87381f52e86f81d4.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-87381f52e86f81d4.js +1 -0
  600. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-87381f52e86f81d4.js +1 -0
  601. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-87381f52e86f81d4.js +1 -0
  602. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-87381f52e86f81d4.js +1 -0
  603. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-87381f52e86f81d4.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-87381f52e86f81d4.js +1 -0
  605. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-87381f52e86f81d4.js +1 -0
  606. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-87381f52e86f81d4.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-87381f52e86f81d4.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-87381f52e86f81d4.js +1 -0
  609. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-87381f52e86f81d4.js +1 -0
  610. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-87381f52e86f81d4.js +1 -0
  611. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-87381f52e86f81d4.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-87381f52e86f81d4.js +1 -0
  613. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-87381f52e86f81d4.js +1 -0
  614. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-87381f52e86f81d4.js +1 -0
  615. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-87381f52e86f81d4.js +1 -0
  616. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-87381f52e86f81d4.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-87381f52e86f81d4.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-87381f52e86f81d4.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-87381f52e86f81d4.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-87381f52e86f81d4.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-87381f52e86f81d4.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-87381f52e86f81d4.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-87381f52e86f81d4.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-87381f52e86f81d4.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-87381f52e86f81d4.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-87381f52e86f81d4.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-87381f52e86f81d4.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-87381f52e86f81d4.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-87381f52e86f81d4.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-87381f52e86f81d4.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-87381f52e86f81d4.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-87381f52e86f81d4.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-87381f52e86f81d4.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-87381f52e86f81d4.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-87381f52e86f81d4.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-87381f52e86f81d4.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-87381f52e86f81d4.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-87381f52e86f81d4.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/combos/route-87381f52e86f81d4.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-87381f52e86f81d4.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-87381f52e86f81d4.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-87381f52e86f81d4.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-87381f52e86f81d4.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-87381f52e86f81d4.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-87381f52e86f81d4.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/health/route-87381f52e86f81d4.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/init/route-87381f52e86f81d4.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-87381f52e86f81d4.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/keys/route-87381f52e86f81d4.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/locale/route-87381f52e86f81d4.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-87381f52e86f81d4.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-87381f52e86f81d4.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-87381f52e86f81d4.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-87381f52e86f81d4.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-87381f52e86f81d4.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-87381f52e86f81d4.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-87381f52e86f81d4.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-87381f52e86f81d4.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-87381f52e86f81d4.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-87381f52e86f81d4.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/models/chat/route-87381f52e86f81d4.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-87381f52e86f81d4.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-87381f52e86f81d4.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/models/route-87381f52e86f81d4.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/models/test/route-87381f52e86f81d4.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/models/test-batch/route-87381f52e86f81d4.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-87381f52e86f81d4.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-87381f52e86f81d4.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-87381f52e86f81d4.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-87381f52e86f81d4.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-87381f52e86f81d4.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-87381f52e86f81d4.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-87381f52e86f81d4.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-87381f52e86f81d4.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-87381f52e86f81d4.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-87381f52e86f81d4.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-87381f52e86f81d4.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-87381f52e86f81d4.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-87381f52e86f81d4.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-87381f52e86f81d4.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-87381f52e86f81d4.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-87381f52e86f81d4.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-87381f52e86f81d4.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-87381f52e86f81d4.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-87381f52e86f81d4.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-87381f52e86f81d4.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/pricing/route-87381f52e86f81d4.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-87381f52e86f81d4.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-87381f52e86f81d4.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-87381f52e86f81d4.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-87381f52e86f81d4.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-87381f52e86f81d4.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-87381f52e86f81d4.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-87381f52e86f81d4.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-87381f52e86f81d4.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-87381f52e86f81d4.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-87381f52e86f81d4.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/providers/route-87381f52e86f81d4.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-87381f52e86f81d4.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-87381f52e86f81d4.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-87381f52e86f81d4.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/providers/web-session/[id]/route-87381f52e86f81d4.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-87381f52e86f81d4.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-87381f52e86f81d4.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-87381f52e86f81d4.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-87381f52e86f81d4.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-87381f52e86f81d4.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-87381f52e86f81d4.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-87381f52e86f81d4.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-87381f52e86f81d4.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-87381f52e86f81d4.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-87381f52e86f81d4.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-87381f52e86f81d4.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-87381f52e86f81d4.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-87381f52e86f81d4.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-87381f52e86f81d4.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-87381f52e86f81d4.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-87381f52e86f81d4.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-87381f52e86f81d4.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-87381f52e86f81d4.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/settings/route-87381f52e86f81d4.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-87381f52e86f81d4.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/tags/route-87381f52e86f81d4.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-87381f52e86f81d4.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-87381f52e86f81d4.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-87381f52e86f81d4.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-87381f52e86f81d4.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-87381f52e86f81d4.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-87381f52e86f81d4.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-87381f52e86f81d4.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-87381f52e86f81d4.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-87381f52e86f81d4.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-87381f52e86f81d4.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-87381f52e86f81d4.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-87381f52e86f81d4.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-87381f52e86f81d4.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-87381f52e86f81d4.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-87381f52e86f81d4.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-87381f52e86f81d4.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-87381f52e86f81d4.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-87381f52e86f81d4.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-87381f52e86f81d4.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-87381f52e86f81d4.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-87381f52e86f81d4.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-87381f52e86f81d4.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-87381f52e86f81d4.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-87381f52e86f81d4.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-87381f52e86f81d4.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-87381f52e86f81d4.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-87381f52e86f81d4.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-87381f52e86f81d4.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-87381f52e86f81d4.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-87381f52e86f81d4.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-87381f52e86f81d4.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-87381f52e86f81d4.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-87381f52e86f81d4.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-87381f52e86f81d4.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-87381f52e86f81d4.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-87381f52e86f81d4.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-87381f52e86f81d4.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-87381f52e86f81d4.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/v1/route-87381f52e86f81d4.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-87381f52e86f81d4.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-87381f52e86f81d4.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-87381f52e86f81d4.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-87381f52e86f81d4.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-87381f52e86f81d4.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-87381f52e86f81d4.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-87381f52e86f81d4.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-87381f52e86f81d4.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-87381f52e86f81d4.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/version/route-87381f52e86f81d4.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-87381f52e86f81d4.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/version/update/route-87381f52e86f81d4.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-87381f52e86f81d4.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/page-87381f52e86f81d4.js +1 -0
  777. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-87381f52e86f81d4.js +1 -0
  778. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-87381f52e86f81d4.js +1 -0
  779. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-87381f52e86f81d4.js +1 -0
  780. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-87381f52e86f81d4.js +1 -0
  781. package/app/.next-cli-build/static/chunks/webpack-65f2475d325cf79e.js +1 -0
  782. package/app/.next-cli-build/static/css/a1ec8457dda7a088.css +1 -0
  783. package/app/.next-cli-build/static/rtpcR0260Q2ARX74R3KSA/_buildManifest.js +1 -0
  784. package/app/cli/.build-home/.omnihilbras/db/data.sqlite +0 -0
  785. package/app/package.json +1 -1
  786. package/package.json +1 -1
  787. package/app/.next-cli-build/server/chunks/1736.js +0 -1
  788. package/app/.next-cli-build/static/chunks/5497-6d1087fc9dfbde4e.js +0 -7
  789. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a6704c37e390b7f0.js +0 -27
  790. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-b58ca85f38601cd6.js +0 -1
  791. package/app/.next-cli-build/static/chunks/app/_global-error/page-b27bf15795fc546f.js +0 -1
  792. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-b27bf15795fc546f.js +0 -1
  793. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-b27bf15795fc546f.js +0 -1
  794. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-b27bf15795fc546f.js +0 -1
  795. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-b27bf15795fc546f.js +0 -1
  796. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-b27bf15795fc546f.js +0 -1
  797. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-b27bf15795fc546f.js +0 -1
  798. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-b27bf15795fc546f.js +0 -1
  799. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-b27bf15795fc546f.js +0 -1
  800. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-b27bf15795fc546f.js +0 -1
  801. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-b27bf15795fc546f.js +0 -1
  802. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-b27bf15795fc546f.js +0 -1
  803. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-b27bf15795fc546f.js +0 -1
  804. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-b27bf15795fc546f.js +0 -1
  805. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-b27bf15795fc546f.js +0 -1
  806. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-b27bf15795fc546f.js +0 -1
  807. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-b27bf15795fc546f.js +0 -1
  808. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-b27bf15795fc546f.js +0 -1
  809. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-b27bf15795fc546f.js +0 -1
  810. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-b27bf15795fc546f.js +0 -1
  811. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-b27bf15795fc546f.js +0 -1
  812. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-b27bf15795fc546f.js +0 -1
  813. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-b27bf15795fc546f.js +0 -1
  814. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-b27bf15795fc546f.js +0 -1
  815. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-b27bf15795fc546f.js +0 -1
  816. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-b27bf15795fc546f.js +0 -1
  817. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-b27bf15795fc546f.js +0 -1
  818. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-b27bf15795fc546f.js +0 -1
  819. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-b27bf15795fc546f.js +0 -1
  820. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-b27bf15795fc546f.js +0 -1
  821. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-b27bf15795fc546f.js +0 -1
  822. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-b27bf15795fc546f.js +0 -1
  823. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-b27bf15795fc546f.js +0 -1
  824. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-b27bf15795fc546f.js +0 -1
  825. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-b27bf15795fc546f.js +0 -1
  826. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-b27bf15795fc546f.js +0 -1
  827. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-b27bf15795fc546f.js +0 -1
  828. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-b27bf15795fc546f.js +0 -1
  829. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-b27bf15795fc546f.js +0 -1
  830. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-b27bf15795fc546f.js +0 -1
  831. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-b27bf15795fc546f.js +0 -1
  832. package/app/.next-cli-build/static/chunks/app/api/combos/route-b27bf15795fc546f.js +0 -1
  833. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-b27bf15795fc546f.js +0 -1
  834. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-b27bf15795fc546f.js +0 -1
  835. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-b27bf15795fc546f.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-b27bf15795fc546f.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-b27bf15795fc546f.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-b27bf15795fc546f.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/api/health/route-b27bf15795fc546f.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/api/init/route-b27bf15795fc546f.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-b27bf15795fc546f.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/keys/route-b27bf15795fc546f.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/locale/route-b27bf15795fc546f.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-b27bf15795fc546f.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-b27bf15795fc546f.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-b27bf15795fc546f.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-b27bf15795fc546f.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-b27bf15795fc546f.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-b27bf15795fc546f.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-b27bf15795fc546f.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-b27bf15795fc546f.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-b27bf15795fc546f.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-b27bf15795fc546f.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-b27bf15795fc546f.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-b27bf15795fc546f.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/models/route-b27bf15795fc546f.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/models/test/route-b27bf15795fc546f.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-b27bf15795fc546f.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-b27bf15795fc546f.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-b27bf15795fc546f.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-b27bf15795fc546f.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-b27bf15795fc546f.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-b27bf15795fc546f.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-b27bf15795fc546f.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-b27bf15795fc546f.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-b27bf15795fc546f.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-b27bf15795fc546f.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-b27bf15795fc546f.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-b27bf15795fc546f.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-b27bf15795fc546f.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-b27bf15795fc546f.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-b27bf15795fc546f.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-b27bf15795fc546f.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-b27bf15795fc546f.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-b27bf15795fc546f.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-b27bf15795fc546f.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-b27bf15795fc546f.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/pricing/route-b27bf15795fc546f.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-b27bf15795fc546f.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-b27bf15795fc546f.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-b27bf15795fc546f.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-b27bf15795fc546f.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-b27bf15795fc546f.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-b27bf15795fc546f.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-b27bf15795fc546f.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-b27bf15795fc546f.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-b27bf15795fc546f.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-b27bf15795fc546f.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/providers/route-b27bf15795fc546f.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-b27bf15795fc546f.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-b27bf15795fc546f.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-b27bf15795fc546f.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/providers/web-session/[id]/route-b27bf15795fc546f.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-b27bf15795fc546f.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-b27bf15795fc546f.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-b27bf15795fc546f.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-b27bf15795fc546f.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-b27bf15795fc546f.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-b27bf15795fc546f.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-b27bf15795fc546f.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-b27bf15795fc546f.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-b27bf15795fc546f.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-b27bf15795fc546f.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-b27bf15795fc546f.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-b27bf15795fc546f.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-b27bf15795fc546f.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-b27bf15795fc546f.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-b27bf15795fc546f.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-b27bf15795fc546f.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-b27bf15795fc546f.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-b27bf15795fc546f.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/settings/route-b27bf15795fc546f.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-b27bf15795fc546f.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/tags/route-b27bf15795fc546f.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-b27bf15795fc546f.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-b27bf15795fc546f.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-b27bf15795fc546f.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-b27bf15795fc546f.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-b27bf15795fc546f.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-b27bf15795fc546f.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-b27bf15795fc546f.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-b27bf15795fc546f.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-b27bf15795fc546f.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-b27bf15795fc546f.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-b27bf15795fc546f.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-b27bf15795fc546f.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-b27bf15795fc546f.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-b27bf15795fc546f.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-b27bf15795fc546f.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-b27bf15795fc546f.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-b27bf15795fc546f.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-b27bf15795fc546f.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-b27bf15795fc546f.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-b27bf15795fc546f.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-b27bf15795fc546f.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-b27bf15795fc546f.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-b27bf15795fc546f.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-b27bf15795fc546f.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-b27bf15795fc546f.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-b27bf15795fc546f.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-b27bf15795fc546f.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-b27bf15795fc546f.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-b27bf15795fc546f.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-b27bf15795fc546f.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-b27bf15795fc546f.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-b27bf15795fc546f.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-b27bf15795fc546f.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-b27bf15795fc546f.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-b27bf15795fc546f.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-b27bf15795fc546f.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-b27bf15795fc546f.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-b27bf15795fc546f.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/v1/route-b27bf15795fc546f.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-b27bf15795fc546f.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-b27bf15795fc546f.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-b27bf15795fc546f.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-b27bf15795fc546f.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-b27bf15795fc546f.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-b27bf15795fc546f.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-b27bf15795fc546f.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-b27bf15795fc546f.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-b27bf15795fc546f.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/version/route-b27bf15795fc546f.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-b27bf15795fc546f.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/version/update/route-b27bf15795fc546f.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-b27bf15795fc546f.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/page-b27bf15795fc546f.js +0 -1
  968. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-b27bf15795fc546f.js +0 -1
  969. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-b27bf15795fc546f.js +0 -1
  970. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-b27bf15795fc546f.js +0 -1
  971. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-b27bf15795fc546f.js +0 -1
  972. package/app/.next-cli-build/static/chunks/webpack-908043815b1b426f.js +0 -1
  973. package/app/.next-cli-build/static/css/39ba83361793476b.css +0 -1
  974. package/app/.next-cli-build/static/dbkOt5w7oPLAPpclnaoiZ/_buildManifest.js +0 -1
  975. /package/app/.next-cli-build/static/{dbkOt5w7oPLAPpclnaoiZ → rtpcR0260Q2ARX74R3KSA}/_ssgManifest.js +0 -0
@@ -1,17 +1,17 @@
1
- (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14812:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>ae});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(19099),i=c(2116),j=c.n(i),k=c(81220),l=c(29225),m=c(50412),n=c(92592),o=c(91431),p=c(70552),q=c(18982);c(87592);var r=c(60757);let s=["none","low","medium","high"],t=["none","thinking"],u=["none","low","medium","high","xhigh","max"],v={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":u,"claude-budget":u,"gemini-level":["minimal","low","medium","high"],"gemini-budget":s,zai:t,qwen:s,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:t,hunyuan:s,step:s,nous:s},w=["none","minimal","low","medium","high","xhigh","max"],x=["none","low","medium","high","max"],y=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:x},{pattern:"*claude*4-6*",levels:x},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}];function z(a,b){if("kiro"===a&&null===function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}(b))return null;let c=(0,p.nl)(a,b);if(!c.reasoning)return null;let d=String(b||"").replace(/\([^()]+\)\s*$/,""),e="codex"===a?(0,r.SM)("cx").find(a=>a.id===d)?.thinkingLevels:null,f=y.find(c=>(!c.provider||c.provider===a)&&(0,q.gH)(c.pattern,b)),g=e||f?.levels||v[c.thinkingFormat]||s;return!1===c.thinkingCanDisable&&(g=g.filter(a=>"none"!==a)),g}var A=c(50377),B=c(29476),C=c(99258);let D=new Map;async function E(a,b,{force:c=!1}={}){if(!a?.url||!a?.type)return{data:[]};let d=`${a.url}::${b||""}`;if(!c){let a=D.get(d);if(a&&Date.now()<a.expiresAt)return a.payload}try{let c=new URLSearchParams({url:a.url,type:a.type});b&&c.set("provider",b);let e=await fetch(`/api/providers/suggested-models?${c}`),f=await e.json().catch(()=>({})),g={data:Array.isArray(f.data)?f.data:[],...f.error?{error:f.error}:{},...f.upstream?{upstream:f.upstream}:{},...e.ok?{}:{error:f.error||`Request failed (HTTP ${e.status})`}};return g.data.length>0&&!g.error&&D.set(d,{payload:g,expiresAt:Date.now()+6e5}),g}catch(a){return{data:[],error:a?.message||"Network error"}}}function F({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a,origin:b.origin}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}function G({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:k,isTesting:l,onDisable:n,caps:o,thinkingSuffix:p}){let q=p?`${b}(${p})`:b,r=`model-${a.id}`;return(0,d.jsxs)("div",{className:"flex w-full min-w-0 max-w-full flex-col gap-3 rounded-xl border border-line bg-bg-soft/45 p-3.5 transition-colors hover:border-line-strong sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("span",{className:`grid h-8 w-8 shrink-0 place-items-center rounded-lg border ${"ok"===g?"border-success/25 bg-success/10 text-success":"error"===g?"border-danger/25 bg-danger/10 text-danger":"border-line bg-surface text-muted"}`,children:(0,d.jsx)("span",{className:`material-symbols-outlined text-[16px] ${l?"animate-spin text-gold-text":""}`,"aria-hidden":"true",children:l?"progress_activity":"ok"===g?"check_circle":"error"===g?"cancel":"memory"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-xs font-semibold",title:q,children:q}),a.name&&a.name!==a.id&&(0,d.jsx)("p",{className:"truncate text-[10px] text-muted",children:a.name}),c&&(0,d.jsxs)("span",{className:"shrink-0 rounded border border-line bg-surface px-1.5 py-0.5 font-mono text-[9px] text-muted",children:["alias: ",c]}),h&&(0,d.jsx)("span",{className:"shrink-0 rounded border border-gold/30 bg-gold-soft px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide text-gold-text",children:"custom"}),i&&(0,d.jsx)("span",{className:"shrink-0 rounded border border-success/25 bg-success/10 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide text-success",children:"free"}),(0,d.jsx)(m.nh,{caps:o,colorOverride:"text-muted",size:12})]}),(0,d.jsx)("code",{className:"mt-1 block truncate font-mono text-[10px] text-muted",children:q})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:()=>f(q,r),"aria-label":`Copy ${a.id} model ID`,className:"grid h-8 w-8 place-items-center rounded-lg text-muted transition-colors hover:bg-surface hover:text-gold-text",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:e===r?"check":"content_copy"})}),k&&(0,d.jsxs)("button",{type:"button",onClick:k,disabled:l,"aria-label":`Test ${a.id}`,"aria-busy":l,className:"btn-quiet !px-2 !py-2 !text-[11px]",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[14px] ${l?"animate-spin":""}`,"aria-hidden":"true",children:l?"progress_activity":"bolt"}),l?"Testing":"Test"]}),h?(0,d.jsx)("button",{type:"button",onClick:j,className:"grid h-8 w-8 place-items-center rounded-lg text-muted transition-colors hover:bg-danger/10 hover:text-danger",title:"Remove custom model","aria-label":`Remove ${a.id}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})}):n?(0,d.jsx)("button",{type:"button",onClick:n,className:"grid h-8 w-8 place-items-center rounded-lg text-muted transition-colors hover:bg-danger/10 hover:text-danger sm:opacity-0 sm:group-hover/model-list:opacity-100",title:"Disable this model","aria-label":`Disable ${a.id}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})}):null]})]})}function H({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function I({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:k,connections:l,isAnthropic:n}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)({}),y=async b=>{if(!u){v(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();x(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{x(a=>({...a,[b]:"error"}))}finally{v(null)}}},z=F({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),A=async()=>{if(!o.trim()||q)return;let a=o.trim();if(z.some(b=>b.id===a))return void alert("Model already exists for this provider.");r(!0);try{await j(a),p("")}catch(a){console.log("Error adding model:",a)}finally{r(!1)}},B=async()=>{if(s)return;let a=l.find(a=>!1!==a.isActive);if(a){t(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(z.some(a=>a.id===b)||(await j(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{t(!1)}}},C=l.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>"Enter"===a.key&&A(),placeholder:n?"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,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:A,disabled:!o.trim()||q,children:q?"Adding...":"Add"}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"download",onClick:B,disabled:!C||s,children:s?"Importing...":"Import from /models"})]}),!C&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),z.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:z.map(({id:c,alias:e,source:f})=>(0,d.jsx)(H,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?k(c):i(e),onTest:l.length>0?()=>y(c):void 0,testStatus:w[c],isTesting:u===c},`${f}-${a}/${c}`))})]})}G.propTypes={model:g().shape({id:g().string.isRequired,name:g().string}).isRequired,fullModel:g().string.isRequired,alias:g().string,copied:g().string,onCopy:g().func.isRequired,testStatus:g().oneOf(["ok","error"]),isCustom:g().bool,isFree:g().bool,onDeleteAlias:g().func,onTest:g().func,isTesting:g().bool,onDisable:g().func,caps:g().object,thinkingSuffix:g().string},g().string.isRequired,g().string.isRequired,g().string,g().func.isRequired,g().func.isRequired,g().func,g().oneOf(["ok","error"]),g().bool,g().string.isRequired,g().object.isRequired,g().arrayOf(g().object),g().string,g().func.isRequired,g().func.isRequired,g().func.isRequired,g().func.isRequired,I.propTypes={providerStorageAlias:g().string.isRequired,providerDisplayAlias:g().string.isRequired,modelAliases:g().object.isRequired,customModels:g().arrayOf(g().object),copied:g().string,onCopy:g().func.isRequired,onDeleteAlias:g().func.isRequired,onAddCustomModel:g().func.isRequired,onDeleteCustomModel:g().func.isRequired,connections:g().arrayOf(g().shape({id:g().string,isActive:g().bool})).isRequired,isAnthropic:g().bool};var J=c(74429),K=c(74875);function L({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function M({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:j,onUpdateProxy:k,onEdit:l,onDelete:n,oneByOneStatus:o=null,autoPing:p=null}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useRef)(null),[w,x]=(0,e.useState)(null),y=new Map((b||[]).map(a=>[a.id,a])),z=a.providerSpecificData?.proxyPoolId||null,A=z?y.get(z):null,B=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,C=!!z||B,D=A?`Pool: ${A.name}`:z?`Pool: ${z} (inactive/missing)`:B?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",E=(()=>{if(!p)return"";let a=[];return(p.reactiveOn&&a.push("On reset"),p.scheduleOn&&a.push(`Scheduled (${p.scheduleSummary||"active"})`),a.length>0)?`Auto-ping active: ${a.join(" + ")}. Click to configure.`:"codex"===p.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),F="";if(A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);F=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{F=b}}let G=A?.noProxy||a.providerSpecificData?.connectionNoProxy||"",H="default";A?.isActive===!0?H="success":(z||B)&&(H="error");let I=async a=>{t(!0);try{await k("__none__"===a?null:a)}finally{t(!1),r(!1)}},N=a.authType||(c?"oauth":"apikey"),O="oauth"===N,P="cookie"===N,Q=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(O?"OAuth Account":P?"Cookie Account":"API Key"),R=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,[S,T]=(0,e.useState)(!1),U=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>a).filter(a=>!!a).sort()[0]||null,V="unavailable"!==a.testStatus||S?a.testStatus:"active",W=()=>o?"queued"===o.state?"queued":"testing"===o.state?"testing":"success"===o.state?"success":"failed"===o.state?o.error?`failed: ${o.error}`:"failed":null:null;return(0,d.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===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:P?"cookie":O?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:Q}),R&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:R}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(m.Ex,{variant:(0,K.g)(a.isActive,V),size:"sm",dot:!0,children:!1===a.isActive?"disabled":V||"Unknown"}),(0,d.jsx)(m.Ex,{variant:"default",size:"sm",children:O?"OAuth":P?"Cookie":"API Key"}),C&&(0,d.jsx)(m.Ex,{variant:H,size:"sm",children:"Proxy"}),S&&!1!==a.isActive&&(0,d.jsx)(L,{until:U}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),W()&&(0,d.jsx)(m.Ex,{variant:o?"success"===o.state?"success":"failed"===o.state?"error":"testing"===o.state?"primary":"default":"default",size:"sm",children:W()})]}),C&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),F&&(0,d.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:F}),G&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:G,children:["no_proxy: ",G]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(b||[]).length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{ref:v,onClick:()=>{if(q)return void r(!1);let a=v.current?.getBoundingClientRect();if(!a)return void r(!0);let c=((b?.length||0)+1)*34+8,d=window.innerHeight-a.bottom,e=d<c&&a.top>d;x({position:"fixed",right:window.innerWidth-a.right,...e?{bottom:window.innerHeight-a.top+4,maxHeight:Math.max(a.top-8,120)}:{top:a.bottom+4,maxHeight:Math.max(d-8,120)}}),r(!0)},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:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),q&&(0,J.createPortal)((0,d.jsxs)("div",{ref:u,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!z?"text-primary font-medium":"text-text-main"}`,children:"None"}),(b||[]).map(a=>(0,d.jsx)("button",{onClick:()=>I(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${z===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]}),document.body)]}),p&&(0,d.jsx)(m.m_,{text:E,children:(0,d.jsxs)("button",{onClick:p.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,d.jsxs)("button",{onClick:l,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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(m.lM,{size:"sm",checked:a.isActive??!0,onChange:j,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}L.propTypes={until:g().string.isRequired},M.propTypes={connection:g().shape({id:g().string,name:g().string,email:g().string,displayName:g().string,modelLockUntil:g().string,testStatus:g().string,isActive:g().bool,lastError:g().string,priority:g().number,globalPriority:g().number}).isRequired,proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string,proxyUrl:g().string,noProxy:g().string,isActive:g().bool})),isOAuth:g().bool.isRequired,isFirst:g().bool.isRequired,isLast:g().bool.isRequired,onMoveUp:g().func.isRequired,onMoveDown:g().func.isRequired,onToggleActive:g().func.isRequired,onUpdateProxy:g().func,onEdit:g().func.isRequired,onDelete:g().func.isRequired,oneByOneStatus:g().shape({state:g().string,error:g().string}),autoPing:g().shape({isActive:g().bool,provider:g().string,reactiveOn:g().bool,scheduleOn:g().bool,scheduleSummary:g().string,onConfigure:g().func})};let N=`name1|sk-key1
1
+ (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14812:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>ae});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(19099),i=c(2116),j=c.n(i),k=c(81220),l=c(29225),m=c(50412),n=c(92592),o=c(91431),p=c(70552),q=c(18982);c(87592);var r=c(60757);let s=["none","low","medium","high"],t=["none","thinking"],u=["none","low","medium","high","xhigh","max"],v={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":u,"claude-budget":u,"gemini-level":["minimal","low","medium","high"],"gemini-budget":s,zai:t,qwen:s,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:t,hunyuan:s,step:s,nous:s},w=["none","minimal","low","medium","high","xhigh","max"],x=["none","low","medium","high","max"],y=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:x},{pattern:"*claude*4-6*",levels:x},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}];function z(a,b){if("kiro"===a&&null===function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}(b))return null;let c=(0,p.nl)(a,b);if(!c.reasoning)return null;let d=String(b||"").replace(/\([^()]+\)\s*$/,""),e="codex"===a?(0,r.SM)("cx").find(a=>a.id===d)?.thinkingLevels:null,f=y.find(c=>(!c.provider||c.provider===a)&&(0,q.gH)(c.pattern,b)),g=e||f?.levels||v[c.thinkingFormat]||s;return!1===c.thinkingCanDisable&&(g=g.filter(a=>"none"!==a)),g}var A=c(41371),B=c(50377),C=c(29476),D=c(99258);let E=new Map;async function F(a,b,{force:c=!1}={}){if(!a?.url||!a?.type)return{data:[]};let d=`${a.url}::${b||""}`;if(!c){let a=E.get(d);if(a&&Date.now()<a.expiresAt)return a.payload}try{let c=new URLSearchParams({url:a.url,type:a.type});b&&c.set("provider",b);let e=await fetch(`/api/providers/suggested-models?${c}`),f=await e.json().catch(()=>({})),g={data:Array.isArray(f.data)?f.data:[],...f.error?{error:f.error}:{},...f.upstream?{upstream:f.upstream}:{},...e.ok?{}:{error:f.error||`Request failed (HTTP ${e.status})`}};return g.data.length>0&&!g.error&&E.set(d,{payload:g,expiresAt:Date.now()+6e5}),g}catch(a){return{data:[],error:a?.message||"Network error"}}}function G({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a,origin:b.origin}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}function H({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:k,isTesting:l,onDisable:n,caps:o,thinkingSuffix:p}){let q=p?`${b}(${p})`:b,r=`model-${a.id}`;return(0,d.jsxs)("div",{className:"flex w-full min-w-0 max-w-full flex-col gap-3 rounded-xl border border-line bg-bg-soft/45 p-3.5 transition-colors hover:border-line-strong sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("span",{className:`grid h-8 w-8 shrink-0 place-items-center rounded-lg border ${"ok"===g?"border-success/25 bg-success/10 text-success":"error"===g?"border-danger/25 bg-danger/10 text-danger":"border-line bg-surface text-muted"}`,children:(0,d.jsx)("span",{className:`material-symbols-outlined text-[16px] ${l?"animate-spin text-gold-text":""}`,"aria-hidden":"true",children:l?"progress_activity":"ok"===g?"check_circle":"error"===g?"cancel":"memory"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("p",{className:"truncate text-xs font-semibold",title:q,children:q}),a.name&&a.name!==a.id&&(0,d.jsx)("p",{className:"truncate text-[10px] text-muted",children:a.name}),c&&(0,d.jsxs)("span",{className:"shrink-0 rounded border border-line bg-surface px-1.5 py-0.5 font-mono text-[9px] text-muted",children:["alias: ",c]}),h&&(0,d.jsx)("span",{className:"shrink-0 rounded border border-gold/30 bg-gold-soft px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide text-gold-text",children:"custom"}),i&&(0,d.jsx)("span",{className:"shrink-0 rounded border border-success/25 bg-success/10 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide text-success",children:"free"}),(0,d.jsx)(m.nh,{caps:o,colorOverride:"text-muted",size:12})]}),(0,d.jsx)("code",{className:"mt-1 block truncate font-mono text-[10px] text-muted",children:q})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:()=>f(q,r),"aria-label":`Copy ${a.id} model ID`,className:"grid h-8 w-8 place-items-center rounded-lg text-muted transition-colors hover:bg-surface hover:text-gold-text",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:e===r?"check":"content_copy"})}),k&&(0,d.jsxs)("button",{type:"button",onClick:k,disabled:l,"aria-label":`Test ${a.id}`,"aria-busy":l,className:"btn-quiet !px-2 !py-2 !text-[11px]",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[14px] ${l?"animate-spin":""}`,"aria-hidden":"true",children:l?"progress_activity":"bolt"}),l?"Testing":"Test"]}),h?(0,d.jsx)("button",{type:"button",onClick:j,className:"grid h-8 w-8 place-items-center rounded-lg text-muted transition-colors hover:bg-danger/10 hover:text-danger",title:"Remove custom model","aria-label":`Remove ${a.id}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})}):n?(0,d.jsx)("button",{type:"button",onClick:n,className:"grid h-8 w-8 place-items-center rounded-lg text-muted transition-colors hover:bg-danger/10 hover:text-danger sm:opacity-0 sm:group-hover/model-list:opacity-100",title:"Disable this model","aria-label":`Disable ${a.id}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})}):null]})]})}function I({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function J({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:k,connections:l,isAnthropic:n}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)({}),y=async b=>{if(!u){v(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();x(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{x(a=>({...a,[b]:"error"}))}finally{v(null)}}},z=G({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),A=async()=>{if(!o.trim()||q)return;let a=o.trim();if(z.some(b=>b.id===a))return void alert("Model already exists for this provider.");r(!0);try{await j(a),p("")}catch(a){console.log("Error adding model:",a)}finally{r(!1)}},B=async()=>{if(s)return;let a=l.find(a=>!1!==a.isActive);if(a){t(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(z.some(a=>a.id===b)||(await j(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{t(!1)}}},C=l.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>"Enter"===a.key&&A(),placeholder:n?"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,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:A,disabled:!o.trim()||q,children:q?"Adding...":"Add"}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"download",onClick:B,disabled:!C||s,children:s?"Importing...":"Import from /models"})]}),!C&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),z.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:z.map(({id:c,alias:e,source:f})=>(0,d.jsx)(I,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?k(c):i(e),onTest:l.length>0?()=>y(c):void 0,testStatus:w[c],isTesting:u===c},`${f}-${a}/${c}`))})]})}H.propTypes={model:g().shape({id:g().string.isRequired,name:g().string}).isRequired,fullModel:g().string.isRequired,alias:g().string,copied:g().string,onCopy:g().func.isRequired,testStatus:g().oneOf(["ok","error"]),isCustom:g().bool,isFree:g().bool,onDeleteAlias:g().func,onTest:g().func,isTesting:g().bool,onDisable:g().func,caps:g().object,thinkingSuffix:g().string},g().string.isRequired,g().string.isRequired,g().string,g().func.isRequired,g().func.isRequired,g().func,g().oneOf(["ok","error"]),g().bool,g().string.isRequired,g().object.isRequired,g().arrayOf(g().object),g().string,g().func.isRequired,g().func.isRequired,g().func.isRequired,g().func.isRequired,J.propTypes={providerStorageAlias:g().string.isRequired,providerDisplayAlias:g().string.isRequired,modelAliases:g().object.isRequired,customModels:g().arrayOf(g().object),copied:g().string,onCopy:g().func.isRequired,onDeleteAlias:g().func.isRequired,onAddCustomModel:g().func.isRequired,onDeleteCustomModel:g().func.isRequired,connections:g().arrayOf(g().shape({id:g().string,isActive:g().bool})).isRequired,isAnthropic:g().bool};var K=c(74429),L=c(74875);function M({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function N({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:j,onUpdateProxy:k,onEdit:l,onDelete:n,oneByOneStatus:o=null,autoPing:p=null}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useRef)(null),[w,x]=(0,e.useState)(null),y=new Map((b||[]).map(a=>[a.id,a])),z=a.providerSpecificData?.proxyPoolId||null,A=z?y.get(z):null,B=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,C=!!z||B,D=A?`Pool: ${A.name}`:z?`Pool: ${z} (inactive/missing)`:B?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",E=(()=>{if(!p)return"";let a=[];return(p.reactiveOn&&a.push("On reset"),p.scheduleOn&&a.push(`Scheduled (${p.scheduleSummary||"active"})`),a.length>0)?`Auto-ping active: ${a.join(" + ")}. Click to configure.`:"codex"===p.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),F="";if(A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);F=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{F=b}}let G=A?.noProxy||a.providerSpecificData?.connectionNoProxy||"",H="default";A?.isActive===!0?H="success":(z||B)&&(H="error");let I=async a=>{t(!0);try{await k("__none__"===a?null:a)}finally{t(!1),r(!1)}},J=a.authType||(c?"oauth":"apikey"),O="oauth"===J,P="cookie"===J,Q=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(O?"OAuth Account":P?"Cookie Account":"API Key"),R=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,[S,T]=(0,e.useState)(!1),U=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>a).filter(a=>!!a).sort()[0]||null,V="unavailable"!==a.testStatus||S?a.testStatus:"active",W=()=>o?"queued"===o.state?"queued":"testing"===o.state?"testing":"success"===o.state?"success":"failed"===o.state?o.error?`failed: ${o.error}`:"failed":null:null;return(0,d.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===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:P?"cookie":O?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:Q}),R&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:R}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(m.Ex,{variant:(0,L.g)(a.isActive,V),size:"sm",dot:!0,children:!1===a.isActive?"disabled":V||"Unknown"}),(0,d.jsx)(m.Ex,{variant:"default",size:"sm",children:O?"OAuth":P?"Cookie":"API Key"}),C&&(0,d.jsx)(m.Ex,{variant:H,size:"sm",children:"Proxy"}),S&&!1!==a.isActive&&(0,d.jsx)(M,{until:U}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),W()&&(0,d.jsx)(m.Ex,{variant:o?"success"===o.state?"success":"failed"===o.state?"error":"testing"===o.state?"primary":"default":"default",size:"sm",children:W()})]}),C&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),F&&(0,d.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:F}),G&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:G,children:["no_proxy: ",G]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(b||[]).length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{ref:v,onClick:()=>{if(q)return void r(!1);let a=v.current?.getBoundingClientRect();if(!a)return void r(!0);let c=((b?.length||0)+1)*34+8,d=window.innerHeight-a.bottom,e=d<c&&a.top>d;x({position:"fixed",right:window.innerWidth-a.right,...e?{bottom:window.innerHeight-a.top+4,maxHeight:Math.max(a.top-8,120)}:{top:a.bottom+4,maxHeight:Math.max(d-8,120)}}),r(!0)},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:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),q&&(0,K.createPortal)((0,d.jsxs)("div",{ref:u,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>I("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!z?"text-primary font-medium":"text-text-main"}`,children:"None"}),(b||[]).map(a=>(0,d.jsx)("button",{onClick:()=>I(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${z===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]}),document.body)]}),p&&(0,d.jsx)(m.m_,{text:E,children:(0,d.jsxs)("button",{onClick:p.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,d.jsxs)("button",{onClick:l,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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(m.lM,{size:"sm",checked:a.isActive??!0,onChange:j,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}M.propTypes={until:g().string.isRequired},N.propTypes={connection:g().shape({id:g().string,name:g().string,email:g().string,displayName:g().string,modelLockUntil:g().string,testStatus:g().string,isActive:g().bool,lastError:g().string,priority:g().number,globalPriority:g().number}).isRequired,proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string,proxyUrl:g().string,noProxy:g().string,isActive:g().bool})),isOAuth:g().bool.isRequired,isFirst:g().bool.isRequired,isLast:g().bool.isRequired,onMoveUp:g().func.isRequired,onMoveDown:g().func.isRequired,onToggleActive:g().func.isRequired,onUpdateProxy:g().func,onEdit:g().func.isRequired,onDelete:g().func.isRequired,oneByOneStatus:g().shape({state:g().string,error:g().string}),autoPing:g().shape({isActive:g().bool,provider:g().string,reactiveOn:g().bool,scheduleOn:g().bool,scheduleSummary:g().string,onConfigure:g().func})};let O=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function O({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:j,proxyPools:k,error:l,existingNames:o,onSave:p,onBulkDone:q,onClose:r}){let s="__none__",t="ollama-local"===b,u="cookie"===h,v="xai"===b&&!u,w=u?"Cookie Value":"qoder"===b||"qoder-cn"===b?"Personal Access Token (PAT)":"API Key",x="azure"===b,y="cloudflare-ai"===b,z=n.Q2?.[b]?.credentialForm==="aws",A=n.Q2?.[b]?.apiKeyOptionalWith||null,B=n.Q2?.[b]?.regions||null,C=n.Q2?.[b]?.defaultRegion||B?.[0]?.id||"",[D,E]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:s,ollamaHostUrl:""}),[F,G]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[H,I]=(0,e.useState)({accountId:""}),[J,K]=(0,e.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[L,M]=(0,e.useState)(C),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(null),[T,U]=(0,e.useState)(!1),V=y?`name1|sk-key1|acc123456
3
+ sk-key-only-auto-named`;function P({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:j,proxyPools:k,error:l,existingNames:o,onSave:p,onBulkDone:q,onClose:r}){let s="__none__",t="ollama-local"===b,u="cookie"===h,v="xai"===b&&!u,w=u?"Cookie Value":"qoder"===b||"qoder-cn"===b?"Personal Access Token (PAT)":"API Key",x="azure"===b,y="cloudflare-ai"===b,z=n.Q2?.[b]?.credentialForm==="aws",A=n.Q2?.[b]?.apiKeyOptionalWith||null,B=n.Q2?.[b]?.regions||null,C=n.Q2?.[b]?.defaultRegion||B?.[0]?.id||"",[D,E]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:s,ollamaHostUrl:""}),[F,G]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[H,I]=(0,e.useState)({accountId:""}),[J,K]=(0,e.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[L,M]=(0,e.useState)(C),[N,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(null),[T,U]=(0,e.useState)(!1),V=y?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
5
5
  sk-key-only-auto-named`:"qoder"===b||"qoder-cn"===b?`name1|pt-xxxxx
6
6
  name2|pt-yyyyy
7
- pt-only-auto-named`:N,[W,X]=(0,e.useState)("single"),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)(null),aa=()=>{if(t&&D.ollamaHostUrl.trim())return{baseUrl:D.ollamaHostUrl.trim()};if(x)return{azureEndpoint:F.azureEndpoint,apiVersion:F.apiVersion,deployment:F.deployment,organization:F.organization};if(y)return{accountId:H.accountId};if(z){let a={};return J.profile.trim()&&(a.profile=J.profile.trim()),J.region.trim()&&(a.region=J.region.trim()),J.accessKeyId.trim()&&(a.accessKeyId=J.accessKeyId.trim()),J.sessionToken.trim()&&(a.sessionToken=J.sessionToken.trim()),Object.keys(a).length?a:void 0}if(B&&L)return{region:L}},ab=()=>{let a=aa();return!!(A&&a?.[A])||(z?!!D.apiKey&&!!a?.accessKeyId:!!D.apiKey)},ac=async()=>{Q(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:aa()})}),c=await a.json();S(c.valid?"success":"failed")}catch{S("failed")}finally{Q(!1)}},ad=async()=>{if(b&&(t||ab())&&(t||D.name)&&(!f||D.defaultModel.trim())){U(!0);try{let a=!1;try{Q(!0),S(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:aa()})});a=!!(await c.json()).valid,S(a?"success":"failed")}catch{S("failed")}finally{Q(!1)}await p({name:D.name||(t?"Ollama Local":""),apiKey:D.apiKey,defaultModel:f?D.defaultModel.trim():void 0,priority:D.priority,proxyPoolId:D.proxyPoolId===s?null:D.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:aa()})}finally{U(!1)}}},ae=async()=>{let a=Y.split("\n");if(!a.length)return;let c=function(a,b,c={}){let{isCloudflareAi:d=!1}=c,e=new Set((Array.isArray(b)?b:[]).map(a=>"string"==typeof a?a.toLowerCase():"")),f=[];for(let b of a){let a,c="string"==typeof b?b.trim():"";if(!c)continue;let g=function(a,b={}){let{isCloudflareAi:c=!1}=b,d=a.split("|");if(c&&d.length>=3){let a=d[0].trim();return{baseName:a||"Key",apiKey:d.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:d[d.length-1].trim()}}}return d.length>=2?{baseName:d[0].trim()||"Key",apiKey:d.slice(1).join("|").trim()}:{baseName:"Key",apiKey:d[0].trim()}}(c,{isCloudflareAi:d});if(!g||!g.apiKey)continue;let h=g.baseName,i=1;for(;a=`${h} ${i}`,e.has(a.toLowerCase());)i+=1;e.add(a.toLowerCase());let j={name:a,apiKey:g.apiKey,skipped:!1};g.providerSpecificData&&(j.providerSpecificData=g.providerSpecificData),f.push(j)}return f}(a,o,{isCloudflareAi:y});if(!c.length)return;U(!0),_(null);let d=0,e=0;for(let a of c)try{let c=!1;try{let d=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey})});c=!!(await d.json().catch(()=>({}))).valid}catch{c=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey,name:a.name,priority:1,testStatus:c?"active":"unknown",...a.providerSpecificData?{providerSpecificData:a.providerSpecificData}:{}})})).ok?d++:e++}catch{e++}U(!1),_({success:d,failed:e}),d>0&&q&&q()};return b?(0,d.jsx)(m.aF,{isOpen:a,title:`Add ${c||b} ${w}`,onClose:r,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!z&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{size:"sm",variant:"single"===W?"primary":"ghost",onClick:()=>{X("single"),_(null)},children:"Single"}),(0,d.jsx)(m.$n,{size:"sm",variant:"bulk"===W?"primary":"ghost",onClick:()=>{X("bulk"),_(null)},children:"Bulk Add"})]}),"bulk"===W&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y?(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===b||"qoder-cn"===b?(0,d.jsxs)(d.Fragment,{children:["One PAT per line. Format: ",(0,d.jsx)("code",{children:"name|pt-..."})," or just ",(0,d.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:V,value:Y,onChange:a=>Z(a.target.value)}),$&&(0,d.jsxs)("div",{className:`text-sm font-medium ${$.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",$.success," added",$.failed>0?`, ✗ ${$.failed} failed`:""]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:ae,fullWidth:!0,disabled:T||!Y.trim(),children:T?"Adding...":"Add All Keys"}),(0,d.jsx)(m.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===W&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.pd,{label:"Name",value:D.name,onChange:a=>E({...D,name:a.target.value}),placeholder:t?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.pd,{label:"Ollama Host URL",value:D.ollamaHostUrl,onChange:a=>E({...D,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(m.$n,{onClick:ac,disabled:P||T,variant:"secondary",children:P?"Checking...":"Check"})})]}),!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.pd,{label:w,type:u?"text":"password",value:D.apiKey,onChange:a=>E({...D,apiKey:a.target.value}),placeholder:u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"qoder"===b||"qoder-cn"===b?"pt-...":"",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(m.$n,{onClick:ac,disabled:!ab()||P||T,variant:"secondary",children:P?"Checking...":"Check"})})]}),v&&(0,d.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."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,j&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",j.replace(/^https?:\/\//,"")]})]})]}),B&&(0,d.jsx)(m.l6,{label:"Region",value:L,onChange:a=>M(a.target.value),options:B.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(m.pd,{label:"Default Model",value:D.defaultModel,onChange:a=>E({...D,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),t&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),R&&(0,d.jsx)(m.Ex,{variant:"success"===R?"success":"error",children:"success"===R?"Valid":"Invalid"}),l&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:l}),f&&(0,d.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."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(m.pd,{label:"Account ID",value:H.accountId,onChange:a=>I({...H,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),z&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(m.pd,{label:"AWS Profile (SSO — recommended)",value:J.profile,onChange:a=>K({...J,profile:a.target.value}),placeholder:"my-sso-profile"}),(0,d.jsx)(m.pd,{label:"Region",value:J.region,onChange:a=>K({...J,region:a.target.value}),placeholder:"us-east-1"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,d.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,d.jsxs)("code",{children:["aws sso login --profile ",J.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,d.jsx)(m.pd,{label:"Access Key ID (only for static keys)",value:J.accessKeyId,onChange:a=>K({...J,accessKeyId:a.target.value}),placeholder:"AKIA..."}),(0,d.jsx)(m.pd,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:J.sessionToken,onChange:a=>K({...J,sessionToken:a.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,d.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(m.pd,{label:"Azure Endpoint",value:F.azureEndpoint,onChange:a=>G({...F,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(m.pd,{label:"Deployment Name",value:F.deployment,onChange:a=>G({...F,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(m.pd,{label:"API Version",value:F.apiVersion,onChange:a=>G({...F,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(m.pd,{label:"Organization",value:F.organization,onChange:a=>G({...F,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(m.pd,{label:"Priority",type:"number",value:D.priority,onChange:a=>E({...D,priority:Number.parseInt(a.target.value)||1})}),(0,d.jsx)(m.l6,{label:"Proxy Pool",value:D.proxyPoolId,onChange:a=>E({...D,proxyPoolId:a.target.value}),options:[{value:s,label:"None"},...(k||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(k||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:ad,fullWidth:!0,disabled:T||!t&&(!D.name||!ab())||f&&!D.defaultModel.trim()||x&&(!F.azureEndpoint||!F.deployment||!F.organization)||y&&!H.accountId,children:T?"Saving...":"Save"}),(0,d.jsx)(m.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function P({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,k]=(0,e.useState)(!1),[l,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){k(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{k(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:l,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(m.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(m.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(m.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(m.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(m.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.pd,{label:"API Key (for Check)",type:"password",value:l,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(m.$n,{onClick:v,disabled:!l||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(m.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(m.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"}),(0,d.jsx)(m.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}O.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerName:g().string,isCompatible:g().bool,isAnthropic:g().bool,authType:g().string,authHint:g().string,website:g().string,proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string})),error:g().string,existingNames:g().arrayOf(g().string),onSave:g().func.isRequired,onBulkDone:g().func,onClose:g().func.isRequired},P.propTypes={isOpen:g().bool.isRequired,node:g().shape({id:g().string,name:g().string,prefix:g().string,apiType:g().string,baseUrl:g().string}),onSave:g().func.isRequired,onClose:g().func.isRequired,isAnthropic:g().bool};let Q=()=>Object.fromEntries(Object.keys(o.bs).map(a=>[a,!1]));function R({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(Q),[l,n]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),v=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},w=async()=>{let a=v(h.trim());if(a){n("testing"),q("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();n(d.ok?"ok":"error"),q(d.error||"")}catch(a){n("error"),q(a.message)}}},x=async()=>{let a=v(h.trim());if(a&&!r){s(!0);try{await f(a,j,j.stt?t:null)}finally{s(!1)}}};return(0,d.jsx)(m.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),n(null),q("")},onKeyDown:a=>{"Enter"===a.key&&w()},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,d.jsx)(m.$n,{variant:"secondary",icon:"science",loading:"testing"===l,onClick:w,disabled:!h.trim()||"testing"===l,children:"testing"===l?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:v(h.trim())||"model-id"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(o.bs).map(([a,b])=>(0,d.jsx)(m.lM,{checked:!!j[a],onChange:b=>k(c=>({...c,[a]:b})),label:b.label,description:b.desc,size:"sm"},a))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(m.lM,{checked:!!j.stt,onChange:a=>{k(b=>({...b,stt:a})),a||u("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),j.stt&&(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)(m.l6,{label:"Transport",value:t,onChange:a=>u(a.target.value),placeholder:"Provider default (REST)",options:o.vp.map(a=>({value:a,label:o.qw[a].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===l&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===l&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:p||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(m.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(m.$n,{onClick:x,fullWidth:!0,size:"sm",disabled:!h.trim()||r,children:r?"Adding...":"Add Model"})]})]})})}R.propTypes={isOpen:g().bool.isRequired,providerAlias:g().string.isRequired,providerDisplayAlias:g().string.isRequired,onSave:g().func.isRequired,onClose:g().func.isRequired};let S=`[
7
+ pt-only-auto-named`:O,[W,X]=(0,e.useState)("single"),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)(null),aa=()=>{if(t&&D.ollamaHostUrl.trim())return{baseUrl:D.ollamaHostUrl.trim()};if(x)return{azureEndpoint:F.azureEndpoint,apiVersion:F.apiVersion,deployment:F.deployment,organization:F.organization};if(y)return{accountId:H.accountId};if(z){let a={};return J.profile.trim()&&(a.profile=J.profile.trim()),J.region.trim()&&(a.region=J.region.trim()),J.accessKeyId.trim()&&(a.accessKeyId=J.accessKeyId.trim()),J.sessionToken.trim()&&(a.sessionToken=J.sessionToken.trim()),Object.keys(a).length?a:void 0}if(B&&L)return{region:L}},ab=()=>{let a=aa();return!!(A&&a?.[A])||(z?!!D.apiKey&&!!a?.accessKeyId:!!D.apiKey)},ac=async()=>{Q(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:aa()})}),c=await a.json();S(c.valid?"success":"failed")}catch{S("failed")}finally{Q(!1)}},ad=async()=>{if(b&&(t||ab())&&(t||D.name)&&(!f||D.defaultModel.trim())){U(!0);try{let a=!1;try{Q(!0),S(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:aa()})});a=!!(await c.json()).valid,S(a?"success":"failed")}catch{S("failed")}finally{Q(!1)}await p({name:D.name||(t?"Ollama Local":""),apiKey:D.apiKey,defaultModel:f?D.defaultModel.trim():void 0,priority:D.priority,proxyPoolId:D.proxyPoolId===s?null:D.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:aa()})}finally{U(!1)}}},ae=async()=>{let a=Y.split("\n");if(!a.length)return;let c=function(a,b,c={}){let{isCloudflareAi:d=!1}=c,e=new Set((Array.isArray(b)?b:[]).map(a=>"string"==typeof a?a.toLowerCase():"")),f=[];for(let b of a){let a,c="string"==typeof b?b.trim():"";if(!c)continue;let g=function(a,b={}){let{isCloudflareAi:c=!1}=b,d=a.split("|");if(c&&d.length>=3){let a=d[0].trim();return{baseName:a||"Key",apiKey:d.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:d[d.length-1].trim()}}}return d.length>=2?{baseName:d[0].trim()||"Key",apiKey:d.slice(1).join("|").trim()}:{baseName:"Key",apiKey:d[0].trim()}}(c,{isCloudflareAi:d});if(!g||!g.apiKey)continue;let h=g.baseName,i=1;for(;a=`${h} ${i}`,e.has(a.toLowerCase());)i+=1;e.add(a.toLowerCase());let j={name:a,apiKey:g.apiKey,skipped:!1};g.providerSpecificData&&(j.providerSpecificData=g.providerSpecificData),f.push(j)}return f}(a,o,{isCloudflareAi:y});if(!c.length)return;U(!0),_(null);let d=0,e=0;for(let a of c)try{let c=!1;try{let d=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey})});c=!!(await d.json().catch(()=>({}))).valid}catch{c=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey,name:a.name,priority:1,testStatus:c?"active":"unknown",...a.providerSpecificData?{providerSpecificData:a.providerSpecificData}:{}})})).ok?d++:e++}catch{e++}U(!1),_({success:d,failed:e}),d>0&&q&&q()};return b?(0,d.jsx)(m.aF,{isOpen:a,title:`Add ${c||b} ${w}`,onClose:r,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!z&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{size:"sm",variant:"single"===W?"primary":"ghost",onClick:()=>{X("single"),_(null)},children:"Single"}),(0,d.jsx)(m.$n,{size:"sm",variant:"bulk"===W?"primary":"ghost",onClick:()=>{X("bulk"),_(null)},children:"Bulk Add"})]}),"bulk"===W&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y?(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===b||"qoder-cn"===b?(0,d.jsxs)(d.Fragment,{children:["One PAT per line. Format: ",(0,d.jsx)("code",{children:"name|pt-..."})," or just ",(0,d.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:V,value:Y,onChange:a=>Z(a.target.value)}),$&&(0,d.jsxs)("div",{className:`text-sm font-medium ${$.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",$.success," added",$.failed>0?`, ✗ ${$.failed} failed`:""]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:ae,fullWidth:!0,disabled:T||!Y.trim(),children:T?"Adding...":"Add All Keys"}),(0,d.jsx)(m.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===W&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.pd,{label:"Name",value:D.name,onChange:a=>E({...D,name:a.target.value}),placeholder:t?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.pd,{label:"Ollama Host URL",value:D.ollamaHostUrl,onChange:a=>E({...D,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(m.$n,{onClick:ac,disabled:N||T,variant:"secondary",children:N?"Checking...":"Check"})})]}),!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.pd,{label:w,type:u?"text":"password",value:D.apiKey,onChange:a=>E({...D,apiKey:a.target.value}),placeholder:u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"qoder"===b||"qoder-cn"===b?"pt-...":"",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(m.$n,{onClick:ac,disabled:!ab()||N||T,variant:"secondary",children:N?"Checking...":"Check"})})]}),v&&(0,d.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."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,j&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",j.replace(/^https?:\/\//,"")]})]})]}),B&&(0,d.jsx)(m.l6,{label:"Region",value:L,onChange:a=>M(a.target.value),options:B.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(m.pd,{label:"Default Model",value:D.defaultModel,onChange:a=>E({...D,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),t&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),R&&(0,d.jsx)(m.Ex,{variant:"success"===R?"success":"error",children:"success"===R?"Valid":"Invalid"}),l&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:l}),f&&(0,d.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."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(m.pd,{label:"Account ID",value:H.accountId,onChange:a=>I({...H,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),z&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(m.pd,{label:"AWS Profile (SSO — recommended)",value:J.profile,onChange:a=>K({...J,profile:a.target.value}),placeholder:"my-sso-profile"}),(0,d.jsx)(m.pd,{label:"Region",value:J.region,onChange:a=>K({...J,region:a.target.value}),placeholder:"us-east-1"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,d.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,d.jsxs)("code",{children:["aws sso login --profile ",J.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,d.jsx)(m.pd,{label:"Access Key ID (only for static keys)",value:J.accessKeyId,onChange:a=>K({...J,accessKeyId:a.target.value}),placeholder:"AKIA..."}),(0,d.jsx)(m.pd,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:J.sessionToken,onChange:a=>K({...J,sessionToken:a.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,d.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(m.pd,{label:"Azure Endpoint",value:F.azureEndpoint,onChange:a=>G({...F,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(m.pd,{label:"Deployment Name",value:F.deployment,onChange:a=>G({...F,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(m.pd,{label:"API Version",value:F.apiVersion,onChange:a=>G({...F,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(m.pd,{label:"Organization",value:F.organization,onChange:a=>G({...F,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(m.pd,{label:"Priority",type:"number",value:D.priority,onChange:a=>E({...D,priority:Number.parseInt(a.target.value)||1})}),(0,d.jsx)(m.l6,{label:"Proxy Pool",value:D.proxyPoolId,onChange:a=>E({...D,proxyPoolId:a.target.value}),options:[{value:s,label:"None"},...(k||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(k||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:ad,fullWidth:!0,disabled:T||!t&&(!D.name||!ab())||f&&!D.defaultModel.trim()||x&&(!F.azureEndpoint||!F.deployment||!F.organization)||y&&!H.accountId,children:T?"Saving...":"Save"}),(0,d.jsx)(m.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function Q({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,k]=(0,e.useState)(!1),[l,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){k(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{k(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:l,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(m.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(m.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(m.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(m.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(m.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.pd,{label:"API Key (for Check)",type:"password",value:l,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(m.$n,{onClick:v,disabled:!l||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(m.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(m.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"}),(0,d.jsx)(m.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}P.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerName:g().string,isCompatible:g().bool,isAnthropic:g().bool,authType:g().string,authHint:g().string,website:g().string,proxyPools:g().arrayOf(g().shape({id:g().string,name:g().string})),error:g().string,existingNames:g().arrayOf(g().string),onSave:g().func.isRequired,onBulkDone:g().func,onClose:g().func.isRequired},Q.propTypes={isOpen:g().bool.isRequired,node:g().shape({id:g().string,name:g().string,prefix:g().string,apiType:g().string,baseUrl:g().string}),onSave:g().func.isRequired,onClose:g().func.isRequired,isAnthropic:g().bool};let R=()=>Object.fromEntries(Object.keys(o.bs).map(a=>[a,!1]));function S({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(R),[l,n]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),v=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},w=async()=>{let a=v(h.trim());if(a){n("testing"),q("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();n(d.ok?"ok":"error"),q(d.error||"")}catch(a){n("error"),q(a.message)}}},x=async()=>{let a=v(h.trim());if(a&&!r){s(!0);try{await f(a,j,j.stt?t:null)}finally{s(!1)}}};return(0,d.jsx)(m.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),n(null),q("")},onKeyDown:a=>{"Enter"===a.key&&w()},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,d.jsx)(m.$n,{variant:"secondary",icon:"science",loading:"testing"===l,onClick:w,disabled:!h.trim()||"testing"===l,children:"testing"===l?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:v(h.trim())||"model-id"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(o.bs).map(([a,b])=>(0,d.jsx)(m.lM,{checked:!!j[a],onChange:b=>k(c=>({...c,[a]:b})),label:b.label,description:b.desc,size:"sm"},a))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(m.lM,{checked:!!j.stt,onChange:a=>{k(b=>({...b,stt:a})),a||u("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),j.stt&&(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)(m.l6,{label:"Transport",value:t,onChange:a=>u(a.target.value),placeholder:"Provider default (REST)",options:o.vp.map(a=>({value:a,label:o.qw[a].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===l&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===l&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:p||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(m.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(m.$n,{onClick:x,fullWidth:!0,size:"sm",disabled:!h.trim()||r,children:r?"Adding...":"Add Model"})]})]})})}S.propTypes={isOpen:g().bool.isRequired,providerAlias:g().string.isRequired,providerDisplayAlias:g().string.isRequired,onSave:g().func.isRequired,onClose:g().func.isRequired};let T=`[
8
8
  {
9
9
  "accessToken": "eyJhbGc...",
10
10
  "refreshToken": "rt_...",
11
11
  "idToken": "eyJhbGc...",
12
12
  "email": "user@example.com"
13
13
  }
14
- ]`;function T({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,n]=(0,e.useState)(null),o=()=>{h||(g(""),k(""),n(null),b())},p=async()=>{var a;let b;k(""),n(null);let d=f.trim();if(!d)return;try{b=JSON.parse(d)}catch(a){k(`${(0,C.Tl)("Invalid JSON")}: ${a.message}`);return}let e=Array.isArray(a=b)?a:a&&"object"==typeof a?Array.isArray(a.accounts)?a.accounts:[a]:null;if(!e||0===e.length)return void k((0,C.Tl)("No accounts found in input"));i(!0);try{let a=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),b=await a.json();if(!a.ok)return void k(b?.error||`Request failed: ${a.status}`);n(b),b.success>0&&"function"==typeof c&&c()}catch(a){k(a.message||(0,C.Tl)("Request failed"))}finally{i(!1)}},q=l?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(m.aF,{isOpen:a,title:(0,C.Tl)("Bulk Add Codex Accounts"),onClose:o,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,C.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:S,value:f,onChange:a=>g(a.target.value),disabled:h}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),l&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${l.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",l.success," ",(0,C.Tl)("added"),l.failed>0?`, ✗ ${l.failed} ${(0,C.Tl)("failed")}`:""]}),q.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:q.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:p,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,C.Tl)("Importing..."):(0,C.Tl)("Import All")}),(0,d.jsx)(m.$n,{onClick:o,variant:"ghost",fullWidth:!0,disabled:h,children:(0,C.Tl)("Close")})]})]})})}T.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSuccess:g().func};let U=`[
14
+ ]`;function U({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,n]=(0,e.useState)(null),o=()=>{h||(g(""),k(""),n(null),b())},p=async()=>{var a;let b;k(""),n(null);let d=f.trim();if(!d)return;try{b=JSON.parse(d)}catch(a){k(`${(0,D.Tl)("Invalid JSON")}: ${a.message}`);return}let e=Array.isArray(a=b)?a:a&&"object"==typeof a?Array.isArray(a.accounts)?a.accounts:[a]:null;if(!e||0===e.length)return void k((0,D.Tl)("No accounts found in input"));i(!0);try{let a=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),b=await a.json();if(!a.ok)return void k(b?.error||`Request failed: ${a.status}`);n(b),b.success>0&&"function"==typeof c&&c()}catch(a){k(a.message||(0,D.Tl)("Request failed"))}finally{i(!1)}},q=l?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(m.aF,{isOpen:a,title:(0,D.Tl)("Bulk Add Codex Accounts"),onClose:o,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,D.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:T,value:f,onChange:a=>g(a.target.value),disabled:h}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),l&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${l.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",l.success," ",(0,D.Tl)("added"),l.failed>0?`, ✗ ${l.failed} ${(0,D.Tl)("failed")}`:""]}),q.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:q.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:p,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,D.Tl)("Importing..."):(0,D.Tl)("Import All")}),(0,d.jsx)(m.$n,{onClick:o,variant:"ghost",fullWidth:!0,disabled:h,children:(0,D.Tl)("Close")})]})]})})}U.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSuccess:g().func};let V=`[
15
15
  {
16
16
  "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
17
17
  "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
@@ -24,4 +24,4 @@ pt-only-auto-named`:N,[W,X]=(0,e.useState)("single"),[Y,Z]=(0,e.useState)(""),[$
24
24
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
25
  "email": "account2@example.com"
26
26
  }
27
- ]`;function V(a){let b,c=a.trim();if(!c)return[];try{b=JSON.parse(c)}catch(a){try{let a=c;a.startsWith("[")||((a=a.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(a=a.slice(0,-1)),a=`[${a}]`),b=JSON.parse(a)}catch{throw a}}if(Array.isArray(b))return b;if(b&&"object"==typeof b)return Array.isArray(b.accounts)?b.accounts:[b];throw Error("Input must be a JSON object or array of objects")}function W({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=()=>{h||(g(""),k(""),n(null),r(null),p(!1),b())},u=async a=>{if(!a||0===a.length)return;k("");let b=Array.from(a).filter(a=>a.name.endsWith(".json")||"application/json"===a.type||""===a.type);if(0===b.length)return void k((0,C.Tl)("Please select valid .json files"));try{let a=[];for(let c of b){let b=await c.text(),d=V(b);Array.isArray(d)?a.push(...d):d&&a.push(d)}if(0===a.length)return void k((0,C.Tl)("No accounts found in selected files"));g(JSON.stringify(a,null,2)),r({filesCount:b.length,accountsCount:a.length})}catch(a){k(`${(0,C.Tl)("Error reading files")}: ${a.message}`)}},v=async()=>{let a;k(""),n(null);try{a=V(f)}catch(a){k(`${(0,C.Tl)("Invalid JSON")}: ${a.message}`);return}if(!a||0===a.length)return void k((0,C.Tl)("No accounts found in input"));i(!0);try{let b=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),d=await b.json();if(!b.ok)return void k(d?.error||`Request failed: ${b.status}`);n(d),d.success>0&&"function"==typeof c&&c()}catch(a){k(a.message||(0,C.Tl)("Request failed"))}finally{i(!1)}},w=l?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(m.aF,{isOpen:a,title:(0,C.Tl)("Bulk Add Grok CLI Accounts"),onClose:t,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,C.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,d.jsx)("input",{ref:s,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:a=>{u(a.target.files),a.target&&(a.target.value="")}}),(0,d.jsx)(m.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>s.current?.click(),disabled:h,children:(0,C.Tl)("Upload JSON Files")})]}),(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),p(!0)},onDragLeave:a=>{a.preventDefault(),p(!1)},onDrop:a=>{a.preventDefault(),p(!1),a.dataTransfer?.files?.length>0&&u(a.dataTransfer.files)},className:`relative rounded border transition-colors ${o?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,d.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:U,value:f,onChange:a=>{g(a.target.value),r(null)},disabled:h}),o&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,d.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,C.Tl)("Drop .json files here")})]})]}),q&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,d.jsxs)("span",{children:[(0,C.Tl)("Loaded")," ",q.accountsCount," ",(0,C.Tl)("account(s) from")," ",q.filesCount," ",(0,C.Tl)("file(s)")]})]}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),l&&l.failed>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",l.failed," ",(0,C.Tl)("failed")]}),w.length>0&&(0,d.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(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:v,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,C.Tl)("Importing..."):(0,C.Tl)("Import All")}),(0,d.jsx)(m.$n,{onClick:t,variant:"ghost",fullWidth:!0,disabled:h,children:(0,C.Tl)("Close")})]})]})})}var X=c(41371);let Y=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],Z=/^[A-Za-z0-9-]+$/;function $({providerId:a}){let b=(0,X.i)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([{name:"",value:""}]),[i,j]=(0,e.useState)({}),[k,l]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),p=(a,b,c)=>{h(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},q=(0,e.useCallback)(async()=>{let c={};for(let a of g.filter(a=>a.name.trim())){let d=a.name.trim();if(!Z.test(d))return void b.error(`Invalid header name: ${d}`);if(Y.includes(d.toLowerCase()))return void b.error(`Header ${d} cannot be overridden`);if(d in c)return void b.error(`Duplicate header name: ${d}`);a.value!==i[d]&&(c[d]=a.value)}o(!0);try{let d=await fetch(`/api/providers/${a}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:c})});if(!d.ok){let a=await d.json().catch(()=>({}));b.error(a.error||"Failed to save");return}l(Object.keys(c).length>0),b.success("Custom headers saved")}finally{o(!1)}},[g,i,a,b]);return 0!==Object.keys(i).length||k?(0,d.jsxs)(m.Zp,{padding:"xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"flex w-full items-center justify-between text-left",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),k&&(0,d.jsx)(m.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:g.map((a,b)=>{let c=a.name.trim()in i&&a.value!==i[a.name.trim()];return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:a.name,onChange:a=>p(b,"name",a.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,d.jsx)("input",{value:a.value,onChange:a=>p(b,"value",a.target.value),placeholder:"Value",spellCheck:!1,title:c?"Overridden":a.name.trim()in i?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${c?"border-amber-400/60":"border-border"}`}),(0,d.jsx)("button",{type:"button",title:"Remove header",onClick:()=>h(a=>a.length>1?a.filter((a,c)=>c!==b):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},b)})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>h(a=>[...a,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",disabled:n,onClick:()=>{h(Object.entries(i).map(([a,b])=>({name:a,value:b})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,d.jsx)("button",{type:"button",disabled:n,onClick:q,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Saving...":"Save"})]})]})]})]}):null}$.propTypes={providerId:g().string.isRequired};var _=c(56020),aa=c(54589);let ab=[{value:"all",label:"All"},{value:"untested",label:"Untested"},{value:"passed",label:"Passed"},{value:"failed",label:"Failed"}],ac={claude:"claudeAutoPing",codex:"codexAutoPing"};function ad({label:a,value:b,icon:c,tone:e="text-muted"}){return(0,d.jsxs)("div",{className:"rounded-xl border border-line bg-bg-soft/70 p-3.5",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[17px] ${e}`,"aria-hidden":"true",children:c}),(0,d.jsx)("p",{className:"muted mt-3 text-[10px] uppercase tracking-[0.1em]",children:a}),(0,d.jsx)("p",{className:"mt-1 truncate font-mono text-sm font-semibold",children:b})]})}function ae(){let a,b,c,f,g,i,p=(0,h.useParams)(),q=(0,h.useRouter)(),r=p.id,{getCaps:s}=(0,B.y)(),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(!0),[x,y]=(0,e.useState)(null),[D,H]=(0,e.useState)([]),[J,K]=(0,e.useState)(!1),[L,N]=(0,e.useState)(!1),[Q,S]=(0,e.useState)(!1),[U,V]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(!1),[Z,ae]=(0,e.useState)(""),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(!1),[al,am]=(0,e.useState)(!1),[an,ao]=(0,e.useState)(!1),[ap,aq]=(0,e.useState)(null),[ar,as]=(0,e.useState)({}),[at,au]=(0,e.useState)([]),[av,aw]=(0,e.useState)(!1),[ax,ay]=(0,e.useState)({}),[az,aA]=(0,e.useState)(""),[aB,aC]=(0,e.useState)(()=>new Set),[aD,aE]=(0,e.useState)(""),[aF,aG]=(0,e.useState)("all"),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)([]),[aL,aM]=(0,e.useState)("__none__"),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)(null),[aR,aS]=(0,e.useState)(""),[aT,aU]=(0,e.useState)("auto"),[aV,aW]=(0,e.useState)({enabled:!1,connections:{},schedules:{}}),[aX,aY]=(0,e.useState)(null),[aZ,a$]=(0,e.useState)([]),[a_,a0]=(0,e.useState)(!1),[a1,a2]=(0,e.useState)(null),[a3,a4]=(0,e.useState)([]),[a5,a6]=(0,e.useState)(null),[a7,a8]=(0,e.useState)([]),[a9,ba]=(0,e.useState)([]),[bb,bc]=(0,e.useState)(null),[bd,be]=(0,e.useState)(!1),[bf,bg]=(0,e.useState)(!1),[bh,bi]=(0,e.useState)(!1),[bj,bk]=(0,e.useState)(null),[bl,bm]=(0,e.useState)({}),[bn,bo]=(0,e.useState)(null),bp=(0,e.useRef)(!1),[bq,br]=(0,e.useState)(!1),[bs,bt]=(0,e.useState)(!1),{copied:bu,copy:bv}=(0,A.C)(),bw=()=>{K(!0)},bx=()=>{"xiaomi-mimo"===r?N(!0):bC?bw():(ae(""),Y(!0))},by=()=>{(ae(""),bN)?V(!0):Y(!0)},bz=()=>{bC?bx():by()},bA=x?{id:x.id,name:x.name||("anthropic-compatible"===x.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===x.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===x.type?"AC":"OC",apiType:x.apiType,baseUrl:x.baseUrl,type:x.type}:n.zN[r]||n.fg[r]||n.IS[r]||n.nJ[r]||n.br[r],bB=bA?.authModes||[],bC=!!n.zN[r]||!!n.IS[r]||bB.includes("oauth"),bD=!!n.fg[r]||bB.includes("apikey"),bE=!!n.IS[r]?.noAuth,bF=(0,o.KC)(r),bG=(0,e.useMemo)(()=>(0,n.Q5)(r),[r]),bH="opencode"===r||!bG,bI=("cursor"===r||"zed"===r)&&a3.length>0?a3:bH?bF:[],bJ=(0,n.wG)(r),bK=(0,n.mq)(r),bL=(0,n.gb)(r),bM=bK||bL,bN=!!n.mh[r],bO=!bM&&bC&&bD,bP="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"tokenharbor"===r?"Token Harbor Login":"OAuth",bQ="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"qoder"===r||"qoder-cn"===r?"PAT":"API Key",bR=a=>{if(!aT||"auto"===aT)return null;let b=z(r,a);return b&&b.includes(aT)?aT:null},bS=bM?r:bJ,bT=(()=>{let a=new Set,b=new Set,c=c=>{if(!c||b.has(c))return;b.add(c);let d=z(r,c);d&&d.forEach(b=>{"none"!==b&&a.add(b)})};for(let a of bI)c(a.id);for(let a of a7)c(a.id);for(let a of at)a.providerAlias===bS&&"llm"===(a.kind||a.type||"llm")&&c(a.id);return a.size?["auto",...a]:null})(),bU=bM?x?.prefix||r:bJ,bV=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bS)}`,{cache:"no-store"}),b=await a.json();a.ok&&ba(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bS]),bW=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bS,ids:[a]})})).ok&&await bV()}catch(a){console.log("Error disabling model:",a)}},bX=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bS)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bV()}catch(a){console.log("Error enabling model:",a)}},bY=async a=>{a.length&&bc({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{bc(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bS,ids:a})})).ok&&await bV()}catch(a){console.log("Error disabling all models:",a)}}})},bZ=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bS)}`,{method:"DELETE"})).ok&&await bV()}catch(a){console.log("Error enabling all models:",a)}},b$=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&as(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),b_=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&au(b.models||[])}catch(a){console.log("Error fetching custom models:",a)}},[]),b0=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=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"})]),e=await a.json(),f=await b.json(),g=await c.json(),h=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===r);u(a)}c.ok&&H(g.proxyPools||[]);let i=(h.providerStrategies||{})[r]||{};aQ(i.fallbackStrategy||null),aS(null!=i.stickyRoundRobinLimit?String(i.stickyRoundRobinLimit):"1");let j=(h.providerThinking||{})[r]||{};aU(j.mode||"auto");let k=ac[r],l=k&&h[k]||{};if(aW({enabled:!0===l.enabled,connections:l.connections||{},schedules:l.schedules||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===r)||null;if(!a&&bM)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===r)||null))break}y(a)}}catch(a){console.log("Error fetching connections:",a)}finally{w(!1)}},[r,bM]),b1=async a=>{try{let b=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(y(c.node),await b0(),am(!1))}catch(a){console.log("Error updating provider node:",a)}},b2=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[r]:f[r]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},b3=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[r]={mode:a}:delete c[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},b4=async a=>{let b=ac[r];if(b){aW(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){console.log("Error saving auto-ping config:",a)}}},b5=async(a=!1,{autoAdd:b=!1}={})=>{if(bG){a0(!0);try{let{data:c,error:d}=await E(bG,r,{force:a});if(a$(c),0===c.length)return void a2({ok:!1,text:d||"The provider returned no models."});if(!b)return void a2({ok:!0,text:`Fetched ${c.length} models.`});let e=new Set;for(let a of bI)e.add(`${bS}/${a.id}`);for(let a of at)a.providerAlias===bS&&a.id&&e.add(`${bS}/${a.id}`);for(let a of Object.values(ar))"string"==typeof a&&e.add(a);let f=0,g=0;for(let a of c)if(!e.has(`${bS}/${a.id}`))try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bS,id:a.id,type:"llm",name:a.name||a.id,origin:"fetch"})})).ok?f+=1:g+=1}catch{g+=1}f>0&&await b_();let h=c.length-f-g,i=[];f>0&&i.push(`Added ${f} model${1===f?"":"s"}`),g>0&&i.push(`${g} failed`),h>0&&i.push(`${h} already in the list`),a2({ok:0===g&&f>0,text:i.join(" \xb7 ")||"All models already in the list."})}finally{a0(!1)}}},b6=async(a,b,c=bJ)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await b$();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},b7=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b$()}catch(a){console.log("Error deleting alias:",a)}},b8=async(a,b="llm",c=bS,d,e)=>{try{let f=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b,...d?{caps:d}:{},...e?{transport:e}:{}})});if(f.ok)await b_();else{let a=await f.json();alert(a.error||"Failed to add custom model")}}catch(a){console.log("Error adding custom model:",a)}},b9=async(a,b="llm",c=bS)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});(await fetch(`/api/models/custom?${d}`,{method:"DELETE"})).ok&&await b_()}catch(a){console.log("Error deleting custom model:",a)}},ca=async()=>{if(bq)return;let a=t.find(a=>!1!==a.isActive);if(!a)return void alert((0,C.Tl)("Please add an active Qoder connection first"));br(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,C.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,C.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^(qoder-cn|qoder)\//,"");at.some(a=>a.providerAlias===bS&&a.id===c&&"llm"===(a.kind||a.type||"llm"))||Object.values(ar).includes(`${bS}/${c}`)||(await b8(c,"llm",bS),e+=1)}0===e?alert((0,C.Tl)("All models already exist, no new models added")):alert((0,C.Tl)("Successfully added")+` ${e} `+(0,C.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,C.Tl)("Error fetching models")+": "+a.message)}finally{br(!1)}},cb=async()=>{if(bs)return;let a=t.find(a=>!1!==a.isActive);if(!a)return void alert((0,C.Tl)("Please add an active Cline connection first"));bt(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,C.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,C.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;b&&(at.some(a=>a.providerAlias===bS&&a.id===b&&"llm"===(a.kind||a.type||"llm"))||Object.values(ar).includes(`${bS}/${b}`)||(await b8(b,"llm",bS),e+=1))}0===e?alert((0,C.Tl)("All models already exist, no new models added")):alert((0,C.Tl)("Successfully added")+` ${e} `+(0,C.Tl)("models"))}catch(a){console.log("Error importing Cline models:",a),alert((0,C.Tl)("Error fetching models")+": "+a.message)}finally{bt(!1)}},cc=async()=>{if(bf||0===t.length)return;let a=Object.fromEntries(t.map(a=>[a.id,{state:"queued",error:null}]));bp.current=!1,bg(!0),bi(!1),bk(null),bm(a),bo({total:t.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<t.length;a+=1){if(bp.current){bo({total:t.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=t[a];bk(d.id),bm(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,bm(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,bm(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}bo({total:t.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<t.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{bk(null),bg(!1),bi(!1),bp.current=!1}},cd=async a=>{bc({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{bc(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&u(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},ce=()=>{b0(),K(!1)},cf=async a=>{ae("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await b0(),Y(!1),b5(!0,{autoAdd:!0});return}ae(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),ae("Failed to save connection")}},cg=async a=>{try{(await fetch(`/api/providers/${ap.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await b0(),ak(!1),b5(!0,{autoAdd:!0}))}catch(a){console.log("Error updating connection:",a)}},ch=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&u(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},ci=async(a,b)=>{let c=[...t];[c[a],c[b]]=[c[b],c[a]],u(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await b0()}},cj=t.filter(a=>aJ.includes(a.id)),ck=t.length>0&&aJ.length===t.length;(()=>{if(0===cj.length)return;let a=new Set(cj.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=D.find(a=>a.id===b);return c?.name}})();let cl=()=>{aN||ao(!1)},cm=async a=>{aO(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await b0(),ao(!1)}finally{aO(!1)}},cn=a=>cm(t.map(b=>({connectionId:b.id,proxyPoolId:a}))),co=(0,d.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:t.map((a,b)=>{let c;return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,aJ.includes(c)),onChange:()=>{var b;return b=a.id,void aK(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(M,{connection:a,proxyPools:D,isOAuth:bC,isFirst:0===b,isLast:b===t.length-1,onMoveUp:()=>ci(b,b-1),onMoveDown:()=>ci(b,b+1),onToggleActive:b=>ch(a.id,b),autoPing:ac[r]&&"oauth"===a.authType?{isActive:!0===aV.connections[a.id]||aV.schedules?.[a.id]?.enabled===!0,reactiveOn:!0===aV.connections[a.id],provider:r,scheduleOn:aV.schedules?.[a.id]?.enabled===!0,scheduleSummary:(0,aa.JW)(aV.schedules?.[a.id]).join(" / "),onConfigure:()=>aY(a)}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&u(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{aq(a),ak(!0)},onDelete:()=>cd(a.id),oneByOneStatus:bl[a.id]||null})})]},a.id)})}),cp=D.filter(a=>!0===a.isActive),cq=(0,d.jsx)(m.aF,{isOpen:an,onClose:cl,title:`Apply Proxy (${t.length} connections)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=D.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):cm(t.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aN||0===cp.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>cn(null),disabled:aN,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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),D.map(a=>(0,d.jsxs)("button",{onClick:()=>cn(a.id),disabled:aN||!0!==a.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aN&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(m.$n,{onClick:cl,variant:"ghost",fullWidth:!0,disabled:aN,children:"Cancel"})]})}),cr=async a=>{if(!aB.has(a)){aC(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bS}/${a}`})}),c=await b.json();ay(b=>({...b,[a]:c.ok?"ok":"error"})),aA(c.ok?"":c.error||"Model not reachable")}catch{ay(b=>({...b,[a]:"error"})),aA("Network error")}finally{aC(b=>{let c=new Set(b);return c.delete(a),c})}}};if(v)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(m.Qv,{}),(0,d.jsx)(m.Qv,{})]});if(!bA)return(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(j(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let cs=()=>bK&&bA.apiType?"responses"===bA.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bL?"/providers/anthropic-m.png":(0,l.HY)(bA.id);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(j(),{href:"/dashboard/providers",className:"btn-quiet -ml-2 mb-4 !px-2 !py-1.5 !text-xs inline-flex",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"arrow_back"}),"Back to providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col justify-between gap-4 sm:flex-row sm:items-start",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-3.5 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl border border-line",style:{backgroundColor:`${bA.color}15`},children:av||!cs()?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bA.color},children:bA.textIcon||bA.id.slice(0,2).toUpperCase()}):(0,d.jsx)(k.A,{src:cs(),alt:bA.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,l.Kw)(bA.id),aw(!0)},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-[-0.035em] sm:text-3xl",children:bA.name}),t.length>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-success/25 bg-success/10 px-2 py-1 font-mono text-[9px] text-success",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-success","aria-hidden":"true"}),t.length," Connected"]}):(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-line-strong bg-surface-2 px-2 py-1 font-mono text-[9px] text-muted",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted","aria-hidden":"true"}),"Not connected"]})]}),(bA.notice?.apiKeyUrl||bA.notice?.signupUrl||bA.website)&&(0,d.jsxs)("a",{href:bA.notice?.apiKeyUrl||bA.notice?.signupUrl||bA.website,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-gold-text hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"open_in_new"}),bA.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,d.jsxs)("p",{className:"muted mt-1 text-xs",children:[t.length," connection",1===t.length?"":"s"," \xb7 local workspace"]})]})]}),(0,d.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:bz,className:"btn-gold !px-3 !py-2.5 !text-xs",children:bN?"Connect Session":bM?"Add API Key":"Add connection"})})]})]}),(0,d.jsxs)("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Provider summary",children:[(0,d.jsx)(ad,{label:"Connections",value:String(t.length),icon:"key",tone:t.length>0?"text-success":"text-muted"}),(0,d.jsx)(ad,{label:"Models",value:(a=[...bI,...a7.filter(a=>!bI.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}).length)>0?String(a):"—",icon:"memory",tone:"text-[#5d98e8]"}),(0,d.jsx)(ad,{label:"Status",value:t.length>0?"Connected":"Not connected",icon:"activity",tone:t.length>0?"text-success":"text-muted"}),(0,d.jsx)(ad,{label:"Endpoint",value:bA.website?new URL(bA.website).hostname:r,icon:"dns",tone:"text-gold-text"})]}),bA.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bA.deprecationNotice})]}),bA.notice?.text&&!bA.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bA.notice.text}),bA.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bA.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 →"})]}),bM&&x&&(0,d.jsx)(m.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bL?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bL?"Messages API":"responses"===x.apiType?"Responses API":"Chat Completions"," \xb7 ",(x.baseUrl||"").replace(/\/$/,""),"/",bL?"messages":"responses"===x.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:()=>{ae(""),Y(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>am(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{bc({title:"Delete Compatible Node",message:`Delete this ${bL?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{bc(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&q.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bE?(0,d.jsx)(m.gw,{providerId:r}):(0,d.jsxs)(m.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:"Connections"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:"Credentials and endpoints used by this provider."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[t.length>0&&D.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ao(!0),children:"Apply Proxy"}),t.length>0&&(0,d.jsxs)(d.Fragment,{children:[aJ.length>0&&(0,d.jsxs)(m.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=aJ.length;0!==a&&bc({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{bc(null);let a=0,b=[...aJ];for(let c of b)try{(await fetch(`/api/providers/${c}`,{method:"DELETE"})).ok||(a+=1)}catch(b){console.log("Error deleting connection:",b),a+=1}u(a=>a.filter(a=>!b.includes(a.id))),aK([]),a>0&&alert(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",aJ.length,")"]}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:cc,disabled:bf,children:bf?"Testing Connection One-by-One...":"Test Connection One-by-One"}),bf&&(0,d.jsx)(m.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{bf&&(bp.current=!0,bi(!0))},disabled:bh,children:bh?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(m.lM,{checked:"round-robin"===aP,onChange:a=>{let b=a?"round-robin":null,c=a?aR||"1":aR;a&&!aR&&aS("1"),aQ(b),b2(b,c)}}),"round-robin"===aP&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aR,onChange:a=>{var b;aS(b=a.target.value),b2("round-robin",b)},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===t.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bC?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bO&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bP," or ",bQ,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bO?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bx,children:bP}),(0,d.jsx)(m.$n,{size:"sm",icon:"key",onClick:by,children:bQ})]}):(0,d.jsxs)(d.Fragment,{children:[!bM&&"iflow"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>S(!0),children:"Cookie"}),"codex"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ag(!0),children:(0,C.Tl)("Bulk Add")}),"grok-cli"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ai(!0),children:(0,C.Tl)("Bulk Add")}),(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:bz,children:bN?"Connect Session":bM?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[bn&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",bn.total]}),(0,d.jsxs)("span",{children:["Completed: ",bn.completed]}),(0,d.jsxs)("span",{children:["Passed: ",bn.passed]}),(0,d.jsxs)("span",{children:["Failed: ",bn.failed]}),bn.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),bf&&bj&&(0,d.jsxs)("span",{children:["Running: ",t.find(a=>a.id===bj)?.name||bj]})]})}),t.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:ck,onChange:()=>{ck?aK([]):aK(t.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),co,!bM&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>S(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ag(!0),title:(0,C.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,C.Tl)("Bulk Add")}),"grok-cli"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ai(!0),title:(0,C.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,C.Tl)("Bulk Add")}),bO?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bx,className:"w-full sm:w-auto",children:bP}),(0,d.jsx)(m.$n,{size:"sm",icon:"key",onClick:by,className:"w-full sm:w-auto",children:bQ})]}):(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:bz,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsx)($,{providerId:r}),(0,d.jsxs)(m.Zp,{children:[(0,d.jsxs)("div",{className:"flex flex-col justify-between gap-3 sm:flex-row sm:items-start",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:"Available models"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:"Models currently exposed by this provider route. Test sends one real minimal request."})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a1&&(0,d.jsx)("span",{role:"status",className:`max-w-[240px] truncate rounded-lg border px-2 py-1 text-[11px] ${a1.ok?"border-success/25 bg-success/10 text-success":"border-danger/30 bg-danger/10 text-danger"}`,title:a1.text,children:a1.text}),bG&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:a_?"progress_activity":"cloud_download",onClick:()=>void b5(!0),disabled:a_,title:"Fetch the live model list from the provider API (uses your saved key)",className:a_?"[&_.material-symbols-outlined]:animate-spin":"",children:a_?"Fetching…":"Fetch models"}),bT&&(0,d.jsx)("select",{value:aT,onChange:a=>{var b;aU(b=a.target.value),b3(b)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-line bg-surface px-2 py-1 text-[11px] focus:border-gold focus:outline-none",children:bT.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))}),!bM&&(b=[...bI,...a7.filter(a=>!bI.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}).map(a=>a.id).filter(a=>!a9.includes(a)),(0,d.jsxs)(d.Fragment,{children:[a9.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bZ,children:"Active All"}),b.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bY(b),children:"Disable All"})]}))]})]}),!bM&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,d.jsxs)("label",{className:"relative block flex-1",children:[(0,d.jsx)("span",{className:"sr-only",children:"Search models"}),(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[15px] text-muted","aria-hidden":"true",children:"search"}),(0,d.jsx)("input",{value:aD,onChange:a=>aE(a.target.value),placeholder:"Search models","aria-label":"Search models",className:"input !h-9 !w-full !py-2 !pl-9 !pr-8 !text-xs",autoComplete:"off",spellCheck:!1}),aD&&(0,d.jsx)("button",{type:"button",onClick:()=>aE(""),"aria-label":"Clear model search",title:"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted transition-colors hover:text-text",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})})]}),(0,d.jsx)("div",{className:"flex shrink-0 overflow-x-auto rounded-lg border border-line bg-bg-soft p-0.5",role:"tablist","aria-label":"Filter models by test result",children:ab.map(a=>(0,d.jsx)("button",{type:"button",role:"tab","aria-selected":aF===a.value,onClick:()=>aG(a.value),className:`whitespace-nowrap rounded-md px-2.5 py-1.5 text-[10px] font-medium transition-colors ${aF===a.value?"bg-surface text-gold-text shadow-sm":"text-muted hover:text-text"}`,children:a.label},a.value))})]}),!!az&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:az}),/RegionError|hosted in China|regionNotAllowed/i.test(az)&&(f=(c="string"==typeof az?az:JSON.stringify(az)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),g=c.match(/wrk_[0-9A-Za-z]+/),i=f?f[0].endsWith("/go")?f[0]:`${f[0]}/go`:g?`https://opencode.ai/workspace/${g[0]}/go`:"https://opencode.ai",(0,d.jsx)("div",{className:"mt-1.5",children:(0,d.jsxs)("a",{href:i,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,d.jsx)("span",{children:"Allow China-hosted models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===r&&!!a5&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:a5}),(()=>{let a,b,c;if(bM)return(0,d.jsx)(I,{providerStorageAlias:bS,providerDisplayAlias:bU,modelAliases:ar,customModels:at,copied:bu,onCopy:bv,onSetAlias:b6,onDeleteAlias:b7,onAddCustomModel:a=>b8(a,"llm",bS),onDeleteCustomModel:a=>b9(a,"llm",bS),connections:t,isAnthropic:bL});let e=[...bI,...a7.filter(a=>!bI.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}),f=new Set(a9),g=aD.trim().toLowerCase(),h=a=>!g||a.id.toLowerCase().includes(g)||(a.name||"").toLowerCase().includes(g),i=a=>{if("all"===aF)return!0;let b=ax[a.id];return"untested"===aF?!b:"passed"===aF?"ok"===b:"failed"!==aF||"error"===b},j=e.filter(a=>!f.has(a.id)&&h(a)&&i(a)),k=e.filter(a=>f.has(a.id)),l=F({customModels:at,modelAliases:ar,providerAlias:bS,builtInModels:bI,type:"llm"}).filter(a=>h({id:a.id,name:a.name})&&i({id:a.id}));return(0,d.jsxs)("div",{className:"group/model-list space-y-2",children:[0===l.length&&0===j.length&&(0,d.jsxs)("div",{className:"rounded-xl border border-dashed border-line-strong px-5 py-9 text-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mx-auto text-[24px] text-muted","aria-hidden":"true",children:"memory"}),(0,d.jsx)("p",{className:"mt-3 text-sm font-semibold",children:aD.trim()||"all"!==aF?"No matching models":"No models discovered"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:aD.trim()||"all"!==aF?"Try a different search or filter.":"Connect the provider or add a custom model ID below."})]}),l.map(a=>(0,d.jsx)(G,{model:{id:a.id,name:a.name},fullModel:`${bU}/${a.id}`,alias:a.alias,copied:bu,onCopy:bv,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?b9(a.id,"llm",bS):b7(a.alias)},testStatus:ax[a.id],onTest:t.length>0||bE?()=>cr(a.id):void 0,isTesting:aB.has(a.id),isCustom:"fetch"!==a.origin,isFree:!1,caps:s(`${r}/${a.id}`),thinkingSuffix:bR(a.id)},`${a.source}-${a.fullModel}`)),j.map(a=>{let b=`${bS}/${a.id}`,c=`${r}/${a.id}`,e=Object.entries(ar).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(G,{model:a,fullModel:`${bU}/${a.id}`,alias:e,copied:bu,onCopy:bv,onSetAlias:b=>b6(a.id,b,bS),onDeleteAlias:()=>b7(e),testStatus:ax[a.id],onTest:t.length>0||bE?()=>cr(a.id):void 0,isTesting:aB.has(a.id),isFree:a.isFree,onDisable:()=>bW(a.id),caps:s(`${r}/${a.id}`),thinkingSuffix:bR(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>aI(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-gold/40 px-3 py-2 text-xs font-medium text-gold-text transition-colors hover:border-gold hover:bg-gold-soft sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"add"}),"Add Model"]}),("qoder"===r||"qoder-cn"===r)&&t.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:ca,disabled:bq,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bq?{animation:"spin 1s linear infinite"}:void 0,children:bq?"progress_activity":"download"}),bq?(0,C.Tl)("Fetching..."):(0,C.Tl)("Fetch Qoder Models")]}),("cline"===r||"clinepass"===r)&&t.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:cb,disabled:bs,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bs?{animation:"spin 1s linear infinite"}:void 0,children:bs?"progress_activity":"download"}),bs?(0,C.Tl)("Fetching..."):(0,C.Tl)("Import from /models")]}),aZ.length>0&&(a=new Set([...Object.values(ar),...l.map(a=>a.fullModel)]),b=new Set(bI.map(a=>a.id)),0===(c=aZ.filter(c=>!a.has(`${bS}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested models from the provider API:"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await b8(a.id,"llm",bS)},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:a.contextLength?`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`:a.name||a.id,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),k.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",k.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:k.map(a=>(0,d.jsxs)("button",{onClick:()=>bX(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),cq,"kiro"===r?(0,d.jsx)(m.Mh,{isOpen:J,providerInfo:bA,onSuccess:ce,onClose:()=>K(!1)}):"cursor"===r?(0,d.jsx)(m.G9,{isOpen:J,onSuccess:ce,onClose:()=>K(!1)}):"zed"===r?(0,d.jsx)(m.TE,{isOpen:J,providerInfo:bA,onSuccess:ce,onClose:()=>K(!1)}):"gitlab"===r?(0,d.jsx)(m.vj,{isOpen:J,providerInfo:bA,onSuccess:ce,onClose:()=>K(!1)}):"tokenharbor"===r?(0,d.jsx)(m.O1,{isOpen:J,providerInfo:bA,onSuccess:ce,onClose:()=>K(!1)}):(0,d.jsx)(m.LF,{isOpen:J,provider:r,providerInfo:bA,onSuccess:ce,onClose:()=>K(!1)}),(0,d.jsx)(m.LH,{isOpen:L,onSuccess:ce,onClose:()=>N(!1)}),"iflow"===r&&(0,d.jsx)(m.vE,{isOpen:Q,onSuccess:()=>{b0(),S(!1)},onClose:()=>S(!1)}),bN&&(0,d.jsx)(m.Sg,{isOpen:U,providerId:r,onSuccess:ce,onClose:()=>V(!1)}),(0,d.jsx)(O,{isOpen:X,provider:r,providerName:bA.name,isCompatible:bM,isAnthropic:bL,authType:bA?.authType,authHint:bA?.authHint,website:bA?.website,proxyPools:D,error:Z,existingNames:t.map(a=>a.name).filter(Boolean),onSave:cf,onBulkDone:b0,onClose:()=>{ae(""),Y(!1)}}),(0,d.jsx)(m.wI,{isOpen:aj,connection:ap,proxyPools:D,onSave:cg,onClose:()=>ak(!1)}),bM&&(0,d.jsx)(P,{isOpen:al,node:x,onSave:b1,onClose:()=>am(!1),isAnthropic:bL}),!bM&&(0,d.jsx)(R,{isOpen:aH,providerAlias:bS,providerDisplayAlias:bU,onSave:async(a,b,c)=>{await b8(a,b?.stt?"stt":"llm",bS,b,c),aI(!1)},onClose:()=>aI(!1)}),"codex"===r&&(0,d.jsx)(T,{isOpen:af,onClose:()=>ag(!1),onSuccess:b0}),"grok-cli"===r&&(0,d.jsx)(W,{isOpen:ah,onClose:()=>ai(!1),onSuccess:b0}),aX&&(0,d.jsx)(_.A,{isOpen:!!aX,onClose:()=>aY(null),connection:aX,reactive:!0===aV.connections[aX.id],schedule:aV.schedules?.[aX.id]||null,onSave:a=>((a,{reactive:b,schedule:c})=>{b4({...aV,connections:{...aV.connections,[a]:b},schedules:{...aV.schedules,[a]:c}})})(aX.id,a)}),(0,d.jsx)(m.uo,{isOpen:bd,onClose:()=>be(!1),onConfirm:()=>{(be(!1),bC)?bw():by()},title:"Risk Notice",message:bA?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(m.uo,{isOpen:!!bb,onClose:()=>bc(null),onConfirm:bb?.onConfirm,title:bb?.title||"Confirm",message:bb?.message,variant:"danger"})]})}ad.propTypes={label:g().string.isRequired,value:g().string.isRequired,icon:g().string.isRequired,tone:g().string}},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},26915:a=>{"use strict";a.exports=import("playwright-core")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30714:a=>{"use strict";a.exports=require("node:vm")},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},42272:(a,b,c)=>{Promise.resolve().then(c.bind(c,14812))},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},55708:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>y,handler:()=>A,routeModule:()=>z});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,57529))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.bind(c,56965))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),w={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[v,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},[]]},{error:[s,"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/error.js"],"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/gin/work/Hilbras/OmniHilbras/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,x=(0,e.H)({tree:w,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),y=x.__next_app__,z=x.routeModule,A=x.handler},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},72271:a=>{"use strict";a.exports=require("@aws-sdk/credential-providers")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},78720:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1260,2430,3031,2116,2712,4785,3817,6070,1329,915,6457,4123,3799,6777,412,1736],()=>b(b.s=55708));module.exports=c})();
27
+ ]`;function W(a){let b,c=a.trim();if(!c)return[];try{b=JSON.parse(c)}catch(a){try{let a=c;a.startsWith("[")||((a=a.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(a=a.slice(0,-1)),a=`[${a}]`),b=JSON.parse(a)}catch{throw a}}if(Array.isArray(b))return b;if(b&&"object"==typeof b)return Array.isArray(b.accounts)?b.accounts:[b];throw Error("Input must be a JSON object or array of objects")}function X({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=()=>{h||(g(""),k(""),n(null),r(null),p(!1),b())},u=async a=>{if(!a||0===a.length)return;k("");let b=Array.from(a).filter(a=>a.name.endsWith(".json")||"application/json"===a.type||""===a.type);if(0===b.length)return void k((0,D.Tl)("Please select valid .json files"));try{let a=[];for(let c of b){let b=await c.text(),d=W(b);Array.isArray(d)?a.push(...d):d&&a.push(d)}if(0===a.length)return void k((0,D.Tl)("No accounts found in selected files"));g(JSON.stringify(a,null,2)),r({filesCount:b.length,accountsCount:a.length})}catch(a){k(`${(0,D.Tl)("Error reading files")}: ${a.message}`)}},v=async()=>{let a;k(""),n(null);try{a=W(f)}catch(a){k(`${(0,D.Tl)("Invalid JSON")}: ${a.message}`);return}if(!a||0===a.length)return void k((0,D.Tl)("No accounts found in input"));i(!0);try{let b=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),d=await b.json();if(!b.ok)return void k(d?.error||`Request failed: ${b.status}`);n(d),d.success>0&&"function"==typeof c&&c()}catch(a){k(a.message||(0,D.Tl)("Request failed"))}finally{i(!1)}},w=l?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(m.aF,{isOpen:a,title:(0,D.Tl)("Bulk Add Grok CLI Accounts"),onClose:t,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,D.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,d.jsx)("input",{ref:s,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:a=>{u(a.target.files),a.target&&(a.target.value="")}}),(0,d.jsx)(m.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>s.current?.click(),disabled:h,children:(0,D.Tl)("Upload JSON Files")})]}),(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),p(!0)},onDragLeave:a=>{a.preventDefault(),p(!1)},onDrop:a=>{a.preventDefault(),p(!1),a.dataTransfer?.files?.length>0&&u(a.dataTransfer.files)},className:`relative rounded border transition-colors ${o?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,d.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:V,value:f,onChange:a=>{g(a.target.value),r(null)},disabled:h}),o&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,d.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,D.Tl)("Drop .json files here")})]})]}),q&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,d.jsxs)("span",{children:[(0,D.Tl)("Loaded")," ",q.accountsCount," ",(0,D.Tl)("account(s) from")," ",q.filesCount," ",(0,D.Tl)("file(s)")]})]}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),l&&l.failed>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",l.failed," ",(0,D.Tl)("failed")]}),w.length>0&&(0,d.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(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(m.$n,{onClick:v,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,D.Tl)("Importing..."):(0,D.Tl)("Import All")}),(0,d.jsx)(m.$n,{onClick:t,variant:"ghost",fullWidth:!0,disabled:h,children:(0,D.Tl)("Close")})]})]})})}let Y=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],Z=/^[A-Za-z0-9-]+$/;function $({providerId:a}){let b=(0,A.i)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([{name:"",value:""}]),[i,j]=(0,e.useState)({}),[k,l]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),p=(a,b,c)=>{h(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},q=(0,e.useCallback)(async()=>{let c={};for(let a of g.filter(a=>a.name.trim())){let d=a.name.trim();if(!Z.test(d))return void b.error(`Invalid header name: ${d}`);if(Y.includes(d.toLowerCase()))return void b.error(`Header ${d} cannot be overridden`);if(d in c)return void b.error(`Duplicate header name: ${d}`);a.value!==i[d]&&(c[d]=a.value)}o(!0);try{let d=await fetch(`/api/providers/${a}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:c})});if(!d.ok){let a=await d.json().catch(()=>({}));b.error(a.error||"Failed to save");return}l(Object.keys(c).length>0),b.success("Custom headers saved")}finally{o(!1)}},[g,i,a,b]);return 0!==Object.keys(i).length||k?(0,d.jsxs)(m.Zp,{padding:"xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"flex w-full items-center justify-between text-left",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),k&&(0,d.jsx)(m.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:g.map((a,b)=>{let c=a.name.trim()in i&&a.value!==i[a.name.trim()];return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:a.name,onChange:a=>p(b,"name",a.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,d.jsx)("input",{value:a.value,onChange:a=>p(b,"value",a.target.value),placeholder:"Value",spellCheck:!1,title:c?"Overridden":a.name.trim()in i?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${c?"border-amber-400/60":"border-border"}`}),(0,d.jsx)("button",{type:"button",title:"Remove header",onClick:()=>h(a=>a.length>1?a.filter((a,c)=>c!==b):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},b)})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>h(a=>[...a,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",disabled:n,onClick:()=>{h(Object.entries(i).map(([a,b])=>({name:a,value:b})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,d.jsx)("button",{type:"button",disabled:n,onClick:q,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Saving...":"Save"})]})]})]})]}):null}$.propTypes={providerId:g().string.isRequired};var _=c(56020),aa=c(54589);let ab=[{value:"all",label:"All"},{value:"untested",label:"Untested"},{value:"passed",label:"Passed"},{value:"failed",label:"Failed"}],ac={claude:"claudeAutoPing",codex:"codexAutoPing"};function ad({label:a,value:b,icon:c,tone:e="text-muted"}){return(0,d.jsxs)("div",{className:"rounded-xl border border-line bg-bg-soft/70 p-3.5",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[17px] ${e}`,"aria-hidden":"true",children:c}),(0,d.jsx)("p",{className:"muted mt-3 text-[10px] uppercase tracking-[0.1em]",children:a}),(0,d.jsx)("p",{className:"mt-1 truncate font-mono text-sm font-semibold",children:b})]})}function ae(){let a,b,c,f,g,i,p=(0,h.useParams)(),q=(0,h.useRouter)(),r=p.id,{getCaps:s}=(0,C.y)(),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(!0),[x,y]=(0,e.useState)(null),[E,I]=(0,e.useState)([]),[K,L]=(0,e.useState)(!1),[M,O]=(0,e.useState)(!1),[R,T]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(""),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)(!1),[ao,ap]=(0,e.useState)(!1),[aq,ar]=(0,e.useState)(null),[as,at]=(0,e.useState)({}),[au,av]=(0,e.useState)([]),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)({}),[aA,aB]=(0,e.useState)(""),[aC,aD]=(0,e.useState)(()=>new Set),[aE,aF]=(0,e.useState)(""),aG=(0,A.i)(),[aH,aI]=(0,e.useState)("all"),[aJ,aK]=(0,e.useState)(!1),[aL,aM]=(0,e.useState)(null),[aN,aO]=(0,e.useState)(!1),[aP,aQ]=(0,e.useState)([]),[aR,aS]=(0,e.useState)("__none__"),[aT,aU]=(0,e.useState)(!1),[aV,aW]=(0,e.useState)(null),[aX,aY]=(0,e.useState)(""),[aZ,a$]=(0,e.useState)("auto"),[a_,a0]=(0,e.useState)({enabled:!1,connections:{},schedules:{}}),[a1,a2]=(0,e.useState)(null),[a3,a4]=(0,e.useState)([]),[a5,a6]=(0,e.useState)(!1),[a7,a8]=(0,e.useState)(null),[a9,ba]=(0,e.useState)([]),[bb,bc]=(0,e.useState)(null),[bd,be]=(0,e.useState)([]),[bf,bg]=(0,e.useState)([]),[bh,bi]=(0,e.useState)(null),[bj,bk]=(0,e.useState)(!1),[bl,bm]=(0,e.useState)(!1),[bn,bo]=(0,e.useState)(!1),[bp,bq]=(0,e.useState)(null),[br,bs]=(0,e.useState)({}),[bt,bu]=(0,e.useState)(null),bv=(0,e.useRef)(!1),[bw,bx]=(0,e.useState)(!1),[by,bz]=(0,e.useState)(!1),{copied:bA,copy:bB}=(0,B.C)(),bC=()=>{L(!0)},bD=()=>{"xiaomi-mimo"===r?O(!0):bI?bC():(af(""),Z(!0))},bE=()=>{(af(""),bU)?W(!0):Z(!0)},bF=()=>{bI?bD():bE()},bG=x?{id:x.id,name:x.name||("anthropic-compatible"===x.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===x.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===x.type?"AC":"OC",apiType:x.apiType,baseUrl:x.baseUrl,type:x.type}:n.zN[r]||n.fg[r]||n.IS[r]||n.nJ[r]||n.br[r]||n.mh[r],bH=bG?.authModes||[],bI=!!n.zN[r]||!!n.IS[r]||bH.includes("oauth"),bJ=!!n.fg[r]||bH.includes("apikey"),bK=!!n.IS[r]?.noAuth,bL=(0,o.KC)(r),bM=(0,e.useMemo)(()=>(0,n.Q5)(r),[r]),bN="opencode"===r||!bM,bO=("cursor"===r||"zed"===r)&&a9.length>0,bP=(0,e.useMemo)(()=>bO?a9:bN?bL:[],[bO,bN,bL,a9]),bQ=(0,n.wG)(r),bR=(0,n.mq)(r),bS=(0,n.gb)(r),bT=bR||bS,bU=!!n.mh[r],bV=(0,e.useMemo)(()=>[...bP,...bd.filter(a=>!bP.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}).map(a=>a.id),[bP,bd]),bW=!bT&&bI&&bJ,bX="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"tokenharbor"===r?"Token Harbor Login":"OAuth",bY="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"qoder"===r||"qoder-cn"===r?"PAT":"API Key",bZ=a=>{if(!aZ||"auto"===aZ)return null;let b=z(r,a);return b&&b.includes(aZ)?aZ:null},b$=bT?r:bQ,b_=(()=>{let a=new Set,b=new Set,c=c=>{if(!c||b.has(c))return;b.add(c);let d=z(r,c);d&&d.forEach(b=>{"none"!==b&&a.add(b)})};for(let a of bP)c(a.id);for(let a of bd)c(a.id);for(let a of au)a.providerAlias===b$&&"llm"===(a.kind||a.type||"llm")&&c(a.id);return a.size?["auto",...a]:null})(),b0=bT?x?.prefix||r:bQ,b1=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}`,{cache:"no-store"}),b=await a.json();a.ok&&bg(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[b$]),b2=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,ids:[a]})})).ok&&await b1()}catch(a){console.log("Error disabling model:",a)}},b3=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b1()}catch(a){console.log("Error enabling model:",a)}},b4=async a=>{a.length&&bi({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{bi(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,ids:a})})).ok&&await b1()}catch(a){console.log("Error disabling all models:",a)}}})},b5=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(b$)}`,{method:"DELETE"})).ok&&await b1()}catch(a){console.log("Error enabling all models:",a)}},b6=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&at(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),b7=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&av(b.models||[])}catch(a){console.log("Error fetching custom models:",a)}},[]),b8=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=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"})]),e=await a.json(),f=await b.json(),g=await c.json(),h=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===r);u(a)}c.ok&&I(g.proxyPools||[]);let i=(h.providerStrategies||{})[r]||{};aW(i.fallbackStrategy||null),aY(null!=i.stickyRoundRobinLimit?String(i.stickyRoundRobinLimit):"1");let j=(h.providerThinking||{})[r]||{};a$(j.mode||"auto");let k=ac[r],l=k&&h[k]||{};if(a0({enabled:!0===l.enabled,connections:l.connections||{},schedules:l.schedules||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===r)||null;if(!a&&bT)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===r)||null))break}y(a)}}catch(a){console.log("Error fetching connections:",a)}finally{w(!1)}},[r,bT]),b9=async a=>{try{let b=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(y(c.node),await b8(),an(!1))}catch(a){console.log("Error updating provider node:",a)}},ca=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[r]:f[r]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},cb=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[r]={mode:a}:delete c[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},cc=async a=>{let b=ac[r];if(b){a0(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){console.log("Error saving auto-ping config:",a)}}},cd=async(a=!1,{autoAdd:b=!1}={})=>{if(bM){a6(!0);try{let{data:c,error:d}=await F(bM,r,{force:a});if(a4(c),0===c.length)return void a8({ok:!1,text:d||"The provider returned no models."});if(!b)return void a8({ok:!0,text:`Fetched ${c.length} models.`});let e=new Set;for(let a of bP)e.add(`${b$}/${a.id}`);for(let a of au)a.providerAlias===b$&&a.id&&e.add(`${b$}/${a.id}`);for(let a of Object.values(as))"string"==typeof a&&e.add(a);let f=0,g=0;for(let a of c)if(!e.has(`${b$}/${a.id}`))try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:b$,id:a.id,type:"llm",name:a.name||a.id,origin:"fetch"})})).ok?f+=1:g+=1}catch{g+=1}f>0&&await b7();let h=c.length-f-g,i=[];f>0&&i.push(`Added ${f} model${1===f?"":"s"}`),g>0&&i.push(`${g} failed`),h>0&&i.push(`${h} already in the list`),a8({ok:0===g&&f>0,text:i.join(" \xb7 ")||"All models already in the list."})}finally{a6(!1)}}},ce=async(a,b,c=bQ)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await b6();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},cf=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await b6()}catch(a){console.log("Error deleting alias:",a)}},cg=async(a,b="llm",c=b$,d,e)=>{try{let f=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b,...d?{caps:d}:{},...e?{transport:e}:{}})});if(f.ok)await b7();else{let a=await f.json();alert(a.error||"Failed to add custom model")}}catch(a){console.log("Error adding custom model:",a)}},ch=async(a,b="llm",c=b$)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});(await fetch(`/api/models/custom?${d}`,{method:"DELETE"})).ok&&await b7()}catch(a){console.log("Error deleting custom model:",a)}},ci=async()=>{if(bw)return;let a=t.find(a=>!1!==a.isActive);if(!a)return void alert((0,D.Tl)("Please add an active Qoder connection first"));bx(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,D.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,D.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^(qoder-cn|qoder)\//,"");au.some(a=>a.providerAlias===b$&&a.id===c&&"llm"===(a.kind||a.type||"llm"))||Object.values(as).includes(`${b$}/${c}`)||(await cg(c,"llm",b$),e+=1)}0===e?alert((0,D.Tl)("All models already exist, no new models added")):alert((0,D.Tl)("Successfully added")+` ${e} `+(0,D.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,D.Tl)("Error fetching models")+": "+a.message)}finally{bx(!1)}},cj=async()=>{if(by)return;let a=t.find(a=>!1!==a.isActive);if(!a)return void alert((0,D.Tl)("Please add an active Cline connection first"));bz(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,D.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,D.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;b&&(au.some(a=>a.providerAlias===b$&&a.id===b&&"llm"===(a.kind||a.type||"llm"))||Object.values(as).includes(`${b$}/${b}`)||(await cg(b,"llm",b$),e+=1))}0===e?alert((0,D.Tl)("All models already exist, no new models added")):alert((0,D.Tl)("Successfully added")+` ${e} `+(0,D.Tl)("models"))}catch(a){console.log("Error importing Cline models:",a),alert((0,D.Tl)("Error fetching models")+": "+a.message)}finally{bz(!1)}},ck=async()=>{if(bl||0===t.length)return;let a=Object.fromEntries(t.map(a=>[a.id,{state:"queued",error:null}]));bv.current=!1,bm(!0),bo(!1),bq(null),bs(a),bu({total:t.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<t.length;a+=1){if(bv.current){bu({total:t.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=t[a];bq(d.id),bs(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,bs(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,bs(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}bu({total:t.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<t.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{bq(null),bm(!1),bo(!1),bv.current=!1}},cl=async a=>{bi({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{bi(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&u(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},cm=()=>{b8(),L(!1)},cn=async a=>{af("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await b8(),Z(!1),cd(!0,{autoAdd:!0});return}af(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),af("Failed to save connection")}},co=async a=>{try{(await fetch(`/api/providers/${aq.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await b8(),al(!1),cd(!0,{autoAdd:!0}))}catch(a){console.log("Error updating connection:",a)}},cp=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&u(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},cq=async(a,b)=>{let c=[...t];[c[a],c[b]]=[c[b],c[a]],u(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await b8()}},cr=t.filter(a=>aP.includes(a.id)),cs=t.length>0&&aP.length===t.length;(()=>{if(0===cr.length)return;let a=new Set(cr.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=E.find(a=>a.id===b);return c?.name}})();let ct=()=>{aT||ap(!1)},cu=async a=>{aU(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await b8(),ap(!1)}finally{aU(!1)}},cv=a=>cu(t.map(b=>({connectionId:b.id,proxyPoolId:a}))),cw=(0,d.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:t.map((a,b)=>{let c;return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,aP.includes(c)),onChange:()=>{var b;return b=a.id,void aQ(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(N,{connection:a,proxyPools:E,isOAuth:bI,isFirst:0===b,isLast:b===t.length-1,onMoveUp:()=>cq(b,b-1),onMoveDown:()=>cq(b,b+1),onToggleActive:b=>cp(a.id,b),autoPing:ac[r]&&"oauth"===a.authType?{isActive:!0===a_.connections[a.id]||a_.schedules?.[a.id]?.enabled===!0,reactiveOn:!0===a_.connections[a.id],provider:r,scheduleOn:a_.schedules?.[a.id]?.enabled===!0,scheduleSummary:(0,aa.JW)(a_.schedules?.[a.id]).join(" / "),onConfigure:()=>a2(a)}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&u(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{ar(a),al(!0)},onDelete:()=>cl(a.id),oneByOneStatus:br[a.id]||null})})]},a.id)})}),cx=E.filter(a=>!0===a.isActive),cy=(0,d.jsx)(m.aF,{isOpen:ao,onClose:ct,title:`Apply Proxy (${t.length} connections)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=E.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):cu(t.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aT||0===cx.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>cv(null),disabled:aT,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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),E.map(a=>(0,d.jsxs)("button",{onClick:()=>cv(a.id),disabled:aT||!0!==a.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aT&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(m.$n,{onClick:ct,variant:"ghost",fullWidth:!0,disabled:aT,children:"Cancel"})]})}),cz=async a=>{if(!aC.has(a)){aD(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b$}/${a}`})}),c=await b.json();az(b=>({...b,[a]:c.ok?"ok":"error"})),aB(c.ok?"":c.error||"Model not reachable")}catch{az(b=>({...b,[a]:"error"})),aB("Network error")}finally{aD(b=>{let c=new Set(b);return c.delete(a),c})}}},cA=async()=>{if(!aJ&&0!==bV.length){aK(!0),aM({done:0,total:bV.length}),aB("");try{let a=await fetch("/api/models/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:bV.map(a=>`${b$}/${a}`)})});if(!a.ok){let b=await a.json().catch(()=>({}));aB(b.error||"Batch test failed");return}let b=a.body?.getReader(),c=new TextDecoder,d="",e=null;for(;b;){let{done:a,value:f}=await b.read();if(a)break;let g=(d+=c.decode(f,{stream:!0})).split("\n");for(let a of(d=g.pop()||"",g)){let b,c=a.trim();if(!c)continue;try{b=JSON.parse(c)}catch{continue}if(b.done){e=b.summary;continue}let d=String(b.model||"").split("/").pop();d&&(az(a=>({...a,[d]:b.ok?"ok":"error"})),aM(a=>a?{...a,done:a.done+1}:a))}}if(e){let{passed:a,failed:b,total:c}=e;0===b?aG.success(`All ${c} models passed`):aG.warning(`${a}/${c} models passed, ${b} failed`)}}catch(a){aB(a?.message||"Batch test failed")}finally{aK(!1),aM(null)}}};if(v)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(m.Qv,{}),(0,d.jsx)(m.Qv,{})]});if(!bG)return(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(j(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let cB=()=>bR&&bG.apiType?"responses"===bG.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bS?"/providers/anthropic-m.png":(0,l.HY)(bG.id);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(j(),{href:"/dashboard/providers",className:"btn-quiet -ml-2 mb-4 !px-2 !py-1.5 !text-xs inline-flex",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"arrow_back"}),"Back to providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col justify-between gap-4 sm:flex-row sm:items-start",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-3.5 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl border border-line",style:{backgroundColor:`${bG.color}15`},children:aw||!cB()?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bG.color},children:bG.textIcon||bG.id.slice(0,2).toUpperCase()}):(0,d.jsx)(k.A,{src:cB(),alt:bG.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,l.Kw)(bG.id),ax(!0)},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-[-0.035em] sm:text-3xl",children:bG.name}),t.length>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-success/25 bg-success/10 px-2 py-1 font-mono text-[9px] text-success",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-success","aria-hidden":"true"}),t.length," Connected"]}):(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-line-strong bg-surface-2 px-2 py-1 font-mono text-[9px] text-muted",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted","aria-hidden":"true"}),"Not connected"]})]}),(bG.notice?.apiKeyUrl||bG.notice?.signupUrl||bG.website)&&(0,d.jsxs)("a",{href:bG.notice?.apiKeyUrl||bG.notice?.signupUrl||bG.website,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-gold-text hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"open_in_new"}),bG.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,d.jsxs)("p",{className:"muted mt-1 text-xs",children:[t.length," connection",1===t.length?"":"s"," \xb7 local workspace"]})]})]}),(0,d.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:bF,className:"btn-gold !px-3 !py-2.5 !text-xs",children:bU?"Connect Session":bT?"Add API Key":"Add connection"})})]})]}),(0,d.jsxs)("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Provider summary",children:[(0,d.jsx)(ad,{label:"Connections",value:String(t.length),icon:"key",tone:t.length>0?"text-success":"text-muted"}),(0,d.jsx)(ad,{label:"Models",value:(a=[...bP,...bd.filter(a=>!bP.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}).length)>0?String(a):"—",icon:"memory",tone:"text-[#5d98e8]"}),(0,d.jsx)(ad,{label:"Status",value:t.length>0?"Connected":"Not connected",icon:"activity",tone:t.length>0?"text-success":"text-muted"}),(0,d.jsx)(ad,{label:"Endpoint",value:bG.website?new URL(bG.website).hostname:r,icon:"dns",tone:"text-gold-text"})]}),bG.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bG.deprecationNotice})]}),bG.notice?.text&&!bG.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bG.notice.text}),bG.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bG.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 →"})]}),bT&&x&&(0,d.jsx)(m.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bS?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bS?"Messages API":"responses"===x.apiType?"Responses API":"Chat Completions"," \xb7 ",(x.baseUrl||"").replace(/\/$/,""),"/",bS?"messages":"responses"===x.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:()=>{af(""),Z(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>an(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{bi({title:"Delete Compatible Node",message:`Delete this ${bS?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{bi(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&q.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bK?(0,d.jsx)(m.gw,{providerId:r}):(0,d.jsxs)(m.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:"Connections"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:"Credentials and endpoints used by this provider."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[t.length>0&&E.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>ap(!0),children:"Apply Proxy"}),t.length>0&&(0,d.jsxs)(d.Fragment,{children:[aP.length>0&&(0,d.jsxs)(m.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=aP.length;0!==a&&bi({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{bi(null);let a=0,b=[...aP];for(let c of b)try{(await fetch(`/api/providers/${c}`,{method:"DELETE"})).ok||(a+=1)}catch(b){console.log("Error deleting connection:",b),a+=1}u(a=>a.filter(a=>!b.includes(a.id))),aQ([]),a>0&&alert(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",aP.length,")"]}),(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:ck,disabled:bl,children:bl?"Testing Connection One-by-One...":"Test Connection One-by-One"}),bl&&(0,d.jsx)(m.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{bl&&(bv.current=!0,bo(!0))},disabled:bn,children:bn?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(m.lM,{checked:"round-robin"===aV,onChange:a=>{let b=a?"round-robin":null,c=a?aX||"1":aX;a&&!aX&&aY("1"),aW(b),ca(b,c)}}),"round-robin"===aV&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aX,onChange:a=>{var b;aY(b=a.target.value),ca("round-robin",b)},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===t.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bI?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bW&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bX," or ",bY,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bW?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bD,children:bX}),(0,d.jsx)(m.$n,{size:"sm",icon:"key",onClick:bE,children:bY})]}):(0,d.jsxs)(d.Fragment,{children:[!bT&&"iflow"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>T(!0),children:"Cookie"}),"codex"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ah(!0),children:(0,D.Tl)("Bulk Add")}),"grok-cli"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>aj(!0),children:(0,D.Tl)("Bulk Add")}),(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:bF,children:bU?"Connect Session":bT?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[bt&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",bt.total]}),(0,d.jsxs)("span",{children:["Completed: ",bt.completed]}),(0,d.jsxs)("span",{children:["Passed: ",bt.passed]}),(0,d.jsxs)("span",{children:["Failed: ",bt.failed]}),bt.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),bl&&bp&&(0,d.jsxs)("span",{children:["Running: ",t.find(a=>a.id===bp)?.name||bp]})]})}),t.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:cs,onChange:()=>{cs?aQ([]):aQ(t.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),cw,!bT&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>T(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ah(!0),title:(0,D.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,D.Tl)("Bulk Add")}),"grok-cli"===r&&(0,d.jsx)(m.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>aj(!0),title:(0,D.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,D.Tl)("Bulk Add")}),bW?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bD,className:"w-full sm:w-auto",children:bX}),(0,d.jsx)(m.$n,{size:"sm",icon:"key",onClick:bE,className:"w-full sm:w-auto",children:bY})]}):(0,d.jsx)(m.$n,{size:"sm",icon:"add",onClick:bF,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsx)($,{providerId:r}),(0,d.jsxs)(m.Zp,{children:[(0,d.jsxs)("div",{className:"flex flex-col justify-between gap-3 sm:flex-row sm:items-start",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:"Available models"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:"Models currently exposed by this provider route. Test sends one real minimal request."})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a7&&(0,d.jsx)("span",{role:"status",className:`max-w-[240px] truncate rounded-lg border px-2 py-1 text-[11px] ${a7.ok?"border-success/25 bg-success/10 text-success":"border-danger/30 bg-danger/10 text-danger"}`,title:a7.text,children:a7.text}),bM&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:a5?"progress_activity":"cloud_download",onClick:()=>void cd(!0),disabled:a5,title:"Fetch the live model list from the provider API (uses your saved key)",className:a5?"[&_.material-symbols-outlined]:animate-spin":"",children:a5?"Fetching…":"Fetch models"}),!bT&&bV.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:aJ?"progress_activity":"bolt",onClick:()=>void cA(),disabled:aJ||0===t.length&&!bK,title:0!==t.length||bK?`Send one real request to each of the ${bV.length} models`:"Add a connection first — a model test needs a credential",className:aJ?"[&_.material-symbols-outlined]:animate-spin":"",children:aJ?`Testing ${aL?`${aL.done}/${aL.total}`:"…"}`:"Test all"}),b_&&(0,d.jsx)("select",{value:aZ,onChange:a=>{var b;a$(b=a.target.value),cb(b)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-line bg-surface px-2 py-1 text-[11px] focus:border-gold focus:outline-none",children:b_.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))}),!bT&&(b=[...bP,...bd.filter(a=>!bP.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}).map(a=>a.id).filter(a=>!bf.includes(a)),(0,d.jsxs)(d.Fragment,{children:[bf.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:b5,children:"Active All"}),b.length>0&&(0,d.jsx)(m.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>b4(b),children:"Disable All"})]}))]})]}),!bT&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,d.jsxs)("label",{className:"relative block flex-1",children:[(0,d.jsx)("span",{className:"sr-only",children:"Search models"}),(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[15px] text-muted","aria-hidden":"true",children:"search"}),(0,d.jsx)("input",{value:aE,onChange:a=>aF(a.target.value),placeholder:"Search models","aria-label":"Search models",className:"input !h-9 !w-full !py-2 !pl-9 !pr-8 !text-xs",autoComplete:"off",spellCheck:!1}),aE&&(0,d.jsx)("button",{type:"button",onClick:()=>aF(""),"aria-label":"Clear model search",title:"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted transition-colors hover:text-text",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]","aria-hidden":"true",children:"close"})})]}),(0,d.jsx)("div",{className:"flex shrink-0 overflow-x-auto rounded-lg border border-line bg-bg-soft p-0.5",role:"tablist","aria-label":"Filter models by test result",children:ab.map(a=>(0,d.jsx)("button",{type:"button",role:"tab","aria-selected":aH===a.value,onClick:()=>aI(a.value),className:`whitespace-nowrap rounded-md px-2.5 py-1.5 text-[10px] font-medium transition-colors ${aH===a.value?"bg-surface text-gold-text shadow-sm":"text-muted hover:text-text"}`,children:a.label},a.value))})]}),!!aA&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:aA}),/RegionError|hosted in China|regionNotAllowed/i.test(aA)&&(f=(c="string"==typeof aA?aA:JSON.stringify(aA)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),g=c.match(/wrk_[0-9A-Za-z]+/),i=f?f[0].endsWith("/go")?f[0]:`${f[0]}/go`:g?`https://opencode.ai/workspace/${g[0]}/go`:"https://opencode.ai",(0,d.jsx)("div",{className:"mt-1.5",children:(0,d.jsxs)("a",{href:i,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,d.jsx)("span",{children:"Allow China-hosted models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===r&&!!bb&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:bb}),(()=>{let a,b,c;if(bT)return(0,d.jsx)(J,{providerStorageAlias:b$,providerDisplayAlias:b0,modelAliases:as,customModels:au,copied:bA,onCopy:bB,onSetAlias:ce,onDeleteAlias:cf,onAddCustomModel:a=>cg(a,"llm",b$),onDeleteCustomModel:a=>ch(a,"llm",b$),connections:t,isAnthropic:bS});let e=[...bP,...bd.filter(a=>!bP.some(b=>b.id===a.id))].filter(a=>{let b=(0,o.CP)(a);return!b||"llm"===b}),f=new Set(bf),g=aE.trim().toLowerCase(),h=a=>!g||a.id.toLowerCase().includes(g)||(a.name||"").toLowerCase().includes(g),i=a=>{if("all"===aH)return!0;let b=ay[a.id];return"untested"===aH?!b:"passed"===aH?"ok"===b:"failed"!==aH||"error"===b},j=e.filter(a=>!f.has(a.id)&&h(a)&&i(a)),k=e.filter(a=>f.has(a.id)),l=G({customModels:au,modelAliases:as,providerAlias:b$,builtInModels:bP,type:"llm"}).filter(a=>h({id:a.id,name:a.name})&&i({id:a.id}));return(0,d.jsxs)("div",{className:"group/model-list space-y-2",children:[0===l.length&&0===j.length&&(0,d.jsxs)("div",{className:"rounded-xl border border-dashed border-line-strong px-5 py-9 text-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mx-auto text-[24px] text-muted","aria-hidden":"true",children:"memory"}),(0,d.jsx)("p",{className:"mt-3 text-sm font-semibold",children:aE.trim()||"all"!==aH?"No matching models":"No models discovered"}),(0,d.jsx)("p",{className:"muted mt-1 text-xs",children:aE.trim()||"all"!==aH?"Try a different search or filter.":"Connect the provider or add a custom model ID below."})]}),l.map(a=>(0,d.jsx)(H,{model:{id:a.id,name:a.name},fullModel:`${b0}/${a.id}`,alias:a.alias,copied:bA,onCopy:bB,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?ch(a.id,"llm",b$):cf(a.alias)},testStatus:ay[a.id],onTest:t.length>0||bK?()=>cz(a.id):void 0,isTesting:aC.has(a.id),isCustom:"fetch"!==a.origin,isFree:!1,caps:s(`${r}/${a.id}`),thinkingSuffix:bZ(a.id)},`${a.source}-${a.fullModel}`)),j.map(a=>{let b=`${b$}/${a.id}`,c=`${r}/${a.id}`,e=Object.entries(as).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(H,{model:a,fullModel:`${b0}/${a.id}`,alias:e,copied:bA,onCopy:bB,onSetAlias:b=>ce(a.id,b,b$),onDeleteAlias:()=>cf(e),testStatus:ay[a.id],onTest:t.length>0||bK?()=>cz(a.id):void 0,isTesting:aC.has(a.id),isFree:a.isFree,onDisable:()=>b2(a.id),caps:s(`${r}/${a.id}`),thinkingSuffix:bZ(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>aO(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-gold/40 px-3 py-2 text-xs font-medium text-gold-text transition-colors hover:border-gold hover:bg-gold-soft sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"add"}),"Add Model"]}),("qoder"===r||"qoder-cn"===r)&&t.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:ci,disabled:bw,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bw?{animation:"spin 1s linear infinite"}:void 0,children:bw?"progress_activity":"download"}),bw?(0,D.Tl)("Fetching..."):(0,D.Tl)("Fetch Qoder Models")]}),("cline"===r||"clinepass"===r)&&t.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:cj,disabled:by,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:by?{animation:"spin 1s linear infinite"}:void 0,children:by?"progress_activity":"download"}),by?(0,D.Tl)("Fetching..."):(0,D.Tl)("Import from /models")]}),a3.length>0&&(a=new Set([...Object.values(as),...l.map(a=>a.fullModel)]),b=new Set(bP.map(a=>a.id)),0===(c=a3.filter(c=>!a.has(`${b$}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested models from the provider API:"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await cg(a.id,"llm",b$)},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:a.contextLength?`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`:a.name||a.id,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),k.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",k.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:k.map(a=>(0,d.jsxs)("button",{onClick:()=>b3(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),!bT&&bV.length>0&&(0,d.jsx)(m.Zp,{children:(0,d.jsx)(m.Tt,{providerId:r,providerName:bG?.name||r,models:bV,defaultModel:bV[0],connections:t})}),cy,"kiro"===r?(0,d.jsx)(m.Mh,{isOpen:K,providerInfo:bG,onSuccess:cm,onClose:()=>L(!1)}):"cursor"===r?(0,d.jsx)(m.G9,{isOpen:K,onSuccess:cm,onClose:()=>L(!1)}):"zed"===r?(0,d.jsx)(m.TE,{isOpen:K,providerInfo:bG,onSuccess:cm,onClose:()=>L(!1)}):"gitlab"===r?(0,d.jsx)(m.vj,{isOpen:K,providerInfo:bG,onSuccess:cm,onClose:()=>L(!1)}):"tokenharbor"===r?(0,d.jsx)(m.O1,{isOpen:K,providerInfo:bG,onSuccess:cm,onClose:()=>L(!1)}):(0,d.jsx)(m.LF,{isOpen:K,provider:r,providerInfo:bG,onSuccess:cm,onClose:()=>L(!1)}),(0,d.jsx)(m.LH,{isOpen:M,onSuccess:cm,onClose:()=>O(!1)}),"iflow"===r&&(0,d.jsx)(m.vE,{isOpen:R,onSuccess:()=>{b8(),T(!1)},onClose:()=>T(!1)}),bU&&(0,d.jsx)(m.Sg,{isOpen:V,providerId:r,onSuccess:cm,onClose:()=>W(!1)}),(0,d.jsx)(P,{isOpen:Y,provider:r,providerName:bG.name,isCompatible:bT,isAnthropic:bS,authType:bG?.authType,authHint:bG?.authHint,website:bG?.website,proxyPools:E,error:ae,existingNames:t.map(a=>a.name).filter(Boolean),onSave:cn,onBulkDone:b8,onClose:()=>{af(""),Z(!1)}}),(0,d.jsx)(m.wI,{isOpen:ak,connection:aq,proxyPools:E,onSave:co,onClose:()=>al(!1)}),bT&&(0,d.jsx)(Q,{isOpen:am,node:x,onSave:b9,onClose:()=>an(!1),isAnthropic:bS}),!bT&&(0,d.jsx)(S,{isOpen:aN,providerAlias:b$,providerDisplayAlias:b0,onSave:async(a,b,c)=>{await cg(a,b?.stt?"stt":"llm",b$,b,c),aO(!1)},onClose:()=>aO(!1)}),"codex"===r&&(0,d.jsx)(U,{isOpen:ag,onClose:()=>ah(!1),onSuccess:b8}),"grok-cli"===r&&(0,d.jsx)(X,{isOpen:ai,onClose:()=>aj(!1),onSuccess:b8}),a1&&(0,d.jsx)(_.A,{isOpen:!!a1,onClose:()=>a2(null),connection:a1,reactive:!0===a_.connections[a1.id],schedule:a_.schedules?.[a1.id]||null,onSave:a=>((a,{reactive:b,schedule:c})=>{cc({...a_,connections:{...a_.connections,[a]:b},schedules:{...a_.schedules,[a]:c}})})(a1.id,a)}),(0,d.jsx)(m.uo,{isOpen:bj,onClose:()=>bk(!1),onConfirm:()=>{(bk(!1),bI)?bC():bE()},title:"Risk Notice",message:bG?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(m.uo,{isOpen:!!bh,onClose:()=>bi(null),onConfirm:bh?.onConfirm,title:bh?.title||"Confirm",message:bh?.message,variant:"danger"})]})}ad.propTypes={label:g().string.isRequired,value:g().string.isRequired,icon:g().string.isRequired,tone:g().string}},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},18053:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>y,handler:()=>A,routeModule:()=>z});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,57529))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.bind(c,56965))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),w={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[v,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},[]]},{error:[s,"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/error.js"],"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/gin/work/Hilbras/OmniHilbras/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,x=(0,e.H)({tree:w,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),y=x.__next_app__,z=x.routeModule,A=x.handler},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},26915:a=>{"use strict";a.exports=import("playwright-core")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30714:a=>{"use strict";a.exports=require("node:vm")},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},42272:(a,b,c)=>{Promise.resolve().then(c.bind(c,14812))},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},72271:a=>{"use strict";a.exports=require("@aws-sdk/credential-providers")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},78720:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1260,2430,3031,2116,2712,4785,3817,6070,1329,915,6457,4123,3799,6777,412,3390],()=>b(b.s=18053));module.exports=c})();