var m=(f,c,t)=>new Promise((o,r)=>{var n=a=>{try{e(t.next(a))}catch(u){r(u)}},i=a=>{try{e(t.throw(a))}catch(u){r(u)}},e=a=>a.done?o(a.value):Promise.resolve(a.value).then(n,i);e((t=t.apply(f,c)).next())});import{u as p}from"./useCreateDrawer-JEzOVO6Z.js";import{cd as d,b6 as l}from"./bootstrap-Bqxdt4iG.js";import{u as _}from"./data-refresh-BZ1_-6mk.js";import{_ as h}from"./location-form.vue_vue_type_script_setup_true_lang-XDTShwY0.js";import{a1 as b,L as w,ai as x,aj as S,ak as v,p as D,a9 as s}from"../jse/index-index-BUJ_4tQs.js";const W=b({__name:"location-create-drawer",setup(f){const c=d(),t=_(),o=w(""),{Drawer:r,formRef:n,handleSubmit:i}=p({createApi:e=>m(null,null,function*(){return c.create(e)}),invalidateData:()=>t.invalidateLocations(),title:l("page.locations.drawer.createTitle"),processOpenData:e=>{e!=null&&e.defaultWarehouseId&&(o.value=e.defaultWarehouseId)},onClosed:()=>{o.value=""}});return(e,a)=>(S(),x(s(r),{class:"w-[520px]","confirm-text":s(l)("page.table.button.create"),"cancel-text":s(l)("page.table.button.cancel")},{default:v(()=>[D(h,{ref_key:"formRef",ref:n,mode:"create","default-warehouse-id":o.value,onSubmit:s(i)},null,8,["default-warehouse-id","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{W as _};
