/**
 * DevExtreme (cjs/__internal/scheduler/r1/components/base/group_panel_horizontal_cell.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.GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCell = void 0;
var _inferno = require("inferno");
var _inferno2 = require("@devextreme/runtime/inferno");
var _index = require("../../../../core/r1/utils/index");
var _index2 = require("../../utils/index");
var _group_panel_props = require("./group_panel_props");

function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    _setPrototypeOf(subClass, superClass)
}

function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, p) {
        o.__proto__ = p;
        return o
    };
    return _setPrototypeOf(o, p)
}

function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function(target) {
        for (var i = 1; i < arguments.length; i++) {
            var source = arguments[i];
            for (var key in source) {
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key]
                }
            }
        }
        return target
    };
    return _extends.apply(this, arguments)
}
const GroupPanelHorizontalCellDefaultProps = _extends(_extends({}, _group_panel_props.GroupPanelCellDefaultProps), {
    isFirstGroupCell: false,
    isLastGroupCell: false,
    colSpan: 1
});
exports.GroupPanelHorizontalCellDefaultProps = GroupPanelHorizontalCellDefaultProps;
let GroupPanelHorizontalCell = function(_BaseInfernoComponent) {
    _inheritsLoose(GroupPanelHorizontalCell, _BaseInfernoComponent);

    function GroupPanelHorizontalCell() {
        return _BaseInfernoComponent.apply(this, arguments) || this
    }
    var _proto = GroupPanelHorizontalCell.prototype;
    _proto.render = function() {
        const {
            cellTemplate: cellTemplate,
            colSpan: colSpan,
            color: color,
            data: data,
            id: id,
            index: index,
            text: text,
            className: className,
            isFirstGroupCell: isFirstGroupCell,
            isLastGroupCell: isLastGroupCell
        } = this.props;
        const classes = _index2.renderUtils.combineClasses({
            "dx-scheduler-group-header": true,
            "dx-scheduler-first-group-cell": isFirstGroupCell,
            "dx-scheduler-last-group-cell": isLastGroupCell,
            [null !== className && void 0 !== className ? className : ""]: !!className
        });
        const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate);
        return (0, _inferno.createVNode)(1, "th", classes, (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-header-content", CellTemplateComponent ? CellTemplateComponent({
            data: {
                data: data,
                id: id,
                color: color,
                text: text
            },
            index: index
        }) : (0, _inferno.createVNode)(1, "div", null, text, 0), 0), 2, {
            colSpan: colSpan
        })
    };
    return GroupPanelHorizontalCell
}(_inferno2.BaseInfernoComponent);
exports.GroupPanelHorizontalCell = GroupPanelHorizontalCell;
GroupPanelHorizontalCell.defaultProps = GroupPanelHorizontalCellDefaultProps;
