@rsalmn/extremerouter 0.7.0 → 0.7.2

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 (1045) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +5 -2
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/routes-manifest.json +20 -0
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +12 -12
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +4 -4
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  87. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  90. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  98. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  100. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  101. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  102. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  103. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  105. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  108. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  109. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  127. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  175. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  185. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  187. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  217. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js +1 -0
  251. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -0
  252. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route_client-reference-manifest.js +1 -0
  253. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  282. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  284. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  288. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -0
  290. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -0
  291. package/app/.next-cli-build/server/app/api/pxpipe/install/route_client-reference-manifest.js +1 -0
  292. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -0
  293. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -0
  294. package/app/.next-cli-build/server/app/api/pxpipe/status/route_client-reference-manifest.js +1 -0
  295. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +2 -2
  308. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  314. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  360. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  406. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  408. package/app/.next-cli-build/server/app/callback.html +1 -1
  409. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  410. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  411. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  413. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/alerts.html +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/alerts.rsc +7 -7
  418. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard/alerts/__PAGE__.segment.rsc +2 -2
  419. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard/alerts.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  422. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_full.segment.rsc +7 -7
  423. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_head.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_index.segment.rsc +5 -5
  425. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_tree.segment.rsc +2 -2
  426. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  428. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  429. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  432. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  433. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  435. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  438. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  443. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  445. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  448. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  452. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  453. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  455. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  458. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  462. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  463. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  465. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  468. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  474. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  476. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  477. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  479. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  484. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  486. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  487. package/app/.next-cli-build/server/app/dashboard/overview.html +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/overview.rsc +7 -7
  489. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard/overview/__PAGE__.segment.rsc +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard/overview.segment.rsc +1 -1
  491. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  493. package/app/.next-cli-build/server/app/dashboard/overview.segments/_full.segment.rsc +7 -7
  494. package/app/.next-cli-build/server/app/dashboard/overview.segments/_head.segment.rsc +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/overview.segments/_index.segment.rsc +5 -5
  496. package/app/.next-cli-build/server/app/dashboard/overview.segments/_tree.segment.rsc +2 -2
  497. package/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/playground.rsc +7 -7
  499. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  501. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  503. package/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +7 -7
  504. package/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +5 -5
  506. package/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +2 -2
  507. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  508. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  509. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  510. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  514. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  516. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  517. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  519. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  520. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  521. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  525. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  527. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  528. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  529. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  530. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  532. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  534. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  535. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  537. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  538. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  539. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  540. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  541. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  542. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  543. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  544. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  545. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  547. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  549. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  550. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  551. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  552. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  553. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  554. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  555. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  556. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  557. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  559. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  560. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  562. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  563. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  564. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  566. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  568. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  570. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  571. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  573. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  574. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  577. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  578. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  579. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  580. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  581. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  582. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  583. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  584. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  585. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  586. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  587. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  588. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  589. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  590. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  591. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  592. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  593. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  594. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  595. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  596. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  597. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  598. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  599. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  600. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  601. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  602. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  603. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  604. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  605. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  606. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  607. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  608. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  609. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  610. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  611. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  612. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  613. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  614. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  615. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  616. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  617. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  618. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  619. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  620. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  621. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  622. package/app/.next-cli-build/server/app/index.html +1 -1
  623. package/app/.next-cli-build/server/app/index.rsc +5 -5
  624. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  625. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  626. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  627. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  628. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  629. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  630. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  631. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  632. package/app/.next-cli-build/server/app/landing.html +1 -1
  633. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  634. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  635. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  636. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  637. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  638. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  639. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  640. package/app/.next-cli-build/server/app/login/page.js +2 -2
  641. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  642. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  643. package/app/.next-cli-build/server/app/login.html +1 -1
  644. package/app/.next-cli-build/server/app/login.rsc +6 -6
  645. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  646. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  647. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  648. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  649. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  650. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  651. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  652. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  653. package/app/.next-cli-build/server/app/page.js +2 -2
  654. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  655. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  656. package/app/.next-cli-build/server/app-paths-manifest.json +5 -2
  657. package/app/.next-cli-build/server/chunks/1051.js +1 -1
  658. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  659. package/app/.next-cli-build/server/chunks/1477.js +1 -0
  660. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  661. package/app/.next-cli-build/server/chunks/212.js +1 -1
  662. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  663. package/app/.next-cli-build/server/chunks/2701.js +1 -1
  664. package/app/.next-cli-build/server/chunks/2722.js +1 -1
  665. package/app/.next-cli-build/server/chunks/318.js +13 -9
  666. package/app/.next-cli-build/server/chunks/3735.js +1 -0
  667. package/app/.next-cli-build/server/chunks/412.js +5 -5
  668. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  669. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  670. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  671. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  672. package/app/.next-cli-build/server/chunks/615.js +1 -1
  673. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  674. package/app/.next-cli-build/server/chunks/6316.js +2 -2
  675. package/app/.next-cli-build/server/chunks/6638.js +1 -0
  676. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  677. package/app/.next-cli-build/server/chunks/6777.js +1 -1
  678. package/app/.next-cli-build/server/chunks/788.js +1 -1
  679. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  680. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  681. package/app/.next-cli-build/server/chunks/8833.js +3 -3
  682. package/app/.next-cli-build/server/chunks/8881.js +1 -0
  683. package/app/.next-cli-build/server/chunks/8895.js +5 -5
  684. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  685. package/app/.next-cli-build/server/chunks/9422.js +1 -1
  686. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  687. package/app/.next-cli-build/server/chunks/9630.js +1 -1
  688. package/app/.next-cli-build/server/chunks/9703.js +2 -2
  689. package/app/.next-cli-build/server/chunks/9903.js +1 -1
  690. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  691. package/app/.next-cli-build/server/middleware.js +1 -1
  692. package/app/.next-cli-build/server/pages/404.html +1 -1
  693. package/app/.next-cli-build/server/pages/500.html +1 -1
  694. package/app/.next-cli-build/static/chunks/1321-767de793890bdf8c.js +1 -0
  695. package/app/.next-cli-build/static/chunks/5497-09625960ec618fe0.js +7 -0
  696. package/app/.next-cli-build/static/chunks/{6069-a4cd5af243707b67.js → 6069-6b96289a846b5144.js} +6 -6
  697. package/app/.next-cli-build/static/chunks/705-197061b2f061280b.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/alerts/page-4a622e705e5c4efc.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-0858623d4e6bc8d9.js → page-70b66ef1b070a378.js} +1 -1
  700. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-6d0b92899909f933.js → page-e8d14560b2019a5f.js} +12 -12
  701. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-a27c538ea71ebf8a.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-5e3375dcb5344f35.js +4 -0
  703. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-e1875ca8be7183eb.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/page-4ffb884f6b54afb0.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-1e4e44e8b9d5d986.js +10 -0
  706. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-0fb5e4d7aabfb5d2.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-5fc4c9e1400d741e.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-73e504f021474182.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-6235a5ba123759b2.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/_global-error/page-ef8b722482bf88a8.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-ef8b722482bf88a8.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-ef8b722482bf88a8.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-ef8b722482bf88a8.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-ef8b722482bf88a8.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-ef8b722482bf88a8.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-ef8b722482bf88a8.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-ef8b722482bf88a8.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-ef8b722482bf88a8.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/cache/route-ef8b722482bf88a8.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-ef8b722482bf88a8.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-ef8b722482bf88a8.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-ef8b722482bf88a8.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-ef8b722482bf88a8.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-ef8b722482bf88a8.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-ef8b722482bf88a8.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-ef8b722482bf88a8.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-ef8b722482bf88a8.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-ef8b722482bf88a8.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-ef8b722482bf88a8.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-ef8b722482bf88a8.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-ef8b722482bf88a8.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-ef8b722482bf88a8.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-ef8b722482bf88a8.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-ef8b722482bf88a8.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-ef8b722482bf88a8.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-ef8b722482bf88a8.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-ef8b722482bf88a8.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/combos/route-ef8b722482bf88a8.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-ef8b722482bf88a8.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-ef8b722482bf88a8.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-ef8b722482bf88a8.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-ef8b722482bf88a8.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/health/route-ef8b722482bf88a8.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-ef8b722482bf88a8.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/init/route-ef8b722482bf88a8.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-ef8b722482bf88a8.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/keys/route-ef8b722482bf88a8.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/locale/route-ef8b722482bf88a8.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-ef8b722482bf88a8.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-ef8b722482bf88a8.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-ef8b722482bf88a8.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-ef8b722482bf88a8.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-ef8b722482bf88a8.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-ef8b722482bf88a8.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-ef8b722482bf88a8.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-ef8b722482bf88a8.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-ef8b722482bf88a8.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-ef8b722482bf88a8.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-ef8b722482bf88a8.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/models/route-ef8b722482bf88a8.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/models/test/route-ef8b722482bf88a8.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-ef8b722482bf88a8.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-ef8b722482bf88a8.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-ef8b722482bf88a8.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-ef8b722482bf88a8.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-ef8b722482bf88a8.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-ef8b722482bf88a8.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-ef8b722482bf88a8.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-ef8b722482bf88a8.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-ef8b722482bf88a8.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-ef8b722482bf88a8.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-ef8b722482bf88a8.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-ef8b722482bf88a8.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-ef8b722482bf88a8.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/pricing/route-ef8b722482bf88a8.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-ef8b722482bf88a8.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-ef8b722482bf88a8.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-ef8b722482bf88a8.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-ef8b722482bf88a8.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-ef8b722482bf88a8.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-ef8b722482bf88a8.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-ef8b722482bf88a8.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-ef8b722482bf88a8.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-ef8b722482bf88a8.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-ef8b722482bf88a8.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-ef8b722482bf88a8.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-ef8b722482bf88a8.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-ef8b722482bf88a8.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-ef8b722482bf88a8.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-ef8b722482bf88a8.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/providers/route-ef8b722482bf88a8.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-ef8b722482bf88a8.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-ef8b722482bf88a8.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-ef8b722482bf88a8.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-ef8b722482bf88a8.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-ef8b722482bf88a8.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-ef8b722482bf88a8.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-ef8b722482bf88a8.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-ef8b722482bf88a8.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-ef8b722482bf88a8.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-ef8b722482bf88a8.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-ef8b722482bf88a8.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-ef8b722482bf88a8.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-ef8b722482bf88a8.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-ef8b722482bf88a8.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/settings/route-ef8b722482bf88a8.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-ef8b722482bf88a8.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-ef8b722482bf88a8.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-ef8b722482bf88a8.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/tags/route-ef8b722482bf88a8.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-ef8b722482bf88a8.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-ef8b722482bf88a8.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-ef8b722482bf88a8.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-ef8b722482bf88a8.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-ef8b722482bf88a8.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-ef8b722482bf88a8.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-ef8b722482bf88a8.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-ef8b722482bf88a8.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-ef8b722482bf88a8.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-ef8b722482bf88a8.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-ef8b722482bf88a8.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-ef8b722482bf88a8.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-ef8b722482bf88a8.js +1 -0
  824. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-ef8b722482bf88a8.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-ef8b722482bf88a8.js +1 -0
  826. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-ef8b722482bf88a8.js +1 -0
  827. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-ef8b722482bf88a8.js +1 -0
  828. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-ef8b722482bf88a8.js +1 -0
  829. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-ef8b722482bf88a8.js +1 -0
  830. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-ef8b722482bf88a8.js +1 -0
  831. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-ef8b722482bf88a8.js +1 -0
  832. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-ef8b722482bf88a8.js +1 -0
  833. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-ef8b722482bf88a8.js +1 -0
  834. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-ef8b722482bf88a8.js +1 -0
  835. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-ef8b722482bf88a8.js +1 -0
  836. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-ef8b722482bf88a8.js +1 -0
  837. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-ef8b722482bf88a8.js +1 -0
  838. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-ef8b722482bf88a8.js +1 -0
  839. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-ef8b722482bf88a8.js +1 -0
  840. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-ef8b722482bf88a8.js +1 -0
  841. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-ef8b722482bf88a8.js +1 -0
  842. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-ef8b722482bf88a8.js +1 -0
  843. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-ef8b722482bf88a8.js +1 -0
  844. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-ef8b722482bf88a8.js +1 -0
  845. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-ef8b722482bf88a8.js +1 -0
  846. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-ef8b722482bf88a8.js +1 -0
  847. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-ef8b722482bf88a8.js +1 -0
  848. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-ef8b722482bf88a8.js +1 -0
  849. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-ef8b722482bf88a8.js +1 -0
  850. package/app/.next-cli-build/static/chunks/app/api/v1/route-ef8b722482bf88a8.js +1 -0
  851. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-ef8b722482bf88a8.js +1 -0
  852. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-ef8b722482bf88a8.js +1 -0
  853. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-ef8b722482bf88a8.js +1 -0
  854. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-ef8b722482bf88a8.js +1 -0
  855. package/app/.next-cli-build/static/chunks/app/api/version/route-ef8b722482bf88a8.js +1 -0
  856. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-ef8b722482bf88a8.js +1 -0
  857. package/app/.next-cli-build/static/chunks/app/api/version/update/route-ef8b722482bf88a8.js +1 -0
  858. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-ef8b722482bf88a8.js +1 -0
  859. package/app/.next-cli-build/static/chunks/app/page-ef8b722482bf88a8.js +1 -0
  860. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-ef8b722482bf88a8.js +1 -0
  861. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-ef8b722482bf88a8.js +1 -0
  862. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-ef8b722482bf88a8.js +1 -0
  863. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-ef8b722482bf88a8.js +1 -0
  864. package/app/.next-cli-build/static/css/5dcaa119b622f73a.css +1 -0
  865. package/app/.next-cli-build/static/zG5Y3KIUIUTgefLUSHfaI/_buildManifest.js +1 -0
  866. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-shm +0 -0
  867. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-wal +0 -0
  868. package/app/package.json +80 -80
  869. package/app/public/providers/devin.svg +5 -0
  870. package/app/public/providers/featherless.svg +8 -0
  871. package/app/public/providers/moonshot.svg +8 -0
  872. package/app/public/providers/perplexity-agent.svg +13 -0
  873. package/app/public/providers/qwencloud.svg +6 -0
  874. package/app/src/lib/network/pickProxyPoolId.js +38 -0
  875. package/package.json +1 -1
  876. package/app/.next-cli-build/server/chunks/8142.js +0 -1
  877. package/app/.next-cli-build/static/chunks/1321-c2673b86ae099f7a.js +0 -1
  878. package/app/.next-cli-build/static/chunks/5497-4a46de726a80ec4c.js +0 -7
  879. package/app/.next-cli-build/static/chunks/705-88c44a85ef2fa706.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/alerts/page-9f05c495f92fb578.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-04df212b392a7049.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-6ff0b7ef268b9f96.js +0 -4
  883. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-a6ff642180bb6c33.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/page-02c60e92de70e467.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-bc74cf85727e59c8.js +0 -10
  886. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-88b8c16ff41dc468.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-1b66539173748945.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-2ebb6e5a67759dda.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-f2b0f4a782580e21.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/_global-error/page-7321cb331506637b.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-7321cb331506637b.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-7321cb331506637b.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-7321cb331506637b.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-7321cb331506637b.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-7321cb331506637b.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-7321cb331506637b.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-7321cb331506637b.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-7321cb331506637b.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/cache/route-7321cb331506637b.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-7321cb331506637b.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-7321cb331506637b.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-7321cb331506637b.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-7321cb331506637b.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-7321cb331506637b.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-7321cb331506637b.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-7321cb331506637b.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-7321cb331506637b.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-7321cb331506637b.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-7321cb331506637b.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-7321cb331506637b.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-7321cb331506637b.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-7321cb331506637b.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-7321cb331506637b.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-7321cb331506637b.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-7321cb331506637b.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-7321cb331506637b.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-7321cb331506637b.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/combos/route-7321cb331506637b.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-7321cb331506637b.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-7321cb331506637b.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-7321cb331506637b.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-7321cb331506637b.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/health/route-7321cb331506637b.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-7321cb331506637b.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/init/route-7321cb331506637b.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-7321cb331506637b.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/keys/route-7321cb331506637b.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/locale/route-7321cb331506637b.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-7321cb331506637b.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-7321cb331506637b.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-7321cb331506637b.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-7321cb331506637b.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-7321cb331506637b.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-7321cb331506637b.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-7321cb331506637b.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-7321cb331506637b.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-7321cb331506637b.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-7321cb331506637b.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-7321cb331506637b.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/models/route-7321cb331506637b.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/models/test/route-7321cb331506637b.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-7321cb331506637b.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-7321cb331506637b.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-7321cb331506637b.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-7321cb331506637b.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-7321cb331506637b.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-7321cb331506637b.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-7321cb331506637b.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-7321cb331506637b.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-7321cb331506637b.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-7321cb331506637b.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-7321cb331506637b.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-7321cb331506637b.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-7321cb331506637b.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/pricing/route-7321cb331506637b.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-7321cb331506637b.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-7321cb331506637b.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-7321cb331506637b.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-7321cb331506637b.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-7321cb331506637b.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-7321cb331506637b.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-7321cb331506637b.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-7321cb331506637b.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-7321cb331506637b.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-7321cb331506637b.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-7321cb331506637b.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-7321cb331506637b.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-7321cb331506637b.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-7321cb331506637b.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/providers/route-7321cb331506637b.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-7321cb331506637b.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-7321cb331506637b.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-7321cb331506637b.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-7321cb331506637b.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-7321cb331506637b.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-7321cb331506637b.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-7321cb331506637b.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-7321cb331506637b.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-7321cb331506637b.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-7321cb331506637b.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-7321cb331506637b.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-7321cb331506637b.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/settings/route-7321cb331506637b.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-7321cb331506637b.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-7321cb331506637b.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-7321cb331506637b.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/tags/route-7321cb331506637b.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-7321cb331506637b.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-7321cb331506637b.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-7321cb331506637b.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-7321cb331506637b.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-7321cb331506637b.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-7321cb331506637b.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-7321cb331506637b.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-7321cb331506637b.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-7321cb331506637b.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-7321cb331506637b.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-7321cb331506637b.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-7321cb331506637b.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-7321cb331506637b.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-7321cb331506637b.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-7321cb331506637b.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-7321cb331506637b.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-7321cb331506637b.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-7321cb331506637b.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-7321cb331506637b.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-7321cb331506637b.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-7321cb331506637b.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-7321cb331506637b.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-7321cb331506637b.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-7321cb331506637b.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-7321cb331506637b.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-7321cb331506637b.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-7321cb331506637b.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-7321cb331506637b.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-7321cb331506637b.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-7321cb331506637b.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-7321cb331506637b.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-7321cb331506637b.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-7321cb331506637b.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-7321cb331506637b.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-7321cb331506637b.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-7321cb331506637b.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-7321cb331506637b.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-7321cb331506637b.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-7321cb331506637b.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/v1/route-7321cb331506637b.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-7321cb331506637b.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-7321cb331506637b.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-7321cb331506637b.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-7321cb331506637b.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/version/route-7321cb331506637b.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-7321cb331506637b.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/version/update/route-7321cb331506637b.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-7321cb331506637b.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/page-7321cb331506637b.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-7321cb331506637b.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-7321cb331506637b.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-7321cb331506637b.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-7321cb331506637b.js +0 -1
  1041. package/app/.next-cli-build/static/css/a024ae3118bec883.css +0 -1
  1042. package/app/.next-cli-build/static/p-3kW8XDeBLQg0sl_rzmI/_buildManifest.js +0 -1
  1043. /package/app/.next-cli-build/static/{p-3kW8XDeBLQg0sl_rzmI → zG5Y3KIUIUTgefLUSHfaI}/_ssgManifest.js +0 -0
  1044. /package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/{upgrade-0.6.5-to-0.6.6-0.6.6-20260707-011739 → upgrade-0.6.9-to-0.7.0-0.7.0-20260715-111110}/data.sqlite +0 -0
  1045. /package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/{upgrade-0.6.6-to-0.6.7-0.6.7-20260708-103430 → upgrade-0.7.0-to-0.7.1-0.7.1-20260718-003406}/data.sqlite +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{41095:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>R});var a=s(95155),r=s(73321);s(98500);var o=s(12115),l=s(35497),n=s(57250),i=s(88105),d=s(70217),c=s(14051),m=s.n(c);function u({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 p({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:n,onMoveUp:i,onMoveDown:c,onToggleActive:m,onUpdateProxy:x,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}`:"",A="",T=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(T)try{let e=new URL(T);A=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{A=T}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 x("__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:c,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,d.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)(u,{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:_}),A&&(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:A}),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 x({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),[h,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"})})]}),h&&(0,a.jsx)(l.Ex,{variant:"success"===h?"success":"error",children:"success"===h?"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 h({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),[b,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)}}})},A=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)}},T=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)(p,{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=>A(e.id,t),onUpdateProxy:t=>T(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)(x,{isOpen:m,provider:e,proxyPools:n,onSave:I,onClose:()=>u(!1)}),(0,a.jsx)(l.wI,{isOpen:b,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"})]})}u.propTypes={until:m().string.isRequired},p.propTypes={connection:m().shape({id:m().string,name:m().string,email:m().string,displayName:m().string,testStatus:m().string,isActive:m().bool,lastError:m().string,priority:m().number}).isRequired,proxyPools:m().array,isOAuth:m().bool.isRequired,isFirst:m().bool.isRequired,isLast:m().bool.isRequired,onMoveUp:m().func.isRequired,onMoveDown:m().func.isRequired,onToggleActive:m().func.isRequired,onUpdateProxy:m().func,onEdit:m().func.isRequired,onDelete:m().func.isRequired},x.propTypes={isOpen:m().bool.isRequired,provider:m().string,providerName:m().string,proxyPools:m().array,onSave:m().func.isRequired,onClose:m().func.isRequired},h.propTypes={providerId:m().string.isRequired,isOAuth:m().bool};var b=s(28777),g=s(11059);function f({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 y({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 v({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,j]=(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",A=(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)(()=>{A()},[A]);let T=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 A()}catch(e){console.log("set alias error:",e)}},I=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}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 A(),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 A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},O=async e=>{if(!h){j(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{j(null)}}},M=(0,b.KC)(e),K=t?M.filter(e=>e.kinds?e.kinds.includes(t):(0,b.CP)(e,"llm")===t):M,L=m.filter(e=>e.providerAlias===P&&(0,b.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)(f,{model:e,fullModel:`${P}/${e.id}`,alias:s,copied:r,onCopy:n,onSetAlias:t=>T(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)(f,{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)(y,{isOpen:k,onSave:async e=>{await E(e),C(!1)},onClose:()=>C(!1)})]})}function j({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})]})}f.propTypes={model:m().shape({id:m().string.isRequired}).isRequired,fullModel:m().string.isRequired,copied:m().string,onCopy:m().func.isRequired,testStatus:m().oneOf(["ok","error"]),isCustom:m().bool,isFree:m().bool,onDeleteAlias:m().func,onTest:m().func,isTesting:m().bool},y.propTypes={isOpen:m().bool.isRequired,onSave:m().func.isRequired,onClose:m().func.isRequired},v.propTypes={providerId:m().string.isRequired,kindFilter:m().string,providerAliasOverride:m().string};let w={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],{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}`:"",A="",T=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(T)try{let e=new URL(T);A=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{A=T}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:_}),A&&(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:A}),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)}}})},A=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)}},T=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=>A(e.id,t),onUpdateProxy:t=>T(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",A=(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)(()=>{A()},[A]);let T=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 A()}catch(e){console.log("set alias error:",e)}},I=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}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 A(),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 A(),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=>T(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
  ]
@@ -21,7 +21,7 @@
21
21
  "data": [
22
22
  { "url": "...", "format": "mp3" }
23
23
  ]
24
- }`}},N=`{
24
+ }`}},k=`{
25
25
  "object": "list",
26
26
  "data": [{
27
27
  "object": "embedding",
@@ -30,30 +30,30 @@
30
30
  }],
31
31
  "model": "...",
32
32
  "usage": { "prompt_tokens": 9, "total_tokens": 9 }
33
- }`;function k({providerId:e,customAlias:t}){let s=(0,i.gC)(e),r=s?t||e:(0,i.wG)(e),n=s?[]:(0,b.KC)(e).filter(e=>"embedding"===(0,b.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,f]=(0,o.useState)(""),[y,v]=(0,o.useState)(!1),[w,C]=(0,o.useState)(""),[S,$]=(0,o.useState)(""),[P,_]=(0,o.useState)(null),[A,T]=(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)(()=>{C(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{f((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:w,B=d?`${r}/${d}`:"",U=()=>{let e={model:B,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),[A,T]=(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,B=d?`${r}/${d}`:"",U=()=>{let e={model:B,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
- -d '${JSON.stringify(U())}'`,F=async()=>{if(!m.trim()||!B)return;T(!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(U())}),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{T(!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)(j,{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)(j,{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):C(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)(j,{label:"API Key",children:(0,a.jsx)("input",{type:"password",value:h,onChange:e=>f(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)(j,{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)(j,{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:A||!m.trim()||!B,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:A?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),A?"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 N;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 C={"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=s(717),$=s(91781);let P=`// Audio will appear here after running.
36
+ -d '${JSON.stringify(U())}'`,F=async()=>{if(!m.trim()||!B)return;T(!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(U())}),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{T(!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:A||!m.trim()||!B,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:A?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),A?"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.
37
37
  // Example JSON response (response_format=json):
38
38
  {
39
39
  "format": "mp3",
40
40
  "audio": "//NExAANaAIIAUAAANNNNNNNN..." // base64 encoded MP3
41
- }`;function _({providerId:e}){let t,s,r=(0,i.wG)(e),n=C[e]||C["edge-tts"],[d,c]=(0,o.useState)(n.defaultVoiceId||""),[m,u]=(0,o.useState)(""),[p,x]=(0,o.useState)(n.defaultVoiceId||""),[h,f]=(0,o.useState)([]),[y,v]=(0,o.useState)(""),[w,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,b.KC)(n.modelKey);return e?.[0]?.id||""}return""}),[k,A]=(0,o.useState)("Hello, this is a text to speech test."),[T,I]=(0,o.useState)(""),[E,R]=(0,o.useState)(!1),[O,M]=(0,o.useState)(""),[K,L]=(0,o.useState)(""),[B,U]=(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,b.KC)(n.modelKey)?.[0]?.id||"",s=n.voicesPerModel&&t?(0,S.jY)(e,t)||[]:(0,b.KC)(n.voiceKey||e).filter(e=>"tts"===(0,b.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),f([{id:e.id,name:e.name}])}else f(s),c(s[0].id),u(s[0].name||s[0].id)}},[e]),(0,o.useEffect)(()=>{if(!n.voicesPerModel||!w)return;let t=(0,S.jY)(e,w)||[];f(t),t.length&&(c(t[0].id),u(t[0].name||t[0].id))},[w]);let ep=async()=>{if(ee(!0),el(""),ei(""),!et.length){er(!0);try{if("hardcoded"===n.voiceSource){let t=n.voiceKey||e,s=(0,b.KC)(t).filter(e=>"tts"===(0,b.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&&w&&eb?`${r}/${w}/${eb}`:n.hasModelSelector&&w?`${r}/${w}`: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"===B?"?response_format=json":""} \\
41
+ }`;function A({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."),[T,I]=(0,o.useState)(""),[E,R]=(0,o.useState)(!1),[O,M]=(0,o.useState)(""),[K,L]=(0,o.useState)(""),[B,U]=(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"===B?"?response_format=json":""} \\
42
42
  -H "Content-Type: application/json" \\
43
43
  -H "Authorization: Bearer ${T||"YOUR_KEY"}" \\
44
- -d '${JSON.stringify(ef)}' \\
45
- ${"json"===B?"":"--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"};T&&(t.Authorization=`Bearer ${T}`);let s=`/api/v1/audio/speech${"json"===B?"?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"===B){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)(j,{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)(j,{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:T?`${T.slice(0,8)}${"•".repeat(Math.min(20,T.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),n.hasModelSelector&&(n.modelKey||(0,b.KC)(e).some(e=>"tts"===(0,b.CP)(e)))&&(0,a.jsx)(j,{label:"Model",children:(0,a.jsx)("select",{value:w,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,b.KC)(e).filter(e=>"tts"===(0,b.CP)(e))).length?s:(0,b.KC)(n.modelKey)||[]).map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),n.hasLanguageHint&&(0,a.jsx)(j,{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"}),$.I.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.id))]})}),n.hasBrowseButton&&(0,a.jsx)(j,{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)(j,{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)(j,{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)(j,{label:"Language",children:(0,a.jsx)("select",{value:d,onChange:t=>{let s=(0,b.KC)(e).filter(e=>"tts"===(0,b.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,b.KC)(e).filter(e=>"tts"===(0,b.CP)(e)).map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,a.jsx)(j,{label:"Input",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:k,onChange:e=>A(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:()=>A(""),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)(j,{label:"Output Format",children:(0,a.jsxs)("select",{value:B,onChange:e=>U(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:P})]})]})]}),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(f(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 T(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function I({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=w[t],c=d||{},m=(0,b.KC)(e).filter(e=>(0,b.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??""),f=m.find(e=>e.id===x),y=!!f?.capabilities?.includes("edit"),v=!!f?.capabilities?.includes("mask"),[N,k]=(0,o.useState)(c.defaultInput||""),[C,S]=(0,o.useState)(""),[$,P]=(0,o.useState)(""),[_,E]=(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,B]=(0,o.useState)(""),[U,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)(()=>{B(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?U: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=T(ex),eg=T(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]:N,...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"===B?"":"--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"};T&&(t.Authorization=`Bearer ${T}`);let s=`/api/v1/audio/speech${"json"===B?"?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"===B){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:T?`${T.slice(0,8)}${"•".repeat(Math.min(20,T.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:B,onChange:e=>U(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 T="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)(""),[_,A]=(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,B]=(0,o.useState)(""),[U,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)(()=>{B(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?U: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:T}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===x?{image:T,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(!N.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)(j,{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)(j,{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)(j,{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]}),U&&(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)(j,{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)(j,{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)(j,{label:d.inputLabel,children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{value:N,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"}),N&&(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)(j,{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)(j,{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(f?.params)&&f.params.includes(e.key)).map(e=>(0,a.jsx)(j,{label:e.label,children:"select"===e.type?(0,a.jsx)("select",{value:_[e.key]??"",onChange:t=>E(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=>E(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=>E(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)(j,{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||!N.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 E({providerId:e}){let t=(0,i.wG)(e),s=(0,b.KC)(e).filter(e=>"stt"===(0,b.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),[f,y]=(0,o.useState)(""),[v,w]=(0,o.useState)(""),[N,k]=(0,o.useState)("json"),[C,S]=(0,o.useState)(""),[$,P]=(0,o.useState)(""),[_,A]=(0,o.useState)(!1),[T,I]=(0,o.useState)(""),[R,O]=(0,o.useState)(""),[M,K]=(0,o.useState)(null),[L,B]=(0,o.useState)(null),[U,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,b.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=_?R:T,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]}),U&&(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=>A(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=>A(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=>A(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,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)(""),[_,A]=(0,o.useState)(!1),[T,I]=(0,o.useState)(""),[E,O]=(0,o.useState)(""),[M,K]=(0,o.useState)(null),[L,B]=(0,o.useState)(null),[U,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:T,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
- -F "model=${Y}"${p.includes("language")&&f?` \\
54
- -F "language=${f}"`:""}${p.includes("response_format")?` \\
53
+ -F "model=${Y}"${p.includes("language")&&b?` \\
54
+ -F "language=${b}"`:""}${p.includes("response_format")?` \\
55
55
  -F "response_format=${N}"`:""}${p.includes("temperature")&&C?` \\
56
56
  -F "temperature=${C}"`:""}${p.includes("prompt")&&v?` \\
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")&&f&&t.append("language",f),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});B(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):`{
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});B(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)(j,{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)(j,{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)(j,{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"]}),R&&(0,a.jsxs)("button",{onClick:()=>A(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)(j,{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)(j,{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)(j,{label:"Language",children:(0,a.jsx)("input",{value:f,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)(j,{label:"Prompt",children:(0,a.jsx)("input",{value:v,onChange:e=>w(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)(j,{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)(j,{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:U||!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:U?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),U?"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 R(){let{kind:e,id:t}=(0,r.useParams)(),s=(0,r.useRouter)(),d=i.rj.find(t=>t.id===e),c=(0,i.gC)(t)&&"embedding"===e,m=async()=>{if(confirm("Delete this Custom 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)}},[u,p]=(0,o.useState)(null),[x,b]=(0,o.useState)(c),[g,f]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if(!c)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(p((s.nodes||[]).find(e=>e.id===t)||null),b(!1))}).catch(()=>{e||b(!1)}),()=>{e=!0}},[t,c]),!d)return(0,r.notFound)();let y=i.Q2[t],j=c?u?{id:t,name:u.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:y;if(!c&&!y||c&&!x&&!u)return(0,r.notFound)();if(c&&x)return(0,a.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let N=c?["embedding"]:j.serviceKinds??["llm"];return c||N.includes(e)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:j.name,description:d.label,iconNode:(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-brand ring-1 ring-border-subtle",style:{backgroundColor:`${j.color}15`},children:(0,a.jsx)(n.A,{src:`/providers/${j.id}.png`,alt:j.name,size:36,className:"object-contain rounded max-w-[36px] max-h-[36px]",fallbackText:j.textIcon||j.id.slice(0,2).toUpperCase(),fallbackColor:j.color})}),breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:d.label,href:`/dashboard/media-providers/${e}`},{label:j.name}],actions:(0,a.jsxs)(a.Fragment,{children:[!c&&j.notice?.apiKeyUrl&&(0,a.jsxs)("a",{href:j.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"]}),c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>f(!0),children:"Edit"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:m,children:"Delete"})]})]})}),(0,a.jsxs)("div",{className:"-mt-2 flex flex-wrap items-center gap-1.5",children:[c&&(0,a.jsxs)(l.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",u?.prefix]}),N.map(t=>(0,a.jsx)(l.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]}),!c&&j.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:j.kindNotice[e]})]}),!c&&j.notice?.text&&!j.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:j.notice.text}),j.notice.apiKeyUrl&&(0,a.jsx)("a",{href:j.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 →"})]}),!c&&j.noAuth?(0,a.jsx)(l.gw,{providerId:t}):(0,a.jsx)(h,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,a.jsx)(v,{providerId:t,kindFilter:e,providerAliasOverride:c?u?.prefix:void 0}),!c&&(j.searchConfig||j.fetchConfig||j.ttsConfig||j.sttConfig||j.embeddingConfig||j.searchViaChat)&&(0,a.jsx)(l.Wx,{config:"webFetch"===e?j.fetchConfig:"tts"===e?j.ttsConfig:"stt"===e?j.sttConfig:"embedding"===e?j.embeddingConfig:j.searchConfig||{mode:"chat-completions",defaultModel:j.searchViaChat?.defaultModel,pricingUrl:j.searchViaChat?.pricingUrl,freeTier:j.searchViaChat?.freeTier},provider:j,title:`${d.label} Config`}),"embedding"===e&&(0,a.jsx)(k,{providerId:t,customAlias:u?.prefix}),"tts"===e&&(0,a.jsx)(_,{providerId:t}),"stt"===e&&!c&&(0,a.jsx)(E,{providerId:t}),!c&&w[e]&&(0,a.jsx)(I,{providerId:t,kind:e}),c&&(0,a.jsx)(l.x0,{isOpen:g,node:u,onClose:()=>f(!1),onSaved:e=>{p(e),f(!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})},85460:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=85460)),_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:()=>A(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:U||!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:U?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),U?"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,u=async()=>{if(confirm("Delete this Custom 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=m?p?{id:t,name:p.name||"Custom Embedding",color:"#6366F1",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 k=m?["embedding"]:w.serviceKinds??["llm"];return m||k.includes(e)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:w.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:`${w.color}15`},children:(0,a.jsx)(n.A,{src:(0,d.k)(w.id),alt:w.name,size:36,className:"object-contain rounded max-w-[36px] max-h-[36px]",fallbackText:w.textIcon||w.id.slice(0,2).toUpperCase(),fallbackColor:w.color})}),breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:c.label,href:`/dashboard/media-providers/${e}`},{label:w.name}],actions:(0,a.jsxs)(a.Fragment,{children:[!m&&w.notice?.apiKeyUrl&&(0,a.jsxs)("a",{href:w.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]}),k.map(t=>(0,a.jsx)(l.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]}),!m&&w.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:w.kindNotice[e]})]}),!m&&w.notice?.text&&!w.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:w.notice.text}),w.notice.apiKeyUrl&&(0,a.jsx)("a",{href:w.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&&w.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&&(w.searchConfig||w.fetchConfig||w.ttsConfig||w.sttConfig||w.embeddingConfig||w.searchViaChat)&&(0,a.jsx)(l.Wx,{config:"webFetch"===e?w.fetchConfig:"tts"===e?w.ttsConfig:"stt"===e?w.sttConfig:"embedding"===e?w.embeddingConfig:w.searchConfig||{mode:"chat-completions",defaultModel:w.searchViaChat?.defaultModel,pricingUrl:w.searchViaChat?.pricingUrl,freeTier:w.searchViaChat?.freeTier},provider:w,title:`${c.label} Config`}),"embedding"===e&&(0,a.jsx)(C,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,a.jsx)(A,{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,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})},85460:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=85460)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6620],{16144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var i=t(95155),a=t(73321),r=t(98500),n=t.n(r),o=t(12115),l=t(35497),c=t(57250),d=t(88105),m=t(8247);let x=new Set([]),h={image:"image-combo",tts:"tts-combo"};function p(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function u({provider:e,kind:s,connections:t,isCustom:a,onToggle:r}){let o=d.Q2[e.id],x=!!o?.noAuth,h=t.filter(s=>s.provider===e.id),f=h.filter(e=>{let s=p(e);return"active"===s||"success"===s}).length,b=h.filter(e=>{let s=p(e);return"error"===s||"expired"===s||"unavailable"===s}).length,g=h.length,j=g>0&&h.every(e=>!1===e.isActive);return(0,i.jsx)(n(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${j?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:(0,m.k)(e.id),alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[a&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),x?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):j?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===g?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[f>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[f," Connected"]}),b>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[b," Error"]}),0===f&&0===b&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[g," Added"]})]})]})]})]}),g>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),r&&r(e.id,j)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!j,onChange:()=>{},title:j?"Enable provider":"Disable provider"})})]})})})}function f({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(n(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,i.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:(0,m.k)(t),alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function b(){let{kind:e}=(0,a.useParams)(),s=(0,a.useRouter)(),[t,r]=(0,o.useState)([]),[n,c]=(0,o.useState)([]),[m,p]=(0,o.useState)([]),[b,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{("webSearch"===e||"webFetch"===e)&&s.replace("/dashboard/media-providers/web")},[e,s]);let j=d.rj.find(s=>s.id===e),v="embedding"===e,N=x.has(e);if((0,o.useEffect)(()=>{j&&(fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>r(e.connections||[])).catch(()=>{}),v&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>c((e.nodes||[]).filter(e=>"custom-embedding"===e.type))).catch(()=>{}),N&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>p(e.combos||[])).catch(()=>{}))},[v,N,j]),!j)return(0,a.notFound)();let k=(0,d.o5)(e),y=m.filter(s=>s.kind===e),w=n.map(e=>({id:e.id,name:e.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"})),C=[...k,...w],E=async(e,s)=>{let i=t.filter(s=>s.provider===e);r(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(i.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},$=async()=>{let t=h[e]||`${e}-combo`,i=t,a=1,r=new Set(m.map(e=>e.name));for(;r.has(i);)i=`${t}-${a++}`;let n=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,models:[],kind:e})});if(n.ok){let e=await n.json();s.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await n.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsx)(l.zY,{title:j?.label||e,description:`Manage your ${j?.label||e} providers`,icon:j?.icon||"perm_media",actions:(v||N)&&(0,i.jsxs)(i.Fragment,{children:[N&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:$,children:"Create Combo"}),v&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>g(!0),children:"Add Custom Embedding"})]})}),N&&y.length>0&&(0,i.jsx)(f,{combos:y}),0===C.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:j.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[k.map(s=>(0,i.jsx)(u,{provider:s,kind:e,connections:t,onToggle:E},s.id)),w.map(s=>(0,i.jsx)(u,{provider:s,kind:e,connections:t,isCustom:!0,onToggle:E},s.id))]}),v&&(0,i.jsx)(l.x0,{isOpen:b,onClose:()=>g(!1),onCreated:e=>{c(s=>[...s,e]),g(!1)}})]})}},42349:(e,s,t)=>{Promise.resolve().then(t.bind(t,16144))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=42349)),_N_E=e.O()}]);
@@ -0,0 +1,4 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8334],{12654:(e,t,a)=>{Promise.resolve().then(a.bind(a,22662))},22662:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>p});var s=a(95155),l=a(73321),r=a(12115);a(98500);var i=a(35497),n=a(57250),o=a(88105),d=a(8247);let c=/^[a-zA-Z0-9_.\-]+$/,m={webSearch:"Web Search",webFetch:"Web Fetch",image:"Text to Image",tts:"Text To Speech"},x={webSearch:"/v1/search",webFetch:"/v1/web/fetch",image:"/v1/images/generations",tts:"/v1/audio/speech"},h={webSearch:e=>({model:e,query:"What is the latest news about AI?",search_type:"web",max_results:5}),webFetch:e=>({model:e,url:"https://example.com",format:"markdown"}),image:e=>({model:e,prompt:"A cute cat playing piano",n:1,size:"1024x1024"}),tts:e=>({model:e,input:"Hello, this is a test.",voice:"alloy"})};function u(e){return"webSearch"===e||"webFetch"===e?"/dashboard/media-providers/web":`/dashboard/media-providers/${e}`}function p(){let{id:e}=(0,l.useParams)(),t=(0,l.useRouter)(),[a,p]=(0,r.useState)(null),[b,f]=(0,r.useState)(!0),[j,g]=(0,r.useState)(""),[w,v]=(0,r.useState)(""),[y,k]=(0,r.useState)([]),[N,S]=(0,r.useState)(!1),[$,U]=(0,r.useState)(!1),[C,O]=(0,r.useState)([]),[_,T]=(0,r.useState)(!1),[R,A]=(0,r.useState)(null),[P,L]=(0,r.useState)(""),[z,E]=(0,r.useState)(""),[D,F]=(0,r.useState)([]),[M,I]=(0,r.useState)({}),J=async()=>{try{let[t,a,s,l,r,i]=await Promise.all([fetch(`/api/combos/${e}`,{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"}),fetch("/api/usage/logs",{cache:"no-store"}),fetch("/api/keys",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]);if(i.ok&&I((await i.json()).aliases||{}),l.ok){let e=await l.json();E((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}if(r.ok&&F((await r.json()).connections||[]),!t.ok){p(null),f(!1);return}let n=await t.json();p(n),g(n.name),k(n.models||[]);let o=a.ok?await a.json():{};S(o.comboStrategies?.[n.name]?.fallbackStrategy==="round-robin");let d=s.ok?await s.json():[];O(d.filter(e=>"string"==typeof e&&e.includes(n.name)).slice(0,50))}catch{}f(!1)};(0,r.useEffect)(()=>{J()},[e]);let W=e=>e.trim()?c.test(e)?(v(""),!0):(v("Only letters, numbers, -, _ and ."),!1):(v("Name is required"),!1),H=async t=>{let a=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return!!a.ok||(alert((await a.json()).error||"Failed to save"),!1)},Z=async()=>{!W(j)||j===a.name||await H({name:j})&&await J()},q=async e=>{let t=e?.value||e;if(!t||y.includes(t))return;let a=[...y,t];k(a),await H({models:a})},B=async e=>{let t=e?.value||e;if(!t||!y.includes(t))return;let a=y.filter(e=>e!==t);k(a),await H({models:a})},Y=async e=>{let t=y.filter((t,a)=>a!==e);k(t),await H({models:t})},G=async(e,t)=>{let a=[...y],s=e+t;s<0||s>=a.length||([a[e],a[s]]=[a[s],a[e]],k(a),await H({models:a}))},K=async e=>{S(e);let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).comboStrategies||{}};e?s[a.name]={fallbackStrategy:"round-robin"}:delete s[a.name],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:s})})},Q=async()=>{!confirm(`Delete combo "${a.name}"?`)||(await fetch(`/api/combos/${e}`,{method:"DELETE"})).ok&&t.push(u(a.kind))},V=async()=>{if(T(!0),A(null),L(""),R?.audioUrl)try{URL.revokeObjectURL(R.audioUrl)}catch{}if(R?.imageUrl?.startsWith("blob:"))try{URL.revokeObjectURL(R.imageUrl)}catch{}let e=Date.now();try{let t=x[a.kind],s=h[a.kind](a.name),l={"Content-Type":"application/json"};z&&(l.Authorization=`Bearer ${z}`);let r=await fetch(`/api${t}`,{method:"POST",headers:l,body:JSON.stringify(s)}),i=Date.now()-e;if(!r.ok){let e=await r.json().catch(()=>({}));L(e?.error?.message||e?.error||`HTTP ${r.status}`),A({json:JSON.stringify(e,null,2),latencyMs:i});return}let n=r.headers.get("content-type")||"";if(n.startsWith("image/")){let e=await r.blob();A({imageUrl:URL.createObjectURL(e),latencyMs:i});return}if(n.startsWith("audio/")||"application/octet-stream"===n){let e=await r.blob();A({audioUrl:URL.createObjectURL(e),latencyMs:i});return}let o=await r.json(),d=o?.data?.[0],c=d?.b64_json?`data:image/png;base64,${d.b64_json}`:d?.url||"";A({json:JSON.stringify(function e(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);let a={};for(let[s,l]of Object.entries(t))a[s]="b64_json"===s&&"string"==typeof l&&l.length>100?`<${l.length} chars base64>`:e(l);return a}(o),null,2),imageUrl:c,latencyMs:i})}catch(e){L(e.message||"Network error")}T(!1)};if(b)return(0,s.jsx)("div",{className:"text-text-muted text-sm",children:"Loading..."});if(!a)return(0,l.notFound)();let X=m[a.kind]||o.rj.find(e=>e.id===a.kind)?.label||"Combo",ee=x[a.kind],et=a.kind&&h[a.kind]?h[a.kind](a.name):null,ea=ee?`curl -X POST http://localhost:20128${ee} \\
2
+ -H "Content-Type: application/json" \\
3
+ -H "Authorization: Bearer ${z||"YOUR_KEY"}" \\
4
+ -d '${JSON.stringify(et)}'`:"";return u(a.kind),(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(i.zY,{title:a.name,description:`${X} Combo`,icon:"layers",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${a.kind}`},{label:`${X} Combos`,href:`/dashboard/media-providers/${a.kind}`},{label:a.name}],actions:(0,s.jsx)(i.$n,{variant:"outline",size:"sm",icon:"delete",onClick:Q,children:"Delete"})}),(0,s.jsxs)(i.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Settings"}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(i.pd,{label:"Combo Name",value:j,onChange:e=>{g(e.target.value),W(e.target.value)},onBlur:Z,error:w}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and ."})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Round Robin"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Rotate providers across requests instead of strict fallback order."})]}),(0,s.jsx)(i.lM,{checked:N,onChange:K})]})]})]}),(0,s.jsxs)(i.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Providers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Tried in order (top-down) or rotated when round-robin is on."})]}),(0,s.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>U(!0),children:"Add Provider"})]}),0===y.length?(0,s.jsx)("div",{className:"text-center py-6 border border-dashed border-border rounded-lg text-text-muted text-sm",children:"No providers yet."}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:y.map((e,t)=>{let{providerId:a,model:l}=function(e){if("string"!=typeof e)return{providerId:"",model:""};let t=e.indexOf("/");return t<0?{providerId:e,model:""}:{providerId:e.slice(0,t),model:e.slice(t+1)}}(e),r=o.Q2[a];return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted w-5 text-center",children:t+1}),(0,s.jsx)(n.A,{src:(0,d.k)(a),alt:r?.name||a,size:24,className:"object-contain rounded shrink-0",fallbackText:r?.textIcon||a.slice(0,2).toUpperCase(),fallbackColor:r?.color}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium truncate",children:r?.name||a}),l&&(0,s.jsx)("code",{className:"text-[10px] text-text-muted font-mono truncate block",children:l})]}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:()=>G(t,-1),disabled:0===t,className:`p-1 rounded ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,title:"Move up",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:()=>G(t,1),disabled:t===y.length-1,className:`p-1 rounded ${t===y.length-1?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,title:"Move down",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_downward"})}),(0,s.jsx)("button",{onClick:()=>Y(t),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:"Remove",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]})]},`${e}-${t}`)})})]}),a.kind&&ee&&(0,s.jsxs)(i.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Test Example"}),(0,s.jsx)(i.$n,{size:"sm",icon:"play_arrow",onClick:V,disabled:_||0===y.length,children:_?"Running...":"Run"})]}),(0,s.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-x-auto whitespace-pre-wrap break-all",children:ea}),P&&(0,s.jsx)("p",{className:"mt-3 text-xs text-red-500 break-words",children:P}),R&&(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[null!=R.latencyMs&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:["⚡ ",R.latencyMs,"ms"]}),R.imageUrl&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:R.imageUrl,download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("img",{src:R.imageUrl,alt:"Generated",className:"max-w-full rounded-lg border border-border"})]}),R.audioUrl&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:R.audioUrl,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("audio",{controls:!0,src:R.audioUrl,className:"w-full"})]}),R.json&&(0,s.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[300px] whitespace-pre-wrap break-all",children:R.json})]})]}),(0,s.jsxs)(i.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Usage Logs"}),0===C.length?(0,s.jsx)("p",{className:"text-xs text-text-muted italic",children:"No usage yet."}):(0,s.jsx)("pre",{className:"text-[11px] font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[400px] whitespace-pre-wrap",children:C.join("\n")})]}),(0,s.jsx)(i.rq,{isOpen:$,onClose:()=>U(!1),onSelect:q,onDeselect:B,activeProviders:D,modelAliases:M,title:`Add ${X} Model`,kindFilter:a.kind,addedModelValues:y,closeOnSelect:!1})]})}}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=12654)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9260],{71088:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>u});var r=t(95155),a=t(98500),i=t.n(a),l=t(12115),c=t(73321),o=t(35497),n=t(57250),d=t(88105),m=t(8247);function x(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function h({provider:e,kind:s,connections:t}){let a=d.Q2[e.id],l=!!a?.noAuth,c=t.filter(s=>s.provider===e.id),p=c.filter(e=>{let s=x(e);return"active"===s||"success"===s}).length,b=c.filter(e=>{let s=x(e);return"error"===s||"expired"===s||"unavailable"===s}).length,u=c.length,f=u>0&&c.every(e=>!1===e.isActive);return(0,r.jsx)(i(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${f?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,r.jsx)(n.A,{src:(0,m.k)(e.id),alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,r.jsx)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:l?(0,r.jsx)(o.Ex,{variant:"success",size:"sm",children:"Ready"}):f?(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===u?(0,r.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,r.jsxs)(r.Fragment,{children:[p>0&&(0,r.jsxs)(o.Ex,{variant:"success",size:"sm",dot:!0,children:[p," Connected"]}),b>0&&(0,r.jsxs)(o.Ex,{variant:"error",size:"sm",dot:!0,children:[b," Error"]}),0===p&&0===b&&(0,r.jsxs)(o.Ex,{variant:"default",size:"sm",children:[u," Added"]})]})})]})]})})})}function p({combos:e}){return 0===e.length?(0,r.jsx)("p",{className:"text-xs text-text-muted italic",children:"No combos yet."}):(0,r.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,r.jsx)(i(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,r.jsx)(o.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,r.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,r.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,r.jsx)(n.A,{src:(0,m.k)(t),alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,r.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function b({title:e,icon:s,kind:t,providers:a,connections:i,combos:l,onCreateCombo:c}){return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary",children:s}),(0,r.jsx)("h2",{className:"text-base font-semibold",children:e}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["(",a.length," providers \xb7 ",l.length," combos)"]})]}),(0,r.jsx)(o.$n,{size:"sm",icon:"add",onClick:c,children:"Create Combo"})]}),l.length>0&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(p,{combos:l})}),0===a.length?(0,r.jsx)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl text-text-muted text-sm",children:"No providers."}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:a.map(e=>(0,r.jsx)(h,{provider:e,kind:t,connections:i},e.id))})]})}function u(){let e=(0,c.useRouter)(),[s,t]=(0,l.useState)([]),[a,i]=(0,l.useState)([]),n=async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"})]);e.ok&&t((await e.json()).connections||[]),s.ok&&i((await s.json()).combos||[])}catch{}};(0,l.useEffect)(()=>{n()},[]);let m=(0,d.o5)("webSearch"),x=(0,d.o5)("webFetch"),h=a.filter(e=>"webSearch"===e.kind),p=a.filter(e=>"webFetch"===e.kind),u=async s=>{let t="webSearch"===s?"search-combo":"fetch-combo",r=t,i=1,l=new Set(a.map(e=>e.name));for(;l.has(r);)r=`${t}-${i++}`;let c=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r,models:[],kind:s})});if(c.ok){let s=await c.json();e.push(`/dashboard/media-providers/combo/${s.id}`)}else alert((await c.json()).error||"Failed to create combo")};return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsx)(o.zY,{title:"Web Fetch & Search",description:"Web search and web fetch providers",icon:"travel_explore"}),(0,r.jsx)(b,{title:"Web Search",icon:"search",kind:"webSearch",providers:m,connections:s,combos:h,onCreateCombo:()=>u("webSearch")}),(0,r.jsx)("div",{className:"border-t border-border"}),(0,r.jsx)(b,{title:"Web Fetch",icon:"travel_explore",kind:"webFetch",providers:x,connections:s,combos:p,onCreateCombo:()=>u("webFetch")})]})}},84147:(e,s,t)=>{Promise.resolve().then(t.bind(t,71088))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=84147)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3645],{73411:(e,s,t)=>{Promise.resolve().then(t.bind(t,98378))},98378:(e,s,t)=>{"use strict";t.d(s,{default:()=>j});var a=t(95155),r=t(12115),n=t(35497),i=t(14051),l=t.n(i);let o=e=>{let s=Number(e||0);return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()},c=[{key:"rtk",label:"RTK",icon:"compress",color:"text-primary"},{key:"headroom",label:"Headroom",icon:"air",color:"text-info"},{key:"pxpipe",label:"Pxpipe",icon:"image_search",color:"text-secondary"},{key:"cache",label:"Cache",icon:"cached",color:"text-success"},{key:"caveman",label:"Caveman",icon:"short_text",color:"text-warning"},{key:"ponytail",label:"Ponytail",icon:"notes",color:"text-accent"}];function d({breakdown:e}){let s=c.map(s=>({...s,value:e?.[s.key]||0})).filter(e=>e.value>0);return 0===s.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No per-mechanism data yet."}):(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:s.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[11px] font-medium",title:`${e.label}: ${e.value.toLocaleString()} tokens saved`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[12px] ${e.color}`,children:e.icon}),(0,a.jsx)("span",{className:"text-text-muted",children:e.label}),(0,a.jsx)("span",{className:"font-semibold text-text-main",children:o(e.value)})]},e.key))})}let m=[{key:"tokensSaved",icon:"savings",color:"success",label:"Tokens Saved",sub:"All token savers",expandable:!0},{key:"requestsRouted",icon:"route",color:"primary",label:"Requests Routed",sub:"Lifetime"},{key:"cacheTokens",icon:"cached",color:"info",label:"Cache Tokens",sub:"From cache reads"}];function x({data:e}){let[s,t]=(0,r.useState)(!1);if(!e)return null;let n={tokensSaved:e.tokensSavedLifetime,requestsRouted:e.totalRequestsLifetime,cacheTokens:e.totalCachedTokens};return(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:m.map(r=>{let i=r.expandable&&s;return(0,a.jsxs)("div",{className:`flex flex-col gap-2 rounded-panel border bg-panel p-5 shadow-[var(--shadow-soft)] ${r.expandable?"cursor-pointer transition-colors hover:border-primary/30":"border-border-subtle"} ${i?"border-primary/30":"border-border-subtle"}`,onClick:r.expandable?()=>t(e=>!e):void 0,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:`flex size-10 items-center justify-center rounded-brand ring-1 ${{success:"bg-success/10 text-success ring-success/20",primary:"bg-primary/10 text-primary ring-primary/20",info:"bg-info/10 text-info ring-info/20"}[r.color]}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:r.icon})}),(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)("span",{className:"text-2xl font-bold text-text-main",children:o(n[r.key])})}),r.expandable&&(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${i?"rotate-180":""}`,children:"expand_more"})]}),(0,a.jsx)("div",{className:"text-sm font-medium text-text-main",children:r.label}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:r.sub}),i&&"tokensSaved"===r.key&&(0,a.jsxs)("div",{className:"mt-2 border-t border-border-subtle pt-2",children:[(0,a.jsx)("p",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Breakdown by mechanism"}),(0,a.jsx)(d,{breakdown:e.tokensSavedByMechanism}),e.semanticCacheHits>0&&(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] align-middle text-success",children:"bolt"})," ",e.semanticCacheHits.toLocaleString()," cache hits served from Semantic Cache"]})]})]},r.key)})})}x.propTypes={data:l().object};let p=[{key:"rtkEnabled",name:"RTK Token Saver",icon:"compress"},{key:"headroomEnabled",name:"Headroom",icon:"cloud_compress"},{key:"pxpipeEnabled",name:"Pxpipe",icon:"image_search"},{key:"semanticCacheEnabled",name:"Semantic Cache",icon:"cached"},{key:"cavemanEnabled",name:"Caveman Mode",icon:"cottage"},{key:"ponytailEnabled",name:"Ponytail",icon:"cut"}];function u({settings:e}){return e?(0,a.jsx)("div",{className:"flex flex-wrap gap-3",children:p.map(s=>{let t=!!e[s.key];return(0,a.jsxs)("div",{className:`flex items-center gap-2 rounded-brand border px-3 py-2 transition-colors ${t?"border-success/30 bg-success/5":"border-border-subtle bg-surface-2"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${t?"text-success":"text-text-muted"}`,children:s.icon}),(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:s.name}),(0,a.jsx)(n.Ex,{variant:t?"success":"default",size:"sm",dot:!0,children:t?"Active":"Off"})]},s.key)})}):null}u.propTypes={settings:l().object};var h=t(98500),b=t.n(h),g=t(57250),f=t(8247);let v=e=>{let s=Number(e||0);return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()};function y({providers:e}){return e&&0!==e.length?(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:e.map(e=>{let s=e.color||"#6b7280",t=s.length>7?s:s+"15";return(0,a.jsxs)(b(),{href:`/dashboard/providers/${e.id}`,className:"group flex items-center gap-3 rounded-brand border border-border-subtle bg-panel px-3 py-2.5 shadow-[var(--shadow-soft)] transition-all hover:border-primary/35 hover:bg-panel-elev hover:shadow-[var(--shadow-warm)]",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:t},children:(0,a.jsx)(g.A,{src:(0,f.k)(e.id),alt:e.name,size:24,className:"object-contain rounded max-w-[24px] max-h-[24px]",fallbackText:(e.name||e.id).slice(0,2).toUpperCase(),fallbackColor:s})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"truncate text-sm font-semibold text-text-main",children:e.name}),(0,a.jsx)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:e.requests>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"font-medium",children:[v(e.requests)," requests"]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[v(e.tokens)," tokens"]})]}):e.connected?(0,a.jsxs)("span",{className:"flex items-center gap-1 text-success",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-success"}),"Connected"]}):(0,a.jsx)("span",{children:"No usage yet"})})]})]},e.id)})}):(0,a.jsx)(n.pp,{icon:"redeem",title:"No free providers used yet",description:"Connect a free provider (Kiro, OpenCode, etc.) and start routing requests to see usage here."})}function j(){let[e,s]=(0,r.useState)(null),[t,i]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{fetch("/api/usage/meta").then(e=>e.json()).then(e=>{e.error||s(e)}).catch(()=>{}).finally(()=>i(!1))},[]),t)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(n.zY,{title:"Overview",description:"Gateway summary, savings, and free-tier usage",icon:"dashboard"}),(0,a.jsx)(n.Qv,{}),(0,a.jsx)(n.Qv,{})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(n.zY,{title:"Overview",description:"Gateway summary, savings, and free-tier usage",icon:"dashboard"}),(0,a.jsx)(x,{data:e}),(0,a.jsx)(n.Zp,{title:"Token Savers",subtitle:"Input compression and output optimization",icon:"savings",padding:"sm",children:(0,a.jsx)(u,{settings:e?.tokenSaverSettings})}),(0,a.jsx)(n.Zp,{title:"Free Providers Used",subtitle:"Providers with no API cost routing through your gateway",icon:"redeem",padding:"sm",children:(0,a.jsx)(y,{providers:e?.freeProviders||[]})})]})}y.propTypes={providers:l().arrayOf(l().shape({id:l().string,name:l().string,icon:l().string,color:l().string,requests:l().number,tokens:l().number}))}}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=73411)),_N_E=e.O()}]);