Module 306852

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