Loading
function(e,t,n){n.d(t,{A:()=>k}),n(321073);var i=n(627968),l=n(64700),a=n(435558),s=n.n(a),r=n(17928),o=n(866665),c=n(922016),d=n(481901),u=n(29540),p=n(793574),h=n(688810),m=n(402216),A=n(689874),f=n(872363),x=n(446243),g=n(920639),C=n(360729),y=n(51082),j=n(275731),v=n(289552),E=n(246356),N=n(977851),I=n(204651),T=n(772475),b=n(481947),_=n(309010),R=n(485296),S=n(313961),P=n(546871),L=n(195007),O=n(806931),w=n(375708),M=n(662731),D=n(622073);function U(e){let{channelId:t,guildId:n}=e,l=(0,r.yK)([R.A,S.A],()=>{let e=Date.now();return s()(R.A.getSpeakers()).map(e=>S.A.getParticipant(t,e)).filter(e=>null!=e&&e.type===O.lp.USER&&e.speaking&&!(0,y.Ay)(e)).sortBy(t=>-R.A.getSpeakingDuration(t.user.id,e)).slice(0,3).value()});return 0===l.length?null:(0,i.jsx)("div",{className:D.$U,children:l.map(e=>(0,i.jsx)(o.m,{position:"bottom",text:w.intl.formatToPlainString(w.t.JjdizN,{username:e.user.username}),children:(0,i.jsx)(b.Ay,{user:e.user,speaking:!0,collapsed:!0,guildId:n})},e.id))})}function k(e){let{channel:t,isChatOpen:n,focusedApplication:a,shouldShowHeaderParticipants:s,guildRoomVisible:o}=e,y=l.useRef(null),{analyticsLocations:b}=(0,h.Ay)(p.A.VOICE_CHANNEL_HEADER),R=t.id,{voiceParticipantsHidden:k,selectedParticipant:V,userParticipantCount:G}=(0,r.cf)([S.A],()=>({selectedParticipant:S.A.getSelectedParticipant(R),voiceParticipantsHidden:S.A.getVoiceParticipantsHidden(R),userParticipantCount:S.A.getUserParticipantCount(R)}),[R]),{enabled:B}=C.A.useExperiment({guildId:t.guild_id,location:"ChannelCallHeaderToolbar"}),H=(0,r.bG)([_.Ay],()=>_.Ay.getVoiceChannelId()===R),F=t.isGuildVoiceOrThread()&&!n,z=[];if(s&&(V?.type===O.lp.STREAM?z.push((0,i.jsx)(P.A,{channel:t,focusedParticipant:V},"stream-participants")):V?.type===O.lp.ACTIVITY&&null!=a&&z.push((0,i.jsx)(P.A,{channel:t,focusedParticipant:V},"activity-participants"))),k&&z.push((0,i.jsx)(U,{channelId:R,guildId:t.guild_id},"current-speaker")),z.push((0,i.jsx)(A.A,{className:D.x6,channelId:R},"clips-enabled-indicator")),V?.type===O.lp.STREAM&&(z.push((0,i.jsx)(j.A,{className:D.x6,participant:V},"warning")),z.push((0,i.jsx)(f.A,{size:m.Ay.Sizes.LARGE,className:D.x6,participant:V,showQuality:!0,premiumIndicator:!1},"live-indicator"))),V?.type===O.lp.USER&&z.push((0,i.jsx)(v.A,{className:D.x6,userId:V.id},"video-warning")),k&&z.push((0,i.jsx)(c.Y,{targetElementRef:y,position:"bottom",renderPopout:()=>(0,i.jsx)(E.A,{children:(0,i.jsx)(L.A,{channel:t})}),children:(e,t)=>{let{isShown:n}=t;return(0,l.createElement)(T.A,{...e,buttonRef:y,isActive:n,count:G,key:"call-members",className:D.x6})}},"call-members-popout")),B&&H){let e=o?M.default.iXldTS:M.default.zQkVWf;z.push((0,i.jsx)(I.A,{iconComponent:o?d.d:u.u,label:w.intl.string(e),onClick:()=>{(0,x.zD)(R),(0,g.yt)({guildRoomOpen:!o,guildId:t.guild_id,channelId:R,location:o?p.A.GUILD_ROOM:p.A.CHANNEL_CALL})},className:D.x6},"guild-room-toggle"))}return F&&z.push((0,i.jsx)(N.V,{channelId:t.id,className:D.x6,disabled:n},"chat-spacer")),(0,i.jsx)(h.f5,{value:b,children:z})}}