"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    SettingLayout: ()=>SettingLayout
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
require("react");
const icons_namespaceObject = require("@ant-design/icons");
const pro_components_namespaceObject = require("@ant-design/pro-components");
const external_antd_namespaceObject = require("antd");
const external_react_router_namespaceObject = require("react-router");
const index_js_namespaceObject = require("../../user/index.js");
const external_admin_layout_index_js_namespaceObject = require("../admin-layout/index.js");
const external_system_settings_index_js_namespaceObject = require("../system-settings/index.js");
const SettingLayout = (param)=>{
    let { selectedKeys, onClick, route, children, fullscreen } = param;
    var _result_data_data, _result_data, _result_data_data_logo, _result_data_data1, _result_data1, _data_data, _data_data1, _data_data2;
    const settings = {
        fixSiderbar: true,
        layout: 'mix',
        splitMenus: false,
        navTheme: 'light',
        contentWidth: 'Fluid',
        fixedHeader: true,
        siderMenuType: 'sub'
    };
    const location = (0, external_react_router_namespaceObject.useLocation)();
    const navigate = (0, external_react_router_namespaceObject.useNavigate)();
    const { data } = (0, index_js_namespaceObject.useCurrentUserContext)();
    const result = (0, external_system_settings_index_js_namespaceObject.useSystemSettings)();
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_admin_layout_index_js_namespaceObject.AdminProvider, {
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(pro_components_namespaceObject.ProConfigProvider, {
            hashed: false,
            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(pro_components_namespaceObject.ProLayout, {
                title: null == result ? void 0 : null === (_result_data = result.data) || void 0 === _result_data ? void 0 : null === (_result_data_data = _result_data.data) || void 0 === _result_data_data ? void 0 : _result_data_data.title,
                logo: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
                    src: null == result ? void 0 : null === (_result_data1 = result.data) || void 0 === _result_data1 ? void 0 : null === (_result_data_data1 = _result_data1.data) || void 0 === _result_data_data1 ? void 0 : null === (_result_data_data_logo = _result_data_data1.logo) || void 0 === _result_data_data_logo ? void 0 : _result_data_data_logo.url
                }),
                bgLayoutImgList: [
                    {
                        src: 'https://img.alicdn.com/imgextra/i2/O1CN01O4etvp1DvpFLKfuWq_!!6000000000279-2-tps-609-606.png',
                        left: 85,
                        bottom: 100,
                        height: '303px'
                    },
                    {
                        src: 'https://img.alicdn.com/imgextra/i2/O1CN01O4etvp1DvpFLKfuWq_!!6000000000279-2-tps-609-606.png',
                        bottom: -68,
                        right: -45,
                        height: '303px'
                    },
                    {
                        src: 'https://img.alicdn.com/imgextra/i3/O1CN018NxReL1shX85Yz6Cx_!!6000000005798-2-tps-884-496.png',
                        bottom: 0,
                        left: 0,
                        width: '331px'
                    }
                ],
                route: route,
                token: {
                    header: {
                        colorBgMenuItemSelected: 'rgba(0,0,0,0.04)'
                    }
                },
                location: location,
                siderMenuType: "group",
                menuProps: {
                    onClick,
                    selectedKeys
                },
                menu: {
                    collapsedShowGroupTitle: true
                },
                avatarProps: {
                    src: 'https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg',
                    size: 'small',
                    title: (null == data ? void 0 : null === (_data_data = data.data) || void 0 === _data_data ? void 0 : _data_data.nickname) || (null == data ? void 0 : null === (_data_data1 = data.data) || void 0 === _data_data1 ? void 0 : _data_data1.username) || (null == data ? void 0 : null === (_data_data2 = data.data) || void 0 === _data_data2 ? void 0 : _data_data2.email),
                    render: (props, dom)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
                            dropdownRender: ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SettingsMenu, {}),
                            children: dom
                        })
                },
                actionsRender: (props)=>{
                    if (props.isMobile) return [];
                    if ('undefined' == typeof window) return [];
                    return [
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
                            type: "text",
                            onClick: ()=>{
                                navigate('/admin');
                            },
                            icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.HomeFilled, {}, "HomeFilled")
                        }),
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
                            type: "text",
                            target: "_blank",
                            href: "https://tachybase.org",
                            icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.InfoCircleFilled, {}, "InfoCircleFilled")
                        }),
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
                            type: "text",
                            target: "_blank",
                            href: "https://github.com/tachybase/tachybase/issues",
                            icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.QuestionCircleFilled, {}, "QuestionCircleFilled")
                        }),
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
                            type: "text",
                            target: "_blank",
                            href: "https://github.com/tachybase/tachybase",
                            icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.GithubFilled, {}, "GithubFilled")
                        })
                    ];
                },
                pageTitleRender: false,
                headerTitleRender: (logo, title, _)=>{
                    const defaultDom = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
                        children: [
                            logo,
                            title
                        ]
                    });
                    if ('undefined' == typeof window) return defaultDom;
                    if (document.body.clientWidth < 1400) return defaultDom;
                    if (_.isMobile) return defaultDom;
                    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
                        children: defaultDom
                    });
                },
                ...settings,
                headerContentRender: ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_admin_layout_index_js_namespaceObject.NoticeArea, {}),
                contentStyle: {
                    padding: 0
                },
                children: fullscreen ? children : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(pro_components_namespaceObject.PageContainer, {
                    children: children
                })
            })
        })
    });
};
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
