/**
 * DevExtreme (cjs/__internal/scheduler/options_validator/validator_rules.js)
 * Version: 23.2.6 (build 24140-0112)
 * Build date: Sun May 19 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.visibleIntervalMustBeDivisibleByCellDuration = exports.endDayHourMustBeGreaterThanStartDayHour = exports.cellDurationMustBeLessThanVisibleInterval = void 0;
var _index = require("./common/index");
var _index2 = require("./core/index");
const endDayHourMustBeGreaterThanStartDayHour = (0, _index2.createValidatorRule)("endDayHourGreaterThanStartDayHour", _ref => {
    let {
        startDayHour: startDayHour,
        endDayHour: endDayHour
    } = _ref;
    return (0, _index.greaterThan)(endDayHour, startDayHour) || "endDayHour: ".concat(endDayHour, " must be greater that startDayHour: ").concat(startDayHour, ".")
});
exports.endDayHourMustBeGreaterThanStartDayHour = endDayHourMustBeGreaterThanStartDayHour;
const visibleIntervalMustBeDivisibleByCellDuration = (0, _index2.createValidatorRule)("visibleIntervalMustBeDivisibleByCellDuration", _ref2 => {
    let {
        cellDuration: cellDuration,
        startDayHour: startDayHour,
        endDayHour: endDayHour
    } = _ref2;
    const visibleInterval = 60 * (endDayHour - startDayHour);
    return (0, _index.divisibleBy)(visibleInterval, cellDuration) || "endDayHour - startDayHour: ".concat(visibleInterval, " (minutes), must be divisible by cellDuration: ").concat(cellDuration, " (minutes).")
});
exports.visibleIntervalMustBeDivisibleByCellDuration = visibleIntervalMustBeDivisibleByCellDuration;
const cellDurationMustBeLessThanVisibleInterval = (0, _index2.createValidatorRule)("cellDurationMustBeLessThanVisibleInterval", _ref3 => {
    let {
        cellDuration: cellDuration,
        startDayHour: startDayHour,
        endDayHour: endDayHour
    } = _ref3;
    const visibleInterval = 60 * (endDayHour - startDayHour);
    return (0, _index.lessThan)(cellDuration, visibleInterval, false) || "endDayHour - startDayHour: ".concat(visibleInterval, " (minutes), must be greater or equal the cellDuration: ").concat(cellDuration, " (minutes).")
});
exports.cellDurationMustBeLessThanVisibleInterval = cellDurationMustBeLessThanVisibleInterval;
