@yina-npm/openrouterx 0.4.24 → 0.4.26

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 (578) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +6 -4
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/routes-manifest.json +12 -0
  5. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js +2 -2
  6. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +2 -2
  8. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  10. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  12. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  16. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  20. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  22. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  24. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  26. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  28. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page.js +2 -0
  30. package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page.js.nft.json +1 -0
  31. package/app/.next/server/app/(dashboard)/dashboard/network-analysis/page_client-reference-manifest.js +1 -0
  32. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  33. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  35. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  37. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  43. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  45. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  47. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  49. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  51. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/user/page.js +3 -3
  53. package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/_global-error/page.js +3 -3
  55. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/_global-error.html +1 -1
  57. package/app/.next/server/app/_global-error.rsc +1 -1
  58. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  59. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  60. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  61. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  62. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  63. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  64. package/app/.next/server/app/_not-found/page.js +2 -2
  65. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/_not-found.html +1 -1
  67. package/app/.next/server/app/_not-found.rsc +4 -4
  68. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  69. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  70. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  71. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  72. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  73. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  74. package/app/.next/server/app/api/auth/login/route.js +1 -1
  75. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  76. package/app/.next/server/app/api/auth/me/route.js +1 -1
  77. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  78. package/app/.next/server/app/api/cli-tools/antigravity-mitm/inject-auth/route.js +1 -1
  79. package/app/.next/server/app/api/cli-tools/antigravity-mitm/restart/route.js +1 -1
  80. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  81. package/app/.next/server/app/api/cli-tools/antigravity-mitm/test/route.js +1 -1
  82. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  83. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  84. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  85. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  86. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  87. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
  88. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  89. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  90. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  91. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  92. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  93. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  94. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  95. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  96. package/app/.next/server/app/api/combos/route.js +1 -1
  97. package/app/.next/server/app/api/health/route.js +1 -1
  98. package/app/.next/server/app/api/init/route.js +1 -1
  99. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  100. package/app/.next/server/app/api/keys/route.js +1 -1
  101. package/app/.next/server/app/api/locale/route.js +1 -1
  102. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  103. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  104. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  105. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  106. package/app/.next/server/app/api/models/alias/route.js +1 -1
  107. package/app/.next/server/app/api/models/availability/route.js +1 -1
  108. package/app/.next/server/app/api/models/custom/route.js +1 -1
  109. package/app/.next/server/app/api/models/disabled/route.js +1 -1
  110. package/app/.next/server/app/api/models/route.js +1 -1
  111. package/app/.next/server/app/api/models/test/route.js +1 -1
  112. package/app/.next/server/app/api/network-analysis/route.js +2 -0
  113. package/app/.next/server/app/api/network-analysis/route.js.nft.json +1 -0
  114. package/app/.next/server/app/api/network-analysis/route_client-reference-manifest.js +1 -0
  115. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  116. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  117. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  118. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  119. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  120. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  121. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  122. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  123. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  124. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  125. package/app/.next/server/app/api/pricing/route.js +1 -1
  126. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  127. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  128. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  129. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  130. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  131. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  132. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  133. package/app/.next/server/app/api/providers/client/route.js +1 -1
  134. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  135. package/app/.next/server/app/api/providers/route.js +1 -1
  136. package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
  137. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  138. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  139. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  140. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  141. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  142. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  143. package/app/.next/server/app/api/settings/database/route.js +1 -1
  144. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  145. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  146. package/app/.next/server/app/api/settings/route.js +1 -1
  147. package/app/.next/server/app/api/shutdown/route.js +1 -1
  148. package/app/.next/server/app/api/tags/route.js +1 -1
  149. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  150. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  151. package/app/.next/server/app/api/translator/load/route.js +1 -1
  152. package/app/.next/server/app/api/translator/save/route.js +1 -1
  153. package/app/.next/server/app/api/translator/send/route.js +1 -1
  154. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  155. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  156. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  157. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  158. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +1 -1
  159. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  160. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  161. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +1 -1
  162. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +1 -1
  163. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  164. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  165. package/app/.next/server/app/api/usage/api-keys/route.js +1 -1
  166. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  167. package/app/.next/server/app/api/usage/history/route.js +1 -1
  168. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  169. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  170. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  171. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  172. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  173. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  174. package/app/.next/server/app/api/users/[id]/route.js +1 -1
  175. package/app/.next/server/app/api/users/route.js +1 -1
  176. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  177. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  178. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  179. package/app/.next/server/app/api/v1/audio/voices/route.js +1 -1
  180. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  181. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  182. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  183. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  184. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  185. package/app/.next/server/app/api/v1/models/[kind]/route.js +1 -1
  186. package/app/.next/server/app/api/v1/models/info/route.js +1 -1
  187. package/app/.next/server/app/api/v1/models/route.js +1 -1
  188. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  189. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  190. package/app/.next/server/app/api/v1/route.js +1 -1
  191. package/app/.next/server/app/api/v1/search/route.js +1 -1
  192. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  193. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  194. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  195. package/app/.next/server/app/api/version/route.js +1 -1
  196. package/app/.next/server/app/api/version/update/route.js +1 -1
  197. package/app/.next/server/app/callback/page.js +2 -2
  198. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/callback.html +1 -1
  200. package/app/.next/server/app/callback.rsc +4 -4
  201. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  202. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  203. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  204. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  205. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  206. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  207. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  208. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  209. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  210. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  211. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  212. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  213. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  214. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  215. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  216. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  217. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  218. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  219. package/app/.next/server/app/favicon.ico/route.js +1 -1
  220. package/app/.next/server/app/index.html +1 -1
  221. package/app/.next/server/app/index.rsc +4 -4
  222. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  223. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  224. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  225. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  226. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  227. package/app/.next/server/app/landing/page.js +2 -2
  228. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  229. package/app/.next/server/app/landing.html +1 -1
  230. package/app/.next/server/app/landing.rsc +5 -5
  231. package/app/.next/server/app/landing.segments/_full.segment.rsc +5 -5
  232. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  233. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  234. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  235. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  236. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  237. package/app/.next/server/app/login/page.js +2 -2
  238. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/login.html +1 -1
  240. package/app/.next/server/app/login.rsc +5 -5
  241. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  242. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  243. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  244. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  245. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  246. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  247. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  248. package/app/.next/server/app/page.js +2 -2
  249. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  250. package/app/.next/server/app-paths-manifest.json +6 -4
  251. package/app/.next/server/chunks/1263.js +1 -1
  252. package/app/.next/server/chunks/2549.js +1 -1
  253. package/app/.next/server/chunks/3110.js +2 -2
  254. package/app/.next/server/chunks/412.js +2 -2
  255. package/app/.next/server/chunks/4122.js +1 -1
  256. package/app/.next/server/chunks/4664.js +1 -1
  257. package/app/.next/server/chunks/6182.js +1 -1
  258. package/app/.next/server/chunks/7595.js +1 -1
  259. package/app/.next/server/chunks/7828.js +1 -1
  260. package/app/.next/server/chunks/8590.js +1 -1
  261. package/app/.next/server/chunks/9547.js +4 -4
  262. package/app/.next/server/middleware-build-manifest.js +1 -1
  263. package/app/.next/server/middleware.js +2 -2
  264. package/app/.next/server/pages/404.html +1 -1
  265. package/app/.next/server/pages/500.html +1 -1
  266. package/app/.next/static/chunks/{1321-e48fd14f5bef6d7a.js → 1321-95c9ff5c55e7523c.js} +1 -1
  267. package/app/.next/static/chunks/{2336-36a1f30358e691c6.js → 2336-291f4397a7464d20.js} +6 -6
  268. package/app/.next/static/chunks/5497-5e089c05197cb78c.js +7 -0
  269. package/app/.next/static/chunks/{5555-9189a6eb2a8e87a5.js → 5555-595382d9c4d118fe.js} +2 -2
  270. package/app/.next/static/chunks/app/(dashboard)/dashboard/network-analysis/page-b1347cd5ca75819b.js +1 -0
  271. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-39ab11dad9bb6b89.js +1 -0
  272. package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-6252e05d8d534383.js +1 -0
  273. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-e967880631a99483.js +1 -0
  274. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-2ae01d48c665f7b4.js → page-c41fbdb17b88c549.js} +1 -1
  275. package/app/.next/static/chunks/app/_global-error/page-e967880631a99483.js +1 -0
  276. package/app/.next/static/chunks/app/api/auth/login/route-e967880631a99483.js +1 -0
  277. package/app/.next/static/chunks/app/api/auth/logout/route-e967880631a99483.js +1 -0
  278. package/app/.next/static/chunks/app/api/auth/me/route-e967880631a99483.js +1 -0
  279. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-e967880631a99483.js +1 -0
  280. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/inject-auth/route-e967880631a99483.js +1 -0
  281. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/restart/route-e967880631a99483.js +1 -0
  282. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-e967880631a99483.js +1 -0
  283. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/test/route-e967880631a99483.js +1 -0
  284. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-e967880631a99483.js +1 -0
  285. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-e967880631a99483.js +1 -0
  286. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-e967880631a99483.js +1 -0
  287. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-e967880631a99483.js +1 -0
  288. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-e967880631a99483.js +1 -0
  289. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-e967880631a99483.js +1 -0
  290. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-e967880631a99483.js +1 -0
  291. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-e967880631a99483.js +1 -0
  292. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-e967880631a99483.js +1 -0
  293. package/app/.next/static/chunks/app/api/cloud/auth/route-e967880631a99483.js +1 -0
  294. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-e967880631a99483.js +1 -0
  295. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-e967880631a99483.js +1 -0
  296. package/app/.next/static/chunks/app/api/cloud/models/alias/route-e967880631a99483.js +1 -0
  297. package/app/.next/static/chunks/app/api/combos/[id]/route-e967880631a99483.js +1 -0
  298. package/app/.next/static/chunks/app/api/combos/route-e967880631a99483.js +1 -0
  299. package/app/.next/static/chunks/app/api/health/route-e967880631a99483.js +1 -0
  300. package/app/.next/static/chunks/app/api/init/route-e967880631a99483.js +1 -0
  301. package/app/.next/static/chunks/app/api/keys/[id]/route-e967880631a99483.js +1 -0
  302. package/app/.next/static/chunks/app/api/keys/route-e967880631a99483.js +1 -0
  303. package/app/.next/static/chunks/app/api/locale/route-e967880631a99483.js +1 -0
  304. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-e967880631a99483.js +1 -0
  305. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-e967880631a99483.js +1 -0
  306. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-e967880631a99483.js +1 -0
  307. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-e967880631a99483.js +1 -0
  308. package/app/.next/static/chunks/app/api/models/alias/route-e967880631a99483.js +1 -0
  309. package/app/.next/static/chunks/app/api/models/availability/route-e967880631a99483.js +1 -0
  310. package/app/.next/static/chunks/app/api/models/custom/route-e967880631a99483.js +1 -0
  311. package/app/.next/static/chunks/app/api/models/disabled/route-e967880631a99483.js +1 -0
  312. package/app/.next/static/chunks/app/api/models/route-e967880631a99483.js +1 -0
  313. package/app/.next/static/chunks/app/api/models/test/route-e967880631a99483.js +1 -0
  314. package/app/.next/static/chunks/app/api/network-analysis/route-e967880631a99483.js +1 -0
  315. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-e967880631a99483.js +1 -0
  316. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-e967880631a99483.js +1 -0
  317. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-e967880631a99483.js +1 -0
  318. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-e967880631a99483.js +1 -0
  319. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-e967880631a99483.js +1 -0
  320. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-e967880631a99483.js +1 -0
  321. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-e967880631a99483.js +1 -0
  322. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-e967880631a99483.js +1 -0
  323. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-e967880631a99483.js +1 -0
  324. package/app/.next/static/chunks/app/api/pricing/route-e967880631a99483.js +1 -0
  325. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-e967880631a99483.js +1 -0
  326. package/app/.next/static/chunks/app/api/provider-nodes/route-e967880631a99483.js +1 -0
  327. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-e967880631a99483.js +1 -0
  328. package/app/.next/static/chunks/app/api/providers/[id]/models/route-e967880631a99483.js +1 -0
  329. package/app/.next/static/chunks/app/api/providers/[id]/route-e967880631a99483.js +1 -0
  330. package/app/.next/static/chunks/app/api/providers/[id]/test/route-e967880631a99483.js +1 -0
  331. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-e967880631a99483.js +1 -0
  332. package/app/.next/static/chunks/app/api/providers/client/route-e967880631a99483.js +1 -0
  333. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-e967880631a99483.js +1 -0
  334. package/app/.next/static/chunks/app/api/providers/route-e967880631a99483.js +1 -0
  335. package/app/.next/static/chunks/app/api/providers/suggested-models/route-e967880631a99483.js +1 -0
  336. package/app/.next/static/chunks/app/api/providers/test-batch/route-e967880631a99483.js +1 -0
  337. package/app/.next/static/chunks/app/api/providers/validate/route-e967880631a99483.js +1 -0
  338. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-e967880631a99483.js +1 -0
  339. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-e967880631a99483.js +1 -0
  340. package/app/.next/static/chunks/app/api/proxy-pools/route-e967880631a99483.js +1 -0
  341. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-e967880631a99483.js +1 -0
  342. package/app/.next/static/chunks/app/api/settings/database/route-e967880631a99483.js +1 -0
  343. package/app/.next/static/chunks/app/api/settings/proxy-test/route-e967880631a99483.js +1 -0
  344. package/app/.next/static/chunks/app/api/settings/require-login/route-e967880631a99483.js +1 -0
  345. package/app/.next/static/chunks/app/api/settings/route-e967880631a99483.js +1 -0
  346. package/app/.next/static/chunks/app/api/shutdown/route-e967880631a99483.js +1 -0
  347. package/app/.next/static/chunks/app/api/tags/route-e967880631a99483.js +1 -0
  348. package/app/.next/static/chunks/app/api/translator/console-logs/route-e967880631a99483.js +1 -0
  349. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-e967880631a99483.js +1 -0
  350. package/app/.next/static/chunks/app/api/translator/load/route-e967880631a99483.js +1 -0
  351. package/app/.next/static/chunks/app/api/translator/save/route-e967880631a99483.js +1 -0
  352. package/app/.next/static/chunks/app/api/translator/send/route-e967880631a99483.js +1 -0
  353. package/app/.next/static/chunks/app/api/translator/translate/route-e967880631a99483.js +1 -0
  354. package/app/.next/static/chunks/app/api/tunnel/disable/route-e967880631a99483.js +1 -0
  355. package/app/.next/static/chunks/app/api/tunnel/enable/route-e967880631a99483.js +1 -0
  356. package/app/.next/static/chunks/app/api/tunnel/status/route-e967880631a99483.js +1 -0
  357. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-e967880631a99483.js +1 -0
  358. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-e967880631a99483.js +1 -0
  359. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-e967880631a99483.js +1 -0
  360. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-e967880631a99483.js +1 -0
  361. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-e967880631a99483.js +1 -0
  362. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-e967880631a99483.js +1 -0
  363. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-e967880631a99483.js +1 -0
  364. package/app/.next/static/chunks/app/api/usage/api-keys/route-e967880631a99483.js +1 -0
  365. package/app/.next/static/chunks/app/api/usage/chart/route-e967880631a99483.js +1 -0
  366. package/app/.next/static/chunks/app/api/usage/history/route-e967880631a99483.js +1 -0
  367. package/app/.next/static/chunks/app/api/usage/logs/route-e967880631a99483.js +1 -0
  368. package/app/.next/static/chunks/app/api/usage/providers/route-e967880631a99483.js +1 -0
  369. package/app/.next/static/chunks/app/api/usage/request-details/route-e967880631a99483.js +1 -0
  370. package/app/.next/static/chunks/app/api/usage/request-logs/route-e967880631a99483.js +1 -0
  371. package/app/.next/static/chunks/app/api/usage/stats/route-e967880631a99483.js +1 -0
  372. package/app/.next/static/chunks/app/api/usage/stream/route-e967880631a99483.js +1 -0
  373. package/app/.next/static/chunks/app/api/users/[id]/route-e967880631a99483.js +1 -0
  374. package/app/.next/static/chunks/app/api/users/route-e967880631a99483.js +1 -0
  375. package/app/.next/static/chunks/app/api/v1/api/chat/route-e967880631a99483.js +1 -0
  376. package/app/.next/static/chunks/app/api/v1/audio/speech/route-e967880631a99483.js +1 -0
  377. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-e967880631a99483.js +1 -0
  378. package/app/.next/static/chunks/app/api/v1/audio/voices/route-e967880631a99483.js +1 -0
  379. package/app/.next/static/chunks/app/api/v1/chat/completions/route-e967880631a99483.js +1 -0
  380. package/app/.next/static/chunks/app/api/v1/embeddings/route-e967880631a99483.js +1 -0
  381. package/app/.next/static/chunks/app/api/v1/images/generations/route-e967880631a99483.js +1 -0
  382. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-e967880631a99483.js +1 -0
  383. package/app/.next/static/chunks/app/api/v1/messages/route-e967880631a99483.js +1 -0
  384. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-e967880631a99483.js +1 -0
  385. package/app/.next/static/chunks/app/api/v1/models/info/route-e967880631a99483.js +1 -0
  386. package/app/.next/static/chunks/app/api/v1/models/route-e967880631a99483.js +1 -0
  387. package/app/.next/static/chunks/app/api/v1/responses/compact/route-e967880631a99483.js +1 -0
  388. package/app/.next/static/chunks/app/api/v1/responses/route-e967880631a99483.js +1 -0
  389. package/app/.next/static/chunks/app/api/v1/route-e967880631a99483.js +1 -0
  390. package/app/.next/static/chunks/app/api/v1/search/route-e967880631a99483.js +1 -0
  391. package/app/.next/static/chunks/app/api/v1/web/fetch/route-e967880631a99483.js +1 -0
  392. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-e967880631a99483.js +1 -0
  393. package/app/.next/static/chunks/app/api/v1beta/models/route-e967880631a99483.js +1 -0
  394. package/app/.next/static/chunks/app/api/version/route-e967880631a99483.js +1 -0
  395. package/app/.next/static/chunks/app/api/version/update/route-e967880631a99483.js +1 -0
  396. package/app/.next/static/chunks/app/landing/page-d345c7018be3c351.js +1 -0
  397. package/app/.next/static/chunks/app/manifest.webmanifest/route-e967880631a99483.js +1 -0
  398. package/app/.next/static/chunks/app/page-e967880631a99483.js +1 -0
  399. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-e967880631a99483.js +1 -0
  400. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-e967880631a99483.js +1 -0
  401. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-e967880631a99483.js +1 -0
  402. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-e967880631a99483.js +1 -0
  403. package/app/.next/static/css/7cd54184567aeb93.css +1 -0
  404. package/app/.next/static/faQBvAhPvYR3OC9ddKyfJ/_buildManifest.js +1 -0
  405. package/app/package.json +1 -1
  406. package/app/public/i18n/literals/ar.json +3 -3
  407. package/app/public/i18n/literals/bn.json +3 -3
  408. package/app/public/i18n/literals/cs.json +3 -3
  409. package/app/public/i18n/literals/da.json +3 -3
  410. package/app/public/i18n/literals/de.json +3 -3
  411. package/app/public/i18n/literals/el.json +3 -3
  412. package/app/public/i18n/literals/es.json +3 -3
  413. package/app/public/i18n/literals/fi.json +3 -3
  414. package/app/public/i18n/literals/fr.json +3 -3
  415. package/app/public/i18n/literals/he.json +3 -3
  416. package/app/public/i18n/literals/hi.json +3 -3
  417. package/app/public/i18n/literals/hu.json +3 -3
  418. package/app/public/i18n/literals/id.json +3 -3
  419. package/app/public/i18n/literals/it.json +3 -3
  420. package/app/public/i18n/literals/ja.json +3 -3
  421. package/app/public/i18n/literals/ko.json +3 -3
  422. package/app/public/i18n/literals/nl.json +3 -3
  423. package/app/public/i18n/literals/no.json +3 -3
  424. package/app/public/i18n/literals/pl.json +3 -3
  425. package/app/public/i18n/literals/pt-BR.json +3 -3
  426. package/app/public/i18n/literals/pt-PT.json +3 -3
  427. package/app/public/i18n/literals/ro.json +3 -3
  428. package/app/public/i18n/literals/ru.json +3 -3
  429. package/app/public/i18n/literals/sv.json +3 -3
  430. package/app/public/i18n/literals/th.json +3 -3
  431. package/app/public/i18n/literals/tl.json +3 -3
  432. package/app/public/i18n/literals/tr.json +3 -3
  433. package/app/public/i18n/literals/uk.json +3 -3
  434. package/app/public/i18n/literals/ur.json +3 -3
  435. package/app/public/i18n/literals/vi.json +3 -3
  436. package/app/public/i18n/literals/zh-CN.json +66 -43
  437. package/app/public/i18n/literals/zh-TW.json +59 -11
  438. package/app/src/mitm/cert/rootCA.js +4 -4
  439. package/app/src/mitm/handlers/base.js +2 -2
  440. package/app/src/mitm/handlers/copilot.js +2 -2
  441. package/app/src/mitm/handlers/openrouter.js +2 -2
  442. package/app/src/mitm/server.js +4 -4
  443. package/package.json +1 -1
  444. package/src/cli/menus/cliTools.js +3 -3
  445. package/app/.next/static/SQn85l_D0P4BshNJQkGiZ/_buildManifest.js +0 -1
  446. package/app/.next/static/chunks/5497-a2d728c63029180e.js +0 -7
  447. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-0dc79ccb25aab919.js +0 -1
  448. package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-d4518d92737b2728.js +0 -1
  449. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-6ec61ce021cdb9a6.js +0 -1
  450. package/app/.next/static/chunks/app/_global-error/page-6ec61ce021cdb9a6.js +0 -1
  451. package/app/.next/static/chunks/app/api/auth/login/route-6ec61ce021cdb9a6.js +0 -1
  452. package/app/.next/static/chunks/app/api/auth/logout/route-6ec61ce021cdb9a6.js +0 -1
  453. package/app/.next/static/chunks/app/api/auth/me/route-6ec61ce021cdb9a6.js +0 -1
  454. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-6ec61ce021cdb9a6.js +0 -1
  455. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/inject-auth/route-6ec61ce021cdb9a6.js +0 -1
  456. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/restart/route-6ec61ce021cdb9a6.js +0 -1
  457. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-6ec61ce021cdb9a6.js +0 -1
  458. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/test/route-6ec61ce021cdb9a6.js +0 -1
  459. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-6ec61ce021cdb9a6.js +0 -1
  460. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-6ec61ce021cdb9a6.js +0 -1
  461. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-6ec61ce021cdb9a6.js +0 -1
  462. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-6ec61ce021cdb9a6.js +0 -1
  463. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-6ec61ce021cdb9a6.js +0 -1
  464. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-6ec61ce021cdb9a6.js +0 -1
  465. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-6ec61ce021cdb9a6.js +0 -1
  466. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-6ec61ce021cdb9a6.js +0 -1
  467. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-6ec61ce021cdb9a6.js +0 -1
  468. package/app/.next/static/chunks/app/api/cloud/auth/route-6ec61ce021cdb9a6.js +0 -1
  469. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-6ec61ce021cdb9a6.js +0 -1
  470. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-6ec61ce021cdb9a6.js +0 -1
  471. package/app/.next/static/chunks/app/api/cloud/models/alias/route-6ec61ce021cdb9a6.js +0 -1
  472. package/app/.next/static/chunks/app/api/combos/[id]/route-6ec61ce021cdb9a6.js +0 -1
  473. package/app/.next/static/chunks/app/api/combos/route-6ec61ce021cdb9a6.js +0 -1
  474. package/app/.next/static/chunks/app/api/health/route-6ec61ce021cdb9a6.js +0 -1
  475. package/app/.next/static/chunks/app/api/init/route-6ec61ce021cdb9a6.js +0 -1
  476. package/app/.next/static/chunks/app/api/keys/[id]/route-6ec61ce021cdb9a6.js +0 -1
  477. package/app/.next/static/chunks/app/api/keys/route-6ec61ce021cdb9a6.js +0 -1
  478. package/app/.next/static/chunks/app/api/locale/route-6ec61ce021cdb9a6.js +0 -1
  479. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-6ec61ce021cdb9a6.js +0 -1
  480. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-6ec61ce021cdb9a6.js +0 -1
  481. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-6ec61ce021cdb9a6.js +0 -1
  482. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-6ec61ce021cdb9a6.js +0 -1
  483. package/app/.next/static/chunks/app/api/models/alias/route-6ec61ce021cdb9a6.js +0 -1
  484. package/app/.next/static/chunks/app/api/models/availability/route-6ec61ce021cdb9a6.js +0 -1
  485. package/app/.next/static/chunks/app/api/models/custom/route-6ec61ce021cdb9a6.js +0 -1
  486. package/app/.next/static/chunks/app/api/models/disabled/route-6ec61ce021cdb9a6.js +0 -1
  487. package/app/.next/static/chunks/app/api/models/route-6ec61ce021cdb9a6.js +0 -1
  488. package/app/.next/static/chunks/app/api/models/test/route-6ec61ce021cdb9a6.js +0 -1
  489. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-6ec61ce021cdb9a6.js +0 -1
  490. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-6ec61ce021cdb9a6.js +0 -1
  491. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-6ec61ce021cdb9a6.js +0 -1
  492. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-6ec61ce021cdb9a6.js +0 -1
  493. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-6ec61ce021cdb9a6.js +0 -1
  494. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-6ec61ce021cdb9a6.js +0 -1
  495. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-6ec61ce021cdb9a6.js +0 -1
  496. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-6ec61ce021cdb9a6.js +0 -1
  497. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-6ec61ce021cdb9a6.js +0 -1
  498. package/app/.next/static/chunks/app/api/pricing/route-6ec61ce021cdb9a6.js +0 -1
  499. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-6ec61ce021cdb9a6.js +0 -1
  500. package/app/.next/static/chunks/app/api/provider-nodes/route-6ec61ce021cdb9a6.js +0 -1
  501. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-6ec61ce021cdb9a6.js +0 -1
  502. package/app/.next/static/chunks/app/api/providers/[id]/models/route-6ec61ce021cdb9a6.js +0 -1
  503. package/app/.next/static/chunks/app/api/providers/[id]/route-6ec61ce021cdb9a6.js +0 -1
  504. package/app/.next/static/chunks/app/api/providers/[id]/test/route-6ec61ce021cdb9a6.js +0 -1
  505. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-6ec61ce021cdb9a6.js +0 -1
  506. package/app/.next/static/chunks/app/api/providers/client/route-6ec61ce021cdb9a6.js +0 -1
  507. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-6ec61ce021cdb9a6.js +0 -1
  508. package/app/.next/static/chunks/app/api/providers/route-6ec61ce021cdb9a6.js +0 -1
  509. package/app/.next/static/chunks/app/api/providers/suggested-models/route-6ec61ce021cdb9a6.js +0 -1
  510. package/app/.next/static/chunks/app/api/providers/test-batch/route-6ec61ce021cdb9a6.js +0 -1
  511. package/app/.next/static/chunks/app/api/providers/validate/route-6ec61ce021cdb9a6.js +0 -1
  512. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-6ec61ce021cdb9a6.js +0 -1
  513. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-6ec61ce021cdb9a6.js +0 -1
  514. package/app/.next/static/chunks/app/api/proxy-pools/route-6ec61ce021cdb9a6.js +0 -1
  515. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-6ec61ce021cdb9a6.js +0 -1
  516. package/app/.next/static/chunks/app/api/settings/database/route-6ec61ce021cdb9a6.js +0 -1
  517. package/app/.next/static/chunks/app/api/settings/proxy-test/route-6ec61ce021cdb9a6.js +0 -1
  518. package/app/.next/static/chunks/app/api/settings/require-login/route-6ec61ce021cdb9a6.js +0 -1
  519. package/app/.next/static/chunks/app/api/settings/route-6ec61ce021cdb9a6.js +0 -1
  520. package/app/.next/static/chunks/app/api/shutdown/route-6ec61ce021cdb9a6.js +0 -1
  521. package/app/.next/static/chunks/app/api/tags/route-6ec61ce021cdb9a6.js +0 -1
  522. package/app/.next/static/chunks/app/api/translator/console-logs/route-6ec61ce021cdb9a6.js +0 -1
  523. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-6ec61ce021cdb9a6.js +0 -1
  524. package/app/.next/static/chunks/app/api/translator/load/route-6ec61ce021cdb9a6.js +0 -1
  525. package/app/.next/static/chunks/app/api/translator/save/route-6ec61ce021cdb9a6.js +0 -1
  526. package/app/.next/static/chunks/app/api/translator/send/route-6ec61ce021cdb9a6.js +0 -1
  527. package/app/.next/static/chunks/app/api/translator/translate/route-6ec61ce021cdb9a6.js +0 -1
  528. package/app/.next/static/chunks/app/api/tunnel/disable/route-6ec61ce021cdb9a6.js +0 -1
  529. package/app/.next/static/chunks/app/api/tunnel/enable/route-6ec61ce021cdb9a6.js +0 -1
  530. package/app/.next/static/chunks/app/api/tunnel/status/route-6ec61ce021cdb9a6.js +0 -1
  531. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-6ec61ce021cdb9a6.js +0 -1
  532. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-6ec61ce021cdb9a6.js +0 -1
  533. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-6ec61ce021cdb9a6.js +0 -1
  534. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-6ec61ce021cdb9a6.js +0 -1
  535. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-6ec61ce021cdb9a6.js +0 -1
  536. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-6ec61ce021cdb9a6.js +0 -1
  537. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-6ec61ce021cdb9a6.js +0 -1
  538. package/app/.next/static/chunks/app/api/usage/api-keys/route-6ec61ce021cdb9a6.js +0 -1
  539. package/app/.next/static/chunks/app/api/usage/chart/route-6ec61ce021cdb9a6.js +0 -1
  540. package/app/.next/static/chunks/app/api/usage/history/route-6ec61ce021cdb9a6.js +0 -1
  541. package/app/.next/static/chunks/app/api/usage/logs/route-6ec61ce021cdb9a6.js +0 -1
  542. package/app/.next/static/chunks/app/api/usage/providers/route-6ec61ce021cdb9a6.js +0 -1
  543. package/app/.next/static/chunks/app/api/usage/request-details/route-6ec61ce021cdb9a6.js +0 -1
  544. package/app/.next/static/chunks/app/api/usage/request-logs/route-6ec61ce021cdb9a6.js +0 -1
  545. package/app/.next/static/chunks/app/api/usage/stats/route-6ec61ce021cdb9a6.js +0 -1
  546. package/app/.next/static/chunks/app/api/usage/stream/route-6ec61ce021cdb9a6.js +0 -1
  547. package/app/.next/static/chunks/app/api/users/[id]/route-6ec61ce021cdb9a6.js +0 -1
  548. package/app/.next/static/chunks/app/api/users/route-6ec61ce021cdb9a6.js +0 -1
  549. package/app/.next/static/chunks/app/api/v1/api/chat/route-6ec61ce021cdb9a6.js +0 -1
  550. package/app/.next/static/chunks/app/api/v1/audio/speech/route-6ec61ce021cdb9a6.js +0 -1
  551. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-6ec61ce021cdb9a6.js +0 -1
  552. package/app/.next/static/chunks/app/api/v1/audio/voices/route-6ec61ce021cdb9a6.js +0 -1
  553. package/app/.next/static/chunks/app/api/v1/chat/completions/route-6ec61ce021cdb9a6.js +0 -1
  554. package/app/.next/static/chunks/app/api/v1/embeddings/route-6ec61ce021cdb9a6.js +0 -1
  555. package/app/.next/static/chunks/app/api/v1/images/generations/route-6ec61ce021cdb9a6.js +0 -1
  556. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-6ec61ce021cdb9a6.js +0 -1
  557. package/app/.next/static/chunks/app/api/v1/messages/route-6ec61ce021cdb9a6.js +0 -1
  558. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-6ec61ce021cdb9a6.js +0 -1
  559. package/app/.next/static/chunks/app/api/v1/models/info/route-6ec61ce021cdb9a6.js +0 -1
  560. package/app/.next/static/chunks/app/api/v1/models/route-6ec61ce021cdb9a6.js +0 -1
  561. package/app/.next/static/chunks/app/api/v1/responses/compact/route-6ec61ce021cdb9a6.js +0 -1
  562. package/app/.next/static/chunks/app/api/v1/responses/route-6ec61ce021cdb9a6.js +0 -1
  563. package/app/.next/static/chunks/app/api/v1/route-6ec61ce021cdb9a6.js +0 -1
  564. package/app/.next/static/chunks/app/api/v1/search/route-6ec61ce021cdb9a6.js +0 -1
  565. package/app/.next/static/chunks/app/api/v1/web/fetch/route-6ec61ce021cdb9a6.js +0 -1
  566. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-6ec61ce021cdb9a6.js +0 -1
  567. package/app/.next/static/chunks/app/api/v1beta/models/route-6ec61ce021cdb9a6.js +0 -1
  568. package/app/.next/static/chunks/app/api/version/route-6ec61ce021cdb9a6.js +0 -1
  569. package/app/.next/static/chunks/app/api/version/update/route-6ec61ce021cdb9a6.js +0 -1
  570. package/app/.next/static/chunks/app/landing/page-4644660041715534.js +0 -1
  571. package/app/.next/static/chunks/app/manifest.webmanifest/route-6ec61ce021cdb9a6.js +0 -1
  572. package/app/.next/static/chunks/app/page-6ec61ce021cdb9a6.js +0 -1
  573. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-6ec61ce021cdb9a6.js +0 -1
  574. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-6ec61ce021cdb9a6.js +0 -1
  575. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-6ec61ce021cdb9a6.js +0 -1
  576. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6ec61ce021cdb9a6.js +0 -1
  577. package/app/.next/static/css/d726e4e5a2cfbfd1.css +0 -1
  578. /package/app/.next/static/{SQn85l_D0P4BshNJQkGiZ → faQBvAhPvYR3OC9ddKyfJ}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5555],{35555:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>m});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059);let c=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],d=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"}];function m({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[g,y]=(0,l.useState)(!1),[b,f]=(0,l.useState)(""),[j,k]=(0,l.useState)(null),[w,v]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!0),[S,T]=(0,l.useState)(!0),[_,E]=(0,l.useState)(!1),[P,$]=(0,l.useState)(!0),[U,A]=(0,l.useState)(!1),[D,O]=(0,l.useState)("full"),[I,F]=(0,l.useState)(!0),[W,L]=(0,l.useState)(!1),[R,q]=(0,l.useState)(""),[K,J]=(0,l.useState)(""),[z,H]=(0,l.useState)(!1),[M,Z]=(0,l.useState)(""),[B,Q]=(0,l.useState)(null),[V,G]=(0,l.useState)(!1),[X,Y]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(!1),[es,ea]=(0,l.useState)(""),[el,en]=(0,l.useState)(!1),[er,ei]=(0,l.useState)(""),[eo,ec]=(0,l.useState)(null),[ed,em]=(0,l.useState)(null),[ex,eh]=(0,l.useState)(!1),[eu,ep]=(0,l.useState)([]),[eg,ey]=(0,l.useState)(""),[eb,ef]=(0,l.useState)(!1),[ej,ek]=(0,l.useState)(!1),[ew,ev]=(0,l.useState)(!1),eN=(0,l.useRef)(null),[eC,eS]=(0,l.useState)(new Set),{copied:eT,copy:e_}=(0,o.C)();(0,l.useEffect)(()=>{eN.current&&(eN.current.scrollTop=eN.current.scrollHeight)},[eu]),(0,l.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),eO(),eP();let e=setInterval(()=>{eE()},5e3),t=()=>{document.hidden||eE()};return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[]);let eE=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"",l=t.tunnel?.publicUrl||"";q(a),J(l),L(s);let n=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,r=t.tailscale?.tunnelUrl||"";ea(r),et(n)}catch{}},eP=async()=>{F(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();v(t.requireApiKey||!1),C(!1!==t.requireLogin),T(t.hasPassword||!1),E(t.tunnelDashboardAccess||!1),$(!1!==t.rtkEnabled),A(!!t.cavemanEnabled),O(t.cavemanLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"",l=e.tunnel?.publicUrl||"";q(a),J(l),L(s);let n=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,r=e.tailscale?.tunnelUrl||"";if(ea(r),et(n),s&&(l||a)){let e=`${l||a}/api/health`;fetch(e,{cache:"no-store"}).then(e=>{e.ok||Q({type:"warning",message:"Tunnel reconnecting..."})}).catch(()=>Q({type:"warning",message:"Tunnel reconnecting..."}))}n&&r&&fetch(`${r}/api/health`,{mode:"no-cors",cache:"no-store"}).then(e=>{e.ok||"opaque"===e.type||ec({type:"warning",message:"Tailscale reconnecting..."})}).catch(()=>ec({type:"warning",message:"Tailscale reconnecting..."}))}}catch(e){console.log("Error loading settings:",e)}finally{F(!1)}},e$=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&E(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},eU=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&v(e)}catch(e){console.log("Error updating requireApiKey:",e)}},eA=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&$(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},eD=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},eO=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},eI=async e=>{H(!0),Z("Waiting for tunnel ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return L(!0),H(!1),Z(""),!0}catch{}if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return Q({type:"error",message:"Tunnel process stopped unexpectedly."}),H(!1),Z(""),!1}}catch{}}return Q({type:"error",message:"Tunnel created but not reachable. Please try again."}),H(!1),Z(""),!1},eF=async()=>{G(!1),H(!0),Q(null),Z("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?Z(`Downloading cloudflared... ${s.download.progress}%`):e&&Z("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void Q({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.publicUrl||s.tunnelUrl;if(!a)return void Q({type:"error",message:"No tunnel URL returned"});q(s.tunnelUrl||""),J(s.publicUrl||""),await eI(a)}catch(e){Q({type:"error",message:e.message})}finally{e=!1,H(!1),Z("")}},eW=async()=>{H(!0),Q(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(L(!1),q(""),J(""),Y(!1),Q({type:"success",message:"Tunnel disabled"})):Q({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){Q({type:"error",message:e.message})}finally{H(!1)}},eL=async()=>{em(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return em(t.installed),t}}catch{}return em(!1),{installed:!1}},eR=async()=>{eh(!0),ec(null),ep([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:eg})});ey("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ep(e=>[...e.slice(-50),a.message]);else if("done"===s){em(!0),eh(!1);return}else"error"===s&&ec({type:"error",message:a.error||"Install failed"})}}}catch(e){ec({type:"error",message:e.message})}finally{eh(!1)}},eq=async e=>{ei("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},eK=async e=>{let t=e||null;ek(!1),ef(!0),en(!0),ec(null),ei("Connecting...");try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),ea(s.tunnelUrl||""),await eq(s.tunnelUrl)?(et(!0),ec(null)):(et(!0),ec({type:"warning",message:"Connected but not reachable yet."}));return}if(s.needsLogin&&s.authUrl){t?t.location.href=s.authUrl:window.open(s.authUrl,"tailscale_auth","width=600,height=700"),ei("Waiting for login...");for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){ei("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();e.ok&&s.success?(t&&t.close(),ea(s.tunnelUrl||""),await eq(s.tunnelUrl)?(et(!0),ec(null)):(et(!0),ec({type:"warning",message:"Connected but not reachable yet."}))):s.funnelNotEnabled&&s.enableUrl?await eJ(s.enableUrl,t):ec({type:"error",message:s.error||"Failed to start funnel"});return}}catch{}}ec({type:"error",message:"Login timed out. Please try again."});return}if(s.funnelNotEnabled&&s.enableUrl)return void await eJ(s.enableUrl,t);t&&t.close(),ec({type:"error",message:s.error||"Failed to connect"})}catch(e){t&&t.close(),ec({type:"error",message:e.message})}finally{en(!1),ef(!1),ei("")}},eJ=async(e,t)=>{t?t.location.href=e:window.open(e,"tailscale_auth","width=600,height=700"),ei("Enable Funnel in browser, waiting...");for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),ea(s.tunnelUrl||""),await eq(s.tunnelUrl)?(et(!0),ec(null)):(et(!0),ec({type:"warning",message:"Connected but not reachable yet."}));return}if(s.funnelNotEnabled)continue;if(s.error)return void ec({type:"error",message:s.error})}catch{}}ec({type:"error",message:"Timed out waiting for Funnel to be enabled."})},ez=async()=>{en(!0),ec(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(et(!1),ea(""),ev(!1),ec({type:"success",message:"Tailscale disabled"})):ec({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){ec({type:"error",message:e.message})}finally{en(!1)}},eH=async()=>{ec(null),ep([]),ek(!0),await eL()},eM=async()=>{if(b.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}),t=await e.json();e.ok&&(k(t.key),await eO(),f(""),y(!1))}catch(e){console.log("Error creating key:",e)}},eZ=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),eS(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},eB=async(e,t)=>{try{(await fetch(`/api/keys/${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 toggling key:",e)}},[eQ,eV]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{eV(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(x,{label:"Local",url:eQ,copyId:"local_url",copied:eT,onCopy:e_}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${W?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),W&&!z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${K||R}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e_(`${K||R}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===eT?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>Y(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),M||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{H(!1),Z("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):B?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),B.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>G(!0),children:"Enable"})]}):I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>F(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{w?G(!0):Q({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ee?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ee&&!el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${es}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e_(`${es}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===eT?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>ev(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):el||eb?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),er||"Connecting..."]}),(0,a.jsx)("button",{onClick:()=>{en(!1),ef(!1),ei("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):eo?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),eo.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eH,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eH,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"})]})]}),(W||ee)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!w&&(0,a.jsx)(p,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!N||!S)&&(0,a.jsx)(p,{message:N?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:N?"Change password":"Enable",href:"/dashboard/profile"}})]}),(W||ee)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:_,onChange:()=>e$(!_)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(u,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>eA(!P)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[U&&(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:d.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;O(t=e.id),eD({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${D===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)(i.lM,{checked:U,onChange:()=>{var e;A(e=!U),eD({cavemanEnabled:e})}})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>y(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:w,onChange:()=>eU(!w)})]}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>y(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:eC.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void eS(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",title:eC.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eC.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>e_(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eT===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?confirm(`Pause API key "${e.name}"?
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5555],{35555:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>m});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059);let c=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],d=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"}];function m({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[g,y]=(0,l.useState)(!1),[b,f]=(0,l.useState)(""),[j,k]=(0,l.useState)(null),[w,v]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!0),[S,T]=(0,l.useState)(!0),[_,E]=(0,l.useState)(!1),[P,$]=(0,l.useState)(!0),[U,A]=(0,l.useState)(!1),[D,O]=(0,l.useState)("full"),[I,F]=(0,l.useState)(!0),[W,L]=(0,l.useState)(!1),[R,q]=(0,l.useState)(""),[K,J]=(0,l.useState)(""),[z,H]=(0,l.useState)(!1),[M,Z]=(0,l.useState)(""),[B,Q]=(0,l.useState)(null),[V,X]=(0,l.useState)(!1),[G,Y]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(!1),[es,ea]=(0,l.useState)(""),[el,en]=(0,l.useState)(!1),[er,ei]=(0,l.useState)(""),[eo,ec]=(0,l.useState)(null),[ed,em]=(0,l.useState)(null),[ex,eh]=(0,l.useState)(!1),[eu,ep]=(0,l.useState)([]),[eg,ey]=(0,l.useState)(""),[eb,ef]=(0,l.useState)(!1),[ej,ek]=(0,l.useState)(!1),[ew,ev]=(0,l.useState)(!1),eN=(0,l.useRef)(null),[eC,eS]=(0,l.useState)(new Set),{copied:eT,copy:e_}=(0,o.C)();(0,l.useEffect)(()=>{eN.current&&(eN.current.scrollTop=eN.current.scrollHeight)},[eu]),(0,l.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{}),eO(),eP();let e=setInterval(()=>{eE()},5e3),t=()=>{document.hidden||eE()};return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[]);let eE=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"",l=t.tunnel?.publicUrl||"";q(a),J(l),L(s);let n=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,r=t.tailscale?.tunnelUrl||"";ea(r),et(n)}catch{}},eP=async()=>{F(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();v(t.requireApiKey||!1),C(!1!==t.requireLogin),T(t.hasPassword||!1),E(t.tunnelDashboardAccess||!1),$(!1!==t.rtkEnabled),A(!!t.cavemanEnabled),O(t.cavemanLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"",l=e.tunnel?.publicUrl||"";q(a),J(l),L(s);let n=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,r=e.tailscale?.tunnelUrl||"";if(ea(r),et(n),s&&(l||a)){let e=`${l||a}/api/health`;fetch(e,{cache:"no-store"}).then(e=>{e.ok||Q({type:"warning",message:"Tunnel reconnecting..."})}).catch(()=>Q({type:"warning",message:"Tunnel reconnecting..."}))}n&&r&&fetch(`${r}/api/health`,{mode:"no-cors",cache:"no-store"}).then(e=>{e.ok||"opaque"===e.type||ec({type:"warning",message:"Tailscale reconnecting..."})}).catch(()=>ec({type:"warning",message:"Tailscale reconnecting..."}))}}catch(e){console.log("Error loading settings:",e)}finally{F(!1)}},e$=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&E(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},eU=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&v(e)}catch(e){console.log("Error updating requireApiKey:",e)}},eA=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&$(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},eD=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},eO=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},eI=async e=>{H(!0),Z("Waiting for tunnel ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return L(!0),H(!1),Z(""),!0}catch{}if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return Q({type:"error",message:"Tunnel process stopped unexpectedly."}),H(!1),Z(""),!1}}catch{}}return Q({type:"error",message:"Tunnel created but not reachable. Please try again."}),H(!1),Z(""),!1},eF=async()=>{X(!1),H(!0),Q(null),Z("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?Z(`Downloading cloudflared... ${s.download.progress}%`):e&&Z("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void Q({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.publicUrl||s.tunnelUrl;if(!a)return void Q({type:"error",message:"No tunnel URL returned"});q(s.tunnelUrl||""),J(s.publicUrl||""),await eI(a)}catch(e){Q({type:"error",message:e.message})}finally{e=!1,H(!1),Z("")}},eW=async()=>{H(!0),Q(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(L(!1),q(""),J(""),Y(!1),Q({type:"success",message:"Tunnel disabled"})):Q({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){Q({type:"error",message:e.message})}finally{H(!1)}},eL=async()=>{em(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return em(t.installed),t}}catch{}return em(!1),{installed:!1}},eR=async()=>{eh(!0),ec(null),ep([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:eg})});ey("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ep(e=>[...e.slice(-50),a.message]);else if("done"===s){em(!0),eh(!1);return}else"error"===s&&ec({type:"error",message:a.error||"Install failed"})}}}catch(e){ec({type:"error",message:e.message})}finally{eh(!1)}},eq=async e=>{ei("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},eK=async e=>{let t=e||null;ek(!1),ef(!0),en(!0),ec(null),ei("Connecting...");try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),ea(s.tunnelUrl||""),await eq(s.tunnelUrl)?(et(!0),ec(null)):(et(!0),ec({type:"warning",message:"Connected but not reachable yet."}));return}if(s.needsLogin&&s.authUrl){t?t.location.href=s.authUrl:window.open(s.authUrl,"tailscale_auth","width=600,height=700"),ei("Waiting for login...");for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){ei("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();e.ok&&s.success?(t&&t.close(),ea(s.tunnelUrl||""),await eq(s.tunnelUrl)?(et(!0),ec(null)):(et(!0),ec({type:"warning",message:"Connected but not reachable yet."}))):s.funnelNotEnabled&&s.enableUrl?await eJ(s.enableUrl,t):ec({type:"error",message:s.error||"Failed to start funnel"});return}}catch{}}ec({type:"error",message:"Login timed out. Please try again."});return}if(s.funnelNotEnabled&&s.enableUrl)return void await eJ(s.enableUrl,t);t&&t.close(),ec({type:"error",message:s.error||"Failed to connect"})}catch(e){t&&t.close(),ec({type:"error",message:e.message})}finally{en(!1),ef(!1),ei("")}},eJ=async(e,t)=>{t?t.location.href=e:window.open(e,"tailscale_auth","width=600,height=700"),ei("Enable Funnel in browser, waiting...");for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),s=await e.json();if(e.ok&&s.success){t&&t.close(),ea(s.tunnelUrl||""),await eq(s.tunnelUrl)?(et(!0),ec(null)):(et(!0),ec({type:"warning",message:"Connected but not reachable yet."}));return}if(s.funnelNotEnabled)continue;if(s.error)return void ec({type:"error",message:s.error})}catch{}}ec({type:"error",message:"Timed out waiting for Funnel to be enabled."})},ez=async()=>{en(!0),ec(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(et(!1),ea(""),ev(!1),ec({type:"success",message:"Tailscale disabled"})):ec({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){ec({type:"error",message:e.message})}finally{en(!1)}},eH=async()=>{ec(null),ep([]),ek(!0),await eL()},eM=async()=>{if(b.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}),t=await e.json();e.ok&&(k(t.key),await eO(),f(""),y(!1))}catch(e){console.log("Error creating key:",e)}},eZ=async e=>{if(confirm("Delete this API key?"))try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),eS(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}},eB=async(e,t)=>{try{(await fetch(`/api/keys/${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 toggling key:",e)}},[eQ,eV]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{eV(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(x,{label:"Local",url:eQ,copyId:"local_url",copied:eT,onCopy:e_}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${W?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),W&&!z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${K||R}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e_(`${K||R}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===eT?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>Y(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),M||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{H(!1),Z("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):B?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),B.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>X(!0),children:"Enable"})]}):I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>F(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{w?X(!0):Q({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ee?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ee&&!el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${es}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e_(`${es}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===eT?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>ev(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):el||eb?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),er||"Connecting..."]}),(0,a.jsx)("button",{onClick:()=>{en(!1),ef(!1),ei("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):eo?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),eo.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eH,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:eH,className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"})]})]}),(W||ee)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!w&&(0,a.jsx)(p,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!N||!S)&&(0,a.jsx)(p,{message:N?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:N?"Change password":"Enable",href:"/dashboard/profile"}})]}),(W||ee)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:_,onChange:()=>e$(!_)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(u,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>eA(!P)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[U&&(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:d.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;O(t=e.id),eD({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${D===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)(i.lM,{checked:U,onChange:()=>{var e;A(e=!U),eD({cavemanEnabled:e})}})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>y(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:w,onChange:()=>eU(!w)})]}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>y(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:eC.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void eS(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",title:eC.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eC.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>e_(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eT===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?confirm(`Pause API key "${e.name}"?
2
2
 
3
- This key will stop working immediately but can be resumed later.`)&&eB(e.id,t):eB(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>eZ(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:g,title:"Create API Key",onClose:()=>{y(!1),f("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:b,onChange:e=>f(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eM,fullWidth:!0,disabled:!b.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{y(!1),f("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!j,title:"API Key Created",onClose:()=>k(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:j||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===eT?"check":"content_copy",onClick:()=>e_(j,"created_key"),children:"created_key"===eT?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>k(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:V,title:"Enable Tunnel",onClose:()=>G(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:c.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eF,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>G(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:X,title:"Disable Tunnel",onClose:()=>!z&&Y(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eW,fullWidth:!0,disabled:z,variant:"danger",children:z?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>Y(!1),variant:"ghost",fullWidth:!0,disabled:z,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:ej,title:"Tailscale Funnel",onClose:()=>{ex||(ek(!1),ey(""),ec(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ed&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ed&&!ex&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eR,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>ek(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ex&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),eu.length>0&&(0,a.jsx)("div",{ref:eN,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:eu.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ed&&!ex&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>{let e=window.open("","tailscale_auth","width=600,height=700");e&&e.document.write("<p style='font-family:sans-serif;text-align:center;margin-top:40px'>Connecting to Tailscale...</p>"),eK(e)},fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>ek(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eo&&(0,a.jsx)(h,{status:eo})]})}),(0,a.jsx)(i.aF,{isOpen:ew,title:"Disable Tailscale",onClose:()=>!el&&ev(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:ez,fullWidth:!0,disabled:el,variant:"danger",children:el?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>ev(!1),variant:"ghost",fullWidth:!0,disabled:el,children:"Cancel"})]})]})})]})}function x({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function h({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function u({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function p({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}m.propTypes={machineId:r().string.isRequired}}}]);
3
+ This key will stop working immediately but can be resumed later.`)&&eB(e.id,t):eB(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>eZ(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:g,title:"Create API Key",onClose:()=>{y(!1),f("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:b,onChange:e=>f(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eM,fullWidth:!0,disabled:!b.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{y(!1),f("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!j,title:"API Key Created",onClose:()=>k(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:j||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===eT?"check":"content_copy",onClick:()=>e_(j,"created_key"),children:"created_key"===eT?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>k(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:V,title:"Enable Tunnel",onClose:()=>X(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local OpenrouterX to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:c.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eF,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>X(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:G,title:"Disable Tunnel",onClose:()=>!z&&Y(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eW,fullWidth:!0,disabled:z,variant:"danger",children:z?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>Y(!1),variant:"ghost",fullWidth:!0,disabled:z,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:ej,title:"Tailscale Funnel",onClose:()=>{ex||(ek(!1),ey(""),ec(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ed&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ed&&!ex&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:eR,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>ek(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ex&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),eu.length>0&&(0,a.jsx)("div",{ref:eN,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:eu.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ed&&!ex&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>{let e=window.open("","tailscale_auth","width=600,height=700");e&&e.document.write("<p style='font-family:sans-serif;text-align:center;margin-top:40px'>Connecting to Tailscale...</p>"),eK(e)},fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>ek(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eo&&(0,a.jsx)(h,{status:eo})]})}),(0,a.jsx)(i.aF,{isOpen:ew,title:"Disable Tailscale",onClose:()=>!el&&ev(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:ez,fullWidth:!0,disabled:el,variant:"danger",children:el?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>ev(!1),variant:"ghost",fullWidth:!0,disabled:el,children:"Cancel"})]})]})})]})}function x({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function h({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function u({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function p({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}m.propTypes={machineId:r().string.isRequired}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7537],{21004:(e,t,s)=>{Promise.resolve().then(s.bind(s,45699))},45699:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),l=s(35497);function n(e){return Array.isArray(e)?e.length:0}function i({label:e,value:t,skipValue:s=!1}){return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase text-text-muted/70",children:e}),(0,a.jsx)("p",{className:"mt-1 break-words text-sm text-text-main","data-i18n-skip":s?"true":void 0,children:t||"None"})]})}function o({icon:e,label:t,value:s,tone:r="default"}){let l={default:"text-text-main",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",success:"text-green-600 dark:text-green-400"}[r];return(0,a.jsxs)("div",{className:"flex min-h-20 items-center gap-3 rounded-lg border border-border-subtle bg-bg px-4 py-3",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] ${l}`,children:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:t}),(0,a.jsx)("p",{className:`mt-1 text-lg font-semibold ${l}`,children:s})]})]})}function d(){let[e,t]=(0,r.useState)(null),[s,d]=(0,r.useState)(!0),[c,x]=(0,r.useState)(""),m=(0,r.useCallback)(async({setBusy:e=!0}={})=>{e&&d(!0),e&&x("");try{let e=await fetch("/api/network-analysis",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Failed to load diagnostics");t(s)}catch(e){x(e.message||"Failed to load diagnostics")}finally{d(!1)}},[]);(0,r.useEffect)(()=>{fetch("/api/auth/me").then(e=>e.json()).then(e=>{"sub_user"===e.role&&(window.location.href="/dashboard/usage")}).catch(()=>{});let e=setTimeout(()=>{m({setBusy:!1})},0);return()=>clearTimeout(e)},[m]);let u=(0,r.useMemo)(()=>{var t;return"healthy"===(t=e?.verdict)?{label:"Healthy",variant:"success",title:"No transport errors in sampled logs",detail:"The current app log window does not show route loss, DNS failures, proxy timeout, or socket reset patterns."}:"upstream_or_socket_instability"===t?{label:"Socket resets",variant:"warning",title:"Upstream sockets were interrupted",detail:"Requests were reset while in flight. This can come from upstream, Wi-Fi churn, or an intermediate proxy."}:{label:"External route instability",variant:"warning",title:"Network path instability is affecting OpenrouterX",detail:"The log pattern points to local route loss, transient TLS disconnects, or the configured upstream proxy timing out before API calls complete."}},[e?.verdict]),p=e?.logs?.errorCounts||{},b=e?.project||{},h=b.outboundProxy||{},g=b.mitm||{};return(0,a.jsxs)("div",{className:"space-y-5",children:[(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:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(l.Ex,{variant:u.variant,dot:!0,children:u.label}),e?.generatedAt&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{children:"Updated"})," ",(0,a.jsx)("span",{"data-i18n-skip":"true",children:function(e){if(!e)return"Unknown";let t=new Date(e);return Number.isNaN(t.getTime())?"Unknown":t.toLocaleString()}(e.generatedAt)})]})]}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-text-main",children:u.title}),(0,a.jsx)("p",{className:"mt-1 max-w-3xl text-sm text-text-muted",children:u.detail})]}),(0,a.jsx)(l.$n,{icon:"refresh",variant:"outline",loading:s,onClick:m,children:"Refresh"})]}),c&&(0,a.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-600 dark:text-red-400",children:c}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[(0,a.jsx)(o,{icon:"route",label:"Route loss",value:p.EADDRNOTAVAIL||0,tone:(p.EADDRNOTAVAIL||0)>0?"warning":"success"}),(0,a.jsx)(o,{icon:"sync_problem",label:"Socket resets",value:(p.ECONNRESET||0)+(p.TLS_DISCONNECTED||0),tone:p.ECONNRESET||p.TLS_DISCONNECTED?"warning":"success"}),(0,a.jsx)(o,{icon:"vpn_lock",label:"Proxy failures",value:p.PROXY_FAILED||0,tone:(p.PROXY_FAILED||0)>0?"warning":"success"}),(0,a.jsx)(o,{icon:"dns",label:"DNS errors",value:(p.ENOTFOUND||0)+(p.EAI_AGAIN||0),tone:p.ENOTFOUND||p.EAI_AGAIN?"error":"success"})]}),(0,a.jsxs)("div",{className:"grid gap-5 xl:grid-cols-[1fr_1.1fr]",children:[(0,a.jsx)(l.Zp,{title:"Project Network Scope",icon:"hub",padding:"md",children:(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(i,{label:"System proxy",value:b.systemProxyEnabled?"Enabled outside OpenrouterX":"No macOS system proxy detected"}),(0,a.jsx)(i,{label:"Risk level",value:b.riskLevel||"Unknown"}),(0,a.jsx)(i,{label:"Outbound proxy",value:h.enabled?h.url:"Disabled",skipValue:h.enabled}),(0,a.jsx)(i,{label:"Outbound scope",value:"targeted"===h.scope?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"Targeted"}),": ",(0,a.jsx)("span",{"data-i18n-skip":"true",children:(h.targets||[]).join(", ")})]}):h.scope}),(0,a.jsx)(i,{label:"MITM",value:g.enabled?"Enabled":"Disabled"}),(0,a.jsx)(i,{label:"MITM DNS tools",value:n(g.enabledTools)?g.enabledTools.join(", "):"None",skipValue:n(g.enabledTools)>0}),(0,a.jsx)(i,{label:"Cloudflare tunnel",value:b.tunnels?.cloudflareEnabled?"Enabled":"Disabled"}),(0,a.jsx)(i,{label:"Tailscale",value:b.tunnels?.tailscaleEnabled?"Enabled":"Disabled"})]})}),(0,a.jsxs)(l.Zp,{title:"Current Machine State",icon:"monitor_heart",padding:"md",children:[(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(i,{label:"Platform",value:e?.system?.platform,skipValue:!0}),(0,a.jsx)(i,{label:"Hostname",value:e?.system?.hostname,skipValue:!0}),(0,a.jsx)(i,{label:"Default route",value:(e?.system?.route?.output||"").match(/interface:\s*(\S+)/)?.[1]||"Unknown",skipValue:!0}),(0,a.jsx)(i,{label:"Wi-Fi status",value:(e?.system?.ifconfig?.output||"").match(/status:\s*(\S+)/)?.[1]||"Unknown"})]}),(0,a.jsxs)("details",{className:"mt-4 rounded-lg border border-border-subtle bg-bg p-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-sm font-semibold text-text-main",children:"Raw DNS and proxy snapshot"}),(0,a.jsx)("pre",{className:"mt-3 max-h-64 overflow-auto whitespace-pre-wrap break-words text-xs text-text-muted",children:["--- scutil --proxy ---",e?.system?.proxy?.output||"Unavailable","--- scutil --dns ---",e?.system?.dns?.output||"Unavailable"].join("\n")})]})]})]}),(0,a.jsx)(l.Zp,{title:"Findings",icon:"fact_check",padding:"md",children:(0,a.jsx)("div",{className:"space-y-3",children:(e?.logs?.findings||[]).map((e,t)=>(0,a.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-bg p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(l.Ex,{variant:"warning"===e.severity?"warning":"success"===e.severity?"success":"info",children:e.severity}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e.title})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:e.detail})]},`${e.title}-${t}`))})}),(0,a.jsx)(l.Zp,{title:"Network Error Timeline",icon:"timeline",padding:"md",children:0===(e?.logs?.timeline||[]).length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No network transport errors in the sampled logs."}):(0,a.jsx)("div",{className:"max-h-[520px] overflow-auto rounded-lg border border-border-subtle",children:(e?.logs?.timeline||[]).slice().reverse().map((e,t)=>(0,a.jsxs)("div",{className:"border-b border-border-subtle bg-bg p-3 last:border-b-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-text-muted","data-i18n-skip":"true",children:e.time||"unknown"}),(0,a.jsx)(l.Ex,{size:"sm",variant:"mitm"===e.source?"primary":"default",children:e.source}),e.categories.map(e=>(0,a.jsx)(l.Ex,{size:"sm",variant:"EADDRNOTAVAIL"===e?"warning":"default",className:"uppercase","data-i18n-skip":"true",children:e},e))]}),(0,a.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-text-muted","data-i18n-skip":"true",children:e.message})]},`${e.time}-${t}`))})})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=21004)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{53655:(e,t,s)=>{Promise.resolve().then(s.bind(s,84893))},84893:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var i=s(95155),a=s(12115),r=s(73321),l=s(98500),o=s.n(l),n=s(5772),d=s(35497),c=s(52679),p=s(28777),m=s(11059);let x=new Map;async function u(e){if(!e?.url||!e?.type)return[];let t=x.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return x.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}var h=s(14051),f=s.n(h);function y({model:e,fullModel:t,displayModel:s,alias:a,copied:r,onCopy:l,testStatus:o,isCustom:n,isFree:d,onDeleteAlias:c,onTest:p,isTesting:m,onDisable:x}){let u="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:u?{color:u}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:s||t}),e.name&&(0,i.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),p&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:p,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:r===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,i.jsx)("button",{onClick:x,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function g({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:r,onTest:l,testStatus:o,isTesting:n}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),l&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:l,disabled:n,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0,children:n?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function b({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:r,onCopy:l,onSetAlias:o,onDeleteAlias:n,connections:c,isAnthropic:p}){let[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[N,w]=(0,a.useState)({}),k=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();w(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),S=i=>{let a,r=`${e}/${i}`;if(Object.values(s).includes(r))return null;let l=(a=i.split("/"))[a.length-1];if(!s[l])return l;let o=`${t}-${l}`;return s[o]?null:o},$=async()=>{if(!m.trim()||u)return;let t=m.trim(),s=S(t);if(!s)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await o(t,s,e),x("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},A=async()=>{if(f)return;let t=c.find(e=>!1!==e.isActive);if(t){y(!0);try{let s=await fetch(`/api/providers/${t.id}/models`),i=await s.json();if(!s.ok)return void alert(i.error||"Failed to import models");let a=i.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let t of a){let s=t.id||t.name||t.model;if(!s)continue;let i=S(s);i&&(await o(s,i,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{y(!1)}}},T=c.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",p?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&$(),placeholder:p?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:$,disabled:!m.trim()||u,children:u?"Adding...":"Add"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!T||f,children:f?"Importing...":"Import from /models"})]}),!T&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({modelId:e,fullModel:s,alias:a})=>(0,i.jsx)(g,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:l,onDeleteAlias:()=>n(a),onTest:c.length>0?()=>k(e):void 0,testStatus:N[e],isTesting:v===e},s))})]})}function v({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function j({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:n,onToggleActive:c,onUpdateProxy:p,onEdit:m,onDelete:x}){let[u,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),g=(0,a.useRef)(null),b=new Map((t||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,w=N?b.get(N):null,k=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!N||k,S=w?`Pool: ${w.name}`:N?`Pool: ${N} (inactive/missing)`:k?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",$="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);$=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{$=t}}let A=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",T="default";w?.isActive===!0?T="success":(N||k)&&(T="error"),(0,a.useEffect)(()=>{if(!u)return;let e=e=>{g.current&&!g.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let O=async e=>{y(!0);try{await p("__none__"===e?null:e)}finally{y(!1),h(!1)}},P=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),I=s?P(e.email)?e.email:P(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name,[E,R]=(0,a.useState)(!1),_=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{R(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=_?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[_]);let U="unavailable"!==e.testStatus||E?e.testStatus:"active";return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:s?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:I}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(d.Ex,{variant:!1===e.isActive?"default":"active"===U||"success"===U?"success":"error"===U||"expired"===U||"unavailable"===U?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":U||"Unknown"}),C&&(0,i.jsx)(d.Ex,{variant:T,size:"sm",children:"Proxy"}),E&&!1!==e.isActive&&(0,i.jsx)(v,{until:_}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),$&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:$}),A&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:A,children:["no_proxy: ",A]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:g,children:[(0,i.jsxs)("button",{onClick:()=>h(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:f,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:f?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),u&&(0,i.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>O("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>O(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,i.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}function N({isOpen:e,provider:t,providerName:s,isCompatible:r,isAnthropic:l,authType:o,authHint:n,website:c,proxyPools:p,onSave:m,onClose:x}){let u="__none__",h="ollama-local"===t,f="cookie"===o,y=f?"Cookie Value":"API Key",g=f?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":"",b="azure"===t,v="cloudflare-ai"===t,[j,w]=(0,a.useState)({name:"",apiKey:"",priority:1,proxyPoolId:u,ollamaHostUrl:""}),[k,C]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[S,$]=(0,a.useState)({accountId:""}),[A,T]=(0,a.useState)(!1),[O,P]=(0,a.useState)(null),[I,E]=(0,a.useState)(!1),R=h?"Ollama Local":f?`${s||t} Cookie`:"Production Key";(0,a.useEffect)(()=>{e&&(w({name:r?R:"",apiKey:"",priority:1,proxyPoolId:u,ollamaHostUrl:""}),C({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),$({accountId:""}),T(!1),P(null),E(!1))},[R,r,e]);let _=()=>h&&j.ollamaHostUrl.trim()?{baseUrl:j.ollamaHostUrl.trim()}:b?{azureEndpoint:k.azureEndpoint,apiVersion:k.apiVersion,deployment:k.deployment,organization:k.organization}:v?{accountId:S.accountId}:void 0,U=async()=>{T(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:j.apiKey,providerSpecificData:_()})}),s=await e.json();P(s.valid?"success":"failed")}catch{P("failed")}finally{T(!1)}},D=async()=>{if(!t||!h&&!j.apiKey)return;let e=j.name.trim()||R;E(!0);try{let s=!1;try{T(!0),P(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:j.apiKey,providerSpecificData:_()})});s=!!(await e.json()).valid,P(s?"success":"failed")}catch{P("failed")}finally{T(!1)}await m({name:e,apiKey:j.apiKey,priority:j.priority,proxyPoolId:j.proxyPoolId===u?null:j.proxyPoolId,testStatus:s?"active":"unknown",providerSpecificData:_()})}finally{E(!1)}};return t?(0,i.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${y}`,onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.pd,{label:"Name",value:j.name,onChange:e=>w({...j,name:e.target.value}),placeholder:R}),h&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:"Ollama Host URL",value:j.ollamaHostUrl,onChange:e=>w({...j,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:U,disabled:A||I,variant:"secondary",children:A?"Checking...":"Check"})})]}),!h&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:y,type:f?"text":"password",value:j.apiKey,onChange:e=>w({...j,apiKey:e.target.value}),placeholder:g,className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:U,disabled:!j.apiKey||A||I,variant:"secondary",children:A?"Checking...":"Check"})})]}),f&&n&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[n,c&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",c.replace(/^https?:\/\//,"")]})]})]}),h&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),O&&(0,i.jsx)(d.Ex,{variant:"success"===O?"success":"error",children:"success"===O?"Valid":"Invalid"}),r&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${s||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${s||"OpenAI Compatible"} via /models on your base URL.`}),v&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(d.pd,{label:"Account ID",value:S.accountId,onChange:e=>$({...S,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),b&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(d.pd,{label:"Azure Endpoint",value:k.azureEndpoint,onChange:e=>C({...k,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(d.pd,{label:"Deployment Name",value:k.deployment,onChange:e=>C({...k,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(d.pd,{label:"API Version",value:k.apiVersion,onChange:e=>C({...k,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(d.pd,{label:"Organization",value:k.organization,onChange:e=>C({...k,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(d.pd,{label:"Priority",type:"number",value:j.priority,onChange:e=>w({...j,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(d.l6,{label:"Proxy Pool",value:j.proxyPoolId,onChange:e=>w({...j,proxyPoolId:e.target.value}),options:[{value:u,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:D,fullWidth:!0,disabled:I||!h&&!j.apiKey||b&&(!k.azureEndpoint||!k.deployment||!k.organization)||v&&!S.accountId,children:I?"Saving...":"Save"}),(0,i.jsx)(d.$n,{onClick:x,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({isOpen:e,node:t,onSave:s,onClose:r,isAnthropic:l}){let[o,n]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,a.useState)(!1),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[f,y]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&n({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){p(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};l||(e.apiType=o.apiType),await s(e)}finally{p(!1)}}},j=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{y(!1)}};return t?(0,i.jsx)(d.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.pd,{label:"Name",value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(d.pd,{label:"Prefix",value:o.prefix,onChange:e=>n({...o,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,i.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>n({...o,apiType:e.target.value})}),(0,i.jsx)(d.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>n({...o,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>x(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(d.$n,{onClick:j,disabled:!m||f||!o.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(d.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,i.jsx)(d.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,i.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function k({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:r,onClose:l}){var o;let n,[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[f,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(p(""),x(null),h(""),y(!1))},[e]);let g=(o=c.trim(),n=`${t}/`,o.startsWith(n)?o.slice(n.length):o),b=async()=>{if(g){x("testing"),h("");try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${g}`})}),s=await e.json();x(s.ok?"ok":"error"),h(s.error||"")}catch(e){x("error"),h(e.message)}}},v=async()=>{if(g&&!f){y(!0);try{await r(g)}finally{y(!1)}}};return(0,i.jsx)(d.aF,{isOpen:e,onClose:l,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:c,onChange:e=>{p(e.target.value),x(null),h("")},onKeyDown:e=>{"Enter"===e.key&&b()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(d.$n,{type:"button",variant:"secondary",icon:"science",loading:"testing"===m,onClick:b,disabled:!g||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:g||"model-id"})]})]}),"ok"===m&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:u||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(d.$n,{type:"button",onClick:l,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(d.$n,{type:"button",onClick:v,fullWidth:!0,size:"sm",disabled:!g||f,children:f?"Adding...":"Add Model"})]})]})})}function C({isOpen:e,onClose:t,onSuccess:s}){let[r,l]=(0,a.useState)([]),[o,n]=(0,a.useState)(""),[c,p]=(0,a.useState)(!1),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),f=()=>{l([]),n(""),x(null),h(null),t()},y=async()=>{p(!0),x(null),h(null);try{let e=await Promise.all(r.map(async e=>({filename:e.name,jsonText:await e.text()}))),t=o.trim()?[{filename:"pasted JSON",jsonText:o.trim()}]:[],i=[...e,...t];if(0===i.length)throw Error("Select JSON files or paste JSON first");let a=await fetch("/api/oauth/codex/import-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:i})}),l=await a.json();if(!a.ok)throw Error(l.error||"Failed to import accounts");x(l),l.imported?.length>0&&s?.()}catch(e){h(e.message||"Failed to import accounts")}finally{p(!1)}},g=m?.imported?.length||0,b=m?.skipped?.length||0;return(0,i.jsx)(d.aF,{isOpen:e,title:"Import Codex Accounts",onClose:f,size:"lg",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"rounded-lg border border-border bg-surface/50 p-3",children:[(0,i.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"JSON files"}),(0,i.jsx)("input",{type:"file",accept:".json,application/json",multiple:!0,onChange:e=>l(Array.from(e.target.files||[])),className:"block w-full text-sm text-text-muted file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-white hover:file:bg-primary/90"}),r.length>0&&(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.map(e=>(0,i.jsx)("span",{className:"rounded bg-primary/10 px-2 py-0.5 text-xs text-primary",children:e.name},`${e.name}-${e.size}`))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"mb-2 block text-sm font-medium",children:"Paste JSON"}),(0,i.jsx)("textarea",{value:o,onChange:e=>n(e.target.value),placeholder:'[{ "type": "codex", "access_token": "...", "refresh_token": "..." }]',className:"h-36 w-full resize-none rounded-md border border-black/10 bg-white px-3 py-2 font-mono text-xs text-text-main shadow-inner transition-all placeholder-text-muted/60 focus:border-primary/50 focus:outline-none focus:ring-1 focus:ring-primary/30 dark:border-white/10 dark:bg-white/5"})]}),(0,i.jsx)("div",{className:"rounded-lg border border-border bg-background/60 px-3 py-2 text-xs text-text-muted",children:"Auto-detects Codex Session JSON, CLI Proxy API Auth JSON, and Sub2API JSON."}),u&&(0,i.jsx)("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-600",children:u}),m&&(0,i.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-3",children:[(0,i.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-sm",children:[(0,i.jsxs)("span",{className:"font-medium text-green-600",children:[g," imported"]}),b>0&&(0,i.jsxs)("span",{className:"text-text-muted",children:[b," skipped"]})]}),m.imported?.length>0&&(0,i.jsx)("div",{className:"max-h-32 overflow-auto rounded border border-border/70",children:m.imported.map(e=>(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border/70 px-2 py-1.5 last:border-b-0",children:[(0,i.jsx)("span",{className:"min-w-0 truncate text-xs",children:e.email||e.displayName||e.name||e.id}),(0,i.jsx)("span",{className:"shrink-0 text-xs text-text-muted",children:e.sourceFormat})]},e.id))}),m.skipped?.length>0&&(0,i.jsx)("div",{className:"mt-2 max-h-28 overflow-auto rounded border border-border/70",children:m.skipped.map((e,t)=>(0,i.jsxs)("div",{className:"border-b border-border/70 px-2 py-1.5 text-xs last:border-b-0",children:[(0,i.jsx)("span",{className:"font-medium",children:e.filename}),(0,i.jsxs)("span",{className:"text-text-muted",children:[" \xb7 ",e.reason]})]},`${e.filename}-${t}`))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(d.$n,{onClick:y,loading:c,disabled:c||!r.length&&!o.trim(),fullWidth:!0,children:"Import"}),(0,i.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Close"})]})]})})}function S(){let e,t=(0,r.useParams)(),s=(0,r.useRouter)(),l=t.id,[x,h]=(0,a.useState)([]),[f,g]=(0,a.useState)(!0),[v,S]=(0,a.useState)(null),[$,A]=(0,a.useState)([]),[T,O]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!1),[E,R]=(0,a.useState)(!1),[_,U]=(0,a.useState)(!1),[D,z]=(0,a.useState)(null),[q,M]=(0,a.useState)(!1),[J,L]=(0,a.useState)(!1),[F,K]=(0,a.useState)(!1),[W,V]=(0,a.useState)(!1),[H,B]=(0,a.useState)(null),[G,Q]=(0,a.useState)({}),[Z,X]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)({}),[et,es]=(0,a.useState)(""),[ei,ea]=(0,a.useState)(null),[er,el]=(0,a.useState)(!1),[eo,en]=(0,a.useState)([]),[ed,ec]=(0,a.useState)("__none__"),[ep,em]=(0,a.useState)(!1),[ex,eu]=(0,a.useState)(null),[eh,ef]=(0,a.useState)(""),[ey,eg]=(0,a.useState)("auto"),[eb,ev]=(0,a.useState)([]),[ej,eN]=(0,a.useState)([]),[ew,ek]=(0,a.useState)([]),{copied:eC,copy:eS}=(0,m.C)(),e$=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l]||c.br[l],eA=!!c.zN[l]||!!c.IS[l],eT=!!c.IS[l]?.noAuth,eO=(0,p.KC)(l),eP=(0,c.wG)(l),eI=(0,c.mq)(l),eE=(0,c.gb)(l),eR=eI||eE;c.Q2[l]?.thinkingConfig||c.s9.extended;let e_=eR?l:eP,eU=eR?v?.prefix||l:eP,eD="codex"===l,ez=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(e_)}`,{cache:"no-store"}),t=await e.json();e.ok&&ek(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[e_]),eq=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:e_,ids:[e]})})).ok&&await ez()}catch(e){console.log("Error disabling model:",e)}},eM=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(e_)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ez()}catch(e){console.log("Error enabling model:",e)}},eJ=async e=>{if(e.length&&confirm(`Disable all ${e.length} model(s)?`))try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:e_,ids:e})})).ok&&await ez()}catch(e){console.log("Error disabling all models:",e)}},eL=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(e_)}`,{method:"DELETE"})).ok&&await ez()}catch(e){console.log("Error enabling all models:",e)}},eF=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Q(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===l&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eN(e.models)}).catch(()=>{})},[l]);let eK=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=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"})]),a=await e.json(),r=await t.json(),o=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===l);h(e)}s.ok&&A(o.proxyPools||[]);let d=(n.providerStrategies||{})[l]||{};eu(d.fallbackStrategy||null),ef(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(n.providerThinking||{})[l]||{};if(eg(c.mode||"auto"),t.ok){let e=(r.nodes||[]).find(e=>e.id===l)||null;if(!e&&eR)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===l)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},[l,eR]),eW=async e=>{try{let t=await fetch(`/api/provider-nodes/${l}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(S(s.node),await eK(),K(!1))}catch(e){console.log("Error updating provider node:",e)}},eV=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let r={...i};0===Object.keys(a).length?delete r[l]:r[l]=a,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:r})})}catch(e){console.log("Error saving provider strategy:",e)}};(0,a.useEffect)(()=>{(async()=>{await Promise.all([eK(),eF(),ez()])})()},[eK,eF,ez]),(0,a.useEffect)(()=>{let e=(c.zN[l]||c.fg[l]||c.IS[l]||c.nJ[l])?.modelsFetcher;e&&u(e).then(ev)},[l]);let eH=async(e,t,s=eP)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await eF();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},eB=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eF()}catch(e){console.log("Error deleting alias:",e)}},eG=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(x.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eQ=()=>{eK(),O(!1)},eZ=async()=>{if(!_){U(!0),z(null);try{let e=await fetch("/api/oauth/codex/refresh-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();if(!e.ok&&!t?.refreshed?.length)throw Error(t.error||"Failed to refresh Codex tokens");z(t),await eK()}catch(e){z({error:e.message,refreshed:[],failed:[],skipped:[]})}finally{U(!1)}}},eX=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:l,...e})})).ok&&(await eK(),M(!1))}catch(e){console.log("Error saving connection:",e)}},eY=async e=>{try{(await fetch(`/api/providers/${H.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eK(),L(!1))}catch(e){console.log("Error updating connection:",e)}},e0=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},e1=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(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 eK()}},e2=(0,a.useMemo)(()=>new Set(x.map(e=>e.id)),[x]),e5=(0,a.useMemo)(()=>eo.filter(e=>e2.has(e)),[eo,e2]),e3=x.filter(e=>e5.includes(e.id));x.length>0&&(e5.length,x.length);let e4=(()=>{if(0===e3.length)return"";let e=new Set(e3.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let s=$.find(e=>e.id===t);return`All selected currently bound to ${s?.name||t}`}return"Selected connections have mixed proxy bindings"})(),e6=()=>{ep||V(!1)},e7=async()=>{if(0===e5.length)return;let e="__none__"===ed?null:ed;em(!0);try{let t=[];for(let s of e5)try{let i=await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e})});t.push(i.ok)}catch(e){console.log("Error applying bulk proxy pool for",s,e),t.push(!1)}let s=t.filter(e=>!e).length;s>0&&alert(`Updated with ${s} failed request(s).`),await eK(),en([]),ec("__none__"),V(!1)}catch(e){console.log("Error applying bulk proxy pool:",e)}finally{em(!1)}},e8=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/3 dark:divide-white/3",children:x.map((e,t)=>(0,i.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(j,{connection:e,proxyPools:$,isOAuth:eA,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>e1(t,t-1),onMoveDown:()=>e1(t,t+1),onToggleActive:t=>e0(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(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:()=>{B(e),L(!0)},onDelete:()=>eG(e.id)})})},e.id))}),e9=[{value:"__none__",label:"None"},...$.map(e=>({value:e.id,label:e.name}))],te=0===e5.length?"Select one or more connections, then click Proxy Action.":e4,tt=e5.length>0&&!ep,ts=(0,i.jsx)(d.aF,{isOpen:W,onClose:e6,title:`Proxy Action (${e5.length} selected)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(d.l6,{label:"Proxy Pool",value:ed,onChange:e=>ec(e.target.value),options:e9,placeholder:"None"}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:te}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Selecting None will unbind selected connections from proxy pool."}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,i.jsx)(d.$n,{onClick:e7,fullWidth:!0,disabled:!tt,children:ep?"Applying...":"Apply"}),(0,i.jsx)(d.$n,{onClick:e6,variant:"ghost",fullWidth:!0,disabled:ep,children:"Cancel"})]})]})}),ti=async e=>{if(!ei){ea(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e_}/${e}`})}),s=await t.json();ee(t=>({...t,[e]:s.ok?"ok":"error"})),es(s.ok?"":s.error||"Model not reachable")}catch{ee(t=>({...t,[e]:"error"})),es("Network error")}finally{ea(null)}}};return f?(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(d.Qv,{}),(0,i.jsx)(d.Qv,{})]}):e$?(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e$.color}15`},children:Z?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:e$.color},children:e$.textIcon||e$.id.slice(0,2).toUpperCase()}):(0,i.jsx)(n.default,{src:eI&&e$.apiType?"responses"===e$.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":eE?"/providers/anthropic-m.png":`/providers/${e$.id}.png`,alt:e$.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>X(!0)})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e$.name}),(e$.notice?.apiKeyUrl||e$.notice?.signupUrl||e$.website)&&(0,i.jsxs)("a",{href:e$.notice?.apiKeyUrl||e$.notice?.signupUrl||e$.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e$.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),e$.deprecated&&(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e$.deprecationNotice})]}),e$.notice?.text&&!e$.deprecated&&(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e$.notice.text}),e$.notice.apiKeyUrl&&(0,i.jsx)("a",{href:e$.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 →"})]}),eR&&v&&(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:eE?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[eE?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",eE?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>M(!0),disabled:x.length>0,className:"w-full sm:w-auto",children:"Add"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>K(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${eE?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${l}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},className:"w-full sm:w-auto",children:"Delete"})]})]}),x.length>0&&(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),eT?(0,i.jsx)(d.gw,{providerId:l}):(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsx)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(d.lM,{checked:"round-robin"===ex,onChange:e=>{let t=e?"round-robin":null,s=e?eh||"1":eh;e&&!eh&&ef("1"),eu(t),eV(t,s)}}),"round-robin"===ex&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eh,onChange:e=>{var t;ef(t=e.target.value),eV("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})})]}),0===x.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:eA?"lock":"key"})}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"})]}),!eR&&(0,i.jsxs)("div",{className:"flex gap-2",children:["iflow"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),children:"Cookie"}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>eA?O(!0):M(!0),children:"iflow"===l?"OAuth":"Add Connection"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>R(!0),children:"Batch Import"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:eZ,loading:_,children:"Refresh Tokens"})]})]}):(0,i.jsxs)(i.Fragment,{children:[e8,!eR&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>I(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),(0,i.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>eA?O(!0):M(!0),className:"w-full sm:w-auto",children:"Add"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"upload_file",variant:"secondary",onClick:()=>R(!0),className:"w-full sm:w-auto",children:"Batch Import"}),"codex"===l&&(0,i.jsx)(d.$n,{size:"sm",icon:"sync",variant:"secondary",onClick:eZ,loading:_,className:"w-full sm:w-auto",children:"Refresh Tokens"})]})]}),"codex"===l&&D&&(0,i.jsx)("div",{className:`mt-4 rounded-lg border px-3 py-2 text-sm ${D.error?"border-red-500/30 bg-red-500/10 text-red-600":"border-green-500/30 bg-green-500/10 text-green-700 dark:text-green-300"}`,children:D.error?D.error:`Token refresh complete: ${D.refreshed?.length||0} refreshed, ${D.failed?.length||0} failed, ${D.skipped?.length||0} skipped.`})]}),(0,i.jsxs)(d.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!eR&&(e=[...eO,...ej.filter(e=>!eO.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!ew.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[ew.length>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:eL,children:"Active All"}),e.length>0&&(0,i.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>eJ(e),children:"Disable All"})]}))]}),!!et&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 wrap-break-word",children:et}),(()=>{let e,t,s;if(eR)return(0,i.jsx)(b,{providerStorageAlias:e_,providerDisplayAlias:eU,modelAliases:G,copied:eC,onCopy:eS,onSetAlias:eH,onDeleteAlias:eB,connections:x,isAnthropic:eE});let a=[...eO,...ej.filter(e=>!eO.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),r=new Set(ew),o=a.filter(e=>!r.has(e.id)),n=a.filter(e=>r.has(e.id)),d=Object.entries(G).filter(([e,t])=>{let s=`${e_}/`;if(!t.startsWith(s))return!1;let i=t.slice(s.length);return e$.passthroughModels?!eO.some(e=>e.id===i):!eO.some(e=>e.id===i)&&e===i}).map(([e,t])=>({id:t.slice(`${e_}/`.length),alias:e,fullModel:t}));return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(y,{model:{id:e.id},fullModel:`${eU}/${e.id}`,displayModel:eD?e.id:`${eU}/${e.id}`,alias:e.alias,copied:eC,onCopy:eS,onSetAlias:()=>{},onDeleteAlias:()=>eB(e.alias),testStatus:Y[e.id],onTest:x.length>0||eT?()=>ti(e.id):void 0,isTesting:ei===e.id,isCustom:!0,isFree:!1},e.id)),o.map(e=>{let t=`${e_}/${e.id}`,s=`${l}/${e.id}`,a=Object.entries(G).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(y,{model:e,fullModel:`${eU}/${e.id}`,displayModel:eD?e.id:`${eU}/${e.id}`,alias:a,copied:eC,onCopy:eS,onSetAlias:t=>eH(e.id,t,e_),onDeleteAlias:()=>eB(a),testStatus:Y[e.id],onTest:x.length>0||eT?()=>ti(e.id):void 0,isTesting:ei===e.id,isFree:e.isFree,onDisable:()=>eq(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>el(!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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),eb.length>0&&(e=new Set(Object.values(G)),t=new Set(eO.map(e=>e.id)),0===(s=eb.filter(s=>!e.has(`${e_}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{let t=e.id.split("/").pop();await eH(e.id,t,e_)},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,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>eM(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,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),ts,"kiro"===l?(0,i.jsx)(d.Mh,{isOpen:T,providerInfo:e$,onSuccess:eQ,onClose:()=>O(!1)}):"cursor"===l?(0,i.jsx)(d.G9,{isOpen:T,onSuccess:eQ,onClose:()=>O(!1)}):"gitlab"===l?(0,i.jsx)(d.vj,{isOpen:T,providerInfo:e$,onSuccess:eQ,onClose:()=>O(!1)}):(0,i.jsx)(d.LF,{isOpen:T,provider:l,providerInfo:e$,onSuccess:eQ,onClose:()=>O(!1)}),"iflow"===l&&(0,i.jsx)(d.vE,{isOpen:P,onSuccess:()=>{eK(),I(!1)},onClose:()=>I(!1)}),"codex"===l&&(0,i.jsx)(C,{isOpen:E,onSuccess:eK,onClose:()=>R(!1)}),(0,i.jsx)(N,{isOpen:q,provider:l,providerName:e$.name,isCompatible:eR,isAnthropic:eE,authType:e$?.authType,authHint:e$?.authHint,website:e$?.website,proxyPools:$,onSave:eX,onClose:()=>M(!1)}),(0,i.jsx)(d.wI,{isOpen:J,connection:H,proxyPools:$,onSave:eY,onClose:()=>L(!1)}),eR&&(0,i.jsx)(w,{isOpen:F,node:v,onSave:eW,onClose:()=>K(!1),isAnthropic:eE}),!eR&&(0,i.jsx)(k,{isOpen:er,providerAlias:e_,providerDisplayAlias:eU,onSave:async e=>{let t=e$?.passthroughModels?e.split("/").pop():e;await eH(e,t,e_),el(!1)},onClose:()=>el(!1)})]}):(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}y.propTypes={model:f().shape({id:f().string.isRequired}).isRequired,fullModel:f().string.isRequired,displayModel:f().string,alias:f().string,copied:f().string,onCopy:f().func.isRequired,testStatus:f().oneOf(["ok","error"]),isCustom:f().bool,isFree:f().bool,onDeleteAlias:f().func,onTest:f().func,isTesting:f().bool,onDisable:f().func},f().string.isRequired,f().string.isRequired,f().string,f().func.isRequired,f().func.isRequired,f().func,f().oneOf(["ok","error"]),f().bool,f().string.isRequired,f().object.isRequired,f().string,f().func.isRequired,f().func.isRequired,f().func.isRequired,b.propTypes={providerStorageAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,modelAliases:f().object.isRequired,copied:f().string,onCopy:f().func.isRequired,onSetAlias:f().func.isRequired,onDeleteAlias:f().func.isRequired,connections:f().arrayOf(f().shape({id:f().string,isActive:f().bool})).isRequired,isAnthropic:f().bool},v.propTypes={until:f().string.isRequired},j.propTypes={connection:f().shape({id:f().string,name:f().string,email:f().string,displayName:f().string,modelLockUntil:f().string,testStatus:f().string,isActive:f().bool,lastError:f().string,priority:f().number,globalPriority:f().number}).isRequired,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string,proxyUrl:f().string,noProxy:f().string,isActive:f().bool})),isOAuth:f().bool.isRequired,isFirst:f().bool.isRequired,isLast:f().bool.isRequired,onMoveUp:f().func.isRequired,onMoveDown:f().func.isRequired,onToggleActive:f().func.isRequired,onUpdateProxy:f().func,onEdit:f().func.isRequired,onDelete:f().func.isRequired},N.propTypes={isOpen:f().bool.isRequired,provider:f().string,providerName:f().string,isCompatible:f().bool,isAnthropic:f().bool,authType:f().string,authHint:f().string,website:f().string,proxyPools:f().arrayOf(f().shape({id:f().string,name:f().string})),onSave:f().func.isRequired,onClose:f().func.isRequired},w.propTypes={isOpen:f().bool.isRequired,node:f().shape({id:f().string,name:f().string,prefix:f().string,apiType:f().string,baseUrl:f().string}),onSave:f().func.isRequired,onClose:f().func.isRequired,isAnthropic:f().bool},k.propTypes={isOpen:f().bool.isRequired,providerAlias:f().string.isRequired,providerDisplayAlias:f().string.isRequired,onSave:f().func.isRequired,onClose:f().func.isRequired},C.propTypes={isOpen:f().bool.isRequired,onClose:f().func.isRequired,onSuccess:f().func}}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,8441,3794,7358],()=>e(e.s=53655)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9516],{64082:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b});var s=i(95155),r=i(35497),n=i(11059);let a="decolua/9router",o="master",c="skills",d=`https://github.com/${a}`,l=`https://raw.githubusercontent.com/${a}/refs/heads/${o}/${c}`,m=`https://github.com/${a}/blob/${o}/${c}`,x=[{id:"9router",name:"OpenrouterX (Entry)",description:"Setup + index of all capabilities. Start here — covers base URL, auth, model discovery, and links to every capability skill.",endpoint:null,icon:"hub",isEntry:!0},{id:"9router-chat",name:"Chat",description:"Chat / code-gen via OpenAI or Anthropic format with streaming.",endpoint:"/v1/chat/completions",icon:"chat"},{id:"9router-image",name:"Image Generation",description:"Text-to-image via DALL-E, Imagen, FLUX, MiniMax, SDWebUI…",endpoint:"/v1/images/generations",icon:"image"},{id:"9router-tts",name:"Text-to-Speech",description:"OpenAI / ElevenLabs / Edge / Google / Deepgram voices.",endpoint:"/v1/audio/speech",icon:"record_voice_over"},{id:"9router-stt",name:"Speech-to-Text",description:"Transcribe audio via OpenAI Whisper, Groq, Gemini, Deepgram, AssemblyAI…",endpoint:"/v1/audio/transcriptions",icon:"mic"},{id:"9router-embeddings",name:"Embeddings",description:"Vectors for RAG / semantic search via OpenAI, Gemini, Mistral…",endpoint:"/v1/embeddings",icon:"scatter_plot"},{id:"9router-web-search",name:"Web Search",description:"Tavily / Exa / Brave / Serper / SearXNG / Google PSE / You.com.",endpoint:"/v1/search",icon:"search"},{id:"9router-web-fetch",name:"Web Fetch",description:"URL → markdown / text / HTML via Firecrawl, Jina, Tavily, Exa.",endpoint:"/v1/web/fetch",icon:"language"}];function p(e){return`${l}/${e}/SKILL.md`}function h({value:e,label:t="Copy link"}){let{copied:i,copy:r}=(0,n.C)(2e3);return(0,s.jsxs)("button",{onClick:()=>r(e),className:"px-2 py-1 rounded-md bg-primary text-white text-[11px] font-medium hover:bg-primary/90 transition-colors cursor-pointer shrink-0 inline-flex items-center gap-1",title:e,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:i?"check":"content_copy"}),i?"Copied!":t]})}function u({skill:e}){var t;let i=p(e.id);return(0,s.jsxs)("div",{className:`flex items-start gap-3 p-4 rounded-[14px] border shadow-[var(--shadow-soft)] transition-colors ${e.isEntry?"border-brand-500/40 bg-brand-500/5":"border-border-subtle bg-surface hover:bg-surface-2"}`,children:[(0,s.jsx)("div",{className:`size-9 rounded-lg flex items-center justify-center shrink-0 ${e.isEntry?"bg-primary text-white":"bg-primary/10 text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("h3",{className:"font-semibold text-sm text-text-main",children:e.name}),e.isEntry&&(0,s.jsx)(r.Ex,{variant:"primary",size:"sm",children:"START HERE"}),e.endpoint&&(0,s.jsx)(r.Ex,{variant:"default",size:"sm",children:(0,s.jsx)("code",{className:"text-[10px]",children:e.endpoint})})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e.description}),(0,s.jsxs)("a",{href:(t=e.id,`${m}/${t}/SKILL.md`),target:"_blank",rel:"noreferrer",className:"text-[11px] text-text-muted hover:text-primary mt-1 inline-flex items-center gap-1 break-all",children:[i,(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),(0,s.jsx)(h,{value:i})]})}function b(){return(0,s.jsxs)("div",{className:"max-w-4xl mx-auto space-y-6",children:[(0,s.jsxs)(r.Zp,{padding:"md",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted mb-2",children:"Paste this to your AI:"}),(0,s.jsxs)("div",{className:"px-3 py-2 rounded bg-surface-2 font-mono text-[12px] text-text-main",children:["Read this skill and use it: ",p("9router")]})]}),(0,s.jsx)("div",{className:"space-y-2",children:x.map(e=>(0,s.jsx)(u,{skill:e},e.id))}),(0,s.jsx)(r.Zp,{padding:"md",children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"More on GitHub"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Browse source, README, and examples."})]}),(0,s.jsxs)("a",{href:`${d}/tree/master/skills`,target:"_blank",rel:"noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"}),"View on GitHub"]})]})})]})}},80961:(e,t,i)=>{Promise.resolve().then(i.bind(i,64082))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=80961)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{40210:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))},81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var a=s(95155),l=s(12115),n=s(73321),r=s(35497),i=s(84588),d=s(92542),o=s(31474);function c({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let d={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,o.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",d[r]||d.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:l,onPageSizeChange:n,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),p=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,o.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4",r),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:c})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[n&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>n(Number(e.target.value)),className:(0,o.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),p[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(1),className:"w-9 px-0",children:"1"}),p[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."})]}),p.map(t=>(0,a.jsx)(d.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>l(t),className:"w-9 px-0",children:t},t)),p[p.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[p[p.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."}),(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(i),className:"w-9 px-0",children:i})]}),(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(52679);let p=null,h=null;async function u(){if(p&&h)return{providerNameCache:p,providerNodesCache:h};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(h={},t))h[e.id]=e.name;return{providerNameCache:p={...m.Q2,...h},providerNodesCache:h}}function f(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,m.zt)(e)||m.Q2[e];return a?.name||e}function b({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,o.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function j(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function g(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,l.useState)(!1),[p,h]=(0,l.useState)(null),[g,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)([]),[k,y]=(0,l.useState)(null),[S,C]=(0,l.useState)({apiKeyId:"",startDate:"",endDate:""}),D=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/usage/api-keys"),t=await e.json();w(t.apiKeys||[]);let s=await u();y(s.providerNameCache)}catch(e){console.error("Failed to fetch api keys:",e)}},[]),z=(0,l.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});S.apiKeyId&&e.append("apiKeyId",S.apiKeyId),S.startDate&&e.append("startDate",S.startDate),S.endDate&&e.append("endDate",S.endDate);let a=await fetch(`/api/usage/request-details?${e}`),l=await a.json();t(l.details||[]),n(e=>({...e,...l.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,S]);return(0,l.useEffect)(()=>{D()},[D]),(0,l.useEffect)(()=>{z()},[z]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(i.default,{padding:"md",children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"apikey-filter",className:"text-sm font-medium text-text-main",children:"API Key"}),(0,a.jsxs)("select",{id:"apikey-filter",value:S.apiKeyId,onChange:e=>C({...S,apiKeyId:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),children:[(0,a.jsx)("option",{value:"",children:"All Keys"}),N.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:S.startDate,onChange:e=>C({...S,startDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:S.endDate,onChange:e=>C({...S,endDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(d.default,{variant:"ghost",onClick:()=>{C({apiKeyId:"",startDate:"",endDate:""})},disabled:!S.apiKeyId&&!S.startDate&&!S.endDate,children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:f(e.provider,k)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:j(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>{h(e),v(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{n(t=>({...t,page:e}))},onPageSizeChange:e=>{n(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:g,onClose:()=>v(!1),title:"Request Details",width:"lg",children:p&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:p.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(p.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:f(p.provider,k)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,o.cn)("font-medium","success"===p.status?"text-green-600":"text-red-600"),children:p.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",p.latency?.ttft||0,"ms / Total ",p.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:j(p.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(b,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.request,null,2)})}),p.providerRequest&&(0,a.jsx)(b,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.providerRequest,null,2)})}),p.providerResponse&&(0,a.jsx)(b,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof p.providerResponse?JSON.stringify(p.providerResponse,null,2):p.providerResponse})}),(0,a.jsxs)(b,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[p.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:p.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:p.response?.content||"[No content]"})]})]})]})})]})}let v=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function N(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(w,{})})}function w(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)(!1),[d,o]=(0,l.useState)("7d"),c=e.get("tab"),x=c&&["overview","logs","details"].includes(c)?c:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:x,onChange:s=>{if(s===x)return;i(!0);let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1}),setTimeout(()=>i(!1),300)},className:"w-full sm:w-auto"}),"overview"===x&&(0,a.jsx)(r.Iz,{options:v,value:d,onChange:o,size:"sm",className:"w-full sm:w-auto"})]}),s?(0,a.jsx)(r.Qv,{}):(0,a.jsxs)(a.Fragment,{children:["overview"===x&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:d,setPeriod:o,hidePeriodSelector:!0})}),"logs"===x&&(0,a.jsx)(r.gM,{}),"details"===x&&(0,a.jsx)(g,{})]})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=40210)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{40210:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))},81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var a=s(95155),l=s(12115),n=s(73321),r=s(35497),i=s(84588),d=s(92542),o=s(31474);function c({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let d={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,o.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",d[r]||d.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}function x({currentPage:e,pageSize:t,totalItems:s,onPageChange:l,onPageSizeChange:n,className:r}){let i=Math.ceil(s/t),c=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),p=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,o.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4",r),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:c})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[n&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>n(Number(e.target.value)),className:(0,o.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),p[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(1),className:"w-9 px-0",children:"1"}),p[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."})]}),p.map(t=>(0,a.jsx)(d.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>l(t),className:"w-9 px-0",children:t},t)),p[p.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[p[p.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1",children:"..."}),(0,a.jsx)(d.default,{variant:"ghost",size:"sm",onClick:()=>l(i),className:"w-9 px-0",children:i})]}),(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>l(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var m=s(52679);let p=null,h=null;async function u(){if(p&&h)return{providerNameCache:p,providerNodesCache:h};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(h={},t))h[e.id]=e.name;return{providerNameCache:p={...m.Q2,...h},providerNodesCache:h}}function f(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,m.zt)(e)||m.Q2[e];return a?.name||e}function b({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,o.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function j(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function g(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,m]=(0,l.useState)(!1),[p,h]=(0,l.useState)(null),[g,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)([]),[k,y]=(0,l.useState)(null),[S,C]=(0,l.useState)({apiKeyId:"",startDate:"",endDate:""}),D=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/usage/api-keys"),t=await e.json();w(t.apiKeys||[]);let s=await u();y(s.providerNameCache)}catch(e){console.error("Failed to fetch api keys:",e)}},[]),z=(0,l.useCallback)(async()=>{m(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});S.apiKeyId&&e.append("apiKeyId",S.apiKeyId),S.startDate&&e.append("startDate",S.startDate),S.endDate&&e.append("endDate",S.endDate);let a=await fetch(`/api/usage/request-details?${e}`),l=await a.json();t(l.details||[]),n(e=>({...e,...l.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{m(!1)}},[s.page,s.pageSize,S]);return(0,l.useEffect)(()=>{D()},[D]),(0,l.useEffect)(()=>{z()},[z]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(i.default,{padding:"md",children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"apikey-filter",className:"text-sm font-medium text-text-main",children:"API Key"}),(0,a.jsxs)("select",{id:"apikey-filter",value:S.apiKeyId,onChange:e=>C({...S,apiKeyId:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),children:[(0,a.jsx)("option",{value:"",children:"All Keys"}),N.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:S.startDate,onChange:e=>C({...S,startDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:S.endDate,onChange:e=>C({...S,endDate:e.target.value}),className:(0,o.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(d.default,{variant:"ghost",onClick:()=>{C({apiKeyId:"",startDate:"",endDate:""})},disabled:!S.apiKeyId&&!S.startDate&&!S.endDate,children:"Clear Filters"})]})]})}),(0,a.jsxs)(i.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:f(e.provider,k)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:j(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(d.default,{variant:"outline",size:"sm",onClick:()=>{h(e),v(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(x,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{n(t=>({...t,page:e}))},onPageSizeChange:e=>{n(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(c,{isOpen:g,onClose:()=>v(!1),title:"Request Details",width:"lg",children:p&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:p.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(p.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:f(p.provider,k)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,o.cn)("font-medium","success"===p.status?"text-green-600":"text-red-600"),children:p.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",p.latency?.ttft||0,"ms / Total ",p.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:j(p.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:p.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(b,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.request,null,2)})}),p.providerRequest&&(0,a.jsx)(b,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(p.providerRequest,null,2)})}),p.providerResponse&&(0,a.jsx)(b,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof p.providerResponse?JSON.stringify(p.providerResponse,null,2):p.providerResponse})}),(0,a.jsxs)(b,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[p.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:p.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:p.response?.content||"[No content]"})]})]})]})})]})}let v=[{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function N(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(w,{})})}function w(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)(!1),[d,o]=(0,l.useState)("24h"),c=e.get("tab"),x=c&&["overview","logs","details"].includes(c)?c:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:x,onChange:s=>{if(s===x)return;i(!0);let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1}),setTimeout(()=>i(!1),300)},className:"w-full sm:w-auto"}),"overview"===x&&(0,a.jsx)(r.Iz,{options:v,value:d,onChange:o,size:"sm",className:"w-full sm:w-auto"})]}),s?(0,a.jsx)(r.Qv,{}):(0,a.jsxs)(a.Fragment,{children:["overview"===x&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.jK,{period:d,setPeriod:o,hidePeriodSelector:!0})}),"logs"===x&&(0,a.jsx)(r.gM,{}),"details"===x&&(0,a.jsx)(g,{})]})]})}}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=40210)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39,174,204,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{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,318,335,387,501,543,552,675,747,748,907,931,992,997,1070,1088,1110,1118,1200,1288,1337,1382,1451,1512,1566,1666,1686,1697,1860,1910,1946,1949,2121,2198,2284,2296,2525,2772,2785,2797,2919,2922,3025,3038,3079,3102,3397,3472,3507,3528,3549,3562,3568,3579,3883,3888,4010,4245,4286,4422,4444,4656,4896,4993,5018,5079,5107,5177,5211,5226,5377,5466,5685,5745,5922,6100,6107,6268,6319,6432,6479,6529,6580,6594,6619,6740,6743,6819,6919,6988,7131,7158,7218,7241,7311,7429,7442,7445,7508,7520,7824,7851,8026,8167,8207,8246,8453,8489,8573,8648,8673,8736,8791,8814,8870,8948,8974,8975,9027,9069,9088,9141,9199,9321,9461,9678],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);