2 lines
99 KiB
JavaScript
Executable File
2 lines
99 KiB
JavaScript
Executable File
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[2219],{88741:(e,i,n)=>{n.d(i,{o:()=>m});var a=n(59496),t=n(3802),s=n(1996),l=n(98340),d=n(45118),r=n(91834),o=n(40778),c=n(4637);const m=a.memo((function({uri:e}){const{spec:i}=(0,d.T)(e);return(0,c.jsx)(l.ZP,{value:"generic",children:(0,c.jsx)(s.v,{children:(0,c.jsxs)(r.q,{divider:"before",children:[(0,c.jsx)(o.Jx,{spec:i,uri:e,displayText:t.ag.get("context-menu.copy-generic-link")}),(0,c.jsx)(o.W2,{spec:i,uri:e})]})})})}))},39084:(e,i,n)=>{n.d(i,{Pd:()=>l,Wm:()=>s,i9:()=>t});var a=n(3802);const t=["artists","albums","episodes","genres","playlists","podcasts","audiobooks","tracks","users","topResults","podcastAndEpisodes"],s={artists:()=>a.ag.get("search.title.artists"),albums:()=>a.ag.get("search.title.albums"),playlists:()=>a.ag.get("search.title.playlists"),podcasts:()=>a.ag.get("search.title.shows"),episodes:()=>a.ag.get("search.title.episodes"),audiobooks:()=>a.ag.get("search.title.audiobooks"),users:()=>a.ag.get("search.title.profiles"),genres:()=>a.ag.get("search.title.genres-and-moods"),tracks:()=>a.ag.get("search.title.tracks"),podcastAndEpisodes:()=>a.ag.get("search.title.podcast-and-shows"),topResults:()=>a.ag.get("search.row.top-results")},l=["artists","albums","playlists","podcasts","episodes","audiobooks","users","genres"]},27659:(e,i,n)=>{n.d(i,{M:()=>R});var a=n(59496),t=n(84875),s=n.n(t),l=n(61740),d=n(89605),r=n(85830),o=n(94041),c=n(56162),m=n(48710),u=n(83680),k=n(36844),p=n(7681),v=n(50346),S=n(3802),N=n(46997),g=n(21524),y=n(96170),h=n(2831),f=n(41836),x=n(46179);const F="main-topBar-searchBar",b="x-searchInput-searchInputSearchIcon",j="x-searchInput-searchInputInput",C="x-searchInput-searchInputOnSearch",D="x-searchInput-searchInputClearButton",T="x-searchInput-searchInputIconContainer",A="x-searchInput=searchInputClearIcon";var I=n(4637);const R=a.memo((function({isSearchChipsEnabled:e=!1,onSearch:i=!0,onClick:n}){const t=(0,d.TH)(),R=(0,d.s0)(),E=(0,a.useRef)(null),V=(0,a.useRef)(null),w=(0,l.I0)(),[{category:U,query:P},q]=(0,x.l)(),[_,O]=(0,a.useState)(P),L=!!U,{scrollNodeRef:M}=a.useContext(g.VX),W=t.pathname.startsWith("/recent-searches"),H=L||W,{spec:B,logger:K}=(0,y.fU)(p.createDesktopSearchInputEventFactory,{}),G=(0,k.W6)(f.yA),z=(0,r.y1)(((i,n,a)=>{let t;if(a){const{interactionId:e}=K.logInteraction(a);t=e}e?q(i,U,!1,t):q(i,null,n,t),M.current&&(M.current.scrollTop=0)}),200),$=(0,a.useCallback)(((e=!1)=>{E.current!==document.activeElement&&(V.current=document.activeElement,E.current&&E.current.focus()),e&&E.current?.select()}),[]);(0,N.eY)(N.O4.SHOW_SEARCH,(()=>$(!0)));const Z=t.pathname.startsWith("/search");(0,a.useEffect)((()=>{!H&&i&&Z&&(e&&P||$())}),[P,$,t.key,i,Z,H,e]),(0,a.useEffect)((()=>{O(Z?P:"")}),[Z,P]);return(0,I.jsxs)("div",{className:s()(F,{[C]:!i}),children:[(0,I.jsx)("form",{onSubmit:e=>{e.preventDefault(),_&&K.logInteraction(B.keyStrokeSearch());const i=(0,v.EC)(_);if(i?.type===v.JM.AD){const e=(0,v.HB)(i.id);if(i.id===e)return;w((0,h.HI)(i.id))}else i?R(i.toURLPath(!0),{state:{preventMoveFocus:!0}}):_||R("/search",{state:{preventMoveFocus:!0}});_&&M.current?.querySelector("h1, h2, h3, h4")?.focus()},role:"search",children:(0,I.jsx)(c.D,{variant:"mesto",as:"input",style:{color:o.Snx},ref:E,className:s()(j),value:_,maxLength:800,autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,onChange:e=>{const i=e.currentTarget.value,n=B.keyStrokeChangeSearchQuery({searchQueryString:i});O(i),z(i,H,n)},onKeyDown:e=>{if("Escape"===e.key)if(_){const e=B.hitTextClear();O(""),z("",H,e)}else E.current&&E.current.blur(),V.current instanceof HTMLElement&&V.current.focus()},placeholder:i?S.ag.get("search.search-for-label"):S.ag.get("navbar.search"),onFocus:()=>{e||!H&&i||z(_,H,null)},"data-testid":"search-input",onClick:n})}),(0,I.jsxs)("div",{className:T,children:[(0,I.jsx)("span",{className:b,children:(0,I.jsx)(m.j,{className:A,"aria-hidden":!0,iconSize:G?16:24})}),_&&(0,I.jsx)("button",{className:D,onClick:()=>{E.current&&E.current.focus();const e=B.hitTextClear();O(""),z("",H,e)},"aria-label":S.ag.get("search.a11y.clear-input"),children:(0,I.jsx)(u.k,{className:A,iconSize:G?16:24})})]})]})}))},46179:(e,i,n)=>{n.d(i,{l:()=>d});var a=n(59496),t=n(89605),s=n(39084);const l=e=>s.i9.find((i=>i===e));function d(){const e=(0,t.s0)(),i=(0,t.bS)("/search/:query"),n=(0,t.bS)("/search/:query/:category"),s=(0,a.useCallback)((function(i,n,a,t){const s=t?{interactionId:t,preventMoveFocus:!0}:{preventMoveFocus:!0},l=["/search"];i&&(l.push(encodeURIComponent(i)),n&&l.push(n));const d=l.join("/");e(d,a?{state:s}:{state:s,replace:!0})}),[e]);return[{query:function(e){try{return decodeURIComponent(e)}catch{return e}}(i?.params.query??n?.params?.query??""),category:l(n?.params.category)},s]}},29415:(e,i,n)=>{n.r(i),n.d(i,{default:()=>Ut});var a=n(59496),t=n(84875),s=n.n(t),l=n(61740),d=n(89605),r=n(55530),o=n.n(r),c=n(36844),m=n(47792),u=n(3802),k=n(62361),p=n(49795),v=n(99678),S=n(18277),N=n(96170),g=n(69527),y=n(92211),h=n(98340),f=n(21789),x=n(4637);const F=()=>{const{searchHistory:e,clearSearchHistory:i}=(0,f.u)();return 0===e.length?null:(0,x.jsx)(g.q,{index:0,id:"recent-searches",total:e.length,seeAllUri:"spotify:app:recent-searches",title:u.ag.get("search.title.recent-searches"),children:e.map(((e,n)=>(0,x.jsx)(h.ZP,{index:n,value:"search-history",children:(0,x.jsx)(y.q,{entity:e,index:n,clearSearchHistory:i})},e.uri)))})};var b=n(41836);const j="search-searchBrowse-SearchBrowse",C=()=>{const{spec:e,UBIFragment:i}=(0,N.fU)(k.createDesktopFindEventFactory,{data:{uri:"search:find"}}),{recentSearchesSpec:n,topGenresSpec:t,browseAllSpec:s}=(0,a.useMemo)((()=>({recentSearchesSpec:e.recentSearchesFactory(),topGenresSpec:e.topGenresFactory(),browseAllSpec:e.browseAllFactory()})),[e]);return(0,x.jsxs)("div",{className:j,children:[(0,x.jsx)(i,{spec:n,children:(0,x.jsx)(F,{})}),(0,x.jsx)(p.F,{property:b.Oe,renderNewExperience:()=>(0,x.jsx)(S.Tn,{browseAllSpec:s}),renderOldExperience:()=>(0,x.jsx)(v.T,{topGenresSpec:t,browseAllSpec:s})})]})};var D=n(76160),T=n(77153),A=n(82171),I=n(63120);const R=(0,a.createContext)(null),E=R.Provider;function V(){const e=(0,a.useContext)(R);if(null===e)throw new Error("Trying to use 'SearchContext' without 'SearchProvider'!");return e}var w=n(39084);const U="search-searchCategory-SearchCategory",P="search-searchCategory-container",q="search-searchCategory-wrapper",_="search-searchCategory-categoryGridItem",O=({to:e,title:i,selected:n,onClick:a})=>(0,x.jsx)(I.default,{replace:!0,to:e,tabIndex:-1,onClick:a,className:_,children:(0,x.jsx)(D.A,{selected:n,selectedColorSet:"invertedLight",tabIndex:-1,children:i})}),L=({searchCategories:e,selectedCategory:i,displayChips:n})=>{const a=(0,c.W6)(b.Dz),{query:t}=V(),{spec:l,logger:d}=(0,N.fU)(T.createDesktopSearchChipsEventFactory,{});if(!t||!n)return null;const r=encodeURIComponent(t);return(0,x.jsx)("div",{className:U,children:(0,x.jsx)("div",{className:s()(P,"contentSpacing"),children:(0,x.jsx)("div",{className:q,children:(0,x.jsxs)(A.l,{children:[!a&&e.length>0&&(0,x.jsx)(O,{to:`spotify:app:search:${r}`,title:u.ag.get("search.title.all"),selected:void 0===i,onClick:()=>{d.logInteraction(l.chipFactory({identifier:"all",position:0}).hitUiNavigate({destination:`spotify:app:search:${r}`}))}},"all"),e.map(((e,n)=>{const a=w.Wm[e]?.();return(0,x.jsx)(O,{to:`spotify:app:search:${r}:${e}`,title:a,selected:i===e,onClick:()=>{d.logInteraction(l.chipFactory({identifier:e,position:n+1}).hitUiNavigate({destination:`spotify:app:search:${r}:${e}`}))}},e)}))]})})})})};var M=n(50787),W=n(79739),H=n(37180),B=n(73972),K=n(9374),G=n(95357);const z={[B.xN.Podcasts]:["podcasts","podcastAndEpisodes"],[B.xN.Episodes]:["episodes","podcastAndEpisodes"],[B.xN.TopResults]:["topResults","topResults"],[B.xN.Artists]:["artists","artists"],[B.xN.Albums]:["albums","albums"],[B.xN.Playlists]:["playlists","playlists"],[B.xN.Tracks]:["tracks","tracks"],[B.xN.Audiobooks]:["audiobooks","audiobooks"],[B.xN.Genres]:["genres","genres"],[B.xN.Users]:["users","users"]};var $=n(32812),Z=n(62517),X=n(25899),Q=n(41921),Y=n(2106);const J={albums:m.Wg.SEARCH_ALBUMS,artists:m.Wg.SEARCH_ARTISTS,episodes:m.Wg.SEARCH_EPISODES,genres:m.Wg.SEARCH_GENRES,playlists:m.Wg.SEARCH_PLAYLISTS,podcasts:m.Wg.SEARCH_SHOWS,audiobooks:m.Wg.SEARCH_AUDIOBOOKS,tracks:m.Wg.SEARCH_SONGS,users:m.Wg.SEARCH_PROFILES,podcastAndEpisodes:m.Wg.SEARCH_PODCASTS_AND_EPISODES,topResults:m.Wg.SEARCH};function ee({children:e}){const{query:i="",category:n=""}=(0,d.UO)();return(0,x.jsx)(Y.K,{pageId:J[n],entityUri:`spotify:app:search:${i}:${n}`,children:e})}function ie({children:e}){const{query:i}=(0,d.UO)();return(0,x.jsx)(Y.K,{pageId:m.Wg.SEARCH,entityUri:`spotify:app:search:${i}`,children:e})}var ne=n(70631),ae=n(31336),te=n(50346),se=n(59359),le=n(33103),de=n(56162),re=n(79475),oe=n(70333);const ce="hngqMWKjlLOEcuxpoHz9",me="WjLSNZPxuT0Zuw42kxSM",ue="zFOvsuNQpwehjH2VoiLL",ke="zeGt0Z2HCYRvd6ziu_t9",pe=({forChip:e})=>{const{query:i,serpId:n}=V(),a=!(0,$.k)(),t=`/search/${i}`,s=(0,te.ix)(i).toURI(),{spec:l,logger:d}=(0,N.fU)(oe.createDesktopSearchEmptyResultsEventFactory,{data:{uri:s,reason:n}}),r=(0,N.Wi)(l);return(0,x.jsxs)("div",{className:ce,"aria-live":"polite",ref:r,children:[(0,x.jsx)(de.D,{as:"h1",variant:"canon",className:me,children:e?u.ag.get("search.empty-results-title-for-chip",i,e):u.ag.get("search.empty-results-title",i)}),(0,x.jsx)("p",{className:ue,children:a?u.ag.get("web-player.search-modal.offline"):u.ag.get("search.empty-results-text")}),e&&(0,x.jsx)(le.rU,{to:t,children:(0,x.jsx)(re.D,{colorSet:"invertedLight",className:ke,onClick:()=>{d.logInteraction(l.seeAllButtonFactory().hitUiNavigate({destination:t}))},children:u.ag.get("search.see-all")})})]})};var ve=n(44358);const Se={results:null,isError:!1,isFetchMoreError:!1},Ne=(e,i)=>{const n=(0,ve.t)(),t=(0,a.useRef)(null),s=(0,a.useRef)(0),[l,d]=(0,a.useState)(Se),r=(0,a.useCallback)((async(a=!1)=>{if(!n())return;a&&(s.current=0,t.current=null);let l=e;if(null!==t.current){if(s.current>=t.current)return;s.current+l>t.current&&(l=t.current-s.current)}try{const e=await i(s.current,l);s.current+=l,t.current=e.totalCount||0,n()&&d((i=>({isError:!1,isFetchMoreError:!1,results:(a||null===i.results?[]:i.results).concat(e.items)})))}catch(e){n()&&d((e=>{const i=null===e.results||a;return{results:a?[]:e.results,isError:i,isFetchMoreError:!i}}))}}),[e,i,n]);return(0,a.useEffect)((()=>{r(!0)}),[r]),{results:l.results,isError:l.isError,fetchData:r,totalCountRef:t}};var ge=n(29251),ye=n(58230),he=n(88513),fe=n(13655),xe=n(66632),Fe=n(95663);const be=a.memo((function({uri:e,size:i=fe.q.md,className:n,onClick:t,showUpsell:s}){const[l,d]=(0,xe.Z)(e),r=(0,Fe.o)(),o=(0,a.useCallback)((()=>{r({targetUri:e,intent:"add-to-library",type:"click"}),d(!0)}),[r,e,d]);return(0,x.jsx)(fe.o,{className:n,isFollowing:l,onFollow:o,onClick:t,uri:e,size:i,showUpsell:s})})),je="RTP39YFgFAoVSlly6vCF",Ce="QT1jLaHHvO5g2YQor2Fw",De="wArYyZVjFviopRvRFV8t",Te="kRDD8AcqeOf5UDjOSQ8j",Ae="XN4TCZATPrKkEMngUtFc",Ie="VYaCpehPPhmTYPRxMBub",Re="abMqJCpsuShBo0DaZ7IY",Ee="ON88h0KYGqXMdOfsqot8",Ve="BHFMWOZUKxElyq1Ffc_S",we="EyH4QLenIbFw0x8r83eK",Ue="JA9jP30dm3GJikfs7vBn",Pe="xKl_2100SG4svBvzZ8Xv",qe="leel3U31UlOaYhKp6FgQ",_e="FxqpfDsISPKNu1XFExOg",Oe="kE234isNxJ9XiTT8QoJL",Le="KcOp4A5HBQ4EPH0IDRxg",Me="oODk_3Glvh7wotUlk4ov";var We=n(80964);const He=({uri:e,spec:i})=>{const n=(0,N.$P)(),t=(0,a.useCallback)(((a,t)=>{(0,We.l7)(t,i.downloadButtonFactory(),n,e)}),[n,i,e]);return(0,x.jsx)(be,{className:Te,uri:e,size:fe.q.xs,showUpsell:!1,onClick:t})};var Be=n(81281),Ke=n(42531);const Ge=({shape:e=Be.K.ROUNDED_CORNERS,type:i,name:n,images:a})=>(0,x.jsx)(Be.O,{shape:e,size:Ke.m$.SIZE_64,images:a,type:i,title:n});var ze=n(35394),$e=n(59200);const Ze=(0,a.createContext)((()=>{})),Xe=({menu:e,name:i,spec:n})=>{const t=(0,N.$P)(),s=(0,a.useContext)(Ze),l=(0,a.useCallback)((()=>{t.logInteraction(n.contextButtonFactory().hitUiReveal()),s(!0)}),[t,s,n]),d=(0,a.useCallback)((()=>{s(!1)}),[s]);return(0,x.jsx)($e.yj,{menu:e,onShow:l,onHide:d,children:(0,x.jsx)(ze.z,{className:Ae,size:ze.q.sm,label:u.ag.get("more.label.context",i)})})};var Qe=n(45265);const Ye=({name:e,uri:i,spec:n})=>{const t=(0,N.$P)(),s=(0,a.useCallback)((()=>{t.logInteraction(n.titleLinkFactory({uri:i}).hitUiNavigate({destination:i}))}),[t,n,i]);return(0,x.jsx)(Qe.w,{label:e,children:(0,x.jsx)(I.default,{to:i,className:Ve,onClick:s,children:(0,x.jsx)(de.D,{variant:"balladBold",semanticColor:"textBase",className:we,children:e})})})};var Je=n(30301),ei=n(85830),ii=n(91546),ni=n(24843),ai=n(39669),ti=n(66604),si=n(48607);const li=a.forwardRef((function({children:e,isLocked:i=!1,uri:n,playAriaLabel:t,spec:l},d){const[r,o]=(0,a.useState)(!1),c=(0,N.$P)(),{isPlaying:m,isActive:u,togglePlay:k}=(0,si.n)({uri:n},{featureIdentifier:"search"}),p=(0,ei.y1)((e=>{if(e.preventDefault(),e.detail>0&&e.currentTarget&&e.currentTarget.blur(),i)c.logInteraction(l.playbackButtonFactory().hitShowPaywall({paywalledItem:n}));else{const e=(0,We.aK)({isPlaying:m,isActive:u,spec:l.playbackButtonFactory(),logger:c,uri:n});k({loggingParams:e})}}),ai.s_,{leading:!0,trailing:!1});(0,a.useEffect)((()=>{const e=()=>{o(!0)},i=()=>{o(!1)};return m&&(o(document.hasFocus()),window.addEventListener("focus",e),window.addEventListener("blur",i)),()=>{window.removeEventListener("focus",e),window.removeEventListener("blur",i)}}),[m]);const v=!(0,ti.T)()&&r;return(0,x.jsxs)("div",{className:s()(Ue),children:[m?(0,x.jsx)("img",{className:Re,width:"14",height:"14",alt:"",src:(0,ii.g)(v?"images/equaliser-animated-green.gif":"images/equaliser-green.svg")}):e,(0,x.jsx)(ni.I,{className:Ie,iconClassName:Le,onClick:p,isPlaying:m,isLocked:i,playAriaLabel:t,ref:d})]})}));var di=n(54186);const ri="kwJGggri7IZMFvQEClUf",oi="yt0QcQy0t7LfbeVaEJG_",ci="WHMDRepGVQXXrTx3838g",mi="wLoqasagmgNF8ULGMhil",ui="cpC_03FZN3i93V8j3g0l",ki="S7CXd4i9huhWL_kPV_e3",pi="c85eTWJAYaGjCiwH1WDu",vi="cTTgGuDbNSWllHjVqiUx",Si=({className:e,leading:i,media:n,pretitle:a,title:t,subtitle:l,body:d,footer:r,trailing:o,onContextMenu:c,onTouchStart:m,onTouchEnd:u,onDragStart:k,onDoubleClick:p})=>{const v=(0,di.jh)();return(0,x.jsxs)("div",{className:s()(e,ri),onContextMenu:c,onTouchStart:m,onTouchEnd:u,draggable:!0,onDragStart:k,onDoubleClick:p,children:[i?(0,x.jsx)("div",{className:oi,children:i}):null,n?(0,x.jsx)("div",{className:ci,children:n}):null,(0,x.jsxs)("div",{className:mi,children:[a?(0,x.jsx)("div",{children:a}):null,t?(0,x.jsx)("div",{className:pi,children:t}):null,l?(0,x.jsx)("div",{className:vi,children:l}):null,d?(0,x.jsx)("div",{children:d}):null,r?(0,x.jsx)("div",{children:r}):null]}),o?(0,x.jsx)("div",{className:s()(ui,{[ki]:v===di.Uo.MEDIUM}),children:o}):null]})};var Ni=n(6142);const gi=e=>void 0!==e;const yi=({uri:e,destinationUri:i=e,name:n,createdBy:t,menu:l,media:d,leading:r,title:o,subtitle:c,body:m,trailing:u,onClick:k,spec:p})=>{const{isActive:v}=(0,Je.cR)(e),S=(0,N.$P)(),g=(0,a.useCallback)((()=>{S.logInteraction(p.secondaryHitUiReveal())}),[S,p]),y=(0,a.useCallback)((e=>{e.isDefaultPrevented()||(S.logInteraction(p.hitUiNavigate({destination:i})),k(e))}),[S,k,p,i]),h=function(e,i){if(e!==i)return`?highlight=${e}`}(e,i),f=(0,N.Wi)(p),F=((e,i,n)=>{const t=(0,Ni.O)();return(0,a.useCallback)((a=>{if(a.target!==a.currentTarget)return;const s=[i,n].filter(gi).join(" • ");t(a,[e],s,void 0,void 0)}),[t,n,i,e])})(e,n,t),[b,j]=(0,a.useState)(!1);return(0,x.jsx)(Ze.Provider,{value:j,children:(0,x.jsx)($e._P,{menu:l,onShow:g,children:(0,x.jsx)(I.default,{to:i,search:h,tabIndex:-1,onClick:y,className:je,"data-context-menu-open":b.toString(),ref:f,children:(0,x.jsx)(Si,{leading:r||!0,title:o,subtitle:c,body:m,trailing:u,media:d,className:s()(Ce,{[Ee]:v}),onDragStart:F})})})})};var hi=n(46525),fi=n(66405);const xi=({uri:e,type:i,spec:n})=>{const t=(0,N.$P)(),s=(0,a.useCallback)((i=>{const a=i?n.heartButtonFactory().hitLike({itemToBeLiked:e}):n.heartButtonFactory().hitRemoveLike({itemNoLongerLiked:e});t.logInteraction(a)}),[n,t,e]);return["episode","audiobook"].includes(i)?(0,x.jsx)(hi.w,{uri:e,className:De,onClick:s}):(0,x.jsx)(fi.B,{uri:e,className:De,onClick:s})};var Fi=n(14280),bi=n(762),ji=n(68776),Ci=n(13938),Di=n(54299);const Ti=({children:e,uri:i,name:n,index:t,menu:s,spec:l})=>{const d=(0,Ni.O)([i],n),r=(0,N.$P)(),o=(0,a.useCallback)((()=>{const e=l.subtitleLinkFactory({uri:i,position:t}).hitUiNavigate({destination:i});r.logInteraction(e)}),[t,r,l,i]);return(0,x.jsx)(Di._,{menu:s,children:(0,x.jsx)(Qe.w,{label:n,children:(0,x.jsx)(I.default,{draggable:!0,to:i,onDragStart:d,dir:"auto",onClick:o,children:e})})})},Ai=({artists:e,spec:i})=>e?(0,x.jsx)(x.Fragment,{children:e.map((({uri:e,name:n},a)=>[a>0&&u.ag.getSeparator(),(0,x.jsx)(Ti,{name:n,uri:e,index:a,menu:(0,x.jsx)(Fi.m,{uri:e}),spec:i,children:n},e)]))}):null,Ii=({topics:e=[],spec:i})=>0===e.length?null:(0,x.jsx)(x.Fragment,{children:e.filter(Ci.J).map((({uri:e,title:n},a)=>[a>0&&u.ag.getSeparator(),(0,x.jsx)(Ti,{name:n,uri:e,index:a,spec:i,children:n},e)]))}),Ri=({show:e,spec:i})=>(0,x.jsx)(Ti,{name:e.name,uri:e.uri,index:0,menu:(0,x.jsx)(bi.M,{uri:e.uri}),spec:i,children:e.name}),Ei=({uri:e,name:i,spec:n})=>(0,x.jsx)(Ti,{name:i,uri:e,index:0,menu:(0,x.jsx)(ji.I,{uri:e}),spec:n,children:i}),Vi=a.memo((function({album:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:s,type:l,name:d,images:r,year:o,artists:c}=e,m=c[0].name,{spec:k}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:s}}),{isPlaying:p}=(0,Je.cR)(s),v=(0,x.jsx)(he.Y,{uri:s});return(0,x.jsx)(yi,{spec:k,menu:v,uri:s,name:d,createdBy:c.map((e=>e.name)).join(u.ag.getSeparator()),onClick:i,media:(0,x.jsx)(Ge,{type:l,name:d,images:r}),leading:(0,x.jsx)(li,{isLocked:!1,uri:s,spec:k,playAriaLabel:p?u.ag.get("pause"):u.ag.get("tracklist.a11y.play",d,m)}),title:(0,x.jsx)(Ye,{name:d,uri:s,spec:k}),subtitle:(0,x.jsxs)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Me,children:[a&&(0,x.jsx)(de.D,{className:Oe,children:u.ag.get("card.tag.album")}),(0,x.jsx)(de.D,{className:Oe,children:(0,x.jsx)(Ai,{artists:c,spec:k})})]}),body:(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",children:o}),trailing:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(He,{uri:s,spec:k}),(0,x.jsx)(xi,{uri:s,type:"album",spec:k}),(0,x.jsx)(Xe,{menu:v,name:d,spec:k})]})})}));var wi=n(22823);const Ui=a.memo((function({artist:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:s,type:l,name:d,images:r,verified:o}=e,{spec:c}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:s}}),{isPlaying:m}=(0,Je.cR)(s),k=(0,x.jsx)(Fi.m,{uri:s});return(0,x.jsx)(yi,{spec:c,menu:k,uri:s,name:d,onClick:i,media:(0,x.jsx)(Ge,{type:l,name:d,images:r}),leading:(0,x.jsx)(li,{isLocked:!1,uri:s,spec:c,playAriaLabel:m?u.ag.get("playlist.a11y.play",d):u.ag.get("pause")}),title:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ye,{name:d,uri:s,spec:c}),o&&(0,x.jsx)(wi.S,{iconSize:16})]}),subtitle:a&&(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",children:u.ag.get("card.tag.artist")}),trailing:(0,x.jsx)(Xe,{menu:k,name:d,spec:c})})}));var Pi=n(99553),qi=n(75252);const _i=a.memo((function({book:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:s,type:l,name:d,images:r,authorName:o,publishDate:c,topics:m}=e,{spec:k}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:s}}),p=(0,x.jsx)(Pi.X,{uri:s}),v=m&&m.length>0;return(0,x.jsx)(yi,{spec:k,menu:p,uri:s,name:d,onClick:i,media:(0,x.jsx)(Ge,{type:l,name:d,images:r}),title:(0,x.jsx)(Ye,{name:d,uri:s,spec:k}),subtitle:(0,x.jsxs)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Me,children:[a&&(0,x.jsx)(de.D,{className:Oe,children:u.ag.get("search.row.subtitle")}),(0,x.jsx)(Qe.w,{label:o,children:(0,x.jsx)(de.D,{className:Oe,children:o})})]}),body:(0,x.jsxs)(x.Fragment,{children:[c&&(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Oe,children:(0,qi.rL)((0,qi.RX)(c.toISOString()))}),v&&(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Oe,children:(0,x.jsx)(Ii,{topics:m,spec:k})})]}),trailing:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(xi,{uri:s,type:"audiobook",spec:k}),(0,x.jsx)(Xe,{menu:p,name:d,spec:k})]})})}));var Oi=n(37433),Li=n(22315),Mi=n(73769),Wi=n(4882),Hi=n(90303),Bi=n(24867);const Ki=a.memo((function({episode:e,onClick:i,index:n,withEntityTag:t=!1}){const{requestId:l,uri:d,type:r,name:o,images:c,show:m,release:k,duration:p,isExplicit:v,is19PlusOnly:S,timeLeft:g}=e,{logger:y,spec:h}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:l??"",uri:d}}),{isPlaying:f}=(0,Je.cR)(d),F=(0,a.useCallback)(((e,i)=>{(0,We.l7)(i,h.downloadButtonFactory(),y,d)}),[y,h,d]),b=(0,x.jsx)(Mi.k,{uri:d});return(0,x.jsx)(yi,{spec:h,menu:b,uri:d,name:o,createdBy:m?.name||void 0,onClick:i,media:(0,x.jsx)(Ge,{type:r,name:o,images:c}),leading:(0,x.jsx)(li,{isLocked:!1,uri:d,spec:h,playAriaLabel:f?u.ag.get("pause"):m?u.ag.get("tracklist.a11y.play",o,m.publisher):u.ag.get("playlist.a11y.play",o)}),title:(0,x.jsx)(Ye,{name:o,uri:d,spec:h}),subtitle:(0,x.jsxs)(x.Fragment,{children:[v&&(0,x.jsx)(Wi.N,{}),S&&(0,x.jsx)(Hi.X,{size:16}),(0,x.jsxs)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Me,children:[t&&(0,x.jsx)(de.D,{children:u.ag.get("card.tag.episode")}),m&&(0,x.jsx)(de.D,{className:Oe,children:(0,x.jsx)(Ri,{show:m,spec:h})})]})]}),body:(0,x.jsxs)(x.Fragment,{children:[k.date&&(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Oe,children:(0,qi.rL)((0,qi.RX)(k.date))}),(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:s()(Oe,Pe),children:g.milliseconds>0?(0,x.jsx)(Bi.n,{durationMs:p.milliseconds}):(0,x.jsxs)(de.D,{className:qe,children:[u.ag.get("episode.played"),(0,x.jsx)(Oi.N,{iconSize:16,className:_e,"aria-hidden":"true"})]})})]}),trailing:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Li.p,{className:Te,uri:d,size:Li.q.xs,showUpsell:!1,onClick:F}),(0,x.jsx)(xi,{uri:d,type:"episode",spec:h}),(0,x.jsx)(Xe,{menu:b,name:o,spec:h})]})})}));var Gi=n(88741);const zi=a.memo((function({genre:e,onClick:i,index:n}){const{requestId:a,uri:t,type:s,name:l,images:d}=e,{spec:r}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:a??"",uri:t}});return(0,x.jsx)(yi,{spec:r,menu:(0,x.jsx)(Gi.o,{uri:t}),uri:t,name:l,onClick:i,media:(0,x.jsx)(Ge,{type:s,name:l,images:d}),title:(0,x.jsx)(Ye,{name:l,uri:t,spec:r})})}));var $i=n(73444);const Zi=a.memo((function({playlist:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:s,type:l,name:d,images:r,owner:o}=e,{spec:c}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:s}}),{isPlaying:m}=(0,Je.cR)(s),k=o.displayName?u.ag.get("tracklist.a11y.play",d,o.displayName):u.ag.get("play"),p=(0,x.jsx)($i.X,{uri:s});return(0,x.jsx)(yi,{spec:c,menu:p,uri:s,name:d,createdBy:o.displayName??void 0,onClick:i,media:(0,x.jsx)(Ge,{type:l,name:d,images:r}),leading:(0,x.jsx)(li,{isLocked:!1,uri:s,spec:c,playAriaLabel:m?u.ag.get("pause"):k}),title:(0,x.jsx)(Ye,{name:d,uri:s,spec:c}),subtitle:(0,x.jsxs)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Me,children:[a&&(0,x.jsx)(de.D,{className:Oe,children:u.ag.get("card.tag.playlist")}),o.displayName&&(0,x.jsx)(de.D,{className:Oe,children:(0,x.jsx)(Ei,{uri:o.uri,name:u.ag.get("search.playlist-by",o.displayName),spec:c})})]}),trailing:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(He,{uri:s,spec:c}),(0,x.jsx)(xi,{uri:s,type:"playlist",spec:c}),(0,x.jsx)(Xe,{menu:p,name:d,spec:c})]})})})),Xi=a.memo((function({show:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:l,type:d,name:r,images:o,publisher:c,topics:m}=e,{spec:k}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:l}}),p=(0,x.jsx)(bi.M,{uri:l});return(0,x.jsx)(yi,{spec:k,menu:p,uri:l,name:r,onClick:i,media:(0,x.jsx)(Ge,{type:d,name:r,images:o}),title:(0,x.jsx)(Ye,{name:r,uri:l,spec:k}),subtitle:(0,x.jsxs)(de.D,{variant:"mesto",semanticColor:"textSubdued",children:[(0,x.jsxs)("div",{children:[a&&(0,x.jsx)(de.D,{className:Oe,children:u.ag.get("card.tag.show")}),(0,x.jsx)(de.D,{className:s()(Oe),children:c})]}),(0,x.jsx)("div",{children:(0,x.jsx)(de.D,{className:s()(Oe,Me),children:(0,x.jsx)(Ii,{topics:m,spec:k})})})]}),trailing:(0,x.jsx)(Xe,{menu:p,name:r,spec:k})})}));var Qi=n(84229);const Yi=a.memo((function({track:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:s,type:l,name:d,artists:r,album:o,isExplicit:c,is19PlusOnly:m}=e,k=r[0].name,{spec:p}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:s}}),{isPlaying:v}=(0,Je.cR)(s),S=(0,x.jsx)(Qi.$,{uri:s});return(0,x.jsx)(yi,{spec:p,uri:s,destinationUri:o?.uri||void 0,menu:S,name:d,createdBy:r.map((e=>e.name)).join(u.ag.getSeparator()),onClick:i,media:(0,x.jsx)(Ge,{type:l,name:d,images:o?.images||[]}),leading:(0,x.jsx)(li,{isLocked:!1,uri:s,spec:p,playAriaLabel:v?u.ag.get("pause"):u.ag.get("tracklist.a11y.play",d,k)}),title:(0,x.jsx)(Ye,{name:d,uri:s,spec:p}),subtitle:(0,x.jsxs)(x.Fragment,{children:[c&&(0,x.jsx)(Wi.N,{}),m&&(0,x.jsx)(Hi.X,{size:16}),(0,x.jsxs)(de.D,{variant:"mesto",semanticColor:"textSubdued",className:Me,children:[a&&(0,x.jsx)(de.D,{children:u.ag.get("card.tag.track")}),(0,x.jsx)(de.D,{className:Oe,children:(0,x.jsx)(Ai,{artists:r,spec:p})})]})]}),trailing:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(xi,{uri:s,type:"track",spec:p}),(0,x.jsx)(Xe,{menu:S,name:d,spec:p})]})})})),Ji=a.memo((function({user:e,onClick:i,index:n,withEntityTag:a=!1}){const{requestId:t,uri:s,type:l,name:d,images:r}=e,{spec:o}=(0,N.fU)(ye.createDesktopSearchRowEventFactory,{data:{position:n,reason:t??"",uri:s}}),c=(0,x.jsx)(ji.I,{uri:s});return(0,x.jsx)(yi,{spec:o,menu:c,uri:s,name:d,onClick:i,media:(0,x.jsx)(Ge,{type:l,name:d,images:r,shape:Be.K.CIRCLE}),title:(0,x.jsx)(Ye,{name:d,uri:s,spec:o}),subtitle:a&&(0,x.jsx)(de.D,{variant:"mesto",semanticColor:"textSubdued",children:u.ag.get("card.tag.profile")}),trailing:(0,x.jsx)(Xe,{menu:c,name:d,spec:o})})})),en=({entity:e,index:i,withEntityTag:n})=>{const{onAddToHistory:t}=V(),s=(0,a.useCallback)((()=>{t(e)}),[e,t]);switch(e.type){case K.p.ALBUM:return(0,x.jsx)(Vi,{album:e,onClick:s,index:i,withEntityTag:n});case K.p.ARTIST:return(0,x.jsx)(Ui,{artist:e,onClick:s,index:i,withEntityTag:n});case K.p.AUDIOBOOK:return(0,x.jsx)(_i,{book:e,onClick:s,index:i,withEntityTag:n});case K.p.EPISODE:return(0,x.jsx)(Ki,{episode:e,onClick:s,index:i,withEntityTag:n});case K.p.GENRE:return(0,x.jsx)(zi,{genre:e,onClick:s,index:i});case K.p.PLAYLIST:return(0,x.jsx)(Zi,{playlist:e,onClick:s,index:i,withEntityTag:n});case K.p.USER:return(0,x.jsx)(Ji,{user:e,onClick:s,index:i,withEntityTag:n});case K.p.SHOW:return(0,x.jsx)(Xi,{show:e,onClick:s,index:i,withEntityTag:n});case K.p.TRACK:return(0,x.jsx)(Yi,{track:e,onClick:s,index:i,withEntityTag:n});default:return(0,ge._)(e),null}};var nn=n(33971),an=n(51450);const tn="FSAE0ABtUCeNRJckpcCH",sn="H2PDjUgJNBIH5eWg59M0",ln="vRlEuZATPhZt2l04RVIw",dn="Adlh7XTc3j3pXM3jGgr8",rn=({index:e,item:i})=>{const{episode:n,show:a}=i,{usePlayContextItem:t}=(0,si.n)({uri:i.episode.uri},{featureIdentifier:"search",referrerIdentifier:"search"});return(0,x.jsxs)("div",{className:dn,children:[(0,x.jsx)(an.V,{index:e,episode:{...n,requestId:i.requestId},showMetadata:a,usePlayContextItem:t}),(0,x.jsx)("hr",{className:ln,"aria-hidden":!0})]})},on=({showTitle:e=!0,displayEmptyPageOnEmptyResults:i=!0,displayError:n=!0,enableInfiniteScroll:a=!1,fetchData:t,totalCountRef:l,items:d,isError:r,isSearchV3Enabled:o})=>{const{query:c,serpId:m}=V(),u=(0,te.ix)(c).toURI(),{ref:k,breakpoint:p}=(0,di.Db)({[di.Uo.MEDIUM]:0,[di.Uo.LARGE]:600}),v=(0,N.$P)(),S=`spotify:app:search:${encodeURIComponent(c)}:${Vn}`,{spec:g,UBIFragment:y}=(0,N.fU)(ae.m,{data:{uri:u,reason:m}});return r?n?(0,x.jsx)(ne.p,{}):null:0===l.current?i?(0,x.jsx)(y,{spec:g.emptyResultsFactory(),children:(0,x.jsx)(pe,{forChip:w.Wm.episodes()})}):null:(0,x.jsxs)(di.ZU.Provider,{value:p,children:[d&&e&&(0,x.jsx)(se.r,{title:w.Wm.episodes(),seeAllUri:S,onClickTitle:()=>{g&&v.logInteraction(g.episodesListFactory().episodesListHeaderFactory().titleFactory().hitUiNavigate({destination:S}))},onClickSeeAll:()=>{g&&v.logInteraction(g.episodesListFactory().episodesListHeaderFactory().seeAllLinkFactory().hitUiNavigate({destination:S}))},hasMoreElements:!a&&d.length<(l.current||0)}),(0,x.jsx)("div",{ref:k,className:sn,children:d&&(0,x.jsx)(nn.C,{triggerOnInitialLoad:!1,className:s()({[tn]:o}),onReachBottom:()=>{a&&t()},children:d})})]})},cn=e=>{const{query:i,api:n}=V(),{results:t,isError:s,fetchData:l,totalCountRef:d}=Ne(30,(0,a.useCallback)(((e,a)=>n.getFullEpisodes(i,e,a)),[n,i]));return(0,x.jsx)(on,{...e,fetchData:l,totalCountRef:d,items:t?.map(((e,i)=>(0,x.jsx)(rn,{item:e,index:i},i))),isError:s})},mn=e=>{const{query:i,api:n}=V(),{results:t,isError:s,fetchData:l,totalCountRef:d}=Ne(30,(0,a.useCallback)(((e,a)=>n.getSearchCategoryResults(i,"episodes",!1,e,a)),[n,i]));return(0,x.jsx)(on,{...e,fetchData:l,totalCountRef:d,items:t?.map(((e,i)=>(0,x.jsx)(en,{entity:e,index:i},i))),isError:s,isSearchV3Enabled:!0})},un=e=>(0,c.W6)(b.Dz)?(0,x.jsx)(mn,{...e}):(0,x.jsx)(cn,{...e});var kn=n(52543);const pn=e=>{const{title:i,category:n,query:a,results:t,onAddToHistory:s,position:l,showSeeAll:d}=e;if(!t)return null;const{items:r,totalCount:o}=t;return r&&0!==r.length?(0,x.jsx)(g.q,{index:l,id:n,total:o||0,title:i,testId:`${n}-search-entity`,seeAllUri:`spotify:app:search:${encodeURIComponent(a)}:${n}`,showSeeAll:d,children:r.map(((e,i)=>(0,x.jsx)(h.ZP,{value:n,index:i,children:(0,x.jsx)(kn.h,{onClick:()=>s(e),entity:e,index:i})},e.uri)))}):null},vn="pE9ccpPiPFWfTWfDdKT_",Sn=({results:e})=>{const{query:i,serpId:n,onAddToHistory:a}=V(),t=(0,te.ix)(i).toURI(),{spec:s,UBIFragment:l}=(0,N.fU)(ae.m,{data:{uri:t,reason:n}});return 0===e?.podcasts.totalCount&&0===e?.episodes.totalCount?(0,x.jsx)(l,{spec:s.emptyResultsFactory(),children:(0,x.jsx)(pe,{forChip:w.Wm.podcastAndEpisodes()})}):(0,x.jsx)(l,{spec:s,children:(0,x.jsxs)("div",{className:vn,children:[0!==e?.podcasts.totalCount&&(0,x.jsx)("div",{children:(0,x.jsx)(pn,{position:0,category:"podcasts",title:w.Wm.podcastAndEpisodes(),query:i,results:e?.podcasts,onAddToHistory:a})}),0!==e?.episodes.totalCount&&(0,x.jsx)("div",{children:(0,x.jsx)(un,{displayEmptyPageOnEmptyResults:!1,displayError:!1})})]})})};var Nn=n(59290);const gn="bCoyoXohuLs0f6urF2PD",yn="EF2m35WFubo6yUwP04MQ",hn=({displayChips:e,category:i})=>{const{query:n,api:t,serpId:l,onAddToHistory:d}=V(),{results:r,isError:o,fetchData:c,totalCountRef:m}=Ne(30,(0,a.useCallback)(((e,a)=>t.getSearchCategoryResults(n,i,!0,e,a)),[t,i,n])),u=(0,a.useCallback)(((e,i)=>(0,x.jsx)(h.ZP,{value:"card",index:i,children:(0,x.jsx)(kn.h,{entity:e,onClick:()=>d(e),testId:`search-category-card-${i}`,index:i})},`${e.uri}-${i}`)),[d]),k=(0,te.ix)(n).toURI(),{spec:p,UBIFragment:v}=(0,N.fU)(Nn.N,{data:{uri:k,identifier:i,reason:l}}),S=(0,a.useMemo)((()=>p.cardsFactory()),[p]),g=(0,a.useMemo)((()=>p.emptyResultsFactory()),[p]);return o?(0,x.jsx)(ne.p,{}):0===m.current?(0,x.jsx)(v,{spec:g,children:(0,x.jsx)(pe,{forChip:w.Wm[i]()})}):(0,x.jsx)(v,{spec:S,children:(0,x.jsx)("div",{className:s()(gn,{[yn]:e}),children:r&&(0,x.jsx)(nn.C,{onReachBottom:c,triggerOnInitialLoad:!1,children:(0,x.jsx)(Z.T,{render:()=>r.map(((e,i)=>u(e,i)))})})})})};var fn=n(65937),xn=n(34553),Fn=n(16481),bn=n(75207),jn=n(53417);const Cn=({pageSize:e=100})=>{if(e>100)throw new Error("PathFinder does not support page sizes > 100");const{query:i,api:n,serpId:t}=V(),{results:s,isError:l,fetchData:d,totalCountRef:r}=Ne(e,(0,a.useCallback)(((e,a)=>n.getSearchCategoryResults(i,"tracks",!1,e,a)),[n,i])),o=(0,a.useCallback)(((e,i)=>{const n=(0,bn.X)(e.album?.images,{desiredSize:40}),a=!(!1===e.isPlayable);return(0,x.jsx)(jn.e9,{index:i,uri:(0,Fn.$)(e),duration:e.duration,name:e.name,album:e.album||void 0,artists:e.artists,isPlayable:a,isExplicit:e.isExplicit,is19PlusOnly:e.is19PlusOnly,imgUrl:n?.url||"",requestId:e.requestId,isLyricsMatch:e.isLyricsMatch},i+e.uri)}),[]),c=(0,a.useMemo)((()=>[jn.QD.INDEX,jn.QD.TITLE,jn.QD.ALBUM,jn.QD.DURATION]),[]),m=(0,a.useCallback)((e=>e.uri),[]),k=(0,te.ix)(i).toURI(),{spec:p,UBIFragment:v}=(0,N.fU)(fn.h,{data:{uri:k,reason:t}}),S=(0,a.useMemo)((()=>p.tracksFactory()),[p]),g=u.ag.get("search.showing-category-query-songs",i);if(l)return(0,x.jsx)(ne.p,{});if(0===r.current)return(0,x.jsx)(v,{spec:p.emptyResultsFactory(),children:(0,x.jsx)(pe,{forChip:w.Wm.podcastAndEpisodes()})});const y=xn.K1+48;return(0,x.jsx)(v,{spec:S,children:(0,x.jsx)(h.ZP,{value:"search-results-tracklist",children:(0,x.jsx)("div",{children:s&&(0,x.jsx)(nn.C,{triggerOnInitialLoad:!1,onReachBottom:d,children:(0,x.jsx)(jn.Pv,{ariaLabel:g,hasHeaderRow:!0,columns:c,renderRow:o,resolveUri:m,nrTracks:s.length,headerTop:y,tracks:s})})})})})},Dn="hciep85bysUuJqNoK7uw",Tn="Xa3KEcm2U_GOL2KMSoHw",An="KjXzXFYQr6Wp2QlxPUAY",In=({category:e})=>{const{query:i,api:n,serpId:t}=V(),{results:l,isError:d,fetchData:r,totalCountRef:o}=Ne(50,(0,a.useCallback)(((a,t)=>n.getSearchCategoryResults(i,e,!0,a,t)),[n,e,i])),c=(0,te.ix)(i).toURI(),{spec:m,UBIFragment:u}=(0,N.fU)(Nn.N,{data:{uri:c,identifier:e,reason:t}}),{ref:k,breakpoint:p}=(0,di.Db)({[di.Uo.MEDIUM]:0,[di.Uo.LARGE]:600}),v=(0,a.useMemo)((()=>m.cardsFactory()),[m]);if(d)return(0,x.jsx)(ne.p,{});if(0===o.current)return(0,x.jsx)(u,{spec:m.emptyResultsFactory(),children:(0,x.jsx)(pe,{forChip:w.Wm[e]()})});const S="episodes"===e||"podcasts"===e,g="topResults"===e;return(0,x.jsx)(u,{spec:v,children:(0,x.jsx)(di.ZU.Provider,{value:p,children:(0,x.jsx)("div",{ref:k,className:s()(Dn,{[An]:S}),children:l&&(0,x.jsx)(nn.C,{onReachBottom:r,triggerOnInitialLoad:!1,className:Tn,children:l.map(((e,i)=>(0,x.jsx)(en,{entity:e,index:i,withEntityTag:g},e.uri)))})})})})},Rn=({results:e,hasResults:i})=>{const{query:n,serpId:t}=V(),s=(0,te.ix)(n).toURI(),{spec:l,UBIFragment:d}=(0,N.fU)(Nn.N,{data:{uri:s,identifier:"topResults",reason:t}}),{ref:r,breakpoint:o}=(0,di.Db)({[di.Uo.MEDIUM]:0,[di.Uo.LARGE]:600}),c=(0,a.useMemo)((()=>l.cardsFactory()),[l]);return e&&i||l.emptyResultsFactory(),(0,x.jsx)(d,{spec:c,children:(0,x.jsx)(di.ZU.Provider,{value:o,children:(0,x.jsx)("div",{ref:r,className:Dn,children:e&&(0,x.jsx)(nn.C,{triggerOnInitialLoad:!1,className:Tn,children:e.topResults.items.map(((e,i)=>(0,x.jsx)(en,{entity:e,index:i,withEntityTag:!0},e.uri)))})})})})},En="podcastAndEpisodes",Vn="episodes",wn=({results:e,hasResults:i,displayChips:n})=>{const{category:a}=V(),t=(0,c.W6)(b.Dz);return a?a===En?(0,x.jsx)(Sn,{results:e}):t?"topResults"===a?(0,x.jsx)(Rn,{results:e,hasResults:i}):(0,x.jsx)(In,{category:a}):"tracks"===a?(0,x.jsx)(Cn,{}):a===Vn?(0,x.jsx)(un,{enableInfiniteScroll:!0,showTitle:!1}):(0,x.jsx)(hn,{displayChips:n,category:a}):(0,x.jsx)(ne.p,{})};var Un=n(27659),Pn=n(94041),qn=n(22308);const _n=a.memo((function({tracks:e,query:i}){const n=(0,a.useCallback)(((e,i)=>{const n=(0,bn.X)(e.album?.images,{desiredSize:40}),a=!(!1===e.isPlayable);return(0,x.jsx)(jn.pt,{uri:(0,Fn.$)(e),duration:e.duration,name:e.name,album:e.album||void 0,artists:e.artists,isPlayable:a,isExplicit:e.isExplicit,is19PlusOnly:e.is19PlusOnly,index:i,imgUrl:n?.url||"",requestId:e.requestId,isLyricsMatch:e.isLyricsMatch},e.uri)}),[]),t=(0,a.useMemo)((()=>[jn.QD.TITLE,jn.QD.DURATION]),[]),s=(0,a.useCallback)((e=>e.uri),[]);return e&&(0,x.jsx)(h.ZP,{value:"search-results-tracklist",children:(0,x.jsx)(jn.Pv,{ariaLabel:u.ag.get("search.a11y.songs-search-results"),renderRow:n,rowPlaceholder:jn.hU,nrTracks:Math.min(e.length,4),tracks:e,resolveUri:s,columns:t},i)})}),((e,i)=>e.tracks===i.tracks));var On=n(50181);const Ln="search-searchResult-tracklistHeader",Mn="search-searchResult-tracklistHeaderWrapper",Wn="search-searchResult-tracklistHeaderText",Hn="VL6wjp4Br_D3FEWrUGGR",Bn="search-searchResult-tracklistContainer",Kn="search-searchResult-tracklist",Gn=({tracks:e,query:i,className:n,showSeeAll:t=!0,spec:l})=>{const d=(0,N.$P)(),r=(0,a.useCallback)((()=>(0,x.jsx)("div",{className:Kn,children:(0,x.jsx)(a.Suspense,{fallback:null,children:(0,x.jsx)(_n,{tracks:e.items,query:i})})})),[i,e]),o=`spotify:app:search:${encodeURIComponent(i)}:tracks`,c=(0,a.useCallback)((()=>{const e=l.headerFactory().titleFactory().hitUiNavigate({destination:o});d.logInteraction(e)}),[d,l,o]),m=(0,a.useCallback)((()=>{const e=l.headerFactory().seeAllFactory().hitUiNavigate({destination:o});d.logInteraction(e)}),[d,l,o]);return e.items.length?(0,x.jsxs)("section",{className:s()(Bn,n),"aria-label":u.ag.get("search.title.tracks"),"data-testid":"search-tracks-result",children:[(0,x.jsx)("div",{className:Ln,children:e.items.length>3?(0,x.jsxs)("div",{className:Mn,children:[(0,x.jsx)("div",{className:Wn,children:(0,x.jsx)(de.D,{as:"h2",variant:"canon",children:t?(0,x.jsx)(I.Link,{to:o,className:Hn,onClick:c,children:u.ag.get("search.title.tracks")}):(0,x.jsx)("span",{className:Hn,children:u.ag.get("search.title.tracks")})})}),t&&(0,x.jsx)(On.SeeAll,{link:o,onClick:m})]}):(0,x.jsx)(de.D,{as:"h2",variant:"canon",className:Hn,children:u.ag.get("search.title.tracks")})}),(0,x.jsx)(N.Nh,{spec:l,children:(0,x.jsx)(Z.T,{render:r})})]}):null},zn=({topRecommendations:e,query:i,className:n,onAddToHistory:a,position:t,showSeeAll:s})=>{const l=e.totalCount||0;return(0,x.jsx)(g.q,{index:t,id:"top-recommendations",className:n,total:l,title:u.ag.get("artist-page.featuring",e.artistName),seeAllUri:`spotify:app:search:${encodeURIComponent(i)}:topRecommendations`,showSeeAll:s,children:e.items.map(((e,i)=>(0,x.jsx)(h.ZP,{index:i,value:"top-recommendations",children:(0,x.jsx)(kn.h,{onClick:()=>a(e),entity:e,index:i})},e.uri)))})};var $n=n(5488);const Zn="search-searchResult-topResult",Xn="search-searchResult-topResultCard",Qn="search-searchResult-searchResultGrid",Yn="EFHPppToKFxfm6SRhL6K",Jn="search-searchResult-tracklistShort",ea="search-searchResult-tracklistLong",ia="FTRmZyHUkeVY_X3RawUc",na="Tx_CKMgRE8CpW5vLdpAe",aa=({topResults:e,onAddToHistory:i})=>{const[n]=e.items;return n&&(0,x.jsx)($n.P,{total:1,className:Zn,title:u.ag.get("search.title.top-result"),children:[(0,x.jsx)("div",{"aria-live":"polite","data-testid":"top-result-card",className:Xn,children:(0,x.jsx)(h.ZP,{value:"top-result-card",children:(0,x.jsx)(kn.h,{isHero:!0,index:0,onClick:()=>i(n),entity:n})})},"top-result-item")]})},ta=({results:e})=>{const{query:i,onAddToHistory:n,serpId:t}=V(),s=(0,te.ix)(i).toURI(),{spec:l,UBIFragment:d}=(0,N.fU)(qn.r,{data:{uri:s,reason:t}}),r=e.topResults.items.length>0,o=e.tracks.items.length>0,c=e.topRecommendations.items.length>0,m=(0,a.useMemo)((()=>({topResult:l.topResultFactory(),trackList:l.trackListFactory(),shelves:l.shelvesFactory()})),[l]);return(0,x.jsx)(Z.T,{className:Qn,rowGap:Pn.mGT,testId:"search-results",render:({columnCount:a})=>{let t,s;return r?t=a>3?Jn:ea:c&&(a>5&&o?(t=Yn,s=ia):(t=ea,s=na)),(0,x.jsxs)(h.ZP,{value:"search-results",children:[r&&(0,x.jsx)(d,{spec:m.topResult,children:(0,x.jsx)(aa,{topResults:e.topResults,onAddToHistory:n})}),o&&(0,x.jsx)(Gn,{spec:m.trackList,className:t,query:i,tracks:e.tracks,onAddToHistory:n,showSeeAll:!1}),c&&(0,x.jsx)(d,{spec:m.shelves,children:(0,x.jsx)(zn,{position:0,query:i,className:s,topRecommendations:e.topRecommendations,onAddToHistory:n,showSeeAll:!1})}),w.Pd.map(((a,t)=>(0,x.jsx)(d,{spec:m.shelves,children:(0,x.jsx)(pn,{position:t+1,category:a,title:w.Wm[a](),query:i,results:e[a],onAddToHistory:n,showSeeAll:!1})},`search-shelf-${a}`)))]})}})},sa=({results:e,hasResults:i,category:n="topResults"})=>{const a=(0,c.W6)(b.Dz),{category:t,query:s,serpId:l}=V(),d=(0,te.ix)(s).toURI(),r=!(0,$.k)(),{spec:o,UBIFragment:m}=(0,N.fU)(qn.r,{data:{uri:d,reason:l}});return r?(0,x.jsx)(pe,{}):e?e&&!i?(0,x.jsx)(m,{spec:o.emptyResultsFactory(),children:(0,x.jsx)(pe,{})}):a&&!t?n===En?(0,x.jsx)(Sn,{results:e}):(0,x.jsx)(Rn,{results:e,hasResults:i}):(0,x.jsx)(ta,{results:e}):null};var la=n(7656),da=n(91577),ra=n(4055),oa=n(28133),ca=n(47146),ma=n(55760);const ua=(e,i)=>{const n="object"==typeof e?.requestIds?e?.requestIds:void 0,a=n?.[i],t="object"==typeof a?a:void 0;return"string"==typeof t?.["search-api"]?t?.["search-api"]:void 0},ka=e=>ua(e,"/searchV2"),pa=e=>ua(e,"/searchV2/topResults");n(72071);var va=n(74913),Sa=n(24377);const Na={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchImageURLAndSize"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ImageSource"}},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"}}]}}]},ga={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchImageSources"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Image"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sources"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageURLAndSize"}}]}},{kind:"Field",name:{kind:"Name",value:"extractedColors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"colorDark"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hex"}},{kind:"Field",name:{kind:"Name",value:"isFallback"}}]}}]}}]}}]},ya={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchAlbumDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AlbumResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Album"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"artists"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{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:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"date"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"year"}}]}}]}}]}}]}}]},ha={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchArtistDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ArtistResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Artist"}},selectionSet:{kind:"SelectionSet",selections:[{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:"verified"}}]}},{kind:"Field",name:{kind:"Name",value:"visuals"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"avatarImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}}]}}]}}]}}]}}]},fa={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchEpisodeDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EpisodeResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Episode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"duration"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalMilliseconds"}}]}},{kind:"Field",name:{kind:"Name",value:"releaseDate"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isoString"}},{kind:"Field",name:{kind:"Name",value:"precision"}}]}},{kind:"Field",name:{kind:"Name",value:"playedState"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"playPositionMilliseconds"}},{kind:"Field",name:{kind:"Name",value:"state"}}]}},{kind:"Field",name:{kind:"Name",value:"podcastV2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Podcast"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"imageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"mediaType"}},{kind:"Field",name:{kind:"Name",value:"publisher"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"contentRating"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"label"}}]}}]}}]}}]}}]},xa={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchGenreDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"GenreResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Genre"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"image"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}}]}}]}}]}}]},Fa={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchPlaylistDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlaylistResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Playlist"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"images"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"ownerV2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"username"}},{kind:"Field",name:{kind:"Name",value:"avatar"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sources"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"imageURLAndSize"}}]}}]}}]}}]}}]}}]}}]}}]}}]},ba={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchPodcastDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PodcastResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Podcast"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"publisher"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"mediaType"}},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"IntValue",value:"0"}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"5"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"uri"}}]}}]}}]}}]}}]}}]},ja={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchAudiobookDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AudiobookResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Audiobook"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"authors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"publishDate"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isoString"}}]}},{kind:"Field",name:{kind:"Name",value:"topics"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"IntValue",value:"0"}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"5"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"uri"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"mediaType"}},{kind:"Field",name:{kind:"Name",value:"accessInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"unlockedBy"}}]}}]}}]}}]}}]},Ca={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchTrackDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TrackResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Track"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"albumOfTrack"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"coverArt"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}},{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"artists"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{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:"contentRating"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"label"}}]}},{kind:"Field",name:{kind:"Name",value:"duration"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalMilliseconds"}}]}},{kind:"Field",name:{kind:"Name",value:"playability"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"playable"}}]}}]}}]}}]}}]},Da={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"searchUserDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UserResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uri"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",alias:{kind:"Name",value:"displayName"},name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"username"}},{kind:"Field",name:{kind:"Name",value:"avatar"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchImageSources"}}]}}]}}]}}]}}]},Ta={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchFullEpisodes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"episodes"},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:"searchFullEpisodeDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"searchFullEpisodeDesktop"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EpisodeResponseWrapper"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Episode"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"podcastEpisode"}},{kind:"Field",name:{kind:"Name",value:"podcastV2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Podcast"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"podcastMetadataV2"}}]}}]}}]}}]}}]}}]}},...Sa.n0.definitions,...va.rD.definitions,...va.rA.definitions,...va.Zl.definitions,...va.TS.definitions,...Sa.Sz.definitions,...Sa.Rr.definitions]};var Aa=n(6555),Ia=n(28418),Ra=n(84120),Ea=n(9603),Va=n(12741);function wa(e){return e.map((e=>e.url?{url:e.url,width:Number(e.width)||56,height:Number(e.height)||56}:e))}const Ua={type:K.p.SHOW,uri:"",name:"",publisher:"",images:[],mediaType:Va.E.UNKNOWN};function Pa(e,i){return{items:qa(e?.items||[],i),totalCount:e?.totalCount||0}}function qa(e,i){return e.map((e=>_a(e,i))).filter(Ia.K)}function _a(e,i){if("Episode"!==e.data?.__typename)return null;const n=e.data,a=n.podcastV2.data;let t=Ua;return"Podcast"===a.__typename&&(t={type:K.p.SHOW,uri:a.uri,name:a.name,publisher:a.publisher?.name||"",mediaType:(0,Ea.x7)(a.mediaType),images:wa(a.coverArt?.sources||[])}),{type:K.p.EPISODE,name:n.name,images:wa(n.coverArt?.sources||[]),uri:n.uri,duration:{milliseconds:n.duration.totalMilliseconds},isExplicit:n.contentRating?.label===B.KS.Explicit,release:(0,Ea.dR)(n.releaseDate),description:n.description||"",timeLeft:{milliseconds:n.playedState.state===B.sY.Completed?0:n.duration.totalMilliseconds-n.playedState.playPositionMilliseconds},is19PlusOnly:n.contentRating?.label===B.KS.NineteenPlus,show:t,requestId:i,color:(0,Ra.bS)(n.coverArt?.extractedColors)}}const Oa={...Ua,description:"",htmlDescription:"",coverArt:[],trailer:null,topics:[],podcastType:"UNKNOWN",showTypes:[],publisherName:"",consumptionOrder:"recent",nextBestEpisode:void 0,gatedContentAccessReason:void 0};function La(e,i){return e.map((e=>function(e,i){if("Episode"!==e.data?.__typename)return null;let n=Oa;"Podcast"===e.data.podcastV2.data.__typename&&(n=(0,Aa.XU)(e.data.podcastV2.data));return{requestId:i,episode:(0,Aa.YS)(e.data),show:n}}(e,i))).filter(Ia.K)}async function Ma(e,i){const n=await e(Ta,i),a=n?.data?.searchV2?.episodes;return a?function(e,i){return{items:La(e?.items||[],i),totalCount:e?.totalCount||0}}(a,ka(n?.extensions)):null}const Wa={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchDesktop"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"numberOfTopResults"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"includeAudiobooks"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"numberOfTopResults"},value:{kind:"Variable",name:{kind:"Name",value:"numberOfTopResults"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"albums"},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:"searchAlbumDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"artists"},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:"searchArtistDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"episodes"},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:"searchEpisodeDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"genres"},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:"searchGenreDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"playlists"},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:"searchPlaylistDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"podcasts"},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:"searchPodcastDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"audiobooks"},directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"includeAudiobooks"}}}]}],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:"searchAudiobookDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"tracksV2"},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:"matchedFields"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchTrackDesktop"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"users"},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:"searchUserDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"topResults"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemsV2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedFields"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchAlbumDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchArtistDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchEpisodeDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchGenreDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchPlaylistDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchPodcastDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchTrackDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchUserDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchAudiobookDesktop"},directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"includeAudiobooks"}}}]}]}]}}]}},{kind:"Field",name:{kind:"Name",value:"featured"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchPlaylistDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"chipOrder"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"typeName"}}]}}]}}]}}]}},...ya.definitions,...ga.definitions,...Na.definitions,...ha.definitions,...fa.definitions,...va.rD.definitions,...va.rA.definitions,...xa.definitions,...Fa.definitions,...ba.definitions,...ja.definitions,...Ca.definitions,...Da.definitions]};function Ha(e,i){return{items:Ba(e?.items||[],i),totalCount:e?.totalCount||0}}function Ba(e,i){return e.map((e=>Ka(e,i))).filter(Ia.K)}function Ka(e,i){if("Album"!==e.data?.__typename)return null;const n=e.data;return{type:K.p.ALBUM,name:n.name,uri:n.uri,images:wa(n.coverArt?.sources||[]),artists:n.artists.items.map((e=>({type:K.p.ARTIST,name:e.profile.name,uri:e.uri}))),year:n.date?.year,requestId:i,color:(0,Ra.bS)(e.data.coverArt?.extractedColors)}}const Ga={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchAlbums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"albums"},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:"searchAlbumDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...ya.definitions,...ga.definitions,...Na.definitions]};function za(e,i){return{items:$a(e?.items||[],i),totalCount:e?.totalCount||0}}function $a(e,i){return e.map((e=>Za(e,i))).filter(Ia.K)}function Za(e,i){if("Artist"!==e.data?.__typename)return null;const n=e.data;return{type:K.p.ARTIST,name:n.profile.name,images:wa(n.visuals?.avatarImage?.sources||[]),uri:n.uri,verified:n.profile.verified||!1,requestId:i,color:(0,Ra.bS)(n.visuals.avatarImage?.extractedColors)}}const Xa={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchArtists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"artists"},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:"searchArtistDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...ha.definitions,...ga.definitions,...Na.definitions]};var Qa=n(56692);function Ya(e,i){return{items:Ja(e?.items||[],i),totalCount:e?.totalCount}}function Ja(e,i){return e.map((e=>et(e,i))).filter(Ia.K)}function et(e,i){if("Audiobook"!==e.data?.__typename)return null;const n=e.data;return{type:K.p.AUDIOBOOK,uri:n.uri,name:n.name,images:wa(n.coverArt?.sources||[]),authorName:n.authors?.[0]?.name??"",topics:n.topics.items||[],publishDate:n.publishDate?new Date(n.publishDate.isoString):null,requestId:i,color:(0,Ra.bS)(n.coverArt?.extractedColors),gatedContentAccessReason:(0,Qa.S)(n.accessInfo?.unlockedBy)}}const it={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchAudiobooks"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"audiobooks"},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:"searchAudiobookDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...ja.definitions,...ga.definitions,...Na.definitions]};const nt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchEpisodes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"episodes"},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:"searchEpisodeDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...fa.definitions,...ga.definitions,...Na.definitions,...va.rD.definitions,...va.rA.definitions]};function at(e,i){return{items:tt(e?.items||[],i),totalCount:e?.totalCount||0}}function tt(e,i){return e.map((e=>st(e,i))).filter(Ia.K)}function st(e,i){if("Genre"!==e.data?.__typename)return null;const n=e.data,a=(0,te.EC)(n.uri);return{type:K.p.GENRE,name:n.name,uri:a?n.uri:`spotify:genre:${n.uri}`,images:wa(n.image?.sources||[]),requestId:i,color:(0,Ra.bS)(n.image?.extractedColors)}}const lt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchGenres"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"genres"},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:"searchGenreDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...xa.definitions,...ga.definitions,...Na.definitions]};const dt={type:K.p.USER,uri:"",displayName:"",username:"",images:[]};function rt(e,i){return{items:ot(e?.items||[],i),totalCount:e?.totalCount||0}}function ot(e,i){return e.map((e=>ct(e,i))).filter(Ia.K)}function ct(e,i){if("Playlist"!==e.data?.__typename)return null;const n=e.data;let a=dt;if("User"===n.ownerV2?.data.__typename){const e=n.ownerV2?.data;a={type:K.p.USER,uri:e.uri||"",displayName:e.name||"",username:e.username||"",images:wa(e.avatar?.sources||[])}}return{type:K.p.PLAYLIST,uri:n.uri,name:n.name,images:wa(n.images?.items.flatMap((e=>e.sources))||[]),owner:a,requestId:i,color:(0,Ra.bS)(n.images.items[0]?.extractedColors)}}const mt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchPlaylists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"playlists"},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:"searchPlaylistDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...Fa.definitions,...ga.definitions,...Na.definitions,...va.rA.definitions]};function ut(e,i){return{items:kt(e?.items||[],i),totalCount:e?.totalCount||0}}function kt(e,i){return e.map((e=>pt(e,i))).filter(Ia.K)}function pt(e,i){if("Podcast"!==e.data?.__typename)return null;const n=e.data;return{type:K.p.SHOW,uri:n.uri,name:n.name,images:wa(n.coverArt?.sources||[]),publisher:n.publisher?.name||"",topics:n.topics.items||[],requestId:i,color:(0,Ra.bS)(n.coverArt?.extractedColors)}}const vt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchPodcasts"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"podcasts"},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:"searchPodcastDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...ba.definitions,...ga.definitions,...Na.definitions]};function St(e,i){return{items:Nt(e,i),totalCount:e?.totalCount||0}}function Nt(e,i){return e?.items.map((e=>gt(e,i))).filter(Ia.K)||[]}function gt({item:e,matchedFields:i},n){if("Track"!==e.data?.__typename)return null;const a=e.data,t=a.albumOfTrack;return{type:K.p.TRACK,uri:a.uri,name:a.name,isPlayable:a.playability.playable,album:{type:K.p.ALBUM,uri:t?.uri||"",name:t?.name||"",images:wa(t?.coverArt?.sources||[])},artists:a.artists.items.map((e=>({type:K.p.ARTIST,name:e.profile.name,uri:e.uri}))),duration:{milliseconds:a.duration.totalMilliseconds},isExplicit:"EXPLICIT"===a.contentRating?.label,is19PlusOnly:"NINETEEN_PLUS"===a.contentRating?.label,requestId:n,isLyricsMatch:!!i?.includes(B.$C.Lyrics),color:(0,Ra.bS)(t?.coverArt?.extractedColors)}}const yt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchTracks"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"tracksV2"},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:"matchedFields"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchTrackDesktop"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...Ca.definitions,...ga.definitions,...Na.definitions]};function ht(e,i){return{items:ft(e?.items||[],i),totalCount:e?.totalCount||0}}function ft(e,i){return e.map((e=>xt(e,i))).filter(Ia.K)}function xt(e,i){if("User"!==e.data?.__typename)return null;const n=e.data;return{type:K.p.USER,uri:n.uri,name:n.displayName||n.username,images:wa(n.avatar?.sources??[]),requestId:i,color:(0,Ra.bS)(n.avatar?.extractedColors)}}const Ft={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchUsers"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"}},{kind:"Field",name:{kind:"Name",value:"users"},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:"searchUserDesktop"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOffset"}},{kind:"Field",name:{kind:"Name",value:"limit"}}]}}]}}]}}]}},...Da.definitions,...ga.definitions,...Na.definitions]};function bt(e,i){const n=e?.itemsV2??[];return{totalCount:n.length,items:n.map((e=>{const{item:n}=e;switch(n?.data?.__typename){case"Album":return Ka(n,i);case"Artist":return Za(n,i);case"Audiobook":return et(n,i);case"Episode":return _a(n,i);case"Genre":return st(n,i);case"Playlist":return ct(n,i);case"Podcast":return pt(n,i);case"Track":return gt(e,i);case"User":return xt(n,i);default:return console.warn("Unable to determine the correct type for item",n),null}})).filter(Ia.K)}}function jt(e,i){const n=e?.featured||[];return{artistName:n.length?Ct(e):"",items:n?.map((e=>ct(e,i))).filter(Ia.K)||[],totalCount:n.length||0}}function Ct(e){const i=(0,Ea.wY)(e,"itemsV2",[]);try{const e=(0,Ea.U2)(i.map((({item:e})=>e)).filter(Boolean),"0.data");return e?.profile?.name||""}catch{return""}}const Dt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"searchTopResultsOnly"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"numberOfTopResults"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"includeAudiobooks"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"numberOfTopResults"},value:{kind:"Variable",name:{kind:"Name",value:"numberOfTopResults"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"topResults"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchTopResultsOnly"}}]}},{kind:"Field",name:{kind:"Name",value:"chipOrder"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"typeName"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"albums"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"artists"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"episodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"genres"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"playlists"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"podcasts"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"tracksV2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}},{kind:"Field",name:{kind:"Name",value:"users"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"searchTopResultsOnly"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TopResultsV2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemsV2"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedFields"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"searchAlbumDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchArtistDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchEpisodeDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchGenreDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchPlaylistDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchPodcastDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchAudiobookDesktop"},directives:[{kind:"Directive",name:{kind:"Name",value:"include"},arguments:[{kind:"Argument",name:{kind:"Name",value:"if"},value:{kind:"Variable",name:{kind:"Name",value:"includeAudiobooks"}}}]}]},{kind:"FragmentSpread",name:{kind:"Name",value:"searchTrackDesktop"}},{kind:"FragmentSpread",name:{kind:"Name",value:"searchUserDesktop"}}]}}]}}]}},...ya.definitions,...ga.definitions,...Na.definitions,...ha.definitions,...fa.definitions,...va.rD.definitions,...va.rA.definitions,...xa.definitions,...Fa.definitions,...ba.definitions,...ja.definitions,...Ca.definitions,...Da.definitions]};const Tt={items:[],totalCount:0},At={albums:Tt,artists:Tt,episodes:Tt,genres:Tt,playlists:Tt,podcasts:Tt,audiobooks:Tt,topResults:{items:[]},tracks:Tt,users:Tt,topRecommendations:{artistName:"",items:[],totalCount:0},chipOrder:{items:[]}},It={albums:async function(e,i){const n=await e(Ga,i),a=n?.data?.searchV2?.albums;return a?Ha(a,ka(n?.extensions)):null},artists:async function(e,i){const n=await e(Xa,i),a=n?.data?.searchV2?.artists;return a?za(a,ka(n?.extensions)):null},episodes:async function(e,i){const n=await e(nt,i),a=n?.data?.searchV2?.episodes;return a?Pa(a,ka(n?.extensions)):null},genres:async function(e,i){const n=await e(lt,i),a=n?.data?.searchV2?.genres;return a?at(a,ka(n?.extensions)):null},playlists:async function(e,i){const n=await e(mt,i),a=n?.data?.searchV2?.playlists;return a?rt(a,ka(n?.extensions)):null},podcasts:async function(e,i){const n=await e(vt,i),a=n?.data?.searchV2?.podcasts;return a?ut(a,ka(n?.extensions)):null},audiobooks:async function(e,i){const n=await e(it,i),a=n?.data?.searchV2?.audiobooks;return a?Ya(a,ka(n?.extensions)):null},tracks:async function(e,i){const n=await e(yt,i),a=n?.data?.searchV2?.tracksV2;return a?St(a,ka(n?.extensions)):null},users:async function(e,i){const n=await e(Ft,i),a=n?.data?.searchV2?.users;return a?ht(a,ka(n?.extensions)):null},topResults:async function(e,i){const n=await e(Dt,i),a=n?.data?.searchV2?.topResults;return a?bt(a,pa(n?.extensions)):null}};class Rt{constructor(e){this._request=e}async getSearchResults(e,i=!0,n=0,a=10,t=5){const s={searchTerm:e,offset:n,limit:a,numberOfTopResults:t,includeAudiobooks:i},l=await this._request(Wa,s),d=l?.data?.searchV2;if(!d)return At;const r=ka(l?.extensions),o=pa(l?.extensions);return{albums:Ha(d.albums,r),artists:za(d.artists,r),episodes:Pa(d.episodes,r),genres:at(d.genres,r),playlists:rt(d.playlists,r),podcasts:ut(d.podcasts,r),audiobooks:Ya(d.audiobooks??null,r),tracks:St(d.tracksV2,r),users:ht(d.users,r),topResults:bt(d.topResults,o),topRecommendations:jt(d.topResults,o),chipOrder:d.chipOrder}}async getSearchCategoryResults(e,i,n=!1,a=0,t=25,s=20){const l={searchTerm:e,offset:a,limit:t,numberOfTopResults:s,includeAudiobooks:n};return await It[i](this._request,l)||Tt}async getFullEpisodes(e,i=0,n=25){const a={searchTerm:e,offset:i,limit:n};return await Ma(this._request,a)||Tt}}var Et=n(46179),Vt=n(73616);const wt=({results:e,hasResults:i})=>{const n=(0,c.W6)(b.Dz),{isBrowser:t}=(0,l.v9)((e=>e.platform)),r=(0,l.v9)(ca.rZ),o=(0,ra.g)(),u=(0,ma.s4)(),{category:k}=V(),p=((e,i,n)=>{const a=e?.chipOrder?.items??[];return Array.from(a.reduce(((a,t)=>{if(!t.typeName)return a;if(!n&&t.typeName===B.xN.TopResults)return a;const[s,l]=z[t.typeName];return l&&s&&(i===l||e?.[s]?.items?.length)?(a.add(l),a):a}),new Set([])))})(e,k,n),v="podcasts"!==k&&"episodes"!==k,S=n?p[0]:void 0,N=(e=>{if(!e)return!1;const[i]=e.topResults.items;return Boolean(i&&i.type===K.p.TRACK)})(e);return(0,a.useEffect)((()=>{t||e&&i&&N&&(({eventSender:e,country:i,isAnonymous:n})=>{const a={category:"internal-search-test",action:"search-results-page-visit",variant:"default",label:"desktop-app",os:(0,G.y)(),country:i,spt:(0,H.vQ)("sp_t")};n?e.send((0,W.k)(a)):e.send((0,M.x)(a))})({eventSender:u,country:r,isAnonymous:o})}),[r,u,i,o,t,e,N]),(0,x.jsxs)(h.ZP,{value:"search-page",children:[(0,x.jsx)(da.w,{children:(0,x.jsx)(Un.M,{isSearchChipsEnabled:!0})}),(0,x.jsx)(L,{searchCategories:p,selectedCategory:k??S,displayChips:v}),(0,x.jsx)("div",{className:s()("contentSpacing",{[Vt.Z.narrowPage]:n&&e}),id:"searchPage",children:(0,x.jsx)(Z.T,{className:Vt.Z.searchPageGrid,render:()=>(0,x.jsxs)(d.Z5,{children:[(0,x.jsx)(d.AW,{path:"/",element:(0,x.jsx)(Y.K,{pageId:m.Wg.FIND,entityUri:"spotify:app:search",children:(0,x.jsx)(C,{})})}),(0,x.jsx)(d.AW,{path:":query",element:(0,x.jsx)(ie,{children:(0,x.jsx)(sa,{results:e,hasResults:i,category:S})})}),(0,x.jsx)(d.AW,{path:":query/:category",element:(0,x.jsx)(ee,{children:(0,x.jsx)(wn,{results:e,hasResults:i,displayChips:v})})})]})})})]})};const Ut=a.memo((function(){const e=(0,c.W6)(b.Dz),i=!(0,$.k)(),[{category:n,query:t},s]=(0,Et.l)();(0,oa.z)("search");const[l,d]=(0,a.useState)({results:null,queryForResults:""}),r=l.results,m=function(e){return null!==e&&void 0!==Object.keys(e).find((i=>"chipOrder"!==i&&e[i].items.length>0))}(r),k=(0,a.useMemo)((()=>new Rt((0,Q.PQ)(X.b.getInstance()))),[]),{searchHistory:p,setSearchHistory:v}=(0,f.u)(),S=(0,a.useCallback)((e=>{v([e,...p])}),[p,v]),N=(0,a.useCallback)((async e=>{e===l.queryForResults&&m||s(e,n,!1)}),[l.queryForResults,n,m,s]);(0,a.useEffect)((()=>{(async()=>{if(!t)return;if(i)return void d({results:null,queryForResults:t});const n=e?20:5,a=await k.getSearchResults(t,!0,0,10,n);d({results:a,queryForResults:t})})()}),[t,k,e,i]),(0,a.useEffect)((()=>{t||d({results:null,queryForResults:""})}),[t]);const g=(0,a.useMemo)((()=>o().create().toString()),[n,l.queryForResults]),y=(0,a.useMemo)((()=>({api:k,category:n,query:l.queryForResults,onAddToHistory:S,onSearchRequest:N,serpId:g})),[k,n,S,N,l.queryForResults,g]);return(0,x.jsxs)(E,{value:y,children:[(0,x.jsx)(la.$,{children:u.ag.get("search.page-title")}),(0,x.jsx)(wt,{results:r,hasResults:m})]})}))},51450:(e,i,n)=>{n.d(i,{V:()=>R,e:()=>A});var a=n(59496),t=n(61740),s=n(37840),l=n(50346),d=n(23451),r=n(64238),o=n(73769),c=n(54126),m=n(84449),u=n(92009),k=n(97302),p=n(6142),v=n(95663),S=n(4055),N=n(65970),g=n(54299),y=n(4882),h=n(90303),f=n(98340),x=n(54186),F=n(91048),b=n(96170),j=n(73972),C=n(94033),D=n(72171),T=n(4637);function A(e){return{uri:e.uri,name:e.name,trailer:e.trailer,showTypes:e.showTypes}}const I=e=>`activation-trigger-mme-${e}`,R=a.memo((function({index:e=-1,showMetadata:i,episode:n,usePlayContextItem:R,status:E,variant:V}){const w=(0,D.E)(),U=n.playedState.playPositionMilliseconds,P=n.uri,q=(0,a.useRef)(null),[_,O]=(0,a.useState)(n.playedState.state===j.sY.Completed),L=(0,p.O)(),M=(0,S.g)(),W=(0,x.jh)(),H=(0,v.o)(),B=(0,t.I0)(),{UBIFragment:K,spec:G,logger:z}=(0,b.fU)(s.createDesktopEpisodeBlockEventFactory,{data:{uri:P,reason:n.requestId||"",position:e}}),$=(0,b.Wi)(G),{isActive:Z,isPlaying:X,togglePlay:Q}=R({uri:P}),[Y]=(0,F.z)(1e4,(e=>e?.item?.uri===P));(0,a.useEffect)((()=>{X&&(q.current=Y)}),[X,Y]),(0,a.useEffect)((()=>{!X&&q.current&&n.duration.milliseconds<=q.current&&O(!0)}),[X,n.duration.milliseconds]);const J=(0,a.useCallback)((e=>{e||(q.current=0),O(e)}),[]),ee=A(i),ie=(0,N.s)({...n,coverArt:{sources:n.coverArt}},ee),ne=(0,a.useCallback)((()=>{if(n.episodeType===j.Wf.Episode&&w)u.y.set((()=>({triggerId:I(n.uri),triggerAction:null})));else if(M)ie();else{let e;e=X?G.playButtonFactory().hitPause({itemToBePaused:P}):Z?G.playButtonFactory().hitResume({itemToBeResumed:P}):G.playButtonFactory().hitPlay({itemToBePlayed:P});const i=z.logInteraction(e);H({targetUri:P,intent:X?"pause":"play",type:"click"}),Q({loggingParams:i})}}),[Z,ie,H,Q,P,X,M,n,w,z,G]),ae=(0,a.useCallback)((()=>{z.logInteraction(G.hitUiNavigate({destination:P})),H({type:"click",targetUri:P,intent:"navigate"})}),[P,H,z,G]),te=n.podcastSubscription?.isPaywalled??!1,se=n.podcastSubscription?.isUserSubscribed??!1,le=te&&!se,de=te&&M,{badges:re}=(0,C.r)({contentRating:n.contentRating?.label,isPaywalled:te}),oe=(0,a.useCallback)((()=>B((0,d.RM)(i.uri))),[i.uri,B]),ce=(0,a.useCallback)((e=>{let a=e;return(le||de)&&(a=(0,T.jsx)(m.l,{enabled:!0,showUri:i.uri,children:a})),!n.playability.playable&&re.nineteen&&(a=(0,T.jsx)("div",{onClick:e=>{e.stopPropagation(),oe()},children:e})),a=(0,T.jsx)(r.D,{id:I(P),targetURI:(0,l.EC)(P),children:a}),a}),[P,le,de,i.uri,re.nineteen,n.playability.playable,oe]);return(0,T.jsx)(K,{spec:G,children:(0,T.jsx)(f.ZP,{value:"row",index:e,children:(0,T.jsx)(g._,{onShow:()=>{z.logInteraction(G.secondaryHitUiReveal())},menu:(0,T.jsx)(o.k,{uri:P,showUri:i.uri,sharingInfo:n.sharingInfo,isPlayed:_,onMarkAsPlayed:J}),children:(0,T.jsx)(c.X,{ref:$,requestId:n.requestId,index:e,uri:P,size:W,images:n.coverArt||[],name:n.name,showName:i.name,description:n.description,isPlayable:n.playability.playable||le,fullyPlayed:_,durationMs:n.duration.milliseconds,releaseDate:n.releaseDate?.isoString||"",resumePositionMs:q.current??U,handleDragStart:e=>{if(e.target!==e.currentTarget)return;const a=`${n.name} • ${i.name}`;L(e,[P],a,i.uri)},handlePlaybackClick:ne,handleClick:ae,isCurrentlyPlaying:Z,isPaywalled:te,isUserSubscribed:se,isPlaying:X,position:X?Y:void 0,episodeSharingInfo:n.sharingInfo,onMarkAsPlayed:J,contentInformation:n.contentInformation,badges:(0,T.jsxs)(T.Fragment,{children:[re.explicit&&(0,T.jsx)(y.N,{}),re.paid&&(0,T.jsx)(k.g,{}),re.nineteen&&(0,T.jsx)(h.X,{size:16})]}),playButtonWrapper:ce,onMoreButtonClick:()=>{z.logInteraction(G.moreButtonFactory().hitUiReveal())},status:E,variant:V})})})})}))},65970:(e,i,n)=>{n.d(i,{s:()=>u});var a=n(59496),t=n(95663);const s=e=>e<=64?"small":e>640?"xlarge":e>300?"large":"standard";function l(e,i){return e.filter((e=>e.label?e.label===i:e.width?s(e.width)===i:!!e.height&&s(e.height)===i))[0]}var d=n(23327);function r(e){const i=l(e,"standard"),n=l(e,"large"),a=l(e,"small"),t=l(e,"xlarge");return{image_url:i?.url,image_height:i?.height?.toString(),image_width:i?.width?.toString(),image_url_large:n?.url,image_height_large:n?.height?.toString(),image_width_large:n?.width?.toString(),image_url_small:a?.url,image_height_small:a?.height?.toString(),image_width_small:a?.width?.toString(),image_url_xlarge:t?.url,image_height_xlarge:t?.height?.toString(),image_width_xlarge:t?.width?.toString()}}var o=n(37409),c=n(30301),m=n(9374);function u(e,i){const n=(0,t.o)(),s=(0,o.g)(),{isPlaying:l,isActive:u}=(0,c.$o)(e?.uri||""),{isActive:k}=(0,c.cR)(i?.uri||"");return(0,a.useCallback)((a=>{if(!i||!e)return;const t=function(e,i){const n=(e.coverArt?.sources||[]).sort(((e,i)=>(i.width||0)-(e.width||0))),a=(0,d.Xb)(e,i),t=(0,d.Ie)(i)||a;return{uri:e.uri,title:e.name,subtitle:i.name,type:"episode",album_uri:i.uri,album_title:i.name,artist_uri:i.uri,artist_name:i.name,...r(n),media_type:"audio",isTrailer:a,anonymousPlaybackAllowed:t}}(e,i);k&&!l&&u&&!a?s.resume():k&&l&&!a?(n({type:"click",intent:"pause",targetUri:e.uri}),s.pause()):(n({type:"click",intent:"play",targetUri:e.uri}),s.play({uri:i.uri,pages:[{items:[{type:m.p.EPISODE,uri:e.uri,uid:null,metadata:t,provider:null}]}]},{referrerIdentifier:s.getReferrer(),featureIdentifier:"episode"},a))}),[u,l,k,s,n,i,e])}},16481:(e,i,n)=>{n.d(i,{$:()=>a});const a=e=>e?.linked_from?.uri||e.uri}}]);
|
|
//# sourceMappingURL=xpui-routes-search.js.map
|