text: "use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[553],{90110:(e,t,a)=>{a.d(t,{q:()=>T,o:()=>L});var l=a(67294),n=a.n(l),r=a(69518),o=a.n(r),s=a(50020),i=a(96895),c=a(24656),u=a(69010),m=a(94184),d=a.n(m);const g="_d4_L7w1NI7t09jkH7cu",p="q6RbWlHDlbjkbXsca2Yd",E="YuL8TZO5okStcwZtm4zm",f="_TQIlzCUR8U8a6e2b1GQ",y="UvNLcAhjESB_LRPqmfOK",b="JRR8DDodD_hwH0AdW_Z1",w="_YsfF19yZTzikt2Ed8hB";var C=a(6116),h=a(20657),k=a(40080),v=a(38209);var D=a(80946),S=a(83692);let T;!function(e){e[e.sm=24]="sm",e[e.md=32]="md"}(T||(T={}));const x=e=>{const{currentTarget:t,detail:a}=e;a>0&&t&&t.blur()},L=({uri:e,isFollowing:t,onFollow:a,size:r=T.sm,className:m})=>{const L={"--size":`${r}px`},{useDownloading:R,useDownloadCapability:_}=(0,l.useContext)(c.I),[N,A]=(0,l.useState)(!1),[O,I]=_(o().isEpisode(e)),[P,B]=(0,l.useState)(!1),{currentAvailability:Q,progress:U,beginDownload:F,clearDownload:M}=R(e);((e,t)=>{const a=(0,v.r)(),n=(0,l.useRef)(!1);(0,l.useEffect)((()=>{e===u.V8.DOWNLOADING&&!1===n.current&&(n.current=!0,a.say(h.ag.get("download.downloading",t.totalItems)))}),[a,e,t]);const r=(0,k.D)(e);(0,l.useEffect)((()=>{r===u.V8.DOWNLOADING&&e===u.V8.YES&&(n.current=!1,a.say(h.ag.get("download.complete")))}),[a,r,e])})(Q,U);const z=(0,l.useCallback)((e=>{I===u.v$.DOWNLOADING_NOT_ALLOWED?B(!0):!1===t?(a(),A(!0)):F(),x(e)}),[F,I,t,a]),Y=(0,l.useCallback)((e=>{M(),x(e)}),[M]);return(0,l.useEffect)((()=>{!0===N&&!0===t&&(F(),A(!1))}),[t,N,F]),O===u.PQ.NO_DOWNLOAD_CAPABILITY?null:I===u.v$.DOWNLOADING_NOT_ALLOWED?n().createElement("div",{className:p},n().createElement(S.w,{label:h.ag.get("download.download")},n().createElement("button",{className:d()(E,m),role:"switch",onClick:z,"aria-label":h.ag.get("download.download"),"aria-checked":!1},n().createElement(s.a,{iconSize:r}))),P&&n().createElement("div",{className:w},n().createElement(D.E,{withTopLeftPointer:!0,horizontal:!0,onClose:()=>{B(!1)}},h.ag.get("download.upsell")))):Q===u.V8.YES?n().createElement(S.w,{label:h.ag.get("download.remove")},n().createElement("button",{className:d()(E,m,f),role:"switch",onClick:Y,"aria-label":h.ag.get("download.remove"),"aria-checked":!0},n().createElement(i.C,{iconSize:r}))):Q===u.V8.NO?n().createElement(S.w,{label:h.ag.get("download.download")},n().createElement("button",{className:d()(E,m),role:"switch",onClick:z,"aria-label":h.ag.get("download.download"),"aria-checked":!1},n().createElement(s.a,{iconSize:r}))):n().createElement("div",{className:d()(y,m),role:"switch","aria-checked":!0},n().createElement(S.w,{label:h.ag.get("download.cancel")},n().createElement("button",{style:L,className:d()(E,g,m),onClick:Y,"aria-label":h.ag.get("download.cancel")})),n().createElement("span",{style:L,className:d()(b,g)},n().createElement(C.e,{"aria-valuetext":h.ag.get("progress.downloading-tracks"),percentage:U.percentage,size:r})))}},55546:(e,t,a)=>{a.r(t),a.d(t,{LikedSongs:()=>Q,LikedSongsContainer:()=>U,default:()=>F,likedSongscolumns:()=>B});var l=a(67294),n=a.n(l),r=a(47886),o=a(30947),s=a(55911),i=a(20657),c=a(45342),u=a(4236),m=a(1169),d=a(90110),g=a(19565),p=a(53424),E=a(28248),f=a(59482),y=a(72907),b=a(61048);const w=()=>n().createElement("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M47 18.538L48 16.806L31.478 7.26801V42.327C29.826 40.299 27.313 39 24.5 39C19.538 39 15.5 43.038 15.5 48C15.5 52.963 19.538 57 24.5 57C29.27 57 33.175 53.266 33.471 48.569L33.478 48.433C33.485 48.288 33.485 47.711 33.478 47.566V10.732L47 18.538ZM31.478 48.434C31.252 52.091 28.213 55 24.5 55C20.64 55 17.5 51.86 17.5 48C17.5 44.141 20.64 41 24.5 41C28.213 41 31.252 43.909 31.478 47.566V48.434Z",fill:"currentColor"}));var C=a(1663),h=a(71927),k=a(2751),v=a(37338),D=a(55120),S=a(22423),T=a(78462),x=a(53646),L=a(32129),R=a(30520),_=a(84242),N=a(49955),A=a(7692),O=a(92510);var I=a(14893),P=a(70369);const B=[E.QD.INDEX,E.QD.TITLE,E.QD.ALBUM,E.QD.ADDED_AT,E.QD.DURATION],Q=({metadata:e,canFilter:t,canSort:a})=>{const{uri:c,name:E,images:I,totalLength:Q,owner:U}=e,{filterBoxApiRef:F,filterBoxDomRef:M,tracklistDomRef:z,handleKeyDown:Y}=(0,m.Q)(),V=(0,u.k)()&&Q>0,W=Q>0,Z=(0,l.useMemo)((()=>({id:U.username,uri:U.uri,name:U.username,displayName:U.displayName||void 0,images:U.images||[]})),[U]),H=(0,x.Y5)("#5038a0"),{filter:G}=(0,l.useContext)(S.fo),{sortState:K}=(0,l.useContext)(T.Gb),j=(0,r.k6)(),q="POP"!==j.action?new URLSearchParams(j.location.search).get("uri"):null,{isPlaying:X,togglePlay:J,usePlayContextItem:$}=(0,_.n)(function(e,t,a){const l={uri:e};return(0,N.R4)(l,t),(0,A.I)(l,(0,O.cj)(a)),l}(c,(0,R.w)(K),G),{featureIdentifier:"your_library",referrerIdentifier:"your_library"}),ee=()=>J();return n().createElement("section",{role:"presentation",className:k.Z.playlist,"data-testid":"playlist-page",onKeyDown:Y},n().createElement(P.$,null,i.ag.get("playlist.page-title",E)),n().createElement(p.gF,{backgroundColor:H},n().createElement(f.W,null,n().createElement(D.$,{size:s.qE.sm,onClick:ee,isPlaying:X,uri:c,ariaPauseLabel:i.ag.get("liked-songs.a11y.pause",E),ariaPlayLabel:i.ag.get("playlist.a11y.play",E)}),n().createElement(y.i,{text:E})),n().createElement("div",{className:k.Z.playlistImageContainer},n().createElement(v.T,{canEdit:!1,name:E,images:I,onClick:()=>{},placeholderType:"playlist"})),n().createElement(p.sP,null,n().createElement(p.dy,{small:!0,uppercase:!0},i.ag.get("playlist")),n().createElement(p.xd,{canEdit:!1,onClick:()=>{},className:k.Z.playlistTitle},E),n().createElement(p.QS,{creators:[Z],totalTracks:Q}))),n().createElement(o.o,{backgroundColor:H},n().createElement(o.F,null,W?n().createElement(D.$,{onClick:ee,isPlaying:X,size:s.qE.lg,uri:c,ariaPauseLabel:i.ag.get("liked-songs.a11y.pause",E),ariaPlayLabel:i.ag.get("playlist.a11y.play",E)}):null,V?n().createElement(d.o,{uri:c,isFollowing:!0,onFollow:()=>{},size:d.q.md}):null,t&&a&&n().createElement("div",{className:k.Z.searchBoxContainer},n().createElement(b.K,{placeholder:i.ag.get("playlist.search_in_playlist"),filterBoxApiRef:F,outerRef:M}),n().createElement(L.c,{columns:T.P0})))),n().createElement("div",{className:"contentSpacing"},Q>0?n().createElement(l.Suspense,{fallback:n().createElement(C.h,{errorMessage:i.ag.get("error.request-collection-tracks-failure")})},n().createElement(h.p,{nrTracks:Q,columns:B,collectionUri:c,scrollToUri:q,usePlayContextItem:$,outerDomRef:z})):n().createElement(g.u,{message:i.ag.get("collection.empty-page.songs-subtitle"),title:i.ag.get("collection.empty-page.songs-title"),linkTo:"/search",linkTitle:i.ag.get("collection.empty-page.songs-cta"),renderInline:!0},n().createElement(w,null))))},U=n().memo((()=>{const e=(0,I.b)(),t=(0,l.useContext)(c.H).getCapabilities();return e?n().createElement(T.kz,{uri:e.uri},n().createElement(S.hz,{uri:e.uri},n().createElement(Q,{metadata:e,canFilter:t.canFilter&&e.totalLength>0,canSort:t.canSort&&e.totalLength>0}))):n().createElement(C.h,{errorMessage:i.ag.get("error.not_found.title.playlist"),loadOffline:t.canModifyOffline})})),F=U},22578:(e,t,a)=>{a.d(t,{$:()=>g});var l=a(20657),n=a(67294),r=a.n(n),o=a(64593),s=a(8341),i=a(83693),c=a(76303),u=a(47886),m=a(24183);function d(e){return e.includes("Spotify")?e:`Spotify – ${e}`}const g=({children:e})=>{let t=d(e);(e=>{const{mainLandmarkRef:t}=(0,m.Oh)(),a=(0,u.k6)(),l=(0,n.useRef)(a.length<2);l.current=a.length<2,(0,n.useEffect)((()=>{const a=t.current;a&&!l.current&&e&&(a.setAttribute("aria-label",e),a.focus())}),[e,t])})(e);const a=(0,s.Y)(c.o9)===i.PO.PLAYING,g=(0,s.Y)((e=>null==e?void 0:e.item));return g&&a&&((0,i.G_)(g)?t=[g.name,g.artists.map((e=>e.name)).join(l.ag.getSeparator())].join(" · "):(0,i.iw)(g)?t=[g.name,g.show.name].join(" · "):(0,i.k6)(g)&&(t=d(l.ag.get("ad-formats.advertisement")))),r().createElement(o.q,{defaultTitle:"Spotify",defer:!1},r().createElement("title",null,t))}},70369:(e,t,a)=>{a.d(t,{$:()=>l.$});var l=a(22578)},37338:(e,t,a)=>{a.d(t,{T:()=>d});var l=a(67294),n=a.n(l),r=a(25678),o=a(53424),s=a(33732),i=a(22023),c=a(15212);const u="TQSVBI8VWiRisssL6c71",m="UTbTW30nlYwR3HjUFFJr",d=function({onClick:e,name:t,images:a,canEdit:l,placeholderType:d,shape:g=o.Kc.SQUARE,dragUri:p=""}){const[E,f]=(0,s.RH)(a),y=(0,r.VO)(E,f)===r.KO.loaded,b=(0,c.O1)([p],t);return n().createElement("div",{className:u,"data-testid":`${d}-image`,draggable:!!p,onDragStart:b},n().createElement(o.Oe,{loading:"eager",name:t,images:a,placeholderType:d,shape:g}),l&&n().createElement("div",{className:m},n().createElement(i.F,{overlay:y,onClick:e,rounded:g===o.Kc.CIRCLE})))}},71927:(e,t,a)=>{a.d(t,{p:()=>y});var l=a(67294),n=a.n(l),r=a(28248),o=a(42922),s=a(49961),i=a(20657),c=a(36132),u=a(30520),m=a(22423),d=a(78462),g=a(45342),p=a(35308);const E=new Set(d.P0),f=new Set([]),y=n().memo((({nrTracks:e,collectionUri:t,columns:a,uri:y,sortable:b=!0,scrollToUri:w,usePlayContextItem:C,outerDomRef:h})=>{const k=(0,l.useContext)(g.H),v=(0,l.useRef)(null),[D,S]=(0,l.useState)(e),{filter:T}=(0,l.useContext)(m.fo),x=(0,l.useRef)((()=>{})),[L,R]=(0,l.useState)([]),{sortState:_,setSortState:N}=(0,l.useContext)(d.Gb),A=(0,l.useCallback)((e=>{N((0,c.VK)(e,_))}),[N,_]);(0,l.useEffect)((()=>{v.current&&v.current.update()}),[_,T]),(0,l.useEffect)((()=>{v.current&&""===T&&v.current.scrollToFirstSelected()}),[T,D]),(0,l.useEffect)((()=>{S(e)}),[e]),(0,l.useEffect)((()=>{v.current&&w&&v.current.scrollToItem({uri:w})}),[w]);const O=(0,l.useCallback)((e=>{const t=e.map((e=>e.uri));x.current(),null==k||k.remove(...t)}),[k]),I=(0,l.useCallback)(((e,t)=>{x.current=t,e.length>1?R(e):O(e)}),[O]),P=(0,l.useCallback)((async(e,t)=>{const a=await(null==k?void 0:k.getTracks({offset:e,limit:t,uri:y,sort:(0,u.w)(_),filter:T})),l=null==a?void 0:a.totalLength,n=(null==a?void 0:a.items)||[];return"number"==typeof l&&l!==D&&S(l),n}),[T,k,D,_,y]),B=(0,l.useCallback)(((e,a)=>{var l;const o=(0,s.X)(null===(l=e.album)||void 0===l?void 0:l.images,{desiredSize:40,desiredLabel:"small"});return n().createElement(r.dx,{key:a+e.uri,index:a,contextUri:t,uri:e.uri,isPlayable:e.isPlayable,duration_ms:e.duration.milliseconds,name:e.name,artists:e.artists,albumOrShow:e.album,isExplicit:e.isExplicit,isCollaborative:!1,isMixedMedia:!1,isPaywalled:!1,isUserSubscribed:!1,isLocal:e.isLocal,addedBy:null,dateAdded:e.addedAt,hasDecoratedAddedBy:!1,release_date:"",isMOGEFRestricted:e.is19PlusOnly,type:e.type,imgUrl:(null==o?void 0:o.url)||"",onMove:()=>{},onInsert:()=>{},usePlayContextItem:C,allowedDropTypes:[],isDisliked:!1,playlistName:""})}),[t,C]);return n().createElement(n().Fragment,null,n().createElement(o.ZP,{value:"liked-songs-tracklist"},n().createElement(r.Pv,{ariaLabel:i.ag.get("sidebar.liked_songs"),key:t,hasHeaderRow:!0,columns:a,sortableColumns:null!=k&&k.getCapabilities().canSort&&b?E:f,sortState:_,onSort:A,renderRow:B,resolveUri:e=>e.uri,resolveUid:e=>e.uri,onRemove:I,nrTracks:D,fetchTracks:P,limit:50,canFetchAllTracks:null==k?void 0:k.getCapabilities().canFetchAllTracks,outerRef:v,outerDomRef:h})),n().createElement(p.h,{title:i.ag.get("remove_from_your_liked_songs"),isOpen:L.length>0,tracks:L,onClose:e=>{e.stopPropagation(),R([])},onRemove:O}))}))},32129:(e,t,a)=>{a.d(t,{c:()=>m});var l=a(67294),n=a.n(l),r=a(28248),o=a(78462),s=a(36132),i=a(95289),c=a(5292);function u(e){return!!e}const m=({columns:e})=>{const t=[...e];t.splice(2,0,r.QD.ARTIST);const{sortState:a,setSortState:m}=(0,l.useContext)(o.Gb),d=function(e){return null===e.column?c.mE[r.QD.INDEX]:(0,s.cB)(e.column,e.order)?c.mE[r.QD.ARTIST]:c.mE[e.column]}(a),g=(0,l.useCallback)((e=>{m((0,c.WQ)(e,a.column,a.order))}),[m,a.column,a.order]),p=(0,l.useCallback)((()=>null!==a.column),[a.column]),E=t.map((e=>c.mE[e])).filter(u);return n().createElement(i.A,{options:E,onSelect:g,selected:d,isSelectionChanged:p,sortOrder:a.order})}},35308:(e,t,a)=>{a.d(t,{h:()=>p});var l=a(67294),n=a.n(l),r=a(20657);const o="O3A_PD05JkHnmFVQtSaA",s="_HtrXRLuIFcQcwHidTBd",i="VXcw7Tvc8StDEa5QjcLk",c="oZ5r785Xyc2QMY6EAsm6",u="_dK3p91qv_khWZ9b4AbZ";var m=a(85105),d=a(16229),g=a(76343);const p=n().memo((({onClose:e,onRemove:t,isOpen:a,tracks:p,title:E})=>{const f=(0,l.useCallback)((a=>{t(p),e(a)}),[t,e,p]);return n().createElement(m.Z,{shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,onRequestClose:e,contentLabel:E,isOpen:a},n().createElement("div",{className:o},n().createElement(g.Dy,{as:"h2",variant:g.Dy.cello,className:s},E),n().createElement(g.Dy,{as:"p",variant:g.Dy.mesto,className:i},r.ag.get("playlist.remove_multiple_description")),n().createElement("div",{className:c},n().createElement(d.Y,{className:u,version:"tertiary",onClick:e},r.ag.get("playlist.delete-cancel")),n().createElement(d.Y,{version:"primary",onClick:f},r.ag.get("remove")))))}))},1169:(e,t,a)=>{a.d(t,{Q:()=>n});var l=a(67294);const n=()=>{const e=(0,l.useRef)(null),t=(0,l.useRef)(null),a=(0,l.useRef)(null);return{filterBoxApiRef:e,filterBoxDomRef:t,tracklistDomRef:a,handleKeyDown:l=>{var n,r,o;"Escape"===l.key&&((null!==(n=t.current)&&void 0!==n&&n.contains(l.target)||null!==(r=a.current)&&void 0!==r&&r.contains(l.target))&&(null===(o=e.current)||void 0===o||o.clearFilter()))}}}},30520:(e,t,a)=>{a.d(t,{w:()=>s});var l=a(36132),n=a(59916),r=a(74483);const o={[n.bD.ADDED_AT]:r._1.ADDED_AT,[n.bD.ADDED_BY]:null,[n.bD.ALBUM]:r._1.ALBUM_NAME,[n.bD.ARTIST]:r._1.ARTIST_NAME,[n.bD.DURATION]:null,[n.bD.TITLE]:r._1.NAME},s=e=>{const t=(0,l._j)(e);if(!t)return;const a=o[t.field],n=t.order;return a&&n?{field:a,order:n}:void 0}},40080:(e,t,a)=>{a.d(t,{D:()=>n});var l=a(67294);function n(e){const t=(0,l.useRef)();return(0,l.useEffect)((()=>{t.current=e}),[e]),t.current}},2751:(e,t,a)=>{a.d(t,{Z:()=>l});const l={xs:"(min-width: 0px)",xsOnly:"(min-width: 0px) and (max-width: 767px)",sm:"(min-width: 768px)",smOnly:"(min-width: 768px) and (max-width: 1023px)",md:"(min-width: 1024px)",mdOnly:"(min-width: 1024px) and (max-width: 1279px)",lg:"(min-width: 1280px)",lgOnly:"(min-width: 1280px) and (max-width: 1919px)",xl:"(min-width: 1920px)",playlist:"yuDAaRp7JVbeSllpIYmG",searchBoxContainer:"dxcm8V7fFpsDBHWeKDct",recommendedTrackList:"ofetMJMfFi_YgC01RvJ6",playlistContent:"_5wXWalxnOyFQX7uHu_j",playlistDescription:"SsTsOPgmERcM_7iwmHea",top:"ItM550mszGsQGgdtfklO",header:"dZdCvSKfSe1tYcPwtPmb",subtitle:"zszYKxSFitfS6Losokq_",refreshButton:"soajC3PK2UZPVho7_Nto",playlistImageContainer:"wGpZnoBC5qWDEQp2SAdS",playlistInlineCurationSection:"GDNfusbQHe_WtbQQxgIp",playlistInlineCurationWrapper:"NFaeX99xwnz1BNvH2lmp",playlistInlineCurationTitle:"V9D2HmUHiktc0CLtyUQL",playlistInlineCurationCloseButton:"fmzb3r_RSweMsnVEx49b",playlistInlineCurationBackButton:"rMJH1h777LcfjvxodiLr",artistResultListTitle:"ngLf66UuyQeJwgS6Bvb6",seeMore:"RvcbRZszlLTdAV40KDKf",emptyStateContainer:"iK4Gh20hXjoJ_WgLURse",searchResultListContainer:"yjk1njfJ_PTSN31aXkuy",emptySearchTermContainer:"chOO62LTE22PYDJBv75I",icon:"zMCYcxGBa5iNfUMQIUhv"}}}]);
  //# sourceMappingURL=xpui-routes-collection-songs.js.map