import{A as E,f as k}from"./AddEdit-D9887DBK.js";import{_ as b,x as v,Z as T,a as $,r as u,e as A,o as d,g as C,f as c,w as o,V as a,F as g,c as n,J as h,p as w,B as S,ah as B}from"./app-DGDivIsO.js";const D=v({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:T,AddEdit:E},setup(e,{emit:p}){const{permsArray:m}=$(),{initData:l,addEditUrl:f}=k(),s=u(!1),i=u("add"),t=u({...l});return{permsArray:m,visible:s,addEditType:i,addEditUrl:f,formData:t,addEditSuccess:()=>{s.value=!1,t.value={...l},p("onAddSuccess")},onClose:()=>{s.value=!1},showAdd:()=>{s.value=!0}}}}),P={key:0};function M(e,p,m,l,f,s){const i=w,t=A("PlusOutlined"),r=S,y=B,_=A("AddEdit");return e.permsArray.includes("payment_modes_view")||e.permsArray.includes("admin")?(d(),C("div",P,[e.customType=="menu"?(d(),c(i,{onClick:e.showAdd,key:"categories"},{icon:o(()=>[a(e.$slots,"icon")]),default:o(()=>[a(e.$slots,"default")]),_:3},8,["onClick"])):(d(),C(g,{key:1},[e.tooltip?(d(),c(y,{key:0,placement:"topLeft",title:e.$t("payment_mode.add"),"arrow-point-at-center":""},{default:o(()=>[n(r,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:o(()=>[n(t)]),default:o(()=>[a(e.$slots,"default")]),_:3},8,["onClick","type"])]),_:3},8,["title"])):(d(),c(r,{key:1,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:o(()=>[n(t)]),default:o(()=>[a(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),n(_,{addEditType:e.addEditType,visible:e.visible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,formData:e.formData,data:e.formData,pageTitle:e.$t("payment_mode.add"),successMessage:e.$t("payment_mode.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"])])):h("",!0)}const F=b(D,[["render",M]]);export{F as P};
