var p=(f,s,r)=>new Promise((i,o)=>{var n=e=>{try{t(r.next(e))}catch(m){o(m)}},u=e=>{try{t(r.throw(e))}catch(m){o(m)}},t=e=>e.done?i(e.value):Promise.resolve(e.value).then(n,u);t((r=r.apply(f,s)).next())});import{u as d}from"./useEditDrawer-JG4PTzvo.js";import{b6 as c}from"./bootstrap-Bqxdt4iG.js";import{u as l}from"./data-refresh-BZ1_-6mk.js";import{u as _}from"./users-CtrZlEEf.js";import{_ as w}from"./wms-user-form.vue_vue_type_script_setup_true_lang-BaO4QUb_.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 B=b({__name:"wms-user-edit-drawer",setup(f){const s=_(),r=l(),{Drawer:i,entity:o,formRef:n,handleSubmit:u}=d({getDetailApi:t=>p(null,null,function*(){const e=yield s.getDetail(t);if(!e)throw new Error("User not found");return e}),updateApi:(t,e)=>s.update(t,e),invalidateData:()=>{r.invalidateUsers()},title:c("page.wmsUsers.drawer.editTitle"),idKey:"userId"});return(t,e)=>(S(),x(a(i),{class:"w-[640px]","confirm-text":a(c)("page.table.button.save"),"cancel-text":a(c)("page.table.button.cancel")},{default:h(()=>[D(w,{ref_key:"formRef",ref:n,user:a(o),mode:"edit",onSubmit:a(u)},null,8,["user","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{B as _};
