import{_ as C,d as E,Q as v,m as b,p as u,r as A,c as k,h as w,o as d,f as c,a,w as s,S as n,O as T,z as $,B as h,D as g}from"./app-BOG5ezKh.js";import{A as S,f as B}from"./AddEdit-CVT4CiSe.js";const D=E({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:v,AddEdit:S},setup(e,{emit:p}){const{permsArray:m}=b(),{initData:l,addEditUrl:f}=B(),o=u(!1),i=u("add"),t=u({...l});return{permsArray:m,visible:o,addEditType:i,addEditUrl:f,formData:t,addEditSuccess:()=>{o.value=!1,t.value={...l},p("onAddSuccess")},onClose:()=>{o.value=!1},showAdd:()=>{o.value=!0}}}}),P={key:0};function O(e,p,m,l,f,o){const i=T,t=A("PlusOutlined"),r=h,y=g,_=A("AddEdit");return e.permsArray.includes("payment_modes_view")||e.permsArray.includes("admin")?(d(),k("div",P,[e.customType=="menu"?(d(),c(i,{onClick:e.showAdd,key:"categories"},{icon:s(()=>[n(e.$slots,"icon")]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick"])):(d(),k($,{key:1},[e.tooltip?(d(),c(y,{key:0,placement:"topLeft",title:e.$t("payment_mode.add"),"arrow-point-at-center":""},{default:s(()=>[a(r,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[a(t)]),default:s(()=>[n(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:s(()=>[a(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),a(_,{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"])])):w("v-if",!0)}const j=C(D,[["render",O],["__file","/Users/rajeshkumawat/sites/stockifly/resources/js/main/views/settings/payment-modes/AddButton.vue"]]);export{j as P};
