Loading
function(e,t,l){l.d(t,{O:()=>et,A:()=>eo}),l(938796);var n,i=l(477900),a=l(582128),s=l(503698),r=l.n(s),o=l(284009),c=l.n(o),u=l(570138),d=l(350835),m=l(665260),A=l(3026),h=l(462887),p=l(534514),y=l(28863),x=l(707554),g=l(834730),f=l(866665),N=l(939249),j=l(320448),v=l(983851),I=l(492684),T=l(736653),S=l(573648),C=l(47167),P=l(235986),b=l(573435),E=l(769015),L=l(409626),_=l(692969),O=l(682163),G=l(804630),k=l(764359),z=l(763758),M=l(82149),W=l(190915),U=l(287743),R=l(994500),w=l(287809),D=l(913659),$=l(486020),V=l(821589),Y=l(682261),H=l(672979),B=l(90644),F=l(61330),K=l(960076),X=l(855511),Q=l(792996),q=l(432166),J=l(487887),Z=l(652215),ee=l(408313),et=((n={}).ACTIVITY_FEED="ActivityFeed",n.STREAM_PREVIEW="StreamPreview",n.VOICE_CHANNEL="VoiceChannel",n);let el={StreamPreview:[108,60],VoiceChannel:[108,60],ActivityFeed:[900,500]},en=(0,I.A)(class extends a.PureComponent{render(){return(0,i.jsx)("div",{className:ee.timestamp,children:this.props.message})}});function ei(e){let{activity:t}=e,l=(0,T.Ay)(),n=function(e){let{activity:t}=e,l=null;return(0,B.A)(t)&&(l=Z.fg2.SPOTIFY),null!=t.platform&&[u.y.PLAYSTATION_4,u.y.PLAYSTATION_5].includes(t.platform)&&(l=Z.fg2.PLAYSTATION),l}({activity:t});if(null==n)return null;let a=S.A.get(n);return(0,i.jsx)("img",{alt:"",src:(0,h.q)(l)?a.icon.lightSVG:a.icon.darkSVG,className:ee.platformIcon})}function ea(e){let{provider:t}=e,l=(0,T.Ay)();return(0,i.jsx)("img",{alt:"",src:(0,h.q)(l)?t.icon.lightSVG:t.icon.darkSVG,className:ee.headerPlatformIcon})}class es extends a.PureComponent{static Types=et;get activity(){let{activity:e,activityGuild:t}=this.props;return null!=t&&e?.type!==d.$.PLAYING&&e?.type!==d.$.WATCHING&&e?.type!==d.$.LISTENING&&e?.type!==d.$.HANG_STATUS?{type:d.$.PLAYING,name:Q.intl.string(Q.t.eXan7B)}:e}getTypeClass(e,t){return(0,V.t)(ee,e,this.props.type,t)}isStreamerOnTypeActivityFeed(){return(0,K.A)(this.activity)&&"ActivityFeed"===this.props.type}renderHeader(e){let t,{hideHeader:l,activityGuild:n,showChannelDetails:a,renderHeaderAccessory:s}=this.props,r=this.activity;if(l||null==r)return null;let{name:o}=r;switch(r.type){case d.$.STREAMING:t=Q.intl.formatToPlainString(Q.t.Dzgz4u,{platform:[Z.fg2.TWITCH,Z.fg2.YOUTUBE].includes(o.toLowerCase())?o:S.A.get(Z.fg2.TWITCH).name});break;case d.$.LISTENING:t=Q.intl.formatToPlainString(Q.t["5sYPnr"],{name:o});break;case d.$.WATCHING:t=Q.intl.formatToPlainString(Q.t.Ge29Zy,{name:o});break;case d.$.PLAYING:t=function(e){let t=(0,X.A)(e)??"";switch(t){case u.y.PLAYSTATION_4:case u.y.PLAYSTATION_5:return Q.intl.formatToPlainString(Q.t.A17aM8,{platform:t.toUpperCase()});case u.y.XBOX:case u.y.SAMSUNG:return Q.intl.formatToPlainString(Q.t.A17aM8,{platform:S.A.get(t).name});default:return Q.intl.string(Q.t["2TbM/G"])}}(r);break;case d.$.COMPETING:t=Q.intl.formatToPlainString(Q.t.SQCo6D,{name:o})}let c=(0,U.A)(r.session_id);if(null!=c){let e=(0,W.A)(c,r);switch(r.type){case d.$.PLAYING:t=Q.intl.formatToPlainString(Q.t.A17aM8,{platform:e});break;case d.$.WATCHING:t=Q.intl.formatToPlainString(Q.t.ENbTKQ,{platform:e});break;case d.$.LISTENING:t=Q.intl.formatToPlainString(Q.t.EcHzWI,{platform:e});break;case d.$.COMPETING:t=Q.intl.formatToPlainString(Q.t.ikpHeS,{platform:e});break;case d.$.STREAMING:t=Q.intl.formatToPlainString(Q.t.Dzgz4u,{platform:e})}}return null!=n&&(t=(0,m.Lt)(r?.flags??0,Z.jUm.EMBEDDED)?r.type===d.$.WATCHING?Q.intl.formatToPlainString(Q.t["M/L8ot"],{guildName:n.name}):Q.intl.formatToPlainString(Q.t["4chKQu"],{guildName:n.name}):Q.intl.formatToPlainString(Q.t.sddlGK,{server:n.name})),(0,i.jsxs)("div",{className:ee.headerContainer,children:[(0,i.jsxs)(p.D,{className:e?ee.headerTextEmptyBody:ee.headerTextNormal,variant:a?"body-xs/semibold":"body-sm/medium",children:[(0,i.jsx)(A.A,{children:t}),null!=c&&null==n&&(0,i.jsx)(ea,{provider:c})]}),s?.()]})}renderXboxImage(){return(0,i.jsx)("div",{className:ee.assets,children:(0,i.jsx)("img",{alt:"",src:S.A.get(Z.fg2.XBOX).icon.customPNG,className:r()(this.getTypeClass("assetsLargeImage","Xbox"))})})}renderImage(e){let t,l,{type:n}=this.props,{assets:a,application_id:s}=e;if(null==a||null==a.large_image&&null==a.small_image)return null;(0,K.A)(e)&&(t=el[n]);let o=(0,B.A)(e),c=null!=a.large_image?(0,i.jsx)("img",{alt:a.large_text??"",src:(0,D.uD)(s,a.large_image,t??[J.iu.LARGE,J.iu.LARGE]),className:r()(this.getTypeClass("assetsLargeImage",this.isStreamerOnTypeActivityFeed()?Z.fg2.TWITCH:""),{[this.getTypeClass("assetsLargeMask")??""]:null!=a.small_image,[ee.assetsLargeImageSpotify]:o})}):null;if(o)c=(0,i.jsx)(y.Anchor,{onClick:this.handleOpenSpotifyAlbum,children:c});else if((0,M.Cy)(e)){let t=(0,M.UW)(e);if(null==t)return null;c=(0,i.jsx)(b.Ay,{mask:b.Ay.Masks.SQUIRCLE,width:J.iu.SMALL,height:J.iu.SMALL,children:(0,i.jsx)("img",{src:$.Ay.getGuildIconURL({id:t.guildId,icon:a.small_image,size:J.iu.SMALL})??void 0,className:ee.assetsLargeImageVoiceChannel,alt:""})})}return(this.isStreamerOnTypeActivityFeed()&&null!=e.url&&""!==e.url&&(c=(0,i.jsxs)("div",{className:ee.twitchImageContainer,children:[(0,i.jsxs)("div",{className:ee.twitchImageOverlay,children:[(0,i.jsx)(x.H,{className:ee.streamName,children:e.name}),(0,i.jsx)(g.E,{variant:"body-xs/semibold",color:"none",className:ee.streamGame,children:Q.intl.format(Q.t.gmCZRY,{game:e.details})})]}),(0,i.jsx)(y.Anchor,{className:ee.twitchBackgroundImage,href:e.url,children:c})]})),(0,M.Cy)(e)||null==a.small_image||(l=(0,i.jsx)(f.m,{text:""!==a.small_text?a.small_text:null,position:"top",children:(0,i.jsx)("img",{alt:a.small_text??"",src:(0,D.uD)(s,a.small_image,[J.iu.SMALL,J.iu.SMALL]),className:this.getTypeClass("assetsSmallImage",null==c?"WithoutLargeImage":void 0)})})),null==c)?(0,i.jsx)("div",{className:ee.assets,children:l}):(0,i.jsxs)("div",{className:ee.assets,children:[(0,i.jsx)(f.m,{text:null!=a.large_text?a.large_text:null,position:"top",children:c}),l]})}renderGameImage(e){let{user:t,type:l,application:n,activityGuild:a}=this.props;return null!=e.assets||(0,Y.A)(e)||e.type!==d.$.PLAYING||"ActivityFeed"===l||t.bot?null:null==n&&null!=a?(0,i.jsx)("div",{className:r()(ee.gameIcon,ee.screenshareIcon)}):(0,i.jsx)(E.A,{className:ee.gameIcon,game:n})}renderName(e){let{user:t,application:l,hideName:n}=this.props;if(n)return null;let{details:a,type:s}=e;if(s===d.$.CUSTOM_STATUS)return null;let o=(0,H.A)(e),c=e.name,u=c;return(o&&null!=l?u=(0,i.jsx)("span",{className:ee.activityName,children:u}):!o&&(c=a,u=a,(0,B.A)(e)&&null!=e.sync_id&&null!=a?u=(0,i.jsx)(y.Anchor,{className:ee.bodyLink,onClick:this.handleOpenSpotifyTrack,children:a}):(0,M.Cy)(e)&&(u=e.name)),null==u)?null:(0,i.jsx)(g.E,{title:c,variant:"body-sm/semibold",className:r()((0,V.t)(ee,"name",t.bot?"wrap":"normal")),children:u})}renderDetails(e){let t,{details:l,state:n}=e,a=l,s=l;if(e.type===d.$.CUSTOM_STATUS)a=n;else if(!(0,H.A)(e))if(a=n,s=n,(0,B.A)(e)&&null!=n){let t=(t,l)=>(0,i.jsx)(z.A,{artists:n,linkClassName:ee.bodyLink,canOpen:null!=e.sync_id,onOpenSpotifyArtist:this.handleOpenSpotifyArtist},l);a=Q.intl.format(Q.t.uU9le8,{artists:s,artistsHook:t})}else(0,M.Cy)(e)&&(a=e.assets?.small_text);return null==a||""===a?null:((0,K.A)(e)&&(a=Q.intl.formatToPlainString(Q.t.gmCZRY,{game:a})),null!=t)?(0,i.jsx)(N.D,{onClick:t,title:s??void 0,className:ee.clickableDetails,children:a}):(0,i.jsx)("div",{title:s??void 0,className:(0,K.A)(e)||(0,B.A)(e)?ee.detailsWrap:ee.details,children:a})}renderChannelDetails(e){let{activityGuild:t,showChannelDetails:l,channel:n}=this.props;return l&&null!=t?null==n?(0,i.jsx)("div",{className:(0,K.A)(e)||(0,B.A)(e)?ee.detailsWrap:ee.details,children:Q.intl.format(Q.t["hq/Qze"],{guildName:t.name})}):(0,i.jsxs)("div",{className:r()((0,K.A)(e)||(0,B.A)(e)?ee.detailsWrap:ee.details,ee.guildDetails),children:[(0,i.jsx)(O.Ay,{guild:t,size:O.Ay.Sizes.SMOL,className:ee.guildIcon}),(0,i.jsx)(j.ChevronSmallRightIcon,{size:"xxs",color:"currentColor"}),(0,i.jsxs)("div",{className:ee.voiceChannelInfo,children:[(0,i.jsx)(v.VoiceNormalIcon,{size:"xxs",color:"currentColor"}),(0,i.jsx)(g.E,{variant:"body-xs/normal",children:(0,C.m1)(n,w.default,R.A)})]})]}):null}renderTimePlayed(e){let{activityGuild:t}=this.props;if(!(0,H.A)(e)||(0,B.A)(e))return null;let{timestamps:l}=e;return null==l?null:(0,Y.A)(e)?(0,i.jsx)(en,{timestamps:l}):(0,i.jsx)(k.Ay,{start:l.start,location:k.Ay.Locations.USER_ACTIVITY,className:ee.playTime,isApplicationStreaming:null!=t})}renderTimeBar(e){if(!(0,B.A)(e))return null;let{timestamps:t}=e;if(null==t)return null;let{start:l,end:n}=t;return null==l||null==n?null:(0,i.jsx)(q.A,{start:l,end:n,className:this.getTypeClass("timeBar"),themed:"VoiceChannel"===this.props.type})}renderState(e,t){let l,{state:n,party:a,assets:s}=e,r=n,o=n;if(!(0,H.A)(e)&&(r=s?.large_text,o=s?.large_text,(0,B.A)(e)&&null!=r)){let t=(t,l)=>null!=e.sync_id&&null!=o?(0,i.jsx)(y.Anchor,{className:ee.bodyLink,onClick:this.handleOpenSpotifyAlbum,children:o},l):o;r=Q.intl.format(Q.t.vOLBEy,{album:o,albumHook:t})}return null!=r&&""!==r&&e.type!==d.$.CUSTOM_STATUS||(0,M.Cy)(e)?(a?.size==null&&[J.I4].includes(e.application_id??"")?l=Q.intl.formatToPlainString(Q.t["u//9By"],{count:"0",max:t?.getMaxParticipants()??0}):(0,M.Cy)(e)&&a?.size!=null?l=Q.intl.formatToPlainString(Q.t["JC/3xw"],{numSpeakers:a.size[0],numListeners:a.size[1]-a.size[0]}):a?.size!=null&&a.size.length>=2&&(l=0===a.size[1]?Q.intl.formatToPlainString(Q.t.IM4J4e,{count:a.size[0]}):Q.intl.formatToPlainString(Q.t["u//9By"],{count:a.size[0],max:a.size[1]})),(0,i.jsxs)("div",{className:ee.state,children:[(0,i.jsx)("span",{title:o,children:r}),null!=l?(0,i.jsxs)("span",{children:[" ",l]}):null]})):null}render(){let e,{type:t,renderActions:l,className:n,application:a,onClose:s,onOpenGameProfileModal:o}=this.props,c=this.activity;if(null==c||c.type===d.$.CUSTOM_STATUS)return null;let u="ActivityFeed"===t,m="StreamPreview"===t,A=!1;if((0,F.A)(c))e=this.renderXboxImage(),A=!0;else{let t=(0,G.Gf)(this.props.user.id,c??void 0);t.isSpotify||(e=(0,i.jsx)(G.Tf,{resolvedActivity:t})),null==e&&(A=null!=(e=this.renderGameImage(c)))}let h=this.renderName(c),p=this.renderDetails(c),y=this.renderState(c,a),x=this.renderTimePlayed(c),g=this.renderChannelDetails(c),f=null!=l?l():null,j=this.renderTimeBar(c),v=![e,h,p,y,x,j,f].some(e=>null!=e);return(0,i.jsxs)("div",{className:r()(this.getTypeClass("activity"),n),children:[this.renderHeader(v),(0,i.jsx)("div",{className:A?ee.bodyAlignCenter:ee.bodyNormal,children:(0,i.jsxs)("div",{className:ee.activityDetails,children:[e,this.isStreamerOnTypeActivityFeed()?null:(0,i.jsxs)(P.A.Child,{className:r()((0,V.t)(ee,"content",A?"GameImage":null!=e?"Images":"NoImages",t)),children:[(0,i.jsxs)(N.D,{className:r()(null!=o&&ee.openGameProfile),onClick:null!=o?e=>{o(e),s?.()}:void 0,children:[h,p,y,x]}),g,m?null:j,u?f:null]})]})}),m?f:null,(0,i.jsx)(ei,{activity:c})]})}handleOpenSpotifyTrack=()=>{let{activity:e,onOpenSpotifyTrack:t}=this.props;c()(null!=e,"Spotify activity was null"),t?.(e)};handleOpenSpotifyArtist=e=>{let{activity:t,onOpenSpotifyArtist:l,user:n}=this.props;c()(null!=t,"Spotify activity was null"),l?.(t,n.id,e)};handleOpenSpotifyAlbum=()=>{let{activity:e,onOpenSpotifyAlbum:t,user:l}=this.props;c()(null!=e,"Spotify activity was null"),t?.(e,l.id)}}function er(e){let t=(0,_.A)({location:"UserActivity",applicationId:e.application?.id??e.activity?.application_id,source:L.GameProfileSources.UserProfile,sourceUserId:e.user.id,trackEntryPointImpression:!0});return(0,i.jsx)(es,{...e,onOpenGameProfileModal:t})}er.Types=et;let eo=er}