import{u as V}from"./selectMenu.72ERhOvP.js";import{C as j,D as S,f as w,E as v,B as q,i as n,r as I,y as G,o as r,c as a,x as s,a as B,H as l,I as t,K as i,F as o,d,t as p,k as m,J as N}from"./entry.2xM5grDS.js";import{_ as O}from"./_plugin-vue_export-helper.x3n3nnut.js";const P={wrapper:"",label:{wrapper:"flex content-center items-center justify-between",base:"block font-medium text-gray-700 dark:text-gray-200",required:"after:content-['*'] after:ms-0.5 after:text-red-500 dark:after:text-red-400"},size:{"2xs":"text-xs",xs:"text-xs",sm:"text-sm",md:"text-sm",lg:"text-sm",xl:"text-base"},container:"mt-1 relative",description:"text-gray-500 dark:text-gray-400",hint:"text-gray-500 dark:text-gray-400",help:"mt-2 text-gray-500 dark:text-gray-400",error:"mt-2 text-red-500 dark:text-red-400",default:{size:"sm"}},h=j(S.ui.strategy,S.ui.formGroup,P),A=w({inheritAttrs:!1,props:{name:{type:String,default:null},size:{type:String,default:null,validator(e){return Object.keys(h.size).includes(e)}},label:{type:String,default:null},description:{type:String,default:null},required:{type:Boolean,default:!1},help:{type:String,default:null},error:{type:[String,Boolean],default:null},hint:{type:String,default:null},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})},eagerValidation:{type:Boolean,default:!1}},setup(e){const{ui:f,attrs:g}=V("formGroup",v(e,"ui"),h,v(e,"class")),u=q("form-errors",null),y=n(()=>{var $,z;return e.error&&typeof e.error=="string"||typeof e.error=="boolean"?e.error:(z=($=u==null?void 0:u.value)==null?void 0:$.find(C=>C.path===e.name))==null?void 0:z.message}),b=n(()=>f.value.size[e.size??h.default.size]),k=I();return G("form-group",{error:y,inputId:k,name:n(()=>e.name),size:n(()=>e.size),eagerValidation:n(()=>e.eagerValidation)}),{ui:f,attrs:g,inputId:k,size:b,error:y}}}),D=["for"];function F(e,f,g,u,y,b){return r(),a("div",i({class:e.ui.wrapper},e.attrs),[e.label||e.$slots.label?(r(),a("div",{key:0,class:s([e.ui.label.wrapper,e.size])},[B("label",{for:e.inputId,class:s([e.ui.label.base,e.required?e.ui.label.required:""])},[e.$slots.label?l(e.$slots,"label",t(i({key:0},{error:e.error,label:e.label,name:e.name,hint:e.hint,description:e.description,help:e.help}))):(r(),a(o,{key:1},[d(p(e.label),1)],64))],10,D),e.hint||e.$slots.hint?(r(),a("span",{key:0,class:s([e.ui.hint])},[e.$slots.hint?l(e.$slots,"hint",t(i({key:0},{error:e.error,label:e.label,name:e.name,hint:e.hint,description:e.description,help:e.help}))):(r(),a(o,{key:1},[d(p(e.hint),1)],64))],2)):m("",!0)],2)):m("",!0),e.description||e.$slots.description?(r(),a("p",{key:1,class:s([e.ui.description,e.size])},[e.$slots.description?l(e.$slots,"description",t(i({key:0},{error:e.error,label:e.label,name:e.name,hint:e.hint,description:e.description,help:e.help}))):(r(),a(o,{key:1},[d(p(e.description),1)],64))],2)):m("",!0),B("div",{class:s([e.label?e.ui.container:""])},[l(e.$slots,"default",t(N({error:e.error}))),typeof e.error=="string"&&e.error||e.$slots.error?(r(),a("p",{key:0,class:s([e.ui.error,e.size])},[e.$slots.error?l(e.$slots,"error",t(i({key:0},{error:e.error,label:e.label,name:e.name,hint:e.hint,description:e.description,help:e.help}))):(r(),a(o,{key:1},[d(p(e.error),1)],64))],2)):e.help||e.$slots.help?(r(),a("p",{key:1,class:s([e.ui.help,e.size])},[e.$slots.help?l(e.$slots,"help",t(i({key:0},{error:e.error,label:e.label,name:e.name,hint:e.hint,description:e.description,help:e.help}))):(r(),a(o,{key:1},[d(p(e.help),1)],64))],2)):m("",!0)],2)],16)}const J=O(A,[["render",F]]);export{J as default};
