2 lines
27 KiB
JavaScript
Executable File
2 lines
27 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[4179],{49630:(e,a,i)=>{i.d(a,{E:()=>r});var t=i(98340),n=i(43438),s=i(57559),l=i(4637);const r=({album:e,index:a,artistURI:i})=>(0,l.jsx)(t.ZP,{value:"card",index:a,children:(0,l.jsx)(s.i,{index:a,latest:!1,showType:!0,...(0,n.B$)(e,i,e.name)})})},68562:(e,a,i)=>{i.d(a,{R:()=>c});var t=i(3802),n=i(98340),s=i(73972),l=i(43438),r=i(49630),d=i(5488),o=i(4637);const c=({albums:e,artistName:a,artistId:i,artistUri:c,className:m})=>e?(0,o.jsx)(n.ZP,{value:"shelf/albums",children:(0,o.jsx)(d.P,{total:e.totalCount,title:t.ag.get("rich-page.popular-albums-by-artist",{artist:a}),seeAllUri:`${(0,l.GJ)(i)}:discography:${s.VZ.Album.toLowerCase()}`,seeAllLabel:t.ag.get("shelf.see-all"),alwaysShowSeeAll:!0,className:m,children:(0,l.Hr)(e.items).map(((e,a)=>(0,o.jsx)(r.E,{album:e,index:a,artistURI:c},e.uri)))})}):null},48687:(e,a,i)=>{i.d(a,{V:()=>o});var t=i(3802),n=i(98340),s=i(43438),l=i(79823),r=i(5488),d=i(4637);const o=({artistId:e,className:a,fansAlsoLike:i,title:o})=>(0,d.jsx)(n.ZP,{value:"shelf/fans-also-like",children:(0,d.jsx)(r.P,{total:i.length,title:o??t.ag.get("rich-page.fans-also-like"),seeAllUri:`${(0,s.GJ)(e)}:related`,className:a,children:i.map(((e,a)=>(0,d.jsx)(n.ZP,{value:"card",index:a,children:(0,d.jsx)(l.I,{index:a,uri:e.uri,name:e.profile.name,images:e.visuals.avatarImage?.sources||[]})},e.uri)))})})},30226:(e,a,i)=>{i.d(a,{j:()=>o});var t=i(59496),n=i(56162),s=i(3802),l=i(48607),r=i(29655),d=i(4637);const o=({artistName:e,artistUri:a,headerClassName:i,rowClassName:o,topTracks:c,topTracksTransformer:m,uri:u})=>{const k=(0,t.useMemo)((()=>c?.items.map((e=>m(e,u)))),[c?.items,m,u]),{usePlayContextItem:v}=(0,l.n)({uri:a},{featureIdentifier:"artist"});return k&&k.length>0?(0,d.jsxs)("div",{className:o,children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(n.D,{variant:"mesto",children:s.ag.get("rich-page.popular-tracks")}),(0,d.jsx)(n.D,{as:"h2",variant:"canon",semanticColor:"textBase",className:i,children:e})]}),(0,d.jsx)(r.k,{nrTracks:k.length,initialTracks:k,usePlayContextItem:v})]}):null}},35021:(e,a,i)=>{i.d(a,{y:()=>c});var t=i(3802),n=i(98340),s=i(73972),l=i(43438),r=i(49630),d=i(5488),o=i(4637);const c=({artistId:e,artistName:a,artistUri:i,className:c,singles:m})=>m?(0,o.jsx)(n.ZP,{value:"shelf/singles-and-eps",children:(0,o.jsx)(d.P,{total:m.totalCount,title:t.ag.get("rich-page.popular-singles-and-eps-by-artist",{artist:a}),seeAllUri:`${(0,l.GJ)(e)}:discography:${s.VZ.Single.toLowerCase()}`,seeAllLabel:t.ag.get("shelf.see-all"),alwaysShowSeeAll:!0,className:c,children:(0,l.Hr)(m.items).map(((e,a)=>(0,o.jsx)(r.E,{album:e,index:a,artistURI:i},e.uri)))})}):null},89600:(e,a,i)=>{i.r(a),i.d(a,{default:()=>Ba});var t=i(59496),n=i(61740),s=i(89605),l=i(56162),r=i(36844),d=i(96435),o=i(50346),c=i(3802),m=i(4270),u=i(14241),k=i(13655),v=i(35394),g=i(84229),h=i(41226),p=i(16743),N=i(73997),S=i(23627),x=i(77312),y=i(80964),A=i(59200),j=i(25915),b=i(62517),F=i(67565),C=i(66632),L=i(85213);let f=function(e){return e.LOADING="LOADING",e.LOADED="LOADED",e.UNAVAILABLE="UNAVAILABLE",e}({});const T=(0,L.Uy)(((e,a)=>{switch(a.type){case"LYRICS_LOADING":e[a.uri]={status:f.LOADING};break;case"LYRICS_LOADED":e[a.uri]={status:f.LOADED,data:{lyrics:{...a.response.lyrics}}};break;case"LYRICS_ERROR":e[a.uri]={status:f.UNAVAILABLE};break;default:throw new Error(`Unhandled lyrics action with type: ${a.type}`)}}));var I=i(25899),R=i(85270);var P=i(4637);const w={status:f.LOADING},D={status:f.UNAVAILABLE},O=t.createContext(void 0),U=({children:e,initialState:a={}})=>{const i=t.useReducer(T,a);return(0,P.jsx)(O.Provider,{value:i,children:e})},E=(e,a)=>{const i=t.useContext(O);if(void 0===i)throw new Error("useSEOLyrics must be used within a LyricsSEOProvider");if(!e||!(0,o.wj)(e)||a)return D;const[n,s]=i,l=n[e];return l||(s({type:"LYRICS_LOADING",uri:e}),(async e=>{const a=(0,o.EC)(e);return(await R.Zz.getSEOTrackLyrics(I.b.getInstance(),a.id)).body})(e).then((a=>{s({type:"LYRICS_LOADED",uri:e,response:a})})).catch((()=>{s({type:"LYRICS_ERROR",uri:e})})),w)};var B=i(48607),_=i(71857),M=i(6444),G=i(42495);const Z=e=>e===G.Zn.ORGANIC_TOP_POSITION,$=e=>e===G.Zn.ORGANIC_BOTTOM_POSITION;var z=i(96170),W=i(90350),Y=i(32422),K=i(47563);const V="UDuv2dzJuOEimwKzf_Ht",Q="crU3_phk5OplHUp2b_iW",H=({padded:e})=>(0,P.jsx)(l.D,{as:"p",dir:"auto",variant:"finale",className:`${V} ${e?Q:""}`,children:"Lyrics powered by Musixmatch."}),q=({uri:e})=>{const{status:a}=E(e);return a!==f.LOADED?null:(0,P.jsx)(H,{})};var J=i(84875),X=i.n(J),ee=i(30366),ae=i(63120),ie=i(68562),te=i(30226),ne=i(98340),se=i(27509),le=i(73972),re=i(43438),de=i(49630),oe=i(5488);const ce=({artistName:e,artistId:a,artistUri:i,className:t,releases:n,artistImages:s})=>n?(0,P.jsx)(ne.ZP,{value:"shelf/releases",children:(0,P.jsx)(oe.P,{total:10,title:c.ag.get("rich-page.popular-releases-by-artist",{artist:e}),seeAllUri:`${(0,re.GJ)(a)}:discography:${le.VZ.Album.toLowerCase()}`,seeAllLabel:c.ag.get("shelf.see-all"),alwaysShowSeeAll:!0,className:t,listRowHeaderProps:s?{title:e,pretitle:c.ag.get("artist-page.popular"),media:(0,se.o)(s,{desiredSize:48})||""}:null,children:n.items.map(((e,a)=>(0,P.jsx)(de.E,{album:e,index:a,artistURI:i},e.uri)))})}):null;var me=i(35021),ue=i(32812);const ke="o2TlnuNKxRO5RnB9BpHB",ve="q0Ke_aAvTcc4dO4wCHQt",ge="UlKUfS_GcROZmofuafOW",he="I5LORTI1u3A6VoUvRCBf",pe="TS85Qkpioa31wR0p4kzT",Ne="yL1DLXBc05CR_ACv_NhA",Se="k5kRkUyoz9znqg_SGOVQ";var xe=i(28246),ye=i(48811),Ae=i(81281),je=i(9374),be=i(42531);let Fe=function(e){return e.SMALL="small",e.LARGE="large",e}({});const Ce=({art:e,disabled:a=!1,LinkComponent:i,name:t,size:n=Fe.SMALL,type:r,uri:d})=>{const m=e?[e]:[],u=n===Fe.SMALL?(0,ye.R)(r):function(e){switch(e){case xe.albumType.SINGLE:return c.ag.get("track-page.from-the-single");case xe.albumType.EP:return c.ag.get("track-page.from-the-ep");case xe.albumType.COMPILATION:return c.ag.get("track-page.from-the-compilation");case xe.albumType.ALBUM:default:return c.ag.get("track-page.from-the-album")}}(r),k=(0,s.s0)();return(0,P.jsxs)("div",{className:X()(ke,{[ge]:n===Fe.SMALL,[ve]:a}),children:[(0,P.jsx)("div",{className:he,children:(0,P.jsx)(Ae.O,{images:m,size:be.m$.SIZE_80,title:t,type:je.p.ALBUM})}),(0,P.jsxs)("div",{className:pe,children:[(0,P.jsx)(l.D,{variant:n===Fe.SMALL?"mestoBold":"finale",children:u}),(0,P.jsx)(i,{to:d,children:(0,P.jsx)(l.D,{as:"div",className:Ne,variant:"balladBold",dir:"auto",children:t})})]}),(0,P.jsx)("div",{onClick:()=>{k((0,o.EC)(d).toURLPath(!0))},className:Se})]})};var Le=i(44103),fe=i(40066),Te=i(98479);const Ie="oTRKhYD0MZlNPm66W3Tw",Re="sc95MwPalcHwYGZ7j3xN",Pe="zrCZCfYv4zZiB1HYv9i8",we="RnlxIDmWcYTbbwNSJNjA",De="SHkxfN1vy0wpRMP1hK7I",Oe="COXBS6zLyyxKNYuEAzjZ",Ue="sR5IpdOUvoUGYKlC9Dk1",Ee="FHMr3WxshoYjZ7jd3YwI",Be="Evcwc4KM2tf9xrLbfB8B",_e="x4_dsi31Cx2SO1L0uYIj",Me="euPDqfFEBILj9KHDNLC1",Ge="x6FPRUKK40oDCPP7g6Ls",Ze="k3SPcfaKewjfdYumDcGw",$e="t9C7vRiN1OSC9uWfJEr0",ze="Onv6dO4lntCzKUqYa8PE",We=({richTrack:e})=>{const{search:a}=(0,s.TH)(),i=(0,t.useCallback)((()=>new URLSearchParams(a.slice(1)).get("highlight")||""),[a])(),{tracklistRef:n}=(0,Te.W)(),l=e.albumOfTrack,r=(0,fe.Y)(l?.uri||""),{usePlayContextItem:d}=(0,B.n)({uri:r},{featureIdentifier:"album"}),o=(0,t.useMemo)((()=>({items:[],totalCount:0})),[]);return l?(0,P.jsx)("div",{ref:n,className:Ue,children:(0,P.jsx)(Le.L,{ariaLabel:l.name,nrTracks:l.tracks.totalCount,albumUri:l.uri,highlightUri:i,discs:o,usePlayContextItem:d,hasHeaderRow:!1})}):null};var Ye=i(48687),Ke=i(36016),Ve=i(41836);const Qe=(0,t.memo)((function({track:e,richTrackArtists:a}){const i=(0,r.W6)(Ve.YS),n=(0,ue.k)(),s=e.albumOfTrack,d=s?.playability?.playable,o=e.artistsWithRoles.items[0]?.artist,m=o?.discography?.topTracks,u=o?.discography?.popularReleasesAlbums,k=o?.discography?.albums,v=o?.discography?.singles,g={artistId:o?.id,artistName:o?.profile?.name,artistUri:o?.uri},[h,p]=(0,t.useState)(!1),N=(0,t.useCallback)((()=>{p(!h)}),[h]),S=a?.otherArtists&&a?.otherArtists.items.length>5;return(0,P.jsxs)("div",{"data-testid":"rich-track",children:[(x=i,x===G.Zn.CANONICAL_TOP_POSITION&&(0,P.jsx)("div",{"data-testid":"canonical-pool-top"})),Z(i)&&(0,P.jsx)("div",{"data-testid":"organic-pool-top"}),(0,P.jsx)(te.j,{artistName:o?.profile?.name,artistUri:o?.uri,headerClassName:Be,rowClassName:De,topTracks:m,topTracksTransformer:Ke.X7,uri:e.uri}),(0,P.jsx)(ce,{className:Ee,releases:u,...g}),(0,P.jsx)(ie.R,{albums:k,className:Ee,...g}),(0,P.jsx)(me.y,{className:Ee,singles:v,...g}),a&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:Me,children:a.otherArtists.items.map(((e,a)=>(0,P.jsx)(ce,{className:X()(_e,{[Ze]:a>4,[$e]:h&&a>4}),releases:e.artist.discography.popularReleasesAlbums,artistName:e.artist.profile.name,artistId:e.artist.id,artistUri:e.artist.uri,artistImages:e.artist.visuals.avatarImage?.sources},e.artist.id)))}),S&&(0,P.jsx)(ee.o,{onClick:N,className:ze,children:(0,P.jsx)(l.D,{as:"h2",variant:"violaBold",children:h?c.ag.get("show_less"):c.ag.get("mwp.search.artists.all")})}),(0,P.jsx)(Ye.V,{artistId:o.id,className:X()(Ee,{[Ge]:a.otherArtists.items.length>0}),fansAlsoLike:a.firstArtist.items[0].artist.relatedContent.relatedArtists.items,title:c.ag.get("artist-page.fansalsolike")})]}),s&&(0,P.jsx)(Ce,{art:s.coverArt?.sources[0],disabled:!d||!n,LinkComponent:ae.default,name:s.name,type:s.type,size:Fe.LARGE,uri:s.uri}),(0,P.jsx)(We,{richTrack:e})]});var x})),He=Qe;var qe=i(79475);const Je="QhDsXG1Gmo7XmQWLggAO",Xe="bZgWQj7UxvK8GYKWDA7N",ea="AW61P3tnW5cKJCWtbhFh",aa=({buttonText:e,onSecondaryButtonClick:a,onPrimaryButtonClick:i,secondaryButtonText:t,text:n})=>(0,P.jsxs)("div",{className:Je,"data-testid":"static-activation-trigger",children:[(0,P.jsx)(l.D,{className:Xe,variant:"cello",children:n}),(0,P.jsxs)("div",{className:ea,children:[(0,P.jsx)(ee.o,{onClick:a,semanticColor:"textBase",children:t}),(0,P.jsx)(qe.D,{onClick:i,colorSet:"invertedLight",children:e})]})]}),ia="T1nqQ4HEh3heHy4RCCKa",ta="L8zjshPVgUMXyZR4FtOk",na="YMn1FWcFmOz9osBrNvhF",sa="Inbyq3TnvKDOJtcKFTDQ",la="lWk5se4WETUOJwaEb8D6",ra="i8DyQbWCmDV_8N5XGJQT",da="t5WPFlGTY6GCd9UOFfLu",oa="AGQ3wRyMVK1odq860qnT",ca="ZX_r7uZgPgssaUplfpxT",ma="qrqctaPu2XBpxsw23nPX",ua="XnWidTagai3nQwMPxIMF";var ka=i(39669);let va=function(e){return e.SMALL="small",e.LARGE="large",e}({});const ga=e=>{const{disabled:a,images:i,LinkComponent:t,name:n,size:r,uri:d,enableI18nRoutes:m,enableI18nAdditionalPages:u}=e,k=r===va.SMALL,v=(0,s.s0)(),g=(0,o.EC)(d),h=g?.type,p=c.ag.getUrlLocale(),N=(0,Y.S9)({localeFeatureFlag:m,entityFeatureFlag:u,urlLocale:p,entity:h,type:"link"});return(0,P.jsxs)("div",{className:X()(ta,{[na]:a}),"data-testid":"track-artist-link-card",children:[(0,P.jsx)(Ae.O,{shape:Ae.K.CIRCLE,images:i,size:be.m$.SIZE_80,title:n,type:je.p.ARTIST}),(0,P.jsxs)("div",{className:X()(la,{[ra]:k}),children:[(0,P.jsx)(l.D,{variant:"mestoBold",className:sa,children:c.ag.get("card.tag.artist")}),(0,P.jsx)(t,{to:d,children:(0,P.jsx)(l.D,{as:"div",dir:"ltr",className:da,variant:"balladBold",children:n})})]}),(0,P.jsx)("div",{onClick:()=>{const e=g?.toURL(`/${ka.F0}${p}/`);if(g){const a=N?e:g.toURLPath(!0);v(a)}},className:oa})]})},ha=({size:e=va.LARGE,disabled:a=!1,enableI18nRoutes:i,enableI18nAdditionalPages:n,...s})=>{const[r,d]=(0,t.useState)(!1),o=(0,t.useCallback)((()=>{d(!r)}),[r]),m=s.artists;return(0,P.jsxs)("div",{"data-testid":"track-artist-link-card-container",children:[(0,P.jsx)("div",{className:ia,children:m.map(((t,l)=>(0,P.jsx)("div",{className:X()({[ma]:r&&l>5,[ca]:l>5}),children:(0,P.jsx)(ga,{name:t.name,uri:t.uri,images:t.images,size:e,LinkComponent:s.LinkComponent,disabled:a,enableI18nRoutes:i,enableI18nAdditionalPages:n},t.id)},`${t.uri}-${l}`)))}),m.length>6&&(0,P.jsx)(ee.o,{onClick:o,className:ua,children:(0,P.jsx)(l.D,{as:"p",variant:"violaBold",children:r?c.ag.get("show_less"):c.ag.get("mwp.search.artists.all")})})]})};var pa=i(35526);const Na="Q3OKWaFrTVTIRZyG05Gh",Sa="cFQh4aLbQzp0aYzbWwjY",xa="NAaJboGa8qckhNNQTKTn",ya=({lines:e=[]})=>0===e.length?null:(0,P.jsxs)("div",{className:Na,children:[(0,P.jsx)(l.D,{as:"h2",variant:"canon",semanticColor:"textBase",className:Sa,children:c.ag.get("web-player.lyrics.title")}),e.map((({words:e},a)=>(0,P.jsx)(l.D,{as:"p",dir:"auto",variant:"ballad",className:xa,children:e},`lyrics-seo-line-${a}`)))]}),Aa=({uri:e})=>{const{status:a,data:i}=E(e);return a!==f.LOADED?null:(0,P.jsx)(ya,{lines:i?.lyrics.lines})};var ja=i(30985),ba=i(82108);const Fa=e=>{const{albumArtists:a,columnCount:i,uri:s}=e,l=i-2,r={"--column-count":i,"--left-column-end":l-2,"--right-column-start":l},{isAnonymous:d}=(0,n.v9)(ba.Gg),o=(0,ue.k)(),{data:m,status:u}=E(s,d),k=!!m&&u!==f.UNAVAILABLE||d,v=(0,n.v9)(ja.br),g=(0,n.v9)(ja.yE);return(0,P.jsxs)(t.Suspense,{fallback:null,children:[k&&(0,P.jsx)("div",{className:X()(Pe,{[we]:i>5}),style:{...r},children:d?(0,P.jsx)(aa,{buttonText:c.ag.get("sign_up"),secondaryButtonText:c.ag.get("login"),text:c.ag.get("track-page.sign-in-to-view-lyrics"),onPrimaryButtonClick:pa.L6,onSecondaryButtonClick:pa.h$}):(0,P.jsx)(Aa,{uri:s})}),(0,P.jsx)("div",{className:X()(Ie,{[Re]:i>5&&k}),style:{...r},children:(0,P.jsx)(ha,{artists:a,LinkComponent:ae.default,disabled:!o,enableI18nRoutes:v,enableI18nAdditionalPages:g})})]})};var Ca=i(91703),La=i(40610),fa=i(95663),Ta=i(4055),Ia=i(47146),Ra=i(31503),Pa=i(88549),wa=i(72071);const Da={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getRichTrackArtists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uri"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"trackUnion"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uri"},value:{kind:"Variable",name:{kind:"Name",value:"uri"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"FragmentSpread",name:{kind:"Name",value:"richTrackArtistsFields"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"NotFound"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richTrackArtistsFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Track"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"richTrackArtists"}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richTrackArtists"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Track"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"firstArtist"},name:{kind:"Name",value:"artistsWithRoles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artist"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"richRelatedArtistsFields"}}]}}]}}]}},{kind:"Field",alias:{kind:"Name",value:"otherArtists"},name:{kind:"Name",value:"artistsWithRoles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"richTrackArtistItem"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richRelatedArtistsFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Artist"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"relatedContent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"relatedArtists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"20"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"visuals"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatarImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sources"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richTrackArtistItem"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TrackArtistPage"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artist"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"richArtistFields"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richArtistFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Artist"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"visuals"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatarImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sources"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"url"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"discography"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"popularReleasesAlbums"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"richTrackArtistAlbums"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richTrackArtistAlbums"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AlbumPage"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"richTrackArtistAlbumFields"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"richTrackArtistAlbumFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Album"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"playability"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"playable"}}]}},{kind:"Field",name:{kind:"Name",value:"date"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isoString"}},{kind:"Field",name:{kind:"Name",value:"precision"}},{kind:"Field",name:{kind:"Name",value:"year"}}]}},{kind:"Field",name:{kind:"Name",value:"tracks"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"track"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"trackNumber"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"extractedColors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"colorRaw"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hex"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"sources"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]},Oa=e=>{const a=(i={uri:e},(0,wa.a)(Da,i,t));var i,t;if(!a.loading&&"Track"===a.data?.trackUnion?.__typename)return a.data.trackUnion},Ua=e=>e.items.map((e=>({name:e.artist.profile.name,images:(e.artist.visuals.avatarImage?.sources||[]).map((e=>({url:e.url,width:e.width,height:e.height}))),uri:e.artist.uri,id:e.artist.id}))),Ea=({uri:e,track:a,richTrackArtists:i})=>{const o=(0,fa.o)(),S=(0,ue.k)(),F=(0,Ta.g)(),L=(0,s.TH)(),f=(0,n.v9)(ja.br),T=c.ag.getUrlLocale(),I=(0,Y.S9)({localeFeatureFlag:f,urlLocale:T,type:"locale"}),{artistsWithRoles:R,albumOfTrack:w,duration:D,name:O}=a,E=w?.coverArt,Z=w?.copyright.items,V=w?.courtesyLine,Q=w?.date?.isoString,H=E?.extractedColors?.colorRaw.hex,J=(E?.sources||[]).map((e=>({url:e.url,width:e.width||void 0,height:e.height||void 0}))),X={uri:w?.uri||"",name:w?.name||""},ee=(0,r.W6)(G.YS),ae=(0,_.vI)(W.k.RTPFeaturedArtists,L),ie=(0,n.v9)(Ra.$2),te=(0,K.xU)(ie,a.id),ne=ae||te,se=ne&&i,le=Ua(R),re=se?le.concat(Ua(i.otherArtists)):le,{spec:de,logger:oe}=(0,z.fU)(d.createDesktopTrackEventFactory,{data:{uri:e}}),ce=(0,n.v9)(ba.n5),me=(0,n.v9)(Ia.rZ);(0,La.M)({category:"rtp-feat-artist-and-credits-test",action:"remote-config-response",remoteConfigProperty:G.es,label:"dwp",context:`${e}|${ne}`,country:ce?me:"",spt:!0,isAnonymous:F}),(0,La.M)({category:"track_ilr_exposures",action:"track_page_visit",remoteConfigProperty:G.YS,label:"dwp",context:`${e}|[]`,country:ce?me:"",spt:!0,isAnonymous:F});const ke=a.playability.playable,ve=(0,fe.Y)(e),{togglePlay:ge,isPlaying:he,isActive:pe}=(0,B.n)({uri:ve},{featureIdentifier:"track"}),[Ne,Se]=(0,C.Z)(e),xe=(0,t.useCallback)((async()=>{o({targetUri:e,intent:Ne?"unsave":"save",type:"click"});const a=de.actionBarFactory().saveButtonFactory();oe.logInteraction(Ne?a.hitRemoveLike({itemNoLongerLiked:e}):a.hitLike({itemToBeLiked:e}));try{await Se(!Ne)}catch{}}),[o,e,Ne,de,oe,Se]),ye=(0,t.useCallback)((()=>(0,M.Zs)({i18n:c.ag,trackArtistsList:re.map((e=>e.name)).join(c.ag.getSeparator()),trackName:a.name,shouldLocalize:I})),[re,I,a.name]),Ae=(0,t.useCallback)(((e,a)=>{oe.logInteraction(de.headerFactory().artistLinkFactory({position:a.position,uri:a.creator.uri}).hitUiNavigate({destination:a.creator.uri}))}),[oe,de]),je=(0,t.useCallback)((()=>{const a=(0,y.aK)({isPlaying:he,isActive:pe,spec:de.actionBarFactory().playButtonFactory(),logger:oe,uri:e});ge({loggingParams:a})}),[pe,he,oe,de,ge,e]),be=(0,t.useCallback)((()=>{oe.logInteraction(de.actionBarFactory().contextButtonFactory().hitUiReveal())}),[oe,de]);return(0,P.jsxs)("section",{"data-testid":"track-page",children:[(0,P.jsx)(Ca.$,{children:ye()}),(0,P.jsxs)(h.gF,{backgroundColor:H,children:[(0,P.jsxs)(p.W,{children:[(0,P.jsx)(x.$,{size:"md",onClick:je,disabled:!ke,isPlaying:he,uri:e}),(0,P.jsx)(N.i,{text:O,dragUri:e,dragLabel:O})]}),(0,P.jsx)(A._P,{menu:(0,P.jsx)(g.$,{uri:e}),children:(0,P.jsx)(h.Oz,{dragUri:e,images:J,name:O,placeholderType:"album"})}),(0,P.jsxs)(h.sP,{children:[(0,P.jsx)(l.D,{variant:"mestoBold",children:c.ag.get("song")}),(0,P.jsx)(A._P,{menu:(0,P.jsx)(g.$,{uri:e}),children:(0,P.jsx)(h.xd,{dragUri:e,dragLabel:O,children:O})}),ne?(0,P.jsx)(h.QS,{creators:le,releaseDate:Q,durationMilliseconds:D.totalMilliseconds,onCreatorClick:Ae,isTrack:!0,album:X}):(0,P.jsx)(h.QS,{creators:le,releaseDate:Q,durationMilliseconds:D.totalMilliseconds,onCreatorClick:Ae,isTrack:!0})]})]}),(0,P.jsx)(m.o,{backgroundColor:H,children:(0,P.jsxs)(m.F,{children:[(0,P.jsx)(h.rn,{children:(0,P.jsx)(x.$,{onClick:je,isPlaying:he,disabled:!ke,size:"lg",uri:e})}),(0,P.jsx)(h.rn,{children:(0,P.jsx)(u.H,{isAdded:!!Ne,onClick:xe,disabled:!S,size:u.q.md})}),(0,P.jsx)(k.o,{uri:e,isFollowing:!!Ne,onFollow:xe,size:k.q.md}),(0,P.jsx)(A.yj,{menu:(0,P.jsx)(g.$,{uri:e}),onShow:be,children:(0,P.jsx)(v.z,{label:c.ag.get("more.label.context",O)})})]})}),(0,P.jsxs)(U,{children:[(0,P.jsxs)("div",{className:"contentSpacing",children:[(0,P.jsx)("div",{className:De,children:(0,P.jsx)(b.T,{render:({columnCount:a})=>(0,P.jsx)(Fa,{albumArtists:re,columnCount:a,uri:e})})}),se?(0,P.jsx)(He,{track:a,richTrackArtists:i}):(0,P.jsx)(He,{track:a})]}),(0,P.jsxs)("div",{className:"contentSpacing",children:[(0,P.jsxs)("div",{className:Oe,children:[(0,P.jsx)(j.k,{copyrights:Z||[],courtesyLine:V}),!F&&(0,P.jsx)(q,{uri:e})]}),(Fe=ee,Fe===G.Zn.CANONICAL_BOTTOM_POSITION&&(0,P.jsx)("div",{"data-testid":"canonical-pool-bottom"})),$(ee)&&(0,P.jsx)("div",{"data-testid":"organic-pool-bottom"})]})]})]});var Fe},Ba=(0,t.memo)((function(){const{trackId:e=""}=(0,s.UO)(),a=(0,o.tn)(e).toURI(),i=(0,Pa.QN)({uri:a}),t=Oa(a);return i.loading||"Track"!==i.data?.trackUnion?.__typename?(0,P.jsx)(S.h,{hasError:null!==i.error,errorMessage:c.ag.get("track-page.error")}):(0,P.jsx)(F.fd,{surface:F.Tg.TRACK,uris:[a,i.data.trackUnion.albumOfTrack?.uri??null],children:(0,P.jsx)(Ea,{uri:a,track:i.data.trackUnion,richTrackArtists:t})})}))},40610:(e,a,i)=>{i.d(a,{M:()=>c});var t=i(59496),n=i(50787),s=i(79739),l=i(36844),r=i(95357),d=i(37180),o=i(55760);const c=({category:e,action:a,remoteConfigProperty:i,defaultVariant:c,label:m,context:u,country:k,spt:v=!1,isAnonymous:g=!1})=>{const h=(0,l.W6)(i),p=(0,o.s4)();(0,t.useEffect)((()=>{if(!h||!m)return;const i={category:e,action:a,variant:c??h,label:m,os:(0,r.y)(),...u&&{context:u},...k&&{country:k},...v&&{sp_t:(0,d.vQ)("sp_t")}};g?p.send((0,s.k)(i)):p.send((0,n.x)(i))}),[h,m,e,a,u,k,v,g,p,c])}},25915:(e,a,i)=>{i.d(a,{k:()=>l});var t=i(56162);const n="rTMkDBDp47Eo12ZEQv4U";var s=i(4637);const l=({copyrights:e,courtesyLine:a})=>{const i=(e||[]).map(((e,a)=>{const i=e.text.replace(/^(\(C\)\s+)/,"").replace(/^(\(P\)\s+)/,"").replace(/^(©\s+)/,"").replace(/^(℗\s+)/,"");let n;return n="C"===e.type?"©":"P"===e.type?"℗":`(${e.type})`,(0,s.jsx)(t.D,{as:"p",variant:"finale",dir:"auto",children:`${n} ${i}`},a)}));return a&&i.unshift((0,s.jsx)(t.D,{as:"p",variant:"finale",dir:"auto",children:a},i.length)),(0,s.jsx)("div",{className:n,children:i})}},71857:(e,a,i)=>{i.d(a,{j:()=>n,vI:()=>t});const t=(e,a)=>{const i=a?new URLSearchParams(a.search):void 0;return"1"===i?.get(e)},n=(e,a)=>e.map((e=>t(e,a)))},90350:(e,a,i)=>{i.d(a,{k:()=>t});let t=function(e){return e.RichAlbumPageUI="ralphui",e.RichAlbumPageData="ralphdata",e.I18nSEO="i18nSEO",e.RTPFeaturedArtists="rtpv2p1",e.RTPTrackCredits="rtpv2p2",e.BlendParty="bp",e.BlendPartyV2="bpv2",e.VideoPodcastShowTitleTag="vidpodshow",e.I18nAdditionalPages="i18nap",e}({})}}]);
|
|
//# sourceMappingURL=xpui-routes-track-v2.js.map
|