@m1nh/9router 0.5.78 → 0.5.80

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 (205) 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_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  31. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  37. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  38. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  39. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  40. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  42. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  43. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  44. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  45. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  46. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  47. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  48. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  49. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  50. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  51. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  52. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  53. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  54. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/callback.html +1 -1
  56. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  57. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  58. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
  60. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  61. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  62. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
  63. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  64. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  66. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  67. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
  68. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  69. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  70. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  71. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  72. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
  73. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  74. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  76. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  77. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
  78. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  79. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  81. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  82. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
  83. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  84. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  86. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  87. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  88. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  89. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  91. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  92. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
  93. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  94. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  96. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  97. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
  98. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  99. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  101. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  102. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
  103. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  104. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  105. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  106. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  107. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  108. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  109. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  110. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  111. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  112. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  113. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  114. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  115. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  116. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  117. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
  118. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  119. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  120. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  121. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  122. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  123. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  124. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  125. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
  126. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  127. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  128. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
  129. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  130. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  131. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  132. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  133. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  134. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  135. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  136. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  137. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  138. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
  139. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  140. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  141. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  142. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  143. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  144. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  145. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  146. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  147. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  148. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
  149. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  150. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  151. package/app/.next-cli-build/server/app/index.html +1 -1
  152. package/app/.next-cli-build/server/app/index.rsc +4 -4
  153. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  154. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  155. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  156. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  157. package/app/.next-cli-build/server/app/landing.html +1 -1
  158. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  159. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  160. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  161. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
  162. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  163. package/app/.next-cli-build/server/app/login.html +1 -1
  164. package/app/.next-cli-build/server/app/login.rsc +5 -5
  165. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  166. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  167. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  168. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  169. package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  170. package/app/.next-cli-build/server/chunks/24.js +1 -1
  171. package/app/.next-cli-build/server/chunks/318.js +3 -3
  172. package/app/.next-cli-build/server/chunks/4037.js +1 -1
  173. package/app/.next-cli-build/server/chunks/4049.js +1 -1
  174. package/app/.next-cli-build/server/chunks/412.js +1 -1
  175. package/app/.next-cli-build/server/chunks/4572.js +1 -1
  176. package/app/.next-cli-build/server/chunks/4961.js +1 -1
  177. package/app/.next-cli-build/server/chunks/6697.js +1 -1
  178. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  179. package/app/.next-cli-build/server/chunks/6922.js +1 -1
  180. package/app/.next-cli-build/server/chunks/7220.js +1 -1
  181. package/app/.next-cli-build/server/chunks/827.js +1 -1
  182. package/app/.next-cli-build/server/chunks/8363.js +1 -1
  183. package/app/.next-cli-build/server/chunks/8402.js +1 -1
  184. package/app/.next-cli-build/server/chunks/8499.js +2 -2
  185. package/app/.next-cli-build/server/chunks/8628.js +1 -1
  186. package/app/.next-cli-build/server/chunks/8755.js +1 -1
  187. package/app/.next-cli-build/server/chunks/8895.js +3 -3
  188. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  189. package/app/.next-cli-build/server/chunks/9181.js +1 -1
  190. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  191. package/app/.next-cli-build/server/pages/404.html +1 -1
  192. package/app/.next-cli-build/server/pages/500.html +1 -1
  193. package/app/.next-cli-build/static/chunks/1321-f51a5f2ed41cad73.js +1 -0
  194. package/app/.next-cli-build/static/chunks/5497-1fd5580a860b4a46.js +7 -0
  195. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-6238681346fa83a7.js +1 -0
  196. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-839a7390879900f2.js → page-2ca4c0776d1b9e76.js} +1 -1
  197. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  198. package/app/cli/package.json +1 -1
  199. package/app/package.json +1 -1
  200. package/package.json +1 -1
  201. package/app/.next-cli-build/static/chunks/1321-9c1f0b673347d8a7.js +0 -1
  202. package/app/.next-cli-build/static/chunks/5497-e17b59a7b49d3352.js +0 -7
  203. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-aa0643403f562fe8.js +0 -1
  204. /package/app/.next-cli-build/static/{DFi6LgHG2hzIaZo2vEKjO → GMR3RbgZVxIk9IrwDjSM6}/_buildManifest.js +0 -0
  205. /package/app/.next-cli-build/static/{DFi6LgHG2hzIaZo2vEKjO → GMR3RbgZVxIk9IrwDjSM6}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{80191:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var l=s(95155),a=s(12115),i=s(44923),n=s(87256),r=s(39768),o=s(5020),d=s(35497),c=s(11059),m=s(929);s(88105);let x=/^[a-zA-Z0-9_.\-]+$/,p=[{key:"vision",label:"Vision",icon:"visibility",desc:"Images"},{key:"audioInput",label:"Audio",icon:"graphic_eq",desc:"Audio input"}],u={enabled:!0,roundRobin:!1,models:[]},h={vision:{...u},pdf:{...u},audioInput:{...u},videoInput:{...u}};function b(){let[e,t]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),[n,r]=(0,a.useState)(!1),[o,x]=(0,a.useState)(null),[b,f]=(0,a.useState)([]),[y,v]=(0,a.useState)({}),[w,k]=(0,a.useState)(h),{getCaps:C}=(0,m.y)(),[S,$]=(0,a.useState)(null),{copied:M,copy:A}=(0,c.C)();(0,a.useEffect)(()=>{E()},[]);let E=async()=>{try{let[s,l,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),i=await s.json(),n=await l.json(),r=a.ok?await a.json():{};s.ok&&t((i.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),l.ok&&f(n.connections||[]),v(r.comboStrategies||{});let o=r.capacityAdapter||{},d={};for(let t of p){var e;d[t.key]=(e=o[t.key],Array.isArray(e)?{enabled:!0,roundRobin:!1,models:e.map(e=>e?.model||e).filter(Boolean)}:e&&"object"==typeof e?{enabled:!1!==e.enabled,roundRobin:!!e.roundRobin,models:Array.isArray(e.models)?e.models.filter(Boolean):[]}:{...u})}k(d)}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},O=async e=>{k(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({capacityAdapter:e})})}catch(e){console.log("Error updating capacity adapter:",e)}},P=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await E(),r(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},F=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await E(),x(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},R=async s=>{$({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{$(null);try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}}})},_=async(e,t)=>{try{let s={...y},l={...s[e]||{},...t};l.fallbackStrategy&&"fallback"!==l.fallbackStrategy?s[e]=l:delete s[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:s})}),v(s)}catch(e){console.log("Error updating combo strategy:",e)}};return s?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(d.Qv,{}),(0,l.jsx)(d.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Group models under one name, then pick a strategy per combo:"}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted mt-2 flex flex-col gap-1",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fallback"})," — tries models in order (next on failure)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Round Robin"})," — rotates models across requests to spread load"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fusion"})," — queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]})]})]}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto whitespace-nowrap",children:"Create Combo"})]}),0===e.length?(0,l.jsx)(d.Zp,{children:(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,l.jsx)(d.$n,{icon:"add",onClick:()=>r(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,l.jsx)(g,{combo:e,getCaps:C,activeProviders:b,copied:M,onCopy:A,onEdit:()=>x(e),onDelete:()=>R(e.id),strategy:y[e.name]||{},onSetStrategy:t=>_(e.name,t)},e.id))}),(0,l.jsx)(j,{capacityAdapter:w,onChange:O,activeProviders:b,getCaps:C}),n&&(0,l.jsx)(N,{isOpen:n,onClose:()=>r(!1),onSave:P,activeProviders:b},"create"),o&&(0,l.jsx)(N,{isOpen:!!o,combo:o,onClose:()=>x(null),onSave:e=>F(o.id,e),activeProviders:b},o.id),(0,l.jsx)(d.uo,{isOpen:!!S,onClose:()=>$(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,variant:"danger"})]})}let f=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate"},{value:"fusion",label:"Fusion — panel + judge"}];function g({combo:e,getCaps:t,activeProviders:s=[],copied:i,onCopy:n,onEdit:r,onDelete:o,strategy:c={},onSetStrategy:m}){let[x,p]=(0,a.useState)(!1),u=c.fallbackStrategy||"fallback",h=c.judgeModel||"";return(0,l.jsxs)(d.Zp,{padding:"sm",className:"group",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,s)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:t?.(e)})]},s)),e.models.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]}),"fusion"===u&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,l.jsxs)("button",{onClick:()=>p(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:h||`Auto — ${e.models[0]||"first model"}`})]}),h&&(0,l.jsx)("button",{onClick:()=>m({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsx)("div",{className:"w-full sm:w-[200px]",children:(0,l.jsx)(d.l6,{options:f,value:u,onChange:e=>m({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),n(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:r,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:o,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),x&&(0,l.jsx)(d.rq,{isOpen:x,onClose:()=>p(!1),onSelect:e=>{m({judgeModel:e?.value||""}),p(!1)},activeProviders:s,title:"Select Judge Model",addedModelValues:h?[h]:[],closeOnSelect:!0})]})}function j({capacityAdapter:e,onChange:t,activeProviders:s,getCaps:a}){return(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:"Vision Adapter"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Your model can't read image/audio? Auto-switches to a model in the pool below."}),(0,l.jsxs)("ul",{className:"mt-1.5 text-[11px] text-text-muted flex flex-col gap-0.5",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Vision"})," — images (png, jpg, webp, …)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Audio"})," — audio input"]})]})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:p.map(i=>(0,l.jsx)(y,{cap:i,entry:e[i.key]||u,onChange:s=>t({...e,[i.key]:s}),activeProviders:s,getCaps:a},i.key))})]})}function y({cap:e,entry:t,onChange:s,activeProviders:i,getCaps:n}){let[r,o]=(0,a.useState)(!1),{enabled:c,roundRobin:m,models:x}=t,p=e=>s({...t,...e}),u=(e,t)=>{let s=e+t;if(s<0||s>=x.length)return;let l=[...x];[l[e],l[s]]=[l[s],l[e]],p({models:l})};return(0,l.jsxs)(d.Zp,{padding:"sm",className:`group ${!c?"opacity-50":""}`,children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[(0,l.jsx)(d.lM,{checked:c,onChange:e=>p({enabled:e}),"aria-label":`Enable ${e.label} adapter`}),(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:e.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("code",{className:"font-mono text-sm font-medium",children:e.label}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["— ",e.desc]})]}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===x.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):x.slice(0,3).map((e,t)=>(0,l.jsxs)("code",{className:"group/chip inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(d.nh,{caps:n?.(e)}),(0,l.jsx)("button",{onClick:()=>u(t,-1),disabled:0===t,className:`leading-none opacity-0 group-hover/chip:opacity-100 ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary"}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:()=>u(t,1),disabled:t===x.length-1,className:`leading-none opacity-0 group-hover/chip:opacity-100 ${t===x.length-1?"text-text-muted/20":"text-text-muted hover:text-primary"}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})}),(0,l.jsx)("button",{onClick:()=>{let e;p({models:0===(e=x.filter((e,s)=>s!==t)).length?["oc/mimo-v2.5-free"]:e})},className:"leading-none opacity-0 group-hover/chip:opacity-100 text-text-muted hover:text-red-500",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e}-${t}`)),x.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",x.length-3," more"]})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-muted cursor-pointer select-none",children:[(0,l.jsx)(d.lM,{checked:m,onChange:e=>p({roundRobin:e}),disabled:!c,"aria-label":`Round-robin ${e.label} adapter`}),(0,l.jsx)("span",{children:"Round"})]}),(0,l.jsx)(d.$n,{icon:"add",variant:"ghost",size:"sm",onClick:()=>o(!0),disabled:!c,title:`Add ${e.label} model`,children:"Add Model"})]})]}),r&&(0,l.jsx)(d.rq,{isOpen:r,onClose:()=>o(!1),onSelect:e=>{x.includes(e.value)||p({models:[...x,e.value]})},activeProviders:i,title:`Add ${e.label} Model`,addedModelValues:x,capFilter:e.key,closeOnSelect:!1})]})}function v({id:e,index:t,model:s,isFirst:i,isLast:o,onEdit:d,onMoveUp:c,onMoveDown:m,onRemove:x}){let{attributes:p,listeners:u,setNodeRef:h,transform:b,isDragging:f}=(0,n.gl)({id:e}),g={transform:r.Ks.Transform.toString(b),opacity:f?.4:1,zIndex:f?999:void 0},[j,y]=(0,a.useState)(!1),[N,w]=(0,a.useState)(s),k=()=>{let e=N.trim();e&&e!==s?d(e):w(s),y(!1)};return(0,l.jsxs)("div",{ref:h,style:g,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${f?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,l.jsx)("button",{...p,...u,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"2"})]})}),(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),j?(0,l.jsx)("input",{autoFocus:!0,value:N,onChange:e=>w(e.target.value),onBlur:k,onKeyDown:e=>{"Enter"===e.key&&k(),"Escape"===e.key&&(w(s),y(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,l.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>y(!0),title:"Click to edit",children:s}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,l.jsx)("button",{onClick:c,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function N({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:c,kindFilter:m=null}){let[p,u]=(0,a.useState)(t?.name||""),[h,b]=(0,a.useState)(t?.models||[]),[f,g]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[C,S]=(0,a.useState)({}),$=(0,i.FR)((0,i.MS)(i.AN,{activationConstraint:{distance:5}}),(0,i.MS)(i.uN,{coordinateGetter:n.JR})),M=h.map((e,t)=>({uid:`item-${t}`,model:e})),A=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();S(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,a.useEffect)(()=>{e&&A()},[e]);let E=e=>e.trim()?x.test(e)?(k(""),!0):(k("Only letters, numbers, -, _ and . allowed"),!1):(k("Name is required"),!1),O=async()=>{E(p)&&(y(!0),await r({name:p.trim(),models:h}),y(!1))},P=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.aF,{isOpen:e,onClose:s,title:P?"Edit Combo":"Create Combo",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.pd,{label:"Combo Name",value:p,onChange:e=>{let t=e.target.value;u(t),t?E(t):k("")},placeholder:"my-combo",error:w}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===h.length?(0,l.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,l.jsx)(i.Mp,{sensors:$,collisionDetection:i.fp,onDragEnd:e=>{let{active:t,over:s}=e;if(s&&t.id!==s.id){let e=M.findIndex(e=>e.uid===t.id),l=M.findIndex(e=>e.uid===s.id);-1!==e&&-1!==l&&b(t=>(0,n.be)(t,e,l))}},modifiers:[o.FN,o.gj],children:(0,l.jsx)(n.gB,{items:M.map(e=>e.uid),strategy:n._G,children:(0,l.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:M.map(({uid:e,model:t},s)=>(0,l.jsx)(v,{id:e,index:s,model:t,isFirst:0===s,isLast:s===M.length-1,onEdit:e=>{let t=[...h];t[s]=e,b(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...h];[t[e-1],t[e]]=[t[e],t[e-1]],b(t)})(s),onMoveDown:()=>(e=>{if(e===h.length-1)return;let t=[...h];[t[e],t[e+1]]=[t[e+1],t[e]],b(t)})(s),onRemove:()=>{b(h.filter((e,t)=>t!==s))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>g(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(d.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(d.$n,{onClick:O,fullWidth:!0,size:"sm",disabled:!p.trim()||!!w||j,children:j?"Saving...":P?"Save":"Create"})]})]})}),f&&(0,l.jsx)(d.rq,{isOpen:f,onClose:()=>g(!1),onSelect:e=>{h.includes(e.value)||b([...h,e.value])},onDeselect:e=>{b(h.filter(t=>t!==e.value))},activeProviders:c,modelAliases:C,title:"Add Model to Combo",kindFilter:m,addedModelValues:h,closeOnSelect:!1})]})}},84680:(e,t,s)=>{"use strict";s.d(t,{PM:()=>l.PM,Sj:()=>l.Sj,Vy:()=>l.Vy,fF:()=>l.fF,sl:()=>l.sl,vL:()=>l.vL,y$:()=>l.y$,zM:()=>l.zM});var l=s(44923)},90801:(e,t,s)=>{Promise.resolve().then(s.bind(s,80191))}},e=>{e.O(0,[4614,5353,1321,705,5497,8441,3794,7358],()=>e(e.s=90801)),_N_E=e.O()}]);