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