1import{$ as C,R as F,bh as D,g as L,c5 as O,N as W,o,w as B,a as w,n as s,s as q,c as p,j as h,b as K,k as d,T as u,d as m,t as f,U as T,V as N,bF as P,cL as A,cM as M}from"./Cny-jMUR.js";import{L as R}from"./YoF-LljS.js";const U={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between",label:"block font-medium text-default",container:"mt-1 relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}}},defaultVariants:{size:"md"}},E=["id"],G=["id"],H=["id"],J=["id"],Y={__name:"FormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(t){const e=t,l=C(),j=F(),r=q(()=>{var a;return N({extend:N(U),...((a=j.ui)==null?void 0:a.formField)||{}})({size:e.size,required:e.required})}),v=D("form-errors",null),i=q(()=>{var a,b;return e.error||((b=(a=v==null?void 0:v.value)==null?void 0:a.find(n=>n.name&&(n.name===e.name||e.errorPattern&&n.name.match(e.errorPattern))))==null?void 0:b.message)}),y=L(O()),c=y.value;return P(A,y),P(M,q(()=>({error:i.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:c}))),(a,b)=>{var n;return o(),W(d(T),{as:t.as,class:s(r.value.root({class:[(n=e.ui)==null?void 0:n.root,e.class]}))},{default:B(()=>{var g,x,$,k,S,V,z,I;return[w("div",{class:s(r.value.wrapper({class:(g=e.ui)==null?void 0:g.wrapper}))},[t.label||l.label?(o(),p("div",{key:0,class:s(r.value.labelWrapper({class:(x=e.ui)==null?void 0:x.labelWrapper}))},[K(d(R),{for:y.value,class:s(r.value.label({class:($=e.ui)==null?void 0:$.label}))},{default:B(()=>[u(a.$slots,"label",{label:t.label},()=>[m(f(t.label),1)])]),_:3},8,["for","class"]),t.hint||l.hint?(o(),p("span",{key:0,id:`${d(c)}-hint`,class:s(r.value.hint({class:(k=e.ui)==null?void 0:k.hint}))},[u(a.$slots,"hint",{hint:t.hint},()=>[m(f(t.hint),1)])],10,E)):h("",!0)],2)):h("",!0),t.description||l.description?(o(),p("p",{key:1,id:`${d(c)}-description`,class:s(r.value.description({class:(S=e.ui)==null?void 0:S.description}))},[u(a.$slots,"description",{description:t.description},()=>[m(f(t.description),1)])],10,G)):h("",!0)],2),w("div",{class:s([(t.label||!!l.label||t.description||!!l.description)&&r.value.container({class:(V=e.ui)==null?void 0:V.container})])},[u(a.$slots,"default",{error:i.value}),typeof i.value=="string"&&i.value||l.error?(o(),p("div",{key:0,id:`${d(c)}-error`,class:s(r.value.error({class:(z=e.ui)==null?void 0:z.error}))},[u(a.$slots,"error",{error:i.value},()=>[m(f(i.value),1)])],10,H)):t.help||l.help?(o(),p("div",{key:1,id:`${d(c)}-help`,class:s(r.value.help({class:(I=e.ui)==null?void 0:I.help}))},[u(a.$slots,"help",{help:t.help},()=>[m(f(t.help),1)])],10,J)):h("",!0)],2)]}),_:3},8,["as","class"])}}};export{Y as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.