import{b as i}from"./public-DGgMDUCq.chunk.mjs";import{A as o}from"./AvatarWrapper-DhHFz0g9.chunk.mjs";import{C as n,a as p}from"./Editor-vWNdTyLn.chunk.mjs";import{n as l}from"./_plugin-vue2_normalizer-wd1ZAbRr.chunk.mjs";import"./modulepreload-polyfill-wXdbfrnd.chunk.mjs";import"./emoji-picker-DlAAdvrL.chunk.mjs";import"./NcLoadingIcon-BFPuXP3q.chunk.mjs";import"./vue.runtime.esm-BSiu2UOd.chunk.mjs";import"./index-DfiDB3im.chunk.mjs";import"./NcColorPicker-DPqW0WY2.chunk.mjs";import"./index-D4JaVBd5.chunk.mjs";import"./index-Doa8FbYv.chunk.mjs";import"./MediaHandler.provider-DiZr3p7V.chunk.mjs";import"./logger-BaSPzHnw.chunk.mjs";import"./index-D29f11qk.chunk.mjs";import"./NcCheckboxRadioSwitch-ip_mRd2T-DHC_vlea.chunk.mjs";import"./index-zyxvkHrF.chunk.mjs";import"./Wrapper-DzbiSdyf.chunk.mjs";import"./index-fFPh3eUu.chunk.mjs";import"./_commonjs-dynamic-modules-Cdb4quZm.chunk.mjs";const u={name:"SessionList",components:{AvatarWrapper:o,NcPopover:i},props:{sessions:{type:Object,default:()=>({})}},data(){return{myName:""}},computed:{label(){return t("text","Active people")},participantsPopover(){return this.currentSession?.guestName?this.participantsWithoutCurrent:this.participants},participantsWithoutCurrent(){return this.participants.filter(s=>!s.isCurrent)},participants(){return Object.values(this.sessions).filter(s=>s.lastContact>Date.now()/1e3-n&&(s.userId!==null||s.guestName!==null)).sort((s,r)=>s.lastContact<r.lastContact)},currentSession(){return Object.values(this.sessions).find(s=>s.isCurrent)},avatarStyle(){return s=>({opacity:s.lastContact>Date.now()/1e3-p?1:.5})},sessionsVisible(){return this.participantsWithoutCurrent.slice(0,3)}}};var c=function(){var s=this,r=s._self._c;return r("NcPopover",{staticClass:"session-list",attrs:{placement:"bottom"},scopedSlots:s._u([{key:"trigger",fn:function({attrs:e}){return[r("div",[r("button",s._b({staticClass:"avatar-list",attrs:{title:s.label,"aria-label":s.label}},"button",e,!1),[r("div",{staticClass:"avatardiv icon-group"}),s._l(s.sessionsVisible,function(a){return r("AvatarWrapper",{key:a.id,attrs:{session:a,size:30}})})],2)])]}},{key:"default",fn:function(){return[r("div",{staticClass:"session-menu"},[s._t("lastSaved"),r("ul",[s._t("default"),s._l(s.participantsPopover,function(e){return r("li",{key:e.id,style:s.avatarStyle(e)},[r("AvatarWrapper",{attrs:{session:e,size:36}}),r("span",{staticClass:"session-label"},[s._v(" "+s._s(e.userId?e.displayName:e.guestName?e.guestName:s.t("text","Guest"))+" ")]),e.userId===null?r("span",{staticClass:"guest-label"},[s._v("("+s._s(s.t("text","guest"))+")")]):s._e()],1)})],2)],2)]},proxy:!0}],null,!0)})},m=[],v=l(u,c,m,!1,null,"886d35f7");const D=v.exports;export{D as default};
//# sourceMappingURL=SessionList-CYUcg_8e.chunk.mjs.map
