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