!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]="1334ef5b-847e-464d-9f20-bd51f38e0c66",e._sentryDebugIdIdentifier="sentry-dbid-1334ef5b-847e-464d-9f20-bd51f38e0c66")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8213],{31967:function(e,t,i){"use strict";i.r(t),i.d(t,{__N_SSP:function(){return q},default:function(){return J}});var n=i(2784),r=i(82091),o=i(62203),s=i(97224),a=i(88627),l=i(3597),d=i(7307);const c=d.default.div.withConfig({componentId:"sc-jehdzo-0"})(["align-items:center;display:grid;grid-template-columns:"," auto;grid-template-rows:1fr auto auto;row-gap:",";column-gap:",";margin-bottom:",";padding-bottom:",";border-bottom:1px solid ",";","{grid-template-columns:"," 6fr 1fr 2fr auto;grid-template-rows:auto;}"],(e=>{let{theme:t}=e;return t.image.mobile.xxsmall.width}),(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.color.lightGray3}),(e=>{let{theme:t}=e;return t.mediaQuery.tablet}),(e=>e.theme.image.desktop.xxsmall.width)),u=(0,d.default)(l.S).attrs({type:"icon"}).withConfig({componentId:"sc-jehdzo-1"})(["grid-column:2 / 3;justify-self:flex-end;width:auto;","{grid-column:auto;order:3;}"],(e=>{let{theme:t}=e;return t.mediaQuery.tablet})),h=(0,d.default)(l.S).attrs({size:"h3"}).withConfig({componentId:"sc-jehdzo-2"})(["grid-column:1 / 3;","{grid-column:auto;order:2;}"],(e=>{let{theme:t}=e;return t.mediaQuery.tablet}));var m=i(52322);var g=()=>{const e=new Array(3).fill(null);return(0,m.jsxs)(a.He,{small:!0,children:[e.map(((e,t)=>(0,m.jsxs)(c,{children:[(0,m.jsx)(l.S,{type:"image"}),(0,m.jsx)(l.S,{size:"caption",width:"75%"}),(0,m.jsx)(l.S,{size:"caption"}),(0,m.jsx)(u,{}),(0,m.jsx)(h,{})]},`loading-wishlist-items-${t}`))),(0,m.jsx)(_,{})]})},p=i(47725),f=i(1505),y=i(73387),x=i(4431),j=i(13154);const w=d.default.div.withConfig({componentId:"sc-ayuuc7-0"})(["align-items:center;display:flex;flex-direction:row;gap:",";"],(e=>e.theme.spacing[16])),b=d.default.ul.withConfig({componentId:"sc-ayuuc7-1"})(["list-style:none;margin:0;padding:0;"]),v=d.default.div.withConfig({componentId:"sc-ayuuc7-2"})(["display:flex;justify-content:center;margin:"," 0;"],(e=>{let{theme:t}=e;return t.spacing[32]})),k=d.default.div.withConfig({componentId:"sc-ayuuc7-3"})(["display:flex;justify-content:center;margin-top:0;margin-bottom:1rem;button{width:100%;}","{button{width:auto;}justify-content:flex-end;}","{margin-top:-4rem;}"],(e=>{let{theme:t}=e;return t.mediaQuery.tablet}),(e=>{let{theme:t}=e;return t.mediaQuery.desktopLarge}));var I=e=>{let{loading:t,loadMore:i,hasMore:o,removeEntry:s,entries:l}=e;const{text:d}=(0,r.useLocalizer)(),c=(0,r.useMaintenance)(),u=t||o,h=(0,n.useMemo)((()=>l.map((e=>(0,m.jsx)(a._j,{removeEntry:s,entry:e,buttonDisabled:c?.eshop?.active,showWishlistHeart:!0},`${e.category}:${e.id}`)))),[l,s,c?.eshop?.active]);return l.length>0?(0,m.jsxs)(a.He,{small:!0,children:[(0,m.jsx)(k,{children:(0,m.jsx)(Q,{entries:l})}),(0,m.jsx)(b,{children:h}),u&&(0,m.jsx)(v,{children:(0,m.jsx)(p.B,{icon:f.Z,isLoading:t,disabled:t,variant:"tertiary",onClick:i,children:d("Load more")})}),(0,m.jsx)(y.S,{size:80})]}):t?(0,m.jsx)(g,{}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(a.$0,{as:"div",background:e=>e.theme.color.lightGray3,constrained:!0,children:(0,m.jsxs)(w,{children:[(0,m.jsx)(x.Z,{size:64}),(0,m.jsx)(j.H,{variant:"h1",as:"h2",children:d("Nothing's been added to your Wish List yet.")})]})}),(0,m.jsx)(a.$0,{as:"div",constrained:!0,children:(0,m.jsx)(_,{})})]})},C=i(91858),L=i(47361);const S=d.default.div.withConfig({componentId:"sc-s394gk-0"})(["display:flex;flex-direction:column;padding:",";border:1px solid ",";border-radius:",";","{align-items:center;flex-direction:row;}"],(e=>e.theme.spacing[32]),(e=>e.theme.color.primary),(e=>e.theme.spacing[8]),(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),O=d.default.div.withConfig({componentId:"sc-s394gk-1"})(["justify-content:center;display:flex;flex-direction:row;gap:",";flex:0 0 auto;margin-top:",";padding:"," 0 0;border-top:1px solid ",";","{align-items:center;margin-top:0;margin-left:",";padding-right:0;padding-bottom:",";padding-left:",";border-top:0;border-left:1px solid ",";}"],(e=>e.theme.spacing[16]),(e=>e.theme.spacing[16]),(e=>e.theme.spacing[16]),(e=>e.theme.color.lightGray2),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>e.theme.spacing[16]),(e=>e.theme.spacing[16]),(e=>e.theme.spacing[16]),(e=>e.theme.color.lightGray2)),E=(0,d.default)(L.W).withConfig({componentId:"sc-s394gk-2"})(["display:inline-block;",";"],(e=>e.small&&(0,d.css)(["font-size:0.6em;"])));var _=()=>{const{0:e,1:t}=(0,n.useState)(!1),{text:i}=(0,r.useLocalizer)(),o=()=>t(!e);return(0,m.jsxs)(S,{children:[(0,m.jsxs)(C.T,{variant:"body",children:[i("You can save games and other products you like by clicking the")," ",(0,m.jsx)(E,{small:!0,iconOnly:!0,isAdded:e,lang:"en",onClick:o}),"."," ",i("It\u2019s a handy way to keep track of items you\u2019re interested in. We\u2019ll even let you know when one of your Wish List items goes on sale.")]}),(0,m.jsxs)(O,{children:[(0,m.jsx)(C.T,{variant:"title",children:i("Give it a try:")}),(0,m.jsx)(E,{iconOnly:!0,isAdded:e,lang:"en",onClick:o})]})]})},M=i(64897),W=i(30464),P=i(88639),$=i(2002),D=i(99140),z=i(83533),T=i(41999);const N=d.default.h3.withConfig({componentId:"sc-14hwjov-0"})(["background:",";color:",";padding:",";text-align:center;width:100%;margin:0;"],(e=>{let{theme:t}=e;return t.color.primary}),(e=>{let{theme:t}=e;return t.color.white}),(e=>{let{theme:t}=e;return t.spacing[16]})),Z=d.default.div.withConfig({componentId:"sc-14hwjov-1"})(["display:grid;justify-content:center;justify-items:center;align-items:center;grid-gap:1rem;padding:1rem;grid-template-columns:1fr;max-width:500px;p{margin:0;}"]),A=d.default.p.withConfig({componentId:"sc-14hwjov-2"})(["text-align:center;"]),H=(0,d.default)(T.I).withConfig({componentId:"sc-14hwjov-3"})(["input,label{font-weight:300;}"]);var Q=e=>{let{entries:t}=e;const i=(0,z.Z)(z.o.TABLET),{text:o}=(0,r.useLocalizer)(),{locale:s}=(0,M.Z)(),a=t?.slice(0,100).map((e=>e.product?.sku||e.id)).join(","),l=new Date,{0:d,1:c}=(0,n.useState)(!1),{0:u,1:h}=(0,n.useState)(!1),{0:g,1:f}=(0,n.useState)("Copy link"),y=(0,$.mt)(s),x=`${`${D.$e.replace(/\/$/,"")}/${y}`}/wish-list/share/#skus=${a}&date=${Date.parse(l)}`,j=()=>{h(!1),c((e=>!e))};return(0,n.useEffect)((()=>{navigator.share&&!i?f(o("Share")):f(o(u?"Copied!":"Copy"))}),[u,o,i]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(p.B,{icon:W.Z,onClick:j,variant:"tertiary",children:o("Share Wish List")}),(0,m.jsxs)(P.M,{dialogLabel:o("Share Wish List"),visible:d,onClose:j,children:[(0,m.jsx)(N,{children:o("Share Wish List")}),(0,m.jsxs)(Z,{children:[(0,m.jsx)(W.Z,{size:48}),(0,m.jsx)(A,{children:o("Share a snapshot of your current Wish List with friends and family!")}),(0,m.jsx)(H,{buttonText:g,label:o("Share link"),placeholder:"https://nintendo.com/wish-list/[id's]",value:x,onClick:()=>{navigator.share&&!i?navigator.share({title:o("Check out a snapshot of my Wish List at the My Nintendo Store!"),text:o("Check out a snapshot of my Wish List at the My Nintendo Store!"),url:x}).catch((e=>{console.error("Unable to share",e)})):(h(!0),navigator.clipboard.writeText(x))},disabled:u,readOnly:!0})]})]})]})},R=i(95235);function G(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function B(e){for(var t=1;t{let{type:i,payload:n}=t;if(i===F){if(e.isLoadingMore||e.isRemovingItem){const t=new Set(e.entries.map((e=>{let{category:t,id:i}=e;return`${t}:${i}`}))),i=n.filter((e=>{let{category:i,id:n,product:r}=e;return!t.has(`${i}:${n}`)&&r}));return B(B({},e),{},{entries:[...e.entries,...i],isLoadingMore:!1,isRemovingItem:!1})}return B(B({},e),{},{entries:[...n]})}return i===U?B(B({},e),{},{isLoadingMore:!0}):i===X?B(B({},e),{},{isRemovingItem:!0}):void 0},q=!0;function J(){const{text:e}=(0,r.useLocalizer)(),t=(0,r.useWishlist)({type:r.WishlistType.PAGED_LIST,includeProductInfo:!0}),{0:i,1:l}=(0,n.useReducer)(V,Y),d=(0,n.useMemo)((()=>(t.entries||[]).filter((e=>{let{product:t}=e;return t}))),[t.entries]),c=i.entries?.length>0?i.entries:d,u=(0,n.useCallback)((e=>{l({type:X}),t.removeEntry(e)}),[t]),h=(0,n.useCallback)((()=>{l({type:U}),t.loadMoreEntries()}),[t]);(0,n.useEffect)((()=>{l({type:F,payload:d})}),[d]);const p=c.length>0,f=(0,m.jsx)(a.h5,{title:e("Wish List"),description:e("Explore, purchase, or remove items from your Wish List here. You can also share your current list with friends and family."),small:!0,shortDesc:!0,children:(0,m.jsxs)(o.B,{currentPage:"/address-book/",children:[(0,m.jsx)(s.Z,{href:"/",children:(0,m.jsx)("a",{children:e("Home")})}),(0,m.jsx)(s.Z,{href:"/wish-list/",children:(0,m.jsx)("a",{children:e("Wish List")})})]})});return t.loading&&!p?(0,m.jsxs)(a.He,{children:[f,(0,m.jsx)(g,{})]}):(0,m.jsx)(a.Td,{errorMessage:e("Please log in to your Nintendo Account to view your Wish List."),header:f,children:(0,m.jsx)(I,{loading:t.loading,loadMore:h,hasMore:t.hasMoreEntries,entries:c,removeEntry:u})})}},88103:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/wish-list",function(){return i(31967)}])}},function(e){e.O(0,[9774,2888,179],(function(){return t=88103,e(e.s=t);var t}));var t=e.O();_N_E=t}]); //# sourceMappingURL=wish-list-0fe46c2e7955a4f3.js.map