@rsalmn/extremerouter 0.7.2 → 0.7.3

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 (587) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +3 -3
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -459
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  87. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  90. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  98. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  100. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  101. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  102. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  103. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  105. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  108. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  124. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  126. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  129. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  145. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  147. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +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.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  250. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  287. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  289. package/app/.next-cli-build/server/app/callback.html +1 -1
  290. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  291. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  292. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  294. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  295. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  302. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  303. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  305. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  306. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/index.html +1 -1
  312. package/app/.next-cli-build/server/app/index.rsc +5 -5
  313. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  315. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  317. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  318. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  319. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  321. package/app/.next-cli-build/server/app/landing.html +1 -1
  322. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  323. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  324. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  325. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  326. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/login/page.js +2 -2
  330. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  332. package/app/.next-cli-build/server/app/login.html +1 -1
  333. package/app/.next-cli-build/server/app/login.rsc +6 -6
  334. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  335. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  337. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  338. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/page.js +2 -2
  342. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  344. package/app/.next-cli-build/server/app-paths-manifest.json +3 -3
  345. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  346. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  347. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  348. package/app/.next-cli-build/server/chunks/318.js +2 -2
  349. package/app/.next-cli-build/server/chunks/319.js +3 -3
  350. package/app/.next-cli-build/server/chunks/{2391.js → 4013.js} +1 -1
  351. package/app/.next-cli-build/server/chunks/412.js +1 -1
  352. package/app/.next-cli-build/server/chunks/42.js +1 -0
  353. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  354. package/app/.next-cli-build/server/chunks/6316.js +2 -2
  355. package/app/.next-cli-build/server/chunks/6591.js +1 -0
  356. package/app/.next-cli-build/server/chunks/788.js +1 -1
  357. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  358. package/app/.next-cli-build/server/chunks/8881.js +1 -1
  359. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  360. package/app/.next-cli-build/server/pages/404.html +1 -1
  361. package/app/.next-cli-build/server/pages/500.html +1 -1
  362. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  363. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  364. package/app/.next-cli-build/static/chunks/{1321-767de793890bdf8c.js → 1321-118ecb4341892b2c.js} +1 -1
  365. package/app/.next-cli-build/static/chunks/{5497-09625960ec618fe0.js → 5497-d21171ba9c9fbb8d.js} +1 -1
  366. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-ba165a4326051b21.js +1 -0
  367. package/app/.next-cli-build/static/css/f99fd82ccc97a1ed.css +1 -0
  368. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-shm +0 -0
  369. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-wal +0 -0
  370. package/app/package.json +1 -1
  371. package/package.json +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/alerts.html +0 -1
  373. package/app/.next-cli-build/server/app/dashboard/alerts.meta +0 -17
  374. package/app/.next-cli-build/server/app/dashboard/alerts.rsc +0 -25
  375. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard/alerts/__PAGE__.segment.rsc +0 -9
  376. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard/alerts.segment.rsc +0 -5
  377. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  378. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  379. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_full.segment.rsc +0 -25
  380. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_head.segment.rsc +0 -6
  381. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_index.segment.rsc +0 -9
  382. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_tree.segment.rsc +0 -3
  383. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +0 -1
  384. package/app/.next-cli-build/server/app/dashboard/basic-chat.meta +0 -17
  385. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +0 -22
  386. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +0 -6
  387. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +0 -5
  388. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  389. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  390. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +0 -22
  391. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +0 -6
  392. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +0 -9
  393. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +0 -3
  394. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +0 -1
  395. package/app/.next-cli-build/server/app/dashboard/cli-tools.meta +0 -17
  396. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +0 -23
  397. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +0 -6
  398. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +0 -5
  399. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  400. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  401. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +0 -23
  402. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +0 -6
  403. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +0 -9
  404. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +0 -3
  405. package/app/.next-cli-build/server/app/dashboard/combos.html +0 -1
  406. package/app/.next-cli-build/server/app/dashboard/combos.meta +0 -17
  407. package/app/.next-cli-build/server/app/dashboard/combos.rsc +0 -25
  408. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +0 -9
  409. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +0 -5
  410. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  411. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  412. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +0 -25
  413. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +0 -6
  414. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +0 -9
  415. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +0 -3
  416. package/app/.next-cli-build/server/app/dashboard/endpoint.html +0 -1
  417. package/app/.next-cli-build/server/app/dashboard/endpoint.meta +0 -17
  418. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +0 -23
  419. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +0 -6
  420. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +0 -5
  421. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  422. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  423. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +0 -23
  424. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +0 -6
  425. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +0 -9
  426. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +0 -3
  427. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +0 -1
  428. package/app/.next-cli-build/server/app/dashboard/media-providers/web.meta +0 -18
  429. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +0 -25
  430. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +0 -9
  431. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +0 -5
  432. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +0 -5
  433. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  434. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  435. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +0 -25
  436. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +0 -6
  437. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +0 -9
  438. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +0 -3
  439. package/app/.next-cli-build/server/app/dashboard/mitm.html +0 -1
  440. package/app/.next-cli-build/server/app/dashboard/mitm.meta +0 -17
  441. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +0 -22
  442. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +0 -6
  443. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +0 -5
  444. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  445. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  446. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +0 -22
  447. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +0 -6
  448. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +0 -9
  449. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +0 -3
  450. package/app/.next-cli-build/server/app/dashboard/overview.html +0 -1
  451. package/app/.next-cli-build/server/app/dashboard/overview.meta +0 -17
  452. package/app/.next-cli-build/server/app/dashboard/overview.rsc +0 -22
  453. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard/overview/__PAGE__.segment.rsc +0 -6
  454. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard/overview.segment.rsc +0 -5
  455. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  456. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  457. package/app/.next-cli-build/server/app/dashboard/overview.segments/_full.segment.rsc +0 -22
  458. package/app/.next-cli-build/server/app/dashboard/overview.segments/_head.segment.rsc +0 -6
  459. package/app/.next-cli-build/server/app/dashboard/overview.segments/_index.segment.rsc +0 -9
  460. package/app/.next-cli-build/server/app/dashboard/overview.segments/_tree.segment.rsc +0 -3
  461. package/app/.next-cli-build/server/app/dashboard/playground.html +0 -1
  462. package/app/.next-cli-build/server/app/dashboard/playground.meta +0 -17
  463. package/app/.next-cli-build/server/app/dashboard/playground.rsc +0 -22
  464. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +0 -6
  465. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +0 -5
  466. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  467. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  468. package/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +0 -22
  469. package/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +0 -6
  470. package/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +0 -9
  471. package/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +0 -3
  472. package/app/.next-cli-build/server/app/dashboard/profile.html +0 -1
  473. package/app/.next-cli-build/server/app/dashboard/profile.meta +0 -17
  474. package/app/.next-cli-build/server/app/dashboard/profile.rsc +0 -25
  475. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +0 -9
  476. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +0 -5
  477. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  478. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  479. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +0 -25
  480. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +0 -6
  481. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +0 -9
  482. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +0 -3
  483. package/app/.next-cli-build/server/app/dashboard/providers/new.html +0 -1
  484. package/app/.next-cli-build/server/app/dashboard/providers/new.meta +0 -18
  485. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +0 -25
  486. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +0 -9
  487. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +0 -5
  488. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
  489. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  490. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  491. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +0 -25
  492. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +0 -6
  493. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +0 -9
  494. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +0 -3
  495. package/app/.next-cli-build/server/app/dashboard/providers.html +0 -1
  496. package/app/.next-cli-build/server/app/dashboard/providers.meta +0 -17
  497. package/app/.next-cli-build/server/app/dashboard/providers.rsc +0 -25
  498. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +0 -9
  499. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +0 -5
  500. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  501. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  502. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +0 -25
  503. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +0 -6
  504. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +0 -9
  505. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +0 -3
  506. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +0 -1
  507. package/app/.next-cli-build/server/app/dashboard/proxy-pools.meta +0 -17
  508. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +0 -25
  509. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +0 -9
  510. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +0 -5
  511. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  512. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  513. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +0 -25
  514. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +0 -6
  515. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +0 -9
  516. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +0 -3
  517. package/app/.next-cli-build/server/app/dashboard/quota.html +0 -2
  518. package/app/.next-cli-build/server/app/dashboard/quota.meta +0 -17
  519. package/app/.next-cli-build/server/app/dashboard/quota.rsc +0 -23
  520. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +0 -7
  521. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +0 -5
  522. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  523. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  524. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +0 -23
  525. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +0 -6
  526. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +0 -9
  527. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +0 -3
  528. package/app/.next-cli-build/server/app/dashboard/skills.html +0 -1
  529. package/app/.next-cli-build/server/app/dashboard/skills.meta +0 -17
  530. package/app/.next-cli-build/server/app/dashboard/skills.rsc +0 -25
  531. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +0 -9
  532. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +0 -5
  533. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  534. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  535. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +0 -25
  536. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +0 -6
  537. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +0 -9
  538. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +0 -3
  539. package/app/.next-cli-build/server/app/dashboard/token-saver.html +0 -1
  540. package/app/.next-cli-build/server/app/dashboard/token-saver.meta +0 -17
  541. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +0 -22
  542. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +0 -6
  543. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +0 -5
  544. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  545. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  546. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +0 -22
  547. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +0 -6
  548. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +0 -9
  549. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +0 -3
  550. package/app/.next-cli-build/server/app/dashboard/translator.html +0 -1
  551. package/app/.next-cli-build/server/app/dashboard/translator.meta +0 -17
  552. package/app/.next-cli-build/server/app/dashboard/translator.rsc +0 -25
  553. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +0 -9
  554. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +0 -5
  555. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  556. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  557. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +0 -25
  558. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +0 -6
  559. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +0 -9
  560. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +0 -3
  561. package/app/.next-cli-build/server/app/dashboard/usage.html +0 -1
  562. package/app/.next-cli-build/server/app/dashboard/usage.meta +0 -17
  563. package/app/.next-cli-build/server/app/dashboard/usage.rsc +0 -26
  564. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +0 -10
  565. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +0 -5
  566. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  567. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  568. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +0 -26
  569. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +0 -6
  570. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +0 -9
  571. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +0 -4
  572. package/app/.next-cli-build/server/app/dashboard.html +0 -1
  573. package/app/.next-cli-build/server/app/dashboard.meta +0 -16
  574. package/app/.next-cli-build/server/app/dashboard.rsc +0 -23
  575. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +0 -6
  576. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +0 -5
  577. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -5
  578. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +0 -23
  579. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +0 -6
  580. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +0 -9
  581. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +0 -3
  582. package/app/.next-cli-build/server/chunks/4306.js +0 -1
  583. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-f83681329e5612b2.js +0 -1
  584. package/app/.next-cli-build/static/css/5dcaa119b622f73a.css +0 -1
  585. /package/app/.next-cli-build/static/{zG5Y3KIUIUTgefLUSHfaI → 3gc9MPTw0g8Wf0FjVPWJh}/_buildManifest.js +0 -0
  586. /package/app/.next-cli-build/static/{zG5Y3KIUIUTgefLUSHfaI → 3gc9MPTw0g8Wf0FjVPWJh}/_ssgManifest.js +0 -0
  587. /package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/{upgrade-0.6.7-to-0.6.8-0.6.8-20260712-041517 → upgrade-0.7.1-to-0.7.2-0.7.2-20260718-105318}/data.sqlite +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5497],{98:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({label:e,options:t=[],value:a,onChange:i,placeholder:l="Select an option",error:o,hint:d,disabled:c=!1,required:m=!1,className:u,selectClassName:x,...p}){return(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",u),children:[e&&(0,r.jsxs)("label",{className:"text-xs font-semibold text-text-main",children:[e,m&&(0,r.jsx)("span",{className:"ml-1 text-danger",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:a,onChange:i,disabled:c,className:(0,s.cn)("w-full appearance-none rounded-brand border border-border bg-surface-2 py-2 pl-3 pr-10 text-sm text-text-main","[-webkit-appearance:none] [-moz-appearance:none]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",o&&"border-danger ring-1 ring-danger/20",x),...p,children:[(0,r.jsx)("option",{value:"",disabled:!0,children:l}),t.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,r.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"expand_more"})})]}),o&&(0,r.jsxs)("p",{className:"flex items-center gap-1 text-xs text-danger",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},1620:(e,t,a)=>{a.d(t,{D:()=>o});var r=a(12115),s=a(90085);function n(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function l(){return!1}function o(){let{theme:e,setTheme:t,toggleTheme:a,initTheme:o}=(0,s.A)(),d=(0,r.useSyncExternalStore)(n,i,l);(0,r.useEffect)(()=>{o()},[o]),(0,r.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>o();return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e,o]);let c="dark"===e||"system"===e&&d;return{theme:e,setTheme:t,toggleTheme:a,isDark:c}}},4823:(e,t,a)=>{a.d(t,{default:()=>u});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(84588),o=a(98),d=a(56061);let c="__none__",m=[{value:"none",label:"None (single pool)"},{value:"round-robin",label:"Round Robin — cycle through all pools"},{value:"random",label:"Random — pick a random pool each request"}];function u({providerId:e}){let[t,a]=(0,s.useState)([]),[n,i]=(0,s.useState)(c),[x,p]=(0,s.useState)("none"),[h,f]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let t=!1;return Promise.all([fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.ok?e.json():{proxyPools:[]}),fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{})]).then(([r,s])=>{if(t)return;a(r.proxyPools||[]);let n=(s.providerStrategies||{})[e]||{};i(n.proxyPoolId||c),p(n.rotateStrategy||"none")}).catch(()=>{}),()=>{t=!0}},[e]);let v=async t=>{f(!0);try{let a=await fetch("/api/settings",{cache:"no-store"}),r=(a.ok?await a.json():{}).providerStrategies||{},s={...r[e]||{}},n={...r};Object.assign(s,t),s.proxyPoolId||delete s.proxyPoolId,s.rotateStrategy&&"none"!==s.rotateStrategy||delete s.rotateStrategy,0===Object.keys(s).length?delete n[e]:n[e]=s,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})}),g(!0),setTimeout(()=>g(!1),1500)}catch(e){console.log("Save settings error:",e)}finally{f(!1)}},j="none"!==x,y=t.length>=2;return(0,r.jsxs)(l.default,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),b&&(0,r.jsx)(d.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Rotation Strategy",value:x,onChange:e=>{var t;p(t=e.target.value),v({rotateStrategy:t})},disabled:h,hint:j?y?`Rotating across ${t.length} active pools`:"Need ≥2 active pools for rotation":"Distribute requests across all active proxy pools",options:m.map(e=>({...e,..."none"!==e.value&&!y?{label:`${e.label} (need ≥2 pools)`}:{}}))}),(0,r.jsx)(o.default,{label:"Proxy Pool",value:n,onChange:e=>{var t;i(t=e.target.value),v({proxyPoolId:t===c?"":t})},disabled:h||j,hint:j?"Disabled — rotation auto-selects from all pools":void 0,options:[{value:c,label:"None (direct)"},...t.map(e=>({value:e.id,label:e.name}))]})]})]})}u.propTypes={providerId:i().string.isRequired}},6587:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(31474),n=a(97677);function i({icon:e,onClick:t,tooltip:a,variant:l="ghost",size:o="md",disabled:d,loading:c,className:m,...u}){let x=(0,r.jsx)("button",{onClick:t,disabled:d||c,"aria-label":a||e,className:(0,s.cn)("flex shrink-0 items-center justify-center transition-all disabled:opacity-50 disabled:cursor-not-allowed","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35",{ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",primary:"text-primary hover:bg-primary/10",danger:"text-danger hover:bg-danger/10",outline:"border border-border text-text-muted hover:border-primary/45 hover:bg-surface-2 hover:text-text-main"}[l],{sm:"size-6 rounded text-[14px]",md:"size-8 rounded-md text-[16px]",lg:"size-10 rounded-lg text-[20px]"}[o],m),...u,children:(0,r.jsx)("span",{className:(0,s.cn)("material-symbols-outlined",c&&"animate-spin"),children:c?"progress_activity":e})});return a?(0,r.jsx)(n.default,{text:a,position:"top",children:x}):x}},7648:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(65921),i=a(31852),l=a(8823);function o({children:e}){let[t,a]=(0,s.useState)(!1),d=(0,n.i)(e=>e.notifications),c=(0,n.i)(e=>e.removeNotification);return(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg text-text-main",children:[(0,r.jsx)("div",{className:"pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_top_left,rgba(139,92,246,0.16),transparent_32rem),radial-gradient(circle_at_top_right,rgba(34,211,238,0.10),transparent_28rem)]","aria-hidden":"true"}),(0,r.jsx)("div",{className:"fixed right-4 top-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:d.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-success/25 bg-success/10 text-success",icon:"check_circle"}:"error"===t?{wrapper:"border-danger/25 bg-danger/10 text-danger",icon:"error"}:"warning"===t?{wrapper:"border-warning/25 bg-warning/10 text-warning",icon:"warning"}:{wrapper:"border-info/25 bg-info/10 text-info",icon:"info"};return(0,r.jsx)("div",{className:`rounded-brand border px-3 py-2 shadow-[var(--shadow-elev)] backdrop-blur-md ${a.wrapper}`,children:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,r.jsx)("p",{className:"mb-0.5 text-xs font-semibold",children:e.title}):null,(0,r.jsx)("p",{className:"whitespace-pre-wrap break-words text-xs",children:e.message})]}),e.dismissible?(0,r.jsx)("button",{type:"button",onClick:()=>c(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/40 backdrop-blur-sm lg:hidden",onClick:()=>a(!1)}),(0,r.jsx)("div",{className:"relative hidden lg:flex",children:(0,r.jsx)(i.default,{})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform transition-transform duration-200 ease-out lg:hidden ${t?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(i.default,{onClose:()=>a(!1)})}),(0,r.jsxs)("main",{className:"relative isolate flex h-full min-w-0 flex-1 flex-col",children:[(0,r.jsx)(l.default,{onMenuClick:()=>a(!0)}),(0,r.jsx)("div",{className:"custom-scrollbar flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8 lg:py-8",children:(0,r.jsx)("div",{className:"mx-auto w-full max-w-7xl",children:e})})]})]})}},8247:(e,t,a)=>{a.d(t,{k:()=>n});var r=a(88105);let s=new Set(["windsurf","trae","cody","kimchi","chatglm-cn","blackbox-web","puter","adapta-web","deepseek-web","chatgpt-web","doubao-web","gemini-web","copilot-web","muse-spark-web","duckduckgo-web","venice-web","t3-web","lmarena","veoaifree-web","claude-web","pollinations","poe-web","v0-vercel-web","qwen-web","kimi-web","huggingchat","api-airforce","openvecta","freebuff-web","zenmux-free","perplexity-agent","featherless","moonshot","qwencloud","devin"]);function n(e,t){if(e?.startsWith(r.JH))return"responses"===t?"/providers/oai-r.png":"/providers/oai-cc.png";if(e?.startsWith(r.DI))return"/providers/anthropic-m.png";let a=s.has(e)?"svg":"png";return`/providers/${e}.${a}`}},8823:(e,t,a)=>{a.d(t,{default:()=>f});var r=a(95155),s=a(12115),n=a(73321),i=a(14051),l=a.n(i),o=a(80752),d=a(93308),c=a(38202),m=a(21931);function u(){let[e,t]=(0,s.useState)(!1),[a,n]=(0,s.useState)("en");return(0,s.useEffect)(()=>{n(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${d.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,d.QC)(t)}())},[e]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>t(!0),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Language","data-i18n-skip":"true",children:(0,r.jsx)("span",{className:"text-lg leading-none",children:c.h[a]||"\uD83C\uDF10"})}),(0,r.jsx)(m.default,{hideTrigger:!0,isOpen:e,onClose:e=>{t(!1),n(e)}})]})}var x=a(38587),p=a(38003);let h=[["/dashboard/endpoint",{title:"Endpoint",description:"Gateway URL, tunnels, and API keys",icon:"api"}],["/dashboard/providers",{title:"Providers",description:"Provider registry and account health",icon:"dns"}],["/dashboard/combos",{title:"Combos",description:"Model routing strategies and fallback chains",icon:"layers"}],["/dashboard/usage",{title:"Activity",description:"Requests, analytics, and request details",icon:"bar_chart"}],["/dashboard/quota",{title:"Quota",description:"Capacity, resets, and account availability",icon:"data_usage"}],["/dashboard/token-saver",{title:"Token Saver",description:"Compression policies for prompt and tool output",icon:"savings"}],["/dashboard/cli-tools",{title:"CLI Tools",description:"Configure developer tools to use ExtremeRouter",icon:"terminal"}],["/dashboard/proxy-pools",{title:"Proxy Pools",description:"Outbound proxy routing and health checks",icon:"lan"}],["/dashboard/skills",{title:"Skills",description:"Reusable agent skills and install links",icon:"extension"}],["/dashboard/profile",{title:"Settings",description:"Security, routing, network, and account settings",icon:"settings"}],["/dashboard/translator",{title:"Translator",description:"Inspect format conversion between clients and providers",icon:"translate"}],["/dashboard/console-log",{title:"Console",description:"Live server logs",icon:"monitor"}],["/dashboard/mitm",{title:"MITM Proxy",description:"Intercept selected IDE traffic through the gateway",icon:"security"}],["/dashboard/media-providers",{title:"Media Providers",description:"Image, audio, embedding, and web providers",icon:"perm_media"}]];function f({onMenuClick:e,showMenuButton:t=!0}){let a=(0,n.usePathname)(),[i,l]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),m=(0,s.useMemo)(()=>(function(e){if(!e||"/dashboard"===e)return h[0][1];let t=h.find(([t])=>e.startsWith(t));return t?t[1]:{title:"ExtremeRouter",description:"Gateway Console",icon:"hub"}})(a),[a]);(0,s.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let a=await t.json();e||(l(a?.displayName||a?.oidcName||a?.oidcEmail||""),c(a?.loginMethod||""))}catch{e||(l(""),c(""))}}(),()=>{e=!0}},[]);let p=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsx)("header",{className:"shrink-0 border-b border-border-subtle bg-bg/70 px-4 py-3 backdrop-blur-xl lg:px-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[t&&(0,r.jsx)("button",{onClick:e,className:"rounded p-1.5 text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main lg:hidden","aria-label":"Open sidebar",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"menu"})}),(0,r.jsx)("div",{className:"hidden size-8 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15 sm:flex",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:m.icon})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"truncate text-sm font-semibold tracking-tight text-text-main sm:text-base",children:m.title}),(0,r.jsx)("p",{className:"hidden truncate text-xs text-text-muted md:block",children:m.description})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[i&&"OIDC"===d&&(0,r.jsxs)("div",{className:"hidden max-w-[220px] items-center rounded-full border border-border bg-surface-2 px-3 py-1 text-xs text-text-muted sm:flex",children:[(0,r.jsx)("span",{className:"truncate",children:i}),(0,r.jsx)("span",{className:"ml-2 rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary",children:"OIDC"})]}),(0,r.jsx)(b,{}),(0,r.jsx)(x.default,{}),(0,r.jsx)(u,{}),(0,r.jsx)(o.default,{onLogout:p})]})]})})}function b(){let e=(0,p.C)(e=>e.visible),t=(0,p.C)(e=>e.query),a=(0,p.C)(e=>e.placeholder),s=(0,p.C)(e=>e.setQuery);return e?(0,r.jsxs)("div",{className:"relative hidden w-[220px] md:block",children:[(0,r.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-muted",children:"search"}),(0,r.jsx)("input",{type:"text",value:t,onChange:e=>s(e.target.value),placeholder:a,className:"h-8 w-full rounded-brand border border-border bg-surface-2 pl-8 pr-7 text-xs text-text-main placeholder:text-text-muted/70 focus:outline-none focus:ring-2 focus:ring-primary/30"}),t&&(0,r.jsx)("button",{type:"button",onClick:()=>s(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:bg-surface-3 hover:text-text-main","aria-label":"Clear search",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}):null}f.propTypes={onMenuClick:l().func,showMenuButton:l().bool}},11059:(e,t,a)=>{a.d(t,{C:()=>s});var r=a(12115);function s(e=2e3){let[t,a]=(0,r.useState)(null),n=(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)}})(),a(r),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{a(null)},e)},[e])}}},11910:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({label:e,type:t="text",placeholder:a,value:i,onChange:l,error:o,hint:d,icon:c,disabled:m=!1,required:u=!1,className:x,inputClassName:p,...h}){return(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",x),children:[e&&(0,r.jsxs)("label",{className:"text-xs font-semibold text-text-main",children:[e,u&&(0,r.jsx)("span",{className:"ml-1 text-danger",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[c&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:c})}),(0,r.jsx)("input",{type:t,placeholder:a,value:i,onChange:l,disabled:m,className:(0,s.cn)("w-full rounded-brand border border-border bg-surface-2 px-3 py-2 text-sm text-text-main placeholder:text-text-muted/70","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",o&&"border-danger ring-1 ring-danger/20",p),...h})]}),o&&(0,r.jsxs)("p",{className:"flex items-center gap-1 text-xs text-danger",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},21931:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),s=a(12115),n=a(47650),i=a(93308),l=a(73006);let o=e=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}})[e]||{name:e,flag:"\uD83C\uDF10"};function d({className:e="",isOpen:t,onClose:a,hideTrigger:c=!1}){let[m,u]=(0,s.useState)("en"),[x,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!1),b=(0,s.useRef)(null),g="boolean"==typeof t,v=g?t:h,j=e=>{g?!e&&a&&a(m):f(e)};(0,s.useEffect)(()=>{u(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${i.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,i.QC)(t)}())},[]),(0,s.useEffect)(()=>{function e(e){b.current&&!b.current.contains(e.target)&&j(!1)}if(v)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]);let y=async e=>{if(e!==m&&!x){p(!0),j(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,l.wn)(),u(e)}catch(e){console.error("Failed to set locale:",e)}finally{p(!1)}}};return(0,r.jsxs)("div",{className:e,children:[!c&&(0,r.jsxs)("button",{onClick:()=>j(!v),disabled:x,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:o(m).name}),(0,r.jsx)("span",{className:"text-lg",children:o(m).flag})]}),v&&(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>j(!1)}),(0,r.jsxs)("div",{ref:b,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,r.jsx)("button",{onClick:()=>j(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,r.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:i.YZ.map(e=>{let t=m===e,a=o(e);return(0,r.jsxs)("button",{onClick:()=>y(e),disabled:x,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${t?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${x?"opacity-70 cursor-wait":""}`,title:a.name,children:[(0,r.jsx)("span",{className:"text-2xl",children:a.flag}),(0,r.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:a.name}),t&&(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},e)})})})]})]}),document.body)]})}},23936:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(35497);function o({isOpen:e,onSuccess:t,onClose:a}){let[n,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[m,u]=(0,s.useState)(null),[x,p]=(0,s.useState)(!1),h=async()=>{if(!n.trim())return void u("Please paste your cookie");c(!0),u(null);try{let e=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:n.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"Authentication failed");p(!0),setTimeout(()=>{t?.(),f()},1500)}catch(e){u(e.message)}finally{c(!1)}},f=()=>{i(""),u(null),p(!1),a?.()};return(0,r.jsx)(l.aF,{isOpen:e,onClose:f,title:"iFlow Cookie Authentication",children:(0,r.jsx)("div",{className:"space-y-4",children:x?(0,r.jsxs)("div",{className:"text-center py-8",children:[(0,r.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,r.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,r.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,r.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,r.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,r.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,r.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,r.jsx)("li",{children:"Login to your account"}),(0,r.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,r.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,r.jsx)("li",{children:"Paste it below"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,r.jsx)("textarea",{value:n,onChange:e=>i(e.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:d})]}),m&&(0,r.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-error",children:m})}),(0,r.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,r.jsx)(l.$n,{variant:"secondary",onClick:f,disabled:d,fullWidth:!0,children:"Cancel"}),(0,r.jsx)(l.$n,{onClick:h,loading:d,fullWidth:!0,children:"Authenticate"})]})]})})})}o.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func}},25086:(e,t,a)=>{a.d(t,{CardSkeleton:()=>o,PageLoading:()=>i,Skeleton:()=>l,Spinner:()=>n,default:()=>d});var r=a(95155),s=a(31474);function n({size:e="md",className:t}){return(0,r.jsx)("span",{className:(0,s.cn)("material-symbols-outlined animate-spin text-brand-500",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[e],t),children:"progress_activity"})}function i({message:e="Loading..."}){return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,r.jsx)(n,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function l({className:e,...t}){return(0,r.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-[10px] bg-surface-2",e),...t})}function o(){return(0,r.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)(l,{className:"h-4 w-24"}),(0,r.jsx)(l,{className:"size-10 rounded-[10px]"})]}),(0,r.jsx)(l,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(l,{className:"h-3 w-20"})]})}function d({type:e="spinner",...t}){switch(e){case"page":return(0,r.jsx)(i,{...t});case"skeleton":return(0,r.jsx)(l,{...t});case"card":return(0,r.jsx)(o,{...t});default:return(0,r.jsx)(n,{...t})}}},28058:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(12115),n=a(81127);function i({isOpen:e,onClose:t,onAdd:a,addedNames:l=[]}){let[o,d]=(0,s.useState)([]),[c,m]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),[p,h]=(0,s.useState)("all"),[f,b]=(0,s.useState)(null),[g,v]=(0,s.useState)(null),[j,y]=(0,s.useState)({}),[k,w]=(0,s.useState)({}),[N,C]=(0,s.useState)({});(0,s.useEffect)(()=>{!e||o.length>0||(m(!0),fetch("/api/cli-tools/cowork-mcp-registry").then(e=>e.json()).then(e=>{e.error?b(e.error):d(e.servers||[])}).catch(e=>b(e.message)).finally(()=>m(!1)))},[e]);let S=(0,s.useMemo)(()=>new Set(l),[l]),O=(0,s.useMemo)(()=>{let e=u.trim().toLowerCase();return o.filter(t=>("authless"!==p||!t.oauth)&&("oauth"!==p||!!t.oauth)&&(!e||(t.title||"").toLowerCase().includes(e)||(t.description||"").toLowerCase().includes(e)||(t.name||"").toLowerCase().includes(e)))},[o,u,p]),W=async e=>{if(!j[e.url]){w(t=>({...t,[e.url]:!0}));try{let t=await fetch("/api/cli-tools/cowork-mcp-tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e.url})}),a=await t.json(),r=a.tools||[],s=Array.isArray(e.toolNames)?e.toolNames:[],n=r.length>0?r.map(e=>e.name):s;y(t=>({...t,[e.url]:{tools:r,requiresAuth:!!a.requiresAuth,error:a.error}})),C(t=>({...t,[e.url]:Object.fromEntries(n.map(e=>[e,!0]))}))}catch(t){y(a=>({...a,[e.url]:{tools:[],error:t.message}}))}finally{w(t=>({...t,[e.url]:!1}))}}},_=(e,t)=>{let a=N[e]||{};C(r=>({...r,[e]:Object.fromEntries(Object.keys(a).map(e=>[e,t]))}))};return(0,r.jsx)(n.default,{isOpen:e,onClose:t,title:"Browse MCP Marketplace",size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search by name or description...",className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,r.jsxs)("select",{value:p,onChange:e=>h(e.target.value),className:"px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,r.jsx)("option",{value:"all",children:"All"}),(0,r.jsx)("option",{value:"authless",children:"Authless"}),(0,r.jsx)("option",{value:"oauth",children:"OAuth"})]})]}),f&&(0,r.jsx)("div",{className:"px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:f}),c&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs py-4 justify-center",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),(0,r.jsx)("span",{children:"Loading registry..."})]}),!c&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:[0===O.length&&(0,r.jsx)("div",{className:"text-center text-xs text-text-muted py-6",children:"No servers match filter"}),O.map(e=>{let t=S.has(e.slug||e.name),s=g===e.url,n=j[e.url],i=k[e.url],l=N[e.url]||{},o=Object.keys(l),d=Object.values(l).filter(Boolean).length;return(0,r.jsxs)("div",{className:"rounded border border-transparent hover:border-border",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2 px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5",children:[e.iconUrl?(0,r.jsx)("img",{src:e.iconUrl,alt:"",className:"size-7 rounded shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}):(0,r.jsx)("div",{className:"size-7 rounded bg-surface shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,r.jsx)("span",{className:"font-medium text-xs",children:e.title}),e.oauth?(0,r.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-amber-500/10 text-amber-600",children:"OAuth"}):(0,r.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-green-500/10 text-green-600",children:"Authless"}),e.toolCount>0&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[e.toolCount," tools"]})]}),e.description&&(0,r.jsx)("p",{className:"text-[10px] text-text-muted line-clamp-2 mt-0.5",children:e.description})]}),(0,r.jsx)("button",{onClick:()=>t?null:void(g===e.url?v(null):(v(e.url),W(e))),disabled:t,className:`shrink-0 px-2 py-1 rounded text-[10px] font-medium transition-colors ${t?"bg-green-500/10 text-green-600 cursor-default":s?"bg-surface border border-border text-text-muted hover:bg-black/5":"bg-primary/10 border border-primary/40 text-primary hover:bg-primary/20"}`,children:t?"Added":s?"Cancel":"+ Add"})]}),s&&(0,r.jsxs)("div",{className:"px-3 py-2 bg-surface/40 border-t border-border flex flex-col gap-2",children:[i&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[10px] py-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),(0,r.jsx)("span",{children:"Probing server for tools..."})]}),!i&&n?.requiresAuth&&(0,r.jsx)("p",{className:"text-[10px] text-amber-600 bg-amber-500/10 px-2 py-1 rounded",children:"\uD83D\uDD10 OAuth required. Add now and authenticate after Apply; tool list will be discovered after first connect."}),!i&&n?.error&&!n?.requiresAuth&&(0,r.jsxs)("p",{className:"text-[10px] text-red-600 bg-red-500/10 px-2 py-1 rounded",children:["Probe failed: ",n.error]}),!i&&0===o.length&&!n?.requiresAuth&&!n?.error&&(0,r.jsx)("p",{className:"text-[10px] text-text-muted",children:"No tools advertised by server."}),!i&&o.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[d,"/",o.length," tools enabled"]}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("button",{onClick:()=>_(e.url,!0),className:"text-[10px] text-primary hover:underline",children:"All"}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:"\xb7"}),(0,r.jsx)("button",{onClick:()=>_(e.url,!1),className:"text-[10px] text-primary hover:underline",children:"None"})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-1 max-h-40 overflow-y-auto",children:o.map(t=>(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-1 rounded",children:[(0,r.jsx)("input",{type:"checkbox",checked:!!l[t],onChange:()=>{var a;return a=e.url,void C(e=>({...e,[a]:{...e[a],[t]:!e[a]?.[t]}}))},className:"size-3"}),(0,r.jsx)("span",{className:"truncate",children:t})]},t))})]}),(0,r.jsx)("button",{onClick:()=>{let t,r;return r=Object.keys(t=N[e.url]||{}).filter(e=>t[e]),void(a?.({name:e.slug||e.name,title:e.title,description:e.description,url:e.url,transport:e.transport,oauth:e.oauth,toolNames:r}),v(null))},className:"self-end px-2 py-1 rounded text-[10px] font-medium bg-primary text-white hover:bg-primary/90",children:"✓ Confirm Add"})]})]},e.url)})]}),(0,r.jsxs)("div",{className:"text-[10px] text-text-muted text-right",children:[O.length," of ",o.length," servers"]})]})})}},28067:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({options:e=[],value:t,onChange:a,size:i="md",className:l}){let o={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,r.jsx)("div",{className:(0,s.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",l),children:e.map(e=>(0,r.jsxs)("button",{onClick:()=>a(e.value),className:(0,s.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",o[i],t===e.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:e.icon}),e.label]},e.value))})}},28815:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(81127),i=a(92542),l=a(11059);function o({isOpen:e,onClose:t,title:a="Manual Configuration",configs:d=[]}){let{copy:c}=(0,l.C)(),[m,u]=(0,s.useState)(null);return(0,r.jsx)(n.default,{isOpen:e,onClose:t,title:a,size:"xl",children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:d.map((e,t)=>(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.filename}),(0,r.jsxs)(i.default,{variant:"ghost",size:"sm",onClick:()=>{var a;return a=e.content,void(c(a,`manualconfig-${t}`),u(t),setTimeout(()=>u(null),2e3))},children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:m===t?"check":"content_copy"}),m===t?"Copied!":"Copy"]})]}),(0,r.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:e.content})]},t))})})}},29366:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(28777),n=a(97677);function i({caps:e,className:t="",colorOverride:a,size:l=16}){if(!e)return null;let o=Object.keys(s.bs).filter(t=>e[t]);return 0===o.length?null:(0,r.jsx)("span",{className:`inline-flex items-center gap-0.5 ${t}`,children:o.map(e=>(0,r.jsx)(n.default,{text:`${s.bs[e].label} — ${s.bs[e].desc}`,children:(0,r.jsx)("span",{className:`material-symbols-outlined leading-none cursor-help ${a||s.bs[e].color}`,style:{fontSize:`${l}px`},children:s.bs[e].icon})},e))})}},30815:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(35497);function o({isOpen:e,onSuccess:t,onClose:a}){let[n,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)(null),[x,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),y=async()=>{f(!0),u(null),g(!1),j(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(i(t.accessToken),c(t.machineId),g(!0)):t.windowsManual?j(!0):u(t.error||"Could not auto-detect tokens")}catch(e){u("Failed to auto-detect tokens")}finally{f(!1)}};(0,s.useEffect)(()=>{e&&y()},[e]);let k=async()=>{if(!n.trim())return void u("Please enter an access token");if(!d.trim())return void u("Please enter a machine ID");p(!0),u(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:n.trim(),machineId:d.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t?.(),a()}catch(e){u(e.message)}finally{p(!1)}};return(0,r.jsx)(l.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:a,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!h&&(0,r.jsxs)(r.Fragment,{children:[b&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),v&&(0,r.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,r.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Make sure Cursor IDE has been opened at least once, then click ",(0,r.jsx)("strong",{children:"Retry"}),". If the problem persists, paste your tokens manually below."]}),(0,r.jsx)(l.$n,{onClick:y,variant:"outline",fullWidth:!0,children:"Retry"})]}),!b&&!v&&!m&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:n,onChange:e=>i(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:d,onChange:e=>c(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),m&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:m})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:k,fullWidth:!0,disabled:x||!n.trim()||!d.trim(),children:x?"Importing...":"Import Token"}),(0,r.jsx)(l.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func.isRequired}},31852:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(95155),s=a(12115),n=a(98500),i=a.n(n),l=a(73321),o=a(14051),d=a.n(o),c=a(31474),m=a(90620),u=a(67098),x=a(47650);let p=[{id:"paypal",label:"PayPal",description:"paypal.me/XYOURZONE",icon:"account_balance_wallet",color:"#0070BA",url:"https://paypal.me/XYOURZONE",qr:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://paypal.me/XYOURZONE"},{id:"kofi",label:"Ko-fi",description:"ko-fi.com/rsalman",icon:"coffee",color:"#FF5E5B",url:"https://ko-fi.com/rsalman",qr:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://ko-fi.com/rsalman"},{id:"saweria",label:"Saweria (APAC)",description:"saweria.co/rsalman",icon:"savings",color:"#6E45E2",url:"https://saweria.co/rsalman",qr:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://saweria.co/rsalman"}];function h({isOpen:e,onClose:t}){let a=(0,s.useRef)(null);return((0,s.useEffect)(()=>{if(!e)return;let a=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),(0,s.useEffect)(()=>{if(!e)return;let r=e=>{a.current&&!a.current.contains(e.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t]),(0,s.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e]),!e||"u"<typeof document)?null:(0,x.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),(0,r.jsxs)("div",{ref:a,className:"relative w-full max-w-2xl rounded-2xl border border-border bg-surface shadow-2xl flex flex-col max-h-[88vh] animate-in fade-in zoom-in-95 duration-200",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border-subtle p-4",children:[(0,r.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold text-text-main",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-pink-500",children:"volunteer_activism"}),"Support ExtremeRouter"]}),(0,r.jsx)("button",{onClick:t,className:"rounded-lg p-1.5 text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-5",children:[(0,r.jsx)("p",{className:"mx-auto mb-6 max-w-md text-center text-sm text-text-muted",children:"ExtremeRouter is free and open source. If it saves you time or money, consider buying me a coffee — every bit keeps development going. \uD83D\uDC9C"}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:p.map(e=>(0,r.jsx)(f,{channel:e},e.id))})]})]})]}),document.body)}function f({channel:e}){let{label:t,description:a,icon:s,color:n,url:i,qr:l}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center rounded-xl border border-border bg-surface-2 p-4 text-center transition-colors hover:border-primary/40",children:[(0,r.jsx)("div",{className:"mb-3 flex size-12 items-center justify-center rounded-full",style:{backgroundColor:`${n}20`,color:n},children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:s})}),(0,r.jsx)("div",{className:"mb-1 font-semibold text-text-main",children:t}),a&&(0,r.jsx)("div",{className:"mb-3 text-xs text-text-muted",children:a}),l&&(0,r.jsx)("img",{src:l,alt:`${t} QR code`,loading:"lazy",className:"mb-3 aspect-square w-full max-w-[180px] rounded-lg bg-white p-1"}),i&&(0,r.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-sm font-medium text-white transition-opacity hover:opacity-90",style:{backgroundColor:n},children:["Open",(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"})]})]})}h.propTypes={isOpen:d().bool.isRequired,onClose:d().func.isRequired};let b=[{label:"Gateway",items:[{href:"/dashboard/overview",label:"Overview",icon:"dashboard"},{href:"/dashboard/playground",label:"Playground",icon:"science"},{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/token-saver",label:"Token Saver",icon:"savings"}]},{label:"Observe",items:[{href:"/dashboard/usage",label:"Activity",icon:"bar_chart"},{href:"/dashboard/health",label:"Health",icon:"monitor_heart"},{href:"/dashboard/quota",label:"Quota",icon:"data_usage"},{href:"/dashboard/swarm",label:"Swarm",icon:"hub"},{href:"/dashboard/console-log",label:"Console",icon:"terminal"}]},{label:"Tools",items:[{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"},{href:"/dashboard/mitm",label:"MITM Proxy",icon:"security"},{href:"/dashboard/media-providers/image",label:"Media",icon:"perm_media"}]},{label:"Configure",items:[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/alerts",label:"Alerts",icon:"notifications"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}]}];function g({onClose:e}){let t=(0,l.usePathname)(),{isNew:a,markSeen:n}=(0,u.P)("features");(0,s.useEffect)(()=>{t&&n(t)},[t,n]);let[o,d]=(0,s.useState)(!1);return(0,r.jsxs)("aside",{className:"flex h-full w-72 shrink-0 flex-col border-r border-border-subtle bg-sidebar backdrop-blur-xl",children:[(0,r.jsx)("div",{className:"border-b border-border-subtle p-4",children:(0,r.jsxs)(i(),{href:"/dashboard",onClick:e,className:"group flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex size-9 items-center justify-center rounded-brand bg-primary text-white shadow-[var(--shadow-warm)]",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"hub"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"truncate text-sm font-semibold tracking-tight text-text-main",children:"ExtremeRouter"}),(0,r.jsxs)("div",{className:"text-xs text-text-muted",children:["Gateway Console \xb7 v",m.vQ.version]})]})]})}),(0,r.jsx)("div",{className:"p-3",children:(0,r.jsxs)(i(),{href:"/dashboard/providers",onClick:e,className:"flex h-9 items-center gap-2 rounded-brand border border-border bg-surface-2 px-3 text-xs text-text-muted transition-colors hover:border-primary/40 hover:text-text-main",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"search"}),"Search providers, models, keys…"]})}),(0,r.jsx)("nav",{className:"custom-scrollbar flex-1 overflow-y-auto px-3 pb-4",children:b.map(s=>(0,r.jsxs)("div",{className:"mb-5",children:[(0,r.jsx)("div",{className:"mb-2 px-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-text-subtle",children:s.label}),(0,r.jsx)("div",{className:"space-y-1",children:s.items.map(s=>{var n;let l=(n=s.href,!!t&&(t===n||("/dashboard/endpoint"===n?"/dashboard"===t:t===n||t.startsWith(n+"/")))),o=!l&&a(s.href);return(0,r.jsxs)(i(),{href:s.href,onClick:e,className:(0,c.cn)("group flex h-9 items-center gap-3 rounded-brand px-3 text-sm transition-colors",l?"bg-primary/15 text-text-main ring-1 ring-primary/20":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",l&&"text-primary fill-1"),children:s.icon}),(0,r.jsx)("span",{className:"truncate font-medium",children:s.label}),o&&(0,r.jsx)("span",{className:"ml-auto inline-flex items-center rounded-full bg-primary/12 px-1.5 py-0.5 text-[9px] font-bold text-primary ring-1 ring-primary/20",children:"NEW"}),l&&(0,r.jsx)("span",{className:"ml-auto size-1.5 rounded-full bg-primary"})]},s.href)})})]},s.label))}),(0,r.jsxs)("div",{className:"border-t border-border-subtle p-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>d(!0),className:"mb-2 flex h-9 w-full items-center gap-3 rounded-brand px-3 text-sm text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"volunteer_activism"}),(0,r.jsx)("span",{className:"font-medium",children:"Support"})]}),(0,r.jsxs)("div",{className:"rounded-brand border border-border-subtle bg-surface-2 p-3",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center gap-2 text-xs font-semibold text-text-main",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-success"}),"Local Gateway"]}),(0,r.jsx)("div",{className:"font-mono text-[11px] text-text-muted",children:"localhost:20128/v1"})]})]}),(0,r.jsx)(h,{isOpen:o,onClose:()=>d(!1)})]})}g.propTypes={onClose:d().func}},34325:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({children:e,className:t}){return(0,r.jsx)("div",{className:(0,s.cn)("mb-4 flex flex-col gap-2 rounded-brand border border-border-subtle bg-panel/60 p-2 backdrop-blur-md sm:flex-row sm:items-center sm:justify-between",t),children:e})}n.Group=function({children:e,className:t}){return(0,r.jsx)("div",{className:(0,s.cn)("flex flex-wrap items-center gap-2",t),children:e})},n.Search=function({value:e,onChange:t,placeholder:a="Search…",className:n}){return(0,r.jsxs)("div",{className:(0,s.cn)("relative",n),children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"search"})}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t?.(e.target.value),placeholder:a,className:"h-8 w-full rounded bg-surface-2 pl-8 pr-7 text-xs text-text-main placeholder:text-text-muted/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 sm:w-56"}),e&&(0,r.jsx)("button",{onClick:()=>t?.(""),"aria-label":"Clear search",className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted transition-colors hover:bg-surface-3 hover:text-text-main",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}},35497:(e,t,a)=>{a.d(t,{x0:()=>y.default,Ex:()=>d.default,$n:()=>r.default,nh:()=>S.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,CK:()=>p.default,uo:()=>l.ConfirmModal,G9:()=>b.default,wI:()=>j.default,pp:()=>W.default,vj:()=>v.default,vE:()=>g.default,pd:()=>s.default,Mh:()=>f.default,uR:()=>x.default,Nf:()=>h.default,aF:()=>l.default,rq:()=>u.default,gw:()=>k.default,LF:()=>m.default,zY:()=>O.default,Wx:()=>C.default,Iz:()=>w.default,l6:()=>n.default,lM:()=>c.default,m_:()=>N.default});var r=a(92542),s=a(11910),n=a(98),i=a(84588),l=a(81127),o=a(25086);a(56319);var d=a(56061),c=a(98542);a(38587),a(21110),a(31852),a(8823),a(92173);var m=a(90882),u=a(72908),x=a(28815),p=a(45455),h=a(28058);a(21931),a(67968),a(80752),a(40197),a(61500);var f=a(62899);a(94230);var b=a(30815),g=a(23936),v=a(95088),j=a(73579),y=a(96748),k=a(4823),w=a(28067),N=a(97677),C=a(51825),S=a(29366),O=a(54960);a(34325),a(6587);var W=a(99312);a(7648),a(91450)},38003:(e,t,a)=>{a.d(t,{C:()=>r});let r=(0,a(1934).v)(e=>({query:"",placeholder:"",visible:!1,setQuery:t=>e({query:t}),register:(t="Search...")=>e({visible:!0,placeholder:t,query:""}),unregister:()=>e({visible:!1,placeholder:"",query:""})}))},38202:(e,t,a)=>{a.d(t,{h:()=>r});let r={en:"\uD83C\uDDFA\uD83C\uDDF8",vi:"\uD83C\uDDFB\uD83C\uDDF3","zh-CN":"\uD83C\uDDE8\uD83C\uDDF3","zh-TW":"\uD83C\uDDF9\uD83C\uDDFC",ja:"\uD83C\uDDEF\uD83C\uDDF5","pt-BR":"\uD83C\uDDE7\uD83C\uDDF7","pt-PT":"\uD83C\uDDF5\uD83C\uDDF9",ko:"\uD83C\uDDF0\uD83C\uDDF7",es:"\uD83C\uDDEA\uD83C\uDDF8",de:"\uD83C\uDDE9\uD83C\uDDEA",fr:"\uD83C\uDDEB\uD83C\uDDF7",he:"\uD83C\uDDEE\uD83C\uDDF1",ar:"\uD83C\uDDF8\uD83C\uDDE6",ru:"\uD83C\uDDF7\uD83C\uDDFA",pl:"\uD83C\uDDF5\uD83C\uDDF1",cs:"\uD83C\uDDE8\uD83C\uDDFF",nl:"\uD83C\uDDF3\uD83C\uDDF1",tr:"\uD83C\uDDF9\uD83C\uDDF7",uk:"\uD83C\uDDFA\uD83C\uDDE6",tl:"\uD83C\uDDF5\uD83C\uDDED",id:"\uD83C\uDDEE\uD83C\uDDE9",th:"\uD83C\uDDF9\uD83C\uDDED",hi:"\uD83C\uDDEE\uD83C\uDDF3",bn:"\uD83C\uDDE7\uD83C\uDDE9",ur:"\uD83C\uDDF5\uD83C\uDDF0",ro:"\uD83C\uDDF7\uD83C\uDDF4",sv:"\uD83C\uDDF8\uD83C\uDDEA",it:"\uD83C\uDDEE\uD83C\uDDF9",el:"\uD83C\uDDEC\uD83C\uDDF7",hu:"\uD83C\uDDED\uD83C\uDDFA",fi:"\uD83C\uDDEB\uD83C\uDDEE",da:"\uD83C\uDDE9\uD83C\uDDF0",no:"\uD83C\uDDF3\uD83C\uDDF4"}},38587:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(1620),n=a(31474);function i({className:e,variant:t="default"}){let{isDark:a,toggleTheme:l}=(0,s.D)(),o={default:(0,n.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,n.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60 hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};return(0,r.jsx)("button",{onClick:l,className:(0,n.cn)(o[t],e),"aria-label":`Switch to ${a?"light":"dark"} mode`,title:`Switch to ${a?"light":"dark"} mode`,children:(0,r.jsx)("span",{className:(0,n.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:a?"light_mode":"dark_mode"})})}},40197:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(12115),n=a(47650),i=a(14051),l=a.n(i),o=a(9233),d=a(90620);function c({isOpen:e,onClose:t}){let[a,i]=(0,s.useState)(""),[l,m]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),p=(0,s.useRef)(null);return((0,s.useEffect)(()=>{e&&!a&&(m(!0),x(""),fetch(d.Nu.changelogUrl).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(e=>i(o.xI.parse(e))).catch(e=>x(e.message||"Failed to load")).finally(()=>m(!1)))},[e,a]),(0,s.useEffect)(()=>{let a=e=>{p.current&&!p.current.contains(e.target)&&t()};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t]),!e||"u"<typeof document)?null:(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t}),(0,r.jsxs)("div",{ref:p,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[l&&(0,r.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),u&&(0,r.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",u]}),!l&&!u&&a&&(0,r.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:a}})]})]})]}),document.body)}o.xI.setOptions({gfm:!0,breaks:!0}),c.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired}},45455:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(81127),i=a(11910),l=a(92542),o=a(72908);let d=/^[a-zA-Z0-9_.\-]+$/;function c({index:e,model:t,isFirst:a,isLast:n,onEdit:i,onMoveUp:l,onMoveDown:o,onRemove:d}){let[m,u]=(0,s.useState)(!1),[x,p]=(0,s.useState)(t),h=()=>{let e=x.trim();e&&e!==t?i(e):p(t),u(!1)};return(0,r.jsxs)("div",{className:"group flex min-w-0 items-center gap-1.5 rounded-md bg-black/[0.02] px-2 py-1 transition-colors hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04]",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:e+1}),m?(0,r.jsx)("input",{autoFocus:!0,value:x,onChange:e=>p(e.target.value),onBlur:h,onKeyDown:e=>{"Enter"===e.key&&h(),"Escape"===e.key&&(p(t),u(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,r.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>u(!0),title:"Click to edit",children:t}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,r.jsx)("button",{onClick:l,disabled:a,className:`p-0.5 rounded ${a?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,r.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,r.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function m({isOpen:e,combo:t,onClose:a,onSave:u,activeProviders:x,kindFilter:p=null,forcePrefix:h="",title:f}){let b=t?.name?h&&t.name.startsWith(h)?t.name.slice(h.length):t.name:"",[g,v]=(0,s.useState)(b),[j,y]=(0,s.useState)(t?.models||[]),[k,w]=(0,s.useState)(!1),[N,C]=(0,s.useState)(!1),[S,O]=(0,s.useState)(""),[W,_]=(0,s.useState)({});(0,s.useEffect)(()=>{e&&fetch("/api/models/alias").then(e=>e.ok?e.json():null).then(e=>e&&_(e.aliases||{})).catch(()=>{})},[e]);let P=e=>{if(!e.trim())return O("Name is required"),!1;let t=h+e;return d.test(t)?(O(""),!0):(O("Only letters, numbers, -, _ and . allowed"),!1)},F=e=>{let t=e.target.value;h&&t.startsWith(h)&&(t=t.slice(h.length)),v(t),t?P(t):O("")},I=async()=>{P(g)&&(C(!0),await u({name:h+g.trim(),models:j}),C(!1))},E=!!t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{isOpen:e,onClose:a,title:f||(E?"Edit Combo":"Create Combo"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{children:[h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("label",{className:"text-sm font-medium mb-1 block",children:"Combo Name"}),(0,r.jsxs)("div",{className:"flex items-stretch",children:[(0,r.jsx)("span",{className:"inline-flex items-center px-2 rounded-l border border-r-0 border-black/10 dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.04] text-text-muted font-mono text-sm",children:h}),(0,r.jsx)("input",{value:g,onChange:F,placeholder:"my-combo",className:"flex-1 min-w-0 rounded-r border border-black/10 dark:border-white/10 bg-white dark:bg-black/20 px-2 py-1.5 font-mono text-sm outline-none focus:border-primary"})]}),S&&(0,r.jsx)("p",{className:"text-[11px] text-red-500 mt-0.5",children:S})]}):(0,r.jsx)(i.default,{label:"Combo Name",value:g,onChange:F,placeholder:"my-combo",error:S}),(0,r.jsxs)("p",{className:"text-[10px] text-text-muted mt-0.5",children:[h?`Auto-prefixed with "${h}". `:"","Only letters, numbers, -, _ and . allowed"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===j.length?(0,r.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,r.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:j.map((e,t)=>(0,r.jsx)(c,{index:t,model:e,isFirst:0===t,isLast:t===j.length-1,onEdit:e=>{let a=[...j];a[t]=e,y(a)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...j];[t[e-1],t[e]]=[t[e],t[e-1]],y(t)})(t),onMoveDown:()=>(e=>{if(e===j.length-1)return;let t=[...j];[t[e],t[e+1]]=[t[e+1],t[e]],y(t)})(t),onRemove:()=>y(j.filter((e,a)=>a!==t))},t))}),(0,r.jsxs)("button",{onClick:()=>w(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,r.jsx)(l.default,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,r.jsx)(l.default,{onClick:I,fullWidth:!0,size:"sm",disabled:!g.trim()||!!S||N,children:N?"Saving...":E?"Save":"Create"})]})]})}),(0,r.jsx)(o.default,{isOpen:k,onClose:()=>w(!1),onSelect:e=>{j.includes(e.value)||y([...j,e.value])},onDeselect:e=>{y(j.filter(t=>t!==e.value))},activeProviders:x,modelAliases:W,title:"Add Model to Combo",kindFilter:p,addedModelValues:j,closeOnSelect:!1})]})}},51825:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(84588);let n={mode:{label:"Mode",format:e=>e},defaultModel:{label:"Model",format:e=>e,mono:!0},baseUrl:{label:"Endpoint",format:e=>e,isLink:!0,mono:!0},costPerQuery:{label:"Cost / call",format:e=>0===e?"Free":`$${e.toFixed(4)}`},pricingUrl:{label:"Pricing",format:()=>"View pricing",isLink:!0},freeTier:{label:"Free tier",format:e=>e},freeMonthlyQuota:{label:"Free quota",format:e=>0===e?"—":e>=999999?"Unlimited":`${e.toLocaleString()} / mo`},searchTypes:{label:"Types",format:e=>e.join(", ")},formats:{label:"Formats",format:e=>e.join(", ")},maxMaxResults:{label:"Max results",format:e=>e},maxCharacters:{label:"Max chars",format:e=>e.toLocaleString()}};function i({config:e,provider:t,title:a="Provider Info"}){if(!e)return null;let l=Object.entries(n).filter(([t])=>void 0!==e[t]&&null!==e[t]&&""!==e[t]).map(([t,a])=>({key:t,label:a.label,value:a.format(e[t]),isLink:a.isLink,mono:a.mono,raw:e[t]})),o=t?.notice?.apiKeyUrl||t?.website,d=t?.notice?.text;return(0,r.jsxs)(s.default,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:a}),o&&(0,r.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2",children:[l.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0",children:e.label}),e.isLink?(0,r.jsx)("a",{href:e.raw,target:"_blank",rel:"noopener noreferrer",className:`text-sm text-primary hover:underline truncate ${e.mono?"font-mono":""}`,children:e.value}):(0,r.jsx)("span",{className:`text-sm text-text-main truncate ${e.mono?"font-mono":""}`,children:e.value})]},e.key)),d&&(0,r.jsxs)("div",{className:"flex items-start gap-3 min-w-0 sm:col-span-2",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0 mt-0.5",children:"Notice"}),(0,r.jsx)("span",{className:"text-sm text-text-main leading-relaxed",children:d})]})]})]})}},53593:(e,t,a)=>{a.d(t,{y:()=>d});var r=a(12115),s=a(62630);let n={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,thinkingMaxEffort:!1,contextWindow:2e5,maxOutput:64e3},i={"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},l={nvidia:{"minimaxai/minimax-m2.7":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072},"minimaxai/minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:131072},"z-ai/glm-5.2":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:128e3},"deepseek-ai/deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},"deepseek-ai/deepseek-v4-flash":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536}},"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}}},o=[{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*fable*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude-*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:1024,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5.6-sol*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3,thinkingMaxEffort:!0}},{pattern:"*gpt-5.6-terra*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3}},{pattern:"*gpt-5.6-luna*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3}},{pattern:"*kimi-k3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:65536,thinkingMaxEffort:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o1_*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3-*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3_*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4-*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4_*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok-imagine-video*",caps:{videoOutput:!0}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*omni*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:65536}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwen*max*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.5*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.6*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.7*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function d(){let[e,t]=(0,r.useState)({}),[a,d]=(0,r.useState)({});return(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{let a=await fetch("/api/models");if(!a.ok)return;let r=await a.json(),s={},n={};for(let e of r.models||[])e.caps&&(e.fullModel&&(s[e.fullModel]=e.caps),e.model&&(n[e.model]=e.caps));e&&(t(s),d(n))}catch{}})(),()=>{e=!1}},[]),{getCaps:t=>{if(!t)return null;if(e[t])return e[t];let r=t.includes("/")?t.slice(t.indexOf("/")+1):t;if(a[r])return a[r];let d=function(e,t){if(!t)return{...n};if(e&&l[e]?.[t])return{...n,...l[e][t]};let a=t.includes("/")?t.split("/").pop():t;if(i[a])return{...n,...i[a]};if(i[t])return{...n,...i[t]};for(let{pattern:e,caps:r}of o)if((0,s.gH)(e,a)||(0,s.gH)(e,t))return{...n,...r};return{...n}}(t.includes("/")?t.slice(0,t.indexOf("/")):null,r);return{vision:d.vision,search:d.search,reasoning:d.reasoning}}}}},54960:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({title:e,description:t,icon:a,iconNode:i,actions:l,breadcrumbs:o,className:d}){return(0,r.jsxs)("div",{className:(0,s.cn)("mb-6",d),children:[o?.length>0&&(0,r.jsx)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs text-text-muted",children:o.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-60",children:"chevron_right"}),e.href?(0,r.jsx)("a",{href:e.href,className:"transition-colors hover:text-primary",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-text-main",children:e.label})]},t))}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i?(0,r.jsx)("div",{className:"mt-0.5 shrink-0",children:i}):a&&(0,r.jsx)("div",{className:"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight text-text-main",children:e}),t&&(0,r.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:t})]})]}),l&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})]})}},56061:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(31474);let n={default:"bg-surface-2 text-text-muted ring-1 ring-border-subtle",primary:"bg-primary/12 text-primary ring-1 ring-primary/20",success:"bg-success/12 text-success ring-1 ring-success/20",warning:"bg-warning/12 text-warning ring-1 ring-warning/20",error:"bg-danger/12 text-danger ring-1 ring-danger/20",info:"bg-info/12 text-info ring-1 ring-info/20",cyan:"bg-cyan/12 text-cyan ring-1 ring-cyan/20"},i={default:"bg-text-subtle",primary:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",cyan:"bg-cyan"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function o({children:e,variant:t="default",size:a="md",dot:d=!1,icon:c,className:m}){return(0,r.jsxs)("span",{className:(0,s.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold leading-none",n[t],l[a],m),children:[d&&(0,r.jsx)("span",{className:(0,s.cn)("size-1.5 rounded-full",i[t])}),c&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:c}),e]})}},56319:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({src:e,alt:t="Avatar",name:a,size:i="md",className:l}){let o={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return e?(0,r.jsx)("div",{className:(0,s.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",o[i],l),style:{backgroundImage:`url(${e})`},role:"img","aria-label":t}):(0,r.jsx)("div",{className:(0,s.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",o[i],(e=>{if(!e)return"bg-primary";let t=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],a=e.charCodeAt(0)%t.length;return t[a]})(a),l),role:"img","aria-label":t,children:(e=>{if(!e)return"?";let t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()})(a)})}},57250:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n);function l({src:e,alt:t,size:a=32,className:n="",fallbackText:i="?",fallbackColor:o}){let[d,c]=(0,s.useState)(!1);return!e||d?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${n}`.trim(),style:{width:a,height:a,color:o,fontSize:Math.max(10,Math.floor(.38*a))},children:i}):(0,r.jsx)("img",{src:e,alt:t,width:a,height:a,className:n,onError:()=>c(!0)})}l.propTypes={src:i().string,alt:i().string,size:i().number,className:i().string,fallbackText:i().string,fallbackColor:i().string}},61500:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(35497);function o({isOpen:e,onMethodSelect:t,onClose:a}){let[n,i]=(0,s.useState)(null),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)("us-east-1"),[x,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(""),[b,g]=(0,s.useState)(""),[v,j]=(0,s.useState)("us-east-1"),[y,k]=(0,s.useState)(null),[w,N]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[O,W]=(0,s.useState)(!1),[_,P]=(0,s.useState)(null);(0,s.useEffect)(()=>{"import"===n&&e&&(async()=>{S(!0),k(null),W(!1),P(null);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(p(t.refreshToken),W(!0),t.clientId&&t.clientSecret&&P({clientId:t.clientId,clientSecret:t.clientSecret,region:t.region,authMethod:t.authMethod,profileArn:t.profileArn})):k(t.error||"Could not auto-detect token")}catch(e){k("Failed to auto-detect token")}finally{S(!1)}})()},[n,e]);let F=e=>{i(e),k(null)},I=()=>{i(null),k(null)},E=async()=>{if(!x.trim())return void k("Please enter a refresh token");N(!0),k(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:x.trim(),..._||{}})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("import")}catch(e){k(e.message)}finally{N(!1)}},A=async()=>{if(!h.trim())return void k("Please paste CLIProxyAPI auth JSON");N(!0),k(null);try{let e=await fetch("/api/oauth/kiro/import-cli-proxy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({json:h.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"CLIProxyAPI import failed");t("import-cli-proxy")}catch(e){k(e.message)}finally{N(!1)}},z=async()=>{if(!b.trim())return void k("Please enter an API key");N(!0),k(null);try{let e=await fetch("/api/oauth/kiro/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:b.trim(),region:v.trim()||"us-east-1"})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("api-key")}catch(e){k(e.message)}finally{N(!1)}},R=e=>{t("social",{provider:e})};return(0,r.jsx)(l.aF,{isOpen:e,title:"Connect Kiro",onClose:a,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!n&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,r.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("api-key"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"key"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"API Key"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Use a long-lived Kiro/CodeWhisperer API key (headless auth)."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("import-cli-proxy"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"data_object"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import CLIProxyAPI JSON"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste external_idp auth JSON from CLIProxyAPI/Kiro Microsoft login."})]})]})})]}),"idc"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:d,onChange:e=>c(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(l.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),y&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:y}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>{d.trim()?t("idc",{startUrl:d.trim(),region:m}):k("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"api-key"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste a long-lived Kiro/CodeWhisperer API key. It is validated against AWS and stored directly as a bearer credential (no refresh)."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["API Key ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:b,onChange:e=>g(e.target.value),placeholder:"Paste your Kiro API key...",className:"font-mono text-sm"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(l.pd,{value:v,onChange:e=>j(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for the key (default: us-east-1)"})]}),y&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:y})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:z,fullWidth:!0,disabled:w||!b.trim(),children:w?"Validating...":"Add API Key"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>R("google"),fullWidth:!0,children:"Continue with Google"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>R("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[C&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!C&&(0,r.jsxs)(r.Fragment,{children:[O&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!O&&!y&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:x,onChange:e=>p(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),y&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:y})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:E,fullWidth:!0,disabled:w||!x.trim(),children:w?"Importing...":"Import Token"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]}),"import-cli-proxy"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste the Kiro CLIProxyAPI auth JSON containing auth_method=external_idp. Only Microsoft login token endpoints are accepted."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["CLIProxyAPI Auth JSON ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:h,onChange:e=>f(e.target.value),placeholder:'{"auth_method":"external_idp","access_token":"...","refresh_token":"...","client_id":"...","token_endpoint":"https://login.microsoftonline.com/.../oauth2/v2.0/token","profile_arn":"...","scopes":"..."}',className:"min-h-40 w-full rounded-md border border-border bg-background p-3 font-mono text-sm outline-none focus:border-primary"})]}),y&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:y})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:A,fullWidth:!0,disabled:w||!h.trim(),children:w?"Importing...":"Import CLIProxyAPI JSON"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onMethodSelect:i().func.isRequired,onClose:i().func.isRequired}},62899:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(90882),o=a(61500),d=a(94230);function c({isOpen:e,providerInfo:t,onSuccess:a,onClose:n}){let[i,m]=(0,s.useState)(null),[u,x]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),f=(0,s.useCallback)((e,t)=>{"builder-id"===e?m("builder-id"):"idc"===e?(m("idc"),h(t)):"social"===e?(m("social"),x(t.provider)):("import"===e||"api-key"===e)&&a?.()},[a]),b=()=>{m(null),x(null),h(null)};return i?"builder-id"===i||"idc"===i?(0,r.jsx)(l.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{m(null),h(null),a?.(),n?.()},onClose:b,idcConfig:p}):"social"===i&&u?(0,r.jsx)(d.default,{isOpen:e,provider:u,onSuccess:()=>{m(null),x(null),a?.(),n?.()},onClose:b}):null:(0,r.jsx)(o.default,{isOpen:e,onMethodSelect:f,onClose:n})}c.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},65921:(e,t,a)=>{a.d(t,{i:()=>n});var r=a(1934);let s=0,n=(0,r.v)((e,t)=>({notifications:[],addNotification:a=>{let r=++s,n={id:r,type:a.type||"info",message:a.message,title:a.title||null,duration:a.duration??5e3,dismissible:a.dismissible??!0,createdAt:Date.now()};return e(e=>({notifications:[...e.notifications,n]})),n.duration>0&&setTimeout(()=>t().removeNotification(r),n.duration),r},removeNotification:t=>{e(e=>({notifications:e.notifications.filter(e=>e.id!==t)}))},clearAll:()=>e({notifications:[]}),success:(e,a)=>t().addNotification({type:"success",message:e,title:a}),error:(e,a)=>t().addNotification({type:"error",message:e,title:a,duration:8e3}),warning:(e,a)=>t().addNotification({type:"warning",message:e,title:a}),info:(e,a)=>t().addNotification({type:"info",message:e,title:a})}))},67098:(e,t,a)=>{a.d(t,{P:()=>n});var r=a(12115);function s(e,t){try{window.localStorage.setItem(`seen:${e}`,JSON.stringify(t))}catch{}}function n(e){let[t,a]=(0,r.useState)({});(0,r.useEffect)(()=>{a(function(e){try{let t=window.localStorage.getItem(`seen:${e}`);return t?JSON.parse(t):{}}catch{return{}}}(e))},[e]);let n=(0,r.useCallback)(e=>!t[e],[t]);return{isNew:n,markSeen:(0,r.useCallback)(t=>{a(a=>{if(a[t])return a;let r={...a,[t]:new Date().toISOString()};return s(e,r),r})},[e]),markAllSeen:(0,r.useCallback)(t=>{a(a=>{let r=!1,n={...a};for(let e of t)n[e]||(n[e]=new Date().toISOString(),r=!0);return r&&s(e,n),r?n:a})},[e])}}},67968:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),s=a(12115),n=a(47650);let i=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],l=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function o({isOpen:e,onClose:t}){return((0,s.useEffect)(()=>{if(!e)return;document.body.style.overflow="hidden";let a=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",a),()=>{document.body.style.overflow="",document.removeEventListener("keydown",a)}},[e,t]),e)?(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:t}),(0,r.jsxs)("div",{className:"relative w-full max-w-sm rounded-[14px] overflow-hidden shadow-[var(--shadow-elev)] fade-in flex flex-col bg-surface border border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,r.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,r.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,r.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,r.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,r.jsx)("div",{className:"flex gap-2 w-full",children:i.map(({icon:e,label:t,desc:a})=>(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1.5 py-4 px-1 rounded-[10px] border border-border-subtle bg-surface-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:e}),(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main",children:t}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:a})]},t))}),(0,r.jsx)("div",{className:"flex flex-col gap-3 w-full",children:l.map(({icon:e,text:t})=>(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:e}),(0,r.jsx)("span",{className:"text-xs text-text-muted",children:t})]},e))}),(0,r.jsxs)("button",{onClick:()=>window.open("https://9remote.cc","_blank"),className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-semibold text-white rounded-[10px] bg-primary hover:bg-primary-hover shadow-[var(--shadow-warm)] active:scale-[0.98] transition-all",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}function d(){let[e,t]=(0,s.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>t(!0),className:"relative flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg transition-all text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5",title:"9Remote",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"computer"}),(0,r.jsx)("span",{className:"text-xs font-medium",children:"Remote"})]}),(0,r.jsx)(o,{isOpen:e,onClose:()=>t(!1)})]})}},72908:(e,t,a)=>{a.d(t,{default:()=>f});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(57250),d=a(29366),c=a(53593),m=a(28777),u=a(88105),x=a(8247);let p=[...Object.keys(u.zN),...Object.keys(u.IS),...Object.keys(u.nJ),...Object.keys(u.fg)],h=Object.keys(u.IS).filter(e=>u.IS[e].noAuth);function f({isOpen:e,onClose:t,onSelect:a,onDeselect:n,selectedModel:i,activeProviders:b=[],title:g="Select Model",modelAliases:v={},kindFilter:j=null,addedModelValues:y=[],closeOnSelect:k=!0}){let w=(0,s.useMemo)(()=>j?b.filter(e=>{let t=u.Q2[e.provider];return(t?.serviceKinds||["llm"]).includes(j)}):b,[b,j]),{getCaps:N}=(0,c.y)(),[C,S]=(0,s.useState)(""),[O,W]=(0,s.useState)([]),[_,P]=(0,s.useState)([]),[F,I]=(0,s.useState)([]),[E,A]=(0,s.useState)({}),z=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();W(t.combos||[])}catch(e){console.error("Error fetching combos:",e),W([])}};(0,s.useEffect)(()=>{e&&z()},[e]);let R=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();P(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),P([])}};(0,s.useEffect)(()=>{e&&R()},[e]);let T=async()=>{try{let e=await fetch("/api/models/custom");if(!e.ok)throw Error(`Failed to fetch custom models: ${e.status}`);let t=await e.json();I(t.models||[])}catch(e){console.error("Error fetching custom models:",e),I([])}};(0,s.useEffect)(()=>{e&&T()},[e]);let L=async()=>{try{let e=await fetch("/api/models/disabled");if(!e.ok)throw Error(`Failed to fetch disabled models: ${e.status}`);let t=await e.json();A(t.disabled||{})}catch(e){console.error("Error fetching disabled models:",e),A({})}};(0,s.useEffect)(()=>{e&&L()},[e]);let $=(0,s.useMemo)(()=>({...u.zN,...u.IS,...u.nJ,...u.fg}),[]),q=(0,s.useMemo)(()=>{let e={},t=new Set(["webSearch","webFetch"]),a=new Set(["image","tts","stt","embedding","imageToText"]),r=new Set(["tts","image","webFetch"]);return[...new Set([...w.map(e=>e.provider),...j?h.filter(e=>(u.Q2[e]?.serviceKinds||["llm"]).includes(j)):h])].sort((e,t)=>{let a=p.indexOf(e),r=p.indexOf(t);return(-1===a?999:a)-(-1===r?999:r)}).forEach(s=>{let n=(0,u.wG)(s),i=$[s]||{name:s,color:"#666"},l=(0,u.mq)(s)||(0,u.gb)(s);if(j&&t.has(j)){e[s]={name:i.name,alias:n,color:i.color,models:[{id:s,name:i.name,value:s}]};return}if(i.passthroughModels){let t=Object.entries(v).filter(([,e])=>e.startsWith(`${n}/`)).map(([e,t])=>({id:t.replace(`${n}/`,""),name:e,value:t})),l=F.filter(e=>e.providerAlias===n).map(e=>({id:e.id,name:e.name||e.id,value:`${n}/${e.id}`,kind:(0,m.CP)(e),isCustom:!0})),o=t;if(j&&a.has(j)){let e=l.filter(e=>(0,m.CP)(e)===j);0===(o=[...e,...(0,m.KC)(s).filter(e=>(0,m.CP)(e)===j).map(e=>({id:e.id,name:e.name,value:`${n}/${e.id}`,kind:(0,m.CP)(e)})).filter(t=>!e.some(e=>e.value===t.value))]).length&&r.has(j)&&(i.serviceKinds||["llm"]).includes(j)&&(o=[{id:s,name:i.name,value:n}])}else{let e=l.filter(e=>!(0,m.CP)(e)||"llm"===(0,m.CP)(e)),a=new Set([...t,...e].map(e=>e.value)),r=(0,m.KC)(s).filter(e=>!(0,m.CP)(e)||"llm"===(0,m.CP)(e)).map(e=>({id:e.id,name:e.name,value:`${n}/${e.id}`,kind:(0,m.CP)(e)})).filter(e=>!a.has(e.value));o=[...e,...t.filter(t=>!e.some(e=>e.value===t.value)),...r]}if(o.length>0){let t=_.find(e=>e.id===s),a=t?.name||i.name;e[s]={name:a,alias:n,color:i.color,models:o}}}else if(l){if(j&&a.has(j))return;let t=b.find(e=>e.provider===s),r=_.find(e=>e.id===s),n=r?.name||t?.name||i.name,l=t?.providerSpecificData?.prefix||r?.prefix||s,o=Object.entries(v).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:`${l}/${t.replace(`${s}/`,"")}`})),d=F.filter(e=>e.providerAlias===s).map(e=>({id:e.id,name:e.name||e.id,value:`${l}/${e.id}`,isCustom:!0})),c=new Set(o.map(e=>e.value)),m=[...o,...d.filter(e=>!c.has(e.value))],u=m.length>0?m:[{id:`__placeholder__${s}`,name:`${l}/model-id`,value:`${l}/model-id`,isPlaceholder:!0}];e[s]={name:n,alias:l,color:i.color,models:u,isCustom:!0,hasModels:m.length>0}}else{var o;let t=(0,m.KC)(s),l=new Set(t.map(e=>e.id)),d=t.length>0,c=Object.entries(v).filter(([e,t])=>t.startsWith(`${n}/`)&&(!d||e===t.replace(`${n}/`,""))&&!l.has(t.replace(`${n}/`,""))).map(([e,t])=>({id:t.replace(`${n}/`,""),name:e,value:t,isCustom:!0})),u=new Set(c.map(e=>e.id)),x=F.filter(e=>e.providerAlias===n&&!l.has(e.id)&&!u.has(e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${n}/${e.id}`,isCustom:!0})),p=[...t.map(e=>({id:e.id,name:e.name,value:`${n}/${e.id}`,kind:(0,m.CP)(e)})),...c,...x],h=new Set,f=(o=p.filter(e=>!h.has(e.value)&&(h.add(e.value),!0)),j?a.has(j)?o.filter(e=>e.isPlaceholder||(0,m.CP)(e)===j):o:o.filter(e=>e.isPlaceholder||e.isCustom||!(0,m.CP)(e)||"llm"===(0,m.CP)(e)));0===f.length&&j&&r.has(j)&&(i.serviceKinds||["llm"]).includes(j)&&(f=[{id:s,name:i.name,value:n}]),f.length>0&&(e[s]={name:i.name,alias:n,color:i.color,models:f})}}),Object.entries(e).forEach(([t,a])=>{let r=new Set([...E[(0,u.wG)(t)]||[],...E[t]||[]]);0!==r.size&&(a.models=a.models.filter(e=>!r.has(e.id)),0===a.models.length&&delete e[t])}),e},[w,v,$,_,F,E,j,b]),D=(0,s.useMemo)(()=>{if(j)return[];if(!C.trim())return O;let e=C.toLowerCase();return O.filter(t=>t.name.toLowerCase().includes(e))},[O,C,j]),M=(0,s.useMemo)(()=>{let e=C.trim().toLowerCase(),t={};return Object.entries(q).forEach(([a,r])=>{var s;let n=r.models;if(e){let t=r.name.toLowerCase().includes(e);if(0===(n=n.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e))).length&&!t)return}t[a]={...r,models:[...(s=n).filter(e=>y.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name)),...s.filter(e=>!y.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name))]}}),t},[q,C,y]),U=e=>{let r=e?.value||e?.name||e;y.includes(r)&&n?n(e):a(e),k&&(t(),S(""))};return(0,r.jsxs)(l.default,{isOpen:e,onClose:()=>{t(),S("")},title:g,size:"md",className:"p-4!",footer:null,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,r.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search...",value:C,onChange:e=>S(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,r.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[D.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",D.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:D.map(e=>{let t=i===e.name;return(0,r.jsxs)("button",{onClick:()=>U({id:e.name,name:e.name,value:e.name}),className:`
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5497],{98:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({label:e,options:t=[],value:a,onChange:i,placeholder:l="Select an option",error:o,hint:d,disabled:c=!1,required:m=!1,className:u,selectClassName:x,...p}){return(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",u),children:[e&&(0,r.jsxs)("label",{className:"text-xs font-semibold text-text-main",children:[e,m&&(0,r.jsx)("span",{className:"ml-1 text-danger",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:a,onChange:i,disabled:c,className:(0,s.cn)("w-full appearance-none rounded-brand border border-border bg-surface-2 py-2 pl-3 pr-10 text-sm text-text-main","[-webkit-appearance:none] [-moz-appearance:none]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",o&&"border-danger ring-1 ring-danger/20",x),...p,children:[(0,r.jsx)("option",{value:"",disabled:!0,children:l}),t.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,r.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"expand_more"})})]}),o&&(0,r.jsxs)("p",{className:"flex items-center gap-1 text-xs text-danger",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},1620:(e,t,a)=>{a.d(t,{D:()=>o});var r=a(12115),s=a(90085);function n(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function l(){return!1}function o(){let{theme:e,setTheme:t,toggleTheme:a,initTheme:o}=(0,s.A)(),d=(0,r.useSyncExternalStore)(n,i,l);(0,r.useEffect)(()=>{o()},[o]),(0,r.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>o();return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e,o]);let c="dark"===e||"system"===e&&d;return{theme:e,setTheme:t,toggleTheme:a,isDark:c}}},4823:(e,t,a)=>{a.d(t,{default:()=>u});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(84588),o=a(98),d=a(56061);let c="__none__",m=[{value:"none",label:"None (single pool)"},{value:"round-robin",label:"Round Robin — cycle through all pools"},{value:"random",label:"Random — pick a random pool each request"}];function u({providerId:e}){let[t,a]=(0,s.useState)([]),[n,i]=(0,s.useState)(c),[x,p]=(0,s.useState)("none"),[h,f]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let t=!1;return Promise.all([fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.ok?e.json():{proxyPools:[]}),fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{})]).then(([r,s])=>{if(t)return;a(r.proxyPools||[]);let n=(s.providerStrategies||{})[e]||{};i(n.proxyPoolId||c),p(n.rotateStrategy||"none")}).catch(()=>{}),()=>{t=!0}},[e]);let v=async t=>{f(!0);try{let a=await fetch("/api/settings",{cache:"no-store"}),r=(a.ok?await a.json():{}).providerStrategies||{},s={...r[e]||{}},n={...r};Object.assign(s,t),s.proxyPoolId||delete s.proxyPoolId,s.rotateStrategy&&"none"!==s.rotateStrategy||delete s.rotateStrategy,0===Object.keys(s).length?delete n[e]:n[e]=s,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})}),g(!0),setTimeout(()=>g(!1),1500)}catch(e){console.log("Save settings error:",e)}finally{f(!1)}},j="none"!==x,y=t.length>=2;return(0,r.jsxs)(l.default,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-green-500/10 text-green-500",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"No authentication required"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"This provider is ready to use. Optionally route requests through a proxy pool to bypass IP-based limits."})]}),b&&(0,r.jsx)(d.default,{variant:"success",size:"sm",children:"Saved"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Rotation Strategy",value:x,onChange:e=>{var t;p(t=e.target.value),v({rotateStrategy:t})},disabled:h,hint:j?y?`Rotating across ${t.length} active pools`:"Need ≥2 active pools for rotation":"Distribute requests across all active proxy pools",options:m.map(e=>({...e,..."none"!==e.value&&!y?{label:`${e.label} (need ≥2 pools)`}:{}}))}),(0,r.jsx)(o.default,{label:"Proxy Pool",value:n,onChange:e=>{var t;i(t=e.target.value),v({proxyPoolId:t===c?"":t})},disabled:h||j,hint:j?"Disabled — rotation auto-selects from all pools":void 0,options:[{value:c,label:"None (direct)"},...t.map(e=>({value:e.id,label:e.name}))]})]})]})}u.propTypes={providerId:i().string.isRequired}},6587:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(31474),n=a(97677);function i({icon:e,onClick:t,tooltip:a,variant:l="ghost",size:o="md",disabled:d,loading:c,className:m,...u}){let x=(0,r.jsx)("button",{onClick:t,disabled:d||c,"aria-label":a||e,className:(0,s.cn)("flex shrink-0 items-center justify-center transition-all disabled:opacity-50 disabled:cursor-not-allowed","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35",{ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",primary:"text-primary hover:bg-primary/10",danger:"text-danger hover:bg-danger/10",outline:"border border-border text-text-muted hover:border-primary/45 hover:bg-surface-2 hover:text-text-main"}[l],{sm:"size-6 rounded text-[14px]",md:"size-8 rounded-md text-[16px]",lg:"size-10 rounded-lg text-[20px]"}[o],m),...u,children:(0,r.jsx)("span",{className:(0,s.cn)("material-symbols-outlined",c&&"animate-spin"),children:c?"progress_activity":e})});return a?(0,r.jsx)(n.default,{text:a,position:"top",children:x}):x}},7648:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(65921),i=a(31852),l=a(8823);function o({children:e}){let[t,a]=(0,s.useState)(!1),d=(0,n.i)(e=>e.notifications),c=(0,n.i)(e=>e.removeNotification);return(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg text-text-main",children:[(0,r.jsx)("div",{className:"pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_top_left,rgba(139,92,246,0.16),transparent_32rem),radial-gradient(circle_at_top_right,rgba(34,211,238,0.10),transparent_28rem)]","aria-hidden":"true"}),(0,r.jsx)("div",{className:"fixed right-4 top-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:d.map(e=>{var t;let a="success"===(t=e.type)?{wrapper:"border-success/25 bg-success/10 text-success",icon:"check_circle"}:"error"===t?{wrapper:"border-danger/25 bg-danger/10 text-danger",icon:"error"}:"warning"===t?{wrapper:"border-warning/25 bg-warning/10 text-warning",icon:"warning"}:{wrapper:"border-info/25 bg-info/10 text-info",icon:"info"};return(0,r.jsx)("div",{className:`rounded-brand border px-3 py-2 shadow-[var(--shadow-elev)] backdrop-blur-md ${a.wrapper}`,children:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:a.icon}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,r.jsx)("p",{className:"mb-0.5 text-xs font-semibold",children:e.title}):null,(0,r.jsx)("p",{className:"whitespace-pre-wrap break-words text-xs",children:e.message})]}),e.dismissible?(0,r.jsx)("button",{type:"button",onClick:()=>c(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/40 backdrop-blur-sm lg:hidden",onClick:()=>a(!1)}),(0,r.jsx)("div",{className:"relative hidden lg:flex",children:(0,r.jsx)(i.default,{})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform transition-transform duration-200 ease-out lg:hidden ${t?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(i.default,{onClose:()=>a(!1)})}),(0,r.jsxs)("main",{className:"relative isolate flex h-full min-w-0 flex-1 flex-col",children:[(0,r.jsx)(l.default,{onMenuClick:()=>a(!0)}),(0,r.jsx)("div",{className:"custom-scrollbar flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8 lg:py-8",children:(0,r.jsx)("div",{className:"mx-auto w-full max-w-7xl",children:e})})]})]})}},8247:(e,t,a)=>{a.d(t,{k:()=>n});var r=a(88105);let s=new Set(["windsurf","trae","cody","kimchi","chatglm-cn","blackbox-web","puter","adapta-web","deepseek-web","chatgpt-web","doubao-web","gemini-web","copilot-web","muse-spark-web","duckduckgo-web","venice-web","t3-web","lmarena","veoaifree-web","claude-web","pollinations","poe-web","v0-vercel-web","qwen-web","kimi-web","huggingchat","api-airforce","openvecta","freebuff-web","zenmux-free","perplexity-agent","featherless","moonshot","qwencloud","devin"]);function n(e,t){if(e?.startsWith(r.JH))return"responses"===t?"/providers/oai-r.png":"/providers/oai-cc.png";if(e?.startsWith(r.DI))return"/providers/anthropic-m.png";let a=s.has(e)?"svg":"png";return`/providers/${e}.${a}`}},8823:(e,t,a)=>{a.d(t,{default:()=>f});var r=a(95155),s=a(12115),n=a(73321),i=a(14051),l=a.n(i),o=a(80752),d=a(93308),c=a(38202),m=a(21931);function u(){let[e,t]=(0,s.useState)(!1),[a,n]=(0,s.useState)("en");return(0,s.useEffect)(()=>{n(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${d.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,d.QC)(t)}())},[e]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>t(!0),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Language","data-i18n-skip":"true",children:(0,r.jsx)("span",{className:"text-lg leading-none",children:c.h[a]||"\uD83C\uDF10"})}),(0,r.jsx)(m.default,{hideTrigger:!0,isOpen:e,onClose:e=>{t(!1),n(e)}})]})}var x=a(38587),p=a(38003);let h=[["/dashboard/endpoint",{title:"Endpoint",description:"Gateway URL, tunnels, and API keys",icon:"api"}],["/dashboard/providers",{title:"Providers",description:"Provider registry and account health",icon:"dns"}],["/dashboard/combos",{title:"Combos",description:"Model routing strategies and fallback chains",icon:"layers"}],["/dashboard/usage",{title:"Activity",description:"Requests, analytics, and request details",icon:"bar_chart"}],["/dashboard/quota",{title:"Quota",description:"Capacity, resets, and account availability",icon:"data_usage"}],["/dashboard/token-saver",{title:"Token Saver",description:"Compression policies for prompt and tool output",icon:"savings"}],["/dashboard/cli-tools",{title:"CLI Tools",description:"Configure developer tools to use ExtremeRouter",icon:"terminal"}],["/dashboard/proxy-pools",{title:"Proxy Pools",description:"Outbound proxy routing and health checks",icon:"lan"}],["/dashboard/skills",{title:"Skills",description:"Reusable agent skills and install links",icon:"extension"}],["/dashboard/profile",{title:"Settings",description:"Security, routing, network, and account settings",icon:"settings"}],["/dashboard/translator",{title:"Translator",description:"Inspect format conversion between clients and providers",icon:"translate"}],["/dashboard/console-log",{title:"Console",description:"Live server logs",icon:"monitor"}],["/dashboard/mitm",{title:"MITM Proxy",description:"Intercept selected IDE traffic through the gateway",icon:"security"}],["/dashboard/media-providers",{title:"Media Providers",description:"Image, audio, embedding, and web providers",icon:"perm_media"}]];function f({onMenuClick:e,showMenuButton:t=!0}){let a=(0,n.usePathname)(),[i,l]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),m=(0,s.useMemo)(()=>(function(e){if(!e||"/dashboard"===e)return h[0][1];let t=h.find(([t])=>e.startsWith(t));return t?t[1]:{title:"ExtremeRouter",description:"Gateway Console",icon:"hub"}})(a),[a]);(0,s.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let a=await t.json();e||(l(a?.displayName||a?.oidcName||a?.oidcEmail||""),c(a?.loginMethod||""))}catch{e||(l(""),c(""))}}(),()=>{e=!0}},[]);let p=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsx)("header",{className:"shrink-0 border-b border-border-subtle bg-bg/70 px-4 py-3 backdrop-blur-xl lg:px-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[t&&(0,r.jsx)("button",{onClick:e,className:"rounded p-1.5 text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main lg:hidden","aria-label":"Open sidebar",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"menu"})}),(0,r.jsx)("div",{className:"hidden size-8 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15 sm:flex",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:m.icon})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"truncate text-sm font-semibold tracking-tight text-text-main sm:text-base",children:m.title}),(0,r.jsx)("p",{className:"hidden truncate text-xs text-text-muted md:block",children:m.description})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[i&&"OIDC"===d&&(0,r.jsxs)("div",{className:"hidden max-w-[220px] items-center rounded-full border border-border bg-surface-2 px-3 py-1 text-xs text-text-muted sm:flex",children:[(0,r.jsx)("span",{className:"truncate",children:i}),(0,r.jsx)("span",{className:"ml-2 rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary",children:"OIDC"})]}),(0,r.jsx)(b,{}),(0,r.jsx)(x.default,{}),(0,r.jsx)(u,{}),(0,r.jsx)(o.default,{onLogout:p})]})]})})}function b(){let e=(0,p.C)(e=>e.visible),t=(0,p.C)(e=>e.query),a=(0,p.C)(e=>e.placeholder),s=(0,p.C)(e=>e.setQuery);return e?(0,r.jsxs)("div",{className:"relative hidden w-[220px] md:block",children:[(0,r.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-muted",children:"search"}),(0,r.jsx)("input",{type:"text",value:t,onChange:e=>s(e.target.value),placeholder:a,className:"h-8 w-full rounded-brand border border-border bg-surface-2 pl-8 pr-7 text-xs text-text-main placeholder:text-text-muted/70 focus:outline-none focus:ring-2 focus:ring-primary/30"}),t&&(0,r.jsx)("button",{type:"button",onClick:()=>s(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:bg-surface-3 hover:text-text-main","aria-label":"Clear search",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}):null}f.propTypes={onMenuClick:l().func,showMenuButton:l().bool}},11059:(e,t,a)=>{a.d(t,{C:()=>s});var r=a(12115);function s(e=2e3){let[t,a]=(0,r.useState)(null),n=(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)}})(),a(r),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{a(null)},e)},[e])}}},11910:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({label:e,type:t="text",placeholder:a,value:i,onChange:l,error:o,hint:d,icon:c,disabled:m=!1,required:u=!1,className:x,inputClassName:p,...h}){return(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",x),children:[e&&(0,r.jsxs)("label",{className:"text-xs font-semibold text-text-main",children:[e,u&&(0,r.jsx)("span",{className:"ml-1 text-danger",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[c&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:c})}),(0,r.jsx)("input",{type:t,placeholder:a,value:i,onChange:l,disabled:m,className:(0,s.cn)("w-full rounded-brand border border-border bg-surface-2 px-3 py-2 text-sm text-text-main placeholder:text-text-muted/70","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",o&&"border-danger ring-1 ring-danger/20",p),...h})]}),o&&(0,r.jsxs)("p",{className:"flex items-center gap-1 text-xs text-danger",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},21931:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),s=a(12115),n=a(47650),i=a(93308),l=a(73006);let o=e=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}})[e]||{name:e,flag:"\uD83C\uDF10"};function d({className:e="",isOpen:t,onClose:a,hideTrigger:c=!1}){let[m,u]=(0,s.useState)("en"),[x,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!1),b=(0,s.useRef)(null),g="boolean"==typeof t,v=g?t:h,j=e=>{g?!e&&a&&a(m):f(e)};(0,s.useEffect)(()=>{u(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${i.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,i.QC)(t)}())},[]),(0,s.useEffect)(()=>{function e(e){b.current&&!b.current.contains(e.target)&&j(!1)}if(v)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]);let y=async e=>{if(e!==m&&!x){p(!0),j(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,l.wn)(),u(e)}catch(e){console.error("Failed to set locale:",e)}finally{p(!1)}}};return(0,r.jsxs)("div",{className:e,children:[!c&&(0,r.jsxs)("button",{onClick:()=>j(!v),disabled:x,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:o(m).name}),(0,r.jsx)("span",{className:"text-lg",children:o(m).flag})]}),v&&(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>j(!1)}),(0,r.jsxs)("div",{ref:b,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,r.jsx)("button",{onClick:()=>j(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,r.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:i.YZ.map(e=>{let t=m===e,a=o(e);return(0,r.jsxs)("button",{onClick:()=>y(e),disabled:x,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${t?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${x?"opacity-70 cursor-wait":""}`,title:a.name,children:[(0,r.jsx)("span",{className:"text-2xl",children:a.flag}),(0,r.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:a.name}),t&&(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},e)})})})]})]}),document.body)]})}},23936:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(35497);function o({isOpen:e,onSuccess:t,onClose:a}){let[n,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[m,u]=(0,s.useState)(null),[x,p]=(0,s.useState)(!1),h=async()=>{if(!n.trim())return void u("Please paste your cookie");c(!0),u(null);try{let e=await fetch("/api/oauth/iflow/cookie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cookie:n.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"Authentication failed");p(!0),setTimeout(()=>{t?.(),f()},1500)}catch(e){u(e.message)}finally{c(!1)}},f=()=>{i(""),u(null),p(!1),a?.()};return(0,r.jsx)(l.aF,{isOpen:e,onClose:f,title:"iFlow Cookie Authentication",children:(0,r.jsx)("div",{className:"space-y-4",children:x?(0,r.jsxs)("div",{className:"text-center py-8",children:[(0,r.jsx)("div",{className:"text-6xl mb-4",children:"✅"}),(0,r.jsx)("p",{className:"text-lg font-medium text-text-primary",children:"Authentication Successful!"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Fresh API key obtained"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["To get a fresh API key, paste your browser cookie from"," ",(0,r.jsx)("a",{href:"https://platform.iflow.cn",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"platform.iflow.cn"})]}),(0,r.jsxs)("div",{className:"bg-surface-secondary p-3 rounded-lg text-xs space-y-2",children:[(0,r.jsx)("p",{className:"font-medium text-text-primary",children:"How to get cookie:"}),(0,r.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-text-muted",children:[(0,r.jsx)("li",{children:"Open platform.iflow.cn in your browser"}),(0,r.jsx)("li",{children:"Login to your account"}),(0,r.jsx)("li",{children:"Open DevTools (F12) → Application/Storage → Cookies"}),(0,r.jsx)("li",{children:"Copy the entire cookie string (must include BXAuth)"}),(0,r.jsx)("li",{children:"Paste it below"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-text-primary",children:"Cookie String"}),(0,r.jsx)("textarea",{value:n,onChange:e=>i(e.target.value),placeholder:"BXAuth=xxx; ...",className:"w-full px-3 py-2 bg-surface-secondary border border-border rounded-lg text-sm text-text-primary placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-primary resize-none",rows:4,disabled:d})]}),m&&(0,r.jsx)("div",{className:"p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-error",children:m})}),(0,r.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,r.jsx)(l.$n,{variant:"secondary",onClick:f,disabled:d,fullWidth:!0,children:"Cancel"}),(0,r.jsx)(l.$n,{onClick:h,loading:d,fullWidth:!0,children:"Authenticate"})]})]})})})}o.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func}},25086:(e,t,a)=>{a.d(t,{CardSkeleton:()=>o,PageLoading:()=>i,Skeleton:()=>l,Spinner:()=>n,default:()=>d});var r=a(95155),s=a(31474);function n({size:e="md",className:t}){return(0,r.jsx)("span",{className:(0,s.cn)("material-symbols-outlined animate-spin text-brand-500",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[e],t),children:"progress_activity"})}function i({message:e="Loading..."}){return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,r.jsx)(n,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function l({className:e,...t}){return(0,r.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-[10px] bg-surface-2",e),...t})}function o(){return(0,r.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)(l,{className:"h-4 w-24"}),(0,r.jsx)(l,{className:"size-10 rounded-[10px]"})]}),(0,r.jsx)(l,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(l,{className:"h-3 w-20"})]})}function d({type:e="spinner",...t}){switch(e){case"page":return(0,r.jsx)(i,{...t});case"skeleton":return(0,r.jsx)(l,{...t});case"card":return(0,r.jsx)(o,{...t});default:return(0,r.jsx)(n,{...t})}}},28058:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(12115),n=a(81127);function i({isOpen:e,onClose:t,onAdd:a,addedNames:l=[]}){let[o,d]=(0,s.useState)([]),[c,m]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),[p,h]=(0,s.useState)("all"),[f,b]=(0,s.useState)(null),[g,v]=(0,s.useState)(null),[j,y]=(0,s.useState)({}),[k,w]=(0,s.useState)({}),[N,C]=(0,s.useState)({});(0,s.useEffect)(()=>{!e||o.length>0||(m(!0),fetch("/api/cli-tools/cowork-mcp-registry").then(e=>e.json()).then(e=>{e.error?b(e.error):d(e.servers||[])}).catch(e=>b(e.message)).finally(()=>m(!1)))},[e]);let S=(0,s.useMemo)(()=>new Set(l),[l]),O=(0,s.useMemo)(()=>{let e=u.trim().toLowerCase();return o.filter(t=>("authless"!==p||!t.oauth)&&("oauth"!==p||!!t.oauth)&&(!e||(t.title||"").toLowerCase().includes(e)||(t.description||"").toLowerCase().includes(e)||(t.name||"").toLowerCase().includes(e)))},[o,u,p]),W=async e=>{if(!j[e.url]){w(t=>({...t,[e.url]:!0}));try{let t=await fetch("/api/cli-tools/cowork-mcp-tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e.url})}),a=await t.json(),r=a.tools||[],s=Array.isArray(e.toolNames)?e.toolNames:[],n=r.length>0?r.map(e=>e.name):s;y(t=>({...t,[e.url]:{tools:r,requiresAuth:!!a.requiresAuth,error:a.error}})),C(t=>({...t,[e.url]:Object.fromEntries(n.map(e=>[e,!0]))}))}catch(t){y(a=>({...a,[e.url]:{tools:[],error:t.message}}))}finally{w(t=>({...t,[e.url]:!1}))}}},_=(e,t)=>{let a=N[e]||{};C(r=>({...r,[e]:Object.fromEntries(Object.keys(a).map(e=>[e,t]))}))};return(0,r.jsx)(n.default,{isOpen:e,onClose:t,title:"Browse MCP Marketplace",size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"Search by name or description...",className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,r.jsxs)("select",{value:p,onChange:e=>h(e.target.value),className:"px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,r.jsx)("option",{value:"all",children:"All"}),(0,r.jsx)("option",{value:"authless",children:"Authless"}),(0,r.jsx)("option",{value:"oauth",children:"OAuth"})]})]}),f&&(0,r.jsx)("div",{className:"px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:f}),c&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs py-4 justify-center",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),(0,r.jsx)("span",{children:"Loading registry..."})]}),!c&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:[0===O.length&&(0,r.jsx)("div",{className:"text-center text-xs text-text-muted py-6",children:"No servers match filter"}),O.map(e=>{let t=S.has(e.slug||e.name),s=g===e.url,n=j[e.url],i=k[e.url],l=N[e.url]||{},o=Object.keys(l),d=Object.values(l).filter(Boolean).length;return(0,r.jsxs)("div",{className:"rounded border border-transparent hover:border-border",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2 px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5",children:[e.iconUrl?(0,r.jsx)("img",{src:e.iconUrl,alt:"",className:"size-7 rounded shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}):(0,r.jsx)("div",{className:"size-7 rounded bg-surface shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,r.jsx)("span",{className:"font-medium text-xs",children:e.title}),e.oauth?(0,r.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-amber-500/10 text-amber-600",children:"OAuth"}):(0,r.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-green-500/10 text-green-600",children:"Authless"}),e.toolCount>0&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[e.toolCount," tools"]})]}),e.description&&(0,r.jsx)("p",{className:"text-[10px] text-text-muted line-clamp-2 mt-0.5",children:e.description})]}),(0,r.jsx)("button",{onClick:()=>t?null:void(g===e.url?v(null):(v(e.url),W(e))),disabled:t,className:`shrink-0 px-2 py-1 rounded text-[10px] font-medium transition-colors ${t?"bg-green-500/10 text-green-600 cursor-default":s?"bg-surface border border-border text-text-muted hover:bg-black/5":"bg-primary/10 border border-primary/40 text-primary hover:bg-primary/20"}`,children:t?"Added":s?"Cancel":"+ Add"})]}),s&&(0,r.jsxs)("div",{className:"px-3 py-2 bg-surface/40 border-t border-border flex flex-col gap-2",children:[i&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[10px] py-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),(0,r.jsx)("span",{children:"Probing server for tools..."})]}),!i&&n?.requiresAuth&&(0,r.jsx)("p",{className:"text-[10px] text-amber-600 bg-amber-500/10 px-2 py-1 rounded",children:"\uD83D\uDD10 OAuth required. Add now and authenticate after Apply; tool list will be discovered after first connect."}),!i&&n?.error&&!n?.requiresAuth&&(0,r.jsxs)("p",{className:"text-[10px] text-red-600 bg-red-500/10 px-2 py-1 rounded",children:["Probe failed: ",n.error]}),!i&&0===o.length&&!n?.requiresAuth&&!n?.error&&(0,r.jsx)("p",{className:"text-[10px] text-text-muted",children:"No tools advertised by server."}),!i&&o.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[d,"/",o.length," tools enabled"]}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("button",{onClick:()=>_(e.url,!0),className:"text-[10px] text-primary hover:underline",children:"All"}),(0,r.jsx)("span",{className:"text-[10px] text-text-muted",children:"\xb7"}),(0,r.jsx)("button",{onClick:()=>_(e.url,!1),className:"text-[10px] text-primary hover:underline",children:"None"})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-1 max-h-40 overflow-y-auto",children:o.map(t=>(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-1 rounded",children:[(0,r.jsx)("input",{type:"checkbox",checked:!!l[t],onChange:()=>{var a;return a=e.url,void C(e=>({...e,[a]:{...e[a],[t]:!e[a]?.[t]}}))},className:"size-3"}),(0,r.jsx)("span",{className:"truncate",children:t})]},t))})]}),(0,r.jsx)("button",{onClick:()=>{let t,r;return r=Object.keys(t=N[e.url]||{}).filter(e=>t[e]),void(a?.({name:e.slug||e.name,title:e.title,description:e.description,url:e.url,transport:e.transport,oauth:e.oauth,toolNames:r}),v(null))},className:"self-end px-2 py-1 rounded text-[10px] font-medium bg-primary text-white hover:bg-primary/90",children:"✓ Confirm Add"})]})]},e.url)})]}),(0,r.jsxs)("div",{className:"text-[10px] text-text-muted text-right",children:[O.length," of ",o.length," servers"]})]})})}},28067:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({options:e=[],value:t,onChange:a,size:i="md",className:l}){let o={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,r.jsx)("div",{className:(0,s.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",l),children:e.map(e=>(0,r.jsxs)("button",{onClick:()=>a(e.value),className:(0,s.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",o[i],t===e.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:e.icon}),e.label]},e.value))})}},28815:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(81127),i=a(92542),l=a(11059);function o({isOpen:e,onClose:t,title:a="Manual Configuration",configs:d=[]}){let{copy:c}=(0,l.C)(),[m,u]=(0,s.useState)(null);return(0,r.jsx)(n.default,{isOpen:e,onClose:t,title:a,size:"xl",children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:d.map((e,t)=>(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.filename}),(0,r.jsxs)(i.default,{variant:"ghost",size:"sm",onClick:()=>{var a;return a=e.content,void(c(a,`manualconfig-${t}`),u(t),setTimeout(()=>u(null),2e3))},children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:m===t?"check":"content_copy"}),m===t?"Copied!":"Copy"]})]}),(0,r.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:e.content})]},t))})})}},29366:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(28777),n=a(97677);function i({caps:e,className:t="",colorOverride:a,size:l=16}){if(!e)return null;let o=Object.keys(s.bs).filter(t=>e[t]);return 0===o.length?null:(0,r.jsx)("span",{className:`inline-flex items-center gap-0.5 ${t}`,children:o.map(e=>(0,r.jsx)(n.default,{text:`${s.bs[e].label} — ${s.bs[e].desc}`,children:(0,r.jsx)("span",{className:`material-symbols-outlined leading-none cursor-help ${a||s.bs[e].color}`,style:{fontSize:`${l}px`},children:s.bs[e].icon})},e))})}},30815:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(35497);function o({isOpen:e,onSuccess:t,onClose:a}){let[n,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)(null),[x,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),y=async()=>{f(!0),u(null),g(!1),j(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(i(t.accessToken),c(t.machineId),g(!0)):t.windowsManual?j(!0):u(t.error||"Could not auto-detect tokens")}catch(e){u("Failed to auto-detect tokens")}finally{f(!1)}};(0,s.useEffect)(()=>{e&&y()},[e]);let k=async()=>{if(!n.trim())return void u("Please enter an access token");if(!d.trim())return void u("Please enter a machine ID");p(!0),u(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:n.trim(),machineId:d.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t?.(),a()}catch(e){u(e.message)}finally{p(!1)}};return(0,r.jsx)(l.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:a,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!h&&(0,r.jsxs)(r.Fragment,{children:[b&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),v&&(0,r.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,r.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Make sure Cursor IDE has been opened at least once, then click ",(0,r.jsx)("strong",{children:"Retry"}),". If the problem persists, paste your tokens manually below."]}),(0,r.jsx)(l.$n,{onClick:y,variant:"outline",fullWidth:!0,children:"Retry"})]}),!b&&!v&&!m&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:n,onChange:e=>i(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:d,onChange:e=>c(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),m&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:m})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:k,fullWidth:!0,disabled:x||!n.trim()||!d.trim(),children:x?"Importing...":"Import Token"}),(0,r.jsx)(l.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func.isRequired}},31852:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(95155),s=a(12115),n=a(98500),i=a.n(n),l=a(73321),o=a(14051),d=a.n(o),c=a(31474),m=a(90620),u=a(67098),x=a(47650);let p=[{id:"paypal",label:"PayPal",description:"paypal.me/XYOURZONE",icon:"account_balance_wallet",color:"#0070BA",url:"https://paypal.me/XYOURZONE",qr:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://paypal.me/XYOURZONE"},{id:"kofi",label:"Ko-fi",description:"ko-fi.com/rsalman",icon:"coffee",color:"#FF5E5B",url:"https://ko-fi.com/rsalman",qr:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://ko-fi.com/rsalman"},{id:"saweria",label:"Saweria (APAC)",description:"saweria.co/rsalman",icon:"savings",color:"#6E45E2",url:"https://saweria.co/rsalman",qr:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://saweria.co/rsalman"}];function h({isOpen:e,onClose:t}){let a=(0,s.useRef)(null);return((0,s.useEffect)(()=>{if(!e)return;let a=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),(0,s.useEffect)(()=>{if(!e)return;let r=e=>{a.current&&!a.current.contains(e.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t]),(0,s.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e]),!e||"u"<typeof document)?null:(0,x.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),(0,r.jsxs)("div",{ref:a,className:"relative w-full max-w-2xl rounded-2xl border border-border bg-surface shadow-2xl flex flex-col max-h-[88vh] animate-in fade-in zoom-in-95 duration-200",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border-subtle p-4",children:[(0,r.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold text-text-main",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-pink-500",children:"volunteer_activism"}),"Support ExtremeRouter"]}),(0,r.jsx)("button",{onClick:t,className:"rounded-lg p-1.5 text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-5",children:[(0,r.jsx)("p",{className:"mx-auto mb-6 max-w-md text-center text-sm text-text-muted",children:"ExtremeRouter is free and open source. If it saves you time or money, consider buying me a coffee — every bit keeps development going. \uD83D\uDC9C"}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:p.map(e=>(0,r.jsx)(f,{channel:e},e.id))})]})]})]}),document.body)}function f({channel:e}){let{label:t,description:a,icon:s,color:n,url:i,qr:l}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center rounded-xl border border-border bg-surface-2 p-4 text-center transition-colors hover:border-primary/40",children:[(0,r.jsx)("div",{className:"mb-3 flex size-12 items-center justify-center rounded-full",style:{backgroundColor:`${n}20`,color:n},children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:s})}),(0,r.jsx)("div",{className:"mb-1 font-semibold text-text-main",children:t}),a&&(0,r.jsx)("div",{className:"mb-3 text-xs text-text-muted",children:a}),l&&(0,r.jsx)("img",{src:l,alt:`${t} QR code`,loading:"lazy",className:"mb-3 aspect-square w-full max-w-[180px] rounded-lg bg-white p-1"}),i&&(0,r.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-sm font-medium text-white transition-opacity hover:opacity-90",style:{backgroundColor:n},children:["Open",(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"})]})]})}h.propTypes={isOpen:d().bool.isRequired,onClose:d().func.isRequired};let b=[{label:"Gateway",items:[{href:"/dashboard/overview",label:"Overview",icon:"dashboard"},{href:"/dashboard/playground",label:"Playground",icon:"science"},{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/token-saver",label:"Token Saver",icon:"savings"}]},{label:"Observe",items:[{href:"/dashboard/usage",label:"Activity",icon:"bar_chart"},{href:"/dashboard/health",label:"Health",icon:"monitor_heart"},{href:"/dashboard/quota",label:"Quota",icon:"data_usage"},{href:"/dashboard/swarm",label:"Swarm",icon:"hub"},{href:"/dashboard/console-log",label:"Console",icon:"terminal"}]},{label:"Tools",items:[{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"},{href:"/dashboard/mitm",label:"MITM Proxy",icon:"security"},{href:"/dashboard/media-providers/image",label:"Media",icon:"perm_media"}]},{label:"Configure",items:[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/alerts",label:"Alerts",icon:"notifications"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}]}];function g({onClose:e}){let t=(0,l.usePathname)(),{isNew:a,markSeen:n}=(0,u.P)("features");(0,s.useEffect)(()=>{t&&n(t)},[t,n]);let[o,d]=(0,s.useState)(!1);return(0,r.jsxs)("aside",{className:"flex h-full w-72 shrink-0 flex-col border-r border-border-subtle bg-sidebar backdrop-blur-xl",children:[(0,r.jsx)("div",{className:"border-b border-border-subtle p-4",children:(0,r.jsxs)(i(),{href:"/dashboard",onClick:e,className:"group flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex size-9 items-center justify-center rounded-brand bg-primary text-white shadow-[var(--shadow-warm)]",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"hub"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"truncate text-sm font-semibold tracking-tight text-text-main",children:"ExtremeRouter"}),(0,r.jsxs)("div",{className:"text-xs text-text-muted",children:["Gateway Console \xb7 v",m.vQ.version]})]})]})}),(0,r.jsx)("div",{className:"p-3",children:(0,r.jsxs)(i(),{href:"/dashboard/providers",onClick:e,className:"flex h-9 items-center gap-2 rounded-brand border border-border bg-surface-2 px-3 text-xs text-text-muted transition-colors hover:border-primary/40 hover:text-text-main",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"search"}),"Search providers, models, keys…"]})}),(0,r.jsx)("nav",{className:"custom-scrollbar flex-1 overflow-y-auto px-3 pb-4",children:b.map(s=>(0,r.jsxs)("div",{className:"mb-5",children:[(0,r.jsx)("div",{className:"mb-2 px-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-text-subtle",children:s.label}),(0,r.jsx)("div",{className:"space-y-1",children:s.items.map(s=>{var n;let l=(n=s.href,!!t&&(t===n||("/dashboard/endpoint"===n?"/dashboard"===t:t===n||t.startsWith(n+"/")))),o=!l&&a(s.href);return(0,r.jsxs)(i(),{href:s.href,onClick:e,className:(0,c.cn)("group flex h-9 items-center gap-3 rounded-brand px-3 text-sm transition-colors",l?"bg-primary/15 text-text-main ring-1 ring-primary/20":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[18px]",l&&"text-primary fill-1"),children:s.icon}),(0,r.jsx)("span",{className:"truncate font-medium",children:s.label}),o&&(0,r.jsx)("span",{className:"ml-auto inline-flex items-center rounded-full bg-primary/12 px-1.5 py-0.5 text-[9px] font-bold text-primary ring-1 ring-primary/20",children:"NEW"}),l&&(0,r.jsx)("span",{className:"ml-auto size-1.5 rounded-full bg-primary"})]},s.href)})})]},s.label))}),(0,r.jsxs)("div",{className:"border-t border-border-subtle p-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>d(!0),className:"mb-2 flex h-9 w-full items-center gap-3 rounded-brand px-3 text-sm text-text-muted transition-colors hover:bg-surface-2 hover:text-text-main",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"volunteer_activism"}),(0,r.jsx)("span",{className:"font-medium",children:"Support"})]}),(0,r.jsxs)("div",{className:"rounded-brand border border-border-subtle bg-surface-2 p-3",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center gap-2 text-xs font-semibold text-text-main",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-success"}),"Local Gateway"]}),(0,r.jsx)("div",{className:"font-mono text-[11px] text-text-muted",children:"localhost:20128/v1"})]})]}),(0,r.jsx)(h,{isOpen:o,onClose:()=>d(!1)})]})}g.propTypes={onClose:d().func}},34325:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({children:e,className:t}){return(0,r.jsx)("div",{className:(0,s.cn)("mb-4 flex flex-col gap-2 rounded-brand border border-border-subtle bg-panel/60 p-2 backdrop-blur-md sm:flex-row sm:items-center sm:justify-between",t),children:e})}n.Group=function({children:e,className:t}){return(0,r.jsx)("div",{className:(0,s.cn)("flex flex-wrap items-center gap-2",t),children:e})},n.Search=function({value:e,onChange:t,placeholder:a="Search…",className:n}){return(0,r.jsxs)("div",{className:(0,s.cn)("relative",n),children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"search"})}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t?.(e.target.value),placeholder:a,className:"h-8 w-full rounded bg-surface-2 pl-8 pr-7 text-xs text-text-main placeholder:text-text-muted/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 sm:w-56"}),e&&(0,r.jsx)("button",{onClick:()=>t?.(""),"aria-label":"Clear search",className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted transition-colors hover:bg-surface-3 hover:text-text-main",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}},35497:(e,t,a)=>{a.d(t,{x0:()=>y.default,Ex:()=>d.default,$n:()=>r.default,nh:()=>S.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,CK:()=>p.default,uo:()=>l.ConfirmModal,G9:()=>b.default,wI:()=>j.default,pp:()=>W.default,vj:()=>v.default,vE:()=>g.default,pd:()=>s.default,Mh:()=>f.default,uR:()=>x.default,Nf:()=>h.default,aF:()=>l.default,rq:()=>u.default,gw:()=>k.default,LF:()=>m.default,zY:()=>O.default,Wx:()=>C.default,Iz:()=>w.default,l6:()=>n.default,lM:()=>c.default,m_:()=>N.default});var r=a(92542),s=a(11910),n=a(98),i=a(84588),l=a(81127),o=a(25086);a(56319);var d=a(56061),c=a(98542);a(38587),a(21110),a(31852),a(8823),a(92173);var m=a(90882),u=a(72908),x=a(28815),p=a(45455),h=a(28058);a(21931),a(67968),a(80752),a(40197),a(61500);var f=a(62899);a(94230);var b=a(30815),g=a(23936),v=a(95088),j=a(73579),y=a(96748),k=a(4823),w=a(28067),N=a(97677),C=a(51825),S=a(29366),O=a(54960);a(34325),a(6587);var W=a(99312);a(7648),a(91450)},38003:(e,t,a)=>{a.d(t,{C:()=>r});let r=(0,a(1934).v)(e=>({query:"",placeholder:"",visible:!1,setQuery:t=>e({query:t}),register:(t="Search...")=>e({visible:!0,placeholder:t,query:""}),unregister:()=>e({visible:!1,placeholder:"",query:""})}))},38202:(e,t,a)=>{a.d(t,{h:()=>r});let r={en:"\uD83C\uDDFA\uD83C\uDDF8",vi:"\uD83C\uDDFB\uD83C\uDDF3","zh-CN":"\uD83C\uDDE8\uD83C\uDDF3","zh-TW":"\uD83C\uDDF9\uD83C\uDDFC",ja:"\uD83C\uDDEF\uD83C\uDDF5","pt-BR":"\uD83C\uDDE7\uD83C\uDDF7","pt-PT":"\uD83C\uDDF5\uD83C\uDDF9",ko:"\uD83C\uDDF0\uD83C\uDDF7",es:"\uD83C\uDDEA\uD83C\uDDF8",de:"\uD83C\uDDE9\uD83C\uDDEA",fr:"\uD83C\uDDEB\uD83C\uDDF7",he:"\uD83C\uDDEE\uD83C\uDDF1",ar:"\uD83C\uDDF8\uD83C\uDDE6",ru:"\uD83C\uDDF7\uD83C\uDDFA",pl:"\uD83C\uDDF5\uD83C\uDDF1",cs:"\uD83C\uDDE8\uD83C\uDDFF",nl:"\uD83C\uDDF3\uD83C\uDDF1",tr:"\uD83C\uDDF9\uD83C\uDDF7",uk:"\uD83C\uDDFA\uD83C\uDDE6",tl:"\uD83C\uDDF5\uD83C\uDDED",id:"\uD83C\uDDEE\uD83C\uDDE9",th:"\uD83C\uDDF9\uD83C\uDDED",hi:"\uD83C\uDDEE\uD83C\uDDF3",bn:"\uD83C\uDDE7\uD83C\uDDE9",ur:"\uD83C\uDDF5\uD83C\uDDF0",ro:"\uD83C\uDDF7\uD83C\uDDF4",sv:"\uD83C\uDDF8\uD83C\uDDEA",it:"\uD83C\uDDEE\uD83C\uDDF9",el:"\uD83C\uDDEC\uD83C\uDDF7",hu:"\uD83C\uDDED\uD83C\uDDFA",fi:"\uD83C\uDDEB\uD83C\uDDEE",da:"\uD83C\uDDE9\uD83C\uDDF0",no:"\uD83C\uDDF3\uD83C\uDDF4"}},38587:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(1620),n=a(31474);function i({className:e,variant:t="default"}){let{isDark:a,toggleTheme:l}=(0,s.D)(),o={default:(0,n.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,n.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60 hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};return(0,r.jsx)("button",{onClick:l,className:(0,n.cn)(o[t],e),"aria-label":`Switch to ${a?"light":"dark"} mode`,title:`Switch to ${a?"light":"dark"} mode`,children:(0,r.jsx)("span",{className:(0,n.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:a?"light_mode":"dark_mode"})})}},40197:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(12115),n=a(47650),i=a(14051),l=a.n(i),o=a(9233),d=a(90620);function c({isOpen:e,onClose:t}){let[a,i]=(0,s.useState)(""),[l,m]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),p=(0,s.useRef)(null);return((0,s.useEffect)(()=>{e&&!a&&(m(!0),x(""),fetch(d.Nu.changelogUrl).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(e=>i(o.xI.parse(e))).catch(e=>x(e.message||"Failed to load")).finally(()=>m(!1)))},[e,a]),(0,s.useEffect)(()=>{let a=e=>{p.current&&!p.current.contains(e.target)&&t()};if(e)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,t]),!e||"u"<typeof document)?null:(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t}),(0,r.jsxs)("div",{ref:p,className:"relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[l&&(0,r.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),u&&(0,r.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",u]}),!l&&!u&&a&&(0,r.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:a}})]})]})]}),document.body)}o.xI.setOptions({gfm:!0,breaks:!0}),c.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired}},45455:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),s=a(12115),n=a(81127),i=a(11910),l=a(92542),o=a(72908);let d=/^[a-zA-Z0-9_.\-]+$/;function c({index:e,model:t,isFirst:a,isLast:n,onEdit:i,onMoveUp:l,onMoveDown:o,onRemove:d}){let[m,u]=(0,s.useState)(!1),[x,p]=(0,s.useState)(t),h=()=>{let e=x.trim();e&&e!==t?i(e):p(t),u(!1)};return(0,r.jsxs)("div",{className:"group flex min-w-0 items-center gap-1.5 rounded-md bg-black/[0.02] px-2 py-1 transition-colors hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04]",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:e+1}),m?(0,r.jsx)("input",{autoFocus:!0,value:x,onChange:e=>p(e.target.value),onBlur:h,onKeyDown:e=>{"Enter"===e.key&&h(),"Escape"===e.key&&(p(t),u(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,r.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>u(!0),title:"Click to edit",children:t}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,r.jsx)("button",{onClick:l,disabled:a,className:`p-0.5 rounded ${a?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,r.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,r.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function m({isOpen:e,combo:t,onClose:a,onSave:u,activeProviders:x,kindFilter:p=null,forcePrefix:h="",title:f}){let b=t?.name?h&&t.name.startsWith(h)?t.name.slice(h.length):t.name:"",[g,v]=(0,s.useState)(b),[j,y]=(0,s.useState)(t?.models||[]),[k,w]=(0,s.useState)(!1),[N,C]=(0,s.useState)(!1),[S,O]=(0,s.useState)(""),[W,_]=(0,s.useState)({});(0,s.useEffect)(()=>{e&&fetch("/api/models/alias").then(e=>e.ok?e.json():null).then(e=>e&&_(e.aliases||{})).catch(()=>{})},[e]);let P=e=>{if(!e.trim())return O("Name is required"),!1;let t=h+e;return d.test(t)?(O(""),!0):(O("Only letters, numbers, -, _ and . allowed"),!1)},F=e=>{let t=e.target.value;h&&t.startsWith(h)&&(t=t.slice(h.length)),v(t),t?P(t):O("")},I=async()=>{P(g)&&(C(!0),await u({name:h+g.trim(),models:j}),C(!1))},E=!!t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{isOpen:e,onClose:a,title:f||(E?"Edit Combo":"Create Combo"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{children:[h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("label",{className:"text-sm font-medium mb-1 block",children:"Combo Name"}),(0,r.jsxs)("div",{className:"flex items-stretch",children:[(0,r.jsx)("span",{className:"inline-flex items-center px-2 rounded-l border border-r-0 border-black/10 dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.04] text-text-muted font-mono text-sm",children:h}),(0,r.jsx)("input",{value:g,onChange:F,placeholder:"my-combo",className:"flex-1 min-w-0 rounded-r border border-black/10 dark:border-white/10 bg-white dark:bg-black/20 px-2 py-1.5 font-mono text-sm outline-none focus:border-primary"})]}),S&&(0,r.jsx)("p",{className:"text-[11px] text-red-500 mt-0.5",children:S})]}):(0,r.jsx)(i.default,{label:"Combo Name",value:g,onChange:F,placeholder:"my-combo",error:S}),(0,r.jsxs)("p",{className:"text-[10px] text-text-muted mt-0.5",children:[h?`Auto-prefixed with "${h}". `:"","Only letters, numbers, -, _ and . allowed"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===j.length?(0,r.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,r.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:j.map((e,t)=>(0,r.jsx)(c,{index:t,model:e,isFirst:0===t,isLast:t===j.length-1,onEdit:e=>{let a=[...j];a[t]=e,y(a)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...j];[t[e-1],t[e]]=[t[e],t[e-1]],y(t)})(t),onMoveDown:()=>(e=>{if(e===j.length-1)return;let t=[...j];[t[e],t[e+1]]=[t[e+1],t[e]],y(t)})(t),onRemove:()=>y(j.filter((e,a)=>a!==t))},t))}),(0,r.jsxs)("button",{onClick:()=>w(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,r.jsx)(l.default,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,r.jsx)(l.default,{onClick:I,fullWidth:!0,size:"sm",disabled:!g.trim()||!!S||N,children:N?"Saving...":E?"Save":"Create"})]})]})}),(0,r.jsx)(o.default,{isOpen:k,onClose:()=>w(!1),onSelect:e=>{j.includes(e.value)||y([...j,e.value])},onDeselect:e=>{y(j.filter(t=>t!==e.value))},activeProviders:x,modelAliases:W,title:"Add Model to Combo",kindFilter:p,addedModelValues:j,closeOnSelect:!1})]})}},51825:(e,t,a)=>{a.d(t,{default:()=>i});var r=a(95155),s=a(84588);let n={mode:{label:"Mode",format:e=>e},defaultModel:{label:"Model",format:e=>e,mono:!0},baseUrl:{label:"Endpoint",format:e=>e,isLink:!0,mono:!0},costPerQuery:{label:"Cost / call",format:e=>0===e?"Free":`$${e.toFixed(4)}`},pricingUrl:{label:"Pricing",format:()=>"View pricing",isLink:!0},freeTier:{label:"Free tier",format:e=>e},freeMonthlyQuota:{label:"Free quota",format:e=>0===e?"—":e>=999999?"Unlimited":`${e.toLocaleString()} / mo`},searchTypes:{label:"Types",format:e=>e.join(", ")},formats:{label:"Formats",format:e=>e.join(", ")},maxMaxResults:{label:"Max results",format:e=>e},maxCharacters:{label:"Max chars",format:e=>e.toLocaleString()}};function i({config:e,provider:t,title:a="Provider Info"}){if(!e)return null;let l=Object.entries(n).filter(([t])=>void 0!==e[t]&&null!==e[t]&&""!==e[t]).map(([t,a])=>({key:t,label:a.label,value:a.format(e[t]),isLink:a.isLink,mono:a.mono,raw:e[t]})),o=t?.notice?.apiKeyUrl||t?.website,d=t?.notice?.text;return(0,r.jsxs)(s.default,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:a}),o&&(0,r.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2",children:[l.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0",children:e.label}),e.isLink?(0,r.jsx)("a",{href:e.raw,target:"_blank",rel:"noopener noreferrer",className:`text-sm text-primary hover:underline truncate ${e.mono?"font-mono":""}`,children:e.value}):(0,r.jsx)("span",{className:`text-sm text-text-main truncate ${e.mono?"font-mono":""}`,children:e.value})]},e.key)),d&&(0,r.jsxs)("div",{className:"flex items-start gap-3 min-w-0 sm:col-span-2",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted w-28 shrink-0 mt-0.5",children:"Notice"}),(0,r.jsx)("span",{className:"text-sm text-text-main leading-relaxed",children:d})]})]})]})}},53593:(e,t,a)=>{a.d(t,{y:()=>d});var r=a(12115),s=a(62630);let n={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,thinkingMaxEffort:!1,contextWindow:2e5,maxOutput:64e3},i={"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},l={nvidia:{"minimaxai/minimax-m2.7":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072},"minimaxai/minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:131072},"z-ai/glm-5.2":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:128e3},"deepseek-ai/deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},"deepseek-ai/deepseek-v4-flash":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536}},"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}}},o=[{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*fable*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude-*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:1024,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5.6-sol*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3,thinkingMaxEffort:!0}},{pattern:"*gpt-5.6-terra*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3}},{pattern:"*gpt-5.6-luna*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3}},{pattern:"*kimi-k3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:65536,thinkingMaxEffort:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o1_*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3-*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3_*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4-*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4_*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok-imagine-video*",caps:{videoOutput:!0}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*omni*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:65536}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwen*max*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.5*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.6*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.7*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function d(){let[e,t]=(0,r.useState)({}),[a,d]=(0,r.useState)({});return(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{let a=await fetch("/api/models");if(!a.ok)return;let r=await a.json(),s={},n={};for(let e of r.models||[])e.caps&&(e.fullModel&&(s[e.fullModel]=e.caps),e.model&&(n[e.model]=e.caps));e&&(t(s),d(n))}catch{}})(),()=>{e=!1}},[]),{getCaps:t=>{if(!t)return null;let r="string"==typeof t?t:String(t);if(e[r])return e[r];let d=r.includes("/")?r.slice(r.indexOf("/")+1):r;if(a[d])return a[d];let c=function(e,t){if(!t)return{...n};if(e&&l[e]?.[t])return{...n,...l[e][t]};let a=t.includes("/")?t.split("/").pop():t;if(i[a])return{...n,...i[a]};if(i[t])return{...n,...i[t]};for(let{pattern:e,caps:r}of o)if((0,s.gH)(e,a)||(0,s.gH)(e,t))return{...n,...r};return{...n}}(r.includes("/")?r.slice(0,r.indexOf("/")):null,d);return{vision:c.vision,search:c.search,reasoning:c.reasoning}}}}},54960:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({title:e,description:t,icon:a,iconNode:i,actions:l,breadcrumbs:o,className:d}){return(0,r.jsxs)("div",{className:(0,s.cn)("mb-6",d),children:[o?.length>0&&(0,r.jsx)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs text-text-muted",children:o.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-60",children:"chevron_right"}),e.href?(0,r.jsx)("a",{href:e.href,className:"transition-colors hover:text-primary",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-text-main",children:e.label})]},t))}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i?(0,r.jsx)("div",{className:"mt-0.5 shrink-0",children:i}):a&&(0,r.jsx)("div",{className:"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight text-text-main",children:e}),t&&(0,r.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:t})]})]}),l&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})]})}},56061:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(31474);let n={default:"bg-surface-2 text-text-muted ring-1 ring-border-subtle",primary:"bg-primary/12 text-primary ring-1 ring-primary/20",success:"bg-success/12 text-success ring-1 ring-success/20",warning:"bg-warning/12 text-warning ring-1 ring-warning/20",error:"bg-danger/12 text-danger ring-1 ring-danger/20",info:"bg-info/12 text-info ring-1 ring-info/20",cyan:"bg-cyan/12 text-cyan ring-1 ring-cyan/20"},i={default:"bg-text-subtle",primary:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",cyan:"bg-cyan"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function o({children:e,variant:t="default",size:a="md",dot:d=!1,icon:c,className:m}){return(0,r.jsxs)("span",{className:(0,s.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold leading-none",n[t],l[a],m),children:[d&&(0,r.jsx)("span",{className:(0,s.cn)("size-1.5 rounded-full",i[t])}),c&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:c}),e]})}},56319:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155),s=a(31474);function n({src:e,alt:t="Avatar",name:a,size:i="md",className:l}){let o={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return e?(0,r.jsx)("div",{className:(0,s.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",o[i],l),style:{backgroundImage:`url(${e})`},role:"img","aria-label":t}):(0,r.jsx)("div",{className:(0,s.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",o[i],(e=>{if(!e)return"bg-primary";let t=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],a=e.charCodeAt(0)%t.length;return t[a]})(a),l),role:"img","aria-label":t,children:(e=>{if(!e)return"?";let t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()})(a)})}},57250:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n);function l({src:e,alt:t,size:a=32,className:n="",fallbackText:i="?",fallbackColor:o}){let[d,c]=(0,s.useState)(!1);return!e||d?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${n}`.trim(),style:{width:a,height:a,color:o,fontSize:Math.max(10,Math.floor(.38*a))},children:i}):(0,r.jsx)("img",{src:e,alt:t,width:a,height:a,className:n,onError:()=>c(!0)})}l.propTypes={src:i().string,alt:i().string,size:i().number,className:i().string,fallbackText:i().string,fallbackColor:i().string}},61500:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(35497);function o({isOpen:e,onMethodSelect:t,onClose:a}){let[n,i]=(0,s.useState)(null),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)("us-east-1"),[x,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(""),[b,g]=(0,s.useState)(""),[v,j]=(0,s.useState)("us-east-1"),[y,k]=(0,s.useState)(null),[w,N]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[O,W]=(0,s.useState)(!1),[_,P]=(0,s.useState)(null);(0,s.useEffect)(()=>{"import"===n&&e&&(async()=>{S(!0),k(null),W(!1),P(null);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(p(t.refreshToken),W(!0),t.clientId&&t.clientSecret&&P({clientId:t.clientId,clientSecret:t.clientSecret,region:t.region,authMethod:t.authMethod,profileArn:t.profileArn})):k(t.error||"Could not auto-detect token")}catch(e){k("Failed to auto-detect token")}finally{S(!1)}})()},[n,e]);let F=e=>{i(e),k(null)},I=()=>{i(null),k(null)},E=async()=>{if(!x.trim())return void k("Please enter a refresh token");N(!0),k(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:x.trim(),..._||{}})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("import")}catch(e){k(e.message)}finally{N(!1)}},A=async()=>{if(!h.trim())return void k("Please paste CLIProxyAPI auth JSON");N(!0),k(null);try{let e=await fetch("/api/oauth/kiro/import-cli-proxy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({json:h.trim()})}),a=await e.json();if(!e.ok)throw Error(a.error||"CLIProxyAPI import failed");t("import-cli-proxy")}catch(e){k(e.message)}finally{N(!1)}},z=async()=>{if(!b.trim())return void k("Please enter an API key");N(!0),k(null);try{let e=await fetch("/api/oauth/kiro/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:b.trim(),region:v.trim()||"us-east-1"})}),a=await e.json();if(!e.ok)throw Error(a.error||"Import failed");t("api-key")}catch(e){k(e.message)}finally{N(!1)}},R=e=>{t("social",{provider:e})};return(0,r.jsx)(l.aF,{isOpen:e,title:"Connect Kiro",onClose:a,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!n&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,r.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("api-key"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"key"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"API Key"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Use a long-lived Kiro/CodeWhisperer API key (headless auth)."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})}),(0,r.jsx)("button",{onClick:()=>F("import-cli-proxy"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"data_object"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import CLIProxyAPI JSON"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste external_idp auth JSON from CLIProxyAPI/Kiro Microsoft login."})]})]})})]}),"idc"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:d,onChange:e=>c(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(l.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),y&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:y}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>{d.trim()?t("idc",{startUrl:d.trim(),region:m}):k("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"api-key"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste a long-lived Kiro/CodeWhisperer API key. It is validated against AWS and stored directly as a bearer credential (no refresh)."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["API Key ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:b,onChange:e=>g(e.target.value),placeholder:"Paste your Kiro API key...",className:"font-mono text-sm"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(l.pd,{value:v,onChange:e=>j(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for the key (default: us-east-1)"})]}),y&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:y})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:z,fullWidth:!0,disabled:w||!b.trim(),children:w?"Validating...":"Add API Key"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>R("google"),fullWidth:!0,children:"Continue with Google"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>R("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[C&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!C&&(0,r.jsxs)(r.Fragment,{children:[O&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!O&&!y&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(l.pd,{value:x,onChange:e=>p(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),y&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:y})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:E,fullWidth:!0,disabled:w||!x.trim(),children:w?"Importing...":"Import Token"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]}),"import-cli-proxy"===n&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Paste the Kiro CLIProxyAPI auth JSON containing auth_method=external_idp. Only Microsoft login token endpoints are accepted."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["CLIProxyAPI Auth JSON ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:h,onChange:e=>f(e.target.value),placeholder:'{"auth_method":"external_idp","access_token":"...","refresh_token":"...","client_id":"...","token_endpoint":"https://login.microsoftonline.com/.../oauth2/v2.0/token","profile_arn":"...","scopes":"..."}',className:"min-h-40 w-full rounded-md border border-border bg-background p-3 font-mono text-sm outline-none focus:border-primary"})]}),y&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:y})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:A,fullWidth:!0,disabled:w||!h.trim(),children:w?"Importing...":"Import CLIProxyAPI JSON"}),(0,r.jsx)(l.$n,{onClick:I,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onMethodSelect:i().func.isRequired,onClose:i().func.isRequired}},62899:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(90882),o=a(61500),d=a(94230);function c({isOpen:e,providerInfo:t,onSuccess:a,onClose:n}){let[i,m]=(0,s.useState)(null),[u,x]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),f=(0,s.useCallback)((e,t)=>{"builder-id"===e?m("builder-id"):"idc"===e?(m("idc"),h(t)):"social"===e?(m("social"),x(t.provider)):("import"===e||"api-key"===e)&&a?.()},[a]),b=()=>{m(null),x(null),h(null)};return i?"builder-id"===i||"idc"===i?(0,r.jsx)(l.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{m(null),h(null),a?.(),n?.()},onClose:b,idcConfig:p}):"social"===i&&u?(0,r.jsx)(d.default,{isOpen:e,provider:u,onSuccess:()=>{m(null),x(null),a?.(),n?.()},onClose:b}):null:(0,r.jsx)(o.default,{isOpen:e,onMethodSelect:f,onClose:n})}c.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},65921:(e,t,a)=>{a.d(t,{i:()=>n});var r=a(1934);let s=0,n=(0,r.v)((e,t)=>({notifications:[],addNotification:a=>{let r=++s,n={id:r,type:a.type||"info",message:a.message,title:a.title||null,duration:a.duration??5e3,dismissible:a.dismissible??!0,createdAt:Date.now()};return e(e=>({notifications:[...e.notifications,n]})),n.duration>0&&setTimeout(()=>t().removeNotification(r),n.duration),r},removeNotification:t=>{e(e=>({notifications:e.notifications.filter(e=>e.id!==t)}))},clearAll:()=>e({notifications:[]}),success:(e,a)=>t().addNotification({type:"success",message:e,title:a}),error:(e,a)=>t().addNotification({type:"error",message:e,title:a,duration:8e3}),warning:(e,a)=>t().addNotification({type:"warning",message:e,title:a}),info:(e,a)=>t().addNotification({type:"info",message:e,title:a})}))},67098:(e,t,a)=>{a.d(t,{P:()=>n});var r=a(12115);function s(e,t){try{window.localStorage.setItem(`seen:${e}`,JSON.stringify(t))}catch{}}function n(e){let[t,a]=(0,r.useState)({});(0,r.useEffect)(()=>{a(function(e){try{let t=window.localStorage.getItem(`seen:${e}`);return t?JSON.parse(t):{}}catch{return{}}}(e))},[e]);let n=(0,r.useCallback)(e=>!t[e],[t]);return{isNew:n,markSeen:(0,r.useCallback)(t=>{a(a=>{if(a[t])return a;let r={...a,[t]:new Date().toISOString()};return s(e,r),r})},[e]),markAllSeen:(0,r.useCallback)(t=>{a(a=>{let r=!1,n={...a};for(let e of t)n[e]||(n[e]=new Date().toISOString(),r=!0);return r&&s(e,n),r?n:a})},[e])}}},67968:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),s=a(12115),n=a(47650);let i=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],l=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function o({isOpen:e,onClose:t}){return((0,s.useEffect)(()=>{if(!e)return;document.body.style.overflow="hidden";let a=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",a),()=>{document.body.style.overflow="",document.removeEventListener("keydown",a)}},[e,t]),e)?(0,n.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:t}),(0,r.jsxs)("div",{className:"relative w-full max-w-sm rounded-[14px] overflow-hidden shadow-[var(--shadow-elev)] fade-in flex flex-col bg-surface border border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,r.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,r.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,r.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,r.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,r.jsx)("div",{className:"flex gap-2 w-full",children:i.map(({icon:e,label:t,desc:a})=>(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1.5 py-4 px-1 rounded-[10px] border border-border-subtle bg-surface-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:e}),(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main",children:t}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:a})]},t))}),(0,r.jsx)("div",{className:"flex flex-col gap-3 w-full",children:l.map(({icon:e,text:t})=>(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:e}),(0,r.jsx)("span",{className:"text-xs text-text-muted",children:t})]},e))}),(0,r.jsxs)("button",{onClick:()=>window.open("https://9remote.cc","_blank"),className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-semibold text-white rounded-[10px] bg-primary hover:bg-primary-hover shadow-[var(--shadow-warm)] active:scale-[0.98] transition-all",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}function d(){let[e,t]=(0,s.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>t(!0),className:"relative flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg transition-all text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5",title:"9Remote",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"computer"}),(0,r.jsx)("span",{className:"text-xs font-medium",children:"Remote"})]}),(0,r.jsx)(o,{isOpen:e,onClose:()=>t(!1)})]})}},72908:(e,t,a)=>{a.d(t,{default:()=>f});var r=a(95155),s=a(12115),n=a(14051),i=a.n(n),l=a(81127),o=a(57250),d=a(29366),c=a(53593),m=a(28777),u=a(88105),x=a(8247);let p=[...Object.keys(u.zN),...Object.keys(u.IS),...Object.keys(u.nJ),...Object.keys(u.fg)],h=Object.keys(u.IS).filter(e=>u.IS[e].noAuth);function f({isOpen:e,onClose:t,onSelect:a,onDeselect:n,selectedModel:i,activeProviders:b=[],title:g="Select Model",modelAliases:v={},kindFilter:j=null,addedModelValues:y=[],closeOnSelect:k=!0}){let w=(0,s.useMemo)(()=>j?b.filter(e=>{let t=u.Q2[e.provider];return(t?.serviceKinds||["llm"]).includes(j)}):b,[b,j]),{getCaps:N}=(0,c.y)(),[C,S]=(0,s.useState)(""),[O,W]=(0,s.useState)([]),[_,P]=(0,s.useState)([]),[F,I]=(0,s.useState)([]),[E,A]=(0,s.useState)({}),z=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();W(t.combos||[])}catch(e){console.error("Error fetching combos:",e),W([])}};(0,s.useEffect)(()=>{e&&z()},[e]);let R=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();P(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),P([])}};(0,s.useEffect)(()=>{e&&R()},[e]);let T=async()=>{try{let e=await fetch("/api/models/custom");if(!e.ok)throw Error(`Failed to fetch custom models: ${e.status}`);let t=await e.json();I(t.models||[])}catch(e){console.error("Error fetching custom models:",e),I([])}};(0,s.useEffect)(()=>{e&&T()},[e]);let L=async()=>{try{let e=await fetch("/api/models/disabled");if(!e.ok)throw Error(`Failed to fetch disabled models: ${e.status}`);let t=await e.json();A(t.disabled||{})}catch(e){console.error("Error fetching disabled models:",e),A({})}};(0,s.useEffect)(()=>{e&&L()},[e]);let $=(0,s.useMemo)(()=>({...u.zN,...u.IS,...u.nJ,...u.fg}),[]),q=(0,s.useMemo)(()=>{let e={},t=new Set(["webSearch","webFetch"]),a=new Set(["image","tts","stt","embedding","imageToText"]),r=new Set(["tts","image","webFetch"]);return[...new Set([...w.map(e=>e.provider),...j?h.filter(e=>(u.Q2[e]?.serviceKinds||["llm"]).includes(j)):h])].sort((e,t)=>{let a=p.indexOf(e),r=p.indexOf(t);return(-1===a?999:a)-(-1===r?999:r)}).forEach(s=>{let n=(0,u.wG)(s),i=$[s]||{name:s,color:"#666"},l=(0,u.mq)(s)||(0,u.gb)(s);if(j&&t.has(j)){e[s]={name:i.name,alias:n,color:i.color,models:[{id:s,name:i.name,value:s}]};return}if(i.passthroughModels){let t=Object.entries(v).filter(([,e])=>e.startsWith(`${n}/`)).map(([e,t])=>({id:t.replace(`${n}/`,""),name:e,value:t})),l=F.filter(e=>e.providerAlias===n).map(e=>({id:e.id,name:e.name||e.id,value:`${n}/${e.id}`,kind:(0,m.CP)(e),isCustom:!0})),o=t;if(j&&a.has(j)){let e=l.filter(e=>(0,m.CP)(e)===j);0===(o=[...e,...(0,m.KC)(s).filter(e=>(0,m.CP)(e)===j).map(e=>({id:e.id,name:e.name,value:`${n}/${e.id}`,kind:(0,m.CP)(e)})).filter(t=>!e.some(e=>e.value===t.value))]).length&&r.has(j)&&(i.serviceKinds||["llm"]).includes(j)&&(o=[{id:s,name:i.name,value:n}])}else{let e=l.filter(e=>!(0,m.CP)(e)||"llm"===(0,m.CP)(e)),a=new Set([...t,...e].map(e=>e.value)),r=(0,m.KC)(s).filter(e=>!(0,m.CP)(e)||"llm"===(0,m.CP)(e)).map(e=>({id:e.id,name:e.name,value:`${n}/${e.id}`,kind:(0,m.CP)(e)})).filter(e=>!a.has(e.value));o=[...e,...t.filter(t=>!e.some(e=>e.value===t.value)),...r]}if(o.length>0){let t=_.find(e=>e.id===s),a=t?.name||i.name;e[s]={name:a,alias:n,color:i.color,models:o}}}else if(l){if(j&&a.has(j))return;let t=b.find(e=>e.provider===s),r=_.find(e=>e.id===s),n=r?.name||t?.name||i.name,l=t?.providerSpecificData?.prefix||r?.prefix||s,o=Object.entries(v).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:`${l}/${t.replace(`${s}/`,"")}`})),d=F.filter(e=>e.providerAlias===s).map(e=>({id:e.id,name:e.name||e.id,value:`${l}/${e.id}`,isCustom:!0})),c=new Set(o.map(e=>e.value)),m=[...o,...d.filter(e=>!c.has(e.value))],u=m.length>0?m:[{id:`__placeholder__${s}`,name:`${l}/model-id`,value:`${l}/model-id`,isPlaceholder:!0}];e[s]={name:n,alias:l,color:i.color,models:u,isCustom:!0,hasModels:m.length>0}}else{var o;let t=(0,m.KC)(s),l=new Set(t.map(e=>e.id)),d=t.length>0,c=Object.entries(v).filter(([e,t])=>t.startsWith(`${n}/`)&&(!d||e===t.replace(`${n}/`,""))&&!l.has(t.replace(`${n}/`,""))).map(([e,t])=>({id:t.replace(`${n}/`,""),name:e,value:t,isCustom:!0})),u=new Set(c.map(e=>e.id)),x=F.filter(e=>e.providerAlias===n&&!l.has(e.id)&&!u.has(e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${n}/${e.id}`,isCustom:!0})),p=[...t.map(e=>({id:e.id,name:e.name,value:`${n}/${e.id}`,kind:(0,m.CP)(e)})),...c,...x],h=new Set,f=(o=p.filter(e=>!h.has(e.value)&&(h.add(e.value),!0)),j?a.has(j)?o.filter(e=>e.isPlaceholder||(0,m.CP)(e)===j):o:o.filter(e=>e.isPlaceholder||e.isCustom||!(0,m.CP)(e)||"llm"===(0,m.CP)(e)));0===f.length&&j&&r.has(j)&&(i.serviceKinds||["llm"]).includes(j)&&(f=[{id:s,name:i.name,value:n}]),f.length>0&&(e[s]={name:i.name,alias:n,color:i.color,models:f})}}),Object.entries(e).forEach(([t,a])=>{let r=new Set([...E[(0,u.wG)(t)]||[],...E[t]||[]]);0!==r.size&&(a.models=a.models.filter(e=>!r.has(e.id)),0===a.models.length&&delete e[t])}),e},[w,v,$,_,F,E,j,b]),D=(0,s.useMemo)(()=>{if(j)return[];if(!C.trim())return O;let e=C.toLowerCase();return O.filter(t=>t.name.toLowerCase().includes(e))},[O,C,j]),M=(0,s.useMemo)(()=>{let e=C.trim().toLowerCase(),t={};return Object.entries(q).forEach(([a,r])=>{var s;let n=r.models;if(e){let t=r.name.toLowerCase().includes(e);if(0===(n=n.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e))).length&&!t)return}t[a]={...r,models:[...(s=n).filter(e=>y.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name)),...s.filter(e=>!y.includes(e.value)).sort((e,t)=>e.name.localeCompare(t.name))]}}),t},[q,C,y]),U=e=>{let r=e?.value||e?.name||e;y.includes(r)&&n?n(e):a(e),k&&(t(),S(""))};return(0,r.jsxs)(l.default,{isOpen:e,onClose:()=>{t(),S("")},title:g,size:"md",className:"p-4!",footer:null,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,r.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search...",value:C,onChange:e=>S(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,r.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[D.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",D.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:D.map(e=>{let t=i===e.name;return(0,r.jsxs)("button",{onClick:()=>U({id:e.name,name:e.name,value:e.name}),className:`
2
2
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer flex items-center gap-1
3
3
  ${t?"bg-primary text-white border-primary":y.includes(e.name)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
4
4
  `,children:[y.includes(e.name)&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name]},e.id)})})]}),Object.entries(M).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)(o.A,{src:(0,x.k)(e,t.apiType),alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=i===e.value,a=e.isPlaceholder;return(0,r.jsx)("button",{onClick:()=>U(e),title:a?"Select to pre-fill, then edit model ID in the input":void 0,className:`