| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ var __webpack_modules__ = ({ |
| 3 |
|
| 4 |
/***/ "./assets/src/js/admin/orders/export-orders.js" |
| 5 |
/*!*****************************************************!*\ |
| 6 |
!*** ./assets/src/js/admin/orders/export-orders.js ***! |
| 7 |
\*****************************************************/ |
| 8 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 9 |
|
| 10 |
"use strict"; |
| 11 |
__webpack_require__.r(__webpack_exports__); |
| 12 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 13 |
/* harmony export */ ExportOrdersToCSV: () => (/* binding */ ExportOrdersToCSV) |
| 14 |
/* harmony export */ }); |
| 15 |
/* harmony import */ var lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lpAssetsJsPath/utils.js */ "./assets/src/js/utils.js"); |
| 16 |
/* harmony import */ var lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lpAssetsJsPath/lpToastify */ "./assets/src/js/lpToastify.js"); |
| 17 |
|
| 18 |
|
| 19 |
const ExportOrdersToCSV = () => { |
| 20 |
const handleExport = args => { |
| 21 |
const { |
| 22 |
e, |
| 23 |
target |
| 24 |
} = args; |
| 25 |
e.preventDefault(); |
| 26 |
lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(target, true); |
| 27 |
let dataSend = JSON.parse(target.dataset.send); |
| 28 |
const callBack = { |
| 29 |
success: response => { |
| 30 |
const { |
| 31 |
message, |
| 32 |
status, |
| 33 |
data |
| 34 |
} = response; |
| 35 |
if (status === 'success') { |
| 36 |
const maxPage = data?.max_page; |
| 37 |
const nextPage = data?.next_page; |
| 38 |
const done = data?.done; |
| 39 |
const downloadUrl = data?.download_url; |
| 40 |
if (!!maxPage && !!nextPage && nextPage <= maxPage) { |
| 41 |
dataSend = { |
| 42 |
...dataSend, |
| 43 |
paged: nextPage |
| 44 |
}; |
| 45 |
window.lpAJAXG.fetchAJAX(dataSend, callBack); |
| 46 |
} else if (!!done) { |
| 47 |
lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__.show(message, 'success'); |
| 48 |
const link = document.createElement('a'); |
| 49 |
link.href = downloadUrl; |
| 50 |
link.target = '_self'; |
| 51 |
document.body.appendChild(link); |
| 52 |
link.click(); |
| 53 |
document.body.removeChild(link); |
| 54 |
} |
| 55 |
} else { |
| 56 |
throw message; |
| 57 |
} |
| 58 |
}, |
| 59 |
error: error => { |
| 60 |
lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__.show(error, 'error'); |
| 61 |
}, |
| 62 |
completed: () => { |
| 63 |
lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(target, false); |
| 64 |
} |
| 65 |
}; |
| 66 |
window.lpAJAXG.fetchAJAX(dataSend, callBack); |
| 67 |
}; |
| 68 |
lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_0__.eventHandlers('click', [{ |
| 69 |
selector: '.lp-btn-export-order-to-csv', |
| 70 |
class: undefined, |
| 71 |
callBack: handleExport |
| 72 |
}]); |
| 73 |
}; |
| 74 |
|
| 75 |
/***/ }, |
| 76 |
|
| 77 |
/***/ "./assets/src/js/lpToastify.js" |
| 78 |
/*!*************************************!*\ |
| 79 |
!*** ./assets/src/js/lpToastify.js ***! |
| 80 |
\*************************************/ |
| 81 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 82 |
|
| 83 |
"use strict"; |
| 84 |
__webpack_require__.r(__webpack_exports__); |
| 85 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 86 |
/* harmony export */ show: () => (/* binding */ show) |
| 87 |
/* harmony export */ }); |
| 88 |
/* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! toastify-js */ "./node_modules/toastify-js/src/toastify.js"); |
| 89 |
/* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(toastify_js__WEBPACK_IMPORTED_MODULE_0__); |
| 90 |
/* 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"); |
| 91 |
/** |
| 92 |
* Utils functions |
| 93 |
* |
| 94 |
* @param url |
| 95 |
* @param data |
| 96 |
* @param functions |
| 97 |
* @since 4.3.0 |
| 98 |
* @version 1.0.0 |
| 99 |
*/ |
| 100 |
|
| 101 |
|
| 102 |
const argsToastify = { |
| 103 |
text: '', |
| 104 |
gravity: lpData.toast.gravity, |
| 105 |
// `top` or `bottom` |
| 106 |
position: lpData.toast.position, |
| 107 |
// `left`, `center` or `right` |
| 108 |
className: `${lpData.toast.classPrefix}`, |
| 109 |
close: lpData.toast.close == 1, |
| 110 |
stopOnFocus: lpData.toast.stopOnFocus == 1, |
| 111 |
duration: lpData.toast.duration |
| 112 |
}; |
| 113 |
const show = (message, status = 'success', argsCustom) => { |
| 114 |
let args = argsToastify; |
| 115 |
if (argsCustom) { |
| 116 |
args = { |
| 117 |
...args, |
| 118 |
...argsCustom |
| 119 |
}; |
| 120 |
} |
| 121 |
const toastify = new (toastify_js__WEBPACK_IMPORTED_MODULE_0___default())({ |
| 122 |
...args, |
| 123 |
text: message, |
| 124 |
className: `${lpData.toast.classPrefix} ${status}` |
| 125 |
}); |
| 126 |
toastify.showToast(); |
| 127 |
}; |
| 128 |
|
| 129 |
/***/ }, |
| 130 |
|
| 131 |
/***/ "./assets/src/js/utils.js" |
| 132 |
/*!********************************!*\ |
| 133 |
!*** ./assets/src/js/utils.js ***! |
| 134 |
\********************************/ |
| 135 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 136 |
|
| 137 |
"use strict"; |
| 138 |
__webpack_require__.r(__webpack_exports__); |
| 139 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 140 |
/* harmony export */ debounce: () => (/* binding */ debounce), |
| 141 |
/* harmony export */ eventHandlers: () => (/* binding */ eventHandlers), |
| 142 |
/* harmony export */ fullScreenView: () => (/* binding */ fullScreenView), |
| 143 |
/* harmony export */ getDataOfForm: () => (/* binding */ getDataOfForm), |
| 144 |
/* harmony export */ getFieldKeysOfForm: () => (/* binding */ getFieldKeysOfForm), |
| 145 |
/* harmony export */ listenElementCreated: () => (/* binding */ listenElementCreated), |
| 146 |
/* harmony export */ listenElementViewed: () => (/* binding */ listenElementViewed), |
| 147 |
/* harmony export */ lpAddQueryArgs: () => (/* binding */ lpAddQueryArgs), |
| 148 |
/* harmony export */ lpAjaxParseJsonOld: () => (/* binding */ lpAjaxParseJsonOld), |
| 149 |
/* harmony export */ lpClassName: () => (/* binding */ lpClassName), |
| 150 |
/* harmony export */ lpFetchAPI: () => (/* binding */ lpFetchAPI), |
| 151 |
/* harmony export */ lpGetCurrentURLNoParam: () => (/* binding */ lpGetCurrentURLNoParam), |
| 152 |
/* harmony export */ lpOnElementReady: () => (/* binding */ lpOnElementReady), |
| 153 |
/* harmony export */ lpSetLoadingEl: () => (/* binding */ lpSetLoadingEl), |
| 154 |
/* harmony export */ lpShowHideEl: () => (/* binding */ lpShowHideEl), |
| 155 |
/* harmony export */ mergeDataWithDatForm: () => (/* binding */ mergeDataWithDatForm), |
| 156 |
/* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse), |
| 157 |
/* harmony export */ toggleEnable: () => (/* binding */ toggleEnable) |
| 158 |
/* harmony export */ }); |
| 159 |
/** |
| 160 |
* Utils functions |
| 161 |
* |
| 162 |
* @param url |
| 163 |
* @param data |
| 164 |
* @param functions |
| 165 |
* @since 4.2.5.1 |
| 166 |
* @version 1.0.7 |
| 167 |
*/ |
| 168 |
const lpClassName = { |
| 169 |
hidden: 'lp-hidden', |
| 170 |
loading: 'loading', |
| 171 |
elCollapse: 'lp-collapse', |
| 172 |
elSectionToggle: '.lp-section-toggle', |
| 173 |
elTriggerToggle: '.lp-trigger-toggle', |
| 174 |
elBtnFullScreen: '.lp-btn-full-screen-view', |
| 175 |
elFullScreen: 'lp-full-screen-view', |
| 176 |
elBtnFullScreenClose: 'lp-full-screen-view__close' |
| 177 |
}; |
| 178 |
const lpFetchAPI = (url, data = {}, functions = {}) => { |
| 179 |
if ('function' === typeof functions.before) { |
| 180 |
functions.before(); |
| 181 |
} |
| 182 |
fetch(url, { |
| 183 |
method: 'GET', |
| 184 |
...data |
| 185 |
}).then(response => response.json()).then(response => { |
| 186 |
if ('function' === typeof functions.success) { |
| 187 |
functions.success(response); |
| 188 |
} |
| 189 |
}).catch(err => { |
| 190 |
if ('function' === typeof functions.error) { |
| 191 |
functions.error(err); |
| 192 |
} |
| 193 |
}).finally(() => { |
| 194 |
if ('function' === typeof functions.completed) { |
| 195 |
functions.completed(); |
| 196 |
} |
| 197 |
}); |
| 198 |
}; |
| 199 |
|
| 200 |
/** |
| 201 |
* Get current URL without params. |
| 202 |
* |
| 203 |
* @since 4.2.5.1 |
| 204 |
*/ |
| 205 |
const lpGetCurrentURLNoParam = () => { |
| 206 |
let currentUrl = window.location.href; |
| 207 |
const hasParams = currentUrl.includes('?'); |
| 208 |
if (hasParams) { |
| 209 |
currentUrl = currentUrl.split('?')[0]; |
| 210 |
} |
| 211 |
return currentUrl; |
| 212 |
}; |
| 213 |
const lpAddQueryArgs = (endpoint, args) => { |
| 214 |
const url = new URL(endpoint); |
| 215 |
Object.keys(args).forEach(arg => { |
| 216 |
url.searchParams.set(arg, args[arg]); |
| 217 |
}); |
| 218 |
return url; |
| 219 |
}; |
| 220 |
|
| 221 |
/** |
| 222 |
* Listen element viewed. |
| 223 |
* |
| 224 |
* @param el |
| 225 |
* @param callback |
| 226 |
* @since 4.2.5.8 |
| 227 |
*/ |
| 228 |
const listenElementViewed = (el, callback) => { |
| 229 |
const observerSeeItem = new IntersectionObserver(function (entries) { |
| 230 |
for (const entry of entries) { |
| 231 |
if (entry.isIntersecting) { |
| 232 |
callback(entry); |
| 233 |
} |
| 234 |
} |
| 235 |
}); |
| 236 |
observerSeeItem.observe(el); |
| 237 |
}; |
| 238 |
|
| 239 |
/** |
| 240 |
* Listen element created. |
| 241 |
* |
| 242 |
* @param callback |
| 243 |
* @since 4.2.5.8 |
| 244 |
*/ |
| 245 |
const listenElementCreated = callback => { |
| 246 |
const observerCreateItem = new MutationObserver(function (mutations) { |
| 247 |
mutations.forEach(function (mutation) { |
| 248 |
if (mutation.addedNodes) { |
| 249 |
mutation.addedNodes.forEach(function (node) { |
| 250 |
if (node.nodeType === 1) { |
| 251 |
callback(node); |
| 252 |
} |
| 253 |
}); |
| 254 |
} |
| 255 |
}); |
| 256 |
}); |
| 257 |
observerCreateItem.observe(document, { |
| 258 |
childList: true, |
| 259 |
subtree: true |
| 260 |
}); |
| 261 |
// End. |
| 262 |
}; |
| 263 |
|
| 264 |
/** |
| 265 |
* Listen element created. |
| 266 |
* |
| 267 |
* @param selector |
| 268 |
* @param callback |
| 269 |
* @since 4.2.7.1 |
| 270 |
*/ |
| 271 |
const lpOnElementReady = (selector, callback) => { |
| 272 |
const element = document.querySelector(selector); |
| 273 |
if (element) { |
| 274 |
callback(element); |
| 275 |
return; |
| 276 |
} |
| 277 |
const observer = new MutationObserver((mutations, obs) => { |
| 278 |
const element = document.querySelector(selector); |
| 279 |
if (element) { |
| 280 |
obs.disconnect(); |
| 281 |
callback(element); |
| 282 |
} |
| 283 |
}); |
| 284 |
observer.observe(document.documentElement, { |
| 285 |
childList: true, |
| 286 |
subtree: true |
| 287 |
}); |
| 288 |
}; |
| 289 |
|
| 290 |
// Parse JSON from string with content include LP_AJAX_START. |
| 291 |
const lpAjaxParseJsonOld = data => { |
| 292 |
if (typeof data !== 'string') { |
| 293 |
return data; |
| 294 |
} |
| 295 |
const m = String.raw({ |
| 296 |
raw: data |
| 297 |
}).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s); |
| 298 |
try { |
| 299 |
if (m) { |
| 300 |
data = JSON.parse(m[1].replace(/(?:\r\n|\r|\n)/g, '')); |
| 301 |
} else { |
| 302 |
data = JSON.parse(data); |
| 303 |
} |
| 304 |
} catch (e) { |
| 305 |
data = {}; |
| 306 |
} |
| 307 |
return data; |
| 308 |
}; |
| 309 |
|
| 310 |
// status 0: hide, 1: show |
| 311 |
const lpShowHideEl = (el, status = 0) => { |
| 312 |
if (!el) { |
| 313 |
return; |
| 314 |
} |
| 315 |
if (!status) { |
| 316 |
el.classList.add(lpClassName.hidden); |
| 317 |
} else { |
| 318 |
el.classList.remove(lpClassName.hidden); |
| 319 |
} |
| 320 |
}; |
| 321 |
|
| 322 |
// status 0: hide, 1: show |
| 323 |
const lpSetLoadingEl = (el, status) => { |
| 324 |
if (!el) { |
| 325 |
return; |
| 326 |
} |
| 327 |
if (!status) { |
| 328 |
el.classList.remove(lpClassName.loading); |
| 329 |
} else { |
| 330 |
el.classList.add(lpClassName.loading); |
| 331 |
} |
| 332 |
}; |
| 333 |
|
| 334 |
// Toggle collapse section |
| 335 |
const toggleCollapse = (e, target, elTriggerClassName = '', elsExclude = [], callback) => { |
| 336 |
if (!elTriggerClassName) { |
| 337 |
elTriggerClassName = lpClassName.elTriggerToggle; |
| 338 |
} |
| 339 |
|
| 340 |
// Exclude elements, which should not trigger the collapse toggle |
| 341 |
if (elsExclude && elsExclude.length > 0) { |
| 342 |
for (const elExclude of elsExclude) { |
| 343 |
if (target.closest(elExclude)) { |
| 344 |
return; |
| 345 |
} |
| 346 |
} |
| 347 |
} |
| 348 |
const elTrigger = target.closest(elTriggerClassName); |
| 349 |
if (!elTrigger) { |
| 350 |
return; |
| 351 |
} |
| 352 |
|
| 353 |
//console.log( 'elTrigger', elTrigger ); |
| 354 |
|
| 355 |
const elSectionToggle = elTrigger.closest(`${lpClassName.elSectionToggle}`); |
| 356 |
if (!elSectionToggle) { |
| 357 |
return; |
| 358 |
} |
| 359 |
elSectionToggle.classList.toggle(`${lpClassName.elCollapse}`); |
| 360 |
if ('function' === typeof callback) { |
| 361 |
callback(elSectionToggle); |
| 362 |
} |
| 363 |
}; |
| 364 |
|
| 365 |
// Get data of form |
| 366 |
const getDataOfForm = form => { |
| 367 |
const dataSend = {}; |
| 368 |
const formData = new FormData(form); |
| 369 |
for (const pair of formData.entries()) { |
| 370 |
const key = pair[0]; |
| 371 |
const value = formData.getAll(key); |
| 372 |
if (!dataSend.hasOwnProperty(key)) { |
| 373 |
// Convert value array to string. |
| 374 |
dataSend[key] = value.join(','); |
| 375 |
} |
| 376 |
} |
| 377 |
return dataSend; |
| 378 |
}; |
| 379 |
|
| 380 |
// Get field keys of form |
| 381 |
const getFieldKeysOfForm = form => { |
| 382 |
const keys = []; |
| 383 |
const elements = form.elements; |
| 384 |
for (let i = 0; i < elements.length; i++) { |
| 385 |
const name = elements[i].name; |
| 386 |
if (name && !keys.includes(name)) { |
| 387 |
keys.push(name); |
| 388 |
} |
| 389 |
} |
| 390 |
return keys; |
| 391 |
}; |
| 392 |
|
| 393 |
// Merge data handle with data form. |
| 394 |
const mergeDataWithDatForm = (elForm, dataHandle) => { |
| 395 |
const dataForm = getDataOfForm(elForm); |
| 396 |
const keys = getFieldKeysOfForm(elForm); |
| 397 |
keys.forEach(key => { |
| 398 |
if (!dataForm.hasOwnProperty(key)) { |
| 399 |
delete dataHandle[key]; |
| 400 |
} else if (dataForm[key][0] === '') { |
| 401 |
delete dataForm[key]; |
| 402 |
delete dataHandle[key]; |
| 403 |
} |
| 404 |
}); |
| 405 |
dataHandle = { |
| 406 |
...dataHandle, |
| 407 |
...dataForm |
| 408 |
}; |
| 409 |
return dataHandle; |
| 410 |
}; |
| 411 |
|
| 412 |
/** |
| 413 |
* Event trigger |
| 414 |
* For each list of event handlers, listen event on document. |
| 415 |
* |
| 416 |
* eventName: 'click', 'change', ... |
| 417 |
* eventHandlers = [ { selector: '.lp-button', callBack: function(){}, class: object } ] |
| 418 |
* |
| 419 |
* @param eventName |
| 420 |
* @param eventHandlers |
| 421 |
*/ |
| 422 |
const eventHandlers = (eventName, eventHandlers) => { |
| 423 |
document.addEventListener(eventName, e => { |
| 424 |
const target = e.target; |
| 425 |
let args = { |
| 426 |
e, |
| 427 |
target |
| 428 |
}; |
| 429 |
eventHandlers.forEach(eventHandler => { |
| 430 |
args = { |
| 431 |
...args, |
| 432 |
...eventHandler |
| 433 |
}; |
| 434 |
|
| 435 |
//console.log( args ); |
| 436 |
|
| 437 |
// Check condition before call back |
| 438 |
if (eventHandler.conditionBeforeCallBack) { |
| 439 |
if (eventHandler.conditionBeforeCallBack(args) !== true) { |
| 440 |
return; |
| 441 |
} |
| 442 |
} |
| 443 |
|
| 444 |
// Special check for keydown event with checkIsEventEnter = true |
| 445 |
if (eventName === 'keydown' && eventHandler.checkIsEventEnter) { |
| 446 |
if (e.key !== 'Enter') { |
| 447 |
return; |
| 448 |
} |
| 449 |
} |
| 450 |
if (target.closest(eventHandler.selector)) { |
| 451 |
if (eventHandler.class) { |
| 452 |
// Call method of class, function callBack will understand exactly {this} is class object. |
| 453 |
eventHandler.class[eventHandler.callBack](args); |
| 454 |
} else { |
| 455 |
// For send args is objected, {this} is eventHandler object, not class object. |
| 456 |
eventHandler.callBack(args); |
| 457 |
} |
| 458 |
} |
| 459 |
}); |
| 460 |
}); |
| 461 |
}; |
| 462 |
|
| 463 |
/** |
| 464 |
* Debounce - delays function execution until after `wait` ms of inactivity. |
| 465 |
* |
| 466 |
* Each call resets the timer. Only the last call in a burst executes. |
| 467 |
* |
| 468 |
* USE CASES: |
| 469 |
* - Search inputs, form validation, window resize |
| 470 |
* - Multiple elements need independent timers |
| 471 |
* - When you need to call with different arguments |
| 472 |
* |
| 473 |
* EXAMPLES: |
| 474 |
* const debouncedSearch = debounce( (query) => fetchResults(query), 300 ); |
| 475 |
* searchInput.addEventListener('input', (e) => debouncedSearch(e.target.value)); |
| 476 |
* |
| 477 |
* const debouncedResize = debounce( recalculateLayout, 250 ); |
| 478 |
* window.addEventListener('resize', debouncedResize); |
| 479 |
* |
| 480 |
* ⚠️ Create ONCE outside event handlers, not inside. |
| 481 |
* |
| 482 |
* @param {Function} func - Function to debounce (can be anonymous) |
| 483 |
* @param {number} wait - Milliseconds to wait (default: 500) |
| 484 |
* @return {Function} Debounced wrapper function |
| 485 |
* @since 4.3.7 |
| 486 |
* @version 1.0.0 |
| 487 |
*/ |
| 488 |
const debounce = (func, wait = 500) => { |
| 489 |
let timer; |
| 490 |
return args => { |
| 491 |
clearTimeout(timer); |
| 492 |
timer = setTimeout(() => func(args), wait); |
| 493 |
}; |
| 494 |
}; |
| 495 |
|
| 496 |
/** |
| 497 |
* Initialize lp-toggle-enable components. |
| 498 |
* |
| 499 |
* Finds all `.lp-toggle-enable` elements and wires up toggle behavior. |
| 500 |
* Reads initial state from `data-enabled` attribute ("true"/"false"). |
| 501 |
* Calls `data-on-toggle` callback (if provided via options) on state change. |
| 502 |
* |
| 503 |
* HTML structure: |
| 504 |
* <label class="lp-toggle-enable" data-enabled="true"> |
| 505 |
* <input type="checkbox" class="lp-toggle-enable__input" /> |
| 506 |
* <span class="lp-toggle-enable__track"></span> |
| 507 |
* </label> |
| 508 |
* |
| 509 |
* @param {string} selector CSS selector for toggle elements (default: '.lp-toggle-enable') |
| 510 |
* @param {Function} onToggle Optional callback( el, isEnabled ) called on state change |
| 511 |
* @since 4.4.5 |
| 512 |
* @version 1.0.0 |
| 513 |
*/ |
| 514 |
window.lpToggleEnableInit = 0; |
| 515 |
const toggleEnable = (onToggle = null) => { |
| 516 |
if (window.lpToggleEnableInit) { |
| 517 |
return; |
| 518 |
} |
| 519 |
window.lpToggleEnableInit = 1; |
| 520 |
const selector = '.lp-toggle-enable'; |
| 521 |
const updateUI = (toggle, isEnabled) => { |
| 522 |
toggle.classList.toggle('is-enabled', isEnabled); |
| 523 |
const input = toggle.querySelector('.lp-toggle-enable__input'); |
| 524 |
if (input) { |
| 525 |
input.checked = isEnabled; |
| 526 |
input.value = isEnabled ? '1' : '0'; |
| 527 |
} |
| 528 |
}; |
| 529 |
|
| 530 |
// Delegate click handling via eventHandlers. |
| 531 |
eventHandlers('click', [{ |
| 532 |
selector, |
| 533 |
callBack: args => { |
| 534 |
const { |
| 535 |
e, |
| 536 |
target |
| 537 |
} = args; |
| 538 |
const toggle = target.closest(selector); |
| 539 |
if (!toggle || toggle.classList.contains('is-disabled')) { |
| 540 |
return; |
| 541 |
} |
| 542 |
e.preventDefault(); |
| 543 |
const isEnabled = !toggle.classList.contains('is-enabled'); |
| 544 |
updateUI(toggle, isEnabled); |
| 545 |
if ('function' === typeof onToggle) { |
| 546 |
onToggle(toggle, isEnabled); |
| 547 |
} |
| 548 |
} |
| 549 |
}]); |
| 550 |
}; |
| 551 |
|
| 552 |
/** |
| 553 |
* Initialize custom fullscreen view buttons. |
| 554 |
* |
| 555 |
* Delegates clicks on `.lp-btn-full-screen-view` buttons to |
| 556 |
* `lpToggleFullscreenView`. Reads the `data-target` attribute to find the |
| 557 |
* target element. Falls back to the button's parent element when |
| 558 |
* `data-target` is not provided. |
| 559 |
* |
| 560 |
* @since 4.4.5 |
| 561 |
* @version 1.0.0 |
| 562 |
*/ |
| 563 |
window.lpFullScreenViewInit = 0; |
| 564 |
const fullScreenView = () => { |
| 565 |
if (window.lpFullScreenViewInit) { |
| 566 |
return; |
| 567 |
} |
| 568 |
window.lpFullScreenViewInit = 1; |
| 569 |
let lastScrollY = 0; |
| 570 |
const lpToggleFullscreenView = (elTarget, elBtnFullScreen = null) => { |
| 571 |
const isFullscreen = elTarget.classList.contains(lpClassName.elFullScreen); |
| 572 |
if (isFullscreen) { |
| 573 |
elTarget.classList.remove(lpClassName.elFullScreen); |
| 574 |
document.documentElement.classList.remove('lp-full-screen-active'); |
| 575 |
window.scrollTo(0, lastScrollY); |
| 576 |
} else { |
| 577 |
lastScrollY = window.scrollY; |
| 578 |
elTarget.classList.add(lpClassName.elFullScreen); |
| 579 |
document.documentElement.classList.add('lp-full-screen-active'); |
| 580 |
} |
| 581 |
if (!isFullscreen) { |
| 582 |
if (!elTarget.querySelector(`.${lpClassName.elBtnFullScreenClose}`)) { |
| 583 |
const closeButton = document.createElement('button'); |
| 584 |
closeButton.type = 'button'; |
| 585 |
closeButton.className = lpClassName.elBtnFullScreenClose; |
| 586 |
closeButton.setAttribute('aria-label', 'Close'); |
| 587 |
closeButton.innerHTML = lpData.i18n.closeButtonFullScreen || 'Close ×'; |
| 588 |
closeButton.addEventListener('click', e => { |
| 589 |
e.preventDefault(); |
| 590 |
lpToggleFullscreenView(elTarget); |
| 591 |
}); |
| 592 |
elTarget.appendChild(closeButton); |
| 593 |
} |
| 594 |
} else { |
| 595 |
const closeButton = elTarget.querySelector(`.${lpClassName.elBtnFullScreenClose}`); |
| 596 |
if (closeButton) { |
| 597 |
closeButton.remove(); |
| 598 |
} |
| 599 |
} |
| 600 |
}; |
| 601 |
eventHandlers('click', [{ |
| 602 |
selector: lpClassName.elBtnFullScreen, |
| 603 |
callBack: args => { |
| 604 |
const { |
| 605 |
e, |
| 606 |
target |
| 607 |
} = args; |
| 608 |
const elBtnFullScreen = target.closest(lpClassName.elBtnFullScreen); |
| 609 |
if (!elBtnFullScreen) { |
| 610 |
console.log('No full screen button found'); |
| 611 |
return; |
| 612 |
} |
| 613 |
e.preventDefault(); |
| 614 |
let elTarget = null; |
| 615 |
const targetSelector = elBtnFullScreen.dataset.targetFullscreen; |
| 616 |
console.log(targetSelector); |
| 617 |
if (targetSelector) { |
| 618 |
elTarget = document.querySelector(targetSelector); |
| 619 |
} |
| 620 |
if (!elTarget) { |
| 621 |
console.log('No target element found'); |
| 622 |
return; |
| 623 |
} |
| 624 |
lpToggleFullscreenView(elTarget, elBtnFullScreen); |
| 625 |
} |
| 626 |
}]); |
| 627 |
}; |
| 628 |
|
| 629 |
/***/ }, |
| 630 |
|
| 631 |
/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css" |
| 632 |
/*!*****************************************************************************************!*\ |
| 633 |
!*** ./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css ***! |
| 634 |
\*****************************************************************************************/ |
| 635 |
(module, __webpack_exports__, __webpack_require__) { |
| 636 |
|
| 637 |
"use strict"; |
| 638 |
__webpack_require__.r(__webpack_exports__); |
| 639 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 640 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 641 |
/* harmony export */ }); |
| 642 |
/* 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"); |
| 643 |
/* 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__); |
| 644 |
/* 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"); |
| 645 |
/* 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__); |
| 646 |
// Imports |
| 647 |
|
| 648 |
|
| 649 |
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())); |
| 650 |
// Module |
| 651 |
___CSS_LOADER_EXPORT___.push([module.id, `/*! |
| 652 |
* Toastify js 1.12.0 |
| 653 |
* https://github.com/apvarun/toastify-js |
| 654 |
* @license MIT licensed |
| 655 |
* |
| 656 |
* Copyright (C) 2018 Varun A P |
| 657 |
*/ |
| 658 |
|
| 659 |
.toastify { |
| 660 |
padding: 12px 20px; |
| 661 |
color: #ffffff; |
| 662 |
display: inline-block; |
| 663 |
box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3); |
| 664 |
background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5); |
| 665 |
background: linear-gradient(135deg, #73a5ff, #5477f5); |
| 666 |
position: fixed; |
| 667 |
opacity: 0; |
| 668 |
transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1); |
| 669 |
border-radius: 2px; |
| 670 |
cursor: pointer; |
| 671 |
text-decoration: none; |
| 672 |
max-width: calc(50% - 20px); |
| 673 |
z-index: 2147483647; |
| 674 |
} |
| 675 |
|
| 676 |
.toastify.on { |
| 677 |
opacity: 1; |
| 678 |
} |
| 679 |
|
| 680 |
.toast-close { |
| 681 |
background: transparent; |
| 682 |
border: 0; |
| 683 |
color: white; |
| 684 |
cursor: pointer; |
| 685 |
font-family: inherit; |
| 686 |
font-size: 1em; |
| 687 |
opacity: 0.4; |
| 688 |
padding: 0 5px; |
| 689 |
} |
| 690 |
|
| 691 |
.toastify-right { |
| 692 |
right: 15px; |
| 693 |
} |
| 694 |
|
| 695 |
.toastify-left { |
| 696 |
left: 15px; |
| 697 |
} |
| 698 |
|
| 699 |
.toastify-top { |
| 700 |
top: -150px; |
| 701 |
} |
| 702 |
|
| 703 |
.toastify-bottom { |
| 704 |
bottom: -150px; |
| 705 |
} |
| 706 |
|
| 707 |
.toastify-rounded { |
| 708 |
border-radius: 25px; |
| 709 |
} |
| 710 |
|
| 711 |
.toastify-avatar { |
| 712 |
width: 1.5em; |
| 713 |
height: 1.5em; |
| 714 |
margin: -7px 5px; |
| 715 |
border-radius: 2px; |
| 716 |
} |
| 717 |
|
| 718 |
.toastify-center { |
| 719 |
margin-left: auto; |
| 720 |
margin-right: auto; |
| 721 |
left: 0; |
| 722 |
right: 0; |
| 723 |
max-width: fit-content; |
| 724 |
max-width: -moz-fit-content; |
| 725 |
} |
| 726 |
|
| 727 |
@media only screen and (max-width: 360px) { |
| 728 |
.toastify-right, .toastify-left { |
| 729 |
margin-left: auto; |
| 730 |
margin-right: auto; |
| 731 |
left: 0; |
| 732 |
right: 0; |
| 733 |
max-width: fit-content; |
| 734 |
} |
| 735 |
} |
| 736 |
`, "",{"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":""}]); |
| 737 |
// Exports |
| 738 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); |
| 739 |
|
| 740 |
|
| 741 |
/***/ }, |
| 742 |
|
| 743 |
/***/ "./node_modules/css-loader/dist/runtime/api.js" |
| 744 |
/*!*****************************************************!*\ |
| 745 |
!*** ./node_modules/css-loader/dist/runtime/api.js ***! |
| 746 |
\*****************************************************/ |
| 747 |
(module) { |
| 748 |
|
| 749 |
"use strict"; |
| 750 |
|
| 751 |
|
| 752 |
/* |
| 753 |
MIT License http://www.opensource.org/licenses/mit-license.php |
| 754 |
Author Tobias Koppers @sokra |
| 755 |
*/ |
| 756 |
module.exports = function (cssWithMappingToString) { |
| 757 |
var list = []; |
| 758 |
|
| 759 |
// return the list of modules as css string |
| 760 |
list.toString = function toString() { |
| 761 |
return this.map(function (item) { |
| 762 |
var content = ""; |
| 763 |
var needLayer = typeof item[5] !== "undefined"; |
| 764 |
if (item[4]) { |
| 765 |
content += "@supports (".concat(item[4], ") {"); |
| 766 |
} |
| 767 |
if (item[2]) { |
| 768 |
content += "@media ".concat(item[2], " {"); |
| 769 |
} |
| 770 |
if (needLayer) { |
| 771 |
content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); |
| 772 |
} |
| 773 |
content += cssWithMappingToString(item); |
| 774 |
if (needLayer) { |
| 775 |
content += "}"; |
| 776 |
} |
| 777 |
if (item[2]) { |
| 778 |
content += "}"; |
| 779 |
} |
| 780 |
if (item[4]) { |
| 781 |
content += "}"; |
| 782 |
} |
| 783 |
return content; |
| 784 |
}).join(""); |
| 785 |
}; |
| 786 |
|
| 787 |
// import a list of modules into the list |
| 788 |
list.i = function i(modules, media, dedupe, supports, layer) { |
| 789 |
if (typeof modules === "string") { |
| 790 |
modules = [[null, modules, undefined]]; |
| 791 |
} |
| 792 |
var alreadyImportedModules = {}; |
| 793 |
if (dedupe) { |
| 794 |
for (var k = 0; k < this.length; k++) { |
| 795 |
var id = this[k][0]; |
| 796 |
if (id != null) { |
| 797 |
alreadyImportedModules[id] = true; |
| 798 |
} |
| 799 |
} |
| 800 |
} |
| 801 |
for (var _k = 0; _k < modules.length; _k++) { |
| 802 |
var item = [].concat(modules[_k]); |
| 803 |
if (dedupe && alreadyImportedModules[item[0]]) { |
| 804 |
continue; |
| 805 |
} |
| 806 |
if (typeof layer !== "undefined") { |
| 807 |
if (typeof item[5] === "undefined") { |
| 808 |
item[5] = layer; |
| 809 |
} else { |
| 810 |
item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); |
| 811 |
item[5] = layer; |
| 812 |
} |
| 813 |
} |
| 814 |
if (media) { |
| 815 |
if (!item[2]) { |
| 816 |
item[2] = media; |
| 817 |
} else { |
| 818 |
item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); |
| 819 |
item[2] = media; |
| 820 |
} |
| 821 |
} |
| 822 |
if (supports) { |
| 823 |
if (!item[4]) { |
| 824 |
item[4] = "".concat(supports); |
| 825 |
} else { |
| 826 |
item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); |
| 827 |
item[4] = supports; |
| 828 |
} |
| 829 |
} |
| 830 |
list.push(item); |
| 831 |
} |
| 832 |
}; |
| 833 |
return list; |
| 834 |
}; |
| 835 |
|
| 836 |
/***/ }, |
| 837 |
|
| 838 |
/***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js" |
| 839 |
/*!************************************************************!*\ |
| 840 |
!*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***! |
| 841 |
\************************************************************/ |
| 842 |
(module) { |
| 843 |
|
| 844 |
"use strict"; |
| 845 |
|
| 846 |
|
| 847 |
module.exports = function (item) { |
| 848 |
var content = item[1]; |
| 849 |
var cssMapping = item[3]; |
| 850 |
if (!cssMapping) { |
| 851 |
return content; |
| 852 |
} |
| 853 |
if (typeof btoa === "function") { |
| 854 |
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping)))); |
| 855 |
var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); |
| 856 |
var sourceMapping = "/*# ".concat(data, " */"); |
| 857 |
return [content].concat([sourceMapping]).join("\n"); |
| 858 |
} |
| 859 |
return [content].join("\n"); |
| 860 |
}; |
| 861 |
|
| 862 |
/***/ }, |
| 863 |
|
| 864 |
/***/ "./node_modules/toastify-js/src/toastify.css" |
| 865 |
/*!***************************************************!*\ |
| 866 |
!*** ./node_modules/toastify-js/src/toastify.css ***! |
| 867 |
\***************************************************/ |
| 868 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 869 |
|
| 870 |
"use strict"; |
| 871 |
__webpack_require__.r(__webpack_exports__); |
| 872 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 873 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 874 |
/* harmony export */ }); |
| 875 |
/* 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"); |
| 876 |
/* 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__); |
| 877 |
/* 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"); |
| 878 |
/* 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__); |
| 879 |
/* 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"); |
| 880 |
/* 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__); |
| 881 |
/* 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"); |
| 882 |
/* 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__); |
| 883 |
/* 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"); |
| 884 |
/* 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__); |
| 885 |
/* 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"); |
| 886 |
/* 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__); |
| 887 |
/* 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"); |
| 888 |
|
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
|
| 893 |
|
| 894 |
|
| 895 |
|
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
var options = {}; |
| 900 |
|
| 901 |
options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default()); |
| 902 |
options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default()); |
| 903 |
|
| 904 |
options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head"); |
| 905 |
|
| 906 |
options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default()); |
| 907 |
options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default()); |
| 908 |
|
| 909 |
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); |
| 910 |
|
| 911 |
|
| 912 |
|
| 913 |
|
| 914 |
/* 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); |
| 915 |
|
| 916 |
|
| 917 |
/***/ }, |
| 918 |
|
| 919 |
/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js" |
| 920 |
/*!****************************************************************************!*\ |
| 921 |
!*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! |
| 922 |
\****************************************************************************/ |
| 923 |
(module) { |
| 924 |
|
| 925 |
"use strict"; |
| 926 |
|
| 927 |
|
| 928 |
var stylesInDOM = []; |
| 929 |
function getIndexByIdentifier(identifier) { |
| 930 |
var result = -1; |
| 931 |
for (var i = 0; i < stylesInDOM.length; i++) { |
| 932 |
if (stylesInDOM[i].identifier === identifier) { |
| 933 |
result = i; |
| 934 |
break; |
| 935 |
} |
| 936 |
} |
| 937 |
return result; |
| 938 |
} |
| 939 |
function modulesToDom(list, options) { |
| 940 |
var idCountMap = {}; |
| 941 |
var identifiers = []; |
| 942 |
for (var i = 0; i < list.length; i++) { |
| 943 |
var item = list[i]; |
| 944 |
var id = options.base ? item[0] + options.base : item[0]; |
| 945 |
var count = idCountMap[id] || 0; |
| 946 |
var identifier = "".concat(id, " ").concat(count); |
| 947 |
idCountMap[id] = count + 1; |
| 948 |
var indexByIdentifier = getIndexByIdentifier(identifier); |
| 949 |
var obj = { |
| 950 |
css: item[1], |
| 951 |
media: item[2], |
| 952 |
sourceMap: item[3], |
| 953 |
supports: item[4], |
| 954 |
layer: item[5] |
| 955 |
}; |
| 956 |
if (indexByIdentifier !== -1) { |
| 957 |
stylesInDOM[indexByIdentifier].references++; |
| 958 |
stylesInDOM[indexByIdentifier].updater(obj); |
| 959 |
} else { |
| 960 |
var updater = addElementStyle(obj, options); |
| 961 |
options.byIndex = i; |
| 962 |
stylesInDOM.splice(i, 0, { |
| 963 |
identifier: identifier, |
| 964 |
updater: updater, |
| 965 |
references: 1 |
| 966 |
}); |
| 967 |
} |
| 968 |
identifiers.push(identifier); |
| 969 |
} |
| 970 |
return identifiers; |
| 971 |
} |
| 972 |
function addElementStyle(obj, options) { |
| 973 |
var api = options.domAPI(options); |
| 974 |
api.update(obj); |
| 975 |
var updater = function updater(newObj) { |
| 976 |
if (newObj) { |
| 977 |
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) { |
| 978 |
return; |
| 979 |
} |
| 980 |
api.update(obj = newObj); |
| 981 |
} else { |
| 982 |
api.remove(); |
| 983 |
} |
| 984 |
}; |
| 985 |
return updater; |
| 986 |
} |
| 987 |
module.exports = function (list, options) { |
| 988 |
options = options || {}; |
| 989 |
list = list || []; |
| 990 |
var lastIdentifiers = modulesToDom(list, options); |
| 991 |
return function update(newList) { |
| 992 |
newList = newList || []; |
| 993 |
for (var i = 0; i < lastIdentifiers.length; i++) { |
| 994 |
var identifier = lastIdentifiers[i]; |
| 995 |
var index = getIndexByIdentifier(identifier); |
| 996 |
stylesInDOM[index].references--; |
| 997 |
} |
| 998 |
var newLastIdentifiers = modulesToDom(newList, options); |
| 999 |
for (var _i = 0; _i < lastIdentifiers.length; _i++) { |
| 1000 |
var _identifier = lastIdentifiers[_i]; |
| 1001 |
var _index = getIndexByIdentifier(_identifier); |
| 1002 |
if (stylesInDOM[_index].references === 0) { |
| 1003 |
stylesInDOM[_index].updater(); |
| 1004 |
stylesInDOM.splice(_index, 1); |
| 1005 |
} |
| 1006 |
} |
| 1007 |
lastIdentifiers = newLastIdentifiers; |
| 1008 |
}; |
| 1009 |
}; |
| 1010 |
|
| 1011 |
/***/ }, |
| 1012 |
|
| 1013 |
/***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js" |
| 1014 |
/*!********************************************************************!*\ |
| 1015 |
!*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***! |
| 1016 |
\********************************************************************/ |
| 1017 |
(module) { |
| 1018 |
|
| 1019 |
"use strict"; |
| 1020 |
|
| 1021 |
|
| 1022 |
var memo = {}; |
| 1023 |
|
| 1024 |
/* istanbul ignore next */ |
| 1025 |
function getTarget(target) { |
| 1026 |
if (typeof memo[target] === "undefined") { |
| 1027 |
var styleTarget = document.querySelector(target); |
| 1028 |
|
| 1029 |
// Special case to return head of iframe instead of iframe itself |
| 1030 |
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { |
| 1031 |
try { |
| 1032 |
// This will throw an exception if access to iframe is blocked |
| 1033 |
// due to cross-origin restrictions |
| 1034 |
styleTarget = styleTarget.contentDocument.head; |
| 1035 |
} catch (e) { |
| 1036 |
// istanbul ignore next |
| 1037 |
styleTarget = null; |
| 1038 |
} |
| 1039 |
} |
| 1040 |
memo[target] = styleTarget; |
| 1041 |
} |
| 1042 |
return memo[target]; |
| 1043 |
} |
| 1044 |
|
| 1045 |
/* istanbul ignore next */ |
| 1046 |
function insertBySelector(insert, style) { |
| 1047 |
var target = getTarget(insert); |
| 1048 |
if (!target) { |
| 1049 |
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); |
| 1050 |
} |
| 1051 |
target.appendChild(style); |
| 1052 |
} |
| 1053 |
module.exports = insertBySelector; |
| 1054 |
|
| 1055 |
/***/ }, |
| 1056 |
|
| 1057 |
/***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js" |
| 1058 |
/*!**********************************************************************!*\ |
| 1059 |
!*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***! |
| 1060 |
\**********************************************************************/ |
| 1061 |
(module) { |
| 1062 |
|
| 1063 |
"use strict"; |
| 1064 |
|
| 1065 |
|
| 1066 |
/* istanbul ignore next */ |
| 1067 |
function insertStyleElement(options) { |
| 1068 |
var element = document.createElement("style"); |
| 1069 |
options.setAttributes(element, options.attributes); |
| 1070 |
options.insert(element, options.options); |
| 1071 |
return element; |
| 1072 |
} |
| 1073 |
module.exports = insertStyleElement; |
| 1074 |
|
| 1075 |
/***/ }, |
| 1076 |
|
| 1077 |
/***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js" |
| 1078 |
/*!**********************************************************************************!*\ |
| 1079 |
!*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***! |
| 1080 |
\**********************************************************************************/ |
| 1081 |
(module, __unused_webpack_exports, __webpack_require__) { |
| 1082 |
|
| 1083 |
"use strict"; |
| 1084 |
|
| 1085 |
|
| 1086 |
/* istanbul ignore next */ |
| 1087 |
function setAttributesWithoutAttributes(styleElement) { |
| 1088 |
var nonce = true ? __webpack_require__.nc : 0; |
| 1089 |
if (nonce) { |
| 1090 |
styleElement.setAttribute("nonce", nonce); |
| 1091 |
} |
| 1092 |
} |
| 1093 |
module.exports = setAttributesWithoutAttributes; |
| 1094 |
|
| 1095 |
/***/ }, |
| 1096 |
|
| 1097 |
/***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js" |
| 1098 |
/*!***************************************************************!*\ |
| 1099 |
!*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***! |
| 1100 |
\***************************************************************/ |
| 1101 |
(module) { |
| 1102 |
|
| 1103 |
"use strict"; |
| 1104 |
|
| 1105 |
|
| 1106 |
/* istanbul ignore next */ |
| 1107 |
function apply(styleElement, options, obj) { |
| 1108 |
var css = ""; |
| 1109 |
if (obj.supports) { |
| 1110 |
css += "@supports (".concat(obj.supports, ") {"); |
| 1111 |
} |
| 1112 |
if (obj.media) { |
| 1113 |
css += "@media ".concat(obj.media, " {"); |
| 1114 |
} |
| 1115 |
var needLayer = typeof obj.layer !== "undefined"; |
| 1116 |
if (needLayer) { |
| 1117 |
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {"); |
| 1118 |
} |
| 1119 |
css += obj.css; |
| 1120 |
if (needLayer) { |
| 1121 |
css += "}"; |
| 1122 |
} |
| 1123 |
if (obj.media) { |
| 1124 |
css += "}"; |
| 1125 |
} |
| 1126 |
if (obj.supports) { |
| 1127 |
css += "}"; |
| 1128 |
} |
| 1129 |
var sourceMap = obj.sourceMap; |
| 1130 |
if (sourceMap && typeof btoa !== "undefined") { |
| 1131 |
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); |
| 1132 |
} |
| 1133 |
|
| 1134 |
// For old IE |
| 1135 |
/* istanbul ignore if */ |
| 1136 |
options.styleTagTransform(css, styleElement, options.options); |
| 1137 |
} |
| 1138 |
function removeStyleElement(styleElement) { |
| 1139 |
// istanbul ignore if |
| 1140 |
if (styleElement.parentNode === null) { |
| 1141 |
return false; |
| 1142 |
} |
| 1143 |
styleElement.parentNode.removeChild(styleElement); |
| 1144 |
} |
| 1145 |
|
| 1146 |
/* istanbul ignore next */ |
| 1147 |
function domAPI(options) { |
| 1148 |
if (typeof document === "undefined") { |
| 1149 |
return { |
| 1150 |
update: function update() {}, |
| 1151 |
remove: function remove() {} |
| 1152 |
}; |
| 1153 |
} |
| 1154 |
var styleElement = options.insertStyleElement(options); |
| 1155 |
return { |
| 1156 |
update: function update(obj) { |
| 1157 |
apply(styleElement, options, obj); |
| 1158 |
}, |
| 1159 |
remove: function remove() { |
| 1160 |
removeStyleElement(styleElement); |
| 1161 |
} |
| 1162 |
}; |
| 1163 |
} |
| 1164 |
module.exports = domAPI; |
| 1165 |
|
| 1166 |
/***/ }, |
| 1167 |
|
| 1168 |
/***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js" |
| 1169 |
/*!*********************************************************************!*\ |
| 1170 |
!*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***! |
| 1171 |
\*********************************************************************/ |
| 1172 |
(module) { |
| 1173 |
|
| 1174 |
"use strict"; |
| 1175 |
|
| 1176 |
|
| 1177 |
/* istanbul ignore next */ |
| 1178 |
function styleTagTransform(css, styleElement) { |
| 1179 |
if (styleElement.styleSheet) { |
| 1180 |
styleElement.styleSheet.cssText = css; |
| 1181 |
} else { |
| 1182 |
while (styleElement.firstChild) { |
| 1183 |
styleElement.removeChild(styleElement.firstChild); |
| 1184 |
} |
| 1185 |
styleElement.appendChild(document.createTextNode(css)); |
| 1186 |
} |
| 1187 |
} |
| 1188 |
module.exports = styleTagTransform; |
| 1189 |
|
| 1190 |
/***/ }, |
| 1191 |
|
| 1192 |
/***/ "./node_modules/toastify-js/src/toastify.js" |
| 1193 |
/*!**************************************************!*\ |
| 1194 |
!*** ./node_modules/toastify-js/src/toastify.js ***! |
| 1195 |
\**************************************************/ |
| 1196 |
(module) { |
| 1197 |
|
| 1198 |
/*! |
| 1199 |
* Toastify js 1.12.0 |
| 1200 |
* https://github.com/apvarun/toastify-js |
| 1201 |
* @license MIT licensed |
| 1202 |
* |
| 1203 |
* Copyright (C) 2018 Varun A P |
| 1204 |
*/ |
| 1205 |
(function(root, factory) { |
| 1206 |
if ( true && module.exports) { |
| 1207 |
module.exports = factory(); |
| 1208 |
} else { |
| 1209 |
root.Toastify = factory(); |
| 1210 |
} |
| 1211 |
})(this, function(global) { |
| 1212 |
// Object initialization |
| 1213 |
var Toastify = function(options) { |
| 1214 |
// Returning a new init object |
| 1215 |
return new Toastify.lib.init(options); |
| 1216 |
}, |
| 1217 |
// Library version |
| 1218 |
version = "1.12.0"; |
| 1219 |
|
| 1220 |
// Set the default global options |
| 1221 |
Toastify.defaults = { |
| 1222 |
oldestFirst: true, |
| 1223 |
text: "Toastify is awesome!", |
| 1224 |
node: undefined, |
| 1225 |
duration: 3000, |
| 1226 |
selector: undefined, |
| 1227 |
callback: function () { |
| 1228 |
}, |
| 1229 |
destination: undefined, |
| 1230 |
newWindow: false, |
| 1231 |
close: false, |
| 1232 |
gravity: "toastify-top", |
| 1233 |
positionLeft: false, |
| 1234 |
position: '', |
| 1235 |
backgroundColor: '', |
| 1236 |
avatar: "", |
| 1237 |
className: "", |
| 1238 |
stopOnFocus: true, |
| 1239 |
onClick: function () { |
| 1240 |
}, |
| 1241 |
offset: {x: 0, y: 0}, |
| 1242 |
escapeMarkup: true, |
| 1243 |
ariaLive: 'polite', |
| 1244 |
style: {background: ''} |
| 1245 |
}; |
| 1246 |
|
| 1247 |
// Defining the prototype of the object |
| 1248 |
Toastify.lib = Toastify.prototype = { |
| 1249 |
toastify: version, |
| 1250 |
|
| 1251 |
constructor: Toastify, |
| 1252 |
|
| 1253 |
// Initializing the object with required parameters |
| 1254 |
init: function(options) { |
| 1255 |
// Verifying and validating the input object |
| 1256 |
if (!options) { |
| 1257 |
options = {}; |
| 1258 |
} |
| 1259 |
|
| 1260 |
// Creating the options object |
| 1261 |
this.options = {}; |
| 1262 |
|
| 1263 |
this.toastElement = null; |
| 1264 |
|
| 1265 |
// Validating the options |
| 1266 |
this.options.text = options.text || Toastify.defaults.text; // Display message |
| 1267 |
this.options.node = options.node || Toastify.defaults.node; // Display content as node |
| 1268 |
this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration |
| 1269 |
this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector |
| 1270 |
this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display |
| 1271 |
this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination |
| 1272 |
this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window |
| 1273 |
this.options.close = options.close || Toastify.defaults.close; // Show toast close icon |
| 1274 |
this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom |
| 1275 |
this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right |
| 1276 |
this.options.position = options.position || Toastify.defaults.position; // toast position - left or right |
| 1277 |
this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color |
| 1278 |
this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path |
| 1279 |
this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast |
| 1280 |
this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus |
| 1281 |
this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click |
| 1282 |
this.options.offset = options.offset || Toastify.defaults.offset; // toast offset |
| 1283 |
this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup; |
| 1284 |
this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive; |
| 1285 |
this.options.style = options.style || Toastify.defaults.style; |
| 1286 |
if(options.backgroundColor) { |
| 1287 |
this.options.style.background = options.backgroundColor; |
| 1288 |
} |
| 1289 |
|
| 1290 |
// Returning the current object for chaining functions |
| 1291 |
return this; |
| 1292 |
}, |
| 1293 |
|
| 1294 |
// Building the DOM element |
| 1295 |
buildToast: function() { |
| 1296 |
// Validating if the options are defined |
| 1297 |
if (!this.options) { |
| 1298 |
throw "Toastify is not initialized"; |
| 1299 |
} |
| 1300 |
|
| 1301 |
// Creating the DOM object |
| 1302 |
var divElement = document.createElement("div"); |
| 1303 |
divElement.className = "toastify on " + this.options.className; |
| 1304 |
|
| 1305 |
// Positioning toast to left or right or center |
| 1306 |
if (!!this.options.position) { |
| 1307 |
divElement.className += " toastify-" + this.options.position; |
| 1308 |
} else { |
| 1309 |
// To be depreciated in further versions |
| 1310 |
if (this.options.positionLeft === true) { |
| 1311 |
divElement.className += " toastify-left"; |
| 1312 |
console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.') |
| 1313 |
} else { |
| 1314 |
// Default position |
| 1315 |
divElement.className += " toastify-right"; |
| 1316 |
} |
| 1317 |
} |
| 1318 |
|
| 1319 |
// Assigning gravity of element |
| 1320 |
divElement.className += " " + this.options.gravity; |
| 1321 |
|
| 1322 |
if (this.options.backgroundColor) { |
| 1323 |
// This is being deprecated in favor of using the style HTML DOM property |
| 1324 |
console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'); |
| 1325 |
} |
| 1326 |
|
| 1327 |
// Loop through our style object and apply styles to divElement |
| 1328 |
for (var property in this.options.style) { |
| 1329 |
divElement.style[property] = this.options.style[property]; |
| 1330 |
} |
| 1331 |
|
| 1332 |
// Announce the toast to screen readers |
| 1333 |
if (this.options.ariaLive) { |
| 1334 |
divElement.setAttribute('aria-live', this.options.ariaLive) |
| 1335 |
} |
| 1336 |
|
| 1337 |
// Adding the toast message/node |
| 1338 |
if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) { |
| 1339 |
// If we have a valid node, we insert it |
| 1340 |
divElement.appendChild(this.options.node) |
| 1341 |
} else { |
| 1342 |
if (this.options.escapeMarkup) { |
| 1343 |
divElement.innerText = this.options.text; |
| 1344 |
} else { |
| 1345 |
divElement.innerHTML = this.options.text; |
| 1346 |
} |
| 1347 |
|
| 1348 |
if (this.options.avatar !== "") { |
| 1349 |
var avatarElement = document.createElement("img"); |
| 1350 |
avatarElement.src = this.options.avatar; |
| 1351 |
|
| 1352 |
avatarElement.className = "toastify-avatar"; |
| 1353 |
|
| 1354 |
if (this.options.position == "left" || this.options.positionLeft === true) { |
| 1355 |
// Adding close icon on the left of content |
| 1356 |
divElement.appendChild(avatarElement); |
| 1357 |
} else { |
| 1358 |
// Adding close icon on the right of content |
| 1359 |
divElement.insertAdjacentElement("afterbegin", avatarElement); |
| 1360 |
} |
| 1361 |
} |
| 1362 |
} |
| 1363 |
|
| 1364 |
// Adding a close icon to the toast |
| 1365 |
if (this.options.close === true) { |
| 1366 |
// Create a span for close element |
| 1367 |
var closeElement = document.createElement("button"); |
| 1368 |
closeElement.type = "button"; |
| 1369 |
closeElement.setAttribute("aria-label", "Close"); |
| 1370 |
closeElement.className = "toast-close"; |
| 1371 |
closeElement.innerHTML = "✖"; |
| 1372 |
|
| 1373 |
// Triggering the removal of toast from DOM on close click |
| 1374 |
closeElement.addEventListener( |
| 1375 |
"click", |
| 1376 |
function(event) { |
| 1377 |
event.stopPropagation(); |
| 1378 |
this.removeElement(this.toastElement); |
| 1379 |
window.clearTimeout(this.toastElement.timeOutValue); |
| 1380 |
}.bind(this) |
| 1381 |
); |
| 1382 |
|
| 1383 |
//Calculating screen width |
| 1384 |
var width = window.innerWidth > 0 ? window.innerWidth : screen.width; |
| 1385 |
|
| 1386 |
// Adding the close icon to the toast element |
| 1387 |
// Display on the right if screen width is less than or equal to 360px |
| 1388 |
if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) { |
| 1389 |
// Adding close icon on the left of content |
| 1390 |
divElement.insertAdjacentElement("afterbegin", closeElement); |
| 1391 |
} else { |
| 1392 |
// Adding close icon on the right of content |
| 1393 |
divElement.appendChild(closeElement); |
| 1394 |
} |
| 1395 |
} |
| 1396 |
|
| 1397 |
// Clear timeout while toast is focused |
| 1398 |
if (this.options.stopOnFocus && this.options.duration > 0) { |
| 1399 |
var self = this; |
| 1400 |
// stop countdown |
| 1401 |
divElement.addEventListener( |
| 1402 |
"mouseover", |
| 1403 |
function(event) { |
| 1404 |
window.clearTimeout(divElement.timeOutValue); |
| 1405 |
} |
| 1406 |
) |
| 1407 |
// add back the timeout |
| 1408 |
divElement.addEventListener( |
| 1409 |
"mouseleave", |
| 1410 |
function() { |
| 1411 |
divElement.timeOutValue = window.setTimeout( |
| 1412 |
function() { |
| 1413 |
// Remove the toast from DOM |
| 1414 |
self.removeElement(divElement); |
| 1415 |
}, |
| 1416 |
self.options.duration |
| 1417 |
) |
| 1418 |
} |
| 1419 |
) |
| 1420 |
} |
| 1421 |
|
| 1422 |
// Adding an on-click destination path |
| 1423 |
if (typeof this.options.destination !== "undefined") { |
| 1424 |
divElement.addEventListener( |
| 1425 |
"click", |
| 1426 |
function(event) { |
| 1427 |
event.stopPropagation(); |
| 1428 |
if (this.options.newWindow === true) { |
| 1429 |
window.open(this.options.destination, "_blank"); |
| 1430 |
} else { |
| 1431 |
window.location = this.options.destination; |
| 1432 |
} |
| 1433 |
}.bind(this) |
| 1434 |
); |
| 1435 |
} |
| 1436 |
|
| 1437 |
if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") { |
| 1438 |
divElement.addEventListener( |
| 1439 |
"click", |
| 1440 |
function(event) { |
| 1441 |
event.stopPropagation(); |
| 1442 |
this.options.onClick(); |
| 1443 |
}.bind(this) |
| 1444 |
); |
| 1445 |
} |
| 1446 |
|
| 1447 |
// Adding offset |
| 1448 |
if(typeof this.options.offset === "object") { |
| 1449 |
|
| 1450 |
var x = getAxisOffsetAValue("x", this.options); |
| 1451 |
var y = getAxisOffsetAValue("y", this.options); |
| 1452 |
|
| 1453 |
var xOffset = this.options.position == "left" ? x : "-" + x; |
| 1454 |
var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y; |
| 1455 |
|
| 1456 |
divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")"; |
| 1457 |
|
| 1458 |
} |
| 1459 |
|
| 1460 |
// Returning the generated element |
| 1461 |
return divElement; |
| 1462 |
}, |
| 1463 |
|
| 1464 |
// Displaying the toast |
| 1465 |
showToast: function() { |
| 1466 |
// Creating the DOM object for the toast |
| 1467 |
this.toastElement = this.buildToast(); |
| 1468 |
|
| 1469 |
// Getting the root element to with the toast needs to be added |
| 1470 |
var rootElement; |
| 1471 |
if (typeof this.options.selector === "string") { |
| 1472 |
rootElement = document.getElementById(this.options.selector); |
| 1473 |
} else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) { |
| 1474 |
rootElement = this.options.selector; |
| 1475 |
} else { |
| 1476 |
rootElement = document.body; |
| 1477 |
} |
| 1478 |
|
| 1479 |
// Validating if root element is present in DOM |
| 1480 |
if (!rootElement) { |
| 1481 |
throw "Root element is not defined"; |
| 1482 |
} |
| 1483 |
|
| 1484 |
// Adding the DOM element |
| 1485 |
var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild; |
| 1486 |
rootElement.insertBefore(this.toastElement, elementToInsert); |
| 1487 |
|
| 1488 |
// Repositioning the toasts in case multiple toasts are present |
| 1489 |
Toastify.reposition(); |
| 1490 |
|
| 1491 |
if (this.options.duration > 0) { |
| 1492 |
this.toastElement.timeOutValue = window.setTimeout( |
| 1493 |
function() { |
| 1494 |
// Remove the toast from DOM |
| 1495 |
this.removeElement(this.toastElement); |
| 1496 |
}.bind(this), |
| 1497 |
this.options.duration |
| 1498 |
); // Binding `this` for function invocation |
| 1499 |
} |
| 1500 |
|
| 1501 |
// Supporting function chaining |
| 1502 |
return this; |
| 1503 |
}, |
| 1504 |
|
| 1505 |
hideToast: function() { |
| 1506 |
if (this.toastElement.timeOutValue) { |
| 1507 |
clearTimeout(this.toastElement.timeOutValue); |
| 1508 |
} |
| 1509 |
this.removeElement(this.toastElement); |
| 1510 |
}, |
| 1511 |
|
| 1512 |
// Removing the element from the DOM |
| 1513 |
removeElement: function(toastElement) { |
| 1514 |
// Hiding the element |
| 1515 |
// toastElement.classList.remove("on"); |
| 1516 |
toastElement.className = toastElement.className.replace(" on", ""); |
| 1517 |
|
| 1518 |
// Removing the element from DOM after transition end |
| 1519 |
window.setTimeout( |
| 1520 |
function() { |
| 1521 |
// remove options node if any |
| 1522 |
if (this.options.node && this.options.node.parentNode) { |
| 1523 |
this.options.node.parentNode.removeChild(this.options.node); |
| 1524 |
} |
| 1525 |
|
| 1526 |
// Remove the element from the DOM, only when the parent node was not removed before. |
| 1527 |
if (toastElement.parentNode) { |
| 1528 |
toastElement.parentNode.removeChild(toastElement); |
| 1529 |
} |
| 1530 |
|
| 1531 |
// Calling the callback function |
| 1532 |
this.options.callback.call(toastElement); |
| 1533 |
|
| 1534 |
// Repositioning the toasts again |
| 1535 |
Toastify.reposition(); |
| 1536 |
}.bind(this), |
| 1537 |
400 |
| 1538 |
); // Binding `this` for function invocation |
| 1539 |
}, |
| 1540 |
}; |
| 1541 |
|
| 1542 |
// Positioning the toasts on the DOM |
| 1543 |
Toastify.reposition = function() { |
| 1544 |
|
| 1545 |
// Top margins with gravity |
| 1546 |
var topLeftOffsetSize = { |
| 1547 |
top: 15, |
| 1548 |
bottom: 15, |
| 1549 |
}; |
| 1550 |
var topRightOffsetSize = { |
| 1551 |
top: 15, |
| 1552 |
bottom: 15, |
| 1553 |
}; |
| 1554 |
var offsetSize = { |
| 1555 |
top: 15, |
| 1556 |
bottom: 15, |
| 1557 |
}; |
| 1558 |
|
| 1559 |
// Get all toast messages on the DOM |
| 1560 |
var allToasts = document.getElementsByClassName("toastify"); |
| 1561 |
|
| 1562 |
var classUsed; |
| 1563 |
|
| 1564 |
// Modifying the position of each toast element |
| 1565 |
for (var i = 0; i < allToasts.length; i++) { |
| 1566 |
// Getting the applied gravity |
| 1567 |
if (containsClass(allToasts[i], "toastify-top") === true) { |
| 1568 |
classUsed = "toastify-top"; |
| 1569 |
} else { |
| 1570 |
classUsed = "toastify-bottom"; |
| 1571 |
} |
| 1572 |
|
| 1573 |
var height = allToasts[i].offsetHeight; |
| 1574 |
classUsed = classUsed.substr(9, classUsed.length-1) |
| 1575 |
// Spacing between toasts |
| 1576 |
var offset = 15; |
| 1577 |
|
| 1578 |
var width = window.innerWidth > 0 ? window.innerWidth : screen.width; |
| 1579 |
|
| 1580 |
// Show toast in center if screen with less than or equal to 360px |
| 1581 |
if (width <= 360) { |
| 1582 |
// Setting the position |
| 1583 |
allToasts[i].style[classUsed] = offsetSize[classUsed] + "px"; |
| 1584 |
|
| 1585 |
offsetSize[classUsed] += height + offset; |
| 1586 |
} else { |
| 1587 |
if (containsClass(allToasts[i], "toastify-left") === true) { |
| 1588 |
// Setting the position |
| 1589 |
allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px"; |
| 1590 |
|
| 1591 |
topLeftOffsetSize[classUsed] += height + offset; |
| 1592 |
} else { |
| 1593 |
// Setting the position |
| 1594 |
allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px"; |
| 1595 |
|
| 1596 |
topRightOffsetSize[classUsed] += height + offset; |
| 1597 |
} |
| 1598 |
} |
| 1599 |
} |
| 1600 |
|
| 1601 |
// Supporting function chaining |
| 1602 |
return this; |
| 1603 |
}; |
| 1604 |
|
| 1605 |
// Helper function to get offset. |
| 1606 |
function getAxisOffsetAValue(axis, options) { |
| 1607 |
|
| 1608 |
if(options.offset[axis]) { |
| 1609 |
if(isNaN(options.offset[axis])) { |
| 1610 |
return options.offset[axis]; |
| 1611 |
} |
| 1612 |
else { |
| 1613 |
return options.offset[axis] + 'px'; |
| 1614 |
} |
| 1615 |
} |
| 1616 |
|
| 1617 |
return '0px'; |
| 1618 |
|
| 1619 |
} |
| 1620 |
|
| 1621 |
function containsClass(elem, yourClass) { |
| 1622 |
if (!elem || typeof yourClass !== "string") { |
| 1623 |
return false; |
| 1624 |
} else if ( |
| 1625 |
elem.className && |
| 1626 |
elem.className |
| 1627 |
.trim() |
| 1628 |
.split(/\s+/gi) |
| 1629 |
.indexOf(yourClass) > -1 |
| 1630 |
) { |
| 1631 |
return true; |
| 1632 |
} else { |
| 1633 |
return false; |
| 1634 |
} |
| 1635 |
} |
| 1636 |
|
| 1637 |
// Setting up the prototype for the init object |
| 1638 |
Toastify.lib.init.prototype = Toastify.lib; |
| 1639 |
|
| 1640 |
// Returning the Toastify function to be assigned to the window object/module |
| 1641 |
return Toastify; |
| 1642 |
}); |
| 1643 |
|
| 1644 |
|
| 1645 |
/***/ } |
| 1646 |
|
| 1647 |
/******/ }); |
| 1648 |
/************************************************************************/ |
| 1649 |
/******/ // The module cache |
| 1650 |
/******/ const __webpack_module_cache__ = {}; |
| 1651 |
/******/ |
| 1652 |
/******/ // The require function |
| 1653 |
/******/ function __webpack_require__(moduleId) { |
| 1654 |
/******/ // Check if module is in cache |
| 1655 |
/******/ const cachedModule = __webpack_module_cache__[moduleId]; |
| 1656 |
/******/ if (cachedModule !== undefined) { |
| 1657 |
/******/ return cachedModule.exports; |
| 1658 |
/******/ } |
| 1659 |
/******/ // Create a new module (and put it into the cache) |
| 1660 |
/******/ const module = __webpack_module_cache__[moduleId] = { |
| 1661 |
/******/ id: moduleId, |
| 1662 |
/******/ // no module.loaded needed |
| 1663 |
/******/ exports: {} |
| 1664 |
/******/ }; |
| 1665 |
/******/ |
| 1666 |
/******/ // Execute the module function |
| 1667 |
/******/ if (!(moduleId in __webpack_modules__)) { |
| 1668 |
/******/ delete __webpack_module_cache__[moduleId]; |
| 1669 |
/******/ const e = new Error("Cannot find module '" + moduleId + "'"); |
| 1670 |
/******/ e.code = 'MODULE_NOT_FOUND'; |
| 1671 |
/******/ throw e; |
| 1672 |
/******/ } |
| 1673 |
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
| 1674 |
/******/ |
| 1675 |
/******/ // Return the exports of the module |
| 1676 |
/******/ return module.exports; |
| 1677 |
/******/ } |
| 1678 |
/******/ |
| 1679 |
/************************************************************************/ |
| 1680 |
/******/ /* webpack/runtime/compat get default export */ |
| 1681 |
/******/ (() => { |
| 1682 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 1683 |
/******/ __webpack_require__.n = (module) => { |
| 1684 |
/******/ const getter = module && module.__esModule ? |
| 1685 |
/******/ () => (module['default']) : |
| 1686 |
/******/ () => (module); |
| 1687 |
/******/ __webpack_require__.d(getter, { a: getter }); |
| 1688 |
/******/ return getter; |
| 1689 |
/******/ }; |
| 1690 |
/******/ })(); |
| 1691 |
/******/ |
| 1692 |
/******/ /* webpack/runtime/define property getters */ |
| 1693 |
/******/ (() => { |
| 1694 |
/******/ // define getter/value functions for harmony exports |
| 1695 |
/******/ __webpack_require__.d = (exports, definition) => { |
| 1696 |
/******/ if(Array.isArray(definition)) { |
| 1697 |
/******/ var i = 0; |
| 1698 |
/******/ while(i < definition.length) { |
| 1699 |
/******/ var key = definition[i++]; |
| 1700 |
/******/ var binding = definition[i++]; |
| 1701 |
/******/ if(!__webpack_require__.o(exports, key)) { |
| 1702 |
/******/ if(binding === 0) { |
| 1703 |
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] }); |
| 1704 |
/******/ } else { |
| 1705 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding }); |
| 1706 |
/******/ } |
| 1707 |
/******/ } else if(binding === 0) { i++; } |
| 1708 |
/******/ } |
| 1709 |
/******/ } else { |
| 1710 |
/******/ for(var key in definition) { |
| 1711 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 1712 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 1713 |
/******/ } |
| 1714 |
/******/ } |
| 1715 |
/******/ } |
| 1716 |
/******/ }; |
| 1717 |
/******/ })(); |
| 1718 |
/******/ |
| 1719 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 1720 |
/******/ (() => { |
| 1721 |
/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop)) |
| 1722 |
/******/ })(); |
| 1723 |
/******/ |
| 1724 |
/******/ /* webpack/runtime/make namespace object */ |
| 1725 |
/******/ (() => { |
| 1726 |
/******/ // define __esModule on exports |
| 1727 |
/******/ __webpack_require__.r = (exports) => { |
| 1728 |
/******/ if(Symbol.toStringTag) { |
| 1729 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 1730 |
/******/ } |
| 1731 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 1732 |
/******/ }; |
| 1733 |
/******/ })(); |
| 1734 |
/******/ |
| 1735 |
/******/ /* webpack/runtime/nonce */ |
| 1736 |
/******/ (() => { |
| 1737 |
/******/ __webpack_require__.nc = undefined; |
| 1738 |
/******/ })(); |
| 1739 |
/******/ |
| 1740 |
/************************************************************************/ |
| 1741 |
let __webpack_exports__ = {}; |
| 1742 |
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |
| 1743 |
(() => { |
| 1744 |
"use strict"; |
| 1745 |
/*!*********************************************!*\ |
| 1746 |
!*** ./assets/src/js/admin/admin-orders.js ***! |
| 1747 |
\*********************************************/ |
| 1748 |
__webpack_require__.r(__webpack_exports__); |
| 1749 |
/* harmony import */ var _orders_export_orders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./orders/export-orders */ "./assets/src/js/admin/orders/export-orders.js"); |
| 1750 |
|
| 1751 |
(0,_orders_export_orders__WEBPACK_IMPORTED_MODULE_0__.ExportOrdersToCSV)(); |
| 1752 |
})(); |
| 1753 |
|
| 1754 |
/******/ })() |
| 1755 |
; |
| 1756 |
//# sourceMappingURL=admin-orders.js.map |