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