import{m as E,o as r,c as u,R as e,I as d,J as f,F as C,b as g,E as b,K as p,a as h}from"./rpcWorker-CVTx5FIM.js";function k(t){return t.length>20?`${t.slice(0,20)}...`:t}const y=E()(t=>({connectionContainer:{width:500,margin:t.spacing(4)}})),v=r(function({conf:n,session:o,breakConnection:l}){const{connectionInstances:a=[]}=o,i=u.readConfObject(n,"name"),s=u.readConfObject(n,"assemblyNames"),m=a.find(c=>i===c.name);return e.createElement(d,{key:n.connectionId,control:e.createElement(f,{checked:!!m,onChange:()=>{var c;m?l(n):(c=o.makeConnection)===null||c===void 0||c.call(o,n)},color:"primary"}),label:[i,s.length?`(${k(s.join(","))})`:""].filter(c=>!!c).join(" ")})}),x=r(function({session:n,breakConnection:o}){const{classes:l}=y();return e.createElement("div",{className:l.connectionContainer},n.connections.length?n.connections.map((a,i)=>e.createElement("div",{key:`${a.name}_${i}`},e.createElement(v,{conf:a,session:n,breakConnection:o}))):e.createElement(C,null,"No connections found"))}),D=r(function({session:t,handleClose:n,breakConnection:o}){return e.createElement(g.Dialog,{open:!0,onClose:n,maxWidth:"lg",title:"Turn on/off connections"},e.createElement(b,null,e.createElement(C,null,"Use the checkbox to turn on/off connections"),e.createElement(x,{session:t,breakConnection:o})),e.createElement(p,null,e.createElement(h,{onClick:()=>{n()},variant:"contained",color:"primary"},"Close")))});export{D as default};
