Files
dotfiles/.config/spicetify/Extracted/Themed/xpui/2711.js
T
2024-05-05 19:02:45 +02:00

2 lines
12 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[2711],{30435:(e,i,s)=>{s.d(i,{Z:()=>o});var r=s(8071),a=s(32540),t=s(79865),n=s(11527);const o=({name:e,uri:i,images:s,isHero:o,testId:l,description:d,index:c,requestId:u,color:m})=>(0,n.jsx)(r.C,{index:c,featureIdentifier:"artist_concerts",headerText:e,uri:i,isPlayable:!1,renderCardImage:()=>(0,n.jsx)(a.x,{isHero:o,images:s,color:m}),renderSubHeaderContent:()=>(0,n.jsx)(t.i,{isHero:o,children:(0,n.jsx)("span",{children:d||""})}),testId:l,requestId:u})},20537:(e,i,s)=>{s.d(i,{T:()=>P});s(86277);var r=s(50959),a=s(69736),t=s(60702),n=s(79126),o=s(98779),l=s(24441),d=s(21933),c=s(76463),u=s(10226),m=s(85255),x=s(85648),g=s(80626),p=s(58912),I=s(17676);const h="iSdDcgYotxUpyRSGLR62",j="EqZ5uEZ02bJiKlZNijVQ",y="UroGtnEGQiwN1yKyNXjC",C="Tv3tod8ggHvNrrRzE1Kg",b="dWaG35yHF_9XzU2FlAce";var f=s(11527);const k=({content:e})=>(0,f.jsxs)(a.x,{as:"p",semanticColor:"textBrightAccent",className:b,children:[(0,f.jsx)(t.V,{size:"small"}),e]}),E=({content:e})=>(0,f.jsxs)(a.x,{as:"p",semanticColor:"textBrightAccent",className:b,children:[(0,f.jsx)(n.o,{size:"small"}),e]}),S=({content:e})=>(0,f.jsx)(a.x,{as:"p",className:b,children:e}),T=e=>{switch(e.type){case"SPOTIFY_EXCLUSIVE":return(0,f.jsx)(k,{...e});case"TOP_FANS_EXCLUSIVE":case"TOP_FANS_DISCOUNT":case"LIMITED_EDITION":return(0,f.jsx)(E,{...e});default:return(0,f.jsx)(S,{...e})}},H=({price:e,salePrice:i})=>i?(0,f.jsxs)("div",{children:[(0,f.jsxs)(a.x,{variant:"bodySmall",semanticColor:"textBrightAccent",children:[i," "]}),(0,f.jsx)(a.x,{variant:"bodySmall",style:{textDecoration:"line-through"},children:e})]}):(0,f.jsx)(a.x,{variant:"bodySmall",children:e}),P=({name:e,uri:i,href:s,images:a,index:t,price:n,testId:b,salePrice:k,label:E,artists:S})=>{const P=(0,u.W6)(I.WDb),q=(0,r.useMemo)((()=>S.items.map((e=>"profile"in e.data?e.data.profile.name:"")).join(x.ag.getSeparator())),[S.items]),{spec:v,logger:O}=(0,g.fU)(m.I,{data:{position:t,uri:i,reason:E?.type||""}}),L=(0,p.X)(a,{desiredSize:300}),N=(0,r.useCallback)((()=>{O.logInteraction(v.cardLinkFactory({position:0}).hitNavigateToExternalUri({destination:s})),window.open(s,"_blank")}),[s,O,v]);return(0,f.jsx)(o.Z,{id:i,"data-testid":b,title:(0,f.jsx)(l.l,{className:C,children:e}),pretitle:E&&(0,f.jsx)(T,{type:E.type,content:E.content}),media:(0,f.jsx)("div",{className:h,children:L?(0,f.jsx)(d.x,{size:"sm",src:L?.url,alt:e}):(0,f.jsx)("div",{className:j,children:(0,f.jsx)("div",{className:y,children:(0,f.jsx)(c.C,{size:"xxlarge","aria-hidden":!0,"data-testid":"card-image-fallback"})})})}),onClick:N,size:P?"md":"sm",subtitle:(0,f.jsx)(H,{price:n,salePrice:k}),body:q},i)}},93312:(e,i,s)=>{s.d(i,{h:()=>Y});var r=s(10226),a=s(72543),t=s(25959),n=s(33563),o=s(11317),l=s(85648),d=s(8071),c=s(32540),u=s(79865),m=s(31948),x=s(33874),g=s(11527);const p=({name:e,uri:i,images:s,isHero:r,onClick:a,testId:t,description:n,index:o,requestId:p,color:I})=>r?(0,g.jsx)(m.Z,{featureIdentifier:"genre",index:o,onClick:a,headerText:e,uri:i,isPlayable:!1,renderCardImage:()=>(0,g.jsx)(c.x,{isHero:r,images:s,color:I}),renderSubHeaderContent:()=>(0,g.jsx)(u.i,{isHero:!0,children:(0,g.jsx)(x.k,{children:n||l.ag.get("card.tag.genre")})}),testId:t,requestId:p}):(0,g.jsx)(d.C,{index:o,featureIdentifier:"genre",onClick:a,headerText:e,uri:i,isPlayable:!1,renderCardImage:()=>(0,g.jsx)(c.x,{isHero:r,images:s,color:I}),renderSubHeaderContent:()=>(0,g.jsx)(u.i,{children:(0,g.jsx)("span",{children:n||""})}),testId:t,requestId:p}),I=({name:e="",uri:i="",images:s=[],isHero:r,onClick:a,testId:t,index:n})=>r?(0,g.jsx)(m.Z,{featureIdentifier:"unknown",index:n,onClick:a,headerText:e,uri:i,isPlayable:!1,renderCardImage:()=>(0,g.jsx)(c.x,{isHero:r,images:s}),renderSubHeaderContent:()=>(0,g.jsx)(u.i,{isHero:!0,children:(0,g.jsx)(x.k,{})}),testId:t}):(0,g.jsx)(d.C,{index:n,featureIdentifier:"unknown",onClick:a,headerText:e,uri:i,isPlayable:!1,renderCardImage:()=>(0,g.jsx)(c.x,{isHero:r,images:s}),renderSubHeaderContent:()=>(0,g.jsx)(u.i,{children:(0,g.jsx)("span",{})}),testId:t});var h=s(936),j=s(10590),y=s(30435),C=s(20109),b=s(20537),f=s(87964),k=s(15103),E=s(88195),S=s(48672),T=s(25750);const H=({entity:e,index:i,testId:s,isHero:r=!1})=>{const n=((0,o.EC)(e.uri)||{}).type,l={testId:s,isHero:r,index:i,sharingInfo:e.sharingInfo};if(("string"==typeof e.uri||e.uri instanceof String)&&e.uri.startsWith("spotify:merch:")){const i=e.description?e.description.split("•")[0]:"";return(0,g.jsx)(b.T,{...l,name:e.name,uri:e.uri,href:e.href,images:e.images,price:i,artists:e.artists||{items:[]},label:null,salePrice:null})}if(("string"==typeof e.uri||e.uri instanceof String)&&e.uri.startsWith("spotify:artist:")&&e.uri.endsWith(":concerts"))return(0,g.jsx)(y.Z,{...l,name:e.name,uri:e.uri,images:e.images,description:e.description});switch(n){case o.JM.ALBUM:case o.JM.COLLECTION_ALBUM:{const i=e;return(0,g.jsx)(a.r,{...l,name:i.name,uri:i.uri,images:i.images,artists:i.artists})}case o.JM.ARTIST:{const i=e;return(0,g.jsx)(t.I,{...l,name:i.name,uri:i.uri,images:i.images})}case o.JM.EPISODE:{const i=e;return(0,g.jsx)(C.B,{...l,name:i.name,uri:i.uri,images:i.images,showImages:i.show?.images||[],durationMilliseconds:i.duration_ms,releaseDate:i.release_date,resume_point:i.resume_point,description:i.description,isExplicit:i.explicit,is19PlusOnly:!!i.tags?.includes("MOGEF-19+")})}case o.JM.PLAYLIST:case o.JM.PLAYLIST_V2:{const i=e,s=i.owner?.display_name||e.owner?.displayName||"";return(0,g.jsx)(f.Z,{...l,name:i.name,uri:i.uri,images:i.images,description:i.description,authorName:s})}case o.JM.PROFILE:return(0,g.jsx)(k.P,{...l,name:e.name,uri:e.uri,images:e.images});case o.JM.SHOW:{const i=e;return(0,g.jsx)(E._,{...l,name:i.name,uri:i.uri,images:i.images,publisher:i.publisher,mediaType:{audio:j.E.AUDIO,video:j.E.VIDEO,mixed:j.E.MIXED}[i.media_type]??j.E.AUDIO})}case o.JM.APPLICATION:return(0,g.jsx)(p,{...l,name:e.name,uri:e.uri,images:e.images,description:e.description});case o.JM.TRACK:{const i=e;return(0,g.jsx)(S.G,{...l,name:i.name,uri:i.uri,images:i.album?.images||[],artists:i.artists,album:i.album,isExplicit:i.explicit,is19PlusOnly:i.tags?.includes("MOGEF-19+")})}case o.JM.COLLECTION:return e.uri.endsWith("your-episodes")?(0,g.jsx)(T.T,{index:i}):(0,g.jsx)(h.p,{index:i});default:return console.warn("Rendering a generic Card for unknown type:",n),(0,g.jsx)(I,{...l,name:e.name,uri:e.uri,images:e.images})}};s(86277);var P=s(50959),q=s(69736),v=s(72518),O=s(82579),L=s(6807),N=s(45438),w=s(94452),_=s(2017),A=s(76281);const M=P.memo((function({uri:e,sharingInfo:i}){const{spec:s}=(0,w.T)(e);return(0,g.jsx)(N.JL,{value:"album",children:(0,g.jsxs)(L.v,{children:[(0,g.jsx)(_.q,{divider:"before",children:(0,g.jsx)(A.Jx,{uri:e,spec:s,sharingInfo:i,displayText:l.ag.get("context-menu.copy-album-link")})}),(0,g.jsx)(A.h$,{spec:s,divider:"before",uri:e})]})})}));var U=s(67937),D=s(43104),J=s(32793),R=s(27838),z=s(60046);const F=({artist:e,index:i,logger:s,spec:r})=>{const a=(0,P.useCallback)((()=>{s.logInteraction(r.cardLinkFactory({position:i}).hitUiNavigate({destination:e.uri}))}),[s,r,i,e.uri]);return(0,U.i)(e)&&e.uri?(0,g.jsx)(O._,{menu:(0,g.jsx)(R.m,{uri:e.uri}),children:(0,g.jsx)(z.default,{to:e.uri,dir:"auto",onClick:a,children:e.name})},e.uri):(0,g.jsx)(q.x,{variant:"bodySmall",children:e.name})},Z=({name:e,uri:i,images:s,artists:r=[],sharingInfo:a,isHero:t=!1,onClick:n,testId:o,index:p,requestId:I,color:h,release:j,releaseTimezone:y})=>{let C;const b=(0,J.Y)(i),f=()=>r.map((e=>e.name)).join(l.ag.getSeparator()),k=({logger:e,spec:i})=>(0,g.jsx)("span",{children:r.map(((s,r)=>[r>0&&l.ag.getSeparator(),(0,g.jsx)(F,{artist:s,index:r,logger:e,spec:i},s.uri)]))}),E=()=>(0,g.jsx)(q.x,{variant:"bodySmall",semanticColor:"textSubdued",children:(0,g.jsx)("span",{children:l.ag.get("web-player.album-prerelease.releases_on",{date:l.ag.formatDate((0,D.RX)(j.date),(0,D.Hd)({month:"long",day:"numeric",year:"numeric",timeZone:y},j.precision))})})});return C=t?(0,g.jsx)(m.Z,{isPlayable:!1,index:p,onClick:n,headerText:e,featureIdentifier:"album",uri:i,playUri:b,ariaPauseLabel:l.ag.get("tracklist.a11y.pause",e,f()),ariaPlayLabel:l.ag.get("tracklist.a11y.play",e,f()),renderCardImage:()=>(0,g.jsx)(c.x,{isHero:!0,images:s,color:h,FallbackComponent:e=>(0,g.jsx)(v.c,{size:"xxlarge",...e})}),renderSubHeaderContent:(e,i)=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(x.k,{children:l.ag.get("card.tag.album")}),(0,g.jsx)(k,{logger:e,spec:i})]}),getSignifierContent:()=>(0,g.jsx)(E,{}),testId:o,requestId:I}):(0,g.jsx)(d.C,{isPlayable:!1,onClick:n,headerText:e,featureIdentifier:"album",uri:i,playUri:b,ariaPauseLabel:l.ag.get("tracklist.a11y.pause",e,f()),index:p,ariaPlayLabel:l.ag.get("tracklist.a11y.play",e,f()),renderCardImage:()=>(0,g.jsx)(c.x,{isHero:t,images:s,color:h,FallbackComponent:e=>(0,g.jsx)(v.c,{size:"xxlarge",...e})}),renderSubHeaderContent:(e,i)=>(0,g.jsxs)(u.i,{children:[(0,g.jsx)(E,{}),r.length>0&&(0,g.jsx)("span",{children:" • "}),(0,g.jsx)(k,{logger:e,spec:i})]}),testId:o,requestId:I}),(0,g.jsx)(O._,{menu:(0,g.jsx)(M,{uri:i,artistUri:r?.[0]?.uri,sharingInfo:a}),children:C})};var B=s(17676),G=s(54644),V=s(82857),W=s(58301),X=s(86461);const Y=({entity:e,index:i,testId:s,onClick:o,isHero:l=!1})=>{const d=(0,W.E)(),c=(0,X.s)(),u=(0,r.W6)(B.Kpm),m=d||c;switch(e.type){case V.p.ALBUM:return(0,g.jsx)(a.r,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,artists:e.artists,year:e.year,sharingInfo:null,requestId:e.requestId,color:e.color},e.uri);case V.p.ARTIST:return(0,g.jsx)(t.I,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,requestId:e.requestId,color:e.color},e.uri);case V.p.AUDIOBOOK:return(0,g.jsx)(n.c,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,authorName:e.authorName,requestId:e.requestId,color:e.color,signifierText:e.signifierText},e.uri);case V.p.EPISODE:return(0,g.jsx)(C.B,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,showImages:e.show?.images||[],durationMilliseconds:e.duration.milliseconds,releaseDate:e.release.date,resume_point:null,description:e.description,isExplicit:e.isExplicit,is19PlusOnly:e.is19PlusOnly,sharingInfo:null,requestId:e.requestId,color:e.color,episodeShow:e.show},e.uri);case V.p.GENRE:return(0,g.jsx)(p,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,requestId:e.requestId,color:e.color},e.uri);case V.p.PLAYLIST:return(0,g.jsx)(f.Z,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,description:"",authorName:e.owner.displayName,authorUri:e.owner.uri,requestId:e.requestId,color:e.color,isPlayable:!(0,G.T)(e.formatListData?.attributes)},e.uri);case V.p.USER:return(0,g.jsx)(k.P,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,requestId:e.requestId,color:e.color},e.uri);case V.p.SHOW:return(0,g.jsx)(E._,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,publisher:e.publisher,sharingInfo:null,requestId:e.requestId,color:e.color},e.uri);case V.p.TRACK:return(0,g.jsx)(S.G,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.album?.images||[],artists:e.artists,album:m?null:e.album,isExplicit:e.isExplicit,is19PlusOnly:e.is19PlusOnly,sharingInfo:null,requestId:e.requestId,isLyricsMatch:e.isLyricsMatch,color:e.color,hasAssociatedVideo:e.hasAssociatedVideo&&u},e.uri);case V.p.PRE_RELEASE:return(0,g.jsx)(Z,{testId:s,onClick:o,isHero:l,index:i,name:e.name,uri:e.uri,images:e.images,artists:e.artists,sharingInfo:null,requestId:e.requestId,color:e.color,release:e.release,releaseTimezone:e.releaseTimezone},e.uri);default:return console.warn('Rendering SearchEntityCard using the old method <DeprecatedEntityCardByUriType /> as the entity doesn\'t contain the new "type" EntityType enum.'),(0,g.jsx)(H,{testId:s,onClick:o,isHero:l,index:i,entity:e})}}},76578:(e,i,s)=>{s.d(i,{q:()=>c});var r=s(7863),a=s(85648),t=s(93312);const n="x-searchHistoryEntries-searchHistoryEntry",o="x-searchHistoryEntries-clearSingleSearchHistory",l="x-searchHistoryEntries-clearSingleSearchHistoryButton";var d=s(11527);const c=({entity:e,index:i,clearSearchHistory:s})=>(0,d.jsxs)("div",{className:n,children:[(0,d.jsx)(t.h,{entity:{...e,requestId:void 0},index:i}),(0,d.jsx)("div",{className:o,children:(0,d.jsx)("button",{className:l,onClick:()=>s(e.uri),"aria-label":a.ag.get("remove"),children:(0,d.jsx)(r.k,{size:"small"})})})]},e.uri)},37286:(e,i,s)=>{s.d(i,{Z:()=>r});const r={searchPageGrid:"search-recentSearches-searchPageGrid",narrowPage:"search-recentSearches-narrowPage"}}}]);
//# sourceMappingURL=2711.js.map