import { EmailInput } from '../../../ui/components/data-entry/email-input/index.js';
import { withFieldValidation } from '../fragments/with-field-validation/index.js';
import { validateEmailDomain, validateEmailFormat } from './utils.js';
const EmailField = withFieldValidation(EmailInput, {
    validations: {
        _validEmail: () => (value) => {
            if (!value)
                return true;
            return validateEmailFormat(value);
        },
        _allowedDomains: ({ allowedDomains = [] }) => (value) => {
            if (!value)
                return true;
            return validateEmailDomain(value, { allowedDomains });
        },
    },
});
EmailField.displayName = 'EmailField';
export { EmailField };
//# sourceMappingURL=email-field.js.map