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