UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.64 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Qo as t,ll as n}from"./_4____________________________.js";import{GN as r,JN as i,hj as a,mj as o,pj as s}from"./_2_____________________________.js";import{F as c,O as l,Rt as u,U as d,j as f,l as p,u as m,x as h}from"./_6____________________.js";import{O as g}from"./route-controls-runtime-LXiVRSj4.js";function _(e){let t=c(()=>e.agents),r=c(()=>e.additionalAgentIds),s=c(()=>e.selectedId??e.selection.state.scopeId??``),d=c(()=>e.allowAll!==!1),m=c(()=>{let e=t(),c=s(),l=c?n(c):``,u=d(),f=t=>e.some(e=>e.kind===`system`&&n(e.id)===t),p=o(e);if(p.length<=1)return;let m=new Map(p.map(e=>{let t=n(e.id);return[t,t===e.id?e:{...e,id:t}]}));for(let e of r()??[]){if(!e.trim())continue;let t=n(e);!f(t)&&!m.has(t)&&m.set(t,{id:t})}l&&!f(l)&&!m.has(l)&&m.set(l,{id:l});let h=[...m.values()].toSorted((e,t)=>a(e).localeCompare(a(t))),g=f(l)?u?``:h[0]?.id??``:l;return{options:[...u?[{value:``,label:i(`agentScope.allAgents`),icon:`users`}]:[],...h.map(e=>({value:e.id,label:a(e),agent:e}))],selected:g,allowAll:u}});return f(l,{get when(){return m()},children:t=>(()=>{var n=v(),r=n.firstChild;return r.disabled=!1,r.onSelect=n=>t().allowAll?e.selection.setScope(n||null):e.selection.set(n||null),r._$owner=u(),p(()=>({e:t().options,t:t().selected,a:i(`agentScope.label`),o:i(`agentScope.label`)}),({e,t,a:n,o:i},a)=>{e!==a?.e&&(r.options=e),t!==a?.t&&(r.value=t),n!==a?.a&&(r.accessibleLabel=n),i!==a?.o&&(r.menuLabel=i)}),n})()})}var v;function y(){return(y=e((()=>{m(),d(),s(),r(),t(),g(),v=h(`<div class=agent-scope-control><openclaw-agent-select>`,1)})))()}export{y as n,_ as t};