/*!
 * KoliBri - The accessible HTML-Standard
 */
import{I as InputController}from"./controller2.js";import{i as isIcon}from"./icons.js";import{o as objectObjectHandler,p as parseJson,w as watchValidator}from"./prop.validators.js";import{i as isString}from"./common.js";const beforePatchIcons=(o,t)=>{const n=o;"object"==typeof n&&null!==n&&(isString(n.right,1)&&(n.right={icon:n.right}),isString(n.left,1)&&(n.left={icon:n.left}),t.set("_icons",n))};class InputIconController extends InputController{constructor(o,t,n){super(o,t,n),this.component=o}validateIcons(o){objectObjectHandler(o,(()=>{try{o=parseJson(o)}catch(o){}watchValidator(this.component,"_icons",(o=>"object"==typeof o&&null!==o&&(isString(o.left,1)||isIcon(o.left)||isString(o.right,1)||isIcon(o.right))),new Set(["KoliBriHorizontalIcon"]),o,{hooks:{beforePatch:beforePatchIcons},required:!0})}))}componentWillLoad(){super.componentWillLoad(),this.validateIcons(this.component._icons)}}export{InputIconController as I};