!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="694e007c-7a46-4fbf-8625-b6dcc3b16cc8",e._sentryDebugIdIdentifier="sentry-dbid-694e007c-7a46-4fbf-8625-b6dcc3b16cc8")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9186],{79418:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return h}});var a=r(94922),s=r(46420),l=r(2002),n=r(64897),i=r(36734),o=r(15188),c=r(84553),u=(r(98670),r(82090)),d=r(52322);var h=!0;t.default=function(e){let{page:t,preview:r,renderFullBleedPageHero:h}=e;const p=(0,n.Z)(),f=t.content.pageHeader.heading,g=t.content?.productsCategoryUid,m=[{href:"/",title:"Home"},{href:"/store",title:"My Nintendo Store"},{href:"/store/merchandise",title:"Merchandise"},{href:"/store/merchandise/[slug]",title:f}],b=a.e.MERCHANDISE,y=(0,u.XD)({category:b,productsCategoryUid:g,merchandisedGrid:t?.content?.merchandisedGrid,router:p});return g?(0,d.jsx)(s.X$,{router:p,categoryConfig:y,defaultCategory:b,searchParamWhitelist:i.uy,preserveQueryParamKeys:i.aq,children:(0,d.jsx)(o.Z,{preview:r,breadcrumbLinks:m,page:t.content,pageIcon:"t-shirt",cachePrefix:`${(0,l.GL)(f)}`,filterSections:a.I,analytics:{eventPrefix:`Merchandise:${f}`,pageName:`Merchandise PLP - ${f}`},fullBleedHero:h})}):(0,d.jsx)(c.Z,{preview:r,breadcrumbLinks:m,page:t.content,filterSections:a.I,analytics:{pageName:`Merchandise PLP - ${f}`}})}},84553:function(e,t,r){"use strict";var a=r(82269),s=r(95235),l=r(2784),n=r(5632),i=r.n(n),o=r(82091),c=r(97224),u=r(94922),d=r(46420),h=r(51505),p=r(82732),f=r(37364),g=r(98803),m=r(1505),b=r(26856),y=r(88053),j=r(31837),v=r(9873),x=r(90862),P=r(2002),w=r(95395),k=r(83533),S=r(62156),M=r(88627),O=(r(64629),r(36734)),F=r(99140),C=r(23089),H=r(26378),N=r(402),_=r(49481),L=r(73353),D=r(33831),B=r(52322);const E=["title","attribute"];function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function z(e){for(var t=1;t{let{preview:t,breadcrumbLinks:r,filterSections:s,lightScrim:O,page:I,pageIcon:Z,sortByOptions:$,showRating:A,analytics:R,enableStickyCollectionNav:q,fullBleedHero:G,cmsProductPageSize:V,hiddenFilters:U,disableDefaultMarketingPageHeading:X}=e;const{pageHeader:K,ctaCollection:Q,merchandisedGrid:Y,legalText:J,marketingPage:W}=I||{},ee=W?_[W?.templateName??"plmpStandard"]:null,te=X?l.Fragment:f.H.NewLevel,re=(0,w.O_)(),{text:ae}=(0,o.useLocalizer)(),{trackLoadMoreProducts:se}=(0,u.u)(),le=(0,n.useRouter)(),{asPath:ne,pathname:ie,query:oe}=le,ce=(0,w.D9)(oe?.slug),ue=(0,o.useFeature)("wdev-1631-horizontal-tiles"),de=ue?.variant?.payload?.value,he=(0,k.Z)(k.o.TABLET_SMALL),pe="horizontal"===de&&!he,fe=(0,o.deserializeHash)(ne),ge=(0,l.useRef)(),{0:me,1:be}=(0,l.useState)((()=>$.find((e=>{let{param:t}=e;return t===fe.sort}))?.value||$[0].value)),{0:ye,1:je}=(0,l.useState)((()=>parseInt(fe.p)||0)),{isFilterModalOpen:ve,selectedSortByOption:xe,toggleModalFiltersMenu:Pe,handleSortByChange:we}=(0,d.sI)({sortBy:me,sortByOptions:$,analytics:R,applySortBy:e=>{be((()=>e))}}),ke=(0,l.useMemo)((()=>$.map((e=>{let{value:t,label:r}=e;return{value:t,label:ae(r)}}))),[$,ae]),Se=(0,l.useMemo)((()=>({value:xe.value,label:ae(xe.label)})),[xe,ae]),Me=(0,l.useMemo)((()=>s.map((e=>{let{attribute:t}=e;return t}))),[s]),Oe=(Y||[]).flat(),Fe=(Y||[]).flat().filter((e=>{let{sku:t}=e;return Boolean(t)})),{appliedFilters:Ce,appliedFiltersQuery:He,filteredProducts:Ne,filteredState:_e,refine:Le,refineByQuery:De,clearFilters:Be}=(0,w.x3)(Fe,Me,{operator:w.fP.AND,queryToInitializeFilters:fe,hidden:U}),Ee=0===Ce?.length&&xe.value===$[0].value,Ie=(0,k.Z)(k.o.DESKTOP),ze=(0,l.useRef)();ze.current=Ie;const Te=Ee?Oe:Ne,Ze=(0,l.useMemo)((()=>Te.slice(0,(V||Te.length)*(ye+1))),[ye,Te,V]),$e=Ze.lengthme?[...Ze].sort(me):Ze),[Ze,me]),Re=(0,l.useCallback)((()=>{const e=(0,o.deserializeHash)(ne),t=$.find((t=>{let{param:r}=t;return r===e.sort}))?.value||$[0].value;De(e),be((()=>t)),je(parseInt(e.p)||0)}),[$,ne,De]),qe=(0,l.useCallback)((e=>{const t=$.find((e=>{let{value:t}=e;return t===me}))?.param||$[0].value;return`#${new URLSearchParams(z(z({},e),{},{sort:t,p:ye})).toString()}`}),[$,me,ye]),Ge=(0,l.useCallback)((e=>(je((()=>0)),e)),[]),Ve=(0,l.useCallback)((function(){Ge(Le)(...arguments)}),[Le,Ge]),Ue=(0,l.useCallback)((function(){Ge(Be)(...arguments)}),[Be,Ge]),Xe=(0,l.useCallback)((function(){Ge(we)(...arguments)}),[we,Ge]),Ke=(0,l.useCallback)((()=>{const{pageName:e}=R;se(e);const t=(0,o.deserializeHash)(),r=ye+1;t.p=r,je((()=>r))}),[ye,R,se]),Qe=(0,l.useMemo)((()=>qe(He)),[He,qe]),Ye=(0,l.useMemo)((()=>Ce.map((e=>({attribute:e.split(w.HA)[0],label:e.split(w.HA)[1],value:e})))),[Ce]),Je=(0,l.useMemo)((()=>R?.featureFlag?{featureFlag:R.featureFlag}:{featureFlag:ue?.id,featureFlagVariant:de}),[R,ue,de]),We=(0,l.useMemo)((()=>s.filter((e=>{let{attribute:t}=e;return _e[t]?.items?.length>0})).map(((e,t)=>{let{title:r,attribute:s}=e,l=(0,a.Z)(e,E);return(0,B.jsx)(M.vT,z({attribute:s,title:r&&ae(r),startCollapsed:0!==t,refine:Ve,items:_e[s]?.items||[],showMoreLabel:ae("Show more"),showLessLabel:ae("Show less"),collapsible:!0,limit:5,showMore:!0,analytics:{pageName:R?.pageName}},l),s)}))),[s,_e,Ve,ae,R]),et=(0,l.useMemo)((()=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(M.en,{$singleColumnMobile:pe,children:Ae.map(((e,t)=>e.sku?(0,l.createElement)(x.I8,z(z(z({},Je),{},{key:e.sku+t},e),{},{constrain:!1,showRating:A||Boolean(le.query[F.Tx.UTM_CODE])||!1,mobileHorizontal:pe,analytics:{listDetails:{id:`clp-${(0,P.GL)(R.pageName)}`,name:R.pageName}}})):(0,B.jsx)(H.Z,{asset:e.asset.primary.assetPath,cta:e.cta,heading:e.heading},e.heading+t)))}),$e&&(0,B.jsx)(D.VR,{children:(0,B.jsx)(g.B,{variant:"tertiary",icon:m.Z,onClick:Ke,children:ae("Load more")})})]})),[le.query,R,Je,A,$e,Ae,pe,Ke,ae]);(0,S.Z)({isDesktop:Ie,scrollToRef:ge,scrollToElementID:T,enableStickyCollectionNav:q,pillFarm:Q.list}),(0,l.useEffect)((()=>{i().push({pathname:i().pathname,query:i().query,hash:Qe},null,{shallow:!0}).catch((e=>{if(!e.cancelled)throw e}))}),[Qe]),(0,P.nw)((()=>{Re()})),(0,l.useEffect)((()=>{!0===ze.current&&ge.current&&(0,P.n5)(ge.current,{offsetY:q&&L.d})}),[Ce.length,q]),(0,l.useEffect)((()=>{q&&ge.current&&oe?.slug!==ce&&(0,P.n5)(ge.current,{offsetY:L.d,behavior:"smooth",onlyScrollIfAbove:!0})}),[q,oe?.slug,ce]),(0,l.useEffect)((()=>{const e=oe?.slug;Boolean(ce)&&Boolean(e)&&e!==ce&&Re()}),[Re,ce,oe?.slug]);const tt=(0,l.useMemo)((()=>r?(0,B.jsx)(b.B,{currentPage:ie,children:r.map(((e,t)=>(0,B.jsx)(c.Z,{href:e.href,children:(0,B.jsx)("a",{children:ae(e.title)})},e.title+t)))}):null),[r,ae,ie]),rt=(0,l.useMemo)((()=>K?.asset?.primary?.assetPath?G?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(y.F,{heading:K.heading,subtitle:K.description,image:{desktop:{assetPath:K.asset?.primary?.assetPath},mobile:{assetPath:K.asset?.secondary?.assetPath}},pillFarm:Q.list,icon:Z}),(0,B.jsx)(M.Hr,{})]}):(0,B.jsx)(M.tm,{iconName:Z,content:{assetPath:K.asset?.primary?.assetPath,assetPathAlt:K.asset?.alt,background:K.background,cta:K.cta,description:K.description,heading:K.heading,modifiers:K.modifiers},lightScrim:O}):null),[K,G,Z,O,Q]);return(0,B.jsxs)(N.Kq,{preview:t,children:[W&&(0,B.jsx)(te,{children:(0,B.jsx)(ee,{marketingPage:W})}),r&&(0,B.jsx)(M.JL,{children:tt}),rt,(0,B.jsxs)(f.H.NewLevel,{children:[!G&&Q?.list.length>0&&(0,B.jsx)(M.$0,{constrained:!0,small:!0,divider:["bottom"],children:(0,B.jsx)(M.l6,{center:!0,items:Q.list})}),(0,B.jsx)("span",{ref:ge,id:"products","data-drawer-id":T}),(0,B.jsx)(j.S,{size:36,axis:"vertical"}),(0,B.jsxs)(M.He,{children:[(0,B.jsxs)(D.zB,{$breadcrumbs:!!r,children:[(0,B.jsx)(h.D,{children:tt}),(0,B.jsx)(p.S,{label:ae("Sort by"),onSelect:Xe,options:ke,dropdownValue:re?Se:null}),(0,B.jsx)(h.M,{children:(0,B.jsx)(M.Lb,{icon:v.Z,variant:"tertiary",onClick:Pe,children:ae("Filter")})})]}),(0,B.jsx)(j.S,{size:32,axis:"vertical"}),(0,B.jsx)(M.dA,{enableStickyFilterPanel:!0,isFilterModalOpen:ve,toggleModalFiltersMenu:Pe,attributeFilterSets:We,isDesktop:Ie,stickyOffset:q&&parseInt(C.TH)+16,customizeFilters:{clearFilters:Ue,removeFilter:Ve,activeFilters:Ye,totalHits:Ne.length},children:et}),J&&(0,B.jsx)(D.VH,{children:(0,B.jsx)(M.Ho,{data:J,textVariant:"legal"})})]}),(0,B.jsx)(M.y4,{})]})]})};Z.defaultProps={sortByOptions:O.Op},t.Z=Z},89554:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/store/merchandise/[slug]",function(){return r(79418)}])}},function(e){e.O(0,[8286,4511,402,5806,5188,9774,2888,179],(function(){return t=89554,e(e.s=t);var t}));var t=e.O();_N_E=t}]); //# sourceMappingURL=[slug]-4b75fb347e7c1ec0.js.map