@sifxprime/krouter 0.5.150 → 0.5.151

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 (247) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/presidio/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/presidio/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  56. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  57. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  58. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  60. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  61. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  63. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  64. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  65. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  66. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  68. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  69. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  70. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  71. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  72. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  73. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  74. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  75. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  76. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  77. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  78. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  79. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  80. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  81. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  82. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  83. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  84. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  85. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  86. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  87. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  88. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  89. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  90. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  91. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  93. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  95. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  96. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  97. package/app/.next-cli-build/server/app/callback.html +1 -1
  98. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  99. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  100. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  102. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  103. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  104. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +5 -5
  105. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  106. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  108. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  109. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
  110. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  111. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  112. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  113. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  114. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +5 -5
  115. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  116. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  117. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  118. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  119. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +5 -5
  120. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  121. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  122. package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
  123. package/app/.next-cli-build/server/app/dashboard/environment.rsc +5 -5
  124. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +5 -5
  125. package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +5 -5
  126. package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +1 -1
  127. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  128. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  129. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +5 -5
  130. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  131. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  132. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  133. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  134. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +5 -5
  135. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  136. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  137. package/app/.next-cli-build/server/app/dashboard/presidio.html +1 -1
  138. package/app/.next-cli-build/server/app/dashboard/presidio.rsc +4 -4
  139. package/app/.next-cli-build/server/app/dashboard/presidio.segments/!KGRhc2hib2FyZCk/dashboard/presidio/__PAGE__.segment.rsc +4 -4
  140. package/app/.next-cli-build/server/app/dashboard/presidio.segments/_full.segment.rsc +4 -4
  141. package/app/.next-cli-build/server/app/dashboard/presidio.segments/_tree.segment.rsc +1 -1
  142. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  143. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  144. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +5 -5
  145. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  146. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  147. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  148. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  149. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +5 -5
  150. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  151. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  152. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  153. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  154. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +5 -5
  155. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  156. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  157. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  158. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  159. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +5 -5
  160. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  161. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  162. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  163. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  164. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +5 -5
  165. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  166. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  167. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  168. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  169. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +6 -6
  170. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  171. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  172. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  173. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  174. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  175. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  176. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  177. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  178. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  179. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  181. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +5 -5
  182. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  183. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  184. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  186. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +5 -5
  187. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  188. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  191. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +5 -5
  192. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  193. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  194. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  196. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +5 -5
  197. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  198. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  200. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  201. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +5 -5
  202. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  203. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  204. package/app/.next-cli-build/server/app/index.html +1 -1
  205. package/app/.next-cli-build/server/app/index.rsc +3 -3
  206. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  207. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  208. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  209. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  210. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  211. package/app/.next-cli-build/server/app/landing.html +1 -1
  212. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  213. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  214. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  216. package/app/.next-cli-build/server/app/login/page.js +1 -1
  217. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  218. package/app/.next-cli-build/server/app/login.html +1 -1
  219. package/app/.next-cli-build/server/app/login.rsc +4 -4
  220. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  221. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  222. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  223. package/app/.next-cli-build/server/app/page.js +1 -1
  224. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  225. package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  226. package/app/.next-cli-build/server/chunks/2365.js +1 -1
  227. package/app/.next-cli-build/server/chunks/4921.js +1 -0
  228. package/app/.next-cli-build/server/chunks/5330.js +2 -2
  229. package/app/.next-cli-build/server/chunks/5470.js +1 -1
  230. package/app/.next-cli-build/server/chunks/5718.js +1 -1
  231. package/app/.next-cli-build/server/chunks/706.js +1 -1
  232. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  233. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  234. package/app/.next-cli-build/server/chunks/8335.js +10 -0
  235. package/app/.next-cli-build/server/chunks/8361.js +4 -4
  236. package/app/.next-cli-build/server/chunks/8590.js +1 -1
  237. package/app/.next-cli-build/server/chunks/8895.js +1 -1
  238. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  239. package/app/.next-cli-build/server/pages/404.html +1 -1
  240. package/app/.next-cli-build/server/pages/500.html +1 -1
  241. package/app/.next-cli-build/static/chunks/{1321-145204ec1d9a906c.js → 1321-9b766fbbae85a94e.js} +1 -1
  242. package/app/cli/package.json +1 -1
  243. package/app/package.json +1 -1
  244. package/package.json +1 -1
  245. package/app/.next-cli-build/server/chunks/7276.js +0 -10
  246. /package/app/.next-cli-build/static/{p_mO4dTk0WbkwLUU05XBt → dHflmEbdgIZqOODL9Qqy3}/_buildManifest.js +0 -0
  247. /package/app/.next-cli-build/static/{p_mO4dTk0WbkwLUU05XBt → dHflmEbdgIZqOODL9Qqy3}/_ssgManifest.js +0 -0
@@ -8,4 +8,4 @@ sk-key-only-auto-named`;function w({isOpen:a,provider:b,providerName:c,isCompati
8
8
  "idToken": "eyJhbGc...",
9
9
  "email": "user@example.com"
10
10
  }
11
- ]`;function A({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,o]=(0,e.useState)(null),p=()=>{h||(g(""),l(""),o(null),b())},q=async()=>{var a;let b;l(""),o(null);let d=f.trim();if(!d)return;try{b=JSON.parse(d)}catch(a){l(`${(0,n.Tl)("Invalid JSON")}: ${a.message}`);return}let e=Array.isArray(a=b)?a:a&&"object"==typeof a?Array.isArray(a.accounts)?a.accounts:[a]:null;if(!e||0===e.length)return void l((0,n.Tl)("No accounts found in input"));i(!0);try{let a=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),b=await a.json();if(!a.ok)return void l(b?.error||`Request failed: ${a.status}`);o(b),b.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,n.Tl)("Request failed"))}finally{i(!1)}},r=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(j.aF,{isOpen:a,title:(0,n.Tl)("Bulk Add Codex Accounts"),onClose:p,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,n.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:z,value:f,onChange:a=>g(a.target.value),disabled:h}),k&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:k}),m&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,n.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,n.Tl)("failed")}`:""]}),r.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:r.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:q,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,n.Tl)("Importing..."):(0,n.Tl)("Import All")}),(0,d.jsx)(j.$n,{onClick:p,variant:"ghost",fullWidth:!0,disabled:h,children:(0,n.Tl)("Close")})]})]})})}A.propTypes={isOpen:p().bool.isRequired,onClose:p().func.isRequired,onSuccess:p().func};let B={free:{label:"Free",variant:"success",accent:"green"},freetier:{label:"Free tier",variant:"success",accent:"emerald"},oauth:{label:"OAuth",variant:"primary",accent:"primary"},paid:{label:"API key",variant:"default",accent:"neutral"},webcookie:{label:"Cookie",variant:"warning",accent:"amber"}};function C({capabilities:a,connectionCount:b=0,headerIconPath:c}){let[f,g]=(0,e.useState)(!1);if(!a)return null;let k=B[a.tier]||B.paid,l=a.color?`${a.color}10`:"rgba(148,163,184,0.08)",m=a.color?`${a.color}30`:"rgba(148,163,184,0.20)",n=[];return a.links.apiKey&&n.push({href:a.links.apiKey,icon:"key",label:"Get API key"}),a.links.signup&&!a.links.apiKey&&n.push({href:a.links.signup,icon:"person_add",label:"Sign up"}),a.links.homepage&&n.push({href:a.links.homepage,icon:"language",label:"Homepage"}),a.links.docs&&n.push({href:a.links.docs,icon:"menu_book",label:"Docs"}),a.links.pricing&&n.push({href:a.links.pricing,icon:"sell",label:"Pricing"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",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",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border p-5 sm:p-7",style:{borderColor:m,background:`linear-gradient(140deg, ${l} 0%, transparent 55%)`},children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-4",children:[(0,d.jsx)("div",{className:"flex size-14 shrink-0 items-center justify-center rounded-xl shadow-sm",style:{backgroundColor:a.color?`${a.color}20`:"rgba(148,163,184,0.15)"},children:f||!c?(0,d.jsx)("span",{className:"text-base font-bold",style:{color:a.color||"inherit"},children:a.textIcon||a.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:c,alt:a.name,width:56,height:56,className:"max-h-14 max-w-14 rounded-xl object-contain",sizes:"56px",onError:()=>g(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:a.name}),(0,d.jsx)(j.Ex,{variant:k.variant,size:"sm",children:k.label}),a.deprecated&&(0,d.jsx)(j.Ex,{variant:"warning",size:"sm",children:"deprecated"})]}),(0,d.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[b," connection",1===b?"":"s",a.serviceKinds.length>1&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",a.serviceKinds.join(" \xb7 ")]})]})]})]}),n.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 sm:justify-end",children:n.map(a=>(0,d.jsxs)("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-full border border-border bg-bg/60 px-2.5 py-1 text-xs text-text-main hover:border-primary hover:text-primary transition-colors backdrop-blur",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:a.icon}),a.label]},a.label))})]}),a.notices.body&&!a.deprecated&&(0,d.jsx)("p",{className:"mt-4 max-w-3xl text-sm leading-relaxed text-text-muted",children:a.notices.body})]}),a.deprecated&&a.notices.warning&&(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 shrink-0 text-[16px] text-yellow-500",children:"warning"}),(0,d.jsx)("p",{className:"text-xs leading-relaxed text-red-600 dark:text-yellow-400",children:a.notices.warning})]})]})}C.propTypes={capabilities:p().object,connectionCount:p().number,headerIconPath:p().string};let D={oauth:{icon:"lock",label:"Sign in with OAuth",tabLabel:"OAuth"},apikey:{icon:"key",label:"Add API key",tabLabel:"API key"},free:{icon:"bolt",label:"Connect for free",tabLabel:"Free"},cookie:{icon:"cookie",label:"Paste session cookie",tabLabel:"Cookie"},compatible:{icon:"developer_board",label:"Configure endpoint",tabLabel:"Compatible"}};function E({children:a,accentColor:b}){return(0,d.jsx)("div",{className:"rounded-xl border p-5 sm:p-6",style:{borderColor:b?`${b}25`:void 0,background:b?`linear-gradient(160deg, ${b}08, transparent 70%)`:void 0},children:a})}let F={oauth:function({capabilities:a,onOAuth:b,onBulkImport:c}){return(0,d.jsx)(E,{accentColor:a.color,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("h3",{className:"text-base font-semibold",children:["Sign in with ",a.name]}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"One click. We handle the OAuth callback and store your session locally. You can add multiple accounts."})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2 sm:flex-nowrap",children:[a.features.bulkImport&&c&&(0,d.jsx)(j.$n,{size:"md",icon:"playlist_add",variant:"secondary",onClick:c,children:"Bulk import"}),(0,d.jsxs)(j.$n,{size:"md",icon:"lock",onClick:b,children:["Sign in with ",a.name]})]})]})})},apikey:function({capabilities:a,onApiKey:b}){return(0,d.jsx)(E,{accentColor:a.color,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("h3",{className:"text-base font-semibold",children:["Paste your ",a.name," API key"]}),(0,d.jsxs)("p",{className:"mt-0.5 text-sm text-text-muted",children:[a.links.apiKey?(0,d.jsxs)(d.Fragment,{children:["Grab a key from"," ",(0,d.jsx)("a",{href:a.links.apiKey,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline decoration-primary/40 underline-offset-4 hover:decoration-primary",children:new URL(a.links.apiKey).hostname})," ","and paste it in."]}):(0,d.jsx)(d.Fragment,{children:"Paste your API key to connect."})," ","Stored locally, never sent anywhere except ",a.name,"."]})]}),(0,d.jsx)(j.$n,{size:"md",icon:"key",onClick:b,children:"Add API key"})]})})},free:function({capabilities:a,onFree:b}){return(0,d.jsx)(E,{accentColor:a.color||"#10B981",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-green-500",children:"bolt"}),(0,d.jsxs)("h3",{className:"text-base font-semibold",children:[a.name," is free — one click to connect"]})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No key, no signup, no card. Just click connect and start using it."})]}),(0,d.jsx)(j.$n,{size:"md",icon:"add",onClick:b,children:"Connect"})]})})},cookie:function({capabilities:a,onCookie:b}){let[c,f]=(0,e.useState)(!1);return(0,d.jsx)(E,{accentColor:a.color||"#F59E0B",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"text-base font-semibold",children:"Advanced: connect with session cookie"}),(0,d.jsxs)("p",{className:"mt-0.5 text-sm text-text-muted",children:["For power users. Extract the ",a.name," cookie from your browser and paste it here."]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>f(a=>!a),className:"text-xs text-text-muted hover:text-primary",children:c?"hide":"show"})]}),c&&(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-bg/70 p-3",children:[(0,d.jsxs)("ol",{className:"mb-3 list-decimal space-y-1 pl-4 text-xs text-text-muted",children:[(0,d.jsxs)("li",{children:["Open ",a.name," in your browser and sign in."]}),(0,d.jsx)("li",{children:"Open DevTools → Application → Cookies."}),(0,d.jsx)("li",{children:"Copy the session cookie value."}),(0,d.jsx)("li",{children:"Paste it in the modal."})]}),(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",onClick:b,children:"Paste cookie"})]})]})})},compatible:function({capabilities:a,onCompatible:b}){return(0,d.jsx)(E,{accentColor:a.color,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"text-base font-semibold",children:"Use as OpenAI-compatible endpoint"}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Point at any OpenAI-shaped base URL (self-hosted, LiteLLM, custom proxy). Fetches the live model list after you connect."})]}),(0,d.jsx)(j.$n,{size:"md",icon:"developer_board",onClick:b,children:"Configure endpoint"})]})})}};function G({capabilities:a,onOAuth:b,onApiKey:c,onFree:f,onCookie:g,onCompatible:h,onBulkImport:i}){let j=a?.authModes||[],[k,l]=(0,e.useState)(j[0]||"apikey");if(!a||0===j.length)return null;let m=F[k]||F.apikey,n=j.length>1;return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[n&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1 rounded-lg border border-border bg-sidebar/40 p-1",children:j.map(a=>{let b=D[a]||{icon:"add",tabLabel:a},c=a===k;return(0,d.jsxs)("button",{type:"button",onClick:()=>l(a),className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${c?"bg-bg text-text-main shadow-sm":"text-text-muted hover:text-text-main"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:b.icon}),b.tabLabel]},a)})}),(0,d.jsx)(m,{capabilities:a,onOAuth:b,onApiKey:c,onFree:f,onCookie:g,onCompatible:h,onBulkImport:i})]})}function H({providerId:a,models:b=[]}){let[c,f]=(0,e.useState)(""),[g,h]=(0,e.useState)({status:"idle"});if((0,e.useCallback)(async()=>{if(a){h(a=>({...a,status:"ok"===a.status?"refreshing":"loading"}));try{let b=new URLSearchParams({providerId:a});c&&b.set("model",c);let d=await fetch(`/api/providers/zenith?${b.toString()}`,{cache:"no-store"}),e=await d.json();e.success?h({status:"ok",winner:e.winner,count:e.count,leaderboard:e.leaderboard}):h({status:"error",error:e.error||"Zenith read failed"})}catch(a){h({status:"error",error:a?.message||"Network error"})}}},[a,c]),"idle"===g.status||"loading"===g.status||"error"===g.status||!g.winner||(g.count??0)<2)return null;let i=g.winner;return(0,d.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2 rounded-lg border border-primary/20 bg-primary/[0.04] px-3 py-2 text-xs",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-primary font-medium",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"route"}),"Next request →"]}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:i.name}),(0,d.jsxs)("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:["Z:",i.finalScore]}),(0,d.jsxs)("span",{className:"text-text-muted",children:["health ",i.healthScore," \xb7 quota \xd7",i.quotaFactor," \xb7 priority +",i.priorityBonus]}),b.length>0&&(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-text-muted",children:"Model:"}),(0,d.jsxs)("select",{value:c,onChange:a=>f(a.target.value),className:"rounded-md border border-border bg-bg px-1.5 py-0.5 text-[11px] focus:outline-none focus:border-primary",children:[(0,d.jsx)("option",{value:"",children:"(any)"}),b.map(a=>(0,d.jsx)("option",{value:a.id,children:a.id},a.id))]})]})]})}function I({providerId:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)([]),[h,i]=(0,e.useState)(!1);return(0,e.useCallback)(async()=>{if(a){i(!0);try{let b=await fetch(`/api/providers/zenith/log?providerId=${a}&limit=50`,{cache:"no-store"}),c=await b.json();c.success&&g(c.entries||[])}catch{}finally{i(!1)}}},[a]),(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-border",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>c(a=>!a),className:"flex w-full items-center justify-between px-3 py-2 text-xs text-text-muted hover:text-text-main",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"history"}),"Routing decisions",f.length>0&&(0,d.jsxs)("span",{className:"text-text-muted",children:["(",f.length,")"]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:b?"expand_less":"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"max-h-64 overflow-y-auto border-t border-border/50 px-3 py-2",children:[h&&0===f.length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Loading…"}),!h&&0===f.length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No decisions recorded yet. Fire a request through kRouter to populate."}),(0,d.jsx)("ul",{className:"space-y-1",children:f.map((a,b)=>(0,d.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border/30 py-1 text-[11px] font-mono last:border-0",children:[(0,d.jsx)("span",{className:"text-text-muted",children:function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<5)return"just now";if(b<60)return`${b}s ago`;let c=Math.floor(b/60);return c<60?`${c}m ago`:`${Math.floor(c/60)}h ago`}(a.at)}),a.model&&(0,d.jsx)("span",{className:"text-text-main",children:a.model}),(0,d.jsx)("span",{className:"text-text-muted",children:"→"}),(0,d.jsx)("span",{className:"text-text-main",children:a.connectionId.slice(0,8)}),null!=a.score&&(0,d.jsxs)("span",{className:"text-primary",children:["Z:",a.score]}),null!=a.latencyMs&&(0,d.jsxs)("span",{className:"text-text-muted",children:[a.latencyMs,"ms"]}),(0,d.jsx)("span",{className:a.success?"text-green-500":"text-red-500",children:a.success?"✓":"✗"})]},`${a.at}-${b}`))})]})]})}function J(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,[o,p]=(0,e.useState)([]),[r,t]=(0,e.useState)(!0),[v,z]=(0,e.useState)(null),[B,D]=(0,e.useState)([]),[E,F]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(null),[Z,$]=(0,e.useState)({}),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)({}),[ad,ae]=(0,e.useState)(""),[af,ag]=(0,e.useState)(new Set),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(!1),[al,am]=(0,e.useState)([]),[an,ao]=(0,e.useState)("__none__"),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)(null),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)("auto"),[ax,ay]=(0,e.useState)({enabled:!1,connections:{}}),[az,aA]=(0,e.useState)([]),[aB,aC]=(0,e.useState)([]),[aD,aE]=(0,e.useState)(!1),[aF,aG]=(0,e.useState)(""),[aH,aI]=(0,e.useState)(new Set),[aJ,aK]=(0,e.useState)([]),[aL,aM]=(0,e.useState)([]),[aN,aO]=(0,e.useState)(null),[aP,aQ]=(0,e.useState)(!1),[aR,aS]=(0,e.useState)(!1),[aT,aU]=(0,e.useState)(!1),[aV,aW]=(0,e.useState)(null),[aX,aY]=(0,e.useState)({}),[aZ,a$]=(0,e.useState)(null),a_=(0,e.useRef)(!1),[a0,a1]=(0,e.useState)(!1),{copied:a2,copy:a3}=(0,m.C)(),a4=()=>{F(!0)},a5=()=>{bd?a4():(O(""),M(!0))},a6=()=>{O(""),M(!0)},a7=()=>{bd?a5():a6()},a8=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],a9=v?null:function(a){let b=k.zN[a]?k.zN:k.fg[a]?k.fg:k.IS[a]?k.IS:k.nJ[a]?k.nJ:k.br[a]?k.br:null;if(!b)return null;let c=b[a],d=b===k.IS&&c?.noAuth?"free":b===k.IS||b===k.zN?"oauth":b===k.br?"cookie":b===k.fg&&c?.noAuth?"free":(b===k.fg||k.nJ,"apikey"),e=Array.isArray(c.authModes)?c.authModes.filter(a=>a!==d):[],f=[d,...e],g=(0,k.mq)(a)||(0,k.gb)(a);g&&!f.includes("compatible")&&f.push("compatible");let h=c.notice||{};return{id:a,name:c.name||a,icon:c.icon,image:c.image,textIcon:c.textIcon,color:c.color,tier:b===k.IS?"free":b===k.nJ?"freetier":b===k.zN?"oauth":b===k.br?"webcookie":c?.noAuth?"free":"paid",authModes:f,links:{homepage:c.website,apiKey:h.apiKeyUrl,signup:h.signupUrl,pricing:c.searchViaChat?.pricingUrl,docs:c.docsUrl},features:{autoPing:"claude"===a&&"oauth"===d,bulkImport:"codex"===a,compatibleModels:g,customModels:!c.passthroughModels,passthroughModels:!!c.passthroughModels,hasRegions:Array.isArray(c.regions)&&c.regions.length>0,hasProviderSpecificData:!!c.hasProviderSpecificData},serviceKinds:c.serviceKinds||["llm"],thinking:c.thinkingConfig||null,notices:{body:h.text,warning:c.deprecationNotice},deprecated:!!c.deprecated,regions:c.regions,defaultRegion:c.defaultRegion,noAuth:!!c.noAuth,_raw:c}}(g),ba="codex"===g?"codexAutoPing":"claudeAutoPing",bb="claude"===g||"codex"===g,bc=a8?.authModes||[],bd=!!k.zN[g]||!!k.IS[g]||bc.includes("oauth"),be=!!k.fg[g]||bc.includes("apikey"),bf=!!k.IS[g]?.noAuth,bg=(0,l.KC)(g),bh=(0,k.wG)(g),bi=(0,k.mq)(g),bj=(0,k.gb)(g),bk=bi||bj,bl=!bk&&bd&&be,bm="xai"===g?"Grok Build OAuth":"OAuth",bn="xai"===g?"xAI API Key":"API Key";k.Q2[g]?.thinkingConfig||k.s9.extended;let bo=bk?g:bh,bp=bk?v?.prefix||g:bh,bq=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bo)}`,{cache:"no-store"}),b=await a.json();a.ok&&aM(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bo]),br=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bo,ids:[a]})})).ok&&await bq()}catch(a){console.log("Error disabling model:",a)}},bs=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bo)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bq()}catch(a){console.log("Error enabling model:",a)}},bt=async a=>{a.length&&aO({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{aO(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bo,ids:a})})).ok&&await bq()}catch(a){console.log("Error disabling all models:",a)}}})},bu=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bo)}`,{method:"DELETE"})).ok&&await bq()}catch(a){console.log("Error enabling all models:",a)}},bv=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&$(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bw=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),e=await a.json(),f=await b.json(),h=await c.json(),i=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===g);p(a)}c.ok&&D(h.proxyPools||[]);let j=(i.providerStrategies||{})[g]||{};as(j.fallbackStrategy||null),au(null!=j.stickyRoundRobinLimit?String(j.stickyRoundRobinLimit):"1");let k=(i.providerThinking||{})[g]||{};aw(k.mode||"auto");let l=i[ba]||{};if(ay({enabled:!0===l.enabled,connections:l.connections||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===g)||null;if(!a&&bk)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===g)||null))break}z(a)}}catch(a){console.log("Error fetching connections:",a)}finally{t(!1)}},[g,bk]),bx=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&&(z(c.node),await bw(),U(!1))}catch(a){console.log("Error updating provider node:",a)}},by=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)}},bz=async(a,b)=>{ay({...ax,connections:{...ax.connections,[a]:b}});try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{})[ba]||{},e={...d,connections:{...d.connections||{},[a]:b}};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[ba]:e})}),ay({enabled:!0===e.enabled,connections:e.connections})}catch(a){console.log("Error saving auto-ping config:",a),ay(ax)}},[bA,bB]=(0,e.useState)({}),bC=(0,e.useCallback)(async()=>{if(0===o.length)return;let a=o.find(a=>!1!==a.isActive)||o[0];if(a){aE(!0);try{let b=null;try{let c=await fetch(`/api/models/live-by-connection?connectionId=${a.id}`),d=c.ok?await c.json():null;d?.success&&d?.models?.length?b={models:d.models}:d?.code==="no_fetcher"&&(b=null)}catch{}if(!b){let c=await fetch(`/api/providers/${a.id}/models`);b=c.ok?await c.json():null}b?.models?.length&&(aC(b.models),aI(a=>{if(a.size>0)return a;let c=b.models[0]?.id||"",d=c.includes("/")?c.split("/")[0]:"other";return new Set([d])}))}catch{}finally{aE(!1)}}},[g,o]),bD=async(a,b,c=bh)=>{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 bv();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bE=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bv()}catch(a){console.log("Error deleting alias:",a)}},bF=async()=>{if(a0)return;let a=o.find(a=>!1!==a.isActive);if(!a)return void alert((0,n.Tl)("Please add an active Qoder connection first"));a1(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,n.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,n.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,""),d=`${bo}/${c}`;!Object.values(Z).includes(d)&&(Z[c]||(await bD(c,c,bo),e+=1))}0===e?alert((0,n.Tl)("All models already exist, no new models added")):alert((0,n.Tl)("Successfully added")+` ${e} `+(0,n.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,n.Tl)("Error fetching models")+": "+a.message)}finally{a1(!1)}},bG=async()=>{if(aR||0===o.length)return;let a=Object.fromEntries(o.map(a=>[a.id,{state:"queued",error:null}]));a_.current=!1,aS(!0),aU(!1),aW(null),aY(a),a$({total:o.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<o.length;a+=1){if(a_.current){a$({total:o.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=o[a];aW(d.id),aY(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,aY(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,aY(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}a$({total:o.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<o.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{aW(null),aS(!1),aU(!1),a_.current=!1}},bH=async a=>{aO({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{aO(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&p(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},bI=()=>{bw(),F(!1)},bJ=async a=>{O("");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 bw(),M(!1);return}O(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),O("Failed to save connection")}},bK=async a=>{try{(await fetch(`/api/providers/${X.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bw(),S(!1))}catch(a){console.log("Error updating connection:",a)}},bL=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&p(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},bM=async(a,b)=>{let c=[...o];[c[a],c[b]]=[c[b],c[a]],p(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await bw()}},bN=o.filter(a=>al.includes(a.id));o.length>0&&(al.length,o.length),(()=>{if(0===bN.length)return;let a=new Set(bN.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=B.find(a=>a.id===b);return c?.name}})();let bO=()=>{ap||W(!1)},bP=async a=>{aq(!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 bw(),W(!1)}finally{aq(!1)}},bQ=a=>bP(o.map(b=>({connectionId:b.id,proxyPoolId:a}))),bR=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:o.map((a,b)=>(0,d.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(u,{connection:a,proxyPools:B,health:bA[a.id],isOAuth:bd,isFirst:0===b,isLast:b===o.length-1,onMoveUp:()=>bM(b,b-1),onMoveDown:()=>bM(b,b+1),onToggleActive:b=>bL(a.id,b),autoPing:bb&&"oauth"===a.authType?{on:!0===ax.connections[a.id],onToggle:b=>bz(a.id,b)}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&p(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:()=>{Y(a),S(!0)},onDelete:()=>bH(a.id),oneByOneStatus:aX[a.id]||null})})},a.id))}),bS=B.filter(a=>!0===a.isActive),bT=(0,d.jsx)(j.aF,{isOpen:V,onClose:bO,title:`Apply Proxy (${o.length} connections)`,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=B.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):bP(o.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:ap||0===bS.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:()=>bQ(null),disabled:ap,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)"})]}),B.map(a=>(0,d.jsxs)("button",{onClick:()=>bQ(a.id),disabled:ap||!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))]}),ap&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:bO,variant:"ghost",fullWidth:!0,disabled:ap,children:"Cancel"})]})}),bU=async a=>{if(!af.has(a)){ag(b=>new Set([...b,a]));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bo}/${a}`})}),c=await b.json();ac(b=>({...b,[a]:c.ok?"ok":"error"})),c.ok||ae(c.error||"Model not reachable")}catch{ac(b=>({...b,[a]:"error"}))}finally{ag(b=>{let c=new Set(b);return c.delete(a),c})}}},bV=async a=>{if(ah)return;ai(!0);let b=[];try{for(let c=0;c<a.length;c+=5){let d=a.slice(c,c+5);await Promise.all(d.map(async a=>{ag(b=>new Set([...b,a.id]));try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bo}/${a.id}`})}),d=await c.json(),e=d.ok?"ok":"error";ac(b=>({...b,[a.id]:e})),d.ok&&b.push(a)}catch{ac(b=>({...b,[a.id]:"error"}))}finally{ag(b=>{let c=new Set(b);return c.delete(a.id),c})}}))}for(let a of b)await bD(a.id,a.id,bo);b.length>0&&document.getElementById("available-models-section")?.scrollIntoView({behavior:"smooth"})}finally{ai(!1)}};if(r)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]});if(!a8)return(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"})]});let bW=()=>bi&&a8.apiType?"responses"===a8.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bj?"/providers/anthropic-m.png":`/providers/${a8.id}.png`;return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[a9?(0,d.jsx)(C,{capabilities:a9,connectionCount:o.length,headerIconPath:_?null:bW()}):(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:`${a8.color}15`},children:_?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:a8.color},children:a8.textIcon||a8.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bW(),alt:a8.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>aa(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:a8.name}),(0,d.jsxs)("p",{className:"text-text-muted",children:[o.length," connection",1===o.length?"":"s"]})]})]})]}),bk&&v&&(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:bj?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bj?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",bj?"messages":"responses"===v.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:()=>{O(""),M(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>U(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{aO({title:"Delete Compatible Node",message:`Delete this ${bj?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{aO(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"})]})]})}),bf?(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:[o.length>0&&B.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>W(!0),children:"Apply Proxy"}),al.length>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=al.length;0!==a&&aO({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{aO(null);let a=0,b=[...al],c=[];for(let d of b)try{(await fetch(`/api/providers/${d}`,{method:"DELETE"})).ok?c.push(d):a+=1}catch(b){console.log("Error deleting connection:",b),a+=1}p(a=>a.filter(a=>!c.includes(a.id))),am(b.filter(a=>!c.includes(a))),a>0&&alert(`Deleted ${c.length} connection(s), ${a} failed and are still selected.`)}})},children:["Delete Selected (",al.length,")"]}),o.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bG,disabled:aR,children:aR?"Testing Connection One-by-One...":"Test Connection One-by-One"}),aR&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{aR&&(a_.current=!0,aU(!0))},disabled:aT,children:aT?"Stopping...":"Stop"})]}),(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"===ar,onChange:a=>{let b=a?"round-robin":null,c=a?at||"1":at;a&&!at&&au("1"),as(b),by(b,c)}}),"round-robin"===ar&&(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:at,onChange:a=>{var b;au(b=a.target.value),by("round-robin",b)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===o.length?a9?(0,d.jsx)(G,{capabilities:a9,onOAuth:a5,onApiKey:a6,onFree:a7,onCookie:()=>K(!0),onCompatible:a6,onBulkImport:()=>Q(!0)}):(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:"key"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"})]}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:a7,children:"Add API Key"})]}):(0,d.jsxs)(d.Fragment,{children:[aZ&&(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: ",aZ.total]}),(0,d.jsxs)("span",{children:["Completed: ",aZ.completed]}),(0,d.jsxs)("span",{children:["Passed: ",aZ.passed]}),(0,d.jsxs)("span",{children:["Failed: ",aZ.failed]}),aZ.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),aR&&aV&&(0,d.jsxs)("span",{children:["Running: ",o.find(a=>a.id===aV)?.name||aV]})]})}),!bk&&a9&&(0,d.jsx)(H,{providerId:g,models:aB}),bR,!bk&&a9&&(0,d.jsx)(I,{providerId:g}),!bk&&(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:()=>K(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),title:(0,n.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,n.Tl)("Bulk Add")}),bl?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:a5,className:"w-full sm:w-auto",children:bm}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:a6,className:"w-full sm:w-auto",children:bn})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:a7,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsxs)(j.Zp,{id:"available-models-section",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"}),!bk&&(a=[...bg,...aJ.filter(a=>!bg.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type).map(a=>a.id).filter(a=>!aL.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aL.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bu,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bt(a),children:"Disable All"})]}))]}),!!ad&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ad}),(()=>{if(bk)return(0,d.jsx)(s,{providerStorageAlias:bo,providerDisplayAlias:bp,modelAliases:Z,copied:a2,onCopy:a3,onSetAlias:bD,onDeleteAlias:bE,connections:o,isAnthropic:bj});let a=[...bg,...aJ.filter(a=>!bg.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type),b=new Set(aL),c=a.filter(a=>!b.has(a.id)),e=a.filter(a=>b.has(a.id)),f=Object.entries(Z).filter(([a,b])=>{let c=`${bo}/`;if(!b.startsWith(c))return!1;let d=b.slice(c.length);return a8.passthroughModels?!bg.some(a=>a.id===d):!bg.some(a=>a.id===d)&&a===d}).map(([a,b])=>({id:b.slice(`${bo}/`.length),alias:a,fullModel:b}));return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[f.map(a=>(0,d.jsx)(q,{model:{id:a.id},fullModel:`${bp}/${a.id}`,alias:a.alias,copied:a2,onCopy:a3,onSetAlias:()=>{},onDeleteAlias:()=>bE(a.alias),testStatus:ab[a.id],onTest:o.length>0||bf?()=>bU(a.id):void 0,isTesting:af.has(a.id),isCustom:!0,isFree:!1},a.id)),c.map(a=>{let b=`${bo}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(Z).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(q,{model:a,fullModel:`${bp}/${a.id}`,alias:e,copied:a2,onCopy:a3,onSetAlias:b=>bD(a.id,b,bo),onDeleteAlias:()=>bE(e),testStatus:ab[a.id],onTest:o.length>0||bf?()=>bU(a.id):void 0,isTesting:af.has(a.id),isFree:a.isFree,onDisable:()=>br(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>ak(!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&&o.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bF,disabled:a0,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:a0?{animation:"spin 1s linear infinite"}:void 0,children:a0?"progress_activity":"download"}),a0?(0,n.Tl)("Fetching..."):(0,n.Tl)("Fetch Qoder Models")]}),(()=>{let a=new Set([...c.map(a=>a.id),...f.map(a=>a.id)]),b=aB.length>0?aB:az,g=aB.length>0,h=b.filter(b=>b.id&&!a.has(b.id)),i=new Set(aB.map(a=>a.id).filter(Boolean)),j=e.filter(a=>a.id&&!i.has(a.id)).map(a=>({...a,dropped:!0})),k=new Set(j.map(a=>a.id)),l=[...h.filter(a=>!k.has(a.id)),...j];if(!aD&&0===l.length&&0===b.length)return null;let m=aF.trim().toLowerCase(),n=m?l.filter(a=>a.id.toLowerCase().includes(m)||a.name&&a.name.toLowerCase().includes(m)):l,o={};n.forEach(a=>{if(!a.id)return;let b=a.id.includes("/")?a.id.split("/")[0]:"models";o[b]||(o[b]=[]),o[b].push(a)});let p=Object.entries(o).sort((a,b)=>b[1].length-a[1].length),q=n.filter(a=>!a.dropped).slice(0,50);return(0,d.jsxs)("div",{className:"w-full mt-4 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-text-muted shrink-0",children:aD?"Loading...":`${g?"From API":"Suggested"} (${h.length})${j.length>0?` \xb7 ${j.length} dropped`:""}`}),(0,d.jsxs)("div",{className:"relative flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-[13px] text-text-muted pointer-events-none select-none",children:"search"}),(0,d.jsx)("input",{type:"text",value:aF,onChange:a=>aG(a.target.value),placeholder:"Search models...",className:"w-full h-7 pl-7 pr-7 text-xs rounded-lg bg-bg border border-border-subtle text-text-main placeholder:text-text-muted focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors"}),aF&&(0,d.jsx)("button",{onClick:()=>aG(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-muted transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:bC,disabled:aD,title:"Refresh",className:"shrink-0 h-7 w-7 flex items-center justify-center rounded-lg border border-border-subtle text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors disabled:opacity-40",children:(0,d.jsx)("span",{className:`material-symbols-outlined text-[14px] ${aD?"animate-spin":""}`,children:"refresh"})}),!aD&&q.length>0&&(0,d.jsxs)("button",{onClick:()=>bV(q),disabled:ah,title:`Test up to ${q.length} models and auto-add passing ones`,className:"shrink-0 h-7 flex items-center gap-1 px-2.5 rounded-lg border border-border-subtle text-xs text-text-muted hover:text-green-600 hover:border-green-500/40 hover:bg-green-500/5 transition-colors disabled:opacity-40",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[13px] ${ah?"animate-spin":""}`,children:ah?"progress_activity":"play_circle"}),ah?"Testing...":"Test All"]})]}),m&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[n.length," result",1!==n.length?"s":""]}),aD?(0,d.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] animate-spin",children:"progress_activity"}),"Fetching models from provider API..."]}):0===p.length?m?(0,d.jsxs)("p",{className:"text-xs text-text-muted py-2",children:['No models match "',aF,'"']}):null:(0,d.jsx)("div",{className:"space-y-1",children:p.map(([a,b])=>{let c=aH.has(a),e=b.filter(a=>!a.dropped&&"ok"===ab[a.id]).length,f=b.filter(a=>!a.dropped&&"error"===ab[a.id]).length,g=b.filter(a=>a.dropped).length;return(0,d.jsxs)("div",{className:"rounded-xl border border-border-subtle overflow-hidden",children:[(0,d.jsxs)("button",{onClick:()=>aI(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c}),className:"w-full flex items-center gap-2 px-3 py-2 text-xs bg-bg hover:bg-surface-2/60 transition-colors text-left",children:[(0,d.jsx)("span",{className:"font-semibold text-text-main flex-1",children:a}),e>0&&(0,d.jsxs)("span",{className:"text-green-600 dark:text-green-400 font-medium",children:[e," ✓"]}),f>0&&(0,d.jsxs)("span",{className:"text-red-500 font-medium",children:[f," ✗"]}),g>0&&(0,d.jsxs)("span",{className:"px-1.5 py-0.5 rounded-md bg-amber-500/10 text-amber-600 dark:text-amber-400 text-[10px] font-medium",children:[g," dropped"]}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded-md bg-black/[0.06] dark:bg-white/[0.06] text-text-muted tabular-nums font-medium",children:b.length}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsx)("div",{className:"px-3 pt-2 pb-3 flex flex-wrap gap-1.5 border-t border-border-subtle bg-surface/50",children:b.map(a=>{let b=a.id.includes("/")?a.id.split("/").slice(1).join("/"):a.id,c=ab[a.id],e=af.has(a.id);return a.dropped?(0,d.jsxs)("button",{onClick:async()=>{await bs(a.id),document.getElementById("available-models-section")?.scrollIntoView({behavior:"smooth"})},title:`Recently Dropped — click to restore: ${a.id}`,className:"group flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-amber-400/40 bg-amber-500/5 text-amber-700 dark:text-amber-400 text-xs hover:bg-amber-500/10 hover:border-amber-400/60 transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"history"}),(0,d.jsx)("span",{children:b}),a.contextLength>0&&(0,d.jsxs)("span",{className:"opacity-50 text-[10px] ml-0.5",children:[(a.contextLength/1e3).toFixed(0),"k"]})]},a.id):(0,d.jsxs)("button",{onClick:async()=>{await bD(a.id,a.id,bo),document.getElementById("available-models-section")?.scrollIntoView({behavior:"smooth"})},title:`Add: ${a.name||a.id}`,className:["group flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-xs transition-colors","ok"===c?"border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400 hover:bg-green-500/10":"error"===c?"border-red-400/30 bg-red-500/5 text-red-600 dark:text-red-400 hover:bg-red-500/10":"border-border-subtle text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5"].join(" "),children:[e?(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px] animate-spin",children:"progress_activity"}):"ok"===c?(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"check"}):"error"===c?(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"}):(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-50 group-hover:opacity-100",children:"add"}),(0,d.jsx)("span",{children:b}),a.contextLength>0&&(0,d.jsxs)("span",{className:"opacity-40 text-[10px] ml-0.5",children:[(a.contextLength/1e3).toFixed(0),"k"]})]},a.id)})})]},a)})})]})})()]})})()]}),bT,"kiro"===g?(0,d.jsx)(j.Mh,{isOpen:E,providerInfo:a8,onSuccess:bI,onClose:()=>F(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:E,onSuccess:bI,onClose:()=>F(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:E,providerInfo:a8,onSuccess:bI,onClose:()=>F(!1)}):(0,d.jsx)(j.LF,{isOpen:E,provider:g,providerInfo:a8,onSuccess:bI,onClose:()=>F(!1)}),"iflow"===g&&(0,d.jsx)(j.vE,{isOpen:J,onSuccess:()=>{bw(),K(!1)},onClose:()=>K(!1)}),(0,d.jsx)(w,{isOpen:L,provider:g,providerName:a8.name,isCompatible:bk,isAnthropic:bj,authType:a8?.authType,authHint:a8?.authHint,website:a8?.website,proxyPools:B,error:N,existingNames:o.map(a=>a.name).filter(Boolean),onSave:bJ,onBulkDone:bw,onClose:()=>{O(""),M(!1)}}),(0,d.jsx)(j.wI,{isOpen:R,connection:X,proxyPools:B,onSave:bK,onClose:()=>S(!1)}),bk&&(0,d.jsx)(x,{isOpen:T,node:v,onSave:bx,onClose:()=>U(!1),isAnthropic:bj}),!bk&&(0,d.jsx)(y,{isOpen:aj,providerAlias:bo,providerDisplayAlias:bp,onSave:async a=>{let b=a8?.passthroughModels?a.split("/").pop():a;await bD(a,b,bo),ak(!1)},onClose:()=>ak(!1)}),"codex"===g&&(0,d.jsx)(A,{isOpen:P,onClose:()=>Q(!1),onSuccess:bw}),(0,d.jsx)(j.uo,{isOpen:aP,onClose:()=>aQ(!1),onConfirm:()=>{(aQ(!1),bd)?a4():a6()},title:"Risk Notice",message:a8?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aN,onClose:()=>aO(null),onConfirm:aN?.onConfirm,title:aN?.title||"Confirm",message:aN?.message,variant:"danger"})]})}G.propTypes={capabilities:p().object,onOAuth:p().func,onApiKey:p().func,onFree:p().func,onCookie:p().func,onCompatible:p().func,onBulkImport:p().func},H.propTypes={providerId:p().string.isRequired,models:p().array},I.propTypes={providerId:p().string.isRequired}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13934:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,50385))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/Users/shofiqulislam/9router-master/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/Users/shofiqulislam/9router-master/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/Users/shofiqulislam/9router-master/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},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")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34009:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},47161:(a,b,c)=>{Promise.resolve().then(c.bind(c,7592))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83997:a=>{"use strict";a.exports=require("tty")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},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 \"/Users/shofiqulislam/9router-master/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.")},"/Users/shofiqulislam/9router-master/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,7774,5433,4380,2430,5030,1344,1220,4884,5024,5681,4404,4315,8590,4746,6306,1450,7276,8361,5330,8895,6182,6457,706,412,9560],()=>b(b.s=13934));module.exports=c})();
11
+ ]`;function A({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[k,l]=(0,e.useState)(""),[m,o]=(0,e.useState)(null),p=()=>{h||(g(""),l(""),o(null),b())},q=async()=>{var a;let b;l(""),o(null);let d=f.trim();if(!d)return;try{b=JSON.parse(d)}catch(a){l(`${(0,n.Tl)("Invalid JSON")}: ${a.message}`);return}let e=Array.isArray(a=b)?a:a&&"object"==typeof a?Array.isArray(a.accounts)?a.accounts:[a]:null;if(!e||0===e.length)return void l((0,n.Tl)("No accounts found in input"));i(!0);try{let a=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),b=await a.json();if(!a.ok)return void l(b?.error||`Request failed: ${a.status}`);o(b),b.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,n.Tl)("Request failed"))}finally{i(!1)}},r=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(j.aF,{isOpen:a,title:(0,n.Tl)("Bulk Add Codex Accounts"),onClose:p,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,n.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,d.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:z,value:f,onChange:a=>g(a.target.value),disabled:h}),k&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:k}),m&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:`text-sm font-medium ${m.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",m.success," ",(0,n.Tl)("added"),m.failed>0?`, ✗ ${m.failed} ${(0,n.Tl)("failed")}`:""]}),r.length>0&&(0,d.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:r.map(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:q,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,n.Tl)("Importing..."):(0,n.Tl)("Import All")}),(0,d.jsx)(j.$n,{onClick:p,variant:"ghost",fullWidth:!0,disabled:h,children:(0,n.Tl)("Close")})]})]})})}A.propTypes={isOpen:p().bool.isRequired,onClose:p().func.isRequired,onSuccess:p().func};let B={free:{label:"Free",variant:"success",accent:"green"},freetier:{label:"Free tier",variant:"success",accent:"emerald"},oauth:{label:"OAuth",variant:"primary",accent:"primary"},paid:{label:"API key",variant:"default",accent:"neutral"},webcookie:{label:"Cookie",variant:"warning",accent:"amber"}};function C({capabilities:a,connectionCount:b=0,headerIconPath:c}){let[f,g]=(0,e.useState)(!1);if(!a)return null;let k=B[a.tier]||B.paid,l=a.color?`${a.color}10`:"rgba(148,163,184,0.08)",m=a.color?`${a.color}30`:"rgba(148,163,184,0.20)",n=[];return a.links.apiKey&&n.push({href:a.links.apiKey,icon:"key",label:"Get API key"}),a.links.signup&&!a.links.apiKey&&n.push({href:a.links.signup,icon:"person_add",label:"Sign up"}),a.links.homepage&&n.push({href:a.links.homepage,icon:"language",label:"Homepage"}),a.links.docs&&n.push({href:a.links.docs,icon:"menu_book",label:"Docs"}),a.links.pricing&&n.push({href:a.links.pricing,icon:"sell",label:"Pricing"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",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",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border p-5 sm:p-7",style:{borderColor:m,background:`linear-gradient(140deg, ${l} 0%, transparent 55%)`},children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-4",children:[(0,d.jsx)("div",{className:"flex size-14 shrink-0 items-center justify-center rounded-xl shadow-sm",style:{backgroundColor:a.color?`${a.color}20`:"rgba(148,163,184,0.15)"},children:f||!c?(0,d.jsx)("span",{className:"text-base font-bold",style:{color:a.color||"inherit"},children:a.textIcon||a.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:c,alt:a.name,width:56,height:56,className:"max-h-14 max-w-14 rounded-xl object-contain",sizes:"56px",onError:()=>g(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:a.name}),(0,d.jsx)(j.Ex,{variant:k.variant,size:"sm",children:k.label}),a.deprecated&&(0,d.jsx)(j.Ex,{variant:"warning",size:"sm",children:"deprecated"})]}),(0,d.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[b," connection",1===b?"":"s",a.serviceKinds.length>1&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",a.serviceKinds.join(" \xb7 ")]})]})]})]}),n.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 sm:justify-end",children:n.map(a=>(0,d.jsxs)("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-full border border-border bg-bg/60 px-2.5 py-1 text-xs text-text-main hover:border-primary hover:text-primary transition-colors backdrop-blur",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:a.icon}),a.label]},a.label))})]}),a.notices.body&&!a.deprecated&&(0,d.jsx)("p",{className:"mt-4 max-w-3xl text-sm leading-relaxed text-text-muted",children:a.notices.body})]}),a.deprecated&&a.notices.warning&&(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-3 py-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 shrink-0 text-[16px] text-yellow-500",children:"warning"}),(0,d.jsx)("p",{className:"text-xs leading-relaxed text-red-600 dark:text-yellow-400",children:a.notices.warning})]})]})}C.propTypes={capabilities:p().object,connectionCount:p().number,headerIconPath:p().string};let D={oauth:{icon:"lock",label:"Sign in with OAuth",tabLabel:"OAuth"},apikey:{icon:"key",label:"Add API key",tabLabel:"API key"},free:{icon:"bolt",label:"Connect for free",tabLabel:"Free"},cookie:{icon:"cookie",label:"Paste session cookie",tabLabel:"Cookie"},compatible:{icon:"developer_board",label:"Configure endpoint",tabLabel:"Compatible"}};function E({children:a,accentColor:b}){return(0,d.jsx)("div",{className:"rounded-xl border p-5 sm:p-6",style:{borderColor:b?`${b}25`:void 0,background:b?`linear-gradient(160deg, ${b}08, transparent 70%)`:void 0},children:a})}let F={oauth:function({capabilities:a,onOAuth:b,onBulkImport:c}){return(0,d.jsx)(E,{accentColor:a.color,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("h3",{className:"text-base font-semibold",children:["Sign in with ",a.name]}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"One click. We handle the OAuth callback and store your session locally. You can add multiple accounts."})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2 sm:flex-nowrap",children:[a.features.bulkImport&&c&&(0,d.jsx)(j.$n,{size:"md",icon:"playlist_add",variant:"secondary",onClick:c,children:"Bulk import"}),(0,d.jsxs)(j.$n,{size:"md",icon:"lock",onClick:b,children:["Sign in with ",a.name]})]})]})})},apikey:function({capabilities:a,onApiKey:b}){return(0,d.jsx)(E,{accentColor:a.color,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("h3",{className:"text-base font-semibold",children:["Paste your ",a.name," API key"]}),(0,d.jsxs)("p",{className:"mt-0.5 text-sm text-text-muted",children:[a.links.apiKey?(0,d.jsxs)(d.Fragment,{children:["Grab a key from"," ",(0,d.jsx)("a",{href:a.links.apiKey,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline decoration-primary/40 underline-offset-4 hover:decoration-primary",children:new URL(a.links.apiKey).hostname})," ","and paste it in."]}):(0,d.jsx)(d.Fragment,{children:"Paste your API key to connect."})," ","Stored locally, never sent anywhere except ",a.name,"."]})]}),(0,d.jsx)(j.$n,{size:"md",icon:"key",onClick:b,children:"Add API key"})]})})},free:function({capabilities:a,onFree:b}){return(0,d.jsx)(E,{accentColor:a.color||"#10B981",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-green-500",children:"bolt"}),(0,d.jsxs)("h3",{className:"text-base font-semibold",children:[a.name," is free — one click to connect"]})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No key, no signup, no card. Just click connect and start using it."})]}),(0,d.jsx)(j.$n,{size:"md",icon:"add",onClick:b,children:"Connect"})]})})},cookie:function({capabilities:a,onCookie:b}){let[c,f]=(0,e.useState)(!1);return(0,d.jsx)(E,{accentColor:a.color||"#F59E0B",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"text-base font-semibold",children:"Advanced: connect with session cookie"}),(0,d.jsxs)("p",{className:"mt-0.5 text-sm text-text-muted",children:["For power users. Extract the ",a.name," cookie from your browser and paste it here."]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>f(a=>!a),className:"text-xs text-text-muted hover:text-primary",children:c?"hide":"show"})]}),c&&(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-bg/70 p-3",children:[(0,d.jsxs)("ol",{className:"mb-3 list-decimal space-y-1 pl-4 text-xs text-text-muted",children:[(0,d.jsxs)("li",{children:["Open ",a.name," in your browser and sign in."]}),(0,d.jsx)("li",{children:"Open DevTools → Application → Cookies."}),(0,d.jsx)("li",{children:"Copy the session cookie value."}),(0,d.jsx)("li",{children:"Paste it in the modal."})]}),(0,d.jsx)(j.$n,{size:"sm",icon:"cookie",onClick:b,children:"Paste cookie"})]})]})})},compatible:function({capabilities:a,onCompatible:b}){return(0,d.jsx)(E,{accentColor:a.color,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"text-base font-semibold",children:"Use as OpenAI-compatible endpoint"}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Point at any OpenAI-shaped base URL (self-hosted, LiteLLM, custom proxy). Fetches the live model list after you connect."})]}),(0,d.jsx)(j.$n,{size:"md",icon:"developer_board",onClick:b,children:"Configure endpoint"})]})})}};function G({capabilities:a,onOAuth:b,onApiKey:c,onFree:f,onCookie:g,onCompatible:h,onBulkImport:i}){let j=a?.authModes||[],[k,l]=(0,e.useState)(j[0]||"apikey");if(!a||0===j.length)return null;let m=F[k]||F.apikey,n=j.length>1;return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[n&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1 rounded-lg border border-border bg-sidebar/40 p-1",children:j.map(a=>{let b=D[a]||{icon:"add",tabLabel:a},c=a===k;return(0,d.jsxs)("button",{type:"button",onClick:()=>l(a),className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${c?"bg-bg text-text-main shadow-sm":"text-text-muted hover:text-text-main"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:b.icon}),b.tabLabel]},a)})}),(0,d.jsx)(m,{capabilities:a,onOAuth:b,onApiKey:c,onFree:f,onCookie:g,onCompatible:h,onBulkImport:i})]})}function H({providerId:a,models:b=[]}){let[c,f]=(0,e.useState)(""),[g,h]=(0,e.useState)({status:"idle"});if((0,e.useCallback)(async()=>{if(a){h(a=>({...a,status:"ok"===a.status?"refreshing":"loading"}));try{let b=new URLSearchParams({providerId:a});c&&b.set("model",c);let d=await fetch(`/api/providers/zenith?${b.toString()}`,{cache:"no-store"}),e=await d.json();e.success?h({status:"ok",winner:e.winner,count:e.count,leaderboard:e.leaderboard}):h({status:"error",error:e.error||"Zenith read failed"})}catch(a){h({status:"error",error:a?.message||"Network error"})}}},[a,c]),"idle"===g.status||"loading"===g.status||"error"===g.status||!g.winner||(g.count??0)<2)return null;let i=g.winner;return(0,d.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2 rounded-lg border border-primary/20 bg-primary/[0.04] px-3 py-2 text-xs",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-primary font-medium",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"route"}),"Next request →"]}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:i.name}),(0,d.jsxs)("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:["Z:",i.finalScore]}),(0,d.jsxs)("span",{className:"text-text-muted",children:["health ",i.healthScore," \xb7 quota \xd7",i.quotaFactor," \xb7 priority +",i.priorityBonus]}),b.length>0&&(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-text-muted",children:"Model:"}),(0,d.jsxs)("select",{value:c,onChange:a=>f(a.target.value),className:"rounded-md border border-border bg-bg px-1.5 py-0.5 text-[11px] focus:outline-none focus:border-primary",children:[(0,d.jsx)("option",{value:"",children:"(any)"}),b.map(a=>(0,d.jsx)("option",{value:a.id,children:a.id},a.id))]})]})]})}function I({providerId:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)([]),[h,i]=(0,e.useState)(!1);return(0,e.useCallback)(async()=>{if(a){i(!0);try{let b=await fetch(`/api/providers/zenith/log?providerId=${a}&limit=50`,{cache:"no-store"}),c=await b.json();c.success&&g(c.entries||[])}catch{}finally{i(!1)}}},[a]),(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-border",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>c(a=>!a),className:"flex w-full items-center justify-between px-3 py-2 text-xs text-text-muted hover:text-text-main",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"history"}),"Routing decisions",f.length>0&&(0,d.jsxs)("span",{className:"text-text-muted",children:["(",f.length,")"]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:b?"expand_less":"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"max-h-64 overflow-y-auto border-t border-border/50 px-3 py-2",children:[h&&0===f.length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Loading…"}),!h&&0===f.length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No decisions recorded yet. Fire a request through kRouter to populate."}),(0,d.jsx)("ul",{className:"space-y-1",children:f.map((a,b)=>(0,d.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border/30 py-1 text-[11px] font-mono last:border-0",children:[(0,d.jsx)("span",{className:"text-text-muted",children:function(a){let b=Math.floor((Date.now()-a)/1e3);if(b<5)return"just now";if(b<60)return`${b}s ago`;let c=Math.floor(b/60);return c<60?`${c}m ago`:`${Math.floor(c/60)}h ago`}(a.at)}),a.model&&(0,d.jsx)("span",{className:"text-text-main",children:a.model}),(0,d.jsx)("span",{className:"text-text-muted",children:"→"}),(0,d.jsx)("span",{className:"text-text-main",children:a.connectionId.slice(0,8)}),null!=a.score&&(0,d.jsxs)("span",{className:"text-primary",children:["Z:",a.score]}),null!=a.latencyMs&&(0,d.jsxs)("span",{className:"text-text-muted",children:[a.latencyMs,"ms"]}),(0,d.jsx)("span",{className:a.success?"text-green-500":"text-red-500",children:a.success?"✓":"✗"})]},`${a.at}-${b}`))})]})]})}function J(){let a,b=(0,f.useParams)(),c=(0,f.useRouter)(),g=b.id,[o,p]=(0,e.useState)([]),[r,t]=(0,e.useState)(!0),[v,z]=(0,e.useState)(null),[B,D]=(0,e.useState)([]),[E,F]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(null),[Z,$]=(0,e.useState)({}),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)({}),[ad,ae]=(0,e.useState)(""),[af,ag]=(0,e.useState)(new Set),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(!1),[al,am]=(0,e.useState)([]),[an,ao]=(0,e.useState)("__none__"),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)(null),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)("auto"),[ax,ay]=(0,e.useState)({enabled:!1,connections:{}}),[az,aA]=(0,e.useState)([]),[aB,aC]=(0,e.useState)([]),[aD,aE]=(0,e.useState)(!1),[aF,aG]=(0,e.useState)(""),[aH,aI]=(0,e.useState)(new Set),[aJ,aK]=(0,e.useState)([]),[aL,aM]=(0,e.useState)([]),[aN,aO]=(0,e.useState)(null),[aP,aQ]=(0,e.useState)(!1),[aR,aS]=(0,e.useState)(!1),[aT,aU]=(0,e.useState)(!1),[aV,aW]=(0,e.useState)(null),[aX,aY]=(0,e.useState)({}),[aZ,a$]=(0,e.useState)(null),a_=(0,e.useRef)(!1),[a0,a1]=(0,e.useState)(!1),{copied:a2,copy:a3}=(0,m.C)(),a4=()=>{F(!0)},a5=()=>{bd?a4():(O(""),M(!0))},a6=()=>{O(""),M(!0)},a7=()=>{bd?a5():a6()},a8=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:k.zN[g]||k.fg[g]||k.IS[g]||k.nJ[g]||k.br[g],a9=v?null:function(a){let b=k.zN[a]?k.zN:k.fg[a]?k.fg:k.IS[a]?k.IS:k.nJ[a]?k.nJ:k.br[a]?k.br:null;if(!b)return null;let c=b[a],d=b===k.IS&&c?.noAuth?"free":b===k.IS||b===k.zN?"oauth":b===k.br?"cookie":b===k.fg&&c?.noAuth?"free":(b===k.fg||k.nJ,"apikey"),e=Array.isArray(c.authModes)?c.authModes.filter(a=>a!==d):[],f=[d,...e],g=(0,k.mq)(a)||(0,k.gb)(a);g&&!f.includes("compatible")&&f.push("compatible");let h=c.notice||{};return{id:a,name:c.name||a,icon:c.icon,image:c.image,textIcon:c.textIcon,color:c.color,tier:b===k.IS?"free":b===k.nJ?"freetier":b===k.zN?"oauth":b===k.br?"webcookie":c?.noAuth?"free":"paid",authModes:f,links:{homepage:c.website,apiKey:h.apiKeyUrl,signup:h.signupUrl,pricing:c.searchViaChat?.pricingUrl,docs:c.docsUrl},features:{autoPing:"claude"===a&&"oauth"===d,bulkImport:"codex"===a,compatibleModels:g,customModels:!c.passthroughModels,passthroughModels:!!c.passthroughModels,hasRegions:Array.isArray(c.regions)&&c.regions.length>0,hasProviderSpecificData:!!c.hasProviderSpecificData},serviceKinds:c.serviceKinds||["llm"],thinking:c.thinkingConfig||null,notices:{body:h.text,warning:c.deprecationNotice},deprecated:!!c.deprecated,regions:c.regions,defaultRegion:c.defaultRegion,noAuth:!!c.noAuth,_raw:c}}(g),ba="codex"===g?"codexAutoPing":"claudeAutoPing",bb="claude"===g||"codex"===g,bc=a8?.authModes||[],bd=!!k.zN[g]||!!k.IS[g]||bc.includes("oauth"),be=!!k.fg[g]||bc.includes("apikey"),bf=!!k.IS[g]?.noAuth,bg=(0,l.KC)(g),bh=(0,k.wG)(g),bi=(0,k.mq)(g),bj=(0,k.gb)(g),bk=bi||bj,bl=!bk&&bd&&be,bm="xai"===g?"Grok Build OAuth":"OAuth",bn="xai"===g?"xAI API Key":"API Key";k.Q2[g]?.thinkingConfig||k.s9.extended;let bo=bk?g:bh,bp=bk?v?.prefix||g:bh,bq=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bo)}`,{cache:"no-store"}),b=await a.json();a.ok&&aM(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bo]),br=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bo,ids:[a]})})).ok&&await bq()}catch(a){console.log("Error disabling model:",a)}},bs=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bo)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bq()}catch(a){console.log("Error enabling model:",a)}},bt=async a=>{a.length&&aO({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{aO(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bo,ids:a})})).ok&&await bq()}catch(a){console.log("Error disabling all models:",a)}}})},bu=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bo)}`,{method:"DELETE"})).ok&&await bq()}catch(a){console.log("Error enabling all models:",a)}},bv=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&$(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bw=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),e=await a.json(),f=await b.json(),h=await c.json(),i=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===g);p(a)}c.ok&&D(h.proxyPools||[]);let j=(i.providerStrategies||{})[g]||{};as(j.fallbackStrategy||null),au(null!=j.stickyRoundRobinLimit?String(j.stickyRoundRobinLimit):"1");let k=(i.providerThinking||{})[g]||{};aw(k.mode||"auto");let l=i[ba]||{};if(ay({enabled:!0===l.enabled,connections:l.connections||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===g)||null;if(!a&&bk)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===g)||null))break}z(a)}}catch(a){console.log("Error fetching connections:",a)}finally{t(!1)}},[g,bk]),bx=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&&(z(c.node),await bw(),U(!1))}catch(a){console.log("Error updating provider node:",a)}},by=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)}},bz=async(a,b)=>{ay({...ax,connections:{...ax.connections,[a]:b}});try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{})[ba]||{},e={...d,connections:{...d.connections||{},[a]:b}};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[ba]:e})}),ay({enabled:!0===e.enabled,connections:e.connections})}catch(a){console.log("Error saving auto-ping config:",a),ay(ax)}},[bA,bB]=(0,e.useState)({}),bC=(0,e.useCallback)(async()=>{if(0===o.length)return;let a=o.find(a=>!1!==a.isActive)||o[0];if(a){aE(!0);try{let b=null;try{let c=await fetch(`/api/models/live-by-connection?connectionId=${a.id}`),d=c.ok?await c.json():null;d?.success&&d?.models?.length?b={models:d.models}:d?.code==="no_fetcher"&&(b=null)}catch{}if(!b){let c=await fetch(`/api/providers/${a.id}/models`);b=c.ok?await c.json():null}b?.models?.length&&(aC(b.models),aI(a=>{if(a.size>0)return a;let c=b.models[0]?.id||"",d=c.includes("/")?c.split("/")[0]:"other";return new Set([d])}))}catch{}finally{aE(!1)}}},[g,o]),bD=async(a,b,c=bh)=>{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 bv();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bE=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bv()}catch(a){console.log("Error deleting alias:",a)}},bF=async()=>{if(a0)return;let a=o.find(a=>!1!==a.isActive);if(!a)return void alert((0,n.Tl)("Please add an active Qoder connection first"));a1(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,n.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,n.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^qoder\//,""),d=`${bo}/${c}`;!Object.values(Z).includes(d)&&(Z[c]||(await bD(c,c,bo),e+=1))}0===e?alert((0,n.Tl)("All models already exist, no new models added")):alert((0,n.Tl)("Successfully added")+` ${e} `+(0,n.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,n.Tl)("Error fetching models")+": "+a.message)}finally{a1(!1)}},bG=async()=>{if(aR||0===o.length)return;let a=Object.fromEntries(o.map(a=>[a.id,{state:"queued",error:null}]));a_.current=!1,aS(!0),aU(!1),aW(null),aY(a),a$({total:o.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<o.length;a+=1){if(a_.current){a$({total:o.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=o[a];aW(d.id),aY(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,aY(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,aY(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}a$({total:o.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<o.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{aW(null),aS(!1),aU(!1),a_.current=!1}},bH=async a=>{aO({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{aO(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&p(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},bI=()=>{bw(),F(!1)},bJ=async a=>{O("");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 bw(),M(!1);return}O(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),O("Failed to save connection")}},bK=async a=>{try{(await fetch(`/api/providers/${X.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bw(),S(!1))}catch(a){console.log("Error updating connection:",a)}},bL=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&p(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},bM=async(a,b)=>{let c=[...o];[c[a],c[b]]=[c[b],c[a]],p(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await bw()}},bN=o.filter(a=>al.includes(a.id));o.length>0&&(al.length,o.length),(()=>{if(0===bN.length)return;let a=new Set(bN.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=B.find(a=>a.id===b);return c?.name}})();let bO=()=>{ap||W(!1)},bP=async a=>{aq(!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 bw(),W(!1)}finally{aq(!1)}},bQ=a=>bP(o.map(b=>({connectionId:b.id,proxyPoolId:a}))),bR=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:o.map((a,b)=>(0,d.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(u,{connection:a,proxyPools:B,health:bA[a.id],isOAuth:bd,isFirst:0===b,isLast:b===o.length-1,onMoveUp:()=>bM(b,b-1),onMoveDown:()=>bM(b,b+1),onToggleActive:b=>bL(a.id,b),autoPing:bb&&"oauth"===a.authType?{on:!0===ax.connections[a.id],onToggle:b=>bz(a.id,b)}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&p(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:()=>{Y(a),S(!0)},onDelete:()=>bH(a.id),oneByOneStatus:aX[a.id]||null})})},a.id))}),bS=B.filter(a=>!0===a.isActive),bT=(0,d.jsx)(j.aF,{isOpen:V,onClose:bO,title:`Apply Proxy (${o.length} connections)`,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=B.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):bP(o.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:ap||0===bS.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:()=>bQ(null),disabled:ap,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)"})]}),B.map(a=>(0,d.jsxs)("button",{onClick:()=>bQ(a.id),disabled:ap||!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))]}),ap&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(j.$n,{onClick:bO,variant:"ghost",fullWidth:!0,disabled:ap,children:"Cancel"})]})}),bU=async a=>{if(!af.has(a)){ag(b=>new Set([...b,a]));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bo}/${a}`})}),c=await b.json();ac(b=>({...b,[a]:c.ok?"ok":"error"})),c.ok||ae(c.error||"Model not reachable")}catch{ac(b=>({...b,[a]:"error"}))}finally{ag(b=>{let c=new Set(b);return c.delete(a),c})}}},bV=async a=>{if(ah)return;ai(!0);let b=[];try{for(let c=0;c<a.length;c+=5){let d=a.slice(c,c+5);await Promise.all(d.map(async a=>{ag(b=>new Set([...b,a.id]));try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bo}/${a.id}`})}),d=await c.json(),e=d.ok?"ok":"error";ac(b=>({...b,[a.id]:e})),d.ok&&b.push(a)}catch{ac(b=>({...b,[a.id]:"error"}))}finally{ag(b=>{let c=new Set(b);return c.delete(a.id),c})}}))}for(let a of b)await bD(a.id,a.id,bo);b.length>0&&document.getElementById("available-models-section")?.scrollIntoView({behavior:"smooth"})}finally{ai(!1)}};if(r)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]});if(!a8)return(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"})]});let bW=()=>bi&&a8.apiType?"responses"===a8.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bj?"/providers/anthropic-m.png":`/providers/${a8.id}.png`;return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[a9?(0,d.jsx)(C,{capabilities:a9,connectionCount:o.length,headerIconPath:_?null:bW()}):(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:`${a8.color}15`},children:_?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:a8.color},children:a8.textIcon||a8.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.default,{src:bW(),alt:a8.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>aa(!0)})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:a8.name}),(0,d.jsxs)("p",{className:"text-text-muted",children:[o.length," connection",1===o.length?"":"s"]})]})]})]}),bk&&v&&(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:bj?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bj?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",bj?"messages":"responses"===v.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:()=>{O(""),M(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>U(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{aO({title:"Delete Compatible Node",message:`Delete this ${bj?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{aO(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"})]})]})}),bf?(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:[o.length>0&&B.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>W(!0),children:"Apply Proxy"}),al.length>0&&(0,d.jsxs)(j.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=al.length;0!==a&&aO({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{aO(null);let a=0,b=[...al],c=[];for(let d of b)try{(await fetch(`/api/providers/${d}`,{method:"DELETE"})).ok?c.push(d):a+=1}catch(b){console.log("Error deleting connection:",b),a+=1}p(a=>a.filter(a=>!c.includes(a.id))),am(b.filter(a=>!c.includes(a))),a>0&&alert(`Deleted ${c.length} connection(s), ${a} failed and are still selected.`)}})},children:["Delete Selected (",al.length,")"]}),o.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bG,disabled:aR,children:aR?"Testing Connection One-by-One...":"Test Connection One-by-One"}),aR&&(0,d.jsx)(j.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{aR&&(a_.current=!0,aU(!0))},disabled:aT,children:aT?"Stopping...":"Stop"})]}),(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"===ar,onChange:a=>{let b=a?"round-robin":null,c=a?at||"1":at;a&&!at&&au("1"),as(b),by(b,c)}}),"round-robin"===ar&&(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:at,onChange:a=>{var b;au(b=a.target.value),by("round-robin",b)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===o.length?a9?(0,d.jsx)(G,{capabilities:a9,onOAuth:a5,onApiKey:a6,onFree:a7,onCookie:()=>K(!0),onCompatible:a6,onBulkImport:()=>Q(!0)}):(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:"key"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"})]}),(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:a7,children:"Add API Key"})]}):(0,d.jsxs)(d.Fragment,{children:[aZ&&(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: ",aZ.total]}),(0,d.jsxs)("span",{children:["Completed: ",aZ.completed]}),(0,d.jsxs)("span",{children:["Passed: ",aZ.passed]}),(0,d.jsxs)("span",{children:["Failed: ",aZ.failed]}),aZ.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),aR&&aV&&(0,d.jsxs)("span",{children:["Running: ",o.find(a=>a.id===aV)?.name||aV]})]})}),!bk&&a9&&(0,d.jsx)(H,{providerId:g,models:aB}),bR,!bk&&a9&&(0,d.jsx)(I,{providerId:g}),!bk&&(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:()=>K(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===g&&(0,d.jsx)(j.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),title:(0,n.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,n.Tl)("Bulk Add")}),bl?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:a5,className:"w-full sm:w-auto",children:bm}),(0,d.jsx)(j.$n,{size:"sm",icon:"key",onClick:a6,className:"w-full sm:w-auto",children:bn})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"add",onClick:a7,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsxs)(j.Zp,{id:"available-models-section",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"}),!bk&&(a=[...bg,...aJ.filter(a=>!bg.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type).map(a=>a.id).filter(a=>!aL.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[aL.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bu,children:"Active All"}),a.length>0&&(0,d.jsx)(j.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bt(a),children:"Disable All"})]}))]}),!!ad&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ad}),(()=>{if(bk)return(0,d.jsx)(s,{providerStorageAlias:bo,providerDisplayAlias:bp,modelAliases:Z,copied:a2,onCopy:a3,onSetAlias:bD,onDeleteAlias:bE,connections:o,isAnthropic:bj});let a=[...bg,...aJ.filter(a=>!bg.some(b=>b.id===a.id))].filter(a=>!a.type||"llm"===a.type),b=new Set(aL),c=a.filter(a=>!b.has(a.id)),e=a.filter(a=>b.has(a.id)),f=Object.entries(Z).filter(([a,b])=>{let c=`${bo}/`;if(!b.startsWith(c))return!1;let d=b.slice(c.length);return a8.passthroughModels?!bg.some(a=>a.id===d):!bg.some(a=>a.id===d)&&a===d}).map(([a,b])=>({id:b.slice(`${bo}/`.length),alias:a,fullModel:b}));return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[f.map(a=>(0,d.jsx)(q,{model:{id:a.id},fullModel:`${bp}/${a.id}`,alias:a.alias,copied:a2,onCopy:a3,onSetAlias:()=>{},onDeleteAlias:()=>bE(a.alias),testStatus:ab[a.id],onTest:o.length>0||bf?()=>bU(a.id):void 0,isTesting:af.has(a.id),isCustom:!0,isFree:!1},a.id)),c.map(a=>{let b=`${bo}/${a.id}`,c=`${g}/${a.id}`,e=Object.entries(Z).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(q,{model:a,fullModel:`${bp}/${a.id}`,alias:e,copied:a2,onCopy:a3,onSetAlias:b=>bD(a.id,b,bo),onDeleteAlias:()=>bE(e),testStatus:ab[a.id],onTest:o.length>0||bf?()=>bU(a.id):void 0,isTesting:af.has(a.id),isFree:a.isFree,onDisable:()=>br(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>ak(!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&&o.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bF,disabled:a0,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:a0?{animation:"spin 1s linear infinite"}:void 0,children:a0?"progress_activity":"download"}),a0?(0,n.Tl)("Fetching..."):(0,n.Tl)("Fetch Qoder Models")]}),(()=>{let a=new Set([...c.map(a=>a.id),...f.map(a=>a.id)]),b=aB.length>0?aB:az,g=aB.length>0,h=b.filter(b=>b.id&&!a.has(b.id)),i=new Set(aB.map(a=>a.id).filter(Boolean)),j=e.filter(a=>a.id&&!i.has(a.id)).map(a=>({...a,dropped:!0})),k=new Set(j.map(a=>a.id)),l=[...h.filter(a=>!k.has(a.id)),...j];if(!aD&&0===l.length&&0===b.length)return null;let m=aF.trim().toLowerCase(),n=m?l.filter(a=>a.id.toLowerCase().includes(m)||a.name&&a.name.toLowerCase().includes(m)):l,o={};n.forEach(a=>{if(!a.id)return;let b=a.id.includes("/")?a.id.split("/")[0]:"models";o[b]||(o[b]=[]),o[b].push(a)});let p=Object.entries(o).sort((a,b)=>b[1].length-a[1].length),q=n.filter(a=>!a.dropped).slice(0,50);return(0,d.jsxs)("div",{className:"w-full mt-4 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-text-muted shrink-0",children:aD?"Loading...":`${g?"From API":"Suggested"} (${h.length})${j.length>0?` \xb7 ${j.length} dropped`:""}`}),(0,d.jsxs)("div",{className:"relative flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-[13px] text-text-muted pointer-events-none select-none",children:"search"}),(0,d.jsx)("input",{type:"text",value:aF,onChange:a=>aG(a.target.value),placeholder:"Search models...",className:"w-full h-7 pl-7 pr-7 text-xs rounded-lg bg-bg border border-border-subtle text-text-main placeholder:text-text-muted focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors"}),aF&&(0,d.jsx)("button",{onClick:()=>aG(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-muted transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:bC,disabled:aD,title:"Refresh",className:"shrink-0 h-7 w-7 flex items-center justify-center rounded-lg border border-border-subtle text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors disabled:opacity-40",children:(0,d.jsx)("span",{className:`material-symbols-outlined text-[14px] ${aD?"animate-spin":""}`,children:"refresh"})}),!aD&&q.length>0&&(0,d.jsxs)("button",{onClick:()=>bV(q),disabled:ah,title:`Test up to ${q.length} models and auto-add passing ones`,className:"shrink-0 h-7 flex items-center gap-1 px-2.5 rounded-lg border border-border-subtle text-xs text-text-muted hover:text-green-600 hover:border-green-500/40 hover:bg-green-500/5 transition-colors disabled:opacity-40",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[13px] ${ah?"animate-spin":""}`,children:ah?"progress_activity":"play_circle"}),ah?"Testing...":"Test All"]})]}),m&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[n.length," result",1!==n.length?"s":""]}),aD?(0,d.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] animate-spin",children:"progress_activity"}),"Fetching models from provider API..."]}):0===p.length?m?(0,d.jsxs)("p",{className:"text-xs text-text-muted py-2",children:['No models match "',aF,'"']}):null:(0,d.jsx)("div",{className:"space-y-1",children:p.map(([a,b])=>{let c=aH.has(a),e=b.filter(a=>!a.dropped&&"ok"===ab[a.id]).length,f=b.filter(a=>!a.dropped&&"error"===ab[a.id]).length,g=b.filter(a=>a.dropped).length;return(0,d.jsxs)("div",{className:"rounded-xl border border-border-subtle overflow-hidden",children:[(0,d.jsxs)("button",{onClick:()=>aI(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c}),className:"w-full flex items-center gap-2 px-3 py-2 text-xs bg-bg hover:bg-surface-2/60 transition-colors text-left",children:[(0,d.jsx)("span",{className:"font-semibold text-text-main flex-1",children:a}),e>0&&(0,d.jsxs)("span",{className:"text-green-600 dark:text-green-400 font-medium",children:[e," ✓"]}),f>0&&(0,d.jsxs)("span",{className:"text-red-500 font-medium",children:[f," ✗"]}),g>0&&(0,d.jsxs)("span",{className:"px-1.5 py-0.5 rounded-md bg-amber-500/10 text-amber-600 dark:text-amber-400 text-[10px] font-medium",children:[g," dropped"]}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded-md bg-black/[0.06] dark:bg-white/[0.06] text-text-muted tabular-nums font-medium",children:b.length}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsx)("div",{className:"px-3 pt-2 pb-3 flex flex-wrap gap-1.5 border-t border-border-subtle bg-surface/50",children:b.map(a=>{let b=a.id.includes("/")?a.id.split("/").slice(1).join("/"):a.id,c=ab[a.id],e=af.has(a.id);return a.dropped?(0,d.jsxs)("button",{onClick:async()=>{await bs(a.id),document.getElementById("available-models-section")?.scrollIntoView({behavior:"smooth"})},title:`Recently Dropped — click to restore: ${a.id}`,className:"group flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-amber-400/40 bg-amber-500/5 text-amber-700 dark:text-amber-400 text-xs hover:bg-amber-500/10 hover:border-amber-400/60 transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"history"}),(0,d.jsx)("span",{children:b}),a.contextLength>0&&(0,d.jsxs)("span",{className:"opacity-50 text-[10px] ml-0.5",children:[(a.contextLength/1e3).toFixed(0),"k"]})]},a.id):(0,d.jsxs)("button",{onClick:async()=>{await bD(a.id,a.id,bo),document.getElementById("available-models-section")?.scrollIntoView({behavior:"smooth"})},title:`Add: ${a.name||a.id}`,className:["group flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-xs transition-colors","ok"===c?"border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400 hover:bg-green-500/10":"error"===c?"border-red-400/30 bg-red-500/5 text-red-600 dark:text-red-400 hover:bg-red-500/10":"border-border-subtle text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5"].join(" "),children:[e?(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px] animate-spin",children:"progress_activity"}):"ok"===c?(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"check"}):"error"===c?(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"}):(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-50 group-hover:opacity-100",children:"add"}),(0,d.jsx)("span",{children:b}),a.contextLength>0&&(0,d.jsxs)("span",{className:"opacity-40 text-[10px] ml-0.5",children:[(a.contextLength/1e3).toFixed(0),"k"]})]},a.id)})})]},a)})})]})})()]})})()]}),bT,"kiro"===g?(0,d.jsx)(j.Mh,{isOpen:E,providerInfo:a8,onSuccess:bI,onClose:()=>F(!1)}):"cursor"===g?(0,d.jsx)(j.G9,{isOpen:E,onSuccess:bI,onClose:()=>F(!1)}):"gitlab"===g?(0,d.jsx)(j.vj,{isOpen:E,providerInfo:a8,onSuccess:bI,onClose:()=>F(!1)}):(0,d.jsx)(j.LF,{isOpen:E,provider:g,providerInfo:a8,onSuccess:bI,onClose:()=>F(!1)}),"iflow"===g&&(0,d.jsx)(j.vE,{isOpen:J,onSuccess:()=>{bw(),K(!1)},onClose:()=>K(!1)}),(0,d.jsx)(w,{isOpen:L,provider:g,providerName:a8.name,isCompatible:bk,isAnthropic:bj,authType:a8?.authType,authHint:a8?.authHint,website:a8?.website,proxyPools:B,error:N,existingNames:o.map(a=>a.name).filter(Boolean),onSave:bJ,onBulkDone:bw,onClose:()=>{O(""),M(!1)}}),(0,d.jsx)(j.wI,{isOpen:R,connection:X,proxyPools:B,onSave:bK,onClose:()=>S(!1)}),bk&&(0,d.jsx)(x,{isOpen:T,node:v,onSave:bx,onClose:()=>U(!1),isAnthropic:bj}),!bk&&(0,d.jsx)(y,{isOpen:aj,providerAlias:bo,providerDisplayAlias:bp,onSave:async a=>{let b=a8?.passthroughModels?a.split("/").pop():a;await bD(a,b,bo),ak(!1)},onClose:()=>ak(!1)}),"codex"===g&&(0,d.jsx)(A,{isOpen:P,onClose:()=>Q(!1),onSuccess:bw}),(0,d.jsx)(j.uo,{isOpen:aP,onClose:()=>aQ(!1),onConfirm:()=>{(aQ(!1),bd)?a4():a6()},title:"Risk Notice",message:a8?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(j.uo,{isOpen:!!aN,onClose:()=>aO(null),onConfirm:aN?.onConfirm,title:aN?.title||"Confirm",message:aN?.message,variant:"danger"})]})}G.propTypes={capabilities:p().object,onOAuth:p().func,onApiKey:p().func,onFree:p().func,onCookie:p().func,onCompatible:p().func,onBulkImport:p().func},H.propTypes={providerId:p().string.isRequired,models:p().array},I.propTypes={providerId:p().string.isRequired}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13934:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,50385))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/Users/shofiqulislam/9router-master/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/Users/shofiqulislam/9router-master/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/Users/shofiqulislam/9router-master/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},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")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34009:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},47161:(a,b,c)=>{Promise.resolve().then(c.bind(c,7592))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83997:a=>{"use strict";a.exports=require("tty")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},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 \"/Users/shofiqulislam/9router-master/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.")},"/Users/shofiqulislam/9router-master/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,7774,5433,4380,2430,5030,1344,1220,4884,5024,5681,4404,4315,8590,4746,6306,1450,4921,8335,8361,5330,8895,6182,6457,706,412,9560],()=>b(b.s=13934));module.exports=c})();