import{bT as J,I as m,c5 as Q,bO as x,cc as H,bR as Z,dL as ee,bS as K,q as d,bX as D,bW as ae,b$ as L,da as ne,dM as A,eh as X,bU as T,af as te,b5 as F,aS as R,bC as $,aM as se,ao as le,bd as ie,dm as Y,dV as ue,bi as re,ax as oe,ay as de,aC as ce,cF as N,as as ve,cS as W,cT as fe,ei as ge,cU as me,cy as ye,cX as he,cY as pe,cC as Ve,d3 as be}from"./index-DhjTmrEH.js";function Ie(e){const{t:c}=J();function f(n){let{name:o}=n;const a={prepend:"prependAction",prependInner:"prependAction",append:"appendAction",appendInner:"appendAction",clear:"clear"}[o],i=e[`onClick:${o}`],g=i&&a?c(`$vuetify.input.${a}`,e.label??""):void 0;return m(Q,{icon:e[`${o}Icon`],"aria-label":g,onClick:i},null)}return{InputIcon:f}}const Me=x({active:Boolean,color:String,messages:{type:[Array,String],default:()=>[]},...H(),...Z({transition:{component:ee,leaveAbsolute:!0,group:!0}})},"VMessages"),Se=K()({name:"VMessages",props:Me(),setup(e,c){let{slots:f}=c;const n=d(()=>D(e.messages)),{textColorClasses:o,textColorStyles:a}=ae(d(()=>e.color));return L(()=>m(ne,{transition:e.transition,tag:"div",class:["v-messages",o.value,e.class],style:[a.value,e.style],role:"alert","aria-live":"polite"},{default:()=>[e.active&&n.value.map((i,g)=>m("div",{class:"v-messages__message",key:`${g}-${n.value}`},[f.message?f.message({message:i}):i]))]})),{}}}),ke=x({focused:Boolean,"onUpdate:focused":A()},"focus");function we(e){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X();const f=T(e,"focused"),n=d(()=>({[`${c}--focused`]:f.value}));function o(){f.value=!0}function a(){f.value=!1}return{focusClasses:n,isFocused:f,focus:o,blur:a}}const j=Symbol.for("vuetify:form"),De=x({disabled:Boolean,fastFail:Boolean,readonly:Boolean,modelValue:{type:Boolean,default:null},validateOn:{type:String,default:"input"}},"form");function Ae(e){const c=T(e,"modelValue"),f=d(()=>e.disabled),n=d(()=>e.readonly),o=F(!1),a=R([]),i=R([]);async function g(){const r=[];let s=!0;i.value=[],o.value=!0;for(const u of a.value){const t=await u.validate();if(t.length>0&&(s=!1,r.push({id:u.id,errorMessages:t})),!s&&e.fastFail)break}return i.value=r,o.value=!1,{valid:s,errors:i.value}}function I(){a.value.forEach(r=>r.reset())}function V(){a.value.forEach(r=>r.resetValidation())}return $(a,()=>{let r=0,s=0;const u=[];for(const t of a.value)t.isValid===!1?(s++,u.push({id:t.id,errorMessages:t.errorMessages})):t.isValid===!0&&r++;i.value=u,c.value=s>0?!1:r===a.value.length?!0:null},{deep:!0,flush:"post"}),se(j,{register:r=>{let{id:s,vm:u,validate:t,reset:h,resetValidation:M}=r;a.value.some(S=>S.id===s),a.value.push({id:s,validate:t,reset:h,resetValidation:M,vm:le(u),isValid:null,errorMessages:[]})},unregister:r=>{a.value=a.value.filter(s=>s.id!==r)},update:(r,s,u)=>{const t=a.value.find(h=>h.id===r);t&&(t.isValid=s,t.errorMessages=u)},isDisabled:f,isReadonly:n,isValidating:o,isValid:c,items:a,validateOn:ie(e,"validateOn")}),{errors:i,isDisabled:f,isReadonly:n,isValidating:o,isValid:c,items:a,validate:g,reset:I,resetValidation:V}}function Ce(){return te(j,null)}const Be=x({disabled:{type:Boolean,default:null},error:Boolean,errorMessages:{type:[Array,String],default:()=>[]},maxErrors:{type:[Number,String],default:1},name:String,label:String,readonly:{type:Boolean,default:null},rules:{type:Array,default:()=>[]},modelValue:null,validateOn:String,validationValue:null,...ke()},"validation");function Pe(e){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X(),f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y();const n=T(e,"modelValue"),o=d(()=>e.validationValue===void 0?n.value:e.validationValue),a=Ce(),i=R([]),g=F(!0),I=d(()=>!!(D(n.value===""?null:n.value).length||D(o.value===""?null:o.value).length)),V=d(()=>!!(e.disabled??(a==null?void 0:a.isDisabled.value))),r=d(()=>!!(e.readonly??(a==null?void 0:a.isReadonly.value))),s=d(()=>{var l;return(l=e.errorMessages)!=null&&l.length?D(e.errorMessages).concat(i.value).slice(0,Math.max(0,+e.maxErrors)):i.value}),u=d(()=>{let l=(e.validateOn??(a==null?void 0:a.validateOn.value))||"input";l==="lazy"&&(l="input lazy"),l==="eager"&&(l="input eager");const v=new Set((l==null?void 0:l.split(" "))??[]);return{input:v.has("input"),blur:v.has("blur")||v.has("input")||v.has("invalid-input"),invalidInput:v.has("invalid-input"),lazy:v.has("lazy"),eager:v.has("eager")}}),t=d(()=>{var l;return e.error||(l=e.errorMessages)!=null&&l.length?!1:e.rules.length?g.value?i.value.length||u.value.lazy?null:!0:!i.value.length:!0}),h=F(!1),M=d(()=>({[`${c}--error`]:t.value===!1,[`${c}--dirty`]:I.value,[`${c}--disabled`]:V.value,[`${c}--readonly`]:r.value})),S=ue("validation"),b=d(()=>e.name??re(f));oe(()=>{a==null||a.register({id:b.value,vm:S,validate:y,reset:k,resetValidation:C})}),de(()=>{a==null||a.unregister(b.value)}),ce(async()=>{u.value.lazy||await y(!u.value.eager),a==null||a.update(b.value,t.value,s.value)}),N(()=>u.value.input||u.value.invalidInput&&t.value===!1,()=>{$(o,()=>{if(o.value!=null)y();else if(e.focused){const l=$(()=>e.focused,v=>{v||y(),l()})}})}),N(()=>u.value.blur,()=>{$(()=>e.focused,l=>{l||y()})}),$([t,s],()=>{a==null||a.update(b.value,t.value,s.value)});async function k(){n.value=null,await ve(),await C()}async function C(){g.value=!0,u.value.lazy?i.value=[]:await y(!u.value.eager)}async function y(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const v=[];h.value=!0;for(const B of e.rules){if(v.length>=+(e.maxErrors??1))break;const p=await(typeof B=="function"?B:()=>B)(o.value);if(p!==!0){if(p!==!1&&typeof p!="string"){console.warn(`${p} is not a valid value. Rule functions must return boolean true or a string.`);continue}v.push(p||"")}}return i.value=v,h.value=!1,g.value=l,i.value}return{errorMessages:s,isDirty:I,isDisabled:V,isReadonly:r,isPristine:g,isValid:t,isValidating:h,reset:k,resetValidation:C,validate:y,validationClasses:M}}const $e=x({id:String,appendIcon:W,centerAffix:{type:Boolean,default:!0},prependIcon:W,hideDetails:[Boolean,String],hideSpinButtons:Boolean,hint:String,persistentHint:Boolean,messages:{type:[Array,String],default:()=>[]},direction:{type:String,default:"horizontal",validator:e=>["horizontal","vertical"].includes(e)},"onClick:prepend":A(),"onClick:append":A(),...H(),...fe(),...ge(me(),["maxWidth","minWidth","width"]),...ye(),...Be()},"VInput"),Fe=K()({name:"VInput",props:{...$e()},emits:{"update:modelValue":e=>!0},setup(e,c){let{attrs:f,slots:n,emit:o}=c;const{densityClasses:a}=he(e),{dimensionStyles:i}=pe(e),{themeClasses:g}=Ve(e),{rtlClasses:I}=be(),{InputIcon:V}=Ie(e),r=Y(),s=d(()=>e.id||`input-${r}`),u=d(()=>`${s.value}-messages`),{errorMessages:t,isDirty:h,isDisabled:M,isReadonly:S,isPristine:b,isValid:k,isValidating:C,reset:y,resetValidation:l,validate:v,validationClasses:B}=Pe(e,"v-input",s),P=d(()=>({id:s,messagesId:u,isDirty:h,isDisabled:M,isReadonly:S,isPristine:b,isValid:k,isValidating:C,reset:y,resetValidation:l,validate:v})),p=d(()=>{var w;return(w=e.errorMessages)!=null&&w.length||!b.value&&t.value.length?t.value:e.hint&&(e.persistentHint||e.focused)?e.hint:e.messages});return L(()=>{var z,E,O,U;const w=!!(n.prepend||e.prependIcon),q=!!(n.append||e.appendIcon),_=p.value.length>0,G=!e.hideDetails||e.hideDetails==="auto"&&(_||!!n.details);return m("div",{class:["v-input",`v-input--${e.direction}`,{"v-input--center-affix":e.centerAffix,"v-input--hide-spin-buttons":e.hideSpinButtons},a.value,g.value,I.value,B.value,e.class],style:[i.value,e.style]},[w&&m("div",{key:"prepend",class:"v-input__prepend"},[(z=n.prepend)==null?void 0:z.call(n,P.value),e.prependIcon&&m(V,{key:"prepend-icon",name:"prepend"},null)]),n.default&&m("div",{class:"v-input__control"},[(E=n.default)==null?void 0:E.call(n,P.value)]),q&&m("div",{key:"append",class:"v-input__append"},[e.appendIcon&&m(V,{key:"append-icon",name:"append"},null),(O=n.append)==null?void 0:O.call(n,P.value)]),G&&m("div",{class:"v-input__details"},[m(Se,{id:u.value,active:_,messages:p.value},{message:n.message}),(U=n.details)==null?void 0:U.call(n,P.value)])])}),{reset:y,resetValidation:l,validate:v,isValid:k,errorMessages:t}}});export{Fe as V,$e as a,we as b,Ae as c,ke as d,Ie as e,De as m,Ce as u};