import{$ as b,q as _,_ as F,r,o as n,a,e as o,w as m,d as i,g as l,s as d,k as B,n as S,f as h,t as y}from"./_plugin-vue_export-helper-DfQgE-tC.js";import{F as c}from"./InputModelBase-CeuTljlj.js";import{F as M}from"./FormError-s39Y7_4b.js";import{I}from"./InputCheckbox-BdSNXE_n.js";import{I as T}from"./InputEmail-CZ0nPjKB.js";import{I as E}from"./InputTextarea-D-_ql-5p.js";import{S as N}from"./SuccessMessage-Dc-q-6eb.js";import{I as C}from"./InputText-DVlsj828.js";import{B as A}from"./BackendResponse-9vt7nNmn.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./FieldValidityExamples-CjjfBqdt.js";const x=function(e,t){const u={header:{type:"buchhalterseiteMail",action:"sendMailToBuchhalter"},form:{subject:{value:e.subject.value},text:{value:e.text.value},fromEmailAdress:{value:e.fromEmailAddress.value},copyMailToUser:{value:e.copyMailToUser.value?"1":"0"},seoLink:{value:t}}};return b.ajax({url:agenda.request.url,method:"POST",data:u})},q={sendMailToBuchhalter:x},R=_({components:{InputTextarea:E,FormError:M,InputCheckbox:I,InputEmail:T,SuccessMessage:N,InputText:C},props:{seoLink:{type:String,default:""},profilActiv:{type:Boolean}},data(){return{errorMessage:"",showButton:!0,showError:!1,showSuccess:!1,showForm:!1,nachricht:{subject:new c("Betreff").setRequired(!0),text:new c("Text").setRequired(!0),fromEmailAddress:new c("Ihre E-Mail-Adresse").setRequired(!0),copyMailToUser:new c("","true").setRequired(!1)},currentUser:{keycloakId:agenda.wUserCur.keycloakId}}},methods:{sendMailToBuchhalter(){q.sendMailToBuchhalter(this.nachricht,this.seoLink).then(e=>{new A(e).err.code===-1?this.showSuccess=!0:this.showError=!0}).catch(e=>{this.showError=!0,console.error(e)})},toggleForm(){this.showForm=!this.showForm}}}),U={key:0,class:"elementLink elementLink_var10 elementLink-button-color_varGrey isInverseBackground"},L=o("span",{class:"nachricht"},"Direkt-Nachricht senden",-1),P=[L],$={class:"agb"},j={class:"flex-container"},D=o("div",null,[o("button",{class:"detailsuche-box-button"},"Nachricht absenden")],-1),V=o("a",{class:"linkText"},"Abbrechen",-1),z=[V],G={key:2,class:"self-nachricht"},K=o("p",null,[o("strong",null,"Beim inaktivem Profil können keine Direkt-Nachrichten an Ihr Profil gesendet werden.")],-1),O=o("p",null,[h("Bitte aktivieren Sie innerhalb der "),o("a",{href:"/profil/edit",target:"_blank"},"Profilbearbeitung"),h(' die Schaltfläche "Profil ist sichtbar". Nur wenn beide Schaltflächen in der Profilbearbeitung aktiviert sind, können Ihnen Buchhalterseite-User Nachrichten schreiben.')],-1),H=o("a",{class:"linkText"},"Schließen",-1),J=[H],Q={key:3},W=o("div",null,"Ihre Nachricht wurde versendet.",-1);function X(e,t,u,Y,Z,ee){const p=r("input-text"),f=r("input-textarea"),k=r("input-email"),g=r("input-checkbox"),v=r("form-error"),w=r("SuccessMessage");return n(),a("div",{class:S(["kontakt kontakt-form",{"show-border":e.showForm}])},[e.showForm?i("",!0):(n(),a("div",U,[o("a",{onClick:t[0]||(t[0]=m((...s)=>e.toggleForm&&e.toggleForm(...s),["prevent"])),class:"icon-envelope","data-scrollingauto":"yes","data-scrollsmoothtotargetduration":"400"},P)])),!e.showSuccess&&e.showForm&&e.profilActiv!==!1?(n(),a("form",{key:1,onSubmit:t[3]||(t[3]=m(s=>e.sendMailToBuchhalter(),["prevent"])),class:"kontakt"},[o("fieldset",null,[l(p,{model:e.nachricht.subject,name:"vorname"},null,8,["model"]),l(f,{model:e.nachricht.text,name:"nachricht"},null,8,["model"]),l(k,{model:e.nachricht.fromEmailAddress},null,8,["model"]),o("div",$,[l(g,{model:e.nachricht.copyMailToUser},{default:d(()=>[h(" Kopie der Nachricht auch an mich. ")]),_:1},8,["model"])]),o("div",j,[D,o("div",{class:"flex-container-item2",onClick:t[1]||(t[1]=(...s)=>e.toggleForm&&e.toggleForm(...s))},z)]),o("span",{onClick:t[2]||(t[2]=(...s)=>e.toggleForm&&e.toggleForm(...s)),class:"icon-circle-xmark close-form",title:"Formular schliessen"}),e.showError?(n(),B(v,{key:0},{default:d(()=>[h(y(e.errorMessage),1)]),_:1})):i("",!0)])],32)):i("",!0),!e.showSuccess&&e.showForm&&e.profilActiv===!1?(n(),a("div",G,[K,O,o("div",{onClick:t[4]||(t[4]=(...s)=>e.toggleForm&&e.toggleForm(...s))},J)])):i("",!0),e.showSuccess?(n(),a("div",Q,[l(w,{title:"Vielen Dank für Ihre Nachricht."},{default:d(()=>[W]),_:1})])):i("",!0)],2)}const ue=F(R,[["render",X]]);export{ue as default};