var f=(u,i,a)=>new Promise((n,r)=>{var s=e=>{try{t(a.next(e))}catch(m){r(m)}},c=e=>{try{t(a.throw(e))}catch(m){r(m)}},t=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,c);t((a=a.apply(u,i)).next())});import{u as d}from"./useEditDrawer-JG4PTzvo.js";import{b6 as p}from"./bootstrap-Bqxdt4iG.js";import{u as l}from"./data-refresh-BZ1_-6mk.js";import{u as _}from"./invoices-BFW1CUIx.js";import{_ as v}from"./invoice-form.vue_vue_type_script_setup_true_lang-B0Z18z_z.js";import{a1 as w,ai as b,aj as x,ak as S,p as h,a9 as o}from"../jse/index-index-BUJ_4tQs.js";const B=w({__name:"invoice-edit-drawer",setup(u){const i=_(),a=l(),{Drawer:n,entity:r,formRef:s,handleSubmit:c}=d({getDetailApi:t=>f(null,null,function*(){const e=yield i.getDetail(t);if(!e)throw new Error("Invoice not found");return e}),updateApi:(t,e)=>f(null,null,function*(){return i.update(t,e)}),invalidateData:()=>a.invalidateInvoices(),title:p("page.invoices.drawer.editTitle"),idKey:"invoiceId"});return(t,e)=>(x(),b(o(n),{class:"w-[640px]","confirm-text":o(p)("page.table.button.save"),"cancel-text":o(p)("page.table.button.cancel")},{default:S(()=>[h(v,{ref_key:"formRef",ref:s,invoice:o(r),mode:"edit",onSubmit:o(c)},null,8,["invoice","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{B as _};
