// #region Imports
import { ElementValidatorBase } from './Abstracts/ElementValidatorBase';
import { minValidator } from './MinElementValidatorFn';
/**
 * @public
 */
export class MinElementValidator extends ElementValidatorBase {
    // #region Ctor
    constructor(host, messageResolver) {
        super(host, messageResolver ?? ((params) => `The value must be greater than or equal to ${params.min}.`));
    }
    // #endregion
    // #region Properties
    get attributes() {
        return ['min', 'value'];
    }
    // #endregion
    // #region Methods
    validate() {
        const errors = minValidator(this.host);
        return this.getMessage(errors);
    }
}
/**
 * A factory function for the {@link MinElementValidator}.
 *
 * @public
 * @param resolver - A *optional* message resolver to get the error message that will be displayed. When not provided, a default message will be used.
 */
export function minElementValidator(resolver) {
    return (host) => {
        return new MinElementValidator(host, resolver);
    };
}
//# sourceMappingURL=MinElementValidator.js.map