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