Loading
function(e,t,n){"use strict";n.d(t,{A:()=>eV,Y:()=>eD});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(735438),o=n.n(a),u=n(837381);if(21552==n.j)var c=n(887129);var d=n(607399),m=n(17928),h=n(140735),p=n(312138),f=n(707554),g=n(475825);if(21552==n.j)var E=n(506309);var A=n(442433),C=n(361610),x=n(414798),I=n(589158),_=n(775602),S=n(793574),y=n(95561),v=n(688810),T=n(941726),N=n(449582),j=n(900797),b=n(847374),R=n(320448),P=n(939249),L=n(485947),M=n(180170),O=n(435738),w=n(38055);let k="content-inventory-feed";var D=n(652215),U=n(375708),G=n(933928),F=n(540808);let V=i.memo(function(e){let t,{title:s,onToggleExpand:r,expanded:a,expandedCount:o}=e,u=(0,m.bG)([O.A],()=>O.A.hidden),c=i.useCallback(e=>{(0,A.L3)(e,async()=>{let{MemberListContentSettingsMenu:e}=await Promise.resolve().then(n.bind(n,38055));return()=>(0,l.jsx)(e,{closePopout:A.Z_})})},[]);return(0,l.jsxs)(L.A,{className:F.lL,children:[(0,l.jsx)(h.A,{children:U.intl.format(U.t.Uaqbke,{title:s,count:o})}),(0,l.jsxs)("div",{className:G.N1,children:[(0,l.jsx)(P.D,{onClick:e=>{if(e.currentTarget===e.target||e.currentTarget.contains(e.target))return u?(0,M.Il)():o>3?r():(0,D.tEg)()},onContextMenu:c,tag:"span",tabIndex:-1,"aria-hidden":!0,className:G.qd,children:(0,l.jsxs)("span",{children:[s," \u2014 ",o]})}),(0,l.jsx)(w.A,{}),(0,l.jsx)("div",{className:G.AN}),o<=3&&!u?null:(t=u?(0,l.jsx)(j.t,{className:G.wT}):a?(0,l.jsx)(b.a,{className:G.wT}):(0,l.jsx)(R._,{className:G.wT}),(0,l.jsx)(P.D,{onClick:()=>u?(0,M.Il)():o>3?r():(0,D.tEg)(),tag:"span","aria-label":U.intl.string(a&&!u?U.t.iTcuma:U.t.dcl9MQ),"aria-expanded":!u&&a,className:G.wT,children:t}))]})]})}),B=function(){return null};var H=n(742424),W=n(228366),K=n(963307),Y=n(734057),z=n(71393),Z=n(531685),q=n(174459),$=n(99066),J=n(376261),X=n(947593),Q=n(681154),ee=n(99753);n(321073);var et=n(136722),en=n(52133),el=n(860071),ei=n(696451),es=n(488926),er=n(818348);let ea=21552==n.j?[]:null,eo=new Set;var eu=n(751765);let ec=new Set;var ed=n(808323),em=n(424994);let eh=new Set([Q.ContentInventoryEntryType.PLAYED_GAME,Q.ContentInventoryEntryType.WATCHED_MEDIA,Q.ContentInventoryEntryType.TOP_GAME,Q.ContentInventoryEntryType.TOP_ARTIST,Q.ContentInventoryEntryType.LISTENED_SESSION,Q.ContentInventoryEntryType.LAUNCHED_ACTIVITY]),ep=21552==n.j?3e3:null;var ef=n(915089),eg=n(63152),eE=n(201275),eA=n(657048),eC=n(728321),ex=n(342296),eI=n(773669),e_=n(317525),eS=n(994500),ey=n(309010),ev=n(741961),eT=n(287809),eN=n(977997),ej=n(625494),eb=n(403362),eR=n(427262),eP=n(19575),eL=n(47167);let eM=eP.Ay.getEnableHardwareAcceleration(),eO={origin:{x:38,y:11},targetWidth:232,targetHeight:40,offset:{x:0,y:0}},ew=i.memo(function(e){let{colorString:t,colorStrings:s,colorRoleName:r,colorRoleId:a,isOwner:o,nick:u,user:c,currentUser:m,activities:h,applicationStream:p,status:f,channel:g,guildId:E,isTyping:C,isMobileOnline:_,isVROnline:S,premiumSince:y,nameplate:v,...T}=e,N=i.useRef(null),[j,b]=i.useState(!1),R=null!=y?new Date(y):null,P=i.useCallback(e=>{(0,A.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("61312"),n.e("89982"),n.e("76900"),n.e("88429"),n.e("94881"),n.e("26692"),n.e("26132"),n.e("46652"),n.e("93103"),n.e("93190"),n.e("34552"),n.e("21921"),n.e("8757"),n.e("76418"),n.e("85968"),n.e("89673"),n.e("66495"),n.e("71210"),n.e("68403"),n.e("29787"),n.e("88342"),n.e("82073"),n.e("97558"),n.e("89421"),n.e("35027"),n.e("98965"),n.e("91994"),n.e("76665"),n.e("35313"),n.e("24198"),n.e("39171"),n.e("36564"),n.e("52229"),n.e("45996"),n.e("792"),n.e("92822"),n.e("23427"),n.e("49145"),n.e("29422"),n.e("61268"),n.e("9291"),n.e("56753"),n.e("65826"),n.e("49520"),n.e("14461"),n.e("7059"),n.e("25486"),n.e("49644"),n.e("22261"),n.e("43116"),n.e("78195"),n.e("39103"),n.e("70314"),n.e("42204"),n.e("70515"),n.e("4524"),n.e("54148"),n.e("74021"),n.e("13708"),n.e("30221"),n.e("66939"),n.e("24240"),n.e("21879"),n.e("17334"),n.e("84841")]).then(n.bind(n,107632)),t=eN.A.isInChannel(ey.A.getVoiceChannelId(),c.id);return n=>(0,l.jsx)(e,{...n,user:c,guildId:E,channel:g,showMediaItems:t})})},[c,E,g]),L=i.useCallback(()=>{let e=`@${eR.Ay.getUserTag(c,{decoration:"never"})}`,t=`<@${c.id}>`;ej._.dispatch(D.jej.TEXTAREA_FOCUS,{channelId:g.id}),ej._.dispatchToLastSubscribed(D.jej.INSERT_TEXT,{plainText:e,rawText:t}),x.A.startTyping(g.id)},[c,g.id]),M=i.useCallback(e=>{null!=E&&(e.stopPropagation(),(0,eg.K4)({guildId:E,location:{section:D.JJy.MEMBER_LIST,object:D.ZSU.BOOST_GEM_ICON}}))},[E]);return(0,l.jsx)(ex.A,{targetElementRef:N,user:c,guildId:E,channelId:g.id,roleId:a,position:d.Fr?"window_center":"left",spacing:16,onShiftClick:L,shouldShow:j,onRequestClose:()=>{b(!1)},children:e=>{let{onClick:n,onMouseDown:i,...a}=e;return(0,l.jsx)(I.A,{ref:N,className:F.Dc,onContextMenu:P,shouldAnimateStatus:eM,user:c,currentUser:m,nick:u,status:f,activities:h,applicationStream:p,isOwner:o,premiumSince:R,colorString:t,colorStrings:s,colorRoleName:r,isTyping:C,channel:g,guildId:E,isMobile:_,isVR:S,onClickPremiumGuildIcon:M,selected:j,itemProps:T,nameplate:v,onClick:e=>{e.shiftKey?L?.():b(e=>!e)},onMouseDown:e=>{j?e.stopPropagation():i?.(e)},...a})}})}),ek=i.memo(function(e){let{colorRoleId:t,...n}=e,{channel:i,user:s,index:r}=e,a=(0,u.rm)(`${r}`),o=(0,m.bG)([ev.A],()=>ev.A.isTyping(i.id,s.id)),c=(0,m.bG)([eT.default],()=>eT.default.getCurrentUser()),d=(0,m.bG)([e_.A],()=>null!=t?e_.A.getRole(i.guild_id,t)?.name:void 0,[i,t]),h=(0,N.r)({user:s,guildId:i.guild_id});return(0,l.jsx)(ew,{...n,...a,isTyping:o,currentUser:c,colorRoleName:d,nameplate:h})}),eD=i.memo(function(e){let{id:t,title:s,count:r,guildId:a,className:o}=e,u=(0,eE.$7)({roleId:t,guildId:a,size:16}),c=(0,m.bG)([eI.default],()=>null==r?null:new Intl.NumberFormat(eI.default.locale).format(r),[r]),d=i.useCallback(e=>{u?.src!=null&&(0,A.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("95340"),n.e("33743")]).then(n.bind(n,455538));return t=>(0,l.jsx)(e,{...t,imageUrl:u.src})})},[u?.src]);return t===D.clD.UNKNOWN?(0,l.jsx)("div",{className:o,children:(0,l.jsx)("div",{className:F.k1})}):(0,l.jsxs)(L.A,{className:o,children:[(0,l.jsx)(h.A,{children:null==r?s:U.intl.format(U.t.Uaqbke,{title:s,count:r})}),(0,l.jsxs)("div",{className:F.CN,"aria-hidden":!0,children:[null!=u?(0,l.jsx)("span",{onContextMenu:d,children:(0,l.jsx)(eA.A,{className:F.UT,...u})}):null,(0,l.jsx)("span",{className:F.iy,children:s}),null==c?null:(0,l.jsxs)("span",{children:["\xa0\u2014 ",c]})]})]})});function eU(e){let{index:t}=e,n=(0,u.rm)(`${t}`);return(0,l.jsx)(I.A,{itemProps:n})}class eG extends i.Component{_list=null;_firstApplicationIdOccurrences=null;_lastRowsVersion;lastReportedAnalyticsChannel;shouldComponentUpdate(e){return e.channel.id!==this.props.channel.id||e.version!==this.props.version||e.groups.length!==this.props.groups.length}componentDidMount(){this.updateSubscription(),this.trackMemberListViewed()}componentDidUpdate(e){e.channel.id!==this.props.channel.id&&this.updateSubscription(),this.trackMemberListViewed(),this.updateMaxContentFeedRowSeen()}setList=e=>{this._list=e,this.props.listRef.current=e};renderSection=e=>{let{section:t}=e,{groups:n,channel:s}=this.props,r=n[t];if(r?.id===k)return(0,i.createElement)(V,{...r,key:`section-${t}`});if(0===t){let{key:e}=r;return(0,l.jsx)(eC.A,{tutorialId:"whos-online",position:"left",inlineSpecs:eO,children:(0,i.createElement)(eD,{...r,key:`section-${e}`,guildId:s.guild_id,className:F.lL})},`section-${t}`)}return(0,i.createElement)(eD,{...r,key:`section-${t}`,guildId:s.guild_id,className:F.lL})};getRowProps=e=>{let{groups:t,rows:n}=this.props,l=t[e.section];if(null==l)return null;let{index:i}=l;return null==i||"row"!==e.type?null:n[i+1+e.row]};getFirstApplicationIdOccurrences=()=>{let{rows:e,version:t}=this.props;if(null!=this._firstApplicationIdOccurrences&&this._lastRowsVersion===t)return this._firstApplicationIdOccurrences;let n=new Set,l=new Set;for(let t of e)if(null!=t&&t.type===K.S9.CONTENT_INVENTORY){let{entry:e}=t;if("application_id"in e.extra&&null!=e.extra.application_id){let t=e.extra.application_id;n.has(t)||(n.add(t),l.add(e.id))}}return this._firstApplicationIdOccurrences=l,this._lastRowsVersion=t,l};renderRow=e=>{let{section:t,row:n,rowIndex:i}=e,{channel:s}=this.props,r=this.getRowProps(e);if(null!=r){if(r.type===K.S9.MEMBER&&"user"in r){let{colorString:e,colorStrings:t,colorRoleId:n,user:a,status:o,isOwner:u,isMobileOnline:c,isVROnline:d,nick:m,activities:h,applicationStream:p,premiumSince:f}=r;return(0,l.jsx)(ek,{colorString:e,colorStrings:t,colorRoleId:n,user:a,status:o,isOwner:u,nick:m,activities:h,applicationStream:p,channel:s,guildId:s.guild_id,premiumSince:f,isMobileOnline:c,isVROnline:d,index:i},`member-${r.user.id}`)}if(r.type===K.S9.CONTENT_INVENTORY){let e=`content-inventory-${r.entry.id}`;null!=r.entry.original_id&&(e+=`-${r.entry.original_id}`);let t=this.getFirstApplicationIdOccurrences().has(r.entry.id);return(0,l.jsx)(H.Ay,{...r,channel:this.props.channel,index:i,isFirstApplicationOccurrence:t},e)}if(r.type===K.S9.HIDDEN_CONTENT_INVENTORY)return(0,l.jsx)(B,{},"content-inventory-hidden-entry")}return(0,l.jsx)(eU,{index:i},`placeholder-${t}:${n}`)};handleScroll=()=>{this.updateSubscription(),this.updateMaxContentFeedRowSeen()};updateMaxContentFeedRowSeen=o().debounce(()=>{let e=this._list;if(null==e)return;let{offsetHeight:t,scrollTop:n}=e.getScrollerState(),l=n+t-this.props.sectionHeight;this.props.updateMaxContentFeedRowSeen(l)},50);getContentFeedGroup=()=>{let e=this.props.groups[0];if(e?.id===k)return e};hasContentFeed=()=>null!=this.getContentFeedGroup();getRowHeightComputer=()=>{let e=this.getContentFeedGroup(),{rowHeight:t}=this.props;if(null!=e){let{rows:n}=this.props,l=e.index;return function(e,i){if(0===e){let e=n[l+1+i];return(0,H.h9)(e)}return t}}return t};getContentFeedHeight=()=>{let e=this.getContentFeedGroup();return null!=e?e.feedHeight+this.props.sectionHeight:0};getContentFeedAdjustedDimensions(e){let{height:t,rowHeight:n,y:l}=e,i=this.getContentFeedHeight(),s=Math.max(0,t-Math.max(0,i-l)),r=Math.floor(s/n);return{height:s,rowHeight:n,rowsVisible:r,y:Math.max(0,l-i)}}getDimensions(){let e=this._list;if(null==e)return{y:0,height:0,rowHeight:0};let{offsetHeight:t,scrollTop:n}=e.getScrollerState(),{rowHeight:l}=this.props,i=Math.floor(t/l);return this.getContentFeedAdjustedDimensions({height:t,rowHeight:l,rowsVisible:i,y:n})}updateSubscription=o().debounce(()=>{if(null==this._list)return;let{channel:e}=this.props,{rowHeight:t,y:n,height:l}=this.getDimensions();(0,C.NJ)({guildId:e.guild_id,channelId:e.id,y:n,height:l,rowHeight:t})},50);trackMemberListViewed=()=>{if(this.lastReportedAnalyticsChannel===this.props.channel.id)return;let e=this._list?.getItems(),{rowsVisible:t}=this.getDimensions();if(void 0===t||0===t||null==e)return;this.hasContentFeed()&&(e=e.filter(e=>0!==e.section));let n=e.map(e=>this.getRowProps(e)).slice(0,t+1).filter(eb.Vq);if(0===n.length)return;let l=n.reduce((e,t)=>(t.type!==K.S9.MEMBER||(e.num_users_visible++,t.isMobileOnline&&e.num_users_visible_with_mobile_indicator++,null!=t.activities&&t.activities.length>0&&(e.num_users_visible_with_activity++,t.activities.some(e=>e.type===D.$pd.PLAYING)&&e.num_users_visible_with_game_activity++),null!=t.user.avatarDecoration&&e.num_users_visible_with_avatar_decoration++,t.user.collectibles?.nameplate!=null&&e.num_users_visible_with_nameplate++),e),{num_users_visible:0,num_users_visible_with_mobile_indicator:0,num_users_visible_with_game_activity:0,num_users_visible_with_activity:0,num_users_visible_with_avatar_decoration:0,num_users_visible_with_nameplate:0});this.lastReportedAnalyticsChannel=this.props.channel.id,y.Ay.trackWithMetadata(D.HAw.MEMBER_LIST_VIEWED,{...l})};render(){let{groups:e,listId:t,channel:n,sectionHeight:i}=this.props;return(0,l.jsx)(p.sk,{children:s=>(0,l.jsx)(ef.V0,{children:a=>(0,l.jsx)("aside",{className:r()(F.yg,F.ML),"aria-labelledby":a,children:(0,l.jsx)(f.F,{component:(0,l.jsx)(h.A,{children:(0,l.jsx)(f.H,{id:a,children:U.intl.format(U.t.JBQxV6,{channel:(0,eL.m1)(n,eT.default,eS.A)})})}),children:(0,l.jsx)(u.PR,{children:n=>{let{ref:a,role:o,...u}=n;return(0,l.jsx)(g.OZ,{innerRole:o,innerAriaLabel:U.intl.string(U.t["9Oq93m"]),ref:e=>{this._list=e,this.props.listRef.current=e,a.current=e?.getScrollerNode()??null},className:r()(F.ol,{[F.Ij]:d.Fr}),paddingTop:0,sectionHeight:i,rowHeight:this.getRowHeightComputer(),renderSection:this.renderSection,renderRow:this.renderRow,sections:e.map(e=>e.count),onScroll:this.handleScroll,fade:!0,...u,...s},t)}})})})})})}}function eF(e){let{channel:t,className:n}=e,{analyticsLocations:s}=(0,v.Ay)(S.A.MEMBER_LIST),a=(0,m.bG)([_.Ay],()=>_.Ay.keyboardModeEnabled),o=(0,m.cf)([K.Ay],()=>K.Ay.getProps(t.guild_id,t.id)),{rows:d,groups:h,version:p,updateMaxRowSeen:f}=function(e){let{memberStoreProps:{groups:t,rows:n,version:l},channelId:s,guildId:r}=e,[a,o]=i.useState(!1),{requestId:u,entries:c,impressionCappedEntryIds:d}=function(e){var t;let n,l=(0,ed.A)({id:em.X1.GLOBAL_FEED});l=function(e){let{entries:t,channelId:n}=e,l=(0,m.bG)([Y.A],()=>Y.A.getChannel(n)),s=l?.guild_id,r=i.useRef(new Set),a=i.useMemo(()=>{let e=new Set(t?.map(e=>e.author_id));return(0,en.v)([...r.current],[...e])||(r.current=e),r.current},[t]);i.useEffect(()=>{null!=s&&Array.from(a).forEach(e=>{el.A.requestMember(s,e)})},[a,s]);let o=(0,m.yK)([ei.Ay],()=>{if(null==s)return ea;let e=[];for(let t of a)ei.Ay.isMember(s,t)&&e.push(t);return e},[a,s]),u=i.useMemo(()=>{if(null==l||0===o.length)return eo;let e=new Set;for(let t of o){let n=es.cc({user:t,context:l});et.zy(n,er.xB.VIEW_CHANNEL)&&e.add(t)}return e},[o,l]);return i.useMemo(()=>t?.filter(e=>u.has(e.author_id)),[t,u])}({entries:l,channelId:e});let{entries:s,filteredIds:r}=(t=l=i.useMemo(()=>l?.filter(e=>eh.has(e.content_type)),[l]),n=(0,m.bG)([O.A,ee.A],()=>{let e=ee.A.getDebugImpressionCappingDisabled();return!(0,$.sE)("useFilterImpressionCappedContent")||e?ec:O.A.getImpressionCappedItemIds()},[t]),i.useMemo(()=>{if(null==t)return{entries:t,filteredIds:ec};let e=new Set;return{entries:t.filter(t=>!!(0,eu.JM)(t)||!n.has(t.id)||(e.add(t.id),!1)),filteredIds:e}},[t,n]));return l=s,{requestId:(0,m.bG)([ee.A],()=>ee.A.getFeedRequestId(em.X1.GLOBAL_FEED)),entries:l=(0,T.Ay)(l),impressionCappedEntryIds:r}}(s),h=(0,m.bG)([O.A],()=>O.A.hidden),p=(0,m.bG)([Z.A],()=>Z.A.isFocused()),f=(0,m.bG)([Y.A],()=>Y.A.getChannel(s)),g=(0,m.bG)([z.A],()=>z.A.getGuild(r),[r]),E=((0,J.T)(g)??!1)&&f?.isForumChannel()===!1,[A,C,x,I]=i.useMemo(()=>{let e;if(null==c||0===c.length||null==u||!E)return[t,n,l];let i=a?c.length:3,d=c.slice(0,i);e=h?[{type:K.S9.HIDDEN_CONTENT_INVENTORY}]:d.map(e=>({type:K.S9.CONTENT_INVENTORY,entry:e,requestId:u}));let m={id:k,type:K.S9.CONTENT_INVENTORY_GROUP,key:k,count:e.length,index:n.length,title:U.intl.string(U.t["6gwSFY"]),onToggleExpand:function(){o(e=>{let t=!e;return q.default.track(D.HAw.MEMBERLIST_CONTENT_FEED_TOGGLED,{channel_id:s,guild_id:r,expanded:t}),t})},expanded:a,expandedCount:c.length,feedHeight:e.map(H.h9).reduce((e,t)=>e+t,0)};return[[m,...t],[...n,m,...e],Math.random(),e]},[s,c,a,t,r,u,n,l,h,E]),_=i.useRef(0),S=i.useRef(c),y=i.useRef(void 0),v=i.useRef({impressionCappedEntryIds:d}),N=i.useCallback(e=>{let t=Math.floor(e/H.bG),n=Math.min(I?.length??0,t);_.current=Math.max(_.current,n)},[I]);return i.useEffect(()=>{S.current=c},[c]),i.useEffect(()=>{v.current={impressionCappedEntryIds:d}},[d]),i.useEffect(()=>(_.current=0,y.current=Date.now(),()=>{if(null==u||null==y.current||Date.now()-y.current<ep)return;let e=S.current?.map(e=>e.id)??[],t=e.slice(0,_.current);!h&&p&&E&&((0,X.D)(D.HAw.RANKING_ITEMS_SEEN_MUST_BE_SAMPLED,{request_id:u,first_shown_at:y.current,item_ids:t,surface_type:em.UG.GUILD_MEMBER_LIST,channel_id:s,guild_id:r,all_item_ids:e,impression_capped_item_ids:[...v.current.impressionCappedEntryIds]}),(0,$.sE)("useInjectContentInventoryFeed")&&W.h.dispatch({type:"CONTENT_INVENTORY_TRACK_ITEM_IMPRESSIONS",itemIds:t}))}),[u,s,r,h,p,E]),{groups:A,rows:C,version:x,updateMaxRowSeen:N}}({memberStoreProps:o,channelId:t.id,guildId:t.guild_id}),g=i.useRef(null),A=i.useRef(null);i.useEffect(()=>{"u"<typeof document||null!=document.activeElement&&document.activeElement!==document.body&&A.current?.focus({preventScroll:!0})},[]);let C=(0,E.W)("lg")+(0,E.W)("xxs"),x=i.useCallback((e,t)=>{let n=g.current;if(null==n)return;let l=parseInt(t,10),[i,s]=n.getSectionRowFromIndex(l);n.scrollToIndex({section:i,row:s,padding:42*(0===i&&0===s),callback:()=>{requestAnimationFrame(()=>document.querySelector(e)?.focus({preventScroll:!0}))}})},[42]),I=i.useCallback(()=>new Promise(e=>{let t=g.current;if(null==t)return e();t.scrollToTop({callback:()=>requestAnimationFrame(()=>e())})}),[]),y=i.useCallback(()=>new Promise(e=>{let t=g.current;if(null==t)return e();t.scrollToBottom({callback(){requestAnimationFrame(()=>setTimeout(e,100))}})}),[]),N=(0,c.Ay)({id:`members-${t.id}`,setFocus:x,isEnabled:a,scrollToStart:I,scrollToEnd:y});return(0,l.jsx)(v.f5,{value:s,children:(0,l.jsx)("div",{ref:A,tabIndex:-1,className:r()(F.kL,n),children:(0,l.jsx)(u.hD,{navigator:N,children:(0,l.jsx)(eG,{...e,...o,version:p,groups:h,rows:d,listRef:g,updateMaxContentFeedRowSeen:f,sectionHeight:18+C,rowHeight:42})})})})}function eV(e){let{channel:t,className:n}=e,s=i.useDeferredValue(t);return i.useMemo(()=>(0,l.jsx)(T.r$,{children:(0,l.jsx)(eF,{channel:s,className:n})}),[s,n])}}