"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[765],{20765:function(e,t,i){i.d(t,{Z:function(){return I}});var s=i(20567),r=i(14932),a=i(35944),l=i(79896),n=i(59337),o=i(66667),d=i(89646),c=i(79334),m=i(92217),h=i(14104),f=i(82580),u=i(40596),p=i(76507),Z=i(26201),b=i(62162),g=i(66971),x=i(39085),v=i(17082),y=i(71663),M=i(11163),w=i(67294),k=i(87536),B=i(86896),E=i(44012),L=i(27981),C=()=>(0,a.BX)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 262 250",children:[(0,a.tZ)("path",{fill:"#7E9182",d:"M192.9 57.72h-66.6v109.8H236v-63.87c0-25.37-19.22-45.93-43.1-45.93Z"}),(0,a.tZ)("path",{fill:"#C0C8C0",d:"M169.4 167.51v-63.86c0-25.37-19.3-45.93-43.1-45.93-23.87 0-43.1 20.56-43.1 45.93v63.86h86.2Z"}),(0,a.tZ)("path",{fill:"#C0C8C0",d:"M169.7 167.13h-16.84v82.27h16.84v-82.27Z"}),(0,a.tZ)("path",{fill:"#7E9182",d:"M182.01 155.53h-12.6V249H182v-93.47Z"}),(0,a.tZ)("path",{fill:"#F2F3F4",d:"m90.26 69.04-18.02 59.93 94.81 28.77 18.02-59.93-94.81-28.77Z"}),(0,a.tZ)("path",{fill:"#E7E6E7",d:"m66 129.83 94.68 28.28-31.22-58.71L66 129.83Z"}),(0,a.tZ)("path",{fill:"#fff",d:"m83.7 70.04 94.68 28.28-56.34 26.14L83.7 70.04Z"}),(0,a.tZ)("path",{fill:"#D9AE6F",d:"M200.94 118.38c5.65 0 10.23-4.6 10.23-10.28 0-5.67-4.58-10.28-10.23-10.28s-10.23 4.6-10.23 10.28 4.58 10.28 10.23 10.28Z"}),(0,a.tZ)("path",{fill:"#D9AE6F",d:"M199.03 49h-8.32v59.1h8.32V49Z"}),(0,a.tZ)("path",{fill:"#D9AE6F",d:"M222.78 49h-32.07v21.55h32.07V49Z"}),(0,a.tZ)("path",{stroke:"#7E9182",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:".72",d:"m46.15 77.68 14.92 4.18m-25.46 2.65 32.64 9.15m-30.23 1.3 21.35 5.98"}),(0,a.tZ)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:".72",d:"M51.93 170.84a3.34 3.34 0 0 1-2.04 3.07 3.3 3.3 0 0 1-4.51-2.42 3.34 3.34 0 0 1 1.4-3.42 3.3 3.3 0 0 1 5.15 2.77v0Z",opacity:".6"})]});let A=(0,i(77366).Z)(x.Z,{target:"e6xvvwz0"})("margin-left:-3px;padding:14px;background-color:",e=>e.theme.palette.primary.main,";border-radius:2px;color:",e=>e.theme.palette.common.white,";");var T=(0,i(54490).vU)({title:{id:"components.newsletterBanner.title",defaultMessage:"Let's keep in touch",description:"title of the newsletter banner"},text:{id:"components.newsletterBanner.text",defaultMessage:"Be the first to know about new products, exclusive offers and the latest trends",description:"title of the newsletter banner"},emailFieldLabel:{id:"common.email",defaultMessage:"Email",description:"common label for email"},emailFieldPlaceholder:{id:"components.newsletterBanner.fields.email.placeholder",defaultMessage:"Enter your e-mail address",description:"placeholder for the email field in the newsletter banner form"},checkboxFieldLabel:{id:"components.newsletterBanner.fields.checkbox",defaultMessage:"By checking this box and submitting my email address, I agree to DiamondsByMe's Privacy Policy and Terms & Conditions",description:"label for the checkbox in the "},this:{id:"common.this",defaultMessage:"This",description:"common label for this"},validationRequired:{id:"validation.required",defaultMessage:"{name} is a required field",description:"validation type required error message"},validationDefault:{id:"validation.undefinedError",defaultMessage:"The field {name} contains the error: {errorType}",description:"default validation error message"},validationAlreadySubscribed:{id:"validation.alreadySubscribed",defaultMessage:"This email address is already subscribed to our newsletter",description:"already subscribed error message"},submitButtonLabel:{id:"components.newsletterBanner.submitMessage",defaultMessage:"Subscribe",description:"label of the submit message action"},successTitle:{id:"components.newsletterBanner.successMessage.title",defaultMessage:"Subscribed to the newsletter",description:"title of the success message of the newsletter banner form"},successText:{id:"components.newsletterBanner.successMessage.text",defaultMessage:"Thank you for signing up for our newsletter.",description:"text of the success message of the newsletter banner form"},close:{id:"common.close",defaultMessage:"Close",description:"common label for close"}});let F={EMAIL:"",avgAllow:!1},_=()=>{let e=(0,B.Z)(),{locale:t}=(0,M.useRouter)(),{control:i,handleSubmit:_,reset:I,setError:P}=(0,k.cI)({defaultValues:F}),{loading:S,subscribe:X}=(0,n.Z)(L.Cq[t]),[q,D]=(0,w.useState)(!1),W=async e=>{try{let{data:t}=await X(null==e?void 0:e.EMAIL)||{},{data:i,errors:s,success:r}=t||{};if(r){if(null==i?void 0:i.is_subscribed){P("EMAIL",{type:"alreadySubscribed",message:"Already subscribed"});return}D(!0)}else P("EMAIL",{type:"klaviyoError",message:null==s?void 0:s.at(0)})}catch(e){}},H=()=>{D(!1),I()};return(0,a.BX)(a.HY,{children:[(0,a.tZ)(c.Z,{bgcolor:"primary.500",mt:10,mb:{xs:6,md:16},mx:{xs:"-15px",sm:0},px:{xs:"15px"},pt:{xs:6,sm:"initial"},overflow:"hidden",children:(0,a.BX)(m.ZP,{container:!0,alignItems:"center",spacing:{xs:2,md:4},children:[(0,a.tZ)(m.ZP,{item:!0,xs:12,sm:3,alignSelf:"flex-end",lineHeight:0,sx:{order:{xs:2,sm:0}},children:(0,a.tZ)(c.Z,{maxWidth:{xs:200,md:"initial"},mx:"auto",mb:{xs:-3,sm:"initial"},mt:{xs:-3,sm:"initial"},children:(0,a.tZ)(C,{})})}),(0,a.BX)(m.ZP,{item:!0,xs:12,sm:4,sx:{order:{xs:0,sm:1},textAlign:{xs:"center",sm:"left"}},children:[(0,a.tZ)(h.Z,{variant:"h4",component:"div",mb:2,children:(0,a.tZ)(E.Z,(0,s._)({},T.title))}),(0,a.tZ)(h.Z,{variant:"bodyLarge",children:(0,a.tZ)(E.Z,(0,s._)({},T.text))})]}),(0,a.tZ)(m.ZP,{item:!0,xs:12,sm:5,lg:4,sx:{pr:{sm:2,lg:0},order:{xs:1,sm:2}},children:(0,a.BX)("form",{onSubmit:_(W),children:[(0,a.BX)(c.Z,{display:"flex",alignItems:"flex-start",mb:2,mt:2,children:[(0,a.tZ)(k.Qr,{name:"EMAIL",control:i,rules:{required:!0},render:t=>{let{field:i,fieldState:{error:n}}=t;return(0,a.tZ)(l.Z,(0,r._)((0,s._)({},i),{type:"email",InputProps:{sx:{backgroundColor:"common.white"}},fullWidth:!0,disabled:S,inputProps:{"aria-label":e.formatMessage(T.emailFieldLabel)},placeholder:e.formatMessage(T.emailFieldPlaceholder),error:n,helperText:n?e.formatMessage(T["validation".concat((0,y.Z)(n.type))]||T.validationDefault,{name:e.formatMessage(T.emailFieldLabel),errorType:n.type}):void 0}))}}),(0,a.tZ)(A,{color:"primary",type:"submit","aria-label":"Aanmelden",disabled:S,children:S?(0,a.tZ)(f.Z,{size:20}):(0,a.tZ)(o.Z,{sx:{fontSize:20}})})]}),(0,a.tZ)(k.Qr,{name:"avgAllow",control:i,rules:{required:!0},render:t=>{let{field:i,fieldState:{error:l}}=t;return(0,a.BX)(a.HY,{children:[(0,a.tZ)(u.Z,{control:(0,a.tZ)(p.Z,(0,r._)((0,s._)({},i),{sx:{mt:-.75}})),sx:{alignItems:"flex-start",mb:2},label:e.formatMessage(T.checkboxFieldLabel)}),l?(0,a.tZ)(Z.Z,{error:l,children:e.formatMessage(T["validation".concat((0,y.Z)(l.type))]||T.validationDefault,{name:e.formatMessage(T.this),errorType:l.type})}):void 0]})}})]})})]})}),(0,a.BX)(b.Z,{onClose:H,fullWidth:!0,maxWidth:"sm",open:q,children:[(0,a.BX)(g.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.tZ)(E.Z,(0,s._)({},T.successTitle)),(0,a.tZ)(x.Z,{"aria-label":"close",onClick:H,children:(0,a.tZ)(d.Z,{})})]}),(0,a.tZ)(v.Z,{children:(0,a.tZ)(E.Z,(0,s._)({},T.successText))})]})]})};_.propTypes={},_.defaultProps={};var I=_}}]);