(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1736],{54600:function(e,n,o){"use strict";o.r(n),o.d(n,{default:function(){return M}});var i=o(74988),t=o(34235),l=o(73888),a=o.n(l),r=o(44194),s=o(16652),u=o(2614),d=o(43412),c=o(52011),p=o(97358),g=o(34064),b=o(3303),m=o(45947),f=o.n(m),h=o(31549),v=["title","description","closeButtonAriaLabel"],P=["isValidating"],k=a()(()=>Promise.all([o.e(9237),o.e(7522),o.e(9465),o.e(9701),o.e(5906)]).then(o.bind(o,49465)).then(e=>e.RegionModal),{ssr:!1,loadableGenerated:{webpack:()=>[null]}});function RegionModal(e){var n,o,{onPostalCodeChange:l}=(0,c.z0)(),{title:a,description:m,closeButtonAriaLabel:M}=e,x=(0,t.Z)(e,v),y=(0,b.T)(x),{inputField:{label:C="",errorMessage:R="",noProductsAvailableErrorMessage:_="",buttonActionText:A=""}={},idkPostalCodeLink:{text:L="",to:E="",icon:{icon:Z="",alt:j=""}={}}={}}=null!==(o=null==y?void 0:y.regionalization)&&void 0!==o?o:{},w=(0,r.useRef)(null),S=(0,p.kP)(),{isValidating:T}=S,B=(0,t.Z)(S,P),{modal:F,closeModal:N}=(0,s.l8)(),{0:z,1:O}=(0,r.useState)(""),{loading:V,setRegion:D,regionError:G,setRegionError:I}=(0,g.Z)(),K=(n=(0,i.Z)(function*(){T||(yield D({session:B,onSuccess:()=>{l(),O(""),N()},postalCode:z,errorMessage:R,noProductsAvailableErrorMessage:_}))}),function(){return n.apply(this,arguments)}),$=!!(!(null!==d.deliveryPromise&&void 0!==d.deliveryPromise&&d.deliveryPromise.mandatory)||B.postalCode),q={href:E,children:(0,h.jsxs)(h.Fragment,{children:[L,!!Z&&(0,h.jsx)(u.Z,{name:Z,"aria-label":j,width:20,height:20})]})};return(0,h.jsx)(h.Fragment,{children:F&&(0,h.jsx)(k,{title:a,description:m,overlayProps:{className:"section ".concat(f().section," section-region-modal")},closeButtonAriaLabel:M,inputRef:w,inputValue:z,inputLabel:C,errorMessage:G,idkPostalCodeLinkProps:E?q:null,onInput:e=>{""!==G&&I(""),O(e.currentTarget.value)},onSubmit:K,fadeOutOnSubmit:!1,onClear:()=>{O(""),I("")},inputButtonActionText:V?"...":A,dismissible:$})})}RegionModal.$componentKey="RegionModal";var M=RegionModal},45947:function(e){e.exports={section:"section_section__DLuEd"}}}]);