// #region Imports
import { ElementValueAccessorBase } from '../../../../../Forms/Accessors/Abstracts/ElementValueAccessorBase';
// #endregion
/**
 * The `ChoiceGroupElementValueAccessor` class.
 *
 * @public
 */
export class ChoiceGroupElementValueAccessor extends ElementValueAccessorBase {
    // #region Methods
    /**
     * @public
     */
    hostConnected() {
        this.host.on('choiceChanged', (x) => this.writeValue(x.detail.value));
        // we need to set the value here because the host element may have a value before the accessor is connected
        void this.host.updateComplete.then(() => {
            this.value = this.host.value;
        });
    }
}
/**
 * @public
 */
export const choiceGroupElementValueAccessor = (host) => new ChoiceGroupElementValueAccessor(host);
//# sourceMappingURL=ChoiceGroupElementValueAccessor.js.map