Build 533169stable
Module 306852
1,350 characters · in aca7018765200529.jsDependencies
Source Raw
function(e,t,n){n.d(t,{A:()=>E});var i=n(627968),l=n(64700),s=n(503698),a=n.n(s),r=n(311907),o=n(506774),d=n(31728),c=n(164617),u=n(205297),h=n(334463),A=n(175203),_=n(652215),m=n(806931),p=n(566555),g=n(604949);let f="CameraPreviewPosition";function E(e){let{width:t,onContextMenuParticipant:n,height:s,channel:E,participants:x,onSelectParticipant:I}=e,[C,N]=function(){let[e,t]=l.useState(()=>o.w.get(f,_.CUs.BOTTOM_RIGHT));return[e,l.useCallback(e=>{o.w.set(f,e),t(e)},[])]}(),T=l.useRef(null),S=null==E.getGuildId()?70:50,b=(0,r.bG)([h.A],()=>h.A.pipWidth(m.R8.CAMERA_PREVIEW)),y=x.length,v=b*y+8*(y-1),R=l.useMemo(()=>({minWidth:m.mn[m.R8.CAMERA_PREVIEW]*y+8*(y-1),maxWidth:m.cF[m.R8.CAMERA_PREVIEW]*y+8*(y-1)}),[y]);l.useLayoutEffect(()=>{T.current?.ensureIsInPosition()},[x.length]);let j=l.useCallback(e=>{let t=0===y?e:(e-8*(y-1))/y;d.EB(t,m.R8.CAMERA_PREVIEW)},[y]),O=l.useCallback((e,t)=>{N(t)},[N]);return(0,i.jsx)("div",{className:p.kL,children:(0,i.jsx)(u.S,{position:C,id:0,width:v,ref:T,onMove:O,onResize:j,maxX:t,maxY:s,edgeOffsetTop:S,edgeOffsetBottom:70,edgeOffsetLeft:16,edgeOffsetRight:16,resizeConfig:R,children:(0,i.jsx)("div",{className:p.iA,children:x.map(e=>(0,i.jsx)(A.Ay,{participant:e,channel:E,onContextMenu:n,className:a()(p.Vs,g.a8),fit:A.Yl.COVER,inCall:!0,popoutType:c.N.NO_POPOUT,width:160,onClick:I},e.id))})})})}}