2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
|
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[4338],{71429:(e,s,i)=>{i.r(s),i.d(s,{default:()=>Os});var a=i(59496),t=i(74567),n=i(69042),r=i(3802),c=i(52143),l=i(61940),d=i(48631),o=i(35800),u=i(95663),m=i(3289),f=i(64719),g=i(21524),h=i(96170),x=i(48657),b=i(84875),j=i.n(b),p=i(56162),y=i(50346),N=i(62344),v=i(88513),k=i(14280),C=i(73444),E=i(762),I=i(84229),L=i(68776),S=i(63120),w=i(24843),D=i(6142),O=i(54299),T=i(4183),F=i(98340),A=i(48607),M=i(9374),_=i(95077),B=i(45265);const U=e=>{if(!Number.isInteger(e))return"";const s=Date.now()-Number(e),i=Math.round(s/1e3/60),a=Math.round(s/1e3/60/60),t=Math.round(s/1e3/60/60/24),n=Math.round(s/1e3/60/60/24/7);return t>=7?r.ag.get("time.weeks.short",n):a>=24?r.ag.get("time.days.short",t):i>=60?r.ag.get("time.hours.short",a):i>0?r.ag.get("time.minutes.short",i):r.ag.get("time.now")};var P=i(4637);const z=e=>{const{timestamp:s,isNowPlaying:i}=e;return i?(0,P.jsx)(B.w,{label:r.ag.get("time.now"),children:(0,P.jsx)(_.h,{"aria-label":r.ag.get("time.now"),iconSize:16})}):(0,P.jsx)("span",{children:U(s)})},J="main-buddyFeed-friendActivity",R="VLKqDIGaQn2bILzJKSZ0",Y="main-buddyFeed-friendsFeedContainer",Z="main-buddyFeed-avatarContainer",K="main-buddyFeed-overlay",H="main-buddyFeed-playIcon",q="main-buddyFeed-activityMetadata",W="main-buddyFeed-usernameAndTimestamp",Q="main-buddyFeed-username",V="main-buddyFeed-timestamp",G="main-buddyFeed-artistAndTrackName",X="main-buddyFeed-playbackContextIcon",$="main-buddyFeed-playbackContext",ee="main-buddyFeed-playbackContextLink",se="main-buddyFeed-addFriendPlaceholder",ie="main-buddyFeed-addFriendPlaceholderBtn",ae="main-buddyFeed-emptyBuddyFeed",te="main-buddyFeed-addFriendPlaceholderText",ne="PjDcsgAPmXlcTBJRGpIu",re="IRpPQFA57qgQ5jicWWaD",ce="Hm3nIbegLclY1uCAmnx_",le="bhRoVUHjWdo9mgUkU6fe",de="BliqfY7vu_qE2C9zs5Ou",oe="qdYWuHZd4HdSWfd4pSQB",ue="DhvYWKjDc7uyF3HfkDJJ",me="ralK8s_OmE8a8zWcfNKM",fe=e=>Date.now()-e<9e5,ge=(e,s)=>{const i=(0,y.EC)(e)?.type;switch(i){case y.JM.PLAYLIST:case y.JM.PLAYLIST_V2:return(0,P.jsx)(C.X,{uri:e});case y.JM.EPISODE:case y.JM.SHOW:return(0,P.jsx)(E.M,{uri:e});case y.JM.ALBUM:return(0,P.jsx)(v.Y,{uri:e,artistUri:s});case y.JM.ARTIST:return(0,P.jsx)(k.m,{uri:e});default:return null}},he=e=>{switch(e){case y.JM.ALBUM:return M.p.ALBUM;case y.JM.ARTIST:return M.p.ARTIST;case y.JM.SHOW:return M.p.SHOW;case y.JM.EPISODE:return M.p.EPISODE;case y.JM.PLAYLIST:case y.JM.PLAYLIST_V2:return M.p.PLAYLIST;default:return}},xe=e=>{const{show:s=!0,spec:i,friend:t}=e,n=(0,a.useMemo)((()=>t.user.imageUrl?[{url:t.user.imageUrl,width:0,height:0}]:[]),[t.user.imageUrl]),c=(0,u.o)(),l=(0,h.$P)(),d=t.track,o=d.uri,m=d?.context?.uri,{usePlayContextItem:f}=(0,A.n)({uri:m},{featureIdentifier:"buddy_feed",referrerIdentifier:"buddy_feed"}),{togglePlay:g,isPlaying:x,isActive:b}=f({uri:o}),v=(0,y.EC)(d.context?.uri),C=v?.type,E=(0,a.useCallback)((()=>{g(),c({intent:x?"pause":"play",type:"click",itemIdSuffix:"buddyfeed_play",targetUri:o});const e=i.friendRowFactory().playButtonFactory();b?x?l.logInteraction(e.hitPause({itemToBePaused:o})):l.logInteraction(e.hitResume({itemToBeResumed:o})):l.logInteraction(e.hitPlay({itemToBePlayed:o}))}),[g,c,x,o,i,b,l]),M=(0,a.useCallback)(((e,s)=>{l.logInteraction(i.friendRowFactory().friendRowLinkFactory({identifier:e}).hitUiNavigate({destination:s}))}),[l,i]),_=(0,D.O)([o],d.name),B=(0,D.O)([d.artist?.uri],d.artist?.name),U=(0,D.O)([d.context?.uri],d.context?.name);return s?(0,P.jsxs)("div",{className:j()(J),children:[(0,P.jsx)(O._,{menu:ge(d.context?.uri,d.artist?.uri),children:(0,P.jsxs)("div",{className:Z,children:[(0,P.jsx)(N.q,{label:t.user.name,width:40,userIconSize:16,images:n,withBadge:fe(t.timestamp)}),(0,P.jsx)(w.I,{className:K,iconClassName:H,isPlaying:x,isLocked:!1,onClick:E,playAriaLabel:x?r.ag.get("pause"):`${r.ag.get("play")} ${d.artist.name} ${d.name}`})]})}),(0,P.jsxs)("div",{className:j()(q),children:[(0,P.jsxs)("div",{className:W,children:[(0,P.jsx)(p.D,{as:"p",variant:"mestoBold",className:j
|
||
|
//# sourceMappingURL=xpui-routes-buddy-feed.js.map
|