/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";var common=require("./common-Cd2qH809.js"),autoComplete=require("./auto-complete-DQ9TPAgi.js"),maxLengthBehavior=require("./max-length-behavior-Bvbwhaxv.js"),placeholder=require("./placeholder-BncK-3gZ.js"),readOnly=require("./read-only-dIvCm73W.js"),required=require("./required-CXU7vdyH.js"),controllerIcon=require("./controller-icon-xty3Xd5Y.js");const validatePattern=(t,e,a={})=>{common.watchString(t,"_pattern",e,a)},PasswordVariantPropTypeOptions=["default","visibility-toggle"],validatePasswordVariant=(t,e)=>{common.watchValidator(t,"_variant",t=>"string"==typeof t&&PasswordVariantPropTypeOptions.includes(t),new Set(PasswordVariantPropTypeOptions),e)};class InputPasswordController extends controllerIcon.InputIconController{constructor(t,e,a){super(t,e,a),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){autoComplete.validateAutoComplete(this.component,t)}validateHasCounter(t){maxLengthBehavior.validateHasCounter(this.component,t)}validateMaxLengthBehavior(t){maxLengthBehavior.validateMaxLengthBehavior(this.component,t)}validateVariant(t){validatePasswordVariant(this.component,t)}validateMaxLength(t){maxLengthBehavior.validateMaxLength(this.component,t,{hooks:{afterPatch:this.afterSyncCharCounter}})}validatePattern(t){validatePattern(this.component,t)}validatePlaceholder(t){placeholder.validatePlaceholder(this.component,t)}validateReadOnly(t){readOnly.validateReadOnly(this.component,t)}validateRequired(t){required.validateRequired(this.component,t)}validateValue(t){common.watchString(this.component,"_value",t,{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)}}exports.InputPasswordController=InputPasswordController;