mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
2 lines
31 KiB
JavaScript
Executable File
2 lines
31 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[9528],{36959:(e,t,i)=>{i.d(t,{o:()=>_});var n=i(52542),r=i(62822),a=i(12341),s=i(93091),o=i.n(s),l=(i(7651),i(30456),i(26701),i(25550),i(47994),i(37417),i(11737),i(51691),i(702),i(5672),i(43379),i(34192),i(88856),i(51565),i(15342),i(18316),i(30758)),c=i(13534),u=i(94842),d=i(12482),p=i(76149),v=i(92107),h=i(96971),m=i(26173),f=i(66475),x=i(70080),g=i(11854),y=i(19276),b=i(93051);const j="c5Ml9BbBuUEHjNkcSwZA";var k=i(86070),P="70px",C=function(e){var t=e.adId,i=e.advertiser,n=e.tagline,r=e.displayImage,a=e.buttonMessage,s=e.cardOnClick,o=e.buttonOnClick,l=e.clickthroughUrl;return(0,k.jsx)(b.N,{to:(0,y.H)(l),className:j,"data-testid":"leavebehind",children:(0,k.jsx)(h.v,{onClick:s,onClickHint:v.Ru.get("ad-formats.learnMore"),layout:"wide",variant:"tinted",id:t,size:"xl",title:(0,k.jsx)(m.d,{weight:"bold",variant:"ballad",lineClamp:1,"data-testid":"leavebehind-advertiser",children:i}),subtitle:(0,k.jsx)(f.j,{as:"div",lineClamp:2,"data-testid":"leavebehind-tagline",children:n}),media:(0,k.jsx)(x.C,{"data-testid":"leavebehind-image",src:r.src,alt:r.alt,imageHeight:P,imageWidth:P,size:"xl"}),trailing:(0,k.jsx)(g.$,{onClick:function(){o&&o()},"data-testid":"leavebehind-button",colorSet:"invertedLight",size:"small","aria-label":v.Ru.get("ad-formats.learnMore"),children:a})})})},w=i(41243),I=i(76672),T=i(40070),E=i(85726);const S="zlUJfROzFEOsEDWL7ucP",A="Fxvq1Fw7XQdGRDvYokRg";function O(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function R(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?O(Object(i),!0).forEach((function(t){(0,n.A)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):O(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var _=function(e){var t=e.leavebehinds,i=e.seeAllButton,n=e.surface,s=e.uri,h=(0,E.vh)(),m=(0,T.w)(T.P),f=(0,l.useState)(void 0),x=(0,a.A)(f,2),g=x[0],y=x[1];(0,l.useEffect)((function(){t&&t.length>0&&g!==t[0].requestId&&s&&(t.forEach((function(e,t){var i;e.uri===s&&(null===(i=e.trackingEvents)||void 0===i||i.viewed.forEach(function(){var t=(0,r.A)(o().mark((function t(i){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m(i);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),r=t.t0,h.send((0,d.G)({error_type:"trackingURLFailure",error_message:r.message,http_error_code:422,surface:(0,w.Fh)(n),request_url:i,request_type:"leavebehindAds",lineitem_id:e.lineitemId,ad_content_origin:(0,I.Zl)(n)}));case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()),h.send((0,p.x)({leavebehind_lineitem_id:e.lineitemId,leavebehind_request_id:e.requestId,event:"event_viewed",event_reason:"viewed_on_".concat((0,w.Fh)(n).toLowerCase()),surface:(0,w.Fh)(n),surface_position:t+1,uri:s})))})),y(t[0].requestId))}),[h,m,t,s,n,g]);var b=function(e){var t=e.eventReason,i=e.lineitemId,a=e.requestId,l=e.trackingEvents,c=e.surfacePosition;!function(e,t){null==t||t.forEach(function(){var t=(0,r.A)(o().mark((function t(i){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m(i);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),r=t.t0,h.send((0,d.G)({error_type:"trackingURLFailure",error_message:r.name,http_error_code:422,surface:(0,w.Fh)(n),request_url:i,request_type:"leavebehindAds",lineitem_id:e,ad_content_origin:(0,I.Zl)(n)}));case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}())}(i,l),h.send((0,p.x)({leavebehind_lineitem_id:i,leavebehind_request_id:a,event:"event_clicked",event_reason:t,surface:(0,w.Fh)(n),surface_position:c,uri:s}))};return(0,k.jsxs)("section",{"data-testid":"leavebehinds-wrapper",children:[(0,k.jsxs)("div",{className:A,children:[(0,k.jsx)(c.E,{as:"h2",semanticColor:"textBase",variant:"titleSmall",paddingBottom:(0,u.po)("tighter"),"data-testid":"leavebehinds-title",children:v.Ru.get("podcast-ads.recent_ads")}),i]}),(0,k.jsx)("div",{className:S,"data-testid":"leavebehinds-list-wrapper",children:t.map((function(e,t){return(0,k.jsx)(C,R(R({},e),{},{buttonOnClick:function(){var i;b({eventReason:"button_clicked",lineitemId:e.lineitemId,trackingEvents:null===(i=e.trackingEvents)||void 0===i?void 0:i.clicked,requestId:e.requestId,surfacePosition:t+1})},cardOnClick:function(){var i;b({eventReason:"card_clicked",lineitemId:e.lineitemId,trackingEvents:null===(i=e.trackingEvents)||void 0===i?void 0:i.clicked,requestId:e.requestId,surfacePosition:t+1})}}),e.adId)}))})]})}},60425:(e,t,i)=>{i.d(t,{J:()=>d});i(83234);var n=i(68150),r=i(2648),a=i(76149),s=i(92107),o=i(41243),l=i(76672),c=i(85726),u=i(86070),d=function(e){var t=e.leavebehinds,i=e.surface,d=e.uri,p=e.pathname,v=e.state,h=(0,c.vh)(),m="".concat(s.Ru.get("view.see-all")," (").concat(t.length<=l.E9?s.Ru.formatNumber(t.length):s.Ru.formatNumber(l.E9),")");return(0,u.jsx)(n.N_,{to:p,state:v,children:(0,u.jsx)(r.H,{"data-testid":"leavebehinds-see-all",size:"small",onClick:function(){h.send((0,a.x)({leavebehind_request_id:t[0].requestId,event:"event_clicked",event_reason:"cta_see_all",surface:(0,o.Fh)(i),uri:d}))},children:m})})}},15054:(e,t,i)=>{i.d(t,{g:()=>x});i(47994);var n=i(30758),r=i(97500),a=i.n(r),s=i(13534),o=i(80366),l=i(83643),c=i(59739),u=i(64877),d=i(17011),p=i(93051),v=i(8016),h=i(70566),m=i(13584),f=i(86070),x=function(e){var t=e.children,i=e.uri,r=e.name,x=e.nonInteractive,g=void 0!==x&&x,y=e.creatorUri,b=e.spec,j=null,k=(0,v.P)({itemUris:[i],dragLabelText:r}),P=k.draggable,C=k.onDragStart,w=(0,h.s)(),I=(0,n.useCallback)((function(){b&&w.logInteraction(b.albumLinkFactory({uri:i}).hitUiNavigate({destination:i}))}),[w,b,i]);return g?(0,f.jsx)("span",{className:a()("standalone-ellipsis-one-line",m.A.text),children:t}):((0,o._T)(i)&&(j=(0,f.jsx)(c.h,{uri:i,artistUri:y})),(0,o.WB)(i)&&(j=(0,f.jsx)(u.H,{uri:i})),(0,f.jsx)(l.h,{menu:j,children:(0,f.jsx)(s.E,{variant:"bodySmall",children:(0,f.jsx)(d.Zp,{label:r,showDelay:d.uF,children:(0,f.jsx)(p.N,{draggable:P,onDragStart:C,className:a()("standalone-ellipsis-one-line"),to:i,dir:"auto",onClick:I,children:t})})})}))}},48920:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ii});var n=i(52542),r=i(12341),a=(i(7651),i(14551),i(16347),i(30456),i(26701),i(25550),i(47994),i(37417),i(11737),i(51691),i(702),i(5672),i(43379),i(72636),i(18653),i(34192),i(88856),i(51565),i(15342),i(18316),i(30758)),s=i(68150),o=i(44286),l=i(19112),c=i(86308),u=i(80366),d=i(92107),p=i(45625),v=i(57581),h=i(26419),m=i(77034),f=i(44206),x=i(83691),g=i(88677),y=i(40927),b=i(7352),j=i(69045),k=i(99217),P=i(25293),C=i(41366),w=i(15317),I=i(80021),T=i(53163),E=i(43023),S=i(54129),A=i(24787),O=i(91471),R=i(64333),_=i(99365),L=i(86429),N=i(27719),D=i(86070),U="activation-trigger-mme",F=function(e){var t=e.episodeUri,i=e.showUri,n=e.isLocked,r=e.isPlaying,a=e.isPlayDisabled,s=e.playButtonPlayLabel,o=e.playButtonPauseLabel,l=e.onClick,c=e.size,d=void 0===c?"large":c,p=(0,N.c)();if((0,L.V)())return(0,D.jsx)(_.R,{size:d,onClick:l,isPlaying:r,disabled:a,locked:n,ariaPlayLabel:s,ariaPauseLabel:o});var v=(0,D.jsx)(R.f,{showUri:i,enabled:n,renderInline:!1,children:(0,D.jsx)(_.R,{size:d,onClick:l,isPlaying:r,disabled:a,locked:n,ariaPlayLabel:s,ariaPauseLabel:o})});return p?(0,D.jsx)(O.k,{id:U,targetURI:(0,u.o_)(t),fadeOut:!0,children:v}):v};i(2823),i(4672);function B(e){return(null==e?void 0:e.replace(/T.*/,""))||""}var M=i(54249),q=i(46366),z=i(64348),H=i(46198),K=i(44528),Q=i(33814),G=i(5248),W=i(70566),Y=i(12574),Z=i(24119),X=i(97724);const $="KY_tGmIGPqs9GPaaPqL1",J="ZDeijYE6qPzPqT9vG_2w",V="qEoBuparvnBwiHsPzwEj",ee="azmMKgbEFsGjSUnw2Knc",te="oDljdc6tgUKxTeQMyh0D",ie="JflKazLAHawVzYxv1pXc",ne="_8eBVLH51Ej9NMeUQlr8",re="aTeXTpJi_WmakpodeGxX",ae="kZWs1d_TjX2JQgmtx90y",se="JCSifKpPc54eqcTYBj5Q",oe="FlK1APGRiu5DTwm_0kix",le="ahQLeD18bYXcFRWkL_vg",ce="l6peddfW1BiAnd1a_mF3",ue="Xkg0O12dNVwomjL8dzm4",de="OexEjZt7Kf7pFUW701v8",pe="jAY3diSzPfk19oswf8_y",ve="F3BJWbXwGSqNOwZHInLz",he="YjVCpFaOT3LCR64t8jTN",me="Q7HlO_WHb9N8aK8bgOjG",fe="xTENSk0_RmQ8qEeEuhnE";var xe=function(e){var t,i,n,s,o=e.episode,l=e.onPlayEpisode,c=e.isPlaying,u=e.isActive,p=e.isFullyPlayed,v=e.setIsFullyPlayed,h=e.backgroundColor,m=e.isLocked,f=e.spec,x=o.uri,O=o.playedState,R=o.contentRating,_=o.playability,L=(0,W.s)(),N=(0,g.wA)(),U=(0,Q.S)(1e4,(function(e){var t;return(null==e||null===(t=e.item)||void 0===t?void 0:t.uri)===x})),$=(0,r.A)(U,1)[0],J=(0,G.o)((function(e){return null==e?void 0:e.duration})),V=(0,X.b)({contentRating:null==R?void 0:R.label}).badges,ee=(0,a.useCallback)((function(e){!_.playable&&V.nineteen&&(e.stopPropagation(),N((0,b.Tf)(x||"")))}),[x,_.playable,V.nineteen,N]),te=(0,a.useCallback)((function(){var e=f.contextMenuButtonFactory().hitUiReveal();L.logInteraction(e)}),[L,f]),re=(0,a.useCallback)((function(e,t){(0,q.Qv)(t,f.downloadButtonFactory(),L,x)}),[L,f,x]),ae=(0,A.d$)(),se=(0,Y.r)(y.e,{data:{uri:x}}),oe=se.spec,le=se.logger;(0,a.useEffect)((function(){ae&&le.logImpression(oe.impression())}),[ae,le,oe]);var ce=(0,a.useCallback)((function(e){var t=f.saveButtonFactory();L.logInteraction(e?t.hitLike({itemToBeLiked:x}):t.hitRemoveLike({itemNoLongerLiked:x})),e&&ae&&le.logInteraction(oe.hitAddToPlaylist({itemToBeAdded:x,playlist:K.Xn}))}),[L,f,x,ae,le,oe]),ue=!m&&!o.playability.playable,de=d.Ru.get("tracklist.a11y.play",o.name,null===(t=o.podcast)||void 0===t?void 0:t.name),pe=d.Ru.get("tracklist.a11y.pause",o.name,null===(i=o.podcast)||void 0===i?void 0:i.name),ve=null===(n=o.podcast)||void 0===n?void 0:n.uri,he=(0,M.j)(),me=(0,S.v)(o.uri),fe=!m;return(0,D.jsxs)(j.E,{backgroundColor:h,children:[(0,D.jsxs)(k.S,{children:[V.nineteen&&(0,D.jsx)(H.q,{className:ie,size:16}),V.explicit&&(0,D.jsx)(z.U,{className:ne}),(0,D.jsx)(Z.j,{fullyPlayed:p,durationMs:u&&J?J:o.duration.milliseconds,releaseDate:B(null===(s=o.releaseDate)||void 0===s?void 0:s.isoString),resumePositionMs:O.playPositionMilliseconds,isPlaying:c,position:u&&$||void 0})]}),(0,D.jsxs)(k.S,{children:[(0,D.jsx)("div",{onClick:ee,children:(0,D.jsx)(F,{episodeUri:o.uri,showUri:ve,isLocked:m,onClick:function(){l(O.playPositionMilliseconds)},isPlaying:c,isPlayDisabled:ue,playButtonPlayLabel:de,playButtonPauseLabel:pe,size:he})}),(0,D.jsx)(P.e,{uri:o.uri,onClick:re,size:he,canDownload:fe,condensed:!0}),me?(0,D.jsx)(E.g,{uri:o.uri,size:he}):(0,D.jsx)(w.b,{uri:o.uri,size:he,onClick:ce,condensed:!0}),(0,D.jsx)(I.b,{onShow:te,menu:(0,D.jsx)(T.b,{uri:o.uri,sharingInfo:o.sharingInfo,showUri:ve,contextUri:o.uri,isPlayed:p,onMarkAsPlayed:v}),children:(0,D.jsx)(C.e,{label:d.Ru.get("more.label.context",o.name),size:he})})]})]})},ge=i(62822),ye=i(93091),be=i.n(ye),je=i(12072),ke=(i(70750),i(36959)),Pe=i(60425),Ce=i(41243),we=i(37903),Ie=i(21256),Te=i(76672),Ee=i(88560),Se=i(35793),Ae=i(16920),Oe=Ce.ui.EPISODE_PAGE,Re=function(e){var t=e.leavebehinds,i=e.uri,n=e.seeAllPath,r=(0,a.useMemo)((function(){return t.slice(0,Te.un)}),[t]);return(0,D.jsx)(ke.o,{leavebehinds:r,surface:Oe,uri:i,seeAllButton:t.length>Te.un?(0,D.jsx)(Pe.J,{leavebehinds:t,surface:Oe,uri:i,pathname:n,state:{uri:i}}):null})};function _e(e){var t,i,n=(0,Ee.L)(),r=null===(t=(0,u.o_)(e.uri))||void 0===t?void 0:t.id,s=(0,Ie.c)(r),o=(0,we.A)({surface:Oe,uri:e.uri}),l=o.data,c=o.error,d=o.getLeavebehinds,p=(i=null==n?void 0:n.item.type,(0,Se.Z)(i)===Ae.c.AD&&i===Ae.c.EPISODE);(0,a.useEffect)((function(){d()}),[d]),(0,a.useEffect)((function(){p&&d()}),[p]);var v=(0,a.useMemo)((function(){return l?(0,Te.iT)(l,e.uri):[]}),[null==l?void 0:l.requestId]);return v.length<1||c?null:(0,D.jsx)(Re,{uri:e.uri,leavebehinds:v,seeAllPath:s})}var Le=i(65707),Ne=(i(79210),i(13534)),De=i(93493),Ue=i(10169),Fe=i(11854),Be=i(58114),Me=function(e){var t=e.cardHeaderText,i=e.cardBodyText,n=e.buttonText,r=e.buttonTarget;return(0,De.NC)(Be._Nj)?(0,D.jsxs)("div",{className:se,children:[(0,D.jsxs)("div",{className:oe,children:[(0,D.jsx)(Ne.E,{variant:"bodyMediumBold",semanticColor:"textBase",children:t}),(0,D.jsx)(Ne.E,{semanticColor:"textBase",children:i})]}),(0,D.jsx)(Fe.$,{size:"small",colorSet:"invertedLight",href:(0,u.o_)(r).toURLPath(!0),component:Le.v,children:n})]}):null},qe=function(e){var t=e.areHTMLDescriptionsEnabled,i=e.contentInformation,n=e.description,r=e.hasDescription,s=e.htmlDescription,o=e.onExpanded,l=e.onTimeStampClick,c=e.playability,u=e.showHeader,p=void 0===u||u,v=e.spec,h=(0,W.s)(),m=(r||i)&&p,f=(0,a.useCallback)((function(e){var t=v.readMoreButtonFactory();h.logInteraction(e?t.hitUiReveal():t.hitUiHide()),null==o||o()}),[v,h,o]),x=(0,De.NC)(Be.ZK8,{loadingValue:!1});return(0,D.jsxs)(D.Fragment,{children:[m&&(0,D.jsx)(Ne.E,{as:"h2",variant:"titleSmall",semanticColor:"textBase",className:ee,children:d.Ru.get("episode.description-title")}),i&&(0,D.jsx)(Me,{cardHeaderText:i.cardHeaderText,cardBodyText:i.cardBodyText,buttonText:i.buttonText,buttonTarget:i.buttonTarget}),r&&(0,D.jsx)(Ue.N,{className:V,onTimeStampClick:l,maxLines:4,onExpanded:f,content:(n||"").trim(),htmlContent:t&&s?s:void 0,enableTimestamps:c.playable,enableAutomaticLinkification:x&&t&&!!s})]})},ze=i(97500),He=i.n(ze),Ke=i(57574),Qe=i(97373),Ge=i(42193),We=i(107),Ye=i(8540),Ze=i(496),Xe=function(e){return e.DESCRIPTION="description",e.TRANSCRIPT="transcript",e}(Xe||{}),$e=a.memo((function(e){var t=e.transcriptSections,i=e.descriptionContent,s=e.transcriptContent,o=e.spec,l=(0,W.s)(),c=(0,a.useState)(Xe.DESCRIPTION),u=(0,r.A)(c,2),p=u[0],v=u[1],h=(0,Ze.v7)(),m=(0,Ke.Wx)({threshold:[1],root:h.current,rootMargin:"-".concat(Ye.uC+1,"px 100000px 0px 100000px")}),f=m.ref,x=m.inView,g=(0,a.useRef)(null),y=(0,a.useCallback)((function(e){g.current=e,f(e)}),[f]);return(0,a.useEffect)((function(){var e,t=null===(e=g.current)||void 0===e||null===(e=e.parentElement)||void 0===e?void 0:e.offsetTop,i=null==h?void 0:h.current;if(t&&i){var n=t-Ye.uC;i.scrollTop>n&&i.scrollTo({top:n})}}),[h,p]),(0,D.jsx)(Qe.j,{list:(0,D.jsxs)(Ge.L,{className:He()(he,(0,n.A)({},me,!x)),ref:y,children:[(0,D.jsx)(We.Y,{label:d.Ru.get("web-player.episode.description"),sentenceCase:!0,active:p===Xe.DESCRIPTION,onClick:function(){var e=o.tabsFactory().descriptionTabButtonFactory().hitUiReveal();l.logInteraction(e),v(Xe.DESCRIPTION)},className:He()(fe,(0,n.A)({},le,p===Xe.DESCRIPTION))}),(0,D.jsx)(We.Y,{label:d.Ru.get("web-player.episode.transcript"),sentenceCase:!0,disabled:null===t,active:p===Xe.TRANSCRIPT,onClick:function(){var e=o.tabsFactory().transcriptTabButtonFactory().hitUiReveal();l.logInteraction(e),v(Xe.TRANSCRIPT)},className:He()(fe,(0,n.A)({},le,p===Xe.TRANSCRIPT))})]}),children:null===t||p===Xe.DESCRIPTION?i:s})})),Je=i(30038),Ve=i(79431),et=i(73188),tt=(0,a.memo)((function(e){var t=e.transcriptSections,i=e.onTimeStampClick,n=e.episodeUri,r=(0,Y.r)(Je.c,{data:{uri:n}}),a=r.spec,s=r.logger,o=(0,Ve.P)({uri:n},{featureIdentifier:"episode"}).isPlaying,l=a.timestampLinkFactory();return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{className:ue,children:(0,D.jsx)(Ne.E,{variant:"bodySmall",semanticColor:"textBase",children:d.Ru.get("web-player.episode.transcript.disclaimer")})}),t.map((function(e,t){var r="transcript-section-".concat(t);return(0,D.jsxs)("div",{className:ce,children:[(0,D.jsx)("button",{className:de,onClick:function(){i(e.startMs,r),s.logInteraction(o?l.hitSeekToTime({msToSeekTo:e.startMs}):l.hitPlay({itemToBePlayed:n}))},children:(0,D.jsx)(O.k,{id:r,targetURI:(0,u.o_)(n),fadeOut:!0,children:(0,D.jsx)(Ne.E,{variant:"marginalBold",semanticColor:"textSubdued",className:pe,children:(0,et.f)(e.startMs)})})}),e.content.map((function(e,t){return(0,D.jsx)(Ne.E,{variant:"bodySmall",semanticColor:"textBase",className:ve,dir:"auto",children:e},"transcript-text-".concat(t))}))]},r)}))]})})),it=(i(83234),i(38408),i(80456),i(81594)),nt=i(3846),rt=i(75365),at=i(15054),st=i(26682),ot=i(79044),lt=i(84466),ct=i(20938),ut=i(45994),dt=i(86786),pt=i(15150),vt=i(74542),ht=i(31772),mt=(i(78551),i(15057)),ft=i(76126),xt=i(92065),gt=i(8574),yt=i(98156),bt=i(13584),jt=function(e){var t=e.children,i=e.index,r=e.ariaRowIndex,s=e.onTriggerPlay,o=e.isActive,l=e.uri,c=e.spec,u=(0,W.s)(),d=(0,a.useContext)(xt.m),p=d.pushPopSelected,v=d.toggleSelected,h=d.isSelected,m=(0,a.useRef)(null),f=(0,gt.W)(),x=(0,mt.YQ)((function(e){f({intent:"play",type:"double-click"});var t=u.logInteraction(c.doubleHitPlay({itemToBePlayed:l}));s(e,t)}),yt.d,{leading:!0,trailing:!1}),g=(0,a.useCallback)((function(e){v(i,e.shiftKey,e.ctrlKey||e.metaKey)}),[v,i]),y=(0,a.useCallback)((function(e){var t;if(null!==(t=m.current)&&void 0!==t&&t.contains(e.target)){var n="ArrowUp"===e.key?-1:1;["ArrowUp","ArrowDown"].includes(e.key)&&(e.shiftKey?p(i,n):v(i+n,!1,!1))}}),[p,v,i]),b=h(i),j=b&&h(i-1),k=b&&h(i+1);return(0,D.jsx)(ft.$,{rowIndex:r,"aria-selected":b,children:(0,D.jsx)("div",{"data-testid":"tracklist-row",className:He()(bt.A.trackListRow,bt.A.trackListRowGrid,(0,n.A)((0,n.A)((0,n.A)((0,n.A)({},bt.A.active,o),bt.A.selected,b),bt.A.isPreviousRowSelected,j),bt.A.isNextRowSelected,k)),onDoubleClick:x,onClick:g,onKeyDown:y,ref:m,children:t})})},kt=i(21286),Pt=i(53607),Ct=function(e){var t=e.uri,i=e.title,n=void 0===i?"":i,r=e.index,s=e.subtitle,o=void 0===s?"":s,l=e.showName,c=void 0===l?"":l,u=e.showUri,p=void 0===u?"":u,v=e.duration,h=void 0===v?0:v,m=e.start,f=e.stop,x=(0,kt.L)({episodeUri:t,start:m,stop:f}),g=x.isActive,y=x.isPlaying,b=x.onClick,j=(0,a.useCallback)((function(e,t){b(t)}),[b]),k=(0,Y.r)(rt.i,{data:{position:r,reason:"",uri:t}}).spec;return(0,D.jsx)(Pt.pZ,{value:"row",index:r,children:(0,D.jsxs)(jt,{index:r,ariaRowIndex:r+1,onTriggerPlay:j,isActive:g,spec:k,uri:t,children:[(0,D.jsxs)(dt.U,{ariaColIndex:0,children:[(0,D.jsx)(lt.$,{uri:t,playAriaLabel:d.Ru.get("tracklist.a11y.play",o,c),onClick:j,isPlaying:y,isActive:g,spec:k,children:(0,D.jsx)(ct.a,{children:(0,D.jsx)(nt.M,{className:bt.A.talkIcon,"aria-hidden":!0})})}),(0,D.jsxs)(ot.l,{children:[(0,D.jsx)(ht.p,{titleText:n,children:n}),(0,D.jsx)(vt.p,{children:o})]})]}),(0,D.jsx)(pt.o,{ariaColIndex:1,children:(0,D.jsx)(at.g,{uri:p,name:c,spec:k,children:(0,D.jsx)("span",{dir:"auto",children:c})})}),(0,D.jsx)(ut.l,{ariaColIndex:2,children:(0,D.jsx)(st.P,{duration:h,className:bt.A.talkSegmentDuration})})]})})},wt=i(87198),It=i(93195),Tt=i(76840),Et=i(51725),St=i(8972),At=i(52382),Ot=i(40321),Rt=i(71646);const _t="HRApv65revEcL42QzRjJ",Lt="HbJqPqSmOY5H3lLnQVzD",Nt="DBcCnhHVt7coNqp3wMB4";var Dt=function(e){var t,i=e.episodeUri,n=e.index,r=e.duration,s=e.start,o=e.stop,l=e.name,c=e.uri,u=e.artists,p=e.album,v=e.playable,h=(0,kt.L)({episodeUri:i,start:s,stop:o}),m=h.isActive,f=h.isPlaying,x=h.onClick,g=(0,a.useCallback)((function(e,t){x(t)}),[x]),y=(0,Y.r)(rt.i,{data:{position:n,reason:"",uri:c}}).spec;return(0,D.jsx)(Pt.pZ,{value:"row",index:n,children:(0,D.jsx)(Tt.t,{trigger:"right-click",action:"open",menu:(0,D.jsx)(Et.P,{uri:c}),children:(0,D.jsxs)(Ot.w,{uri:c,index:n,ariaRowIndex:n+1,dragMetadata:{name:l,createdBy:null!==(t=null==u?void 0:u[0].name)&&void 0!==t?t:""},onTriggerPlay:g,isActive:m,isPlayable:v,spec:y,children:[(0,D.jsxs)(dt.U,{ariaColIndex:0,children:[(0,D.jsx)(lt.$,{uri:c,playAriaLabel:d.Ru.get("tracklist.a11y.play",l,null==u?void 0:u[0].name),onClick:g,isPlaying:f,isActive:m,spec:y,children:(0,D.jsx)(ct.a,{children:(0,D.jsx)("img",{className:Lt,src:p.image,alt:p.name})})}),(0,D.jsxs)(ot.l,{children:[(0,D.jsx)(ht.p,{titleText:l,children:l}),(0,D.jsx)(vt.p,{children:(0,D.jsx)(St.l,{artists:u,spec:y})})]})]}),(0,D.jsx)(pt.o,{ariaColIndex:1,children:(0,D.jsx)(at.g,{uri:p.uri,name:p.name,spec:y,children:p.name})}),(0,D.jsxs)(ut.l,{ariaColIndex:2,children:[(0,D.jsx)(Rt.d,{uri:c,spec:y}),(0,D.jsx)(st.P,{duration:r}),(0,D.jsx)(At.Y,{spec:y,menu:(0,D.jsx)(Et.P,{uri:c,artists:u}),label:d.Ru.get("more.label.track",l,null==u?void 0:u[0].name)})]})]})})})},Ut=i(18553),Ft=i(82704);function Bt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Mt(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(i),!0).forEach((function(t){(0,n.A)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Bt(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function qt(e,t,i){return e.reduce((function(e,n,r){return(r>0||t>0)&&e.push({type:"SPACER",id:"spacer-".concat(e.length)}),"MUSIC"===n.type?e.push(function(e,t,i){return{type:"MUSIC",index:t,uri:i.uri,episodeUri:e,start:i.start,stop:i.stop,duration:i.duration,name:i.track.name,artists:i.track.artists,album:i.track.album,playable:i.track.playable}}(i,r,n)):"TALK"===n.type&&e.push(function(e,t,i){return{type:"TALK",index:t,uri:e,title:i.title,subtitle:i.subtitle,start:i.start,stop:i.stop,duration:i.duration,showUri:i.show.uri,showName:i.show.name}}(i,r,n)),e}),[])}const zt=function(e){var t=e.uri,i=e.segmentCount,n=(0,Ut.o)(),r=(0,a.useCallback)(function(){var e=(0,ge.A)(be().mark((function e(r,a){var s,o;return be().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=Math.ceil(r/2),e.prev=1,e.next=4,n.getSegments(t,s,a);case 4:return o=e.sent,e.abrupt("return",{items:qt(o,s,t),totalLength:2*i-1});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{items:[],totalLength:0});case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,i){return e.apply(this,arguments)}}(),[i,n,t]),s=(0,a.useCallback)((function(e){switch(e.type){case"SPACER":return(0,D.jsx)("div",{className:Nt},e.id);case"MUSIC":return(0,D.jsx)(Dt,Mt({},e),"".concat(t,"-").concat(e.index));case"TALK":return(0,D.jsx)(Ct,Mt({},e),"".concat(t,"-").concat(e.index));default:return(0,Ft.d)(e)}}),[t]),o=(0,a.useCallback)((function(e){return{uri:"MUSIC"===e.type?e.uri:""}}),[]),l=d.Ru.get("music_and_talk.in_this_episode");return(0,D.jsxs)("div",{children:[(0,D.jsx)(Ne.E,{as:"h2",variant:"titleSmall",semanticColor:"textBase",className:_t,children:l}),(0,D.jsx)(wt.S4,{ariaLabel:l,hasHeaderRow:!0,rowPlaceholder:it.qq,columns:[It.$.TITLE_AND_ARTIST,It.$.ALBUM_OR_SHOW,It.$.DURATION],renderRow:s,fetchTracks:r,resolveItem:o,limit:50,nrTracks:2*i-1,testID:"music-and-talk-tracklist"})]})};var Ht=i(45018),Kt=i(76026),Qt=function(e){var t=e.areHTMLDescriptionsEnabled,i=e.contentInformation,n=e.description,s=e.hasDescription,o=e.hasMusicAndTalkSegements,l=e.htmlDescription,c=e.onExpanded,u=e.onDescriptionTimestampClick,p=e.onTranscriptTimestampClick,v=e.playability,h=e.segmentCount,m=e.showUrl,f=e.transcript,x=e.uri,g=e.spec,y=(0,W.s)(),b=(0,a.useMemo)((function(){return g.descriptionSectionFactory()}),[g]),j=(0,a.useMemo)((function(){return b.trackListFactory()}),[b]),k=(0,a.useState)(null),P=(0,r.A)(k,2),C=P[0],w=P[1],I=(0,a.useCallback)(function(){var e=(0,ge.A)(be().mark((function e(t){var i;return be().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ht.Q)(t);case 2:i=e.sent,w(i);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[]);(0,a.useEffect)((function(){f&&f.length>0&&I(f[0].cdnUrl)}),[I,f]);var T=function(e){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(qe,{hasDescription:s,contentInformation:i,onTimeStampClick:u,onExpanded:c,description:n,areHTMLDescriptionsEnabled:t,htmlDescription:l,playability:v,showHeader:e,spec:b}),o&&(0,D.jsx)(Kt.r,{spec:j,children:(0,D.jsx)(zt,{segmentCount:h,uri:x})}),m&&(0,D.jsx)(je.n,{size:"small",className:te,href:m,component:Le.v,onClick:function(){y.logInteraction(b.allEpisodesLinkFactory().hitUiNavigate({destination:m}))},children:d.Ru.get("episode.see_all_episodes")}),(0,D.jsx)(_e,{uri:x})]})},E=f&&(null==f?void 0:f.length)>0&&v.playable;return(0,D.jsx)(D.Fragment,{children:E?(0,D.jsx)($e,{transcriptSections:C,descriptionContent:T(!1),transcriptContent:(0,D.jsx)(tt,{transcriptSections:C||[],onTimeStampClick:p,episodeUri:x}),spec:g}):T(!0)})},Gt=(i(42703),i(463),i(83643)),Wt=i(9754),Yt=i(87583),Zt=i(33598),Xt=i(17067),$t=i(85925),Jt=i(20837),Vt=i(74351),ei=i(54006),ti=i(88420),ii=i(93051),ni=i(7889),ri=i(18180),ai=i(44113),si=i(47795),oi=i(60455),li=function(e){var t=e.coverArt,i=e.name,n=(0,oi.y)(),r=n===si.E.SMALL||n===si.E.XSMALL;return(0,D.jsx)(ri.b,{images:t,type:Ae.c.EPISODE,shape:ri.u.ROUNDED_CORNERS,title:i,size:r?ai.Qe.SIZE_20:ai.Qe.SIZE_24,className:re})},ci=i(4140);var ui=function(e){var t,i,n,r=e.episode,s=e.isFullyPlayed,o=e.setIsFullyPlayed,l=e.backgroundColor,c=e.spec,p=r.uri,v=r.name,h=r.sharingInfo,m=r.playedState,f=r.episodeType,x=r.releaseDate,g=r.coverArt,y=(0,W.s)(),b=function(e,t,i,n,r){var a=t===ci.I_.Episode;return(0,ni.hD)(e,n,i,r)?(0,D.jsx)(ni.Ih,{isMusicAndTalk:a}):a?d.Ru.get("type.showEpisode"):d.Ru.get("type.podcastEpisode")}(p,f||ci.I_.Unknown,m.playPositionMilliseconds,B(null==x?void 0:x.isoString),m.state===ci._w.Completed),j=null===(t=r.podcast)||void 0===t?void 0:t.uri,k=function(e){var t=(0,u.o_)(e),i=(0,u.cE)((null==t?void 0:t.id)||"");return"/show/".concat(i)}(j),P=(0,a.useCallback)((function(){y.logInteraction(c.podcastLinkFactory().hitUiNavigate({destination:k}))}),[y,k,c]),C=null===(i=r.podcast)||void 0===i?void 0:i.coverArt,w=!!(C&&C.length===g.length&&g.every((function(e,t){return e.url===C[t].url}))),I=(0,D.jsx)(T.b,{uri:p,sharingInfo:h,showUri:j,contextUri:p,isPlayed:s,onMarkAsPlayed:o});return(0,D.jsxs)(Wt.z,{backgroundColor:l,children:[(0,D.jsx)(Xt.h,{children:(0,D.jsx)(Gt.h,{menu:I,children:(0,D.jsx)($t.X,{text:v,dragUri:p,dragLabel:v})})}),!w&&(0,D.jsx)(Yt.X,{children:(0,D.jsx)(Gt.h,{menu:I,children:(0,D.jsx)(Jt.b,{loading:"eager",name:v,images:g,placeholderType:"episode",shape:Jt.u.SQUARE})})}),(0,D.jsxs)(Zt.Y,{children:[(0,D.jsx)(Vt.B,{children:b}),(0,D.jsx)(Gt.h,{menu:I,children:(0,D.jsx)(ti.mm,{dragUri:p,dragLabel:v,scaleAtMinWidth:ti.tw,className:J,children:(0,D.jsx)("span",{"data-testid":"episodeTitle",children:v})})}),(0,D.jsx)(Gt.h,{menu:I,children:(0,D.jsxs)(ii.N,{to:k,onClick:P,className:ae,children:[w&&(0,D.jsx)(li,{name:v,coverArt:g}),(0,D.jsx)(ei.g,{children:(0,D.jsx)("span",{"data-testid":"showTitle",children:null===(n=r.podcast)||void 0===n?void 0:n.name})})]})})]})]})},di=i(39107),pi=i(45497),vi=i(50605),hi=i(82456),mi=i(87424),fi=i(89923),xi=i(62562),gi=i(72346),yi=i(64869),bi=i(11404),ji=i(1321),ki=i(53670),Pi=i(81515);function Ci(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var wi=function(e){var t,i,o,c,d,f,y=e.episode,b=y.uri,j=y.episodeType,k=y.description,P=y.htmlDescription,C=y.podcastSubscription,w=y.segmentsCount,I=y.podcast,T=y.contentInformation,E=y.playedState,S=y.coverArt,A=(0,Y.r)(l.g,{data:{uri:b}}),O=A.spec,R=A.logger,_=(0,fi.n)(),F=(0,a.useMemo)((function(){return O.headerFactory()}),[O]),B=(0,a.useMemo)((function(){return O.actionBarFactory()}),[O]),M=(0,a.useState)(E.state===ci._w.Completed),q=(0,r.A)(M,2),z=q[0],H=q[1],K=(0,yi.z)(),Q=(0,gt.W)(),W=void 0!==w&&w>0,Z=(0,L.V)(),X=(0,Ve.P)(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ci(Object(i),!0).forEach((function(t){(0,n.A)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ci(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({uri:b},_?{}:{pages:[{items:[{type:Ae.c.EPISODE,uri:b,uid:null,provider:null}]}]}),{featureIdentifier:"episode"}),J=X.triggerPlay,V=X.togglePlay,ee=X.isActive,te=(0,bi.te)(b),ie=te.isActive,ne=te.isPlaying,re=null===(t=S.at(0))||void 0===t?void 0:t.url,ae=(0,gi.H)(re||null),se=(0,G.o)((function(e){var t;return null!==(t=null==e?void 0:e.isPaused)&&void 0!==t?t:void 0})),oe=(0,N.c)(),le=C.isPaywalled&&!C.isUserSubscribed,ce=ie||ee,ue=y?{name:y.name,uri:y.uri,mediaTypes:y.mediaTypes,audio:{items:y.audio.items.map((function(e){return{url:e.url}}))}}:null,de=I?{name:I.name,uri:I.uri,trailer:I.trailer,showTypes:I.showTypes}:null,pe=(0,xi.C)(ue,de),ve=(0,a.useCallback)((function(e,t,i,n){var r=function(){se?(null==n||n("resume"),K.resume()):(null==n||n("pause"),K.pause())};if(!le){var a="play";if(!ne||0!==e&&t||(a="pause"),Q({intent:a,targetUri:b,type:"click",itemIdSuffix:e>0?"podcast-description-timestamp":"button"}),j===ci.I_.Episode&&oe)v.h.set((function(){return{triggerId:i||U,triggerAction:null}}));else if(ee&&!t)Z?r():V({loggingParams:null==n?void 0:n()});else if(ie&&!t)r();else{var s=null==n?void 0:n("play");Z?pe({seekTo:e,loggingParams:s}):J({seekTo:e,loggingParams:s})}}}),[le,ne,Q,b,j,oe,ie,ee,Z,se,K,V,pe,J]),he=(0,a.useCallback)((function(e){ve(e,!1,void 0,(function(e){var t,i=O.actionBarFactory().playButtonFactory();return t="pause"===e||ne?i.hitPause({itemToBePaused:b}):"resume"===e||ce?i.hitResume({itemToBeResumed:b}):i.hitPlay({itemToBePlayed:b}),R.logInteraction(t)}))}),[ve,ce,ne,R,O,b]),me=(0,a.useCallback)((function(e){ve(e,!0,void 0,(function(){return R.logInteraction(O.descriptionSectionFactory().timestampLinkFactory().hitPlay({itemToBePlayed:b}))}))}),[ve,R,O,b]),fe=(0,a.useCallback)((function(e,t){ve(e,!0,t)}),[ve]),ge=(0,a.useCallback)((function(){Q({intent:"expand-description",type:"click"})}),[Q]),ye=(0,s.ok)(),be=(0,r.A)(ye,2),je=be[0],ke=be[1];(0,a.useEffect)((function(){if(y&&!ce&&je.has("t")){var e=je.get("t")||"0",t=1e3*parseInt(e,10);t<=y.duration.milliseconds&&(je.delete("t"),ke(je,{replace:!0}),ve(t,!0))}}),[y,ve,ce,je,ke]);var Pe=!!k||!!P,Ce=null===(i=y.podcast)||void 0===i?void 0:i.uri,we=null===(o=(0,u.o_)(Ce))||void 0===o?void 0:o.toURLPath(!0),Ie=(0,h.r)();return function(e){var t=(0,g.wA)(),i=(0,N.c)(),n=(0,g.d4)(mi.u);(0,a.useEffect)((function(){i&&e!==n&&t((0,hi.SC)(e))}),[e,n,t,i])}(b),(0,D.jsxs)("section",{"data-testid":"episode",className:$,children:[(0,D.jsx)(p.Q,{children:(0,Pi.L$)({episodeOrChapterName:y.name,showOrAudiobookName:null!==(c=null===(d=y.podcast)||void 0===d?void 0:d.name)&&void 0!==c?c:"",type:"Podcast"})}),(0,D.jsx)(x.c,{artistOrShow:null===(f=y.podcast)||void 0===f?void 0:f.name,title:y.name,uri:b,entityType:x.p.EPISODE}),(0,D.jsx)(ui,{episode:y,isFullyPlayed:z,setIsFullyPlayed:H,backgroundColor:ae,spec:F}),(0,D.jsx)(xe,{episode:y,onPlayEpisode:he,isPlaying:ne,isActive:ce,isFullyPlayed:z,setIsFullyPlayed:H,backgroundColor:ae,isLocked:le,spec:B}),(0,D.jsx)(di.q,{gatedEntityRelations:y.gatedEntityRelations,upsellExplanation:y.upsellExplanation,hasAccess:y.hasGatedEntityRelationAccess}),(0,D.jsxs)("div",{className:"contentSpacing",children:[(0,D.jsx)(Qt,{transcript:y.transcript,hasDescription:Pe,contentInformation:T,onDescriptionTimestampClick:me,onTranscriptTimestampClick:fe,onExpanded:ge,description:y.description,areHTMLDescriptionsEnabled:!0,htmlDescription:y.htmlDescription,playability:y.playability,hasMusicAndTalkSegements:W,segmentCount:w,uri:y.uri,showUrl:we,spec:O}),Ie&&(0,D.jsx)(m.W,{uri:b})]})]})};const Ii=a.memo((function(){var e,t=(0,o.g)().episodeId,i=void 0===t?"":t,n=(0,u.iM)(i).toURI(),r=(0,ji.d)(n);return null!=r&&r.isError||null==r||!r.episodeOrChapter?(0,D.jsx)(f.LoadingPage,{hasError:(null==r?void 0:r.isError)||!1,errorMessage:d.Ru.get("error.not_found.title.podcast")}):(0,ki.Gr)(r.episodeOrChapter)?(0,D.jsx)(pi.$,{to:(0,u.o_)(null===(e=r.episodeOrChapter.book)||void 0===e?void 0:e.uri).toURLPath(!0)}):(0,D.jsx)(a.Suspense,{fallback:null,children:(0,D.jsx)(vi.u,{pageId:c.$h.PODCAST_EPISODE,uri:n,children:(0,D.jsx)(wi,{episode:r.episodeOrChapter})})})}))}}]);
|
|
//# sourceMappingURL=xpui-routes-episode.js.map
|