"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,l=n(8529),u=n(7328),d=n(2784),h=n(41857),p=n(28885),m=n(92210),f=n(57194),g=n(83232),x=n(11006),b=n(48840),v=n(87330),y=n(81292),w=n(76910),S=n(51339),j=n(52322),C=x.zo.div(r||(r=(0,u.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=x.zo.h1(o||(o=(0,u.Z)(["\n margin: "," auto "," auto;\n ","\n"])),(0,b.W0)(7),(0,b.W0)(1),(0,v.xv)("large2","default")),L=x.zo.div(i||(i=(0,u.Z)(["\n margin-bottom: ",";\n padding: ",";\n max-width: 560px;\n text-align: center;\n ","\n"])),(0,b.W0)(4),(0,b.W0)(2),(0,v.xv)("bodyText","default")),Z=(0,x.zo)(S.zx)(a||(a=(0,u.Z)(["\n max-width: 95%;\n width: 345px;\n margin-bottom: ",";\n\n "," {\n width: 425px;\n }\n"])),(0,b.W0)(10),function(e){return(0,y.mq)(e.theme.breakpointUtils.map,"lg")}),I=x.zo.div(s||(s=(0,u.Z)(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n margin-bottom: ",";\n"])),(0,b.W0)(7)),z=x.zo.div(c||(c=(0,u.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,b.W0)(7),(0,v.xv)("bodyText","alternate"),function(e){return(0,y.mq)(e.theme.breakpointUtils.map,"xs")},function(e){return(0,y.mq)(e.theme.breakpointUtils.map,"sm")}),E=function(e){var t=e.statusCode,n=d.useState([]),r=(0,l.Z)(n,1)[0],o=(0,h.By)(),i=o.currency,a=o.shippingDestination,s=(0,h.ND)().enableMaintenanceFallback;if(!(0,h.bW)().viaFastly&&s)return(0,j.jsxs)(C,{style:{justifyContent:"center",minHeight:"60vh"},children:[(0,j.jsx)(k,{children:"We will be back soon"}),(0,j.jsx)(L,{children:"We are currently performing scheduled maintenance. Please check back shortly."})]});var c={title:"",description:"",buttonDescription:(0,p.ag)("pageunavailable.enterprise.button.description")};return 404===t?(c.title=W((0,p.ag)("pageunavailable.pagenotfound.text")),c.description=(0,p.ag)("pageunavailable.pagenotfound.details.text")):(c.title=W((0,p.ag)("pageunavailable.servererror.text")),c.description=(0,p.ag)("pageunavailable.servererror.details.text")),(0,j.jsxs)(C,{children:[(0,j.jsx)(k,{children:c.title}),(0,j.jsx)(L,{children:c.description}),r.length>0&&(0,j.jsx)(T,{categories:r}),(0,j.jsx)(Z,{emphasis:"medium",renderedAs:"a",href:m.Z5.HomePage,children:c.buttonDescription}),404===t&&(0,j.jsx)(w.ComponentWidgetRenderer,{componentName:g.ComponentName.PAGE_UNAVAILABLE,currency:i,shippingDestination:a})]})},T=function(e){var t=e.categories;return(0,j.jsx)(I,{children:t.map(function(e,t){return(0,j.jsxs)(z,{children:[(0,j.jsx)("img",{src:e.src,alt:e.alt}),(0,j.jsxs)("p",{children:["Category ",t+1]})]},t)})})},W=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,l,u,d,h,p=n(20406),m=n(8529),f=n(82269),g=n(82841),x=n.n(g),b=n(2784),v=n(7328),y=n(51339),w=n(95732),S=n(15792),j=n(92526),C=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,j.o)(e.theme.patterns.storeSearch.padding)}),W=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,C.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"}),R=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,C.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)(y.zx)(c||(c=(0,v.Z)(["\n height: 48px;\n width: 120px;\n"]))),O=(0,S.zo)(w.I)(l||(l=(0,v.Z)(["\n border-radius: ",";\n"])),function(e){return e.theme.patterns.storeSearch.searchInput.borderRadius}),U=S.zo.span(u||(u=(0,v.Z)(["\n width: 100%;\n margin-top: ",";\n ",";\n text-align: left;\n"])),(0,Z.W0)(2),(0,C.xv)("bodyText","default")),A=(0,S.zo)(y.zx)(d||(d=(0,v.Z)(["\n ",";\n text-decoration: underline;\n height: 48px;\n"])),(0,C.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 l=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",l),function(){document.removeEventListener("click",l)}},[l]);var u=function(){n.searchStoreHandler&&n.searchStoreHandler(s)},d="/stores/".concat(n.storeLocatorCountry);return(0,z.jsxs)(T,{children:[(0,z.jsx)(W,{alignment:n.alignment,children:n.i18nText.title}),(0,z.jsx)(R,{alignment:n.alignment,children:n.i18nText.subtitle}),(0,z.jsxs)(N,{onSubmit:function(e){e.preventDefault(),u()},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})]})]})},F=n(21190),H=n(25237),G=n.n(H),_=n(28885),K=G()(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,_.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),l=c[0],u=c[1],d=b.useState(!1),h=(0,m.Z)(d,2),g=h[0],v=h[1],y=b.useState(e.locationParam||""),w=(0,m.Z)(y,2),S=w[0],j=w[1],C=b.useState(void 0),k=(0,m.Z)(C,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,topStores:!1}}),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,F.T)(t.target.value,u,a.storeLocatorCountry);case 3:e.next=6;break;case 5:u([]);case 6:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),onFocus:function(){return v(!0)},clearInputValueHandler:function(){return u([])},closeDropdown:function(){v(!1),u([])},setSearchInputOverride:j,storeLocatorCountry:a.storeLocatorCountry,searchStoreHandler:function(e){return a.onChangeRedirect?a.onChangeRedirect(S||e):I(e)},autocompletePredictions:(0,z.jsx)(B,{setSearchInputOverride:j,setAutocompletePredictions:u,setShowGeolocation:v,getUserLocation:function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(e){Z({latitude:e.coords.latitude,longitude:e.coords.longitude}),j("".concat(e.coords.latitude," ").concat(e.coords.longitude)),v(!1),u([])},function(e){e.code===e.PERMISSION_DENIED&&v(!1)})},showGeolocation:g,predictions:l})})})}}}]); //# sourceMappingURL=5170-d183962203b65901.js.map