"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7626],{8610:function(e,t,l){l.d(t,{T:function(){return s},l:function(){return d}});var n=l(2322),r=l(2784),i=l(4149),a=l(7732),o=l(1534),u=l(2801);let s=/^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;function d(e){var t,l;let{innerRef:d,name:c,id:m,value:v,hint:b,errors:p,rules:f,required:x,disabled:h,validate:g,__methods__:w={},styles:y,...S}=e,j=(0,u.P)(),{__register__:k,__watch__:C,__rules__:q}=w,N=(0,i.M)("input-email");m=m||N;let E=(0,r.useRef)(null);E=d||E,!g&&Array.isArray(p)&&(null==p?void 0:p.length)&&console.warn('To display "errors" in <SCInputEmail />, please set "validate" to true.');let _=C&&C(c),T=!!(p&&p.filter(Boolean).length||q&&q[c]),B=!!(b&&!((null==_?void 0:_.length)||(null===(t=E.current)||void 0===t?void 0:t.value.length)));return(0,n.jsx)(o.oq,{id:m,label:j["common.email"],required:x,disabled:h,inputSlot:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{ref:E,id:m,name:c,type:"email",value:v,autoCorrect:"off",spellCheck:"false",required:x,disabled:h,"aria-invalid":T,dir:"ltr",lang:"en-US","aria-describedby":T?"".concat(m,"-error"):B&&"".concat(m,"-hint")||void 0,...k&&k(c,g&&{required:!h&&{value:x,message:j["input.required"]},pattern:{value:s,message:j["input.invalid"]},...f}),...S,className:(0,a.tw)("w-full outline-none appearance-none",null==y?void 0:y.input,T&&(null==y?void 0:y.inputError))}),g&&T&&(0,n.jsx)(o.lS,{styles:null==y?void 0:y.errorBadge})]}),infoSlot:g&&T?(0,n.jsx)(o.xe,{id:"".concat(m,"-error"),message:p||q&&(null===(l=q[c])||void 0===l?void 0:l.message),className:null==y?void 0:y.error}):B&&(0,n.jsx)(o.b8,{id:"".concat(m,"-hint"),message:b,className:null==y?void 0:y.hint}),styles:{container:null==y?void 0:y.container,label:null==y?void 0:y.label,inputSlot:null==y?void 0:y.inputSlot,infoSlot:null==y?void 0:y.infoSlot}})}},5115:function(e,t,l){l.d(t,{G:function(){return r},U:function(){return i}});var n=l(1714);let r=async(e,t)=>await (0,n.sg)("/api/newsletter/add/?locale=".concat(e),t),i=async(e,t)=>await (0,n.sg)("/api/newsletter/remove/?locale=".concat(e),t)},5572:function(e,t,l){l.r(t),l.d(t,{NewsletterForm:function(){return w}});var n=l(2322),r=l(2784),i=l(6577),a=l.n(i),o=l(5632),u=l(7813),s=l(5401),d=l(7732),c=l(8610),m=l(6171),v=l(4794),b=l(4666),p=l(2801),f=l(9677),x=l(3425),h=l(5115),g=l(8423);let w=e=>{let{id:t,activityIndicatorProps:l,onSubmit:i,unsubscribe:w,styles:y,buttonSendText:S,isValidating:j,muteToasts:k,template:C,discountCode:q,newsletterConsentText:N,source:E,..._}=e,T=(0,p.P)(),{phrases:B}=(0,x.Y)(),{setToast:R}=(0,f.e)(),{locale:A="en"}=(0,o.useRouter)(),z=(0,r.useRef)(null),[F,M]=(0,r.useState)(!1),[P,U]=(0,r.useState)(!1),[G,I]=(0,r.useState)(!1),[D,K]=(0,r.useState)(""),[O,V]=(0,r.useState)([]),Y=(0,r.useCallback)(async e=>{var t,l;if(e.preventDefault(),F)return;if(null==j||j(),!D)return U(!1),null===(t=z.current)||void 0===t||t.focus(),V([T["input.required"]]);if(!c.T.test(D))return U(!1),null===(l=z.current)||void 0===l||l.focus(),V([T["input.invalid"]]);U(!0);let n=w?await (0,h.U)(A,{email:D}):await (0,h.G)(A,{email:D,template:C,consentText:N,source:E});if(n.status!==u.M.OK)return U(!1),V([n.error]);U(!1),I(!0),null==i||i(!0),k||R({type:w?"default":"success",text:w?B["newsletter-form.unsubscribe"]:B["newsletter-form.subscribe"]}),w||(0,s.S)(D)},[D,w,q,A,B,k,N,E,j]);return(0,n.jsxs)("form",{..._,onSubmit:Y,className:(null==y?void 0:y.form)||"flex flex-col w-full",noValidate:!0,children:[(0,n.jsx)(v.j,{id:t,name:"".concat(t,"-email"),innerRef:z,required:!0,placeholder:B["newsletter-form.email-placeholder"],value:D,onChange:e=>{O.length&&V([]),K(e.target.value)},errors:O,validate:!0,disabled:G||P,styles:{label:"visually-hidden",...null==y?void 0:y.inputEmail}}),(0,n.jsx)(b.o,{name:"newsletter-text",placeholder:"Example",onChange:e=>{M(!0)},disabled:G,autoComplete:"off",styles:{container:"hidden",label:"visually-hidden",...null==y?void 0:y.inputEmail}}),(0,n.jsxs)("button",{type:"submit",className:(0,d.tw)("relative",(null==y?void 0:y.submit)||"button button-primary",O.length>0&&"mt-2"),disabled:!!O.length||P||G,children:[P&&(0,n.jsx)(m.z,{color:"black",bgColor:"transparent",size:15,...l}),!P&&G&&(0,n.jsx)(a(),{src:g.Z,alt:"Check icon",height:18,width:18}),!P&&!G&&(S||B["common.send"])]}),G&&(0,n.jsx)("span",{className:"visually-hidden",children:w?B["newsletter-form.unsubscribe"]:B["newsletter-form.subscribe"]})]})}},4794:function(e,t,l){l.d(t,{j:function(){return o}});var n=l(2322),r=l(4869),i=l(8610);let a={input:"min-h-[3rem] px-4 text-md border placeholder-black/50 focus:border-black text-black border-black/50",inputError:"text-urgent border-urgent pe-11",errorBadge:{container:"rounded-full bg-urgent",icon:"invert"},error:"text-sm text-urgent",hint:"text-sm text-black/50",label:"text-sm mb-1",infoSlot:"min-h-[1.5rem] items-center justify-end"},o=e=>{let{styles:t,...l}=e,o=(0,r.T)(a,t);return(0,n.jsx)(i.l,{styles:o,...l})}},4666:function(e,t,l){l.d(t,{o:function(){return m}});var n=l(2322),r=l(4869),i=l(2784),a=l(4149),o=l(7732),u=l(1534),s=l(2801);function d(e){var t,l;let{innerRef:r,name:d,id:c,label:m,value:v,hint:b,errors:p,rules:f,required:x,disabled:h,validate:g,autoComplete:w,__methods__:y={},styles:S,...j}=e,k=(0,s.P)(),{__register__:C,__watch__:q,__rules__:N}=y,E=(0,a.M)("input-text");c=c||E;let _=(0,i.useRef)(null);_=r||_,!g&&Array.isArray(p)&&(null==p?void 0:p.length)&&console.warn('To display "errors" in <SCInputText />, please set "validate" to true.');let T=q&&q(d),B=!!(p&&p.filter(Boolean).length||N&&N[d]),R=!!(b&&!((null==T?void 0:T.length)||(null===(t=_.current)||void 0===t?void 0:t.value.length)));return(0,n.jsx)(u.oq,{id:c,label:m,required:x,disabled:h,inputSlot:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{ref:_,id:c,name:d,type:"text",value:v,spellCheck:"true",autoCorrect:"on",autoComplete:w||"on",autoCapitalize:"sentences",required:x,disabled:h,"aria-invalid":B,"aria-describedby":B?"".concat(c,"-error"):R&&"".concat(c,"-hint")||void 0,...C&&C(d,g&&{required:!h&&{value:x,message:k["input.required"]},...f}),...j,className:(0,o.tw)("w-full outline-none appearance-none",null==S?void 0:S.input,B&&(null==S?void 0:S.inputError))}),g&&B&&(0,n.jsx)(u.lS,{styles:null==S?void 0:S.errorBadge})]}),infoSlot:g&&B?(0,n.jsx)(u.xe,{id:"".concat(c,"-error"),message:p||N&&(null===(l=N[d])||void 0===l?void 0:l.message),className:null==S?void 0:S.error}):R&&(0,n.jsx)(u.b8,{id:"".concat(c,"-hint"),message:b,className:null==S?void 0:S.hint}),styles:{container:null==S?void 0:S.container,label:null==S?void 0:S.label,inputSlot:null==S?void 0:S.inputSlot,infoSlot:null==S?void 0:S.infoSlot}})}let c={input:"min-h-[3rem] px-4 text-black border-black/50 text-md border placeholder-black/50 focus:border-black/100",inputError:"text-urgent border-urgent pe-11",errorBadge:{container:"rounded-full bg-urgent",icon:"invert"},error:"text-sm text-urgent",hint:"text-sm text-black/50",label:"text-sm mb-1",infoSlot:"min-h-[1.5rem] items-center justify-end"},m=e=>{let{styles:t,...l}=e,i=(0,r.T)(c,t);return(0,n.jsx)(d,{styles:i,...l})}}}]);