Build 613334stable
Module 542308
116,283 characters · in 1400bd7c5e0a2194.jsDependencies
Lazily required by (0)none
Requires (322)
3026332251805373162361792822231222772552526741319693418835275359033741138021412004472446054471674999950617517585351656059639956599566834713937231479858814669305595561957019656698098101611104171104510111613113783123292131607131955134413138298139033140735146630147036147925152007152367163328165648166444172218173860174459176431177953181079186111186369192308195702196577202384202776208971217223220650221950228366230135240248241326244083247806259678262763263619270533271683275833280450281405283973285406285796287809289397290863296216297264297469300596302959303528305866307076308528309010310953312006312138315982321073321593323073349828350536360729361158363487364522367513371794375708378570379229391507394107395504403362405018406704419534427262427797428689435183435470435558440293442433443063446600447199454058455234461213470452473529475825475889477900479669480900482487485947486020486418488926493819496767499211499373503698505543506774508654508770513461514179518769521427522435525093531685532622533550534890543465544048544169549996551851554146557722568065569381573163575926576705579129581007581925582128582904584960588224589603591552600761607567616356624458625903629675632015633965634654636585641635648580652215652793661531662980663997667532669715672812683180685399687966688810693879695366696451698441701785702841707539707554713654714619715828717421722884725613728321730134733391734057740426743674744399746080747926750943763827765379769015769765770178770376770666775602778712787541789645790535790782793574807632808728811024812993816662820284821609824865826673828162830215831617832163834730834942837381844944845056847374849134855473855687857253863005866665868652871123877624882840887129888697888918897898900797905695906659914430914732915089917782922016924985933832935208939249940382945810951001960253960755963027964306967198970812970853970928972786976860977997978165983851994500996439998218999903
Source Raw
function(e,t,n){n.d(t,{B:()=>rm,i:()=>rg}),n(321073);var l,i,s=n(477900),r=n(582128),a=n(435558),o=n.n(a),d=n(837381),c=n(887129),u=n(17928),h=n(661531),A=n(715828),g=n(312138),m=n(475825),f=n(707554),p=n(140735),C=n(38021),E=n(951001),x=n(820284),N=n(629675),_=n(263619),I=n(192308),S=n(66834),b=n(443063),G=n(999903),j=n(544169),v=n(16236),R=n(5180),y=n(770376),M=n(395504),L=n(924985),T=n(734057),U=n(769765),D=n(808728),O=n(71393),P=n(576705),V=n(967198),w=n(543465);n(667532);var H=n(95701),B=n(111613),k=n(652215);function F(e,t){return null!=e&&null!=t&&(e===t||(0,H.tr)(e)&&(0,H.tr)(t)||(0,H.ay)(e)&&(0,H.ay)(t))}function K(e,t,n,l){let i=-1;if(l.find((e,n)=>{let{channel:l}=e;return l.id===t&&(i=n,!0)}),i<0)return null;for(let t=i;t>=0&&t<l.length;t+=e){let e=l[t];if(F(e.channel.type,n))return e}return null}function z(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e)return 0;let l=null;return t.filter(t=>{let{channel:{type:l}}=t;return null!=e&&(n||F(e.type,l))}).find((t,n)=>{let{channel:{id:i}}=t;return null!=e&&i===e.id&&(l=n,!0)}),l}function W(e){return{referenceId:e.id,parentId:e.parent_id}}function Y(e,t,n,l,i){if(null==e||null==n)return null;let{GUILD_CATEGORY:s}=k.rbe;if(e.type===s)return l===t||l<t&&e.type===n.type?W(n):l>t?function(e,t,n){let{GUILD_CATEGORY:l}=k.rbe,i=n[(z(t,n,!0)??0)+1],s=K(-1,t.id,e.type,n);return null==s||s.channel.id===e.id?null:null==i||i.channel.type===l?{referenceId:s.channel.id,parentId:null}:null}(e,n,i):null;if(F(e.type,n.type))return W(n);if(l<t){let t,l;if(n.type===s){let t=i[(z(n,i,!0)??0)-1],l=K(1,n.id,e.type,i);if(null==t)return{referenceId:null,parentId:null};if(null!=l){if(F(t.channel.type,e.type)||e.isGuildVocal()&&(0,H.tr)(t.channel.type))return{referenceId:l.channel.id,parentId:t.channel.parent_id};if(t.channel.isCategory())return{referenceId:l.channel.id,parentId:t.channel.id}}return null}return t=i[(z(n,i,!0)??0)-1],l=K(1,n.id,e.type,i),null!=t||e.isGuildVocal()?(0,H.tr)(e.type)&&null!=l&&((0,H.tr)(t.channel.type)||t.channel.isCategory())?{referenceId:l.channel.id,parentId:n.parent_id}:null:{referenceId:null!=l?l.channel.id:null,parentId:null}}if(n.type===s){let t=i[(z(n,i,!0)??0)+1],l=K(-1,n.id,e.type,i);if(null!=l){if(null==t)return{referenceId:l.channel.id,parentId:n.id};if(F(t.channel.type,e.type)||(0,H.tr)(e.type)&&t.channel.isGuildVocal())return{referenceId:l.channel.id,parentId:t.channel.parent_id};if(t.channel.isCategory())return{referenceId:l.channel.id,parentId:n.id}}return null}let r=i[(z(n,i,!0)??0)+1],a=K(-1,n.id,e.type,i);if(null==a)return null;if(e.isGuildVocal()){if(null==r||r.channel.isCategory())return{referenceId:a.channel.id,parentId:n.parent_id};if(r.channel.isGuildVocal())return{referenceId:a.channel.id,parentId:r.channel.parent_id}}return e.isCategory()&&(null==r||r.channel.isCategory())?{referenceId:a.channel.id,parentId:null}:null}var X=n(488926);let q="DRAGGABLE_GUILD_CHANNEL";function Z(e,t){if(null==e||null==t)return null;if(!(0,R.ai)(e))return T.A.getChannel(t);let n=D.Ay.getChannels(e),l=n[D.I6].find(e=>e.channel.id===t)??n[D.vM].find(e=>e.channel.id===t)??n[k.rbe.GUILD_CATEGORY].find(e=>e.channel.id===t);return l?.channel}function J(e,t){if(null!=e.parent_id){let t=T.A.getChannel(e.parent_id);if(null!=t)return P.A.can(k.xBc.MANAGE_CHANNELS,t)}return P.A.can(k.xBc.MANAGE_CHANNELS,t)}function $(e){return(0,N.T)(q,{drop(e,t){let n,l=V.A.getGuildId(),i=t.getItem(),r=Y(Z(l,i.id),i.position,e.channel,e.position,i.channelList);if(null==r)return;let a=Z(l,i.id);if(null==a)return;let o=U.A.getCategories(l),d=O.A.getGuild(l);if(null==d)return;let c=function(e,t,n,l){let i,s,r=[],a=[],o=l._categories;function d(t){var n,l;let a;return a=null==i||null==s||(n=i,l=s,+(null==n||null==l||null==t[n]||t[n].channel!==e||null==t[l]))?[...t]:B.Ay.moveItemFromTo(t,i,s),r=r.concat(B.Ay.calculatePositionDeltas({oldOrdering:t,newOrdering:a,idGetter:e=>{let{channel:t}=e;return t.id},existingPositionGetter:e=>{let{channel:t}=e;return t.position}})),a}if(e.isCategory()){let n=[...o].slice(1);i=z(e,n),s=z(t,n),(a=d(n)).unshift(o[0])}if((0,H.tr)(e.type)||e.isCategory()){let n=(0,G.A)(a.length>0?a:o,l,e=>{let{channel:{type:t}}=e;return(0,H.tr)(t)});i=z(e,n),s=z(t,n),d(n)}if(e.isGuildVocal()||e.isCategory()){let n=(0,G.A)(a.length>0?a:o,l,e=>{let{channel:t}=e;return t.isGuildVocal()});i=z(e,n),s=z(t,n),d(n)}return e.parent_id!==n&&null==r.find(t=>t.id===e.id&&(t.parent_id=n,!0))&&r.push({id:e.id,parent_id:n}),r}(a,Z(l,r.referenceId),r.parentId,o);if(0!==c.length){if((0,R.ai)(l))return void(0,v.zN)(c);if(c=c.filter(e=>{let{id:t}=e,n=T.A.getChannel(t);if(null==n)return!1;let l=T.A.getChannel(n.parent_id);return n.type===k.rbe.GUILD_CATEGORY||null==l?P.A.can(k.xBc.MANAGE_CHANNELS,d):P.A.can(k.xBc.MANAGE_CHANNELS,l)}),a.parent_id!==r.parentId&&c.find(e=>{if(e.id!==a.id)return!1;let t=T.A.getChannel(e.parent_id);if(!(null!=t&&P.A.can(k.xBc.MANAGE_ROLES,a)&&P.A.can(k.xBc.MANAGE_ROLES,t)))return!0;let l=(0,b.GY)(a),i=X.r(a,t,l),s=X.r(a,T.A.getChannel(a.parent_id),l);return(null!=a.parent_id||i)&&(!s||i)||(n=e),!0}),null!=n){let e=T.A.getChannel(n.parent_id);null!=e&&(0,I.openModal)(t=>(0,s.jsx)(j.default,{...t,channel:a,category:e,onConfirm:()=>{null!=n&&(n.lock_permissions=!0,S.A.batchChannelUpdate(l,c))},onCancel:()=>{null!=n&&S.A.batchChannelUpdate(l,c)}}))}else S.A.batchChannelUpdate(l,c)}},canDrop(e,t){let n=t.getItem(),l=T.A.getChannel(n.id);if(null==l)return!1;let i=Y(T.A.getChannel(n.id),n.position,e.channel,e.position,n.channelList);if(null==i)return!1;if((0,R.ai)(V.A.getGuildId()))return!0;if(w.Ay.isFavorite(n.guildId,e.channel.id))return!1;let s=O.A.getGuild(n.guildId);if(null==s)return!1;let r=T.A.getChannel(i.parentId),a=T.A.getChannel(l.parent_id),o=P.A.can(k.xBc.MANAGE_CHANNELS,s),d=null!=a?P.A.can(k.xBc.MANAGE_CHANNELS,a):o,c=null!=r?P.A.can(k.xBc.MANAGE_CHANNELS,r):o;return d&&c}},(e,t)=>{let n=t.getItem();return null==n||null==n.isChannelDrag?{connectChannelDropTarget:e.dropTarget(),sorting:!1,sortingType:null,sortingPosition:null,sortingParent:null}:{connectChannelDropTarget:e.dropTarget(),sorting:!0,sortingType:n.type,sortingPosition:t.isOver()&&t.canDrop()?n.position:null,sortingParent:t.isOver()&&t.canDrop()?n.parentId:null}})((0,_.I)(q,{canDrag(e){let{channel:t}=e;if((0,R.ai)(V.A.getGuildId()))return!0;let l=O.A.getGuild(t.getGuildId());return null!=l&&((0,M.WW)(l.id)&&J(t,l)?((0,y.A)()&&(0,I.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("57729"),n.e("24848")]).then(n.bind(n,354643));return t=>(0,s.jsx)(e,{...t})}),!1):w.Ay.isFavorite(l.id,t.id)&&J(t,l)?((0,I.openModalLazy)(async()=>{let{default:e}=await n.e("280545").then(n.bind(n,933752));return n=>(0,s.jsx)(e,{...n,guildId:l.id,channelId:t.id})}),!1):J(t,l))},beginDrag(e){let{channel:{id:t,parent_id:n,guild_id:l,type:i},position:s}=e,r=V.A.getGuildId(),a=U.A.getCategories(r);return{isChannelDrag:!0,id:t,position:s,parentId:n,type:i,channelList:(0,G.A)(a._categories,a,e=>{let{channel:t}=e;return t.type===k.rbe.GUILD_CATEGORY&&null!=a[t.id]&&0===a[t.id].length?!!(0,R.ai)(r)||P.A.can(k.xBc.MANAGE_CHANNELS,t)&&P.A.can(k.xBc.VIEW_CHANNEL,t):!L.A.isCollapsed(t.parent_id)}),guildId:l}}},e=>({connectChannelDragSource:e.dragSource(),connectDragPreview:e.dragPreview()}))(e))}var Q=n(775602),ee=n(793574),et=n(688810),en=n(915089),el=n(554146),ei=n(866665),es=n(939249),er=n(789645),ea=n(812993),eo=n(687966),ed=n(131607),ec=n(652793),eu=n(976860),eh=n(746080),eA=n(49999),eg=n(394107),em=n(375708),ef=n(275833),ep=n(964306);let eC=r.memo(function(e){let{guildId:t,selected:l}=e,[i,a]=(0,ed.ww)([el.M.GAME_SERVER_HOSTING_NEW_BADGE],t),o=i===el.M.GAME_SERVER_HOSTING_NEW_BADGE,d=r.useCallback(()=>{a(eA.i.USER_DISMISS),(0,eu.pX)(k.BVt.CHANNEL(t,eh.VV.GAME_SERVERS))},[t,a]),c=r.useCallback(e=>{e.stopPropagation(),(0,I.openModalLazy)(async()=>{let{default:e}=await n.e("726702").then(n.bind(n,758909));return n=>(0,s.jsx)(e,{...n,guildId:t})})},[t]),u=(0,s.jsxs)("div",{className:ef.c,children:[(0,s.jsx)("div",{className:ep.Xs,children:(0,s.jsx)(ei.m,{text:em.intl.string(em.t.fgq1gs),position:"top",children:(0,s.jsx)(es.D,{onClick:c,"aria-label":em.intl.string(em.t.fgq1gs),children:(0,s.jsx)(er.P,{size:"xs",color:"currentColor",className:ep.gE})})})}),o&&(0,s.jsx)("div",{className:ep.yW,children:(0,s.jsx)(ea.Lp,{disableColor:!0,text:em.intl.string(em.t.y2b7CA),className:ef.q})})]});return(0,s.jsx)(ec.G,{className:ep.Ki,id:`game-server-empty-${t}`,renderIcon:e=>(0,s.jsx)(eo.GameControllerIcon,{size:"md",className:e,color:"currentColor"}),text:em.intl.string(eg.default.vCzwM7),selected:l,onClick:d,trailing:u})});var eE=n(361158),ex=n(270533),eN=n(186111),e_=n(917782);let eI=r.memo(function(e){let{guildId:t,selected:n}=e,l=(0,I.useHasAnyModalOpen)(),i=(0,u.bG)([eN.A],()=>eN.A.hasLayers()),a=(0,eE.xr)(e=>e.fullScreenLayers.length>0),[o,d]=(0,ed.ww)([el.M.GAME_SERVER_HOSTING_NEW_BADGE],t),c=o===el.M.GAME_SERVER_HOSTING_NEW_BADGE,[h,A]=(0,ed.ww)(l||i||a||!c?[]:[el.M.GAME_SERVER_HOSTING_NEW_COACHMARK],t),g=r.useCallback(e=>{d(e),A(e)},[d,A]),m=r.useCallback(()=>{g(eA.i.USER_DISMISS),(0,eu.pX)(k.BVt.CHANNEL(t,eh.VV.GAME_SERVERS))},[t,g]),f=r.useRef(null),p=h===el.M.GAME_SERVER_HOSTING_NEW_COACHMARK,C=r.useCallback(()=>(0,s.jsx)(ex.mn,{channelRowRef:f,guildId:t,markAsDismissed:g}),[t,g]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec.G,{ref:f,id:`game-server-${t}`,renderIcon:e=>(0,s.jsx)(eo.GameControllerIcon,{size:"md",className:e,color:"currentColor"}),text:em.intl.string(eg.default.vCzwM7),selected:n,onClick:m,trailing:c?(0,s.jsx)(ea.Lp,{disableColor:!0,text:em.intl.string(em.t.y2b7CA),className:e_.q}):null}),p&&C()]})});var eS=n(177953),eb=n(533550),eG=n(624458),ej=n(844944),ev=n(513461),eR=n(663997),ey=n(221950);function eM(e){let{guild:t,selected:n}=e,l=(0,u.bG)([P.A],()=>P.A.can(k.xBc.KICK_MEMBERS,t)),i=(0,u.bG)([ej.A],()=>ej.A.getSubmittedGuildJoinRequestTotal(t.id)),a=l?i??0:0;r.useEffect(()=>{l&&t.features.has(k.GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED)&&t.features.has(k.GuildFeatures.MEMBER_VERIFICATION_MANUAL_APPROVAL)&&eG.A.fetchGuildJoinRequests({guildId:t.id,status:ev.B5.SUBMITTED,limit:eR.L})},[l,t]);let o=r.useCallback(()=>{(0,ey.aZ)(t.id)},[t.id]),d=(0,eb.q8)(t.id,el.M.MEMBERS_LAUNCH_UPSELL);return(0,s.jsx)("div",{ref:d,children:(0,s.jsx)(ec.G,{id:`members-${t.id}`,renderIcon:e=>(0,s.jsx)(eS.n,{size:"md",color:"currentColor",className:e}),text:em.intl.string(em.t.oclz3Z),selected:n,onClick:o,trailing:a>0?(0,s.jsx)(ea.hV,{count:a}):null})})}var eL=n(632015);function eT(e){let{guild:t,selected:n}=e;return(0,s.jsx)(ec.G,{id:`guild-space-tab-${t.id}`,renderIcon:e=>(0,s.jsx)(eL.f,{size:"md",color:"currentColor",className:e}),text:em.intl.string(em.t["04IVMq"]),selected:n,onClick:function(){(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.GUILD_SPACE))}})}var eU=n(581007),eD=n(522435),eO=n(285406),eP=n(582904),eV=n(419534),ew=n(503698),eH=n.n(ew),eB=n(695366),ek=n(104510),eF=n(544048),eK=n(868652),ez=n(379229),eW=n(482487),eY=n(914732),eX=n(828162),eq=n(877624),eZ=n(549996),eJ=n(25525),e$=n(247806);function eQ(e){let{indicator:t}=e;if(null==t)return null;switch(t.type){case ez.cD.WARNING:return(0,s.jsx)(eB.E,{color:h.A.colors.STATUS_WARNING,size:"sm"});case ez.cD.UNREAD:return(0,s.jsx)(ea.hV,{count:t.count});default:return null}}let e0={animation:{BEG:0,END:75},LOOP:{BEG:76,END:376}},e1=r.memo(function(e){let{guildId:t,selected:l}=e,i=(0,eY.Ay)(t),{showHighlight:a,markAsDismissed:o}=function(){let e=(0,eZ.c)(eq.C.GUILD_BOOST_TAB_BANNER),t=null!=e&&"guildBoostTabBanner"===e.properties.properties.oneofKind,[n,l]=(0,ed.Cc)(t?el.M.GUILD_BOOST_TAB_HIGHLIGHT:null,e?.promotionId??"");return{showHighlight:n===el.M.GUILD_BOOST_TAB_HIGHLIGHT,markAsDismissed:l}}(),{showNewBadgeOnRow:d,dismissNewBadgeIfShown:c}=(0,eW.A)(t,i?.indicator!=null||i?.popout!=null),A=r.useCallback(()=>{c(),(0,eK.Zm)(t),(0,eX.A)(t,ee.A.GUILD_POWERUPS_CHANNEL_LIST_ROW),i?.popout?.markAsDismissed(eA.i.INDIRECT_ACTION)},[t,c,i]),g=r.useRef(null),m=(0,I.useModalsStore)(I.hasAnyModalOpenSelector),f=(0,u.bG)([eN.A],()=>eN.A.hasLayers()),p=(0,eE.xr)(e=>e.fullScreenLayers.length>0),C=m||f||p,E=r.useCallback(()=>{if(i?.popout==null||C)return null;switch(i?.popout?.type){case ez.o.LEVEL_REACHED:return(0,s.jsx)(ex.HW,{guildId:t,channelRowRef:g,...i.popout});case ez.o.PERKS_AVAILABLE:return(0,s.jsx)(ex.UB,{guildId:t,channelRowRef:g,...i.popout});case ez.o.PERKS_PURCHASABLE:return(0,s.jsx)(ex.lw,{guildId:t,channelRowRef:g,...i.popout});case ez.o.NEW_PERK_AVAILABLE:return(0,s.jsx)(ex.bo,{guildId:t,channelRowRef:g,...i.popout});case ez.o.BOOST_TO_UNLOCK:return(0,s.jsx)(ex.Gw,{guildId:t,channelRowRef:g,...i.popout});case ez.o.EXPIRING_PERK:return(0,s.jsx)(ex.Mr,{guildId:t,channelRowRef:g,...i.popout});case ez.o.GAME_SERVER_HOSTING_AVAILABLE:case ez.o.GAME_SERVER_HOSTING_GUILD_ELIGIBLE:return(0,s.jsx)(ex.jz,{guildId:t,channelRowRef:g,...i.popout});case ez.o.GAME_SERVER_NEW_GAMES:return(0,s.jsx)(ex.YX,{guildId:t,channelRowRef:g,...i.popout});case ez.o.GAME_SERVER_PRICING_CHANGE:return(0,s.jsx)(ex.Ns,{guildId:t,channelRowRef:g,...i.popout});default:return(0,s.jsx)("div",{})}},[t,i?.popout,g,C]);r.useEffect(()=>{l&&a&&o(eA.i.AUTO_DISMISS)},[l,a,o]);let x=i?.popout!=null||a,[N,_]=r.useState(null);r.useEffect(()=>{x||_(null)},[x]);let S=r.useCallback(e=>{_(e)},[]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec.G,{ref:g,className:e$.kL,id:`skill-trees-${t}`,renderIcon:e=>(0,s.jsx)(ek._,{size:"md",className:e,color:"currentColor"}),background:x&&(0,s.jsx)("div",{className:e$.Fi,children:(0,s.jsx)(eF.t,{nextScene:null==N?"animation":"LOOP",className:e$.UU,sceneSegments:e0,importData:()=>n.e("867807").then(n.t.bind(n,217762,19)),onScenePlay:S,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}})}),text:(0,s.jsx)("span",{className:eH()({[e$.A7]:i?.showUnread===!0}),children:em.intl.string(eJ.default.yv3DJJ)}),selected:l,onClick:A,showUnread:i?.showUnread===!0,trailing:d?(0,s.jsx)(ea.Lp,{text:em.intl.string(em.t.y2b7CA),color:h.A.colors.BACKGROUND_BRAND.css}):(0,s.jsx)(eQ,{indicator:i?.indicator})}),E()]})});var e3=n(479669),e2=n(834730),e9=n(717421),e5=n(442433),e7=n(230135),e6=n(228366);let e4={};class e8 extends u.Ay.PersistedStore{static displayName="GuildBoostingProgressBarPersistedStore";static persistKey="PremiumGuildProgressBarPersistedStore";initialize(e){null!=e&&(e4=e)}getState(){return e4}getCountForGuild(e){return e4[e]}}let te=new e8(e6.h,{APPLIED_GUILD_BOOST_COUNT_UPDATE:function(e){let{guildId:t,premiumCount:n}=e;e4={...e4,[t]:n}},APPLIED_GUILD_BOOST_COUNT_RESET:function(){e4={}}});var tt=n(147925),tn=n(363487),tl=n(568065);function ti(e){return(0,r.useMemo)(()=>{if(null==e)return 0;let t=e?.features.has(k.GuildFeatures.PREMIUM_TIER_3_OVERRIDE)===!0?0:k.M2T[k.TVA.TIER_3],n=Object.values(tl.sy),l=Object.values(tl.YV);return n.concat(l).forEach(n=>{null==n.includedInLevel&&(n.isEnabled?.(e.id)??!0)&&(t+=n.boostPrice)}),t},[e])}var ts=n(196577);let tr=r.forwardRef((e,t)=>{let{appliedBoostCount:n,maxBoostCount:l,premiumSubscriberCount:i,className:a}=e,o=n>=l,d=Math.min(n/l*100,100),c=`calc(${d}% - 4px)`,[u,h]=(0,e9.z)(()=>({width:n===i?c:"calc(0% - 0px)",config:{tension:250,damping:5,mass:1}}),"respect-motion-settings",[n,i]);return r.useEffect(()=>{h({width:c})},[c,h]),(0,s.jsxs)("div",{ref:t,className:ts.hQ,children:[(0,s.jsx)("div",{className:eH()(ts.L$,a)}),(0,s.jsx)(e3.animated.div,{className:eH()(ts.qB,{[ts.mu]:d<=5}),style:u}),(0,s.jsxs)("div",{className:ts.FS,children:[(0,s.jsxs)("div",{className:ts.Ui,children:[(0,s.jsx)(e2.E,{className:ts.Qq,variant:"text-xs/semibold",children:em.intl.string(eJ.default.NI6Ihe)}),i>=l&&(0,s.jsx)(e2.E,{className:ts.Qq,variant:"text-xs/semibold",children:"\uD83C\uDF89"})]}),(0,s.jsxs)("div",{className:ts.Ui,children:[(0,s.jsx)(e2.E,{className:eH()(ts.Qq,ts.ue),variant:"text-xs/semibold",children:o?em.intl.formatToPlainString(eJ.default["Ehpq+7"],{appliedBoostCount:n}):em.intl.formatToPlainString(eJ.default["/rbPDs"],{appliedBoostCount:n,maxBoostCount:l})}),(0,s.jsx)(tt.A,{width:12,height:12,direction:tt.A.Directions.RIGHT,className:eH()(ts.Qq,ts.ue,ts.OW)})]})]})]})});function ta(e){let{guild:t,withMargin:l}=e,i=ti(t),a=(0,tn.A)(t.id),o=r.useCallback(()=>{(0,eX.A)(t.id,ee.A.GUILD_BOOSTING_SIDEBAR_DISPLAY)},[t.id]),d=(0,u.bG)([te],()=>te.getCountForGuild(t.id)??0);r.useEffect(()=>{d!==t.premiumSubscriberCount&&(0,e7.u)(t.id,t.premiumSubscriberCount)},[t.id,d,t.premiumSubscriberCount]);let c=r.useCallback(e=>{a&&(0,e5.L3)(e,async()=>{let{default:e}=await n.e("371728").then(n.bind(n,709843));return n=>(0,s.jsx)(e,{...n,guild:t})})},[a,t]);return(0,s.jsx)(es.D,{"aria-label":void 0,role:"button",focusProps:{offset:{left:10,right:4}},onClick:o,className:eH()(ts.kL,{[ts.aF]:l}),onContextMenu:c,children:(0,s.jsx)(tr,{appliedBoostCount:d,maxBoostCount:i,premiumSubscriberCount:t.premiumSubscriberCount})})}function to(e){let{guild:t,withMargin:n}=e;return(0,s.jsx)(ta,{guild:t,withMargin:n})}tr.displayName="GuildPowerupsProgressBarUI";var td=n(455234),tc=n(181079),tu=n(607567),th=n(403362),tA=n(996439),tg=n(935208),tm=n(63995),tf=n(518769);function tp(e){let{voiceState:t,userNick:n,user:l}=e,i=(0,tu.hz)(t,n);return{user:l,voiceState:t,nick:n,comparator:i}}var tC=n(787541),tE=n(79858),tx=n(600761),tN=n(72314),t_=n(297469),tI=n(960755),tS=n(633965),tb=n(702841),tG=n(41200),tj=n(831617),tv=n(589603),tR=n(496767),ty=n(134413),tM=n(701785),tL=n(101611),tT=n(473529),tU=n(978165),tD=n(960253),tO=n(770666),tP=n(508654),tV=n(470452),tw=n(521427);let tH=(0,n(945810).mj)({name:"2026-04-mobile-boost-progress-bar",kind:"user",defaultConfig:{enabled:!1},variations:{1:{enabled:!0}}});var tB=n(871123),tk=n(683180),tF=n(281405),tK=n(3026),tz=n(821609),tW=n(499373),tY=n(259678),tX=n(508770),tq=n(847374),tZ=n(285796),tJ=n(983851),t$=n(914430),tQ=n(47167),t0=n(485947),t1=n(970853),t3=n(93055),t2=n(349828),t9=n(22277),t5=n(551851),t7=n(391507);function t6(e){e.stopPropagation()}function t4(e){let{label:t,onClick:n,tabIndex:l}=e;return(0,s.jsx)(ei.m,{text:t,children:(0,s.jsx)(es.D,{className:eH()(t7.c9,t7.ih),onClick:n,tabIndex:l,role:"button","aria-label":t,children:(0,s.jsx)(tW.T,{size:"xs",color:"currentColor",className:t7.hs})})})}let t8=$(r.memo(function(e){let t,{channel:l,connectChannelDragSource:i,connectChannelDropTarget:a,disableManageChannels:o,position:c,sortingPosition:h,hideIcon:A,children:g}=e,m=(0,u.bG)([w.Ay],()=>w.Ay.isChannelMuted(l.getGuildId(),l.id)),f=(0,u.bG)([L.A],()=>L.A.isCollapsed(l.id)),p=(0,u.bG)([P.A],()=>P.A.can(k.xBc.MANAGE_CHANNELS,l)),C=(0,tQ.Ay)(l);t=null!=h?c>h?t7.mU:t7.TR:t7.fx;let E=r.useCallback(()=>{f?(0,t$.fh)(l.id):(0,t$.Gv)(l.id)},[l.id,f]),x=r.useCallback(e=>{if("null"!==l.id){let t=O.A.getGuild(l.getGuildId());null!=t&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("393336"),n.e("391763"),n.e("955557"),n.e("535321"),n.e("603998"),n.e("550033"),n.e("412255"),n.e("63340"),n.e("430997"),n.e("379995"),n.e("591377"),n.e("35723"),n.e("566378"),n.e("715675")]).then(n.bind(n,740438));return n=>(0,s.jsx)(e,{...n,channel:l,guild:t})})}},[l]),N=r.useCallback(()=>{let e=l.type===k.rbe.GUILD_CATEGORY?null:l.type,t=l.getGuildId();null!=t&&(0,I.openModalLazy)(async()=>{let{default:i}=await Promise.all([n.e("377476"),n.e("766811"),n.e("746309"),n.e("778799"),n.e("470068"),n.e("203589"),n.e("692513"),n.e("589916"),n.e("460773"),n.e("208018"),n.e("120379"),n.e("824547"),n.e("819193"),n.e("507775"),n.e("662068"),n.e("358608"),n.e("221500")]).then(n.bind(n,684343));return n=>(0,s.jsx)(i,{...n,channelType:e,guildId:t,categoryId:"null"!==l.id?l.id:null})})},[l]),_=function(e,t){let n=(0,u.bG)([tc.A],()=>tc.A.autoAddJoinedThreads),{isAtLimit:l}=(0,t3.ft)();return n&&l&&null!=t&&(0,R.ai)(e.getGuildId())&&e.type===k.rbe.GUILD_CATEGORY&&t.trim().toLowerCase()===t2.A.toLowerCase()?{label:em.intl.string(t9.default.WsUrMD),tooltip:em.intl.string(t9.default.dW9Kov)}:null}(l,C),S=(0,t1.A)(l);null==S&&p&&!o&&(S={label:em.intl.string(em.t["fUYU+j"]),perform:N});let{role:b,tabIndex:G,...j}=(0,d.rm)(l.id),v=r.useRef(null),y=r.useRef(null),M=(0,s.jsxs)("li",{className:t,"data-dnd-name":C,children:[(0,s.jsx)(tY.vN,{focusTarget:v,ringTarget:y,offset:{left:4,right:4},children:(0,s.jsxs)("div",{ref:y,className:eH()(t7.Ki,t7.iE,{[t7.yZ]:f,[t7.SU]:m,[t7.vk]:!0}),onContextMenu:x,children:[(0,s.jsxs)(es.D,{innerRef:v,className:t7.rb,tabIndex:G,...j,onClick:E,"aria-label":em.intl.formatToPlainString(em.t.y5l3J2,{categoryName:C}),"aria-expanded":!f,focusProps:{enabled:!1},children:[(0,s.jsx)(t0.A,{className:t7.UU,children:(0,s.jsx)(tK.A,{children:C})}),null!=_?(0,s.jsx)("span",{className:t7.qS,children:(0,s.jsx)(ei.m,{asContainer:!0,text:_.tooltip,children:(0,s.jsx)(tX.E,{type:{text:_.label},variant:"default"})})}):null,A?null:(0,s.jsx)(tq.a,{size:"md",color:"currentColor",className:t7.Kk})]}),(0,s.jsx)("div",{onClick:t6,className:t7.Y_,children:null!=S?(0,s.jsx)(t4,{label:S.label,onClick:S.perform,tabIndex:G}):null})]})}),g]});return null!=a&&null!=i?a(i(M)):M})),ne=r.memo(function(e){let{name:t,onDismiss:n,className:l}=e;return(0,s.jsx)("li",{className:eH()(l,t7.fx),children:(0,s.jsxs)("div",{className:eH()(t7.Ki,t7._V),children:[(0,s.jsx)("div",{className:t7.rb,children:(0,s.jsx)(t0.A,{className:t7.UU,children:(0,s.jsx)(tK.A,{children:t})})}),null!=n?(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t["5qNmsU"]),children:(0,s.jsx)(es.D,{className:t7.r,onClick:n,children:(0,s.jsx)(tZ.a,{size:"md",color:"currentColor",className:t7.X8})})}):null]})})}),nt=r.memo(function(e){let{category:t}=e,n=(0,u.bG)([t5.A],()=>t5.A.isVoiceCategoryCollapsed(t.guild.id)),l=r.useCallback(()=>{var e,l;n?(e=t.guild.id,e6.h.dispatch({type:"VOICE_CATEGORY_EXPAND",guildId:e,expand:!0})):(l=t.guild.id,e6.h.dispatch({type:"VOICE_CATEGORY_COLLAPSE",guildId:l,expand:!1}))},[t.guild.id,n]);return(0,s.jsx)("div",{className:t7.oA,children:(0,s.jsx)(tz.$,{variant:"secondary",fullWidth:!0,onClick:l,icon:tJ.H,text:n?em.intl.string(em.t["/eB9Bg"]):em.intl.string(em.t.Q2gPWl)})})}),nn=r.memo(function(e){let{category:t,channel:n}=e,l=(0,u.bG)([t5.A],()=>t5.A.isVoiceCategoryCollapsed(t.guild.id));return l||null==n||n.record.type===k.rbe.GUILD_CATEGORY?l?(0,s.jsx)("li",{className:t7.fx,children:(0,s.jsx)("div",{className:eH()(t7.Ki,t7._V),children:(0,s.jsx)(t0.A,{className:t7.UU,children:(0,s.jsx)(tK.A,{children:em.intl.string(em.t["V/u9Dy"])})})})}):null:(0,s.jsx)("div",{style:{height:16}})}),nl=r.memo(function(e){let{channel:t}=e,n=(0,tQ.Ay)(t);return(0,s.jsx)("li",{className:t7.fx,children:(0,s.jsx)("div",{className:eH()(t7.Ki,t7._V),children:(0,s.jsx)(t0.A,{className:t7.UU,children:(0,s.jsx)(tK.A,{children:n})})})})});var ni=n(728321),ns=n(244083);let nr={origin:{x:-36,y:7},targetWidth:232,targetHeight:40,offset:{x:0,y:0}};var na=n(906659);let no=r.memo(function(e){let{sectionIndex:t,guild:n,guildChannels:l,guildChannelsVersion:i,selectedChannelId:a,disableManageChannels:o}=e,d=r.useCallback(()=>{let e=l.getCategoryFromSection(l.recentsSectionNumber);if(null==e)return;let t=null,i=e.getShownChannelAndThreadIds();null!=a&&i.includes(a)&&(t=(0,eV.xb)(l)),(0,eV.DD)(n.id,i,t)},[n.id,a,l,i]),{density:c}=(0,C.wR)(),u="compact"===c?8:12;switch(t){case t_.PU:return(0,s.jsx)("div",{style:{height:u}});case t_.bK:if(n.features.has(k.GuildFeatures.HUB))return null;return(0,s.jsx)("div",{style:{height:u}});case t_.HP:return(0,s.jsx)(ne,{name:em.intl.string(em.t.mlPMCy)});case l.recentsSectionNumber:return(0,s.jsx)(ne,{name:em.intl.string(em.t.gKcrqM),onDismiss:d});case l.voiceChannelsSectionNumber:{let e=l.getCategoryFromSection(l.voiceChannelsSectionNumber);if(null==e||e.isEmpty())return null;let n=l.getChannelFromSectionRow(t,0)?.channel;return(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)("div",{className:na.ts}),(0,s.jsx)(nn,{category:e,channel:n})]})}case t_.TF:{let e=l.getNamedCategoryFromSection(t);if(null==e)return null;return(0,s.jsx)(t8,{channel:e.record,position:e.position,disableManageChannels:o,children:(0,s.jsx)(ni.A,{inlineSpecs:nr,arrowAlignment:ns.oN.TOP,tutorialId:"organize-by-topic",position:"right"})})}default:{let e=l.getNamedCategoryFromSection(t);if(null==e)return null;return(0,s.jsx)(t8,{channel:e.record,position:e.position,disableManageChannels:o})}}});var nd=n(104171),nc=n(186369),nu=n(970812),nh=n(147036);function nA(e,t,n){return{hasDivider:!function(e,t){if(t===t_.PU){let t=e.getGuildActionSection().getRows();return 1===t.length&&t[0]===tF.n.GUILD_PREMIUM_PROGRESS_BAR||e.getGuildActionSection().isEmpty()}return 0===e.getSections(!1)[t]}(e,n)&&(n===t_.PU||((0,R.ai)(e.id)?n!==e.getSections(!1).length-1:n===t_.HP||!!t&&n!==t_.bK&&(n===e.recentsSectionNumber||(e.voiceChannelsSectionNumber,!1)))),canHaveVoiceSummary:n!==t_.PU&&n!==t_.HP&&n!==t_.bK&&n!==e.recentsSectionNumber&&n!==e.voiceChannelsSectionNumber}}let ng=r.memo(function(e){let{guildChannels:t,guildChannelsVersion:n}=e,l=r.useMemo(()=>t.getCategoryFromSection(t.voiceChannelsSectionNumber),[t,n]);return null==l?null:(0,s.jsx)(nt,{category:l})}),nm=r.memo(function(e){let{sectionIndex:t,guildChannels:n,guildChannelsVersion:l,voiceStates:i,guildId:a,selectedChannelId:o,selectedVoiceChannelId:d,optInEnabled:c}=e,{hasDivider:h,canHaveVoiceSummary:A}=r.useMemo(()=>nA(n,c,t),[n,c,t,l]),g=r.useMemo(()=>t===t_.PU?null:n.getCategoryFromSection(t),[n,t,l]),m=(0,M.jN)(a),{enableWaveformIcon:f}=(0,nc.b)(a,"ChannelListSectionFooter"),p=(0,u.yK)([w.Ay],()=>{if(null==g||!g.isCollapsed||!A)return[];let e=g.getChannelRecords(),t=[];for(let n of e){if(!n.isGuildVocal())continue;let e=w.Ay.isChannelOrParentOptedIn(a,n.id);(!m||e)&&t.push(n)}return t},[g,A,a,m]),C=r.useMemo(()=>(0,nh.fK)({channels:p,selectedChannelId:o,selectedVoiceChannelId:d,voiceStates:i}),[p,o,d,i]);if(t===n.voiceChannelsSectionNumber)return(0,s.jsx)(ng,{guildChannels:n,guildChannelsVersion:l});let E=h?(0,s.jsx)("div",{className:na.ts}):null;return A&&0!==C.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:na.qz,children:(0,s.jsx)(nd.Ay,{renderIcon:!0,users:C,max:8,showUserPopout:!0,guildId:a,renderLeadingIcon:f?e=>(0,s.jsx)(nu.A,{color:"currentColor",className:eH()(e,ep.Gj)}):void 0})}),E]}):E});var nf=n(625903),np=n(283973),nC=n(933832),nE=n(435183),nx=n(698441),nN=n(855687),n_=n(816662),nI=n(446600),nS=n(616356);function nb(e,t,n){return null!=t&&!!t&&!F(n,e.type)}function nG(e,t){return null==t?ep.fx:e>t?ep.mU:ep.TR}function nj(e){let{channel:t,disableManageChannels:n,tabIndex:l,forceShowButtons:i,hasChannelInfo:r=!1}=e;return(0,u.bG)([P.A,V.A],()=>n||(0,R.ai)(V.A.getGuildId())||!P.A.can(k.xBc.MANAGE_CHANNELS,t)&&!P.A.can(k.xBc.MANAGE_ROLES,t)&&!P.A.can(k.xBc.MANAGE_WEBHOOKS,t)||(0,H.tr)(t.type)&&!P.A.can(k.xBc.VIEW_CHANNEL,t)||t.isGuildVocal()&&!P.A.can(k.xBc.CONNECT,t)||!H.bk.has(t.type)||t.isModeratorReportChannel())?null:(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t["3gUsJb"]),children:(0,s.jsx)(es.D,{className:eH()(ep.Xs,i?ep.Tf:void 0,r?ep.bw:ep.UI),onClick:function(){nE.Ay.open(t.id)},tabIndex:l,"aria-label":em.intl.string(em.t["3gUsJb"]),children:(0,s.jsx)(nf.SettingsIcon,{size:"xs",color:"currentColor",className:ep.gE})})})}function nv(e){let{channel:t,isDefaultChannel:l=!1,locked:i,tabIndex:a,forceShowButtons:o,hasChannelInfo:d=!1}=e,c=(0,u.bG)([O.A],()=>O.A.getGuild(t.getGuildId())),h=(0,u.bG)([nI.A],()=>nI.A.getStageInstanceByChannel(t.id),[t.id]),A=(0,u.bG)([nx.Ay],()=>nx.Ay.getActiveEventByChannel(t.id),[t.id]),g=(0,u.bG)([P.A],()=>(0,nN.K)(P.A,c,t,h)),m=(0,u.bG)([],()=>t?.type===k.rbe.GUILD_VOICE?em.intl.string(em.t["EE+P0H"]):em.intl.string(em.t["0jeAXt"])),f=r.useRef(null);if(i||!g||t.isModeratorReportChannel()||t.isThread())return null;let p=(0,s.jsx)(np.R,{size:"xs",className:ep.gE,"aria-hidden":!0,color:"currentColor"});return l&&(p=(0,s.jsx)(ni.A,{childRef:f,tutorialId:"instant-invite",position:"left",children:(0,s.jsx)("div",{ref:f,children:p})})),(0,s.jsx)(ei.m,{asContainer:!0,text:m,children:(0,s.jsx)(es.D,{className:eH()(ep.Xs,o?ep.Tf:void 0,d?ep.bw:ep.UI),onClick:function(){if(null!=c){let e=nS.A.getAllActiveStreams().filter(e=>e.state!==k.XYD.ENDED&&e.channelId===t.id);(0,I.openModalLazy)(async()=>{let{default:l}=await Promise.all([n.e("683621"),n.e("711162"),n.e("159957"),n.e("728136"),n.e("216084"),n.e("22547")]).then(n.bind(n,1310));return n=>(0,s.jsx)(l,{...n,guild:c,channel:t,streamUserId:1===e.length?e[0].ownerId:null,source:k.PE1.GUILD_CHANNELS,guildScheduledEvent:A})})}},tabIndex:a,"aria-label":m,children:p})})}function nR(e){let{channel:t}=e;return(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t["ROh4T+"]),children:(0,s.jsx)(es.D,{className:ep.Xs,onClick:function(){(0,n_.Ol)(t.guild_id,t.id)},"aria-label":em.intl.string(em.t["ROh4T+"]),children:(0,s.jsx)(er.P,{size:"xs",color:"currentColor",className:ep.gE})})})}function ny(e){let{channel:t}=e;return(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t["N2c/Un"]),children:(0,s.jsx)(es.D,{className:ep.Xs,onClick:function(){(0,n_.jA)(t.guild_id,t.id,!0,{section:k.JJy.CHANNEL_LIST})},"aria-label":em.intl.string(em.t["N2c/Un"]),children:(0,s.jsx)(nC.CheckmarkLargeIcon,{size:"xs",color:"currentColor",className:ep.gE})})})}class nM extends r.PureComponent{static defaultProps={isDefaultChannel:!1};renderEditButton(){return(0,s.jsx)(nj,{...this.props})}renderInviteButton(){return(0,s.jsx)(nv,{...this.props})}renderRemoveSuggestionButton(){return(0,s.jsx)(nR,{...this.props})}renderAcceptSuggestionButton(){return(0,s.jsx)(ny,{...this.props})}getClassName(){let{position:e,sortingPosition:t}=this.props;return nG(e,t)}isDisabled(){let{channel:e,sorting:t,sortingType:n}=this.props;return nb(e,t,n)}}var nL=n(166444),nT=n(790782);let nU=$(function(e){let{guild:t,selectedChannelId:l,position:i,disableManageChannels:a,sorting:o,sortingType:d,sortingPosition:c,connectChannelDragSource:h,connectChannelDropTarget:A,tabIndex:g}=e,m=(0,u.bG)([T.A,D.Ay],()=>{let e=D.Ay.getDirectoryChannelIds(t.id);return 0===e.length?null:T.A.getChannel(e[0])}),f=(0,u.bG)([T.A],()=>T.A.getChannel(m?.parent_id)),p=l===m?.id,C=(0,tQ.Ay)(m),E=(0,u.bG)([P.A],()=>null!=f?P.A.can(k.xBc.MANAGE_CHANNELS,f):null!=t&&P.A.can(k.xBc.MANAGE_CHANNELS,t)),x=r.useCallback(e=>{null!=m&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("430997"),n.e("379995"),n.e("729559")]).then(n.bind(n,994058));return t=>(0,s.jsx)(e,{...t,channel:m})})},[m]);if(null==m)return null;let N=nG(i,c),_=nb(m,o,d),I=(0,s.jsx)("div",{className:eH()(N,{[ep.r9]:_,[ep.wH]:p}),"data-dnd-name":C,children:(0,s.jsxs)(nL.Ay,{className:ep.Ki,channel:m,guild:t,selected:p,onContextMenu:x,forceInteractable:!0,resolvedUnreadSetting:nT.e.ONLY_MENTIONS,children:[(0,s.jsx)(nv,{channel:m,tabIndex:g}),(0,s.jsx)(nj,{channel:m,disableManageChannels:a,tabIndex:g})]})});return E&&(I=A(h(I))),I});var nD=n(34188),nO=n(733391),nP=n(832163),nV=n(31969),nw=n(44724),nH=n(849134),nB=n(770178),nk=n(307076);let nF=Math.ceil(Math.sqrt(115200)),nK=(nF-240)/2,nz=r.forwardRef(function(e,t){let{children:n}=e,[l,i]=r.useState(-1),a=r.useCallback(e=>{i(e.contentRect.width)},[]),o=(0,nB.w)(a,[],{fireOnMount:!0}),[{shineSpring:d},c]=(0,e9.z)(()=>({from:{shineSpring:0},config:{clamp:!0,mass:1,tension:170,friction:38}})),u=r.useCallback((e,t)=>{c({shineSpring:1,delay:t,reset:!0,loop:{reset:!0,delay:1600}})},[c]),h=r.useCallback(()=>{c({shineSpring:0,immediate:!0,loop:!1})},[c]),A=r.useMemo(()=>n((0,s.jsx)(e3.animated.div,{className:nk.q,style:{transform:d.to(e=>`translateX(calc(${e*l}px + ${e*nF}px)) translateY(-50%) rotate(45deg)`)}})),[n,l,d]);return r.useImperativeHandle(t,()=>({onMouseEnter:u,onMouseLeave:h}),[u,h]),(0,s.jsx)("div",{className:nk.i,onMouseEnter:u,onMouseLeave:h,onFocus:u,onBlur:h,ref:o,style:{"--custom-shine-dimensions":"240px","--custom-shine-rotated-dimensions-delta":`${nK}px`},children:A})});var nW=n(371794),nY=n(240248),nX=n(998218),nq=n(672812),nZ=n(427797);let nJ=r.memo(function(e){let{guild:t,selected:l}=e,i=r.useRef(null),a=r.useRef(null),o=(0,I.useHasAnyModalOpen)(),d=(0,u.bG)([eN.A],()=>eN.A.hasLayers()),c=(0,eE.xr)(e=>e.fullScreenLayers.length>0);r.useEffect(()=>{(0,nO.Kh)(t.id)},[t.id]);let A=(0,u.bG)([nP.A],()=>nP.A.getAnnouncement(t.id)),g=A?.state==="success"?A.announcement:void 0,[m,f]=(0,ed.x_)(el.M.GAME_SHOP_NEW_BADGE,t.id,g?.id??"",void 0,!0),p=m===el.M.GAME_SHOP_NEW_BADGE&&null!=g,C=(0,tB.nY)(t.id),E=(0,nV.F)("storefront_badge",{applicationId:C}),x=null;p&&(x=em.intl.string(em.t.y2b7CA)),null!=E&&(x=E.text);let[N,_]=(0,ed.x_)(el.M.GAME_SHOP_NEW_DROP_POPOVER,t.id,g?.id??""),S=N===el.M.GAME_SHOP_NEW_DROP_POPOVER&&null!=g;r.useEffect(()=>{l&&(p&&f(eA.i.INDIRECT_ACTION),S&&_(eA.i.INDIRECT_ACTION))},[f,_,l,p,S]);let b=r.useCallback(()=>{f(eA.i.TAKE_ACTION),_(eA.i.TAKE_ACTION);let e=(0,tB.mq)(t.id),n=nP.A.getStorefrontState(e)?.activePage??0;(0,eu.pX)(k.BVt.CHANNELS_GAME_SHOP(t.id,n))},[t.id,f,_]),G=r.useCallback(()=>{(0,nw.X)({guildId:t.id,forceFetch:S})},[t.id,S]),j=r.useCallback(()=>{_(eA.i.USER_DISMISS)},[_]),v=r.useCallback(e=>{null!=t&&(0,e5.L3)(e,async()=>{let{default:e}=await n.e("899523").then(n.bind(n,41614));return n=>(0,s.jsx)(e,{...n,guild:t})})},[t]),R=r.useCallback(()=>{i.current?.onMouseEnter(null,500)},[i]),y=r.useCallback(e=>(0,s.jsx)(ec.G,{background:(0,s.jsx)("div",{className:nZ.D}),innerClassName:nZ.Z,ref:a,id:`game-shop-${t.id}`,renderIcon:e=>(0,s.jsx)(nD.U,{size:"custom",color:"currentColor",width:20,height:20,className:e}),text:(0,s.jsx)(e2.E,{variant:"text-md/medium",className:nq.UU,children:em.intl.string(em.t.vyaWs7)}),selected:l,onMouseDown:G,onClick:b,onContextMenu:v,trailing:(0,s.jsxs)(s.Fragment,{children:[null!=x&&(0,s.jsx)(ea.Lp,{text:x,color:h.A.colors.BACKGROUND_BRAND.css}),e]})}),[t.id,l,G,b,v,x]),M=r.useMemo(()=>{if(null==g)return null;switch(g.type){case"guild-application-announcement":{let e=null!=g.assetId?nX.A.toURLSafe((0,nW.YE)(g.applicationId,g.assetId,256,"webp")):void 0,t=null!=g.backgroundImageAssetId?nX.A.toURLSafe((0,nW.YE)(g.applicationId,g.backgroundImageAssetId,256,"webp")):void 0;if(null==e)return null;return{graphicSource:{type:"sku",imageUrl:e,backgroundImageUrl:t},title:em.intl.string(em.t["7PvvS9"]),body:em.intl.formatToPlainString(em.t["9J4h1a"],{applicationName:g.applicationName})}}case"guild-discord-announcement":{let{videoAssetFullyQualifiedURL:e,assetFullyQualifiedURL:t}=g;if((0,nY.uJ)(e)&&(0,nY.uJ)(t))return null;return{graphicSource:(0,nY.uJ)(e)?{type:"asset",src:t}:{type:"video",src:e},title:g.popoverTitle,body:g.popoverBody,actionLabel:g.popoverCta}}default:return null}},[g]),L=r.useCallback(()=>S&&null!=M?(0,s.jsx)(nH.A,{onActionClick:b,onActionMouseDown:G,onRender:R,onRequestClose:j,targetElementRef:a,...M}):null,[S,M,b,G,R,j]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nz,{ref:i,children:y}),!o&&!d&&!c&&L()]})});var n$=n(740426),nQ=n(826673),n0=n(591552),n1=n(202776),n3=n(454058),n2=n(573163);function n9(e){let{guild:t,selected:l}=e,i=(0,n1.A)(t),a=(0,nQ.HX)(el.M.CHANNEL_BROWSER_NEW_BADGE_NUX),o=(0,tb.yK)([n3.A],()=>Array.from(n3.A.getNewChannelIds(t.id)).filter(e=>n3.A.shouldIndicateNewChannel(t.id,e))),d=(0,tb.bG)([n2.Ay],()=>n2.Ay.hasUnread(t.id,nT.P.GUILD_ONBOARDING_QUESTION)),c=o.length>t_.rR,u=(0,tb.bG)([n0.A,n2.Ay],()=>{let e=n0.A.lastFetchedAt(t.id),n=n2.Ay.lastMessageId(t.id,nT.P.GUILD_ONBOARDING_QUESTION);if(null==n)return!1;let l=tg.default.extractTimestamp(n);return null!=e&&e>l}),A=r.useCallback(()=>{(0,eu.pX)(k.BVt.CHANNEL(t.id,i?eh.VV.CUSTOMIZE_COMMUNITY:eh.VV.CHANNEL_BROWSER))},[t.id,i]),g=r.useCallback(e=>{(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("113446"),n.e("317699"),n.e("830412")]).then(n.bind(n,807431));return n=>(0,s.jsx)(e,{...n,guild:t})})},[t]),m=null;return a&&!d&&!c||l||u||(m=(0,s.jsx)(ea.Lp,{color:h.A.colors.BADGE_BACKGROUND_BRAND.css,text:em.intl.string(em.t.y2b7CA)})),(0,s.jsx)(ec.G,{id:`channels-${t.id}`,renderIcon:e=>(0,s.jsx)(n$.k,{size:"md",color:"currentColor",className:e}),text:i?em.intl.string(em.t.h9mGOP):em.intl.string(em.t.et6wav),selected:l,onClick:A,onContextMenu:g,trailing:m})}var n5=n(855473);function n7(e){let{guild:t,selected:n}=e;return(0,s.jsx)(ec.G,{id:`home-tab-${t.id}`,renderIcon:e=>(0,s.jsx)(n5.Z,{size:"md",color:"currentColor",className:e}),text:em.intl.string(em.t.VbpLyU),selected:n,onClick:function(){(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.GUILD_HOME))}})}var n6=n(297264),n4=n(5373),n8=n(65995),le=n(195702);function lt(e,t){return(0,s.jsx)(e2.E,{variant:"text-xs/bold",color:"text-default",children:e},t)}let ln=r.memo(function(e){let{guild:t}=e,n=(0,u.bG)([tM.h],()=>tM.h.getNewMemberActions(t.id),[t.id]),l=(0,u.bG)([n8.A],()=>n8.A.getCompletedActions(t.id)),i=r.useMemo(()=>{if(null==n||null==l)return 0;let e=0;return n.forEach(t=>{null!=l[t.channelId]&&e++}),e},[l,n]),a=null==n?0:n.length,o=(0,d.rm)(`progress-bar-${t.id}`);return(0,s.jsxs)("li",{children:[(0,s.jsxs)(es.D,{...o,role:"button",focusProps:{offset:{right:4}},className:le.G9,onClick:function(){(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.GUILD_HOME))},children:[(0,s.jsxs)("div",{className:le.A1,children:[(0,s.jsx)(n6.D,{variant:"heading-sm/bold",children:em.intl.string(em.t.SnrR3x)}),(0,s.jsxs)("div",{className:le.Ib,children:[(0,s.jsx)(e2.E,{variant:"text-xs/medium",color:"text-muted",className:le.Cv,children:em.intl.format(em.t.eqZ1lW,{numberHook:lt,total:a.toString(),completed:i.toString()})}),(0,s.jsx)(tt.A,{className:le.UE,width:16,height:16,direction:tt.A.Directions.RIGHT})]})]}),(0,s.jsx)(n4.i,{className:le.hr,foregroundGradientColor:[h.A.unsafe_rawColors.GREEN_300.css,h.A.unsafe_rawColors.GREEN_230.css],percent:i/a*100+3,animate:!0})]}),(0,s.jsx)("div",{role:"separator",className:le.yF})]})});var ll=n(581925);function li(e){let{guild:t,selected:n}=e;return(0,s.jsx)(ec.G,{id:`official-messages-page-${t.id}`,renderIcon:e=>(0,s.jsx)(ll.L,{size:"md",color:"currentColor",className:e}),text:em.intl.string(em.t.xHEzFh),selected:n,onClick:function(){(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.GUILD_OFFICIAL_MESSAGES))}})}var ls=n(514179);function lr(e){let{guild:t,selected:l}=e;return(0,s.jsx)(ec.G,{id:`subscriptions-${t.id}`,renderIcon:e=>(0,s.jsx)(ls.A,{className:e}),text:em.intl.string(em.t["KzCF/6"]),selected:l,onClick:function(){(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.ROLE_SUBSCRIPTIONS))},onContextMenu:function(e){null!=t&&(0,e5.L3)(e,async()=>{let{default:e}=await n.e("571911").then(n.bind(n,978554));return n=>(0,s.jsx)(e,{...n,guild:t})})}})}var la=n(506774),lo=n(95561),ld=n(289397),lc=n(486418),lu=n(575926),lh=n(440293),lA=n(174459),lg=n(634654),lm=n(888918);function lf(e){let{guildId:t,selected:n,handleClick:l}=e,i=(0,lh.w)(t),r=(0,tb.bG)([O.A],()=>O.A.getGuild(t)),a=r?.features.has(k.GuildFeatures.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE)===!0,o="false"===la.w.get(lg.bJ,"false"),d=(0,tb.bG)([Q.Ay],()=>Q.Ay.useReducedMotion);return(0,s.jsx)(ec.G,{id:`shop-${t}`,className:eH()(lm.A2,{[lm.wH]:n,[lm.ST]:o}),innerClassName:lm.LE,renderIcon:e=>(0,s.jsx)(lu.h,{width:20,height:20,className:eH()([e,lm.sV])}),text:em.intl.string(em.t.al5EXL),selected:n,onClick:l,trailing:(0,s.jsxs)("div",{className:lm.ai,children:[d?(0,s.jsx)(ea.Lp,{color:h.A.unsafe_rawColors.BRAND_260.css,text:em.intl.string(em.t.y2b7CA),className:lm.Ad}):(0,s.jsx)("img",{src:(0,ld.n)("server_products/storefront/money.gif"),className:lm.TG,alt:""}),n&&(0,s.jsx)(es.D,{className:lm.b,onClick:function(e){e.stopPropagation(),(0,nQ.Dr)(el.M.SERVER_SHOP_PHANTOM_PREVIEW),lA.default.track(k.HAw.GUILD_SHOP_PREVIEW_CLICK,{...(0,lo.H$)(t),action_taken:lg.hN.DISMISS_CHANNEL_ROW}),i&&a||(0,eu.bG)(k.BVt.CHANNEL(t,D.Ay.getDefaultChannel(t)?.id))},"aria-label":em.intl.string(em.t.cpT0Cq),children:(0,s.jsx)(tZ.a,{size:"xs",color:"currentColor"})})]})})}function lp(e){let{guild:t,selected:l}=e;function i(){la.w.set(lg.bJ,"true"),(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.GUILD_SHOP))}return(0,lc.P)(t)?(0,s.jsx)(lf,{guildId:t.id,selected:l,handleClick:i}):(0,s.jsx)(ec.G,{id:`shop-${t.id}`,renderIcon:e=>(0,s.jsx)(lu.h,{width:20,height:20,className:e}),text:em.intl.string(em.t.al5EXL),selected:l,onClick:i,onContextMenu:function(e){null!=t&&(0,e5.L3)(e,async()=>{let{default:e}=await n.e("852565").then(n.bind(n,345332));return n=>(0,s.jsx)(e,{...n,guild:t})})}})}var lC=n(308528),lE=n(534890),lx=n(262763),lN=n(499211),l_=n(406704),lI=n(747926),lS=n(977997),lb=n(807632),lG=n(37411);function lj(e){let{thread:t,tabIndex:n}=e,l=(0,lb.YG)(t),i=(0,lb.IO)(t),r=(0,l_._M)(t);return l&&i&&r?(0,s.jsx)(lv,{thread:t,tabIndex:n}):null}function lv(e){let{thread:t,tabIndex:n}=e,l=(0,u.bG)([lS.A],()=>lS.A.isInChannel(t.id),[t.id]),{needSubscriptionToAccess:i}=(0,lN.A)(t.id),a=r.useCallback(()=>{lx.A.handleVoiceConnect({channel:t,connected:l,needSubscriptionToAccess:i,locked:!1})},[t,l,i]),o=r.useCallback(()=>{(0,lI.JA)(t,!0,lG.H9.CHANNEL_LIST)},[t]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t["96ANUN"]),children:(0,s.jsx)(es.D,{className:ep.Xs,onClick:a,tabIndex:n,"aria-label":em.intl.string(em.t["96ANUN"]),children:(0,s.jsx)(tJ.H,{size:"xs",color:"currentColor",className:ep.gE})})}),(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(es.D,{className:ep.Xs,onClick:o,tabIndex:n,"aria-label":em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(lE.ChatIcon,{size:"xs",color:"currentColor",className:ep.gE})})})]})}var lR=n(897898),ly=n(152007);function lM(e){return null!=e&&e>0}var lL=n(405018),lT=n(428689),lU=n(525093);function lD(e){let{total:t,users:n,videoLimit:l}=e;return(0,s.jsxs)("div",{className:lU.iE,children:[(0,s.jsxs)(e2.E,{tag:"span",color:"text-subtle",variant:"text-xs/medium",className:eH()(lU.VV,{[lU.Ki]:l,[lU.$G]:n>=100}),children:[l?(0,s.jsx)(lT.VideoIcon,{size:"md",color:"currentColor",className:lU.LB}):null,n.toString().padStart(2,"0")]}),(0,s.jsx)(e2.E,{tag:"span",color:"text-subtle",variant:"text-xs/medium",className:eH()(lU.X5,{[lU.$G]:t>=100}),children:t.toString().padStart(2,"0")})]})}function lO(e){let{channel:t,video:n,userCount:l}=e,{limit:i}=(0,lL.A)(t),r=-1,a=!1;return t.userLimit>0&&(r=t.userLimit),n&&i>0&&(a=r<0||i<r,r=r>0?Math.min(r,i):i),(0,s.jsx)(lD,{users:l,total:r,videoLimit:a})}var lP=n(146630);function lV(e){let{mentionsCount:t,isMentionLowImportance:n}=e;return(0,s.jsx)("div",{className:lP.R,"aria-hidden":!0,children:(0,s.jsx)(ea.hV,{count:t,color:n?h.A.colors.BACKGROUND_MOD_STRONG.css:h.A.colors.BACKGROUND_FEEDBACK_NOTIFICATION.css})})}var lw=n(588224),lH=n(447199);function lB(e){let{thread:t,countInVoice:n,hasVideo:l,mentionCount:i,isMentionLowImportance:r}=e,a=n>0&&t.userLimit>0,o=lM(i);return a||o?(0,s.jsxs)("div",{className:ep.yW,children:[a?(0,s.jsx)(lO,{userCount:n,video:l,channel:t}):null,o?(0,s.jsx)(lV,{mentionsCount:i,isMentionLowImportance:r}):null]}):null}function lk(e){let{style:t,withGuildIcon:n,inverted:l}=e,i={className:eH()(lH.GI,{[lH.a7]:n},{[lH.BJ]:l}),style:t},{density:r}=(0,C.wR)();switch(r){case"cozy":return(0,s.jsxs)("svg",{...i,width:"10",height:"20",viewBox:"0 0 10 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M0 15H2c0 1.6569 1.3432 3 3 3v2c-2.7614 0-5-2.2386-5-7ZM0 4H2V15H0V4ZM2 4H0C0 3.4477.4477 3 1 3c.5523 0 1 .4477 1 1Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M6 20V18H9v2H6Zm3 0V18s1 0 1 1-1 1-.989 1.004ZM6 18v2H5V18H6Z",fill:"currentColor"})]});case"compact":return(0,s.jsxs)("svg",{...i,width:"10",height:"19",viewBox:"0 0 10 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M0 11H2c0 1.6569 1.3432 3 3 3v2c-2.7614 0-5-2.2386-5-7ZM0 0H2V11H0V0ZM2 0H0C0-.5523.4477-1 1-1c.5523 0 1 .4477 1 1Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M6 16V14H9v2H6Zm3 0V14s1 0 1 1-1 1-.989 1.004ZM6 14v2H5V14H6Z",fill:"currentColor"})]});default:return(0,s.jsxs)("svg",{...i,width:"10",height:"19",viewBox:"0 0 10 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M0 13H2c0 1.6569 1.3432 3 3 3v2c-2.7614 0-5-2.2386-5-7ZM0 2H2V13H0V2ZM2 2H0C0 1.4477.4477 1 1 1c.5523 0 1 .4477 1 1Z",fill:"currentColor"}),(0,s.jsx)("path",{d:"M6 18V16H9v2H6Zm3 0V16s1 0 1 1-1 1-.989 1.004ZM6 16v2H5V16H6Z",fill:"currentColor"})]})}}let lF=r.memo(function(e){let{thread:t,isSelectedChannel:l,isSelectedVoice:i,isLast:a,withGuildIcon:o}=e,c=(0,u.bG)([tu.Ay],()=>tu.Ay.getVoiceStatesForChannel(t),[t]),h=(0,u.bG)([lS.A],()=>lS.A.hasVideo(t.id)),{unread:A,mentionCount:g,isMentionLowImportance:m}=(0,u.cf)([n2.Ay],()=>({unread:n2.Ay.hasUnread(t.id),mentionCount:n2.Ay.getMentionCount(t.id),isMentionLowImportance:n2.Ay.getIsMentionLowImportance(t.id)})),f=(0,u.bG)([ly.A],()=>ly.A.isMuted(t.id)),p=r.useCallback(e=>{(0,lI.JA)(t,!e.shiftKey,lG.H9.CHANNEL_LIST)},[t]),C=r.useCallback(()=>{lC.A.preload(t.guild_id,t.id)},[t.guild_id,t.id]),E=r.useCallback(e=>{(0,lR.A)(e,t)},[t]),x=r.useCallback(e=>{let l=T.A.getChannel(t.id);null!=l&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("393336"),n.e("391763"),n.e("955557"),n.e("691671"),n.e("603998"),n.e("947502"),n.e("343266"),n.e("965789"),n.e("412255"),n.e("896804"),n.e("63340"),n.e("65200"),n.e("285802"),n.e("703869"),n.e("51212"),n.e("584615")]).then(n.bind(n,612826));return t=>(0,s.jsx)(e,{...t,channel:l})})},[t.id]),N=null==c?0:c.length,{role:_,...I}=(0,d.rm)(t.id),S=r.useRef(null),b=g>0?em.intl.formatToPlainString(em.t["ZL7+I6"],{channelName:t.name,mentionCount:g}):A?em.intl.formatToPlainString(em.t.YlVvmc,{channelName:t.name}):em.intl.formatToPlainString(em.t["0nZpiF"],{channelName:t.name});return(0,s.jsxs)("li",{role:_,className:eH()(ep.fx,{[ep.wH]:l}),children:[(0,s.jsx)(lk,{withGuildIcon:o}),a?null:(0,s.jsx)(lk,{withGuildIcon:o,inverted:!0,style:{transform:"rotateX(180deg) translateY(-9px)"}}),(0,s.jsx)(tY.vN,{focusTarget:S,ringTarget:S,offset:{top:2,bottom:2,right:4},children:(0,s.jsxs)("div",{className:eH()(ep.Ki,nq.iE,nq.ZS,{[nq.J1]:l,[nq.F4]:!l&&f,[nq.V2]:!f&&!l&&A,[nq.lY]:o}),onMouseDown:C,onContextMenu:x,children:[!A||f||l?null:(0,s.jsx)("div",{className:eH()(nq.gy,nq.WS)}),(0,s.jsx)(es.D,{...I,innerRef:S,className:nq.nf,onClick:p,onAuxClick:E,"aria-label":b,focusProps:{enabled:!1},children:(0,s.jsxs)("div",{className:eH()(nq.Y5,nq.__invalid_threadMainContent),children:[(0,s.jsx)(tK.A,{className:nq.UU,"aria-hidden":!0,children:(0,s.jsx)(e2.E,{variant:"text-sm/medium",color:"none",children:t.name})}),(0,s.jsxs)("div",{className:nq.Y_,onClick:nL.dG,onKeyDown:nL.dG,children:[(0,s.jsx)(lB,{thread:t,countInVoice:N,hasVideo:h,mentionCount:g,isMentionLowImportance:m}),(0,s.jsx)(lj,{thread:t,tabIndex:I.tabIndex})]})]})})]})}),(0,s.jsx)(lw.A,{channel:t,collapsed:!i&&1!==c.length,collapsedMax:6,voiceStates:c,isThread:!0})]})}),lK=r.memo(function(e){let{channel:t,selectedChannel:n,selectedVoiceChannelId:l,sortedThreadIds:i,withGuildIcon:r}=e,a=(0,tQ.Ay)(t),{density:o}=(0,C.wR)(),d=(0,u.yK)([T.A],()=>i.map(e=>T.A.getChannel(e)).filter(th.Vq),[i]),c=(0,u.bG)([tu.Ay],()=>{let e=d[d.length-1];if(null==e)return 0;let t=tu.Ay.getVoiceStates(e.guild_id)[e.id];return null==t||0===t.length?0:l!==e.id?40:32*t.length+8});return(0,s.jsx)("li",{className:lH.kL,children:(0,s.jsxs)("ul",{role:"group","aria-label":em.intl.formatToPlainString(em.t.EiyIi6,{channelName:a}),children:[(0,s.jsx)("div",{className:eH()(lH.eh,{[lH.ET]:r}),style:{bottom:("cozy"===o?28:24)+c}}),d.map((e,t)=>(0,s.jsx)(lF,{thread:e,isSelectedChannel:n?.id===e.id,isSelectedVoice:l===e.id,isLast:t===d.length-1,withGuildIcon:r},e.id))]})})});var lz=n(922016),lW=n(367513),lY=n(296216),lX=n(963027),lq=n(202384),lZ=n(51758),lJ=n(139033),l$=n(305866),lQ=n(123292),l0=n(830215),l1=n(315982),l3=n(480900),l2=n(557722),l9=n(834942),l5=n(287809),l7=n(53516),l6=n(648580),l4=((l={})[l.VOICE=0]="VOICE",l);let l8=function(e){let{type:t,guildId:l,closePopout:i}=e,r=(0,en.GV)(),a=(0,u.bG)([l9.A],()=>l9.A.getCheck(l),[l]),{notClaimed:o,notEmailVerified:d,notPhoneVerified:c,missingVerificationRole:h,verificationRole:A}=a,{header:g,body:m,buttonText:f}=function(e,t){if(0!==e)return{header:null,body:null,buttonText:null};{let e=em.intl.string(em.t["6zY8BI"]),{notClaimed:n,notPhoneVerified:l,notEmailVerified:i,newMember:s,newAccount:r,missingVerificationRole:a,verificationRole:o}=t;return n?{header:e,body:em.intl.string(em.t.IRxUlG),buttonText:em.intl.string(em.t.fiNVin)}:l?{header:e,body:em.intl.string(em.t.vW8iUF),buttonText:em.intl.string(em.t["50gfOv"])}:i?{header:e,body:em.intl.string(em.t.vdSOpz),buttonText:em.intl.string(em.t.lm1UKt)}:s?{header:e,body:em.intl.formatToPlainString(em.t.v1ktYb,{min:k.$8o.MEMBER_AGE}),buttonText:em.intl.string(em.t.BddRzS)}:r?{header:e,body:em.intl.formatToPlainString(em.t.sncw41,{min:k.$8o.ACCOUNT_AGE}),buttonText:em.intl.string(em.t.BddRzS)}:a&&null!=o&&null===o.tags.guild_connections?{header:e,body:em.intl.format(em.t.MZbCuG,{roleName:`@${o.name}`}),buttonText:em.intl.string(em.t["6Ge2LG"])}:{header:e,body:null,buttonText:null}}}(t,a);return null==g||null==m?null:(0,s.jsxs)(l$.l,{className:l6.kL,"aria-labelledby":r,children:[(0,s.jsx)("img",{alt:"",className:l6.Sl,src:n(303528)}),(0,s.jsxs)("div",{className:l6.Qs,children:[(0,s.jsx)(n6.D,{variant:"heading-md/semibold",id:r,children:g}),(0,s.jsx)(e2.E,{color:"text-default",variant:"text-sm/normal",children:m}),(0,s.jsxs)("div",{className:l6.UD,children:[null!=f?(0,s.jsx)("div",{"data-button-hoisted-classname-wrapper":!0,className:l6.FS,children:(0,s.jsx)(tz.$,{variant:"primary",text:f,onClick:function(){o?l1.R():c?(0,I.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("590275"),n.e("766806"),n.e("14775"),n.e("989545"),n.e("991531"),n.e("311493"),n.e("84704")]).then(n.bind(n,615715));return t=>(0,s.jsx)(e,{reason:l2.d.GUILD_PHONE_REQUIRED,...t})},{modalKey:l7.V}):d?(l0.A.verifyResend(),(0,lJ.A)({title:em.intl.string(em.t.LykQYk),subtitle:em.intl.format(em.t.azKEPy,{email:l5.default.getCurrentUser()?.email})})):h&&null!=A&&(0,l3.b)(A,l),i()}})}):null,o||c||d?(0,s.jsx)(lQ.Q,{onClick:i,text:em.intl.string(em.t.oEAioF),variant:"secondary"}):null]})]})]})};var ie=n(824865),it=n(378570),il=n(790535),ii=n(113783),is=n(96566),ir=n(280450),ia=n(312006),io=n(505543),id=n(994500),ic=n(685399),iu=n(475889),ih=n(693879),iA=n(435470),ig=n(35275),im=n(300596);function ip(e){let{locked:t}=e;return(0,s.jsx)("div",{className:eH()(ep.Xs,im.U),children:(0,s.jsx)(ig.A,{className:ep.gE,color:t?h.A.colors.CREATOR_REVENUE_LOCKED_CHANNEL_ICON.css:void 0})})}var iC=n(863005),iE=n(669715),ix=n(769015),iN=n(217223);function i_(e){let{className:t,embeddedApps:n,muted:l}=e;if(n.length<=0)return null;{if(1===n.length)return(0,s.jsx)("div",{className:eH()(iN.kL,t,l&&iN.F4),children:(0,s.jsx)(ix.A,{game:n[0].application,className:iN.wK})});let e=n.length-1;return(0,s.jsxs)("div",{className:eH()(iN.kL,t,l&&iN.F4),children:[(0,s.jsx)(ix.A,{game:n[0].application,className:iN.wK}),2===n.length?(0,s.jsx)(ix.A,{game:n[1].application,className:iN.wK}):(0,s.jsx)(e2.E,{className:iN.ju,variant:"text-xs/bold",color:"interactive-text-active",children:`+${e}`})]})}}var iI=n(905695);function iS(e){let{channel:t,isChannelSelected:n,isChannelCollapsed:l,voiceStates:i,enableConnectedUserLimit:r,enableActivities:a,isSubscriptionGated:o,needSubscriptionToAccess:d,isNewChannel:c,muted:A,resolvedUnreadSetting:g}=e,m=(0,u.bG)([n2.Ay],()=>n2.Ay.getMentionCount(t.id)),f=(0,u.bG)([n2.Ay],()=>n2.Ay.getIsMentionLowImportance(t.id)),p=(0,ic.Ay)(t),C=(0,u.bG)([P.A],()=>!P.A.can(k.xBc.CONNECT,t)),E=(0,iu.H)(t),x=(0,u.bG)([lS.A],()=>lS.A.hasVideo(t.id)),N=(0,is.qT)(t.id)&&t.isGuildStageVoice(),_=function(e){let{channel:t,locked:n,video:l,selected:i}=e;return function(e){let{channel:t,video:n,considerMaxStageVoiceUserLimit:l=!0}=e,{limit:i}=(0,lL.A)(t),s=-1;return(t.userLimit>0&&(s=t.userLimit),n&&i>0&&(s=s>0?Math.min(s,i):i),l&&s===k.RCc)?0:s}({channel:t,video:l})>0&&!n&&!i}({channel:t,locked:C,video:(x||N)&&null==E,selected:n}),I=(0,u.bG)([iC.A],()=>iC.A.getNewThreadCount(t.guild_id,t.id)),S=(0,iA.ed)(t.guild_id,t.id),b=(0,u.bG)([O.A],()=>O.A.getGuild(t.guild_id)?.features.has(k.GuildFeatures.COMMUNITY)??!1);if(lM(m))return(0,s.jsx)(lV,{mentionsCount:m,isMentionLowImportance:f});if(o)return(0,s.jsx)(ip,{locked:d});if(c)return(0,s.jsx)(ea.Lp,{text:em.intl.string(em.t.y2b7CA),color:h.A.colors.BADGE_BACKGROUND_BRAND.css});if(!A&&g===nT.e.ALL_MESSAGES&&t.isForumLikeChannel()&&null!=I&&I>0)return(0,s.jsx)(e2.E,{variant:"text-xs/semibold",color:"text-brand",className:iI.O,children:em.intl.format(em.t.GkAbqY,{count:(0,ea.Gu)(I)})});if(!A&&t.isForumLikeChannel()&&null!=S&&S>0)return(0,s.jsx)(e2.E,{variant:"text-xs/semibold",color:"text-muted",children:(0,ea.Gu)(S)});let G=i?.length??0;return null!=r&&r&&_?(0,s.jsx)(lO,{userCount:G,video:x||N,channel:t}):l&&(0,iE.t)(i)&&b?(0,s.jsx)(ea.Lp,{text:em.intl.string(em.t.dI3q4h),color:h.A.unsafe_rawColors.RED_400.css}):null!=E?(0,s.jsx)(ih.z,{textColor:"text-feedback-positive",entry:{start:E}}):null!=a&&a&&p.length>0?(0,s.jsx)(i_,{embeddedApps:p,muted:A}):null}var ib=n(714619);class iG extends nM{channelItemRef=r.createRef();state={shouldShowGuildVerificationPopout:!1};closeGuildVerificationPopout=()=>{this.setState({shouldShowGuildVerificationPopout:!1})};getVoiceStatesCount(){let{voiceStates:e}=this.props;return e?.length??0}isFull(){let{channel:e}=this.props;return(0,nh.Pd)(e,lS.A,O.A)}getModeClass(){let{position:e,sortingPosition:t,isUserOver:n}=this.props;if(n)return ep.ZS;if(null!=t)if(e>t)return ep.mU;else return ep.TR;return ep.fx}handleClick=()=>{let{channel:e,locked:t,connected:n,unverifiedAccount:l,isSuggestedSection:i}=this.props,s=e.getGuildId();null!=s&&(0,lZ.V)(s)&&(0,lq.Ze)(s),l&&this.setState({shouldShowGuildVerificationPopout:!0}),t||n||e.isRoleSubscriptionTemplatePreviewChannel()||(0,il.av)(e),__OVERLAY__||(0,it.iN)(e.id,i?{source:ie.A.CHANNEL_LIST_SUGGESTED_SECTION}:void 0)};handleClickChat=()=>{let{channel:e,locked:t,isSuggestedSection:n}=this.props;__OVERLAY__||t||(0,it.iN)(e.id,n?{source:ie.A.CHANNEL_LIST_SUGGESTED_SECTION}:void 0)};handleContextMenu=e=>{let{channel:t}=this.props,l=O.A.getGuild(t.getGuildId());null!=l&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("146652"),n.e("993103"),n.e("393336"),n.e("893190"),n.e("391763"),n.e("955557"),n.e("474610"),n.e("535321"),n.e("603998"),n.e("550033"),n.e("947502"),n.e("343266"),n.e("309004"),n.e("965789"),n.e("412255"),n.e("63340"),n.e("430997"),n.e("379995"),n.e("537796"),n.e("544058"),n.e("591377"),n.e("35723"),n.e("566378"),n.e("256372"),n.e("29542"),n.e("419690"),n.e("426792"),n.e("248804"),n.e("318663"),n.e("599990"),n.e("599854")]).then(n.bind(n,119357));return n=>(0,s.jsx)(e,{...n,channel:t,guild:l})})};renderVoiceUsers(){let{channel:e,collapsed:t,tabIndex:n,speakerVoiceStates:l,numAudience:i}=this.props;return(0,s.jsx)(lw.A,{channel:e,voiceStates:l,collapsed:t,tabIndex:n,numAudience:i})}renderPopout=()=>{let{channel:e}=this.props,{shouldShowGuildVerificationPopout:t}=this.state;if(t)return(0,s.jsx)(l8,{type:l4.VOICE,guildId:e.guild_id,closePopout:this.closeGuildVerificationPopout});throw Error("VoiceChannel.renderPopout: There must always be something to render")};renderOpenChatButton=()=>{let{channel:e,locked:t,forceShowButtons:n}=this.props;if(!t)return(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(es.D,{className:eH()(ep.Xs,n?ep.Tf:null),onClick:()=>{lW.A.updateChatOpen(e.id,!0),this.handleClickChat()},"aria-label":em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(lE.ChatIcon,{size:"xs",color:"currentColor",className:ep.gE})})})};renderChannelInfo(){let{channelInfo:e}=this.props;return null==e?null:(0,s.jsx)("div",{className:ep.yW,children:e})}getTooltipText=()=>{let{connected:e}=this.props;return this.isFull()&&!e?em.intl.string(em.t.rZfiNq):null};renderSubtitle=()=>{let e=this.props.stageInstance?.topic;return null==e?null:(0,s.jsx)(tK.A,{children:e})};render(){let{channel:e,selected:t,connected:n,locked:l,connectChannelDropTarget:i,connectChannelDragSource:r,connectUserDropTarget:a,connectDragPreview:o,canReorderChannel:d,canMoveMembers:c,stageInstance:u,isSubscriptionGated:h,needSubscriptionToAccess:A,unread:g,resolvedUnreadSetting:m,mentionCount:f,isFavoriteSuggestion:p}=this.props,{shouldShowGuildVerificationPopout:C}=this.state,E=(0,s.jsxs)("li",{className:eH()(this.getModeClass(),{[ep.r9]:this.isDisabled()}),"data-dnd-name":(0,tQ.m1)(e,l5.default,id.A),children:[(0,s.jsx)(lz.Y,{targetElementRef:this.channelItemRef,position:"right",renderPopout:this.renderPopout,spacing:17,onRequestClose:this.closeGuildVerificationPopout,shouldShow:C,children:()=>(0,s.jsx)(ei.m,{text:this.getTooltipText(),children:(0,s.jsxs)(nL.Ay,{ref:this.channelItemRef,className:ep.Ki,iconClassName:eH()({[ib.G]:null!=u}),channel:e,selected:!p&&t,connected:n,unread:n?g:void 0,resolvedUnreadSetting:m,mentionCount:f,locked:l,onClick:()=>{this.handleClick()},onContextMenu:e=>{this.handleContextMenu(e)},connectDragPreview:o,subtitle:this.renderSubtitle(),isFavoriteSuggestion:p,"aria-label":(0,lX.Ay)({channel:e,unread:g,mentionCount:f,isSubscriptionGated:h,needSubscriptionToAccess:A}),children:[p&&this.renderAcceptSuggestionButton(),p&&this.renderRemoveSuggestionButton(),!p&&this.renderOpenChatButton(),!p&&this.renderInviteButton(),!p&&this.renderEditButton(),!p&&this.renderChannelInfo()]})})}),this.renderVoiceUsers()]});return c&&(E=a(E)),d&&(E=i(r(E))),E}}let ij=$((0,lY.F)(iG));function iv(e){var t;let n,l,{guild:i,channel:r,disableSorting:a,isFavoriteCategory:o,collapsed:d,voiceStates:c}=e,h=(0,u.cf)([n2.Ay],()=>({unread:n2.Ay.hasUnread(r.id),mentionCount:n2.Ay.getMentionCount(r.id)})),A=(0,u.bG)([w.Ay],()=>w.Ay.resolveUnreadSetting(r)),g=(0,u.cf)([T.A,l9.A,P.A],()=>{let e=T.A.getChannel(r.parent_id),t=l9.A.getCheck(r.guild_id);return{canManageChannel:null!=i&&P.A.can(k.xBc.MANAGE_CHANNELS,r),canReorderChannel:!0!==a&&((0,R.ai)(i.id)||(null!=e?P.A.can(k.xBc.MANAGE_CHANNELS,e):P.A.can(k.xBc.MANAGE_CHANNELS,i))),canMoveMembers:P.A.can(k.xBc.MOVE_MEMBERS,r),locked:!P.A.can(k.xBc.CONNECT,r),bypassLimit:P.A.can(k.xBc.MOVE_MEMBERS,r),unverifiedAccount:!t.canChat}}),m=(0,u.bG)([L.A],()=>L.A.isCollapsed(r.parent_id)),f=(t=r.id,n=(0,io.A)(t),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,u.cf)([ia.Ay,ir.default],()=>{let n=ir.default.getId();return ia.Ay.getPermissionsForUser(n,e,t)},[e,t])}(t,!0).moderator,!n&&l?1:0),p=(0,u.bG)([nI.A],()=>nI.A.getStageInstanceByChannel(r.id),[r.id]),C=(0,ii.zy)(r.id,tf.ip.AUDIENCE),{isSubscriptionGated:E,needSubscriptionToAccess:x}=(0,lN.A)(r.id),N=(0,u.bG)([w.Ay],()=>w.Ay.isFavorite(i.id,r.id)),_=(0,is.xn)(r.id),I=iS({channel:r,isChannelSelected:!1,isChannelCollapsed:d,voiceStates:c,isSubscriptionGated:E,needSubscriptionToAccess:x,enableConnectedUserLimit:_||r.userLimit>0&&r.userLimit<k.RCc}),S=e.connected&&null==I;return(0,s.jsx)(ij,{categoryCollapsed:m,connectAction:f,numAudience:C,stageInstance:p,isSubscriptionGated:E,needSubscriptionToAccess:x,...h,...g,...e,isFavoriteSuggestion:o&&!N,forceShowButtons:S,channelInfo:I,resolvedUnreadSetting:A})}function iR(e,t){let n=t.getGuildId();if(null==n)throw Error("TextChannel, preloadChannel: Channel does not have a guildId");lC.A.preload(n,t.id)}let iy=$(class extends nM{handleContextMenu=e=>{let{channel:t}=this.props,l=O.A.getGuild(t.getGuildId());null!=l&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("603998"),n.e("309004"),n.e("412255"),n.e("63340"),n.e("430997"),n.e("379995"),n.e("544058"),n.e("715669")]).then(n.bind(n,313140));return n=>(0,s.jsx)(e,{...n,channel:t,guild:l})})};handleClick=e=>{let t=e.getGuildId();if(null==t)throw Error("TextChannel, transitionTo: Channel does not have a guildId");(0,eu.pX)(k.BVt.CHANNEL(t,e.id),{state:{analyticsSource:{page:k.liQ.GUILD_CHANNEL,section:k.JJy.CHANNEL_LIST,object:k.ZSU.CHANNEL}}})};render(){let{channel:e,selected:t,connectChannelDropTarget:n,connectChannelDragSource:l,connectDragPreview:i,canReorderChannel:r}=this.props,a=(0,s.jsx)("li",{className:eH()(this.getClassName(),{[ep.r9]:this.isDisabled()}),"data-dnd-name":(0,tQ.m1)(e,l5.default,id.A),children:(0,s.jsxs)(nL.Ay,{className:ep.Ki,channel:e,selected:t,onClick:this.handleClick,onMouseDown:iR,onContextMenu:this.handleContextMenu,connectDragPreview:r?i:null,"aria-label":(0,lX.Ay)({channel:e}),resolvedUnreadSetting:nT.e.ONLY_MENTIONS,children:[this.renderInviteButton(),this.renderEditButton()]})});return r?n(l(a)):a}}),iM=r.memo(function(e){let{channel:t,guild:n,disableSorting:l}=e,i=(0,u.cf)([T.A,P.A],()=>{let e=T.A.getChannel(t.parent_id);return{canManageChannel:P.A.can(k.xBc.MANAGE_CHANNELS,t),canReorderChannel:!0!==l&&null!=e?P.A.can(k.xBc.MANAGE_CHANNELS,e):P.A.can(k.xBc.MANAGE_CHANNELS,n)}});return(0,s.jsx)(iy,{...i,...e})});var iL=n(172218),iT=n(811024),iU=n(323073);function iD(e){if(null==e)return null;switch(e.type){case"embedded-activities":case"event":return{subtitle:e.name};case"go-live":return{subtitle:em.intl.string(em.t.Pa817q)}}return null}var iO=n(3322),iP=n(696451),iV=n(763827),iw=n(56059),iH=n(163328),iB=n(778712),ik=n(730134),iF=n(707539),iK=n(486020),iz=n(98098);function iW(e){let{channel:t}=e,l=(0,u.yK)([iC.A,n2.Ay,P.A],()=>{let e=iC.A.getActiveJoinedRelevantThreadsForParent(t.guild_id,t.id);return o()(iC.A.getActiveJoinedThreadsForParent(t.guild_id,t.id)).values().map(e=>e.channel).concat(o().values(iC.A.getActiveUnjoinedThreadsForParent(t.guild_id,t.id))).filter(t=>!(t.id in e)&&P.A.can(k.xBc.VIEW_CHANNEL,t)).sort((e,t)=>{let n=n2.Ay.lastMessageId(e.id),l=n2.Ay.lastMessageId(t.id);return tg.default.compare(n,l)}).reverse().value()}),i=t.isForumLikeChannel()?5:3,a=t.isForumLikeChannel()?iw.b:iH.y;return r.useEffect(()=>{(0,iF.TE)()},[]),(0,s.jsxs)("div",{className:iz.SW,children:[(0,s.jsx)(e2.E,{variant:"text-sm/medium",color:"text-muted",className:iz.DD,children:t.isForumLikeChannel()?em.intl.string(em.t.ioVdO2):em.intl.string(em.t.VNYs2v)}),(0,s.jsxs)("div",{className:iz.p_,children:[l.slice(0,t.isForumLikeChannel()?l.length:i).map(e=>(0,s.jsx)(iY,{thread:e},e.id)).filter(e=>r.isValidElement(e)).slice(0,i),(0,s.jsxs)(es.D,{className:iz.nM,onClick:function(){t.isForumLikeChannel()?(0,it.iN)(t.id):(0,I.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("327744"),n.e("852197"),n.e("225307"),n.e("332165"),n.e("618416"),n.e("524434"),n.e("849162"),n.e("802598"),n.e("242266"),n.e("552705"),n.e("481647"),n.e("776602"),n.e("140402"),n.e("139970"),n.e("472789"),n.e("179049"),n.e("31267"),n.e("444567"),n.e("665927"),n.e("751743"),n.e("384042"),n.e("65225")]).then(n.bind(n,126768));return n=>(0,s.jsx)(e,{channel:t,...n})})},children:[(0,s.jsx)("div",{className:iz.R4,children:(0,s.jsx)(a,{size:"custom",className:iz.Kk})}),(0,s.jsx)("div",{className:iz.Pf,children:(0,s.jsx)(e2.E,{variant:"text-sm/normal",color:"none",children:em.intl.string(em.t["4qdZ93"])})})]})]})]})}function iY(e){let{thread:t}=e,n=(0,u.bG)([l5.default],()=>l5.default.getUser(t.ownerId)),l=(0,iF.JO)(t);return(0,s.jsxs)(es.D,{className:iz.nM,onClick:function(e){(0,lI.JA)(t,t.isForumPost()?e.shiftKey:!e.shiftKey,lG.H9.POPOUT)},children:[(0,s.jsx)("div",{className:iz.R4,children:null==n?(0,s.jsx)("img",{className:iz.my,src:iK.Ay.getDefaultAvatarURL(void 0,void 0),alt:""}):(0,s.jsx)(ik.A,{className:iz.my,user:n,size:iB._3.SIZE_16})}),(0,s.jsxs)("div",{className:iz.Pf,children:[(0,s.jsx)(e2.E,{className:iz.UU,variant:"text-sm/normal",color:"none",children:t.name}),(0,s.jsx)(e2.E,{variant:"text-sm/normal",color:"text-muted",children:"\u2022"}),(0,s.jsx)(e2.E,{className:iz.vE,variant:"text-sm/normal",color:"text-muted",children:(0,iF.aK)(l)})]})]})}var iX=n(138298),iq=n(940382);function iZ(e){let{channel:t,isSuggestedSection:n}=e;return(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(es.D,{className:ep.Xs,onClick:()=>{iX.A.openChannelAsSidebar({guildId:t.getGuildId(),channelId:t.id,baseChannelId:t.id,details:{type:iq.kk.CHAT}}),(0,it.iN)(t.id,n?{source:ie.A.CHANNEL_LIST_SUGGESTED_SECTION}:void 0)},"aria-label":em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(lE.ChatIcon,{size:"xs",color:"currentColor",className:ep.gE})})})}var iJ=n(364522),i$=n(302959),iQ=n(35903),i0=n(970928),i1=n(427262),i3=n(641635);let i2=nd.DN.SIZE_24;function i9(e){let{activity:t,embeddedApp:n}=e,l=t?.assets,i=t?.application_id;if(null==l||null==l.large_image&&null==l.small_image){let e=iK.Ay.getApplicationIconURL({id:n.application.id,icon:n.application.icon}),t=n.application.name;return(0,s.jsx)(ei.m,{text:t,position:"top",asContainer:!0,children:(0,s.jsx)("img",{alt:t,src:e,className:i3.P3})})}let r=l.large_image??l.small_image;return null!=r?(0,s.jsx)("img",{alt:l.large_text??"",src:(0,i0.uD)(i,r,[128,128]),className:i3.P3}):null}function i5(e){let{activity:t,embeddedApp:n,channel:l}=e,i=Array.from(n.embeddedActivity.userIds),r=(0,u.yK)([l5.default],()=>i.map(e=>l5.default.getUser(e)).filter(th.Vq));return(0,s.jsx)("div",{className:i3.ec,children:(0,s.jsxs)("div",{className:i3.Wh,children:[(0,s.jsx)(i9,{activity:t,embeddedApp:n}),(0,s.jsxs)("div",{className:i3.X0,children:[(0,s.jsx)(n6.D,{variant:"heading-sm/semibold",color:"text-strong",className:i3.wx,lineClamp:1,children:n.application.name}),t?.details!=null&&""!==t.details&&(0,s.jsx)(e2.E,{variant:"text-xs/normal",color:"text-strong",lineClamp:1,children:t.details}),t?.state!=null&&""!==t.state&&(0,s.jsx)(e2.E,{variant:"text-xs/normal",color:"text-strong",lineClamp:1,children:t.state}),i.length>0&&(0,s.jsx)(nd.Ay,{className:i3.TN,guildId:l.guild_id,users:r,size:i2,max:7,renderUser:function(e){if(null==e||e===nd.mt)return null;let t=i1.Ay.getName(e);return(0,s.jsx)(ei.m,{asContainer:!0,text:t,position:"bottom",children:(0,s.jsx)("img",{src:e.getAvatarURL(l.guild_id,i2),alt:t,className:i3.my})},e.id)}})]})]})})}var i7=n(584960);function i6(e){let{channel:t,presenceActivity:n,embeddedApp:l,onAction:i}=e,r=Array.from(l.embeddedActivity.userIds),a=(0,u.bG)([l5.default],()=>l5.default.getUser(r[0]));return null==a?null:(0,s.jsxs)("div",{className:i7.Eb,children:[(0,s.jsx)("div",{className:i7.Il,children:(0,s.jsx)(i5,{activity:n,embeddedApp:l,channel:t})}),(0,s.jsx)("div",{className:i7.M4,children:(0,s.jsx)(iQ.A,{type:i$.M.VOICE_CHANNEL,activity:n,embeddedActivity:l.embeddedActivity,user:a,guildId:t.getGuildId(),channelId:t.id,buttonVariant:"primary",onAction:i})})]})}var i4=n(713654),i8=n(744399);function se(e){let{channel:t}=e,n=(0,u.bG)([O.A],()=>O.A.getGuild(t.guild_id)),l=(0,tQ.Ay)(t),i=(0,i4.gU)(t,n);return null==i?null:(0,s.jsxs)("div",{className:i8.hY,children:[(0,s.jsx)(i,{className:i8.p}),(0,s.jsx)(e2.E,{variant:"text-md/semibold",color:"interactive-text-default",className:i8.HA,children:l})]})}var st=n(220650);function sn(e){let{channel:t,onAction:n}=e,l=(0,ic.Ay)(t),i=Array.from((0,ic.Rz)(l).values());return 0===i.length?null:(0,s.jsxs)(iJ.Ip,{className:st.kL,children:[(0,s.jsx)("div",{className:st.oT,children:(0,s.jsx)(se,{channel:t})}),(0,s.jsx)("div",{className:st.zN}),i.map((e,l)=>(0,s.jsx)(i6,{embeddedApp:e,presenceActivity:e.presenceActivity??void 0,channel:t,onAction:n},l))]})}var sl=n(662980);function si(e){let{channel:t,transitionExtras:n}=e,l=em.intl.string(em.t.ZXxLQg);return(0,s.jsx)(ei.m,{asContainer:!0,text:l,children:(0,s.jsx)(es.D,{className:ep.Xs,onClick:function(){(0,sl.T)(t.id,!0),(0,it.iN)(t.id,n)},"aria-label":l,children:(0,s.jsx)(lE.ChatIcon,{size:"xs",color:"currentColor",className:ep.gE})})})}class ss extends nM{state={shouldShowThreadsPopout:!1,shouldShowActivities:!1,isMenuItemPopoverVisible:!1};channelItemRef=r.createRef();assignRef=(e,t)=>{null!=e&&(e.current=t)};setChannelItemRef=e=>{this.channelItemRef.current=e,this.assignRef(this.props.channelItemRef,e)};enterTimer=null;exitTimer=null;handleMouseEnter=()=>{this.props.channelIsContentGated&&null==this.props.embeddedApps||(this.resetTextChannelPopoutTimers(),this.enterTimer=setTimeout(()=>{null!=this.props.embeddedApps&&this.props.embeddedApps.length>0?this.setState({shouldShowActivities:!0}):this.props.channelIsContentGated||this.setState({shouldShowThreadsPopout:!0})},200))};handleMouseLeave=()=>{this.resetTextChannelPopoutTimers(),this.exitTimer=setTimeout(()=>{this.state.shouldShowActivities&&this.setState({shouldShowActivities:!1}),this.state.shouldShowThreadsPopout&&this.setState({shouldShowThreadsPopout:!1})},250)};handleThreadsPopoutClose=()=>{this.resetTextChannelPopoutTimers(),this.setState({shouldShowThreadsPopout:!1})};handleActivitiesPopoutClose=()=>{this.resetTextChannelPopoutTimers(),this.setState({shouldShowActivities:!1})};handleMenuItemPopoverVisibilityChange=e=>{this.setState({isMenuItemPopoverVisible:e})};handleClosePopout=()=>{this.state.shouldShowActivities&&this.handleActivitiesPopoutClose(),this.state.shouldShowThreadsPopout&&this.handleThreadsPopoutClose()};handleMouseDown=()=>{this.handleActivitiesPopoutClose(),this.handleThreadsPopoutClose();let{channel:e}=this.props,t=e.getGuildId();lC.A.preload(t??k.ME,e.id)};renderPopout=e=>{let{channel:t,sorting:n,embeddedApps:l,channelIsContentGated:i}=this.props,{shouldShowActivities:r}=this.state;return t.isModeratorReportChannel()||i?null:null!=l&&l.length>0&&r&&!n?(0,s.jsx)(sn,{onAction:this.handleActivitiesPopoutClose,channel:t}):(0,s.jsx)(iW,{...e,channel:this.props.channel})};componentWillUnmount(){this.resetTextChannelPopoutTimers()}resetTextChannelPopoutTimers(){null!=this.enterTimer&&(clearTimeout(this.enterTimer),this.enterTimer=null),null!=this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=null)}handleContextMenu=e=>{let{channel:t}=this.props;if(t.type===k.rbe.GROUP_DM)return void(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("146652"),n.e("393336"),n.e("893190"),n.e("391763"),n.e("955557"),n.e("947502"),n.e("965789"),n.e("368530"),n.e("537796"),n.e("566378"),n.e("17244"),n.e("153416"),n.e("760200")]).then(n.bind(n,4027));return n=>(0,s.jsx)(e,{...n,channel:t,selected:!0})});if(t.type===k.rbe.DM){let l=l5.default.getUser(t.getRecipientId());null!=l&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("790484"),n.e("207322"),n.e("622936"),n.e("216947"),n.e("866038"),n.e("926132"),n.e("146652"),n.e("834552"),n.e("708757"),n.e("993103"),n.e("585968"),n.e("393336"),n.e("776273"),n.e("893190"),n.e("391763"),n.e("571210"),n.e("88342"),n.e("189673"),n.e("955557"),n.e("311802"),n.e("229787"),n.e("698965"),n.e("882073"),n.e("797558"),n.e("691994"),n.e("235313"),n.e("576665"),n.e("474610"),n.e("436564"),n.e("947502"),n.e("245996"),n.e("700792"),n.e("592822"),n.e("838056"),n.e("965789"),n.e("823427"),n.e("529422"),n.e("508829"),n.e("309291"),n.e("307059"),n.e("537796"),n.e("516054"),n.e("298199"),n.e("17244"),n.e("864464"),n.e("439778")]).then(n.bind(n,385913));return n=>(0,s.jsx)(e,{...n,user:l,channel:t,showModalItems:!1})});return}if(t.isModeratorReportChannel())return void(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("146652"),n.e("393336"),n.e("391763"),n.e("955557"),n.e("535321"),n.e("550033"),n.e("947502"),n.e("343266"),n.e("430997"),n.e("379995"),n.e("578580")]).then(n.bind(n,907647));return n=>(0,s.jsx)(e,{...n,channel:t})});let l=O.A.getGuild(t.getGuildId());null!=l&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("146652"),n.e("393336"),n.e("893190"),n.e("391763"),n.e("955557"),n.e("535321"),n.e("603998"),n.e("550033"),n.e("947502"),n.e("343266"),n.e("309004"),n.e("965789"),n.e("412255"),n.e("63340"),n.e("430997"),n.e("379995"),n.e("537796"),n.e("544058"),n.e("65200"),n.e("591377"),n.e("35723"),n.e("566378"),n.e("256372"),n.e("29542"),n.e("248804"),n.e("25173")]).then(n.bind(n,468916));return n=>(0,s.jsx)(e,{...n,channel:t,guild:l})})};renderChannelInfo(){let{channelInfo:e}=this.props;return null==e?null:(0,s.jsx)("div",{className:ep.yW,children:e})}renderVibegrationsChatButton(e){let{channel:t,locked:n}=this.props;return!0===n?null:(0,s.jsx)(si,{channel:t,transitionExtras:e})}render(){let{channel:e,guild:t,selected:n,muted:l,unread:i,hasActiveThreads:r,hasMoreActiveThreads:a,mentionCount:o,connectChannelDropTarget:d,connectChannelDragSource:c,connectDragPreview:u,canReorderChannel:h,isSubscriptionGated:A,isFavoriteSuggestion:g,subtitle:m,forceTopLevelThread:f,embeddedApps:p,resolvedUnreadSetting:C,enableActivities:E,isTargetInViewport:x,channelItemRef:N,isSuggestedSection:_}=this.props,I=N??this.channelItemRef,{isMenuItemPopoverVisible:S}=this.state,b=!S&&a,G=!S&&E&&null!=p&&p.length>0,j=iD(m),v=_?{source:ie.A.CHANNEL_LIST_SUGGESTED_SECTION}:void 0,R=(0,tk.kg)(e,"TextChannel"),y=(0,s.jsxs)("li",{className:eH()(this.getClassName(),{[ep.r9]:this.isDisabled(),[ep.wH]:n}),"data-dnd-name":(0,tQ.m1)(e,l5.default,id.A),onMouseEnter:b||G?this.handleMouseEnter:void 0,onMouseLeave:b||G?this.handleMouseLeave:void 0,children:[(0,s.jsx)(lz.Y,{targetElementRef:I,position:"right",renderPopout:this.renderPopout,onRequestClose:this.handleClosePopout,spacing:17,shouldShow:b&&this.state.shouldShowThreadsPopout||G&&this.state.shouldShowActivities,children:()=>(0,s.jsxs)(nL.Ay,{ref:this.setChannelItemRef,className:ep.Ki,channel:e,guild:t,selected:!g&&n,muted:l,unread:i,mentionCount:o,hasActiveThreads:r,subtitle:j?.subtitle,subtitleColor:j?.color,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,connectDragPreview:h?u:null,isFavoriteSuggestion:g,channelTypeOverride:f?k.rbe.GUILD_TEXT:void 0,resolvedUnreadSetting:C,transitionExtras:v,"aria-label":(0,lX.Ay)({channel:e,unread:i,mentionCount:o,isSubscriptionGated:A,embeddedActivitiesCount:p?.length}),children:[g&&(0,s.jsxs)(s.Fragment,{children:[this.renderAcceptSuggestionButton(),this.renderRemoveSuggestionButton()]}),R&&!g&&this.renderVibegrationsChatButton(v),!g&&(0,s.jsxs)(s.Fragment,{children:[this.renderChannelInfo(),e.type===k.rbe.GUILD_APP?(0,s.jsx)(iZ,{channel:e,isSuggestedSection:_}):null,this.renderInviteButton(),this.renderEditButton()]})]})}),n&&(0,s.jsx)(iO.A,{targetElementRef:I,channelType:e.type,isTargetInViewport:x,onVisibilityChange:this.handleMenuItemPopoverVisibilityChange})]});return h?d(c(y)):y}}let sr=$(ss);function sa(e){let{channel:t,guild:n,disableSorting:l,isFavoriteCategory:i,muted:a,selected:o}=e,{hasActiveThreads:d,hasMoreActiveThreads:c}=(0,l_.NR)(t),h=(0,u.cf)([n2.Ay],()=>({unread:n2.Ay.hasUnread(t.id),ackMessageId:n2.Ay.ackMessageId(t.id),isLowImportanceMention:n2.Ay.getIsMentionLowImportance(t.id)})),A=(0,u.bG)([w.Ay],()=>w.Ay.resolveUnreadSetting(t)),g=(0,u.cf)([T.A,P.A],()=>{let e=T.A.getChannel(t.parent_id);return{canManageChannel:P.A.can(k.xBc.MANAGE_CHANNELS,t),canReorderChannel:!0!==l&&((0,R.ai)(n.id)||(null!=e?P.A.can(k.xBc.MANAGE_CHANNELS,e):P.A.can(k.xBc.MANAGE_CHANNELS,n)))}}),m=(0,u.bG)([n3.A],()=>n3.A.shouldIndicateNewChannel(n.id,t.id)),{needSubscriptionToAccess:f,isSubscriptionGated:p}=(0,lN.A)(t.id),C=(0,u.bG)([w.Ay],()=>w.Ay.isFavorite(n.id,t.id)),E=(0,iU.ni)(t),x=(0,iT.Gp)(t.id),N=iS({channel:t,isChannelCollapsed:!1,isChannelSelected:o,isSubscriptionGated:p,needSubscriptionToAccess:f,isNewChannel:m,muted:a,enableActivities:x,resolvedUnreadSetting:A}),_=(0,ic.Ay)(t),[I,S]=r.useState(!1),b=(0,iL.K)(r.useCallback(e=>{S(e)},[]));return(0,u.bG)([iV.A,iP.Ay],()=>iV.A.getChannelId()!==t.id&&iP.Ay.isCurrentUserGuest(t.getGuildId()))?null:(0,s.jsx)(sr,{...h,...g,...e,hasActiveThreads:d,hasMoreActiveThreads:c,isSubscriptionGated:p,needSubscriptionToAccess:f,isNewChannel:m&&e.canBeNewChannel,isFavoriteSuggestion:i&&!C,channelIsContentGated:E,channelInfo:N,embeddedApps:_,resolvedUnreadSetting:A,hasChannelInfo:null!=N,enableActivities:x,isTargetInViewport:I,channelItemRef:b})}var so=n(900797),sd=n(636585),sc=n(531685),su=((i={}).HIDDEN="hidden",i.UNREAD="unread",i.MENTIONS="mentions",i.VOICE_CHANNELS="voice-channels",i);let sh={mode:"hidden",mentionCount:0,targetChannelId:null},sA={topBar:sh,bottomBar:sh},sg={},sm={};function sf(e){let t=T.A.getChannel(e);return!(null==t||null==t.getGuildId()||t.isGuildVocal())&&!(t.isThread()?ly.A.isMuted(t.id):w.Ay.isChannelMuted(t.getGuildId(),t.id))&&(0,td.Y)(t)}function sp(e){let t=T.A.getChannel(e);if(null==t)return!1;let n=t.getGuildId();if(null==n)return!1;let l=w.Ay.isGuildCollapsed(n),i=w.Ay.isChannelMuted(n,t.id);return(!l||!i)&&n2.Ay.getMentionCount(e)>0}function sC(e){return!w.Ay.isChannelMuted(e.guild_id,e.id)&&(e.isGuildStageVoice()?tm.A.getMutableParticipants(e.id,tf.ip.SPEAKER).length>0:tu.Ay.getVoiceStatesForChannel(e).length>0)}function sE(e){let{guildChannels:t}=tI.A.getGuildWithoutChangingGuildActionRows(e),n=t.getChannels(sm[e]??[]);if(null==n||0===n.length)return!1;let l=null,i=null,s=null,r=null,a=!0,d=!0,c=!1,u=t.getCategoryFromSection(t.voiceChannelsSectionNumber),h=u?.getShownChannelIds()??[],[A,g,m]=t.getSlicedChannels(n);for(let e=0;e<g.length;e++){let t=g[e];if((sf(t.id)||o().some(t.threadIds,sf))&&(d=!1),(sp(t.id)||o().some(t.threadIds,sp))&&(a=!1),h.includes(t.id)&&(c=!0),!d&&!a&&c)break}let f=0,p=!1,C=0,E=!1;if(d||a)for(let e=A.length-1;e>=0;e--){let t=A[e];(sf(t.id)||o().some(t.threadIds,sf))&&(null==i&&(i=t.id),p=!0),(sp(t.id)||o().some(t.threadIds,sp))&&(null==l&&(l=t.id),f+=n2.Ay.getMentionCount(t.id),f+=o().sumBy(t.threadIds,n2.Ay.getMentionCount))}if(d||a)for(let e=0;e<m.length;e++){let t=m[e];if(!d&&!a)break;(sf(t.id)||o().some(t.threadIds,sf))&&(null==r&&(r=t.id),E=!0),(sp(t.id)||o().some(t.threadIds,sp))&&(null==s&&(s=t.id),C+=n2.Ay.getMentionCount(t.id),C+=o().sumBy(t.threadIds,n2.Ay.getMentionCount))}let x=null,N=null,_=u?.getChannelRecords()??[];a&&C>0?x={mode:"mentions",mentionCount:C,targetChannelId:s}:!c&&o().some(_,sC)?x={mode:"voice-channels",mentionCount:0,targetChannelId:null}:d&&E&&(x={mode:"unread",mentionCount:0,targetChannelId:r}),a&&f>0?N={mode:"mentions",mentionCount:f,targetChannelId:l}:d&&p&&(N={mode:"unread",mentionCount:0,targetChannelId:i});let I=null!=N&&(null==x||"mentions"!==x.mode&&"mentions"===N.mode),S=null!=x&&("mentions"===x.mode||!I);return sg[e]={topBar:I?N??sh:sh,bottomBar:S?x??sh:sh},!0}let sx=o().throttle(sE,200);function sN(e){let{guildId:t}=e,n=O.A.getGuild(t);return null!=n&&!!n.features.has(k.GuildFeatures.COMMUNITY)&&sx(t)}function s_(e){let{id:t}=e,n=T.A.getChannel(t);if(null==n)return!1;let l=O.A.getGuild(n.guild_id);return null!=l&&!!l.features.has(k.GuildFeatures.COMMUNITY)&&sx(n.guild_id)}function sI(e){let{channel:t}=e,n=T.A.getChannel(t.id);if(null==n)return!1;let l=O.A.getGuild(t.guild_id);return null!=l&&!!l.features.has(k.GuildFeatures.COMMUNITY)&&sx(n.guild_id)}function sS(e){let{channelId:t}=e,n=T.A.getChannel(t);if(null==n)return!1;let l=O.A.getGuild(n.guild_id);return null!=l&&!!l.features.has(k.GuildFeatures.COMMUNITY)&&V.A.getGuildId()===n.guild_id&&sx(n.guild_id)}function sb(e){let{guildId:t}=e;return null!=t&&sx(t)}class sG extends u.Ay.Store{static displayName="ChannelListUnreadsStore";initialize(){this.waitFor(tI.A,T.A,O.A,ly.A,n2.Ay,V.A,tu.Ay,tm.A,w.Ay)}getUnreadStateForGuildId(e){return sg[e]??sA}}let sj=new sG(e6.h,{UPDATE_CHANNEL_LIST_DIMENSIONS:function(e){let{guildId:t,channelIds:n}=e,l=O.A.getGuild(t);return null!=l&&!!l.features.has(k.GuildFeatures.COMMUNITY)&&null!=n&&!o().isEqual(sm[t],n)&&(sm[t]=n,sE(t))},BULK_ACK:function(e){let{channels:t}=e,n=!1;return o()(t).map(e=>{let{channelId:t}=e;return T.A.getChannel(t)?.guild_id}).filter(th.Vq).uniq().forEach(e=>{let t=O.A.getGuild(e);null!=t&&t.features.has(k.GuildFeatures.COMMUNITY)&&sx(e)&&(n=!0)}),n},CHANNEL_ACK:sS,CHANNEL_DELETE:sI,CHANNEL_LOCAL_ACK:sS,MESSAGE_ACK:sS,MESSAGE_CREATE:sS,MESSAGE_DELETE_BULK:sS,MESSAGE_DELETE:sS,PASSIVE_UPDATE_V2:function(e){let t=O.A.getGuild(e.guildId);return!!(e.channels.length>0&&null!=t&&t.features.has(k.GuildFeatures.COMMUNITY))&&sx(e.guildId)},RESORT_THREADS:sS,THREAD_CREATE:sI,THREAD_DELETE:sI,THREAD_LIST_SYNC:sN,THREAD_MEMBER_UPDATE:s_,THREAD_MEMBERS_UPDATE:s_,THREAD_UPDATE:sI,BULK_CLEAR_RECENTS:sN,CATEGORY_COLLAPSE_ALL:sN,CATEGORY_EXPAND_ALL:sN,VOICE_STATE_UPDATES:function(e){let{voiceStates:t}=e,n=V.A.getGuildId();if(null==n||!new Set(t.map(e=>e.guildId)).has(n))return!1;let l=sg[n];return null!=l&&"voice-channels"===l.bottomBar.mode&&sx(n)},USER_GUILD_SETTINGS_CHANNEL_UPDATE:sb,USER_GUILD_SETTINGS_CHANNEL_UPDATE_BULK:sb,USER_GUILD_SETTINGS_FULL_UPDATE:function(e){let{userGuildSettings:t}=e;for(let e of t)null!=e.guild_id&&sx(e.guild_id)},USER_GUILD_SETTINGS_GUILD_UPDATE:sb,USER_GUILD_SETTINGS_GUILD_AND_CHANNELS_UPDATE:sb});var sv=n(350536);let sR={friction:30,tension:300};function sy(e){let{guildChannels:t,jumpToVoiceChannels:n}=e,l=t.getCategoryFromSection(t.voiceChannelsSectionNumber),i=(0,u.bG)([tu.Ay],()=>tu.Ay.getVoiceStates(t.id),[t.id]),a=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),n()},[n]),o=l?.getChannelRecords()??[],d=(0,nh.fK)({channels:o,selectedChannelId:null,selectedVoiceChannelId:null,voiceStates:i});return(0,s.jsxs)(es.D,{className:eH()(sv.M0,sv.OF),onClick:a,children:[(0,s.jsx)(tJ.H,{size:"custom",className:sv.Gs,width:14,height:14,color:"currentColor"}),(0,s.jsx)(e2.E,{variant:"text-xs/semibold",className:sv.pM,children:em.intl.format(em.t["fDlr+F"],{count:d.length})}),(0,s.jsx)(sd.A,{guildId:t.id,className:sv.J$,users:d.slice(0,4),renderMoreUsers:()=>null,max:4,size:iB._3.SIZE_16})]})}function sM(e){let{position:t,guildChannels:n,guildChannelsVersion:l,jumpToVoiceChannels:i,jumpToChannel:a}=e,{bottomBar:o,topBar:d}=(0,u.cf)([sj],()=>sj.getUnreadStateForGuildId(n.id)),c=(0,u.bG)([sc.A],()=>sc.A.isFocused()),{mode:h,mentionCount:A,targetChannelId:g}="bottom"===t?o:d,m=h===su.HIDDEN,f=(0,e9.z)({to:{transform:m?"bottom"===t?"translateY(180%)":"translateY(-180%)":"translateY(0%)"},config:sR},c?"respect-motion-settings":"animate-never"),p=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null!=g&&a(g)},[a,g]);return(0,s.jsx)("div",{className:eH()(sv.kL,{[sv.Mn]:"top"===t,[sv.sQ]:"bottom"===t}),children:(0,s.jsx)(e3.animated.div,{className:sv.pK,style:f,"aria-hidden":m,children:function(){switch(h){case su.HIDDEN:return(0,s.jsx)("div",{className:eH()(sv.M0,sv.Te)});case su.UNREAD:return(0,s.jsxs)(es.D,{className:sv.M0,onClick:p,children:["bottom"===t?(0,s.jsx)(tq.a,{size:"custom",color:"currentColor",className:sv.z_,height:14,width:14}):(0,s.jsx)(so.t,{size:"custom",color:"currentColor",className:sv.z_,height:14,width:14}),(0,s.jsx)(e2.E,{variant:"text-xs/semibold",color:"interactive-text-default",className:sv.pM,children:em.intl.string(em.t.FCRiT3)})]});case su.MENTIONS:return(0,s.jsx)(es.D,{className:eH()(sv.M0,sv.vU),onClick:p,children:(0,s.jsx)(e2.E,{variant:"text-xs/semibold",color:"badge-text-brand",className:sv.pM,children:em.intl.format(em.t.EQcLyp,{count:A})})});case su.VOICE_CHANNELS:return(0,s.jsx)(sy,{jumpToVoiceChannels:i,guildChannels:n,guildChannelsVersion:l});default:return}}()})})}var sL=n(310953),sT=n(173860);function sU(e){let t=T.A.getChannel(e);return null!=t&&null!=t.getGuildId()&&!(t.isThread()?ly.A.isMuted(t.id):w.Ay.isChannelMuted(t.getGuildId(),t.id))&&(0,td.Y)(t)}function sD(e){let t=T.A.getChannel(e);if(null==t)return!1;let n=t.getGuildId();if(null==n)return!1;let l=w.Ay.isGuildCollapsed(n),i=w.Ay.isChannelMuted(n,t.id);return(!l||!i)&&n2.Ay.getMentionCount(e)>0}let sO=r.forwardRef(function(e,t){let{guildId:n,guildChannels:l,guildChannelsVersion:i,...r}=e,a=(0,sL.W)(n,l,i,{withVoiceChannels:!1},{ignoreRecents:!0}),o=(0,u.bG)([sc.A],()=>sc.A.isFocused());return(0,s.jsx)(sT.A,{ref:t,...r,isUnread:sU,isMentioned:sD,items:a,animate:o})});var sP=n(81466);function sV(e){let{guild:t,selected:l}=e,{hasUnread:i,mentionCount:r}=(0,u.cf)([n2.Ay],()=>({hasUnread:n2.Ay.hasUnread(t.id,nT.P.GUILD_EVENT),mentionCount:n2.Ay.getMentionCount(t.id,nT.P.GUILD_EVENT)}),[t.id]),a=(0,u.bG)([w.Ay],()=>w.Ay.isMuteScheduledEventsEnabled(t.id));async function o(){await (0,I.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("489565"),n.e("684231"),n.e("570690"),n.e("886631"),n.e("931937"),n.e("998835"),n.e("947359"),n.e("694303"),n.e("147626"),n.e("256373"),n.e("970644"),n.e("449347"),n.e("464287"),n.e("853934"),n.e("468248"),n.e("469647"),n.e("798354"),n.e("711588")]).then(n.bind(n,15823));return n=>(0,s.jsx)(e,{...n,guildId:t.id})}),(0,nQ.Dr)(el.M.GUILD_HEADER_EVENT_UPSELL)}let d=(0,tP.Ay)(t.id),c=d.length>0?em.intl.formatToPlainString(em.t.IBdqSu,{number:d.length}):em.intl.string(em.t.tlopTM);return(0,s.jsx)(ec.G,{id:`upcoming-events-${t.id}`,renderIcon:e=>(0,s.jsx)(sP.CalendarIcon,{size:"md",color:"currentColor",className:e}),text:c,selected:l,onClick:o,onContextMenu:function(e){(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("426386"),n.e("819990")]).then(n.bind(n,221621));return n=>(0,s.jsx)(e,{...n,guildId:t.id})})},showUnread:i&&!a,trailing:!a&&r>0?(0,s.jsx)(ea.hV,{className:nq.Do,disableColor:!0,count:r}):null})}var sw=n(152367),sH=n(972786),sB=n(321593),sk=n(309010),sF=n(50617);function sK(e){let{guild:t,selected:n}=e,l=(0,u.bG)([sH.Ay],()=>sH.Ay.getSelectedProjectId(t.id),[t.id]),i=(0,u.bG)([sk.Ay],()=>sk.Ay.getChannelId(),[]),r=(0,u.bG)([V.A],()=>V.A.getGuildId(),[]);return(0,s.jsx)(ec.G,{id:`vibegrations-${t.id}`,renderIcon:e=>(0,s.jsx)(sw.D,{size:"custom",color:"currentColor",width:20,height:20,className:e}),text:em.intl.string(sF.default.Xmvb23),selected:n,background:(0,s.jsx)(sB.gT,{guildId:t.id}),onClick:()=>{let e=i===eh.VV.VIBEGRATIONS&&r===t.id;(0,eu.pX)(k.BVt.CHANNEL(t.id,eh.VV.VIBEGRATIONS,null==l||e?null:l))}})}var sz=n(845056),sW=n(765379),sY=n(271683),sX=n(725613),sq=n(857253),sZ=n(360729),sJ=n(22231),s$=n(241326),sQ=n(750943),s0=n(743674),s1=n(888697),s3=n(26741),s2=n(493819),s9=n(722884),s5=n(579129),s7=n(176431);function s6(e){let{channel:t,imageUrl:l,animatedUrl:i,bannerHash:a,canModifyHangout:o}=e,d=(0,s0.S)(l),c=(0,eD.je)(t),u=(0,s3.P9)({guildId:t.guild_id,channelId:t.id,bannerHash:a}),h=r.useCallback(()=>{(0,s3.J_)({guildId:t.guild_id,channelId:t.id}),(0,s9.A)({channel:t})},[t]),A=r.useCallback(()=>{(0,s3.nK)({guildId:t.guild_id,channelId:t.id}),(0,s1.e2)(t.id)},[t.guild_id,t.id]),g=r.useCallback(e=>{c?(0,e5.L3)(e,async()=>{let{default:e}=await n.e("555558").then(n.bind(n,316421));return n=>(0,s.jsx)(e,{...n,channel:t})}):e.preventDefault()},[t,c]);return(0,s.jsxs)("div",{ref:u,className:s7.rs,onContextMenu:g,children:[(0,s.jsx)("div",{className:s7.ZS,style:null!=d?{backgroundColor:d}:void 0,children:(0,s.jsx)(s2.A,{imageUrl:l,animatedUrl:i,className:s7.Sl})}),o?(0,s.jsxs)("div",{className:s7.n_,children:[(0,s.jsx)(ei.m,{text:em.intl.string(s5.default.XJ4UpB),children:(0,s.jsx)(es.D,{className:s7.HF,onClick:h,children:(0,s.jsx)(sJ.PencilIcon,{size:"xs",color:"currentColor"})})}),(0,s.jsx)(ei.m,{text:em.intl.string(s5.default.XV4qT6),children:(0,s.jsx)(es.D,{className:s7.HF,onClick:A,children:(0,s.jsx)(s$.TrashIcon,{size:"xs",color:"currentColor"})})})]}):null]})}function s4(e){let{channel:t}=e,n=(0,s3.dX)({guildId:t.guild_id,channelId:t.id}),l=r.useCallback(()=>{(0,s3.J_)({guildId:t.guild_id,channelId:t.id}),(0,s9.A)({channel:t})},[t]);return(0,s.jsx)("div",{ref:n,className:s7._o,children:(0,s.jsxs)(es.D,{className:s7.hH,onClick:l,children:[(0,s.jsx)(sQ.X,{size:"xs",color:"currentColor"}),(0,s.jsx)(e2.E,{variant:"text-sm/medium",color:"currentColor",children:em.intl.string(s5.default.NGcIOF)})]})})}function s8(e){let{channel:t,isConnected:n}=e,{enableHangoutWindow:l}=(0,eU.Dm)({guildId:t.guild_id,location:"HangoutWindow"}),i=(0,eD.W6)(t),a=n&&i,o=t.voiceHangout,d=o?.banner_hash,c=r.useMemo(()=>{if(null==d||null==t.guild_id)return null;let e=(0,eD.Sq)({guildId:t.guild_id,bannerHash:d});return null==e?null:{bannerHash:d,...e}},[t.guild_id,d]);return l?null!=c?(0,s.jsx)(s6,{channel:t,imageUrl:c.imageUrl,animatedUrl:c.animatedUrl,bannerHash:c.bannerHash,canModifyHangout:a}):a?(0,s.jsx)(s4,{channel:t}):null:null}var re=n(290863),rt=n(461213),rn=n(532622),rl=n(882840),ri=n(208971),rs=n(46054),rr=n(569381),ra=n(165648);function ro(e){let{channel:t,connected:n,hovered:l,subtitle:i,onClick:a}=e,o=(0,ri.G)((0,rl.l)(t)),{enableHangoutWindow:d}=(0,eU.Dm)({guildId:t.guild_id,location:"VoiceChannelStatus"}),c=d&&(0,eD.lr)(t),u=null!=o&&o.length>0,h=(0,rn.Ay)(t,!0),A=null!=i&&i.length>0;if(r.useEffect(()=>{u&&lA.default.track(k.HAw.VOICE_CHANNEL_TOPIC_VIEWED,{channel_id:t.id,guild_id:t.guild_id})},[u,t.id,t.guild_id]),null==t.guild_id)return null;let g=eH()(rr.Ui,n&&h?rr.BI:null);return u?(0,s.jsx)(es.D,{className:g,onClick:h?a:void 0,children:(0,s.jsx)(e2.E,{variant:"text-xs/medium",className:eH()(rr.qS,ra.PT),children:(0,s.jsx)(tK.A,{children:rs.A.parseVoiceChannelStatus(o,!0,{channelId:t.id})})})}):n&&h&&!c&&(!A||l)?(0,s.jsxs)(es.D,{className:g,onClick:a,children:[(0,s.jsx)(e2.E,{variant:"text-xs/medium",className:rr.qS,children:em.intl.string(em.t.Mgpxiw)}),(0,s.jsx)(sJ.PencilIcon,{color:"currentColor",className:rr.rD,size:"xxs"})]}):A?(0,s.jsx)(tK.A,{children:i}):null}class rd extends nM{state={shouldShowGuildVerificationPopout:!1,hovered:!1};ref=r.createRef();channelItemRef=r.createRef();closeGuildVerificationPopout=()=>{this.setState({shouldShowGuildVerificationPopout:!1})};handleVoiceConnect=()=>{let{locked:e,connected:t,channel:n,unverifiedAccount:l,needSubscriptionToAccess:i,mentionCount:s,isSuggestedSection:r,guildRoomsEnabled:a}=this.props;l&&this.setState({shouldShowGuildVerificationPopout:!0});let o=s>0;o&&lW.A.updateChatOpen(n.id,!0),lx.A.handleVoiceConnect({channel:n,connected:t,needSubscriptionToAccess:i,routeDirectlyToChannel:o||a,locked:e,transitionExtras:r?{source:ie.A.CHANNEL_LIST_SUGGESTED_SECTION}:void 0})};handleContextMenu=e=>{let{channel:t}=this.props,l=O.A.getGuild(t.getGuildId());null!=l&&(0,e5.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("926132"),n.e("146652"),n.e("993103"),n.e("393336"),n.e("893190"),n.e("391763"),n.e("955557"),n.e("474610"),n.e("535321"),n.e("603998"),n.e("550033"),n.e("947502"),n.e("343266"),n.e("309004"),n.e("965789"),n.e("412255"),n.e("63340"),n.e("430997"),n.e("379995"),n.e("537796"),n.e("544058"),n.e("591377"),n.e("35723"),n.e("566378"),n.e("256372"),n.e("29542"),n.e("419690"),n.e("426792"),n.e("248804"),n.e("318663"),n.e("599990"),n.e("599854")]).then(n.bind(n,119357));return n=>(0,s.jsx)(e,{...n,channel:t,guild:l})})};handleMouseEnter=()=>{this.setState({hovered:!0})};handleMouseLeave=()=>{this.setState({hovered:!1})};getVoiceStatesCount(){let{voiceStates:e}=this.props;return e?.length??0}isFull(){let{channel:e}=this.props;return(0,nh.Pd)(e,lS.A,O.A)}getModeClass(){let{position:e,sortingPosition:t,isUserOver:n}=this.props;if(n)return ep.ZS;if(null!=t)if(e>t)return ep.mU;else return ep.TR;return ep.fx}handleClick=()=>{let{channel:e}=this.props,t=e.getGuildId();null!=t&&(0,lZ.V)(t)&&(0,lq.Ze)(t),this.handleVoiceConnect()};handleVoiceStatusClick=e=>{let{connected:t,channel:n}=this.props;t&&(e.stopPropagation(),(0,sY.A)({channel:n}))};renderSubtitle(){let{channel:e,connected:t}=this.props,n=iD(this.props.subtitle)?.subtitle,{hovered:l}=this.state;return(0,s.jsx)(ro,{onClick:this.handleVoiceStatusClick,channel:e,connected:t,subtitle:n,hovered:l})}renderVoiceUsers(){let{channel:e,voiceStates:t,collapsed:n,withGuildIcon:l,tabIndex:i}=this.props;return(0,s.jsx)(lw.A,{channel:e,collapsed:n,collapsedMax:6,voiceStates:t,withGuildIcon:l,tabIndex:i})}renderHangoutWindow(){let{channel:e,connected:t,voiceStates:n,collapsed:l}=this.props;return!(null!=n&&n.length>0)||l?null:(0,s.jsx)(s8,{channel:e,isConnected:t})}renderPopout=()=>{let{channel:e}=this.props,{shouldShowGuildVerificationPopout:t}=this.state;return t?(0,s.jsx)(l8,{type:l4.VOICE,guildId:e.guild_id,closePopout:this.closeGuildVerificationPopout}):null};renderOpenChatButton=()=>{let{channel:e,locked:t,forceShowButtons:n,isSuggestedSection:l}=this.props;if(!t)return(0,s.jsx)(ei.m,{asContainer:!0,text:em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(es.D,{className:eH()(ep.Xs,n?ep.Tf:null),onClick:()=>{lW.A.updateChatOpen(e.id,!0),(0,it.iN)(e.id,l?{source:ie.A.CHANNEL_LIST_SUGGESTED_SECTION}:void 0)},"aria-label":em.intl.string(em.t.ZXxLQg),children:(0,s.jsx)(lE.ChatIcon,{size:"xs",color:"currentColor",className:ep.gE})})})};renderChannelInfo(){let{channelInfo:e}=this.props;return null==e?null:(0,s.jsx)("div",{className:ep.yW,children:e})}getTooltipText=()=>{let{connected:e}=this.props;return this.isFull()&&!e?em.intl.string(em.t.rZfiNq):null};render(){let{channel:e,selected:t,connected:n,unread:l,resolvedUnreadSetting:i,mentionCount:r,locked:a,connectChannelDropTarget:o,connectChannelDragSource:d,connectUserDropTarget:c,connectDragPreview:u,canReorderChannel:h,canMoveMembers:A,showTutorial:g,hasActiveEvent:m,embeddedApps:f,isSubscriptionGated:p,isFavoriteSuggestion:C,withGuildIcon:E,hasStartTime:x,voiceChannelStartTime:N,shouldHighlightChannel:_,shouldUseAnimatedWaveform:I,voiceStates:S}=this.props,{shouldShowGuildVerificationPopout:b}=this.state,G=_||I,j=(0,s.jsxs)("li",{ref:this.ref,className:eH()(this.getModeClass(),{[ep.r9]:this.isDisabled(),[ep.fy]:_}),"data-dnd-name":(0,tQ.m1)(e,l5.default,id.A),children:[_&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:ep.UQ}),(0,s.jsx)("div",{className:ep.l0})]}),(0,s.jsx)("div",{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,children:(0,s.jsx)(lz.Y,{targetElementRef:this.channelItemRef,position:"right",renderPopout:this.renderPopout,onRequestClose:this.closeGuildVerificationPopout,spacing:17,shouldShow:b,children:()=>(0,s.jsx)(ei.m,{text:this.getTooltipText(),children:(0,s.jsxs)(nL.Ay,{ref:this.channelItemRef,className:ep.Ki,iconClassName:eH()({[ep.Gj]:m||x||G}),hasActiveEvent:m,channel:e,selected:!C&&t,connected:n,unread:n?l:void 0,resolvedUnreadSetting:i,mentionCount:r,locked:a,subtitle:this.renderSubtitle(),onClick:()=>{this.handleClick()},onContextMenu:e=>{this.handleContextMenu(e)},connectDragPreview:u,isFavoriteSuggestion:C,"aria-label":(0,lX.Ay)({channel:e,unread:l,mentionCount:r,voiceStates:S,activityNames:[...new Set([...f.map(e=>e.application.name),...this.props.nonEmbeddedActivityNames])],isSubscriptionGated:p,voiceChannelStartTime:N}),withGuildIcon:E,children:[C&&(0,s.jsxs)(s.Fragment,{children:[this.renderAcceptSuggestionButton(),this.renderRemoveSuggestionButton()]}),!C&&(0,s.jsxs)(s.Fragment,{children:[this.renderOpenChatButton(),this.renderInviteButton(),this.renderEditButton(),this.renderChannelInfo()]})]})})})}),this.renderHangoutWindow(),this.renderVoiceUsers()]});return A&&(j=c(j)),h&&(j=o(d(j))),g&&(j=(0,s.jsx)(ni.A,{childRef:this.ref,tutorialId:"voice-conversations",position:"right",offsetX:-20,children:j})),j}}let rc=$((0,lY.F)(rd));function ru(e){let{guild:t,channel:n,disableSorting:l,isFavoriteCategory:i,selected:r,collapsed:a,voiceStates:o}=e,d=(0,u.cf)([n2.Ay],()=>({unread:n2.Ay.hasUnread(n.id),mentionCount:n2.Ay.getMentionCount(n.id)})),c=(0,u.bG)([w.Ay],()=>w.Ay.resolveUnreadSetting(n)),h=(0,u.cf)([T.A,l9.A,P.A],()=>{let e=T.A.getChannel(n.parent_id),i=l9.A.getCheck(n.guild_id);return{canManageChannel:P.A.can(k.xBc.MANAGE_CHANNELS,n),canReorderChannel:!0!==l&&((0,R.ai)(t.id)||(null!=e?P.A.can(k.xBc.MANAGE_CHANNELS,e):P.A.can(k.xBc.MANAGE_CHANNELS,t))),canMoveMembers:P.A.can(k.xBc.MOVE_MEMBERS,n),locked:!P.A.can(k.xBc.CONNECT,n),bypassLimit:P.A.can(k.xBc.MOVE_MEMBERS,n),unverifiedAccount:!i.canChat}}),A=(0,u.bG)([lS.A],()=>lS.A.hasVideo(n.id)),{enabled:g}=(0,sZ.mf)({guildId:t.id,location:"VoiceChannel"}),m=(0,ic.Ay)(n),f=(0,u.yK)([rt.A,re.A,ir.default],()=>{if(null==o||0===o.length)return[];let e=ir.default.getId(),t=[];for(let{user:l}of o)for(let i of l.id===e?rt.A.getActivities():re.A.getActivities(l.id,n.guild_id))!(0,sz.N)(i)||(0,sW.A)(i)||null==i.name||t.includes(i.name)||t.push(i.name);return t},[o,n.guild_id]),p=(0,tQ.Ay)(n),C=(0,tP.Qs)(n.id),E=(0,u.bG)([sX.A],()=>sX.A.getStartTime(n),[n]),{isSubscriptionGated:x,needSubscriptionToAccess:N}=(0,lN.A)(n.id),_=(0,sq.A)(),I=(0,u.bG)([w.Ay],()=>w.Ay.isFavorite(t.id,n.id)),S=e.connected||_?.channelId===n.id,{enableHighlight:b,enableWaveformIcon:G}=(0,nc.b)(t.id,"VoiceChannel"),j=null!=o&&o.length>0,v=b&&j,y=G&&j,M=iS({channel:n,isChannelSelected:r,isChannelCollapsed:a,voiceStates:o,isSubscriptionGated:x,needSubscriptionToAccess:N,enableConnectedUserLimit:!0,enableActivities:!0}),L=S&&null==M;return(0,s.jsx)(rc,{channelName:p,embeddedApps:m,nonEmbeddedActivityNames:f,embeddedActivityType:k.$pd.PLAYING,video:A,hasActiveEvent:null!=C,isSubscriptionGated:x,needSubscriptionToAccess:N,...d,...h,...e,connected:S,isFavoriteSuggestion:i&&!I,forceShowButtons:L,channelInfo:M,resolvedUnreadSetting:c,hasChannelInfo:null!=M,hasStartTime:null!=E,voiceChannelStartTime:E,shouldHighlightChannel:v,shouldUseAnimatedWaveform:y,guildRoomsEnabled:g})}n(131955);function rh(e){return h.A.modules.channels.NAME_LINE_HEIGHT.resolve({density:e})+2*h.A.space.SPACE_XXS.resolve({density:e})+2}class rA extends r.PureComponent{static contextType=d.nC;_list=null;unreadTopRef=r.createRef();unreadBottomRef=r.createRef();static defaultProps={density:"default"};state={initialized:!1,isUnreadVisible:!0,topUnread:null,topMention:null,bottomUnread:null,bottomMention:null};componentDidMount(){this.setState({initialized:!0}),(0,tS.Ei)(this.getVisibleChannels)}componentWillUnmount(){this.updateChannelListScroll.cancel()}componentDidUpdate(e,t){let{scrollToChannel:n,guildId:l,selectedChannelId:i}=this.props,{initialized:s}=this.state,{scrollTop:r}=tN.A.getGuildDimensions(l);null!=n?(this.scrollToChannel(n),E.A.clearChannelListScrollTo(l)):l!==e.guildId?null!=r&&this.scrollTo(r):i!==e.selectedChannelId?this.scrollToChannel(i):!t.initialized&&s&&(null==r&&null!=i?this.scrollToChannel(i,!1,8,this.handleListScroll):this.scrollTo(r??0,this.handleListScroll)),this.testShouldSkipTutorial()}getSectionRowsFromChannel(e){return this.props.guildChannels.getSectionRowsFromChannel(e)}setListRef=e=>{let{ref:t}=this.context;t.current=e?.getScrollerNode()??null,this._list=e};scrollTo(e,t){this._list?.scrollTo({to:e,animate:!1,callback:t})}scrollToChannel(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,l=arguments.length>3?arguments[3]:void 0,i=this._list,s=this.getSectionRowsFromChannel(e)[0];if(null!=s&&null!=i)if(null!=s.threadOffset){let[e]=i.getScrollPosition(s.section,s.row),{density:r="default"}=this.props,a=s.threadOffset*rh(r);i.scrollIntoViewRect({start:e+a,end:e+a+rh(r),padding:n,animate:t,callback:l})}else i.scrollToIndex({section:s.section,row:s.row,animate:t,padding:n,callback:l});else l?.()}jumpToVoiceChannels=()=>{let{guildChannels:e,voiceStates:t}=this.props,n=0,l=e.getCategoryFromSection(e.voiceChannelsSectionNumber)?.getShownChannelIds()??[];for(let e=0;e<l.length-1;e++)if((t[l[e]]??[]).length>0){n=e+1;break}this._list?.scrollToIndex({section:e.voiceChannelsSectionNumber,row:n,animate:!0,padding:8})};jumpToChannel=e=>this.scrollToChannel(e,!0,32);jumpToChannelWithMentionsAndUnreads=(e,t)=>{let[n,l]=t;return this.scrollToChannel(e,!0,null!=n&&null!=l?32:8)};isChannelVisible=(e,t)=>{let n=this.getSectionRowsFromChannel(e),l=this._list;if(null==l)return!1;for(let{row:e,section:i}of n){let[n,s]=l.getScrollPosition(i,e),r=l.getScrollerState();if(t&&n+s<r.scrollTop+r.offsetHeight||!t&&n>r.scrollTop)return!0}return!1};getVisibleChannels=()=>{let e=this._list;if(null==e)return[];let t=e.getItems(),n=e.getScrollerState(),l=[];for(var i=0;i<t.length;i++){let s=t[i];if((0,A.o)(s)&&s.section>=this.props.guildChannels.favoritesSectionNumber){let t=this.props.guildChannels.getChannelFromSectionRow(s.section,s.row),[i,r]=e.getScrollPosition(s.section,s.row);null!=t&&i+r<n.scrollTop+n.offsetHeight&&i>n.scrollTop&&l.push(t.channel.id)}}return l};handleResize=()=>{let{showNewUnreadsBar:e}=this.props,t=this._list?.getScrollerState()??null;if(this.setState({isUnreadVisible:this.isUnreadVisible()}),e&&null!=t){let{scrollTop:e}=t;this.updateChannelListScroll(e)}};handleListScroll=()=>{let{onScroll:e}=this.props,t=this._list?.getScrollerState()??null;if(null!=t){let{scrollTop:n}=t;null!=e&&e(t),this.updateChannelListScroll(n)}null!=this.unreadTopRef.current&&this.unreadTopRef.current.calculateState(),null!=this.unreadBottomRef.current&&this.unreadBottomRef.current.calculateState()};handleUnreadCalculate=(e,t,n)=>{let l=this.isUnreadVisible();n?this.setState({isUnreadVisible:l,bottomUnread:t,bottomMention:e}):this.setState({isUnreadVisible:l,topUnread:t,topMention:e})};isUnreadVisible(){let{guildChannels:e}=this.props,t=this._list;return null!=t&&t.getItems().some(n=>{if("row"!==n.type)return!1;let{section:l,row:i}=n;if(l<t_.bK||e.isPlaceholderRow(l,i))return!1;let s=e.getChannelFromSectionRow(l,i);if(null==s)return!1;let{channel:r,category:a}=s;return!!(0,H.ig)(r.record.type)&&(!a.isCollapsed||!a.isMuted)&&!r.isMuted&&!!t.isItemVisible(l,i,!0)&&(0,td.Y)(r.record)})}updateChannelListScroll=(0,a.throttle)(e=>{E.A.updateChannelListScroll(this.props.guildId,e,this.getVisibleChannels())},100);getSectionHeight=e=>{let{guild:t,guildChannels:n,density:l}=this.props,i="compact"===l?8:12;if(e===t_.PU)return i;if(e===t_.bK)return t.features.has(k.GuildFeatures.HUB)?0:i;if(e===n.voiceChannelsSectionNumber){let t=n.getCategoryFromSection(e);if(null==t||t.isEmpty())return 0;if(t.isCollapsed)return 49;let l=n.getChannelFromSectionRow(e,0)?.channel;return null==l||l.record.type===k.rbe.GUILD_CATEGORY?9:25}return"compact"===l?32:40};getSectionFooterHeight=e=>{let{guildChannels:t,voiceStates:n,selectedVoiceChannelId:l,selectedChannelId:i,optInEnabled:s,guildChannelsVersion:r}=this.props;return function(e){let{sectionIndex:t,guildChannels:n,voiceStates:l,selectedChannelId:i,selectedVoiceChannelId:s,optInEnabled:r,visualRefreshEnabled:a,density:o}=e;if(t===n.voiceChannelsSectionNumber)return 44;let{hasDivider:d,canHaveVoiceSummary:c}=nA(n,r,t),u=d?a?9:12:0;if(!c||t===t_.PU)return u;let h=n.getNamedCategoryFromSection(t);return null==h||!function(e){let{category:t,voiceStates:n,selectedChannelId:l,selectedVoiceChannelId:i}=e;return function(e){let{category:t,voiceStates:n,selectedChannelId:l,selectedVoiceChannelId:i}=e;return!0!==L.A.isCollapsed(t.record.id)?[]:t.getChannelRecords().filter(e=>{if(!P.A.can(k.xBc.VIEW_CHANNEL,e))return!1;let t=n[e.id]??[];return e.id!==i&&e.id!==l&&t.length>0})}({category:t,selectedChannelId:l,selectedVoiceChannelId:i,voiceStates:n}).length>0}({category:h,selectedChannelId:i,selectedVoiceChannelId:s,voiceStates:l})?u:(a&&"cozy"===o?42:34)+u}({sectionIndex:e,guildChannels:t,guildChannelsVersion:r,voiceStates:n,selectedChannelId:i,selectedVoiceChannelId:l,optInEnabled:s,density:this.props.density})};getRowHeight=(e,t)=>{let{guildChannels:n,voiceStates:l,stageChannelSpeakerVoiceStates:i,selectedVoiceChannelId:s,density:r="default"}=this.props,a=rh(r);if(e===t_.PU){let e=n.getGuildActionSection();return e.isEmpty()?0:e.getRow(t)===tF.n.GUILD_PREMIUM_PROGRESS_BAR?e.getRows().length>1?69:57:a}if(n.isPlaceholderRow(e,t))return 0;let o=n.getChannelFromSectionRow(e,t);if(null==o)return 0;let{channel:d,category:c}=o;if(d.record.type===k.rbe.GUILD_CATEGORY)return 40;for(let e of d.threadIds){let{density:t="default"}=this.props;a+=rh(t);let n=l[d.id];null!=n&&n.length>0&&(a+=s===e?32*n.length:32)}if(d.record.isGuildVoice()){let e=l[d.id];if(null!=e&&e.length>0){let t=32*e.length;if(d.isCollapsed||c.isCollapsed?t=32:(0,eP.Ln)(d.record)&&(t+=32),a+=t+h.A.space.SPACE_XS.resolve({density:r}),!d.isCollapsed&&!c.isCollapsed){let{enableHangoutWindow:e}=(0,eU.kY)({guildId:d.record.guild_id,location:"ChannelList"});e&&((0,eD.lr)(d.record)?a+=134:s===d.id&&(a+=44))}}d.id===this.props.rtcConnectedChannelId&&(a+=32*this.props.rtcDesyncedVoiceStatesCount)}if((null!=d.subtitle||s===d.id)&&(a+=16),d.record.isGuildStageVoice()){let e=l[d.id]??[],t=i[d.id]??[];if(null!=e&&e.length>0){let e=32*t.length;d.isCollapsed||c.isCollapsed?e=Math.ceil(e/5):e+=32,a+=e+8}}return a};dismissRecents=()=>{let{guild:e,guildChannels:t,selectedChannelId:n}=this.props,l=t.getCategoryFromSection(t.recentsSectionNumber);if(null==l)return;let i=null,s=l.getShownChannelAndThreadIds();null!=n&&s.includes(n)&&(i=(0,eV.xb)(t)),(0,eV.DD)(e.id,s,i)};renderSection=e=>{let{section:t}=e,{guildChannels:n,guildChannelsVersion:l,guild:i,selectedChannelId:r,disableManageChannels:a}=this.props;return(0,s.jsx)(no,{sectionIndex:t,guild:i,guildChannels:n,guildChannelsVersion:l,selectedChannelId:r,disableManageChannels:a},function(e,t){switch(e){case t_.PU:return"hoisted-spacer";case t_.bK:return"uncategorized-spacer";case t_.HP:return"favorites";case t.recentsSectionNumber:return"recents-header";case t.voiceChannelsSectionNumber:return"voice-channels-header";default:{let n=t.getNamedCategoryFromSection(e);if(null!=n)return`category-${n.id}`;return`section-${e}`}}}(t,n))};renderRow=e=>{let{section:t,row:n}=e,{guild:l,selectedChannel:i,selectedChannelId:a,selectedVoiceChannel:o,selectedVoiceChannelId:d,guildChannels:c,voiceStates:u,disableManageChannels:h,stageChannelSpeakerVoiceStates:A,optInEnabled:g,withGuildIcon:m}=this.props;if(t===t_.PU){let e=c.getGuildActionSection(),t=e.getRow(n);if(null==t)return null;switch(t){case tF.n.GUILD_HUB_HEADER_OPTIONS:return(0,s.jsx)(eO.A,{guild:l,channel:D.Ay.getDefaultChannel(l.id)},tF.n.GUILD_HUB_HEADER_OPTIONS);case tF.n.GUILD_PREMIUM_PROGRESS_BAR:let i=e.getRows();return(0,s.jsx)(to,{guild:l,withMargin:i.length>1},tF.n.GUILD_PREMIUM_PROGRESS_BAR);case tF.n.GUILD_SPACE:return(0,s.jsx)(eT,{guild:l,selected:a===eh.VV.GUILD_SPACE},tF.n.GUILD_SPACE);case tF.n.GUILD_HOME:return(0,s.jsx)(n7,{guild:l,selected:a===eh.VV.GUILD_HOME},tF.n.GUILD_HOME);case tF.n.GUILD_SCHEDULED_EVENTS:return(0,s.jsx)(sV,{guild:l,selected:a===tF.n.GUILD_SCHEDULED_EVENTS},tF.n.GUILD_SCHEDULED_EVENTS);case tF.n.GUILD_ROLE_SUBSCRIPTIONS:return(0,s.jsx)(lr,{guild:l,selected:a===eh.VV.ROLE_SUBSCRIPTIONS},tF.n.GUILD_ROLE_SUBSCRIPTIONS);case tF.n.GUILD_SHOP:return(0,s.jsx)(lp,{guild:l,selected:a===eh.VV.GUILD_SHOP},tF.n.GUILD_SHOP);case tF.n.GUILD_GAME_SHOP:return(0,s.jsx)(nJ,{guild:l,selected:a===eh.VV.GAME_SHOP},tF.n.GUILD_GAME_SHOP);case tF.n.GUILD_VIBEGRATIONS:return(0,s.jsx)(sK,{guild:l,selected:a===eh.VV.VIBEGRATIONS},tF.n.GUILD_VIBEGRATIONS);case tF.n.GUILD_NEW_MEMBER_ACTIONS_PROGRESS_BAR:return(0,s.jsx)(ln,{guild:l});case tF.n.CHANNELS_AND_ROLES:return(0,s.jsx)(n9,{guild:l,selected:a===eh.VV.CHANNEL_BROWSER||a===eh.VV.CUSTOMIZE_COMMUNITY},tF.n.CHANNELS_AND_ROLES);case tF.n.GUILD_DIRECTORY:return(0,s.jsx)(nU,{guild:l,selectedChannelId:a,disableManageChannels:h},tF.n.GUILD_DIRECTORY);case tF.n.GUILD_MOD_DASH_MEMBER_SAFETY:return(0,s.jsx)(eM,{guild:l,selected:a===eh.VV.MEMBER_SAFETY},tF.n.GUILD_MOD_DASH_MEMBER_SAFETY);case tF.n.GUILD_BOOSTS:return(0,s.jsx)(e1,{guildId:l.id,selected:a===eh.VV.GUILD_BOOSTS},tF.n.GUILD_BOOSTS);case tF.n.GAME_SERVERS:return(0,s.jsx)(eI,{guildId:l.id,selected:a===eh.VV.GAME_SERVERS},tF.n.GAME_SERVERS);case tF.n.GAME_SERVERS_EMPTY:return(0,s.jsx)(eC,{guildId:l.id,selected:a===eh.VV.GAME_SERVERS},tF.n.GAME_SERVERS_EMPTY);case tF.n.GUILD_OFFICIAL_MESSAGES:return(0,s.jsx)(li,{guild:l,selected:a===eh.VV.GUILD_OFFICIAL_MESSAGES},tF.n.GUILD_OFFICIAL_MESSAGES);default:return null}}if(c.isPlaceholderRow(t,n))return null;let f=c.getChannelFromSectionRow(t,n);if(null==f)return null;let{category:p,channel:C}=f,E=p instanceof t_.xu,x=C.record,N=`${t}${C.id}`;switch(x.type){case k.rbe.GUILD_ANNOUNCEMENT:case k.rbe.GUILD_TEXT:case k.rbe.GUILD_FORUM:case k.rbe.GUILD_MEDIA:case k.rbe.DM:case k.rbe.GROUP_DM:case k.rbe.GUILD_APP:return(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(sa,{channel:x,guild:l,position:C.position,selected:a===C.id,muted:C.isMuted,subtitle:C.subtitle,disableManageChannels:h,canBeNewChannel:g&&t===c.recentsSectionNumber,isFavoriteCategory:E,isSuggestedSection:t===c.recentsSectionNumber}),C.threadCount>0?(0,s.jsx)(lK,{withGuildIcon:m,channel:x,sortedThreadIds:C.threadIds,selectedChannel:null!=i&&(i.id===C.id||i.parent_id===x.id)?i:null,selectedVoiceChannelId:o?.parent_id===x.id?d:null}):null]},N);case k.rbe.GUILD_STAGE_VOICE:return(0,s.jsx)(iv,{channel:x,guild:l,position:C.position,selected:a===C.id,connected:d===C.id,collapsed:C.isCollapsed||p.isCollapsed,voiceStates:u[C.id]??[],speakerVoiceStates:A[C.id]??[],disableManageChannels:h,isFavoriteCategory:E,isSuggestedSection:t===c.recentsSectionNumber},N);case k.rbe.GUILD_VOICE:return(0,s.jsx)(ru,{channel:x,guild:l,position:C.position,selected:a===C.id,connected:d===C.id,collapsed:C.isCollapsed||p.isCollapsed,voiceStates:u[C.id],subtitle:C.subtitle,disableManageChannels:h,showTutorial:C.isFirstVoiceChannel,isFavoriteCategory:E,withGuildIcon:m,isSuggestedSection:t===c.recentsSectionNumber},N);case k.rbe.GUILD_STORE:return(0,s.jsx)(iM,{channel:x,guild:l,position:C.position,selected:a===C.id},N);case k.rbe.GUILD_CATEGORY:if(t!==c.voiceChannelsSectionNumber)return null;return(0,s.jsx)(nl,{channel:x},`readonly-${x.id}`);case k.rbe.PUBLIC_THREAD:case k.rbe.PRIVATE_THREAD:case k.rbe.ANNOUNCEMENT_THREAD:return(0,s.jsx)(sa,{channel:x,guild:l,position:C.position,selected:a===C.id,muted:C.isMuted,subtitle:C.subtitle,disableManageChannels:h,canBeNewChannel:!1,isFavoriteCategory:!1,forceTopLevelThread:!0},N);default:return null}};renderSectionFooter=e=>{let{section:t}=e,{guildChannels:n,guildChannelsVersion:l,voiceStates:i,selectedChannelId:r,selectedVoiceChannelId:a,optInEnabled:o,guildId:d}=this.props;return(0,s.jsx)(nm,{guildId:d,guildChannels:n,guildChannelsVersion:l,sectionIndex:t,voiceStates:i,selectedChannelId:r,selectedVoiceChannelId:a,optInEnabled:o},function(e,t,n){if(e===t.voiceChannelsSectionNumber)return"voice-channels-button";let{hasDivider:l,canHaveVoiceSummary:i}=nA(t,n,e);return`section-footer-${e}${l?"-divider":""}${i?"-voice-summary":""}`}(t,n,o))};renderTopUnread(){let{topMention:e,bottomUnread:t,bottomMention:n,isUnreadVisible:l}=this.state,{guildId:i,guildChannels:r,guildChannelsVersion:a}=this.props;return(0,s.jsx)("div",{className:na.Eo,children:(0,s.jsx)(sO,{ref:this.unreadTopRef,textUnread:em.intl.string(em.t.FCRiT3),textMention:em.intl.string(em.t["8zH0LJ"]),hide:null==e&&(l||null!=t||null!=n),className:na.Vq,barClassName:na.bu,guildId:i,guildChannels:r,guildChannelsVersion:a,isVisible:this.isChannelVisible,onJumpTo:this.jumpToChannelWithMentionsAndUnreads,onCalculate:this.handleUnreadCalculate})})}renderBottomUnread(){let{guildId:e,guildChannels:t,guildChannelsVersion:n}=this.props,{bottomMention:l,isUnreadVisible:i}=this.state;return(0,s.jsx)(sO,{reverse:!0,ref:this.unreadBottomRef,textUnread:em.intl.string(em.t.FCRiT3),textMention:em.intl.string(em.t["8zH0LJ"]),hide:null==l&&i,className:na.di,barClassName:na.bu,guildId:e,guildChannels:t,guildChannelsVersion:n,isVisible:this.isChannelVisible,onJumpTo:this.jumpToChannelWithMentionsAndUnreads,onCalculate:this.handleUnreadCalculate})}getAnchorId=(e,t)=>{let{guildChannels:n}=this.props;if(e!==t_.PU){if(null==t)return e===t_.HP?"favorites-header":e===n.recentsSectionNumber?"recents-header":e===n.voiceChannelsSectionNumber?"voice-channels":e===t_.bK?"uncategorized-header":n.getNamedCategoryFromSection(e)?.id;if(!n.isPlaceholderRow(e,t))return n.getChannelFromSectionRow(e,t)?.channel?.id}};renderList(){let{guildChannels:e,guildBanner:t,selectedGuildId:n,density:l}=this.props,i={};(0,R.ai)(n)&&(i["data-favorites"]=!0);let{ref:r,...a}=this.context,o=0;null!=t&&(o=84);let d="compact"===l?8:12;return(0,s.jsx)(g.sk,{children:t=>(0,s.jsx)(m.OZ,{ref:this.setListRef,className:na.XG,fade:!0,sectionHeight:this.getSectionHeight,footerHeight:this.getSectionFooterHeight,rowHeight:this.getRowHeight,paddingTop:o,paddingBottom:d,renderSection:this.renderSection,renderFooter:this.renderSectionFooter,renderRow:this.renderRow,onScroll:this.handleListScroll,onResize:this.handleResize,onContentResize:this.handleResize,sections:e.getSections(!0),innerAriaLabel:em.intl.string(em.t.OGiMXJ),innerTag:"ul",getAnchorId:this.getAnchorId,...a,...t,...i},"guild-channels")})}testShouldSkipTutorial=()=>{if(!tE.A.shouldShow("voice-conversations"))return;let{guildChannels:e}=this.props,t=e.getFirstVoiceChannel();if(null==t)return void tC.X8("voice-conversations");let n=this._list;if(null!=n)for(let{section:e,row:l}of this.getSectionRowsFromChannel(t.id))n.isItemVisible(e,l)||tC.X8("voice-conversations")};render(){let{guildChannels:e,guildChannelsVersion:t,showNewUnreadsBar:n}=this.props;return(0,s.jsx)(en.V0,{children:l=>(0,s.jsx)(f.F,{component:(0,s.jsx)(p.A,{children:(0,s.jsx)(f.H,{id:l,children:em.intl.string(em.t.OGiMXJ)})}),children:n?(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)("div",{className:na.Eo,children:(0,s.jsx)(sM,{position:"top",guildChannels:e,guildChannelsVersion:t,jumpToVoiceChannels:this.jumpToVoiceChannels,jumpToChannel:this.jumpToChannel})}),this.renderList(),(0,s.jsx)(sM,{position:"bottom",guildChannels:e,guildChannelsVersion:t,jumpToVoiceChannels:this.jumpToVoiceChannels,jumpToChannel:this.jumpToChannel})]}):(0,s.jsxs)(r.Fragment,{children:[this.renderTopUnread(),this.renderList(),this.renderBottomUnread()]})})})}}let rg=e=>{let{guildId:t,selectedChannelId:n,selectedVoiceChannelId:l}=e,i=(0,u.bG)([Q.Ay],()=>Q.Ay.keyboardModeEnabled),{analyticsLocations:a}=(0,et.Ay)(ee.A.GUILD_CHANNEL_LIST),o=(0,u.bG)([T.A],()=>T.A.getChannel(n)),h=(0,u.bG)([T.A],()=>T.A.getChannel(l)),A=(0,u.bG)([V.A],()=>V.A.getGuildId()),g=(0,M.jN)(t),m=r.useRef(null),f=r.useCallback((e,t)=>{let n=m.current;null!=n&&(k.Ut1.test(t)||(0,eh.jq)(t)?n.scrollToChannel(t,!1,16,()=>{requestAnimationFrame(()=>document.querySelector(e)?.focus())}):document.querySelector(e)?.focus())},[]),p=r.useCallback(()=>new Promise(e=>{let t=m.current;if(null==t)return e();t.scrollTo(0,()=>requestAnimationFrame(()=>e()))}),[]),C=r.useCallback(()=>new Promise(e=>{let t=m.current;if(null==t)return e();t.scrollTo(Number.MAX_SAFE_INTEGER,()=>requestAnimationFrame(()=>e()))}),[]),E=(0,c.Ay)({id:"channels",defaultFocused:n??void 0,isEnabled:i,setFocus:f,scrollToStart:p,scrollToEnd:C}),N=E.setFocus;r.useEffect(()=>{null!=n&&N(n)},[n,N]);let _=function(e){let[t]=(0,u.bG)([tm.A,T.A,tc.A],()=>{let t;return[(t=(0,R.ai)(e)?tg.default.keys(tc.A.getFavoriteChannels()).map(e=>T.A.getChannel(e)).filter(th.Vq).filter(e=>e.isGuildStageVoice()):tm.A.getChannels(e)).reduce((e,t)=>{let n=tm.A.getMutableParticipants(t.id,tf.ip.SPEAKER);return e[t.id]=n.filter(e=>e.type===tf.wY.VOICE).map(tp),e},{}),t.reduce((e,t)=>{let{id:n}=t;return e+tm.A.getParticipantsVersion(n)},0)]},[e],tA.D);return t}(t);return(0,s.jsx)(et.f5,{value:a,children:(0,s.jsx)(x.A,{section:k.JJy.GUILD_CHANNEL_LIST,children:(0,s.jsxs)(d.hD,{navigator:E,children:[(0,s.jsx)(tx.q,{containerRef:E.containerProps.ref,itemType:q}),(0,s.jsx)(rA,{...e,listNavigator:E,ref:m,selectedChannel:o,selectedVoiceChannel:h,stageChannelSpeakerVoiceStates:_,selectedGuildId:A,optInEnabled:g})]})})})};function rm(e){let t=function(e){var t;let n,l,i=(t=e.id,n=(0,tO.A)(t),l=(0,tP.Ay)(t),!(0,u.bG)([O.A],()=>{if(null==t)return!1;let e=O.A.getGuild(t);return e?.features.has(k.GuildFeatures.HUB)??!1},[t])&&(n||l.length>0)),s=(0,tR.W)(e.id),r=(0,tD.vz)(e.id),a=(0,tG.r)(e),o=(0,tB.jz)(e),d=(0,tT.d)(e.id),c=(0,tb.bG)([tM.h],()=>tM.h.getNewMemberActions(e.id),[e.id]),h=(0,tk.by)(e,"useGuildActionRows"),A=(0,tU.A)(e.id),g=(0,tL.jY)(e.id),m=(0,ty.fw)(e.id),f=(0,tV.Uq)(e.id,"useGuildActionRows"),p=[],C=e.features.has(k.GuildFeatures.HUB),E=e.features.has(k.GuildFeatures.COMMUNITY),x=e.features.has(k.GuildFeatures.ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY),N=(0,tn.A)(e.id);tH.useConfig({location:"useGuildActionRows"}).enabled;let _=ti(e),I=(0,tw.bW)(e.id,"useGuildActionRows"),S=(0,tj.C$)(e.id,"useGuildActionRows"),b=e.features.has(k.GuildFeatures.GAME_SERVERS),G=(0,tv.N)("useGuildActionRows"),[j]=(0,ed.kn)(S&&G&&!b?[el.M.EMPTY_GAME_SERVER_TAB]:[],void 0,!0);return C&&p.push(tF.n.GUILD_HUB_HEADER_OPTIONS),!g&&d&&A&&null!=c&&c.length>0?p.push(tF.n.GUILD_NEW_MEMBER_ACTIONS_PROGRESS_BAR):e.premiumProgressBarEnabled&&_>0&&p.push(tF.n.GUILD_PREMIUM_PROGRESS_BAR),!C&&d&&p.push(tF.n.GUILD_HOME),f&&p.push(tF.n.GUILD_SPACE),i&&p.push(tF.n.GUILD_SCHEDULED_EVENTS),!C&&E&&p.push(tF.n.CHANNELS_AND_ROLES),r&&p.push(tF.n.GUILD_ROLE_SUBSCRIPTIONS),a&&p.push(tF.n.GUILD_SHOP),o&&p.push(tF.n.GUILD_GAME_SHOP),(m&&(E||x)||s&&e.features.has(k.GuildFeatures.MEMBER_VERIFICATION_MANUAL_APPROVAL))&&p.push(tF.n.GUILD_MOD_DASH_MEMBER_SAFETY),N&&p.push(tF.n.GUILD_BOOSTS),I&&p.push(tF.n.GUILD_OFFICIAL_MESSAGES),S&&(b?p.push(tF.n.GAME_SERVERS):null!=j&&p.push(tF.n.GAME_SERVERS_EMPTY)),h&&p.push(tF.n.GUILD_VIBEGRATIONS),p}(e.guild),n=(0,u.cf)([tI.A],()=>tI.A.getGuild(e.guildId,{guildActionRows:t})),{density:l}=(0,C.wR)();return(0,s.jsx)(rg,{...e,...n,density:l})}}