/*!
 * KoliBri - The accessible HTML-Standard
 */
import{e as t,w as s}from"./common-Dd0zJQbD.js";import{v as i}from"./auto-complete-mCkUnxg2.js";import{a,v as h,b as e}from"./max-length-behavior-nTw1Zuyf.js";import{v as o}from"./placeholder-BVhy3BzI.js";import{v as r}from"./read-only-BetTuumR.js";import{v as l}from"./required-CnTTpFCN.js";import{I as n}from"./controller-icon-DWR7m7FI.js";const m=(e,o,a={})=>{t(e,"_pattern",o,a)},d=["default","visibility-toggle"],v=(t,e)=>{s(t,"_variant",t=>"string"==typeof t&&d.includes(t),new Set(d),e)};class p extends n{constructor(t,e,o){super(t,e,o),this.afterSyncCharCounter=()=>{"string"==typeof this.component._value&&(this.component.state._currentLength=this.component._value.length,this.updateCurrentLengthDebounced(this.component._value.length))},this.component=t}validateAutoComplete(t){i(this.component,t)}validateHasCounter(t){a(this.component,t)}validateMaxLengthBehavior(t){h(this.component,t)}validateVariant(t){v(this.component,t)}validateMaxLength(t){e(this.component,t,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePattern(t){m(this.component,t)}validatePlaceholder(t){o(this.component,t)}validateReadOnly(t){r(this.component,t)}validateRequired(t){l(this.component,t)}validateValue(e){t(this.component,"_value",e,{hooks:{afterPatch:this.afterSyncCharCounter}}),this.setFormAssociatedValue(this.component.state._value)}componentWillLoad(){super.componentWillLoad(),this.validateAutoComplete(this.component._autoComplete),this.validateHasCounter(this.component._hasCounter),this.validateMaxLengthBehavior(this.component._maxLengthBehavior),this.validateMaxLength(this.component._maxLength),this.validatePattern(this.component._pattern),this.validatePlaceholder(this.component._placeholder),this.validateReadOnly(this.component._readOnly),this.validateRequired(this.component._required),this.validateValue(this.component._value),this.validateVariant(this.component._variant)}}export{p as I};