import{u as v,c as _,b as s,t as d,a as n,g as e,w as m,d as u,l as g,o as y,P as p}from"./app-CYVHboi-.js";import{_ as V}from"./SecondaryButton-CHQvCfls.js";import{_ as h}from"./LoadingButton-CH88QwYm.js";import{_ as k}from"./CheckBox-FJj299Iw.js";import{_ as f}from"./Input-VvJHlcSh.js";import{_ as w}from"./Textarea-D40HahXW.js";import"./browser-BwNzv7vE.js";import"./InputError-u5FIXCwc.js";import"./Keyboard-VWzCpVN-.js";import"./composable-DK3kcOvi.js";import"./InputLabel-dHPaqRUC.js";const x={class:"border-b border-gray-200 px-6 py-4 dark:border-gray-700"},S={class:"sm:flex sm:items-baseline sm:justify-between"},A={class:"sm:w-0 sm:flex-1"},C={class:"text-focus text-base font-semibold"},N={class:"text-mute mt-1 truncate text-sm"},U={class:"grid grid-cols-6 gap-6 p-6"},B={class:"col-span-6 sm:col-span-3"},T={class:"col-span-6 sm:col-span-3"},j={class:"col-span-full"},D={class:"col-span-full"},E={class:"flex flex-row justify-end bg-gray-100 px-6 py-4 text-end dark:bg-gray-950"},O={__name:"Form",props:["current"],emits:["close","done"],setup(l,{emit:b}){const c=b,a=l,o=v({_method:a.current?.id?"put":"post",name:a.current?.name,code:a.current?.code,description:a.current?.description,active:a.current?.id?a.current?.active==1:!0});function $(){o.post(a.current?.id?p("account-types.update",a.current.id):p("account-types.store"),{onSuccess:()=>{c("done"),c("close")}})}return(t,r)=>(y(),_("form",{onSubmit:g($,["prevent"])},[s("div",x,[s("div",S,[s("div",A,[s("h1",C,d(l.current?.id?t.$t("Edit {x}",{x:t.$t("Account Type")}):t.$t("Add {x}",{x:t.$t("Account Type")})),1),s("p",N,d(t.$t("Please fill the form below to {action} {record}.",{record:t.$t("account type"),action:l.current?.id?t.$t("edit"):t.$t("add")})),1)])])]),s("div",U,[s("div",B,[n(e(f),{id:"name",label:t.$t("Name"),modelValue:e(o).name,"onUpdate:modelValue":r[0]||(r[0]=i=>e(o).name=i),error:e(o).errors.name},null,8,["label","modelValue","error"])]),s("div",T,[n(e(f),{id:"code",label:t.$t("Code"),modelValue:e(o).code,"onUpdate:modelValue":r[1]||(r[1]=i=>e(o).code=i),error:e(o).errors.code},null,8,["label","modelValue","error"])]),s("div",j,[n(e(w),{id:"description",label:t.$t("Description"),modelValue:e(o).description,"onUpdate:modelValue":r[2]||(r[2]=i=>e(o).description=i),error:e(o).errors.description},null,8,["label","modelValue","error"])]),s("div",D,[n(e(k),{id:"active",error:e(o).errors.active,checked:e(o).active,"onUpdate:checked":r[3]||(r[3]=i=>e(o).active=i),label:t.$t("Active")},null,8,["error","checked","label"])])]),s("div",E,[n(e(V),{onClick:r[4]||(r[4]=i=>c("close"))},{default:m(()=>[u(d(t.$t("Cancel")),1)]),_:1}),n(e(h),{class:"ms-3",loading:e(o).processing},{default:m(()=>[u(d(t.$t("Save")),1)]),_:1},8,["loading"])])],32))}};export{O as default};
