zevairouter 1.0.199 → 1.0.201

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 (588) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +3 -3
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js.nft.json +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  61. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  63. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  65. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  66. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  67. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  69. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  70. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  71. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  72. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  73. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  74. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  75. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  77. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  78. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  79. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  80. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  81. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  82. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  83. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  84. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  85. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  86. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  87. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  88. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  89. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  90. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js.nft.json +1 -1
  91. package/cli/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  92. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  93. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  94. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  95. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  96. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  97. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  99. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  100. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  101. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  102. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  103. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  104. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  105. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  106. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  107. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js.nft.json +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js.nft.json +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/context/route.js.nft.json +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js.nft.json +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js.nft.json +1 -1
  121. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js.nft.json +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js.nft.json +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js.nft.json +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js.nft.json +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  133. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  135. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  136. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  139. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  141. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  143. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/metrics/route.js.nft.json +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  147. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  149. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  151. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  155. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  159. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js.nft.json +1 -1
  161. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js.nft.json +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js.nft.json +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  181. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  183. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js.nft.json +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  253. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  271. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  288. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  289. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  294. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  295. package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  296. package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  297. package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  298. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  299. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  301. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  302. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  303. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  304. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  305. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  306. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  307. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  308. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  309. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  310. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  311. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  312. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  313. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  314. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  315. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  316. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  317. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  318. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  319. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  320. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  321. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  322. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  323. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  324. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  325. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  326. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  327. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  328. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  329. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  330. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  331. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  332. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  333. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  334. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  335. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  336. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  337. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  338. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  339. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  340. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  341. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  342. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  343. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  344. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  345. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  346. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  347. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  348. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  349. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  350. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  351. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  352. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  353. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  354. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  355. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  356. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  357. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  358. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  359. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  360. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  361. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  362. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  363. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  364. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  365. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  366. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  367. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  368. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  369. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  370. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  371. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  372. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  373. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  374. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  375. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  376. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  377. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  378. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  379. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  380. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  381. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  382. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  383. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  384. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  385. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  386. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  387. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  388. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  389. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  390. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  391. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  392. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  393. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  394. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  395. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  396. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  397. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
  398. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  399. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  400. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  401. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  402. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
  403. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  404. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
  405. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  406. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  407. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  408. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  409. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  410. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  411. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  412. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  413. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  414. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  415. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  416. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  417. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  418. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  419. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  420. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  421. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  422. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  423. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  424. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  425. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  426. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  427. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  428. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  429. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  430. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  431. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  432. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  433. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  434. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  435. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  436. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  437. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  438. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  439. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  440. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  441. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  442. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  443. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  444. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  445. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  446. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  447. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  448. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  449. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  450. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  451. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  452. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  453. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  454. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  455. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  456. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  457. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  458. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  459. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  460. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  461. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  462. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  463. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  464. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  465. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  466. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  467. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  468. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  469. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  470. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  471. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  472. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  473. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  474. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  475. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  476. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  477. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  478. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  479. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  480. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  481. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  482. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  483. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  484. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  485. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  486. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  487. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  488. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  489. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  490. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  491. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  492. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  493. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  494. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  495. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  496. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  497. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  498. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  499. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  500. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  501. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  502. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  503. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  504. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  505. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  506. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  507. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  508. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  509. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  510. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  511. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  512. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  513. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  514. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  515. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  516. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  517. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  518. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  519. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  520. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  521. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  522. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  523. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  524. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  525. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  526. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  527. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  528. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  529. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  530. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  531. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  532. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  533. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  534. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  535. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  536. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  537. package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
  538. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  539. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  540. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  541. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  542. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  543. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  544. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  545. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  546. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  547. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  548. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  549. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  550. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  551. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  552. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  553. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  554. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  555. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  556. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  557. package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js.nft.json +1 -1
  558. package/cli/app/.next-cli-build/server/app-paths-manifest.json +3 -3
  559. package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
  560. package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
  561. package/cli/app/.next-cli-build/server/chunks/4025.js +5 -5
  562. package/cli/app/.next-cli-build/server/chunks/4404.js +1 -1
  563. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
  564. package/cli/app/.next-cli-build/server/chunks/5681.js +1 -1
  565. package/cli/app/.next-cli-build/server/chunks/7276.js +1 -1
  566. package/cli/app/.next-cli-build/server/chunks/7319.js +5 -5
  567. package/cli/app/.next-cli-build/server/chunks/8202.js +1 -0
  568. package/cli/app/.next-cli-build/server/chunks/8255.js +1 -1
  569. package/cli/app/.next-cli-build/server/chunks/8274.js +1 -1
  570. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  571. package/cli/app/.next-cli-build/server/chunks/9489.js +1 -1
  572. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  573. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  574. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  575. package/cli/app/.next-cli-build/static/chunks/{4686-3870bc6cc2baf49c.js → 4686-9853e280b3d115cd.js} +5 -5
  576. package/cli/app/.next-cli-build/static/chunks/620-4f9354613812794d.js +1 -0
  577. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-f12cb6a2bcaec9fe.js → page-15dd47ab818e675d.js} +8 -8
  578. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-4c3a2c103daf032d.js +3 -0
  579. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-53b93e9ce3d13457.js +1 -0
  580. package/cli/app/CHANGELOG.md +11 -0
  581. package/cli/app/package.json +1 -1
  582. package/cli/package.json +1 -1
  583. package/package.json +1 -1
  584. package/cli/app/.next-cli-build/static/chunks/620-abe9e47b22606c8c.js +0 -1
  585. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-be7d9bbb3ce0bb40.js +0 -3
  586. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-7f25296cd5a4eeab.js +0 -1
  587. /package/cli/app/.next-cli-build/static/{vXCx3sJBUb9AL2WtKv2-b → w1sCnXd2bDo0uOd51yNpl}/_buildManifest.js +0 -0
  588. /package/cli/app/.next-cli-build/static/{vXCx3sJBUb9AL2WtKv2-b → w1sCnXd2bDo0uOd51yNpl}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6512:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>J});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(50412),k=c(96919);let l=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function m(a){return l.includes(String(a||""))}function n(a){let b=String(a||"").trim();return b&&m(b)?`/dashboard/automation?provider=${encodeURIComponent(b)}`:"/dashboard/automation"}var o=c(91431),p=c(50377),q=c(99258),r=c(74875);c(22062);var s=c(49885),t=c.n(s);function u({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:k,isTesting:l,onDisable:m,thinkingSuffix:n}){let o="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0,p=n?`${b}(${n})`:b;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:o?{color:o}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.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:p}),a.name&&(0,d.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:a.name})]}),k&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:k,disabled:l,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${l?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:l?{animation:"spin 1s linear infinite"}:void 0,children:l?"progress_activity":"science"})}),(0,d.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:l?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(p,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):m?(0,d.jsx)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function v({models:a,modelAliases:b,providerStorageAlias:c,providerDisplayAlias:d}){let e={...b||{}},f=new Set(Object.values(e)),g=[];for(let b of Array.isArray(a)?a:[]){let a=function(a){if(!a)return"";if("string"==typeof a)return a.trim();let b=a.id||a.name||a.model;return"string"==typeof b?b.trim():""}(b);if(!a)continue;let h=`${c}/${a}`;if(f.has(h))continue;let i=function(a,b,c){let d=a.split("/"),e=d[d.length-1];if(!e)return"";if(!b[e])return e;let f=`${c}-${e}`;if(!b[f])return f;let g=2;for(;b[`${f}-${g}`];)g+=1;return`${f}-${g}`}(a,e,d);i&&(g.push({alias:i,model:h,modelId:a}),e[i]=h,f.add(h))}return g}function w({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function x({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,copied:f,onCopy:g,onSetAlias:h,onDeleteAlias:i,onAliasesChanged:k,connections:l,isAnthropic:m}){let[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(null),[y,z]=(0,e.useState)({}),A=async b=>{if(t)return;let c=`${a}/${b}`;u(b);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:c})}),b=await a.json();z(a=>({...a,[c]:b.ok?"ok":"error"}))}catch{z(a=>({...a,[c]:"error"}))}finally{u(null)}},B=Object.entries(c).filter(([,b])=>b.startsWith(`${a}/`)).map(([b,c])=>({modelId:c.replace(`${a}/`,""),fullModel:c,alias:b})),C=async()=>{if(!n.trim()||p)return;let d=n.trim(),[e]=v({models:[{id:d}],modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(!e)return void alert("This model already exists.");q(!0);try{await h(d,e.alias,a),o("")}catch(a){console.log("Error adding model:",a),alert(a?.message||`Failed to add model "${d}".`)}finally{q(!1)}},D=async()=>{if(r)return;let d=l.find(a=>!1!==a.isActive);if(d){s(!0);try{let e=await fetch(`/api/providers/${d.id}/models`),f=await e.json();if(!e.ok)return void alert(f.error||"Failed to import models");let g=f.models||[];if(0===g.length)return void alert("No models returned from /models.");let h=v({models:g,modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(0===h.length)return void alert("No new models were added.");let i=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:h.map(({alias:a,model:b})=>({alias:a,model:b}))})}),j=await i.json();if(!i.ok)throw Error(j.error||"Failed to save imported models.");await k(),alert(`Successfully added ${j.count||h.length} models.`)}catch(a){console.log("Error importing models:",a),alert(a?.message||"Failed to import models from /models.")}finally{s(!1)}}},E=l.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",m?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:n,onChange:a=>o(a.target.value),onKeyDown:a=>"Enter"===a.key&&C(),placeholder:m?"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,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:C,disabled:!n.trim()||p,children:p?"Adding...":"Add"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"download",onClick:D,disabled:!E||r,children:r?"Importing...":"Import from /models"})]}),!E&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),B.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:B.map(({modelId:c,fullModel:e,alias:h})=>(0,d.jsx)(w,{modelId:c,fullModel:`${b}/${c}`,copied:f,onCopy:g,onDeleteAlias:()=>i(h),onTest:l.length>0?()=>A(c):void 0,testStatus:y[`${a}/${c}`],isTesting:t===c},e))})]})}u.propTypes={model:t().shape({id:t().string.isRequired}).isRequired,fullModel:t().string.isRequired,alias:t().string,copied:t().string,onCopy:t().func.isRequired,testStatus:t().oneOf(["ok","error"]),isCustom:t().bool,isFree:t().bool,onDeleteAlias:t().func,onTest:t().func,isTesting:t().bool,onDisable:t().func,thinkingSuffix:t().string},t().string.isRequired,t().string.isRequired,t().string,t().func.isRequired,t().func.isRequired,t().func,t().oneOf(["ok","error"]),t().bool,t().string.isRequired,t().object.isRequired,t().string,t().func.isRequired,t().func.isRequired,t().func.isRequired,x.propTypes={providerStorageAlias:t().string.isRequired,providerDisplayAlias:t().string.isRequired,modelAliases:t().object.isRequired,copied:t().string,onCopy:t().func.isRequired,onSetAlias:t().func.isRequired,onDeleteAlias:t().func.isRequired,onAliasesChanged:t().func.isRequired,connections:t().arrayOf(t().shape({id:t().string,isActive:t().bool})).isRequired,isAnthropic:t().bool};var y=c(25049);function z({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function A({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:k,onUpdateProxy:l,onEdit:m,onDelete:n,autoPingEnabled:o=!1,onToggleAutoPing:p,oneByOneStatus:q=null}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),x=(0,e.useMemo)(()=>new Map((b||[]).map(a=>[a.id,a])),[b]),B=(0,e.useMemo)(()=>b||[],[b]),C=a.providerSpecificData?.proxyPoolId||null,D=C?x.get(C):null,E=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,F=!!C||E,G=D?`Pool: ${D.name}`:C?`Pool: ${C} (inactive/missing)`:E?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",H="";if(D?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=D?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);H=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{H=b}}let I=D?.noProxy||a.providerSpecificData?.connectionNoProxy||"",J="default";D?.isActive===!0?J="success":(C||E)&&(J="error");let K=async a=>{v(!0);try{await l("__none__"===a?null:a)}finally{v(!1),t(!1)}},L=a.authType||(c?"oauth":"apikey"),M="oauth"===L,N="cookie"===L,O=a=>"string"==typeof a&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),P=M?O(a.email)?a.email:O(a.name)?a.name:a.name||a.email||a.displayName||"OAuth Account":a.name||a.email||a.displayName||"API Key",Q=(0,y.c)(a),R=null!==Q,S="unavailable"!==a.testStatus||R?a.testStatus:"active",T=(0,r.d4)(a),U=!!a.quarantinedAt,V={policy_suspended:"Policy suspension",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[a.failureClass]||a.quarantineReason||"Account quarantined",W=Number.isFinite(Date.parse(a.quarantinedAt))?new Date(a.quarantinedAt).toLocaleString():a.quarantinedAt||null,X=a.modelLockReason?.resetsAt,Y=Number.isFinite(Date.parse(X))?new Date(X).toLocaleString():X||null,Z=()=>q?"queued"===q.state?"queued":"testing"===q.state?"testing":"success"===q.state?"success":"failed"===q.state?q.error?`failed: ${q.error}`:"failed":null:null;return(0,d.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===a.isActive&&!U?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:N?"cookie":M?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:P}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(j.Ex,{variant:(()=>{if(!1===a.isActive)return"default";let b=(0,r.BU)(T);return"active"!==T.key?b:"active"===S||"success"===S?"success":"error"===S||"expired"===S||"unavailable"===S?"error":"default"})(),size:"sm",dot:!0,children:T.label||S||"unknown"}),(0,d.jsx)(j.Ex,{variant:"default",size:"sm",children:M?"OAuth":N?"Cookie":"API Key"}),U&&(0,d.jsx)(j.Ex,{variant:"error",size:"sm",children:"Quarantined"}),F&&(0,d.jsx)(j.Ex,{variant:J,size:"sm",children:"Proxy"}),a.autoDisabledAt&&!U&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===a.autoDisabledReason?"Token expired":"banned"===a.autoDisabledReason?"Banned":"quota_exhausted"===a.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(a.autoDisabledAt).toLocaleDateString()]}),U&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${a.quarantineReason||V}${W?` - ${W}`:""}`,children:[V,W?` - ${W}`:""]}),R&&!1!==a.isActive&&(0,d.jsx)(z,{until:Q}),R&&a.modelLockReason&&!1!==a.isActive&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${a.modelLockReason.reason}${Y?` — resets ${Y}`:""}`,children:[a.modelLockReason.model,a.modelLockReason.providerErrorCode?` (${a.modelLockReason.providerErrorCode})`:"",Y?` — resets ${Y}`:""]}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),Z()&&(0,d.jsx)(j.Ex,{variant:q?"success"===q.state?"success":"failed"===q.state?"error":"testing"===q.state?"primary":"default":"default",size:"sm",children:Z()})]}),F&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:G,children:G}),H&&(0,d.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:H}),I&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:I,children:["no_proxy: ",I]})]}),U&&!1===a.isActive&&(0,d.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[B.length>0&&(0,d.jsxs)("div",{className:"relative",ref:w,children:[(0,d.jsxs)("button",{onClick:()=>t(a=>!a),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${F?"text-primary":"text-text-muted hover:text-primary"}`,disabled:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:u?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),s&&(0,d.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,d.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),B.map(a=>(0,d.jsx)("button",{onClick:()=>K(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]})]}),p&&(0,d.jsxs)("button",{onClick:()=>p(!o),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${o?"text-primary":"text-text-muted hover:text-primary"}`,title:o?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(j.lM,{size:"sm",checked:a.isActive??!0,onChange:k,title:a.isActive??!0?"Disable connection":U?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}z.propTypes={until:t().string.isRequired},A.propTypes={connection:t().shape({id:t().string,name:t().string,email:t().string,displayName:t().string,modelLockUntil:t().string,testStatus:t().string,isActive:t().bool,lastError:t().string,failureClass:t().string,quarantinedAt:t().string,quarantineReason:t().string,priority:t().number,globalPriority:t().number}).isRequired,proxyPools:t().arrayOf(t().shape({id:t().string,name:t().string,proxyUrl:t().string,noProxy:t().string,isActive:t().bool})),isOAuth:t().bool.isRequired,isFirst:t().bool.isRequired,isLast:t().bool.isRequired,onMoveUp:t().func.isRequired,onMoveDown:t().func.isRequired,onToggleActive:t().func.isRequired,onUpdateProxy:t().func,autoPingEnabled:t().bool,onToggleAutoPing:t().func,onEdit:t().func.isRequired,onDelete:t().func.isRequired,oneByOneStatus:t().shape({state:t().string,error:t().string})};var B=c(58962);let C=`name1|sk-key1
1
+ (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6512:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>J});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(50412),k=c(96919);let l=["kiro","codebuddy","codebuddy-cn","qoder","antigravity","cloudflare-ai","grok-cli"];function m(a){return l.includes(String(a||""))}function n(a){let b=String(a||"").trim();return b&&m(b)?`/dashboard/automation?provider=${encodeURIComponent(b)}`:"/dashboard/automation"}var o=c(91431),p=c(50377),q=c(99258),r=c(74875);c(22062);var s=c(49885),t=c.n(s);function u({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:k,isTesting:l,onDisable:m,thinkingSuffix:n}){let o="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0,p=n?`${b}(${n})`:b;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:o?{color:o}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.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:p}),a.name&&(0,d.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:a.name})]}),k&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:k,disabled:l,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${l?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:l?{animation:"spin 1s linear infinite"}:void 0,children:l?"progress_activity":"science"})}),(0,d.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:l?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(p,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):m?(0,d.jsx)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function v({models:a,modelAliases:b,providerStorageAlias:c,providerDisplayAlias:d}){let e={...b||{}},f=new Set(Object.values(e)),g=[];for(let b of Array.isArray(a)?a:[]){let a=function(a){if(!a)return"";if("string"==typeof a)return a.trim();let b=a.id||a.name||a.model;return"string"==typeof b?b.trim():""}(b);if(!a)continue;let h=`${c}/${a}`;if(f.has(h))continue;let i=function(a,b,c){let d=a.split("/"),e=d[d.length-1];if(!e)return"";if(!b[e])return e;let f=`${c}-${e}`;if(!b[f])return f;let g=2;for(;b[`${f}-${g}`];)g+=1;return`${f}-${g}`}(a,e,d);i&&(g.push({alias:i,model:h,modelId:a}),e[i]=h,f.add(h))}return g}function w({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function x({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,copied:f,onCopy:g,onSetAlias:h,onDeleteAlias:i,onAliasesChanged:k,connections:l,isAnthropic:m}){let[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(()=>new Set),[y,z]=(0,e.useState)({}),A=async b=>{let c=`${a}/${b}`;u(a=>new Set(a).add(b));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:c})}),b=await a.json();z(a=>({...a,[c]:b.ok?"ok":"error"}))}catch{z(a=>({...a,[c]:"error"}))}finally{u(a=>{let c=new Set(a);return c.delete(b),c})}},B=Object.entries(c).filter(([,b])=>b.startsWith(`${a}/`)).map(([b,c])=>({modelId:c.replace(`${a}/`,""),fullModel:c,alias:b})),C=async()=>{if(!n.trim()||p)return;let d=n.trim(),[e]=v({models:[{id:d}],modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(!e)return void alert("This model already exists.");q(!0);try{await h(d,e.alias,a),o("")}catch(a){console.log("Error adding model:",a),alert(a?.message||`Failed to add model "${d}".`)}finally{q(!1)}},D=async()=>{if(r)return;let d=l.find(a=>!1!==a.isActive);if(d){s(!0);try{let e=await fetch(`/api/providers/${d.id}/models`),f=await e.json();if(!e.ok)return void alert(f.error||"Failed to import models");let g=f.models||[];if(0===g.length)return void alert("No models returned from /models.");let h=v({models:g,modelAliases:c,providerStorageAlias:a,providerDisplayAlias:b});if(0===h.length)return void alert("No new models were added.");let i=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aliases:h.map(({alias:a,model:b})=>({alias:a,model:b}))})}),j=await i.json();if(!i.ok)throw Error(j.error||"Failed to save imported models.");await k(),alert(`Successfully added ${j.count||h.length} models.`)}catch(a){console.log("Error importing models:",a),alert(a?.message||"Failed to import models from /models.")}finally{s(!1)}}},E=l.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",m?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:n,onChange:a=>o(a.target.value),onKeyDown:a=>"Enter"===a.key&&C(),placeholder:m?"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,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:C,disabled:!n.trim()||p,children:p?"Adding...":"Add"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"download",onClick:D,disabled:!E||r,children:r?"Importing...":"Import from /models"})]}),!E&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),B.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:B.map(({modelId:c,fullModel:e,alias:h})=>(0,d.jsx)(w,{modelId:c,fullModel:`${b}/${c}`,copied:f,onCopy:g,onDeleteAlias:()=>i(h),onTest:l.length>0?()=>A(c):void 0,testStatus:y[`${a}/${c}`],isTesting:t.has(c)},e))})]})}u.propTypes={model:t().shape({id:t().string.isRequired}).isRequired,fullModel:t().string.isRequired,alias:t().string,copied:t().string,onCopy:t().func.isRequired,testStatus:t().oneOf(["ok","error"]),isCustom:t().bool,isFree:t().bool,onDeleteAlias:t().func,onTest:t().func,isTesting:t().bool,onDisable:t().func,thinkingSuffix:t().string},t().string.isRequired,t().string.isRequired,t().string,t().func.isRequired,t().func.isRequired,t().func,t().oneOf(["ok","error"]),t().bool,t().string.isRequired,t().object.isRequired,t().string,t().func.isRequired,t().func.isRequired,t().func.isRequired,x.propTypes={providerStorageAlias:t().string.isRequired,providerDisplayAlias:t().string.isRequired,modelAliases:t().object.isRequired,copied:t().string,onCopy:t().func.isRequired,onSetAlias:t().func.isRequired,onDeleteAlias:t().func.isRequired,onAliasesChanged:t().func.isRequired,connections:t().arrayOf(t().shape({id:t().string,isActive:t().bool})).isRequired,isAnthropic:t().bool};var y=c(25049);function z({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function A({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:k,onUpdateProxy:l,onEdit:m,onDelete:n,autoPingEnabled:o=!1,onToggleAutoPing:p,oneByOneStatus:q=null}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),x=(0,e.useMemo)(()=>new Map((b||[]).map(a=>[a.id,a])),[b]),B=(0,e.useMemo)(()=>b||[],[b]),C=a.providerSpecificData?.proxyPoolId||null,D=C?x.get(C):null,E=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,F=!!C||E,G=D?`Pool: ${D.name}`:C?`Pool: ${C} (inactive/missing)`:E?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",H="";if(D?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=D?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);H=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{H=b}}let I=D?.noProxy||a.providerSpecificData?.connectionNoProxy||"",J="default";D?.isActive===!0?J="success":(C||E)&&(J="error");let K=async a=>{v(!0);try{await l("__none__"===a?null:a)}finally{v(!1),t(!1)}},L=a.authType||(c?"oauth":"apikey"),M="oauth"===L,N="cookie"===L,O=a=>"string"==typeof a&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),P=M?O(a.email)?a.email:O(a.name)?a.name:a.name||a.email||a.displayName||"OAuth Account":a.name||a.email||a.displayName||"API Key",Q=(0,y.c)(a),R=null!==Q,S="unavailable"!==a.testStatus||R?a.testStatus:"active",T=(0,r.d4)(a),U=!!a.quarantinedAt,V={policy_suspended:"Policy suspension",credential_rejected:"Credential rejected",reauth_required:"Sign-in required",authentication:"Repeated authentication failure"}[a.failureClass]||a.quarantineReason||"Account quarantined",W=Number.isFinite(Date.parse(a.quarantinedAt))?new Date(a.quarantinedAt).toLocaleString():a.quarantinedAt||null,X=a.modelLockReason?.resetsAt,Y=Number.isFinite(Date.parse(X))?new Date(X).toLocaleString():X||null,Z=()=>q?"queued"===q.state?"queued":"testing"===q.state?"testing":"success"===q.state?"success":"failed"===q.state?q.error?`failed: ${q.error}`:"failed":null:null;return(0,d.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===a.isActive&&!U?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:N?"cookie":M?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:P}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(j.Ex,{variant:(()=>{if(!1===a.isActive)return"default";let b=(0,r.BU)(T);return"active"!==T.key?b:"active"===S||"success"===S?"success":"error"===S||"expired"===S||"unavailable"===S?"error":"default"})(),size:"sm",dot:!0,children:T.label||S||"unknown"}),(0,d.jsx)(j.Ex,{variant:"default",size:"sm",children:M?"OAuth":N?"Cookie":"API Key"}),U&&(0,d.jsx)(j.Ex,{variant:"error",size:"sm",children:"Quarantined"}),F&&(0,d.jsx)(j.Ex,{variant:J,size:"sm",children:"Proxy"}),a.autoDisabledAt&&!U&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["token_expired"===a.autoDisabledReason?"Token expired":"banned"===a.autoDisabledReason?"Banned":"quota_exhausted"===a.autoDisabledReason?"Quota exhausted":"Auto-disabled"," — ",new Date(a.autoDisabledAt).toLocaleDateString()]}),U&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-red-600 dark:text-red-400 sm:max-w-[420px]",title:`${a.quarantineReason||V}${W?` - ${W}`:""}`,children:[V,W?` - ${W}`:""]}),R&&!1!==a.isActive&&(0,d.jsx)(z,{until:Q}),R&&a.modelLockReason&&!1!==a.isActive&&(0,d.jsxs)("span",{className:"max-w-full truncate text-xs text-amber-600 dark:text-amber-400 sm:max-w-[360px]",title:`${a.modelLockReason.reason}${Y?` — resets ${Y}`:""}`,children:[a.modelLockReason.model,a.modelLockReason.providerErrorCode?` (${a.modelLockReason.providerErrorCode})`:"",Y?` — resets ${Y}`:""]}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),Z()&&(0,d.jsx)(j.Ex,{variant:q?"success"===q.state?"success":"failed"===q.state?"error":"testing"===q.state?"primary":"default":"default",size:"sm",children:Z()})]}),F&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:G,children:G}),H&&(0,d.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:H}),I&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:I,children:["no_proxy: ",I]})]}),U&&!1===a.isActive&&(0,d.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Re-enable only permits router requests again; it does not change the account's upstream status."})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[B.length>0&&(0,d.jsxs)("div",{className:"relative",ref:w,children:[(0,d.jsxs)("button",{onClick:()=>t(a=>!a),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${F?"text-primary":"text-text-muted hover:text-primary"}`,disabled:u,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:u?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),s&&(0,d.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,d.jsx)("button",{onClick:()=>K("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),B.map(a=>(0,d.jsx)("button",{onClick:()=>K(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]})]}),p&&(0,d.jsxs)("button",{onClick:()=>p(!o),className:`flex flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${o?"text-primary":"text-text-muted hover:text-primary"}`,title:o?"Disable quota auto-ping for this account":"Warm the 5-hour quota window after reset with a tiny request",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]}),(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(j.lM,{size:"sm",checked:a.isActive??!0,onChange:k,title:a.isActive??!0?"Disable connection":U?"Re-enable routing only; upstream suspension or credential status is unchanged":"Enable connection"})]})]})}z.propTypes={until:t().string.isRequired},A.propTypes={connection:t().shape({id:t().string,name:t().string,email:t().string,displayName:t().string,modelLockUntil:t().string,testStatus:t().string,isActive:t().bool,lastError:t().string,failureClass:t().string,quarantinedAt:t().string,quarantineReason:t().string,priority:t().number,globalPriority:t().number}).isRequired,proxyPools:t().arrayOf(t().shape({id:t().string,name:t().string,proxyUrl:t().string,noProxy:t().string,isActive:t().bool})),isOAuth:t().bool.isRequired,isFirst:t().bool.isRequired,isLast:t().bool.isRequired,onMoveUp:t().func.isRequired,onMoveDown:t().func.isRequired,onToggleActive:t().func.isRequired,onUpdateProxy:t().func,autoPingEnabled:t().bool,onToggleAutoPing:t().func,onEdit:t().func.isRequired,onDelete:t().func.isRequired,oneByOneStatus:t().shape({state:t().string,error:t().string})};var B=c(58962);let C=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function D({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:l,proxyPools:m,error:n,onSave:o,onBulkDone:p,onClose:q}){let r="__none__",s="ollama-local"===b,t="cookie"===h,u="xai"===b&&!t,v=t?"Cookie Value":"API Key",w=t?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":u?"xai-...":"",x="azure"===b,y="cloudflare-ai"===b,z=k.Q2?.[b]?.regions||null,A=k.Q2?.[b]?.defaultRegion||z?.[0]?.id||"",[E,F]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:r,ollamaHostUrl:""}),[G,H]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[I,J]=(0,e.useState)({accountId:""}),[K,L]=(0,e.useState)(A),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)("single"),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(null);(0,e.useRef)(!1);let Y=()=>s&&E.ollamaHostUrl.trim()?{baseUrl:E.ollamaHostUrl.trim()}:x?{azureEndpoint:G.azureEndpoint,apiVersion:G.apiVersion,deployment:G.deployment,organization:G.organization}:y?{accountId:I.accountId}:z&&K?{region:K}:void 0,Z=async()=>{N(!0);try{let a=await (0,B.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:E.apiKey,providerSpecificData:Y()}});P(a.valid?"success":"failed")}catch{P("unknown")}finally{N(!1)}},$=async()=>{if(b&&(s||E.apiKey)&&(s||E.name)&&(!f||E.defaultModel.trim())){R(!0);try{let a=!1;try{N(!0),P(null),a=!!(await (0,B.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:E.apiKey,providerSpecificData:Y()}})).valid,P(a?"success":"failed")}catch{P("unknown")}finally{N(!1)}let c=Number.parseInt(E.priority,10);await o({name:E.name||(s?"Ollama Local":""),apiKey:E.apiKey,defaultModel:f?E.defaultModel.trim():void 0,priority:Number.isFinite(c)?c:1,proxyPoolId:E.proxyPoolId===r?null:E.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:Y()})}finally{R(!1)}}},_=async()=>{let a=U.split("\n").map(a=>a.trim()).filter(Boolean);if(!a.length)return;R(!0),X(null);let c=0,d=0,e=[],f=[];for(let g=0;g<a.length;g++){let h=a[g].split("|"),i=h.length>=2?h.slice(1).join("|").trim():h[0].trim(),j=h.length>=2?h[0].trim():"Key",k=`${j} ${g+1}`;try{await (0,B.x6)("/api/providers",{method:"POST",body:{provider:b,apiKey:i,name:k,priority:1,testStatus:"unknown"}}),c++}catch(b){d++,e.push({line:a[g],message:b?.message||"Request failed"}),f.push(a[g])}}R(!1),X({success:c,failed:d,failedRows:e}),V(f.join("\n")),c>0&&p&&p()};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Add ${c||b} ${v}`,onClose:q,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"single"===S?"primary":"ghost",onClick:()=>{T("single"),X(null)},children:"Single"}),(0,d.jsx)(j.$n,{size:"sm",variant:"bulk"===S?"primary":"ghost",onClick:()=>{T("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===S&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:C,value:U,onChange:a=>V(a.target.value)}),W&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${W.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",W.success," added",W.failed>0?`, ✗ ${W.failed} failed`:""]}),W.failedRows?.length>0&&(0,d.jsx)("ul",{className:"text-xs text-red-500 flex flex-col gap-0.5",children:W.failedRows.map((a,b)=>(0,d.jsxs)("li",{className:"break-words",children:[(0,d.jsx)("span",{className:"font-mono",children:a.line.length>40?`${a.line.slice(0,40)}…`:a.line}),` — ${a.message}`]},b))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:_,fullWidth:!0,disabled:Q||!U.trim(),children:Q?"Adding...":"Add All Keys"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{label:"Name",value:E.name,onChange:a=>F({...E,name:a.target.value}),placeholder:s?"Ollama Local":"Production Key"}),s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"Ollama Host URL",value:E.ollamaHostUrl,onChange:a=>F({...E,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:M||Q,variant:"secondary",children:M?"Checking...":"Check"})})]}),!s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:v,type:t?"text":"password",value:E.apiKey,onChange:a=>F({...E,apiKey:a.target.value}),placeholder:w,className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:!E.apiKey||M||Q,variant:"secondary",children:M?"Checking...":"Check"})})]}),u&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),t&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,l&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",l.replace(/^https?:\/\//,"")]})]})]}),z&&(0,d.jsx)(j.l6,{label:"Region",value:K,onChange:a=>L(a.target.value),options:z.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(j.pd,{label:"Default Model",value:E.defaultModel,onChange:a=>F({...E,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),s&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),O&&(0,d.jsx)(j.Ex,{variant:"success"===O?"success":"failed"===O?"error":"default",children:"success"===O?"Valid":"failed"===O?"Invalid":"Could not validate"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(j.pd,{label:"Account ID",value:I.accountId,onChange:a=>J({...I,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.pd,{label:"Azure Endpoint",value:G.azureEndpoint,onChange:a=>H({...G,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(j.pd,{label:"Deployment Name",value:G.deployment,onChange:a=>H({...G,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(j.pd,{label:"API Version",value:G.apiVersion,onChange:a=>H({...G,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(j.pd,{label:"Organization",value:G.organization,onChange:a=>H({...G,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(j.pd,{label:"Priority",type:"number",value:E.priority,onChange:a=>F({...E,priority:a.target.value}),onBlur:a=>{let b=Number.parseInt(a.target.value,10);F(a=>({...a,priority:Number.isFinite(b)?b:1}))}}),(0,d.jsx)(j.l6,{label:"Proxy Pool",value:E.proxyPoolId,onChange:a=>F({...E,proxyPoolId:a.target.value}),options:[{value:r,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:$,fullWidth:!0,disabled:Q||!s&&(!E.name||!E.apiKey)||f&&!E.defaultModel.trim()||x&&(!G.azureEndpoint||!G.deployment||!G.organization)||y&&!I.accountId,children:Q?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function E({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(j.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(j.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(j.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(j.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(j.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||k,children:k?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function F({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),q=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},r=async()=>{let a=q(h.trim());if(a){l("testing"),n("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();l(d.ok?"ok":"error"),n(d.error||"")}catch(a){l("error"),n(a.message)}}},s=async()=>{let a=q(h.trim());if(a&&!o){p(!0);try{await f(a)}finally{p(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),l(null),n("")},onKeyDown:a=>{"Enter"===a.key&&r()},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,d.jsx)(j.$n,{variant:"secondary",icon:"science",loading:"testing"===k,onClick:r,disabled:!h.trim()||"testing"===k,children:"testing"===k?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:q(h.trim())||"model-id"})]})]}),"ok"===k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===k&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:m||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(j.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(j.$n,{onClick:s,fullWidth:!0,size:"sm",disabled:!h.trim()||o,children:o?"Adding...":"Add Model"})]})]})})}D.propTypes={isOpen:t().bool.isRequired,provider:t().string,providerName:t().string,isCompatible:t().bool,isAnthropic:t().bool,authType:t().string,authHint:t().string,website:t().string,proxyPools:t().arrayOf(t().shape({id:t().string,name:t().string})),error:t().string,onSave:t().func.isRequired,onBulkDone:t().func,onClose:t().func.isRequired},E.propTypes={isOpen:t().bool.isRequired,node:t().shape({id:t().string,name:t().string,prefix:t().string,apiType:t().string,baseUrl:t().string}),onSave:t().func.isRequired,onClose:t().func.isRequired,isAnthropic:t().bool},F.propTypes={isOpen:t().bool.isRequired,providerAlias:t().string.isRequired,providerDisplayAlias:t().string.isRequired,onSave:t().func.isRequired,onClose:t().func.isRequired};let G={claude:"claudeAutoPing",codex:"codexAutoPing"};function H(a){return["completed","cancelled","failed"].includes(a)}async function I(a){let b=new AbortController,c=window.setTimeout(()=>b.abort(),8e3);try{let c=await fetch(a,{cache:"no-store",signal:b.signal}),d=null;try{d=await c.json()}catch{d=null}return{response:c,data:d}}finally{window.clearTimeout(c)}}function J(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,[l,s]=(0,e.useState)([]),[t,v]=(0,e.useState)(!0),[w,y]=(0,e.useState)(""),[z,B]=(0,e.useState)(null),[C,J]=(0,e.useState)([]),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(null),[aa,ab]=(0,e.useState)({}),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)({}),[ag,ah]=(0,e.useState)({}),[ai,aj]=(0,e.useState)(null),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)([]),[ao,ap]=(0,e.useState)("__none__"),[aq,ar]=(0,e.useState)(!1),[as,at]=(0,e.useState)(!1),[au,av]=(0,e.useState)(null),[aw,ax]=(0,e.useState)(""),[ay,az]=(0,e.useState)("auto"),[aA,aB]=(0,e.useState)({}),[aC,aD]=(0,e.useState)([]),[aE,aF]=(0,e.useState)([]),[aG,aH]=(0,e.useState)([]),[aI,aJ]=(0,e.useState)(null),[aK,aL]=(0,e.useState)(!1),[aM,aN]=(0,e.useState)(!1),[aO,aP]=(0,e.useState)(!1),[aQ,aR]=(0,e.useState)(null),[aS,aT]=(0,e.useState)({}),[aU,aV]=(0,e.useState)(null),aW=(0,e.useRef)(!1),aX=(0,e.useRef)(null),aY=(0,e.useRef)("1"),[aZ,a$]=(0,e.useState)(!1),[a_,a0]=(0,e.useState)(null),[a1,a2]=(0,e.useState)(""),[a3,a4]=(0,e.useState)(1),[a5,a6]=(0,e.useState)(20),[a7,a8]=(0,e.useState)("all"),[a9,ba]=(0,e.useState)(""),[bb,bc]=(0,e.useState)(1),[bd,be]=(0,e.useState)(20),{copied:bf,copy:bg}=(0,p.C)(),bh=(0,e.useRef)(0),bi=(0,e.useRef)([]),bj=(0,e.useRef)(!0),bk=(0,e.useCallback)(()=>{a0(null),a2(""),bh.current=0},[]),bl=()=>{L(!0)},bm=()=>{"kiro"===g&&a_?.jobId&&H(a_.status)&&bk(),c.push(n(g))},bn=()=>{T(""),R(!0)},bo=()=>{br?(()=>{if(m(g))return bm();br?bl():(T(""),R(!0))})():bn()},bp=z?{id:z.id,name:z.name||("anthropic-compatible"===z.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===z.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===z.type?"AC":"OC",apiType:z.apiType,baseUrl:z.baseUrl,type:z.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],bq=bp?.authModes||[],br=!!k.zN[g]||!!k.IS[g]||bq.includes("oauth"),bs=!!k.fg[g]||bq.includes("apikey"),bt=!!k.IS[g]?.noAuth,bu=(0,o.KC)(g),bv=(0,k.wG)(g),bw=(0,k.mq)(g),bx=(0,k.gb)(g),by=bw||bx,bz=!by&&br&&bs,bA=m(g),bB="xai"===g?"Grok Build OAuth":"OAuth",bC="xai"===g?"xAI API Key":"API Key",bD=k.Q2[g]?.thinkingConfig||k.s9.extended,bE=by?g:bv,bF=by?z?.prefix||g:bv,bG=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}`,{cache:"no-store"}),b=await a.json();a.ok&&aH(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bE]),bH=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bE,ids:[a]})})).ok&&await bG()}catch(a){console.log("Error disabling model:",a)}},bI=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bG()}catch(a){console.log("Error enabling model:",a)}},bJ=async a=>{a.length&&aJ({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{aJ(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bE,ids:a})})).ok&&await bG()}catch(a){console.log("Error disabling all models:",a)}}})},bK=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}`,{method:"DELETE"})).ok&&await bG()}catch(a){console.log("Error enabling all models:",a)}},bL=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&ab(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bM=(0,e.useCallback)(async()=>{try{y("");let[a,b,c,d]=await Promise.allSettled([I("/api/providers"),I("/api/provider-nodes"),I("/api/proxy-pools?isActive=true"),I("/api/settings")]),e="fulfilled"===a.status?a.value.response:null,f="fulfilled"===a.status?a.value.data:{},h="fulfilled"===b.status?b.value.response:null,i="fulfilled"===b.status?b.value.data:{},j="fulfilled"===c.status?c.value.response:null,k="fulfilled"===c.status?c.value.data:{},l="fulfilled"===d.status?d.value.response:null,m=l?.ok&&d.value.data||{};if(e?.ok){let a=(f.connections||[]).filter(a=>a.provider===g);bi.current=a,s(a)}else y("Connections could not be loaded.");j?.ok&&J(k.proxyPools||[]);let n=(m.providerStrategies||{})[g]||{};av(n.fallbackStrategy||null),ax(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1"),aY.current=null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1";let o=(m.providerThinking||{})[g]||{};az(o.mode||"auto");let p=G[g];if(aB(p&&m?.[p]?.connections||{}),h?.ok){let a=(i.nodes||[]).find(a=>a.id===g)||null;if(!a&&by)for(let b=0;b<3;b+=1){if(await new Promise(a=>setTimeout(a,150)),!bj.current)return;let{response:b,data:c}=await I("/api/provider-nodes");if(!bj.current)return;if(b.ok&&(a=(c.nodes||[]).find(a=>a.id===g)||null))break}B(a)}}catch(a){console.log("Error fetching connections:",a),bj.current&&y("Connections could not be loaded.")}finally{bj.current&&v(!1)}},[g,by]),bN=async a=>{try{let b=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(B(c.node),await bM(),X(!1))}catch(a){console.log("Error updating provider node:",a)}},bO=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[g]:f[g]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},bP=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[g]={mode:a}:delete c[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},bQ=async(a,b)=>{let c=G[g];if(!c)return;let d={...aA,[a]:b};aB(d);try{let a=await fetch("/api/settings",{cache:"no-store"}),b={...(a.ok?await a.json():{})[c]||{},connections:d};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[c]:b})})).ok)throw Error("Failed to save auto-ping setting")}catch(a){aB(aA),console.log("Error saving auto-ping config:",a)}},bR=async(a,b,c=bv)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await bL();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bS=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bL()}catch(a){console.log("Error deleting alias:",a)}},bT=async()=>{if(aZ)return;let a=l.find(a=>!1!==a.isActive);if(!a)return void alert((0,q.Tl)("Please add an active Qoder connection first"));a$(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,q.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,q.Tl)("No models returned"));let e={...aa},f=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,""),d=`${bE}/${c}`;!Object.values(e).includes(d)&&(e[c]||(await bR(c,c,bE),e[c]=d,f+=1))}0===f?alert((0,q.Tl)("All models already exist, no new models added")):alert((0,q.Tl)("Successfully added")+` ${f} `+(0,q.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,q.Tl)("Error fetching models")+": "+a.message)}finally{a$(!1)}},bU=async()=>{let a=[...l];if(aM||0===a.length)return;let b=Object.fromEntries(a.map(a=>[a.id,{state:"queued",error:null}]));aW.current=!1,aN(!0),aP(!1),aR(null),aT(b),aV({total:a.length,completed:0,passed:0,failed:0,stopped:!1});let c=0,d=0;try{for(let b=0;b<a.length;b+=1){if(aW.current){aV({total:a.length,completed:b,passed:c,failed:d,stopped:!0});break}let e=a[b];if(!bi.current.some(a=>a.id===e.id)){aT(a=>({...a,[e.id]:{state:"skipped",error:null}})),aV({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1});continue}aR(e.id),aT(a=>({...a,[e.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${e.id}/test`,{method:"POST"}),b=await a.json(),f=!!b.valid;f?c+=1:d+=1,aT(a=>({...a,[e.id]:{state:f?"success":"failed",error:f?null:b.error||null}}))}catch(a){d+=1,aT(b=>({...b,[e.id]:{state:"failed",error:a.message||"Test failed"}}))}aV({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1}),b<a.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{aR(null),aN(!1),aP(!1),aW.current=!1}},bV=async a=>{aJ({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{aJ(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&s(l.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},bW=()=>{bM(),L(!1)},bX=(0,e.useCallback)(a=>{a0(a),a2("")},[bk]),bY=async a=>{T("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await bM(),R(!1);return}T(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),T("Failed to save connection")}},bZ=async a=>{try{(await fetch(`/api/providers/${$.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bM(),V(!1))}catch(a){console.log("Error updating connection:",a)}},b$=async(a,b)=>{try{let c=await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(c.ok){let d=await c.json().catch(()=>null);s(c=>c.map(c=>c.id===a?{...c,isActive:b,...d?.connection||{}}:c))}}catch(a){console.log("Error updating connection status:",a)}},b_=async(a,b)=>{let c=[...l];[c[a],c[b]]=[c[b],c[a]],s(c);try{let[d,e]=await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a+1})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b+1})})]);d.ok&&e.ok||(console.log("Priority swap rejected:",d.status,e.status),await bM())}catch(a){console.log("Error swapping priority:",a),await bM()}},b0=(0,e.useMemo)(()=>{let a=a9.trim().toLowerCase();return l.filter(b=>!!(0,r.i2)(b,a7)&&(!a||[b.name,b.email,b.id,b.account,b.username,b.label,b.authType,b.notes,b.proxyPoolId].filter(Boolean).join(" ").toLowerCase().includes(a)))},[l,a7,a9]),b1=(0,e.useMemo)(()=>r.gJ.reduce((a,b)=>(a[b.id]="all"===b.id?l.length:l.filter(a=>(0,r.i2)(a,b.id)).length,a),{}),[l]),b2=am.filter(a=>l.some(b=>b.id===a)),b3=l.filter(a=>b2.includes(a.id)),b4="codebuddy"===g?(b3.length>0?b3:l).map(a=>a.id):[],b5=b0.length>0&&b0.every(a=>b2.includes(a.id)),b6=(()=>{if(0===b3.length)return"";let a=new Set(b3.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return"All selected currently unbound";let c=C.find(a=>a.id===b);return`All selected currently bound to ${c?.name||b}`}return"Selected connections have mixed proxy bindings"})(),b7=()=>{aq||Z(!1)},b8=async a=>{ar(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await bM(),Z(!1)}finally{ar(!1)}},b9=a=>b8(b3.map(b=>({connectionId:b.id,proxyPoolId:a}))),ca=a=>{let b="gsuite"===a?"GSuite (non-Gmail)":"Gmail (@gmail.com)";aJ({title:`Delete ${b}`,message:`Delete ALL ${b} accounts for this provider? This cannot be undone.`,onConfirm:async()=>{aJ(null);try{(await fetch("/api/providers/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:bp?.id||g,emailFilter:a})})).ok&&(an([]),await bM())}catch(a){console.error("bulk delete error:",a)}}})},cb=Math.max(1,Math.ceil(b0.length/a5)),cc=Math.min(a3,cb),cd=b0.slice((cc-1)*a5,cc*a5),ce=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:cd.map((a,b)=>{let c,e=l.findIndex(b=>b.id===a.id);return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("label",{className:"flex w-8 shrink-0 items-center justify-center",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,b2.includes(c)),onChange:()=>{var b;return b=a.id,void an(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"size-4 rounded border-black/20 dark:border-white/20","aria-label":`Select ${a.name||a.email||a.id}`})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(A,{connection:a,proxyPools:C,isOAuth:br,isFirst:0===e,isLast:e===l.length-1,onMoveUp:()=>b_(e,e-1),onMoveDown:()=>b_(e,e+1),onToggleActive:b=>b$(a.id,b),autoPingEnabled:!0===aA[a.id],onToggleAutoPing:G[g]&&"oauth"===a.authType?b=>bQ(a.id,b):void 0,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&s(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{_(a),V(!0)},onDelete:()=>bV(a.id),oneByOneStatus:aS[a.id]||null})})]},a.id)})}),cf=C.filter(a=>!0===a.isActive),cg=(0,d.jsx)(j.aF,{isOpen:Y,onClose:b7,title:`Apply Proxy (${b3.length} selected)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=C.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):b8(b3.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aq||0===cf.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>b9(null),disabled:aq,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),C.map(a=>(0,d.jsxs)("button",{onClick:()=>b9(a.id),disabled:aq||!0!==a.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aq&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:b7,variant:"ghost",fullWidth:!0,disabled:aq,children:"Cancel"})]})}),ch=async a=>{if(!ai){aj(a);try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bE}/${a}`})}),c=await b.json();af(b=>({...b,[a]:c.ok?"ok":"error"})),ah(b=>({...b,[a]:c.ok?"":c.error||"Model not reachable"}))}catch{af(b=>({...b,[a]:"error"})),ah(b=>({...b,[a]:"Network error"}))}finally{aj(null)}}};return t?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):bp?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bp.color}15`},children:ac?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bp.color},children:bp.textIcon||bp.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bw&&bp.apiType?"responses"===bp.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bx?"/providers/anthropic-m.png":`/providers/${bp.id}.png`,alt:bp.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ad(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bp.name}),(bp.notice?.apiKeyUrl||bp.notice?.signupUrl||bp.website)&&(0,d.jsxs)("a",{href:bp.notice?.apiKeyUrl||bp.notice?.signupUrl||bp.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bp.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[l.length," connection",1===l.length?"":"s"]})]})]})]}),bp.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bp.deprecationNotice})]}),bp.notice?.text&&!bp.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bp.notice.text}),bp.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bp.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 →"})]}),by&&z&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bx?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bx?"Messages API":"responses"===z.apiType?"Responses API":"Chat Completions"," \xb7 ",(z.baseUrl||"").replace(/\/$/,""),"/",bx?"messages":"responses"===z.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{T(""),R(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>X(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{aJ({title:"Delete Compatible Node",message:`Delete this ${bx?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{aJ(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&c.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bt?(0,d.jsx)(j.gw,{providerId:g}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[l.length>0&&C.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>{if(0===b3.length)return;let a=[...new Set(b3.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"))];ap(1===a.length?a[0]:"__none__"),Z(!0)},disabled:0===b3.length,children:"Apply Proxy"}),l.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bU,disabled:aM,children:aM?"Testing Connection One-by-One...":"Test Connection One-by-One"}),aM&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{aM&&(aW.current=!0,aP(!0))},disabled:aO,children:aO?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Thinking"}),(0,d.jsx)("select",{value:ay,onChange:a=>{var b;az(b=a.target.value),bP(b)},className:"text-xs px-2 py-1 border border-border rounded-md bg-background focus:outline-none focus:border-primary",title:"Forces reasoning_effort on requests; model chips copy as alias/model(level)",children:(bD?.options||k.mt).map(a=>(0,d.jsx)("option",{value:a,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(j.lM,{checked:"round-robin"===au,onChange:a=>{let b=a?"round-robin":null,c=a?aw||"1":aw;a&&!aw&&ax("1"),aY.current=c,aX.current&&(clearTimeout(aX.current),aX.current=null),av(b),bO(b,c)}}),"round-robin"===au&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aw,onChange:a=>{var b;ax(b=a.target.value),aY.current=b,aX.current&&clearTimeout(aX.current),aX.current=setTimeout(()=>{bO("round-robin",aY.current)},500)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),l.length>0&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-black/5 bg-black/[0.02] p-3 dark:border-white/5 dark:bg-white/[0.02]",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,d.jsx)("input",{type:"checkbox",checked:b5,onChange:()=>{b5?an(a=>a.filter(a=>!b0.some(b=>b.id===a))):an(a=>Array.from(new Set([...a,...b0.map(a=>a.id)])))},className:"size-4 rounded border-black/20 dark:border-white/20"}),b5?"Unselect visible":"Select visible"]}),(0,d.jsxs)(j.Ex,{variant:"default",children:[b0.length," visible"]}),b3.length>0&&(0,d.jsxs)(j.Ex,{variant:"default",children:[b3.length," selected"]}),b6&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b6}),b3.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>{an([]),ap("__none__")},children:"Clear"}),b3.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{0!==b3.length&&aJ({title:"Delete Selected Connections",message:`Delete ${b3.length} selected connection(s)? This permanently removes the selected accounts.`,onConfirm:async()=>{aJ(null);let a=[],b=0;for(let c of b3)try{(await fetch(`/api/providers/${c.id}`,{method:"DELETE"})).ok?a.push(c.id):b+=1}catch(a){console.log("Error deleting selected connection:",a),b+=1}an(b=>b.filter(b=>!a.includes(b))),b>0&&alert(`Deleted ${a.length} connection(s); ${b} failed.`),await bM()}})},children:["Delete Selected (",b3.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"domain",onClick:()=>ca("gsuite"),children:"Delete GSuite"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"mail",onClick:()=>ca("gmail"),children:"Delete Gmail"})]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.gJ.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>a8(a.id),className:`rounded-full border px-2.5 py-1 text-xs transition-colors ${a7===a.id?"border-primary/50 bg-primary/10 text-primary":"border-border text-text-muted hover:border-primary/30 hover:text-text-main"}`,children:[a.label,(0,d.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:b1[a.id]||0})]},a.id))}),l.length>=20&&(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,d.jsx)("input",{type:"search",value:a9,onChange:a=>ba(a.target.value),placeholder:`Search ${l.length} connections (email, name, id)…`,className:"w-full rounded-lg border border-border bg-background py-2 pl-8 pr-3 text-xs text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),w?(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-red-500",children:"error"}),(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:w})]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>{v(!0),bM()},children:"Retry"})]}):0===l.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:br?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bz&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bB," or ",bC,"."]})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[bA&&(0,d.jsx)(j.$n,{size:"sm",icon:"automation",onClick:bm,children:"Open Automation"}),bz?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bl,children:bB}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bn,children:bC})]}):bA?null:(0,d.jsxs)(d.Fragment,{children:[!by&&"iflow"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>N(!0),children:"Cookie"}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bo,children:by?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})]})]}),"kiro"===g&&a_?.jobId&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",a_.status," | Success: ",a_.summary?.success||0," | Running: ",a_.summary?.running||0," | Queued: ",a_.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),H(a_.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bk,children:"Clear"})]})]}),"kiro"===g&&!a_?.jobId&&a1&&(0,d.jsx)("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:a1})]}):(0,d.jsxs)(d.Fragment,{children:[aU&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",aU.total]}),(0,d.jsxs)("span",{children:["Completed: ",aU.completed]}),(0,d.jsxs)("span",{children:["Passed: ",aU.passed]}),(0,d.jsxs)("span",{children:["Failed: ",aU.failed]}),aU.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),aM&&aQ&&(0,d.jsxs)("span",{children:["Running: ",l.find(a=>a.id===aQ)?.name||aQ]})]})}),"kiro"===g&&a_?.jobId&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",a_.status," | Success: ",a_.summary?.success||0," | Running: ",a_.summary?.running||0," | Queued: ",a_.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),H(a_.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bk,children:"Clear"})]})]}),"kiro"===g&&!a_?.jobId&&a1&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:a1}),ce,"kiro"===g&&cb>1&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Page ",cc," of ",cb," • Showing ",(cc-1)*a5+1,"-",Math.min(cc*a5,b0.length)," of ",b0.length," connections"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cc<=1,onClick:()=>a4(a=>Math.max(1,a-1)),children:"Previous"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cc>=cb,onClick:()=>a4(a=>Math.min(cb,a+1)),children:"Next"})]})]}),"kiro"!==g&&b0.length>0&&(0,d.jsx)(j.dK,{currentPage:cc,pageSize:a5,totalItems:b0.length,onPageChange:a4,onPageSizeChange:a=>{a6(a),a4(1)},className:"mt-2"}),l.length>0&&0===b0.length&&(0,d.jsx)("div",{className:"py-8 text-center text-sm text-text-muted",children:"No connections match this status filter."}),!by&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>N(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codebuddy"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>{l.length>1&&0===b3.length?alert("Select the CodeBuddy connection(s) that should use this quota cookie first."):P(!0)},title:"Attach CodeBuddy web cookie for quota tracking",className:"w-full sm:w-auto",children:"Quota Cookie"}),bA&&(0,d.jsx)(j.$n,{size:"sm",icon:"automation",onClick:bm,className:"w-full sm:w-auto",children:"Open Automation"}),bz?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bl,className:"w-full sm:w-auto",children:bB}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bn,className:"w-full sm:w-auto",children:bC})]}):bA?null:(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bo,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!by&&(a=[...bu,...aE.filter(a=>!bu.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type).map(a=>a.id).filter(a=>!aG.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aG.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bK,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bJ(a),children:"Disable All"})]}))]}),Object.values(ag).some(Boolean)&&(0,d.jsx)("div",{className:"mb-3 flex flex-col gap-1",children:Object.entries(ag).filter(([,a])=>!!a).map(([a,b])=>(0,d.jsxs)("p",{className:"text-xs text-red-500 break-words",children:[a,": ",b]},a))}),(()=>{let a,b,c;if(by)return(0,d.jsx)(x,{providerStorageAlias:bE,providerDisplayAlias:bF,modelAliases:aa,copied:bf,onCopy:bg,onSetAlias:bR,onDeleteAlias:bS,onAliasesChanged:bL,connections:l,isAnthropic:bx});let e=[...bu,...aE.filter(a=>!bu.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type),f=new Set(aG),h=e.filter(a=>!f.has(a.id)),i=e.filter(a=>f.has(a.id)),k=Object.entries(aa).filter(([a,b])=>{let c=`${bE}/`;if(!b.startsWith(c))return!1;let d=b.slice(c.length);return bp.passthroughModels?!bu.some(a=>a.id===d):!bu.some(a=>a.id===d)&&a===d}).map(([a,b])=>({id:b.slice(`${bE}/`.length),alias:a,fullModel:b})),m=Math.min(bb,Math.max(1,Math.ceil(h.length/bd))),n=h.slice((m-1)*bd,m*bd);return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[k.map(a=>(0,d.jsx)(u,{model:{id:a.id},fullModel:`${bF}/${a.id}`,alias:a.alias,copied:bf,onCopy:bg,onSetAlias:()=>{},onDeleteAlias:()=>bS(a.alias),testStatus:ae[a.id],onTest:l.length>0||bt?()=>ch(a.id):void 0,isTesting:ai===a.id,isCustom:!0,isFree:!1,thinkingSuffix:ay&&"auto"!==ay&&"off"!==ay&&"none"!==ay?ay:null},a.id)),n.map(a=>{let b=`${bE}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(aa).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(u,{model:a,fullModel:`${bF}/${a.id}`,alias:e,copied:bf,onCopy:bg,onSetAlias:b=>bR(a.id,b,bE),onDeleteAlias:()=>bS(e),testStatus:ae[a.id],onTest:l.length>0||bt?()=>ch(a.id):void 0,isTesting:ai===a.id,isFree:a.isFree,onDisable:()=>bH(a.id),thinkingSuffix:ay&&"auto"!==ay&&"off"!==ay&&"none"!==ay?ay:null},a.id)}),h.length>bd&&(0,d.jsx)("div",{className:"w-full",children:(0,d.jsx)(j.dK,{currentPage:m,pageSize:bd,totalItems:h.length,onPageChange:bc,onPageSizeChange:a=>{be(a),bc(1)}})}),(0,d.jsxs)("button",{onClick:()=>al(!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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===g&&l.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bT,disabled:aZ,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:aZ?{animation:"spin 1s linear infinite"}:void 0,children:aZ?"progress_activity":"download"}),aZ?(0,q.Tl)("Fetching..."):(0,q.Tl)("Fetch Qoder Models")]}),aC.length>0&&(a=new Set(Object.values(aa)),b=new Set(bu.map(a=>a.id)),0===(c=aC.filter(c=>!a.has(`${bE}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{let b=a.id.split("/").pop();await bR(a.id,b,bE)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),i.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",i.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(a=>(0,d.jsxs)("button",{onClick:()=>bI(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),cg,"kiro"===g?(0,d.jsx)(j.Mh,{isOpen:K,providerInfo:bp,onSuccess:bW,onRefresh:bM,initialBulkJobId:a_?.jobId||null,onBulkJobChange:bX,onClose:()=>L(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:K,onSuccess:bW,onClose:()=>L(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:K,providerInfo:bp,onSuccess:bW,onClose:()=>L(!1)}):(0,d.jsx)(j.LF,{isOpen:K,provider:g,providerInfo:bp,onSuccess:bW,onClose:()=>L(!1)}),"iflow"===g&&(0,d.jsx)(j.vE,{isOpen:M,onSuccess:()=>{bM(),N(!1)},onClose:()=>N(!1)}),"codebuddy"===g&&(0,d.jsx)(j.xl,{isOpen:O,connectionIds:b4,onSuccess:()=>{bM(),P(!1)},onClose:()=>P(!1)}),(0,d.jsx)(D,{isOpen:Q,provider:g,providerName:bp.name,isCompatible:by,isAnthropic:bx,authType:bp?.authType,authHint:bp?.authHint,website:bp?.website,proxyPools:C,error:S,onSave:bY,onBulkDone:bM,onClose:()=>{T(""),R(!1)}}),(0,d.jsx)(j.wI,{isOpen:U,connection:$,proxyPools:C,onSave:bZ,onClose:()=>V(!1)}),by&&(0,d.jsx)(E,{isOpen:W,node:z,onSave:bN,onClose:()=>X(!1),isAnthropic:bx}),!by&&(0,d.jsx)(F,{isOpen:ak,providerAlias:bE,providerDisplayAlias:bF,onSave:async a=>{let b=bp?.passthroughModels?a.split("/").pop():a;await bR(a,b,bE),al(!1)},onClose:()=>al(!1)}),(0,d.jsx)(j.uo,{isOpen:aK,onClose:()=>aL(!1),onConfirm:()=>{(aL(!1),m("antigravity"))?c.push(n("antigravity")):br?bl():bn()},title:"Risk Notice",message:bp?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aI,onClose:()=>{as||aJ(null)},onConfirm:async()=>{if(as)return;let a=aI?.onConfirm;if(a){at(!0);try{await a()}finally{at(!1)}}},title:aI?.title||"Confirm",message:aI?.message,variant:"danger",loading:as})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},9825:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},22977:(a,b,c)=>{Promise.resolve().then(c.bind(c,6512))},25049:(a,b,c)=>{"use strict";c.d(b,{c:()=>e});var d=c(67484);function e(a={}){let[b,c]=(0,d.useState)(null);return JSON.stringify(Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).sort(([a],[b])=>a.localeCompare(b))),b}c(74875)},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42175:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>O,handler:()=>Q,routeModule:()=>P});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(14965),o=c(63747),p=c(24235),q=c(23938),r=c(261),s=c(66758),t=c(77243),u=c(26713),v=c(37527),w=c(22820),x=c(88216),y=c(47929),z=c(79551),A=c(71797),B=c(89125),C=c(86439),D=c(77068),E=c(27269),F=c(37525),G=c(61287),H=c(81494),I=c(70722),J=c(70753),K=c(43954),L=c(17891),M={};for(let a in G)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(M[a]=()=>G[a]);c.d(b,M);let N={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,93110)),"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/zevairouter-build/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,32059)),"/zevairouter-build/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,O={require:c,loadChunk:()=>Promise.resolve()},P=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:N},distDir:".next-cli-build",relativeProjectDir:""});async function Q(a,b,d){var M,R,S,T,U;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),P.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let V=!!(0,h.getRequestMeta)(a,"minimalMode"),W="/(dashboard)/dashboard/providers/[id]/page";"/index"===W&&(W="/");let X=await P.prepare(a,b,{srcPage:W,multiZoneDraftMode:!1});if(!X)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Y,query:Z,params:$,pageIsDynamic:_,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,serverActionsManifest:ad,clientReferenceManifest:ae,subresourceIntegrityManifest:af,prerenderManifest:ag,isDraftMode:ah,resolvedPathname:ai,revalidateOnlyGenerated:aj,routerServerContext:ak,nextConfig:al,parsedUrl:am,interceptionRoutePatterns:an,deploymentId:ao,clientAssetToken:ap}=X,aq=(0,r.normalizeAppPath)(W),{isOnDemandRevalidate:ar}=X,as=al.experimental.ppr&&!al.cacheComponents&&(0,K.isInterceptionRouteAppPath)(ai)?null:P.match(ai,ag),at=(null==as?void 0:as.route)??null,au=!!ag.routes[ai],av=a.headers["user-agent"]||"",aw=(0,u.getBotType)(av),ax=(0,q.isHtmlBotRequest)(a),ay=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],az=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[t.RSC_HEADER]),aA=(0,s.getIsPossibleServerAction)(a),aB=(0,m.checkIsAppPPREnabled)(al.experimental.ppr),aC=a.headers[y.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&V&&aB&&aA&&aC&&"string"==typeof aC){let e=parseInt(aC,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(U=al.experimental.serverActions)?void 0:U.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,E.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&aB&&"1"===a.headers[y.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize),f=await (0,E.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aD=!0===P.isDev||!0===al.experimental.exposeTestingApiInProductionBuild,aE=aD&&("1"===a.headers[t.NEXT_INSTANT_PREFETCH_HEADER]||!(0,n.f)(a.headers[t.RSC_HEADER])&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(t.NEXT_INSTANT_TEST_COOKIE+"=")),aF=(aB||aE)&&((null==(M=ag.routes[aq]??ag.dynamicRoutes[aq])?void 0:M.renderingMode)==="PARTIALLY_STATIC"||aE&&(aD||(null==ak?void 0:ak.experimentalTestProxy)===!0)),aG=aE&&aF,aH=aG&&!0===P.isDev,aI=!1,aJ=aF?(0,h.getRequestMeta)(a,"postponed"):void 0,aK=null==(R=ag.routes[ai])?void 0:R.prefetchDataRoute,aL=aF&&az&&!ay&&!aK;V&&(aL=aL&&!!aJ);let aM=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aN=(!aw||!aF)&&(!av||(0,q.shouldServeStreamingMetadata)(av,al.htmlLimitedBots)),aO=!!((at||au||ag.routes[aq])&&!(aw&&aF)),aP=aF&&!0===al.cacheComponents,aQ=!0===P.isDev||!aO||"string"==typeof aJ||(aP&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aL&&!V:aL),aR=!!aw&&aF,aS=(null==at?void 0:at.remainingPrerenderableParams)??[],aT=(null==at?void 0:at.fallback)===null&&((null==(S=at.fallbackRootParams)?void 0:S.length)??0)>0,aU=null;if(!ah&&aO&&!aQ&&!aA&&!aJ&&!aL){let a=as?"string"==typeof(null==at?void 0:at.fallback)?at.fallback:as.source:null;if(!0===al.experimental.partialFallbacks&&a&&(null==at?void 0:at.fallbackRouteParams)&&!aT){if(aS.length>0){let b,c=(b=new Map(aS.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,L.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==$?void 0:$[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace((0,o.buildDynamicSegmentPlaceholder)(d),f)}).join("/")||"/");aU=c!==a?c:null}}else aU=ai}let aV=aU;!aV&&(P.isDev||aO&&_&&(null==at?void 0:at.fallbackRouteParams)&&!aA)&&(aV=ai),P.isDev||ah||!aO||!az||aL||(0,k.d)(a.headers);let aW={...G,tree:N,handler:Q,routeModule:P,__next_app__:O};ad&&ae&&(0,p.setManifestsSingleton)({page:W,clientReferenceManifest:ae,serverActionsManifest:ad});let aX=a.method||"GET",aY=(0,g.getTracer)(),aZ=aY.getActiveScopeSpan(),a$=!!(null==ak?void 0:ak.isWrappedByNextServer),a_=!0===al.experimental.partialFallbacks&&aS.length>0?(null==at||null==(T=at.fallbackRouteParams)?void 0:T.filter(a=>!aS.some(b=>b.paramName===a.paramName)))??[]:[],a0=async()=>((null==ak?void 0:ak.render404)?await ak.render404(a,b,am,!1):b.end("This page could not be found"),null);try{let k,m=P.getVaryHeader(ai,an);b.setHeader("Vary",m);let n=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return P.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aY.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aX} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),k&&k!==c&&(k.setAttribute("http.route",d),k.updateName(a))}else c.updateName(`${aX} ${W}`)})},p=(0,h.getRequestMeta)(a,"incrementalCache")||await P.getIncrementalCache(a,al,ag,V);null==p||p.resetRequestCache(),globalThis.__incrementalCache=p;let q=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:Z,params:$,page:aq,sharedContext:{buildId:Y,deploymentId:ao,clientAssetToken:ap},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aW,Component:(0,j.T)(aW),params:$,routeModule:P,page:W,postponed:f,shouldWaitOnAllReady:aR,serveStreamingMetadata:aN,supportsDynamicResponse:"string"==typeof f||aQ,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,subresourceIntegrityManifest:af,setCacheStatus:null==ak?void 0:ak.setCacheStatus,setIsrStatus:null==ak?void 0:ak.setIsrStatus,setReactDebugChannel:null==ak?void 0:ak.setReactDebugChannel,sendErrorsToBrowser:null==ak?void 0:ak.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),P.relativeProjectDir),isDraftMode:ah,botType:aw,isOnDemandRevalidate:ar,isPossibleServerAction:aA,assetPrefix:al.assetPrefix,nextConfigOutput:al.output,crossOrigin:al.crossOrigin,trailingSlash:al.trailingSlash,images:al.images,previewProps:ag.preview,enableTainting:al.experimental.taint,htmlLimitedBots:al.htmlLimitedBots,reactMaxHeadersLength:al.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:p,cacheLifeProfiles:al.cacheLife,basePath:al.basePath,serverActions:al.experimental.serverActions,logServerFunctions:"object"==typeof al.logging&&!!al.logging.serverFunctions,...aG||aH||aI?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aH}:{},cacheComponents:!!al.cacheComponents,experimental:{isRoutePPREnabled:aF,expireTime:al.expireTime,staleTimes:al.experimental.staleTimes,dynamicOnHover:!!al.experimental.dynamicOnHover,optimisticRouting:!!al.experimental.optimisticRouting,inlineCss:!!al.experimental.inlineCss,prefetchInlining:al.experimental.prefetchInlining??!1,authInterrupts:!!al.experimental.authInterrupts,cachedNavigations:!!al.experimental.cachedNavigations,clientTraceMetadata:al.experimental.clientTraceMetadata||[],clientParamParsingOrigins:al.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,D.parseMaxPostponedStateSize)(al.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>P.onRequestError(a,b,d,e,ak),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await n(e,k),{metadata:m}=l,{cacheControl:o,headers:q={},fetchTags:r,fetchMetrics:s}=m;if(r&&(q[y.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aO&&(null==o?void 0:o.revalidate)===0&&!P.isDev&&!aF){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ai}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
3
+ sk-key-only-auto-named`;function D({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:l,proxyPools:m,error:n,onSave:o,onBulkDone:p,onClose:q}){let r="__none__",s="ollama-local"===b,t="cookie"===h,u="xai"===b&&!t,v=t?"Cookie Value":"API Key",w=t?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":u?"xai-...":"",x="azure"===b,y="cloudflare-ai"===b,z=k.Q2?.[b]?.regions||null,A=k.Q2?.[b]?.defaultRegion||z?.[0]?.id||"",[E,F]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:r,ollamaHostUrl:""}),[G,H]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[I,J]=(0,e.useState)({accountId:""}),[K,L]=(0,e.useState)(A),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)("single"),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(null);(0,e.useRef)(!1);let Y=()=>s&&E.ollamaHostUrl.trim()?{baseUrl:E.ollamaHostUrl.trim()}:x?{azureEndpoint:G.azureEndpoint,apiVersion:G.apiVersion,deployment:G.deployment,organization:G.organization}:y?{accountId:I.accountId}:z&&K?{region:K}:void 0,Z=async()=>{N(!0);try{let a=await (0,B.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:E.apiKey,providerSpecificData:Y()}});P(a.valid?"success":"failed")}catch{P("unknown")}finally{N(!1)}},$=async()=>{if(b&&(s||E.apiKey)&&(s||E.name)&&(!f||E.defaultModel.trim())){R(!0);try{let a=!1;try{N(!0),P(null),a=!!(await (0,B.x6)("/api/providers/validate",{method:"POST",body:{provider:b,apiKey:E.apiKey,providerSpecificData:Y()}})).valid,P(a?"success":"failed")}catch{P("unknown")}finally{N(!1)}let c=Number.parseInt(E.priority,10);await o({name:E.name||(s?"Ollama Local":""),apiKey:E.apiKey,defaultModel:f?E.defaultModel.trim():void 0,priority:Number.isFinite(c)?c:1,proxyPoolId:E.proxyPoolId===r?null:E.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:Y()})}finally{R(!1)}}},_=async()=>{let a=U.split("\n").map(a=>a.trim()).filter(Boolean);if(!a.length)return;R(!0),X(null);let c=0,d=0,e=[],f=[];for(let g=0;g<a.length;g++){let h=a[g].split("|"),i=h.length>=2?h.slice(1).join("|").trim():h[0].trim(),j=h.length>=2?h[0].trim():"Key",k=`${j} ${g+1}`;try{await (0,B.x6)("/api/providers",{method:"POST",body:{provider:b,apiKey:i,name:k,priority:1,testStatus:"unknown"}}),c++}catch(b){d++,e.push({line:a[g],message:b?.message||"Request failed"}),f.push(a[g])}}R(!1),X({success:c,failed:d,failedRows:e}),V(f.join("\n")),c>0&&p&&p()};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Add ${c||b} ${v}`,onClose:q,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"single"===S?"primary":"ghost",onClick:()=>{T("single"),X(null)},children:"Single"}),(0,d.jsx)(j.$n,{size:"sm",variant:"bulk"===S?"primary":"ghost",onClick:()=>{T("bulk"),X(null)},children:"Bulk Add"})]}),"bulk"===S&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:C,value:U,onChange:a=>V(a.target.value)}),W&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${W.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",W.success," added",W.failed>0?`, ✗ ${W.failed} failed`:""]}),W.failedRows?.length>0&&(0,d.jsx)("ul",{className:"text-xs text-red-500 flex flex-col gap-0.5",children:W.failedRows.map((a,b)=>(0,d.jsxs)("li",{className:"break-words",children:[(0,d.jsx)("span",{className:"font-mono",children:a.line.length>40?`${a.line.slice(0,40)}…`:a.line}),` — ${a.message}`]},b))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:_,fullWidth:!0,disabled:Q||!U.trim(),children:Q?"Adding...":"Add All Keys"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{label:"Name",value:E.name,onChange:a=>F({...E,name:a.target.value}),placeholder:s?"Ollama Local":"Production Key"}),s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"Ollama Host URL",value:E.ollamaHostUrl,onChange:a=>F({...E,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:M||Q,variant:"secondary",children:M?"Checking...":"Check"})})]}),!s&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:v,type:t?"text":"password",value:E.apiKey,onChange:a=>F({...E,apiKey:a.target.value}),placeholder:w,className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:Z,disabled:!E.apiKey||M||Q,variant:"secondary",children:M?"Checking...":"Check"})})]}),u&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),t&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,l&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",l.replace(/^https?:\/\//,"")]})]})]}),z&&(0,d.jsx)(j.l6,{label:"Region",value:K,onChange:a=>L(a.target.value),options:z.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(j.pd,{label:"Default Model",value:E.defaultModel,onChange:a=>F({...E,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),s&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),O&&(0,d.jsx)(j.Ex,{variant:"success"===O?"success":"failed"===O?"error":"default",children:"success"===O?"Valid":"failed"===O?"Invalid":"Could not validate"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(j.pd,{label:"Account ID",value:I.accountId,onChange:a=>J({...I,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(j.pd,{label:"Azure Endpoint",value:G.azureEndpoint,onChange:a=>H({...G,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(j.pd,{label:"Deployment Name",value:G.deployment,onChange:a=>H({...G,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(j.pd,{label:"API Version",value:G.apiVersion,onChange:a=>H({...G,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(j.pd,{label:"Organization",value:G.organization,onChange:a=>H({...G,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(j.pd,{label:"Priority",type:"number",value:E.priority,onChange:a=>F({...E,priority:a.target.value}),onBlur:a=>{let b=Number.parseInt(a.target.value,10);F(a=>({...a,priority:Number.isFinite(b)?b:1}))}}),(0,d.jsx)(j.l6,{label:"Proxy Pool",value:E.proxyPoolId,onChange:a=>F({...E,proxyPoolId:a.target.value}),options:[{value:r,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:$,fullWidth:!0,disabled:Q||!s&&(!E.name||!E.apiKey)||f&&!E.defaultModel.trim()||x&&(!G.azureEndpoint||!G.deployment||!G.organization)||y&&!I.accountId,children:Q?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:q,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function E({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(j.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(j.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(j.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(j.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(j.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(j.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(j.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||k,children:k?"Saving...":"Save"}),(0,d.jsx)(j.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function F({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),q=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},r=async()=>{let a=q(h.trim());if(a){l("testing"),n("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();l(d.ok?"ok":"error"),n(d.error||"")}catch(a){l("error"),n(a.message)}}},s=async()=>{let a=q(h.trim());if(a&&!o){p(!0);try{await f(a)}finally{p(!1)}}};return(0,d.jsx)(j.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),l(null),n("")},onKeyDown:a=>{"Enter"===a.key&&r()},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,d.jsx)(j.$n,{variant:"secondary",icon:"science",loading:"testing"===k,onClick:r,disabled:!h.trim()||"testing"===k,children:"testing"===k?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:q(h.trim())||"model-id"})]})]}),"ok"===k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===k&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:m||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(j.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(j.$n,{onClick:s,fullWidth:!0,size:"sm",disabled:!h.trim()||o,children:o?"Adding...":"Add Model"})]})]})})}D.propTypes={isOpen:t().bool.isRequired,provider:t().string,providerName:t().string,isCompatible:t().bool,isAnthropic:t().bool,authType:t().string,authHint:t().string,website:t().string,proxyPools:t().arrayOf(t().shape({id:t().string,name:t().string})),error:t().string,onSave:t().func.isRequired,onBulkDone:t().func,onClose:t().func.isRequired},E.propTypes={isOpen:t().bool.isRequired,node:t().shape({id:t().string,name:t().string,prefix:t().string,apiType:t().string,baseUrl:t().string}),onSave:t().func.isRequired,onClose:t().func.isRequired,isAnthropic:t().bool},F.propTypes={isOpen:t().bool.isRequired,providerAlias:t().string.isRequired,providerDisplayAlias:t().string.isRequired,onSave:t().func.isRequired,onClose:t().func.isRequired};let G={claude:"claudeAutoPing",codex:"codexAutoPing"};function H(a){return["completed","cancelled","failed"].includes(a)}async function I(a){let b=new AbortController,c=window.setTimeout(()=>b.abort(),8e3);try{let c=await fetch(a,{cache:"no-store",signal:b.signal}),d=null;try{d=await c.json()}catch{d=null}return{response:c,data:d}}finally{window.clearTimeout(c)}}function J(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,[l,s]=(0,e.useState)([]),[t,v]=(0,e.useState)(!0),[w,y]=(0,e.useState)(""),[z,B]=(0,e.useState)(null),[C,J]=(0,e.useState)([]),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(null),[aa,ab]=(0,e.useState)({}),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)({}),[ag,ah]=(0,e.useState)({}),[ai,aj]=(0,e.useState)(()=>new Set),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)([]),[ao,ap]=(0,e.useState)("__none__"),[aq,ar]=(0,e.useState)(!1),[as,at]=(0,e.useState)(!1),[au,av]=(0,e.useState)(null),[aw,ax]=(0,e.useState)(""),[ay,az]=(0,e.useState)("auto"),[aA,aB]=(0,e.useState)({}),[aC,aD]=(0,e.useState)([]),[aE,aF]=(0,e.useState)([]),[aG,aH]=(0,e.useState)([]),[aI,aJ]=(0,e.useState)(null),[aK,aL]=(0,e.useState)(!1),[aM,aN]=(0,e.useState)(!1),[aO,aP]=(0,e.useState)(!1),[aQ,aR]=(0,e.useState)(null),[aS,aT]=(0,e.useState)({}),[aU,aV]=(0,e.useState)(null),aW=(0,e.useRef)(!1),aX=(0,e.useRef)(null),aY=(0,e.useRef)("1"),[aZ,a$]=(0,e.useState)(!1),[a_,a0]=(0,e.useState)(null),[a1,a2]=(0,e.useState)(""),[a3,a4]=(0,e.useState)(1),[a5,a6]=(0,e.useState)(20),[a7,a8]=(0,e.useState)("all"),[a9,ba]=(0,e.useState)(""),[bb,bc]=(0,e.useState)(1),[bd,be]=(0,e.useState)(20),{copied:bf,copy:bg}=(0,p.C)(),bh=(0,e.useRef)(0),bi=(0,e.useRef)([]),bj=(0,e.useRef)(!0),bk=(0,e.useCallback)(()=>{a0(null),a2(""),bh.current=0},[]),bl=()=>{L(!0)},bm=()=>{"kiro"===g&&a_?.jobId&&H(a_.status)&&bk(),c.push(n(g))},bn=()=>{T(""),R(!0)},bo=()=>{br?(()=>{if(m(g))return bm();br?bl():(T(""),R(!0))})():bn()},bp=z?{id:z.id,name:z.name||("anthropic-compatible"===z.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===z.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===z.type?"AC":"OC",apiType:z.apiType,baseUrl:z.baseUrl,type:z.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],bq=bp?.authModes||[],br=!!k.zN[g]||!!k.IS[g]||bq.includes("oauth"),bs=!!k.fg[g]||bq.includes("apikey"),bt=!!k.IS[g]?.noAuth,bu=(0,o.KC)(g),bv=(0,k.wG)(g),bw=(0,k.mq)(g),bx=(0,k.gb)(g),by=bw||bx,bz=!by&&br&&bs,bA=m(g),bB="xai"===g?"Grok Build OAuth":"OAuth",bC="xai"===g?"xAI API Key":"API Key",bD=k.Q2[g]?.thinkingConfig||k.s9.extended,bE=by?g:bv,bF=by?z?.prefix||g:bv,bG=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}`,{cache:"no-store"}),b=await a.json();a.ok&&aH(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bE]),bH=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bE,ids:[a]})})).ok&&await bG()}catch(a){console.log("Error disabling model:",a)}},bI=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bG()}catch(a){console.log("Error enabling model:",a)}},bJ=async a=>{a.length&&aJ({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{aJ(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bE,ids:a})})).ok&&await bG()}catch(a){console.log("Error disabling all models:",a)}}})},bK=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}`,{method:"DELETE"})).ok&&await bG()}catch(a){console.log("Error enabling all models:",a)}},bL=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&ab(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bM=(0,e.useCallback)(async()=>{try{y("");let[a,b,c,d]=await Promise.allSettled([I("/api/providers"),I("/api/provider-nodes"),I("/api/proxy-pools?isActive=true"),I("/api/settings")]),e="fulfilled"===a.status?a.value.response:null,f="fulfilled"===a.status?a.value.data:{},h="fulfilled"===b.status?b.value.response:null,i="fulfilled"===b.status?b.value.data:{},j="fulfilled"===c.status?c.value.response:null,k="fulfilled"===c.status?c.value.data:{},l="fulfilled"===d.status?d.value.response:null,m=l?.ok&&d.value.data||{};if(e?.ok){let a=(f.connections||[]).filter(a=>a.provider===g);bi.current=a,s(a)}else y("Connections could not be loaded.");j?.ok&&J(k.proxyPools||[]);let n=(m.providerStrategies||{})[g]||{};av(n.fallbackStrategy||null),ax(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1"),aY.current=null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1";let o=(m.providerThinking||{})[g]||{};az(o.mode||"auto");let p=G[g];if(aB(p&&m?.[p]?.connections||{}),h?.ok){let a=(i.nodes||[]).find(a=>a.id===g)||null;if(!a&&by)for(let b=0;b<3;b+=1){if(await new Promise(a=>setTimeout(a,150)),!bj.current)return;let{response:b,data:c}=await I("/api/provider-nodes");if(!bj.current)return;if(b.ok&&(a=(c.nodes||[]).find(a=>a.id===g)||null))break}B(a)}}catch(a){console.log("Error fetching connections:",a),bj.current&&y("Connections could not be loaded.")}finally{bj.current&&v(!1)}},[g,by]),bN=async a=>{try{let b=await fetch(`/api/provider-nodes/${g}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(B(c.node),await bM(),X(!1))}catch(a){console.log("Error updating provider node:",a)}},bO=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[g]:f[g]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},bP=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[g]={mode:a}:delete c[g],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},bQ=async(a,b)=>{let c=G[g];if(!c)return;let d={...aA,[a]:b};aB(d);try{let a=await fetch("/api/settings",{cache:"no-store"}),b={...(a.ok?await a.json():{})[c]||{},connections:d};if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[c]:b})})).ok)throw Error("Failed to save auto-ping setting")}catch(a){aB(aA),console.log("Error saving auto-ping config:",a)}},bR=async(a,b,c=bv)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await bL();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bS=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bL()}catch(a){console.log("Error deleting alias:",a)}},bT=async()=>{if(aZ)return;let a=l.find(a=>!1!==a.isActive);if(!a)return void alert((0,q.Tl)("Please add an active Qoder connection first"));a$(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,q.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,q.Tl)("No models returned"));let e={...aa},f=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,""),d=`${bE}/${c}`;!Object.values(e).includes(d)&&(e[c]||(await bR(c,c,bE),e[c]=d,f+=1))}0===f?alert((0,q.Tl)("All models already exist, no new models added")):alert((0,q.Tl)("Successfully added")+` ${f} `+(0,q.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,q.Tl)("Error fetching models")+": "+a.message)}finally{a$(!1)}},bU=async()=>{let a=[...l];if(aM||0===a.length)return;let b=Object.fromEntries(a.map(a=>[a.id,{state:"queued",error:null}]));aW.current=!1,aN(!0),aP(!1),aR(null),aT(b),aV({total:a.length,completed:0,passed:0,failed:0,stopped:!1});let c=0,d=0;try{for(let b=0;b<a.length;b+=1){if(aW.current){aV({total:a.length,completed:b,passed:c,failed:d,stopped:!0});break}let e=a[b];if(!bi.current.some(a=>a.id===e.id)){aT(a=>({...a,[e.id]:{state:"skipped",error:null}})),aV({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1});continue}aR(e.id),aT(a=>({...a,[e.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${e.id}/test`,{method:"POST"}),b=await a.json(),f=!!b.valid;f?c+=1:d+=1,aT(a=>({...a,[e.id]:{state:f?"success":"failed",error:f?null:b.error||null}}))}catch(a){d+=1,aT(b=>({...b,[e.id]:{state:"failed",error:a.message||"Test failed"}}))}aV({total:a.length,completed:b+1,passed:c,failed:d,stopped:!1}),b<a.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{aR(null),aN(!1),aP(!1),aW.current=!1}},bV=async a=>{aJ({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{aJ(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&s(l.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},bW=()=>{bM(),L(!1)},bX=(0,e.useCallback)(a=>{a0(a),a2("")},[bk]),bY=async a=>{T("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await bM(),R(!1);return}T(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),T("Failed to save connection")}},bZ=async a=>{try{(await fetch(`/api/providers/${$.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bM(),V(!1))}catch(a){console.log("Error updating connection:",a)}},b$=async(a,b)=>{try{let c=await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(c.ok){let d=await c.json().catch(()=>null);s(c=>c.map(c=>c.id===a?{...c,isActive:b,...d?.connection||{}}:c))}}catch(a){console.log("Error updating connection status:",a)}},b_=async(a,b)=>{let c=[...l];[c[a],c[b]]=[c[b],c[a]],s(c);try{let[d,e]=await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a+1})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b+1})})]);d.ok&&e.ok||(console.log("Priority swap rejected:",d.status,e.status),await bM())}catch(a){console.log("Error swapping priority:",a),await bM()}},b0=(0,e.useMemo)(()=>{let a=a9.trim().toLowerCase();return l.filter(b=>!!(0,r.i2)(b,a7)&&(!a||[b.name,b.email,b.id,b.account,b.username,b.label,b.authType,b.notes,b.proxyPoolId].filter(Boolean).join(" ").toLowerCase().includes(a)))},[l,a7,a9]),b1=(0,e.useMemo)(()=>r.gJ.reduce((a,b)=>(a[b.id]="all"===b.id?l.length:l.filter(a=>(0,r.i2)(a,b.id)).length,a),{}),[l]),b2=am.filter(a=>l.some(b=>b.id===a)),b3=l.filter(a=>b2.includes(a.id)),b4="codebuddy"===g?(b3.length>0?b3:l).map(a=>a.id):[],b5=b0.length>0&&b0.every(a=>b2.includes(a.id)),b6=(()=>{if(0===b3.length)return"";let a=new Set(b3.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return"All selected currently unbound";let c=C.find(a=>a.id===b);return`All selected currently bound to ${c?.name||b}`}return"Selected connections have mixed proxy bindings"})(),b7=()=>{aq||Z(!1)},b8=async a=>{ar(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await bM(),Z(!1)}finally{ar(!1)}},b9=a=>b8(b3.map(b=>({connectionId:b.id,proxyPoolId:a}))),ca=a=>{let b="gsuite"===a?"GSuite (non-Gmail)":"Gmail (@gmail.com)";aJ({title:`Delete ${b}`,message:`Delete ALL ${b} accounts for this provider? This cannot be undone.`,onConfirm:async()=>{aJ(null);try{(await fetch("/api/providers/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:bp?.id||g,emailFilter:a})})).ok&&(an([]),await bM())}catch(a){console.error("bulk delete error:",a)}}})},cb=Math.max(1,Math.ceil(b0.length/a5)),cc=Math.min(a3,cb),cd=b0.slice((cc-1)*a5,cc*a5),ce=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:cd.map((a,b)=>{let c,e=l.findIndex(b=>b.id===a.id);return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("label",{className:"flex w-8 shrink-0 items-center justify-center",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,b2.includes(c)),onChange:()=>{var b;return b=a.id,void an(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"size-4 rounded border-black/20 dark:border-white/20","aria-label":`Select ${a.name||a.email||a.id}`})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(A,{connection:a,proxyPools:C,isOAuth:br,isFirst:0===e,isLast:e===l.length-1,onMoveUp:()=>b_(e,e-1),onMoveDown:()=>b_(e,e+1),onToggleActive:b=>b$(a.id,b),autoPingEnabled:!0===aA[a.id],onToggleAutoPing:G[g]&&"oauth"===a.authType?b=>bQ(a.id,b):void 0,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&s(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{_(a),V(!0)},onDelete:()=>bV(a.id),oneByOneStatus:aS[a.id]||null})})]},a.id)})}),cf=C.filter(a=>!0===a.isActive),cg=(0,d.jsx)(j.aF,{isOpen:Y,onClose:b7,title:`Apply Proxy (${b3.length} selected)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=C.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):b8(b3.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aq||0===cf.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>b9(null),disabled:aq,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),C.map(a=>(0,d.jsxs)("button",{onClick:()=>b9(a.id),disabled:aq||!0!==a.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aq&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:b7,variant:"ghost",fullWidth:!0,disabled:aq,children:"Cancel"})]})}),ch=async a=>{aj(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bE}/${a}`})}),c=await b.json();af(b=>({...b,[a]:c.ok?"ok":"error"})),ah(b=>({...b,[a]:c.ok?"":c.error||"Model not reachable"}))}catch{af(b=>({...b,[a]:"error"})),ah(b=>({...b,[a]:"Network error"}))}finally{aj(b=>{let c=new Set(b);return c.delete(a),c})}};return t?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):bp?(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bp.color}15`},children:ac?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bp.color},children:bp.textIcon||bp.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bw&&bp.apiType?"responses"===bp.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bx?"/providers/anthropic-m.png":`/providers/${bp.id}.png`,alt:bp.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ad(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bp.name}),(bp.notice?.apiKeyUrl||bp.notice?.signupUrl||bp.website)&&(0,d.jsxs)("a",{href:bp.notice?.apiKeyUrl||bp.notice?.signupUrl||bp.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bp.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[l.length," connection",1===l.length?"":"s"]})]})]})]}),bp.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bp.deprecationNotice})]}),bp.notice?.text&&!bp.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bp.notice.text}),bp.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bp.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 →"})]}),by&&z&&(0,d.jsx)(j.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bx?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bx?"Messages API":"responses"===z.apiType?"Responses API":"Chat Completions"," \xb7 ",(z.baseUrl||"").replace(/\/$/,""),"/",bx?"messages":"responses"===z.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:()=>{T(""),R(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>X(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{aJ({title:"Delete Compatible Node",message:`Delete this ${bx?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{aJ(null);try{(await fetch(`/api/provider-nodes/${g}`,{method:"DELETE"})).ok&&c.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bt?(0,d.jsx)(j.gw,{providerId:g}):(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[l.length>0&&C.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>{if(0===b3.length)return;let a=[...new Set(b3.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"))];ap(1===a.length?a[0]:"__none__"),Z(!0)},disabled:0===b3.length,children:"Apply Proxy"}),l.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bU,disabled:aM,children:aM?"Testing Connection One-by-One...":"Test Connection One-by-One"}),aM&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{aM&&(aW.current=!0,aP(!0))},disabled:aO,children:aO?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Thinking"}),(0,d.jsx)("select",{value:ay,onChange:a=>{var b;az(b=a.target.value),bP(b)},className:"text-xs px-2 py-1 border border-border rounded-md bg-background focus:outline-none focus:border-primary",title:"Forces reasoning_effort on requests; model chips copy as alias/model(level)",children:(bD?.options||k.mt).map(a=>(0,d.jsx)("option",{value:a,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(j.lM,{checked:"round-robin"===au,onChange:a=>{let b=a?"round-robin":null,c=a?aw||"1":aw;a&&!aw&&ax("1"),aY.current=c,aX.current&&(clearTimeout(aX.current),aX.current=null),av(b),bO(b,c)}}),"round-robin"===au&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aw,onChange:a=>{var b;ax(b=a.target.value),aY.current=b,aX.current&&clearTimeout(aX.current),aX.current=setTimeout(()=>{bO("round-robin",aY.current)},500)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),l.length>0&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-black/5 bg-black/[0.02] p-3 dark:border-white/5 dark:bg-white/[0.02]",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted",children:[(0,d.jsx)("input",{type:"checkbox",checked:b5,onChange:()=>{b5?an(a=>a.filter(a=>!b0.some(b=>b.id===a))):an(a=>Array.from(new Set([...a,...b0.map(a=>a.id)])))},className:"size-4 rounded border-black/20 dark:border-white/20"}),b5?"Unselect visible":"Select visible"]}),(0,d.jsxs)(j.Ex,{variant:"default",children:[b0.length," visible"]}),b3.length>0&&(0,d.jsxs)(j.Ex,{variant:"default",children:[b3.length," selected"]}),b6&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b6}),b3.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",onClick:()=>{an([]),ap("__none__")},children:"Clear"}),b3.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:()=>{0!==b3.length&&aJ({title:"Delete Selected Connections",message:`Delete ${b3.length} selected connection(s)? This permanently removes the selected accounts.`,onConfirm:async()=>{aJ(null);let a=[],b=0;for(let c of b3)try{(await fetch(`/api/providers/${c.id}`,{method:"DELETE"})).ok?a.push(c.id):b+=1}catch(a){console.log("Error deleting selected connection:",a),b+=1}an(b=>b.filter(b=>!a.includes(b))),b>0&&alert(`Deleted ${a.length} connection(s); ${b} failed.`),await bM()}})},children:["Delete Selected (",b3.length,")"]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"domain",onClick:()=>ca("gsuite"),children:"Delete GSuite"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"mail",onClick:()=>ca("gmail"),children:"Delete Gmail"})]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.gJ.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>a8(a.id),className:`rounded-full border px-2.5 py-1 text-xs transition-colors ${a7===a.id?"border-primary/50 bg-primary/10 text-primary":"border-border text-text-muted hover:border-primary/30 hover:text-text-main"}`,children:[a.label,(0,d.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:b1[a.id]||0})]},a.id))}),l.length>=20&&(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,d.jsx)("input",{type:"search",value:a9,onChange:a=>ba(a.target.value),placeholder:`Search ${l.length} connections (email, name, id)…`,className:"w-full rounded-lg border border-border bg-background py-2 pl-8 pr-3 text-xs text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),w?(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-red-500",children:"error"}),(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:w})]}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:()=>{v(!0),bM()},children:"Retry"})]}):0===l.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:br?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bz&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bB," or ",bC,"."]})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[bA&&(0,d.jsx)(j.$n,{size:"sm",icon:"automation",onClick:bm,children:"Open Automation"}),bz?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bl,children:bB}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bn,children:bC})]}):bA?null:(0,d.jsxs)(d.Fragment,{children:[!by&&"iflow"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>N(!0),children:"Cookie"}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bo,children:by?"Add API Key":"iflow"===g?"OAuth":"Add Connection"})]})]})]}),"kiro"===g&&a_?.jobId&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",a_.status," | Success: ",a_.summary?.success||0," | Running: ",a_.summary?.running||0," | Queued: ",a_.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),H(a_.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bk,children:"Clear"})]})]}),"kiro"===g&&!a_?.jobId&&a1&&(0,d.jsx)("div",{className:"mt-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:a1})]}):(0,d.jsxs)(d.Fragment,{children:[aU&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",aU.total]}),(0,d.jsxs)("span",{children:["Completed: ",aU.completed]}),(0,d.jsxs)("span",{children:["Passed: ",aU.passed]}),(0,d.jsxs)("span",{children:["Failed: ",aU.failed]}),aU.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),aM&&aQ&&(0,d.jsxs)("span",{children:["Running: ",l.find(a=>a.id===aQ)?.name||aQ]})]})}),"kiro"===g&&a_?.jobId&&(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-lg border border-primary/20 bg-primary/[0.06] px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-text-main",children:"Bulk import progress is still available"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Status: ",a_.status," | Success: ",a_.summary?.success||0," | Running: ",a_.summary?.running||0," | Queued: ",a_.summary?.queued||0]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",icon:"monitoring",variant:"secondary",onClick:()=>c.push(n("kiro")),children:"Resume Bulk Progress"}),H(a_.status)&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"close",onClick:bk,children:"Clear"})]})]}),"kiro"===g&&!a_?.jobId&&a1&&(0,d.jsx)("div",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:a1}),ce,"kiro"===g&&cb>1&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Page ",cc," of ",cb," • Showing ",(cc-1)*a5+1,"-",Math.min(cc*a5,b0.length)," of ",b0.length," connections"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cc<=1,onClick:()=>a4(a=>Math.max(1,a-1)),children:"Previous"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",disabled:cc>=cb,onClick:()=>a4(a=>Math.min(cb,a+1)),children:"Next"})]})]}),"kiro"!==g&&b0.length>0&&(0,d.jsx)(j.dK,{currentPage:cc,pageSize:a5,totalItems:b0.length,onPageChange:a4,onPageSizeChange:a=>{a6(a),a4(1)},className:"mt-2"}),l.length>0&&0===b0.length&&(0,d.jsx)("div",{className:"py-8 text-center text-sm text-text-muted",children:"No connections match this status filter."}),!by&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>N(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codebuddy"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>{l.length>1&&0===b3.length?alert("Select the CodeBuddy connection(s) that should use this quota cookie first."):P(!0)},title:"Attach CodeBuddy web cookie for quota tracking",className:"w-full sm:w-auto",children:"Quota Cookie"}),bA&&(0,d.jsx)(j.$n,{size:"sm",icon:"automation",onClick:bm,className:"w-full sm:w-auto",children:"Open Automation"}),bz?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bl,className:"w-full sm:w-auto",children:bB}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:bn,className:"w-full sm:w-auto",children:bC})]}):bA?null:(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:bo,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!by&&(a=[...bu,...aE.filter(a=>!bu.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type).map(a=>a.id).filter(a=>!aG.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aG.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bK,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bJ(a),children:"Disable All"})]}))]}),Object.values(ag).some(Boolean)&&(0,d.jsx)("div",{className:"mb-3 flex flex-col gap-1",children:Object.entries(ag).filter(([,a])=>!!a).map(([a,b])=>(0,d.jsxs)("p",{className:"text-xs text-red-500 break-words",children:[a,": ",b]},a))}),(()=>{let a,b,c;if(by)return(0,d.jsx)(x,{providerStorageAlias:bE,providerDisplayAlias:bF,modelAliases:aa,copied:bf,onCopy:bg,onSetAlias:bR,onDeleteAlias:bS,onAliasesChanged:bL,connections:l,isAnthropic:bx});let e=[...bu,...aE.filter(a=>!bu.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type),f=new Set(aG),h=e.filter(a=>!f.has(a.id)),i=e.filter(a=>f.has(a.id)),k=Object.entries(aa).filter(([a,b])=>{let c=`${bE}/`;if(!b.startsWith(c))return!1;let d=b.slice(c.length);return bp.passthroughModels?!bu.some(a=>a.id===d):!bu.some(a=>a.id===d)&&a===d}).map(([a,b])=>({id:b.slice(`${bE}/`.length),alias:a,fullModel:b})),m=Math.min(bb,Math.max(1,Math.ceil(h.length/bd))),n=h.slice((m-1)*bd,m*bd);return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[k.map(a=>(0,d.jsx)(u,{model:{id:a.id},fullModel:`${bF}/${a.id}`,alias:a.alias,copied:bf,onCopy:bg,onSetAlias:()=>{},onDeleteAlias:()=>bS(a.alias),testStatus:ae[a.id],onTest:l.length>0||bt?()=>ch(a.id):void 0,isTesting:ai.has(a.id),isCustom:!0,isFree:!1,thinkingSuffix:ay&&"auto"!==ay&&"off"!==ay&&"none"!==ay?ay:null},a.id)),n.map(a=>{let b=`${bE}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(aa).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(u,{model:a,fullModel:`${bF}/${a.id}`,alias:e,copied:bf,onCopy:bg,onSetAlias:b=>bR(a.id,b,bE),onDeleteAlias:()=>bS(e),testStatus:ae[a.id],onTest:l.length>0||bt?()=>ch(a.id):void 0,isTesting:ai.has(a.id),isFree:a.isFree,onDisable:()=>bH(a.id),thinkingSuffix:ay&&"auto"!==ay&&"off"!==ay&&"none"!==ay?ay:null},a.id)}),h.length>bd&&(0,d.jsx)("div",{className:"w-full",children:(0,d.jsx)(j.dK,{currentPage:m,pageSize:bd,totalItems:h.length,onPageChange:bc,onPageSizeChange:a=>{be(a),bc(1)}})}),(0,d.jsxs)("button",{onClick:()=>al(!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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===g&&l.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bT,disabled:aZ,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:aZ?{animation:"spin 1s linear infinite"}:void 0,children:aZ?"progress_activity":"download"}),aZ?(0,q.Tl)("Fetching..."):(0,q.Tl)("Fetch Qoder Models")]}),aC.length>0&&(a=new Set(Object.values(aa)),b=new Set(bu.map(a=>a.id)),0===(c=aC.filter(c=>!a.has(`${bE}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{let b=a.id.split("/").pop();await bR(a.id,b,bE)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),i.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",i.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(a=>(0,d.jsxs)("button",{onClick:()=>bI(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),cg,"kiro"===g?(0,d.jsx)(j.Mh,{isOpen:K,providerInfo:bp,onSuccess:bW,onRefresh:bM,initialBulkJobId:a_?.jobId||null,onBulkJobChange:bX,onClose:()=>L(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:K,onSuccess:bW,onClose:()=>L(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:K,providerInfo:bp,onSuccess:bW,onClose:()=>L(!1)}):(0,d.jsx)(j.LF,{isOpen:K,provider:g,providerInfo:bp,onSuccess:bW,onClose:()=>L(!1)}),"iflow"===g&&(0,d.jsx)(j.vE,{isOpen:M,onSuccess:()=>{bM(),N(!1)},onClose:()=>N(!1)}),"codebuddy"===g&&(0,d.jsx)(j.xl,{isOpen:O,connectionIds:b4,onSuccess:()=>{bM(),P(!1)},onClose:()=>P(!1)}),(0,d.jsx)(D,{isOpen:Q,provider:g,providerName:bp.name,isCompatible:by,isAnthropic:bx,authType:bp?.authType,authHint:bp?.authHint,website:bp?.website,proxyPools:C,error:S,onSave:bY,onBulkDone:bM,onClose:()=>{T(""),R(!1)}}),(0,d.jsx)(j.wI,{isOpen:U,connection:$,proxyPools:C,onSave:bZ,onClose:()=>V(!1)}),by&&(0,d.jsx)(E,{isOpen:W,node:z,onSave:bN,onClose:()=>X(!1),isAnthropic:bx}),!by&&(0,d.jsx)(F,{isOpen:ak,providerAlias:bE,providerDisplayAlias:bF,onSave:async a=>{let b=bp?.passthroughModels?a.split("/").pop():a;await bR(a,b,bE),al(!1)},onClose:()=>al(!1)}),(0,d.jsx)(j.uo,{isOpen:aK,onClose:()=>aL(!1),onConfirm:()=>{(aL(!1),m("antigravity"))?c.push(n("antigravity")):br?bl():bn()},title:"Risk Notice",message:bp?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aI,onClose:()=>{as||aJ(null)},onConfirm:async()=>{if(as)return;let a=aI?.onConfirm;if(a){at(!0);try{await a()}finally{at(!1)}}},title:aI?.title||"Confirm",message:aI?.message,variant:"danger",loading:as})]}):(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},9825:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},22977:(a,b,c)=>{Promise.resolve().then(c.bind(c,6512))},25049:(a,b,c)=>{"use strict";c.d(b,{c:()=>e});var d=c(67484);function e(a={}){let[b,c]=(0,d.useState)(null);return JSON.stringify(Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).sort(([a],[b])=>a.localeCompare(b))),b}c(74875)},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42175:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>O,handler:()=>Q,routeModule:()=>P});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(14965),o=c(63747),p=c(24235),q=c(23938),r=c(261),s=c(66758),t=c(77243),u=c(26713),v=c(37527),w=c(22820),x=c(88216),y=c(47929),z=c(79551),A=c(71797),B=c(89125),C=c(86439),D=c(77068),E=c(27269),F=c(37525),G=c(61287),H=c(81494),I=c(70722),J=c(70753),K=c(43954),L=c(17891),M={};for(let a in G)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(M[a]=()=>G[a]);c.d(b,M);let N={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,93110)),"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/zevairouter-build/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,32059)),"/zevairouter-build/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,O={require:c,loadChunk:()=>Promise.resolve()},P=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:N},distDir:".next-cli-build",relativeProjectDir:""});async function Q(a,b,d){var M,R,S,T,U;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),P.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let V=!!(0,h.getRequestMeta)(a,"minimalMode"),W="/(dashboard)/dashboard/providers/[id]/page";"/index"===W&&(W="/");let X=await P.prepare(a,b,{srcPage:W,multiZoneDraftMode:!1});if(!X)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Y,query:Z,params:$,pageIsDynamic:_,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,serverActionsManifest:ad,clientReferenceManifest:ae,subresourceIntegrityManifest:af,prerenderManifest:ag,isDraftMode:ah,resolvedPathname:ai,revalidateOnlyGenerated:aj,routerServerContext:ak,nextConfig:al,parsedUrl:am,interceptionRoutePatterns:an,deploymentId:ao,clientAssetToken:ap}=X,aq=(0,r.normalizeAppPath)(W),{isOnDemandRevalidate:ar}=X,as=al.experimental.ppr&&!al.cacheComponents&&(0,K.isInterceptionRouteAppPath)(ai)?null:P.match(ai,ag),at=(null==as?void 0:as.route)??null,au=!!ag.routes[ai],av=a.headers["user-agent"]||"",aw=(0,u.getBotType)(av),ax=(0,q.isHtmlBotRequest)(a),ay=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],az=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[t.RSC_HEADER]),aA=(0,s.getIsPossibleServerAction)(a),aB=(0,m.checkIsAppPPREnabled)(al.experimental.ppr),aC=a.headers[y.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&V&&aB&&aA&&aC&&"string"==typeof aC){let e=parseInt(aC,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(U=al.experimental.serverActions)?void 0:U.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,E.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&aB&&"1"===a.headers[y.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize),f=await (0,E.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aD=!0===P.isDev||!0===al.experimental.exposeTestingApiInProductionBuild,aE=aD&&("1"===a.headers[t.NEXT_INSTANT_PREFETCH_HEADER]||!(0,n.f)(a.headers[t.RSC_HEADER])&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(t.NEXT_INSTANT_TEST_COOKIE+"=")),aF=(aB||aE)&&((null==(M=ag.routes[aq]??ag.dynamicRoutes[aq])?void 0:M.renderingMode)==="PARTIALLY_STATIC"||aE&&(aD||(null==ak?void 0:ak.experimentalTestProxy)===!0)),aG=aE&&aF,aH=aG&&!0===P.isDev,aI=!1,aJ=aF?(0,h.getRequestMeta)(a,"postponed"):void 0,aK=null==(R=ag.routes[ai])?void 0:R.prefetchDataRoute,aL=aF&&az&&!ay&&!aK;V&&(aL=aL&&!!aJ);let aM=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aN=(!aw||!aF)&&(!av||(0,q.shouldServeStreamingMetadata)(av,al.htmlLimitedBots)),aO=!!((at||au||ag.routes[aq])&&!(aw&&aF)),aP=aF&&!0===al.cacheComponents,aQ=!0===P.isDev||!aO||"string"==typeof aJ||(aP&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aL&&!V:aL),aR=!!aw&&aF,aS=(null==at?void 0:at.remainingPrerenderableParams)??[],aT=(null==at?void 0:at.fallback)===null&&((null==(S=at.fallbackRootParams)?void 0:S.length)??0)>0,aU=null;if(!ah&&aO&&!aQ&&!aA&&!aJ&&!aL){let a=as?"string"==typeof(null==at?void 0:at.fallback)?at.fallback:as.source:null;if(!0===al.experimental.partialFallbacks&&a&&(null==at?void 0:at.fallbackRouteParams)&&!aT){if(aS.length>0){let b,c=(b=new Map(aS.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,L.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==$?void 0:$[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace((0,o.buildDynamicSegmentPlaceholder)(d),f)}).join("/")||"/");aU=c!==a?c:null}}else aU=ai}let aV=aU;!aV&&(P.isDev||aO&&_&&(null==at?void 0:at.fallbackRouteParams)&&!aA)&&(aV=ai),P.isDev||ah||!aO||!az||aL||(0,k.d)(a.headers);let aW={...G,tree:N,handler:Q,routeModule:P,__next_app__:O};ad&&ae&&(0,p.setManifestsSingleton)({page:W,clientReferenceManifest:ae,serverActionsManifest:ad});let aX=a.method||"GET",aY=(0,g.getTracer)(),aZ=aY.getActiveScopeSpan(),a$=!!(null==ak?void 0:ak.isWrappedByNextServer),a_=!0===al.experimental.partialFallbacks&&aS.length>0?(null==at||null==(T=at.fallbackRouteParams)?void 0:T.filter(a=>!aS.some(b=>b.paramName===a.paramName)))??[]:[],a0=async()=>((null==ak?void 0:ak.render404)?await ak.render404(a,b,am,!1):b.end("This page could not be found"),null);try{let k,m=P.getVaryHeader(ai,an);b.setHeader("Vary",m);let n=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return P.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aY.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aX} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),k&&k!==c&&(k.setAttribute("http.route",d),k.updateName(a))}else c.updateName(`${aX} ${W}`)})},p=(0,h.getRequestMeta)(a,"incrementalCache")||await P.getIncrementalCache(a,al,ag,V);null==p||p.resetRequestCache(),globalThis.__incrementalCache=p;let q=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:Z,params:$,page:aq,sharedContext:{buildId:Y,deploymentId:ao,clientAssetToken:ap},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aW,Component:(0,j.T)(aW),params:$,routeModule:P,page:W,postponed:f,shouldWaitOnAllReady:aR,serveStreamingMetadata:aN,supportsDynamicResponse:"string"==typeof f||aQ,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,subresourceIntegrityManifest:af,setCacheStatus:null==ak?void 0:ak.setCacheStatus,setIsrStatus:null==ak?void 0:ak.setIsrStatus,setReactDebugChannel:null==ak?void 0:ak.setReactDebugChannel,sendErrorsToBrowser:null==ak?void 0:ak.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),P.relativeProjectDir),isDraftMode:ah,botType:aw,isOnDemandRevalidate:ar,isPossibleServerAction:aA,assetPrefix:al.assetPrefix,nextConfigOutput:al.output,crossOrigin:al.crossOrigin,trailingSlash:al.trailingSlash,images:al.images,previewProps:ag.preview,enableTainting:al.experimental.taint,htmlLimitedBots:al.htmlLimitedBots,reactMaxHeadersLength:al.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:p,cacheLifeProfiles:al.cacheLife,basePath:al.basePath,serverActions:al.experimental.serverActions,logServerFunctions:"object"==typeof al.logging&&!!al.logging.serverFunctions,...aG||aH||aI?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aH}:{},cacheComponents:!!al.cacheComponents,experimental:{isRoutePPREnabled:aF,expireTime:al.expireTime,staleTimes:al.experimental.staleTimes,dynamicOnHover:!!al.experimental.dynamicOnHover,optimisticRouting:!!al.experimental.optimisticRouting,inlineCss:!!al.experimental.inlineCss,prefetchInlining:al.experimental.prefetchInlining??!1,authInterrupts:!!al.experimental.authInterrupts,cachedNavigations:!!al.experimental.cachedNavigations,clientTraceMetadata:al.experimental.clientTraceMetadata||[],clientParamParsingOrigins:al.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,D.parseMaxPostponedStateSize)(al.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>P.onRequestError(a,b,d,e,ak),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await n(e,k),{metadata:m}=l,{cacheControl:o,headers:q={},fetchTags:r,fetchMetrics:s}=m;if(r&&(q[y.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aO&&(null==o?void 0:o.revalidate)===0&&!P.isDev&&!aF){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ai}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
4
4
  see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:o}},r=async({hasResolved:c,previousCacheEntry:g,isRevalidating:i,span:j,forceStaticRender:k=!1})=>{let l=!1===P.isDev,m=c||b.writableEnded;try{var n;let f;if(ar&&aj&&!g&&!V)return(null==ak?void 0:ak.render404)?await ak.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(at&&(f=(0,w.parseFallbackField)(at.fallback)),!0===al.experimental.partialFallbacks&&(null==at?void 0:at.fallback)===null&&!aT&&aS.length>0&&(f=w.FallbackMode.PRERENDER),f===w.FallbackMode.PRERENDER&&(0,u.isBot)(av)&&(!aF||ax)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==g?void 0:g.isStale)===-1&&(ar=!0),ar&&(f!==w.FallbackMode.NOT_FOUND||g)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),!V&&f!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aV&&!m&&!ah&&_&&(l||!au)){if((l||at)&&f===w.FallbackMode.NOT_FOUND){if(al.adapterPath)return await a0();throw new C.NoFallbackError}if(aF&&(al.cacheComponents?!aL:!az)){let b=l&&"string"==typeof(null==at?void 0:at.fallback)?at.fallback:aq,f=(l||aG)&&(null==at?void 0:at.fallbackRouteParams)?(0,o.createOpaqueFallbackRouteParams)(at.fallbackRouteParams):aI?(0,o.getFallbackRouteParams)(aq,P):null;aG&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await P.handleResponse({cacheKey:b,req:a,nextConfig:al,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ag,isRoutePPREnabled:aF,responseGenerator:async()=>q({span:j,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:V});if(null===g)return null;if(g)return V||!aF||!(aS.length>0)||!0!==al.experimental.partialFallbacks||!aU||!p||ar||aI||aD||aE||ay||(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(aU,p,aF,!1,a=>q({span:a.span,postponed:void 0,fallbackRouteParams:a_.length>0?(0,o.createOpaqueFallbackRouteParams)(a_):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let s=ar||i||!aJ?void 0:aJ;if(aP&&!V&&p&&(aL||aA)&&!k){let b=await p.get(ai,{kind:v.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===v.CachedRouteKind.APP_PAGE&&(s=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(ai,p,aF,!1,a=>r({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aG||aH)&&void 0!==s)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let t=!P.isDev&&_&&(null==at?void 0:at.fallbackRouteParams)?(0,o.getPlaceholderFallbackRouteParams)($,at.fallbackRouteParams):null,y=t&&t.length>0?t:null==at?void 0:at.fallbackRouteParams,z=null!=t&&t.length>0,A=null;if(al.cacheComponents&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,h.getRequestMeta)(a,"resolvedRouteParamKeys");b&&b.size>0&&(A=at.fallbackRouteParams.filter(a=>!b.has(a.paramName)))}let B=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||z||aG&&!au)&&y?(0,o.createOpaqueFallbackRouteParams)(y):A&&A.length>0&&A.length<((null==at||null==(n=at.fallbackRouteParams)?void 0:n.length)??0)?(0,o.createOpaqueFallbackRouteParams)(A):aI?(0,o.getFallbackRouteParams)(aq,P):null;if((l||aG)&&al.cacheComponents&&!au&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,o.createOpaqueFallbackRouteParams)(y??at.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return q({span:j,postponed:s,fallbackRouteParams:B,forceStaticRender:k})}catch(b){throw(null==g?void 0:g.isStale)&&await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}},s=async c=>{var f,g,i,j,k,l;let m,n=await P.handleResponse({cacheKey:aU,responseGenerator:a=>r({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ar,isRoutePPREnabled:aF,req:a,nextConfig:al,prerenderManifest:ag,waitUntil:d.waitUntil,isMinimalMode:V});if(ah&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),P.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!n){if(aU)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let o="string"==typeof n.value.postponed;az&&!aA&&ao&&b.setHeader(y.NEXT_NAV_DEPLOYMENT_ID_HEADER,ao),aO&&!aL&&(!o||ay)&&(V||b.setHeader("x-nextjs-cache",ar?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:p}=n;if(aJ)m={revalidate:0,expire:void 0};else if(aL)m={revalidate:0,expire:void 0};else if(!P.isDev)if(ah)m={revalidate:0,expire:void 0};else if(aO){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});m={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??al.expireTime}}else m={revalidate:y.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(m={revalidate:0,expire:void 0});if(n.cacheControl=m,"string"==typeof aM&&(null==p?void 0:p.kind)===v.CachedRouteKind.APP_PAGE&&p.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=p.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];V&&aO&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=p.segmentData.get(aM);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let s=aP?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(s){let b=(0,h.getRequestMeta)(a,"initURL")??a.url,c=b?(null==(l=(0,F.parseUrl)(b))?void 0:l.pathname)??b:void 0;if(await s(n,{url:c}))return null}if(p.headers){let a={...p.headers};for(let[c,d]of(V&&aO||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let u=null==(g=p.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(V&&aO&&u&&"string"==typeof u&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,u),!p.status||az&&aF||(b.statusCode=p.status),!V&&p.status&&H.RedirectStatusCode[p.status]&&az&&(b.statusCode=200),o&&!aL&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),az&&!ah){if(void 0===p.rscData){if(p.html.contentType!==t.RSC_CONTENT_TYPE_HEADER)if(al.cacheComponents)return b.statusCode=404,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl});else throw Object.defineProperty(new I.InvariantError(`Expected RSC response, got ${p.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:p.html,cacheControl:n.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(p.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let w=p.html;if(aE&&aG){let c=!0===P.isDev?crypto.randomUUID():null;return w.pipeThrough(await (0,A.createInstantTestScriptInsertionTransformStream)(c)),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})}if(!o||V||az)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:n.cacheControl});if(aG||aH)return w.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}});let C=new TransformStream;return w.push(C.readable),q({span:c,postponed:p.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(C.writable)}).catch(a=>{C.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})};if(!a$||!aZ)return k=aY.getActiveScopeSpan(),await aY.withPropagatedContext(a.headers,()=>aY.trace(i.BaseServerSpan.handleRequest,{spanName:`${aX} ${W}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aX,"http.target":a.url}},s),void 0,!a$);await s(aZ)}catch(b){throw b instanceof C.NoFallbackError||await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}}},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},55511:a=>{"use strict";a.exports=require("crypto")},58962:(a,b,c)=>{"use strict";c.d(b,{x6:()=>d.fetchJson,E2:()=>e,gs:()=>f});var d=c(86819);function e(a){if(!a)return null;let b=a.match(/\b([45]\d{2})\b/);return b?b[1]:"ERR"}function f(a){if(!a)return"";let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return`${d}d ago`}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},73024:a=>{"use strict";a.exports=require("node:fs")},74875:(a,b,c)=>{"use strict";c.d(b,{BU:()=>l,G9:()=>h,d4:()=>j,gJ:()=>d,i2:()=>k});let d=[{id:"all",label:"All"},{id:"active",label:"Active",keys:["active"]},{id:"errors",label:"Errors",keys:["connection_error","auth_error","quota_exhausted","rate_limited","banned","cooldown","unknown"]},{id:"connection",label:"Connection",keys:["connection_error"]},{id:"auth",label:"Auth",keys:["auth_error"]},{id:"limit",label:"Limit",keys:["rate_limited","cooldown"]},{id:"exhausted",label:"Exhausted",keys:["quota_exhausted"]},{id:"banned",label:"Banned",keys:["banned"]},{id:"disabled",label:"Disabled",keys:["disabled"]}],e={active:{label:"active",severity:"success",terminal:!1},disabled:{label:"disabled",severity:"default",terminal:!1},connection_error:{label:"connection error",severity:"error",terminal:!1},auth_error:{label:"auth error",severity:"error",terminal:!0},quota_exhausted:{label:"exhausted",severity:"error",terminal:!0},rate_limited:{label:"rate limited",severity:"warning",terminal:!1},banned:{label:"banned",severity:"error",terminal:!0},cooldown:{label:"cooldown",severity:"warning",terminal:!1},unknown:{label:"unknown",severity:"default",terminal:!1}},f={policy_suspended:"banned",credential_rejected:"auth_error",reauth_required:"auth_error",authentication:"auth_error",entitlement_or_quota:"quota_exhausted",rate_limited:"rate_limited",permission_denied:"auth_error",upstream_transient:"connection_error"};function g(a){if(!a)return"";if("string"==typeof a)return a.toLowerCase();try{return JSON.stringify(a).toLowerCase()}catch{return String(a).toLowerCase()}}function h(a={},b=Date.now()){let c=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>new Date(a).getTime()).filter(a=>Number.isFinite(a)&&a>b);return c.length>0?new Date(Math.min(...c)).toISOString():null}function i(a,b=""){let c=e[a]||e.unknown;return{key:a,...c,reason:b}}function j(a={}){var b;let c=(b=a).quarantinedAt?i(f[g(b.failureClass)]||"unknown",b.quarantineReason||b.lastError||"Connection is quarantined"):null;if(c)return c;if(!1===a.isActive)return i("disabled","Connection is disabled");if(function(a={}){return null!==h(a)}(a))return i("cooldown","Model cooldown is active");if(function(a){if(!a)return!1;let b=new Date(a).getTime();return Number.isFinite(b)&&b>Date.now()}(a.rateLimitedUntil))return i("rate_limited","Rate limit cooldown is active");let d=g(a.testStatus||a.status),e=g(a.lastErrorType||a.errorType),k=g(a.errorCode||a.statusCode),l=g(a.lastError||a.error),m=`${d} ${e} ${k} ${l}`.trim();return!m||["active","success","ok"].includes(d)?i("active",""):m.includes("ban")||m.includes("suspend")||m.includes("restricted")?i("banned",a.lastError||"Account appears restricted"):m.includes("exhaust")||m.includes("quota exceeded")||m.includes("insufficient_quota")||m.includes("payment required")||"402"===k?i("quota_exhausted",a.lastError||"Quota exhausted"):e.includes("rate_limited")||m.includes("rate limit")||m.includes("too many requests")||"429"===k?i("rate_limited",a.lastError||"Rate limited"):e.includes("auth")||e.includes("token")||m.includes("unauthorized")||m.includes("invalid api key")||m.includes("token invalid")||m.includes("token expired")||m.includes("revoked")||"401"===k||"403"===k?i("auth_error",a.lastError||"Authentication failed"):e.includes("network")||m.includes("network")||m.includes("timeout")||m.includes("fetch failed")||m.includes("econn")||m.includes("dns")||m.includes("proxy")?i("connection_error",a.lastError||"Connection failed"):["error","expired","unavailable","failed"].includes(d)?i("connection_error",a.lastError||a.testStatus||"Connection failed"):i("unknown",a.lastError||a.testStatus||"")}function k(a,b){if(!b||"all"===b)return!0;let c=d.find(a=>a.id===b);return!c||c.keys.includes(j(a).key)}function l(a){return a?.severity==="success"?"success":a?.severity==="error"?"error":"default"}},76760:a=>{"use strict";a.exports=require("node:path")},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},77598:a=>{"use strict";a.exports=require("node:crypto")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},86819:(a,b,c)=>{"use strict";c.d(b,{fetchJson:()=>e});let d={"Content-Type":"application/json"};async function e(a,b={}){let{body:c,headers:f,...g}=b,h={...g,headers:{...d,...f}};void 0!==c&&"string"!=typeof c?h.body=JSON.stringify(c):void 0!==c&&(h.body=c);let i=await fetch(a,h),j=await i.text(),k=null;if(j)try{k=JSON.parse(j)}catch{let b=Error(`Non-JSON response from ${a} (HTTP ${i.status})`);throw b.status=i.status,b.rawBody=j.slice(0,300),b}if(!i.ok){let a=k&&(k.error?.message||k.error||k.message)||`Request failed (HTTP ${i.status})`,b=Error("string"==typeof a?a:`HTTP ${i.status}`);throw b.status=i.status,b.data=k,b}return k}e.get=(a,b)=>e(a,{...b,method:"GET"}),e.post=(a,b,c)=>e(a,{...c,method:"POST",body:b}),e.put=(a,b,c)=>e(a,{...c,method:"PUT",body:b}),e.patch=(a,b,c)=>e(a,{...c,method:"PATCH",body:b}),e.del=(a,b)=>e(a,{...b,method:"DELETE"})},87550:a=>{"use strict";a.exports=require("better-sqlite3")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/zevairouter-build/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,319,5846,2760,492,3999,5024,4404,5681,1131,412,9372],()=>b(b.s=42175));module.exports=c})();