1import{N as T}from"./B7KIGEBT.js";import{d as x,aB as I,S as N,m as S,r as d,x as k,ae as L,p as A,q as C,A as F,c as K,e as E,i as P,v as B,g as w,I as R}from"./wGaC-Zcn.js";import"./-jdA4pKC.js";import"./CVMx9qG5.js";import"./X9MRHzqW.js";import"./Co1YIp_a.js";import"./BR_rOBzX.js";import"./La00Ijyy.js";import"./BfYqtZUW.js";import"./CPeRe0Bd.js";import"./BehRJDZa.js";import"./DEHJaEqD.js";const D=x({__name:"Newsletter",props:{formTitle:{},formText:{},formButtonLabel:{},formPrivacyText:{},formAgreementText:{},formInfoText:{},subscriptionSource:{default:"NL-Anmeldung Ãbersichtsseite"},userdata:{default:{}},tagList:{},newsletterIcon:{},newsletterNotificationTime:{},salescloudKey:{}},async setup(p){let a,u;const g=I(),h=N(),r=S(),i=d([]),o=k(),e=p,_=r?.newsletter_svg_base_url,l=d(),c=L({countAbos:0,formKey:e.salescloudKey?e.salescloudKey:"",formTitle:e.formTitle,formText:e.formText,formPrivacyText:r?.privacyText,formAgreementText:r?.newsletterAgreementText,formInfoText:r?.newsletterTextHint,loggedIn:h,userData:{salutation:e.userdata?.salutation||o?.salutation,firstName:e.userdata?.firstname||o?.firstname,lastName:e.userdata?.lastname||o?.lastname,email:e.userdata?.email||o?.email},tagList:e.tagList,response:{},newsletterIcon:e.salescloudKey?_+e.salescloudKey+".svg":"",newsletterNotificationTime:e.newsletterNotificationTime}),{data:y}=([a,u]=A(()=>C("/api/newsletter",{key:"newsletter-list-form",default:()=>[],lazy:!0,server:!1},"$T9nmtCrEN_")),a=await a,u(),a);async function b(s){if(!s?.aboList?.length)return;document.body.dispatchEvent(new CustomEvent("avo-submit-newsletter-form",{detail:l.value}));const m=s.aboList.map(async t=>{const f=i.value?.find(n=>n.salescloud_key===t);if(!f)return console.warn(`Newsletter ${t} nicht gefunden`),{success:!1,key:t};const v={...s,newsletter_meta_data:r.newsletter_meta_data,subscriptionSource:e.subscriptionSource,currentURL:g?.href,campaignId:f.campaign_id};try{return await $fetch("/api/user/newsletter",{method:"POST",body:v}),{success:!0,key:t}}catch(n){return console.error(`Newsletter ${t} fehlgeschlagen:`,n),{success:!1,key:t,error:n}}});(await Promise.allSettled(m)).every(t=>t.status==="fulfilled"&&t.value?.success)?(c.response={title:"Ihre Anmeldung war erfolgreich",message:"In Kürze erhalten Sie eine Aktivierungsmail. Bitte beachten Sie: Wenn Sie Ihre E-Mail-Adresse schon einmal bei uns bestätigt haben, erhalten Sie keine Aktivierungsmail mehr.",status:"success"},l.value?.scrollIntoView({behavior:"smooth",block:"start"})):c.response={title:null,message:"Ein Fehler ist aufgetreten.",status:"error"}}return F(y,s=>{i.value=s||[]},{immediate:!0}),(s,m)=>(K(),E("section",{id:"newsletterForm",class:"u-newsletter",ref_key:"newsletterFormRef",ref:l},[P(T,B(w(c),{onSubmit:b,newsletterList:w(i)}),null,16,["newsletterList"])],512))}}),Y=Object.assign(R(D,[["__scopeId","data-v-204bdfac"]]),{__name:"Newsletter"});export{Y as default};
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.