var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import React from 'react';
import { ThemeContext } from '../../lib/theming/ThemeContext.js';
import { CommonWrapper } from '../../internal/CommonWrapper/index.js';
import { responsiveLayout } from '../ResponsiveLayout/decorator.js';
import { rootNode } from '../../lib/rootNode/index.js';
import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
import { getStyles } from './SidePage.styles.js';
import { SidePageContext } from './SidePageContext.js';
export var SidePageContainerDataTids = {
    root: 'SidePageContainer__root',
};
/**
 * Контейнер с отступами
 *
 * @visibleName SidePage.Container
 */
var SidePageContainer = /** @class */ (function (_super) {
    __extends(SidePageContainer, _super);
    function SidePageContainer() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    SidePageContainer.prototype.render = function () {
        var _this = this;
        this.styles = getStyles(this.emotion);
        return (React.createElement(ThemeContext.Consumer, null, function (theme) {
            _this.theme = theme;
            return _this.renderMain();
        }));
    };
    SidePageContainer.prototype.renderMain = function () {
        var _this = this;
        return (React.createElement(SidePageContext.Consumer, null, function (_a) {
            var _b;
            var hasHeader = _a.hasHeader, hasFooter = _a.hasFooter, hasPanel = _a.hasPanel;
            return (React.createElement(CommonWrapper, __assign({ rootNodeRef: _this.setRootNode }, _this.props),
                React.createElement("div", { "data-tid": SidePageContainerDataTids.root, className: _this.cx((_b = {},
                        _b[_this.styles.container(_this.theme)] = true,
                        _b[_this.styles.containerWithoutHeader(_this.theme)] = !hasHeader,
                        _b[_this.styles.containerWithoutFooter(_this.theme)] = !hasFooter,
                        _b[_this.styles.containerWithPanel(_this.theme)] = hasPanel,
                        _b[_this.styles.mobileContainer(_this.theme)] = _this.isMobileLayout,
                        _b[_this.styles.mobileContainerWithoutHeader(_this.theme)] = _this.isMobileLayout && !hasHeader,
                        _b)) }, _this.props.children)));
        }));
    };
    SidePageContainer.__KONTUR_REACT_UI__ = 'SidePageContainer';
    SidePageContainer.displayName = 'SidePageContainer';
    SidePageContainer = __decorate([
        withRenderEnvironment,
        responsiveLayout,
        rootNode
    ], SidePageContainer);
    return SidePageContainer;
}(React.Component));
export { SidePageContainer };
//# sourceMappingURL=SidePageContainer.js.map