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A,IAAAqE,EAAA2B,EAAAC,GAAAjG,EAGA,IAAA6D,EAAAgC,EAAArB,EAAA,EACA,GAAAH,EAAA6B,KAAAC,GAAA,IAAAP,EAAAO,IAAA,CACA,IAAAtC,KAAAmC,EACApC,EAAA2B,EAAAS,EAAAnC,KACAD,EAAAK,EAAAJ,GAAAmC,EAAAnC,IAGA,GAAAoC,EAAA,IAAA7B,EAAA6B,EAAArC,EACA,CAEA,IADAmC,GAAAA,EAAA/F,GACMwE,EAAAH,EAAAzD,OAAqB4D,IAC3BqB,EAAAxB,EAAAG,GACAZ,EAAA2B,EAAAK,EAAAC,IAAAD,EAAAC,IACAD,EAAAC,GAAA,KAEAD,EAAAC,GAAA,EAEA,OAAAjC,EAAAO,EAAAC,IAGAgC,EAAAC,KAAA,2BAAAA,KAAA,+BACAD,EAAAjE,QAAA2D,EAAAQ,KAAA,SACAF,EAAAjD,KAAA2C,EAAAQ,KAAA,KAAAF,EAAAjD,KAAAmD,KAAAF,QC7CA,IAAAG,EAAA3C,EAAAO,OAAAV,EAAA,WAAAG,EAAA,QACA2C,EAAA3C,EAAAO,EAAAoC","sources":["webpack://@logos/commerceweb-frontend/./Scripts/site/cart/entries/shoppingcart.js","webpack://@logos/commerceweb-frontend/./Scripts/site/cart/utility/cartnotificationutility.js","webpack://@logos/commerceweb-frontend/./Scripts/site/cart/utility/eventaggregator.js","webpack://@logos/commerceweb-frontend/webpack/bootstrap","webpack://@logos/commerceweb-frontend/webpack/runtime/chunk loaded","webpack://@logos/commerceweb-frontend/webpack/runtime/global","webpack://@logos/commerceweb-frontend/webpack/runtime/hasOwnProperty shorthand","webpack://@logos/commerceweb-frontend/webpack/runtime/jsonp chunk loading","webpack://@logos/commerceweb-frontend/webpack/startup"],"sourcesContent":["const $ = require('jquery');\nconst events = require('../utility/eventaggregator.js');\nconst cartNotificationUtility = require('../utility/cartnotificationutility.js');\n\nconst checkoutMainHeader = $('.checkout-main .header');\n\n// Only show checkout-main's header on mobile when there are elements (payment plans or logos credit) above it or if group license info is present\nfunction updateCheckoutMainHeader(event, data) {\n\tconst cartContainer = document.querySelector('.cart-container');\n\n\tconst isCreditComponentDisplayed = data ? data.order.canApplyCredit : cartContainer.dataset.canApplyCredit === 'true';\n\tconst arePaymentPlansDisplayed = data\n\t\t? data.order.showCartPaymentPlans\n\t\t: cartContainer.dataset.showCartPaymentPlans === 'true';\n\n\tconst groupLicenseElement = document.querySelector('.header__group-license');\n\n\tcheckoutMainHeader.toggleClass(\n\t\t'mobile-hidden',\n\t\t!arePaymentPlansDisplayed && !isCreditComponentDisplayed && !groupLicenseElement\n\t);\n}\n\nif (checkoutMainHeader.length) {\n\tupdateCheckoutMainHeader();\n\tevents.on('cart:updated', updateCheckoutMainHeader);\n}\n\ncartNotificationUtility.init();\n","'use strict';\n\nconst $ = require('jquery');\nconst events = require('./eventaggregator.js');\n\nmodule.exports = {\n\tinit: function () {\n\t\tlet alreadyDisplayedNotification = false;\n\t\tlet previousNumberOfPayments = null;\n\n\t\tevents.on('cart:updated', (event, newCartData) => {\n\t\t\tconst notifications = newCartData.order.notifications ?? [];\n\t\t\tconst immediatePaymentPreventsBalanceDueFromSurpassingLimitNotification = notifications.find(\n\t\t\t\tn => n.code === 'ImmediatePaymentPreventsBalanceDueFromSurpassingLimit'\n\t\t\t);\n\t\t\tconst notificationBannerNotification = $(\n\t\t\t\t'.js-cart-notification[js-notification-code=\"ImmediatePaymentPreventsBalanceDueFromSurpassingLimit\"]'\n\t\t\t);\n\n\t\t\tif (immediatePaymentPreventsBalanceDueFromSurpassingLimitNotification) {\n\t\t\t\t// Note that this creates a different style of notification than the _Notifications.cshtml notification that may be present on page load.\n\t\t\t\t// We could unify these styles, but the static notification (from _Notifications.cshtml) feels better-suited to a notification display for a page load,\n\t\t\t\t// and the dynamic sweep-in/sweep-out notification from window.NotificationUtility.notify feels better-suited to a notification display for an update after page load.\n\t\t\t\tif (\n\t\t\t\t\twindow.NotificationUtility &&\n\t\t\t\t\tnotificationBannerNotification.length === 0 &&\n\t\t\t\t\t(!alreadyDisplayedNotification || newCartData.order.numberOfPayments !== previousNumberOfPayments)\n\t\t\t\t) {\n\t\t\t\t\twindow.NotificationUtility.notify(\n\t\t\t\t\t\timmediatePaymentPreventsBalanceDueFromSurpassingLimitNotification.message,\n\t\t\t\t\t\timmediatePaymentPreventsBalanceDueFromSurpassingLimitNotification.kind\n\t\t\t\t\t);\n\t\t\t\t\talreadyDisplayedNotification = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\talreadyDisplayedNotification = false;\n\n\t\t\t\tif (notificationBannerNotification.length > 0) {\n\t\t\t\t\tnotificationBannerNotification.remove();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpreviousNumberOfPayments = newCartData.order.numberOfPayments;\n\n\t\t\tconst otherNotifications = notifications.filter(\n\t\t\t\tn => n.code !== 'ImmediatePaymentPreventsBalanceDueFromSurpassingLimit'\n\t\t\t);\n\n\t\t\totherNotifications.forEach(notification =>\n\t\t\t\twindow.NotificationUtility.notify(notification.message, notification.kind)\n\t\t\t);\n\t\t});\n\t},\n};\n","'use strict';\n\nconst handlers = {};\n// pending events allow a lot of subscribers to all come online during the same tick\nlet pending = {};\n// the timeout id to clear pending events at the end of a tick after an event has been triggered\nlet clear = undefined;\nconst eventAggregator = {\n\ton: function (events, handler) {\n\t\t// events can be one event (\"cart:updated\") or multiple separated by spaces (\"cart:validated cart:invalidated\")\n\t\t// this preserves the behavior of jQuery.on()\n\t\tfor (const event of events.split(' ')) {\n\t\t\tif (!handlers[event]) {\n\t\t\t\thandlers[event] = [];\n\t\t\t}\n\t\t\t// don't modify the handlers array or it'll cause iterator issues\n\t\t\thandlers[event] = [...handlers[event], handler];\n\t\t\t// pending events were fired on the same tick, but before you registered your handler\n\t\t\tif (!pending[event]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const data of pending[event]) {\n\t\t\t\thandler({ type: event }, data);\n\t\t\t}\n\t\t}\n\t},\n\toff: function (events, handler) {\n\t\t// events can be one event (\"cart:updated\") or multiple separated by spaces (\"cart:validated cart:invalidated\")\n\t\t// this preserves the behavior of jQuery.off()\n\t\tfor (const event of events.split(' ')) {\n\t\t\tif (!handlers[event]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst index = handlers[event].indexOf(handler);\n\t\t\tif (index === -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// don't modify the handlers array or it'll cause iterator issues\n\t\t\thandlers[event] = handlers[event].filter((it, ix) => ix !== index);\n\t\t}\n\t},\n\ttrigger: function (event, data) {\n\t\tif (typeof window === 'undefined') {\n\t\t\tthrow new Error('Events cannot be triggered server-side. Wrap them in an event handler or useEffect.');\n\t\t}\n\t\tif (!pending[event]) {\n\t\t\tpending[event] = [];\n\t\t}\n\t\tpending[event].push(data);\n\t\tif (!handlers[event]) {\n\t\t\treturn;\n\t\t}\n\t\tfor (const handler of handlers[event]) {\n\t\t\ttry {\n\t\t\t\thandler({ type: event }, data);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(`[eventAggregator] Error in \"${event}\" handler:`, e);\n\t\t\t}\n\t\t}\n\t\tif (!clear) {\n\t\t\tclear = setTimeout(() => {\n\t\t\t\t// on the next tick, clear the pending queue and allow us to restart the pending queue\n\t\t\t\tclear = undefined;\n\t\t\t\tpending = {};\n\t\t\t}, 0);\n\t\t}\n\t},\n};\n\nif (!global.eventAggregator) {\n\tglobal.eventAggregator = eventAggregator;\n}\nmodule.exports = global.eventAggregator;\n","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","const deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tlet notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tlet [chunkIds, fn, priority] = deferred[i];\n\t\tlet fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tconst r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nconst installedChunks = {\n\t9240: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nconst webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tlet [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nconst chunkLoadingGlobal = self[\"__LOADABLE_LOADED_CHUNKS__\"] = self[\"__LOADABLE_LOADED_CHUNKS__\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nlet __webpack_exports__ = __webpack_require__.O(undefined, [3420], () => (__webpack_require__(22658)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["$","require","events","cartNotificationUtility","checkoutMainHeader","updateCheckoutMainHeader","event","data","cartContainer","document","querySelector","isCreditComponentDisplayed","order","canApplyCredit","dataset","arePaymentPlansDisplayed","showCartPaymentPlans","groupLicenseElement","toggleClass","length","on","init","module","exports","alreadyDisplayedNotification","previousNumberOfPayments","newCartData","_newCartData$order$no","notifications","immediatePaymentPreventsBalanceDueFromSurpassingLimitNotification","find","n","code","notificationBannerNotification","window","NotificationUtility","numberOfPayments","notify","message","kind","remove","filter","forEach","notification","handlers","clear","pending","eventAggregator","handler","split","type","off","index","indexOf","it","ix","trigger","Error","push","e","console","error","concat","setTimeout","undefined","global","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","i","notFulfilled","Infinity","fulfilled","j","Object","keys","every","key","splice","r","g","globalThis","this","Function","o","obj","prop","prototype","hasOwnProperty","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","id","chunkLoadingGlobal","self","bind","__webpack_exports__"],"sourceRoot":""}