"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5170],{86283:function(e,t,n){n.r(t);var r,o,i,a,s,c,u=n(8529),l=n(7328),d=n(2784),h=n(41857),p=n(28885),m=n(92210),f=n(57194),g=n(11006),x=n(48840),b=n(87330),v=n(81292),w=n(51339),y=n(76910),S=n(83232),C=n(52322),j=g.zo.div(r||(r=(0,l.Z)(["\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: ",";\n"])),function(e){return e.theme.colors.palette.greys.white}),k=g.zo.h1(o||(o=(0,l.Z)(["\n margin: "," auto "," auto;\n ","\n"])),(0,x.W0)(7),(0,x.W0)(1),(0,b.xv)("large2","default")),L=g.zo.div(i||(i=(0,l.Z)(["\n margin-bottom: ",";\n padding: ",";\n max-width: 560px;\n text-align: center;\n ","\n"])),(0,x.W0)(4),(0,x.W0)(2),(0,b.xv)("bodyText","default")),Z=(0,g.zo)(w.zx)(a||(a=(0,l.Z)(["\n max-width: 95%;\n width: 345px;\n margin-bottom: ",";\n\n "," {\n width: 425px;\n }\n"])),(0,x.W0)(10),function(e){return(0,v.mq)(e.theme.breakpointUtils.map,"lg")}),I=g.zo.div(s||(s=(0,l.Z)(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n margin-bottom: ",";\n"])),(0,x.W0)(7)),z=g.zo.div(c||(c=(0,l.Z)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n text-align: center;\n margin-bottom: ",";\n & p {\n ","\n }\n & img {\n padding: 7px;\n }\n "," {\n width: 50%;\n margin-bottom: 36px;\n }\n "," {\n width: 33%;\n }\n"])),(0,x.W0)(7),(0,b.xv)("bodyText","alternate"),function(e){return(0,v.mq)(e.theme.breakpointUtils.map,"xs")},function(e){return(0,v.mq)(e.theme.breakpointUtils.map,"sm")}),E=function(e){var t=e.statusCode,n=d.useState([]),r=(0,u.Z)(n,1)[0],o=(0,h.By)(),i=o.currency,a=o.shippingDestination,s={title:"",description:"",buttonDescription:(0,p.ag)("pageunavailable.enterprise.button.description")};return 404===t?(s.title=R((0,p.ag)("pageunavailable.pagenotfound.text")),s.description=(0,p.ag)("pageunavailable.pagenotfound.details.text")):(s.title=R((0,p.ag)("pageunavailable.servererror.text")),s.description=(0,p.ag)("pageunavailable.servererror.details.text")),(0,C.jsxs)(j,{children:[(0,C.jsx)(k,{children:s.title}),(0,C.jsx)(L,{children:s.description}),r.length>0&&(0,C.jsx)(T,{categories:r}),(0,C.jsx)(Z,{emphasis:"medium",renderedAs:"a",href:m.Z5.HomePage,children:s.buttonDescription}),404===t&&(0,C.jsx)(y.ComponentWidgetRenderer,{componentName:S.ComponentName.PAGE_UNAVAILABLE,currency:i,shippingDestination:a})]})},T=function(e){var t=e.categories;return(0,C.jsx)(I,{children:t.map(function(e,t){return(0,C.jsxs)(z,{children:[(0,C.jsx)("img",{src:e.src,alt:e.alt}),(0,C.jsxs)("p",{children:["Category ",t+1]})]},t)})})},R=function(e){return e.replace(/\./g,"")};E.Layout=f.K,E.getInitialProps=function(e){var t=e.res,n=e.err;return{statusCode:t?t.statusCode:n?n.statusCode:404}},t.default=E},90943:function(e,t,n){n.d(t,{Y:function(){return Y}});var r,o,i,a,s,c,u,l,d,h,p=n(20406),m=n(8529),f=n(82269),g=n(82841),x=n.n(g),b=n(2784),v=n(7328),w=n(51339),y=n(95732),S=n(15792),C=n(92526),j=n(87330),k=n(60299),L=n(81292),Z=n(48840),I=n(53678),z=n(52322),E=["closeDropdown"],T=S.zo.div(r||(r=(0,v.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n background-color: ",";\n\n ",";\n"])),function(e){return e.theme.patterns.storeSearch.backgroundColor},function(e){return(0,C.o)(e.theme.patterns.storeSearch.padding)}),R=S.zo.h1(o||(o=(0,v.Z)(["\n ",";\n\n width: 100%;\n max-width: 310px;\n text-align: center;\n color: ",";\n text-decoration: ",";\n\n ",";\n\n "," {\n max-width: 416px;\n text-align: ",";\n margin-right: auto;\n margin-left: ",";\n }\n"])),function(e){return(0,j.xv)(e.theme.patterns.storeSearch.title.font.entry,e.theme.patterns.storeSearch.title.font.style)},function(e){return e.theme.patterns.storeSearch.title.font.textColor},function(e){return e.theme.patterns.storeSearch.title.font.textDecoration},function(e){return(0,k.e)(e.theme.patterns.storeSearch.title.margin)},function(e){return(0,L.mq)(e.theme.breakpointUtils.map,"md")},function(e){return e.alignment},function(e){return e.alignment===I.K.CENTER?"auto":"0"}),W=S.zo.p(i||(i=(0,v.Z)(["\n ",";\n\n width: 100%;\n text-align: center;\n color: ",";\n text-transform: ",";\n text-decoration: ",";\n\n ",";\n\n "," {\n text-align: ",";\n }\n"])),function(e){return(0,j.xv)(e.theme.patterns.storeSearch.subtitle.font.entry,e.theme.patterns.storeSearch.subtitle.font.style)},function(e){return e.theme.patterns.storeSearch.subtitle.font.textColor},function(e){return e.theme.patterns.storeSearch.subtitle.font.transform},function(e){return e.theme.patterns.storeSearch.subtitle.font.textDecoration},function(e){return(0,k.e)(e.theme.patterns.storeSearch.subtitle.margin)},function(e){return(0,L.mq)(e.theme.breakpointUtils.map,"md")},function(e){return e.alignment}),N=S.zo.form(a||(a=(0,v.Z)(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n justify-content: center;\n"]))),D=S.zo.div(s||(s=(0,v.Z)(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n position: relative;\n width: 100%;\n "," {\n width: ",";\n }\n\n ",";\n\n > div {\n width: 100%;\n "," {\n width: ",";\n }\n }\n"])),function(e){return(0,L.mq)(e.theme.breakpointUtils.map,"sm")},function(e){return e.alignment===I.K.CENTER?e.theme.patterns.storeSearch.searchInput.width:"100%"},function(e){return(0,k.e)(e.theme.patterns.storeSearch.searchInput.margin)},function(e){return(0,L.mq)(e.theme.breakpointUtils.map,"sm")},function(e){return e.alignment===I.K.CENTER?e.theme.patterns.storeSearch.searchInput.width:"100%"}),P=(0,S.zo)(w.zx)(c||(c=(0,v.Z)(["\n height: 48px;\n width: 120px;\n"]))),O=(0,S.zo)(y.I)(u||(u=(0,v.Z)(["\n border-radius: ",";\n"])),function(e){return e.theme.patterns.storeSearch.searchInput.borderRadius}),U=S.zo.span(l||(l=(0,v.Z)(["\n width: 100%;\n margin-top: ",";\n ",";\n text-align: left;\n"])),(0,Z.W0)(2),(0,j.xv)("bodyText","default")),A=(0,S.zo)(w.zx)(d||(d=(0,v.Z)(["\n ",";\n text-decoration: underline;\n height: 48px;\n"])),(0,j.xv)("bodyText","alternate")),q=function(e){var t=e.closeDropdown,n=(0,f.Z)(e,E),r=b.useRef(null),o=b.useRef(null),i=b.useState(n.searchInputOverride||""),a=(0,m.Z)(i,2),s=a[0],c=a[1];b.useEffect(function(){c(n.searchInputOverride||"")},[n.searchInputOverride]);var u=b.useCallback(function(e){r.current&&r.current!==e.target&&o.current&&o.current!==e.target&&t()},[t]);b.useEffect(function(){return document.addEventListener("click",u),function(){document.removeEventListener("click",u)}},[u]);var l=function(){n.searchStoreHandler&&n.searchStoreHandler(s)},d="/stores/".concat(n.storeLocatorCountry);return(0,z.jsxs)(T,{children:[(0,z.jsx)(R,{alignment:n.alignment,children:n.i18nText.title}),(0,z.jsx)(W,{alignment:n.alignment,children:n.i18nText.subtitle}),(0,z.jsxs)(N,{onSubmit:function(e){e.preventDefault(),l()},children:[(0,z.jsxs)(D,{alignment:n.alignment,children:[(0,z.jsx)(O,{valueOverride:n.searchInputOverride||s||"",label:n.i18nText.inputLabel,required:!1,type:"text",onChange:function(e){c(e.target.value),n.onChange(e)},onFocus:n.onFocus,clearInputValueHandler:n.clearInputValueHandler,bindref:r}),(0,z.jsx)("div",{ref:o,children:n.autocompletePredictions})]}),(0,z.jsx)(P,{type:"submit",emphasis:"high",children:n.i18nText.buttonLabel})]}),n.showInfoLabel&&n.i18nText.infoLabel&&n.i18nText.infoLinkLabel&&(0,z.jsxs)(U,{children:[n.i18nText.infoLabel," ",(0,z.jsx)(A,{emphasis:"low",renderedAs:"a",href:d,children:n.i18nText.infoLinkLabel})]})]})},G=n(21190),H=n(25237),_=n.n(H),F=n(28885),K=_()(function(){return Promise.resolve().then(n.bind(n,18157))},{loadableGenerated:{webpack:function(){return[18157]}}}),V=Z.zo.li(h||(h=(0,v.Z)(["\n cursor: pointer;\n width: 100%;\n padding: "," 0 "," ",";\n margin: 0;\n background-color: ",";\n box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);\n\n &:first-child {\n border-top: "," solid\n ",";\n }\n\n &:last-child {\n border-bottom: "," solid\n ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n }\n\n &:focus-within {\n border-color: ",";\n }\n"])),(0,Z.W0)(2),(0,Z.W0)(2),(0,Z.W0)(3),function(e){return e.theme.colors.palette.greys.white},(0,Z.W0)(1),function(e){return e.theme.colors.palette.greys.lighter},(0,Z.W0)(1),function(e){return e.theme.colors.palette.greys.lighter},function(e){return e.theme.colors.palette.greys.lighter},function(e){return e.theme.colors.palette.brand.base}),B=function(e){var t=(0,F.ag)("storelocator.storesearch.usemylocation");return(0,z.jsxs)("ul",{"data-testid":"autocomplete-suggestions",style:{width:"100%",position:"absolute",zIndex:1},children:[e.showGeolocation&&(0,z.jsxs)(V,{onClick:e.getUserLocation,children:[(0,z.jsx)(K,{style:{marginRight:(0,Z.W0)(2.25),verticalAlign:"top"}}),t]}),e.predictions&&e.predictions.length>0?e.predictions.map(function(t,n){return(0,z.jsx)(V,{value:t.description,onClick:function(){e.setSearchInputOverride(t.description),e.setAutocompletePredictions([]),e.setShowGeolocation(!1)},children:t.description},n)}):null]})},M=["isSearchReady","getNearbyStores","setSelectedNearbyStore","setResultsFor"],Y=function(e){var t,n=e.isSearchReady,r=e.getNearbyStores,o=e.setSelectedNearbyStore,i=e.setResultsFor,a=(0,f.Z)(e,M),s=b.useState([]),c=(0,m.Z)(s,2),u=c[0],l=c[1],d=b.useState(!1),h=(0,m.Z)(d,2),g=h[0],v=h[1],w=b.useState(e.locationParam||""),y=(0,m.Z)(w,2),S=y[0],C=y[1],j=b.useState(void 0),k=(0,m.Z)(j,2),L=k[0],Z=k[1],I=b.useCallback(function(e){if(n&&(S&&S.trim()||e)){var t=e?{address:e,componentRestrictions:{country:a.storeLocatorCountry},region:a.storeLocatorCountry}:{address:S};new google.maps.Geocoder().geocode(t,function(e,t){if("OK"===t&&e&&e[0]&&e[0].geometry.location){var n=e[0].geometry.location;Z({latitude:n.lat(),longitude:n.lng()}),r&&r({variables:{latitude:n.lat(),longitude:n.lng(),limit:20}}),o&&o(0),i&&i(e[0].formatted_address)}})}},[S,n,r,o,i,a.storeLocatorCountry]);return b.useEffect(function(){I()},[a.locationParam,n,I]),(0,z.jsx)(b.Fragment,{children:(0,z.jsx)(q,{i18nText:a.i18nText,alignment:a.alignment,searchInputOverride:S,selectedStoreLocation:L,showInfoLabel:a.showInfoLabel,onChange:(t=(0,p.Z)(x().mark(function e(t){var r;return x().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null!==(r=t.target)&&void 0!==r&&r.value&&n)){e.next=5;break}return e.next=3,(0,G.T)(t.target.value,l,a.storeLocatorCountry);case 3:e.next=6;break;case 5:l([]);case 6:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),onFocus:function(){return v(!0)},clearInputValueHandler:function(){return l([])},closeDropdown:function(){v(!1),l([])},setSearchInputOverride:C,storeLocatorCountry:a.storeLocatorCountry,searchStoreHandler:function(e){return a.onChangeRedirect?a.onChangeRedirect(S||e):I(e)},autocompletePredictions:(0,z.jsx)(B,{setSearchInputOverride:C,setAutocompletePredictions:l,setShowGeolocation:v,getUserLocation:function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(e){Z({latitude:e.coords.latitude,longitude:e.coords.longitude}),C("".concat(e.coords.latitude," ").concat(e.coords.longitude)),v(!1),l([])},function(e){e.code===e.PERMISSION_DENIED&&v(!1)})},showGeolocation:g,predictions:u})})})}}}]); //# sourceMappingURL=5170-7f29515487e091af.js.map