PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | assets/js/dist/admin/admin-notices.js +1177 -135 4.4.6 → 4.4.9 View file →
@@ -1,58 +1,59 @@
1 1 /******/ (() => { // webpackBootstrap
2 -/******/ "use strict";
3 2 /******/ var __webpack_modules__ = ({
4 3
5 -/***/ "./assets/src/js/api.js"
6 -/*!******************************!*\
7 - !*** ./assets/src/js/api.js ***!
8 - \******************************/
4 +/***/ "./assets/src/js/lpToastify.js"
5 +/*!*************************************!*\
6 + !*** ./assets/src/js/lpToastify.js ***!
7 + \*************************************/
9 8 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10 9
10 +"use strict";
11 11 __webpack_require__.r(__webpack_exports__);
12 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13 +/* harmony export */ show: () => (/* binding */ show)
14 14 /* harmony export */ });
15 +/* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! toastify-js */ "./node_modules/toastify-js/src/toastify.js");
16 +/* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(toastify_js__WEBPACK_IMPORTED_MODULE_0__);
17 +/* harmony import */ var toastify_js_src_toastify_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! toastify-js/src/toastify.css */ "./node_modules/toastify-js/src/toastify.css");
15 18 /**
16 - * List API on backend
19 + * Utils functions
17 20 *
18 - * @since 4.2.6
19 - * @version 1.0.2
21 + * @param url
22 + * @param data
23 + * @param functions
24 + * @since 4.3.0
25 + * @version 1.0.0
20 26 */
21 27
22 -const lplistAPI = {};
23 -let lp_rest_url;
24 -if ('undefined' !== typeof lpDataAdmin) {
25 - lp_rest_url = lpDataAdmin.lp_rest_url;
26 - lplistAPI.admin = {
27 - apiAdminNotice: lp_rest_url + 'lp/v1/admin/tools/admin-notices',
28 - apiAddons: lp_rest_url + 'lp/v1/addon/all',
29 - apiAddonAction: lp_rest_url + 'lp/v1/addon/action-n',
30 - apiAddonsPurchase: lp_rest_url + 'lp/v1/addon/info-addons-purchase',
31 - apiSearchCourses: lp_rest_url + 'lp/v1/admin/tools/search-course',
32 - apiSearchUsers: lp_rest_url + 'lp/v1/admin/tools/search-user',
33 - apiAssignUserCourse: lp_rest_url + 'lp/v1/admin/tools/assign-user-course',
34 - apiUnAssignUserCourse: lp_rest_url + 'lp/v1/admin/tools/unassign-user-course'
35 - };
36 -}
37 -if ('undefined' !== typeof lpData) {
38 - lp_rest_url = lpData.lp_rest_url;
39 - lplistAPI.frontend = {
40 - apiWidgets: lp_rest_url + 'lp/v1/widgets/api',
41 - apiCourses: lp_rest_url + 'lp/v1/courses/archive-course',
42 - // Deprecated API, don't load from v4.3.7
43 - apiAJAX: lp_rest_url + 'lp/v1/load_content_via_ajax/',
44 - // Deprecated since 4.3.0
45 - apiProfileCoverImage: lp_rest_url + 'lp/v1/profile/cover-image'
46 - };
47 -}
48 -if (lp_rest_url) {
49 - lplistAPI.apiCourses = lp_rest_url + 'lp/v1/courses/';
50 - lplistAPI.apiEditCoursesArchiveBlock = lp_rest_url + 'lp/v1/courses/edit-archive-block';
51 - lplistAPI.apiCoursesSuggest = lp_rest_url + 'lp/v1/courses/courses-suggest';
52 -}
53 -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lplistAPI);
54 28
29 +const argsToastify = {
30 + text: '',
31 + gravity: lpData.toast.gravity,
32 + // `top` or `bottom`
33 + position: lpData.toast.position,
34 + // `left`, `center` or `right`
35 + className: `${lpData.toast.classPrefix}`,
36 + close: lpData.toast.close == 1,
37 + stopOnFocus: lpData.toast.stopOnFocus == 1,
38 + duration: lpData.toast.duration
39 +};
40 +const show = (message, status = 'success', argsCustom) => {
41 + let args = argsToastify;
42 + if (argsCustom) {
43 + args = {
44 + ...args,
45 + ...argsCustom
46 + };
47 + }
48 + const toastify = new (toastify_js__WEBPACK_IMPORTED_MODULE_0___default())({
49 + ...args,
50 + text: message,
51 + className: `${lpData.toast.classPrefix} ${status}`
52 + });
53 + toastify.showToast();
54 +};
55 +
55 56 /***/ },
56 57
57 58 /***/ "./assets/src/js/utils.js"
58 59 /*!********************************!*\
@@ -59,8 +60,9 @@
59 60 !*** ./assets/src/js/utils.js ***!
60 61 \********************************/
61 62 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
62 63
64 +"use strict";
63 65 __webpack_require__.r(__webpack_exports__);
64 66 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
65 67 /* harmony export */ debounce: () => (/* binding */ debounce),
66 68 /* harmony export */ eventHandlers: () => (/* binding */ eventHandlers),
@@ -550,8 +552,1024 @@
550 552 }
551 553 }]);
552 554 };
553 555
556 +/***/ },
557 +
558 +/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css"
559 +/*!*****************************************************************************************!*\
560 + !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css ***!
561 + \*****************************************************************************************/
562 +(module, __webpack_exports__, __webpack_require__) {
563 +
564 +"use strict";
565 +__webpack_require__.r(__webpack_exports__);
566 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
567 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
568 +/* harmony export */ });
569 +/* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
570 +/* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
571 +/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
572 +/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
573 +// Imports
574 +
575 +
576 +var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
577 +// Module
578 +___CSS_LOADER_EXPORT___.push([module.id, `/*!
579 + * Toastify js 1.12.0
580 + * https://github.com/apvarun/toastify-js
581 + * @license MIT licensed
582 + *
583 + * Copyright (C) 2018 Varun A P
584 + */
585 +
586 +.toastify {
587 + padding: 12px 20px;
588 + color: #ffffff;
589 + display: inline-block;
590 + box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);
591 + background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);
592 + background: linear-gradient(135deg, #73a5ff, #5477f5);
593 + position: fixed;
594 + opacity: 0;
595 + transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
596 + border-radius: 2px;
597 + cursor: pointer;
598 + text-decoration: none;
599 + max-width: calc(50% - 20px);
600 + z-index: 2147483647;
601 +}
602 +
603 +.toastify.on {
604 + opacity: 1;
605 +}
606 +
607 +.toast-close {
608 + background: transparent;
609 + border: 0;
610 + color: white;
611 + cursor: pointer;
612 + font-family: inherit;
613 + font-size: 1em;
614 + opacity: 0.4;
615 + padding: 0 5px;
616 +}
617 +
618 +.toastify-right {
619 + right: 15px;
620 +}
621 +
622 +.toastify-left {
623 + left: 15px;
624 +}
625 +
626 +.toastify-top {
627 + top: -150px;
628 +}
629 +
630 +.toastify-bottom {
631 + bottom: -150px;
632 +}
633 +
634 +.toastify-rounded {
635 + border-radius: 25px;
636 +}
637 +
638 +.toastify-avatar {
639 + width: 1.5em;
640 + height: 1.5em;
641 + margin: -7px 5px;
642 + border-radius: 2px;
643 +}
644 +
645 +.toastify-center {
646 + margin-left: auto;
647 + margin-right: auto;
648 + left: 0;
649 + right: 0;
650 + max-width: fit-content;
651 + max-width: -moz-fit-content;
652 +}
653 +
654 +@media only screen and (max-width: 360px) {
655 + .toastify-right, .toastify-left {
656 + margin-left: auto;
657 + margin-right: auto;
658 + left: 0;
659 + right: 0;
660 + max-width: fit-content;
661 + }
662 +}
663 +`, "",{"version":3,"sources":["webpack://./node_modules/toastify-js/src/toastify.css"],"names":[],"mappings":"AAAA;;;;;;EAME;;AAEF;IACI,kBAAkB;IAClB,cAAc;IACd,qBAAqB;IACrB,uFAAuF;IACvF,6DAA6D;IAC7D,qDAAqD;IACrD,eAAe;IACf,UAAU;IACV,wDAAwD;IACxD,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,2BAA2B;IAC3B,mBAAmB;AACvB;;AAEA;IACI,UAAU;AACd;;AAEA;IACI,uBAAuB;IACvB,SAAS;IACT,YAAY;IACZ,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,YAAY;IACZ,cAAc;AAClB;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,UAAU;AACd;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,kBAAkB;AACtB;;AAEA;IACI,iBAAiB;IACjB,kBAAkB;IAClB,OAAO;IACP,QAAQ;IACR,sBAAsB;IACtB,2BAA2B;AAC/B;;AAEA;IACI;QACI,iBAAiB;QACjB,kBAAkB;QAClB,OAAO;QACP,QAAQ;QACR,sBAAsB;IAC1B;AACJ","sourcesContent":["/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n\n.toastify {\n padding: 12px 20px;\n color: #ffffff;\n display: inline-block;\n box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);\n background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);\n background: linear-gradient(135deg, #73a5ff, #5477f5);\n position: fixed;\n opacity: 0;\n transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);\n border-radius: 2px;\n cursor: pointer;\n text-decoration: none;\n max-width: calc(50% - 20px);\n z-index: 2147483647;\n}\n\n.toastify.on {\n opacity: 1;\n}\n\n.toast-close {\n background: transparent;\n border: 0;\n color: white;\n cursor: pointer;\n font-family: inherit;\n font-size: 1em;\n opacity: 0.4;\n padding: 0 5px;\n}\n\n.toastify-right {\n right: 15px;\n}\n\n.toastify-left {\n left: 15px;\n}\n\n.toastify-top {\n top: -150px;\n}\n\n.toastify-bottom {\n bottom: -150px;\n}\n\n.toastify-rounded {\n border-radius: 25px;\n}\n\n.toastify-avatar {\n width: 1.5em;\n height: 1.5em;\n margin: -7px 5px;\n border-radius: 2px;\n}\n\n.toastify-center {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n max-width: -moz-fit-content;\n}\n\n@media only screen and (max-width: 360px) {\n .toastify-right, .toastify-left {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n }\n}\n"],"sourceRoot":""}]);
664 +// Exports
665 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
666 +
667 +
668 +/***/ },
669 +
670 +/***/ "./node_modules/css-loader/dist/runtime/api.js"
671 +/*!*****************************************************!*\
672 + !*** ./node_modules/css-loader/dist/runtime/api.js ***!
673 + \*****************************************************/
674 +(module) {
675 +
676 +"use strict";
677 +
678 +
679 +/*
680 + MIT License http://www.opensource.org/licenses/mit-license.php
681 + Author Tobias Koppers @sokra
682 +*/
683 +module.exports = function (cssWithMappingToString) {
684 + var list = [];
685 +
686 + // return the list of modules as css string
687 + list.toString = function toString() {
688 + return this.map(function (item) {
689 + var content = "";
690 + var needLayer = typeof item[5] !== "undefined";
691 + if (item[4]) {
692 + content += "@supports (".concat(item[4], ") {");
693 + }
694 + if (item[2]) {
695 + content += "@media ".concat(item[2], " {");
696 + }
697 + if (needLayer) {
698 + content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
699 + }
700 + content += cssWithMappingToString(item);
701 + if (needLayer) {
702 + content += "}";
703 + }
704 + if (item[2]) {
705 + content += "}";
706 + }
707 + if (item[4]) {
708 + content += "}";
709 + }
710 + return content;
711 + }).join("");
712 + };
713 +
714 + // import a list of modules into the list
715 + list.i = function i(modules, media, dedupe, supports, layer) {
716 + if (typeof modules === "string") {
717 + modules = [[null, modules, undefined]];
718 + }
719 + var alreadyImportedModules = {};
720 + if (dedupe) {
721 + for (var k = 0; k < this.length; k++) {
722 + var id = this[k][0];
723 + if (id != null) {
724 + alreadyImportedModules[id] = true;
725 + }
726 + }
727 + }
728 + for (var _k = 0; _k < modules.length; _k++) {
729 + var item = [].concat(modules[_k]);
730 + if (dedupe && alreadyImportedModules[item[0]]) {
731 + continue;
732 + }
733 + if (typeof layer !== "undefined") {
734 + if (typeof item[5] === "undefined") {
735 + item[5] = layer;
736 + } else {
737 + item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
738 + item[5] = layer;
739 + }
740 + }
741 + if (media) {
742 + if (!item[2]) {
743 + item[2] = media;
744 + } else {
745 + item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
746 + item[2] = media;
747 + }
748 + }
749 + if (supports) {
750 + if (!item[4]) {
751 + item[4] = "".concat(supports);
752 + } else {
753 + item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
754 + item[4] = supports;
755 + }
756 + }
757 + list.push(item);
758 + }
759 + };
760 + return list;
761 +};
762 +
763 +/***/ },
764 +
765 +/***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js"
766 +/*!************************************************************!*\
767 + !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
768 + \************************************************************/
769 +(module) {
770 +
771 +"use strict";
772 +
773 +
774 +module.exports = function (item) {
775 + var content = item[1];
776 + var cssMapping = item[3];
777 + if (!cssMapping) {
778 + return content;
779 + }
780 + if (typeof btoa === "function") {
781 + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
782 + var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
783 + var sourceMapping = "/*# ".concat(data, " */");
784 + return [content].concat([sourceMapping]).join("\n");
785 + }
786 + return [content].join("\n");
787 +};
788 +
789 +/***/ },
790 +
791 +/***/ "./node_modules/toastify-js/src/toastify.css"
792 +/*!***************************************************!*\
793 + !*** ./node_modules/toastify-js/src/toastify.css ***!
794 + \***************************************************/
795 +(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
796 +
797 +"use strict";
798 +__webpack_require__.r(__webpack_exports__);
799 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
800 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
801 +/* harmony export */ });
802 +/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
803 +/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
804 +/* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
805 +/* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
806 +/* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
807 +/* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
808 +/* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
809 +/* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
810 +/* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
811 +/* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
812 +/* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
813 +/* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
814 +/* harmony import */ var _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../css-loader/dist/cjs.js!./toastify.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css");
815 +
816 +
817 +
818 +
819 +
820 +
821 +
822 +
823 +
824 +
825 +
826 +var options = {};
827 +
828 +options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
829 +options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
830 +
831 + options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
832 +
833 +options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
834 +options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
835 +
836 +var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
837 +
838 +
839 +
840 +
841 + /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
842 +
843 +
844 +/***/ },
845 +
846 +/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
847 +/*!****************************************************************************!*\
848 + !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
849 + \****************************************************************************/
850 +(module) {
851 +
852 +"use strict";
853 +
854 +
855 +var stylesInDOM = [];
856 +function getIndexByIdentifier(identifier) {
857 + var result = -1;
858 + for (var i = 0; i < stylesInDOM.length; i++) {
859 + if (stylesInDOM[i].identifier === identifier) {
860 + result = i;
861 + break;
862 + }
863 + }
864 + return result;
865 +}
866 +function modulesToDom(list, options) {
867 + var idCountMap = {};
868 + var identifiers = [];
869 + for (var i = 0; i < list.length; i++) {
870 + var item = list[i];
871 + var id = options.base ? item[0] + options.base : item[0];
872 + var count = idCountMap[id] || 0;
873 + var identifier = "".concat(id, " ").concat(count);
874 + idCountMap[id] = count + 1;
875 + var indexByIdentifier = getIndexByIdentifier(identifier);
876 + var obj = {
877 + css: item[1],
878 + media: item[2],
879 + sourceMap: item[3],
880 + supports: item[4],
881 + layer: item[5]
882 + };
883 + if (indexByIdentifier !== -1) {
884 + stylesInDOM[indexByIdentifier].references++;
885 + stylesInDOM[indexByIdentifier].updater(obj);
886 + } else {
887 + var updater = addElementStyle(obj, options);
888 + options.byIndex = i;
889 + stylesInDOM.splice(i, 0, {
890 + identifier: identifier,
891 + updater: updater,
892 + references: 1
893 + });
894 + }
895 + identifiers.push(identifier);
896 + }
897 + return identifiers;
898 +}
899 +function addElementStyle(obj, options) {
900 + var api = options.domAPI(options);
901 + api.update(obj);
902 + var updater = function updater(newObj) {
903 + if (newObj) {
904 + if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
905 + return;
906 + }
907 + api.update(obj = newObj);
908 + } else {
909 + api.remove();
910 + }
911 + };
912 + return updater;
913 +}
914 +module.exports = function (list, options) {
915 + options = options || {};
916 + list = list || [];
917 + var lastIdentifiers = modulesToDom(list, options);
918 + return function update(newList) {
919 + newList = newList || [];
920 + for (var i = 0; i < lastIdentifiers.length; i++) {
921 + var identifier = lastIdentifiers[i];
922 + var index = getIndexByIdentifier(identifier);
923 + stylesInDOM[index].references--;
924 + }
925 + var newLastIdentifiers = modulesToDom(newList, options);
926 + for (var _i = 0; _i < lastIdentifiers.length; _i++) {
927 + var _identifier = lastIdentifiers[_i];
928 + var _index = getIndexByIdentifier(_identifier);
929 + if (stylesInDOM[_index].references === 0) {
930 + stylesInDOM[_index].updater();
931 + stylesInDOM.splice(_index, 1);
932 + }
933 + }
934 + lastIdentifiers = newLastIdentifiers;
935 + };
936 +};
937 +
938 +/***/ },
939 +
940 +/***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js"
941 +/*!********************************************************************!*\
942 + !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
943 + \********************************************************************/
944 +(module) {
945 +
946 +"use strict";
947 +
948 +
949 +var memo = {};
950 +
951 +/* istanbul ignore next */
952 +function getTarget(target) {
953 + if (typeof memo[target] === "undefined") {
954 + var styleTarget = document.querySelector(target);
955 +
956 + // Special case to return head of iframe instead of iframe itself
957 + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
958 + try {
959 + // This will throw an exception if access to iframe is blocked
960 + // due to cross-origin restrictions
961 + styleTarget = styleTarget.contentDocument.head;
962 + } catch (e) {
963 + // istanbul ignore next
964 + styleTarget = null;
965 + }
966 + }
967 + memo[target] = styleTarget;
968 + }
969 + return memo[target];
970 +}
971 +
972 +/* istanbul ignore next */
973 +function insertBySelector(insert, style) {
974 + var target = getTarget(insert);
975 + if (!target) {
976 + throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
977 + }
978 + target.appendChild(style);
979 +}
980 +module.exports = insertBySelector;
981 +
982 +/***/ },
983 +
984 +/***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js"
985 +/*!**********************************************************************!*\
986 + !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
987 + \**********************************************************************/
988 +(module) {
989 +
990 +"use strict";
991 +
992 +
993 +/* istanbul ignore next */
994 +function insertStyleElement(options) {
995 + var element = document.createElement("style");
996 + options.setAttributes(element, options.attributes);
997 + options.insert(element, options.options);
998 + return element;
999 +}
1000 +module.exports = insertStyleElement;
1001 +
1002 +/***/ },
1003 +
1004 +/***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
1005 +/*!**********************************************************************************!*\
1006 + !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
1007 + \**********************************************************************************/
1008 +(module, __unused_webpack_exports, __webpack_require__) {
1009 +
1010 +"use strict";
1011 +
1012 +
1013 +/* istanbul ignore next */
1014 +function setAttributesWithoutAttributes(styleElement) {
1015 + var nonce = true ? __webpack_require__.nc : 0;
1016 + if (nonce) {
1017 + styleElement.setAttribute("nonce", nonce);
1018 + }
1019 +}
1020 +module.exports = setAttributesWithoutAttributes;
1021 +
1022 +/***/ },
1023 +
1024 +/***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js"
1025 +/*!***************************************************************!*\
1026 + !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
1027 + \***************************************************************/
1028 +(module) {
1029 +
1030 +"use strict";
1031 +
1032 +
1033 +/* istanbul ignore next */
1034 +function apply(styleElement, options, obj) {
1035 + var css = "";
1036 + if (obj.supports) {
1037 + css += "@supports (".concat(obj.supports, ") {");
1038 + }
1039 + if (obj.media) {
1040 + css += "@media ".concat(obj.media, " {");
1041 + }
1042 + var needLayer = typeof obj.layer !== "undefined";
1043 + if (needLayer) {
1044 + css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
1045 + }
1046 + css += obj.css;
1047 + if (needLayer) {
1048 + css += "}";
1049 + }
1050 + if (obj.media) {
1051 + css += "}";
1052 + }
1053 + if (obj.supports) {
1054 + css += "}";
1055 + }
1056 + var sourceMap = obj.sourceMap;
1057 + if (sourceMap && typeof btoa !== "undefined") {
1058 + css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
1059 + }
1060 +
1061 + // For old IE
1062 + /* istanbul ignore if */
1063 + options.styleTagTransform(css, styleElement, options.options);
1064 +}
1065 +function removeStyleElement(styleElement) {
1066 + // istanbul ignore if
1067 + if (styleElement.parentNode === null) {
1068 + return false;
1069 + }
1070 + styleElement.parentNode.removeChild(styleElement);
1071 +}
1072 +
1073 +/* istanbul ignore next */
1074 +function domAPI(options) {
1075 + if (typeof document === "undefined") {
1076 + return {
1077 + update: function update() {},
1078 + remove: function remove() {}
1079 + };
1080 + }
1081 + var styleElement = options.insertStyleElement(options);
1082 + return {
1083 + update: function update(obj) {
1084 + apply(styleElement, options, obj);
1085 + },
1086 + remove: function remove() {
1087 + removeStyleElement(styleElement);
1088 + }
1089 + };
1090 +}
1091 +module.exports = domAPI;
1092 +
1093 +/***/ },
1094 +
1095 +/***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js"
1096 +/*!*********************************************************************!*\
1097 + !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
1098 + \*********************************************************************/
1099 +(module) {
1100 +
1101 +"use strict";
1102 +
1103 +
1104 +/* istanbul ignore next */
1105 +function styleTagTransform(css, styleElement) {
1106 + if (styleElement.styleSheet) {
1107 + styleElement.styleSheet.cssText = css;
1108 + } else {
1109 + while (styleElement.firstChild) {
1110 + styleElement.removeChild(styleElement.firstChild);
1111 + }
1112 + styleElement.appendChild(document.createTextNode(css));
1113 + }
1114 +}
1115 +module.exports = styleTagTransform;
1116 +
1117 +/***/ },
1118 +
1119 +/***/ "./node_modules/toastify-js/src/toastify.js"
1120 +/*!**************************************************!*\
1121 + !*** ./node_modules/toastify-js/src/toastify.js ***!
1122 + \**************************************************/
1123 +(module) {
1124 +
1125 +/*!
1126 + * Toastify js 1.12.0
1127 + * https://github.com/apvarun/toastify-js
1128 + * @license MIT licensed
1129 + *
1130 + * Copyright (C) 2018 Varun A P
1131 + */
1132 +(function(root, factory) {
1133 + if ( true && module.exports) {
1134 + module.exports = factory();
1135 + } else {
1136 + root.Toastify = factory();
1137 + }
1138 +})(this, function(global) {
1139 + // Object initialization
1140 + var Toastify = function(options) {
1141 + // Returning a new init object
1142 + return new Toastify.lib.init(options);
1143 + },
1144 + // Library version
1145 + version = "1.12.0";
1146 +
1147 + // Set the default global options
1148 + Toastify.defaults = {
1149 + oldestFirst: true,
1150 + text: "Toastify is awesome!",
1151 + node: undefined,
1152 + duration: 3000,
1153 + selector: undefined,
1154 + callback: function () {
1155 + },
1156 + destination: undefined,
1157 + newWindow: false,
1158 + close: false,
1159 + gravity: "toastify-top",
1160 + positionLeft: false,
1161 + position: '',
1162 + backgroundColor: '',
1163 + avatar: "",
1164 + className: "",
1165 + stopOnFocus: true,
1166 + onClick: function () {
1167 + },
1168 + offset: {x: 0, y: 0},
1169 + escapeMarkup: true,
1170 + ariaLive: 'polite',
1171 + style: {background: ''}
1172 + };
1173 +
1174 + // Defining the prototype of the object
1175 + Toastify.lib = Toastify.prototype = {
1176 + toastify: version,
1177 +
1178 + constructor: Toastify,
1179 +
1180 + // Initializing the object with required parameters
1181 + init: function(options) {
1182 + // Verifying and validating the input object
1183 + if (!options) {
1184 + options = {};
1185 + }
1186 +
1187 + // Creating the options object
1188 + this.options = {};
1189 +
1190 + this.toastElement = null;
1191 +
1192 + // Validating the options
1193 + this.options.text = options.text || Toastify.defaults.text; // Display message
1194 + this.options.node = options.node || Toastify.defaults.node; // Display content as node
1195 + this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
1196 + this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
1197 + this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
1198 + this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
1199 + this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
1200 + this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
1201 + this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
1202 + this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
1203 + this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
1204 + this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
1205 + this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
1206 + this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
1207 + this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
1208 + this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
1209 + this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
1210 + this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
1211 + this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
1212 + this.options.style = options.style || Toastify.defaults.style;
1213 + if(options.backgroundColor) {
1214 + this.options.style.background = options.backgroundColor;
1215 + }
1216 +
1217 + // Returning the current object for chaining functions
1218 + return this;
1219 + },
1220 +
1221 + // Building the DOM element
1222 + buildToast: function() {
1223 + // Validating if the options are defined
1224 + if (!this.options) {
1225 + throw "Toastify is not initialized";
1226 + }
1227 +
1228 + // Creating the DOM object
1229 + var divElement = document.createElement("div");
1230 + divElement.className = "toastify on " + this.options.className;
1231 +
1232 + // Positioning toast to left or right or center
1233 + if (!!this.options.position) {
1234 + divElement.className += " toastify-" + this.options.position;
1235 + } else {
1236 + // To be depreciated in further versions
1237 + if (this.options.positionLeft === true) {
1238 + divElement.className += " toastify-left";
1239 + console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')
1240 + } else {
1241 + // Default position
1242 + divElement.className += " toastify-right";
1243 + }
1244 + }
1245 +
1246 + // Assigning gravity of element
1247 + divElement.className += " " + this.options.gravity;
1248 +
1249 + if (this.options.backgroundColor) {
1250 + // This is being deprecated in favor of using the style HTML DOM property
1251 + console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
1252 + }
1253 +
1254 + // Loop through our style object and apply styles to divElement
1255 + for (var property in this.options.style) {
1256 + divElement.style[property] = this.options.style[property];
1257 + }
1258 +
1259 + // Announce the toast to screen readers
1260 + if (this.options.ariaLive) {
1261 + divElement.setAttribute('aria-live', this.options.ariaLive)
1262 + }
1263 +
1264 + // Adding the toast message/node
1265 + if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
1266 + // If we have a valid node, we insert it
1267 + divElement.appendChild(this.options.node)
1268 + } else {
1269 + if (this.options.escapeMarkup) {
1270 + divElement.innerText = this.options.text;
1271 + } else {
1272 + divElement.innerHTML = this.options.text;
1273 + }
1274 +
1275 + if (this.options.avatar !== "") {
1276 + var avatarElement = document.createElement("img");
1277 + avatarElement.src = this.options.avatar;
1278 +
1279 + avatarElement.className = "toastify-avatar";
1280 +
1281 + if (this.options.position == "left" || this.options.positionLeft === true) {
1282 + // Adding close icon on the left of content
1283 + divElement.appendChild(avatarElement);
1284 + } else {
1285 + // Adding close icon on the right of content
1286 + divElement.insertAdjacentElement("afterbegin", avatarElement);
1287 + }
1288 + }
1289 + }
1290 +
1291 + // Adding a close icon to the toast
1292 + if (this.options.close === true) {
1293 + // Create a span for close element
1294 + var closeElement = document.createElement("button");
1295 + closeElement.type = "button";
1296 + closeElement.setAttribute("aria-label", "Close");
1297 + closeElement.className = "toast-close";
1298 + closeElement.innerHTML = "&#10006;";
1299 +
1300 + // Triggering the removal of toast from DOM on close click
1301 + closeElement.addEventListener(
1302 + "click",
1303 + function(event) {
1304 + event.stopPropagation();
1305 + this.removeElement(this.toastElement);
1306 + window.clearTimeout(this.toastElement.timeOutValue);
1307 + }.bind(this)
1308 + );
1309 +
1310 + //Calculating screen width
1311 + var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
1312 +
1313 + // Adding the close icon to the toast element
1314 + // Display on the right if screen width is less than or equal to 360px
1315 + if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
1316 + // Adding close icon on the left of content
1317 + divElement.insertAdjacentElement("afterbegin", closeElement);
1318 + } else {
1319 + // Adding close icon on the right of content
1320 + divElement.appendChild(closeElement);
1321 + }
1322 + }
1323 +
1324 + // Clear timeout while toast is focused
1325 + if (this.options.stopOnFocus && this.options.duration > 0) {
1326 + var self = this;
1327 + // stop countdown
1328 + divElement.addEventListener(
1329 + "mouseover",
1330 + function(event) {
1331 + window.clearTimeout(divElement.timeOutValue);
1332 + }
1333 + )
1334 + // add back the timeout
1335 + divElement.addEventListener(
1336 + "mouseleave",
1337 + function() {
1338 + divElement.timeOutValue = window.setTimeout(
1339 + function() {
1340 + // Remove the toast from DOM
1341 + self.removeElement(divElement);
1342 + },
1343 + self.options.duration
1344 + )
1345 + }
1346 + )
1347 + }
1348 +
1349 + // Adding an on-click destination path
1350 + if (typeof this.options.destination !== "undefined") {
1351 + divElement.addEventListener(
1352 + "click",
1353 + function(event) {
1354 + event.stopPropagation();
1355 + if (this.options.newWindow === true) {
1356 + window.open(this.options.destination, "_blank");
1357 + } else {
1358 + window.location = this.options.destination;
1359 + }
1360 + }.bind(this)
1361 + );
1362 + }
1363 +
1364 + if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
1365 + divElement.addEventListener(
1366 + "click",
1367 + function(event) {
1368 + event.stopPropagation();
1369 + this.options.onClick();
1370 + }.bind(this)
1371 + );
1372 + }
1373 +
1374 + // Adding offset
1375 + if(typeof this.options.offset === "object") {
1376 +
1377 + var x = getAxisOffsetAValue("x", this.options);
1378 + var y = getAxisOffsetAValue("y", this.options);
1379 +
1380 + var xOffset = this.options.position == "left" ? x : "-" + x;
1381 + var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
1382 +
1383 + divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
1384 +
1385 + }
1386 +
1387 + // Returning the generated element
1388 + return divElement;
1389 + },
1390 +
1391 + // Displaying the toast
1392 + showToast: function() {
1393 + // Creating the DOM object for the toast
1394 + this.toastElement = this.buildToast();
1395 +
1396 + // Getting the root element to with the toast needs to be added
1397 + var rootElement;
1398 + if (typeof this.options.selector === "string") {
1399 + rootElement = document.getElementById(this.options.selector);
1400 + } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {
1401 + rootElement = this.options.selector;
1402 + } else {
1403 + rootElement = document.body;
1404 + }
1405 +
1406 + // Validating if root element is present in DOM
1407 + if (!rootElement) {
1408 + throw "Root element is not defined";
1409 + }
1410 +
1411 + // Adding the DOM element
1412 + var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
1413 + rootElement.insertBefore(this.toastElement, elementToInsert);
1414 +
1415 + // Repositioning the toasts in case multiple toasts are present
1416 + Toastify.reposition();
1417 +
1418 + if (this.options.duration > 0) {
1419 + this.toastElement.timeOutValue = window.setTimeout(
1420 + function() {
1421 + // Remove the toast from DOM
1422 + this.removeElement(this.toastElement);
1423 + }.bind(this),
1424 + this.options.duration
1425 + ); // Binding `this` for function invocation
1426 + }
1427 +
1428 + // Supporting function chaining
1429 + return this;
1430 + },
1431 +
1432 + hideToast: function() {
1433 + if (this.toastElement.timeOutValue) {
1434 + clearTimeout(this.toastElement.timeOutValue);
1435 + }
1436 + this.removeElement(this.toastElement);
1437 + },
1438 +
1439 + // Removing the element from the DOM
1440 + removeElement: function(toastElement) {
1441 + // Hiding the element
1442 + // toastElement.classList.remove("on");
1443 + toastElement.className = toastElement.className.replace(" on", "");
1444 +
1445 + // Removing the element from DOM after transition end
1446 + window.setTimeout(
1447 + function() {
1448 + // remove options node if any
1449 + if (this.options.node && this.options.node.parentNode) {
1450 + this.options.node.parentNode.removeChild(this.options.node);
1451 + }
1452 +
1453 + // Remove the element from the DOM, only when the parent node was not removed before.
1454 + if (toastElement.parentNode) {
1455 + toastElement.parentNode.removeChild(toastElement);
1456 + }
1457 +
1458 + // Calling the callback function
1459 + this.options.callback.call(toastElement);
1460 +
1461 + // Repositioning the toasts again
1462 + Toastify.reposition();
1463 + }.bind(this),
1464 + 400
1465 + ); // Binding `this` for function invocation
1466 + },
1467 + };
1468 +
1469 + // Positioning the toasts on the DOM
1470 + Toastify.reposition = function() {
1471 +
1472 + // Top margins with gravity
1473 + var topLeftOffsetSize = {
1474 + top: 15,
1475 + bottom: 15,
1476 + };
1477 + var topRightOffsetSize = {
1478 + top: 15,
1479 + bottom: 15,
1480 + };
1481 + var offsetSize = {
1482 + top: 15,
1483 + bottom: 15,
1484 + };
1485 +
1486 + // Get all toast messages on the DOM
1487 + var allToasts = document.getElementsByClassName("toastify");
1488 +
1489 + var classUsed;
1490 +
1491 + // Modifying the position of each toast element
1492 + for (var i = 0; i < allToasts.length; i++) {
1493 + // Getting the applied gravity
1494 + if (containsClass(allToasts[i], "toastify-top") === true) {
1495 + classUsed = "toastify-top";
1496 + } else {
1497 + classUsed = "toastify-bottom";
1498 + }
1499 +
1500 + var height = allToasts[i].offsetHeight;
1501 + classUsed = classUsed.substr(9, classUsed.length-1)
1502 + // Spacing between toasts
1503 + var offset = 15;
1504 +
1505 + var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
1506 +
1507 + // Show toast in center if screen with less than or equal to 360px
1508 + if (width <= 360) {
1509 + // Setting the position
1510 + allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
1511 +
1512 + offsetSize[classUsed] += height + offset;
1513 + } else {
1514 + if (containsClass(allToasts[i], "toastify-left") === true) {
1515 + // Setting the position
1516 + allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
1517 +
1518 + topLeftOffsetSize[classUsed] += height + offset;
1519 + } else {
1520 + // Setting the position
1521 + allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
1522 +
1523 + topRightOffsetSize[classUsed] += height + offset;
1524 + }
1525 + }
1526 + }
1527 +
1528 + // Supporting function chaining
1529 + return this;
1530 + };
1531 +
1532 + // Helper function to get offset.
1533 + function getAxisOffsetAValue(axis, options) {
1534 +
1535 + if(options.offset[axis]) {
1536 + if(isNaN(options.offset[axis])) {
1537 + return options.offset[axis];
1538 + }
1539 + else {
1540 + return options.offset[axis] + 'px';
1541 + }
1542 + }
1543 +
1544 + return '0px';
1545 +
1546 + }
1547 +
1548 + function containsClass(elem, yourClass) {
1549 + if (!elem || typeof yourClass !== "string") {
1550 + return false;
1551 + } else if (
1552 + elem.className &&
1553 + elem.className
1554 + .trim()
1555 + .split(/\s+/gi)
1556 + .indexOf(yourClass) > -1
1557 + ) {
1558 + return true;
1559 + } else {
1560 + return false;
1561 + }
1562 + }
1563 +
1564 + // Setting up the prototype for the init object
1565 + Toastify.lib.init.prototype = Toastify.lib;
1566 +
1567 + // Returning the Toastify function to be assigned to the window object/module
1568 + return Toastify;
1569 +});
1570 +
1571 +
554 1572 /***/ }
555 1573
556 1574 /******/ });
557 1575 /************************************************************************/
@@ -566,9 +1584,9 @@
566 1584 /******/ return cachedModule.exports;
567 1585 /******/ }
568 1586 /******/ // Create a new module (and put it into the cache)
569 1587 /******/ var module = __webpack_module_cache__[moduleId] = {
570 -/******/ // no module.id needed
1588 +/******/ id: moduleId,
571 1589 /******/ // no module.loaded needed
572 1590 /******/ exports: {}
573 1591 /******/ };
574 1592 /******/
@@ -578,9 +1596,9 @@
578 1596 /******/ var e = new Error("Cannot find module '" + moduleId + "'");
579 1597 /******/ e.code = 'MODULE_NOT_FOUND';
580 1598 /******/ throw e;
581 1599 /******/ }
582 -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1600 +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
583 1601 /******/
584 1602 /******/ // Return the exports of the module
585 1603 /******/ return module.exports;
586 1604 /******/ }
@@ -585,8 +1603,20 @@
585 1603 /******/ return module.exports;
586 1604 /******/ }
587 1605 /******/
588 1606 /************************************************************************/
1607 +/******/ /* webpack/runtime/compat get default export */
1608 +/******/ (() => {
1609 +/******/ // getDefaultExport function for compatibility with non-harmony modules
1610 +/******/ __webpack_require__.n = (module) => {
1611 +/******/ var getter = module && module.__esModule ?
1612 +/******/ () => (module['default']) :
1613 +/******/ () => (module);
1614 +/******/ __webpack_require__.d(getter, { a: getter });
1615 +/******/ return getter;
1616 +/******/ };
1617 +/******/ })();
1618 +/******/
589 1619 /******/ /* webpack/runtime/define property getters */
590 1620 /******/ (() => {
591 1621 /******/ // define getter functions for harmony exports
592 1622 /******/ __webpack_require__.d = (exports, definition) => {
@@ -613,126 +1643,138 @@
613 1643 /******/ Object.defineProperty(exports, '__esModule', { value: true });
614 1644 /******/ };
615 1645 /******/ })();
616 1646 /******/
1647 +/******/ /* webpack/runtime/nonce */
1648 +/******/ (() => {
1649 +/******/ __webpack_require__.nc = undefined;
1650 +/******/ })();
1651 +/******/
617 1652 /************************************************************************/
618 1653 var __webpack_exports__ = {};
619 -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
1654 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
620 1655 (() => {
1656 +"use strict";
621 1657 /*!**********************************************!*\
622 1658 !*** ./assets/src/js/admin/admin-notices.js ***!
623 1659 \**********************************************/
624 1660 __webpack_require__.r(__webpack_exports__);
625 -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./assets/src/js/utils.js");
626 -/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../api.js */ "./assets/src/js/api.js");
1661 +/* harmony import */ var lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lpAssetsJsPath/utils.js */ "./assets/src/js/utils.js");
1662 +/* harmony import */ var lpAssetsJsPath_lpToastify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lpAssetsJsPath/lpToastify.js */ "./assets/src/js/lpToastify.js");
627 1663 /**
628 1664 * Script handle admin notices.
629 1665 *
630 1666 * @since 4.1.7.3.2
631 - * @version 1.0.2
1667 + * @version 1.0.3
632 1668 */
633 1669
634 1670
635 -let elLPAdminNotices = null;
636 -let dataHtml = null;
637 -const queryString = window.location.search;
638 -const urlParams = new URLSearchParams(queryString);
639 -const tab = urlParams.get('tab');
640 -const notifyAddonsNewVersion = () => {
641 - try {
642 - const elAdminMenu = document.querySelector('#adminmenu');
643 - if (!elAdminMenu) {
644 - return;
1671 +class AdminNotices {
1672 + static selectors = {
1673 + elAddonsNewVersionTotals: '.lp-addons-new-version-totals',
1674 + elBtnDismiss: '.btn-lp-notice-dismiss',
1675 + elAdminMenu: '#adminmenu',
1676 + elTabLP: '#toplevel_page_learn_press',
1677 + elTabLPName: '.wp-menu-name',
1678 + elTabLPNotice: '.tab-lp-admin-notice',
1679 + elTabLPAddons: 'a[href="admin.php?page=learn-press-addons"]',
1680 + elMenuAddons: '.lp-menu-addons',
1681 + elUpdatePlugins: '.update-plugins',
1682 + elMessage: '.learn-press-message'
1683 + };
1684 + init() {
1685 + lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpOnElementReady(AdminNotices.selectors.elAddonsNewVersionTotals, () => {
1686 + this.notifyAddonsNewVersion();
1687 + });
1688 + this.events();
1689 + }
1690 + notifyAddonsNewVersion() {
1691 + try {
1692 + const elAdminMenu = document.querySelector(AdminNotices.selectors.elAdminMenu);
1693 + if (!elAdminMenu) {
1694 + return;
1695 + }
1696 + const elTabLP = elAdminMenu.querySelector(AdminNotices.selectors.elTabLP);
1697 + if (!elTabLP) {
1698 + return;
1699 + }
1700 + const elTabLPName = elTabLP.querySelector(AdminNotices.selectors.elTabLPName);
1701 + if (!elTabLPName) {
1702 + return;
1703 + }
1704 + const elAddonsNewVerTotal = document.querySelector(AdminNotices.selectors.elAddonsNewVersionTotals);
1705 + if (!elAddonsNewVerTotal) {
1706 + return;
1707 + }
1708 + const htmlNotifyLP = `<span class="tab-lp-admin-notice"></span>`;
1709 + if (!elTabLPName.querySelector(AdminNotices.selectors.elTabLPNotice)) {
1710 + elTabLPName.insertAdjacentHTML('beforeend', htmlNotifyLP);
1711 + }
1712 + const elTabLPAddons = elTabLP.querySelector(AdminNotices.selectors.elTabLPAddons);
1713 + if (!elTabLPAddons) {
1714 + return;
1715 + }
1716 + const total = elAddonsNewVerTotal.dataset.total;
1717 + const elMenuAddons = elTabLPAddons.querySelector(AdminNotices.selectors.elMenuAddons);
1718 + if (!elMenuAddons) {
1719 + return;
1720 + }
1721 + elTabLPAddons.setAttribute('href', 'admin.php?page=learn-press-addons&tab=update');
1722 + elMenuAddons.textContent = total;
1723 + elMenuAddons.classList.remove(lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpClassName.hidden);
1724 + } catch (e) {
1725 + console.log(e);
645 1726 }
646 - const elTabLP = elAdminMenu.querySelector('#toplevel_page_learn_press');
647 - if (!elTabLP) {
1727 + }
1728 +
1729 + /*** Events ***/
1730 + events() {
1731 + if (AdminNotices._loadedEvents) {
648 1732 return;
649 1733 }
650 - const elTabLPName = elTabLP.querySelector('.wp-menu-name');
651 - if (!elTabLPName) {
652 - return;
653 - }
654 - const elAddonsNewVerTotal = document.querySelector('input[name=lp-addons-new-version-totals]');
655 - if (!elAddonsNewVerTotal) {
656 - return;
657 - }
658 - const htmlNotifyLP = `<span class="tab-lp-admin-notice"></span>`;
659 - elTabLPName.insertAdjacentHTML('beforeend', htmlNotifyLP);
660 - const elTabLPAddons = elTabLP.querySelector('a[href="admin.php?page=learn-press-addons"]');
661 - if (!elTabLPAddons) {
662 - return;
663 - }
664 - const total = elAddonsNewVerTotal.value;
665 - const html = `<span style="margin-left: 5px" class="update-plugins">${total}</span>`;
666 - elTabLPAddons.setAttribute('href', 'admin.php?page=learn-press-addons&tab=update');
667 - elTabLPAddons.insertAdjacentHTML('beforeend', html);
668 - } catch (e) {
669 - console.log(e);
1734 + AdminNotices._loadedEvents = true;
1735 + lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.eventHandlers('click', [{
1736 + selector: AdminNotices.selectors.elBtnDismiss,
1737 + class: this,
1738 + callBack: this.dismissNotice.name
1739 + }]);
670 1740 }
671 -};
672 -const callAdminNotices = (set = '') => {
673 - if (!lpGlobalSettings.is_admin) {
674 - return;
675 - }
676 - let params = tab ? `?tab=${tab}` : '';
677 - params += set ? (tab ? '&' : '?') + `${set}` : '';
678 - fetch(_api_js__WEBPACK_IMPORTED_MODULE_1__["default"].admin.apiAdminNotice + params, {
679 - method: 'POST',
680 - headers: {
681 - 'X-WP-Nonce': lpGlobalSettings.nonce
682 - }
683 - }).then(res => res.json()).then(res => {
684 - // console.log(data);
685 -
1741 + dismissNotice(args) {
686 1742 const {
687 - status,
688 - message,
689 - data
690 - } = res;
691 - if (status === 'success') {
692 - if ('Dismissed!' !== message) {
693 - dataHtml = data.content;
694 - if (dataHtml.length === 0) {
695 - elLPAdminNotices.style.display = 'none';
696 - } else {
697 - elLPAdminNotices.innerHTML = dataHtml;
698 - elLPAdminNotices.style.display = 'block';
699 - // Handle notify addons new version.
700 - notifyAddonsNewVersion();
701 - }
702 - }
703 - } else {
704 - dataHtml = message;
1743 + e,
1744 + target
1745 + } = args;
1746 + const el = target.closest(AdminNotices.selectors.elBtnDismiss);
1747 + if (!el) {
1748 + return;
705 1749 }
706 - }).catch(err => {
707 - console.log(err);
708 - });
709 -};
710 -
711 -// Listen element ready
712 -(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpOnElementReady)('.lp-admin-notices', () => {
713 - elLPAdminNotices = document.querySelector('.lp-admin-notices');
714 - callAdminNotices();
715 -});
716 -
717 -/*** Events ***/
718 -document.addEventListener('click', e => {
719 - const el = e.target;
720 - if (el.classList.contains('btn-lp-notice-dismiss')) {
721 1750 e.preventDefault();
722 1751
723 1752 // eslint-disable-next-line no-alert
724 - if (confirm('Are you sure you want to dismiss this notice?')) {
725 - const parent = el.closest('.lp-notice');
726 - callAdminNotices(`dismiss=${el.getAttribute('data-dismiss')}`);
727 - parent.remove();
728 - if (elLPAdminNotices.querySelectorAll('.lp-notice').length === 0) {
729 - elLPAdminNotices.style.display = 'none';
730 - }
1753 + if (confirm(el.dataset.message)) {
1754 + const parent = el.closest(AdminNotices.selectors.elMessage);
1755 + const dataSend = JSON.parse(el.dataset.send);
1756 + window.lpAJAXG.fetchAJAX(dataSend, {
1757 + success: response => {
1758 + const {
1759 + message,
1760 + status
1761 + } = response;
1762 + lpAssetsJsPath_lpToastify_js__WEBPACK_IMPORTED_MODULE_1__.show(message, status);
1763 + if (status === 'success') {
1764 + parent?.remove();
1765 + }
1766 + },
1767 + error: error => {
1768 + lpAssetsJsPath_lpToastify_js__WEBPACK_IMPORTED_MODULE_1__.show(error, 'error');
1769 + }
1770 + });
731 1771 }
732 1772 }
733 -});
1773 +}
1774 +const adminNotices = new AdminNotices();
1775 +adminNotices.init();
734 1776 })();
735 1777
736 1778 /******/ })()
737 1779 ;
738 1780 //# sourceMappingURL=admin-notices.js.map