import{a as f}from"./chunk-P5VFCF3S.mjs";import{a as m}from"./chunk-Q63I6SEV.mjs";import{useCurrentProfile as p}from"@baseapp-frontend/authentication";import{useFragment as c}from"react-relay";import s from"relay-connection-handler-plus";var A=function(o){var n,r=c(m,o);return{title:r?.title,avatar:r==null||(n=r.image)===null||n===void 0?void 0:n.url}},g=function(o){var n,r,l=p(),v=l.currentProfile,d=c(f,o);if(!(d!=null&&d.participants))return{title:"Error: No participants"};var t=d.participants.edges.find(function(e){var i,a;return(e==null||(i=e.node)===null||i===void 0||(i=i.profile)===null||i===void 0?void 0:i.id)&&(e==null||(a=e.node)===null||a===void 0||(a=a.profile)===null||a===void 0?void 0:a.id)!==v?.id});return{title:t==null||(n=t.node)===null||n===void 0||(n=n.profile)===null||n===void 0?void 0:n.name,avatar:t==null||(r=t.node)===null||r===void 0||(r=r.profile)===null||r===void 0||(r=r.image)===null||r===void 0?void 0:r.url}},_=function(o){var n=g(o),r=A(o);return o.isGroup?r:n},$=function(o){if(o!=null)return"".concat(o," member").concat(o!==1?"s":"")},x=function(o,n,r){var l=o.get(n);return l?s.getConnections(l,"roomsList_chatRooms",r):[]};export{A as a,_ as b,$ as c,x as d};
//# sourceMappingURL=chunk-QM7X6D7F.mjs.map