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