Loading
function(e,t,n){n.d(t,{A:()=>N});var i=n(477900),l=n(582128),a=n(682577),s=n(17928),r=n(717421),o=n(367513),c=n(401843),d=n(770178),u=n(90804),h=n(198052),p=n(643501),m=n(279250),A=n(267102),f=n(175203),x=n(616356),g=n(734057),C=n(71393),y=n(576705),j=n(309010),I=n(977997),v=n(889426),E=n(57642);function N(e){let{channelId:t,popoutType:n,seatsRef:N,controlsIdle:b,height:T}=e,_=(0,A.Us)(),R=l.useRef(null),[S,L]=(0,r.z)(()=>({raise:0,config:{duration:200,clamp:!0}})),P=(0,s.bG)([h.A],()=>h.A.getStreamParticipants(t)),O=(0,s.yK)([x.A],()=>x.A.getAllActiveStreams()),w=P.filter(e=>!O.some(n=>n.channelId===t&&n.ownerId===e.user.id)),M=(0,s.bG)([g.A],()=>g.A.getChannel(t)),D=(0,s.bG)([j.Ay],()=>j.Ay.getVoiceChannelId()===t),[U,V]=(0,s.yK)([I.A,C.A,y.A,p.default],()=>(0,m.eo)(M,I.A,C.A,y.A,p.default)),k=(0,s.bG)([h.A],()=>null!=h.A.getSelectedParticipant(t)),G=l.useCallback(()=>{let e=N.current?.getBoundingClientRect(),t=R.current?.offsetHeight;if(null==e||null==t)return;let n=T+32-68,i=e.bottom-16;i<n?L({raise:0}):L({raise:b?0:Math.max(0,i-(n-16))})},[N,T,L,b]);(0,d.g)(R,G,[b],{fireOnMount:!0});let B=l.useCallback(async e=>{let n=D;n||(n=await (0,u.A)({channelId:t})),n&&U&&((0,c.A9)(e.stream),o.A.selectParticipant(t,e.id))},[D,U,t]);return null==M||k||0===w.length?null:(0,i.jsx)(a.animated.div,{ref:R,className:E.M,style:{transform:S.raise.to(e=>`translate3d(-50%, -${e}px, 0)`)},children:w.map(e=>(0,i.jsx)(f.Ay,{participant:e,inCall:!0,channel:M,width:200,popoutType:n,className:E.V,onClick:()=>B(e),onContextMenu:(e,n,i,l)=>(0,v.A)({participant:e,event:n,minimalContextMenu:i,entrypoint:l,channelId:t,appContext:_,location:"GuildRoomTiles"})},e.id))})}}