import{ao as e,aQ as o,L as A,a_ as S,av as g,bj as k,aC as y,M as d,ca as N,ah as z,au as C,aw as H,b9 as L}from"./app-k0jcl5PQ.js";import{A as T}from"./BEDdXV-K.chunk.js";import{m as $}from"./BUELddOb.chunk.js";const I="_avatarContainer_p1zht_1",w="_sm_p1zht_5",U="_sharedAvatar_p1zht_10",c={avatarContainer:I,sm:w,sharedAvatar:U},b="reportsShare.sharedToAvatarList",l=A.encloseNamespace(b);function _(a){const s=y.countBy(a,"typeId"),t=s[d.User],r=s[d.Classroom],n=s[d.ClassroomGroup];if(t&&r&&n)return l("classroomsGroupsAndUsers",{userCount:t,classroomCount:r,groupCount:n});if(t&&r)return l("classroomsAndUsers",{userCount:t,classroomCount:r});if(t&&n)return l("groupsAndUsers",{userCount:t,groupCount:n});if(r&&n)return l("classroomsAndGroups",{classroomCount:r,groupCount:n});if(t)return l("users",{userCount:t});if(r)return l("classrooms",{classroomCount:r});if(n)return l("groups",{groupCount:n})}function G(a){var m,u,h,v,i;const s=((m=a.item)==null?void 0:m.typeId)===d.User&&a.item,t=((u=a.item)==null?void 0:u.typeId)===d.Classroom&&a.item,r=((h=a.item)==null?void 0:h.typeId)===d.ClassroomGroup&&a.item,n="d-flex justify-content-center align-items-center text-white rounded-circle h-100 w-100";return e.jsxs(e.Fragment,{children:[!!s&&e.jsx(o,{title:`${s.name} ${s.surname}`,spanHack:!0,spanHackClassName:"h-100 w-100",children:e.jsx(N,{imageUrl:(v=s.avatar)==null?void 0:v.url,imageCdnUrl:a.imageCdnUrl,initials:z.getInitials(s.name,s.surname),extraClasses:c.sharedAvatar})}),!!t&&e.jsx(o,{title:t.name,spanHack:!0,spanHackClassName:"h-100 w-100",children:e.jsx("div",{className:n,children:e.jsx(C,{svg:H,svgSize:g.Large,variant:"teal"})})}),!!r&&e.jsx(o,{title:r.name,spanHack:!0,spanHackClassName:"h-100 w-100",children:e.jsx("div",{className:n,children:e.jsx(C,{svg:L,variant:$((i=r.metadata)==null?void 0:i.colour)})})})]})}function M(a){return e.jsx("div",{className:`${c.avatarContainer} ${a.avatarSize==="sm"?c.sm:""}`,children:e.jsx(o,{title:l("anonymous"),spanHack:!0,spanHackClassName:"bg-light text-dark d-flex justify-content-center align-items-center rounded-circle h-100 w-100",children:e.jsx(S,{svg:T,size:a.avatarSize==="sm"?g.Small:null})})})}function P(a){return e.jsx("div",{className:`${c.avatarContainer} ${a.avatarSize==="sm"?c.sm:""}`,children:e.jsx(o,{title:a.text||l("sharedLink"),spanHack:!0,spanHackClassName:`bg-light text-dark d-flex justify-content-center align-items-center rounded-circle h-100 w-100 ${a.className||""}`,children:e.jsx(S,{svg:k,size:a.avatarSize==="sm"?g.Small:null})})})}D.defaultProps={maxAvatars:5};function D(a){return e.jsx(j,{...a,items:a.recipients,avatarItem:G,avatarContainerClassname:`${c.avatarContainer} ${a.avatarSize==="sm"?c.sm:""}`,getHiddenTooltip:_,hasShareLink:a.hasShareLink,shareLinkText:a.shareLinkText})}const R="shared.avatarList",f=A.encloseNamespace(R);j.defaultProps={maxAvatars:5};function j(a){const s=a.items.length>a.maxAvatars?a.items.slice(0,a.maxAvatars-1):a.items,t=a.items.length>s.length?a.items.slice(a.maxAvatars-1):[],r=a.avatarItem,n=t.length,m=a.avatarSize==="sm"?4:8;function u(){return a.getHiddenTooltip?a.getHiddenTooltip(t):a.roleToDisplay?f(a.roleToDisplay==="staff"?"staff":"student",{count:n,smartCount:n}):f("users",{count:n,smartCount:n})}function h(){return{marginRight:`-${(s.length-1+(t.length?1:0)+(a.hasShareLink?1:0))*m}px`}}function v(i){return{transform:`translateX(${(a.hasShareLink?i+1:i)*-m}px)`,zIndex:a.maxAvatars-i}}return s.length===0&&t.length===0?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"d-flex",style:h(),children:[a.hasShareLink&&e.jsx("div",{style:{zIndex:a.maxAvatars+1},children:e.jsx(P,{text:a.shareLinkText,avatarSize:a.avatarSize,className:"bg-dark text-white"})}),s.map((i,x)=>e.jsx("div",{className:`${a.avatarContainerClassname||""}`,style:v(x),children:e.jsx(r,{item:i,imageCdnUrl:a.imageCdnUrl,index:x,maxAvatars:a.maxAvatars})},i.id)),!!t.length&&e.jsx("div",{className:`${a.avatarContainerClassname||""} bg-white rounded-circle`,style:{transform:`translateX(${s.length*-m}px)`,zIndex:a.maxAvatars-s.length},children:e.jsx(o,{title:u(),spanHack:!0,spanHackClassName:"h-100 w-100",children:e.jsx("div",{className:`d-flex justify-content-center align-items-center border border-dark rounded-circle h-100 w-100 ${a.numberClassname||""}`,children:`+${t.length}`})})})]})}export{j as A,P as S,M as a,D as b};
//# sourceMappingURL=CYwt329T.chunk.js.map
