@rsalmn/extremerouter 0.8.7 → 0.8.8

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 (1027) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +15 -13
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/routes-manifest.json +14 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +3 -3
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +3 -3
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +2 -2
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/smart-routing/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  94. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  105. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  108. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  109. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  110. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
  112. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  114. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  115. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/breaker/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/breaker/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  136. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  142. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  148. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  150. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  152. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  154. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  156. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  160. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  162. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  164. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  166. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  168. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/combos/lab/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/lab/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/combos/simulate/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/combos/simulate/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js +2 -2
  180. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +2 -2
  186. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/health/overview/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/health/overview/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  194. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +3 -3
  206. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  240. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/freebuff/import/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/zcode/import/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/oauth/zcode/import/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  274. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route.js +2 -2
  288. package/app/.next-cli-build/server/app/api/providers/[id]/felo-profile/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +2 -2
  296. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/providers/[id]/zai-profile/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/providers/capture/launch/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/providers/capture/launch/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/providers/capture/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/providers/capture/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/providers/felo-capture/launch/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/providers/felo-capture/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/providers/felo-capture/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  342. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  344. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  348. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  350. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/smart-routing/active/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/smart-routing/active/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/smart-routing/history/route.js +2 -2
  366. package/app/.next-cli-build/server/app/api/smart-routing/history/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/smart-routing/lab/route.js +2 -2
  368. package/app/.next-cli-build/server/app/api/smart-routing/lab/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/smart-routing/stream/route.js +2 -2
  370. package/app/.next-cli-build/server/app/api/smart-routing/stream/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +2 -2
  374. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  380. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  402. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  428. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  442. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/api/v1/media/results/[id]/route.js +1 -0
  444. package/app/.next-cli-build/server/app/api/v1/media/results/[id]/route.js.nft.json +1 -0
  445. package/app/.next-cli-build/server/app/api/v1/media/results/[id]/route_client-reference-manifest.js +1 -0
  446. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  447. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  448. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  449. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  450. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  451. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  452. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  453. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  454. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  455. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  456. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  457. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  458. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  459. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  460. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  461. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  462. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  463. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  464. package/app/.next-cli-build/server/app/api/v1/video/generations/route.js +1 -0
  465. package/app/.next-cli-build/server/app/api/v1/video/generations/route.js.nft.json +1 -0
  466. package/app/.next-cli-build/server/app/api/v1/video/generations/route_client-reference-manifest.js +1 -0
  467. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  468. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  469. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  470. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  471. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  472. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  473. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  474. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  475. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  476. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  478. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  479. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  480. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  481. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  482. package/app/.next-cli-build/server/app/callback.html +1 -1
  483. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  484. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  485. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  486. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
  487. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  488. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  489. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  491. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +7 -7
  495. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
  496. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
  498. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  501. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  503. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  504. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  505. package/app/.next-cli-build/server/app/index.html +1 -1
  506. package/app/.next-cli-build/server/app/index.rsc +6 -6
  507. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  509. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
  511. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  512. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  513. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  514. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  515. package/app/.next-cli-build/server/app/landing.html +1 -1
  516. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  517. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  518. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
  520. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/login/page.js +2 -2
  524. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  525. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  526. package/app/.next-cli-build/server/app/login.html +1 -1
  527. package/app/.next-cli-build/server/app/login.rsc +7 -7
  528. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  529. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
  531. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  532. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  534. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  535. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  536. package/app/.next-cli-build/server/app/page.js +2 -2
  537. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  538. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  539. package/app/.next-cli-build/server/app-paths-manifest.json +15 -13
  540. package/app/.next-cli-build/server/chunks/1194.js +1 -1
  541. package/app/.next-cli-build/server/chunks/1350.js +3 -3
  542. package/app/.next-cli-build/server/chunks/1411.js +1 -1
  543. package/app/.next-cli-build/server/chunks/1429.js +1 -1
  544. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  545. package/app/.next-cli-build/server/chunks/212.js +1 -1
  546. package/app/.next-cli-build/server/chunks/2436.js +1 -0
  547. package/app/.next-cli-build/server/chunks/3520.js +1 -1
  548. package/app/.next-cli-build/server/chunks/3552.js +1 -1
  549. package/app/.next-cli-build/server/chunks/4046.js +1 -1
  550. package/app/.next-cli-build/server/chunks/412.js +1 -1
  551. package/app/.next-cli-build/server/chunks/4161.js +1 -0
  552. package/app/.next-cli-build/server/chunks/4502.js +6 -6
  553. package/app/.next-cli-build/server/chunks/4828.js +1 -0
  554. package/app/.next-cli-build/server/chunks/{3841.js → 4987.js} +1 -1
  555. package/app/.next-cli-build/server/chunks/5050.js +2 -2
  556. package/app/.next-cli-build/server/chunks/5253.js +1 -1
  557. package/app/.next-cli-build/server/chunks/5330.js +9 -9
  558. package/app/.next-cli-build/server/chunks/5473.js +1 -1
  559. package/app/.next-cli-build/server/chunks/5604.js +1 -1
  560. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  561. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  562. package/app/.next-cli-build/server/chunks/5628.js +1 -1
  563. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  564. package/app/.next-cli-build/server/chunks/6007.js +10 -0
  565. package/app/.next-cli-build/server/chunks/6157.js +1 -0
  566. package/app/.next-cli-build/server/chunks/6182.js +1 -1
  567. package/app/.next-cli-build/server/chunks/6488.js +1 -1
  568. package/app/.next-cli-build/server/chunks/6777.js +1 -1
  569. package/app/.next-cli-build/server/chunks/7247.js +1 -0
  570. package/app/.next-cli-build/server/chunks/7765.js +2 -2
  571. package/app/.next-cli-build/server/chunks/809.js +1 -1
  572. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  573. package/app/.next-cli-build/server/chunks/8240.js +1 -0
  574. package/app/.next-cli-build/server/chunks/8266.js +1 -1
  575. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  576. package/app/.next-cli-build/server/chunks/8802.js +2 -2
  577. package/app/.next-cli-build/server/chunks/885.js +7 -7
  578. package/app/.next-cli-build/server/chunks/8851.js +3 -0
  579. package/app/.next-cli-build/server/chunks/8895.js +6 -6
  580. package/app/.next-cli-build/server/chunks/9715.js +1 -0
  581. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  582. package/app/.next-cli-build/server/middleware.js +3 -3
  583. package/app/.next-cli-build/server/pages/404.html +1 -1
  584. package/app/.next-cli-build/server/pages/500.html +1 -1
  585. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  586. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  587. package/app/.next-cli-build/static/chunks/1321-738b3efba6f43f03.js +1 -0
  588. package/app/.next-cli-build/static/chunks/5497-97801e653d366579.js +7 -0
  589. package/app/.next-cli-build/static/chunks/705-1b66113f1f9bdd89.js +1 -0
  590. package/app/.next-cli-build/static/chunks/9086-5e0c8ccb81f25cbb.js +1 -0
  591. package/app/.next-cli-build/static/chunks/{9622-d0f22be4f1ef8011.js → 9622-1dc5485471326b33.js} +1 -1
  592. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/alerts/{page-3527fe022102a692.js → page-5da9d88aea0f0c4d.js} +1 -1
  593. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-fe59538aa4add719.js → page-af18b8bd5a604e31.js} +1 -1
  594. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-1849f671db0f9fe9.js → page-c933ec2b61961be3.js} +1 -1
  595. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-0e903eb34158c8a8.js → page-3b6ddb5ae1f382fc.js} +1 -1
  596. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-8406e79b31e512bb.js → page-6e960c6e7b31b9df.js} +1 -1
  597. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-81ef4c324f201832.js → page-dd4edb101f50cc0f.js} +1 -1
  598. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-f1add2aaae4a459c.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/health/{page-d71cb9f910cb5d13.js → page-2ac0245eea32c9aa.js} +1 -1
  600. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-94341b277cf27462.js → page-e0b2567bb9fe606d.js} +7 -7
  601. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-558f5601f8df1d4d.js → page-9da68f29ab52796d.js} +1 -1
  602. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-6effc5c0f2b1d72e.js → page-2c80d26d992e4bb2.js} +1 -1
  603. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/page-7cdd74503baa001a.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-95375c7b40f99306.js → page-ebc169fccd95e5d8.js} +1 -1
  605. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-4549c187375b9192.js → page-50b3f8c8ed3358f2.js} +1 -1
  606. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/{page-bb459e518dfa9f70.js → page-c4728000c2a09214.js} +1 -1
  607. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-86eaf12ef68c60ba.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/{page-625485e32264e15b.js → page-c43d594bf432dbb3.js} +1 -1
  609. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-09b1b5beae8435cd.js → page-8147c101767a32a1.js} +1 -1
  610. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-776433cfd87f123a.js → page-f20fce2b984f4ef3.js} +1 -1
  611. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-1f67fe5d69805df2.js → page-99b2fb0411fa61e4.js} +1 -1
  612. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-5d9d7d47216375ea.js → page-3231355c17df9913.js} +1 -1
  613. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-c561cab29785310a.js → page-c619835a47dd125d.js} +1 -1
  614. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-140fef4b235b4792.js → page-46f5c7b65b5bb9ad.js} +1 -1
  615. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-acf6cde3210c179a.js → page-fb7fe2c2ce8ee710.js} +1 -1
  616. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-c3ae0ab7f0d0634d.js → page-971ad40322c4940b.js} +1 -1
  617. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-cb12854a23416b01.js → page-33f472a9351a93f8.js} +1 -1
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-52a5ff6e854d82e7.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-66efb163e888cd6b.js → layout-6605206f3a2e2db9.js} +1 -1
  620. package/app/.next-cli-build/static/chunks/app/_global-error/page-fe046df355b8d174.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-fe046df355b8d174.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-fe046df355b8d174.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-fe046df355b8d174.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-fe046df355b8d174.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-fe046df355b8d174.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-fe046df355b8d174.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-fe046df355b8d174.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-fe046df355b8d174.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/breaker/route-fe046df355b8d174.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/cache/route-fe046df355b8d174.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-fe046df355b8d174.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-fe046df355b8d174.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-fe046df355b8d174.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-fe046df355b8d174.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-fe046df355b8d174.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-fe046df355b8d174.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-fe046df355b8d174.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-fe046df355b8d174.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-fe046df355b8d174.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-fe046df355b8d174.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-fe046df355b8d174.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-fe046df355b8d174.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-fe046df355b8d174.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-fe046df355b8d174.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-fe046df355b8d174.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-fe046df355b8d174.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-fe046df355b8d174.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-fe046df355b8d174.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/combos/lab/route-fe046df355b8d174.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/combos/route-fe046df355b8d174.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/combos/simulate/route-fe046df355b8d174.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-fe046df355b8d174.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-fe046df355b8d174.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-fe046df355b8d174.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-fe046df355b8d174.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-fe046df355b8d174.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/health/overview/route-fe046df355b8d174.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-fe046df355b8d174.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/health/route-fe046df355b8d174.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-fe046df355b8d174.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/init/route-fe046df355b8d174.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-fe046df355b8d174.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/keys/route-fe046df355b8d174.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/locale/route-fe046df355b8d174.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-fe046df355b8d174.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-fe046df355b8d174.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-fe046df355b8d174.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-fe046df355b8d174.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-fe046df355b8d174.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-fe046df355b8d174.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-fe046df355b8d174.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-fe046df355b8d174.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-fe046df355b8d174.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-fe046df355b8d174.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-fe046df355b8d174.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-fe046df355b8d174.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/models/route-fe046df355b8d174.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/models/test/route-fe046df355b8d174.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-fe046df355b8d174.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-fe046df355b8d174.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-fe046df355b8d174.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-fe046df355b8d174.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-fe046df355b8d174.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-fe046df355b8d174.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/oauth/freebuff/import/route-fe046df355b8d174.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-fe046df355b8d174.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-fe046df355b8d174.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-fe046df355b8d174.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-fe046df355b8d174.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-fe046df355b8d174.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-fe046df355b8d174.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-fe046df355b8d174.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-fe046df355b8d174.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-fe046df355b8d174.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-fe046df355b8d174.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-fe046df355b8d174.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-fe046df355b8d174.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-fe046df355b8d174.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/oauth/zcode/import/route-fe046df355b8d174.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-fe046df355b8d174.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-fe046df355b8d174.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/pricing/route-fe046df355b8d174.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-fe046df355b8d174.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-fe046df355b8d174.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-fe046df355b8d174.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-fe046df355b8d174.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/felo-profile/route-fe046df355b8d174.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-fe046df355b8d174.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-fe046df355b8d174.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-fe046df355b8d174.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-fe046df355b8d174.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-fe046df355b8d174.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-fe046df355b8d174.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-fe046df355b8d174.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-fe046df355b8d174.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-fe046df355b8d174.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-fe046df355b8d174.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-fe046df355b8d174.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-fe046df355b8d174.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zai-profile/route-fe046df355b8d174.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-fe046df355b8d174.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/providers/capture/launch/route-fe046df355b8d174.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/providers/capture/route-fe046df355b8d174.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-fe046df355b8d174.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/launch/route-fe046df355b8d174.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/route-fe046df355b8d174.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-fe046df355b8d174.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/providers/route-fe046df355b8d174.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-fe046df355b8d174.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-fe046df355b8d174.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-fe046df355b8d174.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-fe046df355b8d174.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-fe046df355b8d174.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-fe046df355b8d174.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-fe046df355b8d174.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-fe046df355b8d174.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-fe046df355b8d174.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-fe046df355b8d174.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-fe046df355b8d174.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-fe046df355b8d174.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-fe046df355b8d174.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-fe046df355b8d174.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/settings/route-fe046df355b8d174.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-fe046df355b8d174.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/smart-routing/active/route-fe046df355b8d174.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/smart-routing/history/route-fe046df355b8d174.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/smart-routing/lab/route-fe046df355b8d174.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/smart-routing/stream/route-fe046df355b8d174.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-fe046df355b8d174.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-fe046df355b8d174.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/tags/route-fe046df355b8d174.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-fe046df355b8d174.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-fe046df355b8d174.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-fe046df355b8d174.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-fe046df355b8d174.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-fe046df355b8d174.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-fe046df355b8d174.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-fe046df355b8d174.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-fe046df355b8d174.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-fe046df355b8d174.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-fe046df355b8d174.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-fe046df355b8d174.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-fe046df355b8d174.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-fe046df355b8d174.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-fe046df355b8d174.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-fe046df355b8d174.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-fe046df355b8d174.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-fe046df355b8d174.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-fe046df355b8d174.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-fe046df355b8d174.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-fe046df355b8d174.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-fe046df355b8d174.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-fe046df355b8d174.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-fe046df355b8d174.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-fe046df355b8d174.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-fe046df355b8d174.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-fe046df355b8d174.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-fe046df355b8d174.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-fe046df355b8d174.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-fe046df355b8d174.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-fe046df355b8d174.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-fe046df355b8d174.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-fe046df355b8d174.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-fe046df355b8d174.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/v1/media/results/[id]/route-fe046df355b8d174.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-fe046df355b8d174.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-fe046df355b8d174.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-fe046df355b8d174.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-fe046df355b8d174.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-fe046df355b8d174.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-fe046df355b8d174.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-fe046df355b8d174.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/v1/route-fe046df355b8d174.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-fe046df355b8d174.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/v1/video/generations/route-fe046df355b8d174.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-fe046df355b8d174.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-fe046df355b8d174.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-fe046df355b8d174.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/version/route-fe046df355b8d174.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-fe046df355b8d174.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/version/update/route-fe046df355b8d174.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/{page-baf12d16760e9b90.js → page-cb505396f61fd853.js} +1 -1
  803. package/app/.next-cli-build/static/chunks/app/{layout-155acd4a482252b8.js → layout-43c49c1c04131398.js} +1 -1
  804. package/app/.next-cli-build/static/chunks/app/login/{page-089f2be5081e9c05.js → page-783218bde9da4df5.js} +1 -1
  805. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-fe046df355b8d174.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/page-fe046df355b8d174.js +1 -0
  807. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-fe046df355b8d174.js +1 -0
  808. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-fe046df355b8d174.js +1 -0
  809. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-fe046df355b8d174.js +1 -0
  810. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-fe046df355b8d174.js +1 -0
  811. package/app/.next-cli-build/static/css/4311ce5e9ab1213e.css +1 -0
  812. package/app/.next-cli-build/static/zahf-uMWnrDSCrrfcee0d/_buildManifest.js +1 -0
  813. package/app/package.json +1 -1
  814. package/app/public/favicon.svg +70 -8
  815. package/app/public/icons/icon-192.svg +73 -3
  816. package/app/public/icons/icon-512.svg +72 -3
  817. package/app/public/providers/xkiro.svg +11 -0
  818. package/app/public/vercel.svg +73 -1
  819. package/app/src/mitm/server.js +27 -27
  820. package/package.json +1 -1
  821. package/src/cli/tray/icon.ico +0 -0
  822. package/src/cli/tray/icon.png +0 -0
  823. package/app/.next-cli-build/server/chunks/1891.js +0 -10
  824. package/app/.next-cli-build/server/chunks/3735.js +0 -1
  825. package/app/.next-cli-build/server/chunks/5699.js +0 -1
  826. package/app/.next-cli-build/server/chunks/6878.js +0 -1
  827. package/app/.next-cli-build/server/chunks/7016.js +0 -3
  828. package/app/.next-cli-build/server/chunks/7410.js +0 -1
  829. package/app/.next-cli-build/server/chunks/7815.js +0 -1
  830. package/app/.next-cli-build/server/chunks/8048.js +0 -1
  831. package/app/.next-cli-build/static/BmLJ5bmQbpsF-jvZIwr9t/_buildManifest.js +0 -1
  832. package/app/.next-cli-build/static/chunks/1321-184fe0dd34faf680.js +0 -1
  833. package/app/.next-cli-build/static/chunks/2563-a547c8ef699e1791.js +0 -1
  834. package/app/.next-cli-build/static/chunks/5497-9caed03337b37e47.js +0 -7
  835. package/app/.next-cli-build/static/chunks/705-eaa2de0fd5964be4.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-72670cb4cac6b97d.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/page-05b05e6f6136829d.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-cc5141ff81040e89.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-55b0738c2d201462.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/_global-error/page-bf747ebfcd7e601c.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-bf747ebfcd7e601c.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-bf747ebfcd7e601c.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-bf747ebfcd7e601c.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-bf747ebfcd7e601c.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-bf747ebfcd7e601c.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-bf747ebfcd7e601c.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-bf747ebfcd7e601c.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-bf747ebfcd7e601c.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/breaker/route-bf747ebfcd7e601c.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/cache/route-bf747ebfcd7e601c.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-bf747ebfcd7e601c.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-bf747ebfcd7e601c.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-bf747ebfcd7e601c.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-bf747ebfcd7e601c.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-bf747ebfcd7e601c.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-bf747ebfcd7e601c.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-bf747ebfcd7e601c.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-bf747ebfcd7e601c.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-bf747ebfcd7e601c.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-bf747ebfcd7e601c.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-bf747ebfcd7e601c.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-bf747ebfcd7e601c.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-bf747ebfcd7e601c.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-bf747ebfcd7e601c.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-bf747ebfcd7e601c.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-bf747ebfcd7e601c.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-bf747ebfcd7e601c.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-bf747ebfcd7e601c.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/combos/lab/route-bf747ebfcd7e601c.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/combos/route-bf747ebfcd7e601c.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/combos/simulate/route-bf747ebfcd7e601c.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-bf747ebfcd7e601c.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-bf747ebfcd7e601c.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-bf747ebfcd7e601c.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-bf747ebfcd7e601c.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-bf747ebfcd7e601c.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/health/overview/route-bf747ebfcd7e601c.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-bf747ebfcd7e601c.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/health/route-bf747ebfcd7e601c.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-bf747ebfcd7e601c.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/init/route-bf747ebfcd7e601c.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-bf747ebfcd7e601c.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/keys/route-bf747ebfcd7e601c.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/locale/route-bf747ebfcd7e601c.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-bf747ebfcd7e601c.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-bf747ebfcd7e601c.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-bf747ebfcd7e601c.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-bf747ebfcd7e601c.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-bf747ebfcd7e601c.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-bf747ebfcd7e601c.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-bf747ebfcd7e601c.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-bf747ebfcd7e601c.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-bf747ebfcd7e601c.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-bf747ebfcd7e601c.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-bf747ebfcd7e601c.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-bf747ebfcd7e601c.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/models/route-bf747ebfcd7e601c.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/models/test/route-bf747ebfcd7e601c.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-bf747ebfcd7e601c.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-bf747ebfcd7e601c.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-bf747ebfcd7e601c.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-bf747ebfcd7e601c.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-bf747ebfcd7e601c.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-bf747ebfcd7e601c.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/oauth/freebuff/import/route-bf747ebfcd7e601c.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-bf747ebfcd7e601c.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-bf747ebfcd7e601c.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-bf747ebfcd7e601c.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-bf747ebfcd7e601c.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-bf747ebfcd7e601c.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-bf747ebfcd7e601c.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-bf747ebfcd7e601c.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-bf747ebfcd7e601c.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-bf747ebfcd7e601c.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-bf747ebfcd7e601c.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-bf747ebfcd7e601c.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-bf747ebfcd7e601c.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-bf747ebfcd7e601c.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/oauth/zcode/import/route-bf747ebfcd7e601c.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-bf747ebfcd7e601c.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-bf747ebfcd7e601c.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/pricing/route-bf747ebfcd7e601c.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-bf747ebfcd7e601c.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-bf747ebfcd7e601c.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-bf747ebfcd7e601c.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-bf747ebfcd7e601c.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/felo-profile/route-bf747ebfcd7e601c.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-bf747ebfcd7e601c.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-bf747ebfcd7e601c.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-bf747ebfcd7e601c.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-bf747ebfcd7e601c.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-bf747ebfcd7e601c.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-bf747ebfcd7e601c.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-bf747ebfcd7e601c.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-bf747ebfcd7e601c.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-bf747ebfcd7e601c.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-bf747ebfcd7e601c.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-bf747ebfcd7e601c.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-bf747ebfcd7e601c.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zai-profile/route-bf747ebfcd7e601c.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-bf747ebfcd7e601c.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/providers/capture/launch/route-bf747ebfcd7e601c.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/providers/capture/route-bf747ebfcd7e601c.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-bf747ebfcd7e601c.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/launch/route-bf747ebfcd7e601c.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/providers/felo-capture/route-bf747ebfcd7e601c.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-bf747ebfcd7e601c.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/providers/route-bf747ebfcd7e601c.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-bf747ebfcd7e601c.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-bf747ebfcd7e601c.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-bf747ebfcd7e601c.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-bf747ebfcd7e601c.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-bf747ebfcd7e601c.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-bf747ebfcd7e601c.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-bf747ebfcd7e601c.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-bf747ebfcd7e601c.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-bf747ebfcd7e601c.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-bf747ebfcd7e601c.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-bf747ebfcd7e601c.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-bf747ebfcd7e601c.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-bf747ebfcd7e601c.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-bf747ebfcd7e601c.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/settings/route-bf747ebfcd7e601c.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-bf747ebfcd7e601c.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/smart-routing/active/route-bf747ebfcd7e601c.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/smart-routing/history/route-bf747ebfcd7e601c.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/smart-routing/lab/route-bf747ebfcd7e601c.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/smart-routing/stream/route-bf747ebfcd7e601c.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-bf747ebfcd7e601c.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-bf747ebfcd7e601c.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/tags/route-bf747ebfcd7e601c.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-bf747ebfcd7e601c.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-bf747ebfcd7e601c.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-bf747ebfcd7e601c.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-bf747ebfcd7e601c.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-bf747ebfcd7e601c.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-bf747ebfcd7e601c.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-bf747ebfcd7e601c.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-bf747ebfcd7e601c.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-bf747ebfcd7e601c.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-bf747ebfcd7e601c.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-bf747ebfcd7e601c.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-bf747ebfcd7e601c.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-bf747ebfcd7e601c.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-bf747ebfcd7e601c.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-bf747ebfcd7e601c.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-bf747ebfcd7e601c.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-bf747ebfcd7e601c.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-bf747ebfcd7e601c.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-bf747ebfcd7e601c.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-bf747ebfcd7e601c.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-bf747ebfcd7e601c.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-bf747ebfcd7e601c.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-bf747ebfcd7e601c.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-bf747ebfcd7e601c.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-bf747ebfcd7e601c.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-bf747ebfcd7e601c.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-bf747ebfcd7e601c.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-bf747ebfcd7e601c.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-bf747ebfcd7e601c.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-bf747ebfcd7e601c.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-bf747ebfcd7e601c.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-bf747ebfcd7e601c.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-bf747ebfcd7e601c.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-bf747ebfcd7e601c.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-bf747ebfcd7e601c.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-bf747ebfcd7e601c.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-bf747ebfcd7e601c.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-bf747ebfcd7e601c.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-bf747ebfcd7e601c.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-bf747ebfcd7e601c.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/v1/route-bf747ebfcd7e601c.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-bf747ebfcd7e601c.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-bf747ebfcd7e601c.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-bf747ebfcd7e601c.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-bf747ebfcd7e601c.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/version/route-bf747ebfcd7e601c.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-bf747ebfcd7e601c.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/version/update/route-bf747ebfcd7e601c.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-bf747ebfcd7e601c.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/page-bf747ebfcd7e601c.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-bf747ebfcd7e601c.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-bf747ebfcd7e601c.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-bf747ebfcd7e601c.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-bf747ebfcd7e601c.js +0 -1
  1026. package/app/.next-cli-build/static/css/8a8ea9ee79a01730.css +0 -1
  1027. /package/app/.next-cli-build/static/{BmLJ5bmQbpsF-jvZIwr9t → zahf-uMWnrDSCrrfcee0d}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{4695:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var n=s(95155),r=s(12115),a=s(56061),i=s(99312),l=s(31474),o=s(88105);let c={closed:{label:"Closed",variant:"success"},halfOpen:{label:"Probing",variant:"warning"},open:{label:"Open",variant:"error"}};function d(){let[e,t]=(0,r.useState)([]),[s,d]=(0,r.useState)(!1),u=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/health/overview");if(!e.ok)return;let s=await e.json();t(Array.isArray(s.providers)?s.providers:[]),d(!0)}catch{d(!1)}},[]);return(0,r.useEffect)(()=>{u();let e=setInterval(u,3e3);return()=>clearInterval(e)},[u]),(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,n.jsx)("span",{className:(0,l.cn)("size-2 rounded-full",s?"bg-success animate-pulse":"bg-danger")}),s?"Live \xb7 refreshes every 3s":"Reconnecting…"]}),e.length>0&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-success"})," Healthy"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-warning"})," Degraded"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-danger"})," Unhealthy"]})]})]}),0===e.length?(0,n.jsx)(i.default,{icon:"grid_view",title:"No provider health data",description:"Send a request to any provider (or connect an account) and the heatmap will appear here with success rate, latency percentiles, breaker state, and connection cooldowns."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-panel border border-border-subtle bg-panel shadow-[var(--shadow-soft)]",children:(0,n.jsxs)("table",{className:"w-full min-w-[760px] border-collapse text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border-subtle text-left text-[11px] uppercase tracking-wider text-text-subtle",children:[(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Provider"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Success rate"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"p50"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"p95"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"p99"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Errors"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Breaker"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Connections"})]})}),(0,n.jsx)("tbody",{children:e.map(e=>{var t;let s,r=e.health||{},i=r.successRate??null,d=null!=i?Math.round(100*i):null,u=function(e){if(null==e)return{bg:"transparent",fg:"text-text-subtle"};let t=Math.max(0,Math.min(120,Math.round(120*e)));return{bg:`hsl(${t} 80% 45% / 0.20)`,fg:"text-text-main"}}(i),m=e.breaker?c[e.breaker.state]||c.closed:null,x=e.connections.length>0?`${e.connections.length}${e.lockedConnections>0?` \xb7 ${e.lockedConnections} locked`:""}`:"—",p=e.connections.length>0?e.connections.map(e=>`${e.label}${e.cooldownActive?" (cooldown)":e.testStatus?` (${e.testStatus})`:""}${e.lastError?` — ${e.lastError}`:""}`).join("\n"):"";return(0,n.jsxs)("tr",{className:"border-b border-border-subtle/60 last:border-b-0 hover:bg-surface-2/40",children:[(0,n.jsxs)("td",{className:"px-3 py-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono font-semibold text-text-main",children:(t=e.id,s=o.Q2[t],s?.name?s.name:String(t||"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()))}),e.cooldownActive&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px] text-danger",title:"At least one connection is in cooldown",children:"lock_clock"})]}),(0,n.jsx)("div",{className:"text-[10px] text-text-subtle",children:e.id})]}),(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[52px] rounded-md px-2 py-1 font-mono font-semibold",u.fg),style:{background:u.bg},children:null!=d?`${d}%`:"—"})}),["p50LatencyMs","p95LatencyMs","p99LatencyMs"].map(e=>{let t=r[e],s=function(e,t=15e3){if(null==e)return{bg:"transparent",fg:"text-text-subtle"};let s=Math.max(0,Math.min(120,Math.round((1-Math.min(e/t,1))*120)));return{bg:`hsl(${s} 80% 45% / 0.16)`,fg:"text-text-main"}}(t);return(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[52px] rounded-md px-2 py-1 font-mono",s.fg),style:{background:s.bg},children:null==t?"—":t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`})},e)}),(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[40px] rounded-md px-2 py-1 font-mono font-semibold",r.failures>0?"bg-danger/15 text-danger":"text-text-subtle"),children:r.failures||0})}),(0,n.jsxs)("td",{className:"px-3 py-2 text-center",children:[m?(0,n.jsx)(a.default,{variant:m.variant,dot:!0,size:"sm",children:m.label}):(0,n.jsx)("span",{className:"text-text-subtle",children:"—"}),e.breaker?.state==="open"&&null!=e.breaker.cooldownRemainingMs&&(0,n.jsxs)("div",{className:"mt-0.5 text-[10px] text-text-muted",children:["cooldown ",function(e){if(null==e)return"";let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let s=Math.floor(t/60);return`${s}m ${t%60}s`}(e.breaker.cooldownRemainingMs)]})]}),(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[52px] rounded-md px-2 py-1 font-mono",e.lockedConnections>0?"bg-danger/15 text-danger":"active"===e.worstStatus?"bg-success/15 text-success":"text-text-subtle"),title:p||void 0,children:x})})]},e.id)})})]})})]})}},21316:(e,t,s)=>{Promise.resolve().then(s.bind(s,40208)),Promise.resolve().then(s.bind(s,37466)),Promise.resolve().then(s.bind(s,54960)),Promise.resolve().then(s.bind(s,4695))},31474:(e,t,s)=>{"use strict";function n(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}s.d(t,{cn:()=>n})},37466:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var n=s(95155),r=s(12115),a=s(56061),i=s(99312),l=s(31474),o=s(88105);function c(e){return null==e?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function d(){let[e,t]=(0,r.useState)([]),[s,d]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=new EventSource("/api/health/stream");return e.onopen=()=>d(!0),e.onerror=()=>d(!1),e.onmessage=e=>{try{let s=JSON.parse(e.data);"snapshot"===s.type&&Array.isArray(s.providers)?t(s.providers):s.provider&&t(e=>{let t=e.findIndex(e=>e.provider===s.provider);if(t>=0){let n=[...e];return n[t]=s,n}return[...e,s]})}catch{}},()=>e.close()},[]),(0,n.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,n.jsx)("span",{className:(0,l.cn)("size-2 rounded-full",s?"bg-success animate-pulse":"bg-danger")}),s?"Live":"Reconnecting…"]}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-success"})," Healthy"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-warning"})," Degraded"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-danger"})," Unhealthy"]})]})]}),0===e.length?(0,n.jsx)(i.default,{icon:"monitor_heart",title:"No health data yet",description:"Provider health metrics will appear here once requests flow through the gateway. Send a request to any provider to start collecting samples."}):(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s,r=function(e,t){if(0===t)return{label:"Unknown",variant:"default",color:"text-text-subtle",bar:"bg-text-subtle"};let s=e??0;return s>=.95?{label:"Healthy",variant:"success",color:"text-success",bar:"bg-success"}:s>=.8?{label:"Degraded",variant:"warning",color:"text-warning",bar:"bg-warning"}:{label:"Unhealthy",variant:"error",color:"text-danger",bar:"bg-danger"}}(e.successRate,e.total),i=null!=e.successRate?Math.round(100*e.successRate):null;return(0,n.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-4 shadow-[var(--shadow-soft)]",children:[(0,n.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,n.jsx)("h3",{className:"truncate font-mono text-sm font-semibold text-text-main",children:(t=e.provider,s=o.Q2[t],s?.name?s.name:t.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()))}),(0,n.jsx)(a.default,{variant:r.variant,dot:!0,size:"sm",children:r.label})]}),null!=i&&(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs text-text-muted",children:[(0,n.jsx)("span",{children:"Success rate"}),(0,n.jsxs)("span",{className:(0,l.cn)("font-mono font-semibold",r.color),children:[i,"%"]})]}),(0,n.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-surface-2",children:(0,n.jsx)("div",{className:(0,l.cn)("h-full rounded-full transition-all",r.bar),style:{width:`${i}%`}})})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"Requests"}),(0,n.jsx)("div",{className:"font-mono font-semibold text-text-main",children:e.total})]}),(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"Failures"}),(0,n.jsx)("div",{className:(0,l.cn)("font-mono font-semibold",e.failures>0?"text-danger":"text-text-main"),children:e.failures})]}),(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"Avg latency"}),(0,n.jsx)("div",{className:"font-mono font-semibold text-text-main",children:c(e.avgLatencyMs)})]}),(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"p95 latency"}),(0,n.jsx)("div",{className:"font-mono font-semibold text-text-main",children:c(e.p95LatencyMs)})]})]}),e.lastError&&(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-1.5 text-xs text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px] text-danger",children:"error"}),"Last error: ",(0,n.jsx)("span",{className:"font-mono",children:e.lastError})," \xb7 ",function(e){if(!e)return"—";let t=Date.now()-e;return t<5e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(e).toLocaleTimeString()}(e.lastErrorAt)]})]},e.provider)})})]})}},40208:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var n=s(95155),r=s(12115),a=s(92542),i=s(56061),l=s(99312);let o={closed:{label:"Closed",variant:"success"},halfOpen:{label:"Half-open (probing)",variant:"warning"},open:{label:"Open",variant:"error"}};function c(){let[e,t]=(0,r.useState)([]),s=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/breaker");if(!e.ok)return;let s=await e.json();t(s.breakers||[])}catch{}},[]);(0,r.useEffect)(()=>{s();let e=setInterval(s,3e3);return()=>clearInterval(e)},[s]);let c=async e=>{try{await fetch("/api/breaker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,key:e})})}catch{}s()},d=async()=>{for(let t of e)try{await fetch("/api/breaker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,key:t.provider})})}catch{}s()};return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Circuit Breakers"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(a.default,{size:"sm",variant:"ghost",icon:"refresh",onClick:s,children:"Refresh"}),e.length>0&&(0,n.jsx)(a.default,{size:"sm",variant:"danger",icon:"bolt",onClick:d,children:"Reset all"})]})]}),0===e.length?(0,n.jsx)(l.default,{icon:"bolt",title:"No opened circuit breakers",description:"Breakers trip when a provider repeatedly fails and recover automatically after cooldown. Opened breakers will appear here so you can inspect or force-close them."}):(0,n.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s=o[e.state]||o.closed;return(0,n.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"truncate font-mono text-xs font-semibold text-text-main",children:String((t=e.provider)||"").split(":")[0]||t}),(0,n.jsx)("div",{className:"truncate text-[11px] text-text-subtle",children:e.provider})]}),(0,n.jsx)(i.default,{variant:s.variant,dot:!0,size:"sm",children:s.label})]}),(0,n.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs text-text-muted",children:[(0,n.jsxs)("span",{children:["Failures: ",(0,n.jsx)("span",{className:"font-mono",children:e.failures})]}),"open"===e.state&&(0,n.jsxs)("span",{children:["Cooldown: ",(0,n.jsx)("span",{className:"font-mono",children:function(e){if(null==e)return"—";let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let s=Math.floor(t/60);return`${s}m ${t%60}s`}(e.cooldownRemainingMs)})]})]}),(0,n.jsx)(a.default,{size:"sm",variant:"secondary",icon:"replay",className:"mt-3 w-full",onClick:()=>c(e.provider),children:"Close breaker"})]},e.provider)})})]})}},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},54960:(e,t,s)=>{"use strict";s.d(t,{default:()=>a});var n=s(95155),r=s(31474);function a({title:e,description:t,icon:s,iconNode:i,actions:l,breadcrumbs:o,className:c}){return(0,n.jsxs)("div",{className:(0,r.cn)("mb-6",c),children:[o?.length>0&&(0,n.jsx)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs text-text-muted",children:o.map((e,t)=>(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[t>0&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-60",children:"chevron_right"}),e.href?(0,n.jsx)("a",{href:e.href,className:"transition-colors hover:text-primary",children:e.label}):(0,n.jsx)("span",{className:"font-medium text-text-main",children:e.label})]},t))}),(0,n.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i?(0,n.jsx)("div",{className:"mt-0.5 shrink-0",children:i}):s&&(0,n.jsx)("div",{className:"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight text-text-main",children:e}),t&&(0,n.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:t})]})]}),l&&(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})]})}},56061:(e,t,s)=>{"use strict";s.d(t,{default:()=>o});var n=s(95155),r=s(31474);let a={default:"bg-surface-2 text-text-muted ring-1 ring-border-subtle",primary:"bg-primary/12 text-primary ring-1 ring-primary/20",success:"bg-success/12 text-success ring-1 ring-success/20",warning:"bg-warning/12 text-warning ring-1 ring-warning/20",error:"bg-danger/12 text-danger ring-1 ring-danger/20",info:"bg-info/12 text-info ring-1 ring-info/20",cyan:"bg-cyan/12 text-cyan ring-1 ring-cyan/20"},i={default:"bg-text-subtle",primary:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",cyan:"bg-cyan"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function o({children:e,variant:t="default",size:s="md",dot:c=!1,icon:d,className:u}){return(0,n.jsxs)("span",{className:(0,r.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold leading-none",a[t],l[s],u),children:[c&&(0,n.jsx)("span",{className:(0,r.cn)("size-1.5 rounded-full",i[t])}),d&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:d}),e]})}},88105:(e,t,s)=>{"use strict";s.d(t,{Q2:()=>w,DI:()=>b,fg:()=>x,MA:()=>k,IS:()=>c,nJ:()=>d,rj:()=>h,zN:()=>m,JH:()=>f,s9:()=>u,wb:()=>T,br:()=>p,wG:()=>C,zt:()=>S,o5:()=>M,gb:()=>v,gC:()=>j,Ox:()=>y,U_:()=>N,mq:()=>g,rs:()=>_});var n=s(82563);let r="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(n.A.filter(e=>e.display).map(e=>{let t;return[e.id,"RISK_NOTICE"===(t=e.display).deprecationNotice?{...t,deprecationNotice:r}:t]}));let a=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],i={toolUse:!0,fileAccess:!0,streaming:!0,multiTurn:!0},l={webCookie:{toolUse:!1,fileAccess:!1,streaming:!0,multiTurn:!0}},o=e=>Object.fromEntries(n.A.filter(t=>t.category===e).map(e=>[e.id,function(e){let t={};for(let s of(e.media&&Object.assign(t,e.media),a))void 0!==e[s]&&(t[s]=e[s]);let s={...e.display||{}};return"RISK_NOTICE"===s.deprecationNotice&&(s.deprecationNotice=r),{...s,id:e.id,alias:e.alias||e.id,...e.uiAlias?{uiAlias:e.uiAlias}:{},...e.hidden?{hidden:!0}:{},...t,...void 0!==e.priority?{priority:e.priority}:{},...e.hasFree?{hasFree:!0}:{},...e.thinkingConfig?{thinkingConfig:e.thinkingConfig}:{},...e.regions?{regions:e.regions,defaultRegion:e.defaultRegion}:{},...e.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...e.noAuth?{noAuth:!0}:{},...e.passthroughModels?{passthroughModels:!0}:{},...e.hasOAuth?{hasOAuth:!0}:{},...e.authModes?{authModes:e.authModes}:"freeTier"===e.category||"apikey"===e.category?{authModes:["apikey"]}:{},...e.authType?{authType:e.authType}:{},...e.authHint?{authHint:e.authHint}:{},...e.comingSoon?{comingSoon:!0}:{},capabilities:function(e){if(e.capabilities&&"object"==typeof e.capabilities)return{...i,...e.capabilities};let t=l[e.category];return t?{...t}:{...i}}(e)}}(e)])),c=o("free"),d=o("freeTier"),u={extended:{options:["auto","on","off"],defaultMode:"auto",defaultBudgetTokens:1e4},effort:{options:["auto","none","low","medium","high"],defaultMode:"auto"}},m=o("oauth"),x=o("apikey"),p=o("webCookie"),h=[{id:"embedding",label:"Embedding",icon:"data_array",endpoint:{method:"POST",path:"/v1/embeddings"}},{id:"image",label:"Text to Image",icon:"brush",endpoint:{method:"POST",path:"/v1/images/generations"}},{id:"imageToText",label:"Image to Text",icon:"image_search",endpoint:{method:"POST",path:"/v1/images/understanding"}},{id:"tts",label:"Text To Speech",icon:"record_voice_over",endpoint:{method:"POST",path:"/v1/audio/speech"}},{id:"stt",label:"Speech To Text",icon:"mic",endpoint:{method:"POST",path:"/v1/audio/transcriptions"}},{id:"webSearch",label:"Web Search",icon:"travel_explore",endpoint:{method:"POST",path:"/v1/search"}},{id:"webFetch",label:"Web Fetch",icon:"language",endpoint:{method:"POST",path:"/v1/web/fetch"}},{id:"video",label:"Video",icon:"movie",endpoint:{method:"POST",path:"/v1/video/generations"}},{id:"music",label:"Music",icon:"music_note",endpoint:{method:"POST",path:"/v1/audio/music"}}],f="openai-compatible-",b="anthropic-compatible-";function g(e){return"string"==typeof e&&e.startsWith(f)}function v(e){return"string"==typeof e&&e.startsWith(b)}function j(e){return"string"==typeof e&&e.startsWith("custom-embedding-")}function y(e){return"string"==typeof e&&e.startsWith("custom-stt-")}function N(e){return"string"==typeof e&&e.startsWith("custom-tts-")}let w={...c,...d,...m,...x,...p},k={oauth:{id:"oauth"},apikey:{id:"apikey"},cookie:{id:"cookie"}};function S(e){for(let t of Object.values(w))if(t.alias===e||t.id===e)return t;return null}function _(e){let t=S(e);return t?.id||e}function C(e){let t=w[e];return t?.alias||e}function M(e){return Object.values(w).filter(t=>!(!(t.serviceKinds??["llm"]).includes(e)||t.hidden||t.hiddenKinds?.includes(e))).sort((e,t)=>(e.priority??e.mediaPriority??999)-(t.priority??t.mediaPriority??999))}Object.values(w).reduce((e,t)=>(e[t.alias]=t.id,e),{}),Object.values(w).reduce((e,t)=>(e[t.id]=t.alias,e),{});let T=n.A.filter(e=>e.features?.usage).map(e=>e.id);n.A.filter(e=>e.features?.usageApikey).map(e=>e.id)},92542:(e,t,s)=>{"use strict";s.d(t,{default:()=>l});var n=s(95155),r=s(31474);let a={primary:"bg-primary hover:bg-primary-hover text-white shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset,0_10px_30px_-18px_rgba(139,92,246,0.75)] disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-primary/45",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-danger hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-success hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-7 px-3 text-xs rounded-brand",md:"h-9 px-4 text-sm rounded-brand",lg:"h-10 px-5 text-sm rounded-brand"};function l({children:e,variant:t="primary",size:s="md",icon:o,iconRight:c,disabled:d=!1,loading:u=!1,fullWidth:m=!1,className:x,...p}){return(0,n.jsxs)("button",{className:(0,r.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg",a[t],i[s],m&&"w-full",x),disabled:d||u,...p,children:[u?(0,n.jsx)("span",{className:"material-symbols-outlined animate-spin text-[16px]",children:"progress_activity"}):o?(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:o}):null,e,c&&!u&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:c})]})}},99312:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var n=s(95155),r=s(31474),a=s(92542);function i({icon:e="inbox",title:t="No items found",description:s="There's nothing here yet.",action:l,actionText:o,onAction:c,className:d}){return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center justify-center rounded-panel border border-dashed border-border p-12 text-center",d),children:[(0,n.jsx)("div",{className:"mb-4 flex size-12 items-center justify-center rounded-full bg-surface-2 text-text-muted ring-1 ring-border-subtle",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:e})}),(0,n.jsx)("h3",{className:"mb-1.5 text-sm font-semibold text-text-main",children:t}),(0,n.jsx)("p",{className:"mb-6 max-w-sm text-xs text-text-muted",children:s}),l||o&&c&&(0,n.jsx)(a.default,{variant:"outline",size:"sm",onClick:c,children:o})]})}}},e=>{e.O(0,[2563,8441,3794,7358],()=>e(e.s=21316)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{4695:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var n=s(95155),r=s(12115),a=s(56061),i=s(99312),l=s(31474),o=s(88105);let c={closed:{label:"Closed",variant:"success"},halfOpen:{label:"Probing",variant:"warning"},open:{label:"Open",variant:"error"}};function d(){let[e,t]=(0,r.useState)([]),[s,d]=(0,r.useState)(!1),u=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/health/overview");if(!e.ok)return;let s=await e.json();t(Array.isArray(s.providers)?s.providers:[]),d(!0)}catch{d(!1)}},[]);return(0,r.useEffect)(()=>{u();let e=setInterval(u,3e3);return()=>clearInterval(e)},[u]),(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,n.jsx)("span",{className:(0,l.cn)("size-2 rounded-full",s?"bg-success animate-pulse":"bg-danger")}),s?"Live \xb7 refreshes every 3s":"Reconnecting…"]}),e.length>0&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-success"})," Healthy"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-warning"})," Degraded"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-danger"})," Unhealthy"]})]})]}),0===e.length?(0,n.jsx)(i.default,{icon:"grid_view",title:"No provider health data",description:"Send a request to any provider (or connect an account) and the heatmap will appear here with success rate, latency percentiles, breaker state, and connection cooldowns."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-panel border border-border-subtle bg-panel shadow-[var(--shadow-soft)]",children:(0,n.jsxs)("table",{className:"w-full min-w-[760px] border-collapse text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border-subtle text-left text-[11px] uppercase tracking-wider text-text-subtle",children:[(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Provider"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Success rate"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"p50"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"p95"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"p99"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Errors"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Breaker"}),(0,n.jsx)("th",{className:"px-3 py-2.5 text-center font-medium",children:"Connections"})]})}),(0,n.jsx)("tbody",{children:e.map(e=>{var t;let s,r=e.health||{},i=r.successRate??null,d=null!=i?Math.round(100*i):null,u=function(e){if(null==e)return{bg:"transparent",fg:"text-text-subtle"};let t=Math.max(0,Math.min(120,Math.round(120*e)));return{bg:`hsl(${t} 80% 45% / 0.20)`,fg:"text-text-main"}}(i),m=e.breaker?c[e.breaker.state]||c.closed:null,x=e.connections.length>0?`${e.connections.length}${e.lockedConnections>0?` \xb7 ${e.lockedConnections} locked`:""}`:"—",p=e.connections.length>0?e.connections.map(e=>`${e.label}${e.cooldownActive?" (cooldown)":e.testStatus?` (${e.testStatus})`:""}${e.lastError?` — ${e.lastError}`:""}`).join("\n"):"";return(0,n.jsxs)("tr",{className:"border-b border-border-subtle/60 last:border-b-0 hover:bg-surface-2/40",children:[(0,n.jsxs)("td",{className:"px-3 py-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono font-semibold text-text-main",children:(t=e.id,s=o.Q2[t],s?.name?s.name:String(t||"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()))}),e.cooldownActive&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px] text-danger",title:"At least one connection is in cooldown",children:"lock_clock"})]}),(0,n.jsx)("div",{className:"text-[10px] text-text-subtle",children:e.id})]}),(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[52px] rounded-md px-2 py-1 font-mono font-semibold",u.fg),style:{background:u.bg},children:null!=d?`${d}%`:"—"})}),["p50LatencyMs","p95LatencyMs","p99LatencyMs"].map(e=>{let t=r[e],s=function(e,t=15e3){if(null==e)return{bg:"transparent",fg:"text-text-subtle"};let s=Math.max(0,Math.min(120,Math.round((1-Math.min(e/t,1))*120)));return{bg:`hsl(${s} 80% 45% / 0.16)`,fg:"text-text-main"}}(t);return(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[52px] rounded-md px-2 py-1 font-mono",s.fg),style:{background:s.bg},children:null==t?"—":t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`})},e)}),(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[40px] rounded-md px-2 py-1 font-mono font-semibold",r.failures>0?"bg-danger/15 text-danger":"text-text-subtle"),children:r.failures||0})}),(0,n.jsxs)("td",{className:"px-3 py-2 text-center",children:[m?(0,n.jsx)(a.default,{variant:m.variant,dot:!0,size:"sm",children:m.label}):(0,n.jsx)("span",{className:"text-text-subtle",children:"—"}),e.breaker?.state==="open"&&null!=e.breaker.cooldownRemainingMs&&(0,n.jsxs)("div",{className:"mt-0.5 text-[10px] text-text-muted",children:["cooldown ",function(e){if(null==e)return"";let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let s=Math.floor(t/60);return`${s}m ${t%60}s`}(e.breaker.cooldownRemainingMs)]})]}),(0,n.jsx)("td",{className:"px-3 py-2 text-center",children:(0,n.jsx)("span",{className:(0,l.cn)("inline-block min-w-[52px] rounded-md px-2 py-1 font-mono",e.lockedConnections>0?"bg-danger/15 text-danger":"active"===e.worstStatus?"bg-success/15 text-success":"text-text-subtle"),title:p||void 0,children:x})})]},e.id)})})]})})]})}},21316:(e,t,s)=>{Promise.resolve().then(s.bind(s,40208)),Promise.resolve().then(s.bind(s,37466)),Promise.resolve().then(s.bind(s,54960)),Promise.resolve().then(s.bind(s,4695))},31474:(e,t,s)=>{"use strict";function n(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}s.d(t,{cn:()=>n})},37466:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var n=s(95155),r=s(12115),a=s(56061),i=s(99312),l=s(31474),o=s(88105);function c(e){return null==e?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function d(){let[e,t]=(0,r.useState)([]),[s,d]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=new EventSource("/api/health/stream");return e.onopen=()=>d(!0),e.onerror=()=>d(!1),e.onmessage=e=>{try{let s=JSON.parse(e.data);"snapshot"===s.type&&Array.isArray(s.providers)?t(s.providers):s.provider&&t(e=>{let t=e.findIndex(e=>e.provider===s.provider);if(t>=0){let n=[...e];return n[t]=s,n}return[...e,s]})}catch{}},()=>e.close()},[]),(0,n.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,n.jsx)("span",{className:(0,l.cn)("size-2 rounded-full",s?"bg-success animate-pulse":"bg-danger")}),s?"Live":"Reconnecting…"]}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-success"})," Healthy"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-warning"})," Degraded"]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"size-2 rounded-full bg-danger"})," Unhealthy"]})]})]}),0===e.length?(0,n.jsx)(i.default,{icon:"monitor_heart",title:"No health data yet",description:"Provider health metrics will appear here once requests flow through the gateway. Send a request to any provider to start collecting samples."}):(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s,r=function(e,t){if(0===t)return{label:"Unknown",variant:"default",color:"text-text-subtle",bar:"bg-text-subtle"};let s=e??0;return s>=.95?{label:"Healthy",variant:"success",color:"text-success",bar:"bg-success"}:s>=.8?{label:"Degraded",variant:"warning",color:"text-warning",bar:"bg-warning"}:{label:"Unhealthy",variant:"error",color:"text-danger",bar:"bg-danger"}}(e.successRate,e.total),i=null!=e.successRate?Math.round(100*e.successRate):null;return(0,n.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-4 shadow-[var(--shadow-soft)]",children:[(0,n.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,n.jsx)("h3",{className:"truncate font-mono text-sm font-semibold text-text-main",children:(t=e.provider,s=o.Q2[t],s?.name?s.name:t.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()))}),(0,n.jsx)(a.default,{variant:r.variant,dot:!0,size:"sm",children:r.label})]}),null!=i&&(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs text-text-muted",children:[(0,n.jsx)("span",{children:"Success rate"}),(0,n.jsxs)("span",{className:(0,l.cn)("font-mono font-semibold",r.color),children:[i,"%"]})]}),(0,n.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-surface-2",children:(0,n.jsx)("div",{className:(0,l.cn)("h-full rounded-full transition-all",r.bar),style:{width:`${i}%`}})})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"Requests"}),(0,n.jsx)("div",{className:"font-mono font-semibold text-text-main",children:e.total})]}),(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"Failures"}),(0,n.jsx)("div",{className:(0,l.cn)("font-mono font-semibold",e.failures>0?"text-danger":"text-text-main"),children:e.failures})]}),(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"Avg latency"}),(0,n.jsx)("div",{className:"font-mono font-semibold text-text-main",children:c(e.avgLatencyMs)})]}),(0,n.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,n.jsx)("div",{className:"text-text-subtle",children:"p95 latency"}),(0,n.jsx)("div",{className:"font-mono font-semibold text-text-main",children:c(e.p95LatencyMs)})]})]}),e.lastError&&(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-1.5 text-xs text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px] text-danger",children:"error"}),"Last error: ",(0,n.jsx)("span",{className:"font-mono",children:e.lastError})," \xb7 ",function(e){if(!e)return"—";let t=Date.now()-e;return t<5e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(e).toLocaleTimeString()}(e.lastErrorAt)]})]},e.provider)})})]})}},40208:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var n=s(95155),r=s(12115),a=s(92542),i=s(56061),l=s(99312);let o={closed:{label:"Closed",variant:"success"},halfOpen:{label:"Half-open (probing)",variant:"warning"},open:{label:"Open",variant:"error"}};function c(){let[e,t]=(0,r.useState)([]),s=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/breaker");if(!e.ok)return;let s=await e.json();t(s.breakers||[])}catch{}},[]);(0,r.useEffect)(()=>{s();let e=setInterval(s,3e3);return()=>clearInterval(e)},[s]);let c=async e=>{try{await fetch("/api/breaker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,key:e})})}catch{}s()},d=async()=>{for(let t of e)try{await fetch("/api/breaker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,key:t.provider})})}catch{}s()};return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Circuit Breakers"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(a.default,{size:"sm",variant:"ghost",icon:"refresh",onClick:s,children:"Refresh"}),e.length>0&&(0,n.jsx)(a.default,{size:"sm",variant:"danger",icon:"bolt",onClick:d,children:"Reset all"})]})]}),0===e.length?(0,n.jsx)(l.default,{icon:"bolt",title:"No opened circuit breakers",description:"Breakers trip when a provider repeatedly fails and recover automatically after cooldown. Opened breakers will appear here so you can inspect or force-close them."}):(0,n.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s=o[e.state]||o.closed;return(0,n.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"truncate font-mono text-xs font-semibold text-text-main",children:String((t=e.provider)||"").split(":")[0]||t}),(0,n.jsx)("div",{className:"truncate text-[11px] text-text-subtle",children:e.provider})]}),(0,n.jsx)(i.default,{variant:s.variant,dot:!0,size:"sm",children:s.label})]}),(0,n.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs text-text-muted",children:[(0,n.jsxs)("span",{children:["Failures: ",(0,n.jsx)("span",{className:"font-mono",children:e.failures})]}),"open"===e.state&&(0,n.jsxs)("span",{children:["Cooldown: ",(0,n.jsx)("span",{className:"font-mono",children:function(e){if(null==e)return"—";let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let s=Math.floor(t/60);return`${s}m ${t%60}s`}(e.cooldownRemainingMs)})]})]}),(0,n.jsx)(a.default,{size:"sm",variant:"secondary",icon:"replay",className:"mt-3 w-full",onClick:()=>c(e.provider),children:"Close breaker"})]},e.provider)})})]})}},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},54960:(e,t,s)=>{"use strict";s.d(t,{default:()=>a});var n=s(95155),r=s(31474);function a({title:e,description:t,icon:s,iconNode:i,actions:l,breadcrumbs:o,className:c}){return(0,n.jsxs)("div",{className:(0,r.cn)("mb-6",c),children:[o?.length>0&&(0,n.jsx)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs text-text-muted",children:o.map((e,t)=>(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[t>0&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-60",children:"chevron_right"}),e.href?(0,n.jsx)("a",{href:e.href,className:"transition-colors hover:text-primary",children:e.label}):(0,n.jsx)("span",{className:"font-medium text-text-main",children:e.label})]},t))}),(0,n.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i?(0,n.jsx)("div",{className:"mt-0.5 shrink-0",children:i}):s&&(0,n.jsx)("div",{className:"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight text-text-main",children:e}),t&&(0,n.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:t})]})]}),l&&(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})]})}},56061:(e,t,s)=>{"use strict";s.d(t,{default:()=>o});var n=s(95155),r=s(31474);let a={default:"bg-surface-2 text-text-muted ring-1 ring-border-subtle",primary:"bg-primary/12 text-primary ring-1 ring-primary/20",success:"bg-success/12 text-success ring-1 ring-success/20",warning:"bg-warning/12 text-warning ring-1 ring-warning/20",error:"bg-danger/12 text-danger ring-1 ring-danger/20",info:"bg-info/12 text-info ring-1 ring-info/20",cyan:"bg-cyan/12 text-cyan ring-1 ring-cyan/20"},i={default:"bg-text-subtle",primary:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",cyan:"bg-cyan"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function o({children:e,variant:t="default",size:s="md",dot:c=!1,icon:d,className:u}){return(0,n.jsxs)("span",{className:(0,r.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold leading-none",a[t],l[s],u),children:[c&&(0,n.jsx)("span",{className:(0,r.cn)("size-1.5 rounded-full",i[t])}),d&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:d}),e]})}},88105:(e,t,s)=>{"use strict";s.d(t,{Q2:()=>w,DI:()=>b,fg:()=>x,MA:()=>k,IS:()=>c,nJ:()=>d,rj:()=>h,zN:()=>m,JH:()=>f,s9:()=>u,wb:()=>T,br:()=>p,wG:()=>C,zt:()=>S,o5:()=>M,gb:()=>v,gC:()=>j,Ox:()=>y,U_:()=>N,mq:()=>g,rs:()=>_});var n=s(59086);let r="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(n.A.filter(e=>e.display).map(e=>{let t;return[e.id,"RISK_NOTICE"===(t=e.display).deprecationNotice?{...t,deprecationNotice:r}:t]}));let a=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],i={toolUse:!0,fileAccess:!0,streaming:!0,multiTurn:!0},l={webCookie:{toolUse:!1,fileAccess:!1,streaming:!0,multiTurn:!0}},o=e=>Object.fromEntries(n.A.filter(t=>t.category===e).map(e=>[e.id,function(e){let t={};for(let s of(e.media&&Object.assign(t,e.media),a))void 0!==e[s]&&(t[s]=e[s]);let s={...e.display||{}};return"RISK_NOTICE"===s.deprecationNotice&&(s.deprecationNotice=r),{...s,id:e.id,alias:e.alias||e.id,...e.uiAlias?{uiAlias:e.uiAlias}:{},...e.hidden?{hidden:!0}:{},...t,...void 0!==e.priority?{priority:e.priority}:{},...e.hasFree?{hasFree:!0}:{},...e.thinkingConfig?{thinkingConfig:e.thinkingConfig}:{},...e.regions?{regions:e.regions,defaultRegion:e.defaultRegion}:{},...e.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...e.noAuth?{noAuth:!0}:{},...e.passthroughModels?{passthroughModels:!0}:{},...e.hasOAuth?{hasOAuth:!0}:{},...e.authModes?{authModes:e.authModes}:"freeTier"===e.category||"apikey"===e.category?{authModes:["apikey"]}:{},...e.authType?{authType:e.authType}:{},...e.authHint?{authHint:e.authHint}:{},...e.comingSoon?{comingSoon:!0}:{},capabilities:function(e){if(e.capabilities&&"object"==typeof e.capabilities)return{...i,...e.capabilities};let t=l[e.category];return t?{...t}:{...i}}(e)}}(e)])),c=o("free"),d=o("freeTier"),u={extended:{options:["auto","on","off"],defaultMode:"auto",defaultBudgetTokens:1e4},effort:{options:["auto","none","low","medium","high"],defaultMode:"auto"}},m=o("oauth"),x=o("apikey"),p=o("webCookie"),h=[{id:"embedding",label:"Embedding",icon:"data_array",endpoint:{method:"POST",path:"/v1/embeddings"}},{id:"image",label:"Text to Image",icon:"brush",endpoint:{method:"POST",path:"/v1/images/generations"}},{id:"imageToText",label:"Image to Text",icon:"image_search",endpoint:{method:"POST",path:"/v1/images/understanding"}},{id:"tts",label:"Text To Speech",icon:"record_voice_over",endpoint:{method:"POST",path:"/v1/audio/speech"}},{id:"stt",label:"Speech To Text",icon:"mic",endpoint:{method:"POST",path:"/v1/audio/transcriptions"}},{id:"webSearch",label:"Web Search",icon:"travel_explore",endpoint:{method:"POST",path:"/v1/search"}},{id:"webFetch",label:"Web Fetch",icon:"language",endpoint:{method:"POST",path:"/v1/web/fetch"}},{id:"video",label:"Video",icon:"movie",endpoint:{method:"POST",path:"/v1/video/generations"}},{id:"music",label:"Music",icon:"music_note",endpoint:{method:"POST",path:"/v1/audio/music"}}],f="openai-compatible-",b="anthropic-compatible-";function g(e){return"string"==typeof e&&e.startsWith(f)}function v(e){return"string"==typeof e&&e.startsWith(b)}function j(e){return"string"==typeof e&&e.startsWith("custom-embedding-")}function y(e){return"string"==typeof e&&e.startsWith("custom-stt-")}function N(e){return"string"==typeof e&&e.startsWith("custom-tts-")}let w={...c,...d,...m,...x,...p},k={oauth:{id:"oauth"},apikey:{id:"apikey"},cookie:{id:"cookie"}};function S(e){for(let t of Object.values(w))if(t.alias===e||t.id===e)return t;return null}function _(e){let t=S(e);return t?.id||e}function C(e){let t=w[e];return t?.alias||e}function M(e){return Object.values(w).filter(t=>!(!(t.serviceKinds??["llm"]).includes(e)||t.hidden||t.hiddenKinds?.includes(e))).sort((e,t)=>(e.priority??e.mediaPriority??999)-(t.priority??t.mediaPriority??999))}Object.values(w).reduce((e,t)=>(e[t.alias]=t.id,e),{}),Object.values(w).reduce((e,t)=>(e[t.id]=t.alias,e),{});let T=n.A.filter(e=>e.features?.usage).map(e=>e.id);n.A.filter(e=>e.features?.usageApikey).map(e=>e.id)},92542:(e,t,s)=>{"use strict";s.d(t,{default:()=>l});var n=s(95155),r=s(31474);let a={primary:"bg-primary hover:bg-primary-hover text-white shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset,0_10px_30px_-18px_rgba(139,92,246,0.75)] disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-primary/45",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-danger hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-success hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-7 px-3 text-xs rounded-brand",md:"h-9 px-4 text-sm rounded-brand",lg:"h-10 px-5 text-sm rounded-brand"};function l({children:e,variant:t="primary",size:s="md",icon:o,iconRight:c,disabled:d=!1,loading:u=!1,fullWidth:m=!1,className:x,...p}){return(0,n.jsxs)("button",{className:(0,r.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg",a[t],i[s],m&&"w-full",x),disabled:d||u,...p,children:[u?(0,n.jsx)("span",{className:"material-symbols-outlined animate-spin text-[16px]",children:"progress_activity"}):o?(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:o}):null,e,c&&!u&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:c})]})}},99312:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var n=s(95155),r=s(31474),a=s(92542);function i({icon:e="inbox",title:t="No items found",description:s="There's nothing here yet.",action:l,actionText:o,onAction:c,className:d}){return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center justify-center rounded-panel border border-dashed border-border p-12 text-center",d),children:[(0,n.jsx)("div",{className:"mb-4 flex size-12 items-center justify-center rounded-full bg-surface-2 text-text-muted ring-1 ring-border-subtle",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:e})}),(0,n.jsx)("h3",{className:"mb-1.5 text-sm font-semibold text-text-main",children:t}),(0,n.jsx)("p",{className:"mb-6 max-w-sm text-xs text-text-muted",children:s}),l||o&&c&&(0,n.jsx)(a.default,{variant:"outline",size:"sm",onClick:c,children:o})]})}}},e=>{e.O(0,[9086,8441,3794,7358],()=>e(e.s=21316)),_N_E=e.O()}]);
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{11055:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))},41095:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>O});var a=s(95155),r=s(73321);s(98500);var o=s(12115),l=s(35497),n=s(57250),i=s(88105),d=s(8247),c=s(70217),m=s(14051),u=s.n(m);function p({until:e}){let[t,s]=(0,o.useState)("");return((0,o.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);a<60?s(`${a}s`):a<3600?s(`${Math.floor(a/60)}m ${a%60}s`):s(`${Math.floor(a/3600)}h ${Math.floor(a%3600/60)}m`)};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function x({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:n,onMoveUp:i,onMoveDown:d,onToggleActive:m,onUpdateProxy:u,onEdit:h,onDelete:b}){let[g,f]=(0,o.useState)(!1),[y,v]=(0,o.useState)(!1),[j,w]=(0,o.useState)(!1),N=(0,o.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,P=!!C||$,_=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",T="",A=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(A)try{let e=new URL(A);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=A}let I=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E=S?.isActive===!0?"success":C||$?"error":"default",R=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,o.useEffect)(()=>{let t=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=R?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[R]),(0,o.useEffect)(()=>{if(!g)return;let e=e=>{N.current&&!N.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let O="unavailable"!==e.testStatus||j?e.testStatus:"active",M=s?e.name||e.email||e.displayName||"OAuth Account":e.name,K=async e=>{v(!0);try{await u("__none__"===e?null:e)}finally{v(!1),f(!1)}};return(0,a.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("button",{onClick:i,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:M}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,a.jsx)(l.Ex,{variant:(0,c.g)(e.isActive,O),size:"sm",dot:!0,children:!1===e.isActive?"disabled":O||"Unknown"}),P&&(0,a.jsx)(l.Ex,{variant:E,size:"sm",children:"Proxy"}),j&&!1!==e.isActive&&(0,a.jsx)(p,{until:R}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),P&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:_,children:_}),T&&(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:T}),I&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:I,children:["no_proxy: ",I]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:N,children:[(0,a.jsxs)("button",{onClick:()=>f(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${P?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,a.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>K(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,a.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(l.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable":"Enable"})]})]})}function h({isOpen:e,provider:t,providerName:s,proxyPools:r,onSave:n,onClose:i}){let d="__none__",[c,m]=(0,o.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,p]=(0,o.useState)(!1),[x,b]=(0,o.useState)(null),[g,f]=(0,o.useState)(!1),y=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),s=await e.json();b(s.valid?"success":"failed")}catch{b("failed")}finally{p(!1)}},v=async()=>{if(t&&c.apiKey){f(!0);try{let e=!1;try{p(!0),b(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await s.json()).valid,b(e?"success":"failed")}catch{b("failed")}finally{p(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,a.jsx)(l.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:i,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(l.$n,{onClick:y,disabled:!c.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),x&&(0,a.jsx)(l.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,a.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,a.jsx)(l.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{onClick:v,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,a.jsx)(l.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function b({providerId:e,isOAuth:t}){let[s,r]=(0,o.useState)([]),[n,i]=(0,o.useState)([]),[d,c]=(0,o.useState)(!0),[m,u]=(0,o.useState)(!1),[p,g]=(0,o.useState)(!1),[f,y]=(0,o.useState)(null),[v,j]=(0,o.useState)(null),[w,N]=(0,o.useState)("1"),[k,C]=(0,o.useState)(null),S=(0,o.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),o=await t.json(),l=await s.json(),n=a.ok?await a.json():{};t.ok&&r((o.connections||[]).filter(t=>t.provider===e)),s.ok&&i(l.proxyPools||[]);let d=(n.providerStrategies||{})[e]||{};j(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,o.useEffect)(()=>{S()},[S]);let $=async(t,s)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),r=(a.ok?await a.json():{}).providerStrategies||{},o={};t&&(o.fallbackStrategy=t),"round-robin"===t&&""!==s&&(o.stickyRoundRobinLimit=Number(s)||3);let l={...r};0===Object.keys(o).length?delete l[e]:l[e]=o,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("saveStrategy error:",e)}},P=async(e,t)=>{let a=[...s];[a[e],a[t]]=[a[t],a[e]],r(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch{await S()}},_=async e=>{C({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{C(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},T=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("toggle error:",e)}},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("proxy error:",e)}},I=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await S(),u(!1))}catch(e){console.log("save apikey error:",e)}},E=async e=>{try{(await fetch(`/api/providers/${f.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await S(),g(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,a.jsx)(l.Zp,{children:(0,a.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(l.lM,{checked:"round-robin"===v,onChange:e=>{let t=e?"round-robin":null;j(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===v&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===s.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,a.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:s.map((e,r)=>(0,a.jsx)(x,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===s.length-1,onMoveUp:()=>P(r,r-1),onMoveDown:()=>P(r,r+1),onToggleActive:t=>T(e.id,t),onUpdateProxy:t=>A(e.id,t),onEdit:()=>{y(e),g(!0)},onDelete:()=>_(e.id)},e.id))}),(0,a.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,a.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,a.jsx)(h,{isOpen:m,provider:e,proxyPools:n,onSave:I,onClose:()=>u(!1)}),(0,a.jsx)(l.wI,{isOpen:p,connection:f,proxyPools:n,onSave:E,onClose:()=>g(!1)}),(0,a.jsx)(l.uo,{isOpen:!!k,onClose:()=>C(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}p.propTypes={until:u().string.isRequired},x.propTypes={connection:u().shape({id:u().string,name:u().string,email:u().string,displayName:u().string,testStatus:u().string,isActive:u().bool,lastError:u().string,priority:u().number}).isRequired,proxyPools:u().array,isOAuth:u().bool.isRequired,isFirst:u().bool.isRequired,isLast:u().bool.isRequired,onMoveUp:u().func.isRequired,onMoveDown:u().func.isRequired,onToggleActive:u().func.isRequired,onUpdateProxy:u().func,onEdit:u().func.isRequired,onDelete:u().func.isRequired},h.propTypes={isOpen:u().bool.isRequired,provider:u().string,providerName:u().string,proxyPools:u().array,onSave:u().func.isRequired,onClose:u().func.isRequired},b.propTypes={providerId:u().string.isRequired,isOAuth:u().bool};var g=s(28777),f=s(11059);function y({model:e,fullModel:t,copied:s,onCopy:r,testStatus:o,isCustom:l,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let m="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,a.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),l&&(0,a.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function v({isOpen:e,onSave:t,onClose:s}){let[r,n]=(0,o.useState)(""),i=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,a.jsx)(l.aF,{isOpen:e,title:"Add Custom Model",onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&i(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{onClick:i,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,a.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j({providerId:e,kindFilter:t,providerAliasOverride:s}){let{copied:r,copy:n}=(0,f.C)(),[d,c]=(0,o.useState)({}),[m,u]=(0,o.useState)([]),[p,x]=(0,o.useState)({}),[h,b]=(0,o.useState)(null),[w,N]=(0,o.useState)(""),[k,C]=(0,o.useState)(!1),[S,$]=(0,o.useState)([]),P=s||(0,i.wG)(e),_=t||"llm",T=(0,o.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/models/alias"),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"})]),r=await t.json(),o=await s.json(),l=await a.json();t.ok&&c(r.aliases||{}),s.ok&&$((o.connections||[]).filter(t=>t.provider===e)),a.ok&&u(l.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[e]);(0,o.useEffect)(()=>{T()},[T]);let A=async(e,t)=>{let s=`${P}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})})).ok&&await T()}catch(e){console.log("set alias error:",e)}},I=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){console.log("delete alias error:",e)}},E=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:P,id:e,type:_})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},R=async e=>{try{let t=new URLSearchParams({providerAlias:P,id:e,type:_});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},O=async e=>{if(!h){b(e);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${P}/${e}`,kind:t})}),a=await s.json();x(t=>({...t,[e]:a.ok?"ok":"error"})),N(a.ok?"":a.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),N("Network error")}finally{b(null)}}},M=(0,g.KC)(e),K=t?M.filter(e=>e.kinds?e.kinds.includes(t):(0,g.CP)(e,"llm")===t):M,L=m.filter(e=>e.providerAlias===P&&(0,g.CP)(e,"llm")===_&&!K.some(t=>t.id===e.id));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),w&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:w}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${P}/${e.id}`,s=Object.entries(d).find(([,e])=>e===t)?.[0];return(0,a.jsx)(y,{model:e,fullModel:`${P}/${e.id}`,alias:s,copied:r,onCopy:n,onSetAlias:t=>A(e.id,t),onDeleteAlias:()=>I(s),testStatus:p[e.id],onTest:S.length>0?()=>O(e.id):void 0,isTesting:h===e.id,isFree:e.isFree},e.id)}),L.map(e=>(0,a.jsx)(y,{model:{id:e.id,name:e.name},fullModel:`${P}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>R(e.id),testStatus:p[e.id],onTest:S.length>0?()=>O(e.id):void 0,isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,a.jsxs)("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,a.jsx)(v,{isOpen:k,onSave:async e=>{await E(e),C(!1)},onClose:()=>C(!1)})]})}function w({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,a.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}y.propTypes={model:u().shape({id:u().string.isRequired}).isRequired,fullModel:u().string.isRequired,copied:u().string,onCopy:u().func.isRequired,testStatus:u().oneOf(["ok","error"]),isCustom:u().bool,isFree:u().bool,onDeleteAlias:u().func,onTest:u().func,isTesting:u().bool},v.propTypes={isOpen:u().bool.isRequired,onSave:u().func.isRequired,onClose:u().func.isRequired},j.propTypes={providerId:u().string.isRequired,kindFilter:u().string,providerAliasOverride:u().string};let N={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{11055:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))},41095:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>O});var a=s(95155),r=s(73321);s(98500);var o=s(12115),l=s(35497),n=s(57250),i=s(88105),d=s(8247),c=s(70217),m=s(14051),u=s.n(m);function p({until:e}){let[t,s]=(0,o.useState)("");return((0,o.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);a<60?s(`${a}s`):a<3600?s(`${Math.floor(a/60)}m ${a%60}s`):s(`${Math.floor(a/3600)}h ${Math.floor(a%3600/60)}m`)};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function x({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:n,onMoveUp:i,onMoveDown:d,onToggleActive:m,onUpdateProxy:u,onEdit:h,onDelete:b}){let[f,g]=(0,o.useState)(!1),[y,v]=(0,o.useState)(!1),[j,w]=(0,o.useState)(!1),N=(0,o.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,P=!!C||$,_=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",T="",A=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(A)try{let e=new URL(A);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=A}let I=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E=S?.isActive===!0?"success":C||$?"error":"default",R=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,o.useEffect)(()=>{let t=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=R?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[R]),(0,o.useEffect)(()=>{if(!f)return;let e=e=>{N.current&&!N.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let O="unavailable"!==e.testStatus||j?e.testStatus:"active",M=s?e.name||e.email||e.displayName||"OAuth Account":e.name,K=async e=>{v(!0);try{await u("__none__"===e?null:e)}finally{v(!1),g(!1)}};return(0,a.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("button",{onClick:i,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:M}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,a.jsx)(l.Ex,{variant:(0,c.g)(e.isActive,O),size:"sm",dot:!0,children:!1===e.isActive?"disabled":O||"Unknown"}),P&&(0,a.jsx)(l.Ex,{variant:E,size:"sm",children:"Proxy"}),j&&!1!==e.isActive&&(0,a.jsx)(p,{until:R}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),P&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:_,children:_}),T&&(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:T}),I&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:I,children:["no_proxy: ",I]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:N,children:[(0,a.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${P?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,a.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>K(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,a.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:b,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(l.lM,{size:"sm",checked:e.isActive??!0,onChange:m,title:e.isActive??!0?"Disable":"Enable"})]})]})}function h({isOpen:e,provider:t,providerName:s,proxyPools:r,onSave:n,onClose:i}){let d="__none__",[c,m]=(0,o.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,p]=(0,o.useState)(!1),[x,b]=(0,o.useState)(null),[f,g]=(0,o.useState)(!1),y=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),s=await e.json();b(s.valid?"success":"failed")}catch{b("failed")}finally{p(!1)}},v=async()=>{if(t&&c.apiKey){g(!0);try{let e=!1;try{p(!0),b(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await s.json()).valid,b(e?"success":"failed")}catch{b("failed")}finally{p(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{g(!1)}}};return t?(0,a.jsx)(l.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:i,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(l.$n,{onClick:y,disabled:!c.apiKey||u||f,variant:"secondary",children:u?"Checking...":"Check"})})]}),x&&(0,a.jsx)(l.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,a.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,a.jsx)(l.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{onClick:v,fullWidth:!0,disabled:!c.name||!c.apiKey||f,children:f?"Saving...":"Save"}),(0,a.jsx)(l.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function b({providerId:e,isOAuth:t}){let[s,r]=(0,o.useState)([]),[n,i]=(0,o.useState)([]),[d,c]=(0,o.useState)(!0),[m,u]=(0,o.useState)(!1),[p,f]=(0,o.useState)(!1),[g,y]=(0,o.useState)(null),[v,j]=(0,o.useState)(null),[w,N]=(0,o.useState)("1"),[k,C]=(0,o.useState)(null),S=(0,o.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),o=await t.json(),l=await s.json(),n=a.ok?await a.json():{};t.ok&&r((o.connections||[]).filter(t=>t.provider===e)),s.ok&&i(l.proxyPools||[]);let d=(n.providerStrategies||{})[e]||{};j(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,o.useEffect)(()=>{S()},[S]);let $=async(t,s)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),r=(a.ok?await a.json():{}).providerStrategies||{},o={};t&&(o.fallbackStrategy=t),"round-robin"===t&&""!==s&&(o.stickyRoundRobinLimit=Number(s)||3);let l={...r};0===Object.keys(o).length?delete l[e]:l[e]=o,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("saveStrategy error:",e)}},P=async(e,t)=>{let a=[...s];[a[e],a[t]]=[a[t],a[e]],r(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch{await S()}},_=async e=>{C({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{C(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},T=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("toggle error:",e)}},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("proxy error:",e)}},I=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await S(),u(!1))}catch(e){console.log("save apikey error:",e)}},E=async e=>{try{(await fetch(`/api/providers/${g.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await S(),f(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,a.jsx)(l.Zp,{children:(0,a.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(l.lM,{checked:"round-robin"===v,onChange:e=>{let t=e?"round-robin":null;j(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===v&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===s.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,a.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:s.map((e,r)=>(0,a.jsx)(x,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===s.length-1,onMoveUp:()=>P(r,r-1),onMoveDown:()=>P(r,r+1),onToggleActive:t=>T(e.id,t),onUpdateProxy:t=>A(e.id,t),onEdit:()=>{y(e),f(!0)},onDelete:()=>_(e.id)},e.id))}),(0,a.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,a.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,a.jsx)(h,{isOpen:m,provider:e,proxyPools:n,onSave:I,onClose:()=>u(!1)}),(0,a.jsx)(l.wI,{isOpen:p,connection:g,proxyPools:n,onSave:E,onClose:()=>f(!1)}),(0,a.jsx)(l.uo,{isOpen:!!k,onClose:()=>C(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}p.propTypes={until:u().string.isRequired},x.propTypes={connection:u().shape({id:u().string,name:u().string,email:u().string,displayName:u().string,testStatus:u().string,isActive:u().bool,lastError:u().string,priority:u().number}).isRequired,proxyPools:u().array,isOAuth:u().bool.isRequired,isFirst:u().bool.isRequired,isLast:u().bool.isRequired,onMoveUp:u().func.isRequired,onMoveDown:u().func.isRequired,onToggleActive:u().func.isRequired,onUpdateProxy:u().func,onEdit:u().func.isRequired,onDelete:u().func.isRequired},h.propTypes={isOpen:u().bool.isRequired,provider:u().string,providerName:u().string,proxyPools:u().array,onSave:u().func.isRequired,onClose:u().func.isRequired},b.propTypes={providerId:u().string.isRequired,isOAuth:u().bool};var f=s(28777),g=s(11059);function y({model:e,fullModel:t,copied:s,onCopy:r,testStatus:o,isCustom:l,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let m="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,a.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),l&&(0,a.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function v({isOpen:e,onSave:t,onClose:s}){let[r,n]=(0,o.useState)(""),i=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,a.jsx)(l.aF,{isOpen:e,title:"Add Custom Model",onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&i(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{onClick:i,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,a.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j({providerId:e,kindFilter:t,providerAliasOverride:s}){let{copied:r,copy:n}=(0,g.C)(),[d,c]=(0,o.useState)({}),[m,u]=(0,o.useState)([]),[p,x]=(0,o.useState)({}),[h,b]=(0,o.useState)(null),[w,N]=(0,o.useState)(""),[k,C]=(0,o.useState)(!1),[S,$]=(0,o.useState)([]),P=s||(0,i.wG)(e),_=t||"llm",T=(0,o.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/models/alias"),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"})]),r=await t.json(),o=await s.json(),l=await a.json();t.ok&&c(r.aliases||{}),s.ok&&$((o.connections||[]).filter(t=>t.provider===e)),a.ok&&u(l.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[e]);(0,o.useEffect)(()=>{T()},[T]);let A=async(e,t)=>{let s=`${P}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})})).ok&&await T()}catch(e){console.log("set alias error:",e)}},I=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){console.log("delete alias error:",e)}},E=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:P,id:e,type:_})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},R=async e=>{try{let t=new URLSearchParams({providerAlias:P,id:e,type:_});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},O=async e=>{if(!h){b(e);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${P}/${e}`,kind:t})}),a=await s.json();x(t=>({...t,[e]:a.ok?"ok":"error"})),N(a.ok?"":a.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),N("Network error")}finally{b(null)}}},M=(0,f.KC)(e),K=t?M.filter(e=>e.kinds?e.kinds.includes(t):(0,f.CP)(e,"llm")===t):M,L=m.filter(e=>e.providerAlias===P&&(0,f.CP)(e,"llm")===_&&!K.some(t=>t.id===e.id));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),w&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:w}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${P}/${e.id}`,s=Object.entries(d).find(([,e])=>e===t)?.[0];return(0,a.jsx)(y,{model:e,fullModel:`${P}/${e.id}`,alias:s,copied:r,onCopy:n,onSetAlias:t=>A(e.id,t),onDeleteAlias:()=>I(s),testStatus:p[e.id],onTest:S.length>0?()=>O(e.id):void 0,isTesting:h===e.id,isFree:e.isFree},e.id)}),L.map(e=>(0,a.jsx)(y,{model:{id:e.id,name:e.name},fullModel:`${P}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>R(e.id),testStatus:p[e.id],onTest:S.length>0?()=>O(e.id):void 0,isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,a.jsxs)("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,a.jsx)(v,{isOpen:k,onSave:async e=>{await E(e),C(!1)},onClose:()=>C(!1)})]})}function w({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,a.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}y.propTypes={model:u().shape({id:u().string.isRequired}).isRequired,fullModel:u().string.isRequired,copied:u().string,onCopy:u().func.isRequired,testStatus:u().oneOf(["ok","error"]),isCustom:u().bool,isFree:u().bool,onDeleteAlias:u().func,onTest:u().func,isTesting:u().bool},v.propTypes={isOpen:u().bool.isRequired,onSave:u().func.isRequired,onClose:u().func.isRequired},j.propTypes={providerId:u().string.isRequired,kindFilter:u().string,providerAliasOverride:u().string};let N={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
2
2
  "results": [
3
3
  { "title": "...", "url": "...", "snippet": "..." }
4
4
  ]
@@ -30,7 +30,7 @@
30
30
  }],
31
31
  "model": "...",
32
32
  "usage": { "prompt_tokens": 9, "total_tokens": 9 }
33
- }`;function C({providerId:e,customAlias:t}){let s=(0,i.gC)(e),r=s?t||e:(0,i.wG)(e),n=s?[]:(0,g.KC)(e).filter(e=>"embedding"===(0,g.CP)(e)),[d,c]=(0,o.useState)(n[0]?.id??""),[m,u]=(0,o.useState)("The quick brown fox jumps over the lazy dog"),[p,x]=(0,o.useState)(""),[h,b]=(0,o.useState)(""),[y,v]=(0,o.useState)(!1),[j,N]=(0,o.useState)(""),[S,$]=(0,o.useState)(""),[P,_]=(0,o.useState)(null),[T,A]=(0,o.useState)(!1),[I,E]=(0,o.useState)(""),{copied:R,copy:O}=(0,f.C)(),{copied:M,copy:K}=(0,f.C)();(0,o.useEffect)(()=>{N(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{b((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&$(e.publicUrl)}).catch(()=>{})},[]);let L=y?S:j,U=d?`${r}/${d}`:"",B=()=>{let e={model:U,input:m.trim()},t=Number(p);return p&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},D=`curl -X POST ${L}/v1/embeddings \\
33
+ }`;function C({providerId:e,customAlias:t}){let s=(0,i.gC)(e),r=s?t||e:(0,i.wG)(e),n=s?[]:(0,f.KC)(e).filter(e=>"embedding"===(0,f.CP)(e)),[d,c]=(0,o.useState)(n[0]?.id??""),[m,u]=(0,o.useState)("The quick brown fox jumps over the lazy dog"),[p,x]=(0,o.useState)(""),[h,b]=(0,o.useState)(""),[y,v]=(0,o.useState)(!1),[j,N]=(0,o.useState)(""),[S,$]=(0,o.useState)(""),[P,_]=(0,o.useState)(null),[T,A]=(0,o.useState)(!1),[I,E]=(0,o.useState)(""),{copied:R,copy:O}=(0,g.C)(),{copied:M,copy:K}=(0,g.C)();(0,o.useEffect)(()=>{N(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{b((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&$(e.publicUrl)}).catch(()=>{})},[]);let L=y?S:j,U=d?`${r}/${d}`:"",B=()=>{let e={model:U,input:m.trim()},t=Number(p);return p&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},D=`curl -X POST ${L}/v1/embeddings \\
34
34
  -H "Content-Type: application/json" \\
35
35
  -H "Authorization: Bearer ${h||"YOUR_KEY"}" \\
36
36
  -d '${JSON.stringify(B())}'`,F=async()=>{if(!m.trim()||!U)return;A(!0),E(""),_(null);let e=Date.now();try{let t={"Content-Type":"application/json"};h&&(t.Authorization=`Bearer ${h}`);let s=await fetch("/api/v1/embeddings",{method:"POST",headers:t,body:JSON.stringify(B())}),a=Date.now()-e,r=await s.json();if(!s.ok)return void E(r?.error?.message||r?.error||`HTTP ${s.status}`);_({data:r,latencyMs:a})}catch(e){E(e.message||"Network error")}finally{A(!1)}},q=P?JSON.stringify(P.data,null,2):"";return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsx)(w,{label:"Model",children:s?(0,a.jsx)("input",{value:d,onChange:e=>c(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}):(0,a.jsx)("select",{value:d,onChange:e=>c(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:n.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsx)("input",{value:L,onChange:e=>y?$(e.target.value):N(e.target.value),className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono",placeholder:"http://localhost:3000"}),S&&(0,a.jsxs)("button",{onClick:()=>v(e=>!e),title:y?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${y?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("input",{type:"password",value:h,onChange:e=>b(e.target.value),placeholder:"sk-...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,a.jsx)(w,{label:"Input",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:m,onChange:e=>u(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),m&&(0,a.jsx)("button",{type:"button",onClick:()=>u(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,a.jsx)(w,{label:"Dimensions",children:(0,a.jsx)("input",{type:"number",min:"1",value:p,onChange:e=>x(e.target.value),placeholder:"optional, e.g. 512, 1024 (leave empty for default)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>O(D),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:R?"check":"content_copy"}),R?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:F,disabled:T||!m.trim()||!U,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:T?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),T?"Running...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:D})]}),I&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:I}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",P&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",P.latencyMs,"ms"]})]}),P&&(0,a.jsxs)("button",{onClick:()=>K(q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:M?"check":"content_copy"}),M?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:(e=>{if(!e)return k;let t=JSON.parse(JSON.stringify(e));return(t.data||[]).forEach(e=>{Array.isArray(e.embedding)&&e.embedding.length>4&&(e.embedding=[...e.embedding.slice(0,4).map(e=>parseFloat(e.toFixed(6))),`... (${e.embedding.length} dims)`])}),JSON.stringify(t,null,2)})(P?.data)})]})]})]})}let S={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0}};var $=s(717),P=s(91781);let _=`// Audio will appear here after running.
@@ -38,16 +38,16 @@
38
38
  {
39
39
  "format": "mp3",
40
40
  "audio": "//NExAANaAIIAUAAANNNNNNNN..." // base64 encoded MP3
41
- }`;function T({providerId:e}){let t,s,r=(0,i.wG)(e),n=S[e]||S["edge-tts"],[d,c]=(0,o.useState)(n.defaultVoiceId||""),[m,u]=(0,o.useState)(""),[p,x]=(0,o.useState)(n.defaultVoiceId||""),[h,b]=(0,o.useState)([]),[y,v]=(0,o.useState)(""),[j,N]=(0,o.useState)(()=>{let t=i.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(n.hasModelSelector&&n.modelKey){let e=(0,g.KC)(n.modelKey);return e?.[0]?.id||""}return""}),[k,C]=(0,o.useState)("Hello, this is a text to speech test."),[A,I]=(0,o.useState)(""),[E,R]=(0,o.useState)(!1),[O,M]=(0,o.useState)(""),[K,L]=(0,o.useState)(""),[U,B]=(0,o.useState)("mp3"),[D,F]=(0,o.useState)(""),[q,J]=(0,o.useState)(null),[z,V]=(0,o.useState)(!1),[H,W]=(0,o.useState)(""),[Y,G]=(0,o.useState)(null),{copied:Z,copy:Q}=(0,f.C)(),[X,ee]=(0,o.useState)(!1),[et,es]=(0,o.useState)([]),[ea,er]=(0,o.useState)(!1),[eo,el]=(0,o.useState)(""),[en,ei]=(0,o.useState)(""),[ed,ec]=(0,o.useState)({}),[em,eu]=(0,o.useState)("");(0,o.useEffect)(()=>{if(M(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{I((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&L(e.publicUrl)}).catch(()=>{}),"hardcoded"===n.voiceSource){let t=n.hasModelSelector&&n.modelKey&&(0,g.KC)(n.modelKey)?.[0]?.id||"",s=n.voicesPerModel&&t?(0,$.jY)(e,t)||[]:(0,g.KC)(n.voiceKey||e).filter(e=>"tts"===(0,g.CP)(e));if(s.length)if(n.hasBrowseButton){let e=s.find(e=>"en"===e.id)||s[0];v(e.id),c(e.id),u(e.name),b([{id:e.id,name:e.name}])}else b(s),c(s[0].id),u(s[0].name||s[0].id)}},[e]),(0,o.useEffect)(()=>{if(!n.voicesPerModel||!j)return;let t=(0,$.jY)(e,j)||[];b(t),t.length&&(c(t[0].id),u(t[0].name||t[0].id))},[j]);let ep=async()=>{if(ee(!0),el(""),ei(""),!et.length){er(!0);try{if("hardcoded"===n.voiceSource){let t=n.voiceKey||e,s=(0,g.KC)(t).filter(e=>"tts"===(0,g.CP)(e)),a={};for(let e of s)a[e.id]||(a[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});ec(a),es(Object.values(a).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=n.apiEndpoint?n.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,s=await fetch(t),a=await s.json();if(a.error)return void ei(a.error);es(a.languages||[]),ec(a.byLang||{})}}catch(e){ei(e.message)}finally{er(!1)}}},ex=eo?et.filter(e=>e.name.toLowerCase().includes(eo.toLowerCase())||e.code.toLowerCase().includes(eo.toLowerCase())):et,eh=E?K:O,eb=n.hasVoiceIdInput&&p||d,eg=n.hasModelSelector&&j&&eb?`${r}/${j}/${eb}`:n.hasModelSelector&&j?`${r}/${j}`:eb?`${r}/${eb}`:"",ef=(t={model:eg,input:k},n.hasLanguageHint&&em&&(t.language=em),t),ey=`curl -X POST ${eh}/v1/audio/speech${"json"===U?"?response_format=json":""} \\
41
+ }`;function T({providerId:e}){let t,s,r=(0,i.wG)(e),n=S[e]||S["edge-tts"],[d,c]=(0,o.useState)(n.defaultVoiceId||""),[m,u]=(0,o.useState)(""),[p,x]=(0,o.useState)(n.defaultVoiceId||""),[h,b]=(0,o.useState)([]),[y,v]=(0,o.useState)(""),[j,N]=(0,o.useState)(()=>{let t=i.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(n.hasModelSelector&&n.modelKey){let e=(0,f.KC)(n.modelKey);return e?.[0]?.id||""}return""}),[k,C]=(0,o.useState)("Hello, this is a text to speech test."),[A,I]=(0,o.useState)(""),[E,R]=(0,o.useState)(!1),[O,M]=(0,o.useState)(""),[K,L]=(0,o.useState)(""),[U,B]=(0,o.useState)("mp3"),[D,F]=(0,o.useState)(""),[q,J]=(0,o.useState)(null),[z,V]=(0,o.useState)(!1),[H,W]=(0,o.useState)(""),[Y,G]=(0,o.useState)(null),{copied:Z,copy:Q}=(0,g.C)(),[X,ee]=(0,o.useState)(!1),[et,es]=(0,o.useState)([]),[ea,er]=(0,o.useState)(!1),[eo,el]=(0,o.useState)(""),[en,ei]=(0,o.useState)(""),[ed,ec]=(0,o.useState)({}),[em,eu]=(0,o.useState)("");(0,o.useEffect)(()=>{if(M(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{I((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&L(e.publicUrl)}).catch(()=>{}),"hardcoded"===n.voiceSource){let t=n.hasModelSelector&&n.modelKey&&(0,f.KC)(n.modelKey)?.[0]?.id||"",s=n.voicesPerModel&&t?(0,$.jY)(e,t)||[]:(0,f.KC)(n.voiceKey||e).filter(e=>"tts"===(0,f.CP)(e));if(s.length)if(n.hasBrowseButton){let e=s.find(e=>"en"===e.id)||s[0];v(e.id),c(e.id),u(e.name),b([{id:e.id,name:e.name}])}else b(s),c(s[0].id),u(s[0].name||s[0].id)}},[e]),(0,o.useEffect)(()=>{if(!n.voicesPerModel||!j)return;let t=(0,$.jY)(e,j)||[];b(t),t.length&&(c(t[0].id),u(t[0].name||t[0].id))},[j]);let ep=async()=>{if(ee(!0),el(""),ei(""),!et.length){er(!0);try{if("hardcoded"===n.voiceSource){let t=n.voiceKey||e,s=(0,f.KC)(t).filter(e=>"tts"===(0,f.CP)(e)),a={};for(let e of s)a[e.id]||(a[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});ec(a),es(Object.values(a).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=n.apiEndpoint?n.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,s=await fetch(t),a=await s.json();if(a.error)return void ei(a.error);es(a.languages||[]),ec(a.byLang||{})}}catch(e){ei(e.message)}finally{er(!1)}}},ex=eo?et.filter(e=>e.name.toLowerCase().includes(eo.toLowerCase())||e.code.toLowerCase().includes(eo.toLowerCase())):et,eh=E?K:O,eb=n.hasVoiceIdInput&&p||d,ef=n.hasModelSelector&&j&&eb?`${r}/${j}/${eb}`:n.hasModelSelector&&j?`${r}/${j}`:eb?`${r}/${eb}`:"",eg=(t={model:ef,input:k},n.hasLanguageHint&&em&&(t.language=em),t),ey=`curl -X POST ${eh}/v1/audio/speech${"json"===U?"?response_format=json":""} \\
42
42
  -H "Content-Type: application/json" \\
43
43
  -H "Authorization: Bearer ${A||"YOUR_KEY"}" \\
44
- -d '${JSON.stringify(ef)}' \\
45
- ${"json"===U?"":"--output speech.mp3"}`,ev=async()=>{if(!k.trim()||!eg)return;V(!0),W(""),F(""),J(null);let e=Date.now();try{let t={"Content-Type":"application/json"};A&&(t.Authorization=`Bearer ${A}`);let s=`/api/v1/audio/speech${"json"===U?"?response_format=json":""}`,a=await fetch(s,{method:"POST",headers:t,body:JSON.stringify({...ef,input:k.trim()})});if(G(Date.now()-e),!a.ok){let e=await a.json().catch(()=>({}));W(e?.error?.message||e?.error||`HTTP ${a.status}`);return}if("json"===U){let e=await a.json();J(e);let t=await fetch(`data:audio/mp3;base64,${e.audio}`).then(e=>e.blob());F(URL.createObjectURL(t))}else{let e=await a.blob();F(URL.createObjectURL(e))}}catch(e){W(e.message||"Network error")}finally{V(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[eh,"/v1/audio/speech"]}),K&&(0,a.jsxs)("button",{onClick:()=>R(e=>!e),title:E?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${E?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:A?`${A.slice(0,8)}${"•".repeat(Math.min(20,A.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),n.hasModelSelector&&(n.modelKey||(0,g.KC)(e).some(e=>"tts"===(0,g.CP)(e)))&&(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:j,onChange:e=>N(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((s=(0,g.KC)(e).filter(e=>"tts"===(0,g.CP)(e))).length?s:(0,g.KC)(n.modelKey)||[]).map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),n.hasLanguageHint&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsxs)("select",{value:em,onChange:e=>eu(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:"Auto-detect"}),P.I.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.id))]})}),n.hasBrowseButton&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsx)("button",{onClick:ep,className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:y?(0,a.jsx)("span",{className:"text-text-main",children:et.find(e=>e.code===y)?.name||y}):(0,a.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,a.jsxs)("button",{onClick:ep,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),h.length>0&&(0,a.jsx)(w,{label:"Voice",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,a.jsxs)("button",{onClick:()=>{c(e.id),u(e.name),n.hasVoiceIdInput&&x(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${d===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,a.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,a.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),n.hasVoiceIdInput&&(0,a.jsx)(w,{label:"Voice ID",children:(0,a.jsx)("div",{className:"flex flex-col gap-1",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:p,onChange:e=>{x(e.target.value),c(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),p&&(0,a.jsx)("button",{type:"button",onClick:()=>{x(""),c("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})})}),n.hasLanguageDropdown&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsx)("select",{value:d,onChange:t=>{let s=(0,g.KC)(e).filter(e=>"tts"===(0,g.CP)(e)).find(e=>e.id===t.target.value);c(t.target.value),u(s?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,g.KC)(e).filter(e=>"tts"===(0,g.CP)(e)).map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,a.jsx)(w,{label:"Input",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:k,onChange:e=>C(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),k&&(0,a.jsx)("button",{type:"button",onClick:()=>C(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,a.jsx)(w,{label:"Output Format",children:(0,a.jsxs)("select",{value:U,onChange:e=>B(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,a.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>Q(ey),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:Z?"check":"content_copy"}),Z?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:ev,disabled:z||!k.trim()||!eg,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:z?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),z?"Generating...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ey})]}),H&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:H}),D?(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",Y&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",Y,"ms"]})]}),(0,a.jsxs)("a",{href:D,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,a.jsx)("audio",{controls:!0,src:D,className:"w-full"}),q&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:q.format,audio:q.audio?`${q.audio.substring(0,100)}...`:""},null,2)})]})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,a.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:_})]})]})]}),X&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>ee(!1),children:(0,a.jsxs)("div",{className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"Select Language"}),(0,a.jsx)("button",{onClick:()=>ee(!1),className:"text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,a.jsx)("input",{autoFocus:!0,value:eo,onChange:e=>el(e.target.value),placeholder:"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,a.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[en&&(0,a.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:en}),ea?(0,a.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[ex.map(e=>(0,a.jsxs)("button",{onClick:()=>{let t;return ee(!1),v(e.code),void(b(t=ed[e.code]?.voices||[]),t.length&&(c(t[0].id),u(t[0].name),n.hasVoiceIdInput&&x(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${y===e.code?"bg-primary/10 text-primary":""}`,children:[(0,a.jsx)("span",{className:"text-sm",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),y===e.code&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===ex.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}let A="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png";function I(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function E({providerId:e,kind:t}){let s=(0,i.wG)(e),r=(0,i.rs)(s)===e?s:e,n=i.rj.find(e=>e.id===t),d=N[t],c=d||{},m=(0,g.KC)(e).filter(e=>(0,g.CP)(e)===t),u=new Set(["image","video","music","imageToText"]).has(t),p=u&&0===m.length,[x,h]=(0,o.useState)(m[0]?.id??""),b=m.find(e=>e.id===x),y=!!b?.capabilities?.includes("edit"),v=!!b?.capabilities?.includes("mask"),[j,k]=(0,o.useState)(c.defaultInput||""),[C,S]=(0,o.useState)(""),[$,P]=(0,o.useState)(""),[_,T]=(0,o.useState)(()=>(c.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[R,O]=(0,o.useState)(""),[M,K]=(0,o.useState)(!1),[L,U]=(0,o.useState)(""),[B,D]=(0,o.useState)(""),[F,q]=(0,o.useState)(null),[J,z]=(0,o.useState)(null),[V,H]=(0,o.useState)(null),[W,Y]=(0,o.useState)("json"),[G,Z]=(0,o.useState)(""),[Q,X]=(0,o.useState)(!1),[ee,et]=(0,o.useState)(""),[es,ea]=(0,o.useState)([]),[er,eo]=(0,o.useState)(""),{copied:el,copy:en}=(0,f.C)(),{copied:ei,copy:ed}=(0,f.C)();if((0,o.useEffect)(()=>{U(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{O((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&D(e.publicUrl)}).catch(()=>{}),fetch("/api/providers/client").then(e=>e.json()).then(t=>{ea((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!n||!d)return null;let ec=M?B:L,em=n.endpoint.path,eu=u?x?`${r}/${x}`:p?"":r:r,ep="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===x?{image:A}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===x?{image:A,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ex=C.trim()||ep.image||"",eh=$.trim()||ep.mask_image||"",eb=I(ex),eg=I(eh),ef=Object.entries(_).reduce((e,[t,s])=>(""===s||null==s||"number"==typeof s&&Number.isNaN(s)||(e[t]=s),e),{}),ey={model:eu,[d.bodyKey]:j,...d.extraBody,...ef,...y&&ex?{image:ex}:{},...v&&eh?{mask_image:eh}:{}},ev="image"===t&&"binary"===W,ej="image"===t&&"codex"===e&&!ev,ew=`${em}${ev?"?response_format=binary":""}`,eN=`-H "Content-Type: application/json" \\
44
+ -d '${JSON.stringify(eg)}' \\
45
+ ${"json"===U?"":"--output speech.mp3"}`,ev=async()=>{if(!k.trim()||!ef)return;V(!0),W(""),F(""),J(null);let e=Date.now();try{let t={"Content-Type":"application/json"};A&&(t.Authorization=`Bearer ${A}`);let s=`/api/v1/audio/speech${"json"===U?"?response_format=json":""}`,a=await fetch(s,{method:"POST",headers:t,body:JSON.stringify({...eg,input:k.trim()})});if(G(Date.now()-e),!a.ok){let e=await a.json().catch(()=>({}));W(e?.error?.message||e?.error||`HTTP ${a.status}`);return}if("json"===U){let e=await a.json();J(e);let t=await fetch(`data:audio/mp3;base64,${e.audio}`).then(e=>e.blob());F(URL.createObjectURL(t))}else{let e=await a.blob();F(URL.createObjectURL(e))}}catch(e){W(e.message||"Network error")}finally{V(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[eh,"/v1/audio/speech"]}),K&&(0,a.jsxs)("button",{onClick:()=>R(e=>!e),title:E?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${E?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:A?`${A.slice(0,8)}${"•".repeat(Math.min(20,A.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),n.hasModelSelector&&(n.modelKey||(0,f.KC)(e).some(e=>"tts"===(0,f.CP)(e)))&&(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:j,onChange:e=>N(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((s=(0,f.KC)(e).filter(e=>"tts"===(0,f.CP)(e))).length?s:(0,f.KC)(n.modelKey)||[]).map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),n.hasLanguageHint&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsxs)("select",{value:em,onChange:e=>eu(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:"Auto-detect"}),P.I.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.id))]})}),n.hasBrowseButton&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsx)("button",{onClick:ep,className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:y?(0,a.jsx)("span",{className:"text-text-main",children:et.find(e=>e.code===y)?.name||y}):(0,a.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,a.jsxs)("button",{onClick:ep,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),h.length>0&&(0,a.jsx)(w,{label:"Voice",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,a.jsxs)("button",{onClick:()=>{c(e.id),u(e.name),n.hasVoiceIdInput&&x(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${d===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,a.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,a.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),n.hasVoiceIdInput&&(0,a.jsx)(w,{label:"Voice ID",children:(0,a.jsx)("div",{className:"flex flex-col gap-1",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:p,onChange:e=>{x(e.target.value),c(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),p&&(0,a.jsx)("button",{type:"button",onClick:()=>{x(""),c("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})})}),n.hasLanguageDropdown&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsx)("select",{value:d,onChange:t=>{let s=(0,f.KC)(e).filter(e=>"tts"===(0,f.CP)(e)).find(e=>e.id===t.target.value);c(t.target.value),u(s?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,f.KC)(e).filter(e=>"tts"===(0,f.CP)(e)).map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,a.jsx)(w,{label:"Input",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:k,onChange:e=>C(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),k&&(0,a.jsx)("button",{type:"button",onClick:()=>C(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,a.jsx)(w,{label:"Output Format",children:(0,a.jsxs)("select",{value:U,onChange:e=>B(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,a.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>Q(ey),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:Z?"check":"content_copy"}),Z?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:ev,disabled:z||!k.trim()||!ef,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:z?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),z?"Generating...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ey})]}),H&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:H}),D?(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",Y&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",Y,"ms"]})]}),(0,a.jsxs)("a",{href:D,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,a.jsx)("audio",{controls:!0,src:D,className:"w-full"}),q&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:q.format,audio:q.audio?`${q.audio.substring(0,100)}...`:""},null,2)})]})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,a.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:_})]})]})]}),X&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>ee(!1),children:(0,a.jsxs)("div",{className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"Select Language"}),(0,a.jsx)("button",{onClick:()=>ee(!1),className:"text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,a.jsx)("input",{autoFocus:!0,value:eo,onChange:e=>el(e.target.value),placeholder:"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,a.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[en&&(0,a.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:en}),ea?(0,a.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[ex.map(e=>(0,a.jsxs)("button",{onClick:()=>{let t;return ee(!1),v(e.code),void(b(t=ed[e.code]?.voices||[]),t.length&&(c(t[0].id),u(t[0].name),n.hasVoiceIdInput&&x(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${y===e.code?"bg-primary/10 text-primary":""}`,children:[(0,a.jsx)("span",{className:"text-sm",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),y===e.code&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===ex.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}let A="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png";function I(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function E({providerId:e,kind:t}){let s=(0,i.wG)(e),r=(0,i.rs)(s)===e?s:e,n=i.rj.find(e=>e.id===t),d=N[t],c=d||{},m=(0,f.KC)(e).filter(e=>(0,f.CP)(e)===t),u=new Set(["image","video","music","imageToText"]).has(t),p=u&&0===m.length,[x,h]=(0,o.useState)(m[0]?.id??""),b=m.find(e=>e.id===x),y=!!b?.capabilities?.includes("edit"),v=!!b?.capabilities?.includes("mask"),[j,k]=(0,o.useState)(c.defaultInput||""),[C,S]=(0,o.useState)(""),[$,P]=(0,o.useState)(""),[_,T]=(0,o.useState)(()=>(c.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[R,O]=(0,o.useState)(""),[M,K]=(0,o.useState)(!1),[L,U]=(0,o.useState)(""),[B,D]=(0,o.useState)(""),[F,q]=(0,o.useState)(null),[J,z]=(0,o.useState)(null),[V,H]=(0,o.useState)(null),[W,Y]=(0,o.useState)("json"),[G,Z]=(0,o.useState)(""),[Q,X]=(0,o.useState)(!1),[ee,et]=(0,o.useState)(""),[es,ea]=(0,o.useState)([]),[er,eo]=(0,o.useState)(""),{copied:el,copy:en}=(0,g.C)(),{copied:ei,copy:ed}=(0,g.C)();if((0,o.useEffect)(()=>{U(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{O((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&D(e.publicUrl)}).catch(()=>{}),fetch("/api/providers/client").then(e=>e.json()).then(t=>{ea((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!n||!d)return null;let ec=M?B:L,em=n.endpoint.path,eu=u?x?`${r}/${x}`:p?"":r:r,ep="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===x?{image:A}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===x?{image:A,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ex=C.trim()||ep.image||"",eh=$.trim()||ep.mask_image||"",eb=I(ex),ef=I(eh),eg=Object.entries(_).reduce((e,[t,s])=>(""===s||null==s||"number"==typeof s&&Number.isNaN(s)||(e[t]=s),e),{}),ey={model:eu,[d.bodyKey]:j,...d.extraBody,...eg,...y&&ex?{image:ex}:{},...v&&eh?{mask_image:eh}:{}},ev="image"===t&&"binary"===W,ej="image"===t&&"codex"===e&&!ev,ew=`${em}${ev?"?response_format=binary":""}`,eN=`-H "Content-Type: application/json" \\
46
46
  -H "Authorization: Bearer ${R||"YOUR_KEY"}"${er?` \\
47
47
  -H "x-connection-id: ${er}"`:""}${ej?` \\
48
48
  -H "Accept: text/event-stream"`:""}`,ek=`curl -X ${n.endpoint.method} ${ec}${ew} \\
49
49
  ${eN.replace(/\\\n /g,"\\\n ")} \\
50
- -d '${JSON.stringify(ey)}'${ev?" \\\n --output image.png":""}`,eC=async()=>{if(!j.trim()||!eu)return;if(X(!0),et(""),q(null),z(null),H(null),G){try{URL.revokeObjectURL(G)}catch{}Z("")}let e=Date.now();try{let t={"Content-Type":"application/json"};R&&(t.Authorization=`Bearer ${R}`),er&&(t["x-connection-id"]=er),ej&&(t.Accept="text/event-stream");let s={...ey,model:eu},a=await fetch(`/api${ew}`,{method:n.endpoint.method,headers:t,body:JSON.stringify(s)});if(!a.ok){let e=await a.json().catch(()=>({}));et(e?.error?.message||e?.error||`HTTP ${a.status}`);return}let r=a.headers.get("content-type")||"";if(r.startsWith("image/")){let t=await a.blob(),s=URL.createObjectURL(t);Z(s),q({data:{binary:!0,mime:r,size:t.size},latencyMs:Date.now()-e});return}if(r.includes("text/event-stream")&&a.body){let t=a.body.getReader(),s=new TextDecoder,r="",o=null,l=null;for(;;){let e,{done:a,value:n}=await t.read();if(a)break;for(r+=s.decode(n,{stream:!0});-1!==(e=r.indexOf("\n\n"));){let t=r.slice(0,e);r=r.slice(e+2);let s=null,a="";for(let e of t.split("\n"))e.startsWith("event:")?s=e.slice(6).trim():e.startsWith("data:")&&(a+=e.slice(5).trim());if(s)try{let e=a?JSON.parse(a):{};"progress"===s?z(e):"partial_image"===s?H(e):"done"===s?o=e:"error"===s&&(l=e?.message||"Stream error")}catch{}}}let n=Date.now()-e;if(l)return void et(l);o&&q({data:o,latencyMs:n})}else{let t=await a.json(),s=Date.now()-e;q({data:t,latencyMs:s})}}catch(e){et(e.message||"Network error")}finally{X(!1)}},eS=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(eS);let t={};for(let[s,a]of Object.entries(e))t[s]="b64_json"===s&&"string"==typeof a&&a.length>100?`<${a.length} chars base64>`:eS(a);return t},e$=F?JSON.stringify(eS(F.data),null,2):"";return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[m.length>0?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:x,onChange:e=>h(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:m.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):p?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("input",{value:x,onChange:e=>h(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[ec,em]}),B&&(0,a.jsxs)("button",{onClick:()=>K(e=>!e),title:M?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${M?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:R?`${R.slice(0,8)}${"•".repeat(Math.min(20,R.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),es.length>0&&(0,a.jsx)(w,{label:"Connection",children:(0,a.jsxs)("select",{value:er,onChange:e=>eo(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:"Auto (by priority)"}),es.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,s=e.email||e.name||e.id.slice(0,8);return(0,a.jsxs)("option",{value:e.id,children:[s,t?` [${t}]`:""]},e.id)})]})}),(0,a.jsx)(w,{label:d.inputLabel,children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:j,onChange:e=>k(e.target.value),placeholder:d.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),j&&(0,a.jsx)("button",{type:"button",onClick:()=>k(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),y&&(0,a.jsx)(w,{label:"Ref Image (URL)",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:C,onChange:e=>S(e.target.value),placeholder:ep.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,a.jsx)("button",{type:"button",onClick:()=>S(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eb&&(0,a.jsx)("img",{src:eb,alt:"Reference",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),v&&(0,a.jsx)(w,{label:"Mask (URL)",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:$,onChange:e=>P(e.target.value),placeholder:ep.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),$&&(0,a.jsx)("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eg&&(0,a.jsx)("img",{src:eg,alt:"Mask",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),(d.extraFields||[]).filter(e=>0===m.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,a.jsx)(w,{label:e.label,children:"select"===e.type?(0,a.jsx)("select",{value:_[e.key]??"",onChange:t=>T(s=>({...s,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,a.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,a.jsx)("input",{type:"text",value:_[e.key]??"",placeholder:e.placeholder,onChange:t=>T(s=>({...s,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,a.jsx)("input",{type:"number",value:_[e.key]??"",min:e.min,max:e.max,onChange:t=>T(s=>({...s,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,a.jsx)(w,{label:"Output Format",children:(0,a.jsxs)("select",{value:W,onChange:e=>Y(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,a.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>en(ek),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:el?"check":"content_copy"}),el?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:eC,disabled:Q||!j.trim()||!eu,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:Q?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),Q?"Running...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ek})]}),(Q||J)&&ej&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:Q?{animation:"spin 1s linear infinite"}:void 0,children:Q?"progress_activity":"check_circle"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[J?.stage||"starting",!Q&&J?.bytesReceived?` \xb7 ${(J.bytesReceived/1024).toFixed(1)} KB`:""]})]}),V?.b64_json&&!F&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,a.jsx)("img",{src:`data:image/png;base64,${V.b64_json}`,alt:"Partial",className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80"})]}),ee&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:ee}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",F&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",F.latencyMs,"ms"]})]}),F&&(0,a.jsxs)("button",{onClick:()=>ed(e$),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ei?"check":"content_copy"}),ei?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:F?e$:d.defaultResponse}),"image"===t&&(G||F?.data?.data?.[0])&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:G||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("img",{src:G||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url),alt:"Generated",className:"max-w-full rounded-lg border border-border"})]})]})]})]})}function R({providerId:e}){let t=(0,i.wG)(e),s=(0,g.KC)(e).filter(e=>"stt"===(0,g.CP)(e)),[r,n]=(0,o.useState)([]),d=[...s,...r],[c,m]=(0,o.useState)(s[0]?.id??""),u=d.find(e=>e.id===c),p=Array.isArray(u?.params)?u.params:[],[x,h]=(0,o.useState)(null),[b,y]=(0,o.useState)(""),[v,j]=(0,o.useState)(""),[N,k]=(0,o.useState)("json"),[C,S]=(0,o.useState)(""),[$,P]=(0,o.useState)(""),[_,T]=(0,o.useState)(!1),[A,I]=(0,o.useState)(""),[E,O]=(0,o.useState)(""),[M,K]=(0,o.useState)(null),[L,U]=(0,o.useState)(null),[B,D]=(0,o.useState)(!1),[F,q]=(0,o.useState)(""),{copied:J,copy:z}=(0,f.C)(),{copied:V,copy:H}=(0,f.C)();(0,o.useEffect)(()=>{I(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{P((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&O(e.publicUrl)}).catch(()=>{});let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{n((e.models||[]).filter(e=>"stt"===(0,g.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let W=_?E:A,Y=c?`${t}/${c}`:"",G=`curl -X POST ${W}/v1/audio/transcriptions \\
50
+ -d '${JSON.stringify(ey)}'${ev?" \\\n --output image.png":""}`,eC=async()=>{if(!j.trim()||!eu)return;if(X(!0),et(""),q(null),z(null),H(null),G){try{URL.revokeObjectURL(G)}catch{}Z("")}let e=Date.now();try{let t={"Content-Type":"application/json"};R&&(t.Authorization=`Bearer ${R}`),er&&(t["x-connection-id"]=er),ej&&(t.Accept="text/event-stream");let s={...ey,model:eu},a=await fetch(`/api${ew}`,{method:n.endpoint.method,headers:t,body:JSON.stringify(s)});if(!a.ok){let e=await a.json().catch(()=>({}));et(e?.error?.message||e?.error||`HTTP ${a.status}`);return}let r=a.headers.get("content-type")||"";if(r.startsWith("image/")){let t=await a.blob(),s=URL.createObjectURL(t);Z(s),q({data:{binary:!0,mime:r,size:t.size},latencyMs:Date.now()-e});return}if(r.includes("text/event-stream")&&a.body){let t=a.body.getReader(),s=new TextDecoder,r="",o=null,l=null;for(;;){let e,{done:a,value:n}=await t.read();if(a)break;for(r+=s.decode(n,{stream:!0});-1!==(e=r.indexOf("\n\n"));){let t=r.slice(0,e);r=r.slice(e+2);let s=null,a="";for(let e of t.split("\n"))e.startsWith("event:")?s=e.slice(6).trim():e.startsWith("data:")&&(a+=e.slice(5).trim());if(s)try{let e=a?JSON.parse(a):{};"progress"===s?z(e):"partial_image"===s?H(e):"done"===s?o=e:"error"===s&&(l=e?.message||"Stream error")}catch{}}}let n=Date.now()-e;if(l)return void et(l);o&&q({data:o,latencyMs:n})}else{let t=await a.json(),s=Date.now()-e;q({data:t,latencyMs:s})}}catch(e){et(e.message||"Network error")}finally{X(!1)}},eS=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(eS);let t={};for(let[s,a]of Object.entries(e))t[s]="b64_json"===s&&"string"==typeof a&&a.length>100?`<${a.length} chars base64>`:eS(a);return t},e$=F?JSON.stringify(eS(F.data),null,2):"";return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[m.length>0?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:x,onChange:e=>h(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:m.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):p?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("input",{value:x,onChange:e=>h(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[ec,em]}),B&&(0,a.jsxs)("button",{onClick:()=>K(e=>!e),title:M?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${M?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:R?`${R.slice(0,8)}${"•".repeat(Math.min(20,R.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),es.length>0&&(0,a.jsx)(w,{label:"Connection",children:(0,a.jsxs)("select",{value:er,onChange:e=>eo(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:"Auto (by priority)"}),es.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,s=e.email||e.name||e.id.slice(0,8);return(0,a.jsxs)("option",{value:e.id,children:[s,t?` [${t}]`:""]},e.id)})]})}),(0,a.jsx)(w,{label:d.inputLabel,children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:j,onChange:e=>k(e.target.value),placeholder:d.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),j&&(0,a.jsx)("button",{type:"button",onClick:()=>k(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),y&&(0,a.jsx)(w,{label:"Ref Image (URL)",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:C,onChange:e=>S(e.target.value),placeholder:ep.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,a.jsx)("button",{type:"button",onClick:()=>S(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eb&&(0,a.jsx)("img",{src:eb,alt:"Reference",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),v&&(0,a.jsx)(w,{label:"Mask (URL)",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:$,onChange:e=>P(e.target.value),placeholder:ep.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),$&&(0,a.jsx)("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),ef&&(0,a.jsx)("img",{src:ef,alt:"Mask",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),(d.extraFields||[]).filter(e=>0===m.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,a.jsx)(w,{label:e.label,children:"select"===e.type?(0,a.jsx)("select",{value:_[e.key]??"",onChange:t=>T(s=>({...s,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,a.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,a.jsx)("input",{type:"text",value:_[e.key]??"",placeholder:e.placeholder,onChange:t=>T(s=>({...s,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,a.jsx)("input",{type:"number",value:_[e.key]??"",min:e.min,max:e.max,onChange:t=>T(s=>({...s,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,a.jsx)(w,{label:"Output Format",children:(0,a.jsxs)("select",{value:W,onChange:e=>Y(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,a.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>en(ek),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:el?"check":"content_copy"}),el?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:eC,disabled:Q||!j.trim()||!eu,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:Q?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),Q?"Running...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ek})]}),(Q||J)&&ej&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:Q?{animation:"spin 1s linear infinite"}:void 0,children:Q?"progress_activity":"check_circle"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[J?.stage||"starting",!Q&&J?.bytesReceived?` \xb7 ${(J.bytesReceived/1024).toFixed(1)} KB`:""]})]}),V?.b64_json&&!F&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,a.jsx)("img",{src:`data:image/png;base64,${V.b64_json}`,alt:"Partial",className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80"})]}),ee&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:ee}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",F&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",F.latencyMs,"ms"]})]}),F&&(0,a.jsxs)("button",{onClick:()=>ed(e$),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ei?"check":"content_copy"}),ei?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:F?e$:d.defaultResponse}),"image"===t&&(G||F?.data?.data?.[0])&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:G||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("img",{src:G||(F?.data?.data?.[0]?.b64_json?`data:image/png;base64,${F.data.data[0].b64_json}`:F?.data?.data?.[0]?.url),alt:"Generated",className:"max-w-full rounded-lg border border-border"})]}),"video"===t&&F?.data?.data?.[0]?.url&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,a.jsxs)("a",{href:F.data.data[0].url,download:"video.mp4",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,a.jsx)("video",{src:F.data.data[0].url,controls:!0,playsInline:!0,className:"max-w-full rounded-lg border border-border"})]})]})]})]})}function R({providerId:e}){let t=(0,i.wG)(e),s=(0,f.KC)(e).filter(e=>"stt"===(0,f.CP)(e)),[r,n]=(0,o.useState)([]),d=[...s,...r],[c,m]=(0,o.useState)(s[0]?.id??""),u=d.find(e=>e.id===c),p=Array.isArray(u?.params)?u.params:[],[x,h]=(0,o.useState)(null),[b,y]=(0,o.useState)(""),[v,j]=(0,o.useState)(""),[N,k]=(0,o.useState)("json"),[C,S]=(0,o.useState)(""),[$,P]=(0,o.useState)(""),[_,T]=(0,o.useState)(!1),[A,I]=(0,o.useState)(""),[E,O]=(0,o.useState)(""),[M,K]=(0,o.useState)(null),[L,U]=(0,o.useState)(null),[B,D]=(0,o.useState)(!1),[F,q]=(0,o.useState)(""),{copied:J,copy:z}=(0,g.C)(),{copied:V,copy:H}=(0,g.C)();(0,o.useEffect)(()=>{I(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{P((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&O(e.publicUrl)}).catch(()=>{});let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{n((e.models||[]).filter(e=>"stt"===(0,f.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let W=_?E:A,Y=c?`${t}/${c}`:"",G=`curl -X POST ${W}/v1/audio/transcriptions \\
51
51
  -H "Authorization: Bearer ${$||"YOUR_KEY"}" \\
52
52
  -F "file=@${x?.name||"audio.mp3"}" \\
53
53
  -F "model=${Y}"${p.includes("language")&&b?` \\
@@ -56,4 +56,4 @@
56
56
  -F "temperature=${C}"`:""}${p.includes("prompt")&&v?` \\
57
57
  -F "prompt=${v}"`:""}`,Z=async()=>{if(!x||!Y)return;D(!0),q(""),K(null);let e=Date.now();try{let t=new FormData;t.append("file",x),t.append("model",Y),p.includes("language")&&b&&t.append("language",b),p.includes("response_format")&&t.append("response_format",N),p.includes("temperature")&&C&&t.append("temperature",C),p.includes("prompt")&&v&&t.append("prompt",v);let s={};$&&(s.Authorization=`Bearer ${$}`);let a=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:s,body:t});U(Date.now()-e);let r=(a.headers.get("content-type")||"").includes("application/json")?await a.json():await a.text();if(!a.ok)return void q(r?.error?.message||r?.error||r||`HTTP ${a.status}`);K(r)}catch(e){q(e.message||"Network error")}finally{D(!1)}},Q="string"==typeof M?M:M?JSON.stringify(M,null,2):`{
58
58
  "text": "Hello world..."
59
- }`;return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[d.length>0?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:c,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("input",{value:c,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[W,"/v1/audio/transcriptions"]}),E&&(0,a.jsxs)("button",{onClick:()=>T(e=>!e),title:_?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${_?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:$?`${$.slice(0,8)}${"•".repeat(Math.min(20,$.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,a.jsx)(w,{label:"Audio File",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsx)("input",{value:b,onChange:e=>y(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,a.jsx)(w,{label:"Prompt",children:(0,a.jsx)("input",{value:v,onChange:e=>j(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,a.jsx)(w,{label:"Temperature",children:(0,a.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:C,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,a.jsx)(w,{label:"Response Format",children:(0,a.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"json",children:"json"}),(0,a.jsx)("option",{value:"text",children:"text"}),(0,a.jsx)("option",{value:"srt",children:"srt"}),(0,a.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,a.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>z(G),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:J?"check":"content_copy"}),J?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:Z,disabled:B||!x||!Y,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:B?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),B?"Transcribing...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:G})]}),F&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:F}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",M&&L&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",L,"ms"]})]}),M&&(0,a.jsxs)("button",{onClick:()=>H(Q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:V?"check":"content_copy"}),V?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:Q})]})]})]})}function O(){let{kind:e,id:t}=(0,r.useParams)(),s=(0,r.useRouter)(),c=i.rj.find(t=>t.id===e),m=(0,i.gC)(t)&&"embedding"===e||(0,i.Ox)(t)&&"stt"===e||(0,i.U_)(t)&&"tts"===e,u=async()=>{if(confirm(`Delete this Custom ${"stt"===e?"STT":"tts"===e?"TTS":"Embedding"} node?`))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&s.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom embedding node:",e)}},[p,x]=(0,o.useState)(null),[h,g]=(0,o.useState)(m),[f,y]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(x((s.nodes||[]).find(e=>e.id===t)||null),g(!1))}).catch(()=>{e||g(!1)}),()=>{e=!0}},[t,m]),!c)return(0,r.notFound)();let v=i.Q2[t],w=(0,i.gC)(t)?"Embedding":(0,i.Ox)(t)?"STT":(0,i.U_)(t)?"TTS":"",k=m?p?{id:t,name:p.name||`Custom ${w}`,color:p.color||"#6366F1",textIcon:p.textIcon||"CE"}:null:v;if(!m&&!v||m&&!h&&!p)return(0,r.notFound)();if(m&&h)return(0,a.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let S=m?[e]:k.serviceKinds??["llm"];return m||S.includes(e)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:k.name,description:c.label,iconNode:(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-brand ring-1 ring-border-subtle",style:{backgroundColor:`${k.color}15`},children:(0,a.jsx)(n.A,{src:(0,d.k)(k.id),alt:k.name,size:36,className:"object-contain rounded max-w-[36px] max-h-[36px]",fallbackText:k.textIcon||k.id.slice(0,2).toUpperCase(),fallbackColor:k.color})}),breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:c.label,href:`/dashboard/media-providers/${e}`},{label:k.name}],actions:(0,a.jsxs)(a.Fragment,{children:[!m&&k.notice?.apiKeyUrl&&(0,a.jsxs)("a",{href:k.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>y(!0),children:"Edit"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})}),(0,a.jsxs)("div",{className:"-mt-2 flex flex-wrap items-center gap-1.5",children:[m&&(0,a.jsxs)(l.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",p?.prefix]}),S.map(t=>(0,a.jsx)(l.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]}),!m&&k.kindNotice?.[e]&&(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-sm",children:k.kindNotice[e]})]}),!m&&k.notice?.text&&!k.deprecated&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:k.notice.text}),k.notice.apiKeyUrl&&(0,a.jsx)("a",{href:k.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 →"})]}),!m&&k.noAuth?(0,a.jsx)(l.gw,{providerId:t}):(0,a.jsx)(b,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,a.jsx)(j,{providerId:t,kindFilter:e,providerAliasOverride:m?p?.prefix:void 0}),!m&&(k.searchConfig||k.fetchConfig||k.ttsConfig||k.sttConfig||k.embeddingConfig||k.searchViaChat)&&(0,a.jsx)(l.Wx,{config:"webFetch"===e?k.fetchConfig:"tts"===e?k.ttsConfig:"stt"===e?k.sttConfig:"embedding"===e?k.embeddingConfig:k.searchConfig||{mode:"chat-completions",defaultModel:k.searchViaChat?.defaultModel,pricingUrl:k.searchViaChat?.pricingUrl,freeTier:k.searchViaChat?.freeTier},provider:k,title:`${c.label} Config`}),"embedding"===e&&(0,a.jsx)(C,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,a.jsx)(T,{providerId:t}),"stt"===e&&!m&&(0,a.jsx)(R,{providerId:t}),!m&&N[e]&&(0,a.jsx)(E,{providerId:t,kind:e}),m&&(0,a.jsx)(l.x0,{isOpen:f,node:p,nodeType:(0,i.Ox)(t)?"custom-stt":(0,i.U_)(t)?"custom-tts":"custom-embedding",onClose:()=>y(!1),onSaved:e=>{x(e),y(!1)}})]}):(0,r.notFound)()}},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})}},e=>{e.O(0,[27,2563,705,1321,5497,8441,3794,7358],()=>e(e.s=11055)),_N_E=e.O()}]);
59
+ }`;return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[d.length>0?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:c,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("input",{value:c,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[W,"/v1/audio/transcriptions"]}),E&&(0,a.jsxs)("button",{onClick:()=>T(e=>!e),title:_?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${_?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:$?`${$.slice(0,8)}${"•".repeat(Math.min(20,$.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,a.jsx)(w,{label:"Audio File",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsx)("input",{value:b,onChange:e=>y(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,a.jsx)(w,{label:"Prompt",children:(0,a.jsx)("input",{value:v,onChange:e=>j(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,a.jsx)(w,{label:"Temperature",children:(0,a.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:C,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,a.jsx)(w,{label:"Response Format",children:(0,a.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"json",children:"json"}),(0,a.jsx)("option",{value:"text",children:"text"}),(0,a.jsx)("option",{value:"srt",children:"srt"}),(0,a.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,a.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>z(G),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:J?"check":"content_copy"}),J?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:Z,disabled:B||!x||!Y,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:B?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),B?"Transcribing...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:G})]}),F&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:F}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",M&&L&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",L,"ms"]})]}),M&&(0,a.jsxs)("button",{onClick:()=>H(Q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:V?"check":"content_copy"}),V?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:Q})]})]})]})}function O(){let{kind:e,id:t}=(0,r.useParams)(),s=(0,r.useRouter)(),c=i.rj.find(t=>t.id===e),m=(0,i.gC)(t)&&"embedding"===e||(0,i.Ox)(t)&&"stt"===e||(0,i.U_)(t)&&"tts"===e,u=async()=>{if(confirm(`Delete this Custom ${"stt"===e?"STT":"tts"===e?"TTS":"Embedding"} node?`))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&s.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom embedding node:",e)}},[p,x]=(0,o.useState)(null),[h,f]=(0,o.useState)(m),[g,y]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(x((s.nodes||[]).find(e=>e.id===t)||null),f(!1))}).catch(()=>{e||f(!1)}),()=>{e=!0}},[t,m]),!c)return(0,r.notFound)();let v=i.Q2[t],w=(0,i.gC)(t)?"Embedding":(0,i.Ox)(t)?"STT":(0,i.U_)(t)?"TTS":"",k=m?p?{id:t,name:p.name||`Custom ${w}`,color:p.color||"#6366F1",textIcon:p.textIcon||"CE"}:null:v;if(!m&&!v||m&&!h&&!p)return(0,r.notFound)();if(m&&h)return(0,a.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let S=m?[e]:k.serviceKinds??["llm"];return m||S.includes(e)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:k.name,description:c.label,iconNode:(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-brand ring-1 ring-border-subtle",style:{backgroundColor:`${k.color}15`},children:(0,a.jsx)(n.A,{src:(0,d.k)(k.id),alt:k.name,size:36,className:"object-contain rounded max-w-[36px] max-h-[36px]",fallbackText:k.textIcon||k.id.slice(0,2).toUpperCase(),fallbackColor:k.color})}),breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:c.label,href:`/dashboard/media-providers/${e}`},{label:k.name}],actions:(0,a.jsxs)(a.Fragment,{children:[!m&&k.notice?.apiKeyUrl&&(0,a.jsxs)("a",{href:k.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>y(!0),children:"Edit"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})}),(0,a.jsxs)("div",{className:"-mt-2 flex flex-wrap items-center gap-1.5",children:[m&&(0,a.jsxs)(l.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",p?.prefix]}),S.map(t=>(0,a.jsx)(l.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]}),!m&&k.kindNotice?.[e]&&(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-sm",children:k.kindNotice[e]})]}),!m&&k.notice?.text&&!k.deprecated&&(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:k.notice.text}),k.notice.apiKeyUrl&&(0,a.jsx)("a",{href:k.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 →"})]}),!m&&k.noAuth?(0,a.jsx)(l.gw,{providerId:t}):(0,a.jsx)(b,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,a.jsx)(j,{providerId:t,kindFilter:e,providerAliasOverride:m?p?.prefix:void 0}),!m&&(k.searchConfig||k.fetchConfig||k.ttsConfig||k.sttConfig||k.videoConfig||k.embeddingConfig||k.searchViaChat)&&(0,a.jsx)(l.Wx,{config:"webFetch"===e?k.fetchConfig:"tts"===e?k.ttsConfig:"stt"===e?k.sttConfig:"video"===e?k.videoConfig:"embedding"===e?k.embeddingConfig:k.searchConfig||{mode:"chat-completions",defaultModel:k.searchViaChat?.defaultModel,pricingUrl:k.searchViaChat?.pricingUrl,freeTier:k.searchViaChat?.freeTier},provider:k,title:`${c.label} Config`}),"embedding"===e&&(0,a.jsx)(C,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,a.jsx)(T,{providerId:t}),"stt"===e&&!m&&(0,a.jsx)(R,{providerId:t}),!m&&N[e]&&(0,a.jsx)(E,{providerId:t,kind:e}),m&&(0,a.jsx)(l.x0,{isOpen:g,node:p,nodeType:(0,i.Ox)(t)?"custom-stt":(0,i.U_)(t)?"custom-tts":"custom-embedding",onClose:()=>y(!1),onSaved:e=>{x(e),y(!1)}})]}):(0,r.notFound)()}},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})}},e=>{e.O(0,[27,9086,705,1321,5497,8441,3794,7358],()=>e(e.s=11055)),_N_E=e.O()}]);