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 +1329 -164 4.4.1 → 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,12 +60,14 @@
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),
69 +/* harmony export */ fullScreenView: () => (/* binding */ fullScreenView),
67 70 /* harmony export */ getDataOfForm: () => (/* binding */ getDataOfForm),
68 71 /* harmony export */ getFieldKeysOfForm: () => (/* binding */ getFieldKeysOfForm),
69 72 /* harmony export */ listenElementCreated: () => (/* binding */ listenElementCreated),
70 73 /* harmony export */ listenElementViewed: () => (/* binding */ listenElementViewed),
@@ -76,9 +79,10 @@
76 79 /* harmony export */ lpOnElementReady: () => (/* binding */ lpOnElementReady),
77 80 /* harmony export */ lpSetLoadingEl: () => (/* binding */ lpSetLoadingEl),
78 81 /* harmony export */ lpShowHideEl: () => (/* binding */ lpShowHideEl),
79 82 /* harmony export */ mergeDataWithDatForm: () => (/* binding */ mergeDataWithDatForm),
80 -/* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse)
83 +/* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse),
84 +/* harmony export */ toggleEnable: () => (/* binding */ toggleEnable)
81 85 /* harmony export */ });
82 86 /**
83 87 * Utils functions
84 88 *
@@ -85,9 +89,9 @@
85 89 * @param url
86 90 * @param data
87 91 * @param functions
88 92 * @since 4.2.5.1
89 - * @version 1.0.6
93 + * @version 1.0.7
90 94 */
91 95 const lpClassName = {
92 96 hidden: 'lp-hidden',
93 97 loading: 'loading',
@@ -92,9 +96,12 @@
92 96 hidden: 'lp-hidden',
93 97 loading: 'loading',
94 98 elCollapse: 'lp-collapse',
95 99 elSectionToggle: '.lp-section-toggle',
96 - elTriggerToggle: '.lp-trigger-toggle'
100 + elTriggerToggle: '.lp-trigger-toggle',
101 + elBtnFullScreen: '.lp-btn-full-screen-view',
102 + elFullScreen: 'lp-full-screen-view',
103 + elBtnFullScreenClose: 'lp-full-screen-view__close'
97 104 };
98 105 const lpFetchAPI = (url, data = {}, functions = {}) => {
99 106 if ('function' === typeof functions.before) {
100 107 functions.before();
@@ -412,25 +419,1174 @@
412 419 timer = setTimeout(() => func(args), wait);
413 420 };
414 421 };
415 422
423 +/**
424 + * Initialize lp-toggle-enable components.
425 + *
426 + * Finds all `.lp-toggle-enable` elements and wires up toggle behavior.
427 + * Reads initial state from `data-enabled` attribute ("true"/"false").
428 + * Calls `data-on-toggle` callback (if provided via options) on state change.
429 + *
430 + * HTML structure:
431 + * <label class="lp-toggle-enable" data-enabled="true">
432 + * <input type="checkbox" class="lp-toggle-enable__input" />
433 + * <span class="lp-toggle-enable__track"></span>
434 + * </label>
435 + *
436 + * @param {string} selector CSS selector for toggle elements (default: '.lp-toggle-enable')
437 + * @param {Function} onToggle Optional callback( el, isEnabled ) called on state change
438 + * @since 4.4.5
439 + * @version 1.0.0
440 + */
441 +window.lpToggleEnableInit = 0;
442 +const toggleEnable = (onToggle = null) => {
443 + if (window.lpToggleEnableInit) {
444 + return;
445 + }
446 + window.lpToggleEnableInit = 1;
447 + const selector = '.lp-toggle-enable';
448 + const updateUI = (toggle, isEnabled) => {
449 + toggle.classList.toggle('is-enabled', isEnabled);
450 + const input = toggle.querySelector('.lp-toggle-enable__input');
451 + if (input) {
452 + input.checked = isEnabled;
453 + input.value = isEnabled ? '1' : '0';
454 + }
455 + };
456 +
457 + // Delegate click handling via eventHandlers.
458 + eventHandlers('click', [{
459 + selector,
460 + callBack: args => {
461 + const {
462 + e,
463 + target
464 + } = args;
465 + const toggle = target.closest(selector);
466 + if (!toggle || toggle.classList.contains('is-disabled')) {
467 + return;
468 + }
469 + e.preventDefault();
470 + const isEnabled = !toggle.classList.contains('is-enabled');
471 + updateUI(toggle, isEnabled);
472 + if ('function' === typeof onToggle) {
473 + onToggle(toggle, isEnabled);
474 + }
475 + }
476 + }]);
477 +};
478 +
479 +/**
480 + * Initialize custom fullscreen view buttons.
481 + *
482 + * Delegates clicks on `.lp-btn-full-screen-view` buttons to
483 + * `lpToggleFullscreenView`. Reads the `data-target` attribute to find the
484 + * target element. Falls back to the button's parent element when
485 + * `data-target` is not provided.
486 + *
487 + * @since 4.4.5
488 + * @version 1.0.0
489 + */
490 +window.lpFullScreenViewInit = 0;
491 +const fullScreenView = () => {
492 + if (window.lpFullScreenViewInit) {
493 + return;
494 + }
495 + window.lpFullScreenViewInit = 1;
496 + let lastScrollY = 0;
497 + const lpToggleFullscreenView = (elTarget, elBtnFullScreen = null) => {
498 + const isFullscreen = elTarget.classList.contains(lpClassName.elFullScreen);
499 + if (isFullscreen) {
500 + elTarget.classList.remove(lpClassName.elFullScreen);
501 + document.documentElement.classList.remove('lp-full-screen-active');
502 + window.scrollTo(0, lastScrollY);
503 + } else {
504 + lastScrollY = window.scrollY;
505 + elTarget.classList.add(lpClassName.elFullScreen);
506 + document.documentElement.classList.add('lp-full-screen-active');
507 + }
508 + if (!isFullscreen) {
509 + if (!elTarget.querySelector(`.${lpClassName.elBtnFullScreenClose}`)) {
510 + const closeButton = document.createElement('button');
511 + closeButton.type = 'button';
512 + closeButton.className = lpClassName.elBtnFullScreenClose;
513 + closeButton.setAttribute('aria-label', 'Close');
514 + closeButton.innerHTML = lpData.i18n.closeButtonFullScreen || 'Close &times;';
515 + closeButton.addEventListener('click', e => {
516 + e.preventDefault();
517 + lpToggleFullscreenView(elTarget);
518 + });
519 + elTarget.appendChild(closeButton);
520 + }
521 + } else {
522 + const closeButton = elTarget.querySelector(`.${lpClassName.elBtnFullScreenClose}`);
523 + if (closeButton) {
524 + closeButton.remove();
525 + }
526 + }
527 + };
528 + eventHandlers('click', [{
529 + selector: lpClassName.elBtnFullScreen,
530 + callBack: args => {
531 + const {
532 + e,
533 + target
534 + } = args;
535 + const elBtnFullScreen = target.closest(lpClassName.elBtnFullScreen);
536 + if (!elBtnFullScreen) {
537 + console.log('No full screen button found');
538 + return;
539 + }
540 + e.preventDefault();
541 + let elTarget = null;
542 + const targetSelector = elBtnFullScreen.dataset.targetFullscreen;
543 + console.log(targetSelector);
544 + if (targetSelector) {
545 + elTarget = document.querySelector(targetSelector);
546 + }
547 + if (!elTarget) {
548 + console.log('No target element found');
549 + return;
550 + }
551 + lpToggleFullscreenView(elTarget, elBtnFullScreen);
552 + }
553 + }]);
554 +};
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 +
416 1572 /***/ }
417 1573
418 1574 /******/ });
419 1575 /************************************************************************/
420 1576 /******/ // The module cache
421 -/******/ const __webpack_module_cache__ = {};
1577 +/******/ var __webpack_module_cache__ = {};
422 1578 /******/
423 1579 /******/ // The require function
424 1580 /******/ function __webpack_require__(moduleId) {
425 1581 /******/ // Check if module is in cache
426 -/******/ const cachedModule = __webpack_module_cache__[moduleId];
1582 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
427 1583 /******/ if (cachedModule !== undefined) {
428 1584 /******/ return cachedModule.exports;
429 1585 /******/ }
430 1586 /******/ // Create a new module (and put it into the cache)
431 -/******/ const module = __webpack_module_cache__[moduleId] = {
432 -/******/ // no module.id needed
1587 +/******/ var module = __webpack_module_cache__[moduleId] = {
1588 +/******/ id: moduleId,
433 1589 /******/ // no module.loaded needed
434 1590 /******/ exports: {}
435 1591 /******/ };
436 1592 /******/
@@ -436,13 +1592,13 @@
436 1592 /******/
437 1593 /******/ // Execute the module function
438 1594 /******/ if (!(moduleId in __webpack_modules__)) {
439 1595 /******/ delete __webpack_module_cache__[moduleId];
440 -/******/ const e = new Error("Cannot find module '" + moduleId + "'");
1596 +/******/ var e = new Error("Cannot find module '" + moduleId + "'");
441 1597 /******/ e.code = 'MODULE_NOT_FOUND';
442 1598 /******/ throw e;
443 1599 /******/ }
444 -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1600 +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
445 1601 /******/
446 1602 /******/ // Return the exports of the module
447 1603 /******/ return module.exports;
448 1604 /******/ }
@@ -447,31 +1603,28 @@
447 1603 /******/ return module.exports;
448 1604 /******/ }
449 1605 /******/
450 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 +/******/
451 1619 /******/ /* webpack/runtime/define property getters */
452 1620 /******/ (() => {
453 -/******/ // define getter/value functions for harmony exports
1621 +/******/ // define getter functions for harmony exports
454 1622 /******/ __webpack_require__.d = (exports, definition) => {
455 -/******/ if(Array.isArray(definition)) {
456 -/******/ var i = 0;
457 -/******/ while(i < definition.length) {
458 -/******/ var key = definition[i++];
459 -/******/ var binding = definition[i++];
460 -/******/ if(!__webpack_require__.o(exports, key)) {
461 -/******/ if(binding === 0) {
462 -/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
463 -/******/ } else {
464 -/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
465 -/******/ }
466 -/******/ } else if(binding === 0) { i++; }
1623 +/******/ for(var key in definition) {
1624 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1625 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
467 1626 /******/ }
468 -/******/ } else {
469 -/******/ for(var key in definition) {
470 -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
471 -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
472 -/******/ }
473 -/******/ }
474 1627 /******/ }
475 1628 /******/ };
476 1629 /******/ })();
477 1630 /******/
@@ -476,9 +1629,9 @@
476 1629 /******/ })();
477 1630 /******/
478 1631 /******/ /* webpack/runtime/hasOwnProperty shorthand */
479 1632 /******/ (() => {
480 -/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop))
1633 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
481 1634 /******/ })();
482 1635 /******/
483 1636 /******/ /* webpack/runtime/make namespace object */
484 1637 /******/ (() => {
@@ -483,9 +1636,9 @@
483 1636 /******/ /* webpack/runtime/make namespace object */
484 1637 /******/ (() => {
485 1638 /******/ // define __esModule on exports
486 1639 /******/ __webpack_require__.r = (exports) => {
487 -/******/ if(Symbol.toStringTag) {
1640 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
488 1641 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
489 1642 /******/ }
490 1643 /******/ Object.defineProperty(exports, '__esModule', { value: true });
491 1644 /******/ };
@@ -490,126 +1643,138 @@
490 1643 /******/ Object.defineProperty(exports, '__esModule', { value: true });
491 1644 /******/ };
492 1645 /******/ })();
493 1646 /******/
1647 +/******/ /* webpack/runtime/nonce */
1648 +/******/ (() => {
1649 +/******/ __webpack_require__.nc = undefined;
1650 +/******/ })();
1651 +/******/
494 1652 /************************************************************************/
495 -let __webpack_exports__ = {};
496 -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
1653 +var __webpack_exports__ = {};
1654 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
497 1655 (() => {
1656 +"use strict";
498 1657 /*!**********************************************!*\
499 1658 !*** ./assets/src/js/admin/admin-notices.js ***!
500 1659 \**********************************************/
501 1660 __webpack_require__.r(__webpack_exports__);
502 -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./assets/src/js/utils.js");
503 -/* 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");
504 1663 /**
505 1664 * Script handle admin notices.
506 1665 *
507 1666 * @since 4.1.7.3.2
508 - * @version 1.0.2
1667 + * @version 1.0.3
509 1668 */
510 1669
511 1670
512 -let elLPAdminNotices = null;
513 -let dataHtml = null;
514 -const queryString = window.location.search;
515 -const urlParams = new URLSearchParams(queryString);
516 -const tab = urlParams.get('tab');
517 -const notifyAddonsNewVersion = () => {
518 - try {
519 - const elAdminMenu = document.querySelector('#adminmenu');
520 - if (!elAdminMenu) {
521 - 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);
522 1726 }
523 - const elTabLP = elAdminMenu.querySelector('#toplevel_page_learn_press');
524 - if (!elTabLP) {
1727 + }
1728 +
1729 + /*** Events ***/
1730 + events() {
1731 + if (AdminNotices._loadedEvents) {
525 1732 return;
526 1733 }
527 - const elTabLPName = elTabLP.querySelector('.wp-menu-name');
528 - if (!elTabLPName) {
529 - return;
530 - }
531 - const elAddonsNewVerTotal = document.querySelector('input[name=lp-addons-new-version-totals]');
532 - if (!elAddonsNewVerTotal) {
533 - return;
534 - }
535 - const htmlNotifyLP = `<span class="tab-lp-admin-notice"></span>`;
536 - elTabLPName.insertAdjacentHTML('beforeend', htmlNotifyLP);
537 - const elTabLPAddons = elTabLP.querySelector('a[href="admin.php?page=learn-press-addons"]');
538 - if (!elTabLPAddons) {
539 - return;
540 - }
541 - const total = elAddonsNewVerTotal.value;
542 - const html = `<span style="margin-left: 5px" class="update-plugins">${total}</span>`;
543 - elTabLPAddons.setAttribute('href', 'admin.php?page=learn-press-addons&tab=update');
544 - elTabLPAddons.insertAdjacentHTML('beforeend', html);
545 - } catch (e) {
546 - 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 + }]);
547 1740 }
548 -};
549 -const callAdminNotices = (set = '') => {
550 - if (!lpGlobalSettings.is_admin) {
551 - return;
552 - }
553 - let params = tab ? `?tab=${tab}` : '';
554 - params += set ? (tab ? '&' : '?') + `${set}` : '';
555 - fetch(_api_js__WEBPACK_IMPORTED_MODULE_1__["default"].admin.apiAdminNotice + params, {
556 - method: 'POST',
557 - headers: {
558 - 'X-WP-Nonce': lpGlobalSettings.nonce
559 - }
560 - }).then(res => res.json()).then(res => {
561 - // console.log(data);
562 -
1741 + dismissNotice(args) {
563 1742 const {
564 - status,
565 - message,
566 - data
567 - } = res;
568 - if (status === 'success') {
569 - if ('Dismissed!' !== message) {
570 - dataHtml = data.content;
571 - if (dataHtml.length === 0) {
572 - elLPAdminNotices.style.display = 'none';
573 - } else {
574 - elLPAdminNotices.innerHTML = dataHtml;
575 - elLPAdminNotices.style.display = 'block';
576 - // Handle notify addons new version.
577 - notifyAddonsNewVersion();
578 - }
579 - }
580 - } else {
581 - dataHtml = message;
1743 + e,
1744 + target
1745 + } = args;
1746 + const el = target.closest(AdminNotices.selectors.elBtnDismiss);
1747 + if (!el) {
1748 + return;
582 1749 }
583 - }).catch(err => {
584 - console.log(err);
585 - });
586 -};
587 -
588 -// Listen element ready
589 -(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpOnElementReady)('.lp-admin-notices', () => {
590 - elLPAdminNotices = document.querySelector('.lp-admin-notices');
591 - callAdminNotices();
592 -});
593 -
594 -/*** Events ***/
595 -document.addEventListener('click', e => {
596 - const el = e.target;
597 - if (el.classList.contains('btn-lp-notice-dismiss')) {
598 1750 e.preventDefault();
599 1751
600 1752 // eslint-disable-next-line no-alert
601 - if (confirm('Are you sure you want to dismiss this notice?')) {
602 - const parent = el.closest('.lp-notice');
603 - callAdminNotices(`dismiss=${el.getAttribute('data-dismiss')}`);
604 - parent.remove();
605 - if (elLPAdminNotices.querySelectorAll('.lp-notice').length === 0) {
606 - elLPAdminNotices.style.display = 'none';
607 - }
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 + });
608 1771 }
609 1772 }
610 -});
1773 +}
1774 +const adminNotices = new AdminNotices();
1775 +adminNotices.init();
611 1776 })();
612 1777
613 1778 /******/ })()
614 1779 ;
615 1780 //# sourceMappingURL=admin-notices.js.map