(self["webpackChunkblack_knight"] = self["webpackChunkblack_knight"] || []).push([[362],{

/***/ 6958:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// THIS FILE IS AUTO GENERATED
var GenIcon = (__webpack_require__(9720)/* .GenIcon */ .w_)
module.exports.BsPlus = function BsPlus (props) {
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 16 16","fill":"currentColor"},"child":[{"tag":"path","attr":{"fillRule":"evenodd","d":"M8 3.5a.5.5 0 01.5.5v4a.5.5 0 01-.5.5H4a.5.5 0 010-1h3.5V4a.5.5 0 01.5-.5z","clipRule":"evenodd"}},{"tag":"path","attr":{"fillRule":"evenodd","d":"M7.5 8a.5.5 0 01.5-.5h4a.5.5 0 010 1H8.5V12a.5.5 0 01-1 0V8z","clipRule":"evenodd"}}]})(props);
};


/***/ }),

/***/ 1004:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// THIS FILE IS AUTO GENERATED
var GenIcon = (__webpack_require__(9720)/* .GenIcon */ .w_)
module.exports.GiSoundWaves = function GiSoundWaves (props) {
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M468.53 236.03H486v39.94h-17.47v-39.94zm-34.426 51.634h17.47v-63.328h-17.47v63.328zm-33.848 32.756h17.47V191.58h-17.47v128.84zm-32.177 25.276h17.47V167.483h-17.47v178.17zm-34.448-43.521h17.47v-92.35h-17.47v92.35zm-34.994 69.879h17.47v-236.06h-17.525v236.06zM264.2 405.9h17.47V106.1H264.2V405.9zm-33.848-46.284h17.47V152.383h-17.47v207.234zm-35.016-58.85h17.47v-87.35h-17.47v87.35zm-33.847-20.823h17.47V231.98h-17.47v48.042zm-33.848 25.66h17.47v-99.24h-17.47v99.272zm-33.302 48.04h17.47V152.678H94.34v201zm-33.847-30.702h17.47V187.333h-17.47v135.642zM26 287.664h17.47v-63.328H26v63.328z"}}]})(props);
};


/***/ }),

/***/ 7706:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// THIS FILE IS AUTO GENERATED
var GenIcon = (__webpack_require__(9720)/* .GenIcon */ .w_)
module.exports.MdDelete = function MdDelete (props) {
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}}]})(props);
};


/***/ }),

/***/ 9530:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// THIS FILE IS AUTO GENERATED
var GenIcon = (__webpack_require__(9720)/* .GenIcon */ .w_)
module.exports.MdModeEdit = function MdModeEdit (props) {
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})(props);
};


/***/ }),

/***/ 499:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// THIS FILE IS AUTO GENERATED
var GenIcon = (__webpack_require__(9720)/* .GenIcon */ .w_)
module.exports.RiLockPasswordLine = function RiLockPasswordLine (props) {
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"g","attr":{},"child":[{"tag":"path","attr":{"fill":"none","d":"M0 0h24v24H0z"}},{"tag":"path","attr":{"d":"M18 8h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h2V7a6 6 0 1 1 12 0v1zM5 10v10h14V10H5zm6 4h2v2h-2v-2zm-4 0h2v2H7v-2zm8 0h2v2h-2v-2zm1-6V7a4 4 0 1 0-8 0v1h8z"}}]}]})(props);
};


/***/ }),

/***/ 2790:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// THIS FILE IS AUTO GENERATED
var GenIcon = (__webpack_require__(9720)/* .GenIcon */ .w_)
module.exports.VscGlobe = function VscGlobe (props) {
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 16 16","fill":"currentColor"},"child":[{"tag":"path","attr":{"fillRule":"evenodd","clipRule":"evenodd","d":"M8.5 1a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13zm4.894 4a5.527 5.527 0 0 0-3.053-2.676c.444.84.765 1.74.953 2.676h2.1zm.582 2.995A5.11 5.11 0 0 0 14 7.5a5.464 5.464 0 0 0-.213-1.5h-2.342c.032.331.055.664.055 1a10.114 10.114 0 0 1-.206 2h2.493c.095-.329.158-.665.19-1.005zm-3.535 0l.006-.051A9.04 9.04 0 0 0 10.5 7a8.994 8.994 0 0 0-.076-1H6.576A8.82 8.82 0 0 0 6.5 7a8.98 8.98 0 0 0 .233 2h3.534c.077-.332.135-.667.174-1.005zM10.249 5a8.974 8.974 0 0 0-1.255-2.97C8.83 2.016 8.666 2 8.5 2a3.62 3.62 0 0 0-.312.015l-.182.015L8 2.04A8.97 8.97 0 0 0 6.751 5h3.498zM5.706 5a9.959 9.959 0 0 1 .966-2.681A5.527 5.527 0 0 0 3.606 5h2.1zM3.213 6A5.48 5.48 0 0 0 3 7.5 5.48 5.48 0 0 0 3.213 9h2.493A10.016 10.016 0 0 1 5.5 7c0-.336.023-.669.055-1H3.213zm2.754 4h-2.36a5.515 5.515 0 0 0 3.819 2.893A10.023 10.023 0 0 1 5.967 10zM8.5 12.644A8.942 8.942 0 0 0 9.978 10H7.022A8.943 8.943 0 0 0 8.5 12.644zM11.033 10a10.024 10.024 0 0 1-1.459 2.893A5.517 5.517 0 0 0 13.393 10h-2.36z"}}]})(props);
};


/***/ }),

/***/ 1754:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ 4173:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ 2638:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ 9013:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var react_1 = __importStar(__webpack_require__(7294));
var utils_1 = __webpack_require__(5071);
var GiSoundWaves_1 = __webpack_require__(1004);
var RiLockPasswordLine_1 = __webpack_require__(499);
var VscGlobe_1 = __webpack_require__(2790);
var react_router_dom_1 = __webpack_require__(6068);
var jotai_1 = __webpack_require__(1131);
var state_1 = __webpack_require__(466);
var comps_1 = __webpack_require__(5520);
var Log_1 = __importDefault(__webpack_require__(6573));
__webpack_require__(4173);
var HeaderSection;
(function (HeaderSection) {
    HeaderSection["PROFILE"] = "PROFILE";
    HeaderSection["RECENT"] = "RECENT";
    HeaderSection["NONE"] = "NONE";
})(HeaderSection || (HeaderSection = {}));
var Header = function () {
    var _a = (0, react_router_dom_1.useParams)(), app_label = _a.app_label, model_name = _a.model_name;
    var _b = __read((0, react_1.useState)(HeaderSection.NONE), 2), Section = _b[0], setSection = _b[1];
    var UserSection = (0, react_1.useRef)(null);
    var _c = __read((0, jotai_1.useAtom)(state_1.UserAtom), 1), user = _c[0];
    var ChangeSection = function (newSection) {
        if (newSection === Section)
            return setSection(HeaderSection.NONE);
        if (Section === HeaderSection.NONE)
            document.addEventListener('click', CloseDropDown);
        return setSection(newSection);
    };
    function CloseDropDown(e) {
        setSection(function (section) {
            if (section === HeaderSection.NONE)
                return section;
            if (!UserSection.current)
                return section;
            if (!(e.target instanceof Node))
                return section;
            if (!e.target.isConnected)
                return section;
            if (UserSection.current.contains(e.target))
                return section;
            document.removeEventListener('click', CloseDropDown);
            return HeaderSection.NONE;
        });
    }
    return (react_1.default.createElement("div", { className: 'dashboard-header' },
        react_1.default.createElement("div", { className: 'active-section title_small' }, app_label ? (react_1.default.createElement(react_1.default.Fragment, null,
            app_label,
            " / ",
            model_name)) : ('--GG--')),
        react_1.default.createElement("div", { className: 'user-section', ref: UserSection },
            react_1.default.createElement("div", { className: 'user-section-wrapper' },
                react_1.default.createElement("div", { className: 'recent-actions', onClick: function () { return ChangeSection(HeaderSection.RECENT); } },
                    react_1.default.createElement(GiSoundWaves_1.GiSoundWaves, { size: 20 })),
                react_1.default.createElement("div", { className: 'avatar', onClick: function () { return ChangeSection(HeaderSection.PROFILE); } },
                    react_1.default.createElement("img", { src: user.avatar, alt: 'admin avatar' }))),
            react_1.default.createElement(DropDown, { Section: Section }))));
};
var DropDown = function (_a) {
    var Section = _a.Section;
    var _b = __read((0, jotai_1.useAtom)(state_1.UserAtom), 1), user = _b[0];
    var _c = __read((0, jotai_1.useAtom)(state_1.LogAtom), 2), logs = _c[0], UpdateLogs = _c[1];
    var WrapperClass = function () {
        switch (Section) {
            case HeaderSection.PROFILE:
                return ' profile ';
            case HeaderSection.RECENT:
                return ' recent ';
            default:
                return '';
        }
    };
    (0, react_1.useEffect)(function () {
        if (Section === HeaderSection.RECENT) {
            UpdateLogs();
        }
    }, [Section]);
    return (react_1.default.createElement("div", { className: 'dropdown-overflow' +
            (0, utils_1.C)(Section !== HeaderSection.NONE, 'active') },
        react_1.default.createElement("div", { className: 'dropdown-container' },
            react_1.default.createElement("div", { className: 'dropdown-wrapper' + WrapperClass() },
                react_1.default.createElement("div", { className: 'slide-container  title_smaller' },
                    react_1.default.createElement("div", { className: 'menu-wrapper slide' },
                        react_1.default.createElement("div", { className: 'dropdown-header title_smaller' },
                            "Welcome",
                            react_1.default.createElement("span", { className: 'username' }, user.username)),
                        react_1.default.createElement("div", { className: 'dropdown-columns' },
                            react_1.default.createElement("div", { className: 'dropdown-column', onClick: function () { return location.assign('/'); } },
                                react_1.default.createElement("div", { className: 'icon' },
                                    react_1.default.createElement("div", { className: 'before' },
                                        react_1.default.createElement(VscGlobe_1.VscGlobe, { size: 24 })),
                                    react_1.default.createElement("div", { className: 'after' },
                                        react_1.default.createElement(VscGlobe_1.VscGlobe, { size: 24 }))),
                                react_1.default.createElement("div", { className: 'holder' }, "View Site")),
                            react_1.default.createElement("div", { className: 'dropdown-column' },
                                react_1.default.createElement("div", { className: 'icon' },
                                    react_1.default.createElement("div", { className: 'before' },
                                        react_1.default.createElement(RiLockPasswordLine_1.RiLockPasswordLine, { size: 24 })),
                                    react_1.default.createElement("div", { className: 'after' },
                                        react_1.default.createElement(RiLockPasswordLine_1.RiLockPasswordLine, { size: 24 }))),
                                react_1.default.createElement("div", { className: 'holder' }, "Change Password"))),
                        react_1.default.createElement(comps_1.LogoutButton, null)),
                    react_1.default.createElement("div", { className: 'recent-wrapper slide' },
                        react_1.default.createElement("div", { className: 'dropdown-header title_smaller recent' }, "Recent Actions"),
                        logs.map(function (log, index) { return (react_1.default.createElement(Log_1.default, __assign({ key: index }, log))); })))))));
};
exports["default"] = Header;


/***/ }),

/***/ 6573:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var react_1 = __importDefault(__webpack_require__(7294));
var BsPlus_1 = __webpack_require__(6958);
var MdDelete_1 = __webpack_require__(7706);
var MdModeEdit_1 = __webpack_require__(9530);
var state_1 = __webpack_require__(466);
var LogAdd = {
    className: ' add ',
    icon: react_1.default.createElement(BsPlus_1.BsPlus, { fill: '#00dc7d', size: 24 }),
    title: 'Added',
};
var LogChange = {
    className: ' edit ',
    icon: react_1.default.createElement(MdModeEdit_1.MdModeEdit, { fill: '#efb80b', size: 20 }),
    title: 'Changed',
};
var LogDelete = {
    className: ' delete ',
    icon: react_1.default.createElement(MdDelete_1.MdDelete, { fill: '#e20338', size: 24 }),
    title: 'Deleted',
};
var GetLogData = function (flag) {
    switch (flag) {
        case state_1.LogFlag.ADDITION:
            return LogAdd;
        case state_1.LogFlag.CHANGE:
            return LogChange;
        case state_1.LogFlag.DELETION:
            return LogDelete;
    }
};
var Log = function (props) {
    var flag = props.flag, content_type = props.content_type, repr = props.repr;
    var _a = GetLogData(flag), icon = _a.icon, className = _a.className, title = _a.title;
    return (react_1.default.createElement("div", { className: 'dropdown-column-wrapper' + className },
        react_1.default.createElement("div", { className: 'dropdown-column-header title_smaller' },
            react_1.default.createElement("div", { className: 'icon' }, icon),
            react_1.default.createElement("div", { className: 'holder' }, title)),
        react_1.default.createElement("div", { className: 'dropdown-column-data description' },
            react_1.default.createElement("span", null, repr),
            react_1.default.createElement("span", { className: 'dot' }, "\u2022"),
            react_1.default.createElement("span", null, content_type))));
};
exports["default"] = Log;


/***/ }),

/***/ 8383:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var react_1 = __importDefault(__webpack_require__(7294));
var react_router_dom_1 = __webpack_require__(6068);
var jotai_1 = __webpack_require__(1131);
var state_1 = __webpack_require__(466);
__webpack_require__(2638);
var hexagon_svg_1 = __importDefault(__webpack_require__(7433));
var Sidebar = function () {
    var _a = __read((0, jotai_1.useAtom)(state_1.AdminAtom), 1), apps = _a[0].apps;
    return (react_1.default.createElement("div", { className: 'sidebar-container' },
        react_1.default.createElement("div", { className: 'sidebar-wrapper' }, apps.map(function (app, index) { return (react_1.default.createElement("div", { className: 'sidebar-category-wrappper', key: index },
            react_1.default.createElement("div", { className: 'category title_small' },
                react_1.default.createElement("span", null, AppName(app.name))),
            app.models.map(function (model, index) { return (react_1.default.createElement("div", { className: 'column title_smaller', key: index },
                react_1.default.createElement(react_router_dom_1.Link, { to: "".concat(app.app_label, "/").concat(model.name, "/"), className: 'right-side' },
                    react_1.default.createElement("div", { className: 'icon' },
                        react_1.default.createElement("img", { src: model.icon || hexagon_svg_1.default })),
                    react_1.default.createElement("div", { className: 'holder' }, model.plural_name)),
                react_1.default.createElement("div", { className: 'left-side' },
                    react_1.default.createElement(AddSvg, { link: "".concat(app.app_label, "/").concat(model.name, "/add") })))); }))); }))));
};
var AppName = function (s) {
    var ls = s.split(' ');
    if (ls.length > 1)
        return ls[0] + ' ...';
    return s;
};
exports["default"] = Sidebar;
var AddSvg = function (_a) {
    var link = _a.link;
    return (react_1.default.createElement(react_router_dom_1.Link, { to: link, className: 'add-container' },
        react_1.default.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '15', height: '15', viewBox: '0 0 1792 1792' },
            react_1.default.createElement("path", { fill: '#70bf2b', d: 'M1600 796v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z' }))));
};


/***/ }),

/***/ 3766:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var react_1 = __importStar(__webpack_require__(7294));
var react_router_dom_1 = __webpack_require__(6068);
var jotai_1 = __webpack_require__(1131);
var state_1 = __webpack_require__(466);
var Header_1 = __importDefault(__webpack_require__(9013));
var Sidebar_1 = __importDefault(__webpack_require__(8383));
__webpack_require__(1754);
var Dashboard = function () {
    var UpdateUser = (0, jotai_1.useSetAtom)(state_1.UserAtom);
    var UpdateAdmin = (0, jotai_1.useSetAtom)(state_1.AdminAtom);
    (0, react_1.useEffect)(function () {
        UpdateUser();
        UpdateAdmin();
    }, []);
    return (react_1.default.createElement("div", { className: 'dashboard-container' },
        react_1.default.createElement(Header_1.default, null),
        react_1.default.createElement("div", { className: 'dashboard-wrapper' },
            react_1.default.createElement(Sidebar_1.default, null),
            react_1.default.createElement("div", { className: 'brace' },
                react_1.default.createElement(react_1.Suspense, null,
                    react_1.default.createElement(react_router_dom_1.Outlet, null))))));
};
exports["default"] = Dashboard;


/***/ }),

/***/ 7433:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
module.exports = __webpack_require__.p + "assets/2536fcbea17b9b7466ef.svg";

/***/ })

},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ __webpack_require__.O(0, [160,222,712,394], () => (__webpack_exec__(3766)));
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=source_maps/Dashboard.1fd69a091a64d91d70e2.js.map