1import{D as e,E as t,Ht as n,J as r,Lt as i,On as a,Pt as o,Zn as s,_ as c,b as l,et as u,g as d,gt as f,k as p,mt as m,qt as h,tr as g,v as _,vn as v,xt as y,y as b}from"./CaODJcyn.js";import{t as x}from"./BAMJOb0h.js";import{t as S}from"./1NntGLTj.js";import{t as C}from"./BqSvPtSC.js";import{t as w}from"./Djlp7drp.js";import{t as T}from"./DnWcIL3Z.js";import{a as E,i as D,l as O,r as k}from"./CKo2fWXf.js";var A=p({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(e){let t=e;return w(),(e,n)=>(m(),_(a(C),u(t,{onMousedown:n[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:h(()=>[y(e.$slots,`default`)]),_:3},16))}}),j={slots:{root:``,wrapper:``,labelWrapper:`flex content-center items-center justify-between gap-1`,label:`block font-medium text-default`,container:`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`}},orientation:{vertical:{container:`mt-1`},horizontal:{root:`flex justify-between place-items-baseline gap-2`}}},defaultVariants:{size:`md`}},M=[`id`],N=[`id`],P=[`id`],F=[`id`],I={__name:`UFormField`,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,default:void 0},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},orientation:{type:null,required:!1,default:`vertical`},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(u){let p=u,w=i(),I=S(`formField`,p),L=x(),R=d(()=>T({extend:j,...L.ui?.formField||{}})({size:I.size,required:I.required,orientation:I.orientation})),z=r(k,null),B=d(()=>I.error||z?.value?.find(e=>e.name===I.name||I.errorPattern&&e.name?.match(I.errorPattern))?.message),V=v(o()),H=V.value,U=r(E,void 0);return n(V,()=>{U&&I.name&&(U.value[I.name]={id:V.value,pattern:I.errorPattern})},{immediate:!0}),f(O,V),f(D,d(()=>({error:B.value,name:I.name,size:I.size,eagerValidation:I.eagerValidation,validateOnInputDelay:I.validateOnInputDelay,errorPattern:I.errorPattern,hint:I.hint,description:I.description,help:I.help,ariaId:H}))),(n,r)=>(m(),_(a(C),{as:a(I).as,"data-orientation":a(I).orientation,"data-slot":`root`,class:s(R.value.root({class:[a(I).ui?.root,a(I).class]}))},{default:h(()=>[c(`div`,{"data-slot":`wrapper`,class:s(R.value.wrapper({class:a(I).ui?.wrapper}))},[a(I).label||w.label?(m(),l(`div`,{key:0,"data-slot":`labelWrapper`,class:s(R.value.labelWrapper({class:a(I).ui?.labelWrapper}))},[e(a(A),{for:V.value,"data-slot":`label`,class:s(R.value.label({class:a(I).ui?.label}))},{default:h(()=>[y(n.$slots,`label`,{label:a(I).label},()=>[t(g(a(I).label),1)])]),_:3},8,[`for`,`class`]),a(I).hint||w.hint?(m(),l(`span`,{key:0,id:`${a(H)}-hint`,"data-slot":`hint`,class:s(R.value.hint({class:a(I).ui?.hint}))},[y(n.$slots,`hint`,{hint:a(I).hint},()=>[t(g(a(I).hint),1)])],10,M)):b(``,!0)],2)):b(``,!0),a(I).description||w.description?(m(),l(`p`,{key:1,id:`${a(H)}-description`,"data-slot":`description`,class:s(R.value.description({class:a(I).ui?.description}))},[y(n.$slots,`description`,{description:a(I).description},()=>[t(g(a(I).description),1)])],10,N)):b(``,!0)],2),c(`div`,{class:s([(a(I).label||!!w.label||a(I).description||!!w.description)&&R.value.container({class:a(I).ui?.container})])},[y(n.$slots,`default`,{error:B.value}),a(I).error!==!1&&(typeof B.value==`string`&&B.value||w.error)?(m(),l(`div`,{key:0,id:`${a(H)}-error`,"data-slot":`error`,class:s(R.value.error({class:a(I).ui?.error}))},[y(n.$slots,`error`,{error:B.value},()=>[t(g(B.value),1)])],10,P)):a(I).help||w.help?(m(),l(`div`,{key:1,id:`${a(H)}-help`,"data-slot":`help`,class:s(R.value.help({class:a(I).ui?.help}))},[y(n.$slots,`help`,{help:a(I).help},()=>[t(g(a(I).help),1)])],10,F)):b(``,!0)],2)]),_:3},8,[`as`,`data-orientation`,`class`]))}};export{A as n,I as t};
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.