"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__, {
    useShareToken: ()=>useShareToken,
    SharePage: ()=>SharePage,
    NotAuthorityResult: ()=>NotAuthorityResult,
    ShareLayout: ()=>ShareLayout
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_react_namespaceObject = require("react");
const css_namespaceObject = require("@emotion/css");
const external_antd_namespaceObject = require("antd");
const external_react_router_namespaceObject = require("react-router");
const external_react_router_dom_namespaceObject = require("react-router-dom");
const index_js_namespaceObject = require("../../api-client/index.js");
const admin_layout_index_js_namespaceObject = require("../../built-in/admin-layout/index.js");
const pinned_list_index_js_namespaceObject = require("../../built-in/pinned-list/index.js");
const system_settings_index_js_namespaceObject = require("../../built-in/system-settings/index.js");
const external_user_index_js_namespaceObject = require("../../user/index.js");
const external_hooks_index_js_namespaceObject = require("../hooks/index.js");
function _tagged_template_literal(strings, raw) {
    if (!raw) raw = strings.slice(0);
    return Object.freeze(Object.defineProperties(strings, {
        raw: {
            value: Object.freeze(raw)
        }
    }));
}
function _templateObject() {
    const data = _tagged_template_literal([
        "\n          display: flex;\n          flex-direction: column;\n          position: relative;\n          overflow-y: auto;\n          > div {\n            position: relative;\n          }\n          .ant-layout-footer {\n            position: absolute;\n            bottom: 0;\n            text-align: center;\n            width: 100%;\n            z-index: 0;\n            padding: 0px 50px;\n          }\n        "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
function useShareToken() {
    const url = new URL(window.location.href);
    const api = (0, index_js_namespaceObject.useAPIClient)();
    const token = url.searchParams.get('token');
    return token && api.auth.setToken(token), api.auth.getToken();
}
const ShareLayout = ()=>{
    var _result_data_data_logo, _result_data_data, _result_data, _result_data_data1, _result_data1;
    const { styles } = (0, admin_layout_index_js_namespaceObject.useStyles)();
    const app = (0, external_hooks_index_js_namespaceObject.useApp)();
    const result = (0, system_settings_index_js_namespaceObject.useSystemSettings)();
    const sideMenuRef = (0, external_react_namespaceObject.useRef)();
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Layout, {
        style: {
            height: '100%'
        },
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Layout.Content, {
            className: (0, css_namespaceObject.css)(_templateObject()),
            children: [
                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Layout.Header, {
                    className: styles.header,
                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                        className: styles.headerA,
                        children: [
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                                className: styles.headerB,
                                children: [
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                                        className: styles.titleContainer,
                                        onClick: ()=>{
                                            location.href = app.adminUrl;
                                        },
                                        children: [
                                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
                                                className: styles.logo,
                                                src: 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 : null === (_result_data_data_logo = _result_data_data.logo) || void 0 === _result_data_data_logo ? void 0 : _result_data_data_logo.url
                                            }),
                                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h1", {
                                                className: styles.title,
                                                children: 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 : _result_data_data1.title
                                            })
                                        ]
                                    }),
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(admin_layout_index_js_namespaceObject.MenuEditor, {
                                        sideMenuRef: sideMenuRef
                                    }),
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                                        className: styles.headerTabs,
                                        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(admin_layout_index_js_namespaceObject.AdminTabs, {})
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
                                className: styles.right,
                                children: [
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(pinned_list_index_js_namespaceObject.PinnedPluginList, {
                                        belongToFilter: "pinnedmenu"
                                    }),
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_user_index_js_namespaceObject.CurrentUser, {})
                                ]
                            })
                        ]
                    })
                }),
                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Outlet, {})
            ]
        })
    });
};
const SharePage = ()=>{
    const shareToken = useShareToken();
    return shareToken ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(admin_layout_index_js_namespaceObject.AdminProvider, {
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ShareLayout, {})
    }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NotAuthorityResult, {});
};
function NotAuthorityResult() {
    const { pathname, search } = (0, external_react_router_namespaceObject.useLocation)();
    const redirect = "?redirect=".concat(pathname).concat(search);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_namespaceObject.Navigate, {
        replace: true,
        to: "/signin".concat(redirect)
    });
}
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
});
