1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2037],{32037:(e,r,s)=>{s.r(r),s.d(r,{Brevo:()=>p});var l=s(6029),a=s(32),n=s.n(a),t=s(32988),i=s.n(t),d=s(16525),o=s(58503),c=s(90604),u=s(81278),g=s(55729);let p=e=>{let{block:r}=e,{list_id:s,description:a}=r.attrs,t=(0,u.useRouter)(),p=(null==t?void 0:t.locale)||"is",[m,x]=(0,g.useState)(""),[f,h]=(0,g.useState)(!1),[v,b]=(0,g.useState)(""),N=async()=>{b("");let e=m.trim();if(!e)return void(0,c.f)("error","Nau\xf0synlegt a\xf0 sl\xe1 inn netfang.");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return void(0,c.f)("error","\xd3gilt netfang.");h(!0);try{let{data:r}=await n().post("/api/brevo",{email:e,list_id:s});(null==r?void 0:r.id)?b("success"):b("existing"),x("")}catch(e){b("error")}finally{h(!1)}};return(0,l.jsxs)("div",{className:"",children:[(0,l.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,l.jsx)("label",{className:"font-medium",dangerouslySetInnerHTML:{__html:a}}),(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsx)(o.p,{type:"email",value:m,onChange:e=>x(e.target.value),placeholder:"is"===p?"Netfang...":"Email...",className:"flex-1 rounded-none"}),(0,l.jsx)(d.$,{onClick:N,disabled:f||!m,className:i()("bg-primary-300 rounded-none",{"hover:!bg-primary-700":!(f||!m)}),children:(0,l.jsx)("span",{className:"text-white",children:f?"...":"is"===p?"Skr\xe1":"Sign up"})})]})]}),"success"===v&&(0,l.jsx)("div",{className:"p-3 rounded-lg bg-green-50 text-green-700 border border-green-200",children:"Takk! \xde\xfa hefur veri\xf0 skr\xe1\xf0/ur \xe1 p\xf3stlistann."}),"error"===v&&(0,l.jsx)("div",{className:"p-3 rounded-lg bg-red-50 text-red-700 border border-red-200",children:"Villa kom upp â vinsamlegast pr\xf3fa\xf0u aftur."}),"existing"===v&&(0,l.jsx)("div",{className:"p-3 rounded-lg bg-yellow-50 text-yellow-700 border border-yellow-200",children:"\xde\xfa ert n\xfa \xfeegar skr\xe1\xf0/ur \xe1 p\xf3stlista."})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.