/**
 * amis-ui v6.12.0-beta.0
 * Copyright 2018-2025 fex
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var amisCore = require('amis-core');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
(__react_jsx__["default"] || __react_jsx__).Fragment;
function Layout(_a) {
    var _b;
    var header = _a.header, headerClassName = _a.headerClassName, aside = _a.aside, _c = _a.asideClassName, asideClassName = _c === void 0 ? '' : _c, children = _a.children, className = _a.className, contentClassName = _a.contentClassName, folded = _a.folded, _d = _a.asideFixed, asideFixed = _d === void 0 ? true : _d, _e = _a.headerFixed, headerFixed = _e === void 0 ? true : _e, _f = _a.footer, footer = _f === void 0 ? false : _f, _g = _a.offScreen, offScreen = _g === void 0 ? false : _g, size = _a.size, boxed = _a.boxed, cx = _a.classnames, bodyClassName = _a.bodyClassName, mainClassName = _a.mainClassName;
    var body = (_J$X_("div", { className: cx("Layout-body", contentClassName) }, children));
    if (aside) {
        body = (_J$X_("div", { className: cx('Layout-content'), role: "main" }, body));
    }
    React__default["default"].useEffect(function () {
        bodyClassName && document.body.classList.add(bodyClassName);
        return function () {
            bodyClassName && document.body.classList.remove(bodyClassName);
        };
    }, [bodyClassName]);
    return (_J$X_("div", { className: cx("Layout", className, (_b = {
                'Layout--boxed': boxed,
                'Layout--withAside': !!aside,
                'Layout--headerFixed': header ? headerFixed : false,
                'Layout--asideFixed': aside ? asideFixed : false,
                'Layout--folded': folded,
                'Layout--offScreen': offScreen
            },
            _b["Layout--".concat(size)] = size,
            _b['Layout--noFooter'] = !footer,
            _b['Layout--noHeader'] = !header,
            _b)) },
        header ? (_J$X_("div", { className: cx('Layout-header', headerClassName) }, header)) : null,
        _J$X_("div", { className: cx('Layout-main', mainClassName) },
            aside ? (_J$X_("div", { className: cx("Layout-aside", asideClassName) },
                _J$X_("div", { className: cx('Layout-asideWrap') },
                    _J$X_("div", { id: "asideInner", className: cx('Layout-asideInner') }, aside)))) : null,
            body),
        footer ? (_J$X_("footer", { className: cx('Layout-footer'), role: "footer" }, footer)) : null));
}
var Layout$1 = amisCore.themeable(Layout);

exports.Layout = Layout;
exports["default"] = Layout$1;
