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