Module 416528

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