1import{d as C,_ as B,o as p,a as f,b as n,e as o,w as a,U as q,K as ve,G as i,j as I,g as w,t as s,F as T,I as P,s as O,f as j,l as k,N as K,Q,B as X,y as Y,r as x,m as ee,M as be,X as _e,k as $e,Y as ye,h as we,n as Ve}from"./index-DeAUPXSL.js";import{s as Z}from"./index-CTXa41Hp.js";import{s as L}from"./index-ilxmDcjl.js";import{s as z}from"./index-BYl8RVxN.js";import{s as te,a as oe,b as ne}from"./index-CMoB73ht.js";import{s as se,a as ke,b as Se,c as De,d as Re}from"./index-CeYFrKD2.js";import{s as Ue}from"./index-DjDR-jOv.js";import{s as Ie}from"./index-kghMangy.js";import{s as Ae,a as Ne}from"./index-BK9eQzNY.js";import{A as Te}from"./addressBookService-DtHFjagH.js";import{P as J}from"./postDepartmentsService-CVrC6-0L.js";import{C as ae}from"./contentService-CDFRnIim.js";import{s as Ce}from"./index-HYOVrEEh.js";import{s as Be}from"./index-aOP3n9NJ.js";import{s as Pe}from"./index-B46I20_2.js";import{s as Fe}from"./index-BoZdRLJ3.js";import{T as Me}from"./tenantsService-DILFI-id.js";import{P as Ee}from"./pdfBuilder-SV6n0YQB.js";import{c as qe}from"./index-BMOjciaB.js";import{S as Le}from"./signatureService-DBgVOcac.js";import"./index-Cc6y_n8G.js";import"./index-CrBZFnXt.js";import"./index-rQ3q9mvo.js";import"./index-l4JhjWT8.js";import"./index-CrMVwid4.js";import"./index-Ca0FhKHY.js";import"./index-C6TE4_uK.js";import"./index-Dr0PMKoc.js";import"./ApiResponse-Boukza-x.js";const Oe=C({name:"AnimatedEnvelope"}),je={class:"envelope-container"};function ze(e,t,l,d,h,b){return p(),f("div",je,[...t[0]||(t[0]=[n("div",{class:"envelope"},[n("div",{class:"top-flap"}),n("div",{class:"letter"}),n("div",{class:"bottom-flap"})],-1)])])}const le=B(Oe,[["render",ze]]),Ge=C({name:"ComposeSentModal",emits:["update:modelValue","close"],components:{AnimatedEnvelope:le},computed:{value:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},props:{modelValue:{type:Boolean,required:!0}},setup(){return{}},methods:{close(){this.value=!1,this.$emit("close")}}}),We={class:"flex w-full flex-1 flex-col items-center justify-center py-6"};function He(e,t,l,d,h,b){const u=le,v=q;return p(),f("div",null,[o(v,{visible:e.value,"onUpdate:visible":t[0]||(t[0]=_=>e.value=_),modal:"","dismissable-mask":"","show-header":!1,"content-class":"flex grow flex-col",class:"min-w-[300px] min-h-[275px]"},{default:a(()=>[n("div",We,[o(u),t[1]||(t[1]=n("div",{class:"font-bold"}," Dokument wird versendet. ",-1))])]),_:1},8,["visible"])])}const ie=B(Ge,[["render",He],["__scopeId","data-v-74c42cf7"]]),Ze=C({name:"NewContentModal",props:{receivers:Array,modelValue:Boolean},emits:["update:modelValue","save"],computed:{value:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},methods:{save(){const e=[];for(let t=0;t<this.fields.length;t+=1)e.push({fieldName:this.fields[t].name,fieldPurpose:this.fields[t].purpose,value:this.request[t].value,label:this.request[t].label});this.$emit("save",{fields:this.fields,requests:e}),this.value=!1},getReceiverSelection(){if(this.receivers==null)return[];const e=this.receivers.map(l=>{var h,b,u,v,_;let d="";if(console.log(l),l.type==="email")d=(h=l.value.email)!=null?h:"";else if(l.type==="tel")d=(b=l.value.tel)!=null?b:"";else if(l.type==="ssn")d=(u=l.value.ssn)!=null?u:"";else if(l.type==="vat_id")d=(v=l.value.vat_id)!=null?v:"";else if(l.type==="linked")d=(_=l.value.full_name)!=null?_:"";else if(l.type==="birth_information"){const c=l.value.birth_information;d=c?`${c.given_names} ${c.last_name} | ${c.date_of_birth}`:""}return{value:JSON.stringify(l.value),label:d}}),t=this.t("outbox_page.compose.signature.modal.requests.createByMyself");return e.push({value:"{}",label:`<<${t}>>`}),e},addField(){if(this.newName===null||this.newName===""){this.error=this.t("outbox_page.compose.signature.modal.fields.fieldNameRequiredError");return}this.fields.push({role:this.newRole,name:this.newName,purpose:this.newPurpose});const e=this.t("outbox_page.compose.signature.modal.requests.createByMyself");this.request.push({value:"{}",label:`<<${e}>>`}),this.newRole="",this.newName="",this.newPurpose=""}},setup(){const e=i("fields"),t=i(""),l=i([]),d=i(""),h=i(""),b=i(""),u=i([]),{t:v}=ve();return{currentTab:e,error:t,fields:l,newRole:d,newName:h,newPurpose:b,request:u,t:v}}}),Je={key:0,class:"p-4"},Ke={class:"text-h6"},Qe={class:"flex items-center gap-3 px-3 py-2"}
1,Xe={class:"flex-1 min-w-0 flex flex-col"},Ye={class:"mb-6 flex flex-col gap-6 pt-2"},xe={for:"signature-new-name"},et={for:"signature-new-role"},tt={for:"signature-new-purpose"},ot={class:"mb-4 text-red-500"},nt={key:1,class:"p-4"},st={class:"text-h6"};function at(e,t,l,d,h,b){const u=ne,v=oe,_=te,c=j,$=O,S=z,y=L,V=Z,R=q;return p(),I(R,{visible:e.value,"onUpdate:visible":t[6]||(t[6]=m=>e.value=m),modal:"","dismissable-mask":"",header:e.$t("outbox_page.compose.signature.modal.title"),class:"w-[600px] max-w-[75vw]"},{footer:a(()=>[o($,{text:"",label:e.$t("save"),onClick:t[5]||(t[5]=m=>e.save())},null,8,["label"])]),default:a(()=>[n("div",null,[o(_,{value:e.currentTab,"onUpdate:value":t[0]||(t[0]=m=>e.currentTab=m)},{default:a(()=>[o(v,null,{default:a(()=>[o(u,{value:"fields"},{default:a(()=>[w(s(e.$t("outbox_page.compose.signature.modal.fields.title")),1)]),_:1}),o(u,{value:"requests"},{default:a(()=>[w(s(e.$t("outbox_page.compose.signature.modal.requests.title")),1)]),_:1})]),_:1})]),_:1},8,["value"]),e.currentTab==="fields"?(p(),f("div",Je,[n("div",Ke,s(e.$t("outbox_page.compose.signature.modal.fields.subtitle")),1),(p(!0),f(T,null,P(e.fields,(m,D)=>(p(),f("div",{key:"field-"+D},[n("div",Qe,[n("div",Xe,[n("span",null,"Name: "+s(m.name),1),n("span",null,"Rolle: "+s(m.role),1),n("span",null,"Zweck: "+s(m.purpose),1)]),n("div",null,[o($,{rounded:"",text:"",size:"small",onClick:U=>e.fields.splice(D,1)},{icon:a(()=>[o(c,{name:"delete"})]),_:1},8,["onClick"])])])]))),128)),n("div",Ye,[n("h6",null,s(e.$t("outbox_page.compose.signature.modal.fields.newField")),1),o(y,{variant:"on"},{default:a(()=>[o(S,{id:"signature-new-name",modelValue:e.newName,"onUpdate:modelValue":t[1]||(t[1]=m=>e.newName=m),fluid:""},null,8,["modelValue"]),n("label",xe,s(e.$t("outbox_page.compose.signature.modal.fields.fieldName")),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o(S,{id:"signature-new-role",modelValue:e.newRole,"onUpdate:modelValue":t[2]||(t[2]=m=>e.newRole=m),fluid:""},null,8,["modelValue"]),n("label",et,s(e.$t("outbox_page.compose.signature.modal.fields.fieldRole")),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o(S,{id:"signature-new-purpose",modelValue:e.newPurpose,"onUpdate:modelValue":t[3]||(t[3]=m=>e.newPurpose=m),fluid:""},null,8,["modelValue"]),n("label",tt,s(e.$t("outbox_page.compose.signature.modal.fields.fieldPurpose")),1)]),_:1})]),n("div",ot,s(e.error),1),n("div",null,[o($,{class:"w-full",outlined:"",onClick:t[4]||(t[4]=m=>e.addField())},{default:a(()=>[w(s(e.$t("outbox_page.compose.signature.modal.fields.addField")),1)]),_:1})])])):e.currentTab==="requests"?(p(),f("div",nt,[n("div",st,s(e.t("outbox_page.compose.signature.modal.requests.subtitle")),1),n("div",null,[(p(!0),f(T,null,P(e.fields,(m,D)=>(p(),f("div",{key:"request-"+D},[n("span",null,s(m.name)+": ",1),n("span",null,[o(V,{modelValue:e.request[D],"onUpdate:modelValue":U=>e.request[D]=U,options:e.getReceiverSelection(),"option-label":"label",fluid:""},null,8,["modelValue","onUpdate:modelValue","options"])])]))),128))])])):k("",!0)])]),_:1},8,["visible","header"])}const re=B(Ze,[["render",at]]),lt=C({name:"AddressBookModal",components:{},setup(){const e=i(""),t=new K,l=new Te,d=i(1),h=i([]),b=i(0),u=i(!1);return{search:e,accountsService:t,addressBookService:l,page:d,results:h,total:b,isLoading:u}},computed:{totalPages(){return Math.ceil(this.total/25)},value:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},props:{modelValue:{type:Boolean,required:!0}},mounted(){this.searchResults()},methods:{select(e){const l={type:e.is_linked?"linked":e.entry.prefill_type,value:e,id:e.entry.id};this.$emit("select",l),this.value=!1},onPage(e){this.page=e.page+1,this.searchResults()},searchResults(){this.isLoading=!0,this.accountsService.getSelectedAccount().then(e=>{this.addressBookService.searchContacts(e!=null?e:"",this.search,this.page).then(t=>{var l,d;this.results=(l=t==null?void 0:t.results)!=null?l:[],this.total=(d=t==null?void 0:t.total)!=null?d:0,this.isLoading=!1})})}}}),it={class:"py-2"},rt={for:"address-book-search"},dt={class:"mt-4 min-h-0 flex-1 overflow-y-auto"},pt={key:0,class:"my-6 flex justify-center"},ut={class:"text-right"},mt={key:0,class:"pt-6 pb-2"};function ct(e,t,l,d,h,b){const u=z,v=L,_=Q,c=Ne,$=j,S=O,y=Ae,V=Ie,R=q;return p(),I(R,{visible:e.value,"onUpdate:visible":t[2]||(t[2]=m=>e.value=m),modal:"","dismissable-mask":"",header:e.$t("address_book_page.index.title"),class:"w-[800px] max-w-[80vw] h-[800px] max-h-[80vh]","content-class":"flex grow flex-col"},{default:a(()=>[n("div",it,[o(v,{variant:"on"},{default:a(()=>[o(u,{id:"address-book-search",modelValue:e.search,"onUpdate:modelValue":[t[0]||(t[0]=m=>e.search=m),t[1]||(t[1]=m=>{e.searchResults()})],fluid:""},null,8,["modelValue"]),n("label",rt,s(e.$t("address_book_page.index.search")),1)]),_:1})]),n("div",dt,[o(y,{value:e.results,"data-key":"entry.id"},{empty:a(()=>[e.isLoading?(p(),f("div",pt,[o(_)])):k("",!0)]),default:a(()=>[o(c,{header:e.$t("address_book_page.index.name")},{body:a(({data:m})=>[w(s(m.entry.first_name)+" "+s(m.entry.last_name),1)]),_:1},8,["header"]),o(c,{header:e.$t("address_book_page.index.birthDate")},{body:a(({data:m})=>
1[w(s(m.entry.date_of_birth),1)]),_:1},8,["header"]),o(c,{header:e.$t("address_book_page.index.email")},{body:a(({data:m})=>[w(s(m.entry.email),1)]),_:1},8,["header"]),o(c,{header:e.$t("address_book_page.index.phone")},{body:a(({data:m})=>[w(s(m.entry.phone),1)]),_:1},8,["header"]),o(c,{header:e.$t("address_book_page.index.actions")},{body:a(({data:m})=>[n("div",ut,[o(S,{text:"",rounded:"",size:"small",onClick:D=>e.select(m)},{icon:a(()=>[o($,{name:"keyboard_arrow_right"})]),_:1},8,["onClick"])])]),_:1},8,["header"])]),_:1},8,["value"])]),e.totalPages>0?(p(),f("div",mt,[o(V,{first:(e.page-1)*25,rows:25,"total-records":e.total,onPage:e.onPage},null,8,["first","total-records","onPage"])])):k("",!0)]),_:1},8,["visible","header"])}const de=B(lt,[["render",ct]]),ft=C({name:"PostDepartmentSection",emits:["select"],data(){const e=i(""),t=i([]),l=i([]),d=i(""),h=i(!1);return{companyId:e,companyOptions:t,departmentName:d,departmentOptions:l,isLoadingDepartments:h}},methods:{selectCompany(e){this.isLoadingDepartments=!0,J.getActiveDepartmentsByOwner(e).then(t=>{var l,d;t.isSuccessfulResponse()?(this.departmentOptions=(d=(l=t.data)==null?void 0:l.results)!=null?d:[],this.isLoadingDepartments=!1):this.departmentOptions=[]})},selectDepartment(e){var h,b,u,v;const t=(b=(h=this.companyOptions.find(_=>_.id===this.companyId))==null?void 0:h.name)!=null?b:"",l=(v=(u=this.departmentOptions.find(_=>_.id===e))==null?void 0:u.name)!=null?v:"",d={companyId:this.companyId,departmentId:e,name:`${t} - ${l}`};this.$emit("select",d)},filterFn(e){var l;const t=(l=e.value)!=null?l:"";if(t.length<3){this.companyOptions=[];return}J.searchByOwner(t).then(d=>{var h,b;d.isSuccessfulResponse()?this.companyOptions=(b=(h=d.data)==null?void 0:h.results)!=null?b:[]:this.companyOptions=[]})}}}),ht={class:"text-h6 mb-6"},gt={class:"px-3 py-2 text-muted-color"},vt={for:"post-department-company"},bt={class:"text-muted-color"},_t={for:"post-department-department"};function $t(e,t,l,d,h,b){const u=Z,v=L;return p(),f(T,null,[n("div",ht,s(e.$t("outbox_page.compose.receiver_modal.postDepartment.title")),1),o(v,{variant:"on"},{default:a(()=>[o(u,{id:"post-department-company",modelValue:e.companyId,"onUpdate:modelValue":[t[0]||(t[0]=_=>e.companyId=_),t[1]||(t[1]=_=>e.selectCompany(_))],filter:"","show-clear":"","option-label":"name","option-value":"id",options:e.companyOptions,fluid:"",onFilter:e.filterFn},{empty:a(()=>[n("div",gt,s(e.$t("no_results_found")),1)]),_:1},8,["modelValue","options","onFilter"]),n("label",vt,s(e.$t("outbox_page.compose.receiver_modal.postDepartment.receiver")+"*"),1)]),_:1}),n("small",bt,s(e.$t("outbox_page.compose.receiver_modal.postDepartment.receiverHints")),1),e.companyId!=null&&e.companyId.length>0?(p(),I(v,{key:0,variant:"on",class:"mt-6"},{default:a(()=>[o(u,{id:"post-department-department",modelValue:e.departmentName,"onUpdate:modelValue":[t[2]||(t[2]=_=>e.departmentName=_),t[3]||(t[3]=_=>e.selectDepartment(_))],options:e.departmentOptions,loading:e.isLoadingDepartments,disabled:e.isLoadingDepartments,"option-label":"name","option-value":"id",fluid:""},null,8,["modelValue","options","loading","disabled"]),n("label",_t,s(e.$t("outbox_page.compose.receiver_modal.postDepartment.postDepartment")+"*"),1)]),_:1})):k("",!0)],64)}const pe=B(ft,[["render",$t]]);var yt=` 2 .p-inputgroup, 3 .p-inputgroup .p-iconfield, 4 .p-inputgroup .p-floatlabel, 5 .p-inputgroup .p-iftalabel { 6 display: flex; 7 align-items: stretch; 8 width: 100%; 9 } 10 11 .p-inputgroup .p-floatlabel .p-inputwrapper, 12 .p-inputgroup .p-iftalabel .p-inputwrapper { 13 display: inline-flex; 14 } 15 16 .p-inputgroup .p-inputtext, 17 .p-inputgroup .p-inputwrapper { 18 flex: 1 1 auto; 19 width: 1%; 20 } 21 22 .p-inputgroupaddon { 23 display: flex; 24 align-items: center; 25 justify-content: center; 26 padding: dt('inputgroup.addon.padding'); 27 background: dt('inputgroup.addon.background'); 28 color: dt('inputgroup.addon.color'); 29 border-block-start: 1px solid dt('inputgroup.addon.border.color'); 30 border-block-end: 1px solid dt('inputgroup.addon.border.color'); 31 min-width: dt('inputgroup.addon.min.width'); 32 } 33 34 .p-inputgroupaddon:first-child, 35 .p-inputgroupaddon + .p-inputgroupaddon { 36 border-inline-start: 1px solid dt('inputgroup.addon.border.color'); 37 } 38 39 .p-inputgroupaddon:last-child { 40 border-inline-end: 1px solid dt('inputgroup.addon.border.color'); 41 } 42 43 .p-inputgroupaddon:has(.p-button) { 44 padding: 0; 45 overflow: hidden; 46 } 47 48 .p-inputgroupaddon .p-button { 49 border-radius: 0; 50 } 51 52 .p-inputgroup > .p-component, 53 .p-inputgroup > .p-inputwrapper > .p-component, 54 .p-inputgroup > .p-iconfield > .p-component, 55 .p-inputgroup > .p-floatlabel > .p-component, 56 .p-inputgroup > .p-floatlabel > .p-inputwrapper > .p-component, 57 .p-inputgroup > .p-iftalabel > .p-component, 58 .p-inputgroup > .p-iftalabel > .p-inputwrapper > .p-component { 59 border-radius: 0; 60 margin: 0; 61 } 62 63 .p-inputgroupaddon:first-child, 64 .p-inputgroup > .p-component:first-child, 65 .p-inputgroup > .p-inputwrapper:first-child > .p-component, 66 .p-inputgroup > .p-iconfield:first-child > .p-component, 67 .p-inputgroup > .p-floatlabel:first-child > .p-component, 68 .p-inputgroup > .p-floatlabel:first-child > .p-inputwrapper > .p-component, 69 .p-inputgroup > .p-iftalabel:first-child > .p-component, 70 .p-inputgroup > .p-iftalabel:first-child > .p-inputwrapper > .p-component { 71 border-start-start-radius: dt('inputgroup.addon.border.radiu
71s'); 72 border-end-start-radius: dt('inputgroup.addon.border.radius'); 73 } 74 75 .p-inputgroupaddon:last-child, 76 .p-inputgroup > .p-component:last-child, 77 .p-inputgroup > .p-inputwrapper:last-child > .p-component, 78 .p-inputgroup > .p-iconfield:last-child > .p-component, 79 .p-inputgroup > .p-floatlabel:last-child > .p-component, 80 .p-inputgroup > .p-floatlabel:last-child > .p-inputwrapper > .p-component, 81 .p-inputgroup > .p-iftalabel:last-child > .p-component, 82 .p-inputgroup > .p-iftalabel:last-child > .p-inputwrapper > .p-component { 83 border-start-end-radius: dt('inputgroup.addon.border.radius'); 84 border-end-end-radius: dt('inputgroup.addon.border.radius'); 85 } 86 87 .p-inputgroup .p-component:focus, 88 .p-inputgroup .p-component.p-focus, 89 .p-inputgroup .p-inputwrapper-focus, 90 .p-inputgroup .p-component:focus ~ label, 91 .p-inputgroup .p-component.p-focus ~ label, 92 .p-inputgroup .p-inputwrapper-focus ~ label, 93 .p-inputgroup .p-floatlabel .p-inputwrapper ~ label, 94 .p-inputgroup .p-iftalabel .p-inputwrapper ~ label { 95 z-index: 1; 96 } 97 98 .p-inputgroup > .p-button:not(.p-button-icon-only) { 99 width: auto; 100 } 101 102 .p-inputgroup .p-iconfield + .p-iconfield .p-inputtext { 103 border-inline-start: 0; 104 } 105`,wt={root:"p-inputgroup"},Vt=X.extend({name:"inputgroup",style:yt,classes:wt}),kt={name:"BaseInputGroup",extends:Y,style:Vt,provide:function(){return{$pcInputGroup:this,$parentInstance:this}}},ue={name:"InputGroup",extends:kt,inheritAttrs:!1};function St(e,t,l,d,h,b){return p(),f("div",ee({class:e.cx("root")},e.ptmi("root")),[x(e.$slots,"default")],16)}ue.render=St;var Dt={root:"p-inputgroupaddon"},Rt=X.extend({name:"inputgroupaddon",classes:Dt}),Ut={name:"BaseInputGroupAddon",extends:Y,style:Rt,provide:function(){return{$pcInputGroupAddon:this,$parentInstance:this}}},me={name:"InputGroupAddon",extends:Ut,inheritAttrs:!1};function It(e,t,l,d,h,b){return p(),f("div",ee({class:e.cx("root")},e.ptmi("root")),[x(e.$slots,"default")],16)}me.render=It;const At=C({name:"ReceiverModal",props:["modelValue"],emits:["update:modelValue","add"],components:{PostDepartmentSection:pe},computed:{value:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},methods:{selectPostDepartment(e){this.postDepartmentDetails={name:e.name},this.postDepartment={company_id:e.companyId,department_id:e.departmentId}},add(){if(this.valError=this.validate(this.currentReceiveTab),this.valError!=="")return;const e=this.currentReceiveTab,t=e==="email"||e==="tel",l=e==="email"||e==="tel",d=e==="birth_information",h={given_names:d?this.firstName:void 0,last_name:d?this.lastName:void 0,place_of_birth:d?this.birthplace:void 0,date_of_birth:d?this.birthdate:void 0,birth_name:d&&this.birthname.length>0?this.birthname:void 0,postal_address:d&&this.postalAddress.length>0?this.postalAddress:void 0},b={email:e==="email"?this.email:void 0,full_name:t?this.name:void 0,date_of_birth:this.birthdate===""||!l?void 0:this.birthdate,tel:e==="tel"?this.tel:void 0,ssn:e==="ssn"?this.ssn:void 0,vat_id:e==="vat_id"?`DE${this.vatId}`:void 0,birth_information:e==="birth_information"?h:void 0,post_department:e==="post_department"?this.postDepartment:void 0};this.contentService.checkReceiver(b).then(u=>{u==null?this.valError="Empfänger existiert nicht":(this.value=!1,this.$emit("add",{type:e,value:b,details:{post_department:this.postDepartmentDetails},signable:!0}),this.email="",this.tel="",this.birthdate="",this.name="",this.vatId="",this.ssn="",this.firstName="",this.lastName="",this.birthplace="",this.birthname="",this.postalAddress="",this.postDepartment={company_id:"",department_id:""},this.postDepartmentDetails={name:""},this.valError="")})},validate(e){if(e==="email"){if(!this.validateEmail(this.email))return"Ungültige Email-Adresse"}else if(e==="tel"){if(!this.validateTel(this.tel))return"Ungültige Telefonnummer"}else if(e==="vat_id"&&this.vatId.length<9)return"Ungültige Ust-ID";if(e==="tel"||e==="email"){if(!this.validateName(this.name))return"Ungültiger Name";if(!this.validateDateOfBirth(this.birthdate))return"Ungültiges Geburtsdatum"}return""},validateName(e){return e.split(" ").length>1||e.split("-").length>1},validateDateOfBirth(e){return e===""?!0:/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/.test(e)},validateEmail(e){return/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(e)},validateTel(e){return/^[+][0-9]{5,15}$/.test(e)}},mounted(){be.getInstance().then(e=>{this.svnEnabled=e.hasSentBySVNFeature(),this.ustIdEnabled=e.hasSentByUstIdFeature()})},setup(){const e=i("email"),t=i(""),l=i(""),d=i(""),h=i(""),b=i(""),u=i(""),v=i(""),_=i(""),c=i(""),$=i(""),S=i(""),y=new ae,V=i(""),R=i(!1),m=i(!1),D=i(!1),U=i({company_id:"",department_id:""}
105),N=i({name:""});return{currentReceiveTab:e,email:t,name:l,birthdate:b,tel:$,valError:S,contentService:y,vatId:_,ssn:c,firstName:d,lastName:h,birthplace:u,birthname:v,optionalBirthInformationToggled:R,postalAddress:V,svnEnabled:m,ustIdEnabled:D,postDepartment:U,postDepartmentDetails:N}}}),Nt={class:"w-full"},Tt={key:0,class:"p-4 flex flex-col gap-6"},Ct={key:1,class:"p-4 flex flex-col gap-6"},Bt={key:2,class:"p-4 flex flex-col gap-6"},Pt={class:"text-h6"},Ft={for:"receiver-email-email"},Mt={for:"receiver-email-name"},Et={for:"receiver-email-dob"},qt={key:3,class:"p-4 flex flex-col gap-6"},Lt={class:"text-h6"},Ot={for:"receiver-tel-number"},jt={for:"receiver-tel-name"},zt={for:"receiver-tel-dob"},Gt={key:4,class:"p-4 flex flex-col gap-6"},Wt={class:"text-h6"},Ht={for:"receiver-first-name"},Zt={for:"receiver-last-name"},Jt={for:"receiver-birthplace"},Kt={for:"receiver-birth-dob"},Qt={class:"flex items-center gap-3"},Xt={class:"flex flex-col"},Yt={class:"text-muted-color text-sm"},xt={class:"p-4 flex flex-col gap-6"},eo={for:"receiver-birthname"},to={for:"receiver-postal-address"},oo={class:"text-muted-color"},no={key:5,class:"p-4"},so={class:"mt-6 px-4"},ao={class:"text-red-500 pt-4"};function lo(e,t,l,d,h,b){const u=ne,v=oe,_=te,c=me,$=se,S=ue,y=L,V=z,R=j,m=De,D=Re,U=Se,N=ke,F=pe,M=O,E=q;return p(),I(E,{visible:e.value,"onUpdate:visible":t[16]||(t[16]=g=>e.value=g),modal:"","dismissable-mask":"",header:e.$t("outbox_page.compose.receiver_modal.title"),class:"dialog-window-md"},{footer:a(()=>[o(M,{text:"",label:e.$t("outbox_page.compose.receiver_modal.add"),onClick:e.add},null,8,["label","onClick"])]),default:a(()=>[n("div",Nt,[o(_,{value:e.currentReceiveTab,"onUpdate:value":t[0]||(t[0]=g=>e.currentReceiveTab=g),scrollable:""},{default:a(()=>[o(v,null,{default:a(()=>[e.ustIdEnabled?(p(),I(u,{key:0,value:"vat_id"},{default:a(()=>[...t[17]||(t[17]=[w("Ust-ID",-1)])]),_:1})):k("",!0),e.svnEnabled?(p(),I(u,{key:1,value:"ssn"},{default:a(()=>[...t[18]||(t[18]=[w("SVN",-1)])]),_:1})):k("",!0),o(u,{value:"email"},{default:a(()=>[w(s(e.$t("outbox_page.compose.receiver_modal.email.tab")),1)]),_:1}),o(u,{value:"tel"},{default:a(()=>[w(s(e.$t("outbox_page.compose.receiver_modal.tel.tab")),1)]),_:1}),o(u,{value:"birth_information"},{default:a(()=>[w(s(e.$t("outbox_page.compose.receiver_modal.idData.tab")),1)]),_:1}),o(u,{value:"post_department"},{default:a(()=>[w(s(e.$t("outbox_page.compose.receiver_modal.postDepartment.tab")),1)]),_:1})]),_:1})]),_:1},8,["value"]),e.currentReceiveTab==="vat_id"?(p(),f("div",Tt,[t[21]||(t[21]=n("div",{class:"text-h6"},"Umsatzsteuer-ID",-1)),o(y,{variant:"on"},{default:a(()=>[o(S,null,{default:a(()=>[o(c,null,{default:a(()=>[...t[19]||(t[19]=[w("DE",-1)])]),_:1}),o($,{id:"receiver-vat-id",modelValue:e.vatId,"onUpdate:modelValue":t[1]||(t[1]=g=>e.vatId=g),mask:"*********",fluid:""},null,8,["modelValue"])]),_:1}),t[20]||(t[20]=n("label",{for:"receiver-vat-id"},"UST-ID*",-1))]),_:1})])):e.currentReceiveTab==="ssn"?(p(),f("div",Ct,[t[23]||(t[23]=n("div",{class:"text-h6"},"Sozialversicherungsnummer",-1)),o(y,{variant:"on"},{default:a(()=>[o($,{id:"receiver-ssn",modelValue:e.ssn,"onUpdate:modelValue":t[2]||(t[2]=g=>e.ssn=g),mask:"************",fluid:""},null,8,["modelValue"]),t[22]||(t[22]=n("label",{for:"receiver-ssn"},"SVN*",-1))]),_:1})])):e.currentReceiveTab==="email"?(p(),f("div",Bt,[n("div",Pt,s(e.$t("outbox_page.compose.receiver_modal.email.title")),1),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-email-email",modelValue:e.email,"onUpdate:modelValue":t[3]||(t[3]=g=>e.email=g),fluid:""},null,8,["modelValue"]),n("label",Ft,s(e.$t("outbox_page.compose.receiver_modal.email.email")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-email-name",modelValue:e.name,"onUpdate:modelValue":t[4]||(t[4]=g=>e.name=g),fluid:""},null,8,["modelValue"]),n("label",Mt,s(e.$t("outbox_page.compose.receiver_modal.email.name")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o($,{id:"receiver-email-dob",modelValue:e.birthdate,"onUpdate:modelValue":t[5]||(t[5]=g=>e.birthdate=g),mask:"99/99/9999",fluid:""},null,8,["modelValue"]),n("label",Et,s(e.$t("outbox_page.compose.receiver_modal.email.dateOfBirth")),1)]),_:1})])):e.currentReceiveTab==="tel"?(p(),f("div",qt,[n("div",Lt,s(e.$t("outbox_page.compose.receiver_modal.tel.title")),1),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-tel-number",modelValue:e.tel,"onUpdate:modelValue":t[6]||(t[6]=g=>e.tel=g),fluid:""},null,8,["modelValue"]),n("label",Ot,s(e.$t("outbox_page.compose.receiver_modal.tel.number")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-tel-name",modelValue:e.name,"onUpdate:modelValue":t[7]||(t[7]=g=>e.name=g),fluid:""},null,8,["modelValue"]),n("label",jt,s(e.$t("outbox_page.compose.receiver_modal.tel.name")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o($,{id:"receiver-tel-dob",modelValue:e.birthdate,"onUpdate:modelValue":t[8]||(t[8]=g=>e.birthdate=g),mask:"99/99/9999",fluid:""},null,8,["modelValue"]),n("label",zt,s(e.$t("outbox_page.compose.receiver_modal.tel.dateOfBirth")),1)]),_:1})])):e.currentReceiveTab==="birth_information"?(p(),f("div",Gt,[n("div",Wt,s(e.$t("outbox_page.compose.receiver_modal.idData.title")),1),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-first-name",modelValue:e.firstName,"onUpdate:modelValue":t[9]||(t[9]=g=>e.firstName=g),fluid:""},null,8,["modelValue"]),n("label",Ht,s(e.$t("outbox_page.compose.receiver_modal.idData.firstName")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-last-name",modelValue:e.lastName,"onUpdate:modelValue":t[10]||(t[10]=g=>e.lastName=g),fluid:""},null,8,["modelValue"]),n("label",Zt,s(e.$t("outbox_page.compose.receiver_modal.idData.lastName")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-birthplace",modelValue:e.birthplace,"onUpdate:modelValue":t[11]||(t[11]=g=>e.birthplace=g),fluid:""},null,8,["modelValue"]),n("label",Jt,s(e.$t("outbox_page.compose.receiver_modal.idData.placeOfBirth")+"*"),1)]),_:1}),o(y,{variant:"on"},{default:a(()=>[o($,{id:"receiver-birth-dob",modelValue:e.birthdate,"onUpdate:modelValue":t[12]||(t[12]=g=>e.birthdate=g),mask:"99/99/9999",fluid:""},null,8,["modelValue"]),n("label",Kt,s(e.$t("outbox_page.compose.receiver_modal.idData.dateOfBirth")+"*"),1)]),_:1}),o(N,{class:"mt-4"},{default:a(()=>[o(U,{value:"0"},{default:a(()=>[o(m,null,{default:a(()=>[n("div",Qt,[o(R,{name:"filter_alt"}),n("div",Xt,[n("span",null,s(e.$t("outbox_page.compose.receiver_modal.idData.optionalFilter.title")),1),n("span",Yt,s(e.$t("outbox_page.compose.receiver_modal.idData.optionalFilter.subTitle")),1)])])]),_:1}),o(D,null,{default:a(()=>[n("div",xt,[w(s(e.$t("outbox_page.compose.receiver_modal.idData.optionalFilter.description"))+" ",1),o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-birthname",modelValue:e.birthname,"onUpdate:modelValue":t[13]||(t[13]=g=>e.birthname=g),fluid:""},null,8,["modelValue"]),n("label",eo,s(e.$t("outbox_page.compose.receiver_modal.idData.optionalFilter.birthName")),1)]),_:1}),n("div",null,[o(y,{variant:"on"},{default:a(()=>[o(V,{id:"receiver-postal-address",modelValue:e.postalAddress,"onUpdate:modelValue":t[14]||(t[14]=g=>e.postalAddress=g),fluid:""},null,8,["modelValue"]),n("label",to,s(e.$t("outbox_page.compose.receiver_modal.idData.optionalFilter.address")),1)]),_:1}),n("small",oo,s(e.$t("outbox_page.compose.receiver_modal.idData.optionalFilter.addressHint")),1)])])]),_:1})]),_:1})]),_:1})])):e.currentReceiveTab==="post_department"?(p(),f("div",no,[o(F,{onSelect:t[15]||(t[15]=g=>e.selectPostDepartment(g))})])):k("",!0),n("div",so," * "+s(e.$t("outbox_page.compose.receiver_modal.requiredField")),1),n("div",null,[n("div",ao,s(e.valError),1)])])]),_:1},8,["visible","header"])}const ce=B(At,[["render",lo]]),io=C({name:"ComposePage",components:{ReceiverModal:ce,VuePdfEmbed:qe,NewContentSignaturesModal:re,AddressBookModal:de,ComposeSentModal:ie},setup(){const e=_e(),t=new ae,l=new Me,d=new K,h=new Le,b=i(!0),u=i(),v=i([]),_=i(null),c=i(null),$=i(!1),S=i("letter"),y=i(""),V=i(!1),R=i(!1),m=i(!1),D=i(!1),U=i(!1),N=i(!1),F=i(!1),M=i(!1),E=i(""),g=i(""),G=i("0,00"),W=i(""),r=i(""),A=i(""),H=i([]),fe=i([]),he=i([]),ge=i([]);return{route:e,contentService:t,tenantsService:l,isLoading:b,accountsService:d,tenants:u,currentTenantId:_,tenantsOptions:v,currentValue:c,documentType:S,showReceiverDialog:$,files:H,receivers:ge,subject:A,hasSignatures:R,showNewSignaturesContentDialog:D,signatureFields:fe,signatureRequests:he,signatureService:h,hasPayment:m,paymentName:E,paymentIban:g,paymentAmount:G,paymentReference:W,paymentDueDate:r,errorMsg:y,isSending:V,showAddressBookDialog:U,sentAsRegisteredMail:N,showDocumentSentWindow:F,showPreview:M}},computed:{hasUnreachableRecipient(){return this.receivers.length>0&&this.receivers.some(e=>!e.signable)},canUseBrifleSignature(){return this.receivers.length>=1&&this.receivers.every(e=>e.signable)},paymentComplete(){return this.documentType!=="invoice"||!this.hasPayment?!0:this.paymentName!==""&&this.paymentIban.trim()!==""&&this.paymentAmount!==""&&this.paymentReference!==""&&this.paymentDueDate!==""},canSend(){return this.subject!==""&&this.receivers.length>0&&this.files.length>0&&!this.hasUnreachableRecipient&&this.paymentComplete&&!this.isSending}},watch:{canUseBrifleSignature(e){e||(this.hasSignatures=!1)}},mounted(){this.currentTenantId=this.route.query.tenant==null?null:this.route.query.tenant,this.accountsService.getSelectedAccount().then(e=>{this.tenantsService.getMyTenants(e!=null?e:"").then(t=>
105{this.tenants=t.tenants,this.tenantsOptions=t.tenants.map(l=>({id:l.id,desc:l.name})),this.tenants.forEach(l=>{l.id===this.currentTenantId&&(this.currentValue={id:l.id,desc:l.name})})}).catch(()=>{this.isLoading=!1})})},methods:{getInitials(e){return e==null||e.length===0?"":e.split(" ").filter(t=>t.length>0).slice(0,2).map(t=>t[0].toUpperCase()).join("")},changeTenant(e){this.currentTenantId=e.id,this.currentValue=e,this.$router.push(`/outbox/compose?tenant=${e.id}`)},onFileUpload(e){const t=Array.isArray(e.files)?e.files:[e.files],l=["application/pdf","image/png","image/jpeg"];t.filter(h=>l.includes(h.type)).forEach(h=>{const b=new FileReader;b.onload=()=>{var _,c,$;const v=($=((c=(_=b.result)==null?void 0:_.toString())!=null?c:"").split(";base64,")[1])!=null?$:"";this.files.push({type:h.type,name:h.name,value:v})},b.readAsDataURL(h)});const d=this.$refs.uploader;d==null||d.clear()},async addAddressBookReceiver(e){var t;switch(e.type){case"email":this.addReceiver({type:"email",value:{date_of_birth:e.value.entry.date_of_birth,email:e.value.entry.email,full_name:`${e.value.entry.first_name} ${e.value.entry.last_name}`}});break;case"tel":this.addReceiver({type:"tel",value:{date_of_birth:e.value.entry.date_of_birth,tel:e.value.entry.phone,full_name:`${e.value.entry.first_name} ${e.value.entry.last_name}`}});break;case"linked":this.addReceiver({type:"linked",value:{full_name:`${e.value.entry.first_name} ${e.value.entry.last_name}`,address_book:{id:e.id,owner:(t=await this.accountsService.getSelectedAccount())!=null?t:""}}});break}},addReceiver(e){var t,l;if(e.type==="post_department"&&(e.value.full_name=(l=(t=e.details)==null?void 0:t.post_department)==null?void 0:l.name),e.signable===!0){this.receivers.push({type:e.type,value:e.value,signable:!0});return}this.contentService.checkReceiver(e.value).then(d=>{this.receivers.push({type:e.type,value:e.value,signable:d!=null})})},saveSignaturesDialog(e){this.signatureFields=e.fields,this.signatureRequests=e.requests},sendContentWithSignatureReference(e){const t=this.files.map(l=>({type:l.type,content:l.value}));this.receivers.forEach(l=>{const d=this.signatureRequests.filter(c=>c.value===JSON.stringify(l.value)).map(c=>({signer:"receiver",field:c.fieldName,purpose:c.fieldPurpose})),h=this.signatureRequests.filter(c=>c.value==="{}").map(c=>({signer:"sender",field:c.fieldName,purpose:c.fieldPurpose})),b=d.concat(h),u=e===void 0?void 0:{signature_reference:e,requesting_signer:b},v=this.hasPayment?{details:{recipient_name:this.paymentName,iban:this.paymentIban.replace(/ /g,""),market:"DE",amount:Math.round(Number.parseFloat(this.paymentAmount.replace(",","."))*100),reference:this.paymentReference,currency:"EUR",due_date:this.paymentDueDate},payable:!0}:void 0,_=this.sentAsRegisteredMail?"aes":"none";this.contentService.sendContent(this.currentTenantId,this.subject,l.value,this.documentType,t,u,v,_).then(c=>{var $;if(!c.isErrorResponse())this.errorMsg="",this.showDocumentSentWindow=!0,setTimeout(()=>{this.$router.push("/outbox")},2e3);else{let S="Fehler beim Senden";(($=c.error)==null?void 0:$.code)===42203&&(S="IBAN ungültig"),this.errorMsg=S}}).finally(()=>{this.isSending=!1})})},send(){this.currentTenantId==null||this.isSending||!this.canSend||(this.isSending=!0,this.hasSignatures?this.signatureService.createSignatureReference(this.currentTenantId,this.signatureFields).then(e=>{this.sendContentWithSignatureReference(e==null?void 0:e.id)}):this.sendContentWithSignatureReference(void 0))},buildReceiverLabel(e){const t=e.value.date_of_birth==null||e.value.date_of_birth.length===0?"":`| ${e.value.date_of_birth}`;if(e.type==="email")return`${e.value.email} | ${e.value.full_name} ${t}`;if(e.type==="tel")return`${e.value.tel} | ${e.value.full_name} ${t}`;if(e.type==="vat_id")return`${e.value.vat_id}`;if(e.type==="ssn")return`${e.value.ssn}`;if(e.type==="birth_information"&&e.value.birth_information!=null){const l=e.value.birth_information;return`${l.given_names} ${l.last_name} | ${l.date_of_birth}`}return e.type==="linked"?`${e.value.full_name}`:e.type==="post_department"?`${e.value.full_name}`:""},buildReceiverIcon(e){return e==="email"?"alternate_email":e==="tel"?"phone":e==="vat_id"?"apartment":e==="ssn"?"contact_mail":e==="birth_information"?"person":e==="linked"?"link":e==="post_department"?"contact_mail":""},buildPdfContent(e){return Ee.buildPdfContent(e.value)}}}),ro={class:"p-4 md:p-6 max-w-[1200px] mx-auto"},po={class:"flex items-center gap-3 mb-8"},uo={class:"flex-1 min-w-0"},mo={class:"m-0"},co={class:"flex items-center gap-2 text-muted-color text-sm mt-1"},fo={class:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-start"},ho={class:"flex flex-col gap-6"},go={class:"app-card p-6"},vo={class:"pt-6"},bo={for:"subject"},_o={class:"app-card p-6"},$o={class:"flex items-center justify-between mb-4"},yo={class:"m-0"},wo={key:0,class:"status-badge bg-primary/15 text-primary"},Vo={class:"flex flex-col items-center gap-2 py-6 text-muted-color text-center"},ko={class:"text-sm"},So={key:0,class:"mt-4 flex flex-col gap-2"},Do={class:"flex-1 min-w-0 truncate"},Ro={class:"status-badge bg-primary/15 text-primary"},Uo={class:"flex flex-col gap-4"},Io={class:"app-card p-6"},Ao={class:"mt-0 mb-4"},No={class:"flex items-center gap-3"},To={class:"flex-1 min-w-0"},Co={class:"status-badge bg-primary/15 text-primary mt-2"},Bo={class:"app-card p-6"},Po={class:"flex items-center justify-between mb-4"},Fo={class:"m-0"},Mo={key:0,class:"status-badge bg-primary/15 text-primary"},Eo={key:0,class:"flex flex-col gap-2 mb-4"},qo={class:"flex-1 min-w-0 truncate"},Lo={class:"grid grid-cols-2 gap-2"},Oo={key:0,class:"app-card p-6"},jo={class:"flex items-center justify-between"},zo={class:"m-0"},Go={key:0,class:"mt-6 flex flex-col gap-6"},Wo={for:"payment-name"},Ho={for:"payment-iban"},Zo={class:"grid grid-cols-2 gap-4"},Jo={for:"payment-amount"},Ko={for:"payment-due-date"},Qo={for:"payment-reference"},Xo={class:"flex items-center gap-2 text-muted-color text-sm"},Yo={class:"app-card p-6"},xo={class:"flex items-center justify-between"},en={class:"m-0"},tn={class:"text-muted-color text-sm mt-2 mb-0"},on={key:0,class:"text-red-500 dark:text-red-400 block mt-2"},nn={key:1,class:"mt-4 flex flex-col gap-2"},sn={class:"flex-1 min-w-0"},an={class:"truncate"},ln={key:0,class:"text-muted-color text-sm truncate"},rn={class:"status-badge bg-primary/15 text-primary"},dn={key:2,class:"mt-4"},pn={class:"app-card p-6"},un={class:"flex items-center justify-between"},mn={class:"m-0"},cn=["src"];function fn(e,t,l,d,h,b){const u=j,v=O,_=Fe,c=z,$=L,S=Pe,y=Be,V=Z,R=Ce,m=ce,D=de,U=Ue,N=se,F=re,M=Q,E=we("vue-pdf-embed"),g=q,G=ie,W=ye;return p(),f("div",ro,[n("div",po,[$e((p(),I(v,{text:"",class:"text-secondary-tone bg-surface border",as:"router-link",to:"/outbox"},{icon:a(()=>[o(u,{name:"keyboard_arrow_left"})]),_:1})),[[W,e.$t("back")]]),n("div",uo,[n("h5",mo,s(e.$t("outbox_page.compose.header.title")),1),n("div",co,[t[19]||(t[19]=n("span",{class:"inline-block w-2 h-2 rounded-full bg-primary"},null,-1)),w(" "+s(e.$t("outbox_page.compose.header.draftStatus")),1)])]),o(v,{outlined:"",disabled:e.files.length===0,onClick:t[0]||(t[0]=r=>e.showPreview=!0)},{default:a(()=>[o(u,{name:"visibility",class:"mr-2"}),n("span",null,s(e.$t("outbox_page.compose.header.preview")),1)]),_:1},8,["disabled"])]),n("div",fo,[n("div",ho,[n("div",go,[o(_,{modelValue:e.documentType,"onUpdate:modelValue":t[1]||(t[1]=r=>e.documentType=r),"allow-empty":!1,"option-label":"label","option-value":"value",options:[{label:e.$t("mail_type_letter"),value:"letter"},{label:e.$t("mail_type_invoice"),value:"invoice"},{label:e.$t("mail_type_contract"),value:"contract"}]},null,8,["modelValue","options"]),n("div",vo,[o($,{variant:"on"},{default:a(()=>[o(c,{id:"subject",modelValue:e.subject,"onUpdate:modelValue":t[2]||(t[2]=r=>e.subject=r),fluid:""},null,8,["modelValue"]),n("label",bo,s(e.$t("outbox_page.compose.subject")),1)]),_:1})])]),n("div",_o,[n("div",$o,[n("h6",yo,s(e.$t("outbox_page.compose.content.title")),1),e.files.length?(p(),f("span",wo,s(e.files.length),1)):k("",!0)]),o(S,{ref:"uploader","custom-upload":"",auto:"",multiple:"",accept:"application/pdf,image/png,image/jpeg","max-file-size":20971520,"show-upload-button":!1,"show-cancel-button":!1,onUploader:e.onFileUpload},{empty:a(()=>[n("div",Vo,[o(u,{name:"cloud_upload",size:"32px"}),n("div",null,s(e.$t("outbox_page.compose.content.dropHere")),1),n("div",ko,s(e.$t("outbox_page.compose.content.allowedTypes")),1)])]),_:1},8,["onUploader"]),e.files.length?(p(),f("div",So,[(p(!0),f(T,null,P(e.files,(r,A)=>(p(),f("div",{key:"file"+A,class:"flex items-center gap-3 p-3 border-rounded border"},[o(u,{name:"description"}
105),n("span",Do,s(r.name),1),n("span",Ro,[o(u,{name:"check_circle",size:"14px"}),w(" "+s(e.$t("outbox_page.compose.content.statusReady")),1)]),o(v,{text:"",rounded:"",size:"small",onClick:H=>e.files.splice(A,1)},{icon:a(()=>[o(u,{name:"delete"})]),_:1},8,["onClick"])]))),128))])):k("",!0)])]),n("div",Uo,[n("div",Io,[n("h6",Ao,s(e.$t("outbox_page.compose.sender")),1),n("div",No,[o(y,{label:e.getInitials(e.currentValue&&e.currentValue.desc),shape:"circle"},null,8,["label"]),n("div",To,[o(V,{"model-value":e.currentValue,"onUpdate:modelValue":e.changeTenant,"option-label":r=>Object(r)===r&&"desc"in r?r.desc:"- Null -",options:e.tenantsOptions,fluid:""},null,8,["model-value","onUpdate:modelValue","option-label","options"]),n("span",Co,[o(u,{name:"verified",size:"14px"}),w(" "+s(e.$t("outbox_page.compose.sender_verified")),1)])])])]),n("div",Bo,[n("div",Po,[n("h6",Fo,s(e.$t("outbox_page.compose.recipient.title")),1),e.receivers.length?(p(),f("span",Mo,s(e.receivers.length),1)):k("",!0)]),e.receivers.length?(p(),f("div",Eo,[(p(!0),f(T,null,P(e.receivers,(r,A)=>(p(),f("div",{key:"receiver"+A,class:Ve(["flex items-center gap-3 p-3 border-rounded border",r.signable?"":"border-red-400"])},[o(u,{name:e.buildReceiverIcon(r.type)},null,8,["name"]),n("span",qo,s(e.buildReceiverLabel(r)),1),o(v,{text:"",rounded:"",size:"small",onClick:H=>e.receivers.splice(A,1)},{icon:a(()=>[o(u,{name:"delete"})]),_:1},8,["onClick"])],2))),128))])):k("",!0),e.hasUnreachableRecipient?(p(),I(R,{key:1,severity:"warn",closable:!1,class:"mb-4"},{default:a(()=>[w(s(e.$t("outbox_page.compose.recipient.unreachableWarning")),1)]),_:1})):k("",!0),n("div",Lo,[o(v,{outlined:"",class:"accent-bordered-radius",onClick:t[3]||(t[3]=r=>e.showReceiverDialog=!0)},{default:a(()=>[w(s(e.$t("outbox_page.compose.recipient.addNew")),1)]),_:1}),o(v,{outlined:"",severity:"secondary",class:"accent-bordered-radius",onClick:t[4]||(t[4]=r=>e.showAddressBookDialog=!0)},{default:a(()=>[w(s(e.$t("outbox_page.compose.recipient.fromAddressBook")),1)]),_:1})]),o(m,{modelValue:e.showReceiverDialog,"onUpdate:modelValue":t[5]||(t[5]=r=>e.showReceiverDialog=r),onAdd:e.addReceiver},null,8,["modelValue","onAdd"]),o(D,{modelValue:e.showAddressBookDialog,"onUpdate:modelValue":t[6]||(t[6]=r=>e.showAddressBookDialog=r),onSelect:e.addAddressBookReceiver},null,8,["modelValue","onSelect"])]),e.documentType==="invoice"?(p(),f("div",Oo,[n("div",jo,[n("h6",zo,s(e.$t("outbox_page.compose.payment.attachTitle")),1),o(U,{modelValue:e.hasPayment,"onUpdate:modelValue":t[7]||(t[7]=r=>e.hasPayment=r)},null,8,["modelValue"])]),e.hasPayment?(p(),f("div",Go,[o($,{variant:"on"},{default:a(()=>[o(c,{id:"payment-name",modelValue:e.paymentName,"onUpdate:modelValue":t[8]||(t[8]=r=>e.paymentName=r),fluid:""},null,8,["modelValue"]),n("label",Wo,s(e.$t("outbox_page.compose.payment.modal.paymentReceiver")),1)]),_:1}),o($,{variant:"on"},{default:a(()=>[o(N,{id:"payment-iban",modelValue:e.paymentIban,"onUpdate:modelValue":t[9]||(t[9]=r=>e.paymentIban=r),mask:"aa99 9999 9999 9999 9999 99",fluid:""},null,8,["modelValue"]),n("label",Ho,s(e.$t("outbox_page.compose.payment.modal.iban")),1)]),_:1}),n("div",Zo,[o($,{variant:"on"},{default:a(()=>[o(c,{id:"payment-amount",modelValue:e.paymentAmount,"onUpdate:modelValue":t[10]||(t[10]=r=>e.paymentAmount=r),fluid:""},null,8,["modelValue"]),n("label",Jo,s(e.$t("outbox_page.compose.payment.modal.amountInEuro")),1)]),_:1}),o($,{variant:"on"},{default:a(()=>[o(N,{id:"payment-due-date",modelValue:e.paymentDueDate,"onUpdate:modelValue":t[11]||(t[11]=r=>e.paymentDueDate=r),mask:"9999/99/99",fluid:""},null,8,["modelValue"]),n("label",Ko,s(e.$t("outbox_page.compose.payment.modal.dueDate")),1)]),_:1})]),o($,{variant:"on"},{default:a(()=>[o(c,{id:"payment-reference",modelValue:e.paymentReference,"onUpdate:modelValue":t[12]||(t[12]=r=>e.paymentReference=r),fluid:""},null,8,["modelValue"]),n("label",Qo,s(e.$t("outbox_page.compose.payment.modal.reference")),1)]),_:1}),n("div",Xo,[o(u,{name:"qr_code_2",size:"16px"}),w(" "+s(e.$t("outbox_page.compose.payment.qrHint")),1)])])):k("",!0)])):k("",!0),n("div",Yo,[n("div",xo,[n("h6",en,s(e.$t("outbox_page.compose.signature.title")),1),o(U,{modelValue:e.hasSignatures,"onUpdate:modelValue":t[13]||(t[13]=r=>e.hasSignatures=r),disabled:!e.canUseBrifleSignature},null,8,["modelValue","disabled"])]),n("p",tn,s(e.$t("outbox_page.compose.signature.subtitle")),1),e.canUseBrifleSignature?k("",!0):(p(),f("small",on,s(e.$t("outbox_page.compose.signature.disabledNote")),1)),e.hasSignatures&&e.signatureFields.length?(p(),f("div",nn,[(p(!0),f(T,null,P(e.signatureFields,(r,A)=>(p(),f("div",{key:"sig"+A,class:"flex items-center gap-3 p-3 border-rounded border"},[o(u,{name:"draw"}),n("div",sn,[n("div",an,s(r.name),1),r.purpose?(p(),f("div",ln,s(r.purpose),1)):k("",!0)]),n("span",rn,[o(u,{name:"smartphone",size:"14px"}),w(" "+s(e.$t("outbox_page.compose.signature.mobileType")),1)])]))),128))])):k("",!0),e.hasSignatures?(p(),f("div",dn,[o(v,{outlined:"",severity:"secondary",class:"accent-bordered-radius",onClick:t[14]||(t[14]=r=>e.showNewSignaturesContentDialog=!0)},{default:a(()=>[w(s(e.$t("outbox_page.compose.signature.signatureSettings")),1)]),_:1})])):k("",!0),o(F,{modelValue:e.showNewSignaturesContentDialog,"onUpdate:modelValue":t[15]||(t[15]=r=>e.showNewSignaturesContentDialog=r),receivers:e.receivers,onSave:e.saveSignaturesDialog},null,8,["modelValue","receivers","onSave"])]),n("div",pn,[n("div",un,[n("h6",mn,s(e.$t("outbox_page.compose.as_registered_mail.title")),1),o(U,{modelValue:e.sentAsRegisteredMail,"onUpdate:modelValue":t[16]||(t[16]=r=>e.sentAsRegisteredMail=r)},null,8,["modelValue"])])]),n("div",null,[e.errorMsg?(p(),I(R,{key:0,severity:"error",closable:!1,class:"mb-3"},{default:a(()=>
105[w(s(e.errorMsg),1)]),_:1})):k("",!0),e.isSending?(p(),I(v,{key:2,class:"w-full",size:"large",disabled:""},{default:a(()=>[o(M,{color:"secondary",size:"28px"})]),_:1})):(p(),I(v,{key:1,class:"w-full",size:"large",disabled:!e.canSend,onClick:e.send},{default:a(()=>[o(u,{name:"lock",class:"mr-2"}),n("span",null,s(e.$t("outbox_page.compose.secureSend")),1)]),_:1},8,["disabled","onClick"]))])])]),o(g,{visible:e.showPreview,"onUpdate:visible":t[17]||(t[17]=r=>e.showPreview=r),modal:"","dismissable-mask":"",header:e.$t("outbox_page.compose.header.preview"),class:"dialog-window-lg"},{default:a(()=>[(p(!0),f(T,null,P(e.files,(r,A)=>(p(),f("div",{key:"file-content"+A},[r.type==="application/pdf"?(p(),I(E,{key:0,source:e.buildPdfContent(r)},null,8,["source"])):(p(),f("img",{key:1,src:`data:${r.type};base64,${r.value}`,class:"max-w-full border-rounded mb-5"},null,8,cn))]))),128))]),_:1},8,["visible","header"]),o(G,{modelValue:e.showDocumentSentWindow,"onUpdate:modelValue":t[18]||(t[18]=r=>e.showDocumentSentWindow=r)},null,8,["modelValue"])])}const Gn=B(io,[["render",fn]]);export{Gn 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.