import{ao as e,aS as m,aq as f,g1 as w,ca as I,ah as b,bS as N,fF as j,bT as v,cy as A,E as y,ba as U,bW as P,cw as L,cx as k,L as _,h as S,de as T,p as $,r as F}from"./app-k0jcl5PQ.js";import{R as g}from"./BlKMjFEf.chunk.js";import{f as O}from"./BojVbZw0.chunk.js";import{A as D}from"./BhYYYlpK.chunk.js";import{u as H}from"./CIN5bTKK.chunk.js";const M="_playlistItem_euqll_1",q="_playlistItemGradient_euqll_4",z="_playlistMetadata_euqll_13",R="_partialHeading_euqll_20",G="_ownerAvatarContainer_euqll_24",c={playlistItem:M,playlistItemGradient:q,playlistMetadata:z,partialHeading:R,ownerAvatarContainer:G};E.defaultProps={numItems:8};function E(a){const t=[...Array(a.numItems)],i=a.itemClassName||"";return e.jsxs(e.Fragment,{children:[a.showHeading&&e.jsx("div",{className:`${c.partialHeading} mb-1 partial-loading-background`}),e.jsx(g,{className:"mx-n1 mb-n2",children:t.map((l,s)=>e.jsx(m,{xs:6,sm:4,lg:3,className:`${i} px-1 pb-2`,children:e.jsx("div",{className:`${c.playlistItem} partial-loading-background rounded-3`})},s))})]})}const V="playlists.playlistCount";function B(a){var s,n,r;if(!a)return!1;const t=((s=a.videos)==null?void 0:s.count)??0,i=((n=a.interactives)==null?void 0:n.count)??0,l=((r=a.clips)==null?void 0:r.count)??0;return t+i+l}function W(a){const t=B(a.playlist);return t===!1||Number.isNaN(t)?e.jsx(e.Fragment,{}):e.jsx("span",{className:"text-shadow font-size-sm",children:e.jsx(f,{namespace:V,phrase:"count",options:{smartCount:t}})})}function Y(a){var s,n,r;const{_liteOwner:t}=a.playlist;if((s=a.playlist._isClickViewCurated)!=null&&s.value)return e.jsx(w,{});if(!(t!=null&&t.id)||!((n=a.currentUser)!=null&&n.id))return e.jsx(e.Fragment,{});if(t.id.toString()===a.currentUser.id.toString())return e.jsx(e.Fragment,{});const l=typeof t.avatar=="string"?t.avatar:(r=t.avatar)==null?void 0:r.url;return e.jsx(I,{imageUrl:l,imageCdnUrl:a.imageCdnUrl,initials:b.getInitials(t.name,t.surname)})}const J="playlists.playlistList";C.defaultProps={itemStyle:"square"};function C(a){var d,o;const t=N.createUrl(a.data.cover&&a.data.cover.url,{size:v.Medium,resizeType:j.Cover}),i=a.data.subjectPresentationAudiences&&a.data.subjectPresentationAudiences.data,l=H(i,a.presentationAudiences);let s=c.playlistItem;const n=!!t||!!a.showFallbackImage;n&&(s+=` ${c.playlistItemGradient}`),!n&&a.bgColourClassNames&&(s+=` ${c.playlistItem} ${A(a.data.name,a.bgColourClassNames)}`),a.itemStyle==="round"&&(s+=" rounded-3 overflow-hidden"),a.itemStyle==="round-left"&&(s+=" rounded-start-lg overflow-hidden");const r={...a.analyticsData,id:(d=a.data)==null?void 0:d.id,name:(o=a.data)==null?void 0:o.name},x={...a.analyticsOptions,entity:y.Playlist},h=()=>{var u;return!a.data.contentModifiedDate||(u=a.data._isClickViewCurated)!=null&&u.value?"":_.getPhrase(J,"lastUpdated",{timeago:O(S.convertUTCToLocal(a.data.contentModifiedDate))})};return e.jsx(U,{appLink:a.appLink,analyticsData:r,analyticsOptions:x,title:h(),children:e.jsxs(P,{data:t,alt:a.data.name,className:s,children:[!!a.showFallbackImage&&e.jsx(L,{type:k.Playlist}),e.jsxs("div",{className:`text-white ${c.playlistMetadata}`,children:[!!a.showCount&&e.jsx(W,{playlist:a.data}),e.jsx("h5",{className:`mb-0 ${a.titleClassName||""}`,children:e.jsx("span",{className:"text-shadow clamp-2",children:a.data.name})}),!!i&&!!i.length&&!!l&&e.jsx(D,{className:`${a.audienceLabelClass?a.audienceLabelClass:""} mt-1`,audience:l,border:"white"})]}),!!a.showOwner&&!!a.imageCdnUrl&&e.jsx("div",{className:c.ownerAvatarContainer,children:e.jsx(Y,{playlist:a.data,currentUser:a.currentUser,imageCdnUrl:a.imageCdnUrl})})]})})}const K={actionType:F.Click,entity:y.Playlist,location:$.PlaylistListItem,descriptor:T.Cover};function ea(a){return e.jsxs(g,{as:"ul",className:"list-unstyled mx-n1",children:[a.extraPlaylistItem&&e.jsx(m,{as:"li",xs:6,sm:4,lg:3,className:`mb-2 px-1 ${a.itemContainerClassName?a.itemContainerClassName:""}`,children:a.extraPlaylistItem},"extra-playlist-item"),a.playlists.map(t=>e.jsx(m,{as:"li",xs:6,sm:4,lg:3,className:`mb-2 px-1 ${a.itemContainerClassName?a.itemContainerClassName:""}`,children:e.jsx(C,{data:t,appLink:a.getPlaylistAppLink(t),imageCdnUrl:a.imageCdnUrl,currentUser:a.currentUser,presentationAudiences:a.presentationAudiences,bgColourClassNames:a.bgColourClassNames,showCount:a.showCount,showOwner:a.showOwner,showFallbackImage:a.showFallbackImage,titleClassName:a.itemTitleClassName,itemStyle:a.itemStyle,analyticsData:a.analyticsData,analyticsOptions:{...a.analyticsOptions,...K}})},t.id))]})}export{C as P,E as a,ea as b};
//# sourceMappingURL=18C_y0lf.chunk.js.map
