@techysy/10router 1.0.5 → 1.0.6

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 (932) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -9
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +1 -1
  5. package/app/.next-cli-build/routes-manifest.json +6 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page.js +1 -1
  76. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  88. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  89. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  90. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +2 -2
  104. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +2 -2
  106. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +2 -2
  108. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +2 -2
  110. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  120. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  130. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  136. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  148. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  150. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js +1 -0
  208. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js.nft.json +1 -0
  209. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route_client-reference-manifest.js +1 -0
  210. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/providers/[id]/json-models/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/providers/[id]/json-models/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  271. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  273. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  277. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  279. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  281. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  283. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  285. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  289. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  291. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  293. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  311. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  333. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  353. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  407. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  409. package/app/.next-cli-build/server/app/callback.html +1 -1
  410. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  411. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  412. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
  414. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  416. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
  417. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  418. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  421. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
  422. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  423. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  426. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
  427. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  428. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  431. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
  432. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  433. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  436. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
  437. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  438. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  441. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  442. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  443. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  445. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  446. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
  447. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  448. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  451. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
  452. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  453. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  456. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
  457. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  458. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  461. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  462. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  463. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  466. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  467. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  468. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  471. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
  472. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  473. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  476. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  479. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  480. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
  482. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  483. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  484. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
  485. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  486. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  489. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  490. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  491. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  494. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
  495. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  496. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  499. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  500. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  501. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  503. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  504. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
  505. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  506. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  507. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  508. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  509. package/app/.next-cli-build/server/app/index.html +1 -1
  510. package/app/.next-cli-build/server/app/index.rsc +4 -4
  511. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  512. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  513. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  515. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  516. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  517. package/app/.next-cli-build/server/app/landing.html +1 -1
  518. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  519. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  520. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  521. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
  522. package/app/.next-cli-build/server/app/login/page.js +1 -1
  523. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  524. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  525. package/app/.next-cli-build/server/app/login.html +1 -1
  526. package/app/.next-cli-build/server/app/login.rsc +5 -5
  527. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  528. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  529. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  530. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  531. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  532. package/app/.next-cli-build/server/app/page.js +1 -1
  533. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  534. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  535. package/app/.next-cli-build/server/app-paths-manifest.json +10 -9
  536. package/app/.next-cli-build/server/chunks/1377.js +1 -1
  537. package/app/.next-cli-build/server/chunks/1636.js +1 -0
  538. package/app/.next-cli-build/server/chunks/1937.js +1 -0
  539. package/app/.next-cli-build/server/chunks/2179.js +1 -0
  540. package/app/.next-cli-build/server/chunks/2732.js +1 -0
  541. package/app/.next-cli-build/server/chunks/295.js +1 -0
  542. package/app/.next-cli-build/server/chunks/3212.js +1 -1
  543. package/app/.next-cli-build/server/chunks/3350.js +1 -1
  544. package/app/.next-cli-build/server/chunks/3962.js +1 -0
  545. package/app/.next-cli-build/server/chunks/4037.js +1 -1
  546. package/app/.next-cli-build/server/chunks/412.js +1 -1
  547. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  548. package/app/.next-cli-build/server/chunks/4665.js +2 -2
  549. package/app/.next-cli-build/server/chunks/5081.js +3 -3
  550. package/app/.next-cli-build/server/chunks/5217.js +1 -1
  551. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  552. package/app/.next-cli-build/server/chunks/5781.js +2 -2
  553. package/app/.next-cli-build/server/chunks/6212.js +1 -0
  554. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  555. package/app/.next-cli-build/server/chunks/6326.js +1 -0
  556. package/app/.next-cli-build/server/chunks/6457.js +2 -2
  557. package/app/.next-cli-build/server/chunks/653.js +1 -0
  558. package/app/.next-cli-build/server/chunks/6877.js +1 -1
  559. package/app/.next-cli-build/server/chunks/7211.js +1 -1
  560. package/app/.next-cli-build/server/chunks/7239.js +63 -0
  561. package/app/.next-cli-build/server/chunks/7598.js +1 -1
  562. package/app/.next-cli-build/server/chunks/7774.js +3 -3
  563. package/app/.next-cli-build/server/chunks/8162.js +6 -0
  564. package/app/.next-cli-build/server/chunks/8444.js +1 -1
  565. package/app/.next-cli-build/server/chunks/869.js +1 -1
  566. package/app/.next-cli-build/server/chunks/8838.js +1 -0
  567. package/app/.next-cli-build/server/chunks/8895.js +5 -5
  568. package/app/.next-cli-build/server/chunks/{5448.js → 9140.js} +4 -4
  569. package/app/.next-cli-build/server/chunks/9463.js +1 -1
  570. package/app/.next-cli-build/server/chunks/9609.js +1 -0
  571. package/app/.next-cli-build/server/chunks/9703.js +2 -2
  572. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  573. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  574. package/app/.next-cli-build/server/middleware.js +4 -4
  575. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  576. package/app/.next-cli-build/server/pages/404.html +1 -1
  577. package/app/.next-cli-build/server/pages/500.html +1 -1
  578. package/app/.next-cli-build/static/chunks/1321-656ff6a3f06c59ae.js +1 -0
  579. package/app/.next-cli-build/static/chunks/5497-7b21d4160c9e592e.js +7 -0
  580. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-ddb08251c0405731.js +1 -0
  581. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-93a480448464bc2c.js → page-a2431d795923337a.js} +1 -1
  582. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-568a544f8e220d5b.js +1 -0
  583. package/app/.next-cli-build/static/chunks/app/_global-error/page-610e2a51edf6ccba.js +1 -0
  584. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-610e2a51edf6ccba.js +1 -0
  585. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-610e2a51edf6ccba.js +1 -0
  586. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-610e2a51edf6ccba.js +1 -0
  587. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-610e2a51edf6ccba.js +1 -0
  588. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-610e2a51edf6ccba.js +1 -0
  589. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-610e2a51edf6ccba.js +1 -0
  590. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-610e2a51edf6ccba.js +1 -0
  591. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-610e2a51edf6ccba.js +1 -0
  592. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-610e2a51edf6ccba.js +1 -0
  593. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-610e2a51edf6ccba.js +1 -0
  594. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-610e2a51edf6ccba.js +1 -0
  595. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-610e2a51edf6ccba.js +1 -0
  596. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-610e2a51edf6ccba.js +1 -0
  597. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-610e2a51edf6ccba.js +1 -0
  598. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-610e2a51edf6ccba.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-610e2a51edf6ccba.js +1 -0
  600. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-610e2a51edf6ccba.js +1 -0
  601. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-610e2a51edf6ccba.js +1 -0
  602. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-610e2a51edf6ccba.js +1 -0
  603. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-610e2a51edf6ccba.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-610e2a51edf6ccba.js +1 -0
  605. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-610e2a51edf6ccba.js +1 -0
  606. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-610e2a51edf6ccba.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-610e2a51edf6ccba.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-610e2a51edf6ccba.js +1 -0
  609. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-610e2a51edf6ccba.js +1 -0
  610. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-610e2a51edf6ccba.js +1 -0
  611. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-610e2a51edf6ccba.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-610e2a51edf6ccba.js +1 -0
  613. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-610e2a51edf6ccba.js +1 -0
  614. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-610e2a51edf6ccba.js +1 -0
  615. package/app/.next-cli-build/static/chunks/app/api/combos/route-610e2a51edf6ccba.js +1 -0
  616. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-610e2a51edf6ccba.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-610e2a51edf6ccba.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-610e2a51edf6ccba.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-610e2a51edf6ccba.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-610e2a51edf6ccba.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-610e2a51edf6ccba.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/health/route-610e2a51edf6ccba.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/init/route-610e2a51edf6ccba.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-610e2a51edf6ccba.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/keys/route-610e2a51edf6ccba.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/locale/route-610e2a51edf6ccba.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-610e2a51edf6ccba.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-610e2a51edf6ccba.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-610e2a51edf6ccba.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-610e2a51edf6ccba.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-610e2a51edf6ccba.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-610e2a51edf6ccba.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-610e2a51edf6ccba.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-610e2a51edf6ccba.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-610e2a51edf6ccba.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-610e2a51edf6ccba.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-610e2a51edf6ccba.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/models/route-610e2a51edf6ccba.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/models/test/route-610e2a51edf6ccba.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-610e2a51edf6ccba.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-610e2a51edf6ccba.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/checkin/route-610e2a51edf6ccba.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/export/route-610e2a51edf6ccba.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-610e2a51edf6ccba.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-610e2a51edf6ccba.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-610e2a51edf6ccba.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-610e2a51edf6ccba.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-610e2a51edf6ccba.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-610e2a51edf6ccba.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-610e2a51edf6ccba.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-610e2a51edf6ccba.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-610e2a51edf6ccba.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-610e2a51edf6ccba.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-610e2a51edf6ccba.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-610e2a51edf6ccba.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/pricing/route-610e2a51edf6ccba.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-610e2a51edf6ccba.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-610e2a51edf6ccba.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-610e2a51edf6ccba.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/json-models/route-610e2a51edf6ccba.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-610e2a51edf6ccba.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-610e2a51edf6ccba.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-610e2a51edf6ccba.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-610e2a51edf6ccba.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-610e2a51edf6ccba.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-610e2a51edf6ccba.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/providers/route-610e2a51edf6ccba.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-610e2a51edf6ccba.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-610e2a51edf6ccba.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-610e2a51edf6ccba.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-610e2a51edf6ccba.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-610e2a51edf6ccba.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-610e2a51edf6ccba.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-610e2a51edf6ccba.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-610e2a51edf6ccba.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-610e2a51edf6ccba.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-610e2a51edf6ccba.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-610e2a51edf6ccba.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-610e2a51edf6ccba.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-610e2a51edf6ccba.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-610e2a51edf6ccba.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-610e2a51edf6ccba.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-610e2a51edf6ccba.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-610e2a51edf6ccba.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/settings/database/import-usage/route-610e2a51edf6ccba.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-610e2a51edf6ccba.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-610e2a51edf6ccba.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-610e2a51edf6ccba.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/settings/route-610e2a51edf6ccba.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-610e2a51edf6ccba.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/tags/route-610e2a51edf6ccba.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-610e2a51edf6ccba.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-610e2a51edf6ccba.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-610e2a51edf6ccba.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-610e2a51edf6ccba.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-610e2a51edf6ccba.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-610e2a51edf6ccba.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-610e2a51edf6ccba.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-610e2a51edf6ccba.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-610e2a51edf6ccba.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-610e2a51edf6ccba.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-610e2a51edf6ccba.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-610e2a51edf6ccba.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-610e2a51edf6ccba.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-610e2a51edf6ccba.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-610e2a51edf6ccba.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-610e2a51edf6ccba.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-610e2a51edf6ccba.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-610e2a51edf6ccba.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-610e2a51edf6ccba.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-610e2a51edf6ccba.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-610e2a51edf6ccba.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-610e2a51edf6ccba.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-610e2a51edf6ccba.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-610e2a51edf6ccba.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-610e2a51edf6ccba.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-610e2a51edf6ccba.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-610e2a51edf6ccba.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-610e2a51edf6ccba.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-610e2a51edf6ccba.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-610e2a51edf6ccba.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-610e2a51edf6ccba.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-610e2a51edf6ccba.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-610e2a51edf6ccba.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-610e2a51edf6ccba.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-610e2a51edf6ccba.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-610e2a51edf6ccba.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-610e2a51edf6ccba.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/v1/route-610e2a51edf6ccba.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-610e2a51edf6ccba.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-610e2a51edf6ccba.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-610e2a51edf6ccba.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-610e2a51edf6ccba.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-610e2a51edf6ccba.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-610e2a51edf6ccba.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-610e2a51edf6ccba.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-610e2a51edf6ccba.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/version/route-610e2a51edf6ccba.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-610e2a51edf6ccba.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/version/update/route-610e2a51edf6ccba.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-610e2a51edf6ccba.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/page-610e2a51edf6ccba.js +1 -0
  743. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-610e2a51edf6ccba.js +1 -0
  744. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-610e2a51edf6ccba.js +1 -0
  745. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-610e2a51edf6ccba.js +1 -0
  746. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-610e2a51edf6ccba.js +1 -0
  747. package/app/.next-cli-build/static/rPl9WrF0GIBOKSW3yAMMs/_buildManifest.js +1 -0
  748. package/app/package.json +1 -1
  749. package/app/public/i18n/changelog/en.md +114 -101
  750. package/app/public/i18n/changelog/zh-CN.md +15 -3
  751. package/app/public/i18n/changelog/zh-TW.md +114 -101
  752. package/app/public/i18n/literals/zh-CN.json +32 -3
  753. package/app/src/mitm/server.js +2 -2
  754. package/app/src/sse/services/codebuddyCheckin.js +385 -0
  755. package/package.json +1 -1
  756. package/app/.next-cli-build/server/chunks/2283.js +0 -1
  757. package/app/.next-cli-build/server/chunks/3016.js +0 -1
  758. package/app/.next-cli-build/server/chunks/3558.js +0 -1
  759. package/app/.next-cli-build/server/chunks/8185.js +0 -1
  760. package/app/.next-cli-build/server/chunks/827.js +0 -1
  761. package/app/.next-cli-build/server/chunks/8936.js +0 -1
  762. package/app/.next-cli-build/server/chunks/915.js +0 -63
  763. package/app/.next-cli-build/server/chunks/9381.js +0 -1
  764. package/app/.next-cli-build/static/chunks/1321-f66031be5e32c2cb.js +0 -1
  765. package/app/.next-cli-build/static/chunks/5497-857449e2441f5955.js +0 -7
  766. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-5fa69f9a11a9abac.js +0 -1
  767. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-06dd8e4a0a6a89ac.js +0 -1
  768. package/app/.next-cli-build/static/chunks/app/_global-error/page-e2820b80e5f98f0b.js +0 -1
  769. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-e2820b80e5f98f0b.js +0 -1
  770. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-e2820b80e5f98f0b.js +0 -1
  771. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-e2820b80e5f98f0b.js +0 -1
  772. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-e2820b80e5f98f0b.js +0 -1
  773. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-e2820b80e5f98f0b.js +0 -1
  774. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-e2820b80e5f98f0b.js +0 -1
  775. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-e2820b80e5f98f0b.js +0 -1
  776. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-e2820b80e5f98f0b.js +0 -1
  777. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-e2820b80e5f98f0b.js +0 -1
  778. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-e2820b80e5f98f0b.js +0 -1
  779. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-e2820b80e5f98f0b.js +0 -1
  780. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-e2820b80e5f98f0b.js +0 -1
  781. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-e2820b80e5f98f0b.js +0 -1
  782. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-e2820b80e5f98f0b.js +0 -1
  783. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-e2820b80e5f98f0b.js +0 -1
  784. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-e2820b80e5f98f0b.js +0 -1
  785. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-e2820b80e5f98f0b.js +0 -1
  786. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-e2820b80e5f98f0b.js +0 -1
  787. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-e2820b80e5f98f0b.js +0 -1
  788. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-e2820b80e5f98f0b.js +0 -1
  789. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-e2820b80e5f98f0b.js +0 -1
  790. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-e2820b80e5f98f0b.js +0 -1
  791. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-e2820b80e5f98f0b.js +0 -1
  792. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-e2820b80e5f98f0b.js +0 -1
  793. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-e2820b80e5f98f0b.js +0 -1
  794. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-e2820b80e5f98f0b.js +0 -1
  795. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-e2820b80e5f98f0b.js +0 -1
  796. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-e2820b80e5f98f0b.js +0 -1
  797. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-e2820b80e5f98f0b.js +0 -1
  798. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-e2820b80e5f98f0b.js +0 -1
  799. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-e2820b80e5f98f0b.js +0 -1
  800. package/app/.next-cli-build/static/chunks/app/api/combos/route-e2820b80e5f98f0b.js +0 -1
  801. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-e2820b80e5f98f0b.js +0 -1
  802. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-e2820b80e5f98f0b.js +0 -1
  803. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-e2820b80e5f98f0b.js +0 -1
  804. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-e2820b80e5f98f0b.js +0 -1
  805. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-e2820b80e5f98f0b.js +0 -1
  806. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-e2820b80e5f98f0b.js +0 -1
  807. package/app/.next-cli-build/static/chunks/app/api/health/route-e2820b80e5f98f0b.js +0 -1
  808. package/app/.next-cli-build/static/chunks/app/api/init/route-e2820b80e5f98f0b.js +0 -1
  809. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-e2820b80e5f98f0b.js +0 -1
  810. package/app/.next-cli-build/static/chunks/app/api/keys/route-e2820b80e5f98f0b.js +0 -1
  811. package/app/.next-cli-build/static/chunks/app/api/locale/route-e2820b80e5f98f0b.js +0 -1
  812. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-e2820b80e5f98f0b.js +0 -1
  813. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-e2820b80e5f98f0b.js +0 -1
  814. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-e2820b80e5f98f0b.js +0 -1
  815. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-e2820b80e5f98f0b.js +0 -1
  816. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-e2820b80e5f98f0b.js +0 -1
  817. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-e2820b80e5f98f0b.js +0 -1
  818. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-e2820b80e5f98f0b.js +0 -1
  819. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-e2820b80e5f98f0b.js +0 -1
  820. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-e2820b80e5f98f0b.js +0 -1
  821. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-e2820b80e5f98f0b.js +0 -1
  822. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-e2820b80e5f98f0b.js +0 -1
  823. package/app/.next-cli-build/static/chunks/app/api/models/route-e2820b80e5f98f0b.js +0 -1
  824. package/app/.next-cli-build/static/chunks/app/api/models/test/route-e2820b80e5f98f0b.js +0 -1
  825. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-e2820b80e5f98f0b.js +0 -1
  826. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-e2820b80e5f98f0b.js +0 -1
  827. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/export/route-e2820b80e5f98f0b.js +0 -1
  828. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-e2820b80e5f98f0b.js +0 -1
  829. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-e2820b80e5f98f0b.js +0 -1
  830. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-e2820b80e5f98f0b.js +0 -1
  831. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-e2820b80e5f98f0b.js +0 -1
  832. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-e2820b80e5f98f0b.js +0 -1
  833. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-e2820b80e5f98f0b.js +0 -1
  834. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-e2820b80e5f98f0b.js +0 -1
  835. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-e2820b80e5f98f0b.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-e2820b80e5f98f0b.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-e2820b80e5f98f0b.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-e2820b80e5f98f0b.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-e2820b80e5f98f0b.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/api/pricing/route-e2820b80e5f98f0b.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-e2820b80e5f98f0b.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-e2820b80e5f98f0b.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-e2820b80e5f98f0b.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/json-models/route-e2820b80e5f98f0b.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-e2820b80e5f98f0b.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-e2820b80e5f98f0b.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-e2820b80e5f98f0b.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-e2820b80e5f98f0b.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-e2820b80e5f98f0b.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-e2820b80e5f98f0b.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/providers/route-e2820b80e5f98f0b.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-e2820b80e5f98f0b.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-e2820b80e5f98f0b.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-e2820b80e5f98f0b.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-e2820b80e5f98f0b.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-e2820b80e5f98f0b.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-e2820b80e5f98f0b.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-e2820b80e5f98f0b.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-e2820b80e5f98f0b.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-e2820b80e5f98f0b.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-e2820b80e5f98f0b.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-e2820b80e5f98f0b.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-e2820b80e5f98f0b.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-e2820b80e5f98f0b.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-e2820b80e5f98f0b.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-e2820b80e5f98f0b.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-e2820b80e5f98f0b.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-e2820b80e5f98f0b.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/settings/database/import-usage/route-e2820b80e5f98f0b.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-e2820b80e5f98f0b.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-e2820b80e5f98f0b.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-e2820b80e5f98f0b.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/settings/route-e2820b80e5f98f0b.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-e2820b80e5f98f0b.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/tags/route-e2820b80e5f98f0b.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-e2820b80e5f98f0b.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-e2820b80e5f98f0b.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-e2820b80e5f98f0b.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-e2820b80e5f98f0b.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-e2820b80e5f98f0b.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-e2820b80e5f98f0b.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-e2820b80e5f98f0b.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-e2820b80e5f98f0b.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-e2820b80e5f98f0b.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-e2820b80e5f98f0b.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-e2820b80e5f98f0b.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-e2820b80e5f98f0b.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-e2820b80e5f98f0b.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-e2820b80e5f98f0b.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-e2820b80e5f98f0b.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-e2820b80e5f98f0b.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-e2820b80e5f98f0b.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-e2820b80e5f98f0b.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-e2820b80e5f98f0b.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-e2820b80e5f98f0b.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-e2820b80e5f98f0b.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-e2820b80e5f98f0b.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-e2820b80e5f98f0b.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-e2820b80e5f98f0b.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-e2820b80e5f98f0b.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-e2820b80e5f98f0b.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-e2820b80e5f98f0b.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-e2820b80e5f98f0b.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-e2820b80e5f98f0b.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-e2820b80e5f98f0b.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-e2820b80e5f98f0b.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-e2820b80e5f98f0b.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-e2820b80e5f98f0b.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-e2820b80e5f98f0b.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-e2820b80e5f98f0b.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-e2820b80e5f98f0b.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-e2820b80e5f98f0b.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/v1/route-e2820b80e5f98f0b.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-e2820b80e5f98f0b.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-e2820b80e5f98f0b.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-e2820b80e5f98f0b.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-e2820b80e5f98f0b.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-e2820b80e5f98f0b.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-e2820b80e5f98f0b.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-e2820b80e5f98f0b.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-e2820b80e5f98f0b.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/version/route-e2820b80e5f98f0b.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-e2820b80e5f98f0b.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/version/update/route-e2820b80e5f98f0b.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-e2820b80e5f98f0b.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/page-e2820b80e5f98f0b.js +0 -1
  927. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-e2820b80e5f98f0b.js +0 -1
  928. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-e2820b80e5f98f0b.js +0 -1
  929. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-e2820b80e5f98f0b.js +0 -1
  930. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-e2820b80e5f98f0b.js +0 -1
  931. package/app/.next-cli-build/static/twXIb88JirT5kgPRe8HTu/_buildManifest.js +0 -1
  932. /package/app/.next-cli-build/static/{twXIb88JirT5kgPRe8HTu → rPl9WrF0GIBOKSW3yAMMs}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{13966:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))},64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var a=s(95155),r=s(12115),l=s(35497),i=s(81127),o=s(21931),n=s(1620),d=s(31474),c=s(90620),m=s(93308),x=s(38202),p=s(45496),u=s(73006);function h(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${m.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,m.QC)(t)}function b(){let{theme:e,setTheme:t,isDark:s}=(0,n.D)(),[m,b]=(0,r.useState)(()=>h()),[g,f]=(0,r.useState)(!0),[y,j]=(0,r.useState)(!1),[N,w]=(0,r.useState)(!1),[v,S]=(0,r.useState)(!1),[C,k]=(0,r.useState)({fallbackStrategy:"fill-first"}),[I,L]=(0,r.useState)(!0),[A,P]=(0,r.useState)({current:"",new:"",confirm:""}),[O,M]=(0,r.useState)({type:"",message:""}),[T,E]=(0,r.useState)(!1),[R,D]=(0,r.useState)(!1),[U,$]=(0,r.useState)({type:"",message:""}),[F,J]=(0,r.useState)({open:!1,mode:"",password:""}),q=(0,r.useRef)(null),[B,_]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[H,z]=(0,r.useState)(""),[X,K]=(0,r.useState)({type:"",message:""}),[Z,W]=(0,r.useState)(!1),[G,Q]=(0,r.useState)(!1),[V,Y]=(0,r.useState)({type:"",message:""}),[ee,et]=(0,r.useState)(!1),es=window.location.origin,ea=es?`${es}/api/auth/oidc/callback`:"/api/auth/oidc/callback",er=es?`${es}/api/auth/saml/acs`:"/api/auth/saml/acs",el=es?`${es}/api/auth/saml/metadata`:"/api/auth/saml/metadata",[ei,eo]=(0,r.useState)("saml"),[en,ed]=(0,r.useState)({samlEntryPoint:"",samlIssuer:"urn:10router:sp",samlCert:"",samlLoginLabel:"Sign in with SAML SSO",samlAttributeEmail:"email",samlAttributeName:"name"}),[ec,em]=(0,r.useState)({type:"",message:""}),[ex,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(!1),[eb,eg]=(0,r.useState)({type:"",message:""}),[ef,ey]=(0,r.useState)(!1),ej=(0,r.useRef)(null),eN=(0,r.useRef)(null),ew=(0,r.useRef)(null),ev=(0,r.useRef)(null),[eS,eC]=(0,r.useState)({type:"",message:""}),[ek,eI]=(0,r.useState)(!1),[eL,eA]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[eP,eO]=(0,r.useState)({type:"",message:""}),[eM,eT]=(0,r.useState)(!1),[eE,eR]=(0,r.useState)(!1);(0,r.useEffect)(()=>{b(h()),f((0,p.i)())},[y]);let eD=async()=>{let e=!0!==C.modelJsonImport;try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({modelJsonImport:e})}),s=await t.json();t.ok&&k(e=>({...e,...s}))}catch(e){console.log("Error toggling model JSON import:",e)}},eU=async()=>{let e=!0!==C.providerDisabledLastSort;try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerDisabledLastSort:e})}),s=await t.json();t.ok&&k(e=>({...e,...s}))}catch(e){console.log("Error toggling provider disabled-last sort:",e)}},e$=async()=>{let e=!1===C.showCommunityProviders;try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({showCommunityProviders:e})}),s=await t.json();t.ok&&k(e=>({...e,...s}))}catch(e){console.log("Error toggling show-community-providers:",e)}},eF=async()=>{let e=!0!==C.codeBuddyOAuthImport;try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({codeBuddyOAuthImport:e})}),s=await t.json();t.ok&&k(e=>({...e,...s}))}catch(e){console.log("Error toggling codebuddy OAuth import:",e)}},eJ=async()=>{let e=!0!==C.codeBuddyCheckin;try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({codeBuddyCheckin:e})}),s=await t.json();t.ok&&k(e=>({...e,...s}))}catch(e){console.log("Error toggling codebuddy auto check-in:",e)}};(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{k(e),_({authMode:e?.authMode||"password",oidcIssuerUrl:e?.oidcIssuerUrl||"",oidcClientId:e?.oidcClientId||"",oidcScopes:e?.oidcScopes||"openid profile email",oidcLoginLabel:e?.oidcLoginLabel||"Sign in with OIDC"}),z(""),eo(e?.ssoType||"saml"),ed({samlEntryPoint:e?.samlEntryPoint||"",samlIssuer:e?.samlIssuer||"urn:10router:sp",samlCert:e?.samlCert||"",samlLoginLabel:e?.samlLoginLabel||"Sign in with SAML SSO",samlAttributeEmail:e?.samlAttributeEmail||"email",samlAttributeName:e?.samlAttributeName||"name"}),(e?.authMode==="sso"||e?.authMode==="saml"||e?.authMode==="oidc"||e?.authMode==="both")&&et(!0),eA({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),L(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),L(!1)})},[]);let eq=async e=>{if(e.preventDefault(),!0===C.outboundProxyEnabled){eT(!0),eO({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:eL.outboundProxyUrl,outboundNoProxy:eL.outboundNoProxy})}),t=await e.json();e.ok?(k(e=>({...e,...t})),eO({type:"success",message:"Proxy settings applied"})):eO({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){eO({type:"error",message:"An error occurred"})}finally{eT(!1)}}},eB=async()=>{if(!0!==C.outboundProxyEnabled)return;let e=(eL.outboundProxyUrl||"").trim();if(!e)return void eO({type:"error",message:"Please enter a Proxy URL to test"});eR(!0),eO({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?eO({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):eO({type:"error",message:s?.error||"Proxy test failed"})}catch(e){eO({type:"error",message:"An error occurred"})}finally{eR(!1)}},e_=async e=>{eT(!0),eO({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(k(e=>({...e,...s})),eA(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),eO({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):eO({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){eO({type:"error",message:"An error occurred"})}finally{eT(!1)}},eH=async e=>{if(e.preventDefault(),A.new!==A.confirm)return void M({type:"error",message:"Passwords do not match"});E(!0),M({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:A.current,newPassword:A.new})}),t=await e.json();e.ok?(M({type:"success",message:"Password updated successfully"}),P({current:"",new:"",confirm:""})):M({type:"error",message:t.error||"Failed to update password"})}catch(e){M({type:"error",message:"An error occurred"})}finally{E(!1)}},ez=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&k(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},eX=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:e})})).ok&&k(t=>({...t,comboStrategy:e}))}catch(e){console.error("Failed to update combo strategy:",e)}},eK=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&k(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},eZ=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStickyRoundRobinLimit:t})})).ok&&k(e=>({...e,comboStickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update combo sticky limit:",e)}},eW=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&k(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},eG=(e,t)=>{_(s=>({...s,[e]:t}))},eQ=async(e=B.authMode||"password")=>{let t=B.oidcIssuerUrl.trim(),s=B.oidcClientId.trim(),a=B.oidcScopes.trim(),r=B.oidcLoginLabel.trim(),l=H.trim();if("password"!==e&&(!t||!s||!l)&&!C.oidcConfigured)return void K({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});W(!0),K({type:"",message:""}),Y({type:"",message:""});try{let i={authMode:e,ssoType:"oidc",oidcIssuerUrl:t,oidcClientId:s,oidcScopes:a||"openid profile email",oidcLoginLabel:r||"Sign in with OIDC"};l&&(i.oidcClientSecret=l);let o=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),n=await o.json();o.ok?(k(e=>({...e,...n})),_({authMode:n?.authMode||e,oidcIssuerUrl:n?.oidcIssuerUrl||t,oidcClientId:n?.oidcClientId||s,oidcScopes:n?.oidcScopes||a||"openid profile email",oidcLoginLabel:n?.oidcLoginLabel||r||"Sign in with OIDC"}),z(""),K({type:"success",message:"oidc"===e?"OIDC login enabled":"both"===e?"Password and OIDC login enabled":"OIDC settings saved"})):K({type:"error",message:n.error||"Failed to save OIDC settings"})}catch(e){K({type:"error",message:"An error occurred"})}finally{W(!1)}},eV=async()=>{let e=B.oidcIssuerUrl.trim(),t=B.oidcClientId.trim(),s=B.oidcScopes.trim(),a=H.trim();if(!e||!t)return void Y({type:"error",message:"Issuer URL and client ID are required to test the connection."});Q(!0),K({type:"",message:""}),Y({type:"",message:""});try{let r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({authMode:B.authMode||C.authMode||"password",oidcIssuerUrl:e,oidcClientId:t,oidcScopes:s||"openid profile email",oidcLoginLabel:B.oidcLoginLabel.trim()||"Sign in with OIDC",...a?{oidcClientSecret:a}:{}})}),l=await r.json().catch(()=>({}));if(!r.ok)return void Y({type:"error",message:l.error||"Failed to save OIDC settings before testing"});let i=await fetch("/api/auth/oidc/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issuerUrl:l.oidcIssuerUrl||e,clientId:l.oidcClientId||t,scopes:l.oidcScopes||s||"openid profile email"})}),o=await i.json().catch(()=>({}));if(i.ok&&o?.ok){let e=o.clientSecretTested?!0===o.clientSecretValid?`Connection OK. Discovery loaded from ${o.issuerUrl}. Client secret validated too.`:`Connection OK. Discovery loaded from ${o.issuerUrl}. Client secret was not checked.`:`Connection OK. Discovery loaded from ${o.issuerUrl}.`;Y({type:"success",message:e})}else Y({type:"error",message:o.error||"OIDC connection test failed"})}catch(e){Y({type:"error",message:"An error occurred"})}finally{Q(!1)}},eY=(e,t)=>{ed(s=>({...s,[e]:t}))},e0=async(e=B.authMode||"password")=>{ep(!0),em({type:"",message:""}),eg({type:"",message:""});try{let t={authMode:e,ssoType:"saml",samlEntryPoint:en.samlEntryPoint.trim(),samlIssuer:en.samlIssuer.trim()||"urn:10router:sp",samlCert:en.samlCert.trim(),samlLoginLabel:en.samlLoginLabel.trim()||"Sign in with SAML SSO",samlAttributeEmail:en.samlAttributeEmail.trim()||"email",samlAttributeName:en.samlAttributeName.trim()||"name"},s=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await s.json();s.ok?(k(e=>({...e,...a})),ed({samlEntryPoint:a?.samlEntryPoint||t.samlEntryPoint,samlIssuer:a?.samlIssuer||t.samlIssuer,samlCert:a?.samlCert||t.samlCert,samlLoginLabel:a?.samlLoginLabel||t.samlLoginLabel,samlAttributeEmail:a?.samlAttributeEmail||t.samlAttributeEmail,samlAttributeName:a?.samlAttributeName||t.samlAttributeName}),em({type:"success",message:"sso"===e||"saml"===e?"SAML SSO login enabled":"both"===e?"Password and SAML SSO login enabled":"SAML 2.0 settings saved"})):em({type:"error",message:a.error||"Failed to save SAML settings"})}catch{em({type:"error",message:"An error occurred while saving SAML settings"})}finally{ep(!1)}},e1=async()=>{eh(!0),em({type:"",message:""}),eg({type:"",message:""});try{let e=await fetch("/api/auth/saml/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({samlEntryPoint:en.samlEntryPoint.trim(),samlIssuer:en.samlIssuer.trim(),samlCert:en.samlCert.trim()})}),t=await e.json();e.ok&&t.ok?eg({type:"success",message:t.message||"SAML configuration verified!"}):eg({type:"error",message:t.error||"SAML configuration test failed"})}catch{eg({type:"error",message:"An error occurred while testing SAML configuration"})}finally{eh(!1)}},e5=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableObservability:e})})).ok&&k(t=>({...t,enableObservability:e}))}catch(e){console.error("Failed to update enableObservability:",e)}},e2=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();k(t)}catch(e){console.error("Failed to reload settings:",e)}},e4=async e=>{D(!0),$({type:"",message:""});try{let t=await fetch("/api/settings/database",{headers:{"x-9r-password":e}});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Failed to export database")}let s=await t.json(),a=JSON.stringify(s,null,2),r=new Blob([a],{type:"application/json"}),l=URL.createObjectURL(r),i=document.createElement("a"),o=new Date().toISOString().replace(/[.:]/g,"-");i.href=l,i.download=`10router-backup-${o}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(l),$({type:"success",message:"Database backup downloaded"})}catch(e){$({type:"error",message:e.message||"Failed to export database"})}finally{D(!1)}},e3=async e=>{eI(!0),eC({type:"",message:""});try{let t=new FormData;t.append("file",e);let s=await fetch("/api/settings/database/import-usage",{method:"POST",body:t}),a=await s.json();if(!s.ok)throw Error(a.error||"Failed to import usage");eC({type:"success",message:`${(0,u.Tl)("Imported")} ${a.imported} ${(0,u.Tl)("usage records")} (${(0,u.Tl)("skipped")} ${a.skipped}, ${(0,u.Tl)("total")} ${a.total})`})}catch(e){eC({type:"error",message:e.message||"Failed to import usage"})}finally{eI(!1)}},e6=async e=>{let t=q.current;if(t){D(!0);try{let s=await t.text(),a=JSON.parse(s),r=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,password:e})}),l=await r.json().catch(()=>({}));if(!r.ok)throw Error(l.error||"Failed to import database");await e2(),$({type:"success",message:"Database imported successfully"})}catch(e){$({type:"error",message:e.message||"Invalid backup file"})}finally{q.current=null,D(!1)}}},e9=async()=>{let{mode:e,password:t}=F;J({open:!1,mode:"",password:""}),"export"===e?await e4(t):"import"===e&&await e6(t)},e7=!0===C.enableObservability,e8=async()=>{S(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}S(!1),w(!1)},te=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(e){console.error("Failed to logout:",e)}};return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto px-4 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"size-10 sm:size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl sm:text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5 w-full sm:w-auto",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,d.cn)("flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1.5 rounded-md font-medium transition-all flex-1 sm:flex-initial",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-xs sm:text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 rounded-lg bg-bg border border-border gap-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Database Location"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted font-mono break-all",children:"~/.10router/db/data.sqlite"})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(l.$n,{variant:"secondary",icon:"download",onClick:()=>J({open:!0,mode:"export",password:""}),loading:R,className:"w-full sm:w-auto",children:"Download Backup"}),(0,a.jsx)(l.$n,{variant:"outline",icon:"upload",onClick:()=>ew.current?.click(),disabled:R,className:"w-full sm:w-auto",children:"Import Backup"}),(0,a.jsx)(l.$n,{variant:"outline",icon:"history",onClick:()=>ev.current?.click(),loading:ek,className:"w-full sm:w-auto",children:(0,u.Tl)("Import Usage")}),(0,a.jsx)("input",{ref:ew,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];ew.current&&(ew.current.value=""),t&&(q.current=t,$({type:"",message:""}),J({open:!0,mode:"import",password:""}))}}),(0,a.jsx)("input",{ref:ev,type:"file",accept:".sqlite,.db",className:"hidden",onChange:e=>{let t=e.target.files?.[0];ev.current&&(ev.current.value=""),t&&(/\.(sqlite|sqlite3|db)$/i.test(t.name)||"application/x-sqlite3"===t.type||"application/vnd.sqlite3"===t.type||"application/octet-stream"===t.type?e3(t):eC({type:"error",message:(0,u.Tl)("Only SQLite database files (.sqlite/.db) can be imported")}))}})]}),U.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===U.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:U.message}),eS.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===eS.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:eS.message})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg bg-blue-500/10 text-blue-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Language")})]}),(0,a.jsxs)("button",{onClick:()=>j(!0),className:"flex items-center justify-between w-full p-3 rounded-lg bg-bg border border-border hover:border-primary/50 transition-colors","data-i18n-skip":"true",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:(0,u.Tl)("Display language")}),(0,a.jsx)("span",{className:"text-2xl",children:x.h[m]||"\uD83C\uDF10"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 mt-3 p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:(0,u.Tl)("Regional currency")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Show costs in local currency (\xa5/NT$/₩/₫); off → $"})]}),(0,a.jsx)(l.lM,{checked:g,onChange:()=>{let e=!(0,p.i)();"u">typeof localStorage&&localStorage.setItem("useRegionalCurrency",e?"1":"0"),f(e)}})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Security")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:(0,u.Tl)("Require login")}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:(0,u.Tl)("When ON, dashboard requires password. When OFF, access without login.")})]}),(0,a.jsx)(l.lM,{checked:!0===C.requireLogin,onChange:()=>eW(!C.requireLogin),disabled:I})]}),!0===C.requireLogin&&(0,a.jsxs)("form",{onSubmit:eH,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[C.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Current Password"}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Enter current password",value:A.current,onChange:e=>P({...A,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"New Password"}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Enter new password",value:A.new,onChange:e=>P({...A,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Confirm new password",value:A.confirm,onChange:e=>P({...A,confirm:e.target.value}),required:!0})]})]}),O.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===O.type?"text-red-500":"text-green-500"}`,children:O.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(l.$n,{type:"submit",variant:"primary",loading:T,className:"w-full sm:w-auto",children:C.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>et(e=>!e),className:"w-full flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-indigo-500/10 text-indigo-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Single Sign-On (SSO)")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"sso"===C.authMode||"oidc"===C.authMode||"saml"===C.authMode?`${"saml"===C.ssoType?"SAML 2.0":"OIDC"} SSO active`:"both"===C.authMode?`Password + ${"saml"===C.ssoType?"SAML 2.0":"OIDC"} active`:"Optional SSO via Okta, Entra ID, Keycloak, or OIDC"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted shrink-0",children:ee?"expand_less":"expand_more"})]}),ee&&(0,a.jsxs)("div",{className:"flex flex-col gap-4 mt-4",children:[(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:(0,u.Tl)("Configure enterprise Single Sign-On (SSO) for dashboard access using SAML 2.0 or OIDC.")}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"SSO Protocol"}),(0,a.jsxs)("div",{className:"flex p-1 rounded-lg bg-black/5 dark:bg-white/5 border border-border",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eo("saml"),className:(0,d.cn)("flex-1 py-1.5 px-3 rounded-md font-medium text-xs sm:text-sm transition-all text-center","saml"===ei?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:"SAML 2.0"}),(0,a.jsx)("button",{type:"button",onClick:()=>eo("oidc"),className:(0,d.cn)("flex-1 py-1.5 px-3 rounded-md font-medium text-xs sm:text-sm transition-all text-center","oidc"===ei?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:"OIDC"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Auth Mode"}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[{value:"password",title:"Password only",desc:"Keep legacy password login."},{value:"sso",title:`${"saml"===ei?"SAML":"OIDC"} only`,desc:"Require SSO for dashboard access."},{value:"both",title:"Both",desc:"Allow password or SSO login."}].map(e=>{let t=B.authMode,s="password"===e.value?"password"===t:"sso"===e.value?"sso"===t||"saml"===t||"oidc"===t:"both"===t;return(0,a.jsxs)("button",{type:"button",onClick:()=>eG("authMode",e.value),className:(0,d.cn)("text-left rounded-lg border p-3 transition-colors",s?"border-primary bg-primary/5":"border-border bg-bg hover:bg-black/5 dark:hover:bg-white/5"),disabled:I||Z||ex,children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:e.title}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted mt-1",children:e.desc})]},e.value)})})]}),"saml"===ei?(0,a.jsxs)("div",{className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-bg/80 overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ey(e=>!e),className:"w-full p-3 flex items-center justify-between gap-2 text-left hover:bg-surface/50 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-lg",children:"menu_book"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-xs sm:text-sm text-text-main",children:"IdP Setup Guidelines & Provider Configuration Instructions"}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted",children:"Click to view setup steps for AWS IAM Identity Center, Okta, Entra ID, Keycloak, & Authentik"})]})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted transition-transform text-lg",style:{transform:ef?"rotate(180deg)":"none"},children:"expand_more"})]}),ef&&(0,a.jsxs)("div",{className:"p-4 border-t border-border bg-surface/30 text-xs text-text-main flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"p-2.5 rounded border border-primary/20 bg-primary/5 text-primary text-xs",children:[(0,a.jsx)("p",{className:"font-semibold mb-1",children:"\uD83D\uDD11 Required Service Provider (SP) Values for your IdP Setup:"}),(0,a.jsxs)("ul",{className:"list-disc pl-4 space-y-1 font-mono text-[11px]",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Assertion Consumer Service (ACS) URL:"})," ",(0,a.jsx)("code",{className:"bg-bg px-1 py-0.5 rounded break-all",children:er})]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"SP Entity ID / Audience URI:"})," ",(0,a.jsx)("code",{className:"bg-bg px-1 py-0.5 rounded break-all",children:en.samlIssuer||"urn:10router:sp"})]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"NameID Format:"})," ",(0,a.jsx)("code",{className:"bg-bg px-1 py-0.5 rounded",children:"EmailAddress"})," or ",(0,a.jsx)("code",{className:"bg-bg px-1 py-0.5 rounded",children:"Unspecified"})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 pt-1",children:[(0,a.jsxs)("div",{className:"p-3 rounded border border-border bg-bg/50 flex flex-col gap-1.5",children:[(0,a.jsxs)("p",{className:"font-semibold text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{children:"☁️"})," AWS IAM Identity Center"]}),(0,a.jsxs)("ol",{className:"list-decimal pl-4 text-text-muted space-y-1",children:[(0,a.jsxs)("li",{children:["Applications → ",(0,a.jsx)("b",{children:"Add application"})," → Select ",(0,a.jsx)("b",{children:"Add custom SAML 2.0 application"}),"."]}),(0,a.jsxs)("li",{children:["Set ",(0,a.jsx)("b",{children:"Application ACS URL"})," to ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:er}),"."]}),(0,a.jsxs)("li",{children:["Set ",(0,a.jsx)("b",{children:"Application SAML audience"})," to ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:en.samlIssuer||"urn:10router:sp"}),"."]}),(0,a.jsxs)("li",{children:["Under ",(0,a.jsx)("i",{children:"Attribute mappings"}),", map ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:"Subject"})," or ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:"email"})," to ",(0,a.jsxs)("code",{className:"text-text-main font-mono",children:["$","{user:email}"]}),"."]}),(0,a.jsxs)("li",{children:["Download ",(0,a.jsx)("b",{children:"IAM Identity Center SAML metadata XML"})," file and use 1-Click Import below!"]})]})]}),(0,a.jsxs)("div",{className:"p-3 rounded border border-border bg-bg/50 flex flex-col gap-1.5",children:[(0,a.jsxs)("p",{className:"font-semibold text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{children:"\uD83D\uDD37"})," Microsoft Entra ID (Azure AD)"]}),(0,a.jsxs)("ol",{className:"list-decimal pl-4 text-text-muted space-y-1",children:[(0,a.jsxs)("li",{children:["Enterprise Applications → ",(0,a.jsx)("b",{children:"New application"})," → ",(0,a.jsx)("b",{children:"Create your own application"}),"."]}),(0,a.jsxs)("li",{children:["Select ",(0,a.jsx)("b",{children:"Single sign-on"})," → ",(0,a.jsx)("b",{children:"SAML"}),"."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Identifier (Entity ID):"})," ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:en.samlIssuer||"urn:10router:sp"})]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Reply URL (ACS):"})," ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:er})]}),(0,a.jsxs)("li",{children:["Download ",(0,a.jsx)("b",{children:"Federation Metadata XML"})," and import or copy X.509 Certificate."]})]})]}),(0,a.jsxs)("div",{className:"p-3 rounded border border-border bg-bg/50 flex flex-col gap-1.5",children:[(0,a.jsxs)("p",{className:"font-semibold text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{children:"\uD83D\uDFE2"})," Okta / Auth0"]}),(0,a.jsxs)("ol",{className:"list-decimal pl-4 text-text-muted space-y-1",children:[(0,a.jsxs)("li",{children:["Applications → ",(0,a.jsx)("b",{children:"Create App Integration"})," → Select ",(0,a.jsx)("b",{children:"SAML 2.0"}),"."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Single Sign-On URL:"})," ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:er})]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Audience URI (SP Entity ID):"})," ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:en.samlIssuer||"urn:10router:sp"})]}),(0,a.jsxs)("li",{children:["Name ID format: ",(0,a.jsx)("i",{children:"EmailAddress"}),"."]}),(0,a.jsx)("li",{children:"Download Identity Provider metadata XML or copy the X.509 cert."})]})]}),(0,a.jsxs)("div",{className:"p-3 rounded border border-border bg-bg/50 flex flex-col gap-1.5",children:[(0,a.jsxs)("p",{className:"font-semibold text-text-main flex items-center gap-1.5",children:[(0,a.jsx)("span",{children:"\uD83D\uDEE1️"})," Keycloak / Authentik"]}),(0,a.jsxs)("ol",{className:"list-decimal pl-4 text-text-muted space-y-1",children:[(0,a.jsxs)("li",{children:["Clients → ",(0,a.jsx)("b",{children:"Create client"})," → Select ",(0,a.jsx)("b",{children:"SAML"}),"."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Client ID:"})," ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:en.samlIssuer||"urn:10router:sp"})]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("b",{children:"Master SAML Processing URL:"})," ",(0,a.jsx)("code",{className:"text-text-main font-mono",children:er})]}),(0,a.jsx)("li",{children:"Export SAML Descriptor XML or copy IDP Certificate PEM."})]})]})]})]})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg border border-dashed border-primary/40 bg-primary/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm text-text-main",children:"1-Click IdP Metadata XML Import"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Auto-fill SSO URL, Issuer & Cert from XML metadata"})]}),(0,a.jsx)(l.$n,{type:"button",variant:"outline",size:"sm",icon:"upload_file",onClick:()=>ej.current?.click(),children:"Upload Metadata XML"}),(0,a.jsx)("input",{ref:ej,type:"file",accept:".xml,application/xml,text/xml",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(ej.current&&(ej.current.value=""),!t)return;let s=new FileReader;s.onload=e=>{try{let t=e.target?.result||"",s=new DOMParser().parseFromString(t,"text/xml");if(s.querySelector("parsererror"))return void em({type:"error",message:"Unable to parse valid SAML IdP metadata from XML file"});let a=s.documentElement.getAttribute("entityID")||"",r=Array.from(s.querySelectorAll("SingleSignOnService, *|SingleSignOnService")),l="";for(let e of r){let t=e.getAttribute("Binding")||"",s=e.getAttribute("Location")||"";if(s&&(l=s,t.includes("HTTP-Redirect")))break}let i=Array.from(s.querySelectorAll("X509Certificate, *|X509Certificate")),o="";i.length>0&&(o=i[0].textContent.trim()),ed(e=>({...e,samlEntryPoint:l||e.samlEntryPoint,samlIssuer:e.samlIssuer||"urn:10router:sp",samlCert:o||e.samlCert})),em({type:"success",message:`IdP Metadata imported! (SSO URL: ${l?"found":"not found"}, EntityID: ${a?"found":"not found"}, Cert: ${o?"found":"not found"})`})}catch(e){em({type:"error",message:"Error reading IdP Metadata XML file"})}},s.readAsText(t)}})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Single Sign-On Service URL (samlEntryPoint)"}),(0,a.jsx)(l.pd,{placeholder:"https://idp.example.com/app/saml/sso/...",value:en.samlEntryPoint,onChange:e=>eY("samlEntryPoint",e.target.value),disabled:I||ex})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"SP Entity ID / Audience (samlIssuer)"}),(0,a.jsx)(l.pd,{placeholder:"urn:10router:sp",value:en.samlIssuer,onChange:e=>eY("samlIssuer",e.target.value),disabled:I||ex})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"IdP X.509 Certificate (samlCert)"}),(0,a.jsx)(l.$n,{type:"button",variant:"outline",size:"sm",icon:"file_upload",onClick:()=>eN.current?.click(),children:"Upload Certificate"}),(0,a.jsx)("input",{ref:eN,type:"file",accept:".crt,.pem,.cer,text/plain",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(eN.current&&(eN.current.value=""),!t)return;let s=new FileReader;s.onload=e=>{let t=e.target?.result||"";ed(e=>({...e,samlCert:t.trim()})),em({type:"success",message:"Certificate file loaded into configuration."})},s.readAsText(t)}})]}),(0,a.jsx)("textarea",{rows:4,placeholder:"-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",value:en.samlCert,onChange:e=>eY("samlCert",e.target.value),className:"w-full p-2.5 rounded-lg border border-border bg-bg text-xs font-mono text-text-main focus:outline-none focus:border-primary",disabled:I||ex}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Paste raw Base64 certificate or PEM block."})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Login Button Label"}),(0,a.jsx)(l.pd,{placeholder:"Sign in with SAML SSO",value:en.samlLoginLabel,onChange:e=>eY("samlLoginLabel",e.target.value),disabled:I||ex})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Email Claim Attribute"}),(0,a.jsx)(l.pd,{placeholder:"email",value:en.samlAttributeEmail,onChange:e=>eY("samlAttributeEmail",e.target.value),disabled:I||ex})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Display Name Claim"}),(0,a.jsx)(l.pd,{placeholder:"name",value:en.samlAttributeName,onChange:e=>eY("samlAttributeName",e.target.value),disabled:I||ex})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-3 rounded-lg border border-border bg-bg text-xs sm:text-sm text-text-muted",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main",children:"ACS Callback URL"}),(0,a.jsx)("code",{className:"block break-all font-mono text-xs",children:er})]}),(0,a.jsx)(l.$n,{type:"button",variant:"outline",size:"sm",icon:"content_copy",onClick:()=>{navigator.clipboard.writeText(er),em({type:"success",message:"ACS URL copied to clipboard!"})},children:"Copy"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main",children:"SP XML Metadata"}),(0,a.jsx)("code",{className:"block break-all font-mono text-xs",children:el})]}),(0,a.jsxs)("a",{href:el,target:"_blank",rel:"noopener noreferrer",download:"10router-sp-metadata.xml",className:"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"download"}),"Download XML"]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)(l.$n,{type:"button",variant:"primary",loading:ex,onClick:()=>e0(B.authMode),className:"w-full sm:w-auto",children:"Save SAML settings"}),(0,a.jsx)(l.$n,{type:"button",variant:"outline",loading:eu,onClick:e1,className:"w-full sm:w-auto",children:"Test SAML settings"})]}),eb.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===eb.type?"text-red-500":"text-green-500"}`,children:eb.message}),ec.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===ec.type?"text-red-500":"text-green-500"}`,children:ec.message})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Issuer URL"}),(0,a.jsx)(l.pd,{placeholder:"https://auth.example.com/application/o/10router/",value:B.oidcIssuerUrl,onChange:e=>eG("oidcIssuerUrl",e.target.value),disabled:I||Z})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client ID"}),(0,a.jsx)(l.pd,{placeholder:"10router-dashboard",value:B.oidcClientId,onChange:e=>eG("oidcClientId",e.target.value),disabled:I||Z})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client Secret"}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Leave blank to keep existing secret",value:H,onChange:e=>z(e.target.value),disabled:I||Z}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"This value is write-only after saving."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Scopes"}),(0,a.jsx)(l.pd,{placeholder:"openid profile email",value:B.oidcScopes,onChange:e=>eG("oidcScopes",e.target.value),disabled:I||Z})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Login Button Label"}),(0,a.jsx)(l.pd,{placeholder:"Sign in with OIDC",value:B.oidcLoginLabel,onChange:e=>eG("oidcLoginLabel",e.target.value),disabled:I||Z})]})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-bg p-3 text-xs sm:text-sm text-text-muted",children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-1",children:"Redirect URI"}),(0,a.jsx)("code",{className:"block break-all font-mono",children:ea})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)(l.$n,{type:"button",variant:"primary",loading:Z,onClick:()=>eQ(),className:"w-full sm:w-auto",children:"Save OIDC settings"}),(0,a.jsx)(l.$n,{type:"button",variant:"outline",loading:G,onClick:eV,className:"w-full sm:w-auto",children:"Test connection"})]}),V.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===V.type?"text-red-500":"text-green-500"}`,children:V.message}),X.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===X.type?"text-red-500":"text-green-500"}`,children:X.message})]}),"oidc"===C.authMode||"saml"===C.authMode||"sso"===C.authMode?(0,a.jsxs)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:["SSO login (","saml"===C.ssoType?"SAML 2.0":"OIDC",") is currently active. Password login is disabled until you switch back."]}):null,"both"===C.authMode&&(0,a.jsxs)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:["Password and SSO login (","saml"===C.ssoType?"SAML 2.0":"OIDC",") are both active."]})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-blue-500/10 text-blue-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(l.lM,{checked:"round-robin"===C.fallbackStrategy,onChange:()=>ez("round-robin"===C.fallbackStrategy?"fill-first":"round-robin"),disabled:I})]}),"round-robin"===C.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(l.pd,{type:"number",min:"1",max:"10",value:C.stickyRoundRobinLimit||3,onChange:e=>eK(e.target.value),disabled:I,className:"w-16 sm:w-20 text-center shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Combo Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,a.jsx)(l.lM,{checked:"round-robin"===C.comboStrategy,onChange:()=>eX("round-robin"===C.comboStrategy?"fallback":"round-robin"),disabled:I})]}),"round-robin"===C.comboStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Combo Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per combo model before switching"})]}),(0,a.jsx)(l.pd,{type:"number",min:"1",max:"100",value:C.comboStickyRoundRobinLimit||1,onChange:e=>eZ(e.target.value),disabled:I,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["round-robin"===C.fallbackStrategy?`Currently distributing requests across all available accounts with ${C.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===C.comboStrategy?` Combos rotate after ${C.comboStickyRoundRobinLimit||1} call${1===(C.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-cyan-500/10 text-cyan-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"device_hub"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Providers")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:(0,u.Tl)("Disabled providers sort last")}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Push providers with all connections disabled behind those with no connections"})]}),(0,a.jsx)(l.lM,{checked:!0===C.providerDisabledLastSort,onChange:eU})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:(0,u.Tl)("Show community welfare providers")}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Show free community gateways with no recharge entry (GoRouter / TaBiAI)"})]}),(0,a.jsx)(l.lM,{checked:!1!==C.showCommunityProviders,onChange:e$})]})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-amber-500/10 text-amber-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Experimental")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:(0,u.Tl)("Fetch models from GitHub JSON")}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Show a Fetch Models button on providers that publish a model JSON catalog"})]}),(0,a.jsx)(l.lM,{checked:!0===C.modelJsonImport,onChange:eD})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:(0,u.Tl)("CodeBuddy CN OAuth import / export")}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:(0,u.Tl)("Show Import / Export buttons on the CodeBuddy CN page (experimental)")})]}),(0,a.jsx)(l.lM,{checked:!0===C.codeBuddyOAuthImport,onChange:eF})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:(0,u.Tl)("CodeBuddy CN auto daily check-in")}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:(0,u.Tl)("Automatically check in accounts once a day (random 00:00–06:00 local)")})]}),(0,a.jsx)(l.lM,{checked:!0===C.codeBuddyCheckin,onChange:eJ})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:(0,u.Tl)("When enabled, the Import / Export buttons on the CodeBuddy CN page are replaced")})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-purple-500/10 text-purple-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Network")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(l.lM,{checked:!0===C.outboundProxyEnabled,onChange:()=>e_(!0!==C.outboundProxyEnabled),disabled:I||eM})]}),!0===C.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:eq,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy URL"}),(0,a.jsx)(l.pd,{placeholder:"http://127.0.0.1:7897",value:eL.outboundProxyUrl,onChange:e=>eA(t=>({...t,outboundProxyUrl:e.target.value})),disabled:I||eM}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"No Proxy"}),(0,a.jsx)(l.pd,{placeholder:"localhost,127.0.0.1",value:eL.outboundNoProxy,onChange:e=>eA(t=>({...t,outboundNoProxy:e.target.value})),disabled:I||eM}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,a.jsx)(l.$n,{type:"button",variant:"secondary",loading:eE,disabled:I||eM,onClick:eB,className:"w-full sm:w-auto",children:"Test proxy URL"}),(0,a.jsx)(l.$n,{type:"submit",variant:"primary",loading:eM,className:"w-full sm:w-auto",children:"Apply"})]})]}),eP.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===eP.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:eP.message})]})]}),(0,a.jsxs)(l.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-orange-500/10 text-orange-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:(0,u.Tl)("Observability")})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(l.lM,{checked:e7,onChange:e5,disabled:I})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(l.$n,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>w(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"}),(0,a.jsx)(l.$n,{variant:"outline",fullWidth:!0,icon:"logout",onClick:te,children:"Logout"})]}),(0,a.jsxs)("div",{className:"text-center text-xs sm:text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[c.vQ.name," v",c.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]}),(0,a.jsx)(o.default,{hideTrigger:!0,isOpen:y,onClose:e=>{j(!1),b(e)}}),(0,a.jsx)(i.ConfirmModal,{isOpen:N,onClose:()=>w(!1),onConfirm:e8,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:v}),(0,a.jsxs)(i.default,{isOpen:F.open,onClose:()=>J({open:!1,mode:"",password:""}),title:"Confirm Password",size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{variant:"ghost",onClick:()=>J({open:!1,mode:"",password:""}),disabled:R,children:"Cancel"}),(0,a.jsx)(l.$n,{variant:"primary",onClick:e9,loading:R,disabled:!F.password,children:"Confirm"})]}),children:[(0,a.jsxs)("p",{className:"text-text-muted mb-3 text-sm",children:["Enter your current password to ","export"===F.mode?"export":"import"," the database."]}),(0,a.jsx)(l.pd,{type:"password",value:F.password,onChange:e=>J(t=>({...t,password:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&F.password&&e9()},placeholder:"Current password",autoFocus:!0})]})]})}}},e=>{e.O(0,[4614,1321,5497,8441,3794,7358],()=>e(e.s=13966)),_N_E=e.O()}]);
@@ -11,4 +11,4 @@ pt-only-auto-named`:M,[G,V]=(0,i.useState)("single"),[Q,Z]=(0,i.useState)(""),[Y
11
11
  "idToken": "eyJhbGc...",
12
12
  "email": "user@example.com"
13
13
  }
14
- ]`;function K({isOpen:e,onClose:t,onSuccess:s}){let[l,o]=(0,i.useState)(""),[n,r]=(0,i.useState)(!1),[d,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),x=()=>{n||(o(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,N.Tl)("No accounts found in input"));r(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{r(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:l,onChange:e=>o(e.target.value),disabled:n}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,N.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,N.Tl)("failed")}`:""]}),f.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}function L({isOpen:e,onClose:t,onSuccess:s,password:l=""}){let[o,n]=(0,i.useState)(""),[r,d]=(0,i.useState)(""),[m,p]=(0,i.useState)(!1),[u,x]=(0,i.useState)(""),[h,f]=(0,i.useState)(null),g=(0,i.useRef)(null),y=()=>{m||(n(""),d(""),x(""),f(null),g.current&&(g.current.value=""),t())},b=async()=>{let e;x(""),f(null);let t=o.trim();if(!t)return;try{e=JSON.parse(t)}catch(e){x(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}let a=Array.isArray(e)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!a||0===a.length)return void x((0,N.Tl)("No accounts found in input"));p(!0);try{let e=await fetch("/api/oauth/codebuddy-cn/bulk-import",{method:"POST",headers:{"Content-Type":"application/json",...l?{"x-9r-password":l}:{}},body:JSON.stringify({accounts:a})}),t=await e.json();if(!e.ok)return void x(401===e.status?(0,N.Tl)("Invalid password"):t?.error||`Request failed: ${e.status}`);f(t),(t.imported>0||t.updated>0)&&"function"==typeof s&&s()}catch(e){x(e.message||(0,N.Tl)("Request failed"))}finally{p(!1)}},v=h?.results?.filter(e=>!e.ok)||[],j=h?.skipped??0;return(0,a.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Import CodeBuddy CN Accounts"),onClose:y,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(c.$n,{variant:"secondary",fullWidth:!0,icon:"upload_file",onClick:()=>g.current?.click(),disabled:m,children:r||(0,N.Tl)("Choose JSON file...")}),(0,a.jsx)("input",{ref:g,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(!t)return;d(t.name),x(""),f(null);let s=new FileReader;s.onload=()=>n(String(s.result||"")),s.onerror=()=>x((0,N.Tl)("Failed to read file")),s.readAsText(t)}})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute -top-2 left-2 bg-sidebar px-1 text-[10px] text-text-muted",children:(0,N.Tl)("Or paste JSON")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 pt-4 text-sm font-mono resize-y min-h-[160px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:'[{ "access_token": "eyJ...", "refresh_token": "eyJ...", "nickname": "<nickname>" }]',value:o,onChange:e=>n(e.target.value),disabled:m})]}),u&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),h&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${h.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",h.imported," ",(0,N.Tl)("added"),", ",h.updated," ",(0,N.Tl)("updated"),j>0?`, ${j} ${(0,N.Tl)("skipped")}`:"",h.failed>0?`, ✗ ${h.failed} ${(0,N.Tl)("failed")}`:""]}),v.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:v.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:b,fullWidth:!0,disabled:m||!o.trim(),children:m?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:y,variant:"ghost",fullWidth:!0,disabled:m,children:(0,N.Tl)("Close")})]})]})})}K.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSuccess:O().func},L.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSuccess:O().func,password:O().string};let W={claude:"claudeAutoPing",codex:"codexAutoPing"};function B(){let e,t,s,o,u,x,h=(0,l.useParams)(),f=(0,l.useRouter)(),g=h.id,{getCaps:y}=(0,k.y)(),b=(0,C.i)(),[v,S]=(0,i.useState)([]),[A,O]=(0,i.useState)(!0),[E,I]=(0,i.useState)(null),[R,D]=(0,i.useState)([]),[M,F]=(0,i.useState)(!1),[B,H]=(0,i.useState)(!1),[G,V]=(0,i.useState)(!1),[Q,Z]=(0,i.useState)(""),[Y,X]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,ea]=(0,i.useState)(!1),[ei,el]=(0,i.useState)(!1),[eo,en]=(0,i.useState)(!1),[er,ed]=(0,i.useState)(null),[ec,em]=(0,i.useState)({}),[ep,eu]=(0,i.useState)([]),[ex,eh]=(0,i.useState)(()=>{try{let e=window.localStorage.getItem(`jsonModels_${h.id}`);return e?JSON.parse(e):null}catch{return null}}),[ef,eg]=(0,i.useState)(!1),[ey,eb]=(0,i.useState)(!1),[ev,ej]=(0,i.useState)({open:!1,action:null,value:""}),[ew,ek]=(0,i.useState)(""),[eN,eC]=(0,i.useState)(!1),[eS,eT]=(0,i.useState)({}),[e$,eA]=(0,i.useState)(""),[eO,eP]=(0,i.useState)(()=>new Set),[eE,eI]=(0,i.useState)(!1),[eU,eR]=(0,i.useState)([]),[eD,eJ]=(0,i.useState)("__none__"),[eM,e_]=(0,i.useState)(!1),[eq,ez]=(0,i.useState)(null),[eF,eK]=(0,i.useState)(""),[eL,eW]=(0,i.useState)("auto"),[eB,eH]=(0,i.useState)({enabled:!1,connections:{}}),[eG,eV]=(0,i.useState)([]),[eQ,eZ]=(0,i.useState)([]),[eY,eX]=(0,i.useState)([]),[e0,e1]=(0,i.useState)([]),[e5,e2]=(0,i.useState)(null),[e4,e3]=(0,i.useState)(!1),[e6,e7]=(0,i.useState)(!1),[e8,e9]=(0,i.useState)(!1),[te,tt]=(0,i.useState)(null),[ts,ta]=(0,i.useState)({}),[ti,tl]=(0,i.useState)(null),to=(0,i.useRef)(!1),[tn,tr]=(0,i.useState)(!1),[td,tc]=(0,i.useState)(!1),{copied:tm,copy:tp}=(0,w.C)(),tu="ag_risk_confirmed",tx=()=>{F(!0)},th=()=>{"antigravity"===g&&"true"!==window.localStorage.getItem(tu)?e3(!0):tN?tx():(Z(""),V(!0))},tf=()=>{Z(""),V(!0)},tg=()=>{tN?th():tf()},ty=async()=>{let{action:e,value:t}=ev;ej({open:!1,action:null,value:""}),"export"===e?await tv(t):"import"===e&&(ek(t),et(!0))},tb=e=>{ek(""),ej({open:!0,action:e,value:""})},tv=async e=>{try{let t=await fetch("/api/oauth/codebuddy-cn/export",{cache:"no-store",headers:e?{"x-9r-password":e}:{}}),s=await t.json();if(!t.ok){if(401===t.status)throw Error((0,N.Tl)("Invalid password"));throw Error(s?.error||`Request failed: ${t.status}`)}let a=Array.isArray(s)?s:[];if(0===a.length)return void b.warning((0,N.Tl)("No CodeBuddy CN connections to export"));let i=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),l=URL.createObjectURL(i),o=document.createElement("a");o.href=l,o.download=`codebuddy-cn-accounts-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(l),1e3),b.success(`${a.length} ${(0,N.Tl)("accounts exported")}`)}catch(e){b.error((0,N.Tl)("Export failed")+": "+e.message)}},tj=E?{id:E.id,name:E.name||("anthropic-compatible"===E.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===E.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===E.type?"AC":"OC",apiType:E.apiType,baseUrl:E.baseUrl,type:E.type,modelsJsonUrl:E.modelsJsonUrl||void 0,fallbackModelsJsonUrl:E.fallbackModelsJsonUrl||void 0}:m.zN[g]||m.fg[g]||m.IS[g]||m.nJ[g]||m.br[g],tw=tj?.modelsJsonUrl,tk=tj?.authModes||[],tN=!!m.zN[g]||!!m.IS[g]||tk.includes("oauth"),tC=!!m.fg[g]||tk.includes("apikey"),tS=!!m.IS[g]?.noAuth,tT="codebuddy-cn"===g&&ey,t$=(0,p.KC)(g),tA="cursor"===g&&eQ.length>0?eQ:t$,tO=(0,m.wG)(g),tP=(0,m.mq)(g),tE=(0,m.gb)(g),tI=tP||tE,tU=!tI&&tN&&tC,tR="xai"===g?"Grok Build OAuth":"grok-cli"===g?"Grok CLI Device Login":"kimi"===g?"Kimi Coding OAuth":"OAuth",tD="xai"===g?"xAI API Key":"kimi"===g?"Kimi API Key":"qoder"===g?"PAT":"API Key",tJ=e=>{if(!eL||"auto"===eL)return null;let t=j(g,e);return t&&t.includes(eL)?eL:null},tM=tI?g:tO,t_=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=j(g,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tA)s(e.id);for(let e of eY)s(e.id);for(let e of ep)e.providerAlias===tM&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tq=tI?E?.prefix||g:tO,tz=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}`,{cache:"no-store"}),t=await e.json();e.ok&&e1(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tM]),tF=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tM,ids:[e]})})).ok&&await tz()}catch(e){console.log("Error disabling model:",e)}},tK=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tz()}catch(e){console.log("Error enabling model:",e)}},tL=async e=>{e.length&&e2({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e2(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tM,ids:e})})).ok&&await tz()}catch(e){console.log("Error disabling all models:",e)}}})},tW=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tM)}`,{method:"DELETE"})).ok&&await tz()}catch(e){console.log("Error enabling all models:",e)}},tB=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&em(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tH=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eu(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]),tG=(0,i.useCallback)(async()=>{if(tw)try{let e=await fetch(`/api/providers/${g}/json-models`,{cache:"no-store"}),t=await e.json();if(e.ok){eh(t.models||[]);try{window.localStorage.setItem(`jsonModels_${g}`,JSON.stringify(t.models||[]))}catch{}}}catch(e){console.log("Error fetching provider JSON models:",e)}},[g,tw]);(0,i.useEffect)(()=>{"kilocode"===g&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eX(e.models)}).catch(()=>{})},[g]);let tV=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),o=await s.json(),n=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===g);S(e)}s.ok&&D(o.proxyPools||[]);let r=(n.providerStrategies||{})[g]||{};ez(r.fallbackStrategy||null),eK(null!=r.stickyRoundRobinLimit?String(r.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[g]||{};eW(d.mode||"auto");let c=W[g],m=c&&n[c]||{};if(eH({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===g)||null;if(!e&&tI)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===g)||null))break}I(e)}}catch(e){console.log("Error fetching connections:",e)}finally{O(!1)}},[g,tI]),tQ=async e=>{try{let t=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(I(s.node),await tV(),el(!1))}catch(e){console.log("Error updating provider node:",e)}},tZ=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[g]:l[g]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tY=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[g]={mode:e}:delete s[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tX=async e=>{let t=W[g];if(t){eH(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tV(),tB(),tH(),tz(),tG()},[tV,tB,tH,tz,tG]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(e=>{"boolean"==typeof e.modelJsonImport&&eg(e.modelJsonImport),"boolean"==typeof e.codeBuddyOAuthImport&&eb(e.codeBuddyOAuthImport)}).catch(e=>console.log("Error reading settings:",e))},[]),(0,i.useEffect)(()=>{if("cursor"!==g)return void eZ([]);let e=v.find(e=>!1!==e.isActive);if(!e?.id)return void eZ([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:s})=>{!t&&e&&Array.isArray(s.models)&&s.models.length>0&&eZ(s.models)}).catch(()=>{}),()=>{t=!0}},[g,v]),(0,i.useEffect)(()=>{let e=(m.zN[g]||m.fg[g]||m.IS[g]||m.nJ[g])?.modelsFetcher;e&&T(e).then(eV)},[g]);let t0=async(e,t,s=tO)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tB();else{let t=await e.json();b.error(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t1=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tB()}catch(e){console.log("Error deleting alias:",e)}},t5=async(e,t="llm",s=tM,a={},i)=>{try{let l={providerAlias:s,id:e,type:t};if(void 0!==i&&(l.enabled=i),a&&"object"==typeof a)for(let e of["vision","reasoning","contextWindow","maxOutput","thinkingFormat"])void 0!==a[e]&&(l[e]=a[e]);let o=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(o.ok)await tH(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await o.json();b.error(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},t2=async(e,t="llm",s=tM)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tH(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t4=async()=>{if(tn)return;let e=v.find(e=>!1!==e.isActive);if(!e)return void b.warning((0,N.Tl)("Please add an active Qoder connection first"));tr(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void b.error(s.error||(0,N.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void b.warning((0,N.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");ep.some(e=>e.providerAlias===tM&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tM}/${s}`)||(await t5(s,"llm",tM),i+=1)}0===i?b.warning((0,N.Tl)("All models already exist, no new models added")):b.success((0,N.Tl)("Successfully added")+` ${i} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),b.error((0,N.Tl)("Error fetching models")+": "+e.message)}finally{tr(!1)}},t3=async()=>{if(!td){tc(!0);try{let e=await fetch(`/api/providers/${g}/json-models`,{method:"POST"}),t=await e.json();if(!e.ok)return void b.error(t.error||(0,N.Tl)("Failed to fetch models"));await tG();let s=t.total||t.models?.length||0;b.success((0,N.Tl)("Sync complete")+` (${s} ${(0,N.Tl)("models")})`)}catch(e){console.log("Error importing models from JSON:",e),b.error((0,N.Tl)("Error fetching models")+": "+e.message)}finally{tc(!1)}}},t6=async(e,t)=>{try{(await fetch(`/api/providers/${g}/json-models`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({modelId:e,enabled:t})})).ok&&await tG()}catch(e){console.log("Error toggling JSON model:",e)}},t7=async e=>{try{(await fetch(`/api/providers/${g}/json-models`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,enabled:e})})).ok&&await tG()}catch(e){console.log("Error bulk-toggling JSON models:",e)}},t8=async()=>{if(e6||0===v.length)return;let e=Object.fromEntries(v.map(e=>[e.id,{state:"queued",error:null}]));to.current=!1,e7(!0),e9(!1),tt(null),ta(e),tl({total:v.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<v.length;e+=1){if(to.current){tl({total:v.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=v[e];tt(a.id),ta(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,ta(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,ta(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}tl({total:v.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<v.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tt(null),e7(!1),e9(!1),to.current=!1}},t9=async e=>{e2({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e2(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&S(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},se=()=>{tV(),F(!1)},st=async e=>{Z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tV(),V(!1);return}Z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Z("Failed to save connection")}},ss=async e=>{try{(await fetch(`/api/providers/${er.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tV(),ea(!1))}catch(e){console.log("Error updating connection:",e)}},sa=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&S(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},si=async(e,t)=>{let s=[...v];[s[e],s[t]]=[s[t],s[e]],S(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tV()}},sl=v.filter(e=>eU.includes(e.id)),so=v.length>0&&eU.length===v.length;(0,i.useEffect)(()=>{eR(e=>e.filter(e=>v.some(t=>t.id===e)))},[v]),(()=>{if(0===sl.length)return;let e=new Set(sl.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=R.find(e=>e.id===t);return s?.name}})();let sn=()=>{eM||en(!1)},sr=async e=>{e_(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tV(),en(!1)}finally{e_(!1)}},sd=e=>sr(v.map(t=>({connectionId:t.id,proxyPoolId:e}))),sc=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:v.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eU.includes(s)),onChange:()=>{var t;return t=e.id,void eR(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(J,{connection:e,proxyPools:R,isOAuth:tN,isFirst:0===t,isLast:t===v.length-1,onMoveUp:()=>si(t,t-1),onMoveDown:()=>si(t,t+1),onToggleActive:t=>sa(e.id,t),autoPing:W[g]&&"oauth"===e.authType?{on:!0===eB.connections[e.id],onToggle:t=>{var s;return s=e.id,void tX({...eB,connections:{...eB.connections,[s]:t}})},provider:g}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&S(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ed(e),ea(!0)},onDelete:()=>t9(e.id),oneByOneStatus:ts[e.id]||null})})]},e.id)})}),sm=R.filter(e=>!0===e.isActive),sp=(0,a.jsx)(c.aF,{isOpen:eo,onClose:sn,title:`Apply Proxy (${v.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=R.filter(e=>!0===e.isActive);return 0===e.length?void b.warning("No active proxy pools available."):sr(v.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eM||0===sm.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sd(null),disabled:eM,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),R.map(e=>(0,a.jsxs)("button",{onClick:()=>sd(e.id),disabled:eM||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eM&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(c.$n,{onClick:sn,variant:"ghost",fullWidth:!0,disabled:eM,children:"Cancel"})]})}),su=async e=>{if(!eO.has(e)){eP(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tM}/${e}`})}),s=await t.json();eT(t=>({...t,[e]:s.ok?"ok":"error"})),eA(s.ok?"":s.error||"Model not reachable")}catch{eT(t=>({...t,[e]:"error"})),eA("Network error")}finally{eP(t=>{let s=new Set(t);return s.delete(e),s})}}};if(A)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(c.Qv,{}),(0,a.jsx)(c.Qv,{})]});if(!tj)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sx=()=>tP&&tj.apiType?"responses"===tj.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tE?"/providers/anthropic-m.png":(0,d.HY)(tj.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tj.color}15`},children:eN||!sx()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tj.color},children:tj.textIcon||tj.id.slice(0,2).toUpperCase()}):(0,a.jsx)(r.default,{src:sx(),alt:tj.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tj.id),eC(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tj.name}),(tj.notice?.apiKeyUrl||tj.notice?.signupUrl||tj.website)&&(0,a.jsxs)("a",{href:tj.notice?.apiKeyUrl||tj.notice?.signupUrl||tj.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tj.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,a.jsx)(c.N5,{code:tj.notice?.inviteCode})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[v.length," connection",1===v.length?"":"s"]})]})]})]}),tj.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tj.deprecationNotice})]}),tj.notice?.text&&!tj.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tj.notice.text}),tj.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tj.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"}),(0,a.jsx)(c.N5,{code:tj.notice?.inviteCode})]}),tI&&E&&(0,a.jsx)(c.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tE?"Messages API":"responses"===E.apiType?"Responses API":"Chat Completions"," \xb7 ",(E.baseUrl||"").replace(/\/$/,""),"/",tE?"messages":"responses"===E.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Z(""),V(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>el(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e2({title:"Delete Compatible Node",message:`Delete this ${tE?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e2(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&f.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tS?(0,a.jsx)(c.gw,{providerId:g}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[v.length>0&&R.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>en(!0),children:"Apply Proxy"}),v.length>0&&(0,a.jsxs)(a.Fragment,{children:[eU.length>0&&(0,a.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eU.length;0!==e&&e2({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e2(null);let e=0,t=[...eU];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}S(e=>e.filter(e=>!t.includes(e.id))),eR([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eU.length,")"]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:t8,disabled:e6,children:e6?(0,N.Tl)("Testing Connection One-by-One..."):(0,N.Tl)("Test Connection One-by-One")}),e6&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{e6&&(to.current=!0,e9(!0))},disabled:e8,children:e8?(0,N.Tl)("Stopping..."):(0,N.Tl)("Stop")})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:(0,N.Tl)("Round Robin")}),(0,a.jsx)(c.lM,{checked:"round-robin"===eq,onChange:e=>{let t=e?"round-robin":null,s=e?eF||"1":eF;e&&!eF&&eK("1"),ez(t),tZ(t,s)}}),"round-robin"===eq&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:(0,N.Tl)("Sticky:")}),(0,a.jsx)("input",{type:"number",min:1,value:eF,onChange:e=>{var t;eK(t=e.target.value),tZ("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===v.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tN?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tU&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tR," or ",tD,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tU?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:th,children:tR}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tf,children:tD}),tT&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>tb("export"),children:(0,N.Tl)("Export")}),(0,a.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>tb("import"),children:(0,N.Tl)("Import")})]})]}):(0,a.jsxs)(a.Fragment,{children:[!tI&&"iflow"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),children:"Cookie"}),"codex"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),children:(0,N.Tl)("Bulk Add")}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tg,children:tI?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[ti&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:[(0,N.Tl)("Total:")," ",ti.total]}),(0,a.jsxs)("span",{children:[(0,N.Tl)("Completed:")," ",ti.completed]}),(0,a.jsxs)("span",{children:[(0,N.Tl)("Passed:")," ",ti.passed]}),(0,a.jsxs)("span",{children:[(0,N.Tl)("Failed:")," ",ti.failed]}),ti.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:(0,N.Tl)("Stopped")}),e6&&te&&(0,a.jsxs)("span",{children:[(0,N.Tl)("Running:")," ",v.find(e=>e.id===te)?.name||te]})]})}),v.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:so,onChange:()=>{so?eR([]):eR(v.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sc,!tI&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tU?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:th,className:"w-full sm:w-auto",children:tR}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tf,className:"w-full sm:w-auto",children:tD}),tT&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>tb("export"),className:"w-full sm:w-auto",children:(0,N.Tl)("Export")}),(0,a.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>tb("import"),className:"w-full sm:w-auto",children:(0,N.Tl)("Import")})]})]}):(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tg,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),t_&&(0,a.jsx)("select",{value:eL,onChange:e=>{var t;eW(t=e.target.value),tY(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:t_.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tI&&(e=ef&&!!tw,t=(ex||[]).filter(e=>!1!==e.enabled).length,s=(ex||[]).length-t,o=[...tA,...eY.filter(e=>!tA.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e0.includes(e)),u=e?s>0:e0.length>0,x=e?t>0:o.length>0,(0,a.jsxs)("div",{className:"flex gap-2",children:[u&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:()=>e?t7(!0):tW(),children:"Active All"}),x&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>e?t7(!1):tL(o),children:"Disable All"})]}))]}),!!e$&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:e$}),(()=>{let e,t,s;if(tI)return(0,a.jsx)(U,{providerStorageAlias:tM,providerDisplayAlias:tq,modelAliases:ec,customModels:ep,copied:tm,onCopy:tp,onSetAlias:t0,onDeleteAlias:t1,onAddCustomModel:e=>t5(e,"llm",tM),onDeleteCustomModel:e=>t2(e,"llm",tM),connections:v,isAnthropic:tE,jsonModels:tw?ex:null,importingJsonModels:td,onImportJsonModels:t3,onToggleJsonModel:t6,onBulkJsonModels:t7,useJsonCatalog:ef&&!!tw});let i=[...tA,...eY.filter(e=>!tA.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(e0),o=ef&&!!tw,n=o?(ex||[]).filter(e=>!1!==e.enabled):[],r=o?(ex||[]).filter(e=>!1===e.enabled):[],d=o?[]:i.filter(e=>!l.has(e.id)),c=o?[]:i.filter(e=>l.has(e.id)),m=$({customModels:ep,modelAliases:ec,providerAlias:tM,builtInModels:tA,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[m.filter(e=>!1!==e.enabled).map(e=>(0,a.jsx)(P,{model:{id:e.id,name:e.name},fullModel:`${tq}/${e.id}`,alias:e.alias,copied:tm,onCopy:tp,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?t2(e.id,"llm",tM):t1(e.alias)},testStatus:eS[e.id],onTest:v.length>0||tS?()=>su(e.id):void 0,isTesting:eO.has(e.id),isCustom:!0,isFree:!1,caps:{...y(`${g}/${e.id}`)||{},...void 0===e.vision?{}:{vision:e.vision},...void 0===e.reasoning?{}:{reasoning:e.reasoning},...void 0===e.contextWindow?{}:{contextWindow:e.contextWindow},...void 0===e.maxOutput?{}:{maxOutput:e.maxOutput}},thinkingSuffix:tJ(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>(0,a.jsx)(P,{model:{id:e.id,name:e.name},fullModel:`${tq}/${e.id}`,copied:tm,onCopy:tp,testStatus:eS[e.id],onTest:v.length>0||tS?()=>su(e.id):void 0,isTesting:eO.has(e.id),onDisable:()=>t6(e.id,!1),isFree:!1,caps:{...y(`${g}/${e.id}`)||{},...void 0===e.vision?{}:{vision:e.vision},...void 0===e.reasoning?{}:{reasoning:e.reasoning},...void 0===e.contextWindow?{}:{contextWindow:e.contextWindow},...void 0===e.maxOutput?{}:{maxOutput:e.maxOutput}},thinkingSuffix:tJ(e.id)},`json-${e.id}`)),d.map(e=>{let t=`${tM}/${e.id}`,s=`${g}/${e.id}`,i=Object.entries(ec).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(P,{model:e,fullModel:`${tq}/${e.id}`,alias:i,copied:tm,onCopy:tp,onSetAlias:t=>t0(e.id,t,tM),onDeleteAlias:()=>t1(i),testStatus:eS[e.id],onTest:v.length>0||tS?()=>su(e.id):void 0,isTesting:eO.has(e.id),isFree:e.isFree,onDisable:()=>tF(e.id),caps:y(`${g}/${e.id}`),thinkingSuffix:tJ(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>eI(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===g&&v.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t4,disabled:tn,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tn?{animation:"spin 1s linear infinite"}:void 0,children:tn?"progress_activity":"download"}),tn?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Qoder Models")]}),ef&&tw&&v.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t3,disabled:td,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:td?{animation:"spin 1s linear infinite"}:void 0,children:td?"progress_activity":"download"}),td?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Models")]}),eG.length>0&&(e=new Set([...Object.values(ec),...m.map(e=>e.fullModel)]),t=new Set(tA.map(e=>e.id)),0===(s=eG.filter(s=>!e.has(`${tM}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await t5(e.id,"llm",tM)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),(r.length>0||c.length>0)&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",r.length+c.length,"):"]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.map(e=>(0,a.jsxs)("button",{onClick:()=>t6(e.id,!0),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},`json-${e.id}`)),c.map(e=>(0,a.jsxs)("button",{onClick:()=>tK(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))]})]})]})})()]}),sp,"kiro"===g?(0,a.jsx)(c.Mh,{isOpen:M,providerInfo:tj,onSuccess:se,onClose:()=>F(!1)}):"cursor"===g?(0,a.jsx)(c.G9,{isOpen:M,onSuccess:se,onClose:()=>F(!1)}):"gitlab"===g?(0,a.jsx)(c.vj,{isOpen:M,providerInfo:tj,onSuccess:se,onClose:()=>F(!1)}):(0,a.jsx)(c.LF,{isOpen:M,provider:g,providerInfo:tj,onSuccess:se,onClose:()=>F(!1)}),"iflow"===g&&(0,a.jsx)(c.vE,{isOpen:B,onSuccess:()=>{tV(),H(!1)},onClose:()=>H(!1)}),(0,a.jsx)(_,{isOpen:G,provider:g,providerName:tj.name,isCompatible:tI,isAnthropic:tE,authType:tj?.authType,authHint:tj?.authHint,website:tj?.website,proxyPools:R,error:Q,existingNames:v.map(e=>e.name).filter(Boolean),onSave:st,onBulkDone:tV,onClose:()=>{Z(""),V(!1)}}),(0,a.jsx)(c.wI,{isOpen:es,connection:er,proxyPools:R,onSave:ss,onClose:()=>ea(!1)}),tI&&(0,a.jsx)(q,{isOpen:ei,node:E,onSave:tQ,onClose:()=>el(!1),isAnthropic:tE}),!tI&&(0,a.jsx)(z,{isOpen:eE,providerAlias:tM,providerDisplayAlias:tq,onSave:async e=>{await t5(e,"llm",tM),eI(!1)},onClose:()=>eI(!1)}),"codex"===g&&(0,a.jsx)(K,{isOpen:Y,onClose:()=>X(!1),onSuccess:tV}),"codebuddy-cn"===g&&(0,a.jsx)(L,{isOpen:ee,password:ew,onClose:()=>et(!1),onSuccess:tV}),(0,a.jsxs)(c.aF,{isOpen:ev.open,onClose:()=>ej({open:!1,action:null,value:""}),title:(0,N.Tl)("Confirm Password"),size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{variant:"ghost",onClick:()=>ej({open:!1,action:null,value:""}),children:(0,N.Tl)("Cancel")}),(0,a.jsx)(c.$n,{variant:"primary",onClick:ty,disabled:!ev.value,children:(0,N.Tl)("Confirm")})]}),children:[(0,a.jsx)("p",{className:"text-text-muted mb-3 text-sm",children:(0,N.Tl)("export"===ev.action?"Enter your current password to export CodeBuddy CN accounts.":"Enter your current password to import CodeBuddy CN accounts.")}),(0,a.jsx)(c.pd,{type:"password",autoFocus:!0,value:ev.value,onChange:e=>ej(t=>({...t,value:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&ev.value&&ty()},placeholder:(0,N.Tl)("Password")})]}),(0,a.jsx)(c.uo,{isOpen:e4,onClose:()=>e3(!1),onConfirm:()=>{(window.localStorage.setItem(tu,"true"),e3(!1),tN)?tx():tf()},title:"Risk Notice",message:tj?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(c.uo,{isOpen:!!e5,onClose:()=>e2(null),onConfirm:e5?.onConfirm,title:e5?.title||"Confirm",message:e5?.message,variant:"danger"})]})}},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},93578:(e,t,s)=>{Promise.resolve().then(s.bind(s,51745))}},e=>{e.O(0,[4614,5772,1321,5497,8441,3794,7358],()=>e(e.s=93578)),_N_E=e.O()}]);
14
+ ]`;function K({isOpen:e,onClose:t,onSuccess:s}){let[l,o]=(0,i.useState)(""),[n,r]=(0,i.useState)(!1),[d,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),x=()=>{n||(o(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,N.Tl)("No accounts found in input"));r(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,N.Tl)("Request failed"))}finally{r(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,N.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:F,value:l,onChange:e=>o(e.target.value),disabled:n}),d&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,N.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,N.Tl)("failed")}`:""]}),f.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:h,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,N.Tl)("Close")})]})]})})}function L({isOpen:e,onClose:t,onSuccess:s,password:l=""}){let[o,n]=(0,i.useState)(""),[r,d]=(0,i.useState)(""),[m,p]=(0,i.useState)(!1),[u,x]=(0,i.useState)(""),[h,f]=(0,i.useState)(null),g=(0,i.useRef)(null),y=()=>{m||(n(""),d(""),x(""),f(null),g.current&&(g.current.value=""),t())},b=async()=>{let e;x(""),f(null);let t=o.trim();if(!t)return;try{e=JSON.parse(t)}catch(e){x(`${(0,N.Tl)("Invalid JSON")}: ${e.message}`);return}let a=Array.isArray(e)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!a||0===a.length)return void x((0,N.Tl)("No accounts found in input"));p(!0);try{let e=await fetch("/api/oauth/codebuddy-cn/bulk-import",{method:"POST",headers:{"Content-Type":"application/json",...l?{"x-9r-password":l}:{}},body:JSON.stringify({accounts:a})}),t=await e.json();if(!e.ok)return void x(401===e.status?(0,N.Tl)("Invalid password"):t?.error||`Request failed: ${e.status}`);f(t),(t.imported>0||t.updated>0)&&"function"==typeof s&&s()}catch(e){x(e.message||(0,N.Tl)("Request failed"))}finally{p(!1)}},v=h?.results?.filter(e=>!e.ok)||[],j=h?.skipped??0;return(0,a.jsx)(c.aF,{isOpen:e,title:(0,N.Tl)("Import CodeBuddy CN Accounts"),onClose:y,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(c.$n,{variant:"secondary",fullWidth:!0,icon:"upload_file",onClick:()=>g.current?.click(),disabled:m,children:r||(0,N.Tl)("Choose JSON file...")}),(0,a.jsx)("input",{ref:g,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(!t)return;d(t.name),x(""),f(null);let s=new FileReader;s.onload=()=>n(String(s.result||"")),s.onerror=()=>x((0,N.Tl)("Failed to read file")),s.readAsText(t)}})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute -top-2 left-2 bg-sidebar px-1 text-[10px] text-text-muted",children:(0,N.Tl)("Or paste JSON")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 pt-4 text-sm font-mono resize-y min-h-[160px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:'[{ "access_token": "eyJ...", "refresh_token": "eyJ...", "nickname": "<nickname>" }]',value:o,onChange:e=>n(e.target.value),disabled:m})]}),u&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),h&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${h.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",h.imported," ",(0,N.Tl)("added"),", ",h.updated," ",(0,N.Tl)("updated"),j>0?`, ${j} ${(0,N.Tl)("skipped")}`:"",h.failed>0?`, ✗ ${h.failed} ${(0,N.Tl)("failed")}`:""]}),v.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:v.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:b,fullWidth:!0,disabled:m||!o.trim(),children:m?(0,N.Tl)("Importing..."):(0,N.Tl)("Import All")}),(0,a.jsx)(c.$n,{onClick:y,variant:"ghost",fullWidth:!0,disabled:m,children:(0,N.Tl)("Close")})]})]})})}K.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSuccess:O().func},L.propTypes={isOpen:O().bool.isRequired,onClose:O().func.isRequired,onSuccess:O().func,password:O().string};let W={claude:"claudeAutoPing",codex:"codexAutoPing"};function B(){let e,t,s,o,u,x,h=(0,l.useParams)(),f=(0,l.useRouter)(),g=h.id,{getCaps:y}=(0,k.y)(),b=(0,C.i)(),[v,S]=(0,i.useState)([]),[A,O]=(0,i.useState)(!0),[E,I]=(0,i.useState)(null),[R,D]=(0,i.useState)([]),[M,F]=(0,i.useState)(!1),[B,H]=(0,i.useState)(!1),[G,V]=(0,i.useState)(!1),[Q,Z]=(0,i.useState)(""),[Y,X]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,ea]=(0,i.useState)(!1),[ei,el]=(0,i.useState)(!1),[eo,en]=(0,i.useState)(!1),[er,ed]=(0,i.useState)(null),[ec,em]=(0,i.useState)({}),[ep,eu]=(0,i.useState)([]),[ex,eh]=(0,i.useState)(()=>{try{let e=window.localStorage.getItem(`jsonModels_${h.id}`);return e?JSON.parse(e):null}catch{return null}}),[ef,eg]=(0,i.useState)(!1),[ey,eb]=(0,i.useState)(!1),[ev,ej]=(0,i.useState)(!1),[ew,ek]=(0,i.useState)(!1),[eN,eC]=(0,i.useState)({open:!1,action:null,value:""}),[eS,eT]=(0,i.useState)(""),[e$,eA]=(0,i.useState)(!1),[eO,eP]=(0,i.useState)({}),[eE,eI]=(0,i.useState)(""),[eU,eR]=(0,i.useState)(()=>new Set),[eD,eJ]=(0,i.useState)(!1),[eM,e_]=(0,i.useState)([]),[eq,ez]=(0,i.useState)("__none__"),[eF,eK]=(0,i.useState)(!1),[eL,eW]=(0,i.useState)(null),[eB,eH]=(0,i.useState)(""),[eG,eV]=(0,i.useState)("auto"),[eQ,eZ]=(0,i.useState)({enabled:!1,connections:{}}),[eY,eX]=(0,i.useState)([]),[e0,e1]=(0,i.useState)([]),[e5,e2]=(0,i.useState)([]),[e4,e3]=(0,i.useState)([]),[e6,e7]=(0,i.useState)(null),[e8,e9]=(0,i.useState)(!1),[te,tt]=(0,i.useState)(!1),[ts,ta]=(0,i.useState)(!1),[ti,tl]=(0,i.useState)(null),[to,tn]=(0,i.useState)({}),[tr,td]=(0,i.useState)(null),tc=(0,i.useRef)(!1),[tm,tp]=(0,i.useState)(!1),[tu,tx]=(0,i.useState)(!1),{copied:th,copy:tf}=(0,w.C)(),tg="ag_risk_confirmed",ty=()=>{F(!0)},tb=()=>{"antigravity"===g&&"true"!==window.localStorage.getItem(tg)?e9(!0):tO?ty():(Z(""),V(!0))},tv=()=>{Z(""),V(!0)},tj=()=>{tO?tb():tv()},tw=async()=>{let{action:e,value:t}=eN;eC({open:!1,action:null,value:""}),"export"===e?await tN(t):"import"===e&&(eT(t),et(!0))},tk=e=>{eT(""),eC({open:!0,action:e,value:""})},tN=async e=>{try{let t=await fetch("/api/oauth/codebuddy-cn/export",{cache:"no-store",headers:e?{"x-9r-password":e}:{}}),s=await t.json();if(!t.ok){if(401===t.status)throw Error((0,N.Tl)("Invalid password"));throw Error(s?.error||`Request failed: ${t.status}`)}let a=Array.isArray(s)?s:[];if(0===a.length)return void b.warning((0,N.Tl)("No CodeBuddy CN connections to export"));let i=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),l=URL.createObjectURL(i),o=document.createElement("a");o.href=l,o.download=`codebuddy-cn-accounts-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(l),1e3),b.success(`${a.length} ${(0,N.Tl)("accounts exported")}`)}catch(e){b.error((0,N.Tl)("Export failed")+": "+e.message)}},tC=async()=>{ek(!0);try{let e=await fetch("/api/oauth/codebuddy-cn/checkin",{method:"POST",cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t?.error||`Request failed: ${e.status}`);let s=Array.isArray(t?.results)?t.results:[];if(0===s.length)return void b.warning((0,N.Tl)("No CodeBuddy CN connections to check in"));let a=s.filter(e=>"checked-in"===e.status).length,i=s.filter(e=>"already"===e.status).length,l=s.filter(e=>"failed"===e.status).length;0===l?b.success(`${(0,N.Tl)("Check-in complete")}: ${a} ${(0,N.Tl)("checked-in")}, ${i} ${(0,N.Tl)("already checked in")}`):b.error(`${(0,N.Tl)("Check-in complete with errors")}: ${l} ${(0,N.Tl)("failed")}`)}catch(e){b.error((0,N.Tl)("Check-in failed")+": "+e.message)}finally{ek(!1)}},tS=()=>(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,a.jsx)(c.$n,{size:"sm",icon:"calendar_today",onClick:tC,disabled:ew,className:"w-full sm:w-auto",title:(0,N.Tl)("CodeBuddy CN auto-checks in daily (00:00–06:00 local time)"),children:ew?(0,N.Tl)("Checking in..."):(0,N.Tl)("Check in now")})}),tT=E?{id:E.id,name:E.name||("anthropic-compatible"===E.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===E.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===E.type?"AC":"OC",apiType:E.apiType,baseUrl:E.baseUrl,type:E.type,modelsJsonUrl:E.modelsJsonUrl||void 0,fallbackModelsJsonUrl:E.fallbackModelsJsonUrl||void 0}:m.zN[g]||m.fg[g]||m.IS[g]||m.nJ[g]||m.br[g],t$=tT?.modelsJsonUrl,tA=tT?.authModes||[],tO=!!m.zN[g]||!!m.IS[g]||tA.includes("oauth"),tP=!!m.fg[g]||tA.includes("apikey"),tE=!!m.IS[g]?.noAuth,tI="codebuddy-cn"===g,tU=tI&&ey,tR=tI&&ev,tD=(0,p.KC)(g),tJ="cursor"===g&&e0.length>0?e0:tD,tM=(0,m.wG)(g),t_=(0,m.mq)(g),tq=(0,m.gb)(g),tz=t_||tq,tF=!tz&&tO&&tP,tK="xai"===g?"Grok Build OAuth":"grok-cli"===g?"Grok CLI Device Login":"kimi"===g?"Kimi Coding OAuth":"OAuth",tL="xai"===g?"xAI API Key":"kimi"===g?"Kimi API Key":"qoder"===g?"PAT":"API Key",tW=e=>{if(!eG||"auto"===eG)return null;let t=j(g,e);return t&&t.includes(eG)?eG:null},tB=tz?g:tM,tH=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let a=j(g,s);a&&a.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of tJ)s(e.id);for(let e of e5)s(e.id);for(let e of ep)e.providerAlias===tB&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),tG=tz?E?.prefix||g:tM,tV=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tB)}`,{cache:"no-store"}),t=await e.json();e.ok&&e3(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tB]),tQ=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tB,ids:[e]})})).ok&&await tV()}catch(e){console.log("Error disabling model:",e)}},tZ=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tB)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tV()}catch(e){console.log("Error enabling model:",e)}},tY=async e=>{e.length&&e7({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{e7(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tB,ids:e})})).ok&&await tV()}catch(e){console.log("Error disabling all models:",e)}}})},tX=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tB)}`,{method:"DELETE"})).ok&&await tV()}catch(e){console.log("Error enabling all models:",e)}},t0=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&em(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),t1=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eu(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]),t5=(0,i.useCallback)(async()=>{if(t$)try{let e=await fetch(`/api/providers/${g}/json-models`,{cache:"no-store"}),t=await e.json();if(e.ok){eh(t.models||[]);try{window.localStorage.setItem(`jsonModels_${g}`,JSON.stringify(t.models||[]))}catch{}}}catch(e){console.log("Error fetching provider JSON models:",e)}},[g,t$]);(0,i.useEffect)(()=>{"kilocode"===g&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e2(e.models)}).catch(()=>{})},[g]);let t2=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),o=await s.json(),n=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===g);S(e)}s.ok&&D(o.proxyPools||[]);let r=(n.providerStrategies||{})[g]||{};eW(r.fallbackStrategy||null),eH(null!=r.stickyRoundRobinLimit?String(r.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[g]||{};eV(d.mode||"auto");let c=W[g],m=c&&n[c]||{};if(eZ({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===g)||null;if(!e&&tz)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===g)||null))break}I(e)}}catch(e){console.log("Error fetching connections:",e)}finally{O(!1)}},[g,tz]),t4=async e=>{try{let t=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(I(s.node),await t2(),el(!1))}catch(e){console.log("Error updating provider node:",e)}},t3=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[g]:l[g]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},t6=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[g]={mode:e}:delete s[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},t7=async e=>{let t=W[g];if(t){eZ(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{t2(),t0(),t1(),tV(),t5()},[t2,t0,t1,tV,t5]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(e=>{"boolean"==typeof e.modelJsonImport&&eg(e.modelJsonImport),"boolean"==typeof e.codeBuddyOAuthImport&&eb(e.codeBuddyOAuthImport),"boolean"==typeof e.codeBuddyCheckin&&ej(e.codeBuddyCheckin)}).catch(e=>console.log("Error reading settings:",e))},[]),(0,i.useEffect)(()=>{if("cursor"!==g)return void e1([]);let e=v.find(e=>!1!==e.isActive);if(!e?.id)return void e1([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:s})=>{!t&&e&&Array.isArray(s.models)&&s.models.length>0&&e1(s.models)}).catch(()=>{}),()=>{t=!0}},[g,v]),(0,i.useEffect)(()=>{let e=(m.zN[g]||m.fg[g]||m.IS[g]||m.nJ[g])?.modelsFetcher;e&&T(e).then(eX)},[g]);let t8=async(e,t,s=tM)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await t0();else{let t=await e.json();b.error(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},t9=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await t0()}catch(e){console.log("Error deleting alias:",e)}},se=async(e,t="llm",s=tB,a={},i)=>{try{let l={providerAlias:s,id:e,type:t};if(void 0!==i&&(l.enabled=i),a&&"object"==typeof a)for(let e of["vision","reasoning","contextWindow","maxOutput","thinkingFormat"])void 0!==a[e]&&(l[e]=a[e]);let o=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(o.ok)await t1(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await o.json();b.error(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},st=async(e,t="llm",s=tB)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await t1(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},ss=async()=>{if(tm)return;let e=v.find(e=>!1!==e.isActive);if(!e)return void b.warning((0,N.Tl)("Please add an active Qoder connection first"));tp(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void b.error(s.error||(0,N.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void b.warning((0,N.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");ep.some(e=>e.providerAlias===tB&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tB}/${s}`)||(await se(s,"llm",tB),i+=1)}0===i?b.warning((0,N.Tl)("All models already exist, no new models added")):b.success((0,N.Tl)("Successfully added")+` ${i} `+(0,N.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),b.error((0,N.Tl)("Error fetching models")+": "+e.message)}finally{tp(!1)}},sa=async()=>{if(!tu){tx(!0);try{let e=await fetch(`/api/providers/${g}/json-models`,{method:"POST"}),t=await e.json();if(!e.ok)return void b.error(t.error||(0,N.Tl)("Failed to fetch models"));await t5();let s=t.total||t.models?.length||0;b.success((0,N.Tl)("Sync complete")+` (${s} ${(0,N.Tl)("models")})`)}catch(e){console.log("Error importing models from JSON:",e),b.error((0,N.Tl)("Error fetching models")+": "+e.message)}finally{tx(!1)}}},si=async(e,t)=>{try{(await fetch(`/api/providers/${g}/json-models`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({modelId:e,enabled:t})})).ok&&await t5()}catch(e){console.log("Error toggling JSON model:",e)}},sl=async e=>{try{(await fetch(`/api/providers/${g}/json-models`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,enabled:e})})).ok&&await t5()}catch(e){console.log("Error bulk-toggling JSON models:",e)}},so=async()=>{if(te||0===v.length)return;let e=Object.fromEntries(v.map(e=>[e.id,{state:"queued",error:null}]));tc.current=!1,tt(!0),ta(!1),tl(null),tn(e),td({total:v.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<v.length;e+=1){if(tc.current){td({total:v.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=v[e];tl(a.id),tn(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,tn(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,tn(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}td({total:v.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<v.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{tl(null),tt(!1),ta(!1),tc.current=!1}},sn=async e=>{e7({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{e7(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&S(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},sr=()=>{t2(),F(!1)},sd=async e=>{Z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await t2(),V(!1);return}Z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Z("Failed to save connection")}},sc=async e=>{try{(await fetch(`/api/providers/${er.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await t2(),ea(!1))}catch(e){console.log("Error updating connection:",e)}},sm=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&S(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},sp=async(e,t)=>{let s=[...v];[s[e],s[t]]=[s[t],s[e]],S(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await t2()}},su=v.filter(e=>eM.includes(e.id)),sx=v.length>0&&eM.length===v.length;(0,i.useEffect)(()=>{e_(e=>e.filter(e=>v.some(t=>t.id===e)))},[v]),(()=>{if(0===su.length)return;let e=new Set(su.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=R.find(e=>e.id===t);return s?.name}})();let sh=()=>{eF||en(!1)},sf=async e=>{eK(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await t2(),en(!1)}finally{eK(!1)}},sg=e=>sf(v.map(t=>({connectionId:t.id,proxyPoolId:e}))),sy=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:v.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,eM.includes(s)),onChange:()=>{var t;return t=e.id,void e_(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(J,{connection:e,proxyPools:R,isOAuth:tO,isFirst:0===t,isLast:t===v.length-1,onMoveUp:()=>sp(t,t-1),onMoveDown:()=>sp(t,t+1),onToggleActive:t=>sm(e.id,t),autoPing:W[g]&&"oauth"===e.authType?{on:!0===eQ.connections[e.id],onToggle:t=>{var s;return s=e.id,void t7({...eQ,connections:{...eQ.connections,[s]:t}})},provider:g}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&S(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ed(e),ea(!0)},onDelete:()=>sn(e.id),oneByOneStatus:to[e.id]||null})})]},e.id)})}),sb=R.filter(e=>!0===e.isActive),sv=(0,a.jsx)(c.aF,{isOpen:eo,onClose:sh,title:`Apply Proxy (${v.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=R.filter(e=>!0===e.isActive);return 0===e.length?void b.warning("No active proxy pools available."):sf(v.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:eF||0===sb.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>sg(null),disabled:eF,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),R.map(e=>(0,a.jsxs)("button",{onClick:()=>sg(e.id),disabled:eF||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),eF&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(c.$n,{onClick:sh,variant:"ghost",fullWidth:!0,disabled:eF,children:"Cancel"})]})}),sj=async e=>{if(!eU.has(e)){eR(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tB}/${e}`})}),s=await t.json();eP(t=>({...t,[e]:s.ok?"ok":"error"})),eI(s.ok?"":s.error||"Model not reachable")}catch{eP(t=>({...t,[e]:"error"})),eI("Network error")}finally{eR(t=>{let s=new Set(t);return s.delete(e),s})}}};if(A)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(c.Qv,{}),(0,a.jsx)(c.Qv,{})]});if(!tT)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let sw=()=>t_&&tT.apiType?"responses"===tT.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tq?"/providers/anthropic-m.png":(0,d.HY)(tT.id);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tT.color}15`},children:e$||!sw()?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:tT.color},children:tT.textIcon||tT.id.slice(0,2).toUpperCase()}):(0,a.jsx)(r.default,{src:sw(),alt:tT.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tT.id),eA(!0)},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tT.name}),(tT.notice?.apiKeyUrl||tT.notice?.signupUrl||tT.website)&&(0,a.jsxs)("a",{href:tT.notice?.apiKeyUrl||tT.notice?.signupUrl||tT.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tT.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]}),(0,a.jsx)(c.N5,{code:tT.notice?.inviteCode})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[v.length," connection",1===v.length?"":"s"]})]})]})]}),tT.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tT.deprecationNotice})]}),tT.notice?.text&&!tT.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tT.notice.text}),tT.notice.apiKeyUrl&&(0,a.jsx)("a",{href:tT.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"}),(0,a.jsx)(c.N5,{code:tT.notice?.inviteCode})]}),tz&&E&&(0,a.jsx)(c.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tq?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tq?"Messages API":"responses"===E.apiType?"Responses API":"Chat Completions"," \xb7 ",(E.baseUrl||"").replace(/\/$/,""),"/",tq?"messages":"responses"===E.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Z(""),V(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>el(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{e7({title:"Delete Compatible Node",message:`Delete this ${tq?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{e7(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&f.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tE?(0,a.jsx)(c.gw,{providerId:g}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[v.length>0&&R.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>en(!0),children:"Apply Proxy"}),v.length>0&&(0,a.jsxs)(a.Fragment,{children:[eM.length>0&&(0,a.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eM.length;0!==e&&e7({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{e7(null);let e=0,t=[...eM];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}S(e=>e.filter(e=>!t.includes(e.id))),e_([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eM.length,")"]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:so,disabled:te,children:te?(0,N.Tl)("Testing Connection One-by-One..."):(0,N.Tl)("Test Connection One-by-One")}),te&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{te&&(tc.current=!0,ta(!0))},disabled:ts,children:ts?(0,N.Tl)("Stopping..."):(0,N.Tl)("Stop")})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:(0,N.Tl)("Round Robin")}),(0,a.jsx)(c.lM,{checked:"round-robin"===eL,onChange:e=>{let t=e?"round-robin":null,s=e?eB||"1":eB;e&&!eB&&eH("1"),eW(t),t3(t,s)}}),"round-robin"===eL&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:(0,N.Tl)("Sticky:")}),(0,a.jsx)("input",{type:"number",min:1,value:eB,onChange:e=>{var t;eH(t=e.target.value),t3("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===v.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tO?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tF&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tK," or ",tL,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tF?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tb,children:tK}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tv,children:tL}),tU&&!tR&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>tk("export"),children:(0,N.Tl)("Export")}),(0,a.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>tk("import"),children:(0,N.Tl)("Import")})]}),tR&&tS()]}):(0,a.jsxs)(a.Fragment,{children:[!tz&&"iflow"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),children:"Cookie"}),"codex"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),children:(0,N.Tl)("Bulk Add")}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tj,children:tz?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[tr&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:[(0,N.Tl)("Total:")," ",tr.total]}),(0,a.jsxs)("span",{children:[(0,N.Tl)("Completed:")," ",tr.completed]}),(0,a.jsxs)("span",{children:[(0,N.Tl)("Passed:")," ",tr.passed]}),(0,a.jsxs)("span",{children:[(0,N.Tl)("Failed:")," ",tr.failed]}),tr.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:(0,N.Tl)("Stopped")}),te&&ti&&(0,a.jsxs)("span",{children:[(0,N.Tl)("Running:")," ",v.find(e=>e.id===ti)?.name||ti]})]})}),v.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:sx,onChange:()=>{sx?e_([]):e_(v.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),sy,!tz&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>H(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,a.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>X(!0),title:(0,N.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,N.Tl)("Bulk Add")}),tF?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:tb,className:"w-full sm:w-auto",children:tK}),(0,a.jsx)(c.$n,{size:"sm",icon:"key",onClick:tv,className:"w-full sm:w-auto",children:tL}),tU&&!tR&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{size:"sm",icon:"file_download",variant:"secondary",onClick:()=>tk("export"),className:"w-full sm:w-auto",children:(0,N.Tl)("Export")}),(0,a.jsx)(c.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>tk("import"),className:"w-full sm:w-auto",children:(0,N.Tl)("Import")})]}),tR&&tS()]}):(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:tj,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tH&&(0,a.jsx)("select",{value:eG,onChange:e=>{var t;eV(t=e.target.value),t6(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tH.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tz&&(e=ef&&!!t$,t=(ex||[]).filter(e=>!1!==e.enabled).length,s=(ex||[]).length-t,o=[...tJ,...e5.filter(e=>!tJ.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!e4.includes(e)),u=e?s>0:e4.length>0,x=e?t>0:o.length>0,(0,a.jsxs)("div",{className:"flex gap-2",children:[u&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:()=>e?sl(!0):tX(),children:"Active All"}),x&&(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>e?sl(!1):tY(o),children:"Disable All"})]}))]}),!!eE&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eE}),(()=>{let e,t,s;if(tz)return(0,a.jsx)(U,{providerStorageAlias:tB,providerDisplayAlias:tG,modelAliases:ec,customModels:ep,copied:th,onCopy:tf,onSetAlias:t8,onDeleteAlias:t9,onAddCustomModel:e=>se(e,"llm",tB),onDeleteCustomModel:e=>st(e,"llm",tB),connections:v,isAnthropic:tq,jsonModels:t$?ex:null,importingJsonModels:tu,onImportJsonModels:sa,onToggleJsonModel:si,onBulkJsonModels:sl,useJsonCatalog:ef&&!!t$});let i=[...tJ,...e5.filter(e=>!tJ.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(e4),o=ef&&!!t$,n=o?(ex||[]).filter(e=>!1!==e.enabled):[],r=o?(ex||[]).filter(e=>!1===e.enabled):[],d=o?[]:i.filter(e=>!l.has(e.id)),c=o?[]:i.filter(e=>l.has(e.id)),m=$({customModels:ep,modelAliases:ec,providerAlias:tB,builtInModels:tJ,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[m.filter(e=>!1!==e.enabled).map(e=>(0,a.jsx)(P,{model:{id:e.id,name:e.name},fullModel:`${tG}/${e.id}`,alias:e.alias,copied:th,onCopy:tf,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?st(e.id,"llm",tB):t9(e.alias)},testStatus:eO[e.id],onTest:v.length>0||tE?()=>sj(e.id):void 0,isTesting:eU.has(e.id),isCustom:!0,isFree:!1,caps:{...y(`${g}/${e.id}`)||{},...void 0===e.vision?{}:{vision:e.vision},...void 0===e.reasoning?{}:{reasoning:e.reasoning},...void 0===e.contextWindow?{}:{contextWindow:e.contextWindow},...void 0===e.maxOutput?{}:{maxOutput:e.maxOutput}},thinkingSuffix:tW(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>(0,a.jsx)(P,{model:{id:e.id,name:e.name},fullModel:`${tG}/${e.id}`,copied:th,onCopy:tf,testStatus:eO[e.id],onTest:v.length>0||tE?()=>sj(e.id):void 0,isTesting:eU.has(e.id),onDisable:()=>si(e.id,!1),isFree:!1,caps:{...y(`${g}/${e.id}`)||{},...void 0===e.vision?{}:{vision:e.vision},...void 0===e.reasoning?{}:{reasoning:e.reasoning},...void 0===e.contextWindow?{}:{contextWindow:e.contextWindow},...void 0===e.maxOutput?{}:{maxOutput:e.maxOutput}},thinkingSuffix:tW(e.id)},`json-${e.id}`)),d.map(e=>{let t=`${tB}/${e.id}`,s=`${g}/${e.id}`,i=Object.entries(ec).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(P,{model:e,fullModel:`${tG}/${e.id}`,alias:i,copied:th,onCopy:tf,onSetAlias:t=>t8(e.id,t,tB),onDeleteAlias:()=>t9(i),testStatus:eO[e.id],onTest:v.length>0||tE?()=>sj(e.id):void 0,isTesting:eU.has(e.id),isFree:e.isFree,onDisable:()=>tQ(e.id),caps:y(`${g}/${e.id}`),thinkingSuffix:tW(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>eJ(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===g&&v.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:ss,disabled:tm,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tm?{animation:"spin 1s linear infinite"}:void 0,children:tm?"progress_activity":"download"}),tm?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Qoder Models")]}),ef&&t$&&v.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:sa,disabled:tu,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:tu?{animation:"spin 1s linear infinite"}:void 0,children:tu?"progress_activity":"download"}),tu?(0,N.Tl)("Fetching..."):(0,N.Tl)("Fetch Models")]}),eY.length>0&&(e=new Set([...Object.values(ec),...m.map(e=>e.fullModel)]),t=new Set(tJ.map(e=>e.id)),0===(s=eY.filter(s=>!e.has(`${tB}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await se(e.id,"llm",tB)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),(r.length>0||c.length>0)&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",r.length+c.length,"):"]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.map(e=>(0,a.jsxs)("button",{onClick:()=>si(e.id,!0),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},`json-${e.id}`)),c.map(e=>(0,a.jsxs)("button",{onClick:()=>tZ(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))]})]})]})})()]}),sv,"kiro"===g?(0,a.jsx)(c.Mh,{isOpen:M,providerInfo:tT,onSuccess:sr,onClose:()=>F(!1)}):"cursor"===g?(0,a.jsx)(c.G9,{isOpen:M,onSuccess:sr,onClose:()=>F(!1)}):"gitlab"===g?(0,a.jsx)(c.vj,{isOpen:M,providerInfo:tT,onSuccess:sr,onClose:()=>F(!1)}):(0,a.jsx)(c.LF,{isOpen:M,provider:g,providerInfo:tT,onSuccess:sr,onClose:()=>F(!1)}),"iflow"===g&&(0,a.jsx)(c.vE,{isOpen:B,onSuccess:()=>{t2(),H(!1)},onClose:()=>H(!1)}),(0,a.jsx)(_,{isOpen:G,provider:g,providerName:tT.name,isCompatible:tz,isAnthropic:tq,authType:tT?.authType,authHint:tT?.authHint,website:tT?.website,proxyPools:R,error:Q,existingNames:v.map(e=>e.name).filter(Boolean),onSave:sd,onBulkDone:t2,onClose:()=>{Z(""),V(!1)}}),(0,a.jsx)(c.wI,{isOpen:es,connection:er,proxyPools:R,onSave:sc,onClose:()=>ea(!1)}),tz&&(0,a.jsx)(q,{isOpen:ei,node:E,onSave:t4,onClose:()=>el(!1),isAnthropic:tq}),!tz&&(0,a.jsx)(z,{isOpen:eD,providerAlias:tB,providerDisplayAlias:tG,onSave:async e=>{await se(e,"llm",tB),eJ(!1)},onClose:()=>eJ(!1)}),"codex"===g&&(0,a.jsx)(K,{isOpen:Y,onClose:()=>X(!1),onSuccess:t2}),"codebuddy-cn"===g&&(0,a.jsx)(L,{isOpen:ee,password:eS,onClose:()=>et(!1),onSuccess:t2}),(0,a.jsxs)(c.aF,{isOpen:eN.open,onClose:()=>eC({open:!1,action:null,value:""}),title:(0,N.Tl)("Confirm Password"),size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{variant:"ghost",onClick:()=>eC({open:!1,action:null,value:""}),children:(0,N.Tl)("Cancel")}),(0,a.jsx)(c.$n,{variant:"primary",onClick:tw,disabled:!eN.value,children:(0,N.Tl)("Confirm")})]}),children:[(0,a.jsx)("p",{className:"text-text-muted mb-3 text-sm",children:(0,N.Tl)("export"===eN.action?"Enter your current password to export CodeBuddy CN accounts.":"Enter your current password to import CodeBuddy CN accounts.")}),(0,a.jsx)(c.pd,{type:"password",autoFocus:!0,value:eN.value,onChange:e=>eC(t=>({...t,value:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&eN.value&&tw()},placeholder:(0,N.Tl)("Password")})]}),(0,a.jsx)(c.uo,{isOpen:e8,onClose:()=>e9(!1),onConfirm:()=>{(window.localStorage.setItem(tg,"true"),e9(!1),tO)?ty():tv()},title:"Risk Notice",message:tT?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(c.uo,{isOpen:!!e6,onClose:()=>e7(null),onConfirm:e6?.onConfirm,title:e6?.title||"Confirm",message:e6?.message,variant:"danger"})]})}},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},93578:(e,t,s)=>{Promise.resolve().then(s.bind(s,51745))}},e=>{e.O(0,[4614,5772,1321,5497,8441,3794,7358],()=>e(e.s=93578)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{26048:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>O});var a=r(95155),i=r(12115),s=r(57250),n=r(45564);let l="quotaCacheData",o="quotaAutoRefresh",d=[10,20,50,100],c=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function x(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function m(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function b(e,t){return await e(t)}function g(){try{let e=window.localStorage.getItem(l);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function f(e,t){try{let r=g();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(l,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function y(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function v(e,t,r){let a=t?.[e]?.hidden;if(Array.isArray(a))return new Set(a.map(String));if(r&&r!==e){let e=t?.[r]?.hidden;if(Array.isArray(e))return new Set(e.map(String))}return new Set}var k=r(73006);function w({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:s=!1,onHideQuota:n=null}){let[l,o]=(0,i.useState)(1),d=(0,i.useMemo)(()=>e.map((e,t)=>{var r,a,i;return{...e,index:t,remaining:(r=e,r?.remaining!==void 0?Math.max(0,Math.round(r.remaining)):r?.remainingPercentage!==void 0?Math.round(r.remainingPercentage):(a=r?.used,(i=r?.total)&&0!==i?!a||a<0?100:a>=i?0:Math.round((i-a)/i*100):0))}}),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,r]),u=Math.max(1,Math.ceil(c.length/10));if((0,i.useEffect)(()=>{o(1)},[r,e]),(0,i.useEffect)(()=>{o(e=>Math.min(e,u))},[u]),!e||0===e.length)return null;let x=c.slice((l-1)*10,10*l),m=0===c.length?0:(l-1)*10+1,h=Math.min(10*l,c.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",y="function"==typeof n;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"space-y-px",children:x.map(e=>{var r;let i=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},s=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),o=!1!==e.recurring?`in ${s}`:`expires in ${s}`;return(0,a.jsxs)("div",{className:`flex items-center gap-2 border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${p}`,children:[(0,a.jsxs)("div",{className:"flex w-36 min-w-0 items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:i.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:(0,k.Tl)(e.name)})]}),(0,a.jsxs)("div",{className:`min-w-0 flex-1 ${t?"space-y-1":"space-y-1.5"}`,children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${i.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${i.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between gap-1 min-w-0 ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsxs)("span",{className:"text-text-muted truncate",title:`${e.used.toLocaleString()} / ${e.total>0?e.total.toLocaleString():"∞"}`,children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,a.jsxs)("span",{className:`font-medium ${i.text} shrink-0`,children:[e.remaining,"%"]})]})]}),(0,a.jsx)("div",{className:"min-w-0 shrink",children:"-"!==s||l?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:l||"",children:"-"!==s?o:l}):(0,a.jsxs)("div",{className:"min-w-0 space-y-0.5",children:["-"!==s&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,children:o}),l&&(0,a.jsx)("div",{className:`${f} text-text-muted truncate`,children:l})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),y&&(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})]},`${e.name}-${e.index}`)})}),u>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",m,"-",h," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(u,e+1)),disabled:l===u,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var j=r(98542),N=r(97677),C=r(84588),S=r(35497),A=r(88105),$=r(11059);let q={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},E={claude:"claudeAutoPing",codex:"codexAutoPing"},P={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota."};function T(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function D(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function M(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function O(){let{copied:e,copy:t}=(0,$.C)(),[r,O]=(0,i.useState)([]),[I,F]=(0,i.useState)({}),[_,L]=(0,i.useState)({}),[z,R]=(0,i.useState)({}),[U,H]=(0,i.useState)(!0),[J,K]=(0,i.useState)({claude:{},codex:{}}),[G,V]=(0,i.useState)(null),[B,W]=(0,i.useState)(!1),[Q,Y]=(0,i.useState)(!1),[X,Z]=(0,i.useState)(60),[ee,et]=(0,i.useState)(!0),[er,ea]=(0,i.useState)(null),[ei,es]=(0,i.useState)(null),[en,el]=(0,i.useState)(null),[eo,ed]=(0,i.useState)(null),[ec,eu]=(0,i.useState)(null),[ex,em]=(0,i.useState)(!1),[eh,ep]=(0,i.useState)(null),[eb,eg]=(0,i.useState)([]),[ef,ey]=(0,i.useState)(()=>window.localStorage.getItem("quotaProviderFilter")||"all"),[ev,ek]=(0,i.useState)([]),[ew,ej]=(0,i.useState)(()=>window.localStorage.getItem("quotaAccountFilter")||"all");(0,i.useEffect)(()=>{window.localStorage.setItem("quotaProviderFilter",ef)},[ef]),(0,i.useEffect)(()=>{window.localStorage.setItem("quotaAccountFilter",ew)},[ew]);let[eN,eC]=(0,i.useState)("default"),[eS,eA]=(0,i.useState)({}),[e$,eq]=(0,i.useState)(!1),[eE,eP]=(0,i.useState)(!1),[eT,eD]=(0,i.useState)(!1),[eM,eO]=(0,i.useState)(1),[eI,eF]=(0,i.useState)(20),[e_,eL]=(0,i.useState)(String(20)),[ez,eR]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eU,eH]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eJ=(0,i.useRef)(null),eK=(0,i.useRef)(null),eG=(0,i.useRef)(0),eV=(0,i.useCallback)(async(e=eM)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eI),accountStatus:ew,sort:"priority"});"all"!==ef&&a.set("provider",ef);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eI,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return O(n),ek(s.providerOptions||[]),eR(l),eH(o),eO((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),O([]),ek([]),eR({page:1,pageSize:eI,total:0,totalPages:1}),eH({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ew,e$,eM,eI,ef]),eB=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{L(t=>({...t,[e]:!0})),R(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};F(t=>({...t,[e]:a})),f(e,a);return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let l={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":case"ollama":case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};F(t=>({...t,[e]:l})),f(e,l)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),R(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{L(t=>({...t,[e]:!1}))}},[]),eW=(0,i.useCallback)(async(e,t)=>{await eB(e,t,{force:!0}),V(new Date)},[eB]),eQ=(0,i.useCallback)(async(e,t)=>{if("codex"===t&&!en){el(e),R(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eB(e,t),V(new Date)}catch(t){R(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{el(null)}}},[eB,en]),eY=(0,i.useCallback)(async e=>{eu({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eu({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eu({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eX=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){ea(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){F(t=>{let r={...t};return delete r[e],r}),L(t=>{let r={...t};return delete r[e],r}),R(t=>{let r={...t};return delete r[e],r});try{let t=g();t[e]&&(delete t[e],window.localStorage.setItem(l,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await b(eV,eM)}}catch(e){console.error("Error deleting connection:",e)}finally{ea(null)}}},[eV,eM]),eZ=(0,i.useCallback)(async(e,t)=>{es(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(F(e=>({...e})),await b(eV,eM))}catch(e){console.error("Error updating connection status:",e)}finally{es(null)}},[eV,eM]),e0=(0,i.useCallback)(async e=>{if(!eh?.id)return;let t=eh.id,r=eh.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eV(),em(!1),ep(null),A.wb.includes(r)&&await eB(t,r))}catch(e){console.error("Error saving connection:",e)}},[eh,eV,eB]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&eg(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e1=(0,i.useCallback)(async(e=!1)=>{if(Q)return;Y(!0),Z(60);let t=eG.current+=1,r=Math.round(10);try{let a=await eV(eM);L(h(a)),R(e=>p(e,a)),F(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eB(e.id,e.provider))),V(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{Y(!1)}},[Q,eV,eB,eM]);(0,i.useEffect)(()=>{(async()=>{et(!0);let e=await eV(eM);et(!1),L(h(e)),R(t=>p(t,e)),F(t=>p(t,e)),await Promise.all(e.map(e=>eB(e.id,e.provider))),V(new Date)})()},[eV,eB,eM]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(o);H(null===e||"true"===e),W(!0)},[]),(0,i.useEffect)(()=>{B&&window.localStorage.setItem(o,String(U))},[U,B]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{K({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}}),eA(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e5=(0,i.useCallback)(async(e,t,r)=>{let a=E[t];if(!a)return;let i={...J[t]||{},[e]:r};K({...J,[t]:i});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:i};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{K(J)}},[J]),e2=(0,i.useCallback)(async(e,t)=>{eA(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eA(t)}},[]),e3=(0,i.useCallback)((e,t)=>{let r=y(t);if(!e||!r)return;let a=eS[e]||{},i=new Set(a.hidden||[]);i.add(r),e2({...eS,[e]:{...a,hidden:[...i]}},eS)},[eS,e2]),e4=(0,i.useCallback)((e,t)=>{let r=y(t);if(!e||!r)return;let a=eS[e]||{},i=new Set(a.hidden||[]);i.delete(r),e2({...eS,[e]:{...a,hidden:[...i]}},eS)},[eS,e2]);(0,i.useEffect)(()=>{if(!B||!U){eJ.current&&(clearInterval(eJ.current),eJ.current=null),eK.current&&(clearInterval(eK.current),eK.current=null);return}return eJ.current=setInterval(()=>{e1()},6e4),eK.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3),()=>{eJ.current&&clearInterval(eJ.current),eK.current&&clearInterval(eK.current)}},[U,e1,B]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?(eJ.current&&(clearInterval(eJ.current),eJ.current=null),eK.current&&(clearInterval(eK.current),eK.current=null)):U&&B&&(eJ.current=setInterval(()=>e1(),6e4),eK.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[U,e1,B]);let e8=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=m(e,t),s=m(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(x(e)||"").localeCompare(x(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(r,I,e$,ef,eN),[r,I,e$,ef,eN]),e6=(0,i.useCallback)(()=>{let e={...eS},t=!1;for(let r of e8){let a=e[r.id]||{},i=[...function(e){let t=new Set;if(!Array.isArray(e))return t;for(let r of e){let e=y(r);if(!e||!0===r.unlimited)continue;let a=r.total||0;(a<=0||(r.used||0)>=a)&&t.add(e)}return t}(I[r.id]?.quotas||[])],s=a.hidden||[];(i.length!==s.length||i.some((e,t)=>e!==s[t]))&&(e[r.id]={...a,hidden:i},t=!0)}t&&e2(e,eS)},[eS,e2,e8,I]),e9=(0,i.useCallback)(()=>{let e={...eS},t=!1;for(let r of e8)e[r.id]?.hidden?.length&&(e[r.id]={...e[r.id],hidden:[]},t=!0);t&&e2(e,eS)},[eS,e2,e8]),e7=e=>{let t=I[e.id]?.quotas;if(!t?.length)return!1;let r=t.filter(e=>!0!==e.unlimited);return 0!==r.length&&r.every(e=>{let t=e.total||0;return t<=0||(e.used||0)>=t})},te=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eT){eD(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await b(eV,eM)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eD(!1)}}},[eT,eV,eM]),tt="all"===ef?"All providers":ef,tr=eU.eligibleConnections>0,ta=e8.length>0,ti=eU.eligibleConnections?eU.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===ef?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ew?"turned off":"active"===ew?"active":"matching"} accounts found for ${ef}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},ts=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(ez),tn=!d.includes(eI),tl=ee||tr?ee||ta?null:(0,a.jsx)(C.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:ti.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:ti.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:ti.description})]})}):(0,a.jsx)(C.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})});return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eP(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eE,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ef?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(s.A,{src:`/providers/${ef}.png`,alt:ef,size:18,className:"size-[18px] rounded object-contain",fallbackText:ef.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:tt})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eE&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eP(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==ef&&eO(1),ey("all"),eP(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ef?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ef&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ev.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{ef!==e&&eO(1),ey(e),eP(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ef===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(s.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),ef===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ew,onChange:e=>{let t=e.target.value;ew!==t&&eO(1),ej(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ef&&(0,a.jsx)("select",{value:eN,onChange:e=>eC(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eq(e=>!e),"aria-pressed":e$,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${e$?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{te(e8.filter(e=>(e.isActive??!0)&&e7(e)).map(e=>e.id),!1)},disabled:eT,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,k.Tl)("Turn off Empty")})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{te(e8.filter(e=>!(e.isActive??!0)&&!e7(e)).map(e=>e.id),!0)},disabled:eT,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,k.Tl)("Turn on Available")})]}),(0,a.jsxs)("button",{type:"button",onClick:e6,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-blue-500/30 px-2 text-xs text-blue-500 transition-colors hover:bg-blue-500/10",title:"Hide depleted (zero-balance) quota packs across current connections",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"visibility"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,k.Tl)("Only with balance")})]}),(0,a.jsxs)("button",{type:"button",onClick:e9,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:"Show all quota packs across current connections",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:(0,k.Tl)("Show all")})]}),(0,a.jsxs)("button",{onClick:()=>H(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:U?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${U?"text-primary":"text-text-muted"}`,children:U?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),U&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",X,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e1(!0),disabled:Q,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${Q?"animate-spin":""}`,children:"refresh"})})]})}),"all"!==ew&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",children:"filter_alt"}),(0,a.jsx)("span",{children:(0,k.Tl)("Account filter is active and persists across visits")})]}),e$&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),tl&&(0,a.jsx)("div",{className:"pt-2",children:tl}),!tl&&(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e8.map(r=>{let i,n,l,o=I[r.id],d=_[r.id],c=z[r.id],u=!1===r.isActive,m="codex"===r.provider,h=Number.isFinite(n="number"==typeof(i=o?.raw?.resetCredits?.availableCount)?i:Number(i))?Math.max(0,n):0,p=en===r.id,b=er===r.id||ei===r.id||p,g=o?.quotas||[],f=function(e,t=[],r={},a){if(!Array.isArray(t)||0===t.length)return[];let i=v(e,r,a);return 0===i.size?t:t.filter(e=>!i.has(y(e)))}(r.id,g,eS,r.provider),k=function(e,t=[],r={},a){if(!Array.isArray(t)||0===t.length)return[];let i=v(e,r,a);return 0===i.size?[]:t.filter(e=>i.has(y(e)))}(r.id,g,eS,r.provider);return(0,a.jsxs)(C.default,{padding:"none",className:`min-w-0 ${u?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(s.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),x(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(r)}):null,T(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:T(r)}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(l=r.providerSpecificData?.authMethod)&&q[l]?q[l]:"api_key"===r.authType?"API Key":"OAuth"}),D(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:D(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${u?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:u?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.default,{text:h>0?`Use one Codex reset credit. Available: ${h}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>ed({connection:r,resetCreditCount:h}),disabled:h<=0||d||b,"aria-label":h>0?`Use one Codex reset credit. ${h} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${h>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${p?"animate-spin":""}`,children:p?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:h})]})}),(0,a.jsx)(N.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r),disabled:d||b,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),E[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(N.default,{text:P[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e5(r.id,r.provider,J[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${J[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(N.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eW(r.id,r.provider),disabled:d||b,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${d?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(N.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ep(r),em(!0)},disabled:b,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(N.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eX(r.id),disabled:b,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${er===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(j.default,{size:"sm",checked:r.isActive??!0,disabled:b,onChange:e=>eZ(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[d?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):c?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:c})]}):o?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:o.message})}):(0,a.jsx)(w,{quotas:f,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eN,onHideQuota:e=>e3(r.id,e)}),k.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:k.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>e4(r.id,e),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:e.name},y(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:ts}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:tn?"custom":String(eI),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eO(1),eF(r),eL(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[d.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:e_,onChange:e=>eL(e.target.value),onBlur:()=>{let e=Number.parseInt(e_,10);if(!Number.isFinite(e))return void eL(String(eI));let t=Math.min(500,Math.max(1,e));eO(1),eF(t),eL(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(e_,10);if(!Number.isFinite(t))return void eL(String(eI));let r=Math.min(500,Math.max(1,t));eO(1),eF(r),eL(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",ez.page," / ",ez.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eO(1),disabled:ez.page<=1||ee||Q,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eO(e=>Math.max(1,e-1)),disabled:ez.page<=1||ee||Q,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eO(e=>Math.min(ez.totalPages,e+1)),disabled:ez.page>=ez.totalPages||ee||Q,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eO(ez.totalPages),disabled:ez.page>=ez.totalPages||ee||Q,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(S.uo,{isOpen:!!eo,onClose:()=>{en||ed(null)},onConfirm:async()=>{let e=eo?.connection;e&&(await eQ(e.id,e.provider),ed(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${x(eo?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eo?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!en}),ec&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:x(ec.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eu(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ec.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ec.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ec.error}):ec.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ec.data.credits.length," reset credit",1===ec.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ec.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ec.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:M(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:M(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)(S.wI,{isOpen:ex,connection:eh,proxyPools:eb,onSave:e0,onClose:()=>{em(!1),ep(null)}})]})}}},e=>{e.O(0,[4614,1321,5497,8441,3794,7358],()=>e(e.s=26048)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,335,342,371,383,387,501,516,543,552,639,649,675,747,748,907,931,948,992,997,999,1020,1077,1088,1091,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1674,1697,1704,1860,1898,1907,1910,1946,1949,2121,2185,2198,2284,2296,2366,2536,2772,2785,2797,2802,2845,2919,2922,3025,3038,3079,3397,3472,3486,3549,3562,3568,3648,3883,3888,4010,4061,4093,4245,4286,4310,4422,4444,4527,4612,4648,4656,4664,4674,4761,4896,4993,5018,5107,5177,5211,5226,5466,5637,5685,5745,5922,6054,6091,6102,6107,6121,6268,6319,6463,6478,6479,6529,6580,6594,6740,6743,6819,6919,6988,6996,7131,7158,7241,7311,7329,7429,7445,7473,7508,7520,7758,7824,7851,8026,8141,8167,8207,8246,8264,8453,8489,8573,8648,8736,8791,8814,8835,8870,8879,8948,8974,8975,9027,9036,9056,9069,9088,9120,9141,9199,9321,9427,9461,9606,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,335,342,371,383,387,501,516,543,552,639,649,675,747,748,907,931,948,992,997,999,1020,1077,1088,1091,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1674,1697,1704,1860,1898,1907,1910,1946,1949,2121,2185,2198,2284,2296,2366,2536,2772,2785,2797,2802,2845,2919,2922,3025,3038,3079,3397,3472,3486,3549,3562,3568,3648,3883,3888,4010,4061,4093,4245,4286,4310,4422,4444,4527,4612,4648,4656,4664,4674,4761,4896,4993,5018,5107,5177,5211,5226,5466,5637,5685,5745,5922,6054,6091,6102,6107,6121,6268,6319,6463,6478,6479,6529,6580,6594,6740,6743,6819,6919,6988,6996,7131,7158,7241,7311,7329,7429,7445,7473,7508,7520,7758,7824,7851,8026,8141,8167,8207,8246,8264,8453,8489,8573,8648,8736,8791,8814,8835,8870,8879,8948,8974,8975,9027,9036,9056,9069,9088,9120,9141,9199,9321,9427,9461,9606,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,335,342,371,383,387,501,516,543,552,639,649,675,747,748,907,931,948,992,997,999,1020,1077,1088,1091,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1674,1697,1704,1860,1898,1907,1910,1946,1949,2121,2185,2198,2284,2296,2366,2536,2772,2785,2797,2802,2845,2919,2922,3025,3038,3079,3397,3472,3486,3549,3562,3568,3648,3883,3888,4010,4061,4093,4245,4286,4310,4422,4444,4527,4612,4648,4656,4664,4674,4761,4896,4993,5018,5107,5177,5211,5226,5466,5637,5685,5745,5922,6054,6091,6102,6107,6121,6268,6319,6463,6478,6479,6529,6580,6594,6740,6743,6819,6919,6988,6996,7131,7158,7241,7311,7329,7429,7445,7473,7508,7520,7758,7824,7851,8026,8141,8167,8207,8246,8264,8453,8489,8573,8648,8736,8791,8814,8835,8870,8879,8948,8974,8975,9027,9036,9056,9069,9088,9120,9141,9199,9321,9427,9461,9606,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,335,342,371,383,387,501,516,543,552,639,649,675,747,748,907,931,948,992,997,999,1020,1077,1088,1091,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1674,1697,1704,1860,1898,1907,1910,1946,1949,2121,2185,2198,2284,2296,2366,2536,2772,2785,2797,2802,2845,2919,2922,3025,3038,3079,3397,3472,3486,3549,3562,3568,3648,3883,3888,4010,4061,4093,4245,4286,4310,4422,4444,4527,4612,4648,4656,4664,4674,4761,4896,4993,5018,5107,5177,5211,5226,5466,5637,5685,5745,5922,6054,6091,6102,6107,6121,6268,6319,6463,6478,6479,6529,6580,6594,6740,6743,6819,6919,6988,6996,7131,7158,7241,7311,7329,7429,7445,7473,7508,7520,7758,7824,7851,8026,8141,8167,8207,8246,8264,8453,8489,8573,8648,8736,8791,8814,8835,8870,8879,8948,8974,8975,9027,9036,9056,9069,9088,9120,9141,9199,9321,9427,9461,9606,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,335,342,371,383,387,501,516,543,552,639,649,675,747,748,907,931,948,992,997,999,1020,1077,1088,1091,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1674,1697,1704,1860,1898,1907,1910,1946,1949,2121,2185,2198,2284,2296,2366,2536,2772,2785,2797,2802,2845,2919,2922,3025,3038,3079,3397,3472,3486,3549,3562,3568,3648,3883,3888,4010,4061,4093,4245,4286,4310,4422,4444,4527,4612,4648,4656,4664,4674,4761,4896,4993,5018,5107,5177,5211,5226,5466,5637,5685,5745,5922,6054,6091,6102,6107,6121,6268,6319,6463,6478,6479,6529,6580,6594,6740,6743,6819,6919,6988,6996,7131,7158,7241,7311,7329,7429,7445,7473,7508,7520,7758,7824,7851,8026,8141,8167,8207,8246,8264,8453,8489,8573,8648,8736,8791,8814,8835,8870,8879,8948,8974,8975,9027,9036,9056,9069,9088,9120,9141,9199,9321,9427,9461,9606,9678,9709],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);