import{_ as L}from"./FormLanguageSwitcher.vue_vue_type_script_setup_true_lang-U7bIUoKL.js";import{d as S,H as $,q as w,I as j,r as v,f as l,h as s,a0 as A,i as a,c as o,j as m,G as u,v as i,L as F,S as p,D as f,V as g,y as b}from"./index-C5GbdPxY.js";import{V as I}from"./VForm-BZc3SavJ.js";import{a as y,V as M}from"./VAvatar-RkAR0u0e.js";const T=S({__name:"BaseForm",props:{loading:{type:Boolean},disabled:{type:Boolean,default:!1},hasMultipleLanguage:{type:Boolean},action:{},resource:{},hiddenCancelButton:{type:Boolean},hiddenActionButton:{type:Boolean},onClickCancel:{}},emits:["submit"],setup(B){const r=B,{t:c}=$(),{defaultLanguage:V}=w(),C=j(),n=v(V),k=()=>{r.onClickCancel?r.onClickCancel():C.push({name:`admin.${r.resource.replace("-","_")}.index`})};return(e,t)=>{const h=L;return s(),l(I,{onSubmit:t[1]||(t[1]=A(d=>e.$emit("submit",d),["prevent"]))},{default:a(()=>[o(M,null,{default:a(()=>[o(y,{class:"d-flex align-center justify-start gap-2",cols:"12",md:"4"},{default:a(()=>[e.hasMultipleLanguage?(s(),l(h,{key:0,modelValue:i(n),"onUpdate:modelValue":t[0]||(t[0]=d=>F(n)?n.value=d:null)},null,8,["modelValue"])):u("",!0)]),_:1}),o(y,{class:"d-flex justify-end gap-2",cols:"12",md:"8"},{default:a(()=>[m(e.$slots,"header-buttons"),e.hiddenCancelButton?u("",!0):(s(),l(p,{key:0,color:"default",disabled:e.loading,type:"button",onClick:k},{default:a(()=>[o(g,{icon:"tabler-x",start:""}),f(" "+b(i(c)("admin::admin.buttons.cancel")),1)]),_:1},8,["disabled"])),e.hiddenActionButton?u("",!0):(s(),l(p,{key:1,color:"primary",disabled:e.disabled||e.loading,loading:e.loading,type:"submit"},{default:a(()=>[o(g,{icon:e.action==="create"?"tabler-plus":"tabler-pencil",start:""},null,8,["icon"]),f(" "+b(i(c)(`admin::admin.buttons.${e.action}`)),1)]),_:1},8,["disabled","loading"]))]),_:3})]),_:3}),m(e.$slots,"default",{currentLanguage:i(n)})]),_:3})}}});export{T as _};
