/**
 * DevExtreme (esm/renovation/ui/scheduler/appointment_edit_form/edit_form/layout_items/groups/dateBoxGroup.js)
 * Version: 23.2.4 (build 24056-0112)
 * Build date: Sun Feb 25 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import {
    ItemLabels
} from "../const";
import {
    getDateBoxLayoutItemConfig
} from "../dateBox";
import {
    getTimeZoneLayoutItemConfig
} from "../timeZone";
var createDateBoxItems = options => {
    var colSpan = options.allowTimeZoneEditing ? 2 : 1;
    var startDateLayoutItem = getDateBoxLayoutItemConfig(options.startDateEditorTemplate, options.dataExpr.startDateExpr, colSpan, ItemLabels.startDate);
    var startDateTimeZoneLayoutItem = getTimeZoneLayoutItemConfig(options.startDatetimeZoneEditorTemplate, options.dataExpr.startDateTimeZoneExpr, colSpan, 1, !!options.allowTimeZoneEditing);
    var endDateLayoutItem = getDateBoxLayoutItemConfig(options.endDateEditorTemplate, options.dataExpr.endDateExpr, colSpan, ItemLabels.endDate);
    var endDateTimeZoneLayoutItem = getTimeZoneLayoutItemConfig(options.endDateTimeZoneEditorTemplate, options.dataExpr.endDateTimeZoneExpr, colSpan, 3, !!options.allowTimeZoneEditing);
    return [startDateLayoutItem, startDateTimeZoneLayoutItem, endDateLayoutItem, endDateTimeZoneLayoutItem]
};
export var getDateBoxGroupConfig = (dataExpr, allowTimeZoneEditing, startDateEditorTemplate, endDateEditorTemplate, startDatetimeZoneEditorTemplate, endDateTimeZoneEditorTemplate) => ({
    itemType: "group",
    colSpan: 2,
    colCountByScreen: {
        lg: 2,
        xs: 1
    },
    items: createDateBoxItems({
        dataExpr: dataExpr,
        allowTimeZoneEditing: allowTimeZoneEditing,
        startDateEditorTemplate: startDateEditorTemplate,
        endDateEditorTemplate: endDateEditorTemplate,
        startDatetimeZoneEditorTemplate: startDatetimeZoneEditorTemplate,
        endDateTimeZoneEditorTemplate: endDateTimeZoneEditorTemplate
    })
});
