import"../chunks/CWj6FrbW.js";import{s as w,o as N}from"../chunks/tLFXBP7P.js";import{A as F,p as _,u as S,f as m,s as b,b as d,c as A,d as l,r as o,t as j,h as c,e as q,g as H,j as M,$ as O,i as P}from"../chunks/Cp_hX0eh.js";import{e as R,c as z,A as B}from"../chunks/B3K88SyC.js";import{e as D,i as E,c as G,d as I,s as J}from"../chunks/Cv6CwVfk.js";import{g as K}from"../chunks/BMwJcaLS.js";import{t as L}from"../chunks/BEJ5fU19.js";var Q=(g,e,n)=>e.onAgentClick(c(n),g),T=m('<button><span class="agent-name svelte-16acuk9"> </span></button>'),U=m('<div class="agent-grid-container svelte-16acuk9"><div class="agent-grid svelte-16acuk9"><!> <button class="agent-card new-agent svelte-16acuk9" aria-label="Create new agent"><span class="agent-name agent-name_new svelte-16acuk9">New Agent</span></button></div></div>');function V(g,e){_(e,!0),S(()=>{R(e.agents)});const n=a=>a.split("/").at(-1)??a;var r=U(),i=l(r),v=l(i);D(v,17,()=>e.agents,E,(a,t)=>{var s=T();let f;s.__click=[Q,e,t];var p=l(s),k=l(p,!0);o(p),o(s),j((h,x,y,C)=>{f=G(s,1,"agent-card svelte-16acuk9",null,f,h),I(s,`--agent-color: ${x??""}`),J(s,"aria-label",y),w(k,C)},[()=>({active:c(t)===e.currentAgent}),()=>z(c(t)),()=>`Open ${n(c(t))}`,()=>n(c(t))]),d(a,s)});var u=b(v,2);u.__click=function(...a){var t;(t=e.onNewAgent)==null||t.apply(this,a)},o(i),o(r),d(g,r),A()}F(["click"]);var W=m('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 py-3 pr-4"><div class="flex-1"><!></div></div></div>');function se(g,e){_(e,!0);const{onAgentSelect:n}=K();let r=q(H([]));N(async()=>{P(r,await L.agents.list.query(),!0)});var i=W();M(s=>{O.title="Recombine Agents Hub"});var v=l(i);B(v,{className:"flex-none border-r-thin border-r-rc-gray-600",get agents(){return c(r)},currentAgent:"",get onAgentClick(){return n},initiallyCollapsed:!1,hoverCollapse:!1});var u=b(v,2),a=l(u),t=l(a);V(t,{get agents(){return c(r)},currentAgent:"",get onAgentClick(){return n}}),o(a),o(u),o(i),d(g,i),A()}export{se as component};
