"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8948,6731],{6619:function(e,t,a){a.d(t,{jF:function(){return convertDateTime},kh:function(){return convertLocale},TE:function(){return generateDescription}});let n={ja:"ja-JP",en:"en-GB",ie:"en-IE",se:"sv-SE",eu:"en-GB",bg:"bg-BG",ca:"en-CA",hr:"hr-HR",ch:"de-CH",be:"nl-BE",cs:"cs-CZ",cy:"en-CY",da:"da-DK",nl:"nl-NL",ee:"et-EE",fi:"fi-FI",fr:"fr-FR",hu:"hu-HU",de:"de-DE",el:"el-GR",lu:"lb-LU",mt:"en-MT",nz:"en-NZ",it:"it-IT",ko:"ko-KR",lv:"lv-LV",lt:"lt-LT",no:"nb-NO",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",sk:"sk-SK",sl:"sl-SI",es:"es-ES",sv:"sv-SE",at:"de-AT",ae:"ar-AE","fr-ca":"fr-CA",us:"en-US","es-us":"es-US",au:"en-AU","de-ch":"de-CH","de-be":"de-BE","de-de":"de-DE","it-ch":"it-CH","fr-ch":"fr-CH","fr-be":"fr-BE","nl-be":"nl-BE"};var l=a(3542);let s={dateOptions:{hour:"2-digit",minute:"2-digit"}},r={dateOptions:{month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}},o={"en-GB,en-IE,en-EU,en-NZ":{...r,at:"",suffix:"",dateFormat:""},"sv-SE":{...s,at:" kl.",suffix:"",dateFormat:"/",digits:1},"de-DE,de-CH,de-BE,de-AT":{...s,at:"., um ",suffix:" Uhr",dateFormat:"."},"fi-FI":{...s,at:". klo ",suffix:"",dateFormat:".",digits:1},"nb-NO":{...s,at:" kl.",suffix:"",dateFormat:".",digits:1},"da-DK":{...s,at:" kl.",suffix:"",dateFormat:"/",digits:1},"es-US":{...s,at:" a las",suffix:" CT",dateFormat:"/"},"es-ES":{...s,at:" a las",suffix:" h",dateFormat:"/"},"nl-NL,nl-BE":{...s,at:"",suffix:"",dateFormat:"-"},"fr-FR,fr-BE,fr-CH":{...s,at:" \xe0",suffix:"",dateFormat:"/"},"it-IT,it-CH":{...s,at:" alle",suffix:"",dateFormat:"/"},"pl-PL":{...s,at:"., o godzinie",suffix:"",dateFormat:"."},"en-US":{...r,at:"",suffix:" CT",dateFormat:""},"fr-CA":{...s,at:" \xe0",suffix:" CT",dateFormat:"/"},"en-CA":{...r,at:"",suffix:" CT",dateFormat:""},"cs-CZ":{...s,at:".",suffix:" hod",dateFormat:"."},"el-GR":{...s,at:".,στις",suffix:"",dateFormat:"."},"pt-PT":{...s,at:" \xe0s",suffix:" horas",dateFormat:"/"},"sk-SK":{...s,at:". o",suffix:" hod",dateFormat:".",digits:1},"en-AU":{...r,at:"",suffix:" AET",dateFormat:""},"ja-JP,ko-KR,ar-AE":{...r,at:"",suffix:"",dateFormat:""},"ro-RO,hu-HU":{...s,at:",",suffix:"",dateFormat:"/"}},getLocaleOption=e=>{for(let[t,a]of Object.entries(o)){let a=t.split(","),n=a.includes(e);if(n)return o[t]}return null},convertLocale=e=>e&&n[e]?n[e]:null,generateDescription=(e,t)=>e.replace(RegExp("%endDateTime%","gi"),t),shouldChangeLocaleToEnglish=(e,t)=>"ja-JP"===e&&"desenio"===t||"ko-KR"===e&&"desenio"===t||"ar-AE"===e&&"posterstore"===t,convertDateTime=(e,t)=>{let a=new Date(e+" 23:59"),n=l.env.ORGANIZATION||"";shouldChangeLocaleToEnglish(t,n)&&(t="en-US");let s=getLocaleOption(t),r=["fr-FR","fr-BE","fr-CH"].includes(t),o=a.getHours(),i=a.getMinutes(),c=new Intl.DateTimeFormat(t,null==s?void 0:s.dateOptions).format(a),u=a.getDate().toString().padStart((null==s?void 0:s.digits)||2,"0"),d=(a.getMonth()+1).toString().padStart((null==s?void 0:s.digits)||2,"0"),f=r?" ".concat(o," h ").concat(i):" ".concat(c).concat(null==s?void 0:s.suffix),m="".concat(u).concat(null==s?void 0:s.dateFormat).concat(d).concat(null==s?void 0:s.at).concat(f),x=(null==s?void 0:s.dateFormat)?m:c+"".concat(null==s?void 0:s.suffix);return x}},8948:function(e,t,a){a.d(t,{z:function(){return DiscountCodeNewsletterForm}});var n=a(2322),l=a(2784),s=a(1805),r=a(7981),o=a(1994),i=a(8970),c=a(5599),u=a(3540),d=a(2148),f=a(6731),m=a(231),x=a(5100),h=a(5891),p=a(6154),b=a(5632),g=a(6619),w=a(9097),v=a.n(w);let DiscountCodeNewsletterForm=e=>{let{onSuccess:t,discountCode:a,modal:w}=e,{activateDiscountCampaign:F,discountCampaign:E}=(0,p.J)(),S=(0,m.P)(),{phrases:C,resourceURLs:k}=(0,h.Y)(),T=(0,r.M)("notification"),[N,j]=(0,l.useState)(!1),[y,U]=(0,l.useState)(!1),B=(0,l.useCallback)(()=>{let e=new URLSearchParams(window.location.search),t=e.get("activateDiscountCampaign");if(t)return;(s.Z.get("_vaI")||s.Z.get("_ruleNewsletterEntry")||localStorage.getItem(u.m.discountCodeBadgeUsed))&&!E&&(a&&F(a,7),localStorage.setItem(u.m.discountCodeBadgeUsed,String(a)));let n=(null==E?void 0:E.discountCode)===a;a&&n&&s.Z.set(o.u.discountCode,a,{expires:7})},[E,a,F]);(0,l.useEffect)(()=>{let e=null;return e=setInterval(()=>{void 0!==E&&(B(),e&&(clearInterval(e),e=null))},1e3),()=>{e&&clearInterval(e)}},[E,B]);let D=C["bw-newsletter.bw-topbar-title"],{timezone:R}=(0,x.a)(),{locale:I}=(0,b.useRouter)(),[A,L]=(0,l.useState)(void 0);return(0,l.useEffect)(()=>{let e=(0,d.B3)(I),t=(0,d.l0)(I),a=(0,d.SD)(I);if(!d.KU)return;let n=(0,g.kh)(I),l=(0,g.jF)(d.KU,n||"");switch((0,d.oy)(R,a,e,t),!0){case d.$T:L((0,g.TE)(C[e||t?"bw-newsletter.bw-toc-sign-up":"bw-newsletter.bw-toc-sign-up-pp"]||"",l));break;case d.kd:L((0,g.TE)(C[t?"bw-newsletter.bw-toc-sign-up":"bw-newsletter.bw-toc-sign-up-frames"]||"",l));break;case d.Fi:case d.XG:case d.ky:case d.BK:case d.Vs:case d.Vp:L((0,g.TE)(C["bw-newsletter.bw-toc-on-top"]||"",l))}},[I,R,C]),(0,n.jsxs)(n.Fragment,{children:[w?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h1",{className:"leading-none text-center uppercase h1",children:N?C["out-of-stock.thank-you"]:D}),(0,n.jsx)("p",{id:"newsletter-label",className:"mt-8 mb-8 text-center",children:N?(0,i.T)(C["cart.discount-applied"],a||""):C[d.xg]})]}):(0,n.jsxs)("label",{id:"".concat(T,"-newsletter-label"),htmlFor:"".concat(T,"-newsletter-input"),children:[(0,n.jsx)("p",{className:"text-sm font-bold text-center uppercase font-display",children:N?C["out-of-stock.thank-you"]:D}),(0,n.jsx)("span",{className:"block my-3 text-xs text-center text-gray-600",children:N?(0,i.T)(C["cart.discount-applied"],a||""):C[d.xg]})]}),(0,n.jsx)(f.NewsletterForm,{muteToasts:!0,onSubmit:()=>{a&&F(a,7),t(),j(!0),U(!1)},onFocus:()=>U(!0),onBlur:()=>U(!1),buttonSendText:S["common.subscribe"],template:d.xP}),(0,n.jsx)("small",{hidden:!y,className:"block max-w-md mx-auto mt-3 text-center text-gray-600",children:C["footer.newsletter-consent"]}),(0,n.jsx)("small",{id:"newsletter-description",className:"block w-full mt-3 italic text-center",children:(0,c.K)(C["footer.newsletter-legal"],(0,n.jsx)(v(),{href:"/".concat(k["info.privacy-policy"]),prefetch:!1,className:"font-bold hover:underline",target:"_blank",children:C["common.privacy-policy"]}))}),w&&A&&(0,n.jsx)("small",{className:"block max-w-md mx-auto mt-3 mb-2 text-xs text-center",children:A})]})}},6731:function(e,t,a){a.r(t),a.d(t,{NewsletterForm:function(){return NewsletterForm}});var n=a(2322),l=a(2784),s=a(6577),r=a.n(s),o=a(5632),i=a(2091),c=a(3094),u=a(3696),d=a(3540),f=a(111),m=a(5564),x=a(8634),h=a(9227),p=a(231),b=a(6255),g=a(5891),w=a(6154),v=a(2685),F=a(8423);let NewsletterForm=e=>{let{id:t,activityIndicatorProps:a,onSubmit:s,unsubscribe:E,styles:S,buttonSendText:C,isValidating:k,muteToasts:T,template:N,discountCode:j,newsletterConsentText:y,source:U,...B}=e,D=(0,p.P)(),{phrases:R}=(0,g.Y)(),{setToast:I}=(0,b.e)(),{activateDiscountCampaign:A}=(0,w.J)(),{locale:L="en"}=(0,o.useRouter)(),O=(0,l.useRef)(null),[H,K]=(0,l.useState)(!1),[P,G]=(0,l.useState)(!1),[Z,_]=(0,l.useState)(!1),[z,J]=(0,l.useState)(""),[M,V]=(0,l.useState)([]),handleSubmit=async e=>{var t,a;if(e.preventDefault(),H)return;if(null==k||k(),!z)return G(!1),null===(t=O.current)||void 0===t||t.focus(),V([D["input.required"]]);if(!f.T.test(z))return G(!1),null===(a=O.current)||void 0===a||a.focus(),V([D["input.invalid"]]);G(!0);let n=E?await (0,v.U)(L,{email:z}):await (0,v.G)(L,{email:z,template:N,consentText:y,source:U});if(n.status!==i.M.OK)return G(!1),V([n.error]);G(!1),_(!0),null==s||s(!0),T||I({type:E?"default":"success",text:E?R["newsletter-form.unsubscribe"]:R["newsletter-form.subscribe"]}),!E&&j&&(A(j,7),localStorage.setItem(d.m.discountCodeBadgeUsed,String(j))),E||(0,c.S)(z)};return(0,n.jsxs)("form",{...B,onSubmit:handleSubmit,className:(null==S?void 0:S.form)||"flex flex-col w-full",noValidate:!0,children:[(0,n.jsx)(x.j,{id:t,name:"".concat(t,"-email"),innerRef:O,required:!0,placeholder:R["newsletter-form.email-placeholder"],value:z,onChange:e=>{M.length&&V([]),J(e.target.value)},errors:M,validate:!0,disabled:Z||P,styles:{label:"visually-hidden",...null==S?void 0:S.inputEmail}}),(0,n.jsx)(h.o,{name:"newsletter-text",placeholder:"Example",onChange:e=>{K(!0)},disabled:Z,autoComplete:"off",styles:{container:"hidden",label:"visually-hidden",...null==S?void 0:S.inputEmail}}),(0,n.jsxs)("button",{type:"submit",className:(0,u.tw)("relative",(null==S?void 0:S.submit)||"button button-primary",M.length>0&&"mt-2"),disabled:!!M.length||P||Z,children:[P&&(0,n.jsx)(m.z,{color:"black",bgColor:"transparent",size:15,...a}),!P&&Z&&(0,n.jsx)(r(),{src:F.Z,alt:"Check icon",height:18,width:18}),!P&&!Z&&(C||R["common.send"])]}),Z&&(0,n.jsx)("span",{className:"visually-hidden",children:E?R["newsletter-form.unsubscribe"]:R["newsletter-form.subscribe"]})]})}}}]);