1import{ae as S,b as y,x as C,u as I,A as d,E as v,B as n,D as s,a8 as L,S as p,T as x,F as e,U as _,at as f,R as h,C as N,z as a}from"./index-fwKwfetg.js";import{o as w,t as O,H as k,s as P}from"./vite.helpers-DRDfEBY5.js";import{_ as R}from"./ImageUpload--xLJ-txk.js";import{v as c}from"./usePrecognition-BN_HyqPn.js";import"./_plugin-vue_export-helper-1Fh_g1AI.js";try{let b=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new b.Error().stack;r&&(b._sentryDebugIds=b._sentryDebugIds||{},b._sentryDebugIds[r]="73409574-0b98-46fe-9dbd-31ac989085b9",b._sentryDebugIdIdentifier="sentry-dbid-73409574-0b98-46fe-9dbd-31ac989085b9")}catch{}const E={class:"relative"},M={class:"px-2 md:px-5 pt-8 md:pt-12 pb-20 2xl:px-[8%]"},q={class:"mx-auto max-w-[800px]"},F={class:"flex flex-col md:flex-row gap-3 items-center md:items-baseline justify-between mb-7"},H={class:"flex gap-3"},J={class:"text-lg md:text-[24px] font-extrabold text-[#3d4146]"},K={class:"mb-7 rounded-[10px] bg-white p-4 md:p-[30px] shadow-[0px_6px_19px_0px_rgb(182,182,182,0.35)]"},X=["textContent"],G=["textContent"],Q={class:"relative flex flex-col gap-3"},W=["textContent"],Y=["textContent"],Z=["textContent"],ee={class:"flex flex-row gap-3"},te={class:"w-full"},ne=["textContent"],ie=["textContent"],oe={class:"lg:w-2/5"},se=["textContent"],le=["textContent"],re={class:"flex flex-row gap-3"},de={class:"w-full lg:w-1/2"},ae=["textContent"],_e=["textContent"],ue={class:"w-full lg:w-1/2"},pe=["textContent"],ce=["textContent"],xe=["textContent"],be=["textContent"],ge=["textContent"],ve=["textContent"],me=["textContent"],fe=["textContent"],ye=["textContent"],Ce=["textContent"],he=["textContent"],we=["textContent"],ke=["textContent"],$e=["textContent"],Ve=["textContent"],Ue=["textContent"],Be=["textContent"],ze={class:"mb-7 rounded-[10px] bg-white p-4 md:p-[30px] shadow-[0px_6px_19px_0px_rgb(182,182,182,0.35)]"},je=["textContent"],De=["textContent"],Ae={class:"relative flex flex-col gap-3"},Te=["textContent"],Se=["textContent"],Ie={key:0},Le=["textContent"],Ne={class:"flex gap-4 mt-1"},Oe={class:"flex items-center gap-2 cursor-pointer"},Pe=["textContent"],Re={class:"flex items-center gap-2 cursor-pointer"},Ee=["textContent"],Me={class:"flex items-center gap-2 cursor-pointer"},qe=["textContent"],Fe={class:"mt-2 flex items-center gap-3"},He=["disabled"],Je={key:0,class:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Ke=["textContent"],Xe={class:"mb-7 rounded-[10px] bg-white p-4 md:p-[30px] shadow-[0px_6px_19px_0px_rgb(182,182,182,0.35)]"},Ge=["textContent"],Qe=["textContent"],We={class:"relative flex flex-col gap-3"},Ye={class:"flex flex-row gap-3"},Ze={class:"w-full lg:w-1/2"},et=["textContent"],tt=["textContent"],nt=["textContent"],it={class:"w-full lg:w-1/2"},ot=["textContent"],st=["textContent"],lt=["textContent"],rt={class:"flex flex-col md:flex-row md:items-center md:justify-end gap-10 md:gap-5 pt-10"},dt={key:0,class:"flex items-center justify-between md:justify-end gap-5"},at=["textContent"],_t=["disabled","textContent"],gt={__name:"Invoicing",props:{event:{type:Object,required:!0},countries:{type:Array,required:!0},invoiceLogo:{type:[Array,Object],default:()=>[]}},setup(b){const r=b,t=S({billing_company_name:r.event.settings.billing_company_name,billing_address_street:r.event.settings.billing_address_street,billing_address_number:r.event.settings.billing_address_number,billing_address_zip:r.event.settings.billing_address_zip,billing_address_city:r.event.settings.billing_address_city,billing_address_country:r.event.settings.billing_address_country,billing_address_vat_number:r.event.settings.billing_address_vat_number,order_prefix:r.event.settings.order_prefix,invoice_prefix:r.event.settings.invoice_prefix,billing_default_vat:r.event.settings.billing_default_vat,billing_currency:r.event.settings.billing_currency,invoice_logo_position:r.event.settings.invoice_logo_position??"top-left",bank_transfer_due_days:r.event.settings.bank_transfer_due_days??14,invoice_logo:r.invoiceLogo}),m=y(!1),g=y(!1),$=C(()=>t.invoice_logo?Array.isArray(t.invoice_logo)?t.invoice_logo.length>0:Object.keys(t.invoice_logo).length>0:!1),V=o=>{o&&o.uuid?t.invoice_logo={[o.uuid]:o}:t.invoice_logo=[]},U=o=>{m.value=o}
1,B=w("events.settings.invoicing.preview",{event:r.event.id}),z=()=>{var i;if(!t.invoice_logo||Array.isArray(t.invoice_logo)&&t.invoice_logo.length===0)return"__none__";const o=Object.values(t.invoice_logo);return o.length===0?"__none__":((i=o[0])==null?void 0:i.uuid)??"__none__"},j=async()=>{var o;g.value=!0;try{const i=(o=document.head.querySelector("meta[name='csrf-token']"))==null?void 0:o.getAttribute("content"),l=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":i},body:JSON.stringify({invoice_logo:z(),invoice_logo_position:t.invoice_logo_position})});if(!l.ok)throw new Error("Preview generation failed");const T=await l.json();window.open(T.url,"_blank")}catch{}finally{g.value=!1}},D=C(()=>I().props.currencies.map(o=>({label:o.englishName+" ("+o.alphabeticCode+")",value:o.alphabeticCode}))),u=w("events.settings.invoicing.update",{event:r.event.id}),A=()=>{t.transform(o=>(o.billing_default_vat=o.billing_default_vat.toString().replace(",","."),o)),t.post(u)};return(o,i)=>(a(),d("div",E,[v(O,{title:o.$t("common.invoicing")},null,8,["title"]),n("div",M,[n("div",q,[n("div",F,[n("div",H,[n("h1",J,s(o.$t("common.invoicing")),1)])]),n("form",{novalidate:"",onSubmit:L(A,["prevent"])},[n("div",K,[n("h2",{class:"block font-semibold mb-2",textContent:s(o.$t("event.settings.invoicing.company-information"))},null,8,X),n("div",{class:"mb-5",textContent:s(o.$t("event.settings.invoicing.company-information.description"))},null,8,G),n("div",Q,[n("div",null,[n("label",{for:"billing_company_name",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_company_name"))},null,8,W),p(n("input",{id:"billing_company_name","onUpdate:modelValue":i[0]||(i[0]=l=>e(t).billing_company_name=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[1]||(i[1]=()=>e(c)("billing_company_name",e(t),e(u)))},null,544),[[x,e(t).billing_company_name]]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.billing_company_name.description"))},null,8,Y),e(t).errors.billing_company_name?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_company_name)},null,8,Z)):_("",!0)]),n("div",ee,[n("div",te,[n("label",{for:"billing_address_street",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_address_street"))},null,8,ne),p(n("input",{id:"billing_address_street","onUpdate:modelValue":i[2]||(i[2]=l=>e(t).billing_address_street=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[3]||(i[3]=()=>e(c)("billing_address_street",e(t),e(u)))},null,544),[[x,e(t).billing_address_street]]),e(t).errors.billing_address_street?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_address_street)},null,8,ie)):_("",!0)]),n("div",oe,[n("label",{for:"billing_address_number",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_address_number"))},null,8,se),p(n("input",{id:"billing_address_number","onUpdate:modelValue":i[4]||(i[4]=l=>e(t).billing_address_number=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[5]||(i[5]=()=>e(c)("billing_address_number",e(t),e(u)))},null,544),[[x,e(t).billing_address_number]]),e(t).errors.billing_address_number?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_address_number)},null,8,le)):_("",!0)])]),n("div",re,[n("div",de,[n("label",{for:"billing_address_zip",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_address_zip"))},null,8,ae),p(n("input",{id:"billing_address_zip","onUpdate:modelValue":i[6]||(i[6]=l=>e(t).billing_address_zip=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[7]||(i[7]=()=>e(c)("billing_address_zip",e(t),e(u)))},null,544),[[x,e(t).billing_address_zip]]),e(t).errors.billing_address_zip?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_address_zip)},null,8,_e)):_("",!0)]),n("div",ue,[n("label",{for:"billing_address_city",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_address_city"))},null,8,pe),p(n("input",{id:"billing_address_city","onUpdate:modelValue":i[8]||(i[8]=l=>e(t).billing_address_city=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[9]||(i[9]=()=>e(c)("billing_address_city",e(t),e(u)))},null,544),[[x,e(t).billing_address_city]]),e(t).errors.billing_address_city?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_address_city)},null,8,ce)):_("",!0)])]),n("div",null,[n("label",{for:"billing_address_country",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_address_country"))},null,8,xe),v(k,{modelValue:e(t).billing_address_country,"onUpdate:modelValue":i[10]||(i[10]=l=>e(t).billing_address_country=l),items:b.countries,"show-search":"",optional:"","btn-class":"border-[#ced4da] focus:border-[#a944b3cc]","key-label":"label","key-value":"id",onChange:i[11]||(i[11]=()=>e(c)("billing_address_country",e(t),e(u)))},null,8,["modelValue","items"]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.billing_address_country.description"))},null,8,be),e(t).errors.billing_address_country?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_address_country)},null,8,ge)):_("",!0)]),n("div",null,[n("label",{for:"billing_address_vat_number",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_address_vat_number"))},null,8,ve),p(n("input",{id:"billing_address_vat_number","onUpdate:modelValue":i[12]||(i[12]=l=>e(t).billing_address_vat_number=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[13]||(i[13]=()=>e(c)("billing_address_vat_number",e(t),e(u)))},null,544),[[x,e(t).billing_address_vat_number]]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.billing_address_vat_number.description"))},null,8,me),e(t).errors.billing_address_vat_number?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_address_vat_number)},null,8,fe)):_("",!0)]),n("div",null,[n("label",{for:"invoice_prefix",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.invoice_prefix"))},null,8,ye),p(n("input",{id:"invoice_prefix","onUpdate:modelValue":i[14]||(i[14]=l=>e(t).invoice_prefix=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[15]||(i[15]=()=>e(c)("invoice_prefix",e(t),e(u)))},null,544),[[x,e(t).invoice_prefix]]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.invoice_prefix.description"))},null,8,Ce),e(t).errors.invoice_prefix?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.invoice_prefix)},null,8,he)):_("",!0)]),n("div",null,[n("label",{for:"bank_transfer_due_days",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.bank_transfer_due_days.label"))},null,8,we),p(n("input",{id:"bank_transfer_due_days","onUpdate:modelValue":i[16]||(i[16]=l=>e(t).bank_transfer_due_days=l),type:"number",min:"0",max:"999",class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[17]||(i[17]=()=>e(c)("bank_transfer_due_days",e(t),e(u)))},null,544),[[x,e(t).bank_transfer_due_days,void 0,{number:!0}]]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.bank_transfer_due_days.help"))},null,8,ke),e(t).errors.bank_transfer_due_days?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.bank_transfer_due_days)},null,8,$e)):_("",!0)]),n("div",null,[n("label",{for:"order_prefix",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.order_prefix"))},null,8,Ve),p(n("input",{id:"order_prefix","onUpdate:modelValue":i[18]||(i[18]=l=>e(t).order_prefix=l),class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[19]||(i[19]=()=>e(c)("order_prefix",e(t),e(u)))},null,544),[[x,e(t).order_prefix]]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.order_prefix.description"))},null,8,Ue),e(t).errors.order_prefix?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.order_prefix)},null,8,Be)):_("",!0)])])]),n("div",ze,[n("h2",{class:"block font-semibold mb-2",textContent:s(o.$t("event.settings.invoicing.invoice-branding"))},null,8,je),n("div",{class:"mb-5",textContent:s(o.$t("event.settings.invoicing.invoice-branding.description"))},null,8,De),n("div",Ae,[n("div",null,[n("label",{class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.invoice_logo"))},null,8,Te),v(R,{"initial-value":e(t).invoice_logo,"input-name":"invoice_logo",accept:["image/svg+xml"],onChanged:V,onUploadInProgress:U},null,8,["initial-value"]),n("small",{class:"block text-[10px] mt-1",textContent:s(o.$t("event.settings.invoicing.invoice_logo.hint"))},null,8,Se)]),$.value?(a(),d("div",Ie,[n("label",{class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.invoice_logo_position"))},null,8,Le),n("div",Ne,[n("label",Oe,[p(n("input",{"onUpdate:modelValue":i[20]||(i[20]=l=>e(t).invoice_logo_position=l),type:"radio",value:"top-left",class:"accent-[#a944b3]"},null,512),[[f,e(t).invoice_logo_position]]),n("span",{class:"text-[13px] text-[#3d4146]",textContent:s(o.$t("event.settings.invoicing.logo_position.top_left"))},null,8,Pe)]),n("label",Re,[p(n("input",{"onUpdate:modelValue":i[21]||(i[21]=l=>e(t).invoice_logo_position=l),type:"radio",value:"top-center",class:"accent-[#a944b3]"},null,512),[[f,e(t).invoice_logo_position]]),n("span",{class:"text-[13px] text-[#3d4146]",textContent:s(o.$t("event.settings.invoicing.logo_position.top_center"))},null,8,Ee)]),n("label",Me,[p(n("input",{"onUpdate:modelValue":i[22]||(i[22]=l=>e(t).invoice_logo_position=l),type:"radio",value:"top-right",class:"accent-[#a944b3]"},null,512),[[f,e(t).invoice_logo_position]]),n("span",{class:"text-[13px] text-[#3d4146]",textContent:s(o.$t("event.settings.invoicing.logo_position.top_right"))},null,8,qe)])])])):_("",!0),n("div",Fe,[n("button",{type:"button",class:h(["flex h-[35px] w-max items-center gap-2 rounded-[5px] border border-[#ced4da] px-[15px] text-[13px] text-[#3d4146] outline-none hover:bg-gray-50",{"opacity-50 cursor-not-allowed":g.value}]),disabled:g.value,onClick:j},[g.value?(a(),d("svg",Je,[...i[28]||(i[28]=[n("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):_("",!0),N(" "+s(o.$t("event.settings.invoicing.preview_invoice")),1)],10,He),e(t).isDirty?(a(),d("small",{key:0,class:"text-[11px] text-[#f59e0b]",textContent:s(o.$t("event.settings.invoicing.preview_unsaved_warning"))},null,8,Ke)):_("",!0)])])]),n("div",Xe,[n("h2",{class:"block font-semibold mb-2",textContent:s(o.$t("event.settings.invoicing.tax-information"))},null,8,Ge),n("div",{class:"mb-5",textContent:s(o.$t("event.settings.invoicing.tax-information.description"))},null,8,Qe),n("div",We,[n("div",Ye,[n("div",Ze,[n("label",{for:"billing_default_vat",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_default_vat"))},null,8,et),p(n("input",{id:"billing_default_vat","onUpdate:modelValue":i[23]||(i[23]=l=>e(t).billing_default_vat=l),type:"number",class:"w-full rounded border border-[#ced4da] pl-[7px] py-[7px] text-[13px] text-[#3d4146] outline-none focus:border-[#a944b3cc]",onBlur:i[24]||(i[24]=()=>e(c)("billing_default_vat",e(t),e(u)))},null,544),[[x,e(t).billing_default_vat]]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.billing_default_vat.description"))},null,8,tt),e(t).errors.billing_default_vat?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_default_vat)},null,8,nt)):_("",!0)]),n("div",it,[n("label",{for:"billing_currency",class:"text-[13px] font-semibold text-[#3d4146] mb-2",textContent:s(o.$t("event.settings.invoicing.billing_currency"))},null,8,ot),v(k,{id:"event.settings.payments.billing_currency",modelValue:e(t).billing_currency,"onUpdate:modelValue":i[25]||(i[25]=l=>e(t).billing_currency=l),items:D.value,"key-label":"label","key-value":"value","show-search":"",disabled:"","btn-class":{"w-full rounded border border-[#e0e0e0] p-[7.5px_15px] text-[13px] text-[#3d4146] outline-none outline-none":!0,"border-[#ff9700]":e(t).errors.billing_currency},onChange:i[26]||(i[26]=l=>e(c)("billing_currency",e(t),e(u)))},null,8,["modelValue","items","btn-class"]),n("small",{class:"block text-[10px]",textContent:s(o.$t("event.settings.invoicing.billing_currency.description"))},null,8,st),e(t).errors.billing_currency?(a(),d("small",{key:0,class:"block text-[10px] text-red-500 subpixel-antialiased",textContent:s(e(t).errors.billing_currency)}
1,null,8,lt)):_("",!0)])])])]),n("div",rt,[e(P)("event:setting:update")?(a(),d("div",dt,[n("button",{type:"button",class:"flex h-[35px] w-max min-w-[70px] items-center gap-2 rounded-[5px] px-[10px] text-[13px] text-[#e01249] outline-none",onClick:i[27]||(i[27]=l=>e(t).reset()),textContent:s(o.$t("common.discard_changes"))},null,8,at),n("button",{type:"submit",disabled:e(t).processing||!e(t).isDirty||m.value,class:h([e(t).processing||!e(t).isDirty||m.value?"cursor-not-allowed opacity-50":"","flex h-[35px] w-max min-w-[70px] items-center gap-2 rounded-[5px] bg-primary px-[25px] text-[13px] text-white outline-none"]),textContent:s(o.$t("common.save"))},null,10,_t)])):_("",!0)])],32)])])]))}};export{gt as default}; 2//# sourceMappingURL=Invoicing-C5tGtIDF.js.map
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.