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