"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[7704],{81958:(e,t,s)=>{s.r(t),s.d(t,{SKELETON_CARDS_COUNT:()=>It,SKELETON_SHELVES_COUNT:()=>Tt,SKELETON_SHORTCUTS_COUNT:()=>_t,default:()=>wt});var n=s(59496),a=s(84875),r=s.n(a),o=s(61740),i=s(36844),c=s(22385),l=s(3802),u=s(91703),d=s(40576),m=s(21718),h=s(23329),g=s(9374),p=s(82279),x=s(56876),f=s(7142),j=s(74991),y=s(34058),v=s(50346),C=s(27652),S=s(54299),k=s(75257),b=s(20287),N=s(82538),E=s(43064),_=s(91048),T=s(30301);const I="view-homeShortcutsGrid-shortcuts",P="view-homeShortcutsGrid-grid",L="view-homeShortcutsGrid-shortcutLink",w="view-homeShortcutsGrid-shortcut",M="view-homeShortcutsGrid-draggable",F="view-homeShortcutsGrid-imageContainer",B="view-homeShortcutsGrid-imageWrapper",U="view-homeShortcutsGrid-image",O="view-homeShortcutsGrid-main",D="view-homeShortcutsGrid-nameWrapper",A="view-homeShortcutsGrid-name",H="EzRmGRncgnv1zFgF4dqE",R="bPmmKmSPLKMhtJSaUJRX",W="vpQWUBWS_lXRLZMRJT7w",J="GSv7K805J9Jw7LB9tn2A",q="view-homeShortcutsGrid-PlayButtonContainer",z="s9c9x_mJq197U2hBzGtV";var $=s(4637);const Y=(0,n.memo)((function({item:e}){const t=(0,E._)(e.uri),s=e.duration_ms??0,{isPlaying:n,isActive:a}=(0,T.$o)(e.uri),[r]=(0,_.z)(1e4,(t=>t.item?.uri===e.uri)),o=e.resume_point?.resume_position_ms??0,i=n||a?r:o,c=Math.round(100/(s/i)),l=t===N.Om.YES,u=s&&i>0;return l||u?(0,$.jsxs)("div",{className:W,children:[l?(0,$.jsx)(k.E,{iconSize:16,semanticColor:"textSubdued"}):null,u?(0,$.jsx)(b.k,{className:J,value:c,semanticColor:"essentialBase"}):null]}):null}));var G=s(89605),K=s(56162),X=s(94722),Z=s(30985),V=s(17201),Q=s(40780),ee=s(39669),te=s(48607),se=s(96170),ne=s(32422),ae=s(42006),re=s(75207);const oe=(0,n.memo)((function({images:e=[],fallbackIcon:t=x.U}){const s=(0,re.X)(e);return(0,$.jsx)("div",{className:F,children:(0,$.jsx)("div",{className:B,children:(0,$.jsx)(ae.E,{className:U,src:s?.url,loading:"lazy",testid:"shortcut-image",children:(0,$.jsx)(t,{"aria-hidden":!0})})})})}));var ie=s(6142),ce=s(95663),le=s(63120);const ue=n.memo((function({index:e,item:t,fallbackIcon:s,showPlayButton:a,extraContent:i,playInsteadOfNavigating:c=!1,onContextMenu:u=(()=>{}),onTouchStart:d=(()=>{}),onTouchEnd:m=(()=>{})}){const h=(0,G.s0)(),g=(0,ce.o)(),{setColorFromUri:x,resetColor:f,clearColor:j}=(0,p.WQ)(),y=(0,Q.G3)(t.uri,t.release_date,t.resume_point?.resume_position_ms,t.resume_point?.fully_played),{spec:C,logger:S}=(0,se.fU)(X.createDesktopShortcutsPlayNavCardEventFactory,{data:{position:e,uri:t.uri}}),{isPlaying:k,isActive:b,togglePlay:N}=(0,te.n)({uri:t.uri},{featureIdentifier:"home",referrerIdentifier:"home"}),E=(0,v.EC)(t.uri),_=E?.type,T=(0,o.v9)(Z.br),I=(0,o.v9)(Z.yE),P=l.ag.getUrlLocale(),F=(0,ne.S9)({localeFeatureFlag:T,entityFeatureFlag:I,urlLocale:P,entity:_,type:"link"}),B=(0,n.useCallback)((()=>{g({targetUri:t.uri,intent:k?"pause":"play",type:"click"});const e=C.playButtonFactory();let s;s=k?e.hitPause({itemToBePaused:t.uri}):b?e.hitResume({itemToBeResumed:t.uri}):e.hitPlay({itemToBePlayed:t.uri});const n=S.logInteraction(s);N({loggingParams:n})}),[b,k,t.uri,S,g,C,N]),U=(0,n.useCallback)((()=>{if(c)return void B();g({targetUri:t.uri,intent:"navigate",type:"click"});const e=C.hitUiNavigate({destination:t.uri});let s;S.logInteraction(e),E&&(s=E.toURLPath(!0));const n=F?`/${ee.F0}${P}${s}`:s;n&&h(n)}),[t.uri,S,h,g,C,E,F,P,c,B]),W=(0,n.useCallback)((()=>{x(t.uri)}),[t.uri,x]);(0,n.useEffect)((()=>()=>{j()}),[j]);const J=(0,se.Wi)(C),Y=(0,ie.O)([t.uri],t.name);return(0,$.jsx)("div",{ref:J,className:w,onContextMenu:u,onTouchStart:d,onTouchEnd:m,onMouseEnter:W,onMouseLeave:f,children:(0,$.jsxs)("div",{className:M,onDragStart:Y,children:[(0,$.jsx)(oe,{images:t.images,fallbackIcon:s}),(0,$.jsxs)("div",{className:O,children:[(0,$.jsxs)("div",{className:D,children:[(0,$.jsxs)("div",{className:A,children:[y&&(0,$.jsx)(Q.Rd,{className:R}),(0,$.jsx)(le.Link,{to:t.uri,onClick:U,title:t.name,children:(0,$.jsx)(K.D,{as:"p",variant:"balladBold",className:H,children:t.name})})]}),i||null]}),a&&(0,$.jsx)("div",{className:r()(q,{[z]:k}),children:(0,$.jsx)(V.f,{isPlaying:k,onClick:B})})]}),(0,$.jsx)("div",{onClick:U,className:L})]})})}));var de=s(88513),me=s(14280),he=s(73769),ge=s(73444),pe=s(762);const xe=n.memo((function(e){return(0,v.zO)(e.item.uri)?(0,$.jsx)(ue,{...e,fallbackIcon:x.U}):(0,C.MW)(e.item.uri)?(0,$.jsx)(S._,{menu:(0,$.jsx)(C.XL,{}),children:(0,$.jsx)(ue,{...e,fallbackIcon:x.U,playInsteadOfNavigating:!0})}):(0,$.jsx)(S._,{menu:(0,$.jsx)(ge.X,{uri:e.item.uri}),children:(0,$.jsx)(ue,{...e,fallbackIcon:x.U})})})),fe=n.memo((function(e){return(0,$.jsx)(S._,{menu:(0,$.jsx)(de.Y,{uri:e.item.uri}),children:(0,$.jsx)(ue,{...e,fallbackIcon:f.c})})})),je=n.memo((function(e){return(0,$.jsx)(S._,{menu:(0,$.jsx)(me.m,{uri:e.item.uri}),children:(0,$.jsx)(ue,{...e,fallbackIcon:j.a})})})),ye=n.memo((function(e){return(0,$.jsx)(S._,{menu:(0,$.jsx)(pe.M,{uri:e.item.uri}),children:(0,$.jsx)(ue,{...e,fallbackIcon:y.J,showPlayButton:!1})})})),ve=n.memo((function(e){return e.item.podcast?(0,$.jsx)(ye,{index:e.index,shouldSetBackgroundColor:e.shouldSetBackgroundColor,item:e.item.podcast,showPlayButton:e.showPlayButton}):(0,$.jsx)(S._,{menu:(0,$.jsx)(he.k,{uri:e.item.uri}),children:(0,$.jsx)(ue,{...e,fallbackIcon:y.J,extraContent:(0,$.jsx)(Y,{...e})})})}));var Ce=s(98042),Se=s(13973);const ke="J6UEDIqMSJhYlwGoeUZB",be="ZjFf4lVC48DSryAjP9qB",Ne=n.memo((function(e){const t=(0,Se.x)(),s={...e.item,...t};return(0,$.jsx)(ue,{...e,item:s,fallbackIcon:()=>(0,$.jsx)("div",{className:ke,children:(0,$.jsx)(Ce.P,{iconSize:32,className:be})})})}));var Ee=s(32812),_e=s(59359);const Te=24,Ie=270,Pe=200,Le=600,we=3*Ie+2*Te,Me=80,Fe=64,Be=16,Ue=12;function Oe(e){if(null===e)return{cssProperties:{"--min-column-width":`${Ie}px`,"--item-height":`${Me}px`,"--column-gap":`${Te}px`,"--row-gap":`${Be}px`},showPlayButton:!0};const t=e.offsetWidth,s=t=we?Me:Fe;return{cssProperties:{"--min-column-width":`${s}px`,"--item-height":`${a}px`,"--column-gap":`${Te}px`,"--row-gap":`${a===Fe?Ue:Be}px`},showPlayButton:(t-(n-1)*Te)/n>=Ie}}function De(){const e=(0,n.useRef)(null),[t,s]=(0,n.useState)(Oe(null)),a=(0,n.useCallback)((()=>{null!==e.current&&s(Oe(e.current))}),[]),r=(0,n.useCallback)((t=>{e.current=t,a()}),[a]);return(0,m.a)((()=>a())),[t,r]}const Ae=e=>{if(null!==e&&"object"==typeof e){const{type:t,name:s}=e;return t===g.p.YOUR_EPISODES&&"string"==typeof s}return!1},He=n.memo((function({title:e,tagline:t,items:s}){const{fetchMultipleColors:a}=(0,p.WQ)(),r=!(0,Ee.k)(),o=e??(()=>{const e=(new Date).getHours();let t=l.ag.get("home.evening");return e>=5&&e<12?t=l.ag.get("home.morning"):e>=12&&e<18&&(t=l.ag.get("home.afternoon")),t})(),[i,c]=De();return(0,n.useEffect)((()=>{const e=s?.map(p.lh)||[];a(e)}),[s,a]),r||!s?.length?null:(0,$.jsxs)("section",{className:I,"aria-label":o,ref:c,children:[(0,$.jsx)(_e.r,{title:o,titleVariant:"alto",tagline:t}),(0,$.jsx)("div",{className:P,style:i.cssProperties,children:s.filter(((e,t)=>Ae(e)||!e.error)).filter(((e,t)=>t<6)).map(((e,t)=>{if(Ae(e))return(0,$.jsx)(Ne,{index:t,item:e,showPlayButton:i.showPlayButton,shouldSetBackgroundColor:0===t},`${t}-${e.uri}`);const s=function(e){const t=((0,v.EC)(e)||{}).type;switch(t){case v.JM.ARTIST:return je;case v.JM.ALBUM:case v.JM.COLLECTION_ALBUM:return fe;case v.JM.PLAYLIST:case v.JM.PLAYLIST_V2:return xe;case v.JM.SHOW:return ye;case v.JM.EPISODE:return ve;case v.JM.COLLECTION:return xe;default:return console.warn(`Unable to resolve entity shortcut from ${e} of type "${t||"unknown"}"`),ye}}(e.uri);return(0,$.jsx)(s,{index:t,item:e,showPlayButton:i.showPlayButton,shouldSetBackgroundColor:0===t},`${t}-${e.uri}`)}))})]})})),Re=e=>(0,$.jsx)(d.L,{onError:e=>{(0,h.vK)(e,"HomeShortcutsGrid")},children:(0,$.jsx)(He,{...e})});var We=s(28291),Je=s(52052);const qe="zUf7jtv9GPOKC1jYO5TO",ze="T8QLel3PoQTgJUpGYj7Q",$e=(0,n.memo)((({isLoading:e})=>{const t=(0,We.h)("shimmer");return(0,$.jsx)("div",{className:F,children:(0,$.jsx)("div",{ref:t,className:r()(B,{[ze]:e})})})})),Ye=(0,n.memo)((({isLoading:e})=>(0,$.jsx)("div",{className:r()(w,qe),"data-testid":"skeleton-shortcut",children:(0,$.jsxs)("div",{className:M,children:[(0,$.jsx)($e,{isLoading:e}),(0,$.jsx)("div",{className:O,children:(0,$.jsx)(Je.C,{as:"p",variant:"balladBold",className:H,isLoading:e})})]})}))),Ge="v7dc5ekmeBiAYnLzV8oT",Ke=(0,n.memo)((({shortcutCount:e})=>{const[t,s]=De();return(0,$.jsxs)("section",{className:I,ref:s,children:[(0,$.jsx)(Je.C,{as:"h2",variant:"alto",className:Ge,charCount:25,isLoading:!0}),(0,$.jsx)("div",{className:P,style:t.cssProperties,children:[...new Array(e).keys()].slice(0,6).map(((e,t)=>(0,$.jsx)(Ye,{isLoading:!0},t)))})]})}));var Xe=s(23627),Ze=s(28133),Ve=s(92348),Qe=s(33482),et=s(6444),tt=s(46617),st=s(11268),nt=s(98389),at=s(1634),rt=s(61815),ot=s(29251),it=s(82400),ct=s(69527),lt=s(41836),ut=s(36087);const dt=({spec:e,section:t,index:s})=>{const a=(0,i.W6)(lt.ty,{loadingValue:!1})?it.N:ct.q;return(0,n.useMemo)((()=>t.sectionItems.items.some((e=>(0,ut.d)(e.content)))),[t.sectionItems])?(0,$.jsx)(se.Nh,{spec:e.shelvesFactory(),children:(0,$.jsx)(a,{total:t.sectionItems.totalCount,seeAllUri:t.uri,pageId:t.uri,title:t.data.title?.text??"",index:s,id:t.uri,children:t.sectionItems.items.map(ut.x).filter((e=>!!e))})}):null};var mt=s(49666);const ht=({spec:e,section:t,index:s})=>(0,$.jsx)(se.Nh,{spec:e.shelvesFactory(),children:(0,$.jsx)(mt.default,{title:t.data.title?.text??void 0,showAll:!1,index:s})});var gt=s(77282);const pt=({spec:e,greeting:t,section:s})=>(0,$.jsx)(se.Nh,{spec:e.shortcutsFactory(),children:(0,$.jsx)(Re,{items:s.sectionItems.items.map(gt.lh),title:t??void 0})});var xt=s(85013);const ft=(0,n.lazy)((async()=>{const{FeatureActivationShelf:e}=await Promise.all([s.e(1814),s.e(8228)]).then(s.bind(s,28127));return{default:e}})),jt=({spec:e,greeting:t,section:s,index:a})=>{const r=(0,C._n)();switch(s.data?.__typename){case"HomeGenericSectionData":return(0,$.jsx)(dt,{spec:e,section:(0,xt.f)(s,s.data),index:a});case"HomeFeatureActivationSectionData":return(0,rt.wW)()?(0,$.jsx)(n.Suspense,{fallback:null,children:(0,$.jsx)(ft,{})}):null;case"HomeShortsSectionData":return(0,$.jsx)(pt,{spec:e,greeting:t,section:(0,xt.f)(s,s.data)});case"HomeRecentlyPlayedSectionData":return(0,$.jsx)(ht,{spec:e,section:(0,xt.f)(s,s.data),index:a});case"HomeFeedBaselineSectionData":case"HomeNativeAdsSectionData":case"HomeOnboardingSectionData":case"HomeOnboardingSectionDataV2":return null;case"HomeYourDJSectionData":{if(!r)return null;const t=(0,xt.f)(s,s.data),{data:n,sectionItems:a}=t,o=a.items[0];if("PlaylistResponseWrapper"===o.content.__typename&&"Playlist"===o.content.data.__typename){const{data:t}=o.content;return(0,$.jsx)(C.KE,{spec:e,shelfTitle:n.title?.text??"",title:t.name,description:t.description??""})}return null}case null:case void 0:return null;default:return(0,ot._)(s.data),null}},yt=({spec:e,greeting:t,container:s})=>{const{spec:a,logger:r}=(0,se.fU)(nt.createDesktopHomeFeatureActivationShelfEventFactory,{});return(0,n.useEffect)((()=>{(0,at.wW)()&&r.logImpression(a.impressionElementFactory().impression())}),[a,r]),(0,$.jsx)($.Fragment,{children:s.sections.items.map(((s,n)=>(0,$.jsx)(jt,{spec:e,greeting:t,section:s,index:n},`${n}-${s.uri}`)))})};var vt=s(9654),Ct=s(5945);const St=(0,n.memo)((({cardCount:e})=>(0,$.jsx)(Ct.X,{isLoading:!0,children:[...new Array(e).keys()].map(((e,t)=>(0,$.jsx)(vt.A,{isLoading:!0},t)))})));var kt=s(27659),bt=s(91577);const Nt=()=>(0,i.W6)(lt.Jw)===lt.pF.ONHOME?(0,$.jsx)(bt.w,{children:(0,$.jsx)(kt.M,{onSearch:!1})}):null;var Et=s(4776);const _t=6,Tt=6,It=6,Pt=(0,n.memo)((({shortcutCount:e,shelfCount:t,cardCount:s})=>(0,$.jsx)("section",{"data-testid":"home-page",children:(0,$.jsx)("div",{className:Et.Z.home,children:(0,$.jsxs)("div",{className:r()(Et.Z.content,"contentSpacing"),children:[(0,$.jsx)(Ke,{shortcutCount:e}),[...new Array(t).keys()].map(((e,t)=>(0,$.jsx)(St,{cardCount:s},t)))]})})}))),Lt=({spec:e})=>{(0,Ze.z)("home");const{data:t,error:s,loading:n}=(0,tt.b3)({timeZone:(0,st.L7)()},{cacheTime:st.us,staleTime:st.fS});if(n)return(0,$.jsx)(Pt,{shortcutCount:_t,shelfCount:Tt,cardCount:It});if(null!==s)return(0,$.jsx)(Xe.h,{hasError:!0,errorMessage:l.ag.get("error.generic")});const a=t?.home;return"HomeResponsePayload"!==a?.__typename||0===a.sectionContainer.sections.totalCount||0===a.sectionContainer.sections.items.length?(0,$.jsx)(Xe.h,{hasError:!0,errorMessage:l.ag.get("error.generic")}):(0,$.jsx)("section",{"data-testid":"home-page",children:(0,$.jsx)("div",{className:Et.Z.home,children:(0,$.jsx)("div",{className:r()(Et.Z.content,"contentSpacing"),children:(0,$.jsx)(yt,{spec:e,greeting:a.greeting?.text??null,container:a.sectionContainer})})})})},wt=()=>{const{spec:e}=(0,se.fU)(c.createDesktopHomeEventFactory,{data:{identifier:"home",uri:"spotify:home"}}),t=(0,i.W6)(lt.yg),s=(0,o.v9)(Z.br),a=(0,o.v9)(Z.yE),r=(0,Qe.S)(t),d=(0,ne.S9)({urlLocale:l.ag.getUrlLocale(),entity:"",localeFeatureFlag:s,entityFeatureFlag:a,type:"link"});return(0,$.jsx)(se.Nh,{spec:e,children:(0,$.jsxs)(Ve.q,{config:r,children:[(0,$.jsx)(u.$,{children:(0,et.nW)({i18n:l.ag,shouldLocalize:d})}),(0,$.jsx)(n.Suspense,{fallback:null,children:(0,$.jsx)(Nt,{})}),(0,$.jsx)(Lt,{spec:e})]})})}},39084:(e,t,s)=>{s.d(t,{Pd:()=>o,Wm:()=>r,i9:()=>a});var n=s(3802);const a=["artists","albums","episodes","genres","playlists","podcasts","audiobooks","tracks","users","topResults","podcastAndEpisodes"],r={artists:()=>n.ag.get("search.title.artists"),albums:()=>n.ag.get("search.title.albums"),playlists:()=>n.ag.get("search.title.playlists"),podcasts:()=>n.ag.get("search.title.shows"),episodes:()=>n.ag.get("search.title.episodes"),audiobooks:()=>n.ag.get("search.title.audiobooks"),users:()=>n.ag.get("search.title.profiles"),genres:()=>n.ag.get("search.title.genres-and-moods"),tracks:()=>n.ag.get("search.title.tracks"),podcastAndEpisodes:()=>n.ag.get("search.title.podcast-and-shows"),topResults:()=>n.ag.get("search.row.top-results")},o=["artists","albums","playlists","podcasts","episodes","audiobooks","users","genres"]},27659:(e,t,s)=>{s.d(t,{M:()=>L});var n=s(59496),a=s(84875),r=s.n(a),o=s(61740),i=s(89605),c=s(85830),l=s(94041),u=s(56162),d=s(48710),m=s(83680),h=s(36844),g=s(7681),p=s(50346),x=s(3802),f=s(46997),j=s(21524),y=s(96170),v=s(2831),C=s(41836),S=s(46179);const k="main-topBar-searchBar",b="x-searchInput-searchInputSearchIcon",N="x-searchInput-searchInputInput",E="x-searchInput-searchInputOnSearch",_="x-searchInput-searchInputClearButton",T="x-searchInput-searchInputIconContainer",I="x-searchInput=searchInputClearIcon";var P=s(4637);const L=n.memo((function({isSearchChipsEnabled:e=!1,onSearch:t=!0,onClick:s}){const a=(0,i.TH)(),L=(0,i.s0)(),w=(0,n.useRef)(null),M=(0,n.useRef)(null),F=(0,o.I0)(),[{category:B,query:U},O]=(0,S.l)(),[D,A]=(0,n.useState)(U),H=!!B,{scrollNodeRef:R}=n.useContext(j.VX),W=a.pathname.startsWith("/recent-searches"),J=H||W,{spec:q,logger:z}=(0,y.fU)(g.createDesktopSearchInputEventFactory,{}),$=(0,h.W6)(C.yA),Y=(0,c.y1)(((t,s,n)=>{let a;if(n){const{interactionId:e}=z.logInteraction(n);a=e}e?O(t,B,!1,a):O(t,null,s,a),R.current&&(R.current.scrollTop=0)}),200),G=(0,n.useCallback)(((e=!1)=>{w.current!==document.activeElement&&(M.current=document.activeElement,w.current&&w.current.focus()),e&&w.current?.select()}),[]);(0,f.eY)(f.O4.SHOW_SEARCH,(()=>G(!0)));const K=a.pathname.startsWith("/search");(0,n.useEffect)((()=>{!J&&t&&K&&(e&&U||G())}),[U,G,a.key,t,K,J,e]),(0,n.useEffect)((()=>{A(K?U:"")}),[K,U]);return(0,P.jsxs)("div",{className:r()(k,{[E]:!t}),children:[(0,P.jsx)("form",{onSubmit:e=>{e.preventDefault(),D&&z.logInteraction(q.keyStrokeSearch());const t=(0,p.EC)(D);if(t?.type===p.JM.AD){const e=(0,p.HB)(t.id);if(t.id===e)return;F((0,v.HI)(t.id))}else t?L(t.toURLPath(!0),{state:{preventMoveFocus:!0}}):D||L("/search",{state:{preventMoveFocus:!0}});D&&R.current?.querySelector("h1, h2, h3, h4")?.focus()},role:"search",children:(0,P.jsx)(u.D,{variant:"mesto",as:"input",style:{color:l.Snx},ref:w,className:r()(N),value:D,maxLength:800,autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,onChange:e=>{const t=e.currentTarget.value,s=q.keyStrokeChangeSearchQuery({searchQueryString:t});A(t),Y(t,J,s)},onKeyDown:e=>{if("Escape"===e.key)if(D){const e=q.hitTextClear();A(""),Y("",J,e)}else w.current&&w.current.blur(),M.current instanceof HTMLElement&&M.current.focus()},placeholder:t?x.ag.get("search.search-for-label"):x.ag.get("navbar.search"),onFocus:()=>{e||!J&&t||Y(D,J,null)},"data-testid":"search-input",onClick:s})}),(0,P.jsxs)("div",{className:T,children:[(0,P.jsx)("span",{className:b,children:(0,P.jsx)(d.j,{className:I,"aria-hidden":!0,iconSize:$?16:24})}),D&&(0,P.jsx)("button",{className:_,onClick:()=>{w.current&&w.current.focus();const e=q.hitTextClear();A(""),Y("",J,e)},"aria-label":x.ag.get("search.a11y.clear-input"),children:(0,P.jsx)(m.k,{className:I,iconSize:$?16:24})})]})]})}))},46179:(e,t,s)=>{s.d(t,{l:()=>i});var n=s(59496),a=s(89605),r=s(39084);const o=e=>r.i9.find((t=>t===e));function i(){const e=(0,a.s0)(),t=(0,a.bS)("/search/:query"),s=(0,a.bS)("/search/:query/:category"),r=(0,n.useCallback)((function(t,s,n,a){const r=a?{interactionId:a,preventMoveFocus:!0}:{preventMoveFocus:!0},o=["/search"];t&&(o.push(encodeURIComponent(t)),s&&o.push(s));const i=o.join("/");e(i,n?{state:r}:{state:r,replace:!0})}),[e]);return[{query:function(e){try{return decodeURIComponent(e)}catch{return e}}(t?.params.query??s?.params?.query??""),category:o(s?.params.category)},r]}}}]); //# sourceMappingURL=home-v2.js.map