import{dF as X,dG as N,dI as _,dK as Z,cS as i,eh as ae,ei as de,cU as t,eH as Q,du as E,e7 as ne,g7 as ye,gN as Ce,gb as xe,eM as he,gz as ce,cO as x,cJ as L,gq as Ve,gJ as Ie,db as ke,gQ as _e,cV as H,dL as K,ge as Pe,gg as Se,jv as Fe,iG as ee,gj as le,d$ as Be,e1 as we,gR as Re,gl as Ae,dY as Te,eN as Le,gP as $e,gA as De,jw as Ee,ew as te,gW as Ne}from"./BC4hLSsA.js";import{d as Me,b as Oe}from"./DFl25b2e.js";import{M as Ue,m as je,I as ue}from"./C6iUKSE9.js";import{b as ze,a as qe,u as fe,d as We,V as se,m as Ge}from"./DlrL_d2K.js";import{n as Je,a as Ye}from"./Bb-Ds3qC.js";import{f as He}from"./C-GTDzx5.js";const Ke=N({active:Boolean,disabled:Boolean,max:[Number,String],value:{type:[Number,String],default:0},...ne(),...je({transition:{component:Me}})},"VCounter"),Qe=X()({name:"VCounter",functional:!0,props:Ke(),setup(e,d){let{slots:n}=d;const u=_(()=>e.max?`${e.value} / ${e.max}`:String(e.value));return Z(()=>i(Ue,{transition:e.transition},{default:()=>[ae(t("div",{class:E(["v-counter",{"text-error":e.max&&!e.disabled&&parseFloat(e.value)>parseFloat(e.max)},e.class]),style:Q(e.style)},[n.default?n.default({counter:u.value,max:e.max,value:e.value}):u.value]),[[de,e.active]])]})),{}}}),Xe=N({floating:Boolean,...ne()},"VFieldLabel"),Y=X()({name:"VFieldLabel",props:Xe(),setup(e,d){let{slots:n}=d;return Z(()=>i(ze,{class:E(["v-field-label",{"v-field-label--floating":e.floating},e.class]),style:Q(e.style)},n)),{}}}),Ze=["underlined","outlined","filled","solo","solo-inverted","solo-filled","plain"],ve=N({appendInnerIcon:le,bgColor:String,clearable:Boolean,clearIcon:{type:le,default:"$clear"},active:Boolean,centerAffix:{type:Boolean,default:void 0},color:String,baseColor:String,details:Boolean,dirty:Boolean,disabled:{type:Boolean,default:null},glow:Boolean,error:Boolean,flat:Boolean,iconColor:[Boolean,String],label:String,persistentClear:Boolean,prependInnerIcon:le,reverse:Boolean,singleLine:Boolean,variant:{type:String,default:"filled",validator:e=>Ze.includes(e)},"onClick:clear":ee(),"onClick:appendInner":ee(),"onClick:prependInner":ee(),...ne(),...Fe(),...Se(),...Pe()},"VField"),re=X()({name:"VField",inheritAttrs:!1,props:{id:String,...qe(),...ve()},emits:{"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,d){let{attrs:n,emit:u,slots:l}=d;const{themeClasses:o}=ye(e),{loaderClasses:P}=Ce(e),{focusClasses:M,isFocused:$,focus:S,blur:F}=fe(e),{InputIcon:D}=We(e),{roundedClasses:O}=xe(e),{rtlClasses:U}=he(),m=_(()=>e.dirty||e.active),h=_(()=>!!(e.label||l.label)),g=_(()=>!e.singleLine&&h.value),p=ce(),c=x(()=>e.id||`input-${p}`),j=_(()=>e.details?`${c.value}-messages`:void 0),z=L(),B=L(),q=L(),a=x(()=>["plain","underlined"].includes(e.variant)),s=x(()=>e.error||e.disabled?void 0:m.value&&$.value?e.color:e.baseColor),V=x(()=>{if(!(!e.iconColor||e.glow&&!$.value))return e.iconColor===!0?s.value:e.iconColor}),{backgroundColorClasses:w,backgroundColorStyles:ie}=Ve(()=>e.bgColor),{textColorClasses:W,textColorStyles:G}=Ie(s);ke(m,b=>{if(g.value&&!Be()){const v=z.value.$el,y=B.value.$el;requestAnimationFrame(()=>{const C=Je(v),r=y.getBoundingClientRect(),A=r.x-C.x,I=r.y-C.y-(C.height/2-r.height/2),k=r.width/.75,T=Math.abs(k-C.width)>1?{maxWidth:Re(k)}:void 0,J=getComputedStyle(v),oe=getComputedStyle(y),me=parseFloat(J.transitionDuration)*1e3||150,ge=parseFloat(oe.getPropertyValue("--v-field-label-scale")),be=oe.getPropertyValue("color");v.style.visibility="visible",y.style.visibility="hidden",Ye(v,{transform:`translate(${A}px, ${I}px) scale(${ge})`,color:be,...T},{duration:me,easing:we,direction:b?"normal":"reverse"}).finished.then(()=>{v.style.removeProperty("visibility"),y.style.removeProperty("visibility")})})}},{flush:"post"});const f=x(()=>({isActive:m,isFocused:$,controlRef:q,blur:F,focus:S}));function R(b){b.target!==document.activeElement&&b.preventDefault()}return Z(()=>{var A,I,k;const b=e.variant==="outlined",v=!!(l["prepend-inner"]||e.prependInnerIcon),y=!!(e.clearable||l.clear)&&!e.disabled,C=!!(l["append-inner"]||e.appendInnerIcon||y),r=()=>l.label?l.label({...f.value,label:e.label,props:{for:c.value}}):e.label;return t("div",K({class:["v-field",{"v-field--active":m.value,"v-field--appended":C,"v-field--center-affix":e.centerAffix??!a.value,"v-field--disabled":e.disabled,"v-field--dirty":e.dirty,"v-field--error":e.error,"v-field--glow":e.glow,"v-field--flat":e.flat,"v-field--has-background":!!e.bgColor,"v-field--persistent-clear":e.persistentClear,"v-field--prepended":v,"v-field--reverse":e.reverse,"v-field--single-line":e.singleLine,"v-field--no-label":!r(),[`v-field--variant-${e.variant}`]:!0},o.value,w.value,M.value,P.value,O.value,U.value,e.class],style:[ie.value,e.style],onClick:R},n),[t("div",{class:"v-field__overlay"},null),i(_e,{name:"v-field",active:!!e.loading,color:e.error?"error":typeof e.loading=="string"?e.loading:e.color},{default:l.loader}),v&&t("div",{key:"prepend",class:"v-field__prepend-inner"},[e.prependInnerIcon&&i(D,{key:"prepend-icon",name:"prependInner",color:V.value},null),(A=l["prepend-inner"])==null?void 0:A.call(l,f.value)]),t("div",{class:"v-field__field","data-no-activator":""},[["filled","solo","solo-inverted","solo-filled"].includes(e.variant)&&g.value&&i(Y,{key:"floating-label",ref:B,class:E([W.value]),floating:!0,for:c.value,"aria-hidden":!m.value,style:Q(G.value)},{default:()=>[r()]}),h.value&&i(Y,{key:"label",ref:z,for:c.value},{default:()=>[r()]}),((I=l.default)==null?void 0:I.call(l,{...f.value,props:{id:c.value,class:"v-field__input","aria-describedby":j.value},focus:S,blur:F}))??t("div",{id:c.value,class:"v-field__input","aria-describedby":j.value},null)]),y&&i(Oe,{key:"clear"},{default:()=>[ae(t("div",{class:"v-field__clearable",onMousedown:T=>{T.preventDefault(),T.stopPropagation()}},[i(Ae,{defaults:{VIcon:{icon:e.clearIcon}}},{default:()=>[l.clear?l.clear({...f.value,props:{onFocus:S,onBlur:F,onClick:e["onClick:clear"],tabindex:-1}}):i(D,{name:"clear",onFocus:S,onBlur:F,tabindex:-1},null)]})]),[[de,e.dirty]])]}),C&&t("div",{key:"append",class:"v-field__append-inner"},[(k=l["append-inner"])==null?void 0:k.call(l,f.value),e.appendInnerIcon&&i(D,{key:"append-icon",name:"appendInner",color:V.value},null)]),t("div",{class:E(["v-field__outline",W.value]),style:Q(G.value)},[b&&t(H,null,[t("div",{class:"v-field__outline__start"},null),g.value&&t("div",{class:"v-field__outline__notch"},[i(Y,{ref:B,floating:!0,for:c.value,"aria-hidden":!m.value},{default:()=>[r()]})]),t("div",{class:"v-field__outline__end"},null)]),a.value&&g.value&&i(Y,{ref:B,floating:!0,for:c.value,"aria-hidden":!m.value},{default:()=>[r()]})])])}),{controlRef:q,fieldIconColor:V}}}),pe=N({autocomplete:String},"autocomplete");function el(e){const d=ce(),n=Te(0),u=_(()=>e.autocomplete==="suppress"),l=_(()=>u.value?`${e.name}-${d}-${n.value}`:e.name),o=_(()=>u.value?"off":e.autocomplete);return{isSuppressing:u,fieldAutocomplete:o,fieldName:l,update:()=>n.value=new Date().getTime()}}function ll(e){function d(n,u){var l,o;!e.autofocus||!n||(o=(l=u[0].target)==null?void 0:l.focus)==null||o.call(l)}return{onIntersect:d}}const tl=["color","file","time","date","datetime-local","week","month"],al=N({autofocus:Boolean,counter:[Boolean,Number,String],counterValue:[Number,Function],prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,suffix:String,role:String,type:{type:String,default:"text"},modelModifiers:Object,...pe(),...Ge(),...ve()},"VTextField"),dl=X()({name:"VTextField",directives:{vIntersect:ue},inheritAttrs:!1,props:al(),emits:{"click:control":e=>!0,"mousedown:control":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,d){let{attrs:n,emit:u,slots:l}=d;const o=Le(e,"modelValue"),{isFocused:P,focus:M,blur:$}=fe(e),{onIntersect:S}=ll(e),F=x(()=>typeof e.counterValue=="function"?e.counterValue(o.value):typeof e.counterValue=="number"?e.counterValue:(o.value??"").toString().length),D=x(()=>{if(n.maxlength)return n.maxlength;if(!(!e.counter||typeof e.counter!="number"&&typeof e.counter!="string"))return e.counter}),O=x(()=>["plain","underlined"].includes(e.variant)),U=L(),m=L(),h=L(),g=el(e),p=x(()=>tl.includes(e.type)||e.persistentPlaceholder||P.value||e.active);function c(){g.isSuppressing.value&&g.update(),P.value||M(),te(()=>{var a;h.value!==document.activeElement&&((a=h.value)==null||a.focus())})}function j(a){u("mousedown:control",a),a.target!==h.value&&(c(),a.preventDefault())}function z(a){u("click:control",a)}function B(a,s){a.stopPropagation(),c(),te(()=>{o.value=null,s(),Ne(e["onClick:clear"],a)})}function q(a){var V;const s=a.target;if(o.value=s.value,(V=e.modelModifiers)!=null&&V.trim&&["text","search","password","tel","url"].includes(e.type)){const w=[s.selectionStart,s.selectionEnd];te(()=>{s.selectionStart=w[0],s.selectionEnd=w[1]})}}return Z(()=>{const a=!!(l.counter||e.counter!==!1&&e.counter!=null),s=!!(a||l.details),[V,w]=$e(n),{modelValue:ie,...W}=se.filterProps(e),G=re.filterProps(e);return i(se,K({ref:U,modelValue:o.value,"onUpdate:modelValue":f=>o.value=f,class:["v-text-field",{"v-text-field--prefixed":e.prefix,"v-text-field--suffixed":e.suffix,"v-input--plain-underlined":O.value},e.class],style:e.style},V,W,{centerAffix:!O.value,focused:P.value}),{...l,default:f=>{let{id:R,isDisabled:b,isDirty:v,isReadonly:y,isValid:C,hasDetails:r,reset:A}=f;return i(re,K({ref:m,onMousedown:j,onClick:z,"onClick:clear":I=>B(I,A),"onClick:prependInner":e["onClick:prependInner"],"onClick:appendInner":e["onClick:appendInner"],role:e.role},De(G,["onClick:clear"]),{id:R.value,active:p.value||v.value,dirty:v.value||e.dirty,disabled:b.value,focused:P.value,details:r.value,error:C.value===!1}),{...l,default:I=>{let{props:{class:k,...T}}=I;const J=ae(t("input",K({ref:h,value:o.value,onInput:q,autofocus:e.autofocus,readonly:y.value,disabled:b.value,name:g.fieldName.value,autocomplete:g.fieldAutocomplete.value,placeholder:e.placeholder,size:1,role:e.role,type:e.type,onFocus:M,onBlur:$},T,w),null),[[ue,{handler:S},null,{once:!0}]]);return t(H,null,[e.prefix&&t("span",{class:"v-text-field__prefix"},[t("span",{class:"v-text-field__prefix__text"},[e.prefix])]),l.default?t("div",{class:E(k),"data-no-activator":""},[l.default(),J]):Ee(J,{class:k}),e.suffix&&t("span",{class:"v-text-field__suffix"},[t("span",{class:"v-text-field__suffix__text"},[e.suffix])])])}})},details:s?f=>{var R;return t(H,null,[(R=l.details)==null?void 0:R.call(l,f),a&&t(H,null,[t("span",null,null),i(Qe,{active:e.persistentCounter||P.value,value:F.value,max:D.value,disabled:e.disabled},l.counter)])])}:void 0})}),He({},U,m,h)}});export{dl as V,re as a,pe as b,Qe as c,ll as d,al as e,ve as m,el as u};