Build 555975stable
Module 808166
12,950 characters · in 2c95535df24bd155.jsDependencies
Lazily required by (0)none
Requires (78)
179281957547167587036470074114886869748397808148839172218174755187322192308222823232835262295284009287809290863302005308528330001330076343328351952368919375708381941394871397244414808428678442433449582503698534400535185543465549254562708571694574553586893607399612324616356620982627968652215661531691540709066714114720149741961765671778712780645789645821609824994837381854627857250922301935208936504939249945810952270954376960076963027976860989349990078994500
Source Raw
function(e,t,n){n.d(t,{z9:()=>eF,w_:()=>eO,Ay:()=>eV,th:()=>eG});var l=n(627968),i=n(64700),s=n(503698),a=n.n(s),r=n(284009),o=n.n(r),u=n(936504),c=n(562708),d=n(837381),h=n(172218),m=n(612324),p=n(535185),f=n(148839),g=n(607399),A=n(17928),x=n(780645),C=n(990078),E=n(97808),v=n(939249),T=n(821609),_=n(952270),j=n(428678),S=n(661531),N=n(549254),y=n(574553);function R(e){let{as:t,muted:n=!1,selected:i=!1,className:s,...r}=e,o=t??v.D;return(0,l.jsx)(o,{...r,className:a()(y.bG,s,{[y.SU]:n,[y.wH]:i})})}var I=n(778712),b=n(192308),M=n(789645),w=n(308528),U=n(442433),O=n(765671),D=n(960076),P=n(397244),k=n(714114),L=n(394871),F=n(709066),G=n(262295),V=n(620982),B=n(343328);let H=(0,n(945810).mj)({kind:"user",name:"2026-02-channel-wave-button",defaultConfig:{enabled:!1,showClose:!0},variations:{1:{enabled:!0,showClose:!1},2:{enabled:!0,showClose:!0}}});var Q=n(963027),W=n(571694),z=n(47167),q=n(989349),Z=n.n(q),K=n(691540),$=n(857250),Y=n(97483),X=n(720149),J=n(976860),ee=n(74114),et=n(232835),en=n(994500),el=n(58703),ei=n(935208),es=n(330001),ea=n(652215),er=n(381941),eo=n(375708),eu=n(449582),ec=n(351952),ed=n(88686),eh=n(174755),em=n(187322),ep=n(586893);let ef=i.forwardRef(function(e,t){let{className:n,focusProps:i,...s}=e;return(0,l.jsx)(em.vN,{...i,children:(0,l.jsx)("li",{className:a()(n,ep.k),...s,ref:t})})});var eg=n(824994),eA=n(922301),ex=n(368919),eC=n(414808),eE=n(302005),ev=n(954376),eT=n(534400),e_=n(854627),ej=n(616356),eS=n(290863),eN=n(222823),ey=n(741961),eR=n(543465),eI=n(287809),eb=n(19575),eM=n(330076);let ew=eb.Ay.getEnableHardwareAcceleration()?E.Js:E.eu,eU={offset:{top:2,bottom:2,right:4}},eO=e=>{let{nameplate:t,icon:n,forceShow:i=!1,reducedClickTarget:s=!1,visibleElementRef:r,...o}=e,u=(0,ec.K)(t);return(0,l.jsx)(v.D,{className:a()(eM.b,{[eM.DQ]:null!=t,[eM.by]:i,[eM.wY]:s}),style:u,...o,focusProps:{offset:{top:-2,bottom:-2,left:-2,right:6}},children:(0,l.jsx)("div",{ref:r,className:a()({[eM.PJ]:null!=t}),children:(0,l.jsx)(n,{size:"sm",color:"currentColor",className:a()(eM.ut,{[eM.Uq]:null!=t})})})})},eD=e=>{let{onClick:t,channelName:n,showNameplate:i}=e,{enabled:s}=H.useConfig({location:"Wave CTA"});return s?(0,l.jsx)("div",{className:eM.KQ,children:(0,l.jsx)(C.m,{text:eo.intl.formatToPlainString(eo.t.m0zYbV,{username:n}),children:(0,l.jsx)(T.$,{size:"sm",variant:i?"overlay-secondary":"secondary",onClick:t,text:eo.intl.string(eo.t.pVlP58)})})}):null},eP=()=>(0,l.jsx)(_.G,{size:"xs",color:"currentColor",className:eM.wB}),ek=()=>(0,l.jsx)(j.K,{size:"xs",color:"currentColor",className:eM.wB});function eL(e){let{eventTargetRef:t,isNitro:n,contentWidth:s,hoverGradientStart:a,hoverGradientMiddle:r,hoverGradientEnd:o}=e,u=i.useMemo(()=>null!=a&&null!=r&&null!=o?{Color_GradientCenter:a,Color_InnerRing:r??S.A.colors.NITRO_TAB_GRADIENT_INNER_RING??r,Color_OuterRing:o,NitroVFX:!1}:n?{Color_GradientCenter:S.A.colors.NITRO_TAB_GRADIENT_CENTER,Color_InnerRing:S.A.colors.NITRO_TAB_GRADIENT_INNER_RING,Color_OuterRing:S.A.colors.NITRO_TAB_GRADIENT_OUTER_RING,NitroVFX:!0}:{Color_GradientCenter:S.A.colors.STANDARD_TAB_GRADIENT_CENTER,Color_InnerRing:S.A.colors.STANDARD_TAB_GRADIENT_INNER_RING,Color_OuterRing:S.A.colors.STANDARD_TAB_GRADIENT_OUTER_RING,NitroVFX:!1},[n,a,r,o]);return(0,l.jsx)(N.U,{eventTargetRef:t,className:eM.a1,dataBinding:{...u,DimmerWidth:(s??0)+32}})}let eF=e=>{let{route:t,selected:n,icon:s,iconClassName:r,interactiveClassName:o,text:c,children:d,locationState:h,onClick:m,className:p,role:f,"aria-posinset":A,"aria-setsize":x,listItemRef:C,showHoverGradient:E=!1,nitroHoverGradient:v=!1,hoverGradientStart:T,hoverGradientMiddle:_,hoverGradientEnd:j,...S}=e,{width:N,ref:y}=(0,O.Ay)(),I=i.useRef(null),b=C??I;return(0,l.jsx)(ef,{className:a()(eM.Ix,{[eM.Ij]:g.Fr},p),onClick:m,role:f,focusProps:{within:!0,...eU},"aria-posinset":A,"aria-setsize":x,ref:b,children:(0,l.jsxs)(R,{as:"div",selected:n,className:a()(o,eM.bG,eM.$J,{[eM.Q2]:n}),children:[E&&(0,l.jsx)(eL,{eventTargetRef:b,isNitro:v,contentWidth:N,hoverGradientStart:T,hoverGradientMiddle:_,hoverGradientEnd:j}),(0,l.jsxs)(u.N_,{to:{pathname:t,state:h},className:eM.nf,...S,children:[(0,l.jsx)(G.A,{ref:E?y:void 0,muted:!1,avatar:(0,l.jsx)(s,{size:"refresh_sm",className:a()(eM.e_,r),color:"currentColor"}),name:c,innerClassName:eM.xx}),d]})]})})};function eG(e){let{channel:t,selected:s=!1,user:r,activities:g,applicationStream:C,voiceChannel:E,isTyping:v,status:T,isMobile:_,isVR:j,nameplate:S,ref:N,"aria-posinset":y,"aria-setsize":O}=e,[k,q]=i.useState(!1),[eu,ec]=i.useState(!1),[em,ep]=i.useState(!1),ej=i.useRef(null),[eS,ey]=i.useState(!1),eI=(0,h.K)(i.useCallback(e=>{ey(e)},[])),eb=i.useRef(null),eL=N??eb,eF=(0,m.A)(eL,eI),{showMenuItemPopover:eG,markMenuItemPopoverAsDismissed:eV}=(0,eE.z)({location:"PrivateChannel",isChannelSelected:!0===s,isTargetInViewport:eS,channelType:t.type}),{avatarSrc:eB,avatarDecorationSrc:eH,eventHandlers:eQ}=(0,e_.A)({userId:r?.id,size:I._3.SIZE_32,animateOnHover:!(s||k||eu||em)}),[eW,ez]=i.useState({maskImage:"none"}),eq=i.useRef(null),eZ=t.isMultiUserDM(),eK=t.isSystemDM(),e$=!eZ&&!eK&&t.type===ea.rbe.DM,eY=e$&&r?.primaryGuild!=null,eX=(0,A.bG)([eR.Ay],()=>eR.Ay.isChannelMuted(t.getGuildId(),t.id)),{ignored:eJ,blocked:e0}=(0,A.cf)([en.A],()=>({ignored:en.A.isIgnored(t.getRecipientId()),blocked:en.A.isBlocked(t.getRecipientId())})),e1=e$&&eJ,e2=e$&&e0,e3=(eX||e1||e2)&&!(s||k),e6=(0,A.bG)([eN.Ay],()=>eN.Ay.getMentionCount(t.id)>0),e5=(0,z.Ay)(t),e4=i.useRef(null),e8=null!=S&&(s||k||em),e7=()=>{q(!0)},e9=()=>{q(!1)},te=()=>{ec(!0)},tt=()=>{ec(!1)},tn=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null!=e&&(e.preventDefault(),e.stopPropagation()),w.A.closePrivateChannel(t.id,s,n)},tl=()=>{w.A.preload(ea.ME,t.id)},ti=e=>{e.stopPropagation()},ts=e=>{e.target===e.currentTarget&&ej.current?.click()},ta=e=>{let i="contextmenu"===e.type?c.ImpressionNames.DM_LIST_RIGHT_CLICK_MENU_SHOWN:c.ImpressionNames.DM_LIST_KEBAB_MENU_SHOWN;ep(!0),t.isMultiUserDM()?(0,U.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("26132"),n.e("46652"),n.e("93190"),n.e("91763"),n.e("38730"),n.e("34971"),n.e("42339"),n.e("12520"),n.e("46149"),n.e("53416"),n.e("60200")]).then(n.bind(n,4027));return n=>(0,l.jsx)(e,{...n,channel:t,selected:s})},{impressionName:i,noBlurEvent:!0,onClose:()=>ep(!1)}):(0,U.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("38804"),n.e("39713"),n.e("23531"),n.e("94881"),n.e("26132"),n.e("46652"),n.e("93190"),n.e("34552"),n.e("93103"),n.e("8757"),n.e("91763"),n.e("89673"),n.e("85968"),n.e("68403"),n.e("29787"),n.e("71210"),n.e("82073"),n.e("97558"),n.e("88342"),n.e("91994"),n.e("38730"),n.e("42451"),n.e("76665"),n.e("98965"),n.e("35313"),n.e("76273"),n.e("36564"),n.e("34971"),n.e("45996"),n.e("52229"),n.e("792"),n.e("92822"),n.e("23427"),n.e("29422"),n.e("9291"),n.e("38056"),n.e("7059"),n.e("8829"),n.e("42339"),n.e("98199"),n.e("41175"),n.e("60816"),n.e("39778")]).then(n.bind(n,385913));return n=>(0,l.jsx)(e,{...n,user:r,channel:t,channelSelected:s})},{impressionName:i,onClose:()=>ep(!1)})},tr=e=>{e.preventDefault(),e.stopPropagation();let i=eo.intl.formatToPlainString(eo.t.hJ5Ap4,{name:e5}),s=eo.intl.format(eo.t.SSIVOu,{name:e5});t.isManaged()&&(i=eo.intl.formatToPlainString(eo.t.hVGjEW,{name:e5}),s=eo.intl.format(eo.t.IK1Qvs,{name:e5})),(0,b.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("70588"),n.e("37803")]).then(n.bind(n,148166));return t=>(0,l.jsx)(e,{title:i,body:s,onSubmit:tn,...t})})},to=(0,l.jsx)(ex.A,{userName:e5,displayNameStyles:r?.displayNameStyles,effectDisplayType:k||s||em?eA.G.ANIMATED:eA.G.PLAIN,loop:k,boldFontOpacity:.9}),tu=eY?(0,l.jsxs)(l.Fragment,{children:[to,(0,l.jsx)(eT.Ay,{primaryGuild:r?.primaryGuild,userId:r?.id,inline:!0,disableGuildProfile:!0,className:a()(eM.fc,{[eM.Y_]:e3})})]}):to,tc=i.useRef(null),td=(0,eg.W)({location:"PrivateChannel"})&&r?.displayNameStyles!=null,{isIncomingCall:th,isOngoingCall:tm}=(0,V.A)(t.id),tp=[(0,Q.Ay)({channel:t,unread:e6,isIncomingCall:th,isOngoingCall:tm}),(0,Q.r2)({channel:t,muted:eX,userStatus:T})].filter(Boolean).join(", "),tf=(0,A.bG)([eN.Ay],()=>eN.Ay.lastMessageId(t.id)),{waveShouldShow:tg,wavePressed:tA}=function(e,t){let[n,l]=i.useState(!1),s=i.useCallback(async()=>{if(!n){l(!0),(0,es.W)({channelId:e.id,source:"DM Channel"}),(0,J.pX)(ea.BVt.CHANNEL(ea.ME,e.id));try{await X.A.sendStickers(e.id,["749054660769218631"],"",{location:er.Hx.SEND_WAVE})}catch(e){e.ok||429!==e.status||(0,K.P0)((0,$.o)(eo.intl.string(eo.t.Whhv4w),Y.Ck.FAILURE))}l(!1)}},[e.id,n]),a=e.isDM()&&!e.isSystemDM()&&!e.rawRecipients.some(e=>e.bot),r=a?e.getRecipientId():null,o=(0,A.bG)([en.A],()=>null!=r&&en.A.isFriend(r)),u=(0,A.bG)([en.A],()=>null!=r&&en.A.isIgnored(r)),c=(0,A.bG)([et.A],()=>{let t=et.A.getMessages(e.id);return 1===t.length&&t.first()?.type===ea.lAJ.FRIEND_REQUEST_ACCEPTED}),d=ei.default.extractTimestamp(e.id),h=(0,el.v0)(Z()(),Z()(d),18144e5),m=(0,ee.l)(e.id);return{waveShouldShow:a&&o&&!u&&(null==t||c)&&h&&null==m,wavePressed:s}}(t,tf),{showClose:tx}=H.useConfig({location:"PrivateChannel"}),tC=(0,f.A)(()=>{let e=eq.current?.getBoundingClientRect()??null,t=tc.current?.getBoundingClientRect()??null;if(null==t||null==e||e.width+44-t.width<=0)return void ez({maskImage:"none"});let n=t.width-16;ez({maskImage:`linear-gradient(to right, rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) ${n}px, rgba(0, 0, 0, 0))`})});return i.useLayoutEffect(tC,[k,s,tC]),(0,p.g)(eL,tC),(0,l.jsx)(d.tG,{id:t.id,children:e=>{let{role:n,...i}=e;return(0,l.jsxs)(ef,{className:a()(eM.Ix,eM.dm),role:n,focusProps:{...eU,focusTarget:ej,ringTarget:eL},ref:eF,onMouseEnter:e7,onMouseLeave:e9,onMouseDown:tl,onFocus:te,onBlur:tt,onContextMenu:ta,"aria-setsize":O,"aria-posinset":y,children:[e6?(0,l.jsx)("div",{className:a()(eM.dM,{[eM.SU]:e3})}):null,(0,l.jsxs)(R,{className:a()(eM.bG,{[eM.Q2]:s||em}),as:"div",onClick:ts,muted:e3,selected:s,children:[(0,l.jsx)(eh.A,{nameplate:e8?S:void 0,selected:s,hovered:k,content:tc,placement:ed.u.CHANNEL}),(0,l.jsx)("div",{className:eM.lU,ref:eq,children:tu}),(0,l.jsx)(u.N_,{style:eW,innerRef:ej,to:ea.BVt.CHANNEL(ea.ME,t.id),className:eM.nf,"aria-label":tp,...i,children:(0,l.jsx)(G.A,{ref:tc,avatar:(()=>{let e=I._3.SIZE_32;if(t.isMultiUserDM())if(t.recipients.length>=2&&null==t.icon)return(0,l.jsx)(ev.A,{"aria-hidden":!0,recipients:t.recipients,size:e,isTyping:v,status:T});else return(0,l.jsx)(ew,{...eQ,src:(0,W.Y)(t),"aria-hidden":!0,size:e,status:v?ea.clD.ONLINE:T,isTyping:v});o()(null!=r,"PrivateChannel.renderAvatar: Invalid prop configuration - no user or channel");let n=null;return r.isSystemUser()||(n=(0,D.A)(g)?ea.clD.STREAMING:T),(0,l.jsx)(ew,{...eQ,size:I._3.SIZE_32,src:eB,avatarDecoration:eH,status:n,isMobile:_,isVR:j,isTyping:v,"aria-label":r.username,statusTooltip:!0})})(),highlighted:e6&&!e3,muted:e3,subText:t.isSystemDM()?(0,l.jsx)("div",{className:eM.W$,children:(0,B.A)(t.id)?eo.intl.string(eo.t.FL5T01):eo.intl.string(eo.t.NnY5lc)}):t.isMultiUserDM()?(0,l.jsx)("div",{className:eM.W$,children:eo.intl.format(eo.t.CxSA5N,{members:t.recipients.length+1})}):(0,P.A)({activities:g,status:T,applicationStream:C,voiceChannel:E})?(0,l.jsx)(L.A,{user:r,activities:g,voiceChannel:E,applicationStream:C,animateEmoji:k||eu||em,textClassName:eM.XD,iconClassName:e3?eM.tG:void 0}):null,name:(0,l.jsx)(x.A,{className:a()(eM.uN,{[eM.e8]:td}),children:tu}),decorators:t.isSystemDM()?(0,l.jsx)(F.A,{className:eM.G$,type:F.A.Types.SYSTEM_DM,verified:!0}):null,withDisplayNameStyles:td})}),(0,l.jsxs)("div",{className:a()(eM._q,{[eM.EY]:e8}),children:[e1?(0,l.jsx)(eP,{}):null,e2?(0,l.jsx)(ek,{}):null,tg&&null!=e5?(0,l.jsx)(eD,{channelName:e5,onClick:tA,showNameplate:e8}):null,tx||!tg?(0,l.jsx)(eO,{icon:M.P,"aria-label":eZ?eo.intl.string(eo.t["26C4oi"]):eo.intl.string(eo.t.jsvgc3),onClick:eZ?tr:tn,onMouseDown:ti,nameplate:S,reducedClickTarget:!0,visibleElementRef:e4}):null]})]}),eG&&(0,l.jsx)(eC.A,{targetElementRef:eL,markMenuItemPopoverAsDismissed:eV})]})}})}let eV=21552==n.j?e=>{let{channel:t,selected:n,...i}=e,s=(0,A.bG)([eI.default],()=>eI.default.getUser(t.getRecipientId())),a=s?.id,r=(0,A.cf)([eS.A,ej.A],()=>{let e;if(t.isMultiUserDM()){let n=eS.A.getState().statuses;t.recipients.some(e=>n[e]===ea.clD.ONLINE)&&(e=ea.clD.ONLINE)}else null!=a&&(e=eS.A.getStatus(a));return{status:e,activities:null!=a?eS.A.getActivities(a):null,applicationStream:null!=a?ej.A.getAnyStreamForUser(a):null,isMobile:null!=a&&eS.A.isMobileOnline(a),isVR:null!=a&&eS.A.isVROnline(a)}},[t,a]),{voiceChannel:o}=(0,k.A)({userId:a}),u=(0,eu.r)({user:s}),c=(0,A.bG)([eI.default,ey.A],()=>t.isMultiUserDM()?ei.default.keys(ey.A.getTypingUsers(t.id)).some(e=>e!==eI.default.getCurrentUser()?.id):null!=s&&ey.A.isTyping(t.id,t.getRecipientId()),[t,s]);return t.isMultiUserDM()?(0,l.jsx)(eG,{channel:t,selected:n,isTyping:c,status:r.status===ea.clD.ONLINE?ea.clD.ONLINE:void 0,...i}):(0,l.jsx)(eG,{channel:t,selected:n,user:s,voiceChannel:o,isTyping:c,nameplate:u,...i,...r})}:null}