var c=(p,o,r)=>new Promise((n,s)=>{var i=e=>{try{t(r.next(e))}catch(m){s(m)}},d=e=>{try{t(r.throw(e))}catch(m){s(m)}},t=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,d);t((r=r.apply(p,o)).next())});import{u}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"./tms-orders-Bsi6LVLz.js";import{_ as w}from"./order-form.vue_vue_type_script_setup_true_lang-COv7Yipk.js";import{a1 as b,ai as x,aj as S,ak as h,p as D,a9 as a}from"../jse/index-index-BUJ_4tQs.js";const A=b({__name:"order-edit-drawer",setup(p){const o=_(),r=l(),{Drawer:n,entity:s,formRef:i,handleSubmit:d}=u({getDetailApi:t=>c(null,null,function*(){const e=yield o.getDetail(t);if(!e)throw new Error("Order not found");return e}),updateApi:(t,e)=>c(null,null,function*(){return o.update(t,e)}),invalidateData:()=>r.invalidateTmsOrders(),title:f("page.tms.orders.drawer.editTitle"),idKey:"orderId"});return(t,e)=>(S(),x(a(n),{class:"w-[520px]","confirm-text":a(f)("page.table.button.save"),"cancel-text":a(f)("page.table.button.cancel")},{default:h(()=>[D(w,{ref_key:"formRef",ref:i,order:a(s),mode:"edit",onSubmit:a(d)},null,8,["order","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{A as _};
