vansrouter 0.9.99 → 0.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (640) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +13 -13
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/react-loadable-manifest.json +2 -2
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-fitness/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.rsc +2 -2
  82. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +2 -2
  83. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +2 -2
  88. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  89. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  91. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  92. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  93. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  94. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  96. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  99. package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +6 -5
  109. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  111. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  124. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  128. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  130. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  132. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +4 -3
  136. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  140. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  142. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/fitness/clear/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/proxy-pools/fitness/clear-all/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/proxy-pools/fitness/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +3 -3
  265. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  333. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  335. package/app/.next-cli-build/server/app/callback.html +1 -1
  336. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  337. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  338. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  340. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  341. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  345. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  346. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  349. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  350. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  352. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  353. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  355. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  356. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  359. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  360. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  362. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  363. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  365. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  366. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  369. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  370. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  372. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  374. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  375. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  376. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  379. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  380. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  382. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  384. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  385. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  386. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  390. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  391. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  393. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  394. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  396. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  397. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  400. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  401. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  403. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  404. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  406. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  407. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  410. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  411. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  413. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  416. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  417. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  421. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  422. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  424. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  425. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  427. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  431. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  432. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  434. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  435. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.html +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.rsc +6 -6
  437. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness/__PAGE__.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard/proxy-fitness.segment.rsc +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  441. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_full.segment.rsc +6 -6
  442. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_head.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_index.segment.rsc +4 -4
  444. package/app/.next-cli-build/server/app/dashboard/proxy-fitness.segments/_tree.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  447. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  448. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  451. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  452. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  454. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  455. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  457. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  458. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  462. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
  464. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  465. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  467. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  468. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  471. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  472. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  473. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  474. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  475. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  476. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  480. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  481. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  483. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  486. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  490. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  491. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  495. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  497. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  500. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  501. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  503. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  504. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  505. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  507. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  508. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  510. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  511. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  514. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  515. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  517. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  520. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  525. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  527. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  528. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  529. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  530. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  532. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  534. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  536. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  537. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  538. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  539. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  540. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  541. package/app/.next-cli-build/server/app/landing.html +1 -1
  542. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  543. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  544. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  546. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  547. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  549. package/app/.next-cli-build/server/app/login/page.js +1 -1
  550. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  551. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  552. package/app/.next-cli-build/server/app/login.html +1 -1
  553. package/app/.next-cli-build/server/app/login.rsc +5 -5
  554. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  555. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  556. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  557. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  559. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  560. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  561. package/app/.next-cli-build/server/app/masuk/page.js +1 -1
  562. package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
  563. package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
  564. package/app/.next-cli-build/server/app-paths-manifest.json +13 -13
  565. package/app/.next-cli-build/server/chunks/1253.js +1 -1
  566. package/app/.next-cli-build/server/chunks/1586.js +1 -0
  567. package/app/.next-cli-build/server/chunks/1632.js +1 -1
  568. package/app/.next-cli-build/server/chunks/224.js +1 -1
  569. package/app/.next-cli-build/server/chunks/2262.js +1 -1
  570. package/app/.next-cli-build/server/chunks/2445.js +1 -1
  571. package/app/.next-cli-build/server/chunks/2557.js +5 -5
  572. package/app/.next-cli-build/server/chunks/2764.js +1 -1
  573. package/app/.next-cli-build/server/chunks/32.js +1 -1
  574. package/app/.next-cli-build/server/chunks/3539.js +1 -1
  575. package/app/.next-cli-build/server/chunks/3736.js +1 -1
  576. package/app/.next-cli-build/server/chunks/3750.js +1 -1
  577. package/app/.next-cli-build/server/chunks/4004.js +2 -2
  578. package/app/.next-cli-build/server/chunks/4121.js +1 -1
  579. package/app/.next-cli-build/server/chunks/4132.js +1 -0
  580. package/app/.next-cli-build/server/chunks/4502.js +6 -6
  581. package/app/.next-cli-build/server/chunks/4574.js +10 -10
  582. package/app/.next-cli-build/server/chunks/4816.js +1 -1
  583. package/app/.next-cli-build/server/chunks/4836.js +1 -1
  584. package/app/.next-cli-build/server/chunks/5006.js +2 -2
  585. package/app/.next-cli-build/server/chunks/5009.js +1 -1
  586. package/app/.next-cli-build/server/chunks/5050.js +1 -1
  587. package/app/.next-cli-build/server/chunks/5302.js +1 -1
  588. package/app/.next-cli-build/server/chunks/5577.js +1 -1
  589. package/app/.next-cli-build/server/chunks/5598.js +1 -1
  590. package/app/.next-cli-build/server/chunks/622.js +1 -1
  591. package/app/.next-cli-build/server/chunks/6385.js +1 -1
  592. package/app/.next-cli-build/server/chunks/6723.js +1 -1
  593. package/app/.next-cli-build/server/chunks/7010.js +1 -1
  594. package/app/.next-cli-build/server/chunks/7074.js +1 -1
  595. package/app/.next-cli-build/server/chunks/7104.js +1 -1
  596. package/app/.next-cli-build/server/chunks/7834.js +1 -0
  597. package/app/.next-cli-build/server/chunks/7916.js +1 -1
  598. package/app/.next-cli-build/server/chunks/7950.js +1 -1
  599. package/app/.next-cli-build/server/chunks/8711.js +1 -1
  600. package/app/.next-cli-build/server/chunks/912.js +1 -1
  601. package/app/.next-cli-build/server/chunks/9984.js +1 -1
  602. package/app/.next-cli-build/server/instrumentation.js +1 -1
  603. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  604. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  605. package/app/.next-cli-build/server/middleware.js +2 -2
  606. package/app/.next-cli-build/server/pages/404.html +1 -1
  607. package/app/.next-cli-build/server/pages/500.html +1 -1
  608. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  609. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  610. package/app/.next-cli-build/static/chunks/{1731-1db5ca0c20180658.js → 1731-da520113514b1a8e.js} +1 -0
  611. package/app/.next-cli-build/static/chunks/2940-f9ef37d2c1ee1858.js +1 -0
  612. package/app/.next-cli-build/static/chunks/4385-f174ba7bd8d55a16.js +1 -0
  613. package/app/.next-cli-build/static/chunks/{5479-4214d11ddca13cd7.js → 5479-a561d2bd06a771d3.js} +1 -1
  614. package/app/.next-cli-build/static/chunks/8914-28038867caf43f95.js +27 -0
  615. package/app/.next-cli-build/static/chunks/{9131-d2c897637a43297d.js → 9131-4cf620c77c678902.js} +2 -2
  616. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7554227adda5679e.js +12 -0
  617. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-80c1ebd9abd4c7d8.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-c82d74f5a3484fcd.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-d4ec8046e367735f.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/landing/page-b601562162c7ca0e.js +1 -0
  621. package/app/.next-cli-build/static/chunks/{webpack-a93413593916815e.js → webpack-6535fa1f2bd12da8.js} +1 -1
  622. package/app/.next-cli-build/static/css/f2afce53f9efcbe5.css +1 -0
  623. package/app/custom-server.js +5 -0
  624. package/app/package.json +8 -5
  625. package/app/src/mitm/server.js +27 -27
  626. package/package.json +1 -1
  627. package/src/cli/menus/providers.js +4 -1
  628. package/app/.next-cli-build/server/chunks/6685.js +0 -1
  629. package/app/.next-cli-build/server/chunks/8857.js +0 -1
  630. package/app/.next-cli-build/static/chunks/2940-7bddea6bffcea4aa.js +0 -1
  631. package/app/.next-cli-build/static/chunks/4385-c87cdb3beb184733.js +0 -1
  632. package/app/.next-cli-build/static/chunks/8914-878835816a5f05d4.js +0 -27
  633. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-19b29a55b52a2ed9.js +0 -12
  634. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-cca5ff9425339efb.js +0 -1
  635. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-15c53720e24055bc.js +0 -1
  636. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-40ce04b1b6199f3a.js +0 -1
  637. package/app/.next-cli-build/static/chunks/app/landing/page-dc8b7015bd680bce.js +0 -1
  638. package/app/.next-cli-build/static/css/170aaccd50e74dd7.css +0 -1
  639. /package/app/.next-cli-build/static/{DEvbhZaKhFHleOIAerxk2 → v41gJTKLtRvPbsQjRtfLb}/_buildManifest.js +0 -0
  640. /package/app/.next-cli-build/static/{DEvbhZaKhFHleOIAerxk2 → v41gJTKLtRvPbsQjRtfLb}/_ssgManifest.js +0 -0
@@ -1,12 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{6:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>L});var s=a(15102),i=a(82030),l=a(93278),o=a(93885),r=a.n(o);a(37837),a(19965);var n=a(31704),d=a(92940),c=a(31038),m=a(55223),p=a(58788),x=a(47236);a(5477);let u={base:["none","low","medium","high"],onOff:["none","thinking"],openai:["none","minimal","low","medium","high","xhigh"],levelMax:["none","low","medium","high","max"],budgetX:["none","low","medium","high","xhigh","max"],gemini:["minimal","low","medium","high"],hiMax:["none","high","max"]},h={openai:u.openai,"claude-adaptive":u.levelMax,"claude-budget":u.budgetX,"gemini-level":u.gemini,"gemini-budget":u.base,zai:u.onOff,qwen:u.base,kimi:u.levelMax,deepseek:u.hiMax,minimax:u.onOff,hunyuan:u.base,step:u.base},f=["none","minimal","low","medium","high","xhigh","max"],g=[{provider:"codex",pattern:"*gpt-5.6-sol*",levels:f},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:f},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:f},{pattern:"*gpt-5.6-sol*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*claude*opus-5*",levels:u.CLAUDE_EFFORT},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function y(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let a=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!a)return null;let[,s,i]=a,l=Number(s),o=void 0===i?null:Number(i);return l<4||4===l&&(null===o||o<=5||null!==o&&o>=1e3)?null:"output_config"}(t))return null;let a=(0,p.nl)(e,t);if(!a.reasoning)return null;let s=g.find(a=>(!a.provider||a.provider===e)&&(0,x.gH)(a.pattern,t)),i=s?.levels||h[a.thinkingFormat]||u.base;return!1===a.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var b=a(21577),v=a(85479),j=a(20264);let w=new Map;async function k(e){if(!e?.url||!e?.type)return[];let t=w.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),a=await fetch(`/api/providers/suggested-models?${t}`);if(!a.ok)return[];let s=(await a.json()).data??[];return w.set(e.url,{data:s,expiresAt:Date.now()+6e5}),s}catch{return[]}}function N({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:s=[],type:i="llm",includeLegacyAliases:l=!0}){let o=new Set(s.map(e=>e.id)),r=new Set,n=[];for(let t of e){if(!t?.id||t.providerAlias!==a)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||o.has(t.id))continue;let s=`${a}/${t.id}`;r.has(s)||(r.add(s),n.push({id:t.id,name:t.name||t.id,fullModel:s,source:"custom",type:e}))}if(!l)return n;let d=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(d))continue;let t=a.slice(d.length);!t||o.has(t)||r.has(a)||(r.add(a),n.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:i||"llm"}))}return n}function C({model:e,fullModel:t,alias:a,copied:i,onCopy:l,testStatus:o,isCustom:r,isFree:n,onDeleteAlias:c,onTest:m,isTesting:p,onDisable:x,caps:u}){let h="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:h?{color:h}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,s.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:t}),(0,s.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,s.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,s.jsx)(d.CapacityBadges,{caps:u,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),r?(0,s.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,s.jsx)("button",{onClick:x,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function S({modelId:e,fullModel:t,copied:a,onCopy:i,onDeleteAlias:l,onTest:o,testStatus:r,isTesting:n}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,s.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e}`?"Copied!":"Copy"})]}),o&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:o,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]})]})]}),(0,s.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function A({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:a,customModels:l,copied:o,onCopy:r,onDeleteAlias:n,onAddCustomModel:c,onDeleteCustomModel:m,connections:p,isAnthropic:x}){let[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[w,k]=(0,i.useState)({}),C=async t=>{if(!v){j(t);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),s=await a.json();k(e=>({...e,[t]:s.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},T=N({customModels:l,modelAliases:a,providerAlias:e,type:"llm"}),I=async()=>{if(!u.trim()||f)return;let e=u.trim();if(T.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await c(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},P=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||"Failed to import models");let s=a.models||[];if(0===s.length)return void alert("No models returned from /models.");let i=0;for(let e of s){let t=e.id||e.name||e.model;t&&(T.some(e=>e.id===t)||(await c(t),i+=1))}0===i&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),placeholder:x?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:I,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"download",onClick:P,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),T.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:a,alias:i,source:l})=>(0,s.jsx)(S,{modelId:a,fullModel:`${t}/${a}`,copied:o,onCopy:r,onDeleteAlias:()=>"custom"===l?m(a):n(i),onTest:p.length>0?()=>C(a):void 0,testStatus:w[a],isTesting:v===a},`${l}-${e}/${a}`))})]})}var T=a(21863);function I({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);if(s<60)a(`${s}s`);else if(s<3600)a(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);a(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function P({connection:e,proxyPools:t,isOAuth:a,isFirst:l,isLast:o,onMoveUp:r,onMoveDown:n,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x,oneByOneStatus:u=null,autoPing:h=null}){let[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),w=e.providerSpecificData?.proxyPoolIds||(e.providerSpecificData?.proxyPoolId?[e.providerSpecificData.proxyPoolId]:[]),k=e.providerSpecificData?.proxyRotationStrategy||"none",N=w[0]||e.providerSpecificData?.proxyPoolId||null,C=N?j.get(N):null,S=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,A=!!N||S,$=w.length>1?`${w.length} pools (${k})`:C?`Pool: ${C.name}`:N?`Pool: ${N} (inactive/missing)`:S?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",E=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",O="";if(C?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=C?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);O=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{O=t}}let D=C?.noProxy||e.providerSpecificData?.connectionNoProxy||"",_="default";C?.isActive===!0?_="success":(N||S)&&(_="error"),(0,i.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let U=async e=>{b(!0);try{"__none__"===e?await m(null):await m(e)}finally{b(!1)}},z=async(e,t)=>{let a=t.filter(e=>j.get(e)?.isActive===!0);if(a.length){b(!0);try{await m({proxyPoolIds:a,proxyRotationStrategy:e}),g(!1)}finally{b(!1)}}},B=e.authType||(a?"oauth":"apikey"),M="oauth"===B,R="cookie"===B,K=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(M?"OAuth Account":R?"Cookie Account":"API Key"),L=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[F,J]=(0,i.useState)(!1),q=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=null,a=()=>{J(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};return a(),q&&(t=setInterval(a,1e3)),()=>{t&&clearInterval(t)}},[q,e]);let W="unavailable"!==e.testStatus||F?e.testStatus:"active",H=()=>u?"queued"===u.state?"queued":"testing"===u.state?"testing":"success"===u.state?"success":"failed"===u.state?u.error?`failed: ${u.error}`:"failed":null:null;return(0,s.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,s.jsx)("button",{onClick:r,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:n,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:R?"cookie":M?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:K}),L&&(0,s.jsx)("p",{className:"text-xs text-text-muted truncate",children:L}),(0,s.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,s.jsx)(d.Badge,{variant:(0,T.g)(e.isActive,W),size:"sm",dot:!0,children:!1===e.isActive?"disabled":W||"Unknown"}),(0,s.jsx)(d.Badge,{variant:"default",size:"sm",children:M?"OAuth":R?"Cookie":"API Key"}),A&&(0,s.jsx)(d.Badge,{variant:_,size:"sm",children:"Proxy"}),F&&!1!==e.isActive&&(0,s.jsx)(I,{until:q}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),H()&&(0,s.jsx)(d.Badge,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:H()})]}),A&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:$,children:$}),O&&(0,s.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:O}),D&&(0,s.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:D,children:["no_proxy: ",D]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:v,children:[(0,s.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${A?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,s.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:["smart"===k&&(0,s.jsx)("p",{className:"px-3 py-1 text-[10px] text-text-muted",children:"Smart skips unfit pools for this provider/model."}),(0,s.jsx)("button",{onClick:()=>U("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(0,s.jsx)("p",{className:"px-3 pt-2 text-[10px] font-medium uppercase text-text-muted",children:"Rotation"}),["fill-first","round-robin","random","smart"].map(e=>(0,s.jsx)("button",{onClick:()=>z(e,w.length>1?w:(t||[]).filter(e=>e.isActive).map(e=>e.id)),className:`w-full px-3 py-1.5 text-left text-sm hover:bg-black/5 dark:hover:bg-white/5 ${k===e?"font-medium text-primary":"text-text-main"}`,children:"smart"===e?"Smart (provider/model aware)":e},e)),(0,s.jsx)("p",{className:"px-3 pt-2 text-[10px] font-medium uppercase text-text-muted",children:"Single pool"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>U(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,s.jsx)(d.Tooltip,{text:E,children:(0,s.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,s.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(d.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}var $=a(28937),E=a.n($);let O=`name1|sk-key1
2
- name2|sk-key2
3
- sk-key-only-auto-named`;function D({isOpen:e,provider:t,providerName:a,isCompatible:l,isAnthropic:o,authType:r,authHint:n,website:m,proxyPools:p,error:x,existingNames:u,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===r,j="xai"===t&&!v,w=v?"Cookie Value":"API Key",k="azure"===t,N="cloudflare-ai"===t,C=c.Q2?.[t]?.regions||null,S=c.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[A,T]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[I,P]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[$,E]=(0,i.useState)({accountId:""}),[_,U]=(0,i.useState)(S),[z,B]=(0,i.useState)(!1),[M,R]=(0,i.useState)(null),[K,L]=(0,i.useState)(!1),F=N?`name1|sk-key1|acc123456
4
- name2|sk-key2|def789012
5
- sk-key-only-auto-named`:O,[J,q]=(0,i.useState)("single"),[W,H]=(0,i.useState)(""),[V,G]=(0,i.useState)(null),Q=()=>b&&A.ollamaHostUrl.trim()?{baseUrl:A.ollamaHostUrl.trim()}:k?{azureEndpoint:I.azureEndpoint,apiVersion:I.apiVersion,deployment:I.deployment,organization:I.organization}:N?{accountId:$.accountId}:C&&_?{region:_}:void 0,X=async()=>{B(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Q()})}),a=await e.json();R(a.valid?"success":"failed")}catch{R("failed")}finally{B(!1)}},Y=async()=>{if(t&&(b||A.apiKey)&&(b||A.name)){L(!0);try{let e=!1;try{B(!0),R(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Q()})});e=!!(await a.json()).valid,R(e?"success":"failed")}catch{R("failed")}finally{B(!1)}await h({name:A.name||(b?"Ollama Local":""),apiKey:A.apiKey,priority:A.priority,proxyPoolId:A.proxyPoolId===y?null:A.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Q()})}finally{L(!1)}}},Z=async()=>{let e=W.split("\n");if(!e.length)return;let a=function(e,t,a={}){let{isCloudflareAi:s=!1}=a,i=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,a="string"==typeof t?t.trim():"";if(!a)continue;let o=function(e,t={}){let{isCloudflareAi:a=!1}=t,s=e.split("|");if(a&&s.length>=3){let e=s[0].trim();return{baseName:e||"Key",apiKey:s.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:s[s.length-1].trim()}}}return s.length>=2?{baseName:s[0].trim()||"Key",apiKey:s.slice(1).join("|").trim()}:{baseName:"Key",apiKey:s[0].trim()}}(a,{isCloudflareAi:s});if(!o||!o.apiKey)continue;let r=o.baseName,n=1;for(;e=`${r} ${n}`,i.has(e.toLowerCase());)n+=1;i.add(e.toLowerCase());let d={name:e,apiKey:o.apiKey,skipped:!1};o.providerSpecificData&&(d.providerSpecificData=o.providerSpecificData),l.push(d)}return l}(e,u,{isCloudflareAi:N});if(!a.length)return;L(!0),G(null);let s=0,i=0;for(let e of a)try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?s++:i++}catch{i++}L(!1),G({success:s,failed:i}),s>0&&f&&f()};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Add ${a||t} ${w}`,onClose:g,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{size:"sm",variant:"single"===J?"primary":"ghost",onClick:()=>{q("single"),G(null)},children:"Single"}),(0,s.jsx)(d.Button,{size:"sm",variant:"bulk"===J?"primary":"ghost",onClick:()=>{q("bulk"),G(null)},children:"Bulk Add"})]}),"bulk"===J&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):(0,s.jsxs)(s.Fragment,{children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:W,onChange:e=>H(e.target.value)}),V&&(0,s.jsxs)("div",{className:`text-sm font-medium ${V.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",V.success," added",V.failed>0?`, ✗ ${V.failed} failed`:""]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Z,fullWidth:!0,disabled:K||!W.trim(),children:K?"Adding...":"Add All Keys"}),(0,s.jsx)(d.Button,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===J&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Input,{label:"Name",value:A.name,onChange:e=>T({...A,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"Ollama Host URL",value:A.ollamaHostUrl,onChange:e=>T({...A,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:z||K,variant:"secondary",children:z?"Checking...":"Check"})})]}),!b&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:w,type:v?"text":"password",value:A.apiKey,onChange:e=>T({...A,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:!A.apiKey||z||K,variant:"secondary",children:z?"Checking...":"Check"})})]}),j&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),v&&n&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[n,m&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),C&&(0,s.jsx)(d.Select,{label:"Region",value:_,onChange:e=>U(e.target.value),options:C.map(e=>({value:e.id,label:e.label}))}),b&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,s.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,s.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),M&&(0,s.jsx)(d.Badge,{variant:"success"===M?"success":"error",children:"success"===M?"Valid":"Invalid"}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),N&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,s.jsx)(d.Input,{label:"Account ID",value:$.accountId,onChange:e=>E({...$,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,s.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),k&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(d.Input,{label:"Azure Endpoint",value:I.azureEndpoint,onChange:e=>P({...I,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,s.jsx)(d.Input,{label:"Deployment Name",value:I.deployment,onChange:e=>P({...I,deployment:e.target.value}),placeholder:"gpt-4"}),(0,s.jsx)(d.Input,{label:"API Version",value:I.apiVersion,onChange:e=>P({...I,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,s.jsx)(d.Input,{label:"Organization",value:I.organization,onChange:e=>P({...I,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,s.jsx)(d.Input,{label:"Priority",type:"number",value:A.priority,onChange:e=>T({...A,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsx)(d.Select,{label:"Proxy Pool",value:A.proxyPoolId,onChange:e=>T({...A,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Y,fullWidth:!0,disabled:K||!b&&(!A.name||!A.apiKey)||k&&(!I.azureEndpoint||!I.deployment||!I.organization)||N&&!$.accountId,children:K?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}D.propTypes={isOpen:E().bool.isRequired,provider:E().string,providerName:E().string,isCompatible:E().bool,isAnthropic:E().bool,authType:E().string,authHint:E().string,website:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string})),error:E().string,existingNames:E().arrayOf(E().string),onSave:E().func.isRequired,onBulkDone:E().func,onClose:E().func.isRequired};let _=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function U({isOpen:e,node:t,onSave:a,onClose:l,isAnthropic:o}){let[r,n]=(0,i.useState)(()=>({name:t?.name||"",prefix:t?.prefix||"",apiType:t?.apiType||"chat",baseUrl:t?.baseUrl||(o?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})),[c,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),[v,j]=(0,i.useState)(t);t!==v&&(j(t),t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(o?"https://api.anthropic.com/v1":"https://api.openai.com/v1")}));let w=async()=>{if(r.name.trim()&&r.prefix.trim()&&r.baseUrl.trim()){m(!0);try{let e={name:r.name,prefix:r.prefix,baseUrl:r.baseUrl};o||(e.apiType=r.apiType),await a(e)}finally{m(!1)}}},k=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:r.baseUrl,apiKey:p,type:o?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Edit ${o?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.Input,{label:"Name",value:r.name,onChange:e=>n({...r,name:e.target.value}),placeholder:`${o?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(d.Input,{label:"Prefix",value:r.prefix,onChange:e=>n({...r,prefix:e.target.value}),placeholder:o?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!o&&(0,s.jsx)(d.Select,{label:"API Type",options:_,value:r.apiType,onChange:e=>n({...r,apiType:e.target.value})}),(0,s.jsx)(d.Input,{label:"Base URL",value:r.baseUrl,onChange:e=>n({...r,baseUrl:e.target.value}),placeholder:o?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${o?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>x(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:k,disabled:!p||f||!r.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,s.jsx)(d.Input,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),y&&(0,s.jsx)(d.Badge,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:w,fullWidth:!0,disabled:!r.name.trim()||!r.prefix.trim()||!r.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function z(e,t){switch(t.type){case"RESET":return{modelId:"",testStatus:null,testError:"",saving:!1};case"SET_MODEL":return{...e,modelId:t.value,testStatus:null,testError:""};case"TEST_START":return{...e,testStatus:"testing",testError:""};case"TEST_RESULT":return{...e,testStatus:t.ok?"ok":"error",testError:t.error||""};case"SAVE_START":return{...e,saving:!0};case"SAVE_DONE":return{...e,saving:!1};default:return e}}function B({isOpen:e,providerAlias:t,providerDisplayAlias:a,onSave:l,onClose:o}){let[r,n]=(0,i.useReducer)(z,{modelId:"",testStatus:null,testError:"",saving:!1}),{modelId:c,testStatus:m,testError:p,saving:x}=r,[u,h]=(0,i.useState)(!1);e&&!u?(h(!0),n({type:"RESET"})):!e&&u&&h(!1);let f=e=>{let a=`${t}/`;return e.startsWith(a)?e.slice(a.length):e},g=async()=>{let e=f(c.trim());if(e){n({type:"TEST_START"});try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),s=await a.json();n({type:"TEST_RESULT",ok:s.ok,error:s.error})}catch(e){n({type:"TEST_RESULT",ok:!1,error:e.message})}}},y=async()=>{let e=f(c.trim());if(e&&!x){n({type:"SAVE_START"});try{await l(e)}finally{n({type:"SAVE_DONE"})}}};return(0,s.jsx)(d.Modal,{isOpen:e,onClose:o,title:"Add Custom Model",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"add-custom-model-id",className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{id:"add-custom-model-id",type:"text",value:c,onChange:e=>n({type:"SET_MODEL",value:e.target.value}),onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),(0,s.jsx)(d.Button,{variant:"secondary",icon:"science",loading:"testing"===m,onClick:g,disabled:!c.trim()||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,s.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(c.trim())||"model-id"})]})]}),"ok"===m&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,s.jsx)("span",{children:p||"Model not reachable"})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(d.Button,{onClick:o,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(d.Button,{onClick:y,fullWidth:!0,size:"sm",disabled:!c.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}let M=`[
6
- {
7
- "accessToken": "eyJhbGc...",
8
- "refreshToken": "rt_...",
9
- "idToken": "eyJhbGc...",
10
- "email": "user@example.com"
11
- }
12
- ]`;function R({isOpen:e,onClose:t,onSuccess:a}){let[l,o]=(0,i.useState)(""),[r,n]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),u=()=>{r||(o(""),m(""),x(null),t())},h=async()=>{var e;let t;m(""),x(null);let s=l.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){m(`${(0,j.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,j.Tl)("No accounts found in input"));n(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,j.Tl)("Request failed"))}finally{n(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(d.Modal,{isOpen:e,title:(0,j.Tl)("Bulk Add Codex Accounts"),onClose:u,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,j.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:M,value:l,onChange:e=>o(e.target.value),disabled:r}),c&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,j.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,j.Tl)("failed")}`:""]}),f.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:h,fullWidth:!0,disabled:r||!l.trim(),children:r?(0,j.Tl)("Importing..."):(0,j.Tl)("Import All")}),(0,s.jsx)(d.Button,{onClick:u,variant:"ghost",fullWidth:!0,disabled:r,children:(0,j.Tl)("Close")})]})]})})}let K={claude:"claudeAutoPing",codex:"codexAutoPing"};function L(){let e,t=(0,l.useParams)(),a=(0,l.useRouter)(),o=t.id,{getCaps:p}=(0,v.y)(),[x,u]=(0,i.useState)([]),[h,f]=(0,i.useState)(!0),[g,w]=(0,i.useState)(null),[S,T]=(0,i.useState)([]),[I,$]=(0,i.useState)(!1),[E,O]=(0,i.useState)(!1),[_,z]=(0,i.useState)(!1),[M,L]=(0,i.useState)(""),[F,J]=(0,i.useState)(!1),[q,W]=(0,i.useState)(!1),[H,V]=(0,i.useState)(!1),[G,Q]=(0,i.useState)(!1),[X,Y]=(0,i.useState)(null),[Z,ee]=(0,i.useState)({}),[et,ea]=(0,i.useState)([]),[es,ei]=(0,i.useState)(!1),[el,eo]=(0,i.useState)({}),[er,en]=(0,i.useState)(""),[ed,ec]=(0,i.useState)(()=>new Set),[em,ep]=(0,i.useState)(!1),[ex,eu]=(0,i.useState)([]),[eh,ef]=(0,i.useState)(1),[eg,ey]=(0,i.useState)("__none__"),[eb,ev]=(0,i.useState)(!1),[ej,ew]=(0,i.useState)(null),[ek,eN]=(0,i.useState)(""),[eC,eS]=(0,i.useState)("auto"),[eA,eT]=(0,i.useState)({enabled:!1,connections:{}}),[eI,eP]=(0,i.useState)([]),[e$,eE]=(0,i.useState)([]),[eO,eD]=(0,i.useState)([]),[e_,eU]=(0,i.useState)([]),[ez,eB]=(0,i.useState)(null),[eM,eR]=(0,i.useState)(!1),[eK,eL]=(0,i.useState)(!1),[eF,eJ]=(0,i.useState)(!1),[eq,eW]=(0,i.useState)(null),[eH,eV]=(0,i.useState)({}),[eG,eQ]=(0,i.useState)(null),eX=(0,i.useRef)(!1),[eY,eZ]=(0,i.useState)(!1),{copied:e0,copy:e1}=(0,b.C)(),e2="ag_risk_confirmed",e5=()=>{$(!0)},e3=()=>{"antigravity"===o&&"true"!==window.localStorage.getItem(e2)?eR(!0):e9?e5():(L(""),z(!0))},e4=()=>{L(""),z(!0)},e6=()=>{e9?e3():e4()},e8=g?{id:g.id,name:g.name||("anthropic-compatible"===g.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===g.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===g.type?"AC":"OC",apiType:g.apiType,baseUrl:g.baseUrl,type:g.type}:c.zN[o]||c.fg[o]||c.IS[o]||c.nJ[o]||c.br[o],e7=e8?.authModes||[],e9=!!c.zN[o]||!!c.IS[o]||e7.includes("oauth"),te=!!c.fg[o]||e7.includes("apikey"),tt=!!c.IS[o]?.noAuth,ta=(0,m.KC)(o),ts="cursor"===o&&e$.length>0?e$:ta,ti=(0,c.wG)(o),tl=(0,c.mq)(o),to=(0,c.gb)(o),tr=tl||to,tn=!tr&&e9&&te,td="xai"===o?"Grok Build OAuth":"grok-cli"===o?"Grok CLI Device Login":"kimi"===o?"Kimi Coding OAuth":"OAuth",tc="xai"===o?"xAI API Key":"kimi"===o?"Kimi API Key":"qoder"===o?"PAT":"API Key",tm=e=>{if(!eC||"auto"===eC)return null;let t=y(o,e);return t&&t.includes(eC)?eC:null},tp=tr?o:ti,tx=(()=>{let e=new Set,t=new Set,a=a=>{if(!a||t.has(a))return;t.add(a);let s=y(o,a);s&&s.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of ts)a(e.id);for(let e of eO)a(e.id);for(let e of et)e.providerAlias===tp&&"llm"===(e.kind||e.type||"llm")&&a(e.id);return e.size?["auto",...e]:null})(),tu=tr?g?.prefix||o:ti,th=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tp)}`,{cache:"no-store"}),t=await e.json();e.ok&&eU(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tp]),tf=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tp,ids:[e]})})).ok&&await th()}catch(e){console.log("Error disabling model:",e)}},tg=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tp)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await th()}catch(e){console.log("Error enabling model:",e)}},ty=async e=>{e.length&&eB({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eB(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tp,ids:e})})).ok&&await th()}catch(e){console.log("Error disabling all models:",e)}}})},tb=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tp)}`,{method:"DELETE"})).ok&&await th()}catch(e){console.log("Error enabling all models:",e)}},tv=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ee(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tj=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ea(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===o&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eD(e.models)}).catch(()=>{})},[o]);let tw=(0,i.useCallback)(async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),r=await a.json(),n=s.ok?await s.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===o);u(e)}a.ok&&T(r.proxyPools||[]);let d=(n.providerStrategies||{})[o]||{};ew(d.fallbackStrategy||null),eN(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(n.providerThinking||{})[o]||{};eS(c.mode||"auto");let m=K[o],p=m&&n[m]||{};if(eT({enabled:!0===p.enabled,connections:p.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===o)||null;if(!e&&tr)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===o)||null))break}w(e)}}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},[o,tr]),tk=async e=>{try{let t=await fetch(`/api/provider-nodes/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(w(a.node),await tw(),V(!1))}catch(e){console.log("Error updating provider node:",e)}},tN=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),s=(a.ok?await a.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...s};0===Object.keys(i).length?delete l[o]:l[o]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tC=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[o]={mode:e}:delete a[o],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},tS=async e=>{let t=K[o];if(t){eT(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tw(),tv(),tj(),th()},[tw,tv,tj,th]),(0,i.useEffect)(()=>{if("cursor"!==o)return void eE([]);let e=x.find(e=>!1!==e.isActive);if(!e?.id)return void eE([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:a})=>{!t&&e&&Array.isArray(a.models)&&a.models.length>0&&eE(a.models)}).catch(()=>{}),()=>{t=!0}},[o,x]),(0,i.useEffect)(()=>{let e=(c.zN[o]||c.fg[o]||c.IS[o]||c.nJ[o])?.modelsFetcher;e&&k(e).then(eP)},[o]);let tA=async(e,t,a=ti)=>{let s=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await tv();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tT=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tv()}catch(e){console.log("Error deleting alias:",e)}},tI=async(e,t="llm",a=tp)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(s.ok)await tj(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await s.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tP=async(e,t="llm",a=tp)=>{try{let s=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await tj(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t$=async()=>{if(eY)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,j.Tl)("Please add an active Qoder connection first"));eZ(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,j.Tl)("Failed to fetch models"));let s=a.models||[];if(0===s.length)return void alert((0,j.Tl)("No models returned"));let i=0;for(let e of s){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");et.some(e=>e.providerAlias===tp&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(Z).includes(`${tp}/${a}`)||(await tI(a,"llm",tp),i+=1)}0===i?alert((0,j.Tl)("All models already exist, no new models added")):alert((0,j.Tl)("Successfully added")+` ${i} `+(0,j.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,j.Tl)("Error fetching models")+": "+e.message)}finally{eZ(!1)}},tE=async()=>{if(eK||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));eX.current=!1,eL(!0),eJ(!1),eW(null),eV(e),eQ({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<x.length;e+=1){if(eX.current){eQ({total:x.length,completed:e,passed:t,failed:a,stopped:!0});break}let s=x[e];eW(s.id),eV(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:a+=1,eV(e=>({...e,[s.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){a+=1,eV(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}eQ({total:x.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eW(null),eL(!1),eJ(!1),eX.current=!1}},tO=async e=>{eB({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eB(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&u(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tD=()=>{tw(),$(!1)},t_=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tw(),z(!1);return}L(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}},tU=async e=>{try{(await fetch(`/api/providers/${X.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tw(),W(!1))}catch(e){console.log("Error updating connection:",e)}},tz=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&u(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},tB=async(e,t)=>{let a=[...x];[a[e],a[t]]=[a[t],a[e]],u(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(e){console.log("Error swapping priority:",e),await tw()}},tM=x.filter(e=>ex.includes(e.id)),{currentPage:tR,totalPages:tK,items:tL,start:tF}=function(e=[],t=1){let a=Array.isArray(e)?e:[],s=a.length,i=Math.max(1,Math.ceil(s/10)),l=Math.floor(Number(t)),o=Math.min(Number.isFinite(l)&&l>0?l:1,i),r=(o-1)*10,n=a.slice(r,r+10);return{currentPage:o,totalPages:i,totalItems:s,start:r,items:n,pageSize:10}}(x,eh),tJ=x.length>0&&ex.length===x.length;(0,i.useEffect)(()=>{eu(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===tM.length)return;let e=new Set(tM.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=S.find(e=>e.id===t);return a?.name}})();let tq=()=>{eb||Q(!1)},tW=async e=>{ev(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:s}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:s})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tw(),Q(!1)}finally{ev(!1)}},tH=e=>tW(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),tV=(0,s.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[tL.map((e,t)=>{let a,i=tF+t;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(a=e.id,ex.includes(a)),onChange:()=>{var t;return t=e.id,void eu(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(P,{connection:e,proxyPools:S,isOAuth:e9,isFirst:0===i,isLast:i===x.length-1,onMoveUp:()=>tB(i,i-1),onMoveDown:()=>tB(i,i+1),onToggleActive:t=>tz(e.id,t),autoPing:K[o]&&"oauth"===e.authType?{on:!0===eA.connections[e.id],onToggle:t=>{var a;return a=e.id,void tS({...eA,connections:{...eA.connections,[a]:t}})},provider:o}:null,onUpdateProxy:async t=>{try{let a="object"==typeof t?t:{proxyPoolId:t||null};if((await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok){let t={...e.providerSpecificData};a.proxyPoolIds?(t.proxyPoolIds=a.proxyPoolIds,t.proxyRotationStrategy=a.proxyRotationStrategy,delete t.proxyPoolId):(a.proxyPoolId?t.proxyPoolId=a.proxyPoolId:delete t.proxyPoolId,delete t.proxyPoolIds,delete t.proxyRotationStrategy),u(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:t}:a))}}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Y(e),W(!0)},onDelete:()=>tO(e.id),oneByOneStatus:eH[e.id]||null})})]},e.id)}),x.length>10&&(0,s.jsx)(d.Pagination,{currentPage:tR,pageSize:10,totalItems:x.length,onPageChange:ef})]}),tG=S.filter(e=>!0===e.isActive),tQ=(0,s.jsx)(d.Modal,{isOpen:G,onClose:tq,title:`Apply Proxy (${x.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("button",{onClick:()=>{let e=S.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tW(x.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:eb||0===tG.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,s.jsxs)("button",{onClick:()=>tH(null),disabled:eb,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),S.map(e=>(0,s.jsxs)("button",{onClick:()=>tH(e.id),disabled:eb||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,s.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eb&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,s.jsx)(d.Button,{onClick:tq,variant:"ghost",fullWidth:!0,disabled:eb,children:"Cancel"})]})}),tX=async e=>{if(!ed.has(e)){ec(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tp}/${e}`})}),a=await t.json();eo(t=>({...t,[e]:a.ok?"ok":"error"})),en(a.ok?"":a.error||"Model not reachable")}catch{eo(t=>({...t,[e]:"error"})),en("Network error")}finally{ec(t=>{let a=new Set(t);return a.delete(e),a})}}};return h?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.CardSkeleton,{}),(0,s.jsx)(d.CardSkeleton,{})]}):e8?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)(n.A,{providerId:e8.id,size:48,alt:e8.name,className:"shrink-0 rounded-lg",fallbackText:e8.textIcon||e8.id.slice(0,2).toUpperCase(),fallbackColor:e8.color}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e8.name}),(e8.notice?.apiKeyUrl||e8.notice?.signupUrl||e8.website)&&(0,s.jsxs)("a",{href:e8.notice?.apiKeyUrl||e8.notice?.signupUrl||e8.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e8.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),e8.deprecated&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e8.deprecationNotice})]}),e8.notice?.text&&!e8.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e8.notice.text}),e8.notice.apiKeyUrl&&(0,s.jsx)("a",{href:e8.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 →"})]}),tr&&g&&(0,s.jsx)(d.Card,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:to?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[to?"Messages API":"responses"===g.apiType?"Responses API":"Chat Completions"," \xb7 ",(g.baseUrl||"").replace(/\/$/,""),"/",to?"messages":"responses"===g.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:()=>{L(""),z(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eB({title:"Delete Compatible Node",message:`Delete this ${to?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eB(null);try{(await fetch(`/api/provider-nodes/${o}`,{method:"DELETE"})).ok&&a.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tt?(0,s.jsx)(d.NoAuthProxyCard,{providerId:o}):(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[x.length>0&&S.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Q(!0),children:"Apply Proxy"}),x.length>0&&(0,s.jsxs)(s.Fragment,{children:[ex.length>0&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=ex.length;0!==e&&eB({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eB(null);let e=0,t=[...ex];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}u(e=>e.filter(e=>!t.includes(e.id))),eu([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",ex.length,")"]}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"sync",onClick:tE,disabled:eK,children:eK?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eK&&(0,s.jsx)(d.Button,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eK&&(eX.current=!0,eJ(!0))},disabled:eF,children:eF?"Stopping...":"Stop"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(d.Toggle,{checked:"round-robin"===ej,onChange:e=>{let t=e?"round-robin":null,a=e?ek||"1":ek;e&&!ek&&eN("1"),ew(t),tN(t,a)}}),"round-robin"===ej&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:ek,onChange:e=>{var t;eN(t=e.target.value),tN("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===x.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e9?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tn&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",td," or ",tc,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:tn?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e3,children:td}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:e4,children:tc})]}):(0,s.jsxs)(s.Fragment,{children:[!tr&&"iflow"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>O(!0),children:"Cookie"}),"codex"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>J(!0),children:(0,j.Tl)("Bulk Add")}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e6,children:tr?"Add API Key":"iflow"===o?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[eG&&(0,s.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:["Total: ",eG.total]}),(0,s.jsxs)("span",{children:["Completed: ",eG.completed]}),(0,s.jsxs)("span",{children:["Passed: ",eG.passed]}),(0,s.jsxs)("span",{children:["Failed: ",eG.failed]}),eG.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eK&&eq&&(0,s.jsxs)("span",{children:["Running: ",x.find(e=>e.id===eq)?.name||eq]})]})}),x.length>0&&(0,s.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:tJ,onChange:()=>{tJ?eu([]):eu(x.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tV,!tr&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>O(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===o&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>J(!0),title:(0,j.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,j.Tl)("Bulk Add")}),tn?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e3,className:"w-full sm:w-auto",children:td}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:e4,className:"w-full sm:w-auto",children:tc})]}):(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e6,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tx&&(0,s.jsx)("select",{value:eC,onChange:e=>{var t;eS(t=e.target.value),tC(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tx.map(e=>(0,s.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tr&&(e=[...ts,...eO.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e_.includes(e)),(0,s.jsxs)("div",{className:"flex gap-2",children:[e_.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tb,children:"Active All"}),e.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"block",onClick:()=>ty(e),children:"Disable All"})]}))]}),!!er&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:er}),(()=>{let e,t,a;if(tr)return(0,s.jsx)(A,{providerStorageAlias:tp,providerDisplayAlias:tu,modelAliases:Z,customModels:et,copied:e0,onCopy:e1,onSetAlias:tA,onDeleteAlias:tT,onAddCustomModel:e=>tI(e,"llm",tp),onDeleteCustomModel:e=>tP(e,"llm",tp),connections:x,isAnthropic:to});let i=[...ts,...eO.filter(e=>!ts.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(e_),r=i.filter(e=>!l.has(e.id)),n=i.filter(e=>l.has(e.id)),d=N({customModels:et,modelAliases:Z,providerAlias:tp,builtInModels:ts,type:"llm"});return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,s.jsx)(C,{model:{id:e.id,name:e.name},fullModel:`${tu}/${e.id}`,alias:e.alias,copied:e0,onCopy:e1,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tP(e.id,"llm",tp):tT(e.alias)},testStatus:el[e.id],onTest:x.length>0||tt?()=>tX(e.id):void 0,isTesting:ed.has(e.id),isCustom:!0,isFree:!1,caps:p(`${o}/${e.id}`),thinkingSuffix:tm(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tp}/${e.id}`,a=`${o}/${e.id}`,i=Object.entries(Z).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(C,{model:e,fullModel:`${tu}/${e.id}`,alias:i,copied:e0,onCopy:e1,onSetAlias:t=>tA(e.id,t,tp),onDeleteAlias:()=>tT(i),testStatus:el[e.id],onTest:x.length>0||tt?()=>tX(e.id):void 0,isTesting:ed.has(e.id),isFree:e.isFree,onDisable:()=>tf(e.id),caps:p(`${o}/${e.id}`),thinkingSuffix:tm(e.id)},e.id)}),(0,s.jsxs)("button",{onClick:()=>ep(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===o&&x.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:t$,disabled:eY,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:eY?{animation:"spin 1s linear infinite"}:void 0,children:eY?"progress_activity":"download"}),eY?(0,j.Tl)("Fetching..."):(0,j.Tl)("Fetch Qoder Models")]}),eI.length>0&&(e=new Set([...Object.values(Z),...d.map(e=>e.fullModel)]),t=new Set(ts.map(e=>e.id)),0===(a=eI.filter(a=>!e.has(`${tp}/${a.id}`)&&!t.has(a.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await tI(e.id,"llm",tp)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,s.jsxs)("button",{onClick:()=>tg(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tQ,"kiro"===o?(0,s.jsx)(d.KiroOAuthWrapper,{isOpen:I,providerInfo:e8,onSuccess:tD,onClose:()=>$(!1)}):"cursor"===o?(0,s.jsx)(d.CursorAuthModal,{isOpen:I,onSuccess:tD,onClose:()=>$(!1)}):"gitlab"===o?(0,s.jsx)(d.GitLabAuthModal,{isOpen:I,providerInfo:e8,onSuccess:tD,onClose:()=>$(!1)}):(0,s.jsx)(d.OAuthModal,{isOpen:I,provider:o,providerInfo:e8,onSuccess:tD,onClose:()=>$(!1)}),"iflow"===o&&(0,s.jsx)(d.IFlowCookieModal,{isOpen:E,onSuccess:()=>{tw(),O(!1)},onClose:()=>O(!1)}),(0,s.jsx)(D,{isOpen:_,provider:o,providerName:e8.name,isCompatible:tr,isAnthropic:to,authType:e8?.authType,authHint:e8?.authHint,website:e8?.website,proxyPools:S,error:M,existingNames:x.map(e=>e.name).filter(Boolean),onSave:t_,onBulkDone:tw,onClose:()=>{L(""),z(!1)}}),(0,s.jsx)(d.EditConnectionModal,{isOpen:q,connection:X,proxyPools:S,onSave:tU,onClose:()=>W(!1)}),tr&&(0,s.jsx)(U,{isOpen:H,node:g,onSave:tk,onClose:()=>V(!1),isAnthropic:to}),!tr&&(0,s.jsx)(B,{isOpen:em,providerAlias:tp,providerDisplayAlias:tu,onSave:async e=>{await tI(e,"llm",tp),ep(!1)},onClose:()=>ep(!1)}),"codex"===o&&(0,s.jsx)(R,{isOpen:F,onClose:()=>J(!1),onSuccess:tw}),(0,s.jsx)(d.ConfirmModal,{isOpen:eM,onClose:()=>eR(!1),onConfirm:()=>{(window.localStorage.setItem(e2,"true"),eR(!1),e9)?e5():e4()},title:"Risk Notice",message:e8?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(d.ConfirmModal,{isOpen:!!ez,onClose:()=>eB(null),onConfirm:ez?.onConfirm,title:ez?.title||"Confirm",message:ez?.message,variant:"danger"})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},21863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})},68810:(e,t,a)=>{Promise.resolve().then(a.bind(a,6))}},e=>{e.O(0,[3885,2318,4385,2940,7236,5479,2147,3204,7358],()=>e(e.s=68810)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{19327:(e,t,r)=>{Promise.resolve().then(r.bind(r,70665)),Promise.resolve().then(r.bind(r,47056))},70665:(e,t,r)=>{"use strict";r.d(t,{default:()=>O});var a=r(15102),s=r(82030),i=r(31704),l=r(79835);let n=new Set(["antigravity","gemini-cli"]),o="quotaCacheData",d="quotaAutoRefresh",c=[10,20,50,100],u=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],x=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function h(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function b(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function g(e,t){return await e(t)}function f(){try{let e=window.localStorage.getItem(o);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function y(e,t){try{let r=f();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(o,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function v(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}let k=[];function j({quotas:e=k,compact:t=!1,sortMode:r="default",showSortLabel:i=!1}){let[l,n]=(0,s.useState)(1),o=(0,s.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):v(e?.used,e?.total)})),[e]),d=(0,s.useMemo)(()=>"remaining-asc"===r?o.toSorted((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?o.toSorted((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):o,[o,r]),c=Math.max(1,Math.ceil(d.length/10)),[u,x]=(0,s.useState)(r),[m,h]=(0,s.useState)(e),[b,p]=(0,s.useState)(c);if(r!==u||e!==m?(x(r),h(e),p(c),n(1)):c!==b&&(p(c),n(e=>Math.min(e,c))),!e||0===e.length)return null;let g=d.slice((l-1)*10,10*l),f=0===d.length?0:(l-1)*10+1,y=Math.min(10*l,d.length),w=t?"py-1 px-1.5":"py-2 px-3",N=t?"text-[11px]":"text-sm",C=t?"text-[11px]":"text-sm",S=t?"text-[10px] leading-tight":"text-xs";return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[d.length," quota",d.length>1?"s":""]}),i&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:g.map(e=>{var r;let s=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},i=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let s=Math.ceil(a/6e4);if(s<60)return`${s}m`;let i=Math.floor(s/60),l=s%60;if(i<24)return`${i}h ${l}m`;let n=Math.floor(i/24);return`${n}d ${i%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(s.getDate()+1);let i="";i=t>=a&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${i}, ${l}`}catch{return null}}(e.resetAt);return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${w} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:s.emoji}),(0,a.jsx)("span",{className:`${N} font-medium text-text-primary truncate`,children:e.name})]})}),(0,a.jsx)("td",{className:`${w} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${s.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${w} w-[25%]`,children:"-"!==i||l?t?(0,a.jsx)("div",{className:`${C} text-text-primary font-medium truncate`,title:l||"",children:"-"!==i?`in ${i}`:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==i&&(0,a.jsxs)("div",{className:`${C} text-text-primary font-medium`,children:["in ",i]}),l&&(0,a.jsx)("div",{className:`${S} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${C} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),c>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",f,"-",y," of ",d.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",c]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>n(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>n(e=>Math.min(c,e+1)),disabled:l===c,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var w=r(52252),N=r(18419),C=r(62758),S=r(92940),A=r(31038),$=r(21577);let q={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},E={claude:"claudeAutoPing",codex:"codexAutoPing"},P={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota."};function D(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function M(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function T(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function O(){let{copied:e,copy:t}=(0,$.C)(),[r,k]=(0,s.useState)([]),[O,I]=(0,s.useState)({}),[F,_]=(0,s.useState)({}),[L,z]=(0,s.useState)({}),[R,U]=(0,s.useState)(!0),[K,J]=(0,s.useState)({claude:{},codex:{}}),[G,H]=(0,s.useState)(null),[B,V]=(0,s.useState)(!1),[W,Y]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(60),[Z,ee]=(0,s.useState)(!0),[et,er]=(0,s.useState)(null),[ea,es]=(0,s.useState)(null),[ei,el]=(0,s.useState)(null),[en,eo]=(0,s.useState)(null),[ed,ec]=(0,s.useState)(null),[eu,ex]=(0,s.useState)(!1),[em,eh]=(0,s.useState)(null),[eb,ep]=(0,s.useState)([]),[eg,ef]=(0,s.useState)("all"),[ey,ev]=(0,s.useState)([]),[ek,ej]=(0,s.useState)("all"),[ew,eN]=(0,s.useState)("all"),[eC,eS]=(0,s.useState)("default"),[eA,e$]=(0,s.useState)(!1),[eq,eE]=(0,s.useState)(!1),[eP,eD]=(0,s.useState)(!1),[eM,eT]=(0,s.useState)(1),[eO,eI]=(0,s.useState)(20),[eF,e_]=(0,s.useState)(String(20)),[eL,ez]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eR,eU]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eK=(0,s.useRef)(null),eJ=(0,s.useRef)(null),eG=(0,s.useRef)(0),eH=(0,s.useCallback)(async(e=eM)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eO),accountStatus:ew,sort:"priority"});"all"!==eg&&a.set("provider",eg);let s=await fetch(`/api/providers/client?${a.toString()}`);if(!s.ok)throw Error("Failed to fetch connections");let i=await s.json(),l=i.connections||[],n=(t=i.pagination,t||{page:1,pageSize:eO,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(i.totals,l.length);return k(l),ev(i.providerOptions||[]),ez(n),eU(o),eT((r=i.pagination,r?.page||e)),l}catch(e){return console.error("Error fetching connections:",e),k([]),ev([]),ez({page:1,pageSize:eO,total:0,totalPages:1}),eU({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ew,eA,eM,eO,eg]),eB=(0,s.useCallback)(async(e,t)=>{_(t=>({...t,[e]:!0})),z(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};I(t=>({...t,[e]:r})),y(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let a=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,a);let s={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"kimi":case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"freebuff":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,l.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,s=r.modelKey||r.name;return(e.get(a)??999)-(e.get(s)??999)})}return r}(t,a),plan:a.plan||null,message:a.message||null,raw:a};I(t=>({...t,[e]:s})),y(e,s)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),z(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{_(t=>({...t,[e]:!1}))}},[]),eV=(0,s.useCallback)(async(e,t)=>{await eB(e,t),H(new Date)},[eB]),eW=(0,s.useCallback)(async(e,t)=>{if("codex"===t&&!ei){el(e),z(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eB(e,t),H(new Date)}catch(t){z(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{el(null)}}},[eB,ei]),eY=(0,s.useCallback)(async e=>{ec({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),ec({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){ec({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eQ=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){er(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){I(t=>{let r={...t};return delete r[e],r}),_(t=>{let r={...t};return delete r[e],r}),z(t=>{let r={...t};return delete r[e],r});try{let t=f();t[e]&&(delete t[e],window.localStorage.setItem(o,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await g(eH,eM)}}catch(e){console.error("Error deleting connection:",e)}finally{er(null)}}},[eH,eM]),eX=(0,s.useCallback)(async(e,t)=>{es(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(I(e=>({...e})),await g(eH,eM))}catch(e){console.error("Error updating connection status:",e)}finally{es(null)}},[eH,eM]),eZ=(0,s.useCallback)(async e=>{if(!em?.id)return;let t=em.id,r=em.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eH(),ex(!1),eh(null),A.wb.includes(r)&&await eB(t,r))}catch(e){console.error("Error saving connection:",e)}},[em,eH,eB]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&ep(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e0=(0,s.useCallback)(async(e=!1)=>{if(W)return;Y(!0),X(60);let t=eG.current+=1,r=Math.round(3);try{let a=await eH(eM);_(b(a)),z(e=>p(e,a)),I(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eB(e.id,e.provider))),H(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{Y(!1)}},[W,eH,eB,eM]);(0,s.useEffect)(()=>{(async()=>{ee(!0);let e=await eH(eM);ee(!1),_(b(e)),z(t=>p(t,e)),I(t=>p(t,e)),await Promise.all(e.map(e=>eB(e.id,e.provider))),H(new Date)})()},[eH,eB,eM]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(d);U(null===e||"true"===e),V(!0)},[]),(0,s.useEffect)(()=>{B&&window.localStorage.setItem(d,String(R))},[R,B]),(0,s.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>J({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}})).catch(()=>{})},[]);let e1=(0,s.useCallback)(async(e,t,r)=>{let a=E[t];if(!a)return;let s={...K[t]||{},[e]:r};J({...K,[t]:s});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:s};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{J(K)}},[K]);(0,s.useEffect)(()=>{if(!B||!R){eK.current&&(clearInterval(eK.current),eK.current=null),eJ.current&&(clearInterval(eJ.current),eJ.current=null);return}return eK.current=setInterval(()=>{e0()},6e4),eJ.current=setInterval(()=>{X(e=>e<=1?60:e-1)},1e3),()=>{eK.current&&clearInterval(eK.current),eJ.current&&clearInterval(eJ.current)}},[R,e0,B]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eK.current&&(clearInterval(eK.current),eK.current=null),eJ.current&&(clearInterval(eJ.current),eJ.current=null)):R&&B&&(eK.current=setInterval(()=>e0(),6e4),eJ.current=setInterval(()=>{X(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[R,e0,B]),(0,s.useEffect)(()=>{ej("all")},[eg]);let e5=(0,s.useMemo)(()=>eg&&n.has(eg)?(0,l.KC)(eg).map(e=>({id:e.id,name:e.name||e.id})):[],[eg]),e2=(0,s.useMemo)(()=>(function(e,t,r,a,s){if("codex"===a&&"default"!==s)return[...e].sort((e,r)=>{let a=h(e,t),i=h(r,t),l="remaining-asc"===s?a-i:i-a;return 0!==l?l:(m(e)||"").localeCompare(m(r)||"")});if(!r)return e;let i=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=i(e)-i(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(r,O,eA,eg,eC),[r,O,eA,eg,eC]),e3=e=>{let t=O[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=v(e.used,e.total))},e8=(0,s.useCallback)(async(e,t)=>{if(e.length&&!eP){eD(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await g(eH,eM)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eD(!1)}}},[eP,eH,eM]),e4="all"===eg?"All providers":eg,e6=eR.eligibleConnections>0,e9=e2.length>0,e7=eR.eligibleConnections?eR.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===eg?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ew?"turned off":"active"===ew?"active":"matching"} accounts found for ${eg}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},te=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(eL),tt=!c.includes(eO);return Z||e6?Z||e9?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eE(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eq,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===eg?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(i.A,{src:`/providers/${eg}.webp`,alt:eg,size:18,className:"size-[18px] rounded object-contain",fallbackText:eg.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e4})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eq&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eE(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-1.5 w-52 overflow-hidden rounded-xl border border-black/10 bg-surface/95 p-1 shadow-lg shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-60",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==eg&&eT(1),ef("all"),eE(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${"all"===eg?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===eg&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-60 overflow-y-auto pr-0.5",children:ey.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{eg!==e&&eT(1),ef(e),eE(!1)},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors ${eg===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(i.A,{src:`/providers/${e}.webp`,alt:e,size:18,className:"size-[18px] rounded object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),eg===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[16px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ew,onChange:e=>{let t=e.target.value;ew!==t&&eT(1),eN(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===eg&&(0,a.jsx)("select",{value:eC,onChange:e=>eS(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:x.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),n.has(eg)&&e5.length>0&&(0,a.jsxs)("select",{value:ek,onChange:e=>ej(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter quotas by model",children:[(0,a.jsx)("option",{value:"all",children:"All models"}),e5.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>e$(e=>!e),"aria-pressed":eA,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${eA?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{e8(e2.filter(e=>(e.isActive??!0)&&e3(e)).map(e=>e.id),!1)},disabled:eP,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{e8(e2.filter(e=>!(e.isActive??!0)&&!e3(e)).map(e=>e.id),!0)},disabled:eP,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>U(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:R?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${R?"text-primary":"text-text-muted"}`,children:R?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),R&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",Q,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e0(!0),disabled:W,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${W?"animate-spin":""}`,children:"refresh"})})]})}),eA&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e2.map(r=>{var s;let l,n,o,d=O[r.id],c=F[r.id],u=L[r.id],x=!1===r.isActive,h="codex"===r.provider,b=Number.isFinite(n="number"==typeof(l=d?.raw?.resetCredits?.availableCount)?l:Number(l))?Math.max(0,n):0,p=ei===r.id,g=et===r.id||ea===r.id||p;return(0,a.jsxs)(C.A,{padding:"none",className:`min-w-0 ${x?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(i.A,{src:`/providers/${r.provider}.webp`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,D(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:D(r)}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(o=r.providerSpecificData?.authMethod)&&q[o]?q[o]:"api_key"===r.authType?"API Key":"OAuth"}),M(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:M(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${x?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:x?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[h&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{text:b>0?`Use one Codex reset credit. Available: ${b}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>eo({connection:r,resetCreditCount:b}),disabled:b<=0||c||g,"aria-label":b>0?`Use one Codex reset credit. ${b} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${b>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${p?"animate-spin":""}`,children:p?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(N.A,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r),disabled:c||g,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),E[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(N.A,{text:P[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e1(r.id,r.provider,K[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${K[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(N.A,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eV(r.id,r.provider),disabled:c||g,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${c?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(N.A,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{eh(r),ex(!0)},disabled:g,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(N.A,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eQ(r.id),disabled:g,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${et===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(w.A,{size:"sm",checked:r.isActive??!0,disabled:g,onChange:e=>eX(r.id,e)})})]})]})}),(0,a.jsx)("div",{className:"px-2 py-1.5",children:c?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):u?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:u})]}):d?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:d.message})}):(0,a.jsx)(j,{quotas:(s=d?.quotas,Array.isArray(s)&&"all"!==ek&&ek?s.filter(e=>(e&&(e.modelKey||e.name)||"")===ek):s||[]),compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eC})})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:te}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tt?"custom":String(eO),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eT(1),eI(r),e_(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[c.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eF,onChange:e=>e_(e.target.value),onBlur:()=>{let e=Number.parseInt(eF,10);if(!Number.isFinite(e))return void e_(String(eO));let t=Math.min(500,Math.max(1,e));eT(1),eI(t),e_(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eF,10);if(!Number.isFinite(t))return void e_(String(eO));let r=Math.min(500,Math.max(1,t));eT(1),eI(r),e_(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eL.page," / ",eL.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eT(1),disabled:eL.page<=1||Z||W,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eT(e=>Math.max(1,e-1)),disabled:eL.page<=1||Z||W,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eT(e=>Math.min(eL.totalPages,e+1)),disabled:eL.page>=eL.totalPages||Z||W,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eT(eL.totalPages),disabled:eL.page>=eL.totalPages||Z||W,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(S.ConfirmModal,{isOpen:!!en,onClose:()=>{ei||eo(null)},onConfirm:async()=>{let e=en?.connection;e&&(await eW(e.id,e.provider),eo(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${m(en?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${en?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!ei}),ed&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:m(ed.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>ec(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ed.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ed.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ed.error}):ed.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ed.data.credits.length," reset credit",1===ed.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ed.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ed.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:T(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:T(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),s=r%24;return a>0?`${a}d ${s}h`:`${s}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)(S.EditConnectionModal,{isOpen:eu,connection:em,proxyPools:eb,onSave:eZ,onClose:()=>{ex(!1),eh(null)}})]}):(0,a.jsx)(C.A,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:e7.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:e7.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:e7.description})]})}):(0,a.jsx)(C.A,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=19327)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{27068:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var s=a(15102),r=a(82030),l=a(92940),n=a(21577),i=a(20264);let o={version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1};function c({rtkEnabled:e,handleRtkEnabled:t,headroomRunning:a,headroomStatusLabel:r,setShowHeadroomInstallModal:n,headroomEnabled:i,handleHeadroomEnabled:o,headroomStatus:d,headroomExtras:m,pendingExtras:x,codeAware:h,kompress:p,restartingProxy:u,toggleExtraActive:g,handleRemoveExtra:f,removingExtra:b,togglePendingExtra:j,handleInstallExtras:y,extrasActionLoading:v,extrasActionError:N,installLog:w,cavemanEnabled:C,visibleCavemanLevels:k,handleCavemanLevel:S,cavemanLevel:E,cavemanLevels:P,handleCavemanEnabled:T,ponytailEnabled:L,ponytailLevels:I,handlePonytailLevel:B,ponytailLevel:R,handlePonytailEnabled:M,pxpipeChipClass:U,pxpipeStatusLabel:O,setShowPxpipeModal:A,pxpipeStatus:H,pxpipeEnabled:G,handlePxpipeEnabled:$}){return(0,s.jsxs)(l.Card,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(l.Toggle,{checked:e,onChange:()=>t(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${a?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:r}),(0,s.jsx)("button",{type:"button",onClick:()=>n(!0),className:"text-xs text-primary underline hover:opacity-80",children:a?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(l.Toggle,{checked:i&&a,disabled:!a,onChange:()=>o(!i)})]}),d.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",m.version?` \xb7 v${m.version}`:"",":"]}),m.available.map(e=>{let t=!!m.extras[e],a=x.includes(e),r="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?h:p;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 rounded border border-success/40 bg-success/5 text-text",title:r,children:[(0,s.jsx)(l.Toggle,{size:"sm",checked:t,disabled:u,onChange:()=>g(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>f(e),disabled:b===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:b===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:r,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>j(e)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),x.length>0&&(0,s.jsx)("button",{onClick:y,disabled:v,className:"text-xs px-2.5 py-1 rounded bg-primary text-white hover:opacity-90 disabled:opacity-50",children:v?"Installing…":`Install [proxy,${x.join(",")}]`})]}),N&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:N}),u&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(v||b)&&w&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:w}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[C&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:k.map(e=>(0,s.jsx)("button",{onClick:()=>S(e.id),className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${E===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:P.find(e=>e.id===E)?.desc})]}),(0,s.jsx)(l.Toggle,{checked:C,onChange:()=>T(!C)})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[L&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:I.map(e=>(0,s.jsx)("button",{onClick:()=>B(e.id),className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${R===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:I.find(e=>e.id===R)?.desc})]}),(0,s.jsx)(l.Toggle,{checked:L,onChange:()=>M(!L)})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress prompts as images"," ",(0,s.jsx)("a",{href:"https://github.com/teamchong/pxpipe",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(PXPIPE)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${U}`,children:O}),(0,s.jsx)("button",{type:"button",onClick:()=>A(!0),className:"text-xs text-primary underline hover:opacity-80",children:H.installed?"Manage":"Setup"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe",className:"text-xs text-primary underline hover:opacity-80",children:"Dashboard"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Transforms large textual context into optimized images before sending to the LLM. Ideal for huge prompts, tool outputs and long conversations."})]}),(0,s.jsx)(l.Toggle,{checked:G,disabled:!H.installed,onChange:()=>$(!G)})]})]})}var d=a(29674);function m(){let[e,t]=(0,r.useState)(!0),[a,m]=(0,r.useState)(!1),[x,h]=(0,r.useState)("http://localhost:8787"),[p,u]=(0,r.useState)(!1),[g,f]=(0,r.useState)("full"),[b,j]=(0,r.useState)(!1),[y,v]=(0,r.useState)("full"),[N,w]=(0,r.useState)(!1),[C,k]=(0,r.useState)(!0),[S,E]=(0,r.useState)(!1),[P,T]=(0,r.useState)({loopGuard:!0,circuitBreaker:!0,semaphore:!0}),[L,I]=(0,r.useState)(i.kk),{copied:B,copy:R}=(0,n.C)(),M=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},U=function({patchSetting:e,setHeadroomEnabled:t,headroomUrl:a,setHeadroomUrl:s,codeAware:l,kompress:n,setCodeAware:i,setKompress:c}){let[d,m]=(0,r.useState)({installed:!1,running:!1,python:null,loading:!0}),[x,h]=(0,r.useState)(!1),[p,u]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),[b,j]=(0,r.useState)(o),[y,v]=(0,r.useState)([]),[N,w]=(0,r.useState)(!1),[C,k]=(0,r.useState)(""),[S,E]=(0,r.useState)(null),[P,T]=(0,r.useState)(""),[L,I]=(0,r.useState)(null),[B,R]=(0,r.useState)(!1),M=(0,r.useRef)(null),U=(0,r.useCallback)(async()=>{m(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(m({...t,loading:!1}),!t?.installed){j(o),v([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();j(e=>({...e,version:t.version??null,extras:t.extras||o.extras,available:t.available||o.available,loading:!1}))}catch{j(o)}v([])}catch{m({installed:!1,running:!1,python:null,loading:!1}),j(o),v([])}},[]);(0,r.useEffect)(()=>()=>{M.current&&clearInterval(M.current)},[]);let O=(0,r.useCallback)(async()=>{f(""),u(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await U()}catch(e){f(e.message)}finally{u(!1)}},[U]),A=(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await U()}finally{u(!1)}},[U]),H=(0,r.useCallback)(()=>{T(""),M.current&&clearInterval(M.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&T(t.log)}catch{}};e(),M.current=setInterval(e,1500)},[]),G=(0,r.useCallback)(()=>{M.current&&(clearInterval(M.current),M.current=null)},[]),$=(0,r.useCallback)(async()=>{if(y.length){w(!0),k(""),H();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:y})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");j(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),v([])}catch(e){k(e.message)}finally{G(),w(!1)}}},[y,H,G]),_=(0,r.useCallback)(async e=>{E(e),k(""),H();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");j(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){k(e.message)}finally{G(),E(null)}},[H,G]),D=(0,r.useCallback)(async(t,a)=>{if(k(""),"code"===t&&i(a),"ml"===t&&c(a),await e({["code"===t?"headroomCodeAware":"headroomKompress"]:a}),d.running){R(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await U()}catch(e){k(e.message)}finally{R(!1)}}},[d.running,e,U,i,c]),z=async()=>{let t=a.trim()||"http://localhost:8787";s(t),await e({headroomUrl:t}),U()};return{headroomStatus:d,showInstallModal:x,setShowInstallModal:h,actionLoading:p,actionError:g,headroomExtras:b,pendingExtras:y,extrasActionLoading:N,extrasActionError:C,removingExtra:S,installLog:P,extrasConfirm:L,setExtrasConfirm:I,codeAware:l,kompress:n,restartingProxy:B,refresh:U,start:O,stop:A,startLogPolling:H,toggleExtraActive:D,installExtras:$,removeExtra:_,toggleEnabled:r=>{let l=a.trim()||"http://localhost:8787";s(l),t(r),e({headroomEnabled:r,headroomUrl:l})},blurUrl:z,setPendingExtras:v}}({patchSetting:M,setHeadroomEnabled:m,headroomUrl:x,setHeadroomUrl:h,codeAware:N,kompress:C,setCodeAware:w,setKompress:k}),O=function({patchSetting:e,setPxpipeEnabled:t}){let[a,s]=(0,r.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[l,n]=(0,r.useState)(null),[i,o]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!1),[m,x]=(0,r.useState)(""),[h,p]=(0,r.useState)(25e3),u=(0,r.useCallback)(async()=>{s(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();s({...t,loading:!1}),"number"==typeof t.minChars&&p(t.minChars)}catch{s({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),g=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});n(await e.json())}catch(e){n({healthy:!1,checks:[],error:e.message})}},[]),f=(0,r.useCallback)(async e=>{x(""),d(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await u(),await g()}catch(e){x(e.message)}finally{d(!1)}},[g,u]);return{pxpipeStatus:a,pxpipeHealth:l,showModal:i,setShowModal:o,actionLoading:c,actionError:m,minChars:h,setMinChars:p,refresh:u,health:g,action:f,setEnabled:a=>{t(a),e({pxpipeEnabled:a})},blurMinChars:()=>{let t=Math.max(0,Number(h)||25e3);p(t),e({pxpipeMinChars:t})}}}({patchSetting:M,setPxpipeEnabled:E}),{headroomStatus:A,showInstallModal:H,setShowInstallModal:G,actionLoading:$,actionError:_,headroomExtras:D,pendingExtras:z,extrasActionLoading:J,extrasActionError:W,removingExtra:F,installLog:X,extrasConfirm:K,setExtrasConfirm:q,restartingProxy:Y,refresh:Q,start:V,stop:Z,toggleExtraActive:ee,installExtras:et,removeExtra:ea,toggleEnabled:es,blurUrl:er,setPendingExtras:el}=U,{pxpipeStatus:en,pxpipeHealth:ei,showModal:eo,setShowModal:ec,actionLoading:ed,actionError:em,minChars:ex,setMinChars:eh,refresh:ep,health:eu,action:eg,setEnabled:ef,blurMinChars:eb}=O;(0,r.useEffect)(()=>(0,i.oQ)(()=>I((0,i.kk)())),[]);let ej=d.hT.includes(L),ey=ej?d.ev:d.ev.filter(e=>!e.wenyan),ev=!ej&&d.ev.find(e=>e.id===g)?.wenyan?"ultra":g;(0,r.useEffect)(()=>{ev!==g&&M({cavemanLevel:ev})},[g,ev]);let eN=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},ew=(e,t)=>{T(a=>({...a,[e]:t})),M({[`${e}Enabled`]:t})};(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),m(!!a.headroomEnabled),h(a.headroomUrl||"http://localhost:8787"),w(!0===a.headroomCodeAware),k(!1!==a.headroomKompress),u(!!a.cavemanEnabled),f(a.cavemanLevel||"full"),j(!!a.ponytailEnabled),v(a.ponytailLevel||"full"),E(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&eh(a.pxpipeMinChars),T({loopGuard:!1!==a.loopGuardEnabled,circuitBreaker:!1!==a.circuitBreakerEnabled,semaphore:!1!==a.semaphoreEnabled}),Q(),ep().then(eu)}}catch{}})()},[Q,ep,eu,eh]);let eC=!!A.running,ek=A.loading?"Checking…":eC?"Running":!1===A.localUrl||A.installed?!1!==A.localUrl?"Stopped":"External":"Not installed",eS=!1!==A.localUrl,eE=!!A.canStart,eP=eS&&!!A.managedPid,eT=ei?.healthy===!0,eL=en.loading?"Checking…":en.installing?"Installing…":en.installed?eT?"Healthy":en.running?"Running":"Stopped":"Not installed",eI=eT||en.running?"bg-success/15 text-success":"bg-warning/15 text-warning";return(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsx)(c,{rtkEnabled:e,handleRtkEnabled:eN,headroomRunning:eC,headroomStatusLabel:ek,setShowHeadroomInstallModal:G,headroomEnabled:a,handleHeadroomEnabled:es,headroomStatus:A,headroomExtras:D,pendingExtras:z,codeAware:N,kompress:C,restartingProxy:Y,toggleExtraActive:ee,handleRemoveExtra:e=>{q({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>ea(e)})},removingExtra:F,togglePendingExtra:e=>{el(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},handleInstallExtras:()=>{if(0!==z.length){if(z.includes("ml"))return void q({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:et});et()}},extrasActionLoading:J,extrasActionError:W,installLog:X,cavemanEnabled:p,visibleCavemanLevels:ey,handleCavemanLevel:e=>{f(e),M({cavemanLevel:e})},cavemanLevel:ev,cavemanLevels:d.ev,handleCavemanEnabled:e=>{u(e),M({cavemanEnabled:e})},ponytailEnabled:b,ponytailLevels:d.Nv,handlePonytailLevel:e=>{v(e),M({ponytailLevel:e})},ponytailLevel:y,handlePonytailEnabled:e=>{j(e),M({ponytailEnabled:e})},pxpipeChipClass:eI,pxpipeStatusLabel:eL,setShowPxpipeModal:ec,pxpipeStatus:en,pxpipeEnabled:S,handlePxpipeEnabled:ef}),(0,s.jsxs)(l.Card,{id:"guards",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"shield"}),"Guards & Shields"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"font-medium",children:"Loop Guard"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Detects repeating tool call sequences and text-only planning loops. Injects corrections to prevent infinite agent run-loops."})]}),(0,s.jsx)(l.Toggle,{checked:P.loopGuard,onChange:()=>ew("loopGuard",!P.loopGuard)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 border-b border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"font-medium",children:"Circuit Breaker"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Temporarily halts upstream calls for offline or failing providers to prevent spamming and conserve connection resource."})]}),(0,s.jsx)(l.Toggle,{checked:P.circuitBreaker,onChange:()=>ew("circuitBreaker",!P.circuitBreaker)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"font-medium",children:"Semaphore (Concurrency Limiter)"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Enforces simultaneous request limits per provider account. Prevents rate-limits (429) and account blockings."})]}),(0,s.jsx)(l.Toggle,{checked:P.semaphore,onChange:()=>ew("semaphore",!P.semaphore)})]})]}),(0,s.jsx)(l.Modal,{isOpen:H,title:eC?"Headroom":"Setup Headroom",onClose:()=>G(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:eC?"text-success":"text-warning",children:ek})]}),eC&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(l.Input,{value:x,onChange:e=>h(e.target.value),onBlur:er,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),eP?(0,s.jsx)(l.Button,{onClick:Z,variant:"ghost",fullWidth:!0,disabled:$,children:$?"Stopping…":"Stop Headroom"}):eC?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):eE?(0,s.jsx)(l.Button,{onClick:V,fullWidth:!0,disabled:$,children:$?"Starting…":"Start Headroom"}):eS?A.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(l.Button,{size:"sm",variant:"ghost",onClick:()=>R('pip install "headroom-ai[proxy]"'),children:B?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),_&&(0,s.jsx)("p",{className:"text-sm text-warning",children:_}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.Button,{onClick:()=>Q(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(l.Button,{onClick:()=>G(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(l.Modal,{isOpen:eo,title:en.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>ec(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eT||en.running?"text-success":"text-warning",children:[eL,en.version?` \xb7 v${en.version}`:""]})]}),ei?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),ei.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),ei.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:ei.error})]}),en.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[en.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Button,{onClick:()=>eg("restart"),variant:"ghost",disabled:ed,children:"Restart"}),(0,s.jsx)(l.Button,{onClick:()=>eg("stop"),variant:"ghost",disabled:ed,children:"Stop"})]}):(0,s.jsx)(l.Button,{onClick:()=>eg("start"),disabled:ed,children:ed?"Starting…":"Start"}),(0,s.jsx)(l.Button,{onClick:()=>eg("install"),variant:"ghost",disabled:ed,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(l.Button,{onClick:()=>eg("install"),fullWidth:!0,disabled:ed||en.installing,children:ed||en.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 9Router data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(l.Input,{value:String(ex),onChange:e=>eh(e.target.value),onBlur:eb,placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),em&&(0,s.jsx)("p",{className:"text-sm text-warning",children:em}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(l.Button,{onClick:()=>ep().then(eu),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(l.Button,{onClick:()=>ec(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(l.ConfirmModal,{isOpen:!!K,onClose:()=>q(null),onConfirm:()=>{let e=K?.onConfirm;q(null),e?.()},title:K?.title,message:K?.message,confirmText:K?.confirmText,variant:K?.variant})]})}},29674:(e,t,a)=>{"use strict";a.d(t,{Cp:()=>n,Hx:()=>l,Iv:()=>d,Nv:()=>x,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>s,oX:()=>r,t6:()=>o});let s=["zh-CN","zh-TW"],r=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],l=2e3,n=3e5,i=5e3,o=5,c=1e4,d=5e3,m=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],x=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},58600:(e,t,a)=>{Promise.resolve().then(a.bind(a,27068))}},e=>{e.O(0,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=58600)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{79153:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(15102),l=s(82030),n=s(93278),r=s(92940),i=s(62758),o=s(88140),d=s(83916);let c={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};function x({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let o=(0,l.useRef)(t);return((0,l.useEffect)(()=>{o.current=t}),(0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&o.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,d.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",c[r]||c.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}var m=s(23812),p=s(31038);let u=null,h=null;async function f(){if(u&&h)return{providerNameCache:u,providerNodesCache:h};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(h={},t))h[e.id]=e.name;return{providerNameCache:u={...p.Q2,...h},providerNodesCache:h}}function b(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,p.zt)(e)||p.Q2[e];return a?.name||e}function j({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function g(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function v({filterProvider:e,setFilterProvider:t,filterStart:s,setFilterStart:l,filterEnd:n,setFilterEnd:r,providers:d,cn:c,handleApplyFilters:x,handleClearFilters:m}){return(0,a.jsx)(i.A,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:e,onChange:e=>t(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20 w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:s,onChange:e=>l(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:n,onChange:e=>r(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Actions"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.A,{onClick:x,className:"flex-1",children:"Search"}),(0,a.jsx)(o.A,{variant:"ghost",onClick:m,disabled:!e&&!s&&!n,className:"flex-1",children:"Clear"})]})]})]})})}function N({detail:e,index:t,handleViewDetail:s,providerNameCache:l}){return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:b(e.provider,l)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:g(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(o.A,{variant:"outline",size:"sm",onClick:()=>s(e),children:"Detail"})})]},`${e.id}-${t}`)}function w(){var e;let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(0),[o,c]=(0,l.useState)(0),[p,u]=(0,l.useState)(1),[h,w]=(0,l.useState)(20),[k,y]=(0,l.useState)(!1),[S,C]=(0,l.useState)(null),[P,T]=(0,l.useState)(!1),[D,E]=(0,l.useState)([]),[R,A]=(0,l.useState)(null),[_,L]=(0,l.useState)(""),[O,I]=(0,l.useState)(""),[q,F]=(0,l.useState)(""),[$,z]=(0,l.useState)(""),[K,U]=(0,l.useState)(""),[J,M]=(0,l.useState)(""),[Q,B]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>{let e=new Date;e.setDate(e.getDate()-7);let t=e.toISOString().slice(0,16);I(t),U(t),B(!0)},500);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=new AbortController;return fetch("/api/usage/providers",{signal:e.signal}).then(e=>e.json()).then(async t=>{if(e.signal.aborted)return;E(t.providers||[]);let s=await f();e.signal.aborted||A(s.providerNameCache)}).catch(()=>{}),()=>e.abort()},[]),(0,l.useEffect)(()=>{if(!Q||!K)return;let e=new AbortController;y(!0);let t=new URLSearchParams({page:String(p),pageSize:String(h)});return $&&t.append("provider",$),t.append("startDate",K),J&&t.append("endDate",J),fetch(`/api/usage/request-details?${t}`,{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(t=>{e.signal.aborted||(s(Array.isArray(t.details)?t.details:[]),r(t.pagination?.totalItems??0),c(t.pagination?.totalPages??0))}).catch(t=>{e.signal.aborted||console.error("request-details fetch failed:",t)}).finally(()=>{e.signal.aborted||y(!1)}),()=>e.abort()},[Q,p,h,$,K,J]);let H=e=>{C(e),T(!0),fetch(`/api/usage/request-details/${encodeURIComponent(e.id)}`).then(e=>e.ok?e.json():null).then(e=>{e?.detail&&C(e.detail)}).catch(()=>{})};return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(v,{filterProvider:_,setFilterProvider:L,filterStart:O,setFilterStart:I,filterEnd:q,setFilterEnd:F,providers:D,cn:d.cn,handleApplyFilters:()=>{u(1),z(_),U(O),M(q)},handleClearFilters:()=>{let e,t=((e=new Date).setDate(e.getDate()-7),e.toISOString().slice(0,16));L(""),I(t),F(""),u(1),z(""),U(t),M("")}}),(0,a.jsxs)(i.A,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:k||!Q?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===t.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):t.map((e,t)=>(0,a.jsx)(N,{detail:e,index:t,handleViewDetail:H,providerNameCache:R},t))})]})}),!k&&t.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(m.A,{currentPage:p,pageSize:h,totalItems:n,onPageChange:e=>u(e),onPageSizeChange:e=>{w(e),u(1)}})})]}),(0,a.jsx)(x,{isOpen:P,onClose:()=>T(!1),title:"Request Details",width:"lg",children:S&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:S.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(S.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:b(S.provider,R)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key Name:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:S.apiKeyName||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.apiKeyName&&S.apiKey?(e=S.apiKey)?e.length>8?`${e.slice(0,8)}...`:e:"":"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,d.cn)("font-medium","success"===S.status?"text-green-600":"text-red-600"),children:S.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",S.latency?.ttft||0,"ms / Total ",S.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:g(S.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.tokens?.completion_tokens?.toLocaleString()||0})]})]}),S.pxpipe&&(0,a.jsxs)("div",{className:"rounded-lg border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"image"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"PXPIPE"}),(0,a.jsx)("span",{className:(0,d.cn)("text-xs px-2 py-0.5 rounded",S.pxpipe.applied?"bg-green-500/15 text-green-600":"bg-amber-500/15 text-amber-600"),children:S.pxpipe.applied?"Activated":"Skipped"})]}),S.pxpipe.applied?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm sm:grid-cols-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Original (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(S.pxpipe.tokensBeforeEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Compressed (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(S.pxpipe.tokensAfterEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Saved"}),(0,a.jsxs)("span",{className:"font-mono text-green-600",children:[S.pxpipe.savedPct||0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Images"}),(0,a.jsxs)("span",{className:"font-mono",children:[S.pxpipe.imageCount||0," (",S.pxpipe.durationMs||0,"ms)"]})]})]}):(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Reason: ",(0,a.jsx)("span",{className:"font-mono",children:S.pxpipe.reason}),S.pxpipe.detail?` — ${S.pxpipe.detail}`:""]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(j,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.request,null,2)})}),S.providerRequest&&(0,a.jsx)(j,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.providerRequest,null,2)})}),S.providerResponse&&(0,a.jsx)(j,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof S.providerResponse?JSON.stringify(S.providerResponse,null,2):S.providerResponse})}),(0,a.jsxs)(j,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[S.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:S.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:S.response?.content||"[No content]"})]})]})]})})]})}let k=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(S,{})})}function S(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)("today"),o=e.get("tab"),d=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.SegmentedControl,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:d,onChange:s=>{if(s===d)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===d&&(0,a.jsx)(r.SegmentedControl,{options:k,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===d&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(r.UsageStats,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===d&&(0,a.jsx)(r.RequestLogger,{}),"details"===d&&(0,a.jsx)(w,{})]})}},85085:(e,t,s)=>{Promise.resolve().then(s.bind(s,79153))}},e=>{e.O(0,[3885,2318,4385,2940,2147,3204,7358],()=>e(e.s=85085)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{19965:(e,t,s)=>{"use strict";s.d(t,{FV:()=>d,HY:()=>n,Kw:()=>i});let r={"perplexity-agent":"perplexity","gitlab-duo":"gitlab","vercel-ai-gateway":"vercel"},a=new Set;function l(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}let o=new Set(["devin-cli","vercel","venice","perplexity-agent","morph","novita","agentrouter","grok-cli","clinepass","freebuff","mmf"]);function n(e){let t=function(e){let t=l(e);if(!t||a.has(t))return"";let s=r[t]||t;return a.has(s)?"":s}(e);if(!t)return null;let s=o.has(t)?"png":"webp";return`/providers/${t}.${s}`}function i(e){let t=l(e);t&&a.add(t);let s=r[t];s&&a.add(s)}let c=["openai","anthropic","claude","gemini","github","copilot","cursor","grok-cli","kiro","deepseek","qwen","mistral","groq","openrouter","together","cohere","ollama","cerebras","sambanova","fireworks","siliconflow","vllm","vertex","azure","aws-polly","deepgram","elevenlabs","searxng","jina-ai","tavily","perplexing","alicode","cline","roo","kilo","codex"];function d(e=c){(window.requestIdleCallback||(e=>setTimeout(e,200)))(()=>{for(let t of e){let e=n(t);e&&(new Image().src=e)}})}},21577:(e,t,s)=>{"use strict";s.d(t,{C:()=>a});var r=s(82030);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},28937:(e,t,s)=>{e.exports=s(41979)()},31704:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(15102),a=s(82030),l=s(28937),o=s.n(l),n=s(19965);function i({src:e,providerId:t,alt:s,size:l=32,className:o="",fallbackText:c="?",fallbackColor:d}){let x=t||(e?String(e).match(/^\/providers\/([^/.]+)/i)?.[1]:null),h=x?(0,n.HY)(x):e,[m,u]=(0,a.useState)(!1);return"a6api"===x||"a6api-cli"===x?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-full ${o}`.trim(),style:{width:l,height:l,borderRadius:"50%",display:"grid",placeItems:"center",position:"relative",overflow:"hidden",color:"var(--navy, #1F2937)",fontSize:`${Math.max(10,Math.floor(.35*l))}px`,letterSpacing:0,background:"radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .38), transparent 22%), conic-gradient(from 210deg, #3157ff, #16b8a6, #74c86a, #3157ff)",boxShadow:"0 12px 26px #3157ff38",isolation:"isolate"},children:(0,r.jsx)("span",{children:"A6"})}):!h||m?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${o}`.trim(),style:{width:l,height:l,color:d,fontSize:Math.max(10,Math.floor(.38*l))},children:c}):(0,r.jsx)("img",{src:h,alt:s,width:l,height:l,className:o,loading:"lazy",decoding:"async",onError:()=>{x&&(0,n.Kw)(x),u(!0)}})}i.propTypes={src:o().string,providerId:o().string,alt:o().string,size:o().number,className:o().string,fallbackText:o().string,fallbackColor:o().string}},41979:(e,t,s)=>{"use strict";var r=s(78784);function a(){}function l(){}l.resetWarningCache=a,e.exports=function(){function e(e,t,s,a,l,o){if(o!==r){var n=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw n.name="Invariant Violation",n}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:a};return s.PropTypes=s,s}},78784:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},79214:(e,t,s)=>{Promise.resolve().then(s.bind(s,83035))},83035:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var r=s(15102),a=s(93278),l=s(82030);function o(){let[e,t]=(0,l.useState)(!1),s=(0,a.useRouter)();return(0,r.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#141121]/80 backdrop-blur-md border-b border-[#3a2f27]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,r.jsx)("div",{className:"size-8 rounded bg-linear-to-br from-[#6366f1] to-[#8b5cf6] flex items-center justify-center text-white",children:(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-5 h-5",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"white",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"white"})]})}),(0,r.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"VansAI"})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/Vanszs/VansRouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{type:"button",onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center rounded-lg px-4 bg-[#6366f1] hover:bg-[#4f46e5] transition-all text-white text-sm font-bold shadow-[0_0_15px_rgba(99,102,241,0.4)] hover:shadow-[0_0_20px_rgba(99,102,241,0.6)]",children:"Get Started"}),(0,r.jsx)("button",{type:"button",className:"md:hidden text-white",onClick:()=>t(!e),children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,r.jsx)("div",{className:"md:hidden border-t border-[#3a2f27] bg-[#141121]/95 backdrop-blur-md",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/Vanszs/VansRouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("button",{type:"button",onClick:()=>s.push("/dashboard"),className:"h-9 rounded-lg bg-[#6366f1] hover:bg-[#4f46e5] text-white text-sm font-bold",children:"Get Started"})]})})]})}function n(){return(0,r.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#6366f1]/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#3a2f27] bg-[#1a1433]/50 px-3 py-1 text-xs font-medium text-[#6366f1]",children:[(0,r.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#6366f1] animate-pulse"}),"v1.0 is now live"]}),(0,r.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#6366f1]",children:"All AI Providers"})]}),(0,r.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,r.jsxs)("button",{type:"button",className:"h-12 px-8 rounded-lg bg-[#6366f1] hover:bg-[#4f46e5] text-white text-base font-bold transition-all shadow-[0_0_15px_rgba(99,102,241,0.4)] flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,r.jsxs)("a",{href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 rounded-lg border border-[#3a2f27] bg-[#1a1433] hover:bg-[#3a2f27] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var i=s(31704);let c=[{id:"claude",name:"Claude Code",image:"/providers/claude.webp"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.webp"},{id:"cline",name:"Cline",image:"/providers/cline.webp"},{id:"cursor",name:"Cursor",image:"/providers/cursor.webp"}],d=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-orange-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function x(){let[e,t]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%d.length)},2e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,r.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#1a1433] border-2 border-[#6366f1] shadow-[0_0_40px_rgba(99,102,241,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-10 h-10",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"#6366f1",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"#6366f1"})]}),(0,r.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"VansAI"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#6366f1]/30 animate-ping opacity-20"})]}),(0,r.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:c.map(e=>(0,r.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-[#1a1433] border border-[#3a2f27] flex items-center justify-center overflow-hidden p-2 hover:border-[#6366f1]/50 transition-all hover:scale-105",children:(0,r.jsx)(i.A,{src:e.image,alt:e.name,size:48,className:"object-contain rounded-xl max-w-[48px] max-h-[48px]",fallbackText:e.name.slice(0,2).toUpperCase()})})},e.id))}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#6366f1":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:d.map((t,s)=>(0,r.jsx)("div",{className:`px-4 py-2 rounded-lg ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#6366f1]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,r.jsx)("div",{className:"md:hidden mt-8 w-full p-4 rounded-lg bg-[#1a1433] border border-[#3a2f27]",children:(0,r.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function h(){return(0,r.jsx)("section",{className:"py-24 border-y border-[#3a2f27] bg-[#1a1433]/30",id:"how-it-works",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How VansAI Works"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,r.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#6366f1] to-gray-700 -z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#141121] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#141121] border-2 border-[#6366f1] flex items-center justify-center shadow-[0_0_30px_rgba(99,102,241,0.2)] z-10 mx-auto",children:(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-10 h-10",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"#6366f1",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"#6366f1",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"#6366f1"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#6366f1]",children:"2. VansAI Hub"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#141121] border border-[#3a2f27] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let m=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-orange-500/50",bg:"hover:bg-orange-500/5",iconBg:"bg-orange-500/10",iconText:"text-orange-500",titleHover:"group-hover:text-orange-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-amber-500/50",bg:"hover:bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-500",titleHover:"group-hover:text-amber-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function u(){return(0,r.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:m.map(e=>(0,r.jsxs)("div",{className:`p-6 rounded-xl bg-[#1a1433] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,r.jsx)("div",{className:`w-10 h-10 rounded-lg ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,r.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}var f=s(21577);function p(){let{copied:e,copy:t}=(0,f.C)();return(0,r.jsx)("section",{className:"py-24 px-6 bg-[#0f0d1a]",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,r.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install VansAI, configure your providers via web dashboard, and start routing AI requests."}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#6366f1]/20 text-[#6366f1] flex items-center justify-center font-bold",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Install VansAI"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#6366f1]/20 text-[#6366f1] flex items-center justify-center font-bold",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#6366f1]/20 text-[#6366f1] flex items-center justify-center font-bold",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://127.0.0.1:20128"})]})]})]})]}),(0,r.jsx)("div",{className:"flex-1 w-full",children:(0,r.jsxs)("div",{className:"rounded-xl overflow-hidden bg-[#1e1e1e] border border-[#3a2f27] shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#252526] border-b border-gray-700",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,r.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,r.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{t("npx VansRoute","landing")},"aria-label":"Copy command: npx VansRoute",children:[(0,r.jsx)("span",{className:"text-green-400",children:"$"}),(0,r.jsx)("span",{className:"text-white",children:"npx VansRoute"}),(0,r.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:"landing"===e?"✓ Copied":"Copy"})]}),(0,r.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,r.jsx)("span",{className:"text-[#6366f1]",children:">"})," Starting VansAI...",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#6366f1]",children:">"})," Server running on ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#6366f1]",children:">"})," Dashboard: ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,r.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,r.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,r.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.9router/db/data.sqlite",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/VansRoute/db/data.sqlite"]})]})]})})]})})})}var g=s(93885),b=s.n(g);function v(){return(0,r.jsx)("footer",{className:"border-t border-[#3a2f27] bg-[#0f0d1a] pt-16 pb-8 px-6",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"size-6 rounded bg-[#6366f1] flex items-center justify-center text-white",children:(0,r.jsxs)("svg",{viewBox:"0 0 32 32",className:"w-4 h-4",fill:"none",children:[(0,r.jsx)("path",{d:"M16 5L22 14L16 27L10 14L16 5Z",fill:"white",opacity:"0.9"}),(0,r.jsx)("path",{d:"M10 14L16 27L10 20L6 14H10Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("path",{d:"M22 14L16 27L22 20L26 14H22Z",fill:"white",opacity:"0.6"}),(0,r.jsx)("circle",{cx:"16",cy:"9",r:"2",fill:"white"})]})}),(0,r.jsx)("h3",{className:"text-white text-lg font-bold",children:"VansAI"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,r.jsx)("div",{className:"flex gap-4",children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"#features",children:"Features"}),(0,r.jsx)(b(),{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter#readme",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://www.npmjs.com/package/vansrouter",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#6366f1] text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,r.jsxs)("div",{className:"border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 VansAI. All rights reserved."}),(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/Vanszs/VansRouter",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/vansrouter",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function j(){let e=(0,a.useRouter)();return(0,r.jsxs)("div",{className:"relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#6366f1] selection:text-white",children:[(0,r.jsxs)("div",{className:"fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#141121]",children:[(0,r.jsx)("div",{className:"absolute inset-0 opacity-[0.06]",style:{backgroundImage:"linear-gradient(to right, #6366f1 1px, transparent 1px), linear-gradient(to bottom, #6366f1 1px, transparent 1px)",backgroundSize:"50px 50px"}}),(0,r.jsx)("div",{className:"absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#6366f1]/12 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{className:"absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob-delayed-1"}),(0,r.jsx)("div",{className:"absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob-delayed-2"}),(0,r.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(circle at center, transparent 0%, rgba(20, 17, 33, 0.4) 100%)"}})]}),(0,r.jsxs)("div",{className:"relative z-10",children:[(0,r.jsx)(o,{}),(0,r.jsxs)("main",{children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(n,{}),(0,r.jsx)("div",{className:"flex justify-center pb-20",children:(0,r.jsx)(x,{})})]}),(0,r.jsx)(p,{}),(0,r.jsx)(h,{}),(0,r.jsx)(u,{}),(0,r.jsxs)("section",{className:"py-32 px-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-linear-to-t from-[#6366f1]/5 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"max-w-4xl mx-auto text-center relative z-10",children:[(0,r.jsx)("h2",{className:"text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,r.jsx)("p",{className:"text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with VansAI. Open source and free to start."}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,r.jsx)("button",{type:"button",onClick:()=>e.push("/dashboard"),className:"w-full sm:w-auto h-14 px-10 rounded-lg bg-[#6366f1] hover:bg-[#4f46e5] text-white text-lg font-bold transition-all shadow-[0_0_20px_rgba(99,102,241,0.5)]",children:"Start Free"}),(0,r.jsx)("button",{type:"button",onClick:()=>window.open("https://github.com/Vanszs/VansRouter#readme","_blank"),className:"w-full sm:w-auto h-14 px-10 rounded-lg border border-[#3a2f27] hover:bg-[#1a1433] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,r.jsx)(v,{})]})]})}},93278:(e,t,s)=>{"use strict";var r=s(57682);s.o(r,"notFound")&&s.d(t,{notFound:function(){return r.notFound}}),s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[3885,2147,3204,7358],()=>e(e.s=79214)),_N_E=e.O()}]);