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A,EAAAA,UAAS,gBAEtC","sources":["webpack://app_custom_lilly_pulitzer/../link_afterpay/cartridges/int_afterpay_ext/cartridge/client/default/js/afterpay.js","webpack://app_custom_lilly_pulitzer/../link_googleanalytics/cartridges/link_googleanalytics/cartridge/client/default/js/util/analytics-util.js","webpack://app_custom_lilly_pulitzer/../link_googleanalytics/cartridges/link_googleanalytics/cartridge/client/default/js/util/constants.js","webpack://app_custom_lilly_pulitzer/../link_secretsauce/cartridges/link_secretsauce/cartridge/client/default/js/product/secretsauce.js","webpack://app_custom_lilly_pulitzer/../node_modules/.pnpm/hammerjs@2.0.8/node_modules/hammerjs/hammer.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/checkout/formErrors.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/clientSideValidation.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/carousel.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/etmc.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/imageSlider.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/pdpEdd.js","webpack://app_custom_lilly_pulitzer/../link_bolt/cartridges/int_bolt_sfra_lp/cartridge/client/default/js/bolt/boltHelpers.js","webpack://app_custom_lilly_pulitzer/../link_bolt/cartridges/int_bolt_sfra_lp/cartridge/client/default/js/bolt/account.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/cart/cart.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/pickUpInStore/ispuHelper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/pickUpInStore.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/constants.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/inventoryMessaging.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/ispuDeliveryMessaging.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/messagingUtil.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/shippingPreferenceHelper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/storeDetailHelper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/constants.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/domUtil.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/googleMaps.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/login/login.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/loyalty/loyaltyDrawer.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/popover.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/base.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/detail.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/helper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/monogram.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/quickView.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/quickView/quickViewHelpers.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/templates.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/util.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/wishlist/helper.js","webpack://app_custom_lilly_pulitzer/../plugin_instorepickup/cartridges/plugin_instorepickup/cartridge/client/default/js/product/pdpInstoreInventory.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/formErrors.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/errorNotification.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/formValidation.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/login/login.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/storeLocator/storeLocator.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack://app_custom_lilly_pulitzer/webpack/bootstrap","webpack://app_custom_lilly_pulitzer/webpack/runtime/compat get default export","webpack://app_custom_lilly_pulitzer/webpack/runtime/define property getters","webpack://app_custom_lilly_pulitzer/webpack/runtime/hasOwnProperty shorthand","webpack://app_custom_lilly_pulitzer/webpack/runtime/make namespace object","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/pdpQuickView.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/notifyMe.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/productDetail.js"],"sourcesContent":["'use strict';\n\nconst { getProductData, queryFirst, queryAll } = require('lilly/domUtil');\nconst { formatMessage } = require('lilly/util');\nconst afterpayTimeout = Date.now() + 5000;\n\n/**\n * Converts an array of selectors/elements to an array of elements (Uses queryAll to query selector strings)\n * @param {string|element|array} items A selector, element, or array of selectors/elements\n * @param {element|array} [scope] The scope(s) in which to search for elements\n * @returns {array} An array of elements\n */\nconst elementArray = (items, scope) => {\n if (!Array.isArray(items)) items = [items];\n if (!Array.isArray(scope)) scope = [scope || document];\n\n return items.reduce((results, item) => {\n if (typeof item === 'string') {\n scope.forEach(parent => {\n if (!!parent.matches && parent.matches(item)) {\n results.push(parent);\n } else {\n results = results.concat(queryAll(item, parent));\n }\n });\n } else {\n results.push(item);\n }\n\n return results;\n }, []);\n};\n\n/**\n * Initializes Afterpay messaging\n * @param {object} options Afterpay configuration options\n * @param {boolean} [options.alwaysShow] Whether the Afterpay messaging should always show, even when outside the threshold range (Default: true)\n * @param {string|element|array|NodeList} options.anchors The anchor element(s) referenced when rendering Afterpay messaging\n * @param {number} [options.price] The static price of the product in any format (if possible, use a priceTarget instead)\n * @param {string|element|array} options.observerTargets A selector, element or array of selectors/elements to observe for price changes and trigger Afterpay messaging updates (if a selector is passed, it will be queried relative to the anchor)\n * @param {string|element|array} options.priceTargets A selector, element or array of selectors/elements to use for price values. The \"value\" will be used if possible, or the innerText as a fallback\n * @param {string} [options.renderMode] The mode to use when rendering Afterpay messaging (E.g. adjacent, append, before, replace [Default: append])\n * @param {string|element} [options.renderTarget] The selector or element to use in conjunction with the renderMode (Defaults to the anchor)\n * @param {boolean} [options.showExcluded] Whether to show Afterpay messaging when a product is excluded\n * @param {object} [options.thresholds] The min/max thresholds to determine when Afterpay messaging shows (E.g. { min: 100, max: 1000 })\n * @param {string} [options.logoPosition] How to position the logo in Afterpay messaging (E.g. before, after [Default: after])\n */\nmodule.exports = function afterpay(options = {}) {\n let { alwaysShow = true, anchors, observerTargets, price, priceTargets, renderMode, renderTarget, showExcluded = true, thresholds = {}, logoPosition = 'after' } = options;\n\n // No anchors OR no observerTargets OR (no price AND no price targets)\n if (!anchors || !anchors.length || !observerTargets || !observerTargets.length || (!price && (!priceTargets || !priceTargets.length))) return false;\n\n // Waiting for Afterpay API\n if (!window.presentAfterpay) return (Date.now() >= afterpayTimeout) ? false : setTimeout(function (args) { afterpay.apply(this, args); }.bind(this, arguments), 250);\n\n // Anchors to array\n anchors = elementArray(anchors);\n\n // Missing anchor(s)\n if (!anchors.length) return false;\n\n // Afterpay preferences element\n const afterpayPrefsEl = document.getElementById('afterpayEnabled');\n\n // Afterpay is disabled\n if (!afterpayPrefsEl || afterpayPrefsEl.value !== 'true') return false;\n\n // Afterpay preferences data\n const afterpayPrefs = afterpayPrefsEl.dataset;\n\n // Base config\n const apConfig = {\n afterpayLogoColor: 'black',\n currency: 'USD',\n locale: 'en_US'\n };\n\n // Get product exclusions\n const exclusions = JSON.parse(afterpayPrefs.exclusions || '[]');\n\n // Threshold mixin\n if (thresholds) {\n const apThresholds = apConfig.minMaxThreshold = {};\n let { min, max } = thresholds;\n\n // Threshold fallbacks\n if (!min) min = afterpayPrefs.min;\n if (!max) max = afterpayPrefs.max;\n\n // Afterpay wants cents\n if (min) apThresholds.min = min * 100;\n if (max) apThresholds.max = max * 100;\n }\n\n /**\n * Updates the product price in an Afterpay config object\n * @param {object} config Afterpay config object\n * @param {*} price Price in any format\n */\n const updateAmount = (config, price) => {\n const stringValue = String(price);\n const isDecimalValue = ~stringValue.indexOf('.');\n const intValue = parseInt(stringValue.replace(/[^0-9]/g, '').trim(), 10);\n const amount = config.amount = intValue * (isDecimalValue ? 1 : 100);\n\n return amount;\n };\n\n /**\n * Gets the price target value for the given observer target\n * @param {element} observerTarget The observer target to search within\n * @returns {*} Returns the price, the price target's text content, or an empty string\n */\n const getPrice = observerTarget => {\n return (priceTargets ? elementArray(priceTargets, observerTarget) : [observerTarget]).reduce((value, element) => {\n if (value) return value;\n return element.value || element.innerText || '';\n }, '');\n };\n\n /**\n * Renders Afterpay messaging\n * @param {object} instance Afterpay instance\n * @param {element} anchor Anchor element\n * @param {string} [mode] Render mode (E.g. adjacent, append, before, replace [Default: append]) \n */\n const renderAfterpay = (instance, anchor, mode) => {\n const { config } = instance;\n const { amount, minMaxThreshold = {} } = config;\n const { min, max } = minMaxThreshold;\n const { utag_data: uData } = window;\n const notWithinThreshold = (min && min > amount) || (max && max < amount);\n const excluded = [];\n const hidden = 'hide';\n\n let excludedMessageKey = 'defaultExcludedMessage';\n let productElements = [anchor];\n\n // If this is the cart, we're displaying with the context of all products\n if (uData?.action?.split('-').shift().toLowerCase() === 'cart') {\n excludedMessageKey = 'excludedMessage';\n productElements = queryAll('#myTote .cart-product-line-item');\n }\n\n // Look for any exclusions\n productElements.forEach(element => {\n const { masterId, productName } = getProductData(element);\n\n if (~exclusions.indexOf(masterId) && !~excluded.indexOf(productName)) {\n excluded.push(productName);\n }\n });\n\n let renderMode = (!alwaysShow && notWithinThreshold) ? hidden : mode.toLowerCase();\n\n if (excluded.length && !showExcluded) {\n renderMode = hidden;\n }\n\n const afterpayNode = renderMode === hidden ? document.createElement('p') : instance.renderAfterpay();\n const afterpayMessage = queryFirst('span[class^=\"afterpay-text\"]', afterpayNode);\n\n if (afterpayMessage) {\n if (logoPosition === 'after') {\n const { parentElement } = afterpayMessage;\n\n parentElement.insertBefore(afterpayMessage, parentElement.firstChild);\n }\n\n if (excluded.length) {\n if (showExcluded) {\n const lastToken = excluded.pop();\n const tokenText = excluded.length ? `${excluded.join(', ')}${afterpayPrefs.excludedMultiSuffix} ${lastToken}` : lastToken;\n\n afterpayMessage.textContent = formatMessage(afterpayPrefs[excludedMessageKey], `${tokenText} `);\n }\n } else if (notWithinThreshold) {\n afterpayMessage.textContent = `${afterpayPrefs.notWithinThresholdMessage} `;\n }\n }\n\n const instanceNode = instance.afterpayNode;\n const target = (typeof renderTarget === 'string' ? queryFirst(renderTarget, anchor) : renderTarget) || anchor;\n\n instance.afterpayNode = afterpayNode;\n\n switch (renderMode) {\n case 'adjacent':\n return target.insertAdjacentElement('afterend', afterpayNode);\n\n case 'before':\n return target.parentElement.insertBefore(afterpayNode, target);\n\n case hidden:\n case 'replace':\n return instanceNode && instanceNode.parentElement && instanceNode.parentElement.replaceChild(afterpayNode, instanceNode);\n\n default:\n return target.appendChild(afterpayNode);\n }\n };\n\n [].slice.call(anchors, 0).forEach(anchor => {\n const instanceConfig = Object.assign({}, apConfig);\n const anchorObserverTargets = elementArray(observerTargets, anchor);\n\n if (price) {\n updateAmount(instanceConfig, price);\n } else {\n const priceValue = anchorObserverTargets.reduce((result, target) => {\n if (result) return result;\n return getPrice(target);\n }, 0);\n\n updateAmount(instanceConfig, priceValue);\n }\n\n if (isNaN(instanceConfig.amount)) return;\n\n const apInstance = new presentAfterpay(instanceConfig);\n const observer = new MutationObserver(mutations => {\n const { afterpayNode } = apInstance;\n\n if (!afterpayNode) return;\n\n updateAmount(apInstance.config, getPrice(mutations[0].target));\n renderAfterpay(apInstance, afterpayNode, 'replace');\n });\n\n anchorObserverTargets.forEach(target => {\n observer.observe(target, { childList: true, subtree: true });\n });\n\n renderAfterpay(apInstance, anchor, renderMode);\n });\n};\n","'use strict';\n\nconst { bind, queryAll, queryFirst, hasClass } = require('lilly/domUtil');\nconst { toDatasetKey, hashValue } = require('lilly/util');\nconst { VIEW_PROMO, SELECT_PROMO, SELECT_ITEM, VIEW_ITEM_LIST, ADD_TO_CART, P_PRODUCT_LIST_KEY, P_PROMO_NAME_KEY, P_PROMO_CREATIVE_NAME } = require('./constants');\n\n// Persisted Data Constants\nconst PERSISTED_DATA_NAME = 'utag_persisted';\nconst STORAGE_EXP_TIME = 30 * 60 * 1000; // 30 minutes\n\nconst gaInitKeyPrefix = 'ga-init';\nconst gaRetriggerFlag = 'gaRetrigger';\nconst gaFieldPipe = '|';\nconst customEventPattern = /\\W/;\n\n// Bindings registry\nif (!window.gaBindings) window.gaBindings = {};\nconst { gaBindings } = window;\n\n// A list of properties that, when set by the user, should be updated in the UDO.\n// More easily put, anything that you want an up-to-date value for, which would be\n// sent with ANY event type, should be in this list.\nconst UDOProperties = [\n 'logged_in_status',\n 'page_type',\n 'page_category',\n 'page_subcategory',\n 'product_id',\n 'product_name',\n 'product_color',\n 'product_category',\n 'product_variant',\n 'product_quantity',\n 'product_price',\n 'product_size',\n 'product_sku',\n 'product_original_price',\n 'variant_group',\n 'product_is_preorder',\n 'affiliation',\n 'product_badge'\n];\n\n// A list of properties that should be preserved as arrays, not converted to piped strings.\nconst UDOArrays = [\n 'product_id',\n 'product_name',\n 'product_color',\n 'product_category',\n 'product_variant',\n 'product_quantity',\n 'product_price',\n 'product_size',\n 'product_sku',\n 'product_original_price',\n 'promo_id',\n 'promo_name',\n 'promo_creative',\n 'promo_position',\n 'product_is_preorder',\n 'affiliation',\n 'product_list_id',\n 'product_list_name',\n 'product_list_price',\n 'product_list_position',\n 'product_list_original_price',\n 'product_badge',\n 'product_list_category',\n 'product_list_sku'\n];\n\n// A list of GA4 events (event_name) which should include promotional information if available.\n// begin_checkout and purchase also need this information, but are handled in the events themselves\nconst promoSensitiveEvents = [VIEW_PROMO, SELECT_PROMO, ADD_TO_CART];\n// a list of GA4 events (event_name) which should include product_list information if available\n// begin_checkout and purchase also need this information, but are handled in the events themselves\nconst productListSensitiveEvents = [VIEW_ITEM_LIST, SELECT_ITEM, ADD_TO_CART];\n\n/**\n * Normalizes analytics data to ensure consistency.\n * @param {*} fields - Analytics data\n * @returns {string} - Normalized analytics value\n * @example normalize(['a','b','c'], 1,2,3, 'x','y','z') // a|b|c|1|2|3|x|y|z\n */\nconst normalize = (...fields) =>\n fields\n .map(field => {\n if (!Array.isArray(field)) field = [field];\n\n return field\n .reduce((result, item) => {\n if (String(item) === '[object Object]') {\n result = result.concat(Object.values(item));\n } else if (Array.isArray(item)) {\n result = result.concat(normalize(item));\n } else {\n result.push(item);\n }\n\n return result;\n }, [])\n .map(text => (typeof text === 'undefined' ? '' : String(text).toLowerCase().trim()))\n .join(gaFieldPipe);\n })\n .join(gaFieldPipe);\n\n/**\n * Normalizes analytics data to ensure consistency.\n * @param {*} field - Analytics data\n * @returns {Array} - Normalized analytics array of values\n * @example normalizeArray(['A','b','C', true, false, ['X', 'Y', 3], 0]) // [\"a\", \"b\", \"c\", \"true\", \"false\", \"x|y|3\", \"0\"]\n */\nconst normalizeArray = field => {\n if (!Array.isArray(field)) field = [field];\n\n return field.map(value => normalize(value));\n};\n\n/**\n * Normalizes a value to a string or an array based on UDOArrays\n * @param {string} key The key whose value is being normalized\n * @param {*} value The value to be normalized\n * @returns {string|Array} Normalized array or string value\n */\nconst smartNormalize = (key, value) => (UDOArrays.includes(key) ? normalizeArray(value) : normalize(value));\n\n/**\n * Normalizes an analytics payload to ensure consistency, preserving UDO properties as arrays.\n * @param {Object} payload - Analytics data object\n * @returns {Object} - Normalized analytics object\n * @example normalizePayload({ event_category: \"SOME CATEGORY\", event_action: \"SOME ACTION\", event_label: undefined }) // { event_category: \"some category\", event_action: \"some action\", event_label: \"\" }\n */\nconst normalizePayload = payload =>\n Object.entries(payload).reduce((result, [key, value]) => {\n result[key] = smartNormalize(key, value);\n\n return result;\n }, {});\n\n/**\n * Retrieves contextual data about the page.\n * @param {element} srcElement - The element that triggered the event\n * @param {Object} [options={}] - options object from bindGA\n * @returns {Object} - Plain object keyed with custom dimensions\n */\nconst getPageContext = (srcElement, options = {}) => {\n const { utag_data: uData = {} } = window;\n let sectionSrcElement = srcElement;\n const dialog = srcElement.closest && srcElement.closest('.modal');\n\n // Dialogs should provide context into what triggered them\n if (dialog) {\n sectionSrcElement = $(dialog).data('srcElement') || srcElement;\n\n if (sectionSrcElement instanceof jQuery) {\n sectionSrcElement = sectionSrcElement[0] || srcElement;\n }\n }\n\n // Try to determine the page section & subsection\n let pageSection = 'content';\n let pageSubsection = '';\n\n if (sectionSrcElement && srcElement) {\n if (sectionSrcElement.closest) {\n // Section\n if (sectionSrcElement.closest('#minicart')) {\n pageSection = 'mini tote drawer';\n } else if (sectionSrcElement.closest('.recently-viewed')) {\n pageSection = 'recently viewed';\n } else if (sectionSrcElement.closest('.style-component-container')) {\n pageSection = 'pdp style component';\n } else if (sectionSrcElement.closest('.product-recommendations.ways-to-wear')) {\n pageSection = 'ways to wear';\n } else if (sectionSrcElement.closest('.recommendations.related-products')) {\n pageSection = 'related products';\n } else if (sectionSrcElement.closest('.shop-the-print')) {\n pageSection = 'shop the print';\n } else if (sectionSrcElement.closest('.full-suggestions')) {\n pageSection = 'search recommendations';\n } else if (sectionSrcElement.closest('.shop-the-print-tiles')) {\n pageSection = 'shop the print';\n } else if (sectionSrcElement.closest('.product-recommendations')) {\n pageSection = 'product recommendations';\n } else if (sectionSrcElement.closest('.shop-by-style')) {\n pageSection = 'clp filter product carousel';\n } else if (sectionSrcElement.closest('.category-landing-page .product-recommendations')) {\n pageSection = 'clp top product carousel';\n } else if (sectionSrcElement.closest('.refinement-bar')) {\n pageSection = 'filters';\n } else if (sectionSrcElement.closest('.main-nav')) {\n pageSection = 'main navigation';\n } else if (sectionSrcElement.closest('.product-grid-container')) {\n pageSection = 'product grid';\n } else if (sectionSrcElement.closest('.product-detail')) {\n pageSection = 'product details';\n } else if (sectionSrcElement.closest('.main-header')) {\n pageSection = 'header';\n } else if (sectionSrcElement.closest('footer')) {\n pageSection = 'footer';\n }\n }\n\n if (srcElement.closest) {\n // Subsection\n if (srcElement.closest('.quick-view-dialog')) {\n pageSubsection = 'quickview dialog';\n } else if (srcElement.closest('.quickview-container')) {\n pageSubsection = 'quickview inline';\n } else if (srcElement.closest('.wishlist-details-tab')) {\n pageSubsection = 'wishlist';\n }\n\n // page_subsection for cart nav/SFL\n const isCartPage = queryFirst('.cart-page');\n const cartNav = srcElement.closest('.cart-nav');\n const removeDialog = srcElement.closest('.remove-product-dialog'); // remove dialog is not within cart-nav\n if (isCartPage) {\n if (cartNav || removeDialog) {\n const selectedTab = queryFirst('.sfl-tabs-selected');\n pageSubsection = hasClass(selectedTab, 'save-for-later-tab') ? 'saved for later' : 'my tote';\n } else {\n // sfl disabled\n pageSubsection = 'my tote';\n }\n }\n }\n }\n\n let uaAttributes = {\n // Defaults only - these should be set at the bind level or in data attributes\n event_label: '',\n event_category: '',\n event_action: ''\n };\n\n // Remove UA defaults if the omitUADefaults option is true\n if (options.omitUADefaults) {\n uaAttributes = {};\n }\n\n return {\n page_section: pageSection,\n page_subsection: pageSubsection,\n\n // Set in Tealium TagHelper\n caching_enabled: uData.caching_enabled,\n logged_in_status: uData.user_loggedin_status,\n affiliation: uData.affiliation,\n loyalty_status: uData.loyalty_status,\n loyalty_program_member: uData.loyalty_program_member,\n page_name: document.title,\n page_type: uData.page_type,\n page_category: uData.page_category,\n page_subcategory: uData.page_subcategory,\n\n product_category: uData.product_category,\n product_color: uData.product_color,\n product_id: uData.product_id,\n product_original_price: uData.product_original_price,\n product_name: uData.product_name,\n product_price: uData.product_price,\n product_quantity: uData.product_quantity && uData.product_quantity.length ? uData.product_quantity : [1],\n product_size: uData.product_size,\n product_variant: uData.product_variant,\n product_badge: uData.product_badge,\n\n ...uaAttributes\n };\n};\n\n/**\n * Retrieves the requested data from the persisted data in Local Storage\n * @param {string|undefined} key - the key to pull -- otherwise the entire object will be returned.\n * @returns {string|Object|undefined} the value corresponding to the supplied key (if available), the entire object (if no key was given) or undefined (if no suitable value was found)\n */\nfunction getStoredDataLayerInfo(key) {\n const { localStorage } = window;\n const dataStr = localStorage.getItem(PERSISTED_DATA_NAME);\n if (!dataStr) return undefined;\n\n let data;\n try {\n data = JSON.parse(dataStr);\n } catch (e) {\n console.error(e);\n localStorage.removeItem(PERSISTED_DATA_NAME);\n return undefined;\n }\n\n // if there is no key, return the full data object.\n if (typeof key === 'undefined') return data;\n\n // if the key does not exist in the data, return undefined\n if (!(key in data)) return undefined;\n\n // check if the data is still valid\n const { value, timestamp } = data[key];\n const validUntil = timestamp + STORAGE_EXP_TIME;\n\n // if the data has expired, delete it, save back to local storage, and return undefined.\n if (validUntil < Date.now()) {\n delete data[key];\n localStorage.setItem(PERSISTED_DATA_NAME, JSON.stringify(data));\n return undefined;\n }\n\n return value;\n}\n\n/**\n * Persists the given data to Local Storage\n * @param {string} key - the key for this item\n * @param {string} value - the value for this item\n */\nfunction setStoredDataLayerInfo(key, value) {\n const { localStorage } = window;\n const data = getStoredDataLayerInfo() || {};\n data[key] = {\n value,\n timestamp: Date.now()\n };\n\n localStorage.setItem(PERSISTED_DATA_NAME, JSON.stringify(data));\n}\n\n/**\n * Stores any data that should be persisted from the payload in Local Storage\n * @param {Object} payload - The payload sent to Tealium\n */\nfunction storePersistentData(payload) {\n const { event_name: eventName, category_id: productList, promo_name: promoName, promo_creative: promoCreative } = payload;\n\n if (promoName && !Array.isArray(promoName)) {\n console.warn(`promo_name for event ${eventName} is not an array!`);\n }\n\n if (eventName === VIEW_ITEM_LIST && productList) setStoredDataLayerInfo(P_PRODUCT_LIST_KEY, productList);\n if (eventName === SELECT_PROMO && promoName) setStoredDataLayerInfo(P_PROMO_NAME_KEY, promoName);\n if (eventName === SELECT_PROMO && promoCreative) setStoredDataLayerInfo(P_PROMO_CREATIVE_NAME, promoCreative);\n}\n\n/**\n * Sends an event to GA\n * @param {Object} data - The data to send (usually contains an event_category, event_action, and event_label)\n * @param {string} eventType - The type of event to send (e.g. link, view, etc)\n * @returns {Promise} a Promise\n */\nfunction sendEventGA(data, eventType = 'link') {\n return new Promise((resolve, reject) => {\n const { utag } = window;\n\n if (utag && typeof utag[eventType] === 'function') {\n utag[eventType](data, () => {\n resolve();\n });\n } else {\n reject(new Error(`utag is missing or utag.${eventType} does not exist`));\n }\n });\n}\n\n/**\n * Sends a GA event with context and normalized payload options\n * @param {Object} data - the baseline payload to send\n * @param {HTMLElement} [contextElem] - The element to reference for context (typically the element with which the user interacted). Default: first container in main-content.\n * @param {string} [eventType='link'] - The type of event to send (e.g. link, view, etc)\n * @param {boolean} [normalizeData=true] - whether to run the payload through the normalization function\n * @returns {Promise} a promise\n */\nfunction sendEventGAWithContext(data, contextElem = queryFirst('#main-content > .container'), eventType = 'link', normalizeData = true) {\n // omit UA defaults by default -- we shouldn't be using any UA properties anymore\n const pageContext = getPageContext(contextElem, { omitUADefaults: true });\n\n // merge context and data, data gets precedence\n let payload = Object.assign({}, pageContext, data);\n\n if (normalizeData) {\n payload = normalizePayload(payload);\n }\n\n return sendEventGA(payload, eventType);\n}\n\n/**\n * Sets up a middleware GA handler for an element\n * @param {Element} elements - The element to bind to\n * @param {Object|function} data - The data to send to GA or a callback that returns the data to send\n * @param {Object} [options={}] - Additional options to configure the event binding\n * @param {Object} [options.bindOptions={}] - Options passed to the bind method as its options parameter\n * @param {function} [options.callback] - Callback to run after the event is triggered and data is sent to GA\n * @param {string} [options.eventType='click'] - The type of event to listen for (E.g. click, change, etc)\n * @param {function} [options.eventCondition] - A function that runs when the event is triggered, but before the data is sent to GA. Returning false will abort sending data to GA.\n * @param {boolean} [options.isCustomEvent=false] - Whether the event is custom. Event types containing non-word characters are flagged custom. Custom events are bound using jQuery.\n * @param {boolean} [options.normalize=true] - Whether the data payload should be normalized.\n * @param {boolean} [options.retriggerEvent=true] - Whether to retrigger the original event, after sending data to GA. Usually you don't want to retrigger custom events.\n * @param {boolean} [options.usesContext=true] - Whether to mix page context in with the data payload.\n * @param {boolean} [options.usesDataset=true] - Whether to pull event category, action and label from from the element's dataset.\n * @param {boolean} [options.updatesUDO=true] - Whether the Universal Data Object should be updated with any applicable values from the data payload after it is sent to GA.\n * @param {boolean} [options.omitUADefaults=false] - Whether UA/360 attributes should be omitted when adding default values to this event. If false, event label, action, and category will be added.\n */\nfunction bindGA(elements, data, options = {}) {\n const {\n bindOptions = {},\n callback,\n eventType = 'click',\n eventCondition,\n isCustomEvent = false,\n normalize: usesNormalize = true,\n retriggerEvent = true,\n usesContext = true,\n usesDataset = true,\n updatesUDO = true,\n gaEventType = 'link',\n omitUADefaults = false\n } = options;\n\n const { utag_data: uData } = window;\n\n let nodeList = elements;\n\n // Convert NodeList to array\n if (elements instanceof NodeList) {\n nodeList = [].slice.call(elements, 0);\n } else if (!Array.isArray(elements)) {\n nodeList = [elements];\n }\n\n // Default once to false (GA will filter duplicates per Shelly)\n if (typeof bindOptions.once !== 'boolean') {\n bindOptions.once = false;\n }\n\n if (typeof bindOptions.eventCondition !== 'function') {\n bindOptions.eventCondition = eventCondition;\n }\n\n // Custom events are bound with jQuery\n if (isCustomEvent || customEventPattern.test(eventType)) {\n bindOptions.bindEngine = 'jQuery';\n }\n\n const initFlag = [gaInitKeyPrefix, eventType, toDatasetKey(bindOptions.targetSelectors || 'root'), hashValue(data)].join('-');\n\n nodeList.forEach(element => {\n const binding = gaBindings[initFlag];\n const isRebind = binding && binding.includes(element);\n\n if (element && !isRebind) {\n // Register this binding to the element\n if (!binding) gaBindings[initFlag] = [];\n\n gaBindings[initFlag].push(element);\n\n bind(\n element,\n eventType,\n (e, target) => {\n // Don't retrigger if we're holding down a modifier key, since we cannot retrigger using modifiers without user interaction\n const willRetrigger = retriggerEvent && !e.ctrlKey && !e.shiftKey;\n\n // Ignore clicks triggered by bindGA\n if (e.gaRetriggered || (target.dataset && target.dataset[gaRetriggerFlag] === initFlag)) {\n e.gaRetriggered = true;\n\n if (target.dataset) {\n delete target.dataset[gaRetriggerFlag];\n }\n\n return;\n }\n\n const tagPayload = {};\n\n // Pull the payload from the target element dataset\n if (usesDataset && target.dataset) {\n const { eventCategory, eventAction, eventLabel } = target.dataset;\n\n tagPayload.event_category = eventCategory;\n tagPayload.event_action = eventAction;\n tagPayload.event_label = eventLabel;\n }\n\n // Get the bindGA payload\n const bindPayload = typeof data === 'function' ? data(element, target, e, tagPayload) : data;\n\n // Trigger was aborted by callback\n if (bindPayload === false) {\n return;\n }\n\n // if event is promo or product list sensitive, add that data to tagPayload\n const { event_name: eventName } = bindPayload;\n if (eventName) {\n if (promoSensitiveEvents.includes(eventName)) {\n const promoName = getStoredDataLayerInfo(P_PROMO_NAME_KEY);\n if (promoName) Object.assign(tagPayload, { promo_name: promoName });\n }\n\n if (productListSensitiveEvents.includes(eventName)) {\n const productListName = getStoredDataLayerInfo(P_PRODUCT_LIST_KEY);\n if (productListName) Object.assign(tagPayload, { product_list: productListName, product_list_category: [productListName] });\n }\n if (promoSensitiveEvents.includes(eventName)) {\n const promoCreativeName = getStoredDataLayerInfo(P_PROMO_CREATIVE_NAME);\n if (promoCreativeName) Object.assign(tagPayload, { promo_creative: promoCreativeName });\n }\n }\n\n // Merge payloads (bindGA data takes priority)\n let payload = Object.assign({}, tagPayload, bindPayload);\n\n // Stop everything until we re-trigger\n if (willRetrigger) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n // Common page context\n const pageContext = getPageContext(target, options);\n\n if (usesContext) {\n payload = Object.assign({}, pageContext, payload);\n }\n\n // Remove product data from promo events - PT-11362\n if ([VIEW_PROMO, SELECT_PROMO].includes(eventName)) {\n payload = Object.fromEntries(Object.entries(payload).filter(([key]) => !/^product_/.test(key)));\n }\n\n // Preserved UDO Properties\n // Any properties beginning with double underscore (__) will be sent with the payload,\n // but will be reverted in the UDO after sending\n const preservedUDOProperties = Object.keys(payload).reduce((result, key) => {\n if (key.substring(0, 2) !== '__') return result;\n\n const property = key.slice(2);\n payload[property] = payload[key];\n delete payload[key];\n result[property] = uData[property];\n return result;\n }, {});\n\n // Do we have any lazy UDO updates?\n const lazyUDOProperties = Object.keys(payload).reduce((result, key) => {\n if (key.charAt(0) !== '_') return result;\n\n const property = key.slice(1);\n payload[property] = payload[key];\n result.push(property);\n delete payload[key];\n\n return result;\n }, []);\n\n // Normalize all values\n if (usesNormalize) {\n payload = normalizePayload(payload);\n }\n\n // If this updates the UDO, store the updates.\n // The UDO will be updated after the payload is sent.\n const UDOUpdates = updatesUDO\n ? Object.keys(payload).reduce((result, key) => {\n // UDO properties only\n if (!UDOProperties.includes(key)) return result;\n\n // Store the updated value\n result[key] = payload[key];\n\n // For lazy properties, send the old UDO value in the payload. We'll update after.\n if (lazyUDOProperties.includes(key)) {\n payload[key] = usesNormalize ? smartNormalize(key, uData[key]) : uData[key];\n }\n\n return result;\n }, {})\n : {};\n\n storePersistentData(payload);\n\n sendEventGA(payload, gaEventType).finally(() => {\n if (typeof callback === 'function') callback(element, target, e);\n\n if (willRetrigger) {\n target.dataset[gaRetriggerFlag] = initFlag;\n\n // Without a teeny tiny timeout our click gets trapped\n setTimeout(() => {\n try {\n target[eventType]();\n } catch (e) {\n $(target).trigger(eventType);\n }\n }, 0);\n }\n\n // Update Tealium UDO\n // This can only happen if we're updating the MAIN product,\n // not another product on the same page (E.g. quickview, recommendations, etc)\n if (updatesUDO && pageContext.page_section === 'product details') {\n // Product sets need to be updated based on index\n if (pageContext.page_type === 'product set') {\n const productSetItem = target.closest('.product-set-item');\n const productSetItems = queryAll('.product-set-item', target.closest('.product-set-detail'));\n const productSetIndex = productSetItems.indexOf(productSetItem);\n\n if (productSetIndex !== -1) {\n Object.keys(UDOUpdates).forEach(key => {\n const value = UDOUpdates[key];\n\n if (UDOArrays.includes(key)) {\n if (!uData[key]) uData[key] = new Array(productSetItems.length).fill('');\n if (!Array.isArray(uData[key])) uData[key] = String(uData[key]).split(gaFieldPipe);\n\n if (~String(value).indexOf(gaFieldPipe)) {\n uData[key][productSetIndex] = String(value).split(gaFieldPipe)[productSetIndex] || '';\n } else {\n uData[key][productSetIndex] = normalize(value);\n }\n } else {\n uData[key] = value;\n }\n });\n }\n } else {\n Object.keys(UDOUpdates).forEach(key => {\n const value = UDOUpdates[key];\n\n uData[key] = Array.isArray(value) ? value : [value];\n });\n }\n }\n\n // Restore preserved UDO property values\n if (Object.keys(preservedUDOProperties).length) {\n Object.assign(uData, preservedUDOProperties);\n }\n });\n },\n bindOptions\n );\n } else if (isRebind) {\n console.warn('WARNING: Attempted duplicate', eventType, 'binding on', element);\n }\n });\n}\n\n/**\n * Gets the text node content of an element\n * @param {HTMLElement} elem - The element whose text node content will be returned\n * @returns {String} The content of the text node or empty string if no text node is found\n */\nfunction getText(elem) {\n const textNode = [...elem.childNodes].find(child => child.nodeType === Node.TEXT_NODE);\n return (textNode && textNode.textContent.trim().replace(/\\s+/g, ' ')) || '';\n}\n\nmodule.exports = {\n bindGA,\n sendEventGA,\n sendEventGAWithContext,\n getPageContext,\n normalize,\n normalizePayload,\n delimiter: gaFieldPipe,\n getText,\n storePersistentData,\n getStoredDataLayerInfo\n};\n","module.exports = {\n // Asset Ids\n EXCLUSIVE_EXPERIENCES_TOOLTIP_CID: 'loyalty-dashboard-exclusive-experiences-tool-tip',\n REWARDS_TOOLTIP_CID: 'loyalty-dashboard-rewards-tool-tip',\n OFFERS_TOOLTIP_CID: 'loyalty-dashboard-offers-tool-tip',\n BENEFITS_TOOLTIP_CID: 'loyalty-dashboard-benefits-tool-tip',\n TELL_A_FRIEND_TOOLTIP_CID: 'loyalty-dashboard-tell-a-friend-tool-tip',\n STYLE_QUIZ_TOOLTIP_CID: 'loyalty-dashboard-style-quiz-tool-tip',\n MEMBERSHIP_FAQ_TOOLTIP_CID: 'loyalty-dashboard-faq-tool-tip',\n\n // Selectors\n TOOL_TIP_CONTENT: '.tool-tip-content',\n LOYALTY_TOOLTIP_ICON: '.loyalty-tooltip-icon',\n ANALYTIC_EVENT_CLASS: '.analytic-event-class',\n BENEFIT_MODAL_CLOSE_ICON: '.benefit-detail-modal .close',\n BENEFIT_DETAIL_MODAL: '.benefit-detail-dialog',\n BENEFIT_SWATCH_THUMBNAIL_MODAL: '.img-wallpaper',\n BENEFIT_SWATCH_TITLE: '.title-text',\n DOWNLOAD_SWATCH_CTA: '.download-cta',\n GO_TO_ACCOUNT_CTA: '.go-to-my-account-btn',\n BENEFIT_SWATCH_TAB: '.tab-pane.active',\n REFER_FRIEND_CTA: '.loyalty-referral-drawer-link',\n REFER_FRIEND_CTA_LINK: '.referral-cta-link',\n REFER_FRIEND_TEXT_FIELD: '.referral-link',\n STYLE_QUIZ_PENDING_QUIZ: '.finished-quiz',\n MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_CTA: '.membership-loyalty-expand-collapse',\n MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_ALL_CTA: '.membership-loyalty-expand-all',\n MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LINK: '.loyalty-terms-and-conditions .faq-link',\n EXCLUSIVE_ARROW_RIGHT: '.exclusive-carousel .chevron-right',\n EXCLUSIVE_ARROW_LEFT: '.exclusive-carousel .chevron-left',\n EXCLUSIVE_PIP: '.exclusive-carousel .pip-content',\n ARROW_CLICKS: 'arrow clicks',\n EXCLUSIVE_PIP_ACTION: 'pip',\n MODULE_CHANGE: 'module change',\n ARROW_NEXT: 'next',\n ARROW_PREVIOUS: 'previous',\n EXCLUSIVE_VIEWALL: '.exclusive-dashboard-section .view-all-label',\n EXCLUSIVE_EXPERIENCE_CTA: '.cta-styling',\n EXCLUSIVE_RIGHT_SECTION: '.exclusive-right-section',\n EXCLUSIVE_CONTENT_SLOTS_CLICK: 'content slots click',\n EXCLUSIVE_SELECT_CONTENT: 'select_content',\n EXCLUSIVE_EXPERIENCE_NAME: 'exclusive experience name',\n EXCLUSIVE_CLICK_TO_VIEWALL: 'click to view all',\n EXCLUSIVE_VIEWALL_EXCLUSIVE_EXPERIENCES: 'view all exclusive experiences',\n EXCLUSIVE_TOOLTIP: '.exclusive-dashboard-section .custom-info-icon',\n REFER_FRIEND_TOOLTIP: '.refer-dashboard-section .custom-info-icon',\n EXCLUSIVE_OPEN_TOOLTIP: 'open tooltip',\n HOW_TO_EARN_LINK: '.loyalty-how-to-earn-drawer-link',\n VIEW_POINT_ACTIVITY_CTA: '.view-point-activity-cta',\n REWARD_START_SHOPPING: '.reward-start-shopping',\n REWARD_VIEW_CODE_CTA: '.view-code-cta',\n VOUCHER_MODAL_CLOSE_CTA: '.loyalty-reward-in-store-dialog .close',\n OFFER_FLIP_CARD_CTA: '.flip-card-front',\n VIEW_COPY_CODE_CTA: '.view-copy-code-cta',\n OFFER_DETAIL_CLOSE: '.offer-detail-modal .close',\n BONUS_POINTS_DAY: 'Bonus points day',\n EARLY_ACCESS: 'Early Access: New Fall Arrivals',\n LOYALTY_PROGRAM_MODAL: '#loyalty-program-modal .close',\n LOYALTY_ACCOUNT_CARD: '.loyalty-card-dropdown-cta',\n VIEW_LOYALTY_DASHBOARD: '.view-dashboard',\n LOYALTY_DRAWER_LINK: '.loyalty-program-drawer-link',\n LOYALTY_OPT_IN_CHECKBOX: '.add-to-loyalty-program-checkbox',\n ORDER_CONFIRM_REGISTER_MODAL: '.loyalty-order-confirmation-container.show',\n ORDER_CONFIRM_GUEST_ELEMENT: '.order-confirm-loyalty-guest-content',\n CREATE_ACCOUNT_ORDER_CONFIRM: '.create-loyalty-account-btn',\n LOYALTY_NEXT_BUTTON: '.loyalty-welcome-cta',\n CLOSE_WELCOME_MODAL: '.loyalty-welcome-dialog .close-enrollnow-model',\n CLOSE_ENROLL_NOW_MODAL: '.loyalty-enrollnow-dialog .close-enrollnow-model',\n ENROLL_LOYALTY_CTA: '.loyalty-enroll-cta',\n GUEST_LOYALTY_ENROLL: '.guest-create-and-enroll',\n STYLE_QUIZ_START_CTA: '.style-quiz-start-cta',\n STYLE_QUIZ_GO_TO_DASHBOARD: '.style-quiz-go-to-dashboard',\n SWATCH_SELECTION_WRAPPER: '.js-swatch-selection-wrapper .swatch-container',\n NEXT_QUESTION_CTA: '.loyalty-next-question-cta',\n PREVIOUS_QUESTION_CTA: '.loyalty-previous-question-cta',\n SUBMIT_QUIZ_CTA: '.loyalty-submit-quiz-cta',\n SKIP_THIS_QUESTION_CTA: '.loyalty-skip-question-cta',\n FINISH_LATER_CTA: '.loyalty-finish-later-cta',\n START_SHOPPING_CTA: '.style-quiz-start-shopping-cta',\n CONTENT_SLOT_SELECTORS: [\n '.content-module',\n '.promo-asset',\n '.promo-default',\n '.product-recommendations.ways-to-wear',\n '.curalate-content',\n '.product-detail .shop-the-print',\n '.style-component-container',\n '.sfl-empty',\n '.homepage .recommendations .product-listing',\n '.is-recommendation-carousel',\n '.blog-posts-item'\n ],\n\n // GA Event category, label, action, page name strings\n LOYALTY_BENEFIT_LABEL: 'loyalty benefits',\n LOYALTY_ANNUAL_GIFT_ID: 'annual-member-gift',\n ANNUAL_GIFT_LABEL: 'Annual Member',\n LOYALTY_BIRTHDAY_TREAT_LABEL: 'birthday treat',\n LOYALTY_DIGITAL_WALLPAPER_LABEL: 'digital wallpaper',\n MODAL_CLOSE_LABEL: 'close',\n MODAL_VOUCHER_CLOSE_LABEL: 'close modal',\n MODAL_SELECTED_LABEL: 'select',\n MODAL_DOWNLOAD_LABEL: 'download',\n CLICK_EVENT_ACTION: 'click',\n SHARE_EVENT_ACTION: 'share link',\n LOYALTY_DASHBOARD_LABEL: 'loyalty dashboard',\n LOYALTY_BENEFIT_TOOLTIP_LABEL: 'benefits tooltip',\n BENEFIT_LABEL: 'benefits',\n LOYALTY_EXCLUSIVE_EXPERIENCE_TOOLTIP_LABEL: 'exclusive experiences tooltip',\n LOYALTY_EXCLUSIVE_EXPERIENCE_LABEL: 'exclusive experiences',\n LOYALTY_MEMBERSHIP_FAQ_TOOLTIP_LABEL: 'membership faq tooltip',\n TOOLTIP_LABEL: 'tooltip',\n OPEN_TOOLTIP_LABEL: 'open tooltip',\n CLOSE_TOOLTIP_LABEL: 'close tooltip',\n STYLE_QUIZ_TOOLTIP_LABEL: 'style quiz tooltip',\n STYLE_QUIZ_PAGE_SECTION: 'style quiz',\n LOYALTY_REFER_A_FRIEND_SECTION: 'content or footer',\n LOYALTY_MEMBERSHIP_FAQ_SECTION: 'membership faq',\n LOYALTY_MODAL_PAGE_SUBSECTION: 'web pop up',\n LOYALTY_REFER_A_FRIEND_LABEL_SECTION: 'refer a friend',\n LOYALTY_REFER_A_FRIEND_TOOLTIP: 'refer a friend tooltip',\n LOYALTY_EVENT_LABEL: 'finish your quiz',\n MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ACTION: 'expand question or collapse question',\n MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ALL_ACTION: 'expand all',\n MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LABEL: 'loyalty t&c link',\n REWARDS_TOOLTIP_LABEL: 'rewards tooltip',\n REWARDS_PAGE_SECTION_LABEL: 'rewards',\n EVENT_CLICK_LINK_ACTION: 'click link',\n REWARDS_HOW_TO_EARN_EVENT_LABEL: 'how to earn',\n REWARDS_VIEW_POINT_ACTIVITY_LABEL: 'view points activity',\n REWARDS_START_SHOPPING_LABEL: 'start shopping',\n REWARDS_VIEW_CODE_ACTION: 'click to view',\n REWARDS_VIEW_CODE_LABEL: 'reward vouchers code',\n REWARDS_VOUCHER_MODAL: 'voucher modal',\n REWARDS_VOUCHER_LABEL: 'voucher',\n REWARDS_VOUCHER_PAGE_SECTION: 'modal',\n OFFER_TOOLTIP_LABEL: 'offers tooltip',\n OFFER_PAGE_SECTION: 'offers',\n TAP_TO_REVEAL_ACTION: 'tap to reveal',\n VIEW_AND_OFFER_CODE_CTA: 'view and copy offer code',\n OFFER_CLOSE_EVENT_LABEL: 'offer modal',\n LOYALTY_PROGRAM_LABEL: 'loyalty',\n LOYALTY_PROGRAM_ACTION: 'initiate enrollment',\n LOYALTY_PROGRAM_SUCCESS_ENROLL: 'successful enrollment',\n ENROLL_LOYALTY: 'start enroll',\n LOYALTY_DASHBOARD_ACTION: 'dashboard',\n OPEN_LABEL: 'open',\n MY_ACCOUNT_NAME: 'my account',\n ACCOUNT_PAGE_TYPE: 'account',\n MY_ACCOUNT_TAB: 'account tab',\n LOYALTY_PROGRAM_DETAILS: 'program details',\n LOYALTY_OPT_IN_ACTION: 'opt-in',\n LOYALTY_OPT_IN_CHECKBOX_SELECT_ACTION: 'select',\n LOYALTY_OPT_IN_CHECKBOX_DESELECT_ACTION: 'deselect',\n ACCOUNT_SIGN_IN_CATEGORY: 'account sign in',\n CREATE_AN_ACCOUNT_ACTION: 'create an account',\n SUBMIT_LOYALTY_OPT_IN: 'submit|opt-in loyalty:true',\n SUBMIT_LOYALTY_NOT_OPT_IN: 'submit|opt-in loyalty:false',\n LOYALTY_PROGRAM_WELCOME: 'welcome',\n LOYALTY_PROGRAM_ENROLLMENT: 'enrollment',\n LOYALTY_PROGRAM_ENROLL_SUCCESS: 'enroll:success',\n LOYALTY_STYLE_QUIZ_LABEL: 'loyalty style quiz',\n LOYALTY_STYLE_QUIZ_GET_STARTED_ACTION: 'get started',\n LOYALTY_STYLE_QUIZ_GO_TO_DASHBOARD: 'go to dashboard',\n LOYALTY_STYLE_QUIZ_PAGE_NAME: 'style quiz|cover',\n LOYALTY_STYLE_QUIZ_QUESTION: 'style quiz|q',\n OPTION_SELECTED: 'select',\n OPTION_DESELECTED: 'deselect',\n STYLE_QUIZ_NEXT_CTA: 'next',\n STYLE_QUIZ_PREVIOUS_CTA: 'previous',\n STYLE_QUIZ_SUBMIT_CTA: 'submit',\n STYLE_QUIZ_SKIP_THIS_QUESTION_CTA: 'skip',\n STYLE_QUIZ_FINISH_LATER: 'finish later',\n START_SHOPPING: 'start shopping',\n STYLE_QUIZ_THANK_YOU_PAGE: 'style quiz|thank you',\n PDP_SELECTIONS: 'pdp selections',\n PDP_INTERACTION: 'pdp_interaction',\n CHANGE_STORE: 'change store',\n VIEW_PROMO: 'view_promotion',\n SELECT_PROMO: 'select_promotion',\n VIEW_ITEM_LIST: 'view_item_list',\n VIEW_ITEM: 'view_item',\n SELECT_ITEM: 'select_item',\n SIGN_IN_OR_CREATE_ACCOUNT_ACTION: 'sign in or create account',\n START_LABEL: 'start',\n PDP_PAGE_NAME: 'pdp',\n PRODUCT_PAGE_TYPE: 'product',\n CREATE_ACCOUNT_ACTION: 'create account',\n SUBMIT_EVENT_LABEL: 'submit or success or failure',\n JOIN_CLUB_LILLY_EVENT: 'join club lilly',\n INITIATE_ACTION: 'initiate',\n LOYALTY_ENROLLMENT_CATEGORY: 'loyalty enrollment',\n ACCOUNT_DASHBOARD_PAGE: 'account dashboard',\n GET_DIRECTIONS: 'get directions',\n STORE_INTERACTION: 'store_interaction',\n ADD_TO_CART: 'add_to_cart',\n\n LOYALTY_VIEW_VOUCHER_CODE_LABEL: 'view voucher code',\n REWARDS_POINT_ACTIVITY_LABEL: 'points activity',\n REWARDS_SHOP_TAB_LABEL: 'shop tab',\n\n SHARED_WISHLIST_CREATE_ACCOUNT_CATEGORY: 'account sign in',\n SHARED_WISHLIST_CREATE_ACCOUNT_ACTION: 'sign in or create account',\n SHARED_WISHLIST_CREATE_ACCOUNT_LABEL: 'start',\n SHARED_WISHLIST_PAGE_SUBSECTION: 'wishlist',\n SHARED_WISHLIST_NON_LOYALTY_CATEGORY: 'loyalty enrollment',\n SHARED_WISHLIST_NON_LOYALTY_ACTION: 'initiate',\n SHARED_WISHLIST_NON_LOYALTY_LABEL: 'join club lilly',\n LOYALTY_ENROLL_MODAL_INTERACTION_TYPE: 'loyalty enroll modal',\n SIGN_IN_OR_SIGN_UP_ENROLL_MODAL: 'sign in/up to enroll modal',\n LOYALTY_ENROLLMENT_EVENT_NAME: 'loyalty_enrollment',\n LOYALTY_VOUCHERS_EVENT_NAME: 'loyalty_dashboard_vouchers',\n BOLT_INTERACTION: 'bolt_interaction',\n LOYALTY_DASHBOARD_REWARDS_EVENT_NAME: 'loyalty_dashboard_rewards',\n BOLT_MODAL_PROCEED: 'otp:proceed',\n BOLT_MODAL_CLOSE: 'otp:close',\n LOYALTY_REWARDS_EVENT_NAME: 'loyalty_rewards',\n BOLT_SIGN_OUT: 'otp:sign out',\n NEWSLETTER_SIGNUP_COMPLETE: 'newsletter_signup_complete',\n NEWSLETTER_SIGNUP_FAILURE: 'newsletter_signup_failure',\n P_PRODUCT_LIST_KEY: 'product_list',\n P_PROMO_NAME_KEY: 'promo_name',\n P_PROMO_CREATIVE_NAME: 'promo_creative'\n};\n","'use strict';\n\nconst isFitPredictorEnabled = !!document.getElementById('fitPredictorEnabled');\nconst noop = function () { };\n\n/**\n * Native querySelector to find first element in the dom with given selector\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {Object} returns the target as a DOM node\n */\nconst queryFirst = (selector, parent = document) => {\n if (!parent) return null;\n return parent.querySelector(selector);\n};\n\n/**\n * Native querySelectorAll to find all the dom element with given selector.\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {nodeList | Array} Returns the target as a DOM node.\n */\nconst queryAll = (selector, parent = document) => {\n if (!parent) return null;\n return [].slice.call(parent.querySelectorAll(selector), 0);\n};\n\n/**\n * Looks for availability of class or classes in the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n * @return {boolean} Returns availability of class in the target element.\n */\nconst hasClass = (el, ...classes) => {\n const { classList } = el;\n for (let c = 0, n = classes.length; c < n; c++) {\n if (!classList.contains(classes[c])) return false;\n }\n return true;\n};\n\n/**\n * Wraps a method to set up feature flagging\n * \n * @param {function} method The method to run\n * @return {function} Returns the method passed in if the feature is enabled, otherwise returns a noop method\n */\nconst featureSwitch = method => (isFitPredictorEnabled && method) || noop;\n\n/**\n * This function sets the site context for Secret Sauce based on the channel type\n */\nfunction siteContext() {\n const deviceWidth = window.screen.width;\n let channelValue = 'desktop';\n if (deviceWidth >= 768 && deviceWidth < 1024) {\n channelValue = 'tablet';\n } else if (deviceWidth < 768) {\n channelValue = 'mobile';\n }\n ssp('set', 'site', {\n layout: channelValue,\n currency: 'USD',\n language: 'en',\n market: 'US',\n shippingCountry: 'US'\n });\n}\n\n/**\n * This function sets the customer context for Secret Sauce\n */\nfunction custContext() {\n const custID = document.getElementById('ssCustomer').value;\n const email = document.getElementById('ssEmail').value;\n if (custID && custID !== '') {\n ssp('set', 'user', {\n userId: custID,\n emailHash: email\n });\n }\n}\n\n/**\n * This function sets the page context for Secret Sauce based on the product page type\n * @param {string | Object} bc breadcrumb value.\n * @param {string | Object} pt product page type.\n */\nfunction pageContext(bc, pt) {\n ssp('set', 'page', {\n breadcrumb: bc, // 'Home > Sweaters > SSP Sweater'\n type: pt // 'cat', 'pdp', 'pdp-set', 'quickview'\n });\n}\n\n/**\n * This function retrieves the price of the product from price container for Secret Sauce\n * @param {Object} container product container\n * @param {string | Object} priceContainerId price container Id.\n * @return {float} returns price\n */\nfunction getPriceFromContainer(priceContainerId, container) {\n const price = queryFirst(priceContainerId, container);\n if (price && price.value) {\n return parseFloat(price.value.replace('$', ''));\n }\n return 0.0;\n}\n\n/**\n * This function retrieves the standard price of the product for Secret Sauce\n * @param {Object} container product continer\n * @return {float} returns standard price\n */\nfunction getPrice(container) {\n return getPriceFromContainer('.ssPrice', container);\n}\n\n/**\n * This function sets the standard price of the product for Secret Sauce\n * @param {float} newPrice standard price\n * @param {Object} container product container\n */\nfunction setPrice(newPrice, container) {\n const priceElement = queryFirst('.ssPrice', container);\n if (priceElement) {\n priceElement.value = newPrice;\n }\n}\n\n/**\n * This function retrieves the sale price of the product for Secret Sauce\n * @param {Object} container product container\n * @return {float} returns sale price\n */\nfunction getSalePrice(container) {\n return getPriceFromContainer('.ssSalesPrice', container);\n}\n\n/**\n * This function sets the sale price of the product for Secret Sauce\n * @param {float} newSalePrice sale price\n * @param {Object} container product container\n */\nfunction setSalePrice(newSalePrice, container) {\n const salesPriceElement = queryFirst('.ssSalesPrice', container);\n if (salesPriceElement) {\n salesPriceElement.value = newSalePrice;\n }\n}\n\n/**\n * This function retrieves the selected color of the product for Secret Sauce\n * @param {Object} container product container\n * @return {string} returns selected product color\n */\nfunction getSelectedColor(container) {\n const colorElement = queryFirst('.ssColor', container);\n return colorElement ? colorElement.value : 'unknown';\n}\n\n/**\n * This function sets the selected color of the product for Secret Sauce\n * @param {string} newColor selected product color\n * @param {Object} container product container\n */\nfunction setSelectedColor(newColor, container) {\n const colorElement = queryFirst('.ssColor', container);\n if (colorElement) {\n colorElement.value = newColor;\n }\n}\n\n/**\n * This function retrieves the selected size of the product for Secret Sauce\n * @param {Object} container product container\n * @return {string} returns selected product size\n */\nfunction getSelectedSize(container) {\n const sizeElement = queryFirst('.ssSize', container);\n return sizeElement ? sizeElement.value : 'unknown';\n}\n\n/**\n * This function sets the selected size of the product for Secret Sauce\n * @param {string} newSize selected product size\n * @param {Object} container product container\n */\nfunction setSelectedSize(newSize, container) {\n const sizeElement = queryFirst('.ssSize', container);\n if (sizeElement) {\n sizeElement.value = newSize;\n }\n}\n\n/**\n * This function updates product data for Secret Sauce\n * @param {string} color selected product color\n * @param {string} size selected product size\n * @param {float} price selected product standard price\n * @param {float} salePrice selected product sale price\n * @param {Object} container product container\n */\nfunction updateProductData(color, size, price, salePrice, container) {\n if (getSelectedColor(container) !== color) setSelectedColor(color, container);\n if (getSelectedSize(container) !== size) setSelectedSize(size, container);\n if (getPrice(container) !== price) setPrice(price, container);\n if (getSalePrice(container) !== salePrice) setSalePrice(salePrice, container);\n}\n\n/**\n * This function retrieves the available sizes for the product swatch selected\n * @param {Object} container product container\n * @return {Array} returns sizes list of the product\n */\nfunction getSizes(container) {\n let sizeArray = [];\n queryAll('.size-container .size-list .size-btn', container).forEach((element) => {\n const size = element.dataset.attrValue;\n if (size !== '' && size !== undefined) {\n sizeArray.push(size);\n }\n });\n return sizeArray;\n}\n\n/**\n * This function retrieves the variant ID of the selected product\n * @return {string} returns product ID\n */\nfunction getVariant() {\n return $('.product-detail').attr('data-masterid');\n}\n\n/**\n * This function enables the Fit Predictor link from Secret Sauce\n */\nfunction startFP() {\n ssp('start', 'fitpredictor');\n}\n\n/**\n * This function enables the Style Finder link from Secret Sauce\n */\nfunction startSF() {\n ssp('show', 'stylefinder');\n}\n\n/**\n * This function enables the Outfit Maker link from Secret Sauce\n */\nfunction startOM() {\n ssp('show', 'outfitmaker');\n}\n\n/**\n * This function retrieves the available sizes that are in stock for the product swatch selected\n * @param {Object} container product container\n * @return {Array} returns sizes list of the product\n */\nfunction getAvailableSizes(container) {\n let sizeArray = [];\n queryAll('.size-container .size-list .size-btn', container).forEach((element) => {\n let size = element.dataset.attrValue;\n if (size !== '') {\n if (!hasClass(element, 'not-available')) {\n sizeArray.push(size);\n }\n }\n });\n return sizeArray;\n}\n\n/**\n * This function updates the product context for Secret Sauce\n * @param {Object} $container product container\n * @param {string} context secret sauce initiation context\n */\nfunction updateProductSetData($container, context) {\n if ($container && $container.length > 0) {\n let sizes = [];\n let availableSizes = [];\n $container.find('.size-container .size-list .size-btn').each(function () {\n let size = $(this).attr('data-attr-value');\n if (size && size !== '') {\n sizes.push(size);\n if (!$(this).hasClass('not-available')) {\n availableSizes.push(size);\n }\n }\n });\n const productId = $container.data('masterid').toString();\n const price = $container.find('.ssPrice').first().val();\n const salePrice = $container.find('.ssSalesPrice').first().val();\n const color = $container.find('.ssColor').first().val();\n const size = $container.find('.ssSize').first().val();\n ssp('set', 'product', {\n productId,\n sizeType: 'regular',\n price,\n salePrice,\n color,\n sizes: sizes,\n availableSizes: availableSizes,\n size\n });\n if (context && context === 'variationUpdate') {\n startFP();\n }\n }\n}\n\n/**\n * This function sets the product context for Secret Sauce\n * @param {string} context secret sauce initiation context\n */\nfunction productContext(context, container) {\n // skip call for gift cards\n const $giftCardAmount = $('input[name=\"giftcert_amount\"]');\n if ($giftCardAmount && $giftCardAmount.length > 0) {\n // If we are on gift card, do not fire secretsauce\n return;\n }\n\n const isMaster = 'true';\n\n if (context === 'load') {\n const pid = container[0].dataset.masterid;\n const price = getPrice(container[0]);\n const salePrice = getSalePrice(container[0]);\n let useSale = true;\n if (price === salePrice) {\n useSale = false;\n }\n if (container[0].closest('.set-items')) {\n $('.set-items .product-detail.product-wrapper').each(function () {\n let $container = $(this);\n updateProductSetData($container, context);\n });\n return;\n }\n\n if (isMaster === 'true') {\n if (useSale) {\n ssp('set', 'product', {\n productId: pid,\n sizeType: 'regular',\n price,\n salePrice,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0])\n });\n } else {\n ssp('set', 'product', {\n productId: pid,\n sizeType: 'regular',\n price,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0])\n });\n }\n } else if (useSale) {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n sizeType: 'regular',\n price,\n salePrice,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0]),\n size: getSelectedSize(container[0])\n });\n } else {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n sizeType: 'regular',\n price,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0]),\n size: getSelectedSize(container[0])\n });\n }\n }\n if (context === 'color') {\n const pid = container.dataset.masterid;\n const price = getPrice(container);\n const salePrice = getSalePrice(container);\n let useSale = true;\n if (price === salePrice) {\n useSale = false;\n }\n if (isMaster === 'true') {\n if (useSale) {\n ssp('set', 'product', {\n productId: pid,\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price,\n salePrice\n });\n } else {\n ssp('set', 'product', {\n productId: pid,\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price\n });\n }\n } else if (useSale) {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price,\n salePrice\n });\n } else {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price\n });\n }\n }\n if (context === 'size') {\n const pid = container.dataset.masterid;\n const price = getPrice(container);\n if (isMaster === 'true') {\n ssp('set', 'product', {\n productId: pid,\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n size: getSelectedSize(container),\n price\n });\n } else {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n size: getSelectedSize(container),\n price\n });\n }\n }\n}\n\n/**\n * This function initiates Secret Sauce based on product's color change\n * @param {Object} container product container\n */\nfunction handleColor(container) {\n const attribute = queryFirst('.ssColor', container);\n if (attribute && attribute.value !== null || 'unknown') {\n productContext('color', container);\n }\n}\n\n/**\n * This function initiates Secret Sauce based on product's size change\n * @param {Object} container product container\n */\nfunction handleSize(container) {\n const attribute = queryFirst('.ssSize', container);\n if (attribute && attribute.value !== 'unknown' || null) {\n productContext('size', container);\n }\n}\n\n/**\n * This function returns page bread crumb\n * @return {string} returns page bread crumb\n */\nfunction getCrumbs() {\n let crumb = '';\n $('.breadcrumb .breadcrumb-item').each(function () {\n if (crumb === '') {\n crumb = $(this).html;\n } else {\n crumb = crumb + ' > ' + $(this).html;\n }\n });\n return crumb;\n}\n\n/**\n * This function fires at the beginning\n * To prevent looping of the change event, which fires an ajax call which reloads everything, then concludes\n * with calling the predictor again, we need to setup some way to track, hence the use of a trigger.\n * @param {Object} container product container\n */\nfunction prediction(container) {\n // The subscription seems to only allow itself to be set once.\n // i.e. future subscription handlers are discarded.\n // References to container will revert to the initial subscription,\n // which won't always be what we were looking for.\n // So I'm attaching the container to the function itself.\n prediction.container = container;\n\n ssp('subscribe', 'prediction', function (event) {\n queryAll('.product-detail.product-wrapper[data-masterid=\"' + event.productId + '\"]').forEach(productContainer => {\n //check for an instance of the trigger\n const trigger = productContainer.getAttribute('data-sstrigger-first-time');\n if (trigger === 'true' && event.service === 'fitpredictor' && event.size) {\n const sizeOption = $('.size-container .size-list .size-btn[data-attr-value=\"' + event.size + '\"]', productContainer);\n if (sizeOption) {\n sizeOption.trigger('click');\n }\n productContainer.setAttribute('data-sstrigger-first-time', 'false');\n $('body').trigger('fitPredictorSizeSelected', productContainer);\n }\n });\n });\n}\n\n/**\n * This function sets Add to Cart context for Secret Sauce\n * @param {Object} container product container\n * @return {boolean} returns status if or not add to cart context is set for secret sauce\n */\nfunction ssAddToCart(container) {\n if (ssp) {\n const { pid, masterid } = container.dataset;\n ssp('track', 'addVariantToCart', {\n variantId: pid,\n productId: masterid,\n quantity: 1\n });\n return true;\n }\n return false;\n}\n\n/**\n * This function sets flag for Secret Sauce initiation\n * @param {Object} container product's container\n */\nfunction setupTrigger(container) {\n container.attr('data-sstrigger-first-time', 'true');\n}\n\n/**\n * This function sets all the context for Secret Sauce initiation and triggers Secret Sauce services\n * @param {Object} container product's container\n */\nfunction initializeDom(container) {\n siteContext();\n custContext();\n let pt = 'pdp';\n if (container[0].closest('.search-results-container')) {\n pt = 'cat';\n } else if (container[0].closest('.product-set-detail')) {\n pt = 'pdp-set';\n } else if (hasClass(container[0], 'product-quickview')) {\n pt = 'quickview';\n }\n const crumbs = getCrumbs();\n pageContext(crumbs, pt);\n productContext('load', container);\n startFP();\n setupTrigger(container);\n prediction(container);\n}\n\n/**\n * This function initiates Secret Sauce\n * @param {Object} container product's container\n */\nfunction sauce(container) {\n initializeDom(container);\n}\n\nmodule.exports = Object.entries({\n handleColor,\n handleSize,\n prediction,\n sauce,\n ssAddToCart,\n startFP,\n startOM,\n startSF,\n updateProductData,\n updateProductSetData\n}).reduce((exported, [alias, method]) => {\n exported[alias] = featureSwitch(method);\n return exported;\n}, {});\n","/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function(window, document, exportName, undefined) {\n 'use strict';\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = document.createElement('div');\n\nvar TYPE_FUNCTION = 'function';\n\nvar round = Math.round;\nvar abs = Math.abs;\nvar now = Date.now;\n\n/**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\nfunction setTimeoutContext(fn, timeout, context) {\n return setTimeout(bindFn(fn, context), timeout);\n}\n\n/**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n return false;\n}\n\n/**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n return function() {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '')\n .replace(/^\\s+at\\s+/gm, '')\n .replace(/^Object.\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n\n var log = window.console && (window.console.warn || window.console.log);\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n return method.apply(this, arguments);\n };\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\nvar extend = deprecate(function extend(dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n while (i < keys.length) {\n if (!merge || (merge && dest[keys[i]] === undefined)) {\n dest[keys[i]] = src[keys[i]];\n }\n i++;\n }\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\nvar merge = deprecate(function merge(dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\nfunction inherit(child, base, properties) {\n var baseP = base.prototype,\n childP;\n\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign(childP, properties);\n }\n}\n\n/**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\nfunction boolOrFn(val, args) {\n if (typeof val == TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n return val;\n}\n\n/**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\nfunction ifUndefined(val1, val2) {\n return (val1 === undefined) ? val2 : val1;\n}\n\n/**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n\n/**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n while (i < src.length) {\n if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\n return i;\n }\n i++;\n }\n return -1;\n }\n}\n\n/**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function sortUniqueArray(a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\n/**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\nfunction prefixed(obj, property) {\n var prefix, prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n\n var i = 0;\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = (prefix) ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n i++;\n }\n return undefined;\n}\n\n/**\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return (doc.defaultView || doc.parentWindow || window);\n}\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\n\nvar COMPUTE_INTERVAL = 25;\n\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\n\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\n\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\nfunction Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget;\n\n // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n this.domHandler = function(ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n\n}\n\nInput.prototype = {\n /**\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n handler: function() { },\n\n /**\n * bind the events\n */\n init: function() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n },\n\n /**\n * unbind the events\n */\n destroy: function() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n};\n\n/**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\nfunction createInputInstance(manager) {\n var Type;\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n return new (Type)(manager, inputHandler);\n}\n\n/**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\n var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\n\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n }\n\n // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n input.eventType = eventType;\n\n // compute scale, rotation etc\n computeInputData(manager, input);\n\n // emit secret event\n manager.emit('hammer.input', input);\n\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length;\n\n // store the first input to calculate the distance and direction\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n }\n\n // to compute scale and rotation we need to store the multiple touches\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput;\n var firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;\n\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n\n input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >\n session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);\n\n computeIntervalInputData(session, input);\n\n // find the correct target\n var target = manager.element;\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n input.target = target;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center;\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input,\n deltaTime = input.timeStamp - last.timeStamp,\n velocity, velocityX, velocityY, direction;\n\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\nfunction getCenter(pointers) {\n var pointersLength = pointers.length;\n\n // no need to loop when only one touch\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0, y = 0, i = 0;\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\n/**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n\n return Math.sqrt((x * x) + (y * y));\n}\n\n/**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\n\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n\n/**\n * Mouse events input\n * @constructor\n * @extends Input\n */\nfunction MouseInput() {\n this.evEl = MOUSE_ELEMENT_EVENTS;\n this.evWin = MOUSE_WINDOW_EVENTS;\n\n this.pressed = false; // mousedown state\n\n Input.apply(this, arguments);\n}\n\ninherit(MouseInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function MEhandler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type];\n\n // on start we want to have the left mouse button down\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n }\n\n // mouse must be down\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n }\n});\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n};\n\n// in IE10 the pointer types is defined as an enum\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n};\n\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n\n// IE10 has prefixed support, and case-sensitive\nif (window.MSPointerEvent && !window.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n\n/**\n * Pointer events input\n * @constructor\n * @extends Input\n */\nfunction PointerEventInput() {\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n\n Input.apply(this, arguments);\n\n this.store = (this.manager.session.pointerEvents = []);\n}\n\ninherit(PointerEventInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function PEhandler(ev) {\n var store = this.store;\n var removePointer = false;\n\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n\n var isTouch = (pointerType == INPUT_TYPE_TOUCH);\n\n // get index of the event in the store\n var storeIndex = inArray(store, ev.pointerId, 'pointerId');\n\n // start and mouse must be down\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n }\n\n // it not found, so the pointer hasn't been down (so it's probably a hover)\n if (storeIndex < 0) {\n return;\n }\n\n // update the event in the store\n store[storeIndex] = ev;\n\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n});\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Touch events input\n * @constructor\n * @extends Input\n */\nfunction SingleTouchInput() {\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n this.started = false;\n\n Input.apply(this, arguments);\n}\n\ninherit(SingleTouchInput, Input, {\n handler: function TEhandler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\n\n // should we handle the touch events?\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type);\n\n // when done, reset the started state\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\nfunction TouchInput() {\n this.evTarget = TOUCH_TARGET_EVENTS;\n this.targetIds = {};\n\n Input.apply(this, arguments);\n}\n\ninherit(TouchInput, Input, {\n handler: function MTEhandler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds;\n\n // when there is only one touch, the process can be simplified\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i,\n targetTouches,\n changedTouches = toArray(ev.changedTouches),\n changedTargetTouches = [],\n target = this.target;\n\n // get target touches from touches\n targetTouches = allTouches.filter(function(touch) {\n return hasParent(touch.target, target);\n });\n\n // collect touches\n if (type === INPUT_START) {\n i = 0;\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n }\n\n // filter changed touches to only contain touches that exist in the collected target ids\n i = 0;\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n }\n\n // cleanup removed touches\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [\n // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\n changedTargetTouches\n ];\n}\n\n/**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction TouchMouseInput() {\n Input.apply(this, arguments);\n\n var handler = bindFn(this.handler, this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n\n this.primaryTouch = null;\n this.lastTouches = [];\n}\n\ninherit(TouchMouseInput, Input, {\n /**\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n handler: function TMEhandler(manager, inputEvent, inputData) {\n var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\n isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n }\n\n // when we're in a touch event, record touches to de-dupe synthetic mouse event\n if (isTouch) {\n recordTouches.call(this, inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n return;\n }\n\n this.callback(manager, inputEvent, inputData);\n },\n\n /**\n * remove the event listeners\n */\n destroy: function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n }\n});\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction setLastTouch(eventData) {\n var touch = eventData.changedPointers[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {x: touch.clientX, y: touch.clientY};\n this.lastTouches.push(lastTouch);\n var lts = this.lastTouches;\n var removeLastTouch = function() {\n var i = lts.indexOf(lastTouch);\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n return false;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\n\n// magical touchAction value\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\nfunction TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n}\n\nTouchAction.prototype = {\n /**\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n set: function(value) {\n // find out the touch-action by the event handlers\n if (value == TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n this.actions = value.toLowerCase().trim();\n },\n\n /**\n * just re-set the touchAction value\n */\n update: function() {\n this.set(this.manager.options.touchAction);\n },\n\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n compute: function() {\n var actions = [];\n each(this.manager.recognizers, function(recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n },\n\n /**\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n preventDefaults: function(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection;\n\n // if the touch action did prevented once this session\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n //do not prevent defaults if this is a tap gesture\n\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone ||\n (hasPanY && direction & DIRECTION_HORIZONTAL) ||\n (hasPanX && direction & DIRECTION_VERTICAL)) {\n return this.preventSrc(srcEvent);\n }\n },\n\n /**\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n preventSrc: function(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n }\n};\n\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\n\n // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n }\n\n // pan-x OR pan-y\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n }\n\n // manipulation\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n var touchMap = {};\n var cssSupports = window.CSS && window.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {\n\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\nfunction Recognizer(options) {\n this.options = assign({}, this.defaults, options || {});\n\n this.id = uniqueId();\n\n this.manager = null;\n\n // default is enable true\n this.options.enable = ifUndefined(this.options.enable, true);\n\n this.state = STATE_POSSIBLE;\n\n this.simultaneous = {};\n this.requireFail = [];\n}\n\nRecognizer.prototype = {\n /**\n * @virtual\n * @type {Object}\n */\n defaults: {},\n\n /**\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n set: function(options) {\n assign(this.options, options);\n\n // also update the touchAction, in case something changed about the directions/enabled state\n this.manager && this.manager.touchAction.update();\n return this;\n },\n\n /**\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n recognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n return this;\n },\n\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRecognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n },\n\n /**\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n requireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n return this;\n },\n\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRequireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n return this;\n },\n\n /**\n * has require failures boolean\n * @returns {boolean}\n */\n hasRequireFailures: function() {\n return this.requireFail.length > 0;\n },\n\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n canRecognizeWith: function(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n },\n\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n emit: function(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n }\n\n // 'panstart' and 'panmove'\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n }\n\n // panend and pancancel\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n },\n\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n tryEmit: function(input) {\n if (this.canEmit()) {\n return this.emit(input);\n }\n // it's failing anyway\n this.state = STATE_FAILED;\n },\n\n /**\n * can we emit?\n * @returns {boolean}\n */\n canEmit: function() {\n var i = 0;\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n i++;\n }\n return true;\n },\n\n /**\n * update the recognizer\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign({}, inputData);\n\n // is is enabled and allow recognizing?\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n }\n\n // reset when we've reached the end\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone);\n\n // the recognizer has recognized a gesture\n // so trigger an event\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n },\n\n /**\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {Const} STATE\n */\n process: function(inputData) { }, // jshint ignore:line\n\n /**\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n getTouchAction: function() { },\n\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n reset: function() { }\n};\n\n/**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n return '';\n}\n\n/**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\nfunction directionStr(direction) {\n if (direction == DIRECTION_DOWN) {\n return 'down';\n } else if (direction == DIRECTION_UP) {\n return 'up';\n } else if (direction == DIRECTION_LEFT) {\n return 'left';\n } else if (direction == DIRECTION_RIGHT) {\n return 'right';\n }\n return '';\n}\n\n/**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n if (manager) {\n return manager.get(otherRecognizer);\n }\n return otherRecognizer;\n}\n\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\nfunction AttrRecognizer() {\n Recognizer.apply(this, arguments);\n}\n\ninherit(AttrRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof AttrRecognizer\n */\n defaults: {\n /**\n * @type {Number}\n * @default 1\n */\n pointers: 1\n },\n\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n attrTest: function(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n },\n\n /**\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n process: function(input) {\n var state = this.state;\n var eventType = input.eventType;\n\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input);\n\n // on cancel input and we've recognized before, return STATE_CANCELLED\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n return state | STATE_CHANGED;\n }\n return STATE_FAILED;\n }\n});\n\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}\n\ninherit(PanRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PanRecognizer\n */\n defaults: {\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n },\n\n getTouchAction: function() {\n var direction = this.options.direction;\n var actions = [];\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n return actions;\n },\n\n directionTest: function(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY;\n\n // lock to axis?\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x != this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y != this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n },\n\n attrTest: function(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) &&\n (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\n },\n\n emit: function(input) {\n\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n\n emit: function(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\nfunction PressRecognizer() {\n Recognizer.apply(this, arguments);\n\n this._timer = null;\n this._input = null;\n}\n\ninherit(PressRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PressRecognizer\n */\n defaults: {\n event: 'press',\n pointers: 1,\n time: 251, // minimal time of the pointer to be pressed\n threshold: 9 // a minimal movement is ok, but keep it low\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_AUTO];\n },\n\n process: function(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n\n this._input = input;\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.time, this);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && (input.eventType & INPUT_END)) {\n this.manager.emit(this.options.event + 'up', input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction RotateRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(RotateRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof RotateRecognizer\n */\n defaults: {\n event: 'rotate',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n }\n});\n\n/**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction SwipeRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(SwipeRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof SwipeRecognizer\n */\n defaults: {\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n },\n\n getTouchAction: function() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n },\n\n attrTest: function(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return this._super.attrTest.call(this, input) &&\n direction & input.offsetDirection &&\n input.distance > this.options.threshold &&\n input.maxPointers == this.options.pointers &&\n abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n },\n\n emit: function(input) {\n var direction = directionStr(input.offsetDirection);\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n }\n});\n\n/**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\nfunction TapRecognizer() {\n Recognizer.apply(this, arguments);\n\n // previous time and center,\n // used for tap counting\n this.pTime = false;\n this.pCenter = false;\n\n this._timer = null;\n this._input = null;\n this.count = 0;\n}\n\ninherit(TapRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300, // max time between the multi-tap taps\n time: 250, // max time of the pointer to be down (like finger on the screen)\n threshold: 9, // a minimal movement is ok, but keep it low\n posThreshold: 10 // a multi-tap can be a bit off the initial position\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_MANIPULATION];\n },\n\n process: function(input) {\n var options = this.options;\n\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n\n this.reset();\n\n if ((input.eventType & INPUT_START) && (this.count === 0)) {\n return this.failTimeout();\n }\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType != INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input;\n\n // if tap count matches we have recognized it,\n // else it has began recognizing...\n var tapCount = this.count % options.taps;\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.interval, this);\n return STATE_BEGAN;\n }\n }\n }\n return STATE_FAILED;\n },\n\n failTimeout: function() {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_FAILED;\n }, this.options.interval, this);\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function() {\n if (this.state == STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Hammer(element, options) {\n options = options || {};\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n return new Manager(element, options);\n}\n\n/**\n * @const {string}\n */\nHammer.VERSION = '2.0.7';\n\n/**\n * default settings\n * @namespace\n */\nHammer.defaults = {\n /**\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * @type {Array}\n */\n preset: [\n // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n [RotateRecognizer, {enable: false}],\n [PinchRecognizer, {enable: false}, ['rotate']],\n [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],\n [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],\n [TapRecognizer],\n [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],\n [PressRecognizer]\n ],\n\n /**\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: 'none',\n\n /**\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: 'none',\n\n /**\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: 'none',\n\n /**\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: 'none',\n\n /**\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: 'none',\n\n /**\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n};\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n\n/**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Manager(element, options) {\n this.options = assign({}, Hammer.defaults, options || {});\n\n this.options.inputTarget = this.options.inputTarget || element;\n\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n\n toggleCssProps(this, true);\n\n each(this.options.recognizers, function(item) {\n var recognizer = this.add(new (item[0])(item[1]));\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n}\n\nManager.prototype = {\n /**\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n set: function(options) {\n assign(this.options, options);\n\n // Options that need a little more setup\n if (options.touchAction) {\n this.touchAction.update();\n }\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n return this;\n },\n\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n stop: function(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n },\n\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n var session = this.session;\n if (session.stopped) {\n return;\n }\n\n // run the touch-action polyfill\n this.touchAction.preventDefaults(inputData);\n\n var recognizer;\n var recognizers = this.recognizers;\n\n // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n var curRecognizer = session.curRecognizer;\n\n // reset when the last recognizer is recognized\n // or when we're in a new session\n if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\n curRecognizer = session.curRecognizer = null;\n }\n\n var i = 0;\n while (i < recognizers.length) {\n recognizer = recognizers[i];\n\n // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer == curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) { // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n }\n\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n i++;\n }\n },\n\n /**\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n get: function(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event == recognizer) {\n return recognizers[i];\n }\n }\n return null;\n },\n\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n add: function(recognizer) {\n if (invokeArrayArg(recognizer, 'add', this)) {\n return this;\n }\n\n // remove existing\n var existing = this.get(recognizer.options.event);\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n\n this.touchAction.update();\n return recognizer;\n },\n\n /**\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n remove: function(recognizer) {\n if (invokeArrayArg(recognizer, 'remove', this)) {\n return this;\n }\n\n recognizer = this.get(recognizer);\n\n // let's make sure this recognizer exists\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, recognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n },\n\n /**\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n on: function(events, handler) {\n if (events === undefined) {\n return;\n }\n if (handler === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n },\n\n /**\n * unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n off: function(events, handler) {\n if (events === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n },\n\n /**\n * emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n emit: function(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n }\n\n // no handlers, so skip it all\n var handlers = this.handlers[event] && this.handlers[event].slice();\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n data.preventDefault = function() {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n },\n\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy: function() {\n this.element && toggleCssProps(this, false);\n\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n};\n\n/**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n if (!element.style) {\n return;\n }\n var prop;\n each(manager.options.cssProps, function(value, name) {\n prop = prefixed(element.style, name);\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || '';\n }\n });\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n\n/**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent('Event');\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n\nassign(Hammer, {\n INPUT_START: INPUT_START,\n INPUT_MOVE: INPUT_MOVE,\n INPUT_END: INPUT_END,\n INPUT_CANCEL: INPUT_CANCEL,\n\n STATE_POSSIBLE: STATE_POSSIBLE,\n STATE_BEGAN: STATE_BEGAN,\n STATE_CHANGED: STATE_CHANGED,\n STATE_ENDED: STATE_ENDED,\n STATE_RECOGNIZED: STATE_RECOGNIZED,\n STATE_CANCELLED: STATE_CANCELLED,\n STATE_FAILED: STATE_FAILED,\n\n DIRECTION_NONE: DIRECTION_NONE,\n DIRECTION_LEFT: DIRECTION_LEFT,\n DIRECTION_RIGHT: DIRECTION_RIGHT,\n DIRECTION_UP: DIRECTION_UP,\n DIRECTION_DOWN: DIRECTION_DOWN,\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n DIRECTION_ALL: DIRECTION_ALL,\n\n Manager: Manager,\n Input: Input,\n TouchAction: TouchAction,\n\n TouchInput: TouchInput,\n MouseInput: MouseInput,\n PointerEventInput: PointerEventInput,\n TouchMouseInput: TouchMouseInput,\n SingleTouchInput: SingleTouchInput,\n\n Recognizer: Recognizer,\n AttrRecognizer: AttrRecognizer,\n Tap: TapRecognizer,\n Pan: PanRecognizer,\n Swipe: SwipeRecognizer,\n Pinch: PinchRecognizer,\n Rotate: RotateRecognizer,\n Press: PressRecognizer,\n\n on: addEventListeners,\n off: removeEventListeners,\n each: each,\n merge: merge,\n extend: extend,\n assign: assign,\n inherit: inherit,\n bindFn: bindFn,\n prefixed: prefixed\n});\n\n// this prevents errors when Hammer is loaded in the presence of an AMD\n// style loader but by script tag, not by the loader.\nvar freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line\nfreeGlobal.Hammer = Hammer;\n\nif (typeof define === 'function' && define.amd) {\n define(function() {\n return Hammer;\n });\n} else if (typeof module != 'undefined' && module.exports) {\n module.exports = Hammer;\n} else {\n window[exportName] = Hammer;\n}\n\n})(window, document, 'Hammer');\n","// OOTB Code\n'use strict';\n\nconst scrollAnimate = require('base/components/scrollAnimate');\nconst baseFormErrors = require('base/checkout/formErrors');\n\n\n/**\n * Display error messages and highlight form fields with errors.\n * @param {string} parentSelector - the form which contains the fields\n * @param {Object} fieldErrors - the fields with errors\n */\nbaseFormErrors.loadFormErrors = function(parentSelector, fieldErrors) { // eslint-disable-line\n // Display error messages and highlight form fields with errors.\n $.each(fieldErrors, function (attr) {\n $('*[name=' + attr + ']', parentSelector)\n .addClass('is-invalid')\n .siblings('.invalid-feedback')\n .html(fieldErrors[attr]);\n });\n // Animate to top of form that has errors\n scrollAnimate($(parentSelector).find('.is-invalid:first'));\n};\n\n/**\n * Clear the form errors.\n * @param {string} parentSelector - the parent form selector.\n */\nbaseFormErrors.clearPreviousErrors = function(parentSelector) {\n $(parentSelector).find('.form-control.is-invalid').removeClass('is-invalid');\n $('.error-message').hide();\n};\n\nmodule.exports = baseFormErrors;\n","// OOTB Code\n'use strict';\nconst { queryFirst, addClass, queryAll, isInViewport, removeClass, hasClass, scrollTo } = require('./domUtil');\nconst { errorTextTemplate } = require('./templates');\nconst formHelpers = require('./checkout/formErrors');\nconst checkoutContainerEl = document.getElementById('checkout-main');\nconst checkoutContainer = queryFirst('.data-checkout-stage');\nconst showClass = 'show';\n\n/**\n * Function to scroll to th first invalid input if it is not in view port\n * @param {HTMLElement} formEl - Form to be validated\n */\nfunction scrollToError(formEl) {\n const headerEl = queryFirst('.main-header');\n const headerHeight = headerEl ? headerEl.offsetHeight : 0;\n const invalidEl = $(formEl)\n .find('.is-invalid')\n .first();\n\n if (invalidEl[0] && !isInViewport(invalidEl[0])) {\n scrollTo(invalidEl.offset().top - headerHeight);\n }\n}\n\n/**\n * Validate whole form. Requires `this` to be set to form object\n * @param {jQuery.event} event - Event to be canceled if form is invalid.\n * @returns {boolean} - Flag to indicate if form is valid\n */\nfunction validateForm(event) {\n var valid = true;\n if (checkoutContainer) {\n const billingForm = queryFirst('.billing-address-form', checkoutContainer);\n if (this === billingForm) {\n return valid;\n }\n }\n if (this.checkValidity && !this.checkValidity()) {\n // safari\n valid = false;\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n scrollToError(this);\n $(this)\n .find('input, select')\n .each(function () {\n if (!this.validity.valid) {\n $(this).trigger('invalid', this.validity);\n }\n });\n }\n return valid;\n}\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearForm(form) {\n $(form)\n .find('.form-control.is-invalid')\n .removeClass('is-invalid');\n}\n\n// LP custom changes start\n/**\n * Enable or disable button based on form validity status\n * @param {Object} button - button to be enabled or disabled\n * @param {Object} formElement - form to be validated\n */\nfunction enableOrDisableButton(button, formElement) {\n button.disabled = formElement.checkValidity && !formElement.checkValidity();\n clearForm(formElement);\n}\n// LP custom changes end\n\n/**\n * function returns validation message basedd on fields invalid state\n * @returns {string} Validation message\n */\nfunction getValidationMessage() {\n let { validationMessage } = this;\n const $this = $(this);\n const patternMismatchValue = $this.data('pattern-mismatch');\n const rangeErrorValue = $this.data('range-error');\n const missingErrorValue = $this.data('missing-error');\n const badInputErrorValue = $this.data('bad-input-error');\n const stepMismatchErrorValue = $this.data('step-mismatch-error');\n const typeMismatchErrorValue = $this.data('type-mismatch-error');\n const { patternMismatch, rangeOverflow, rangeUnderflow, tooLong, tooShort, valueMissing, badInput, stepMismatch, typeMismatch } = this.validity;\n\n addClass(this, 'is-invalid');\n if (patternMismatch && patternMismatchValue) {\n validationMessage = patternMismatchValue;\n } else if ((rangeOverflow || rangeUnderflow) && rangeErrorValue) {\n validationMessage = rangeErrorValue;\n } else if ((tooLong || tooShort) && rangeErrorValue) {\n validationMessage = rangeErrorValue;\n } else if (valueMissing && missingErrorValue) {\n validationMessage = missingErrorValue;\n } else if (badInput && badInputErrorValue) {\n validationMessage = badInputErrorValue;\n } else if (stepMismatch && stepMismatchErrorValue) {\n validationMessage = stepMismatchErrorValue;\n } else if (typeMismatch && typeMismatchErrorValue) {\n validationMessage = typeMismatchErrorValue;\n }\n\n return validationMessage;\n}\n\n/**\n * Displays invalid forms error messages\n * @param {jQuery.event} e - Form invalid event object\n */\nfunction onFormInvalidHandler(e) {\n e.preventDefault();\n this.setCustomValidity('');\n if (!this.validity.valid) {\n $('.btn-show-details').trigger('click');\n $(this)\n .parents('.form-group, .input-group')\n .find('.invalid-feedback')\n .text(getValidationMessage.apply(this));\n if (!checkoutContainerEl) {\n scrollToError(this.form);\n }\n }\n}\n\n/**\n * Form submission event handler\n * @param {jQuery.event} e - Form submit event object\n * @returns {boolean} true if the form is valid\n */\nfunction onFormSubmit(e) {\n return validateForm.call(this, e);\n}\n\n/**\n * Function to update payment fields validation\n * @param {boolean} isRequired - describs payment fields required or not\n */\nfunction updatePaymentValidation(isRequired) {\n queryFirst('input[name=\"dwfrm_billing_creditCardFields_cardNumber\"]', checkoutContainerEl).required = isRequired;\n queryFirst('input[name=\"dwfrm_billing_creditCardFields_cardType\"]', checkoutContainerEl).required = isRequired;\n queryFirst('input[name=\"dwfrm_billing_creditCardFields_securityCode\"]', checkoutContainerEl).required = isRequired;\n document.getElementById('expirationMonth').required = isRequired;\n document.getElementById('expirationYear').required = isRequired;\n}\n\n/**\n * Function to check if the password and confirm password matches in form\n * @param {string} passwordFieldId - ID of the password form field\n * @param {boolean} isPasswordMatched - describes if password matched\n * @param {boolean} isValidForm - describes if the form is valid\n * @return {Object} - updated form validity and password match\n */\nfunction checkPasswordMatch(passwordFieldId, isPasswordMatched, isValidForm, $this) {\n const newPasswordValue = queryFirst(passwordFieldId).value;\n const confirmPasswordValue = $this.value;\n let isPasswordMatches = isPasswordMatched;\n let isValidForms = isValidForm;\n if (confirmPasswordValue && newPasswordValue && confirmPasswordValue !== newPasswordValue) {\n isPasswordMatches = false;\n isValidForms = false;\n }\n return { isPasswordMatches, isValidForms };\n}\n\n/**\n * Runs validation on all INPUT elements within the specified containing element.\n * @param {element} container - The containing element to validate all inputs within\n */\nfunction validateInputs(container) {\n if (!container) return;\n\n container.querySelectorAll('input').forEach(element => element.checkValidity());\n}\n\nmodule.exports = {\n invalid: function () {\n $('form input, form textarea, form select').on('invalid', onFormInvalidHandler);\n },\n\n ajaxFormInvalid: function (formElSelector) {\n if (!formElSelector) return;\n $(`${formElSelector} input, ${formElSelector} textarea, ${formElSelector} select`).on('invalid', onFormInvalidHandler);\n },\n\n submit: function () {\n $('form').on('submit', onFormSubmit);\n },\n\n ajaxFormSubmit: function (formElSelector) {\n if (!formElSelector) return;\n $(`${formElSelector}`).on('submit', onFormSubmit);\n },\n\n validateCheckoutForm: function () {\n // LP custom changes start\n if (checkoutContainer) {\n const guestCustomerForm = queryFirst('.guest-form', checkoutContainer);\n const registeredCustomerForm = queryFirst('.registered-form', checkoutContainer);\n const shippingForm = queryFirst('.shipping-form', checkoutContainer);\n const billingForm = queryFirst('.billing-address-form', checkoutContainer);\n const submitShippingBtn = queryFirst('.submit-shipping', checkoutContainer);\n const billingAddress = queryFirst('.billing-address', billingForm);\n const reauthForm = queryFirst('.reauth-payment-form', checkoutContainer);\n\n if (submitShippingBtn !== null) {\n submitShippingBtn.disabled = false;\n }\n // LP custom changes end\n\n $('.guest-form, .registered-form, .shipping-form, .billing-address-form')\n .find('input, textarea')\n .on('blur', function () {\n if (this.validity.valid) {\n removeClass(this, 'is-invalid');\n } else {\n $(this)\n .parents('.form-group, .input-group')\n .find('.invalid-feedback')\n .text(getValidationMessage.apply(this));\n }\n });\n $('.shipping-form, .billing-address-form')\n .find('select, input[type=\"radio\"], input[type=\"checkbox\"]')\n .on('change', function () {\n if (this.validity.valid) {\n removeClass(this, 'is-invalid');\n } else {\n $(this)\n .parents('.form-group')\n .find('.invalid-feedback')\n .text(getValidationMessage.apply(this));\n }\n });\n if (!reauthForm) {\n const submitCustomerBtn = queryFirst('.submit-customer', checkoutContainer);\n const submitCustomerLoginBtn = queryFirst('.submit-customer-login', checkoutContainer);\n if (submitCustomerBtn) {\n submitCustomerBtn.addEventListener('click', function (event) {\n if (guestCustomerForm.checkValidity && !guestCustomerForm.checkValidity()) {\n event.stopPropagation();\n scrollToError(guestCustomerForm);\n }\n });\n }\n if (submitCustomerLoginBtn) {\n submitCustomerLoginBtn.addEventListener('click', function (event) {\n if (registeredCustomerForm.checkValidity && !registeredCustomerForm.checkValidity()) {\n event.stopPropagation();\n scrollToError(registeredCustomerForm);\n }\n });\n }\n\n shippingForm.addEventListener('submit', function (event) {\n event.preventDefault();\n setTimeout(function () {\n submitShippingBtn.click();\n }, 0);\n });\n\n submitShippingBtn.addEventListener('click', function (event) {\n const shippingForm = queryFirst('.shipping-form');\n const errorElement = queryFirst('.error-message');\n const { shippingError } = this.dataset;\n const { addressMode } = shippingForm.dataset;\n const { customerType } = checkoutContainer.dataset;\n const giftCheckbox = queryFirst('.custom-control-input.gift');\n const giftMessageContainer = queryFirst('.gift-message', shippingForm);\n const giftMessageEl = document.getElementById('giftMessage');\n\n removeClass(errorElement, showClass);\n\n if (customerType === 'registered') {\n if (addressMode === 'new' || addressMode === 'details') {\n if (shippingForm.checkValidity && !shippingForm.checkValidity()) {\n event.stopPropagation();\n errorElement.innerHTML = errorTextTemplate(shippingError);\n addClass(errorElement, showClass);\n scrollTo(0);\n }\n } else if (giftMessageEl && !giftMessageEl.validity.valid) {\n addClass(giftMessageEl, 'is-invalid');\n event.stopPropagation();\n } else {\n removeClass(giftMessageEl, 'is-invalid');\n }\n } else if (shippingForm.checkValidity && !shippingForm.checkValidity()) {\n event.stopPropagation();\n errorElement.innerHTML = errorTextTemplate(shippingError);\n addClass(errorElement, showClass);\n scrollTo(0);\n }\n if (giftCheckbox.checked && !giftMessageEl.required) {\n giftMessageEl.required = true;\n giftMessageEl.checkValidity();\n removeClass(giftMessageContainer, 'd-none');\n event.stopPropagation();\n }\n });\n\n const submitPaymentBtn = queryFirst('.submit-payment', checkoutContainer);\n\n submitPaymentBtn.addEventListener('click', function (event) {\n const { customerType } = checkoutContainer.dataset;\n const isPaymentDisabled = hasClass(queryFirst('.payment-information'), 'disabled-section');\n const isCreditTabActive = hasClass(queryFirst('.credit-card-tab', checkoutContainer), 'active');\n const isBoltTabActive = hasClass(queryFirst('.bolt-tab', checkoutContainer), 'active');\n const isNewPayment = $('.payment-information').data('is-new-payment');\n const isRequired = !isPaymentDisabled && (isCreditTabActive || isBoltTabActive);\n const checkIsBoltEnabledEl = queryFirst('.check-is-bolt-enabled');\n const isBoltEnabled = (checkIsBoltEnabledEl && checkIsBoltEnabledEl.value === 'true') || false;\n const savedPaymentCvv = queryFirst('.saved-payment-security-code');\n\n updatePaymentValidation(isRequired);\n let isCardExpired = false;\n if (isBoltEnabled && isBoltTabActive) {\n updatePaymentValidation(isRequired && isNewPayment);\n if (!isPaymentDisabled && isNewPayment) {\n const creditCardExpirationMonthEl = queryFirst('#expirationMonth');\n const creditCardExpirationYearEl = queryFirst('#expirationYear');\n const { cardExpiredError } = creditCardExpirationMonthEl.dataset;\n const boltCardExpireMonth = creditCardExpirationMonthEl.value;\n const boltCardExpireYear = creditCardExpirationYearEl.value;\n const today = new Date();\n const expDate = new Date();\n expDate.setFullYear(boltCardExpireYear, boltCardExpireMonth, 0);\n if (boltCardExpireYear && boltCardExpireMonth && expDate < today) {\n const boltExpiredCardError = { dwfrm_billing_creditCardFields_expirationMonth: cardExpiredError, dwfrm_billing_creditCardFields_expirationYear: cardExpiredError };\n formHelpers.loadFormErrors('.payment-form', boltExpiredCardError);\n isCardExpired = true;\n }\n }\n\n // In case of LP reg user having saved cards and payment method is Bolt Pay\n // then CVV should not be a required field for LP saved cards\n if (savedPaymentCvv) {\n savedPaymentCvv.required = false;\n }\n } else if (customerType === 'registered') {\n if (savedPaymentCvv) {\n savedPaymentCvv.required = isRequired && !isNewPayment;\n }\n updatePaymentValidation(isRequired && isNewPayment);\n }\n if ((billingForm.checkValidity && !billingForm.checkValidity()) || isCardExpired) {\n scrollToError(billingForm);\n event.stopPropagation();\n }\n });\n\n billingForm.addEventListener('submit', function (event) {\n event.preventDefault();\n setTimeout(function () {\n // if the payment button is hidden, it's because CC is not active\n // and therefore we shouldn't click it\n if (!hasClass(submitPaymentBtn, 'd-none')) {\n submitPaymentBtn.click();\n }\n }, 0);\n });\n\n queryFirst('#billingAddressSelector').addEventListener('change', () => {\n if (checkoutContainer.dataset.checkoutStage === 'payment') {\n clearForm(billingAddress.closest('form'));\n validateInputs(billingAddress);\n }\n });\n\n const addressLinks = queryAll('.billing-address-block .address-links a');\n\n addressLinks.forEach(link => {\n link.addEventListener('click', () => {\n clearForm(billingAddress.closest('form'));\n });\n });\n\n if (checkoutContainer.dataset.checkoutStage === 'payment') {\n $(() => {\n validateInputs(billingAddress);\n });\n }\n } else {\n const submitReauthBtn = queryFirst('.submit-payment-button', checkoutContainer);\n submitReauthBtn.addEventListener('click', function (event) {\n event.preventDefault();\n $.spinner().start();\n submitReauthBtn.disabled = true;\n updatePaymentValidation(true);\n if (billingForm.checkValidity && !billingForm.checkValidity()) {\n scrollToError(billingForm);\n submitReauthBtn.disabled = false;\n $.spinner().stop();\n event.stopPropagation();\n } else {\n billingForm.submit();\n }\n });\n }\n }\n },\n\n enableFormSubmitButton: function () {\n const formElements = queryAll('.enable-form-validate');\n const selectorContainer = $('.valid-password-info li');\n const notMatchedClass = 'pwd-criteria-not-matched';\n const matchedClass = 'pwd-criteria-matched';\n formElements.forEach(form => {\n const button = queryFirst('.enable-button-onvalidate', form);\n if (form && button) {\n const $form = $(form);\n const callback = function () {\n const isConfirmPassword = this.id === 'newPasswordConfirm';\n const isNewPassword = this.id === 'newPassword';\n const isConfirmRegistrationPassword = this.id === 'registration-form-password-confirm';\n const isRegistrationPassword = this.id === 'registration-form-password';\n let isPasswordMatched = true;\n let isValidForm = true;\n\n if (isConfirmPassword || isConfirmRegistrationPassword) {\n const passwordFieldId = isConfirmPassword ? '#newPassword' : '#registration-form-password';\n const confirmPasswordMatches = checkPasswordMatch(passwordFieldId, isPasswordMatched, isValidForm, this);\n isPasswordMatched = confirmPasswordMatches.isPasswordMatches;\n isValidForm = confirmPasswordMatches.isValidForms;\n }\n\n if (this.validity.valid && isValidForm) {\n removeClass(this, 'is-invalid');\n if (isNewPassword || isRegistrationPassword) {\n selectorContainer.removeClass(notMatchedClass);\n selectorContainer.addClass(matchedClass);\n }\n } else {\n const $this = $(this);\n const thisValue = $this.val();\n if ($form.hasClass('change-password-form') && (isNewPassword || isRegistrationPassword) && thisValue) {\n selectorContainer.each(function (i) {\n const item = selectorContainer[i];\n const regexPattern = item.dataset.regexpattern;\n const regexValue = new RegExp(regexPattern);\n if (regexValue.test(thisValue)) {\n removeClass(item, notMatchedClass);\n addClass(item, matchedClass);\n } else {\n removeClass(item, matchedClass);\n addClass(item, notMatchedClass);\n }\n })\n selectorContainer.closest('ul').addClass('padding-none');\n $this.parents('.form-group').find('.invalid-feedback').text('');\n } else {\n if (!isPasswordMatched) {\n $this.parents('.form-group').find('.invalid-feedback').text(this.dataset.mismatchError);\n addClass(this, 'is-invalid');\n } else {\n $this.parents('.form-group').find('.invalid-feedback').text(getValidationMessage.apply(this));\n }\n }\n }\n };\n $form.find('input, textarea').on('blur', callback);\n $form.find('#newPassword, #registration-form-password').on('keyup', callback);\n $form.find('select, input[type=\"radio\"], input[type=\"checkbox\"]').on('change', callback);\n $form.on('change', '.g-recaptcha-response', callback);\n }\n });\n },\n\n buttonClick: function () {\n $('form button[type=\"submit\"], form input[type=\"submit\"]').on('click', function () {\n // clear all errors when trying to submit the form\n if (!$('.reauth-payment-form').length) {\n clearForm($(this).parents('form'));\n }\n });\n },\n\n functions: {\n validateForm: function (form, event) {\n validateForm.call($(form), event || null);\n },\n validateInputs,\n clearForm,\n enableOrDisableButton\n }\n};\n","'use strict';\n\nconst { queryFirst, queryAll, addClass, removeClass, hasClass, debounce } = require('../domUtil');\n\nconst SCROLLABLE_CONTENT_SELECTOR = queryAll('.scrollable-content');\nconst LEFT_ARROW_SELECTOR = '.scroll-left-arrow';\nconst RIGHT_ARROW_SELECTOR = '.scroll-right-arrow';\n\nfunction initSpecificCarousel(scrollableContainerEl) {\n const parentEl = scrollableContainerEl.parentElement;\n\n // Attaching events on Left arrow click\n const leftArrowEl = queryFirst(LEFT_ARROW_SELECTOR, parentEl);\n if (leftArrowEl) {\n leftArrowEl.addEventListener('click', () => {\n scrollableContainerEl.scrollTo({\n left: Math.max(0, scrollableContainerEl.scrollLeft - scrollableContainerEl.offsetWidth),\n behavior: 'smooth'\n });\n });\n }\n\n // Attaching events on Right arrow click\n const rightArrowEl = queryFirst(RIGHT_ARROW_SELECTOR, parentEl);\n if (rightArrowEl) {\n rightArrowEl.addEventListener('click', () => {\n scrollableContainerEl.scrollTo({\n left: Math.min(scrollableContainerEl.scrollWidth, scrollableContainerEl.scrollLeft + scrollableContainerEl.offsetWidth),\n behavior: 'smooth'\n });\n });\n }\n\n // Hide left arrow on carousel initialization.\n addClass(leftArrowEl, 'hide');\n\n // Hide both the arrows, if the items are not scrollable.\n if (scrollableContainerEl.scrollWidth <= scrollableContainerEl.offsetWidth) {\n addClass(rightArrowEl, 'hide');\n } else {\n const callback = () => {\n const { scrollWidth, scrollLeft, offsetWidth } = scrollableContainerEl;\n const offsetValue = 5;\n if (scrollWidth - scrollLeft - offsetWidth < offsetValue) {\n // Hide the right arrow, if content is scrolled to right end.\n if (hasClass(leftArrowEl, 'hide')) {\n removeClass(leftArrowEl, 'hide');\n }\n if (!hasClass(rightArrowEl, 'hide')) {\n addClass(rightArrowEl, 'hide');\n }\n } else if (scrollLeft === 0) {\n // Hide the left arrow, if content is scrolled to left end.\n if (!hasClass(leftArrowEl, 'hide')) {\n addClass(leftArrowEl, 'hide');\n }\n if (hasClass(rightArrowEl, 'hide')) {\n removeClass(rightArrowEl, 'hide');\n }\n } else {\n // Display both the arrows, if content is scrolled neither of the ends.\n if (hasClass(leftArrowEl, 'hide')) {\n removeClass(leftArrowEl, 'hide');\n }\n if (hasClass(rightArrowEl, 'hide')) {\n removeClass(rightArrowEl, 'hide');\n }\n }\n };\n scrollableContainerEl.addEventListener('scroll', debounce(callback, 300));\n }\n}\n\nmodule.exports = {\n initCarousel: function() {\n SCROLLABLE_CONTENT_SELECTOR.forEach(scrollableContainerEl => {\n initSpecificCarousel(scrollableContainerEl);\n });\n },\n initSpecificCarousel: initSpecificCarousel\n};\n","/* global _etmc */\n'use strict';\n\nconst hasEtmc = typeof _etmc !== 'undefined';\n\n/**\n * Send trackCart event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function trackCart(data) {\n if (hasEtmc && 'trackCart' in _etmc) {\n _etmc.trackCart(data);\n }\n}\n\n/**\n * Send trackPageView event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function trackPageView(data) {\n if (hasEtmc && 'trackPageView' in _etmc) {\n _etmc.trackPageView(data);\n }\n}\n\n/**\n * Send trackWishlist event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function trackWishlist(data) {\n if (hasEtmc && 'trackWishlist' in _etmc) {\n _etmc.trackWishlist(data);\n }\n}\n\n/**\n * Send setUserInfo event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function setUserInfo(data) {\n if (hasEtmc && 'setUserInfo' in _etmc) {\n _etmc.setUserInfo(data);\n }\n}\n","'use strict';\n\nimport { queryFirst, queryAll, addClass, removeClass, remove, scrollTo, throttle } from '../domUtil';\n\nimport { initOnce, getNestedValue } from '../util';\n\nconst $window = $(window);\nconst $document = $(document);\nconst $body = $('body');\nconst activeClass = 'active';\n\nconst getOffsetTop = element => {\n let offsetTop = 0;\n while (element) {\n offsetTop += element.offsetTop;\n element = element.offsetParent;\n }\n return offsetTop;\n};\n\nconst handleDesktopCarousel = carousel => {\n let indicators = queryFirst('.image-slide-indicators', carousel);\n\n if (window.matchMedia('(min-width: 768px)').matches) {\n removeClass(carousel, 'slide');\n\n let slideItem = queryFirst('.slider-inner .slider-item:first-of-type', carousel);\n\n if (slideItem && indicators) {\n if (!slideItem.offsetHeight) {\n setTimeout(() => {\n slideItem = queryFirst('.slider-inner .slider-item:first-of-type', carousel);\n\n if (slideItem) {\n const slideIndicatorPosition = slideItem.offsetTop + (slideItem.offsetHeight - indicators.offsetHeight) / 2;\n\n indicators.style.top = slideIndicatorPosition + 'px';\n }\n }, 2400);\n } else {\n const slideIndicatorPosition = slideItem.offsetTop + (slideItem.offsetHeight - indicators.offsetHeight) / 2;\n\n indicators.style.top = slideIndicatorPosition + 'px';\n }\n }\n\n $(carousel).on('slide.bs.carousel', function (e) {\n e.preventDefault();\n\n const headerHeight = queryFirst('header.main-header').offsetHeight;\n\n scrollTo($(e.relatedTarget).offset().top - headerHeight);\n });\n } else {\n addClass(carousel, 'slide');\n\n if (indicators) {\n removeClass(indicators, 'position-fixed');\n indicators.style.top = '';\n }\n }\n};\n\nconst handleCarouselOnScroll = carousel => {\n let currentScrollPos = window.scrollY || window.pageYOffset;\n let ticking = false;\n\n const carouselIndicatorScroll = () => {\n ticking = false;\n if (window.matchMedia('(min-width: 768px)').matches) {\n const indicators = queryFirst('.image-slide-indicators', carousel);\n const sliderContainer = carousel.closest('.scrollable-product-item');\n const sliderContainerOffsetTop = getOffsetTop(sliderContainer);\n const sliderContainerOffsetEnd = sliderContainerOffsetTop + sliderContainer.offsetHeight - queryFirst('.slider-item', carousel).offsetHeight + indicators.offsetHeight / 2;\n if (sliderContainerOffsetTop < currentScrollPos && sliderContainerOffsetEnd >= currentScrollPos) {\n addClass(indicators, 'position-fixed');\n } else {\n removeClass(indicators, 'position-fixed');\n }\n\n const scrollDistance = -sliderContainer.getBoundingClientRect().top + 200;\n\n let activeIndex = 1;\n queryAll('.slider-item', carousel).some((el, i) => {\n if (el.offsetTop < scrollDistance && scrollDistance < el.offsetTop + el.offsetHeight) {\n activeIndex = i + 1;\n return true;\n }\n return false;\n });\n removeClass(queryAll('.slider-item', carousel), activeClass);\n removeClass(queryAll('.image-slide-indicators li', carousel), activeClass);\n addClass(queryFirst('.image-slide-indicators li:nth-child(' + activeIndex + ')', carousel), activeClass);\n addClass(queryFirst('.slider-item:nth-child(' + activeIndex + ')', carousel), activeClass);\n }\n };\n const requestTick = () => {\n if (!ticking) {\n requestAnimationFrame(carouselIndicatorScroll);\n }\n ticking = true;\n };\n const onScroll = () => {\n currentScrollPos = window.scrollY || window.pageYOffset;\n requestTick(carousel);\n };\n $window.scroll(onScroll);\n};\n\nconst initScrollSlider = carousels => {\n if (!Array.isArray(carousels)) {\n const array = [].slice.call(carousels, 0);\n carousels = array.length ? array : [carousels];\n }\n\n carousels.forEach(carousel => {\n if (queryFirst('.carousel-indicators', carousel)) {\n handleDesktopCarousel(carousel);\n }\n\n initOnce(\n carousel,\n undefined,\n () => {\n if (queryFirst('.carousel-indicators', carousel)) {\n handleCarouselOnScroll(carousel);\n }\n },\n 'scrollSlider'\n );\n });\n};\n\n$document.ready(function () {\n $('.carousel').each(function () {\n // Initilize carousel and stop swipe propagations only if slides count is more than 1\n if ($(this).find('.carousel-inner').length > 1) {\n $(this).carousel();\n }\n });\n if (window.matchMedia('(min-width: 768px)').matches) {\n $('.scrollable-product-item:not(.grid-product) .primary-images .carousel').carousel('dispose');\n }\n initScrollSlider(queryAll('.scrollable-product-item:not(.grid-product) .carousel'));\n\n $body.on('product:imageLoad', (e, response) => {\n let carousel = queryFirst('.carousel', response.container);\n const isScrollableProductItem = carousel && $(carousel).closest('.scrollable-product-item:not(.grid-product)').length;\n\n if (isScrollableProductItem) {\n let carouselIndicatorsElement = queryFirst('.carousel-indicators', carousel);\n if (carouselIndicatorsElement) {\n addClass(carouselIndicatorsElement, 'image-slide-indicators');\n addClass(queryFirst('.carousel-inner', carousel), 'slider-inner');\n addClass(queryAll('.carousel-item', carousel), 'slider-item');\n remove(queryAll('.carousel > a'));\n initScrollSlider(carousel);\n }\n }\n });\n});\n\n$window.resize(\n throttle(() => {\n initScrollSlider(queryAll('.scrollable-product-item:not(.grid-product) .carousel'));\n const pdpCarouselEl = queryFirst('.pdp-container .carousel.image-slider');\n if (pdpCarouselEl) {\n pdpCarouselEl.style.minHeight = '';\n }\n })\n);\n\n/**\n * Fixes a bug in Safari 15 where swiping on images is very difficult\n * due to safari being overly sensitive to diagonal scrolling\n * Solution adapted from: http://web.archive.org/web/20220415194859/https://wpdevdesign.com/fixing-flickitys-issue-with-ios15-safari/\n */\nfunction initCarouselSwipeListener() {\n let isTouchingCarousel = false;\n let startCoord;\n\n document.addEventListener('touchstart', e => {\n isTouchingCarousel = !!e.target.closest('.carousel.image-slider');\n startCoord = getNestedValue(e, 'touches[0].pageX');\n });\n\n document.addEventListener('touchmove', e => {\n const currentCoord = getNestedValue(e, 'touches[0].pageX');\n const coordsAreNumbers = typeof startCoord === 'number' && typeof currentCoord === 'number';\n\n // don't do anything if the user isn't touching the carousel,\n // if the event isn't cancelable,\n // or if the user didn't scroll enough in the x direction (i.e. is scrolling vertically)\n if (!isTouchingCarousel || !e.cancelable || (coordsAreNumbers && Math.abs(currentCoord - startCoord) < 16)) {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n }, { passive: false });\n}\n\ninitCarouselSwipeListener();","'use strict';\n\nconst { queryFirst } = require('../domUtil');\nconst { NOT_AVAILABLE_STATUS, PREORDER_STATUS } = require('../constants');\nconst { PDPNarvarEDD } = window.lillyUtils;\nconst isEDDEnabled = !!PDPNarvarEDD;\n\nconst EDD_INFO_SELECTOR = '.narvar-edd-info';\n\n/**\n * Function to inject Estimated delivery date message into its container\n * @param {HTMLElement} productContainerEl - Product container element\n */\nfunction injectEDDInfo(productContainerEl) {\n if (!isEDDEnabled || !productContainerEl) return;\n\n const eddEl = queryFirst(EDD_INFO_SELECTOR, productContainerEl);\n if (eddEl) eddEl.innerHTML = PDPNarvarEDD.estimatedDeliveryTime;\n}\n\n/**\n * Function to remove Estimated delivery date message from its container\n * @param {HTMLElement} productContainerEl - Product container element\n */\nfunction removeEDDInfo(productContainerEl) {\n if (!isEDDEnabled || !productContainerEl) return;\n\n const eddEl = queryFirst(EDD_INFO_SELECTOR, productContainerEl);\n if (eddEl) eddEl.textContent = '';\n}\n\n/**\n * Function to check if Estimated delivery messages to be displayed or not for that variant\n * @param {string} availabilityStatus - Product container element\n * @return {boolean} - if EDD is applicable for a variant, it returns true, else returns false\n */\nfunction isEDDApplicable(availabilityStatus) {\n return (availabilityStatus !== PREORDER_STATUS && availabilityStatus !== NOT_AVAILABLE_STATUS);\n}\n\nmodule.exports = {\n isEDDApplicable,\n injectEDDInfo,\n removeEDDInfo\n};\n","import { getISOCodeByLocale } from './util';\nconst { queryFirst, addClass, scrollTo } = require('lilly/domUtil');\nconst { errorTextTemplate } = require('lilly/templates');\nconst showClass = 'show';\n\n/**\n * making an ajax call to sfcc backend to clear bolt account data\n */\nasync function logout(e, customerEmail) {\n const boltPublishableKey = queryFirst('.bolt-publishable-key').value;\n const locale = queryFirst('.bolt-locale').value;\n\n const boltEmbedded = Bolt(boltPublishableKey, {\n language: getISOCodeByLocale(locale)\n });\n await boltEmbedded.helpers.logout();\n const url = queryFirst('.data-bolt-platform-side-logout-url').value;\n $.spinner().start();\n\n let requestObj = {\n url: url,\n method: 'POST',\n success: function (data) {\n if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON.message) {\n const errorElement = queryFirst('.error-message');\n errorElement.innerHTML = errorTextTemplate(err.responseJSON.message);\n addClass(errorElement, showClass);\n scrollTo(0);\n }\n $.spinner().stop();\n }\n };\n\n // add customerEmail to request to set it in Basket\n if (customerEmail) requestObj.data = { customerEmail: customerEmail };\n\n $.ajax(requestObj);\n}\n\nexport { logout };\n","import { EventAccountRecognitionCheckPerformed } from './constant.js';\nimport { logout as autoLogout } from './boltHelpers.js';\nimport { getISOCodeByLocale } from './util.js';\nimport { HIDDEN_CLASS } from 'lilly/constants';\n\nconst { removeClass, queryFirst, addClass } = require('lilly/domUtil');\n\n/**\n * Log the user into their bolt account\n * @param {string} email - input email\n * @returns {Promise} The returned promise to fetch account details\n */\nasync function login(email) {\n const loginModal = Bolt.create('login_modal', {\n autoDetectEmail: false\n });\n\n loginModal.attemptLogin({\n email\n }).then((authorizeResp) => {\n return authorizeCustomer(authorizeResp, email);\n });\n\n}\n\nexport async function authorizeCustomer(authorizeResp, email) {\n if (!authorizeResp || authorizeResp instanceof Error) {\n // If the user closed the OTP modal then change the payment method to CREDIT_CARD if it is BOLT_PAY \n const checkoutContainer = queryFirst('.data-checkout-stage');\n\n if (checkoutContainer && ($('.payment-information').attr('data-payment-method-id') === 'BOLT_PAY')) {\n const creditCardContent = queryFirst('.credit-card-content');\n creditCardContent.id = 'credit-card-content';\n queryFirst('[data-method-id=\"CREDIT_CARD\"] a').click();\n removeClass(queryFirst('.credit-card-tab-list'), 'payment-options-hide');\n addClass(queryFirst('.bolt-pay-tab-list'), HIDDEN_CLASS);\n }\n\n // trigger only in case if OTP modal was closed \n if (email) $('body').trigger('bolt:closeOtpModal');\n\n return;\n }\n\n const OAuthResp = await authenticateUserWithCode(\n authorizeResp.authorizationCode,\n authorizeResp.scope\n );\n\n return getAccountDetails(OAuthResp.accessToken); // eslint-disable-line consistent-return\n}\n\n/**\n * This function uses the authCode and scope returned from authorizeWithEmail\n * after the user enters the 6 digits OTP code\n * It makes a call to Bolt-FetchOAuthToken controller to fetch Oauth token & refresh token\n * @param {string} authCode - auth Code\n * @param {string} scope - scope, both params are returned from authorizeWithEmail\n * @returns {Object} - an Ajax call to fetch oAuth token\n */\nfunction authenticateUserWithCode(authCode, scope) {\n const authenticateUserUrl = $('.authenticate-bolt-user').val();\n const reqBody = {\n code: authCode,\n scope: scope\n };\n return $.ajax({\n url: authenticateUserUrl,\n method: 'GET',\n data: reqBody,\n error: function (jqXHR, error) {\n console.log(error);\n }\n });\n}\n\n/**\n * Get Account Details.\n * This function passes the Oauth token to bolt and retrieve the account details of a shopper\n * @param {string} oAuthToken - oAuth Token\n * @returns {Object} - an ajax call to fetch account details\n */\nfunction getAccountDetails(oAuthToken) {\n const accountDetailUrl = $('.get-bolt-account-details').val();\n const reqBody = {\n bearerToken: oAuthToken\n };\n $.spinner().start();\n return $.ajax({\n url: accountDetailUrl,\n method: 'GET',\n data: reqBody,\n success: function (data) {\n $('body').trigger('bolt:proceedOtpModal');\n //Remove the bolt logout cookie\n document.cookie = 'bolt_sfcc_session_logout=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';\n window.location.href = data.redirectUrl;\n },\n error: function (jqXHR, error) {\n $.spinner().stop();\n console.log(error);\n }\n });\n}\n\n/**\n * Check Account And Fetch Detail\n * This function makes a call to bolt backend with the user email,\n * and log the user into their bolt account if the user has one\n * at the end of the login flow we redirect the user to the final page\n * where they can click place order so this function\n * doesn't return anything\n * @returns {void}\n */\nexport function checkAccountAndFetchDetail() {\n const emailInput = $('#email-guest');\n const customerEmail = emailInput.val();\n const checkBoltAccountUrl = $('.check-bolt-account-exist').val() + '=' + encodeURIComponent(customerEmail);\n const $accountCheckbox = $('#acct-checkbox');\n const $boltCheckboxInfo = $('#acc-checkbox-info');\n const boltCheckbox = queryFirst('#bolt-acct-check');\n const boltPublishableKey = queryFirst('.bolt-publishable-key').value;\n if ($accountCheckbox) {\n $accountCheckbox.show();\n $boltCheckboxInfo.show();\n }\n $.spinner().start();\n $.ajax({\n url: checkBoltAccountUrl,\n headers: { \"X-Publishable-Key\": boltPublishableKey },\n method: 'GET',\n success(data) {\n if (!data) return;\n\n if (data.has_bolt_account) {\n const localeEl = queryFirst('.bolt-locale');\n const locale = localeEl?.value || '';\n const boltKeyEl = queryFirst('.bolt-publishable-key');\n const boltKey = boltKeyEl?.value || '';\n Bolt(boltKey, { language: getISOCodeByLocale(locale) });\n login(customerEmail);\n if ($accountCheckbox) {\n $accountCheckbox.hide();\n $boltCheckboxInfo.hide();\n if (boltCheckbox) {\n boltCheckbox.checked = false;\n $(boltCheckbox).trigger('change');\n }\n }\n } else {\n const boltCheckboxContainer = queryFirst('#acct-checkbox');\n const isBoltUserLoggedIn = queryFirst('.bolt-is-shopper-logged-in');\n\n if (boltCheckboxContainer) {\n $('body').trigger('bolt:createAccountCheckbox');\n if (boltCheckbox) {\n boltCheckbox.checked = true;\n $(boltCheckbox).trigger('change');\n }\n\n } else if (isBoltUserLoggedIn && isBoltUserLoggedIn.value === 'true') {\n // sign out of a Bolt customer automatically if it is not a Bolt account\n autoLogout(false, customerEmail);\n }\n $('.submit-customer').removeAttr('disabled'); // enable checkout button for non Bolt shopper\n }\n $.spinner().stop();\n window.BoltAnalytics.checkoutStepComplete(EventAccountRecognitionCheckPerformed, { hasBoltAccount: data.has_bolt_account, detectionMethod: 'email' });\n },\n error: function (jqXHR, error) {\n $.spinner().stop();\n console.log(error);\n }\n });\n}\n\n/**\n * making an ajax call to sfcc backend to clear bolt account data\n */\nexport function logout() {\n const url = $('.data-bolt-platform-side-logout-url').val();\n $.ajax({\n url: url,\n method: 'POST',\n success: function (data) {\n if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.message) {\n $('.error-message').show();\n $('.error-message-text').text(err.responseJSON.message);\n }\n }\n });\n}\n\n/**\n * Get cookie from browser\n * @param {string} cookieName - cookie name\n * @returns {string} cookie value\n */\nexport function getCookie(cookieName) {\n let name = cookieName + '=';\n let decodedCookie = decodeURIComponent(document.cookie);\n let ca = decodedCookie.split(';');\n for (let i = 0; i < ca.length; i++) { // eslint-disable-line no-plusplus\n let c = ca[i];\n while (c.charAt(0) === ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) === 0) {\n return c.substring(name.length, c.length);\n }\n }\n return '';\n}\n","/**\n * OOTB SFRA JS code\n */\n\nimport base from '../product/base';\nimport { queryFirst, addClass, removeClass, queryAll, remove, emptyCart, hasClass, scrollTo, throttle } from '../domUtil';\nimport { appendToUrl, getJSON, formatMessage, getNestedValue } from '../util';\nimport { trackCart } from '../components/etmc';\nimport { HIDDEN_CLASS, INVALID_CLASS } from '../constants';\nimport { checkAccountAndFetchDetail } from 'bolt/bolt/account';\nconst { cart: cartTemplates, approachingDiscounts: approachingDiscountsTemplates, promo: promoTemplates, emptySFL: emptySFLTemplates } = require('../templates');\nconst checkoutContainer = queryFirst('.data-checkout-stage');\nconst formValidation = require('base/components/formValidation');\nconst displayFlex = 'd-flex';\nconst selectedTabClass = 'sfl-tabs-selected';\nconst $body = $('body');\nconst loyaltyVoucherApplied = 'applied-reward-bg';\nconst lpRegisteredUserEmailEl = queryFirst('.registered-user-email');\nconst lpRegisteredUserEmail = lpRegisteredUserEmailEl ? lpRegisteredUserEmailEl.value : '';\nconst boltCheckoutAccountExistEl = queryFirst('.check-bolt-account-exist');\n\n/**\n * Displays cart error message\n * @param {string} message - Error message to display\n */\nfunction createErrorNotification(message) {\n const errorHtml = formatMessage(cartTemplates.errorMessage, message);\n $('.cart-container .cart-error')\n .empty()\n .append(errorHtml);\n}\n\n/**\n * Update the GWP HTML if contained in an ajax response\n * @param {Object} data The response data from an ajax call containing a 'gwpProductsHtml' attribute\n * @param {string} data.gwpProductsHtml The GWP HTML to insert\n */\nfunction updateGWP(data) {\n if ('gwpProductsHtml' in data) {\n $('.gwp-container-js, #checkout-main .gwp-container').html(data.gwpProductsHtml);\n }\n}\n\n/**\n * enable or disables the checkout button\n */\nfunction enableOrDisableCheckoutButton() {\n const checkoutButtonElement = queryFirst('.checkout-btn');\n\n if (!checkoutButtonElement) return;\n\n const expressCheckoutSection = queryFirst('.express-checkout-actions');\n const gwpProductsLength = queryAll('.gwp-option-bonus.product-info').length;\n const errorMessage = queryFirst('.cart-container .cart-error .cart-error-message');\n const cartWithSFLElement = queryFirst('.js-cart-container .js-cart-with-items');\n const oosProduct = queryFirst('.line-item-attributes.out-of-stock', (cartWithSFLElement || document));\n const chooseGwpMessage = queryFirst('.gwp-message');\n const monogramRestrictionLength = queryAll('.js-monogram-restriction').length;\n const numLowInventoryWarnings = queryAll('.low-inventory-warning').length;\n\n if (gwpProductsLength || errorMessage || oosProduct || monogramRestrictionLength || numLowInventoryWarnings) {\n addClass(checkoutButtonElement, 'disabled');\n checkoutButtonElement.removeAttribute('href');\n addClass(expressCheckoutSection, HIDDEN_CLASS);\n } else {\n removeClass(checkoutButtonElement, 'disabled');\n checkoutButtonElement.setAttribute('href', checkoutButtonElement.dataset.href);\n const grandTotalVal = queryFirst('.grand-total-value.grand-total');\n const cartPage = queryFirst('.cart-page');\n\n if (grandTotalVal && cartPage && grandTotalVal.textContent === cartPage.dataset.zeroTotal) {\n addClass(expressCheckoutSection, HIDDEN_CLASS);\n } else {\n removeClass(expressCheckoutSection, HIDDEN_CLASS);\n }\n }\n\n if (chooseGwpMessage) {\n if (gwpProductsLength && !errorMessage) {\n removeClass(chooseGwpMessage, HIDDEN_CLASS);\n } else {\n addClass(chooseGwpMessage, HIDDEN_CLASS);\n }\n }\n\n if (!hasClass(checkoutButtonElement, 'disabled')) {\n const boltCheckoutCtaEl = queryFirst('.bolt-checkout-wrapper');\n const { isBoltEnable, isBoltUserLoggedIn } = checkoutButtonElement.dataset;\n\n addClass(boltCheckoutCtaEl, HIDDEN_CLASS);\n\n if (isBoltEnable === 'true' && isBoltUserLoggedIn !== 'true' && lpRegisteredUserEmail && boltCheckoutAccountExistEl) {\n const checkBoltAccountUrl = boltCheckoutAccountExistEl.value + '=' + encodeURIComponent(lpRegisteredUserEmail);\n $.ajax({\n url: checkBoltAccountUrl,\n method: 'GET',\n success(data) {\n if (data && data.has_bolt_account) {\n removeClass(boltCheckoutCtaEl, HIDDEN_CLASS);\n }\n },\n error: function () { }\n });\n }\n }\n}\n\n/**\n * Checks whether the basket is valid. if invalid displays error message and disables\n * checkout button\n * @param {Object} data - AJAX response from the server\n */\nfunction validateBasket(data) {\n if (data.valid.error) {\n if (data.valid.message) {\n createErrorNotification(data.valid.message);\n } else {\n emptyCart(data.resources.emptyCartMsg);\n $('.number-of-items').empty();\n $('.minicart-quantity')\n .empty()\n .append(data.numItems);\n $('.minicart .popover').empty();\n $('.minicart .popover').removeClass('show');\n }\n } else {\n const cartErrors = queryFirst('.cart-container .cart-error');\n if (cartErrors) {\n cartErrors.textContent = '';\n }\n }\n $('.minicart-link').attr({\n 'aria-label': data.resources.minicartCountOfItems,\n title: data.resources.minicartCountOfItems\n });\n\n const couponErrorMessage = queryFirst('.coupon-error-message');\n if (couponErrorMessage) {\n couponErrorMessage.textContent = '';\n }\n enableOrDisableCheckoutButton();\n}\n\n/**\n * re-renders the order totals and the number of items in the cart\n * @param {Object} data - AJAX response from the server\n */\nfunction updateCartTotals(data) {\n const { giftWrapQuantity, giftWrapTotalPrice, totals, giftWrapISPUTotalPrice, giftWrapISPUQuantity, numItems } = data;\n const giftWrapContainer = queryFirst('.gift-wrap-container');\n const giftWrapISPUContainer = queryFirst('.gift-wrap-ispu-container');\n const nonCouponContainer = queryFirst('.non-coupon-price-container');\n if (giftWrapContainer) {\n if (giftWrapQuantity > 0) {\n queryFirst('.gift-wrap-quantity', giftWrapContainer).textContent = giftWrapQuantity.toString();\n queryFirst('.gift-wrap-price', giftWrapContainer).textContent = giftWrapTotalPrice.toString();\n if (!hasClass(giftWrapContainer, displayFlex)) {\n removeClass(giftWrapContainer, HIDDEN_CLASS);\n addClass(giftWrapContainer, displayFlex);\n }\n } else {\n removeClass(giftWrapContainer, displayFlex);\n addClass(giftWrapContainer, HIDDEN_CLASS);\n }\n }\n if (giftWrapISPUContainer) {\n if (giftWrapISPUQuantity > 0) {\n const { freeprice } = giftWrapISPUContainer.dataset;\n queryFirst('.gift-wrap-ispu-quantity', giftWrapISPUContainer).textContent = giftWrapISPUQuantity.toString();\n queryFirst('.gift-wrap-ispu-price', giftWrapISPUContainer).textContent = giftWrapISPUTotalPrice.totalPrice == 0 ? freeprice : giftWrapISPUTotalPrice.formattedPrice.toString();\n if (!hasClass(giftWrapISPUContainer, displayFlex)) {\n removeClass(giftWrapISPUContainer, HIDDEN_CLASS);\n addClass(giftWrapISPUContainer, displayFlex);\n }\n } else {\n removeClass(giftWrapISPUContainer, displayFlex);\n addClass(giftWrapISPUContainer, HIDDEN_CLASS);\n }\n }\n const cartWithSFLCountTotal = queryFirst('.cart-items-count .item-count-tote');\n if (cartWithSFLCountTotal) {\n cartWithSFLCountTotal.textContent = numItems;\n }\n $('.number-of-items')\n .empty()\n .append(data.resources.numberOfItems);\n $('.grand-total')\n .empty()\n .append(data.totals.subTotal);\n $('.sub-total')\n .empty()\n .append(data.totals.totalAmount);\n $('.tax-total')\n .empty()\n .append(data.totals.totalTax);\n $('.minicart-quantity')\n .empty()\n .append(data.numItems);\n if (data.totals.orderLevelDiscountTotal.value > 0) {\n $('.order-discount').removeClass('hide-order-discount');\n $('.order-discount-total')\n .empty()\n .append('- ' + data.totals.orderLevelDiscountTotal.formatted);\n } else {\n $('.order-discount').addClass('hide-order-discount');\n }\n\n const cartErrors = queryAll('.cart-error');\n if (!data.valid.error) {\n addClass(cartErrors, HIDDEN_CLASS);\n } else {\n removeClass(cartErrors, HIDDEN_CLASS);\n }\n\n if (nonCouponContainer) {\n let nonCouponPromotionsHTML = '';\n if (totals.nonCouponBasedAdjustments && totals.nonCouponBasedAdjustments.length) {\n totals.nonCouponBasedAdjustments.forEach(function (couponItem) {\n nonCouponPromotionsHTML += formatMessage(approachingDiscountsTemplates.nonCouponBasedAdjustmentTemplate, couponItem.promoTitle, couponItem.discountPrice, couponItem.callOutMsg);\n });\n }\n nonCouponContainer.innerHTML = nonCouponPromotionsHTML;\n }\n\n data.items.forEach(function (item) {\n if (item.renderedPromotions) {\n $('.item-' + item.UUID)\n .empty()\n .append(item.renderedPromotions);\n }\n if (item.priceTotal && item.priceTotal.renderedPrice) {\n $('.item-total-' + item.UUID)\n .empty()\n .append(item.priceTotal.renderedPrice);\n }\n });\n}\n\n/**\n * re-renders the approaching discount messages\n * @param {Object} approachingDiscounts - updated approaching discounts for the cart\n * @param {Object} approachingDiscountsLabels - Approaching discount label description (contains show more / show less)\n */\nfunction updateApproachingDiscounts(approachingDiscounts, approachingDiscountsLabels) {\n let $approachingDiscountsEl = $('.approaching-discounts');\n if ((approachingDiscounts || []).length) {\n let html = '';\n let item = null;\n if (!$approachingDiscountsEl.length) {\n $('.discounts-section').append(approachingDiscountsTemplates.discountContainerTemplate);\n $approachingDiscountsEl = $('.approaching-discounts');\n } else {\n $approachingDiscountsEl.empty();\n }\n if (approachingDiscounts.length === 1) {\n item = approachingDiscounts[0].discountMsg;\n html += formatMessage(approachingDiscountsTemplates.singleDiscountTemplate, item);\n $approachingDiscountsEl.removeClass('multiple-approaching-discounts');\n } else if (approachingDiscounts.length > 1 && approachingDiscountsLabels) {\n item = approachingDiscounts[0].discountMsg;\n html += formatMessage(approachingDiscountsTemplates.singleDiscountTemplate, item);\n const remainingDiscounts = approachingDiscounts.slice(1, approachingDiscounts.length);\n let remainingDiscountsHtml = '';\n remainingDiscounts.forEach(function (discount) {\n remainingDiscountsHtml += formatMessage(approachingDiscountsTemplates.singleDiscountTemplate, discount.discountMsg);\n });\n html += formatMessage(approachingDiscountsTemplates.multipleDiscountsTemplate, remainingDiscountsHtml, approachingDiscountsLabels.showMore, approachingDiscountsLabels.showLess);\n $approachingDiscountsEl.addClass('multiple-approaching-discounts');\n }\n $approachingDiscountsEl.append(html);\n } else {\n $approachingDiscountsEl.remove();\n }\n}\n\n/**\n * Updates the availability of a product line item\n * @param {Object} data - AJAX response from the server\n * @param {string} uuid - The uuid of the product line item to update\n */\nfunction updateAvailability(data, uuid) {\n var lineItem;\n var messages = '';\n\n for (var i = 0; i < data.items.length; i++) {\n if (data.items[i].UUID === uuid) {\n lineItem = data.items[i];\n break;\n }\n }\n\n $('.availability-' + lineItem.UUID).empty();\n\n if (lineItem.availability) {\n if (lineItem.availability.messages) {\n lineItem.availability.messages.forEach(function (message) {\n messages += `

${message}

`;\n });\n }\n }\n\n $('.availability-' + lineItem.UUID).html(messages);\n}\n\n/**\n * Finds an element in the array that matches search parameter\n * @param {array} array - array of items to search\n * @param {function} match - function that takes an element and returns a boolean indicating if the match is made\n * @returns {Object|null} - returns an element of the array that matched the query.\n */\nfunction findItem(array, match) {\n for (var i = 0, l = array.length; i < l; i++) {\n if (match.call(this, array[i])) {\n return array[i];\n }\n }\n return null;\n}\n\n/**\n * Updates details of a product line item\n * @param {Object} data - AJAX response from the server\n * @param {string} uuid - The uuid of the product line item to update\n * @param {boolean} giftWrapAvailable - flag to check gift wrap applicability\n */\nfunction updateProductDetails(data, uuid, giftWrapAvailable) {\n var lineItem = findItem(data.cartModel.items, function (item) {\n return item.UUID === uuid;\n });\n\n if (lineItem.variationAttributes) {\n var colorAttr = findItem(lineItem.variationAttributes, function (attr) {\n return attr.attributeId === 'color';\n });\n\n if (colorAttr) {\n var colorSelector = '.Color-' + uuid;\n $(colorSelector)\n .find('.line-item-text')\n .text(colorAttr.displayValue);\n }\n\n var sizeAttr = findItem(lineItem.variationAttributes, function (attr) {\n return attr.attributeId === 'size';\n });\n\n if (sizeAttr) {\n var sizeSelector = '.Size-' + uuid;\n $(sizeSelector)\n .find('.line-item-text')\n .text(sizeAttr.displayValue);\n }\n\n const { newProductId } = data || {};\n if (newProductId) {\n const skuElement = queryFirst(`.sku-${uuid}`);\n const skuLabel = skuElement && skuElement.dataset.skuLabel;\n\n if (skuElement && skuLabel) {\n skuElement.textContent = `${skuLabel} ${newProductId}`;\n }\n }\n\n var imageSelector = '.card.product-info.uuid-' + uuid + ' .item-image > img';\n $(imageSelector).attr('src', lineItem.images.small[0].url);\n $(imageSelector).attr('srcset', lineItem.images.small[0].srcset);\n $(imageSelector).attr('alt', lineItem.images.small[0].alt);\n $(imageSelector).attr('title', lineItem.images.small[0].title);\n }\n\n if (lineItem.options && lineItem.options.length) {\n var option = lineItem.options[0];\n var optSelector = '.lineItem-options-values[data-option-id=\"' + option.optionId + '\"]';\n $(optSelector).attr('data-value-id', option.selectedValueId);\n $(optSelector + ' .line-item-attributes').text(option.displayName);\n }\n\n var qtySelector = '.quantity[data-uuid=\"' + uuid + '\"]';\n $(qtySelector).val(lineItem.quantity);\n $(qtySelector).data('pid', data.newProductId);\n\n $('.remove-product[data-uuid=\"' + uuid + '\"], .move-to-wishlist-' + uuid + ' a, .gift-wrap-input[data-uuid=\"' + uuid + '\"], .btn-in-store-pickup[data-uuid=\"' + uuid + '\"], .home-delivery-link[data-uuid=\"' + uuid + '\"], .quantity[data-uuid=\"' + uuid + '\"], .cart-product-line-item[data-uuid=\"' + uuid + '\"]').attr(\n 'data-pid',\n data.newProductId\n );\n const cartStoreLinksSelector = '.product-info.uuid-' + uuid + ' .cart-store-links';\n if (giftWrapAvailable === 'false') {\n $('.gift-wrap-input[data-uuid=\"' + uuid + '\"]').prop('checked', false);\n $(cartStoreLinksSelector + ' form').addClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').addClass(HIDDEN_CLASS);\n } else if ($(cartStoreLinksSelector).closest('.cart-pickup-products').length === 0) {\n $(cartStoreLinksSelector + ' form').removeClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').removeClass(HIDDEN_CLASS);\n }\n\n var priceSelector = '.line-item-price-' + uuid + ' .sales .value';\n $(priceSelector).text(lineItem.price.sales.formatted);\n $(priceSelector).attr('content', lineItem.price.sales.decimalPrice);\n\n if (lineItem.price.list) {\n var listPriceSelector = '.line-item-price-' + uuid + ' .list .value';\n $(listPriceSelector).text(lineItem.price.list.formatted);\n $(listPriceSelector).attr('content', lineItem.price.list.decimalPrice);\n }\n\n if (lineItem.isGiftCard) {\n const { giftCardAmount } = lineItem;\n\n const giftCardHiddenAmountField = queryFirst(`.product-info.uuid-${uuid} .gift-card-amount`);\n if (giftCardHiddenAmountField) {\n giftCardHiddenAmountField.value = giftCardAmount;\n }\n\n queryAll(`.move-to-wishlist-${uuid} .move`).forEach(el => {\n el.dataset.giftCardAmount = giftCardAmount;\n });\n queryFirst(`.remove-product-${uuid}`).dataset.giftCardAmount = giftCardAmount;\n }\n}\n\n/**\n * This method sets the data of line item to be deleted in the delete confirmation modal\n * @param {string} actionUrl - url to be used to remove product\n * @param {string} productID - pid\n * @param {string} productName - product name\n * @param {string} uuid - uuid\n */\nfunction confirmDelete(actionUrl, productID, productName, uuid, tealium = '{}') {\n const deleteConfirmBtn = queryFirst('.cart-page .cart-delete-confirmation-btn');\n deleteConfirmBtn.dataset.pid = productID;\n deleteConfirmBtn.dataset.action = actionUrl;\n deleteConfirmBtn.dataset.uuid = uuid;\n deleteConfirmBtn.dataset.name = productName;\n deleteConfirmBtn.dataset.tealium = tealium;\n}\n\n/**\n * Lilly Customization changes start\n */\n\n/**\n * Update promo code details\n * @param {array} discounts - updated discounts data\n * @param {Object} shippingMethod - Shipping method detail object\n */\nfunction updatePromoCodeDetails(discounts, shippingMethod) {\n const promotionsListContainer = queryFirst('.promo-code-section');\n const cartShippingMethodContainer = queryFirst('.cart-shipping-method');\n const checkoutShippingMethodContainer = queryFirst('.shipping-method-price-container');\n const checkoutShippingMethodTitle = queryFirst('.shipping-method-title');\n let promotionsHtml = '';\n if (discounts && discounts.length) {\n const promoTemplate = document.getElementById('promo-code-details-template').cloneNode(true);\n const promoContainer = queryFirst('.price-container', promoTemplate);\n const promoText = queryFirst('.price-text', promoContainer);\n const promoTitle = promoText.dataset.promoTitle;\n const promoValue = queryFirst('.price-value', promoContainer);\n const description = queryFirst('.promo-description', promoContainer);\n discounts.forEach(eachDiscount => {\n if (eachDiscount.type === 'coupon' && eachDiscount.applied) {\n const couponData = eachDiscount.relationship;\n promoText.textContent = `${promoTitle} ${eachDiscount.couponCode}`;\n if (couponData && couponData.length) {\n promoValue.textContent = eachDiscount.totalPrice;\n description.textContent = couponData[0].name;\n } else {\n promoValue.textContent = '';\n description.textContent = '';\n }\n promotionsHtml += promoTemplate.innerHTML;\n }\n });\n if (cartShippingMethodContainer) {\n if (shippingMethod && shippingMethod.isDiscounted) {\n cartShippingMethodContainer.innerHTML = formatMessage(promoTemplates.shippingMethod, shippingMethod.shippingLabel, shippingMethod.displayName, shippingMethod.shippingCost, shippingMethod.estimatedArrivalTime);\n } else {\n cartShippingMethodContainer.innerHTML = '';\n }\n }\n\n if (checkoutShippingMethodContainer) {\n if (shippingMethod && shippingMethod.isDiscounted) {\n checkoutShippingMethodContainer.innerHTML = formatMessage(promoTemplates.checkoutDiscountShipping, shippingMethod.shippingCost, shippingMethod.adjustedShippingCost);\n } else {\n checkoutShippingMethodContainer.innerHTML = formatMessage(promoTemplates.checkoutNormalShipping, shippingMethod.shippingCost);\n }\n }\n } else if (cartShippingMethodContainer) {\n cartShippingMethodContainer.innerHTML = '';\n } else if (checkoutShippingMethodContainer) {\n checkoutShippingMethodContainer.innerHTML = formatMessage(promoTemplates.checkoutNormalShipping, shippingMethod.shippingCost);\n }\n if (checkoutShippingMethodTitle) {\n checkoutShippingMethodTitle.innerHTML = shippingMethod.displayName;\n }\n if (promotionsListContainer) {\n promotionsListContainer.innerHTML = promotionsHtml;\n }\n}\n\n/**\n * This function updates Form Object for Gift card values\n * @param {Object} formObject - object to edit to add gift card amount\n * @param {HTMLElement} formEl - form node to fetch gift card amount\n */\nfunction updateFormObjectForGiftCard(formObject, formEl) {\n const amountField = queryFirst('.gift-card-amount', formEl);\n\n if (amountField) {\n formObject.giftCardAmount = amountField.value;\n }\n}\n\n/**\n * updates the monogram elements on cart page\n * @param {Object} data - update quantity and remove from cart ajax response\n */\nfunction updateMonogramDetails(data) {\n const { monogramPrice, monogramQuantity } = data;\n const monogramContainer = queryFirst('.cart-totals .monogram-container');\n if (monogramContainer) {\n queryFirst('.price-value', monogramContainer).textContent = monogramPrice;\n\n queryFirst('.monogram-quantity', monogramContainer).textContent = monogramQuantity;\n if (!monogramQuantity) {\n addClass(monogramContainer, 'd-none');\n } else {\n removeClass(monogramContainer, 'd-none');\n }\n }\n}\n\n/**\n * toggle cart summary section in mobile and when tab switched from SFL to MY Tote and vice-versa\n */\nfunction hideShowSummarySection() {\n const sflTabElement = queryFirst('.save-for-later-tab');\n const sflCartElement = queryFirst('.cart-sfl-summary');\n const isCartEmpty = queryFirst('.js-cart-empty');\n const isSFLSelected = hasClass(sflTabElement, selectedTabClass);\n if (window.matchMedia('(max-width: 768px)').matches) {\n if (isSFLSelected) {\n addClass(sflCartElement, HIDDEN_CLASS);\n } else if (!isCartEmpty || hasClass(isCartEmpty, HIDDEN_CLASS)) {\n removeClass(sflCartElement, HIDDEN_CLASS);\n }\n }\n else if (!isCartEmpty || hasClass(isCartEmpty, HIDDEN_CLASS)) {\n removeClass(sflCartElement, HIDDEN_CLASS);\n }\n}\n/**\n * updates the Save for later on cart page\n * @param {Object} data - add product to tote from SFL cart ajax response\n */\nfunction updateSaveForLaterDetails(data) {\n const { saveForLaterHtml, sflCountMsg, count, isLoggedIn } = data;\n const sflProductElement = queryFirst('.sfl-cart-products');\n const sflTitleCount = queryFirst('.number-of-items-sfl');\n const signInSFLBottomEl = queryFirst('.sfl-login-wrapper');\n const moveAllToCartCTA = queryFirst('.move-all-items-to-tote');\n\n if (sflProductElement) {\n sflProductElement.innerHTML = saveForLaterHtml;\n }\n\n if (sflTitleCount) {\n sflTitleCount.textContent = sflCountMsg;\n }\n if (count === 0) {\n addClass([signInSFLBottomEl, moveAllToCartCTA], HIDDEN_CLASS);\n hideShowSummarySection();\n if (isLoggedIn) {\n const loginSFL = queryFirst('.sfl-login-btn');\n addClass(loginSFL, HIDDEN_CLASS);\n }\n }\n}\n/**\n * Updates the loyalty rewards and offers in cart and checkout page\n * @param {Object} summarySection - Rewards or Offers Section\n * @param {Object} couponData - data of the rewards or offers\n * @param {number} couponCount - count of redeemed rewards/offers\n * @param {string} couponPrice - total price of redeemed rewards/offers\n * @param {string} ctaClass - wrapper class for apply and remove CTAs in offers and rewards\n */\nfunction updateLoyaltyRewardsOffers(summarySection, couponData, couponCount, couponPrice, ctaClass) {\n if (couponCount) {\n removeClass(summarySection, HIDDEN_CLASS);\n const redeemedCouponCountEl = queryFirst('.loyalty-cart-reward-quantity', summarySection);\n const redeemedCouponPriceEl = queryFirst('.loyalty-cart-reward-price', summarySection);\n redeemedCouponCountEl.textContent = couponCount;\n redeemedCouponPriceEl.textContent = couponPrice;\n queryAll(ctaClass).forEach((el) => {\n const { voucherCode } = el.dataset;\n const removeCouponCta = queryFirst('.remove-voucher-tote-cta', el);\n const applyCouponCta = queryFirst('.apply-voucher-tote-cta', el);\n const couponCardEl = el.closest('.voucher-card-content');\n const matchingCoupon = couponData.find(voucher => voucher.code === voucherCode);\n if (matchingCoupon) {\n const { applied, UUID } = matchingCoupon;\n if (applied) {\n removeClass(removeCouponCta, HIDDEN_CLASS);\n addClass(applyCouponCta, HIDDEN_CLASS);\n addClass(couponCardEl, loyaltyVoucherApplied);\n el.dataset.uuid = UUID;\n } else {\n addClass(removeCouponCta, HIDDEN_CLASS);\n removeClass(applyCouponCta, HIDDEN_CLASS);\n removeClass(couponCardEl, loyaltyVoucherApplied);\n }\n }\n });\n } else {\n queryAll(ctaClass).forEach((el) => {\n const removeCouponCta = queryFirst('.remove-voucher-tote-cta', el);\n const applyCouponCta = queryFirst('.apply-voucher-tote-cta', el);\n const couponCardEl = el.closest('.voucher-card-content');\n addClass(removeCouponCta, HIDDEN_CLASS);\n removeClass(applyCouponCta, HIDDEN_CLASS);\n removeClass(couponCardEl, loyaltyVoucherApplied);\n });\n addClass(summarySection, HIDDEN_CLASS);\n }\n}\n\n/**\n * updates the loyalty vouchers on cart page\n * @param {Object} data - add product to tote from SFL cart ajax response\n */\nfunction updateLoyaltyVouchers(data) {\n const { loyalty, subTotal } = data.totals;\n if (loyalty) {\n const { memberVouchers, memberOffers, redeemedVouchersCount, redeemedVoucherPrice, redeemedOffersCount, redeemedOffersPrice } = loyalty;\n const loyaltyVouchersSummarySection = queryFirst('.loyalty-cart-reward-section');\n const loyaltyOffersSummarySection = queryFirst('.loyalty-cart-offer-section');\n const applyVoucherCtas = queryAll('.apply-voucher-tote-cta');\n if (loyaltyVouchersSummarySection) {\n updateLoyaltyRewardsOffers(loyaltyVouchersSummarySection, memberVouchers, redeemedVouchersCount, redeemedVoucherPrice, '.js-vouchers-cta');\n }\n if (loyaltyOffersSummarySection) {\n updateLoyaltyRewardsOffers(loyaltyOffersSummarySection, memberOffers, redeemedOffersCount, redeemedOffersPrice, '.js-offers-cta');\n }\n applyVoucherCtas.forEach((applyCta) => {\n const voucherCardContentEl = applyCta.closest('.voucher-card-content');\n const voucherCardDisabledClass = 'voucher-card-disabled';\n if (subTotal === '$0' && !hasClass(applyCta, HIDDEN_CLASS)) {\n applyCta.disabled = true;\n addClass(voucherCardContentEl, voucherCardDisabledClass);\n } else {\n applyCta.disabled = false;\n removeClass(voucherCardContentEl, voucherCardDisabledClass);\n }\n });\n }\n}\n/**\n * Handle the spacing in Promo Section\n */\nfunction couponsAndPromotionSpacingHandle() {\n const promoAccordionEl = queryFirst('.promo-accordion-container');\n if (promoAccordionEl) {\n const couponsAndPromos = queryFirst('.coupons-and-promos', promoAccordionEl);\n const couponItems = queryFirst('.coupon-price-adjustment', couponsAndPromos);\n const couponCodeField = queryFirst('.coupon-code-field');\n const couponError = queryFirst('.coupon-error');\n if (!couponItems) {\n addClass(couponsAndPromos, 'mt-0');\n addClass(couponCodeField, 'mb-2');\n removeClass(couponError, 'mt-2');\n } else {\n const couponErrorMessageEl = queryFirst('.coupon-error-message');\n const couponMissingErrorEl = queryFirst('.coupon-missing-error');\n addClass(couponError, 'mt-2');\n removeClass(couponsAndPromos, 'mt-0');\n if (couponErrorMessageEl && !couponErrorMessageEl.textContent && couponMissingErrorEl && couponMissingErrorEl.style.display === 'none') {\n removeClass(couponCodeField, 'is-invalid');\n }\n removeClass(couponCodeField, 'mb-2');\n }\n }\n}\n\n/**\n * Get the account details for Bolt User\n * @param {string} checkoutUrl - URL to redirect to Checkout page if error comes from the API call\n */\nfunction fetchBoltAccountDetails(checkoutUrl) {\n const accountDetailUrl = queryFirst('.get-bolt-account-details').value;\n $.ajax({\n url: accountDetailUrl,\n method: 'GET',\n success: function ({ success, redirectUrl }) {\n //Remove the bolt logout cookie\n document.cookie = 'bolt_sfcc_session_logout=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';\n window.location.href = (success && redirectUrl) || checkoutUrl;\n },\n error: function () {\n window.location.href = checkoutUrl;\n }\n });\n}\n/**\n * Lilly Customization changes end\n */\n\n/**\n * Initializes the event handlers\n */\nfunction init() {\n $body.on('click', '.cart-nav-list.save-for-later-tab, .see-items-sfl', function (e) {\n const sflTab = queryFirst('.cart-nav-list.save-for-later-tab');\n if (!hasClass(sflTab, selectedTabClass)) {\n const myToteTab = queryFirst('.cart-nav-list.my-tote-tab');\n let toTab = 'saved for later';\n removeClass(myToteTab, selectedTabClass);\n addClass(sflTab, selectedTabClass);\n hideShowSummarySection();\n const queryParam = { view: 'saved' };\n const cartUrl = location.href;\n const urlWithParam = appendToUrl(cartUrl, queryParam);\n if (hasClass(this, 'js-see-items-sfl')) {\n const selectSFLTab = queryFirst('.js-save-for-later-select');\n const selectSFLContent = queryFirst('#saveForLater');\n const selectedMyToteTab = queryFirst('.js-my-tote-selected');\n const selectedMyToteContent = queryFirst('#myTote');\n removeClass([selectedMyToteTab, selectedMyToteContent], 'active');\n addClass([selectSFLTab, selectSFLContent], 'active');\n scrollTo($body.offset().top, 0);\n toTab += ': see items';\n }\n history.replaceState({}, '', urlWithParam);\n $body.trigger('tote:selectTab', { fromTab: 'my tote', toTab });\n }\n });\n\n $body.on('click', '.cart-nav-list.my-tote-tab', function (e) {\n if (!hasClass(this, selectedTabClass)) {\n const safeForLaterTab = queryFirst('.cart-nav-list.save-for-later-tab');\n removeClass(safeForLaterTab, selectedTabClass);\n addClass(this, selectedTabClass);\n hideShowSummarySection();\n history.replaceState({}, '', location.href.split('?')[0]);\n $body.trigger('tote:selectTab', { fromTab: 'saved for later', toTab: 'my tote' });\n }\n });\n\n $body.on('click', '.move-to-sfl', function (e) {\n e.preventDefault();\n $.spinner().start();\n const { href, actionUrl, pid, quantity, name, uuid, isGiftCard, isMonogram, giftCardAmount, monogramColor, monogramLocation, monogramStyle,\n monogramLetter1, monogramLetter2, monogramLetter3, monogramInitials, giftCardRecipientEmail, giftCardRecipientName, giftCardSenderName, giftCardEmailMessage } = this.dataset;\n const monogramOptions = {\n itemPersonalizationColor: monogramColor,\n itemPersonalizationLocation: monogramLocation,\n itemPersonalizationLetterStyle: monogramStyle,\n itemPersonalizationLetter1: monogramLetter1,\n itemPersonalizationLetter2: monogramLetter2,\n itemPersonalizationLetter3: monogramLetter3,\n itemPersonalizationLetters: monogramInitials\n }\n\n const form = {\n pid,\n qty: quantity,\n isGiftCard,\n isMonogram,\n giftCardAmount,\n monogramOptions: JSON.stringify(monogramOptions),\n giftCardRecipientEmail,\n giftCardRecipientName,\n giftCardSenderName,\n giftCardEmailMessage\n };\n $.ajax({\n url: href,\n type: 'post',\n data: form,\n dataType: 'json',\n success: function (data) {\n if (data.success) {\n const { count, isLoggedIn } = data;\n const signInSFLBottomWrapperEl = queryFirst('.sfl-login-wrapper');\n const signInSFLBottomEl = queryFirst('.sfl-sign-in');\n confirmDelete(actionUrl, pid, name, uuid);\n $('.cart-page .cart-delete-confirmation-btn').trigger('click');\n if (count !== 0) {\n if (!isLoggedIn) {\n removeClass([signInSFLBottomEl, signInSFLBottomWrapperEl], HIDDEN_CLASS);\n }\n }\n }\n else {\n $.spinner().stop();\n }\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n });\n\n $body.on('click', '.remove-sfl-product', function (e) {\n e.preventDefault();\n const { action, pid, name, uuid, quantity } = this.dataset;\n const url = appendToUrl(action, { pid, uuid, qty: quantity });\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $.spinner().stop();\n if (data.success) {\n const { count, emptySFLMsg, continueShopURL, continueShopMsg, signInMsg, isLoggedIn, signInSFLURL } = data;\n const signInSFLBottomEl = queryFirst('.sfl-login-wrapper');\n const itemsCountSFL = queryFirst('.cart-items-count .item-count-sfl');\n const numberItemsSFL = queryFirst('.number-of-items-sfl');\n const removedSFLProductCard = queryFirst('.sfl-product-info.uuid-' + uuid);\n itemsCountSFL.textContent = count;\n numberItemsSFL.textContent = count;\n removedSFLProductCard.remove();\n if (count === 0) {\n const moveAllToCartCTA = queryFirst('.move-all-items-to-tote');\n const sflProductCardItems = queryFirst('.sfl-cart-products');\n addClass(moveAllToCartCTA, HIDDEN_CLASS);\n const emptySFLMarkup = emptySFLTemplates(emptySFLMsg, continueShopURL, continueShopMsg, signInMsg, signInSFLURL);\n sflProductCardItems.outerHTML = emptySFLMarkup;\n const loginSFLBtn = queryFirst('.sfl-empty .sfl-login-btn');\n if (isLoggedIn) {\n addClass(loginSFLBtn, HIDDEN_CLASS);\n }\n else {\n addClass(signInSFLBottomEl, HIDDEN_CLASS);\n removeClass(loginSFLBtn, HIDDEN_CLASS);\n }\n }\n }\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n confirmDelete(action, pid, name, uuid);\n });\n\n $body.on('click', '.remove-product', function (e) {\n e.preventDefault();\n const { action, pid, name, uuid, tealium } = this.dataset;\n confirmDelete(action, pid, name, uuid, tealium);\n });\n\n $body.on('afterRemoveFromCart', function (e, data) {\n e.preventDefault();\n const { actionUrl, productID, productName, uuid } = data;\n confirmDelete(actionUrl, productID, productName, uuid);\n });\n\n $('.cart-container, .mini-cart-container').on('cart:updateTotals', function (e, data) {\n const { basket } = data;\n const { bonusProductLineItems } = basket;\n updateCartTotals(basket, true);\n if (bonusProductLineItems) {\n const { nonOptionBonusProducts = [], hasOptionBonusProducts } = bonusProductLineItems;\n\n const hasNonOptionsBonusProducts = !!nonOptionBonusProducts.length;\n const hasBonusProduct = hasNonOptionsBonusProducts || hasOptionBonusProducts;\n\n if (!hasNonOptionsBonusProducts) {\n remove(queryAll('.gwp-no-option-bonus'));\n }\n\n if (!hasOptionBonusProducts) {\n remove(queryAll('.gwp-option-bonus'));\n }\n\n if (!hasBonusProduct) {\n remove(queryAll('.gwp-container'));\n }\n }\n enableOrDisableCheckoutButton();\n });\n\n $body.on('click', '.cart-page .cart-delete-confirmation-btn', function (e) {\n e.preventDefault();\n const { target } = e;\n const { pid, action, uuid } = target.dataset;\n const urlParams = { pid, uuid };\n const url = appendToUrl(action, urlParams);\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n const storePickupGroupElement = cartProductCard.closest('.store-pickup-group');\n const cartShipProductsEl = cartProductCard.closest('.cart-ship-products');\n $('body > .modal-backdrop').remove();\n\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n updateGWP(data);\n const { saveForLater, isSFLEnabled, basket, saveForLaterHtml } = data;\n if (isSFLEnabled) {\n const productCountSFL = saveForLater.count || 0;\n const cartSummaryEl = queryFirst('.cart-sfl-summary');\n const cartWithSFLItemsTotal = queryFirst('.cart-items-count .item-count-tote');\n if (cartWithSFLItemsTotal) {\n cartWithSFLItemsTotal.textContent = basket.numItems;\n }\n $('.cart-items-count .item-count-sfl')\n .empty()\n .append(productCountSFL);\n $('.number-of-items-sfl')\n .empty()\n .append(productCountSFL);\n if (basket.items.length === 0) {\n addClass(cartSummaryEl, HIDDEN_CLASS);\n }\n else {\n removeClass(cartSummaryEl, HIDDEN_CLASS);\n }\n\n if (saveForLater && getNestedValue(saveForLater, 'items.length')) {\n const sflCartProducts = queryFirst('.sfl-cart-products');\n if (sflCartProducts) {\n sflCartProducts.innerHTML = saveForLaterHtml;\n }\n }\n }\n if (basket.items.length === 0) {\n if (isSFLEnabled) {\n const emptyCartWithSFLElement = queryFirst('.js-cart-container .js-cart-empty');\n const cartWithSFLElement = queryFirst('.js-cart-container .js-cart-with-items');\n removeClass(emptyCartWithSFLElement, HIDDEN_CLASS);\n addClass(cartWithSFLElement, HIDDEN_CLASS);\n }\n else {\n emptyCart(basket.resources.emptyCartMsg);\n }\n $('.number-of-items').empty();\n $('.minicart-quantity')\n .empty()\n .append(data.basket.numItems);\n $('.minicart-link').attr({\n 'aria-label': data.basket.resources.minicartCountOfItems,\n title: data.basket.resources.minicartCountOfItems\n });\n } else {\n if (data.toBeDeletedUUIDs && data.toBeDeletedUUIDs.length > 0) {\n for (var i = 0; i < data.toBeDeletedUUIDs.length; i++) {\n $('.uuid-' + data.toBeDeletedUUIDs[i]).remove();\n }\n }\n $('.uuid-' + uuid).remove();\n $('.coupons-and-promos')\n .empty()\n .append(data.basket.totals.discountsHtml);\n updatePromoCodeDetails(data.basket.totals.discounts, data.basket.selectedShippingMethod);\n updateCartTotals(data.basket);\n updateLoyaltyVouchers(data.basket);\n updateApproachingDiscounts(data.basket.approachingDiscounts, data.basket.approachingDiscountsLabels);\n const { updatedStoreQuantity, storeGroupMessage, enablePayPal } = data.basket;\n if (cartShipProductsEl && !queryFirst('.cart-product-line-item', cartShipProductsEl)) {\n cartShipProductsEl.remove();\n }\n\n const paypalContainerEl = queryFirst('.checkout-continue');\n if (paypalContainerEl) {\n if (enablePayPal) {\n removeClass(paypalContainerEl, HIDDEN_CLASS);\n } else {\n addClass(paypalContainerEl, HIDDEN_CLASS);\n }\n }\n\n if (storePickupGroupElement && updatedStoreQuantity && storeGroupMessage) {\n const storeGroupMessageElement = queryFirst('.store-product-items-message', storePickupGroupElement);\n if (storeGroupMessageElement) {\n storeGroupMessageElement.textContent = storeGroupMessage;\n }\n } else if (storePickupGroupElement) {\n storePickupGroupElement.remove();\n }\n\n if (data.basket.inStoreProductLineItems && !data.basket.inStoreProductLineItems.length) {\n addClass(queryFirst('.cart-pickup-products'), HIDDEN_CLASS);\n addClass(queryFirst('.mini-cart-store-title'), HIDDEN_CLASS);\n }\n $body.trigger('setShippingMethodSelection', data.basket);\n\n $('.cart-container, .mini-cart-container').trigger('cart:updateTotals', data);\n validateBasket(data.basket);\n updateMonogramDetails(data.basket);\n }\n\n $body.trigger('cart:update');\n const applePayButton = queryFirst('.dw-apple-pay-button');\n if (data.basket.enableApplePay) {\n removeClass(applePayButton, HIDDEN_CLASS);\n } else {\n addClass(applePayButton, HIDDEN_CLASS);\n }\n // update Marketing Cloud Analytics trackCart event\n trackCart(data.mcAnalyticsArray);\n\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.responseJSON.errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n\n $body.on('change', '.quantity-form > .quantity', function () {\n const self = this;\n const $this = $(self);\n var preSelectQty = $this.data('pre-select-qty');\n var quantity = $this.val();\n var productID = $this.data('pid');\n var url = $this.data('action');\n var uuid = $this.data('uuid');\n const storeId = $this.data('store-id');\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n const storePickupGroupElement = cartProductCard.closest('.store-pickup-group');\n var urlParams = {\n pid: productID,\n quantity: quantity,\n uuid: uuid,\n storeId\n };\n url = appendToUrl(url, urlParams);\n const origPositionY = self.getBoundingClientRect().y;\n $this\n .parents('.card')\n .spinner()\n .start();\n\n $.ajax({\n url: url,\n type: 'get',\n context: this,\n dataType: 'json',\n success: function (data) {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n setTimeout(() => {\n addClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n }, 10000);\n $(this).val(parseInt(preSelectQty, 10));\n }\n $.spinner().stop();\n } else {\n $('.quantity[data-uuid=\"' + uuid + '\"]').val(quantity);\n const { updatedStoreQuantity, storeGroupMessage, cartProductsHtml } = data;\n if (storePickupGroupElement && updatedStoreQuantity && storeGroupMessage) {\n const storeGroupMessageElement = queryFirst('.store-product-items-message', storePickupGroupElement);\n if (storeGroupMessageElement) {\n storeGroupMessageElement.textContent = storeGroupMessage;\n }\n }\n const lineItem = data.items.find(element => element.UUID === uuid);\n if (lineItem && !storePickupGroupElement) {\n const { giftWrapAvailableFlag, hasGiftWrap } = lineItem;\n const cartStoreLinksSelector = '.product-info.uuid-' + uuid + ' .cart-store-links';\n if (!giftWrapAvailableFlag) {\n $('.gift-wrap-input[data-uuid=\"' + uuid + '\"]').prop('checked', false);\n $(cartStoreLinksSelector + ' form').addClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').addClass(HIDDEN_CLASS);\n } else {\n $('.gift-wrap-input[data-uuid=\"' + uuid + '\"]').prop('checked', hasGiftWrap);\n $(cartStoreLinksSelector + ' form').removeClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').removeClass(HIDDEN_CLASS);\n }\n }\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n updateLoyaltyVouchers(data);\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n queryFirst('.cart-products').innerHTML = cartProductsHtml;\n updateGWP(data);\n updateMonogramDetails(data);\n validateBasket(data);\n\n $body.trigger('cart:update');\n\n // update Marketing Cloud Analytics trackCart event\n trackCart(data.mcAnalyticsArray);\n\n $.spinner().stop();\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n const { errorMessage } = err.responseJSON;\n createErrorNotification(errorMessage);\n $(this).val(parseInt(preSelectQty, 10));\n $.spinner().stop();\n }\n }\n });\n });\n\n $body.on('click', '.apply-voucher-tote-cta', function (e) {\n e.preventDefault();\n const applyRewardEl = this;\n const voucherCardEl = this.closest('.voucher-card-content');\n const removeRewardEl = queryFirst('.remove-voucher-tote-cta', voucherCardEl);\n const { couponCode } = voucherCardEl.dataset;\n const csrfTokenInput = queryFirst('.csrf-token', voucherCardEl);\n let csrfToken;\n if (csrfTokenInput) {\n csrfToken = csrfTokenInput.value;\n }\n $.spinner().start();\n $.ajax({\n url: this.dataset.action,\n type: 'POST',\n dataType: 'json',\n data: { csrf_token: csrfToken, couponCode },\n success: function (data) {\n if (data.error) {\n const promoCodeFormControlEl = queryFirst('.promo-code-form .form-control');\n addClass(promoCodeFormControlEl, INVALID_CLASS);\n promoCodeFormControlEl.setAttribute('aria-describedby', 'invalidCouponCode');\n $('.coupon-missing-error').hide();\n couponsAndPromotionSpacingHandle();\n $(queryFirst('.coupon-error-message'))\n .empty()\n .append(data.errorMessage);\n $.spinner().stop();\n } else {\n const { loyalty, discounts, discountsHtml } = data.totals;\n if (loyalty && (loyalty.redeemedVouchersCount || loyalty.redeemedOffersCount)) {\n addClass(applyRewardEl, HIDDEN_CLASS);\n removeClass(removeRewardEl, HIDDEN_CLASS);\n addClass(voucherCardEl, loyaltyVoucherApplied);\n const { memberVouchers, memberOffers } = loyalty;\n const voucherCardCtaEl = applyRewardEl.closest('.js-vouchers-cta');\n const offerCardCtaEl = applyRewardEl.closest('.js-offers-cta');\n if (voucherCardCtaEl) {\n const { voucherCode } = voucherCardCtaEl.dataset;\n memberVouchers.forEach(voucher => {\n const { applied, code } = voucher;\n if (applied && code === voucherCode) {\n voucherCardCtaEl.dataset.uuid = voucher.UUID;\n }\n });\n }\n if (offerCardCtaEl) {\n const { voucherCode } = offerCardCtaEl.dataset;\n memberOffers.forEach(offer => {\n const { applied, code } = offer;\n if (applied && code === voucherCode) {\n offerCardCtaEl.dataset.uuid = offer.UUID;\n }\n });\n }\n updateLoyaltyVouchers(data);\n if (discounts) {\n updateGWP(data);\n updatePromoCodeDetails(discounts, data.selectedShippingMethod);\n }\n updateCartTotals(data);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n }\n $('.coupons-and-promos')\n .empty()\n .append(discountsHtml);\n $.spinner().stop();\n }\n },\n error: function (err) {\n if (err.responseJSON && err.responseJSON.csrfError) {\n $body.trigger('csrf:error');\n } else {\n createErrorNotification(err.errorMessage);\n }\n $.spinner().stop();\n }\n });\n });\n\n $body.on('click', '.remove-voucher-tote-cta', function (e) {\n e.preventDefault();\n const removeRewardEl = this;\n const voucherCardEl = this.closest('.voucher-card-content');\n const voucherCardCtaEl = queryFirst('.js-vouchers-cta', voucherCardEl);\n const offerCardCtaEl = queryFirst('.js-offers-cta', voucherCardEl);\n const applyRewardEl = queryFirst('.apply-voucher-tote-cta', voucherCardEl);\n const { action } = this.dataset;\n const { uuid, voucherCode } = voucherCardCtaEl ? voucherCardCtaEl.dataset : offerCardCtaEl.dataset;\n const url = appendToUrl(action, { code: voucherCode, uuid });\n\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n const { discounts } = data.totals;\n addClass(removeRewardEl, HIDDEN_CLASS);\n removeClass(applyRewardEl, HIDDEN_CLASS);\n removeClass(voucherCardEl, loyaltyVoucherApplied);\n updateLoyaltyVouchers(data);\n updateGWP(data);\n updateCartTotals(data);\n if (discounts) {\n updatePromoCodeDetails(discounts, data.selectedShippingMethod);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n $.spinner().stop();\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.responseJSON.errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n\n $('.promo-code-form').submit(function (e) {\n e.preventDefault();\n $.spinner().start();\n $('.coupon-missing-error').hide();\n $('.coupon-error-message').empty();\n if (!$('.coupon-code-field').val()) {\n $('.promo-code-form .form-control').addClass('is-invalid');\n $('.promo-code-form .form-control').attr('aria-describedby', 'missingCouponCode');\n $('.coupon-missing-error').show();\n couponsAndPromotionSpacingHandle();\n $.spinner().stop();\n return false;\n }\n var $form = $('.promo-code-form');\n $('.promo-code-form .form-control').removeClass('is-invalid');\n $('.coupon-error-message').empty();\n\n $.ajax({\n url: $form.attr('action'),\n type: 'POST',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n queryFirst('.coupon-code-field').value = '';\n if (data.error) {\n $('.promo-code-form .form-control').addClass('is-invalid');\n $('.promo-code-form .form-control').attr('aria-describedby', 'invalidCouponCode');\n $('.coupon-error-message')\n .empty()\n .append(data.errorMessage);\n } else {\n updateGWP(data);\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n updateLoyaltyVouchers(data);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n }\n if (!checkoutContainer) {\n $('.cart-container').trigger('add-coupon', data);\n } else {\n $(checkoutContainer).trigger('add-coupon', data);\n }\n couponsAndPromotionSpacingHandle();\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON && err.responseJSON.csrfError) {\n $body.trigger('csrf:error');\n } else {\n createErrorNotification(err.errorMessage);\n }\n $.spinner().stop();\n }\n });\n return false;\n });\n\n $body.on('click', '.delete-coupon-confirmation-btn', function (e) {\n e.preventDefault();\n\n var url = $(this).data('action');\n var uuid = $(this).data('uuid');\n var couponCode = $(this).data('code');\n var urlParams = {\n code: couponCode,\n uuid: uuid\n };\n\n url = appendToUrl(url, urlParams);\n\n $('body > .modal-backdrop').remove();\n\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n updateGWP(data);\n $('.coupon-uuid-' + uuid).remove();\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n updateCartTotals(data);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateLoyaltyVouchers(data);\n couponsAndPromotionSpacingHandle();\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.responseJSON.errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n\n $body.on('click', '.cart-page .bonus-product-button', function (event) {\n event.stopPropagation();\n $.spinner().start();\n $(this).addClass('launched-modal');\n $.ajax({\n url: $(this).data('url'),\n method: 'GET',\n dataType: 'json',\n success: function (data) {\n base.methods.editBonusProducts(data);\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n\n $body.on('click', '.move-product-to-tote .move-sfl, .move-all-to-tote', function (event) {\n event.preventDefault();\n const self = this;\n const $this = $(self);\n const {\n qtyValue: quantity,\n pid: productID,\n action: url,\n uuid,\n isGiftCard,\n isMonogram: hasMonogram\n } = self.dataset;\n const cartProductCard = queryFirst(`.card.product-info.uuid${uuid ? '-' + uuid : ''}`);\n const storePickupGroupElement = uuid ? cartProductCard.closest('.store-pickup-group') : queryFirst('.store-pickup-group');\n const urlParams = {};\n if (productID) {\n urlParams.pid = productID;\n }\n if (quantity) {\n urlParams.qty = parseInt(quantity);\n }\n if (uuid) {\n urlParams.uuid = uuid;\n }\n if (isGiftCard) {\n urlParams.isGiftCard = isGiftCard;\n }\n if (hasMonogram) {\n urlParams.isMonogram = hasMonogram;\n }\n const origPositionY = self.getBoundingClientRect().y;\n if (hasClass(self, 'move-sfl')) {\n $this\n .parents('.card')\n .spinner()\n .start();\n }\n else {\n $.spinner().start();\n }\n $.ajax({\n url: url,\n type: 'post',\n data: urlParams,\n dataType: 'json',\n success: function (data) {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n }\n $.spinner().stop();\n } else {\n // When we come from Order Reciept page we do not have basket, so\n // things like PayPal skip to initilize. As workaround for this case\n // we force page to reload.\n const currentBasketStatusElement = document.querySelector('[data-has-initial-basket]');\n if (\n currentBasketStatusElement &&\n currentBasketStatusElement.getAttribute('data-has-initial-basket') === 'false'\n ) {\n trackCart(data.mcAnalyticsArray); // update Marketing Cloud Analytics trackCart event\n history.replaceState({}, '', location.href.split('?')[0]);\n location.reload();\n return;\n }\n\n const emptyCartWithSFLElement = queryFirst('.js-cart-container .js-cart-empty');\n const cartWithSFLElement = queryFirst('.js-cart-container .js-cart-with-items');\n addClass(emptyCartWithSFLElement, HIDDEN_CLASS);\n removeClass(cartWithSFLElement, HIDDEN_CLASS);\n const { cartModel, count, toteCount } = data;\n const { updatedStoreQuantity, storeGroupMessage, cartProductsHtml } = cartModel;\n queryFirst('.cart-items-count .item-count-sfl').textContent = count;\n queryFirst('.cart-items-count .item-count-tote').textContent = toteCount;\n if (toteCount > 0) {\n hideShowSummarySection();\n }\n if (storePickupGroupElement && updatedStoreQuantity && storeGroupMessage) {\n const storeGroupMessageElement = queryFirst('.store-product-items-message', storePickupGroupElement);\n if (storeGroupMessageElement) {\n storeGroupMessageElement.textContent = storeGroupMessage;\n }\n }\n const couponsPromosEl = queryFirst('.coupons-and-promos');\n if (couponsPromosEl) {\n couponsPromosEl.innerHTML = cartModel.totals.discountsHtml;\n }\n updatePromoCodeDetails(cartModel.totals.discounts, cartModel.selectedShippingMethod);\n updateCartTotals(cartModel);\n updateLoyaltyVouchers(cartModel);\n updateApproachingDiscounts(cartModel.approachingDiscounts, cartModel.approachingDiscountsLabels);\n updateGWP(cartModel);\n const cartProductElement = queryFirst('.cart-products');\n if (cartProductElement) {\n cartProductElement.innerHTML = cartProductsHtml;\n const seeAllItemElement = queryFirst('.see-all-items-wrapper');\n removeClass(seeAllItemElement, HIDDEN_CLASS);\n }\n updateMonogramDetails(cartModel);\n updateSaveForLaterDetails(data);\n validateBasket(cartModel);\n $body.trigger('cart:update');\n\n // update Marketing Cloud Analytics trackCart event\n trackCart(data.mcAnalyticsArray);\n\n $.spinner().stop();\n if (!hasClass(self, 'move-all-to-tote')) {\n const originalScroll = document.defaultView.scrollY;\n const newPositionY = self.getBoundingClientRect().y;\n scrollTo(originalScroll + newPositionY - origPositionY, 0);\n }\n else {\n scrollTo($body.offset().top, 0);\n }\n }\n },\n error: function (err) {\n const { responseJSON = {} } = err;\n const { errorMessage, redirectUrl } = responseJSON;\n if (redirectUrl) {\n window.location.href = redirectUrl;\n }\n else {\n createErrorNotification(errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n\n $body.on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n if ($('.cart-page').length) {\n $('.launched-modal .btn-outline-primary').trigger('focus');\n $('.launched-modal').removeClass('launched-modal');\n } else {\n $('.product-detail .add-to-cart').focus();\n }\n });\n\n $body.on('product:afterAttributeSelect', function (_e, response) {\n const responseContainer = response.container[0];\n const { product } = response.data;\n const { categoryUrl, isCartPage } = responseContainer.dataset;\n const availabilityMessageEl = queryFirst('.product-availability .availability-message-text', responseContainer);\n\n if (!product.available && isCartPage && categoryUrl) {\n const message = availabilityMessageEl.innerText;\n availabilityMessageEl.innerHTML = cartTemplates.cartAvailabilityMessageOOS(message, categoryUrl);\n }\n\n const updateCartButton = queryFirst('.update-cart-product-global', responseContainer);\n if (updateCartButton) {\n updateCartButton.disabled = !product.readyToOrder || !product.available || product.isDirectlyPurchasable === false;\n }\n });\n\n $body.on('product:notifyMeHidden', function (_e, productContainer) {\n const updateCartButton = queryFirst('.update-cart-product-global', productContainer);\n removeClass(updateCartButton, 'd-none');\n });\n\n $body.on('product:notifyMeShown', function (_e, productContainer) {\n const updateCartButton = queryFirst('.update-cart-product-global', productContainer);\n addClass(updateCartButton, 'd-none');\n });\n\n $body.on('change', '.quantity-select', function () {\n var selectedQuantity = $(this).val();\n $('.modal.show .update-cart-url').data('selected-quantity', selectedQuantity);\n });\n\n $body.on('change', '.options-select', function () {\n var selectedOptionValueId = $(this)\n .children('option:selected')\n .data('value-id');\n $('.modal.show .update-cart-url').data('selected-option', selectedOptionValueId);\n });\n\n $body.on('click', '.update-cart-product-global', function (e) {\n e.preventDefault();\n const { target } = e;\n const buttonContainer = target.closest('.cart-and-ipay');\n const updateCartHiddenField = queryFirst('.update-cart-url', buttonContainer);\n const updateProductUrl = updateCartHiddenField.value;\n const { selectedQuantity, selectedOption, uuid } = updateCartHiddenField.dataset;\n const { storeId } = target.dataset;\n const form = {\n uuid: uuid,\n pid: base.getPidValue($(this)),\n quantity: selectedQuantity,\n selectedOptionValueId: selectedOption,\n storeId\n };\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n $('#quickViewModal')\n .spinner()\n .start();\n\n const giftCardFormEl = buttonContainer.closest('.gift-card');\n if (giftCardFormEl) {\n updateFormObjectForGiftCard(form, giftCardFormEl);\n }\n\n $(this)\n .parents('.card')\n .spinner()\n .start();\n if (updateProductUrl) {\n $.ajax({\n url: updateProductUrl,\n type: 'post',\n context: this,\n data: form,\n dataType: 'json',\n success: function (data) {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n setTimeout(() => {\n addClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n }, 10000);\n }\n $('#quickViewModal')\n .modal('hide')\n .spinner()\n .stop();\n } else if (data.success) {\n $('#quickViewModal')\n .modal('hide')\n .spinner()\n .stop();\n\n $('.coupons-and-promos')\n .empty()\n .append(data.cartModel.totals.discountsHtml);\n updatePromoCodeDetails(data.cartModel.totals.discounts, data.cartModel.selectedShippingMethod);\n updateCartTotals(data.cartModel);\n updateLoyaltyVouchers(data.cartModel);\n updateApproachingDiscounts(data.cartModel.approachingDiscounts, data.cartModel.approachingDiscountsLabels);\n updateAvailability(data.cartModel, uuid);\n updateProductDetails(data, uuid, target.dataset.giftWrapAvailable);\n updateGWP(data.cartModel);\n if (data.uuidToBeDeleted) {\n $('.uuid-' + data.uuidToBeDeleted).remove();\n }\n\n validateBasket(data.cartModel);\n\n const { enablePayPal, enableApplePay } = data.cartModel;\n\n const paypalContainerEl = queryFirst('.checkout-continue');\n if (paypalContainerEl) {\n if (enablePayPal) {\n removeClass(paypalContainerEl, HIDDEN_CLASS);\n } else {\n addClass(paypalContainerEl, HIDDEN_CLASS);\n }\n }\n\n const applePayButton = queryFirst('.dw-apple-pay-button');\n if (applePayButton) {\n if (enableApplePay) {\n removeClass(applePayButton, HIDDEN_CLASS);\n } else {\n addClass(applePayButton, HIDDEN_CLASS);\n }\n }\n\n $body.trigger('cart:update');\n } else {\n formValidation(giftCardFormEl, data);\n }\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.responseJSON.errorMessage);\n $.spinner().stop();\n }\n }\n });\n }\n });\n\n const cartPage = $('.cart-page');\n\n // Event listener for home delivery method link in cart page\n cartPage.on('click', '.home-delivery-link', event => {\n const { target } = event;\n const { uuid, pid, actionUrl } = target.dataset;\n const quantity = queryFirst('.quantity', target.closest('.cart-product-line-item')).value;\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n $.spinner().start();\n getJSON(\n actionUrl,\n 'POST',\n {\n uuid,\n pid,\n quantity\n },\n data => {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n setTimeout(() => {\n addClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n }, 10000);\n }\n $.spinner().stop();\n } else {\n const { cartProductsHtml, totals } = data;\n const { discountsHtml } = totals;\n const couponsEl = queryFirst('.coupons-and-promos');\n\n if (couponsEl && discountsHtml) {\n couponsEl.innerHTML = discountsHtml;\n }\n if (cartProductsHtml) {\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n queryFirst('.cart-products').innerHTML = cartProductsHtml;\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n updateLoyaltyVouchers(data);\n validateBasket(data);\n $body.trigger('cart:update');\n $.spinner().stop();\n }\n }\n },\n () => {\n $.spinner().stop();\n }\n );\n });\n\n // Event listener for product gift wrap checkbox\n cartPage.on('click', '.gift-wrap-input', event => {\n const { target } = event;\n const { pid, uuid, actionUrl, ispu } = target.dataset;\n let isGiftWrap = target.checked;\n let isGiftwrapISPU = false;\n let removeGwpISPU = false;\n if (ispu === 'true') {\n if (isGiftWrap) {\n isGiftWrap = false;\n isGiftwrapISPU = true;\n } else {\n removeGwpISPU = true;\n }\n }\n const quantity = queryFirst('.quantity', target.closest('.cart-product-line-item')).value;\n $.spinner().start();\n getJSON(\n actionUrl,\n 'POST',\n {\n uuid,\n pid,\n quantity,\n isGiftWrap,\n isGiftwrapISPU,\n removeGwpISPU\n },\n data => {\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n updateCartTotals(data);\n enableOrDisableCheckoutButton();\n $.spinner().stop();\n },\n () => {\n $.spinner().stop();\n }\n );\n });\n\n $body.on('checkout:updateCheckoutView', function (e, data) {\n const { totals, shipping } = data.order;\n const { discounts, discountsHtml } = totals;\n const couponsEl = queryFirst('.coupons-and-promos');\n\n if (couponsEl && discountsHtml) {\n couponsEl.innerHTML = discountsHtml;\n }\n if (discounts.length) {\n shipping.forEach(eachShipping => {\n const { selectedShippingMethod } = eachShipping;\n if (selectedShippingMethod && !selectedShippingMethod.storePickupEnabled) {\n updatePromoCodeDetails(discounts, selectedShippingMethod);\n }\n });\n }\n });\n\n $body.on('click', '.loyalty-cart-coupons-collapse', function (e) {\n const loyaltyCouponsAccordionBtn = this;\n const couponsAccordionContainerEl = queryFirst('#vouchers-accordion');\n const couponsCardBodyEl = queryFirst('.card-body', couponsAccordionContainerEl);\n const { totalCoupons } = loyaltyCouponsAccordionBtn.dataset;\n const totalCouponsNum = parseInt(totalCoupons, 10);\n const cardBodyMarginTop = 'mt-3';\n if (totalCouponsNum > 2 && !hasClass(loyaltyCouponsAccordionBtn, 'collapsed')) {\n if (couponsCardBodyEl) {\n removeClass(couponsCardBodyEl, cardBodyMarginTop);\n }\n addClass(loyaltyCouponsAccordionBtn, 'collapsed-voucher-padding');\n } else {\n removeClass(loyaltyCouponsAccordionBtn, 'collapsed-voucher-padding');\n if (couponsCardBodyEl) {\n addClass(couponsCardBodyEl, cardBodyMarginTop);\n }\n }\n });\n\n const checkoutContinueCta = queryFirst('.checkout-continue-section .checkout-btn');\n if (checkoutContinueCta) {\n checkoutContinueCta.addEventListener('click', e => {\n e.preventDefault();\n const { target } = e;\n const { href, isBoltUserLoggedIn } = target.dataset;\n if (isBoltUserLoggedIn === 'true' && boltCheckoutAccountExistEl) {\n if (lpRegisteredUserEmail) {\n const checkBoltAccountUrl = boltCheckoutAccountExistEl.value + '=' + encodeURIComponent(lpRegisteredUserEmail);\n $.ajax({\n url: checkBoltAccountUrl,\n method: 'GET',\n success(data) {\n if (data && data.has_bolt_account) {\n fetchBoltAccountDetails(href);\n } else {\n window.location.href = href;\n }\n },\n error: function () {\n window.location.href = href;\n }\n });\n } else {\n fetchBoltAccountDetails(href);\n }\n } else {\n window.location.href = href;\n }\n });\n }\n\n $body.on('click', '.bolt-checkout-cta', function (e) {\n e.preventDefault();\n checkAccountAndFetchDetail();\n });\n\n enableOrDisableCheckoutButton();\n\n // Afterpay\n require('afterpay/afterpay')({\n anchors: '.grand-total-container',\n observerTargets: '.grand-total-container',\n priceTargets: '.grand-total-value',\n renderMode: 'adjacent'\n });\n\n base.selectAttribute();\n base.colorAttribute();\n base.removeBonusProduct();\n base.selectBonusProduct();\n base.enableBonusProductSelection();\n base.showMoreBonusProducts();\n base.addBonusProductsToCart();\n base.focusChooseBonusProductModal();\n base.trapChooseBonusProductModalFocus();\n base.onClosingChooseBonusProductModal();\n window.setTimeout(function () {\n base.revealRecommendations();\n $body.trigger('search:updateProducts');\n }, 2000);\n\n window.onpageshow = function (event) {\n if (event.persisted) {\n window.location.reload();\n }\n };\n window.addEventListener('resize', throttle(() => {\n hideShowSummarySection();\n }));\n}\n\nexport { updateCartTotals, updatePromoCodeDetails, updateApproachingDiscounts, validateBasket };\nexport default init;\n","import { queryFirst, queryAll, addClass, removeClass } from '../../domUtil';\nimport { geolocate } from '../../util';\n\nconst hiddenClass = 'd-none';\n\n/**\n * This method toggles the location icon state in pick up in store drawer\n * @param {boolean} isGeolocationAllowed -geo location permission\n * @param {HTMLElement} container - ISPU container\n */\nfunction toggleLocationIcon(isGeolocationAllowed, container) {\n const locationInactiveIcon = queryFirst('.geolocation-not-activated', container);\n const locationActiveIcon = queryFirst('.geolocation-activated', container);\n if (isGeolocationAllowed) {\n removeClass(locationActiveIcon, hiddenClass);\n addClass(locationInactiveIcon, hiddenClass);\n } else {\n removeClass(locationInactiveIcon, hiddenClass);\n addClass(locationActiveIcon, hiddenClass);\n }\n}\n\n/**\n * This method handles event on clicking 'use my location' link\n * @param {Event} event - on click event object\n * @param {HTMLElement} ispuContainer - ISPU container\n * @param {Function} handleInStore - Success callback handler\n */\nfunction handleDetectLocation(event, ispuContainer, handleInStore) {\n const { target } = event;\n const { actionUrl } = target.dataset;\n const mixinData = { actionUrl, forceGeoLocation: true };\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n queryFirst('.find-store-input', ispuContainer).value = '';\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n geolocate(handleInStore, mixinData, () => {\n removeClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n addClass([storeResults, noStoresMessage], hiddenClass);\n });\n}\n\n/**\n * This method cleans up the state on closing ISPU modal\n * @param {HTMLElement} ispuContainer - ISPU container\n */\nfunction handleISPUModalClose(ispuContainer) {\n queryFirst('.find-store-input', ispuContainer).value = '';\n removeClass(queryAll('.pickup-in-store-product, .find-stores-form', ispuContainer), hiddenClass);\n queryFirst('.pick-up-in-stores', ispuContainer).innerHTML = '';\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const confirmSection = queryFirst('.pick-up-confirm-section', ispuContainer);\n const geolocateError = queryFirst('.geo-location-error', ispuContainer);\n confirmSection.innerHTML = '';\n addClass([confirmSection, noStoresMessage, geolocateError], hiddenClass);\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n}\n\nexport {\n handleISPUModalClose,\n handleDetectLocation,\n toggleLocationIcon\n};\n","'use strict';\n\nimport { queryFirst, queryAll, addClass, removeClass } from '../domUtil';\nimport {\n getJSON,\n geolocate,\n setItemInLocalStorage,\n getItemFromLocalStorage\n} from '../util';\nimport { includeGoogleMaps, getLatLong } from '../googleMaps';\nimport { PREFERRED_STORE_ID } from '../constants';\nimport { updateCartTotals, updatePromoCodeDetails, validateBasket } from '../cart/cart';\nimport { toggleLocationIcon } from './pickUpInStore/ispuHelper';\n\nconst $body = $('body');\nconst hiddenClass = 'd-none';\nlet ispuContainer = queryFirst('.pickup-in-store-container');\nlet ispuModalContainer = $('.lp-slideout-modal[id*=\"pick-up-in-store\"]');\nconst pickUpInStoreButton = queryFirst('.btn-in-store-pickup');\nconst isRecognizedUser = pickUpInStoreButton && pickUpInStoreButton.dataset.isRecognizedUser === 'true';\nconst ispuClosestParent = $('.product-detail, .cart-page');\n\n/**\n * This method checks if the user is on cart page\n * @returns {boolean} is cart page or not\n */\nfunction isInCartPage() {\n const cartPage = queryFirst('.cart-page');\n return !!cartPage;\n}\n\n/**\n * This method checks if the user is on PDP page\n * @returns {boolean} is PDP page or not\n */\nfunction isInPdpPage() {\n const pdpPage = queryFirst('.pdp-container');\n return !!pdpPage;\n}\n\n/**\n * This method returns ISPU cart line items details\n * @returns {Object} ISPU cart line items details\n */\nfunction getIspuCartLineItemDetails() {\n const storePickupInfo = queryFirst('.cart-page .store-pickup-info');\n const ispuLineItems = queryAll('.cart-product-line-item', storePickupInfo);\n let ispuLineItemsData = [];\n if (ispuLineItems) {\n ispuLineItems.forEach(ispuLineItem => {\n const { pid, uuid } = ispuLineItem.dataset;\n const quantity = queryFirst('.quantity', ispuLineItem).value;\n ispuLineItemsData.push({\n pid,\n uuid,\n quantity\n });\n });\n }\n return ispuLineItemsData;\n}\n\n/**\n * This method handles the store results content\n * @param {Object} data store results\n */\nfunction handleStoreResults(data) {\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n const productDetails = queryFirst('.pickup-in-store-product', ispuContainer);\n addClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n if (data.storesResultsHtml) {\n storeResults.innerHTML = data.storesResultsHtml;\n noStoresMessage.textContent = '';\n if (!data.isCartPage) {\n removeClass(productDetails, hiddenClass);\n }\n removeClass(storeResults, hiddenClass);\n addClass(noStoresMessage, hiddenClass);\n\n if (isRecognizedUser && data.preferredStore) {\n setItemInLocalStorage(PREFERRED_STORE_ID, data.preferredStore.ID);\n }\n } else if (data.noStoresErrorMessage) {\n noStoresMessage.innerHTML = data.noStoresErrorMessage;\n if (!data.isCartPage) {\n addClass(productDetails, hiddenClass);\n }\n addClass(storeResults, hiddenClass);\n removeClass(noStoresMessage, hiddenClass);\n }\n ispuModalContainer.spinner().stop();\n}\n\n/**\n * This method handles the store confirmation results content\n * @param {Object} data store results\n */\nfunction handleConfirmStoreResults(data) {\n const storeConfirm = queryFirst('.pick-up-confirm-section', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n const storeForm = queryFirst('.find-stores-form', ispuContainer);\n storeConfirm.innerHTML = data.storesResultsHtml;\n if (data.storesResultsHtml) {\n removeClass(storeConfirm, hiddenClass);\n addClass([storeResults, storeForm], hiddenClass);\n }\n ispuModalContainer.spinner().stop();\n}\n\n/**\n * This method is an error handler of ajax call\n */\nfunction errorCallBack() {\n ispuModalContainer.spinner().stop();\n}\n\n// Event listener to retrieve store results on click of Pick up in store in PDP\n$('.pdp-in-store-inventory, .cart-page').on('click', '.btn-in-store-pickup', event => {\n const { target } = event;\n const { actionUrl, pid, googleKey, productName, swatchName, masterId } = target.dataset;\n const isCartPage = isInCartPage();\n const ispuContainerDataset = ispuContainer.dataset;\n const mixinData = {\n products: pid,\n isCartPage\n };\n includeGoogleMaps(googleKey);\n if (!isCartPage) {\n ispuModalContainer = $(target).closest('.product-detail').find('.lp-slideout-modal[id*=\"pick-up-in-store\"]');\n ispuContainer = queryFirst('.lp-slideout-modal .pickup-in-store-container', target.closest('.product-detail'));\n }\n ispuContainerDataset.pid = pid;\n ispuContainerDataset.productName = productName;\n ispuContainerDataset.swatchName = swatchName;\n ispuContainerDataset.masterId = masterId;\n if (isRecognizedUser) {\n const storeId = getItemFromLocalStorage(PREFERRED_STORE_ID);\n\n if (storeId) {\n mixinData.storeID = storeId;\n }\n }\n if (ispuContainerDataset.selectStoreView === 'true') {\n mixinData.selectStoreView = true;\n }\n if (isCartPage) {\n const quantity = queryFirst('.quantity', target.closest('.cart-product-line-item')).value;\n mixinData.quantity = quantity;\n const { uuid } = target.dataset;\n ispuContainerDataset.uuid = uuid;\n ispuContainerDataset.quantity = quantity;\n addClass(queryFirst('.pickup-in-store-product'), hiddenClass);\n }\n geolocate(data => {\n ispuModalContainer.spinner().start();\n toggleLocationIcon(true, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n }, mixinData, data => {\n toggleLocationIcon(false, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n });\n});\n\n// Event listener to select a store from ISPU drawer\nispuClosestParent.on('click', '.btn-select-store', event => {\n const { target } = event;\n const { storeId } = target.dataset;\n const productContainer = target.closest('.product-detail');\n\n $body.trigger('product:updateStoreInventory', { storeId, productContainer });\n\n $(target)\n .closest('.lp-slideout-modal')\n .modal('hide');\n});\n\n// Event Listener for edit pick up store link in cart page\n$('.cart-page').on('click', '.btn-edit-store-pickup', event => {\n ispuContainer.dataset.editStore = 'true';\n const products = null;\n const { actionUrl, googleKey } = event.target.dataset;\n includeGoogleMaps(googleKey);\n addClass(queryFirst('.pickup-in-store-product'), hiddenClass);\n const mixinData = {\n products,\n isCartPage: true\n };\n geolocate(data => {\n ispuModalContainer.spinner().start();\n toggleLocationIcon(true, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n }, mixinData, data => {\n toggleLocationIcon(false, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n });\n});\n\n/**\n * This method retrieves store results based on zipcode, city or state\n * @param {Object} locationData google location data based on input value\n */\nfunction handleInStore(locationData) {\n const { latitude, longitude, address, actionUrl, forceGeoLocation } = locationData;\n const ispuContainerDataset = ispuContainer.dataset;\n const isEditStore = JSON.parse(ispuContainerDataset.editStore || 'false');\n let products = null;\n if (!isEditStore) {\n products = ispuContainerDataset.pid + ':' + ispuContainerDataset.quantity;\n }\n const isCartPage = isInCartPage();\n const data = {\n products,\n latitude,\n longitude,\n inputSearchParameter: address,\n isCartPage,\n forceGeoLocation\n };\n if (ispuContainerDataset.selectStoreView === 'true') {\n data.selectStoreView = true;\n }\n if (isRecognizedUser) {\n const storeId = getItemFromLocalStorage(PREFERRED_STORE_ID);\n if (storeId) {\n data.storeID = storeId;\n }\n }\n ispuModalContainer.spinner().start();\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n}\n\n// Event listener to retrieve store results based on input search in pick up in store drawer\nispuClosestParent.on('submit', '.find-stores-form', event => {\n event.preventDefault();\n const { target } = event;\n const actionUrl = target.getAttribute('action');\n const address = queryFirst('.find-store-input', target.closest('.find-stores-form')).value;\n if (address) {\n getLatLong(handleInStore, {\n address,\n actionUrl\n });\n }\n});\n\n/**\n * This method retrieves store results based on zipcode, city or state after preferred store slection\n * @param {Object} locationData google location data based on input value\n */\nfunction handlePreferredStore(locationData) {\n const url = queryFirst('.preferred-store-input').dataset.actionUrl;\n const isCartPage = isInCartPage();\n const { latitude, longitude, address, storeID, products } = locationData;\n const data = {\n products,\n latitude,\n longitude,\n inputSearchParameter: address,\n storeID,\n isCartPage,\n selectStoreView: isInPdpPage()\n };\n ispuModalContainer.spinner().start();\n getJSON(url, 'POST', data, handleStoreResults, errorCallBack);\n}\n\n// Event listener to update preferred store and rerender store results\nispuClosestParent.on('click', '.preferred-store-input', event => {\n const { target } = event;\n const isEditStore = JSON.parse(ispuContainer.dataset.editStore);\n let products = null;\n if (!isEditStore) {\n products = ispuContainer.dataset.pid;\n }\n const address = queryFirst('.find-store-input').value;\n const { dataset } = target;\n const { actionUrl, storeId } = dataset;\n const isCartPage = isInCartPage();\n const mixinData = {\n products,\n storeID: storeId,\n isCartPage\n };\n if (isCartPage && !isEditStore) {\n mixinData.quantity = ispuContainer.dataset.quantity;\n }\n if (address) {\n mixinData.address = address;\n getLatLong(handlePreferredStore, mixinData);\n } else {\n const isCartPage = isInCartPage();\n geolocate(\n data => {\n ispuModalContainer.spinner().start();\n getJSON(actionUrl, 'POST', data, handleStoreResults);\n },\n {\n products,\n storeID: storeId,\n isCartPage,\n selectStoreView: isInPdpPage()\n },\n data => {\n getJSON(actionUrl, 'POST', data, handleStoreResults);\n }\n );\n }\n});\n\n// Event listener to render pick up in store confirmation template\nispuClosestParent.on('click', '.pick-up-confirm-button', event => {\n const { dataset } = event.target;\n const { actionUrl, storeId } = dataset;\n const isCartPage = isInCartPage();\n const data = {\n storeID: storeId,\n isCartPage\n };\n ispuModalContainer.spinner().start();\n getJSON(actionUrl, 'GET', data, handleConfirmStoreResults, errorCallBack);\n});\n\n// Event listener to ISPU store confirmation in cart\nispuClosestParent.on('click', '.store-confirm-button', event => {\n const { target } = event;\n const { actionUrl } = target.dataset;\n const storeID = target.closest('.store-details').dataset.storeId;\n const isEditStore = JSON.parse(ispuContainer.dataset.editStore);\n let data;\n if (isEditStore) {\n const productsInfo = JSON.stringify(getIspuCartLineItemDetails());\n data = {\n productsInfo,\n storeID\n };\n } else {\n const { pid, uuid, quantity } = ispuContainer.dataset;\n data = {\n pid,\n uuid,\n quantity,\n storeID\n };\n }\n ispuModalContainer.spinner().start();\n getJSON(\n actionUrl,\n 'POST',\n data,\n data => {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n ispuModalContainer.spinner().stop();\n ispuModalContainer.modal('hide');\n $('.add-to-cart-messages').remove();\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
');\n }\n $('.add-to-cart-messages').append('
' + lineItemErrorMessage + '
');\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n } else {\n const { cartProductsHtml, totals } = data;\n const { discountsHtml } = totals;\n const couponsEl = queryFirst('.coupons-and-promos');\n\n if (couponsEl && discountsHtml) {\n couponsEl.innerHTML = discountsHtml;\n }\n if (cartProductsHtml) {\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n queryFirst('.cart-products').innerHTML = cartProductsHtml;\n removeClass(queryFirst('.cart-pickup-products'), hiddenClass);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n validateBasket(data);\n $('body').trigger('cart:update');\n ispuModalContainer.spinner().stop();\n ispuModalContainer.modal('hide');\n }\n }\n },\n () => {\n ispuModalContainer.spinner().stop();\n }\n );\n});\n\n// Event listener to toggle store details accordion label\nispuClosestParent.on('click', '.store-locator-container .store-btn-link', event => {\n const { target } = event;\n queryFirst('.collapsed', target).classList.toggle(hiddenClass);\n queryFirst('.expanded', target).classList.toggle(hiddenClass);\n});\n\n// Event listener to show stores to select on click of change location on pickup confirmation page\nispuClosestParent.on('click', '.change-location-link', () => {\n addClass(queryFirst('.pick-up-confirm-section'), hiddenClass);\n removeClass(queryAll('.pick-up-in-stores, .find-stores-form'), hiddenClass);\n});\n\n// Event listener to remove no stores error message on change of ISPU search input\nispuClosestParent.on('keyup', '.find-store-input', (event) => {\n queryFirst('.store-locator-no-results', ispuModalContainer[0]).textContent = '';\n queryFirst('.pick-up-in-stores', ispuContainer).innerHTML = '';\n addClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n const findStoreSubmit = queryFirst('.find-store-submit', ispuContainer);\n if (event.target.value) {\n findStoreSubmit.removeAttribute('disabled');\n } else {\n findStoreSubmit.disabled = true;\n }\n});\n\n$('.lp-slideout-modal[id*=\"pick-up-in-store\"]').on('hidden.bs.modal', () => {\n queryFirst('.find-store-input', ispuContainer).value = '';\n removeClass(queryAll('.pickup-in-store-product, .find-stores-form', ispuContainer), hiddenClass);\n queryFirst('.pick-up-in-stores', ispuContainer).innerHTML = '';\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const confirmSection = queryFirst('.pick-up-confirm-section', ispuContainer);\n const geolocateError = queryFirst('.geo-location-error', ispuContainer);\n confirmSection.innerHTML = '';\n addClass([confirmSection, noStoresMessage, geolocateError], hiddenClass);\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n if (isInCartPage()) {\n ispuContainer.dataset.editStore = 'false';\n }\n});\n\n// Event listener to retrieve geo location based store results on click of use current location\nispuClosestParent.on('click', '.detect-location', event => {\n const { target } = event;\n const { actionUrl } = target.dataset;\n const mixinData = { actionUrl, forceGeoLocation: true };\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n queryFirst('.find-store-input', ispuContainer).value = '';\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n geolocate(handleInStore, mixinData, () => {\n removeClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n addClass([storeResults, noStoresMessage], hiddenClass);\n });\n});\n","'use strict';\n\nconst { queryFirst, addClass, removeClass, queryAll, setAttribute, removeAttribute, hasClass } = require('../domUtil');\nconst { getJSON, appendToUrl, getNestedValue, setItemInLocalStorage } = require('../util');\nconst { shippingPreferences } = require('../templates').shippingPreferenceTemplates;\nconst { ispuSelectStyleMessageTmpl } = require('../templates').productDetail;\nconst { isShippingPreferencesViewEnabled } = require('../product/helper');\nconst {\n getChangeStoreLinkEl, getSelectedPreferenceEl, getShippingPreferencesContainerEl, getISPUradioButtonEl, getSelectedSizeEl,\n getShipToAddressradioButtonEl, getISPUPreferenceContentEl, addStoreNameClass, removeStoreNameClass,\n selectISPURadioButton, selectShipToRadioButton, getPreferedShippingPreference, disableISPURadioButton, disableShipToRadioButton, getShipToAddressContentEl, updateVisibilityOfLowInventoryMsg\n} = require('./shippingPreference/shippingPreferenceHelper');\nconst { updateShipToInventoryMessages, updateISPUInventoryMessages, clearAllInventoryMessages, updateServiceResponseMessage, clearServiceResponseMessage } = require('./shippingPreference/inventoryMessaging');\nconst { injectISPUDeliveryMessage, clearISPUDeliveryMessage, showISPUDeliveryMessage, hideISPUDeliveryMessage } = require('./shippingPreference/ispuDeliveryMessaging');\nconst { getStoreDetailEl, addStoreDetail } = require('./shippingPreference/storeDetailHelper');\nconst { isEDDApplicable, injectEDDInfo, removeEDDInfo } = require('./pdpEdd');\nconst { EMPTY_STRING, HIDDEN_CLASS, NOT_AVAILABLE_STATUS } = require('../constants');\nconst {\n DISABLED_CLASS, PRODUCT_DETAIL_CONTAINER_SELECTOR, SHIPPING_PREFERENCES_CONTAINER_SELECTOR, ISPU_SELECT_STYLE_MESSAGE_SELECTOR, ISPU_SERVICE_ERROR_ATTR_NAME,\n ISPU_RADIO_VALUE, SHIP_TO_RADIO_VALUE, SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR, CHANGE_STORE_LINK_SELECTOR, SHIPPING_PREFERENCE_KEY, RADIO_BUTTON_LABEL_SELECTOR, STORE_DETAIL_SELECTOR, ISPU_INFO_MESSAGE_SELECTOR,\n PDP_CONTAINER_SELECTOR, AVAILABILITY_MSG_SELECTOR, NOT_AVAILABLE_CLASS, ISPU_SERVICE_BLOCKED, PRE_ORDER_CLASS, SHIP_TO_LOW_INVENTORY_CLASS\n} = require('./shippingPreference/constants');\n\nconst $body = $('body');\nconst $shippingPreferenceContainer = $(SHIPPING_PREFERENCES_CONTAINER_SELECTOR); // jQuery version, Used only for spinner\n\nconst shippingPreferencesConfig = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig') || {};\nconst { isEnabled, messages, reasonCodes } = shippingPreferencesConfig;\nconst inventoryCache = {};\n\n/**\n * Function to clear out any existing error/info messages\n * @param {HTMLElement} productContainer - Product container\n */\nfunction clearAllMessages(productContainer) {\n clearServiceResponseMessage(productContainer);\n clearAllInventoryMessages(productContainer);\n clearISPUDeliveryMessage(productContainer);\n}\n\n/**\n * Function to reset radio button view and state\n * @param {HTMLElement} productContainer - Product container\n */\nfunction resetPreferences(productContainer) {\n const shipToRadioButtonEl = getShipToAddressradioButtonEl(productContainer);\n shipToRadioButtonEl.disabled = false;\n removeClass(shipToRadioButtonEl.nextElementSibling, DISABLED_CLASS);\n const shipToAddressContentEl = getShipToAddressContentEl(productContainer);\n removeClass(shipToAddressContentEl, DISABLED_CLASS);\n\n const ispuRadioButtonEl = getISPUradioButtonEl(productContainer);\n ispuRadioButtonEl.disabled = false;\n removeClass(ispuRadioButtonEl.nextElementSibling, DISABLED_CLASS);\n const ispuPreferenceContentEl = getISPUPreferenceContentEl(productContainer);\n removeClass(ispuPreferenceContentEl, DISABLED_CLASS);\n}\n\n/**\n * Function to inject dynamically generated HTML into DOM\n * @param {HTMLElement} productContainerEl - Product container element\n * @param {boolean} preferISPU - A flag to select the ISPU radio on load\n * @param {Object} messages - map of messages\n */\nfunction injectShippingPreferences(productContainerEl, preferISPU, messages) {\n const shippingPreferencesContainerEl = getShippingPreferencesContainerEl(productContainerEl);\n if (shippingPreferencesContainerEl) {\n const { preferenceIspuLabel, preferenceShipToAddressLabel, changeStoreLabel } = messages || {};\n const shippingPreferencesHTML = shippingPreferences(preferenceIspuLabel, ISPU_RADIO_VALUE, preferenceShipToAddressLabel, SHIP_TO_RADIO_VALUE, changeStoreLabel, preferISPU);\n $(shippingPreferencesContainerEl).html(shippingPreferencesHTML);\n }\n}\n\n/**\n * Function to handle successful inventory api response\n * @param {Object} response - Service response\n * @param {HTMLElement} productContainer - Product container element\n */\nfunction handleISPUInventoryResponse(response, productContainer) {\n const { success } = response;\n\n clearAllMessages(productContainer);\n resetPreferences(productContainer);\n let storeDetailEl = getStoreDetailEl(productContainer);\n if (storeDetailEl) {\n storeDetailEl.textContent = EMPTY_STRING;\n }\n\n const ispuRadioButtonEl = getISPUradioButtonEl(productContainer);\n const shipToRadioButtonEl = getShipToAddressradioButtonEl(productContainer);\n const changeStoreLinkEl = getChangeStoreLinkEl(productContainer);\n const selectedSizeEl = getSelectedSizeEl(productContainer);\n removeClass(changeStoreLinkEl, ISPU_SERVICE_BLOCKED);\n\n if (success) {\n removeAttribute(ispuRadioButtonEl, ISPU_SERVICE_ERROR_ATTR_NAME);\n window.ispuProductInventory = response;\n const { store, instorePickupStoreMsg } = response;\n\n // Add store details to DOM\n addStoreDetail(store, productContainer);\n injectISPUDeliveryMessage(instorePickupStoreMsg, productContainer);\n hideISPUDeliveryMessage(productContainer);\n\n if (ispuRadioButtonEl.checked) {\n // On Add to cart button click\n // it takes store-id from DIV element having 'store-name' class, making it ISPU add to cart.\n addStoreNameClass(productContainer);\n }\n\n // Reset change store link\n removeClass(changeStoreLinkEl, HIDDEN_CLASS);\n\n // Show store details, if the size is selected\n if (selectedSizeEl) {\n $(selectedSizeEl).trigger('click');\n removeClass(storeDetailEl, HIDDEN_CLASS);\n removeClass(changeStoreLinkEl, DISABLED_CLASS);\n } else {\n storeDetailEl = queryFirst(STORE_DETAIL_SELECTOR, document);\n addClass(storeDetailEl, HIDDEN_CLASS);\n addClass(changeStoreLinkEl, DISABLED_CLASS);\n\n // Displaying 'Select size message'\n const ispuAvailabilityMessageEl = queryFirst(ISPU_SELECT_STYLE_MESSAGE_SELECTOR, productContainer);\n const { selectStylesMessage } = messages;\n if (ispuAvailabilityMessageEl && selectStylesMessage) {\n ispuAvailabilityMessageEl.innerHTML = !selectedSizeEl ? ispuSelectStyleMessageTmpl(selectStylesMessage) : EMPTY_STRING;\n }\n }\n\n // Update the stock of sizes according to ISPU store, only if store is selected\n if (store && store.ID) {\n updateOutOfStockSizeForIspu();\n }\n } else {\n setAttribute(ispuRadioButtonEl, ISPU_SERVICE_ERROR_ATTR_NAME, true);\n window.ispuProductInventory = { variants: {} };\n let wrapErrorMessage = false;\n disableISPURadioButton(productContainer, ispuRadioButtonEl, true);\n\n // Switch to 'Ship to address' radio button\n selectShipToRadioButton(productContainer, shipToRadioButtonEl, true);\n\n const { message, reasonCode } = response;\n let ispuPreferenceContentEl;\n let store;\n switch (reasonCode) {\n case reasonCodes.NO_STORES_FOUND:\n // Show change store link to select a new store, if nearest store is not found.\n removeClass(changeStoreLinkEl, HIDDEN_CLASS);\n break;\n case reasonCodes.STORES_SERVICE_DOWN:\n wrapErrorMessage = true;\n // Hide change store link\n addClass(changeStoreLinkEl, HIDDEN_CLASS);\n\n // Disable the ISPU section\n ispuPreferenceContentEl = getISPUPreferenceContentEl(productContainer);\n addClass(ispuPreferenceContentEl, DISABLED_CLASS);\n break;\n case reasonCodes.STORE_UNAVAILABLE:\n store = response.store;\n if (store) {\n addStoreDetail(store, productContainer);\n }\n\n // Disable the ISPU section\n ispuPreferenceContentEl = getISPUPreferenceContentEl(productContainer);\n addClass(ispuPreferenceContentEl, DISABLED_CLASS);\n break;\n default: break;\n }\n\n // Show the info message why it got disabled\n if (message) {\n updateServiceResponseMessage(message, wrapErrorMessage, productContainer);\n }\n\n if (!selectedSizeEl) {\n addClass(changeStoreLinkEl, DISABLED_CLASS);\n }\n }\n}\n\n/**\n * Function to handle failure inventory api response\n * @param {Object} error - Service response\n * @param {HTMLElement} productContainer - Product container element\n */\nfunction handleISPUInventoryError(error, productContainer) {\n window.ispuProductInventory = { variants: {} };\n clearAllMessages(productContainer);\n resetPreferences(productContainer);\n\n // Disable ISPU radio button and display error message\n disableISPURadioButton(productContainer, null, true);\n const { errorMessage } = messages;\n updateServiceResponseMessage(errorMessage, true, productContainer);\n const changeStoreLinkEl = getChangeStoreLinkEl(productContainer);\n addClass(changeStoreLinkEl, ISPU_SERVICE_BLOCKED);\n\n // Fallback to ship to address radio button\n selectShipToRadioButton(productContainer);\n}\n\n/**\n * Function to updateOutOfStockSize to instock if pickup instore is available for the size\n */\nfunction updateOutOfStockSizeForIspu() {\n const { ispuProductInventory, productInfo } = window;\n const pdpContainer = queryFirst(PDP_CONTAINER_SELECTOR);\n const productId = pdpContainer.dataset.masterid;\n const selectedColorElement = queryFirst('.color-attribute .swatch-circle.selected', document);\n const selectedColorValue = selectedColorElement.dataset.attrValue;\n const variationGroup = getNestedValue(productInfo, '{0}.variants.{1}', productId, selectedColorValue);\n if (variationGroup) {\n queryAll('.size-container li').forEach(el => {\n const sizeBtn = queryFirst('button', el);\n if (hasClass(sizeBtn, NOT_AVAILABLE_CLASS)) {\n const attributeValue = sizeBtn.dataset.attrValue;\n const getVariationJson = variationGroup.sizes[attributeValue];\n const checkStoreAvailability = (getVariationJson && getNestedValue(ispuProductInventory, 'variants.{0}.availabilityStatus', getVariationJson.ID));\n if (checkStoreAvailability !== NOT_AVAILABLE_STATUS) {\n removeClass(sizeBtn, NOT_AVAILABLE_CLASS);\n }\n }\n });\n }\n}\n/**\n * Function to initialize events on shipping preferences section\n * @param {string?} storeId - storeId in from user session\n */\nfunction initializeEvents() {\n /*\n Gets triggered twice\n #1 On color swatch selection\n #2 On selecting a store from the drawer\n */\n $body.on('product:updateStoreInventory', (event, data) => {\n const { productContainer, storeId } = data;\n const shippingPreferencesContainerEl = getShippingPreferencesContainerEl(productContainer);\n\n // Fetching selected swatch product id from dataset\n const selectedSwatchButton = queryFirst('.swatch-circle.selected', productContainer).closest('.color-attribute');\n if (selectedSwatchButton) {\n const { productId } = selectedSwatchButton.dataset;\n const actionUrl = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig.actionUrl') || EMPTY_STRING;\n if (!actionUrl) return;\n\n // Build params for API call\n const params = { pid: productId };\n let skipCall = false;\n if (storeId) {\n window.lillyUtils.shippingPreferencesConfig.storeId = params.storeID = storeId;\n } else {\n const sessionStoreId = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig.storeId') || EMPTY_STRING;\n if (sessionStoreId === 'null') {\n skipCall = true;\n } else if (sessionStoreId) {\n params.storeID = sessionStoreId;\n }\n }\n if (skipCall) {\n handleISPUInventoryResponse({\n success: false,\n reasonCode: reasonCodes.NO_STORES_FOUND,\n message: messages.noStoresFound\n }, productContainer);\n return;\n }\n const paramHash = productId + (params.storeID || '');\n if (inventoryCache[paramHash]) {\n handleISPUInventoryResponse(inventoryCache[paramHash], productContainer);\n return;\n }\n const urlWithParams = appendToUrl(actionUrl, params);\n\n // Spinner for shipping preferences element\n const $spinner = $(shippingPreferencesContainerEl).spinner();\n $spinner.start();\n\n // Service call\n getJSON(urlWithParams, 'GET', null,\n (response) => {\n inventoryCache[paramHash] = response;\n handleISPUInventoryResponse(response, productContainer);\n $spinner.stop();\n },\n (error) => {\n handleISPUInventoryError(error, productContainer);\n $spinner.stop();\n });\n }\n });\n\n $body.on('product:pdpSizeSelected', ($event, data) => {\n const { productContainer } = data;\n\n const storeDetailEl = getStoreDetailEl(productContainer);\n const changeStoreLinkEl = getChangeStoreLinkEl(productContainer);\n\n // If ISPU enabled, hiding the availability message for ship to address and\n // handling it from updateVisibilityOfLowInventoryMsg method\n const availabilityElement = queryFirst(AVAILABILITY_MSG_SELECTOR);\n addClass(availabilityElement, HIDDEN_CLASS);\n\n if (storeDetailEl) {\n removeClass(storeDetailEl, HIDDEN_CLASS);\n removeClass(changeStoreLinkEl, DISABLED_CLASS);\n } else {\n const storeServiceResponse = queryFirst(ISPU_INFO_MESSAGE_SELECTOR, document);\n addClass(storeServiceResponse, HIDDEN_CLASS);\n }\n updateVisibilityOfLowInventoryMsg(productContainer);\n });\n\n $body.on('product:inventoryStatus', function ($event, data) {\n const { shipToAddressAvailabilityStatus, inStorePickUpAvailabilityStatus, isStorePickUpLowInventory, inStorePickUpAvailabilityMessage, inStorePickUpLowStockMessage, productContainer } = data;\n\n const changeStoreLinkEl = getChangeStoreLinkEl(productContainer);\n const ispuRadioButtonEl = getISPUradioButtonEl(productContainer);\n const shipToRadioButtonEl = getShipToAddressradioButtonEl(productContainer);\n\n if (!ispuRadioButtonEl || !shipToRadioButtonEl) {\n return;\n }\n\n // Reset the radio button's state\n removeAttribute(ispuRadioButtonEl, 'disabled');\n removeAttribute(shipToRadioButtonEl, 'disabled');\n\n // Reset the change store link state\n removeClass(changeStoreLinkEl, HIDDEN_CLASS);\n removeClass(changeStoreLinkEl, DISABLED_CLASS);\n\n // Updating inventory messages\n updateShipToInventoryMessages(shipToAddressAvailabilityStatus, messages, productContainer);\n const ispuAvailabilityMessageEl = queryFirst(ISPU_SELECT_STYLE_MESSAGE_SELECTOR, productContainer);\n ispuAvailabilityMessageEl.innerHTML = EMPTY_STRING;\n if (!ispuRadioButtonEl.hasAttribute(ISPU_SERVICE_ERROR_ATTR_NAME)) {\n updateISPUInventoryMessages(inStorePickUpAvailabilityStatus, isStorePickUpLowInventory, inStorePickUpAvailabilityMessage, inStorePickUpLowStockMessage, messages, productContainer);\n }\n\n const preferenceValue = getPreferedShippingPreference();\n if (inStorePickUpAvailabilityStatus !== NOT_AVAILABLE_STATUS) { // ISPU is available\n showISPUDeliveryMessage(productContainer);\n\n // Enable ISPU content\n const ispuContentEl = getISPUPreferenceContentEl(productContainer);\n const ispuLabelEl = queryFirst(RADIO_BUTTON_LABEL_SELECTOR, ispuRadioButtonEl.parentElement);\n removeClass([ispuContentEl, ispuLabelEl], DISABLED_CLASS);\n ispuRadioButtonEl.disabled = false;\n\n const selectedPreferenceEl = getSelectedPreferenceEl(productContainer);\n\n // If previously user preference is ISPU and (if there is no radio button selected or selected radio is not ISPU)\n if (preferenceValue === ISPU_RADIO_VALUE &&\n (!selectedPreferenceEl || (selectedPreferenceEl !== ispuRadioButtonEl))) {\n selectISPURadioButton(productContainer, ispuRadioButtonEl);\n }\n } else { // ISPU is not available\n disableISPURadioButton(productContainer, ispuRadioButtonEl, true);\n hideISPUDeliveryMessage(productContainer);\n }\n\n if (shipToAddressAvailabilityStatus !== NOT_AVAILABLE_STATUS) { // Ship to address is available\n // Enable ship To content\n const shipToContentEl = getShipToAddressContentEl(productContainer);\n const shipToLabelEl = queryFirst(RADIO_BUTTON_LABEL_SELECTOR, shipToRadioButtonEl.parentElement);\n removeClass([shipToContentEl, shipToLabelEl], DISABLED_CLASS);\n shipToRadioButtonEl.disabled = false;\n\n const selectedPreferenceEl = getSelectedPreferenceEl(productContainer);\n\n // Fallback to shipTo if no radio button is selected (If ISPU is unavailable)\n if (!selectedPreferenceEl) {\n selectShipToRadioButton(productContainer, shipToRadioButtonEl);\n }\n } else { // Ship to address is not available\n disableShipToRadioButton(productContainer, shipToRadioButtonEl, true);\n\n // If ISPU is available\n if (inStorePickUpAvailabilityStatus !== NOT_AVAILABLE_STATUS) {\n selectISPURadioButton(productContainer, ispuRadioButtonEl);\n }\n }\n // Displaying Ship To EDD information\n if (isEDDApplicable(shipToAddressAvailabilityStatus)) {\n injectEDDInfo(productContainer);\n } else {\n removeEDDInfo(productContainer);\n }\n });\n\n // On shipping preference radio button 'change'\n $shippingPreferenceContainer.on('change', SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR, (event) => {\n const radioButtonEl = event.target;\n const productContainer = radioButtonEl.closest(PRODUCT_DETAIL_CONTAINER_SELECTOR);\n\n // On Add to cart button click\n // it takes store-id from DIV element having 'store-name' class, making it ISPU add to cart.\n if (radioButtonEl.checked &&\n radioButtonEl.value === ISPU_RADIO_VALUE) {\n setItemInLocalStorage(SHIPPING_PREFERENCE_KEY, ISPU_RADIO_VALUE);\n addStoreNameClass(productContainer);\n } else {\n setItemInLocalStorage(SHIPPING_PREFERENCE_KEY, SHIP_TO_RADIO_VALUE);\n removeStoreNameClass(productContainer);\n }\n updateVisibilityOfLowInventoryMsg(productContainer);\n });\n\n // On change-store link 'click'\n $shippingPreferenceContainer.on('click', CHANGE_STORE_LINK_SELECTOR, (event) => {\n const productContainerEl = event.target.closest(PRODUCT_DETAIL_CONTAINER_SELECTOR);\n if (!getSelectedSizeEl(productContainerEl)) return;\n\n // artificially call instore pickup dialog\n const $inStorePickupButton = $('.btn-in-store-pickup');\n $inStorePickupButton.trigger('click');\n\n // return focus to initial link after modal close\n const $targetModal = $($inStorePickupButton.data('target'));\n const trigger = event.target;\n $targetModal.one('hidden.bs.modal', () => trigger.focus());\n });\n}\n\n// Injecting radio button and content dynamically\nif (isShippingPreferencesViewEnabled()) {\n if (isEnabled && $shippingPreferenceContainer.length) {\n // Injects shipping preferences radio buttons\n const preferISPU = getPreferedShippingPreference() === ISPU_RADIO_VALUE;\n queryAll(PRODUCT_DETAIL_CONTAINER_SELECTOR).forEach(el => {\n injectShippingPreferences(el, preferISPU, messages);\n });\n\n // Updates data attribute on ISPU container to display select store view\n setAttribute(queryAll('.pickup-in-store-container'), 'data-select-store-view', true);\n\n // Hides Store Pick Up button exists below add to cart button\n addClass(queryAll('.pdp-in-store-inventory'), HIDDEN_CLASS);\n\n // Attaches events on radio button changes, color swatch changes, size changes, change store link\n initializeEvents();\n }\n}\n","// Classnames\nconst DISABLED_CLASS = 'disabled-section';\nconst NOT_AVAILABLE_CLASS = 'not-available';\nconst ISPU_STORE_NAME_CLASS = 'store-name';\nconst ISPU_SERVICE_ERROR_ATTR_NAME = 'data-ispu-service-down';\nconst ISPU_SERVICE_BLOCKED = 'service-blocked';\nconst PRE_ORDER_CLASS = 'pre-order';\nconst SHIP_TO_LOW_INVENTORY_CLASS = 'ship-to-low-inventory';\nconst CHECKOUT_HIDDEN_CLASS = 'checkout-hidden';\n\n// Container selectors\nconst PRODUCT_DETAIL_CONTAINER_SELECTOR = '.product-detail';\nconst PDP_CONTAINER_SELECTOR = '.pdp-container';\nconst SHIPPING_PREFERENCES_CONTAINER_SELECTOR = '.shipping-preferences';\nconst STORE_DETAIL_CONTAINER_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .store-detail-container';\n\n// Radio buttons classes\nconst PREFERENCE_SELECTOR = 'input[name=\"shipping-preference\"]:checked';\nconst ISPU_PREFERENCE_CONTAINER_SELECTOR = '.ispu-preference-container';\nconst ISPU_PREFERENCE_CONTENT_SELECTOR = ISPU_PREFERENCE_CONTAINER_SELECTOR + ' .content';\nconst SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR = 'input[name=shipping-preference]';\nconst ISPU_RADIO_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .preference-ispu';\nconst SHIP_TO_ADDRESS_RADIO_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .preference-ship-to-address';\nconst SHIP_TO_ADDRESS_CONTENT_SELECTOR = '.ship-to-address-preference-container .content';\nconst RADIO_BUTTON_LABEL_SELECTOR = '.form-check-label';\n\n// Radio button values\nconst SHIPPING_PREFERENCE_KEY = 'SHIPPING_PREFERENCE';\nconst ISPU_RADIO_VALUE = 'ISPU';\nconst SHIP_TO_RADIO_VALUE = 'SHIP_TO_ADDRESS';\nconst BOLT_PAY = 'BOLT_PAY';\n\n// Change Store link\nconst CHANGE_STORE_LINK_SELECTOR = '.change-store-link';\n\n// Store name and store address section\nconst STORE_DETAIL_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .store-detail';\n\n// Inventory and service messages\nconst STORE_SERVICE_INFO_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .service-info-message';\nconst STORE_AVAILABILITY_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .inventory-message';\n\nconst ISPU_INFO_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .ispu-info-message';\nconst SHIP_TO_INFO_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .ship-to-info-message';\n\nconst ISPU_SELECT_STYLE_MESSAGE_SELECTOR = ISPU_PREFERENCE_CONTAINER_SELECTOR + ' .select-size-info-msg';\n\n//Availability Message Element\nconst AVAILABILITY_MSG_SELECTOR = '.product-availability .availability-message-text';\n//Inventory Message Element of ISPU\nconst INVENTORY_MSG_SELECTOR = '.inventory-message .availability-message-text';\n//Low Stock Message Element of ISPU\nconst LOW_STOCK_ISPU_SELECTOR = '.product-availability .ispu-low-stock-msg';\n//Regular Expression for Valid WishList Name\nconst WISHLIST_NAME_REGEX = /^[ A-Za-z0-9\\]\\.()[{},;:\"'?!\\u2026\\u2018\\u2019\\u201B\\u201C\\u201D\\u2014\\u2013-]*$/;\n//Regular Expression for Valid Postal Code for Loyalty\nconst LOYALTY_POSTAL_CODE_REGEX = /^\\d{5}$/;\n\nconst TRACKER_FUNCTIONAL_COOKIE = 'C0003';\nconst MY_ACCOUNT = 'myAccount';\nconst ORDER_CONFIRMATION = 'orderConfirmation';\n\nmodule.exports = {\n DISABLED_CLASS,\n NOT_AVAILABLE_CLASS,\n ISPU_STORE_NAME_CLASS,\n PRE_ORDER_CLASS,\n SHIP_TO_LOW_INVENTORY_CLASS,\n ISPU_SERVICE_ERROR_ATTR_NAME,\n ISPU_SERVICE_BLOCKED,\n CHECKOUT_HIDDEN_CLASS,\n\n PRODUCT_DETAIL_CONTAINER_SELECTOR,\n PDP_CONTAINER_SELECTOR,\n SHIPPING_PREFERENCES_CONTAINER_SELECTOR,\n STORE_DETAIL_CONTAINER_SELECTOR,\n\n PREFERENCE_SELECTOR,\n ISPU_PREFERENCE_CONTAINER_SELECTOR,\n ISPU_PREFERENCE_CONTENT_SELECTOR,\n SHIP_TO_ADDRESS_CONTENT_SELECTOR,\n SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR,\n ISPU_RADIO_SELECTOR,\n SHIP_TO_ADDRESS_RADIO_SELECTOR,\n RADIO_BUTTON_LABEL_SELECTOR,\n SHIPPING_PREFERENCE_KEY,\n ISPU_RADIO_VALUE,\n SHIP_TO_RADIO_VALUE,\n BOLT_PAY,\n\n CHANGE_STORE_LINK_SELECTOR,\n STORE_DETAIL_SELECTOR,\n STORE_SERVICE_INFO_MESSAGE_SELECTOR,\n STORE_AVAILABILITY_MESSAGE_SELECTOR,\n ISPU_INFO_MESSAGE_SELECTOR,\n SHIP_TO_INFO_MESSAGE_SELECTOR,\n ISPU_SELECT_STYLE_MESSAGE_SELECTOR,\n AVAILABILITY_MSG_SELECTOR,\n INVENTORY_MSG_SELECTOR,\n LOW_STOCK_ISPU_SELECTOR,\n WISHLIST_NAME_REGEX,\n TRACKER_FUNCTIONAL_COOKIE,\n LOYALTY_POSTAL_CODE_REGEX,\n MY_ACCOUNT,\n ORDER_CONFIRMATION\n};\n","'use strict';\n\nconst { EMPTY_STRING, NOT_AVAILABLE_STATUS } = require('../../constants');\nconst { ISPU_INFO_MESSAGE_SELECTOR, SHIP_TO_INFO_MESSAGE_SELECTOR, STORE_AVAILABILITY_MESSAGE_SELECTOR, STORE_SERVICE_INFO_MESSAGE_SELECTOR, LOW_STOCK_ISPU_SELECTOR } = require('./constants');\nconst { injectMessageAndUpdateElementState } = require('./messagingUtil');\nconst { queryFirst } = require('../../domUtil');\n\n/**\n * Function to get ISPU non-availability element\n * @param {HTMLElement} productContainer - Product container Element\n * @returns {HTMLElement} ISPU non-availability element\n */\nfunction getISPUNotAvailableMessageEl(productContainer) {\n return queryFirst(ISPU_INFO_MESSAGE_SELECTOR, productContainer);\n}\n\n/**\n * Function to get Ship-To address non-availability element\n * @param {HTMLElement} productContainer - Product container Element\n * @returns {HTMLElement} Ship-To non-availability element\n */\nfunction getShipToNotAvailableMessageEl(productContainer) {\n return queryFirst(SHIP_TO_INFO_MESSAGE_SELECTOR, productContainer);\n}\n\n/**\n * Function to get ISPU inventory level message element ('Low stock')\n * @param {HTMLElement} productContainer - Product container Element\n * @returns {HTMLElement} ISPU inventory level message element\n */\nfunction getISPUInventoryLevelMessageEl(productContainer) {\n return queryFirst(STORE_AVAILABILITY_MESSAGE_SELECTOR, productContainer);\n}\n\n/**\n * Function to get ISPU inventory level message element above Add To Tote ('Low stock')\n * @param {HTMLElement} productContainer - Product container Element\n * @returns {HTMLElement} ISPU low inventory level message element\n */\n function getISPULowInventoryMessageEl(productContainer) {\n return queryFirst(LOW_STOCK_ISPU_SELECTOR, productContainer);\n}\n\n/**\n * Function to get ISPU service response messaging element ('No stores found')\n * @param {HTMLElement} productContainer - Product container Element\n * @returns {HTMLElement} ISPU inventory level message element\n */\nfunction getStoreServiceResponseMessageEl(productContainer) {\n return queryFirst(STORE_SERVICE_INFO_MESSAGE_SELECTOR, productContainer);\n}\n\n/**\n * Function to inject Ship to address availability messages within shipping preferences section\n * @param {string} shipToAvailabilityStatus - Ship to address availability status\n * @param {Object} messages - global messages object\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction updateShipToInventoryMessages(shipToAvailabilityStatus, messages, productContainer) {\n // Updating ship to address inventory messages\n const shipToAvailableMessageEl = getShipToNotAvailableMessageEl(productContainer);\n if (shipToAvailableMessageEl) {\n injectMessageAndUpdateElementState(shipToAvailableMessageEl, shipToAvailabilityStatus === NOT_AVAILABLE_STATUS ? messages.notAvailableShipToMessage : EMPTY_STRING);\n }\n}\n\n/**\n * Function to inject ISPU availability messages within shipping preferences section\n * @param {string} ispuAvailabilityStatus - In store pick up inventory availability status\n * @param {boolean} isStorePickUpLowInventory - Is ISPU has low inventory\n * @param {string} ispuAvailabilityMessage - In store pick up inventory message\n * @param {Object} messages - global messages object\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction updateISPUInventoryMessages(ispuAvailabilityStatus, isStorePickUpLowInventory = false, ispuAvailabilityMessage = EMPTY_STRING, ispuLowInventoryMessage = EMPTY_STRING, messages, productContainer) {\n // Updating ISPU inventory messages\n const ispuNotAvailableMessageEl = getISPUNotAvailableMessageEl(productContainer);\n const ispuInventoryLevelMessageEl = getISPUInventoryLevelMessageEl(productContainer);\n const ispuLowInventoryMessageEl = getISPULowInventoryMessageEl(productContainer);\n if (ispuAvailabilityStatus !== NOT_AVAILABLE_STATUS) {\n injectMessageAndUpdateElementState(ispuNotAvailableMessageEl, EMPTY_STRING);\n injectMessageAndUpdateElementState(ispuInventoryLevelMessageEl, isStorePickUpLowInventory ? ispuAvailabilityMessage : EMPTY_STRING);\n injectMessageAndUpdateElementState(ispuLowInventoryMessageEl, isStorePickUpLowInventory ? ispuLowInventoryMessage : EMPTY_STRING);\n } else {\n injectMessageAndUpdateElementState(ispuNotAvailableMessageEl, messages.notAvailableISPUMessage);\n injectMessageAndUpdateElementState(ispuInventoryLevelMessageEl, EMPTY_STRING);\n injectMessageAndUpdateElementState(ispuLowInventoryMessageEl, EMPTY_STRING);\n }\n}\n\n/**\n * Function to inject service response messages\n * @param {Object} message - message to be injected\n * @param {boolean} wrapText - a flag to wrap the text conditionally\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction updateServiceResponseMessage(message, wrapText, productContainer) {\n const ispuServiceResponseEl = getStoreServiceResponseMessageEl(productContainer);\n message = wrapText ? `${message}` : message;\n injectMessageAndUpdateElementState(ispuServiceResponseEl, message);\n}\n\n/**\n * Function to clear availability messages within shipping preferences section\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction clearAllInventoryMessages(productContainer) {\n const ispuNotAvailableMessageEl = getISPUNotAvailableMessageEl(productContainer);\n injectMessageAndUpdateElementState(ispuNotAvailableMessageEl, EMPTY_STRING);\n\n const ispuInventoryLevelMessageEl = getISPUInventoryLevelMessageEl(productContainer);\n injectMessageAndUpdateElementState(ispuInventoryLevelMessageEl, EMPTY_STRING);\n\n const shipToAvailableMessageEl = getShipToNotAvailableMessageEl(productContainer);\n injectMessageAndUpdateElementState(shipToAvailableMessageEl, EMPTY_STRING);\n}\n\n/**\n * Function to clear service response messages\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction clearServiceResponseMessage(productContainer) {\n const ispuServiceResponseEl = getStoreServiceResponseMessageEl(productContainer);\n injectMessageAndUpdateElementState(ispuServiceResponseEl, EMPTY_STRING);\n}\n\nmodule.exports = {\n updateShipToInventoryMessages,\n updateISPUInventoryMessages,\n clearAllInventoryMessages,\n updateServiceResponseMessage,\n clearServiceResponseMessage\n};\n","'use strict';\n\nconst { HIDDEN_CLASS, EMPTY_STRING } = require('../../constants');\nconst { injectMessageAndUpdateElementState } = require('./messagingUtil');\nconst { queryFirst, addClass, removeClass } = require('../../domUtil');\n\nconst ISPU_DELIVERY_MESSAGE_SELECTOR = '.ispu-delivery-estimation-message';\n\n/**\n * Function to get ISPU delivery message element (e.g., Order by X pm Get it by Y pm)\n * @param {HTMLElement} productContainer - Product container Element\n * @returns {HTMLElement} ISPU non-availability element\n */\nfunction getISPUDeliveryMessageEl(productContainer) {\n return queryFirst(ISPU_DELIVERY_MESSAGE_SELECTOR, productContainer);\n}\n\n/**\n * Function to inject ISPU delivery estimation message in product container\n * @param {string} message - ISPU delivery estimation message\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction injectISPUDeliveryMessage(message, productContainer) {\n const ispuDeliveryMessageEl = getISPUDeliveryMessageEl(productContainer);\n injectMessageAndUpdateElementState(ispuDeliveryMessageEl, message);\n}\n\n/**\n * Function to remove ISPU delivery estimation message from product container\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction clearISPUDeliveryMessage(productContainer) {\n const ispuDeliveryMessageEl = getISPUDeliveryMessageEl(productContainer);\n injectMessageAndUpdateElementState(ispuDeliveryMessageEl, EMPTY_STRING);\n}\n\n/**\n * Function to show ISPU delivery estimation message from product container\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction showISPUDeliveryMessage(productContainer) {\n const ispuDeliveryMessageEl = getISPUDeliveryMessageEl(productContainer);\n removeClass(ispuDeliveryMessageEl, HIDDEN_CLASS);\n}\n\n/**\n * Function to hide ISPU delivery estimation message from product container\n * @param {HTMLElement} productContainer - Product container Element\n */\nfunction hideISPUDeliveryMessage(productContainer) {\n const ispuDeliveryMessageEl = getISPUDeliveryMessageEl(productContainer);\n addClass(ispuDeliveryMessageEl, HIDDEN_CLASS);\n}\n\nmodule.exports = {\n getISPUDeliveryMessageEl,\n injectISPUDeliveryMessage,\n clearISPUDeliveryMessage,\n showISPUDeliveryMessage,\n hideISPUDeliveryMessage\n};\n","const { removeClass, addClass } = require('../../domUtil');\nconst { HIDDEN_CLASS, EMPTY_STRING } = require('../../constants');\n\n/**\n * Function to add message safely and update its class\n * @param {HTMLElement} el - The source element\n * @param {string} message - store availability message\n * @param {string} selector - DOM element selector\n * @param {HTMLElement} container - Product container Element\n */\nfunction injectMessageAndUpdateElementState(el, message) {\n if (el) {\n if (message) {\n el.innerHTML = message;\n removeClass(el, HIDDEN_CLASS);\n } else {\n el.textContent = EMPTY_STRING;\n addClass(el, HIDDEN_CLASS);\n }\n }\n}\n\nmodule.exports = {\n injectMessageAndUpdateElementState\n};\n","'use strict';\n\nconst { queryFirst, addClass, removeClass, hasClass } = require('../../domUtil');\nconst { getItemFromLocalStorage, getNestedValue } = require('../../util');\nconst {\n PREFERENCE_SELECTOR, ISPU_STORE_NAME_CLASS, SHIPPING_PREFERENCES_CONTAINER_SELECTOR,\n ISPU_RADIO_SELECTOR, SHIP_TO_ADDRESS_RADIO_SELECTOR, CHANGE_STORE_LINK_SELECTOR,\n ISPU_PREFERENCE_CONTENT_SELECTOR, SHIP_TO_ADDRESS_CONTENT_SELECTOR, DISABLED_CLASS,\n SHIPPING_PREFERENCE_KEY, SHIP_TO_RADIO_VALUE, RADIO_BUTTON_LABEL_SELECTOR, SHIP_TO_LOW_INVENTORY_CLASS,\n STORE_AVAILABILITY_MESSAGE_SELECTOR, INVENTORY_MSG_SELECTOR, ISPU_RADIO_VALUE, AVAILABILITY_MSG_SELECTOR, LOW_STOCK_ISPU_SELECTOR\n} = require('./constants');\nconst { HIDDEN_CLASS } = require('../../constants')\n\n/**\n * Function to get shipping preferences container within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getChangeStoreLinkEl(productContainerEl) {\n return queryFirst(CHANGE_STORE_LINK_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get shipping preferences container within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getShippingPreferencesContainerEl(productContainerEl) {\n return queryFirst(SHIPPING_PREFERENCES_CONTAINER_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get ISPU radio button within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getISPUradioButtonEl(productContainerEl) {\n return queryFirst(ISPU_RADIO_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get Ship To section's content within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getShipToAddressContentEl(productContainerEl) {\n return queryFirst(SHIP_TO_ADDRESS_CONTENT_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get ship to address radio button within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getShipToAddressradioButtonEl(productContainerEl) {\n return queryFirst(SHIP_TO_ADDRESS_RADIO_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get ISPU content radio button within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getISPUPreferenceContentEl(productContainerEl) {\n return queryFirst(ISPU_PREFERENCE_CONTENT_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get selected radio button preference within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getSelectedPreferenceEl(productContainerEl) {\n return queryFirst(PREFERENCE_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get add a ISPU required class to make ISPU - ADD TO CART work\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement?} storeNameEl - optional store name element\n */\nfunction addStoreNameClass(productContainerEl, storeNameEl) {\n storeNameEl = storeNameEl || queryFirst('.store-detail .name', productContainerEl);\n if (storeNameEl) {\n addClass(storeNameEl, ISPU_STORE_NAME_CLASS);\n }\n}\n\n/**\n * Function to get remove a ISPU required class to make SHIP TO - ADD TO CART work\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement?} storeNameEl - optional store name element\n */\nfunction removeStoreNameClass(productContainerEl, storeNameEl) {\n storeNameEl = storeNameEl || queryFirst('.store-detail .name', productContainerEl);\n if (storeNameEl) {\n removeClass(storeNameEl, ISPU_STORE_NAME_CLASS);\n }\n}\n\n/**\n * Function to check if a size is selected or not\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getSelectedSizeEl(productContainerEl) {\n return queryFirst('.size-btn.selected', productContainerEl);\n}\n\n/**\n * Function to update Visibility Of Low Inventory Msg for ISPU and Ship To an address\n * @param {HTMLElement} productContainerEl - Product container Element\n */\nfunction updateVisibilityOfLowInventoryMsg(productContainerEl) {\n const ispuLowStockEl = queryFirst(LOW_STOCK_ISPU_SELECTOR);\n const availabilityElement = queryFirst(AVAILABILITY_MSG_SELECTOR);\n const ispuLowInventory = queryFirst(STORE_AVAILABILITY_MESSAGE_SELECTOR);\n const ispuLowInventoryMsg = queryFirst(INVENTORY_MSG_SELECTOR);\n const ispuRadioButtonEl = getISPUradioButtonEl(productContainerEl);\n // If ISPU enabled, setting the message only after ispu inventory is created\n // one of the radio button is selected\n if (ispuRadioButtonEl && window.ispuProductInventory) {\n if (ispuRadioButtonEl.checked) {\n addClass(availabilityElement, HIDDEN_CLASS);\n if (ispuLowInventoryMsg) {\n removeClass([ispuLowInventory, ispuLowStockEl], HIDDEN_CLASS);\n }\n else {\n addClass(ispuLowStockEl, HIDDEN_CLASS)\n }\n }\n else {\n addClass([ispuLowInventory, ispuLowStockEl], HIDDEN_CLASS);\n removeClass(availabilityElement, HIDDEN_CLASS);\n }\n }\n}\n/**\n * Function to select ISPU radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} ispuRadioButtonEl - ISPU radio button element\n * @param {boolean} enableISPUSection - flag to remove fade out style to ispu section's content\n */\nfunction selectISPURadioButton(productContainerEl, ispuRadioButtonEl, enableISPUSection) {\n ispuRadioButtonEl = ispuRadioButtonEl || getISPUradioButtonEl(productContainerEl);\n if (!ispuRadioButtonEl) return;\n\n ispuRadioButtonEl.disabled = false;\n removeClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, ispuRadioButtonEl.parentElement), DISABLED_CLASS);\n\n ispuRadioButtonEl.checked = true;\n\n addStoreNameClass(productContainerEl);\n\n if (enableISPUSection) {\n const ispuContentEl = getISPUPreferenceContentEl(productContainerEl);\n removeClass(ispuContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to disable & deselect Ship To radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} ispuRadioButtonEl - ISPU radio button element\n * @param {boolean} disableISPUSection - flag to add fade out style ispu section's content\n */\nfunction disableISPURadioButton(productContainerEl, ispuRadioButtonEl, disableISPUSection) {\n ispuRadioButtonEl = ispuRadioButtonEl || getISPUradioButtonEl(productContainerEl);\n if (!ispuRadioButtonEl) return;\n\n ispuRadioButtonEl.disabled = true;\n addClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, ispuRadioButtonEl.parentElement), DISABLED_CLASS);\n\n ispuRadioButtonEl.checked = false;\n\n removeStoreNameClass(productContainerEl);\n\n if (disableISPUSection) {\n const ispuContentEl = getISPUPreferenceContentEl(productContainerEl);\n addClass(ispuContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to select Ship To radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} shipToRadioButtonEl - Ship to address radio button element\n * @param {boolean} enableShipToContent - flag to add fade out style shipTo section's content\n */\nfunction selectShipToRadioButton(productContainerEl, shipToRadioButtonEl, enableShipToContent) {\n shipToRadioButtonEl = shipToRadioButtonEl || getShipToAddressradioButtonEl(productContainerEl);\n if (!shipToRadioButtonEl) return;\n\n shipToRadioButtonEl.disabled = false;\n removeClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, shipToRadioButtonEl.parentElement), DISABLED_CLASS);\n\n shipToRadioButtonEl.checked = true;\n\n removeStoreNameClass(productContainerEl);\n\n if (enableShipToContent) {\n const shipToContentEl = getShipToAddressContentEl(productContainerEl);\n removeClass(shipToContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to disable & deselect Ship To radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} shipToRadioButtonEl - Ship to address radio button element\n * @param {boolean} disableShipToContent - flag to remove fade out style from shipTo section's content\n */\nfunction disableShipToRadioButton(productContainerEl, shipToRadioButtonEl, disableShipToContent) {\n shipToRadioButtonEl = shipToRadioButtonEl || getISPUradioButtonEl(productContainerEl);\n if (!shipToRadioButtonEl) return;\n\n shipToRadioButtonEl.disabled = true;\n addClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, shipToRadioButtonEl.parentElement), DISABLED_CLASS);\n\n shipToRadioButtonEl.checked = false;\n\n if (disableShipToContent) {\n const shipToContentEl = getShipToAddressContentEl(productContainerEl);\n addClass(shipToContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to get preferred shipping preference\n * @returns {string} - Preferred shipping preference value\n */\nfunction getPreferedShippingPreference() {\n let shippingPreferenceValue = getItemFromLocalStorage(SHIPPING_PREFERENCE_KEY);\n if (!shippingPreferenceValue) {\n const shippingPreferencesConfig = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig') || {};\n const { activeStoreFilter } = shippingPreferencesConfig;\n shippingPreferenceValue = activeStoreFilter ? ISPU_RADIO_VALUE : SHIP_TO_RADIO_VALUE;\n }\n return shippingPreferenceValue;\n}\n\nmodule.exports = {\n getChangeStoreLinkEl,\n getSelectedPreferenceEl,\n getShippingPreferencesContainerEl,\n getISPUradioButtonEl,\n getShipToAddressradioButtonEl,\n getShipToAddressContentEl,\n getISPUPreferenceContentEl,\n getSelectedSizeEl,\n addStoreNameClass,\n removeStoreNameClass,\n selectISPURadioButton,\n disableISPURadioButton,\n selectShipToRadioButton,\n disableShipToRadioButton,\n getPreferedShippingPreference,\n updateVisibilityOfLowInventoryMsg\n};\n","'use strict';\n\nconst { queryFirst } = require('../../domUtil');\nconst { storeDetail } = require('../../templates').shippingPreferenceTemplates;\nconst { STORE_DETAIL_SELECTOR, STORE_DETAIL_CONTAINER_SELECTOR } = require('./constants');\n\n/**\n * Function to get store detail within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getStoreDetailEl(productContainerEl) {\n return queryFirst(STORE_DETAIL_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get store detail container within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getStoreDetailContainerEl(productContainerEl) {\n return queryFirst(STORE_DETAIL_CONTAINER_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to inject store details DOM elements within product container\n * @param {Object} store - Store object\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement?} storeDetailContainerEl - Store detail container element\n */\nfunction addStoreDetail(store, productContainerEl, storeDetailContainerEl) {\n storeDetailContainerEl = storeDetailContainerEl || getStoreDetailContainerEl(productContainerEl);\n const { ID, name, address1, city, stateCode, postalCode } = store;\n const storeDetailHTML = storeDetail(ID, name, address1, city, stateCode, postalCode);\n\n $(storeDetailContainerEl).html(storeDetailHTML);\n}\n\nmodule.exports = {\n getStoreDetailEl: getStoreDetailEl,\n getStoreDetailContainerEl: getStoreDetailContainerEl,\n addStoreDetail: addStoreDetail\n};\n","module.exports = {\n breakpoints: {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 1024,\n xl: 1362\n },\n\n // Stores\n PREFERRED_STORE_ID: 'PREFERRED_STORE_ID',\n\n // Constant values\n EMPTY_STRING: '',\n\n // DOM Class\n HIDDEN_CLASS: 'd-none',\n INVALID_CLASS: 'is-invalid',\n INVISIBLE_CLASS: 'invisible',\n NO_SCROLL_CLASS: 'no-scroll',\n IS_STICKY_CLASS: 'is-sticky',\n SELECTED_CLASS: 'selected',\n\n // Product status\n PREORDER_STATUS: 'PREORDER',\n IN_STOCK_STATUS: 'IN_STOCK',\n NOT_AVAILABLE_STATUS: 'NOT_AVAILABLE',\n\n // Custom DOM events\n\n // Control keys\n\n // Event KeyCodes\n KEYCODE_TAB: 9,\n KEYCODE_ESCAPE: 27,\n KEYCODE_UP: 38,\n KEYCODE_DOWN: 40,\n KEYCODE_ENTER: 13,\n EVENT_KEY_ENTER: 'Enter',\n\n // Search types\n SEARCH_TYPE: 'searchType',\n SEARCH_SUBMIT: 'search submit',\n SEARCH_SUGGESTIONS: 'search suggestions',\n POPULAR_SEARCHES: 'popular searches'\n};\n","/**\n * DOM utilities to use native browser capabilities and avoid dependencies.\n *\n * @module dom.dom-util\n * @version 1.0.0\n * @since Sept 26 2019\n *\n * @typedef {Object} ProductData\n * @property {string} colorCode - The product color code (E.g. 002)\n * @property {string} masterId - The product master ID (E.g. 003168)\n * @property {string} originalPrice - The product original price (E.g. 148.00)\n * @property {string} productColor - The product color name (E.g. Onyx)\n * @property {string} productId - The product SKU (E.g. 889069580469)\n * @property {string} productName - The product name (E.g. Keegan Lace Top)\n * @property {string} productPrice - The product sale price (E.g. 98.00)\n * @property {string} productSize - The product size (E.g. M)\n * @property {string} variationGroupId - The product variation group ID (E.g. 003168-onyx)\n * @property {string} productBadge - The product is of Early Access or not (E.g. Early Access)\n */\n\nconst { breakpoints } = require('./constants');\n\n/**\n * Native querySelector to find first element in the dom with given selector\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {Object} returns the target as a DOM node\n */\nconst queryFirst = exports.queryFirst = (selector, parent = document) => {\n if (!parent) return null;\n return parent.querySelector(selector);\n};\n/**\n * loadScript to asynchronously load a script tag in DOM\n *\n * @param {string} source Script tag src value\n * @param {boolean} isAsync Set script to async true or false\n */\nexports.loadScript = (source, isAsync = false) => {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n script.src = source;\n script.async = isAsync;\n script.onload = () => {\n resolve();\n }\n document.body.append(script);\n });\n};\n/**\n * loadInput to load an input tag in DOM\n *\n * @param {string} referrerID Referrer ID value\n * @param {Array} formElement Form element\n */\nexports.loadInput = (referrerID, formElement) => {\n const input = document.createElement('input');\n input.setAttribute('type', 'hidden');\n input.setAttribute('name', 'referrerID');\n input.setAttribute('class', 'referrerID');\n input.setAttribute('value', referrerID);\n formElement.appendChild(input);\n};\n/**\n * Native querySelectorAll to find all the dom element with given selector.\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {nodeList | Array} Returns the target as a DOM node.\n */\nconst queryAll = exports.queryAll = (selector, parent = document) => {\n if (!parent) return null;\n return [].slice.call(parent.querySelectorAll(selector), 0);\n};\n\n/**\n * Returns the value(s) for the specified CSS rule(s), or all computed styles if no rule is specified\n *\n * @param {Element} element Target element\n * @param {string} rule CSS rule name (E.g. padding-top)\n * @return {string | Array | Object} Returns a string value, array of values, or styles object\n */\nconst getStyles = exports.getStyles = (element, ...rules) => {\n const styles = getComputedStyle(element);\n\n if (!rules.length) {\n return styles;\n } else if (rules.length === 1) {\n return styles[rules[0]];\n }\n return rules.map(rule => styles[rule]);\n};\n\n/**\n * Remove DOM element\n *\n * @param {string | Object} el Target element.\n */\nexports.remove = el => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.parentElement.removeChild(node);\n }\n } else {\n el.parentElement.removeChild(el);\n }\n};\n\n/**\n * Set attribute to single or multiple elements\n *\n * @param {string | Object} el Target element.\n * @param {string} attr attribute that need to be added.\n * @param {string | boolean} val value that need to be set for an attribute.\n */\nexports.setAttribute = (el, attr, val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.setAttribute(attr, val);\n }\n } else {\n el.setAttribute(attr, val);\n }\n};\n\n/**\n * Remove attribute to single or multiple elements\n *\n * @param {string | Object} el Target element.\n * @param {string} attr attribute that need to be removed.\n */\nexports.removeAttribute = (el, attr) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.removeAttribute(attr);\n }\n } else {\n el.removeAttribute(attr);\n }\n};\n\n/**\n * Adds class or classes to the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n */\nexports.addClass = (el, ...val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.classList.add(...val);\n }\n } else {\n el.classList.add(...val);\n }\n};\n\n/**\n * Removes class or classes from the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n */\nexports.removeClass = (el, ...val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.classList.remove(...val);\n }\n } else {\n el.classList.remove(...val);\n }\n};\n\n/**\n * Toggles class or classes to the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n */\nexports.toggleClass = (el, ...val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.classList.toggle(...val);\n }\n } else {\n el.classList.toggle(...val);\n }\n};\n\n/**\n * Looks for availability of class or classes in the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n * @return {boolean} Returns availability of class in the target element.\n */\nexports.hasClass = (el, ...classes) => {\n if (!el) return false;\n\n const { classList } = el;\n\n return !!classList && classes.every(className => classList.contains(className));\n};\n\n/**\n * Throttle util to prevent repeatative callbacks\n *\n * @param {function} callback Callback function.\n * @param {number} limit Timeout upon which throttle callback need to be called.\n * fallback to document.\n * @param {function} waitCallback The callback to fire while the function is being throttled.\n * @return {function} Throttle closure function.\n */\nexports.throttle = (callback, limit = 250, waitCallback = function () { }) => {\n let isThrottling = false;\n\n return (...args) => {\n if (isThrottling) return waitCallback(...args);\n\n const returnValue = callback.apply(this, args);\n isThrottling = true;\n\n setTimeout(() => {\n isThrottling = false;\n }, limit);\n\n return returnValue;\n };\n};\n\n/**\n * Throttle util to prevent repeatative callbacks\n *\n * @param {function} callback - Callback function.\n * @param {number} minimumDelay - Delay upon which debounce callback need to be called.\n * @param {object} [options] - Additional options to control debouncing behavior\n * @param {function} [options.condition] - A function that will cause debouncing to be ignored for one cycle if it returns true\n * @param {function} [options.callback] - A function that will run without restriction, each time the debounced method is called\n * @return {function} Debounce closure function.\n */\nexports.debounce = (callback, minimumDelay = 250, options = {}) => {\n const { condition, callback: unrestrictedCallback } = options;\n let timer;\n\n return (...args) => {\n clearTimeout(timer);\n\n if (typeof unrestrictedCallback === 'function') unrestrictedCallback(...args);\n\n if (typeof condition === 'function' && condition(...args)) {\n callback(...args);\n } else {\n timer = setTimeout(() => {\n callback(...args);\n }, minimumDelay);\n }\n };\n};\n\nexports.toArray = (...args) => {\n const makeArray = target => {\n let newTarget;\n if (!Array.isArray(target)) {\n const array = [].slice.call(target);\n newTarget = array.length ? array : [target];\n }\n return newTarget;\n };\n return args.reduce((results, arg) => {\n return results.concat(makeArray(arg));\n }, []);\n};\n\n/**\n * Height util to get outer height of element including margins\n *\n * @param {string | Object} el target element\n * @return {string} height of element\n */\nexports.outerHeight = el => {\n const styles = getStyles(el);\n\n return el.offsetHeight + parseInt(styles.marginTop, 0) + parseInt(styles.marginBottom, 0);\n};\n\n/**\n * Determine if an element is in the viewport\n * (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com\n * @param {Node} el The element\n * @return {boolean} Returns true if element is in the viewport\n */\nexports.isInViewportCheck = el => {\n const scroll = window.scrollY || window.pageYOffset;\n const boundsTop = el.getBoundingClientRect().top + scroll;\n\n const numberOfViewportToCheck = el.dataset.nextViewportLazyLoad ? 2 : 1;\n\n const viewport = {\n top: scroll,\n bottom: scroll + window.innerHeight * numberOfViewportToCheck\n };\n\n const bounds = {\n top: boundsTop,\n bottom: boundsTop + el.clientHeight\n };\n\n return (bounds.bottom >= viewport.top && bounds.bottom <= viewport.bottom) || (bounds.top <= viewport.bottom && bounds.top >= viewport.top);\n};\n\n/**\n * Determine if an element is in the viewport\n * (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com\n * @param {Node} el The element\n * @return {boolean} Returns true if element is in the viewport\n */\nexports.isInViewport = el => {\n var rect = el.getBoundingClientRect();\n\n return rect.bottom > 0 &&\n rect.right > 0 &&\n rect.left < (window.innerWidth || document.documentElement.clientWidth) &&\n rect.top < (window.innerHeight || document.documentElement.clientHeight);\n};\n\n/**\n * Displays empty cart message\n * @param {string} message - Error message to display\n */\nexports.emptyCart = message => {\n const cartElements = queryAll('.cart');\n cartElements.forEach(cartElement => {\n cartElement.innerHTML = `

${message}

Continue Shopping
`;\n });\n};\n\n/**\n * Animates scrolling the page to the specified Y coordinate\n * @param {number} y - The Y coordinate to scroll to\n * @param {number} duration - The duration of the animation in milliseconds\n * @param {function} callback - The callback to run when the animation is complete\n * @returns {JQuery}\n */\nexports.scrollTo = (y, duration = 600, callback = function () { }) => $('html, body').scrollTo(y, duration, callback);\n\n/**\n * Finds the last element sibling on the same line as the specified element\n * @param {Element} element - The element to reference when looking for siblings\n * @returns {Element} - returns last element in the row\n */\nexports.getLastElementInRow = element => {\n if (!element.nextElementSibling) return element;\n\n const bottom = element.offsetTop + element.scrollHeight;\n let sibling;\n\n while ((sibling = element.nextElementSibling)) {\n if (sibling.offsetTop >= bottom) return sibling.previousElementSibling;\n element = sibling;\n }\n\n return element;\n};\n\n/**\n * Update url with query parameter to handle remember placement\n *\n * @param {DocumentFragment} fragment - A DocumentFragment object\n * @return {undefined}\n */\nexports.updateUrlQueryParam = fragment => {\n const queryParamsElement = queryFirst('.append-params', fragment);\n const permaLink = queryFirst('.permalink', fragment);\n\n if (permaLink) {\n window.history.pushState({ path: permaLink.value }, '', permaLink.value);\n } else if (queryParamsElement) {\n const newUrl = window.location.href.split('?')[0] + '?' + queryParamsElement.value;\n window.history.pushState({ path: newUrl }, '', newUrl);\n }\n};\n\n/**\n * This method returns character count\n * @param {HTMLElement} element - current element for which count has to be calculated\n * @return {number} character count\n */\nexports.getCharacterCount = function (element) {\n if (!element) {\n return 0;\n }\n return element.value.length;\n};\n\n/**\n * Waits for a specified element to exist.\n * @param {string} selector - The selector to match\n * @param {element} scope - The containing element to search within (default: document)\n * @param {number} timeout - How long (in milliseconds) to wait before rejecting the promise\n * @returns a Promise containing all matched elements\n */\nexports.waitForElement = (selector, scope = document, timeout = 0) =>\n new Promise((resolve, reject) => {\n const elements = queryAll(selector, scope);\n\n if (elements.length) return resolve(elements);\n\n const observer = new MutationObserver((mutations, self) => {\n const elements = queryAll(selector, scope);\n\n if (elements.length) {\n self.disconnect();\n resolve(elements);\n }\n });\n\n observer.observe(scope, { childList: true, subtree: true });\n\n if (timeout) {\n setTimeout(() => {\n observer.disconnect();\n reject('Timed out');\n }, timeout);\n }\n });\n\n/**\n * Binds an event listener to a callback using native methods and selector matching.\n * @param {element} element - The element to attach the listener to\n * @param {string|array} eventTypes - The type of events to listen for\n * @param {function} callback - The method to run when the event is fired\n * @param {object} [options={}] - Additional options to configure the event binding\n * @param {function} [options.eventCondition] - A function that returns a boolean indicating whether to proceed with the callback when the event is triggered\n * @param {string} [options.bindEngine='native'] - The engine to use when binding the event (native or jQuery)\n * @param {boolean} [options.once=false] - Whether to fire the event callback only once and then unbind\n */\nexports.bind = (element, eventTypes, callback, options = {}) => {\n const {\n eventCondition,\n bindEngine = 'native',\n once = false\n } = options;\n\n if (!Array.isArray(eventTypes)) eventTypes = eventTypes.split(',').map(type => type.trim());\n\n const useJQuery = (String(bindEngine).toLowerCase() === 'jquery');\n let { targetSelectors = [] } = options;\n\n if (typeof targetSelectors === 'string') {\n targetSelectors = [targetSelectors];\n }\n\n const handler = (e, extraData) => {\n let { target } = e;\n\n if (extraData instanceof Element || extraData === document) {\n target = extraData;\n } else if (extraData instanceof jQuery.Event) {\n target = extraData.target;\n } else {\n e.data = extraData;\n }\n\n let targetElement = target;\n\n if (Array.isArray(targetSelectors) && targetSelectors.length) {\n // If an array of selectors is provided, store a reference to the closest element that is matched\n targetElement = targetSelectors.reduce((result, selector) => {\n if (result) return result;\n const node = target.closest(selector);\n if (node) result = { node, selector };\n return result;\n }, false);\n }\n\n // We need a target element as context or we don't execute our callback\n if (!targetElement) return;\n\n const { node, selector } = targetElement;\n\n // Only execute the callback if the eventCondition allows\n if (typeof eventCondition === 'function' && !eventCondition(e, node || targetElement)) {\n return;\n }\n\n if (once) {\n if (useJQuery) {\n const $element = $(element);\n\n eventTypes.forEach(eventType => {\n $element.off(eventType, handler);\n });\n } else {\n eventTypes.forEach(eventType => {\n element.removeEventListener(eventType, handler, true);\n });\n }\n }\n\n if (node && selector) {\n callback(e, node, selector);\n } else {\n callback(e, targetElement);\n }\n };\n\n if (useJQuery) {\n const $element = $(element);\n\n eventTypes.forEach(eventType => {\n $element.on(eventType, handler);\n });\n } else {\n eventTypes.forEach(eventType => {\n element.addEventListener(eventType, handler, true);\n });\n }\n};\n\n/**\n * Function to get product data\n * @param {HTMLElement} element - Product container element or srcElement\n * @returns {ProductData} - Product data\n */\nexports.getProductData = element => {\n const { getNestedValue } = require('./util');\n const PREORDER_STATUS = 'PREORDER';\n\n element = element.closest('.color-attribute, .product-tile-swatch, .tile-img-link, .add-to-cart, .account-login-btn, .create-account-btn') || element;\n\n const container = element.closest('.product, .product-detail') || element.closest('.product-info') || element.closest('.cart-product-line-item') || element;\n const { dataset } = element;\n const { dataset: containerData } = container;\n const { monetatePid } = containerData;\n const isQuickview = !!container.closest('.product-quickview');\n\n let { productInfo, productInventory } = window;\n\n // Update the product data where possible\n let pid = containerData.wishlistId || containerData.pid || dataset.pid;\n let masterId = dataset.masterid || containerData.masterid;\n let productName = dataset.productName || containerData.productName;\n let productSize = dataset.productSize || containerData.productSize;\n let swatchName = dataset.swatchName || containerData.swatchName;\n let { attrValue: colorCode, productSet } = dataset;\n const { productBadge } = dataset;\n\n let variationGroupId;\n let originalPrice;\n let productPrice;\n let isPreorder;\n\n let productId = [dataset.productId, containerData.productId, pid].find(id => {\n if (id && ~id.indexOf('-')) {\n if (!variationGroupId) variationGroupId = id;\n\n return false;\n }\n\n return id;\n }) || '';\n\n // We need the color code, which is only available on the swatch\n if (!swatchName || !element.closest('.color-attribute, .product-tile-swatch')) {\n const colorEl = queryFirst('.color-attribute .swatch-circle.selected, .product-tile-swatch.selected', container) || queryFirst('.selected-swatch-name', container) || queryFirst('.tile-img-link', container);\n const swatchButton = (colorEl && colorEl.closest('.color-attribute'));\n\n swatchName = (colorEl && (colorEl.dataset.attrDisplayvalue || colorEl.dataset.swatchName || colorEl.textContent.trim())) || '';\n colorCode = (colorEl && colorEl.dataset.attrValue) || '';\n variationGroupId = variationGroupId || (swatchButton && swatchButton.dataset.productId) || '';\n }\n\n // Use the PID if the productId is missing or set to master\n if (!productId || (productId.length <= 6 && pid)) productId = pid;\n\n // We need the master ID to look up the product\n if (!masterId && monetatePid) {\n masterId = monetatePid.split('-')[0] || '';\n }\n\n if (!masterId) {\n if (pid && (~pid.indexOf('-') || pid.length <= 6)) {\n masterId = pid.split('-')[0];\n } else if (productId && ~productId.indexOf('-')) {\n masterId = productId.split('-')[0];\n } else {\n const tileEl = element.closest('.product-tile');\n masterId = ((tileEl && tileEl.dataset.monetatePid) || '').split('-')[0];\n }\n }\n\n // QuickView productInfo\n if (isQuickview) {\n productInfo = getNestedValue(window, 'quickviewProductInfo.productInfo');\n productInventory = getNestedValue(window, 'quickviewProductInfo.productInventory');\n }\n\n // Now we can check the productInfo\n if (productInfo && masterId && colorCode) {\n let productData;\n if (isQuickview) {\n productData = getNestedValue(productInfo, 'variants.{0}', colorCode);\n } else {\n productData = getNestedValue(productInfo, '{0}.variants.{1}', masterId, colorCode);\n }\n\n if (productData) {\n originalPrice = productData.standardPrice + '.00';\n productPrice = productData.price + '.00';\n variationGroupId = productData.groupId;\n isPreorder = productData.isPreorder;\n }\n }\n\n if (!productName) {\n const productNameEl = queryFirst('.product-name, .line-item-name', container);\n productName = (productNameEl && productNameEl.textContent.trim()) || '';\n }\n\n if (!productSize) {\n const productSizeEl = queryFirst('.size-btn.selected, .wishlist-item-attribute-size .wishlist-detail-value', container);\n productSize = (productSizeEl && (productSizeEl.dataset.valueId || productSizeEl.textContent.trim())) || '';\n }\n\n if (productSize && pid) {\n isPreorder = getNestedValue(productInventory, 'variants[{0}].availabilityStatus', pid) === PREORDER_STATUS;\n }\n\n if (!originalPrice) {\n const originalPriceEl = queryFirst('.price-section .ssPrice', container);\n originalPrice = ((originalPriceEl && originalPriceEl.value) || '').split('$').pop();\n }\n\n if (originalPrice && !~originalPrice.indexOf('.')) {\n originalPrice += '.00';\n }\n\n if (!productPrice) {\n const productPriceEl = queryFirst('.price-section .sales .ssSalesPrice', container);\n productPrice = ((productPriceEl && productPriceEl.value) || '').split('$').pop();\n }\n\n if (productPrice && !~productPrice.indexOf('.')) {\n productPrice += '.00';\n }\n\n if (!swatchName) {\n const productColorEl = queryFirst('.wishlist-item-attribute-color .wishlist-detail-value', container);\n swatchName = (productColorEl && productColorEl.textContent.trim()) || '';\n }\n\n // Sanity check\n if (masterId && masterId.length > 6) masterId = '';\n if (productId && (~productId.indexOf('-') || productId.length <= 6)) productId = '';\n if (variationGroupId && !~variationGroupId.indexOf('-')) variationGroupId = '';\n if (productSet === 'null') productSet = ''; // not all PLP tiles have data-product-set\n\n return {\n colorCode,\n masterId,\n originalPrice,\n productColor: swatchName,\n productId,\n productName,\n productPrice,\n productSize,\n variationGroupId,\n isPreorder,\n productBadge,\n productSet\n };\n};\n\n/**\n * Check whether the device matches the specified breakpoint at a minimum (i.e. min-width)\n * @param {string} breakpoint - The breakpoint to match against (xs; sm; md; lg; xl)\n * @returns {boolean} - Whether the device matches the breakpoint\n */\nexports.matchesBreakpoint = breakpoint => breakpoint in breakpoints && window.matchMedia(`(min-width: ${breakpoints[breakpoint]}px)`).matches;\n\nexports.getCSRFToken = (scope = document.body) => {\n const token = scope.querySelector('.csrf-token');\n return (token && token.value) || '';\n};\n\n/**\n * Renders a string into a template and returns the DOM Fragment.\n * @param {string} html - the html content.\n * @returns {DocumentFragment} - The input string as a document fragment\n */\nexports.renderFragment = html => {\n const template = document.createElement('template');\n template.innerHTML = html;\n return template.content;\n};\n\n/**\n * Gets all accessible cookies and creates a plain key/value object\n * @returns {Object} Plain object containing cookie names and values\n */\nexports.getCookieMap = () => document.cookie.split(';').reduce((result, keyValue) => {\n const [key, value] = keyValue.trim().split('=');\n result[key] = decodeURIComponent(value);\n return result;\n}, {});\n\n/**\n * Sets a cookie\n * @param {string} key - the name of the cookie\n * @param {string} value - the value of the cookie\n * @param {number} [minutes] - how long until the cookie expires in minutes\n */\nexports.setCookie = (key, value, minutes) => {\n let date;\n if (minutes) {\n date = new Date();\n date.setTime(date.getTime() + (minutes * 60 * 1000));\n }\n\n document.cookie = `${key}=${value}${date ? `; expires=${date.toGMTString()}` : ''}; path=/`;\n};\n\n/**\n * Validating the date as per month\n */\nexports.validateDate = () => {\n const monthSelector = document.getElementById('birthdaymonth');\n const dateSelector = document.getElementById('birthdaydate');\n\n if (monthSelector && dateSelector) {\n const { message } = dateSelector.dataset;\n /**\n * Validating date\n */\n function validateDateOption() {\n const m = monthSelector.value;\n const d = dateSelector.value;\n const mlength = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m];\n dateSelector.length = 0;\n const labelOption = new Option();\n labelOption.text = message;\n labelOption.value = '';\n dateSelector.add(labelOption);\n for (let i = 1; i <= mlength; i++) {\n const option = new Option();\n option.value = i;\n option.text = i;\n if (i.toString() === d) option.selected = true;\n dateSelector.add(option);\n }\n }\n monthSelector.addEventListener('change', validateDateOption);\n }\n};\n\n/**\n * Returns whether an element's content is visible to the user\n * Note that this differs from existing implementations like JQuery :visible -- this will return false\n * for elements which are visibility: hidden or which are overflow hidden with 0 height.\n * @param {HTMLElement} element - The element whose visibility to check\n * @returns {boolean} true if the element is visible, false otherwise.\n */\nexports.isVisible = function(element) {\n if (!element instanceof HTMLElement) return false;\n\n // Check if the element is hidden using more performant methods first\n // We can't check for d-none here because we use conventions like \"d-none d-md-block\" on the site.\n if (exports.hasClass(element, 'invisible') || element.offsetParent === null) return false;\n\n const style = window.getComputedStyle(element);\n return !(style.display === 'none' || style.visibility === 'hidden' || (style.overflowY === 'hidden' && (style.height === '0px' || style.maxHeight === '0px')));\n};\n\n/**\n * Converts a basic object to FormData\n * @param {Object} obj - the object to convert to FormData\n * @param {boolean} [includeUndefined=false] - include undefined values in the result\n * @returns {FormData} FormData representation of the object\n */\nexports.toFormData = (obj, includeUndefined = false) => Object.keys(obj).reduce((formData, key) => {\n const value = obj[key];\n if (typeof value !== 'undefined' || includeUndefined) formData.append(key, value);\n return formData;\n}, new FormData());\n\nexports.getStyles = getStyles;\nexports.queryAll = queryAll;\n","'use strict';\n\n// OOTB Code\nlet googleMapScript;\nlet geocoder;\n\n/**\n * This method includes google api for using google maps\n * @param {string} googleKey google api key\n */\nfunction includeGoogleMaps(googleKey) {\n if (!googleMapScript && googleKey) {\n googleMapScript = document.createElement('script');\n googleMapScript.src = `https://maps.googleapis.com/maps/api/js?key=${googleKey}`;\n document.head.append(googleMapScript);\n }\n}\n\n/**\n * This method renders location from google maps based on address\n * @param {function} callBack callback function\n * @param {Object} mixin additional parameters\n */\nfunction getLatLong(callBack, mixin = {}) {\n const { address } = mixin;\n geocoder = new google.maps.Geocoder();\n if (!(geocoder && address)) return;\n const data = Object.assign({}, mixin);\n geocoder.geocode({ address }, function (results, status) {\n if (status === google.maps.GeocoderStatus.OK) {\n const { location } = results[0].geometry;\n data.latitude = location.lat();\n data.longitude = location.lng();\n }\n callBack(data);\n });\n}\n\nexport { includeGoogleMaps, getLatLong };\n","'use strict';\n\nvar formValidation = require('base/components/formValidation');\nconst baseLogin = require('base/login/login');\n\nconst { queryFirst, addClass, removeClass, loadInput } = require('../domUtil');\nconst { formatPhoneNumber, getItemFromLocalStorage } = require('../util');\nconst registrationFormPhone = queryFirst('.registration-form-phone');\nconst loyaltyGuestReferralModal = queryFirst('#guest-friend-referral-popup');\nconst $body = $('body');\nconst checkoutContainer = queryFirst('#checkout-main');\nconst { HIDDEN_CLASS } = require('../constants');\n\nwindow.addEventListener('load', (event) => {\n const formElement = queryFirst('.change-password-form');\n const referrerID = getItemFromLocalStorage('REFERRED_ID');\n if (referrerID && formElement) {\n loadInput(referrerID, formElement);\n }\n if (loyaltyGuestReferralModal) {\n $(loyaltyGuestReferralModal).modal('show');\n }\n if (checkoutContainer) {\n const guestCheckoutSignInModal = queryFirst('#guest-checkout-login');\n const cancelBtnRegistrationModal = queryFirst('.registration-right .cancel a', guestCheckoutSignInModal);\n if (cancelBtnRegistrationModal) {\n cancelBtnRegistrationModal.addEventListener('click', e => {\n e.preventDefault();\n $(guestCheckoutSignInModal).modal('hide');\n });\n }\n if (guestCheckoutSignInModal) {\n addClass(queryFirst('.account-need-help'), HIDDEN_CLASS);\n const registerLeft = queryFirst('.registration-left');\n const registerRight = queryFirst('.registration-right');\n removeClass(registerLeft, 'offset-md-2');\n addClass([registerLeft, registerRight], 'col-md-6');\n }\n }\n if (queryFirst('.add-to-loyalty-program-checkbox')) {\n $('form.registration').trigger('register:optin_load');\n }\n});\n\n/**\n * Enables the login button - to be called after this script loads to prevent early login button clicks.\n */\nfunction enableLoginButton() {\n $body.off('login:dialogLoaded').on('login:dialogLoaded', () => {\n enableLoginButton();\n });\n\n const btn = queryFirst('.account-login-btn');\n if (btn) {\n btn.disabled = false;\n }\n}\n\nmodule.exports = {\n ...baseLogin,\n\n register: function () {\n $('form.registration').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n $body.spinner().start();\n form.trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n $body.spinner().stop();\n if (data.success) {\n form.trigger('register:success');\n if (checkoutContainer) {\n //reloading the page when account is created from checkout page\n location.reload();\n } else {\n //redirecting to my account when account is created from Login Page\n location.href = data.redirectUrl;\n }\n } else {\n formValidation(form, data);\n form.trigger('register:error');\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification($('.error-messaging'), err.responseJSON.errorMessage);\n }\n\n $body.spinner().stop();\n }\n });\n return false;\n });\n },\n\n resetPassword: function () {\n const resetPasswordDialog = $('#requestPasswordResetModal');\n\n resetPasswordDialog.on('hidden.bs.modal', function () {\n removeClass(queryFirst('.password-reset-section', this), 'request-success');\n const emailEl = document.getElementById('reset-password-email');\n emailEl.value = '';\n removeClass(emailEl, 'is-invalid');\n });\n\n $('.reset-password-form').on('submit', function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('.reset-password-form').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n } else {\n // LP Customization start\n addClass(queryFirst('.reset-password-request-modal .password-reset-section'), 'request-success');\n // LP Customization end\n }\n },\n error: function () {\n form.spinner().stop();\n resetPasswordDialog.modal('hide').one('hidden.bs.modal', () => {\n $body.trigger('csrf:error');\n });\n }\n });\n\n return false;\n });\n },\n handleLogin: function () {\n const loginBtnEl = queryFirst('.account-login-btn');\n const $loginFormEl = $('form.login');\n $loginFormEl.on('login:submit', function () {\n loginBtnEl.disabled = true;\n });\n\n $loginFormEl.on('login:error', function () {\n loginBtnEl.disabled = false;\n });\n }\n};\n\nformatPhoneNumber(registrationFormPhone);\nenableLoginButton();\n","'use strict';\nconst { queryFirst, addClass, removeClass, throttle, hasClass, setAttribute, queryAll, loadInput, validateDate } = require('../domUtil');\nconst formValidation = require('base/components/formValidation');\nconst { getTimeRemaining, getItemFromLocalStorage, formatPhoneNumber, getJSON } = require('../util');\nconst { resetPassword } = require('../login/login');\nconst { MY_ACCOUNT } = require('../components/shippingPreference/constants');\nconst $body = $('body');\nconst hiddenClass = 'd-none';\nconst loyaltyWelcomeDialog = queryFirst('.loyalty-welcome-popup');\nconst loyaltyEnrollNowDialog = queryFirst('#loyalty-enrollnow-modal');\nconst invalidClass = 'is-invalid';\nconst desktopShowClass = 'desktop-show';\nconst activeClass = 'active';\nconst exclusiveCarouselIdSelector = '#exclusive-experience-carousel';\nlet mobileImg, desktopImg;\nconst root = document.documentElement;\nconst { initSpecificCarousel } = require('../components/carousel');\nconst loyaltyEarlyAccessRegisterForm = queryFirst('#loyalty-early-access-register');\nconst earlyAccessPdpSignInRegistration = queryAll('.js-early-access-sign-in-cta');\nconst { ajaxFormInvalid, ajaxFormSubmit, enableFormSubmitButton, invalid } = require('../clientSideValidation');\nconst swatchImageDownload = queryFirst('.swatch-image-download');\nconst swatchImageDownloaded = queryFirst('.swatch-image-downloaded');\nconst downloadCtaDesktop = '.download-cta.desktop-show';\nconst downloadCtaMobile = '.download-cta.mobile-show';\nconst welcomeDialogEarlyAccessMsgEl = queryFirst('.js-loyalty-welcome-early-access-msg');\nconst welcomeDialogMsgEl = queryFirst('.js-loyalty-welcome-msg');\n$body.on('hidden.bs.modal', function () {\n if (!queryFirst('.modal.show')) {\n $body.removeClass('referral-modal');\n }\n});\n\n/**\n * Handle the enroll now popup view\n */\nfunction handleEarlyAccessEnrollModal() {\n $(loyaltyEnrollNowDialog).modal('show').off('hidden.bs.modal').on('hidden.bs.modal', function () {\n if (!hasClass(loyaltyWelcomeDialog, 'show')) {\n location.reload();\n } else {\n addClass(welcomeDialogMsgEl, hiddenClass);\n removeClass(welcomeDialogEarlyAccessMsgEl, hiddenClass);\n removeWelcomeModalShowSession();\n }\n });\n $(loyaltyWelcomeDialog).off('hidden.bs.modal').on('hidden.bs.modal', function (e) {\n location.reload();\n });\n}\n\n/**\n * Login form on PDP Early Access\n * @param {boolean} isLoyaltyMember - if the user is enrolled to loyalty or not\n * @param {string} postalCode - ZIP Code\n * @param {string} showWelcomeModal - When the enrollment is complete and the welcome modal needs to be displayed, it will be true\n */\nfunction handlePdpEarlyAccessLoginRegistration(isLoyaltyMember, postalCode, showWelcomeModal) {\n if (showWelcomeModal) {\n addClass(welcomeDialogMsgEl, hiddenClass);\n removeClass(welcomeDialogEarlyAccessMsgEl, hiddenClass);\n $(loyaltyWelcomeDialog).modal('show').off('hidden.bs.modal').on('hidden.bs.modal', function (e) {\n location.reload();\n });\n removeWelcomeModalShowSession();\n } else if (isLoyaltyMember) {\n location.reload();\n } else {\n const loyaltyEnrollModalForm = queryFirst('.loyalty-get-access');\n const loyaltyEnrollPostalCodeEl = queryFirst('.js-loyalty-access-postal-code', loyaltyEnrollModalForm);\n const loyaltyGuestEnrollment = queryFirst('.loyalty-getaccess-section .guest-enrollment');\n addClass(loyaltyGuestEnrollment, hiddenClass);\n removeClass(loyaltyEnrollModalForm, hiddenClass);\n if (!postalCode) {\n removeClass(loyaltyEnrollPostalCodeEl, hiddenClass);\n } else {\n queryFirst('.loyalty-access-form-postalcode', loyaltyEnrollPostalCodeEl).value = postalCode;\n }\n handleEarlyAccessEnrollModal();\n }\n}\n/**\n * Login form on PDP Early Access\n * @param {Object} form - form element\n */\nfunction earlyAccessSignIn(form) {\n const url = form.attr('action');\n $.spinner().start();\n $.ajax({\n url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n $.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n form.trigger('login:error', data);\n } else {\n const { loyaltyProgramMemberId, postalCode } = data;\n $(loyaltyEarlyAccessRegisterForm).modal('hide');\n handlePdpEarlyAccessLoginRegistration(!!loyaltyProgramMemberId, postalCode);\n }\n },\n error: function () {\n $.spinner().stop();\n $(loyaltyEarlyAccessRegisterForm).modal('hide');\n }\n });\n}\n/**\n * Remove show modal session attribute on close of welcome modal\n */\nfunction removeWelcomeModalShowSession() {\n const closeButton = queryFirst('.loyalty-welcome-popup .close-welcome-modal');\n getJSON(closeButton.dataset.welcomeSessionUrl, 'get');\n}\n/**\n * Registration form on PDP Early Access\n * @param {Object} form - form element\n */\nfunction earlyAccessRegistration(form) {\n const url = form.attr('action');\n $.spinner().start();\n $.ajax({\n url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n $.spinner().stop();\n if (data.success) {\n const { optedInToLoyalty, postalCode } = data;\n const showWelcomeModal = optedInToLoyalty;\n $(loyaltyEarlyAccessRegisterForm).modal('hide');\n handlePdpEarlyAccessLoginRegistration(optedInToLoyalty, postalCode, showWelcomeModal);\n } else {\n formValidation(form, data);\n form.trigger('register:error');\n }\n },\n error: function () {\n $.spinner().stop();\n $(loyaltyEarlyAccessRegisterForm).modal('hide');\n }\n });\n}\n/**\n * Function to attach form validation events\n * @param {Object} form - form element\n */\nfunction attachLoginRegistrationFormEvents(form) {\n ajaxFormInvalid(form);\n ajaxFormSubmit(form);\n enableFormSubmitButton();\n}\n\n/**\n * Function to handle early access sign in or registration on PLP and PDP page\n * @param {Object} earlyAccessCta - element\n */\nfunction handleEarlyAccessLogin(earlyAccessCta) {\n const { initPopover, initPopoverClose, POPOVER_CLICK_BOTTOM } = require('../popover');\n\n if (earlyAccessCta) {\n const { actionUrl } = earlyAccessCta.dataset;\n $.spinner().start();\n $.ajax({\n url: actionUrl,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n if (data.success) {\n $(loyaltyEarlyAccessRegisterForm).modal('show');\n const { accountRegistrationForm, loginForm, keepUserLoggedIn, isPersistentLoginEnabled } = data;\n const signInForm = queryFirst('.early-access-login-form');\n const registerForm = queryFirst('.early-access-register-form');\n signInForm.innerHTML = loginForm;\n\n registerForm.innerHTML = accountRegistrationForm;\n const accountHelpEl = queryFirst('.account-need-help');\n const earlyAccessRegisterLeft = queryFirst('.registration-left');\n const earlyAccessRegisterRight = queryFirst('.registration-right');\n addClass(accountHelpEl, hiddenClass);\n addClass([earlyAccessRegisterLeft, earlyAccessRegisterRight], 'col-md-6');\n const loyaltyRegistrationForm = '.early-access-register-form form.registration';\n const loyaltyLoginForm = '.early-access-login-form form.login';\n resetPassword();\n invalid();\n attachLoginRegistrationFormEvents(loyaltyLoginForm);\n attachLoginRegistrationFormEvents(loyaltyRegistrationForm);\n const registrationFormPhone = queryFirst('.registration-form-phone', earlyAccessRegisterLeft);\n const addToLoyaltyProgram = queryFirst('#add-to-loyalty-program', earlyAccessRegisterRight);\n if (addToLoyaltyProgram) {\n addToLoyaltyProgram.addEventListener('change', e => {\n const createAcctBtn = queryFirst('.create-account-btn');\n const earlyAccessMsg = queryFirst('input[name=\"earlyAccessMessage\"]');\n const earlyAccessProduct = earlyAccessMsg && earlyAccessMsg.value;\n if (e.currentTarget.checked) {\n createAcctBtn.setAttribute('data-product-badge', earlyAccessProduct);\n } else {\n createAcctBtn.setAttribute('data-product-badge', '');\n }\n });\n }\n formatPhoneNumber(registrationFormPhone);\n validateDate();\n if (isPersistentLoginEnabled) {\n const signInContainer = queryFirst('.logged-in-user-notifications');\n signInContainer.innerHTML = keepUserLoggedIn;\n const keepUserSignedInPopover = queryFirst('.keep-user-signed-in', signInForm);\n const keepUserSignedContainer = queryFirst('.logged-in-user-notification', signInContainer);\n initPopover(keepUserSignedInPopover, POPOVER_CLICK_BOTTOM, {\n content: keepUserSignedContainer\n });\n\n initPopoverClose();\n }\n\n\n $(loyaltyLoginForm).off('submit').on('submit', function (e) {\n const form = $(this);\n e.preventDefault();\n earlyAccessSignIn(form);\n });\n $(loyaltyRegistrationForm).off('submit').on('submit', function (e) {\n const form = $(this);\n e.preventDefault();\n earlyAccessRegistration(form);\n });\n $body.trigger('login:dialogLoaded');\n }\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\n/**\n * hide or show drawer image in mobile and desktop view\n * @param {string} drawerMobileImg - image for mobile view\n * @param {string} drawerDesktopImg - image for desktop view\n */\nfunction hideShowDrawerImage(drawerMobileImg, drawerDesktopImg) {\n const desktopImageWrapper = queryFirst('.drawer-img-wrap-desktop');\n const mobileImageWrapper = queryFirst('.drawer-img-wrap-mobile');\n const drawerMobileImgEl = queryFirst('.drawer-image-mobile');\n const drawerDesktopImgEl = queryFirst('.drawer-image-desktop');\n\n // check if scene7 link is present for mobile or desktop or both\n if (drawerMobileImg !== 'null' && drawerMobileImgEl) {\n drawerMobileImgEl.src = drawerMobileImg;\n }\n\n loyaltyDrawerImageView(drawerMobileImg, mobileImageWrapper);\n\n if (drawerDesktopImg !== 'null' && drawerDesktopImgEl) {\n drawerDesktopImgEl.src = drawerDesktopImg;\n }\n\n loyaltyDrawerImageView(drawerDesktopImg, desktopImageWrapper);\n}\n\n/**\n * update the backgroud of referral section bassed on the configuration in content asset\n */\nfunction updateReferralBg() {\n const loyaltyReferralBg = queryFirst('.referral-section-bg-color');\n if (!loyaltyReferralBg) {\n return;\n }\n const { bgColor, bgImageDesktop, bgImageMobile } = loyaltyReferralBg.dataset;\n if (bgImageDesktop) {\n root.style.setProperty('--referral-bg-img-desktop', `url(${bgImageDesktop})`);\n }\n if (bgImageMobile) {\n root.style.setProperty('--referral-bg-img-mobile', `url(${bgImageMobile})`);\n }\n if (bgColor) {\n root.style.setProperty('--referral-bg-color', bgColor);\n }\n}\n\n\n/**\n * handling hide or show of drawer image and background color in mobile and desktop view\n * @param {string} image - image of mobile/desktop view\n * @param {string} el - wrapper element of desktop/mobile\n */\nfunction loyaltyDrawerImageView(drawerImage, el) {\n const loyaltyModalEl = queryFirst('#loyalty-program-modal .modal-content');\n const withImageEl = queryFirst('.drawer-with-img', el);\n const withoutImageEl = queryFirst('.drawer-without-img', el);\n const loyaltyDrawerBackground = 'loyalty-background';\n\n if (drawerImage && drawerImage !== 'null') {\n addClass(withoutImageEl, hiddenClass);\n removeClass(withImageEl, hiddenClass);\n addClass(loyaltyModalEl, loyaltyDrawerBackground);\n } else {\n removeClass(withoutImageEl, hiddenClass);\n addClass(withImageEl, hiddenClass);\n addClass(loyaltyModalEl, loyaltyDrawerBackground);\n }\n\n}\n\n/**\n * show how to earn drawer image in mobile and desktop view\n * @param {string} drawerMobileImg - image for mobile view\n * @param {string} drawerDesktopImg - image for desktop view\n * @param {string} drawerTitle - title for the drawer\n * @param {string} drawerCloseButtonLabel - close button label\n */\nfunction showHowToEarnDrawerImage(drawerMobileImg, drawerDesktopImg, drawerTitle, drawerCloseButtonLabel) {\n const drawerMobileImgEl = queryFirst('.drawer-image-mobile');\n const drawerDesktopImgEl = queryFirst('.drawer-image-desktop');\n const drawerTitleE1 = queryFirst('#loyalty-how-to-earn-modal-label');\n const drawerCloseButtonE1 = queryFirst('#loyalty-how-to-earn-modal .close-current-modal');\n\n if (drawerTitle && drawerTitleE1) {\n drawerTitleE1.innerHTML = drawerTitle;\n }\n if (drawerCloseButtonLabel && drawerCloseButtonE1) {\n drawerCloseButtonE1.ariaLabel = drawerCloseButtonLabel;\n }\n if (drawerMobileImg !== 'null' && drawerMobileImgEl) {\n drawerMobileImgEl.src = drawerMobileImg;\n }\n if (drawerDesktopImg !== 'null' && drawerDesktopImgEl) {\n drawerDesktopImgEl.src = drawerDesktopImg;\n }\n}\n/**\n * Add the image URL in download CTA on select of wallpaper swatch\n * @param {HTMLElement} selectedWallpaperId - selected swatch element Id\n */\nfunction updateImgURLOnDownloadCta(selectedWallpaperId) {\n const selectTab = selectedWallpaperId ? queryFirst(selectedWallpaperId) : queryFirst('.main-swatch-section .tab-pane.active');\n const imageElement = queryFirst('.wallpaper-main-image', selectTab);\n const swatchImageDownloadCtaDesktop = queryFirst(downloadCtaDesktop, swatchImageDownload);\n const swatchImageDownloadCtaMobile = queryFirst(downloadCtaMobile, swatchImageDownload);\n const swatchImageDownloadedCtaDesktop = queryFirst(downloadCtaDesktop, swatchImageDownloaded);\n const swatchImageDownloadedCtaMobile = queryFirst(downloadCtaMobile, swatchImageDownloaded);\n if (imageElement) {\n const { desktopDownloadedImage, mobileDownloadedImage } = imageElement.dataset;\n setAttribute(swatchImageDownloadCtaDesktop, 'href', desktopDownloadedImage);\n setAttribute(swatchImageDownloadCtaMobile, 'href', mobileDownloadedImage);\n setAttribute(swatchImageDownloadedCtaDesktop, 'href', desktopDownloadedImage);\n setAttribute(swatchImageDownloadedCtaMobile, 'href', mobileDownloadedImage);\n }\n}\n\n/**\n * Add click event listener on download cta to call the update image URL function\n */\nfunction loyaltySwatchImgDownload() {\n updateImgURLOnDownloadCta();\n $body.on('click', '.img-wallpaper', function (e) {\n const selectedWallpaperId = this.closest('a').hash;\n updateImgURLOnDownloadCta(selectedWallpaperId);\n addClass(swatchImageDownloaded, hiddenClass);\n removeClass(swatchImageDownload, hiddenClass);\n });\n\n $body.on('click', '.download-cta.desktop-show, .download-cta.mobile-show', function () {\n addClass(swatchImageDownload, hiddenClass);\n removeClass(swatchImageDownloaded, hiddenClass);\n });\n}\n\n/**\n * Updated the counter timmer in every second\n * @param {string} countDataMsg - timmer string\n * @param {string} countDownTime - countDownTimmer\n * @param {HTMLElement} countDownEle - Html element where the timer needs to updated\n * @param {Object} timeinterval - OOS javascript function updated on every second\n */\nfunction updateClock(countDataMsg, countDownTime, countDownEle, timeinterval, countDataMsgNoDays) {\n const { tokenize } = require('../util');\n const timer = getTimeRemaining(countDownTime);\n const newCountDataMsg = (timer.days === 0) ? countDataMsgNoDays : countDataMsg;\n countDownEle.innerHTML = tokenize(newCountDataMsg, timer, '[', ']');\n if (timer.total <= 0) {\n clearInterval(timeinterval);\n }\n}\n\n\n/**\n * Updated voucher Expiry date to formatted string\n * @param {string} expiryDate - API response expiry date string\n * @param {string} formatString - format string of resource message\n * @return {string} formattedString - formatted expiry date string\n */\nfunction getFormatDateString(expiryDate, formatString) {\n if (!expiryDate) {\n return expiryDate;\n }\n const expiryDateStringArray = expiryDate.split(' ');\n const formattedString = expiryDateStringArray[0] + ' ' + formatString;\n return formattedString;\n}\n/**\n * Add click event listener on download cta to call the update image URL function\n */\nfunction exclusiveExperiencesCountDown() {\n const exclusiveExperiencesTile = queryAll('.exclusive-tile');\n if (exclusiveExperiencesTile.length > 0) {\n for (let i = 0, n = exclusiveExperiencesTile.length; i < n; i++) {\n const exclusiveModule = exclusiveExperiencesTile[i];\n const countDownTime = exclusiveModule.dataset.countDownTimer;\n const countDownEle = queryFirst('.count-down-timer', exclusiveModule);\n const countDownEleNoDays = queryFirst('.count-down-timer-nodays', exclusiveModule);\n const countDataMsg = countDownEle.dataset.counterMsg;\n const countDataMsgNoDays = countDownEleNoDays.dataset.counterMsg;\n if (countDownTime) {\n // update the counter\n const timeinterval = setInterval(function () { updateClock(countDataMsg, countDownTime, countDownEle, timeinterval, countDataMsgNoDays) }, 1000);\n } else {\n addClass(countDownEle, hiddenClass);\n }\n }\n }\n}\n\n/**\n * Hide show the right and left icon if carousel reaches to last or first position\n */\n$(exclusiveCarouselIdSelector).carousel({\n wrap: false\n});\n\nconst carouselControlsToggle = function () {\n const exclusiveCarousel = queryFirst(exclusiveCarouselIdSelector);\n\n if (exclusiveCarousel) {\n const parentElement = queryFirst('.image-slide-indicators', exclusiveCarousel);\n const carouselControl = queryFirst('.lp-icon-chevron', exclusiveCarousel);\n const { lastElementChild, firstElementChild } = parentElement;\n const previousControl = queryFirst('.carousel-control-prev', exclusiveCarousel);\n const nextControl = queryFirst('.carousel-control-next', exclusiveCarousel);\n if (hasClass(lastElementChild, activeClass)) {\n addClass(nextControl, hiddenClass);\n removeClass(previousControl, hiddenClass);\n } else if (hasClass(firstElementChild, activeClass)) {\n removeClass(nextControl, hiddenClass);\n addClass(previousControl, hiddenClass);\n } else {\n removeClass(carouselControl, hiddenClass);\n }\n }\n};\n\nwindow.addEventListener('load', (event) => {\n const formElement = queryFirst('.loyalty-get-access');\n const referrerID = getItemFromLocalStorage('REFERRED_ID');\n if (referrerID && formElement) {\n loadInput(referrerID, formElement);\n }\n});\n\nif (earlyAccessPdpSignInRegistration.length) {\n earlyAccessPdpSignInRegistration.forEach((earlyAccessBtn) => {\n earlyAccessBtn.addEventListener('click', e => {\n e.preventDefault();\n handleEarlyAccessLogin(earlyAccessBtn);\n });\n });\n}\n\n/**\n * Function to initialize events\n */\nfunction init() {\n loyaltySwatchImgDownload();\n exclusiveExperiencesCountDown();\n carouselControlsToggle();\n $(exclusiveCarouselIdSelector).on('slid.bs.carousel', '', carouselControlsToggle);\n}\n\nmodule.exports = {\n loyaltyDrawer: function () {\n const loyaltyAppImage = queryFirst('.is-drawer-img');\n if (loyaltyAppImage) {\n const loyaltyDrawerContent = queryFirst('.loyalty-drawer-content');\n const { isAppDrawer } = loyaltyAppImage.dataset;\n const drawerAppImgEl = queryFirst('.drawer-image-mobile');\n if (isAppDrawer === \"true\") {\n mobileImg = loyaltyAppImage.dataset.mobileImg;\n const appImageWrapper = queryFirst('.drawer-img-wrap-mobile');\n if (mobileImg && mobileImg !== 'null') {\n drawerAppImgEl.src = mobileImg;\n }\n const appMobileImgEl = queryFirst('body');\n addClass(appMobileImgEl, 'loyalty-background-ios');\n loyaltyDrawerImageView(mobileImg, appImageWrapper);\n }\n removeClass(loyaltyDrawerContent, hiddenClass);\n }\n\n $body.on('click', '.loyalty-program-drawer-link, .loyalty-program-terms-condition, .loyalty-how-to-earn-drawer-link', function (e) {\n e.preventDefault();\n const url = this.dataset.href;\n const isLoyaltyProgramDrawerClick = $(this).hasClass('loyalty-program-drawer-link');\n const isLoyaltyProgramOverviewFromHeader = $(this).hasClass('loyalty-program-overview-from-header');\n const isMobileSession = queryFirst('.mobile-session');\n if (isMobileSession) {\n return true;\n }\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'html',\n success: function (data) {\n if (data) {\n if (isLoyaltyProgramDrawerClick) {\n const loyaltyContainer = queryFirst('.loyalty-drawer-body');\n loyaltyContainer.innerHTML = data;\n const loyaltyDrawerContent = queryFirst('.loyalty-drawer-content');\n removeClass(loyaltyDrawerContent, hiddenClass);\n const guestEnrollment = queryFirst('.lilly-loyalty-container .guest-enrollment');\n const memberSignInEnrollment = queryFirst('.lilly-loyalty-container .already-registered-log-in');\n if (guestEnrollment && memberSignInEnrollment) {\n if (isLoyaltyProgramOverviewFromHeader) {\n removeClass([guestEnrollment, memberSignInEnrollment], hiddenClass);\n } else {\n addClass([guestEnrollment, memberSignInEnrollment], hiddenClass);\n }\n }\n const loyaltyIsImage = queryFirst('.is-drawer-img', loyaltyContainer);\n desktopImg = loyaltyIsImage.dataset.desktopImg;\n mobileImg = loyaltyIsImage.dataset.mobileImg;\n hideShowDrawerImage(mobileImg, desktopImg);\n } else {\n const loyaltyContainer = queryFirst('.loyalty-how-to-earn-drawer-body');\n loyaltyContainer.innerHTML = data;\n const loyaltyIsImage = queryFirst('.is-how-to-earn-drawer-img', loyaltyContainer);\n desktopImg = loyaltyIsImage.dataset.desktopImg;\n mobileImg = loyaltyIsImage.dataset.mobileImg;\n const title = loyaltyIsImage.dataset.title;\n const closeButtonLabel = loyaltyIsImage.dataset.closeButton;\n showHowToEarnDrawerImage(mobileImg, desktopImg, title, closeButtonLabel);\n }\n $.spinner().stop();\n }\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n })\n },\n loyaltyEnrollNowDialog: function () {\n $body.on('click', '.loyalty-enrollnow-cta', function (e) {\n e.preventDefault();\n $('#loyalty-enrollnow-modal').modal('show');\n const loyaltyEnrollPostalCodeContainer = queryFirst('.js-loyalty-access-postal-code');\n const loyaltyEnrollPostalEl = queryFirst('.loyalty-access-form-postalcode', loyaltyEnrollPostalCodeContainer);\n const loyaltyEnrollCheckboxEl = queryFirst('.optin-to-loyalty-program');\n const loyaltyEnrollNowEl = queryFirst('.loyalty-get-access');\n loyaltyEnrollNowEl.dataset.enrollNowSource = MY_ACCOUNT;\n const loyaltyRemoveClass = [];\n if (!hasClass(loyaltyEnrollPostalCodeContainer, hiddenClass)) {\n loyaltyRemoveClass.push(loyaltyEnrollPostalEl);\n loyaltyEnrollPostalEl.value = '';\n }\n if (loyaltyEnrollCheckboxEl) {\n loyaltyRemoveClass.push(loyaltyEnrollCheckboxEl);\n loyaltyEnrollCheckboxEl.checked = false;\n }\n removeClass(loyaltyRemoveClass, invalidClass);\n });\n $body.on('click', '.loyalty-early-access-welcome-cta', function (e) {\n location.reload();\n });\n },\n loyaltyEnrollNowSubmit: function () {\n $('form.loyalty-get-access').off('submit').on('submit', function (e) {\n e.preventDefault();\n const postalCodeEl = queryFirst('.loyalty-access-form-postalcode');\n const referrerIDEl = queryFirst('.referrerID');\n const postalCodeRegex = postalCodeEl ? new RegExp(postalCodeEl.dataset.regexp) : '';\n const postalCode = postalCodeEl ? postalCodeEl.value : '';\n const loyaltyEnrollNowEl = queryFirst('.loyalty-get-access');\n const source = loyaltyEnrollNowEl.dataset.enrollNowSource;\n const referrerID = referrerIDEl ? referrerIDEl.value : '';\n const invalidFeedback = queryFirst('#form-postalcode-error.invalid-feedback');\n if (postalCode && !postalCodeRegex.test(postalCode)) {\n if (invalidFeedback) {\n addClass(postalCodeEl, invalidClass);\n invalidFeedback.textContent = postalCodeEl.dataset.patternMismatch;\n }\n }\n else {\n $.spinner().start();\n let requestData = {\n postalCode,\n lillyLoyaltyProgram: true,\n source\n };\n if (referrerIDEl) {\n requestData = {\n postalCode,\n lillyLoyaltyProgram: true,\n referrerID\n };\n }\n const url = this.dataset.href;\n $.ajax({\n url: url,\n type: 'POST',\n data: requestData,\n dataType: 'html',\n success: function (data) {\n const responseData = JSON.parse(data);\n if (responseData.success) {\n $('#loyalty-enrollnow-modal').modal('hide');\n $('#loyalty-welcome-popup').modal('show');\n }\n $.spinner().stop();\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n }\n\n });\n const loyaltyUnenrollDashboard = queryFirst('.loyalty-dashboard-unenroll');\n $(loyaltyWelcomeDialog).on('hidden.bs.modal', function () {\n if (loyaltyUnenrollDashboard) {\n location.reload();\n }\n });\n const accountLoyaltyDashboard = queryFirst('.account-lilly-loyalty');\n if (accountLoyaltyDashboard && accountLoyaltyDashboard.dataset.showWelcomePopup === 'true') {\n $('#loyalty-welcome-popup').modal('show');\n removeWelcomeModalShowSession();\n }\n },\n loyaltyDashboardShow: function () {\n $('.loyalty-dashboard-link').off('click').on('click', function (e) {\n e.preventDefault();\n const url = this.dataset.checkLoyaltyAccess;\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n if (!data) {\n $.spinner().stop();\n return false;\n }\n if (data.showEnrollmentModel) {\n $body.trigger('clubLilly:EnrollModal');\n if (data.imageUrls) {\n const modelImages = data.imageUrls;\n const enrollmentModel = $('.loyalty-enroll-now-container');\n const welcomeModel = $('.loyalty-welcome-popup');\n enrollmentModel.find('.drawer-image-source').attr('srcset', modelImages.loyaltyaccesspopupmobile);\n enrollmentModel.find('.drawer-image').attr('src', modelImages.LoyaltyguestenrollmentnonloyaltyD2x);\n welcomeModel.find('.drawer-image-source').attr('srcset', modelImages.loyaltywelcomepopupmobile);\n welcomeModel.find('.drawer-image').attr('src', modelImages.LoyaltywelcomeloyaltyD2x);\n $('#loyalty-enrollnow-modal').modal('show');\n }\n } else {\n window.location.href = data.redirectUrl;\n }\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n loyaltyDashboardOffersTile: function () {\n const offerExpirationDateEl = queryAll('.offer-expiration-date');\n offerExpirationDateEl.forEach(el => {\n const expirationDateTime = el.textContent;\n el.textContent = expirationDateTime.split(' ')[0];\n });\n $body.on('click', '.flip-card-front', function (e) {\n e.preventDefault();\n const cardFlippedEl = this.closest('.offer-flip-card');\n const cardFront = queryFirst('.flip-card-front', cardFlippedEl);\n addClass(cardFlippedEl, 'offer-card-flipped');\n cardFront.style.pointerEvents = 'none';\n });\n $body.on('click', '.reveal-state-done', function (e) {\n e.preventDefault();\n const cardFlippedEl = this.closest('.offer-flip-card');\n const cardFront = queryFirst('.flip-card-front', cardFlippedEl);\n removeClass(cardFlippedEl, 'offer-card-flipped');\n cardFront.style.pointerEvents = 'unset';\n });\n $body.on('click', '.view-copy-code-cta', function (e) {\n e.preventDefault();\n const { target, expiryDate, couponCode, formatString } = e.target.dataset;\n const offerDiscountDialog = queryFirst(target);\n const offerDiscountTileData = queryFirst('.offer-tile-content', offerDiscountDialog);\n const offerDiscountModalData = queryFirst('.offer-code-modal-content', offerDiscountDialog);\n const copyCodeText = queryFirst('.copy-code-section .code-section', offerDiscountDialog);\n queryFirst('.coupon-expiry .expiry-date', offerDiscountDialog).textContent = getFormatDateString(expiryDate, formatString);\n copyCodeText.textContent = couponCode;\n addClass(offerDiscountTileData, hiddenClass);\n removeClass(offerDiscountModalData, hiddenClass);\n $(offerDiscountDialog).modal('show');\n copyCodeText.select();\n copyCodeText.setSelectionRange(0, 99999); /* For mobile devices */\n /* Copy the text */\n navigator.clipboard.writeText(copyCodeText.value);\n });\n },\n loyaltyReferralDrawer: function () {\n $body.on('click', '.loyalty-referral-drawer-link', function (e) {\n const referralUrlElement = queryFirst('.referral-drawer-link');\n $('.referral-link').val((referralUrlElement.dataset.referralUrl).replace('https://', ''));\n $body.addClass('referral-modal');\n });\n },\n loyaltyCopyReferralUrl: function () {\n $body.on('click', '.referral-cta-link', function (e) {\n const copyReferralUrl = queryFirst('.referral-link');\n const copyCta = queryFirst('.referral-cta-link');\n const copiedLinkCta = queryFirst('.copied-link');\n const referralUrlElement = queryFirst('.referral-drawer-link');\n copyReferralUrl.select();\n copyReferralUrl.setSelectionRange(0, 99999); /* For mobile devices */\n\n /* Copy the text */\n navigator.clipboard.writeText(referralUrlElement.dataset.referralUrl).then(function () {\n /* clipboard successfully set */\n addClass(copyCta, hiddenClass);\n removeClass(copiedLinkCta, hiddenClass);\n setTimeout(function () {\n removeClass(copyCta, hiddenClass);\n addClass(copiedLinkCta, hiddenClass);\n }, 3000);\n });\n });\n },\n loyaltyOopsRefreshSection: function (e) {\n $body.on('click', '.error-refresh-link', function (e) {\n e.preventDefault();\n const url = this.dataset.referralUrl;\n const successServiceResData = this.closest('.service-response-section');\n if (!successServiceResData) {\n location.reload();\n }\n const tooltipModule = queryFirst('.tool-tip-content', successServiceResData);\n const tooltipInnerData = queryFirst('.' + tooltipModule.id);\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n if (!data.error) {\n if (successServiceResData) {\n successServiceResData.innerHTML = data.serviceResHTMLData;\n const updatedToolTip = queryFirst('.tool-tip-content', successServiceResData);\n if (updatedToolTip && tooltipInnerData) {\n updatedToolTip.innerHTML = tooltipInnerData.innerHTML;\n const popContent = queryFirst('.loyalty-tooltip-popover', updatedToolTip);\n const tooltipIcon = queryFirst('.loyalty-tooltip-icon', updatedToolTip);\n $(tooltipIcon).popover({\n trigger: 'click',\n placement: 'auto',\n html: true,\n content: popContent\n });\n $('[data-toggle=\"popover\"]').on('shown.bs.popover', function (e) {\n const { target } = e;\n $body.one('click', function (clickEvent) {\n const clicked = clickEvent.target;\n if (clicked !== target && clicked.parentElement !== target && $('.popover.show').length) {\n $(target).trigger('click');\n }\n });\n });\n const scrollableContent = queryFirst('.scrollable-content', successServiceResData);\n if (scrollableContent) initSpecificCarousel(scrollableContent);\n }\n updateReferralBg();\n init();\n }\n }\n $.spinner().stop();\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n });\n },\n referralModuleBg: function (e) {\n updateReferralBg();\n const referralSection = queryFirst('.referral-section-bg-color');\n removeClass(referralSection, hiddenClass);\n },\n loyaltyEarlyAccessSignUp: function () {\n $body.on('click', '.early-access-registered .early-access-sign-up', function (e) {\n e.preventDefault();\n handleEarlyAccessEnrollModal();\n });\n\n $body.on('click', '.early-access-register-form-cancel', function (e) {\n e.preventDefault();\n $(loyaltyEarlyAccessRegisterForm).modal('hide');\n });\n },\n\n init: init,\n handleEarlyAccessLogin: handleEarlyAccessLogin\n};\n\nwindow.addEventListener('resize', throttle(() => {\n if (mobileImg || desktopImg) {\n hideShowDrawerImage(mobileImg, desktopImg);\n }\n updateReferralBg();\n}));\n","'use strict';\n\n/**\n * Helper module for initialization popover elements\n *\n * @module popover\n */\n\nconst { queryFirst, queryAll, hasClass } = require('./domUtil');\n\nconst phInfoPopover = queryFirst('.ph-number-info-popover .content-asset');\nconst fpoInfoPopover = queryFirst('.fpo-info-popover .content-asset');\nconst checkoutBenefitsInfoPopover = queryFirst('.checkout-benefits-info .checkout-benefits-info-content');\nconst cvvInfoPopover = queryFirst('.cvv-info-popover .cvv-info-popover-content');\nconst giftCardInfoPopover = queryFirst('.gift-card-number-info-popover .content-asset');\nconst birthdayInfoPopover = queryFirst('.birthday-info-popover .content-asset');\nconst deliveryFeeInfoPopover = queryFirst('.delivery-fee-info-popover .content-asset');\nconst boltSignoutMessage = queryFirst('.bolt-logout-button .bolt-sign-out');\nconst earlyAccessMessage = queryFirst('.loyalty-early-access-lock-container .early-access-container-tooltip');\nconst giftReturnNumberInfoPopover = queryFirst('.gift-return-order-no-popover .content-asset');\nconst keepUserSignedInPopover = queryFirst('.remember-me .keep-user-signed-in');\nconst keepUserSignedInContainer = queryFirst('.remember-me .logged-in-user-notification');\nconst earlyAccessLockedSelector = '.loyalty-early-access-locked';\nconst pdpChatWrapper = queryFirst('.pdp-chat');\nconst pdpChatPopover = queryFirst('.pdp-chat-label');\nconst pdpChatContainer = queryFirst('.pdp-chat-container');\n\nconst initPopover = (selector, ...options) => $(selector).popover(Object.assign({}, ...options));\n\n// default popover options\nconst POPOVER_CLICK_BOTTOM = {\n trigger: 'click',\n placement: 'bottom',\n html: true\n};\n/*\n * Handle clicks outside of popover in order to close it\n */\nconst initPopoverClose = () => {\n // since it can be called dynamically, first we get rid of old events\n $('[data-toggle=\"popover\"]')\n .off('shown.bs.popover')\n .on('shown.bs.popover', function (e) {\n const { target } = e;\n $(document).one('click', function (clickEvent) {\n const clicked = clickEvent.target;\n if (clicked !== target && clicked.parentElement !== target && $('.popover.show').length) {\n $(target).trigger('click');\n }\n });\n });\n};\n/*\n * Assign custom close event on custom selector\n */\nconst initPopoverCloseSelector = () => {\n $('[data-close-popover-selector]').on('click', function () {\n const tooltipSelector = $(this).data('close-popover-selector');\n $(tooltipSelector).popover('hide');\n });\n};\n\n/**\n * Initializing popover for promotions on a page\n */\nconst initPopoverPromotions = () => {\n queryAll('.promotions-info').forEach((button) => {\n const popoverContent = queryFirst('.promotions-info-popover .promotions-info-popover-content', button.parentElement);\n\n $(button).popover({\n trigger: 'click',\n placement: 'bottom',\n html: true,\n content: popoverContent\n });\n });\n};\n/**\n * Initializing popover for strike hearts on a page\n */\nconst initPopoverWishList = () => {\n queryAll('.strike-wish-list').forEach((button) => {\n const popoverContent = button.dataset.content;\n $(button).popover({\n trigger: 'click',\n placement: 'bottom',\n html: true,\n content: popoverContent\n });\n });\n};\n\n/**\n * Early access locked message popover\n */\nconst initPopoverEarlyAccessLocked = () => {\n const earlyAccessMessage = queryFirst('.loyalty-early-access-lock-container .early-access-container-tooltip');\n\n if (hasClass(queryFirst(earlyAccessLockedSelector), 'has-early-access-container')) {\n initPopover(earlyAccessLockedSelector, POPOVER_CLICK_BOTTOM, {\n content: earlyAccessMessage\n });\n }\n};\n\n/**\n * All of usual popover elements on site\n * TODO: Ideally refactor to something dynamical, when it appear in DOM - initialize it\n */\nconst initPopoverAll = () => {\n initPopover('.ph-number-info', POPOVER_CLICK_BOTTOM, {\n content: phInfoPopover\n });\n\n const popoverIcons = queryAll('.loyalty-tooltip-icon');\n popoverIcons.forEach((tooltipIcon) => {\n const popContent = queryFirst('.loyalty-tooltip-popover', tooltipIcon.parentElement);\n\n initPopover(tooltipIcon, POPOVER_CLICK_BOTTOM, {\n content: popContent,\n placement: 'auto'\n });\n });\n\n initPopover('.birthday-info', POPOVER_CLICK_BOTTOM, {\n content: birthdayInfoPopover\n });\n\n initPopover('.fpo-info', POPOVER_CLICK_BOTTOM, {\n content: fpoInfoPopover\n });\n\n initPopover('.checkout-benefits-info', POPOVER_CLICK_BOTTOM, {\n container: '.new-customers',\n offset: '160 0',\n content: checkoutBenefitsInfoPopover\n });\n\n initPopover('.cvv-info', POPOVER_CLICK_BOTTOM, {\n content: cvvInfoPopover\n });\n\n initPopover('.gift-return-order-no', POPOVER_CLICK_BOTTOM, {\n content: giftReturnNumberInfoPopover\n });\n\n initPopover('.gift-card-number-info', POPOVER_CLICK_BOTTOM, {\n content: giftCardInfoPopover\n });\n\n initPopover('.delivery-fee-info', POPOVER_CLICK_BOTTOM, {\n content: deliveryFeeInfoPopover\n });\n\n initPopover('.bolt-logout-button-container', POPOVER_CLICK_BOTTOM, {\n content: boltSignoutMessage\n });\n\n initPopoverPromotions();\n initPopoverWishList();\n\n if (hasClass(queryFirst(earlyAccessLockedSelector), 'has-early-access-container')) {\n initPopover(earlyAccessLockedSelector, POPOVER_CLICK_BOTTOM, {\n content: earlyAccessMessage\n });\n }\n\n initPopover(keepUserSignedInPopover, POPOVER_CLICK_BOTTOM, {\n content: keepUserSignedInContainer\n });\n\n initPopover(pdpChatPopover, {\n html: true,\n container: pdpChatWrapper,\n placement: 'bottom',\n content: pdpChatContainer\n });\n\n initPopoverClose();\n initPopoverCloseSelector();\n};\n\nmodule.exports.POPOVER_CLICK_BOTTOM = POPOVER_CLICK_BOTTOM;\n// export the initialization function for places where popover may be initialized dynamically\nmodule.exports.initPopoverClose = initPopoverClose;\nmodule.exports.initPopoverCloseSelector = initPopoverCloseSelector;\n// export function for single initialization of popover\nmodule.exports.initPopover = initPopover;\nmodule.exports.initPopoverPromotions = initPopoverPromotions;\nmodule.exports.initPopoverEarlyAccessLocked = initPopoverEarlyAccessLocked;\nmodule.exports.initPopoverAll = initPopoverAll;\nmodule.exports.initPopoverWishList = initPopoverWishList;\n","/**\n * OOTBS SFRA JS code\n * DRP-180 updated addToCart product set code on line 772 for custom designs\n */\n\n'use strict';\nconst focusHelper = require('base/components/focus');\nimport { queryFirst, queryAll, addClass, removeClass, hasClass, remove, renderFragment, toFormData } from '../domUtil';\nimport { formatMessage, getJSON, getNestedValue, tokenize } from '../util';\nimport { updateProductData, handleColor } from 'fitpredictor/product/secretsauce';\nimport { getStoredDataLayerInfo } from 'analytics/util/analytics-util';\nimport { P_PRODUCT_LIST_KEY, P_PROMO_NAME_KEY, P_PROMO_CREATIVE_NAME } from 'analytics/util/constants';\nimport { setWishlistProductId, showStrikeHearts } from '../wishlist/helper';\n\nconst { trackPageView } = require('../components/etmc');\nconst { toggleSelectSizeInfo, isEarlyAccessElement } = require('./helper');\nconst { swatchNameTemplate, sizeOptionTemplate, sizeButtonTemplate, gwpSizeTemplate, dialogTemplate, loyalty: loyaltyTemplates } = require('../templates');\nconst $body = $('body');\nconst $gwpDialog = $('#chooseBonusProductModal');\nconst hiddenClass = 'd-none';\nconst readyClass = 'ready-to-add';\nconst selectedProductClass = 'selected-product';\nconst notAvailable = 'not-available';\nconst { updateVisibilityOfLowInventoryMsg } = require('../components/shippingPreference/shippingPreferenceHelper');\nconst isFitPredictorEnabled = !!queryFirst('#fitPredictorEnabled');\nconst { PRODUCT_DETAIL_CONTAINER_SELECTOR } = require('../components/shippingPreference/constants');\nconst { HIDDEN_CLASS } = require('../constants');\nconst loyaltyProfile = getNestedValue(window, 'lillyUtils.profile') || {};\nconst { isLoyaltyProgramMember, isLoyaltyAuthenticated, isLoyaltyEnabled } = loyaltyProfile;\nlet observer;\nlet isContentModulesFetched = false;\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n var pid;\n\n if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n pid = $($el).closest('.modal-content').find('.product-quickview').attr('data-pid');\n } else if ($('.quickview-container').length && !$('.product-set').length) {\n pid = $($el).closest('.quickview-container').find('.product-quickview').attr('data-pid');\n } else if ($('.product-set-detail').length || $('.product-set').length) {\n pid = $($el).closest('.product-detail').find('.product-id').first().text();\n } else {\n pid = $($el).closest('.product-detail').find('.product-id').first().text();\n }\n\n return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n return $el && $('.set-items').length ? $el.closest('.product-detail').find('.quantity-select') : $('.quantity-select');\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n var isChoiceOfBonusProducts = $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' + attrValue.value + '\"]');\n var $swatchButton = $attrValue.parent();\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n } else {\n $attrValue.removeClass('selected');\n $attrValue.siblings('.selected-assistive-text').empty();\n }\n\n const { bonusVariationUrl, url } = attrValue;\n\n if (isChoiceOfBonusProducts) {\n if (bonusVariationUrl) {\n $swatchButton.attr('data-url', bonusVariationUrl);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n } else if (url) {\n $swatchButton.attr('data-url', url);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n const $bonusProductItem = $productContainer.parent('.bonus-product-item');\n if ($bonusProductItem.length) {\n const sizes = attr.values;\n const sizeContainer = queryFirst('.selected-size-container', $bonusProductItem[0]);\n if (!sizes.length || !sizeContainer) {\n return;\n }\n\n if (sizes.length === 1) {\n sizeContainer.innerHTML = formatMessage(gwpSizeTemplate.singleSize, sizes[0].displayValue);\n } else {\n const loopStatus = sizeContainer.dataset.loopStatus;\n const resetUrl = attr.resetUrl;\n const selectLabel = sizeContainer.dataset.selectLabel;\n const selectId = `bonus-size-${loopStatus.count || '1'}`;\n\n let sizeOptions = formatMessage(gwpSizeTemplate.multiDefaultSizeOption, resetUrl, selectLabel);\n sizeOptions += sizes\n .map(function (size) {\n const selected = size.selected ? ' selected ' : '';\n const className = !size.inStock || size.forceOutOfStock ? notAvailable : '';\n if (className) {\n const outOfStockMsg = sizeContainer.dataset.outOfStock;\n size.displayValue += ' - ' + outOfStockMsg;\n }\n return formatMessage(gwpSizeTemplate.multiSizeOption, size.url, size.value, selected, size.displayValue, className, className ? 'disabled' : '');\n })\n .join('');\n sizeContainer.innerHTML = formatMessage(gwpSizeTemplate.multiSize, selectId, sizeOptions);\n }\n } else {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n const selectSizeEl = $productContainer.find('.select-size')[0];\n let selectedValue = '';\n if (selectSizeEl) {\n $(selectSizeEl).find('option').not(':first').remove();\n $(selectSizeEl).find('option:first').attr('value', attr.resetUrl);\n }\n attr.values.forEach(function (attrValue) {\n if (selectSizeEl) {\n const assistiveElement = queryFirst('.selected-assistive-text', selectSizeEl.closest('.size-list'));\n assistiveElement.textContent = selectSizeEl.selectedOptions[0].dataset.attrValue;\n if (!attrValue.isOffline) {\n selectSizeEl.innerHTML += sizeOptionTemplate(attrValue.url, attrValue.value);\n }\n if (attrValue.selected) {\n selectedValue = attrValue.value;\n }\n } else {\n var $attrValue = $productContainer.find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n const sizeListItemEl = $attrValue.closest('.size-list');\n if (!attrValue.isOffline) {\n sizeListItemEl.removeClass(hiddenClass);\n } else {\n sizeListItemEl.addClass(hiddenClass);\n }\n if ($attrValue.length > 0) {\n $attrValue.val(attrValue.url).attr('data-attr-url', attrValue.url).removeClass(notAvailable);\n const assistiveElement = queryFirst('.selected-assistive-text', $attrValue[0].closest('.size-list'));\n assistiveElement.textContent = '';\n const { selectedText, outOfStock } = assistiveElement.dataset;\n if (hasClass($attrValue[0], 'selected')) {\n assistiveElement.textContent += selectedText;\n }\n if (!attrValue.inStock || attrValue.forceOutOfStock) {\n $attrValue.addClass(notAvailable);\n assistiveElement.textContent += outOfStock;\n }\n }\n }\n });\n if (selectSizeEl && selectedValue) {\n const optionEl = queryFirst('[data-attr-value=\"' + selectedValue + '\"]', selectSizeEl);\n if (optionEl) {\n optionEl.selected = true;\n } else {\n selectSizeEl.selectedIndex = 0;\n }\n }\n }\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithSwatches = ['color'];\n\n attrs.forEach(function (attr) {\n if (attrsWithSwatches.indexOf(attr.id) > -1) {\n processSwatchValues(attr, $productContainer, msgs);\n } else {\n processNonSwatchValues(attr, $productContainer);\n }\n });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n const { isDirectlyPurchasable } = response.product;\n const availabilityMsgEl = queryFirst('.availability-msg', $productContainer[0]);\n if (isDirectlyPurchasable === false && availabilityMsgEl) {\n availabilityValue = `
  • ${availabilityMsgEl.dataset.notPurchasable}

  • `;\n } else if (response.product.readyToOrder) {\n availabilityMessages.forEach(function (message) {\n availabilityValue += `
  • \n ${message}\n

  • `;\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
    ' + attribute.label + ': ' + attribute.value + '
    ';\n });\n }\n });\n\n return html;\n}\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} options - Ajax response options from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(options, $productContainer) {\n options.forEach(function (option) {\n var $optionEl = $productContainer.find('.product-option[data-option-id*=\"' + option.id + '\"]');\n option.values.forEach(function (value) {\n var valueEl = $optionEl.find('option[data-value-id*=\"' + value.id + '\"]');\n valueEl.val(value.url);\n });\n });\n}\n\n/**\n * Handles the CTAs to be shown for Early Access Product\n * @param {jQuery} productContainer - DOM element for current product\n * @param {boolean} isEarlyAccessProduct - Is the product Early Access Product\n */\nfunction handleEarlyAccessCta(productContainer, isEarlyAccessProduct) {\n const earlyAccessLockIcon = queryFirst('.loyalty-early-access-lock-container', productContainer);\n const earlyAccessWishlistIcon = queryFirst('.add-to-wish-list-container', productContainer);\n const earlyAccessCta = queryFirst('.loyalty-early-access-restricted', productContainer);\n const addToCartCta = queryFirst('.add-to-cart', productContainer);\n const earlyAccessPdpEl = queryFirst('.loyalty-product-pdp-badge', productContainer);\n if (isLoyaltyEnabled && earlyAccessCta) {\n if (earlyAccessPdpEl) {\n addClass([earlyAccessPdpEl, earlyAccessCta], hiddenClass);\n }\n if (isEarlyAccessProduct) {\n if (isLoyaltyProgramMember) {\n addClass([earlyAccessLockIcon, earlyAccessCta], HIDDEN_CLASS);\n if (earlyAccessWishlistIcon && addToCartCta) {\n removeClass([earlyAccessWishlistIcon, addToCartCta], HIDDEN_CLASS);\n }\n } else {\n removeClass([earlyAccessLockIcon, earlyAccessCta], HIDDEN_CLASS);\n if (earlyAccessWishlistIcon && addToCartCta) {\n addClass([earlyAccessWishlistIcon, addToCartCta], HIDDEN_CLASS);\n }\n const earlyAccessGuest = queryFirst('.early-access-guest', earlyAccessCta);\n const earlyAccessRegistered = queryFirst('.early-access-registered', earlyAccessCta);\n if (isLoyaltyAuthenticated) {\n addClass(earlyAccessGuest, HIDDEN_CLASS);\n removeClass(earlyAccessRegistered, HIDDEN_CLASS);\n } else {\n removeClass(earlyAccessGuest, HIDDEN_CLASS);\n addClass(earlyAccessRegistered, HIDDEN_CLASS);\n }\n }\n if (earlyAccessPdpEl) {\n removeClass(earlyAccessPdpEl, hiddenClass);\n }\n } else {\n if (earlyAccessWishlistIcon && addToCartCta) {\n removeClass([earlyAccessWishlistIcon, addToCartCta], hiddenClass);\n }\n addClass([earlyAccessLockIcon, earlyAccessCta], hiddenClass);\n }\n }\n}\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {boolean} isEarlyAccess - Check if the product is early access product\n * @param {boolean} earlyAccessText - Early Access badge text\n * @param {string} videoUrl - Selected variant group video url\n */\nfunction createCarousel(imgs, $productContainer, isEarlyAccess, earlyAccessText, videoUrl) {\n var carousel = $productContainer.find('.carousel:not(.tile-carousel)');\n $(carousel).carousel('dispose');\n var carouselId = $(carousel).attr('id');\n\n const displayCounter = $productContainer.hasClass('product-quickview');\n\n $(carousel)\n .empty()\n .append(\n '
      ' +\n $(carousel).data('prev') +\n '' +\n $(carousel).data('next') +\n ''\n );\n let i;\n for (i = 0; i < imgs.length; i++) {\n let counterHtml = '';\n if (displayCounter && imgs.length > 1) {\n counterHtml = `${i + 1} ${'/'} ${imgs.length}`;\n }\n\n const imageZoomUrl = carousel.data('image');\n const imagePresetUrl = carousel.data('preset');\n const enableCache = carousel.data('cache');\n\n let dataSrc = '';\n if (imgs[i].url.includes(imagePresetUrl)) {\n dataSrc = imgs[i].url.replace(imagePresetUrl, imageZoomUrl);\n } else {\n dataSrc = imgs[i].url + '?$' + imageZoomUrl + '$';\n }\n $(\n '
      ' +\n (i === 0 && earlyAccessText ? formatMessage(loyaltyTemplates.carouselBadge, earlyAccessText) : '') +\n '\"' ' +\n counterHtml +\n '
      '\n ).appendTo($(carousel).find('.carousel-inner'));\n $(\n '
    1. '\n ).appendTo($(carousel).find('.carousel-indicators'));\n }\n const productContainer = $productContainer[0];\n const earlyAccessPdpEl = queryFirst('.loyalty-product-pdp-badge', productContainer);\n const addToWishlistIconPdp = queryFirst('.add-to-wish-list-container', productContainer);\n const loyaltyEarlyAccessEl = queryFirst('.loyalty-early-access-restricted', productContainer);\n const addToCartButtonPdp = queryFirst('.pdp-container .add-to-cart', productContainer);\n const pdpNonEarlyAccessLoginEl = queryFirst('.pdp-sign-in-create-account-section', productContainer);\n\n if (pdpNonEarlyAccessLoginEl) {\n const { isLoyaltyEnabled } = pdpNonEarlyAccessLoginEl.dataset;\n if (isLoyaltyEnabled === 'true' && !isEarlyAccess) {\n removeClass(pdpNonEarlyAccessLoginEl, hiddenClass);\n } else {\n addClass(pdpNonEarlyAccessLoginEl, hiddenClass);\n }\n }\n if (addToCartButtonPdp) {\n removeClass(addToCartButtonPdp, hiddenClass);\n }\n if (earlyAccessPdpEl && loyaltyEarlyAccessEl) {\n addClass([earlyAccessPdpEl, loyaltyEarlyAccessEl], hiddenClass);\n }\n removeClass(addToWishlistIconPdp, hiddenClass);\n if (isEarlyAccess) {\n const loyaltyEarlyAccessLockContainer = queryFirst('.primary-images .loyalty-early-access-lock-container', productContainer);\n if (loyaltyEarlyAccessLockContainer) {\n addClass(loyaltyEarlyAccessLockContainer, hiddenClass);\n }\n }\n handleEarlyAccessCta(productContainer, isEarlyAccess);\n\n const firstImageElement = queryFirst('.carousel-inner .carousel-item img.img-fluid', $productContainer[0]);\n if (firstImageElement) {\n firstImageElement.addEventListener('load', () => {\n $body.trigger('product:imageLoad', {\n container: $productContainer[0]\n });\n });\n }\n if (videoUrl) {\n // LP customizations start\n const productContainer = $productContainer[0];\n const videoTemplate = queryFirst('.product-video-template').cloneNode(true);\n const templateVideoElement = queryFirst('.carousel-item video', videoTemplate);\n if (templateVideoElement) {\n templateVideoElement.setAttribute('poster', imgs[0].url);\n queryAll('source', templateVideoElement).forEach(eachElement => {\n eachElement.setAttribute('src', videoUrl);\n });\n queryFirst('.carousel-inner', carousel[0]).appendChild(queryFirst('.carousel-item', videoTemplate));\n queryFirst('.carousel-item video', productContainer).load();\n }\n // LP customizations end\n\n $('
    2. ').appendTo(\n $(carousel).find('.carousel-indicators')\n );\n }\n $($(carousel).find('.carousel-item')).first().addClass('active');\n $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n if (imgs.length === 1) {\n $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n }\n $(carousel).carousel();\n $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts = $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n const { variationAttributes, productType, readyToOrder, bonusVariationAtrributes, isFinalSale, isDirectlyPurchasable, earlyAccess } = response.product;\n const saleMessageEl = queryFirst('.on-sale-message', $productContainer[0]);\n if (saleMessageEl) {\n if (isFinalSale) {\n removeClass(saleMessageEl, hiddenClass);\n } else {\n addClass(saleMessageEl, hiddenClass);\n }\n }\n\n if (isChoiceOfBonusProducts) {\n if (bonusVariationAtrributes) {\n updateAttrs(bonusVariationAtrributes, $productContainer, response.resources);\n }\n if (productType === 'variant') {\n $productContainer.parent('.bonus-product-item').data('ready-to-order', readyToOrder);\n }\n } else if (variationAttributes) {\n updateAttrs(variationAttributes, $productContainer, response.resources);\n if (isDirectlyPurchasable === false) {\n const sizeElements = queryAll('.size-btn', $productContainer[0]);\n addClass(sizeElements, notAvailable);\n }\n }\n\n // Update primary images\n var primaryImageUrls = isChoiceOfBonusProducts ? response.product.images.checkout : response.product.images.large;\n\n const productContainer = $productContainer[0];\n if (isChoiceOfBonusProducts) {\n // LP customization changes start\n const { alt, url, srcset } = primaryImageUrls[0] || {};\n const productImageElement = queryFirst('.product-image', productContainer);\n productImageElement.setAttribute('src', url);\n productImageElement.setAttribute('srcset', srcset);\n productImageElement.setAttribute('alt', alt);\n // LP customization changes end\n } else if (hasClass(productContainer, 'custom-set-product')) {\n const setModalImages = response.product.images.ispu;\n if (setModalImages) {\n const { alt, url, srcset } = setModalImages[0] || {};\n const productImageElement = queryFirst('.custom-set-detail-modal-img img', productContainer);\n productImageElement.setAttribute('src', url);\n productImageElement.setAttribute('srcset', srcset);\n productImageElement.setAttribute('alt', alt);\n }\n } else {\n createCarousel(primaryImageUrls, $productContainer, earlyAccess && earlyAccess.isEarlyAccessProduct);\n }\n\n // Updated logic here\n const swatchNameElement = queryFirst('.selected-swatch-name', productContainer);\n const selectedSwatch = queryFirst('.swatch-circle.selected', productContainer);\n let selectedSwatchName = '';\n if (selectedSwatch) {\n selectedSwatchName = selectedSwatch.dataset.swatchName;\n }\n if (swatchNameElement) {\n swatchNameElement.textContent = selectedSwatchName;\n } else {\n const swatchHtml = formatMessage(swatchNameTemplate.swatchNameHtml, selectedSwatchName);\n const selectedSwatchElement = queryFirst('.selected-swatch', productContainer);\n if (selectedSwatchElement) {\n selectedSwatchElement.innerHTML = swatchHtml;\n }\n }\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n let $priceSelector = $('.prices .price', $productContainer);\n if (!$priceSelector.length) $priceSelector = $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n const promotionElement = queryFirst('.promotions', productContainer);\n if (promotionElement) {\n promotionElement.innerHTML = response.product.promotionsHtml;\n }\n\n const promotionsPopover = queryFirst('.promotions-info-popover .promotions-info-popover-content');\n $('.custom-set-detail').find('.promotions-info').popover({\n trigger: 'click',\n placement: 'bottom',\n html: true,\n content: promotionsPopover\n });\n $('[data-toggle=\"popover\"]').off('shown.bs.popover').on('shown.bs.popover', function (e) {\n var target = e.target;\n $(document).one('click', function (clickEvent) {\n var clicked = clickEvent.target;\n if (clicked !== target && clicked.parentElement !== target) {\n $(target).trigger('click');\n }\n });\n });\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product,\n $productContainer: $productContainer\n });\n } else if ($productContainer.closest('#productSetModal').length > 0) {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart-global, button.update-cart-product-global')\n .trigger('product:updateAddToCart', {\n product: response.product,\n $productContainer: $productContainer\n })\n .trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty().html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n const $bonusProductItem = $productContainer.parent('.bonus-product-item');\n if (!($bonusProductItem.length > 0)) {\n var optionsHtml = quantities\n .map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n })\n .join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n * @param {Object} selectedSizeElement - DOM element for selected size button\n */\nfunction attributeSelect(selectedValueUrl, $productContainer, selectedSizeElement) {\n if (selectedValueUrl) {\n $body.trigger('product:beforeAttributeSelect', {\n url: selectedValueUrl,\n container: $productContainer\n });\n\n // Updated logic here\n const $choiceOfBonusProductEl = $productContainer.closest('.choice-of-bonus-product');\n if ($choiceOfBonusProductEl.length) {\n $productContainer.spinner().start();\n }\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer);\n updateOptions(data.product.options, $productContainer);\n updateQuantities(data.product.quantities, $productContainer);\n $body.trigger('product:afterAttributeSelect', {\n data: data,\n container: $productContainer,\n selectedSizeElement\n });\n if ($choiceOfBonusProductEl.length) {\n $choiceOfBonusProductEl.trigger('bonus:afterAttributeSelect');\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction selectColorAttribute(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $body.trigger('product:beforeAttributeSelect', {\n url: selectedValueUrl,\n container: $productContainer\n });\n\n // Updated logic here\n const $choiceOfBonusProductEl = $productContainer.closest('.choice-of-bonus-product');\n if ($choiceOfBonusProductEl.length) {\n $productContainer.spinner().start();\n }\n\n getJSON(\n selectedValueUrl,\n 'GET',\n null,\n data => {\n const { options, quantities, uuid } = data.product;\n handleVariantResponse(data, $productContainer);\n updateOptions(options, $productContainer);\n updateQuantities(quantities, $productContainer, uuid);\n const selectedSizeElement = queryFirst('.size-btn.selected', $productContainer[0]);\n $body.trigger('product:afterAttributeSelect', {\n data: data,\n container: $productContainer,\n selectedSizeElement\n });\n if ($choiceOfBonusProductEl.length) {\n const sizeEl = queryFirst('.select-size', $choiceOfBonusProductEl[0]);\n if (sizeEl) sizeEl.selectedIndex = 0;\n $choiceOfBonusProductEl.trigger('bonus:afterAttributeSelect');\n }\n const swatchContainer = queryFirst('.color-container', $productContainer[0]);\n const assistiveElements = queryAll('.selected-assistive-text', swatchContainer);\n const selectedSwatchElement = queryFirst('.swatch-circle.selected', $productContainer[0]);\n const assistiveTextElement = queryFirst('.selected-assistive-text', selectedSwatchElement.closest('.color-list'));\n assistiveElements.forEach(eachElement => {\n eachElement.textContent = '';\n });\n assistiveTextElement.textContent = assistiveTextElement.dataset.selectedText;\n },\n () => {\n $.spinner().stop();\n }\n );\n }\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} data - Shop the print data\n * @param {Object} productContainer - DOM container for a given product\n */\nfunction updateShopThePrint(data, productContainer) {\n const shopThePrintElement = queryFirst('.shop-the-print', productContainer);\n if (shopThePrintElement) {\n if (data) {\n shopThePrintElement.outerHTML = data;\n } else {\n shopThePrintElement.outerHTML = '
      ';\n }\n }\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {int} price - product sale price\n * @param {int} standardPrice - product standard price\n * @param {Object} productContainer - DOM container for a given product\n */\nfunction updateProductPrice(price, standardPrice, productContainer) {\n const priceTemplate = document.getElementById('price-template').cloneNode(true);\n const priceSection = queryFirst('.prices .price', productContainer);\n const priceContainer = queryFirst('.price-section', priceTemplate);\n const strikeThroughContainer = queryFirst('.strike-through-section', priceContainer);\n const priceElement = queryFirst('.strike-through-price', strikeThroughContainer);\n const salesContainer = queryFirst('.sales', priceContainer);\n const salesPriceElement = queryFirst('.price-value', salesContainer);\n let fixedPrice = price;\n let fixedStandardPrice = standardPrice;\n\n // Fix decimal places for non-whole-number prices\n if (price % 1 !== 0) {\n fixedPrice = price.toFixed(2);\n }\n if (standardPrice % 1 !== 0) {\n fixedStandardPrice = standardPrice.toFixed(2);\n }\n\n removeClass(strikeThroughContainer, hiddenClass);\n priceElement.textContent = `$${fixedStandardPrice}`;\n salesPriceElement.textContent = `$${fixedPrice}`;\n if (price === standardPrice) {\n addClass(strikeThroughContainer, hiddenClass);\n }\n priceSection.innerHTML = priceTemplate.innerHTML;\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} sizes - sizes object\n * @param {Object} productContainer - DOM container for a given product\n * @param {Object} variantsList - Variations list data\n */\nfunction updateSizeElements(sizes, productContainer, variantsList) {\n const isQuickView = hasClass(productContainer, 'cached-quick-view');\n const { variants } = isQuickView ? window.quickviewProductInfo.productInventory : window.productInventory;\n const sizeContainer = queryFirst('.size-container', productContainer);\n\n if (!sizeContainer) return;\n\n const { selectedText, outOfStock, label, describedby, attrValue } = sizeContainer.dataset;\n let sizeButtonHtml = '';\n\n variantsList.forEach((eachVariant, index) => {\n const eachSize = sizes[eachVariant];\n const sizeElement = queryFirst('[data-attr=\"size\"] [data-attr-value=\"' + eachVariant + '\"]', productContainer);\n const sizeId = eachSize.ID;\n const { forceOutOfStock } = eachSize;\n const inventoryData = variants[sizeId];\n const variantData = {\n value: eachVariant,\n forceOutOfStock,\n selected: sizeElement ? hasClass(sizeElement, 'selected') : false,\n inStock: inventoryData.availabilityStatus !== 'NOT_AVAILABLE'\n };\n const ariaLabelValue = label + ' ' + attrValue + ' ' + eachVariant;\n sizeButtonHtml += sizeButtonTemplate(variantData, ariaLabelValue, describedby + eachVariant + index, selectedText, outOfStock);\n });\n remove(queryAll('.size-list', sizeContainer));\n sizeButtonHtml += sizeContainer.innerHTML;\n sizeContainer.innerHTML = sizeButtonHtml;\n}\n\n/**\n * Function to update Ways to wear content based on the response\n * @param {string} groupId - selected variation group id\n * @param {string} variationUrl - url to fetch the content\n * @param {HTMLElement} waysToWearContainer - container with recommendations\n */\nfunction updateContentModules(groupId, variationUrl, waysToWearContainer, entry) {\n if (isContentModulesFetched || !entry.isIntersecting) { return; }\n\n $(waysToWearContainer).spinner().start();\n $.ajax({\n url: variationUrl,\n method: 'post',\n data: {\n variationGroup: groupId\n }\n }).done(function (response) {\n if (response) {\n waysToWearContainer.innerHTML = response;\n } else {\n waysToWearContainer.innerHTML = '';\n }\n $body.trigger('search:updateProducts');\n }).always(function () {\n $(waysToWearContainer).spinner().stop();\n isContentModulesFetched = true;\n });\n\n destroyContentModulesIntersectionObserver(waysToWearContainer);\n}\n\n/**\n * Fetch Ways to Wear components only when user scroll near their position\n * @param {string} groupId - selected variation group id\n * @param {string} variationUrl - url to fetch the content\n */\nfunction dynamicallyFetchContentModules(groupId, variationUrl) {\n const waysToWearContainer = queryFirst('.ways-to-wear');\n if (!waysToWearContainer) { return; }\n\n observer = new IntersectionObserver(\n ([entry]) => updateContentModules(groupId, variationUrl, waysToWearContainer, entry),\n { rootMargin: '500px', threshold: 0 }\n );\n observer.observe(waysToWearContainer);\n}\n\n/**\n * Destroy Intersection Observer of Ways to Wear components since it needed only once\n * @param {HTMLElement} waysToWearContainer - container with recommendations\n */\nfunction destroyContentModulesIntersectionObserver(waysToWearContainer) {\n if (observer instanceof IntersectionObserver) {\n observer.unobserve(waysToWearContainer);\n observer = null;\n }\n}\n\n/**\n * updates image urls and presets by appending the scene7 url\n * @param {Object} images - images array to be updated\n * @returns {Object} - updated images array\n */\nfunction updateImageDetails(images) {\n const updatedImages = images.map(imageObj => {\n const srcsetPresets = JSON.parse(imageObj.srcset);\n let srcsetString = [];\n srcsetPresets.forEach(function (item) {\n srcsetString.push(imageObj.imageScene7 + '?' + item.preset + ' ' + item.breakpoint);\n });\n return {\n alt: imageObj.alt,\n url: imageObj.imageScene7 + imageObj.url,\n srcset: srcsetString.join(', '),\n title: imageObj.title\n };\n });\n return updatedImages;\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {Object} currentElement - selected color element\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateProductDetails(currentElement, $productContainer) {\n const { promotionMessageTmpl } = require('../templates').productDetail;\n const { initPopoverPromotions, initPopoverClose } = require('../popover');\n const elementData = currentElement.dataset;\n const variantGroupId = elementData.attrValue;\n const productContainer = $productContainer[0];\n const swatchNameElement = queryFirst('.selected-swatch-name', productContainer);\n const swatchContainer = queryFirst('.color-container', productContainer);\n const assistiveElements = queryAll('.selected-assistive-text', swatchContainer);\n const assistiveTextElement = queryFirst('.selected-assistive-text', currentElement.closest('.color-list'));\n const monogramBtn = queryFirst('.monogram-btn', productContainer);\n const masterId = productContainer.dataset.masterid;\n const productInfo = window.productInfo[masterId];\n const { groupId, sizes, images, shopThePrint, price, standardPrice, videoUrl, variantsList, mgFlag, mgLocs, hasWaysToWear, isFinalSale, isDirectlyPurchasable, earlyAccess, promotions } = productInfo.variants[variantGroupId];\n productContainer.dataset.wishlistId = groupId;\n setWishlistProductId(groupId, productContainer);\n const colorElements = queryAll('.color-attribute .swatch-circle', productContainer);\n const { attrDisplayvalue, customPageTitle, pageTitle, includeLillyColor, lillyColorName, customPageDescription, pageDescription } = elementData;\n const titleElement = queryFirst('.meta-page-title');\n const descriptionElement = queryFirst('.meta-page-description');\n const waysToWearEl = queryFirst('.ways-to-wear', productContainer);\n const variationGridUrl = waysToWearEl.dataset.variationGridUrl;\n const earlyAccessBadgeTextEl = queryFirst('.loyalty-product-pdp-badge .product-tile-badge-text', productContainer);\n const earlyAccessText = earlyAccessBadgeTextEl.textContent;\n // update Marketing Analytics trackWishlist event\n let marketingCloudPageAnalytics = [{ item: groupId }];\n trackPageView(marketingCloudPageAnalytics);\n // Updated logic here\n if (swatchNameElement) {\n const selectedSwatchElement = queryFirst('.selected-swatch', productContainer);\n const colorlabel = selectedSwatchElement.dataset.colorLabel;\n swatchNameElement.textContent = colorlabel + attrDisplayvalue;\n } else {\n const swatchHtml = formatMessage(swatchNameTemplate.swatchNameHtml, attrDisplayvalue);\n queryFirst('.selected-swatch', productContainer).innerHTML = swatchHtml;\n }\n\n if (customPageTitle && titleElement) {\n titleElement.textContent = customPageTitle;\n } else if (pageTitle && titleElement) {\n titleElement.textContent = pageTitle;\n }\n const longDescriptionElement = queryFirst('.long-description-container .long-description', productContainer);\n if (longDescriptionElement) {\n const { longDescription } = longDescriptionElement.dataset;\n let description;\n if (includeLillyColor !== 'false' && lillyColorName) {\n description = tokenize(longDescription, { lillyColor: lillyColorName }, '{{', '}}');\n } else {\n description = tokenize(longDescription, { lillyColor: '' }, '
    3. {{', '}}
    4. ');\n }\n longDescriptionElement.innerHTML = description;\n }\n if (customPageDescription && descriptionElement) {\n descriptionElement.content = customPageDescription;\n } else if (pageDescription && descriptionElement) {\n descriptionElement.content = pageDescription;\n }\n\n removeClass(colorElements, 'selected');\n addClass(queryFirst('.swatch-circle', currentElement), 'selected');\n queryFirst('.product-id', productContainer).textContent = masterId;\n\n assistiveElements.forEach(eachElement => {\n eachElement.textContent = '';\n });\n\n assistiveTextElement.textContent = assistiveTextElement.dataset.selectedText;\n\n const productFinalSaleMessage = queryFirst('.on-sale-message', productContainer);\n const productFreeReturnsMessage = queryFirst('.pdp-header-promo');\n if (productFinalSaleMessage) {\n if (isFinalSale) {\n removeClass(productFinalSaleMessage, hiddenClass);\n addClass(productFreeReturnsMessage, 'd-none');\n } else {\n addClass([productFinalSaleMessage], hiddenClass);\n removeClass(productFreeReturnsMessage, 'd-none');\n }\n }\n\n if (mgFlag && mgLocs && mgLocs.length > 0) {\n removeClass(monogramBtn, hiddenClass);\n } else {\n addClass(monogramBtn, hiddenClass);\n }\n\n if (hasWaysToWear) {\n isContentModulesFetched = false;\n dynamicallyFetchContentModules(groupId, variationGridUrl);\n } else {\n waysToWearEl.innerHTML = '';\n }\n updateSizeElements(sizes, productContainer, variantsList);\n\n $body.trigger('product:updateStoreInventory', {\n productContainer\n });\n if (!isDirectlyPurchasable) {\n const sizeElements = queryAll('.size-btn', productContainer);\n addClass(sizeElements, notAvailable);\n }\n updateShopThePrint(shopThePrint, productContainer);\n updateProductPrice(price, standardPrice, productContainer);\n const ssColor = currentElement.dataset.attrDisplayvalue;\n const ssSizeElement = queryFirst('.size-btn.selected', productContainer);\n const ssSize = ssSizeElement ? ssSizeElement.dataset.attrValue : 'unknown';\n\n if (isFitPredictorEnabled) {\n updateProductData(ssColor, ssSize, standardPrice, price, productContainer);\n handleColor(productContainer);\n }\n\n if (!ssSizeElement) {\n $('.availability-msg', $productContainer).empty();\n // update promotion messages display for selected color (size not selected yet here)\n queryFirst('.promotions').innerHTML = promotions ? promotions.filter((promotion) => promotion.calloutMsg).map((promotion, promotionIdx) => {\n return promotionMessageTmpl(promotion.calloutMsg, promotion.details, promotionIdx);\n }).join('') : '';\n // pick new promotion popover elements\n initPopoverPromotions();\n initPopoverClose();\n }\n // Update primary images\n var primaryImageUrls = updateImageDetails(images.large);\n\n if (window.matchMedia('(max-width: 767.98px)').matches) {\n const carouselContainerEl = queryFirst('.carousel.image-slider', productContainer);\n const carouselContainerHeight = carouselContainerEl.offsetHeight;\n carouselContainerEl.style.minHeight = carouselContainerHeight + 'px';\n }\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccess);\n createCarousel(primaryImageUrls, $productContainer, isEarlyAccessItem, earlyAccessText, videoUrl);\n $body.trigger('product:afterAttributeChange', {\n container: $productContainer,\n variantGroupId,\n groupId\n });\n $body.trigger('product:handleImageZoom');\n const wishlistButton = queryFirst('.add-to-wish-list', productContainer);\n if (wishlistButton && hasClass(wishlistButton, 'added-to-wish-list')) {\n removeClass(wishlistButton, 'added-to-wish-list');\n wishlistButton.disabled = false;\n const assistiveText = wishlistButton.getAttribute('data-assistive-text');\n wishlistButton.setAttribute('aria-label', assistiveText);\n }\n // Updated logic here\n const swatchParam = `?dwvar_${masterId}_color`;\n const queryParams = location.search;\n let UpdatedParams = `${swatchParam}=${variantGroupId}`;\n if (queryParams) {\n UpdatedParams = queryParams\n .split('&')\n .map(eachParam => {\n if (eachParam.indexOf(swatchParam) > -1) {\n return `${swatchParam}=${variantGroupId}`;\n }\n return eachParam;\n })\n .join('&');\n }\n history.replaceState({ variantGroupId }, document.title, UpdatedParams);\n}\n\n/**\n * updates the quick view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {Object} currentElement - selected color element\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateQuickViewDetails(currentElement, $productContainer) {\n const elementData = currentElement.dataset;\n const variantGroupId = elementData.attrValue;\n const productContainer = $productContainer[0];\n const swatchNameElement = queryFirst('.selected-swatch-name', productContainer);\n const swatchContainer = queryFirst('.color-container', productContainer);\n const assistiveElements = queryAll('.selected-assistive-text', swatchContainer);\n const assistiveTextElement = queryFirst('.selected-assistive-text', currentElement.closest('.color-list'));\n const quickViewInfo = window.quickviewProductInfo;\n const { productInfo } = quickViewInfo;\n const { groupId, sizes, images, price, standardPrice, variantsList, isDirectlyPurchasable, pdpBreadCrumbs, earlyAccess } = productInfo.variants[variantGroupId];\n productContainer.dataset.wishlistId = groupId;\n setWishlistProductId(groupId, productContainer);\n handleEarlyAccessCta(productContainer, (earlyAccess && earlyAccess.isEarlyAccessProduct));\n const colorElements = queryAll('.color-attribute .swatch-circle', productContainer);\n const { attrDisplayvalue } = elementData;\n // Updated logic here\n if (swatchNameElement) {\n swatchNameElement.textContent = attrDisplayvalue;\n } else {\n const swatchHtml = formatMessage(swatchNameTemplate.swatchNameHtml, attrDisplayvalue);\n queryFirst('.selected-swatch', productContainer).innerHTML = swatchHtml;\n }\n removeClass(colorElements, 'selected');\n addClass(queryFirst('.swatch-circle', currentElement), 'selected');\n\n assistiveElements.forEach(eachElement => {\n eachElement.textContent = '';\n });\n\n assistiveTextElement.textContent = assistiveTextElement.dataset.selectedText;\n\n updateSizeElements(sizes, productContainer, variantsList);\n if (!isDirectlyPurchasable) {\n const sizeElements = queryAll('.size-btn', productContainer);\n addClass(sizeElements, notAvailable);\n }\n\n updateProductPrice(price, standardPrice, productContainer);\n const ssColor = currentElement.dataset.attrDisplayvalue;\n const ssSizeElement = queryFirst('.size-btn.selected', productContainer);\n const ssSize = ssSizeElement ? ssSizeElement.dataset.attrValue : 'unknown';\n\n if (isFitPredictorEnabled) {\n updateProductData(ssColor, ssSize, standardPrice, price, productContainer);\n handleColor(productContainer);\n }\n\n if (!ssSizeElement) {\n $('.availability-msg', $productContainer).empty();\n }\n // Update primary images\n var primaryImageUrls = updateImageDetails(images.large);\n if (window.matchMedia('(min-width: 1024px)').matches) {\n const carouselContainerEl = queryFirst('.carousel', productContainer);\n const carouselContainerHeight = carouselContainerEl.offsetHeight;\n carouselContainerEl.style.minHeight = carouselContainerHeight + 'px';\n }\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccess);\n createCarousel(primaryImageUrls, $productContainer, isEarlyAccessItem);\n $body.trigger('product:quickViewAttributeChange', {\n container: $productContainer,\n variantGroupId,\n groupId,\n productContainer,\n monetateData: {\n pdpBreadCrumbs\n }\n });\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n var $html = $('
      ').append($.parseHTML(html));\n\n var body = $html.find('.bonus-acordion-container');\n var selectedProducts = $html.find('.selected-products-container');\n var footer = $html.find('.modal-footer');\n\n return {\n body,\n footer,\n selectedProducts\n };\n}\n\n/**\n * Function to update GWP elements on swatch or size change\n */\nfunction updateGwpElements() {\n $('.choice-of-bonus-product').on('bonus:afterAttributeSelect', function () {\n const productDialog = queryFirst('.choose-bonus-product-dialog');\n const accordionContainer = this.closest('.bonus-acordion-container', productDialog);\n const bonusAccordionElements = queryAll('.bonus-acordion-container', productDialog);\n const addToCart = queryFirst('.add-bonus-products', productDialog);\n const sizeEl = queryFirst('.select-size', this);\n const isSizeSelected = sizeEl ? !!sizeEl.selectedIndex : true;\n const selectedSwatch = queryFirst('.color-attribute .swatch-circle.selected', this);\n const isSelectedSizeUnavailable = sizeEl && hasClass($(sizeEl).children('option:selected')[0], notAvailable);\n\n if (sizeEl) {\n const firstOption = queryFirst('option', sizeEl);\n\n // Force this option's resetUrl to remove the size\n firstOption.value = firstOption.value.replace(/(_size=)[^&]+/, '$1');\n }\n\n if (isSelectedSizeUnavailable) {\n addClass(sizeEl, notAvailable);\n } else {\n removeClass(sizeEl, notAvailable);\n }\n\n let isEnabled = true;\n const maxItems = parseInt(accordionContainer.dataset.maxItems, 10);\n const selectedItemsCount = queryAll('.select-bonus-product:checked', accordionContainer).length;\n\n if (selectedItemsCount < maxItems) {\n isEnabled = false;\n }\n\n if (isEnabled && isSizeSelected && !!selectedSwatch && !isSelectedSizeUnavailable) {\n addClass(accordionContainer, readyClass);\n } else {\n isEnabled = false;\n removeClass(accordionContainer, readyClass);\n }\n\n const validProducts = queryAll('.bonus-acordion-container.ready-to-add', productDialog);\n\n addToCart.disabled = !isEnabled || hasClass(addToCart, notAvailable) || bonusAccordionElements.length !== validProducts.length;\n });\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n $('.modal-body').spinner().start();\n\n var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n const { maxBonusItems, addToCartUrl, uuid, pliUUID, pageSize, showProductsUrlRuleBased, bonusChoiceRuleBased, bonusDiscountLineItems } = data;\n $('.choose-bonus-product-dialog').attr({\n 'data-total-qty': maxBonusItems,\n 'data-addToCartUrl': addToCartUrl,\n 'data-UUID': uuid,\n 'data-pliUUID': pliUUID,\n 'data-pageStart': 0,\n 'data-pageSize': pageSize,\n 'data-moreURL': showProductsUrlRuleBased,\n 'data-bonusChoiceRuleBased': bonusChoiceRuleBased,\n 'data-bonus-items': JSON.stringify(bonusDiscountLineItems)\n });\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'json',\n success: function (response) {\n var parsedHtml = parseHtml(response.renderedTemplate);\n $gwpDialog.find('.enter-message').text(response.enterDialogMessage);\n $gwpDialog.find('.modal-body').html(parsedHtml.body);\n $gwpDialog.find('.modal-footer, .selected-products-container').remove();\n $gwpDialog.find('.modal-content').append(parsedHtml.footer);\n $(parsedHtml.selectedProducts).insertAfter($gwpDialog.find('.modal-header'));\n // LP custom changes start\n const { selectedBonusProducts } = response;\n if ((selectedBonusProducts || []).length) {\n const modalDialog = queryFirst('.choose-bonus-product-dialog');\n let selectedProductsCount = 0;\n selectedBonusProducts.forEach(eachProductList => {\n if (eachProductList.length) {\n const bonusAccordionContainer = queryFirst(`.bonus-acordion-container[data-uuid=\"${eachProductList[0].uuid}\"]`, modalDialog);\n const maxCount = parseInt(bonusAccordionContainer.dataset.maxItems, 10);\n const productListLength = eachProductList.length;\n if (maxCount === productListLength) {\n addClass(bonusAccordionContainer, 'selected');\n addClass(bonusAccordionContainer, readyClass);\n }\n const bonusItemCount = queryFirst('.bonus-item-count span', bonusAccordionContainer);\n bonusItemCount.textContent = productListLength;\n selectedProductsCount += productListLength;\n eachProductList.forEach(eachProduct => {\n const selectedProduct = queryFirst(`.choice-of-bonus-product[data-pid=\"${eachProduct.pid}\"][data-uuid=\"${eachProduct.uuid}\"]`);\n const selectBonusCheckbox = queryFirst('.select-bonus-product', selectedProduct);\n\n if (selectBonusCheckbox) {\n selectBonusCheckbox.checked = true;\n }\n\n addClass(selectedProduct, selectedProductClass);\n setControlsEnabled(selectedProduct, true);\n });\n }\n });\n const addToCart = queryFirst('.add-bonus-products', modalDialog);\n addToCart.disabled = maxBonusItems !== selectedProductsCount;\n }\n\n // Default all size dropdowns that aren't selected products\n $('.bonus-product-item:not(.selected-product) .select-size').each(function () {\n this.selectedIndex = 0;\n });\n\n updateGwpElements();\n // LP custom changes end\n $gwpDialog.modal('show');\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\n if (!response.error) {\n return;\n }\n\n if (response.displayModal) {\n let addToCartWarningDialog = queryFirst('#add-to-cart-warning-dialog');\n\n if (!addToCartWarningDialog) {\n const isOnCartPage = (window.location.pathname === '/cart/');\n const fragment = renderFragment(dialogTemplate({\n buttons: isOnCartPage ? [{ text: 'OK', primary: true }] : [{ text: 'Close' }, { text: 'Review Tote', primary: true, link: response.redirectLink }],\n modalContentHeading: response.messageHeading,\n modalContentBody: isOnCartPage ? response.messageBodyOnCart : response.messageBodyOffCart,\n id: 'add-to-cart-warning-dialog'\n }));\n\n document.body.appendChild(fragment);\n addToCartWarningDialog = queryFirst('#add-to-cart-warning-dialog');\n }\n\n $(addToCartWarningDialog).modal('show');\n } else {\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n $('.add-to-cart-messages').remove();\n if ($('.add-to-cart-messages').length === 0) {\n $body.append('
      ');\n }\n\n $('.add-to-cart-messages').append('
      ' + response.message + '
      ');\n\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n var childProducts = [];\n $('.bundle-item').each(function () {\n childProducts.push({\n pid: $(this).find('.product-id').text(),\n quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n });\n });\n\n return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n var options = $productContainer\n .find('.product-option')\n .map(function () {\n var $elOption = $(this).find('.options-select');\n var urlValue = $elOption.val();\n var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]').data('value-id');\n return {\n optionId: $(this).data('option-id'),\n selectedValueId: selectedValueId\n };\n })\n .toArray();\n\n return JSON.stringify(options);\n}\n\n/**\n * Enables or disables the color/size controls in a container\n * @param {HTMLElement} container - The container element\n * @param {boolean} enable - Whether to enable the controls (false to disable)\n */\nfunction setControlsEnabled(container, enable) {\n const controls = queryAll('button:not(.select-add):not(.select-remove), select', container);\n const blocker = queryAll('.bonus-product-blocker', container);\n const blockerActiveClass = 'active';\n\n controls.forEach(control => {\n control.disabled = !enable;\n });\n\n if (enable) {\n blocker.forEach(blockElement => {\n const sizeElement = queryFirst('select', blockElement.closest('.product-detail'));\n\n if (sizeElement) {\n $(sizeElement).trigger('change');\n }\n });\n\n removeClass(blocker, blockerActiveClass);\n } else {\n addClass(blocker, blockerActiveClass);\n }\n}\n\n/**\n * Get analytics data to be associated with a product line item when adding to cart\n * @returns {Object} analytics data\n */\nfunction getAddToCartAnalyticsData() {\n const promoName = getStoredDataLayerInfo(P_PROMO_NAME_KEY);\n const promoCreativeName = getStoredDataLayerInfo(P_PROMO_CREATIVE_NAME);\n const listName = getStoredDataLayerInfo(P_PRODUCT_LIST_KEY);\n const data = {};\n\n if (promoName && Array.isArray(promoName)) data.utagPromoName = promoName[0]; // promo_name should always be an array, but we don't want to store it that way on the BE\n if (promoCreativeName && Array.isArray(promoCreativeName)) data.utagPromoCreativeName = promoCreativeName[0];\n if (listName) data.utagListName = listName;\n\n return data;\n}\n\nexport default {\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n attributeSelect,\n updateProductDetails,\n updateImageDetails,\n focusChooseBonusProductModal: function () {\n $gwpDialog.on('shown.bs.modal', () => {\n $gwpDialog.siblings().attr('aria-hidden', 'true');\n $gwpDialog.find('.close').trigger('focus');\n });\n },\n\n onClosingChooseBonusProductModal: function () {\n $gwpDialog.on('hidden.bs.modal', () => {\n $gwpDialog.siblings().attr('aria-hidden', 'false');\n removeClass(queryFirst('.choose-bonus-product-dialog'), 'selected');\n });\n },\n\n trapChooseBonusProductModalFocus: function () {\n $body.on('keydown', '#chooseBonusProductModal', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '#chooseBonusProductModal',\n firstElementSelector: '.close',\n lastElementSelector: '.add-bonus-products'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n\n colorAttribute: function () {\n $(document).on('click', '[data-attr=\"color\"] button.color-attribute', function (e) {\n e.preventDefault();\n const productDetailContainer = queryFirst(PRODUCT_DETAIL_CONTAINER_SELECTOR);\n\n if ($(this).attr('disabled') || hasClass(queryFirst('.swatch-circle', this), 'selected')) {\n return;\n }\n var $productContainer = $(this).closest('.set-items .product-detail, .choose-bonus-product-modal .product-detail, .gift-card-main, .product-quickview');\n if ($productContainer.hasClass('cached-quick-view')) {\n updateQuickViewDetails(this, $productContainer);\n } else if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n updateProductDetails(this, $productContainer);\n } else {\n selectColorAttribute($(this).attr('data-url'), $productContainer);\n }\n $body.trigger('swatchChangeEvent', this);\n $body.trigger('search:updateProducts');\n updateVisibilityOfLowInventoryMsg(productDetailContainer);\n });\n },\n\n renderSizeElements: function () {\n const swatchEl = queryFirst('.pdp-container:not(.gift-card-main) button.color-attribute .swatch-circle.selected');\n\n if (swatchEl) {\n const productContainer = queryFirst('.pdp-container');\n const selectedSizeEl = queryFirst('.size-btn.selected', productContainer);\n\n if (!selectedSizeEl) {\n const selectedSwtachBtn = swatchEl.parentElement;\n const variantGroupId = selectedSwtachBtn.dataset.attrValue;\n const masterId = productContainer.dataset.masterid;\n const productInfo = window.productInfo[masterId];\n const { sizes, variantsList, isDirectlyPurchasable, wishlistDisabled, isFinalSale } = productInfo.variants[variantGroupId];\n\n updateSizeElements(sizes, productContainer, variantsList);\n if (!isDirectlyPurchasable) {\n const sizeElements = queryAll('.size-btn', productContainer);\n addClass(sizeElements, notAvailable);\n }\n if (wishlistDisabled || !isDirectlyPurchasable || isFinalSale) {\n showStrikeHearts(productContainer);\n }\n }\n\n $body.trigger('product:updateStoreInventory', {\n productContainer: productContainer\n });\n }\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n if (!e.target.closest('.fp-root')) {\n e.preventDefault();\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n attributeSelect(e.currentTarget.value, $productContainer);\n }\n });\n },\n\n availability: function () {\n $(document).on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n }\n\n if ($('.bundle-items', $productContainer).length === 0) {\n attributeSelect($(e.currentTarget).find('option:selected').data('url'), $productContainer);\n }\n });\n },\n\n addToCart: () => {\n $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', async e => {\n // Elements\n const { target } = e;\n const $target = $(target);\n const productContainer = target.closest('.product-detail');\n const $productContainer = $(productContainer);\n const storeLocatorContainer = queryFirst('.store-locator-container');\n const ispuAddToCart = queryFirst('.add-to-cart', storeLocatorContainer);\n\n if (ispuAddToCart) {\n ispuAddToCart.disabled = true;\n }\n\n const pdpSetData = {};\n let isPDPSet = false;\n\n // PDP Set - add all to cart button\n if (hasClass(target, 'add-to-cart-global')) {\n isPDPSet = true;\n const setPids = [];\n\n const setModal = target.closest('.custom-set-detail-modal');\n // all visible set products -- \"removed\" set products are not included (removed set products do not have the custom-set-product class)\n const modalProducts = queryAll('.custom-set-items.set-items .custom-set-product', setModal);\n\n // set products which have a selected size\n const sizeSelectedProducts = modalProducts.filter(modalProduct => {\n toggleSelectSizeInfo(modalProduct);\n const sizeSelected = queryFirst('.size-btn.selected', modalProduct);\n\n if (sizeSelected) {\n // collect some data for the ATC call while we're looping anyway\n setPids.push({\n pid: queryFirst('.product-id', modalProduct)?.textContent,\n options: getOptions($(modalProduct))\n });\n }\n\n return !!sizeSelected;\n });\n\n // exit if not all sizes are selected\n if (sizeSelectedProducts.length !== modalProducts.length) {\n return;\n }\n\n Object.assign(pdpSetData, {\n pidsObj: JSON.stringify(setPids)\n });\n } else {\n // Not PDP Set -- Check if size is selected on single product PDP\n toggleSelectSizeInfo(productContainer);\n if (!queryFirst('.size-btn.selected', productContainer)) {\n return;\n }\n }\n\n $body.trigger('product:beforeAddToCart', target);\n\n const analyticsData = getAddToCartAnalyticsData();\n\n const form = {\n pid: getPidValue($target),\n childProducts: getChildProducts(),\n ...pdpSetData,\n ...analyticsData\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n $target.trigger('updateAddToCartFormData', form);\n\n let addToCartUrl = getAddToCartUrl();\n\n // it needs for cases when mincart has a recommendation block with empty value in the '.add-to-cart-url'\n if (!addToCartUrl && hasClass(productContainer, 'is-stylitics-gallery')) {\n let closestUrl = queryFirst('.add-to-cart-url', productContainer);\n if (closestUrl && closestUrl.value) addToCartUrl = closestUrl.value;\n }\n\n if (addToCartUrl) {\n try {\n const res = await fetch(addToCartUrl, {\n method: 'POST',\n body: toFormData(form)\n });\n\n if (!res.ok) throw new Error('Add to cart response was not OK');\n\n const resData = await res.json();\n\n if (isPDPSet) {\n $('#productSetModal').modal('hide');\n }\n\n if (ispuAddToCart) {\n ispuAddToCart.disabled = false;\n $productContainer.find('.lp-slideout-modal[id*=\"pick-up-in-store\"]').modal('hide');\n }\n\n handlePostCartAdd(resData);\n\n $.spinner().stop();\n $body.trigger('product:afterAddToCart', resData);\n\n // send analytics data (trackAddItemToCart) if it is Stylitics Gallery QuickView on PLP\n // and Stylitics Gallery Widget exists\n if (hasClass(productContainer, 'is-stylitics-gallery')) {\n $body.trigger('stylitics:gallery:addItem', {\n pid: form.pid,\n price: queryFirst('.price-section .sales .ssSalesPrice', productContainer)?.value\n });\n }\n } catch (err) {\n $.spinner().stop();\n if (ispuAddToCart) {\n ispuAddToCart.disabled = false;\n }\n console.error('addToCart error:', err.message);\n }\n }\n });\n },\n selectBonusProduct: function () {\n $(document).on('click', '.select-bonus-product', function () {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $choiceOfBonusProduct.data('pid');\n var uuid = $choiceOfBonusProduct.data('uuid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = 1;\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n\n // LP customization changes start\n const { checked } = this;\n const productDialog = queryFirst('.choose-bonus-product-dialog');\n const choiceOfBonusProduct = $choiceOfBonusProduct[0];\n const addToCart = queryFirst('.add-bonus-products', productDialog);\n const selectedProductElement = queryFirst(`.selected-pid[data-pid=\"${pid}\"][data-uuid=\"${uuid}\"]`, productDialog);\n let bonusAccordionElements = queryAll('.bonus-acordion-container', productDialog);\n let accordionContainer = this.closest('.bonus-acordion-container', productDialog);\n const bonusCountElement = queryFirst('.bonus-item-count span', accordionContainer);\n const selectedCount = queryAll('.select-bonus-product:checked', accordionContainer).length;\n const maxCount = parseInt(accordionContainer.dataset.maxItems, 10);\n let sizeEl = queryFirst('.select-size', choiceOfBonusProduct);\n let selectedSwatch = queryFirst('.color-attribute .swatch-circle.selected', choiceOfBonusProduct);\n let isSizeSelected = sizeEl ? !!sizeEl.selectedIndex : true;\n\n if (selectedCount < maxCount) {\n removeClass(accordionContainer, 'selected');\n } else {\n addClass(accordionContainer, 'selected');\n }\n bonusCountElement.textContent = selectedCount;\n\n let enableAddTocart = true;\n const maxItems = parseInt(accordionContainer.dataset.maxItems, 10);\n const selectedItemsCount = queryAll('.select-bonus-product:checked', accordionContainer).length;\n if (selectedItemsCount < maxItems) {\n enableAddTocart = false;\n }\n enableAddTocart = isSizeSelected && !!selectedSwatch && enableAddTocart;\n\n if (enableAddTocart) {\n addClass(accordionContainer, readyClass);\n } else {\n removeClass(accordionContainer, readyClass);\n }\n\n let validProducts = queryAll('.bonus-acordion-container.ready-to-add', productDialog);\n\n if (!hasClass(addToCart, notAvailable)) {\n addToCart.disabled = bonusAccordionElements.length !== validProducts.length;\n }\n\n if (checked) {\n addClass(choiceOfBonusProduct, selectedProductClass);\n } else {\n removeClass(choiceOfBonusProduct, selectedProductClass);\n if (selectedProductElement) {\n selectedProductElement.click();\n }\n }\n if (selectedCount < maxCount) {\n $(accordionContainer).find('.choice-of-bonus-product').find('.select-bonus-product, .color-attribute, select').removeAttr('tabindex');\n } else {\n $(accordionContainer).find('.choice-of-bonus-product:not(.selected-product)').find('.select-bonus-product, .color-attribute, select').attr('tabindex', -1);\n }\n if (!checked) {\n return;\n }\n // LP customization changes end\n\n totalQty += submittedQty;\n var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id');\n var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml =\n '' +\n '
      ' +\n '
      ' +\n $choiceOfBonusProduct.find('.product-name').html() +\n '
      ' +\n '
      ' +\n '
      ';\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n });\n\n const bonusDrawer = document.getElementById('chooseBonusProductModal');\n\n if (bonusDrawer) {\n bonusDrawer.addEventListener('click', e => {\n const { target } = e;\n if (hasClass(target, 'bonus-product-blocker') || hasClass(target, 'select-add') || hasClass(target, 'select-remove')) {\n e.preventDefault();\n const bonusTile = target.closest('.choice-of-bonus-product-tile');\n if (bonusTile) {\n const targetCheckbox = queryFirst('.select-bonus-product', bonusTile);\n\n if (!targetCheckbox.checked) {\n // unselect the checked checkbox as long as the user didn't click the already-checked option\n const accordion = bonusTile.closest('.bonus-acordion-container');\n const checkedBox = queryFirst('input:checked', accordion);\n if (checkedBox) {\n checkedBox.click();\n }\n }\n\n // toggle the checkbox for the clicked tile\n targetCheckbox.click();\n }\n }\n });\n }\n },\n removeBonusProduct: function () {\n $(document).on('click', '.selected-pid', function () {\n $(this).remove();\n var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n var count = 0;\n if ($selected.length) {\n $selected.each(function () {\n count += parseInt($(this).data('qty'), 10);\n });\n }\n\n $('.pre-cart-products').html(count);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n });\n },\n enableBonusProductSelection: function () {\n $body.on('bonusproduct:updateSelectButton', function (e, response) {\n $('button.select-bonus-product', response.$productContainer).attr('disabled', !response.product.readyToOrder || !response.product.available);\n var pid = response.product.id;\n $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n });\n\n const bonusProductDialog = queryFirst('.choose-bonus-product-dialog');\n\n if (bonusProductDialog) {\n bonusProductDialog.addEventListener('click', e => {\n const target = e.target.closest('.select-bonus-product');\n\n if (!target) return;\n\n setControlsEnabled(target.closest('.row'), target.checked);\n });\n }\n },\n showMoreBonusProducts: function () {\n $(document).on('click', '.show-more-bonus-products', function () {\n var url = $(this).data('url');\n $('.modal-content').spinner().start();\n $.ajax({\n url: url,\n method: 'GET',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('.modal-body').append(parsedHtml.body);\n $('.show-more-bonus-products:first').remove();\n $('.modal-content').spinner().stop();\n },\n error: function () {\n $('.modal-content').spinner().stop();\n }\n });\n });\n },\n addBonusProductsToCart: function () {\n $(document).on('click', '.add-bonus-products', function () {\n var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n var queryString = '?pids=';\n var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n var pidsObject = {\n bonusProducts: []\n };\n\n $.each($readyToOrderBonusProducts, function () {\n var qtyOption = parseInt($(this).data('qty'), 10);\n const pid = $(this).data('pid');\n const uuid = $(this).data('uuid');\n const productId = $(`.choice-of-bonus-product.selected-product[data-pid=\"${pid}\"][data-uuid=\"${uuid}\"] .product-detail`).attr('data-pid');\n var option = null;\n if (qtyOption > 0) {\n if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n option = {};\n option.optionId = $(this).data('optionid');\n option.productId = productId;\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n uuid: uuid,\n pid: productId,\n qty: qtyOption,\n options: option ? [option] : []\n });\n pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&bonusItems=' + JSON.stringify($('.choose-bonus-product-dialog').data('bonusItems'));\n $.spinner().start();\n $.ajax({\n url: url + queryString,\n method: 'POST',\n success: function (data) {\n $.spinner().stop();\n if (data.error) {\n $('#chooseBonusProductModal').modal('hide');\n if ($('.add-to-cart-messages').length === 0) {\n $body.append('
      ');\n }\n $('.add-to-cart-messages').append('
      ' + data.errorMessage + '
      ');\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 3000);\n } else {\n $('.configure-bonus-product-attributes').html(data);\n $('.bonus-products-step2').removeClass('hidden-xl-down');\n $('#chooseBonusProductModal').modal('hide');\n $('.minicart-quantity').html(data.totalQty);\n if ($('.cart-page').length) {\n location.reload();\n }\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n revealRecommendations: function () {\n const { initSpecificCarousel } = require('../components/carousel');\n queryAll('.recommendations:not(.product-listing-header)').forEach(eachRecommendation => {\n const titleEl = queryFirst('.title', eachRecommendation);\n const productEl = queryFirst('.grid-tile', eachRecommendation);\n const scrollableContent = queryFirst('.scrollable-content', eachRecommendation);\n\n if (titleEl && !productEl) {\n eachRecommendation.outerHTML = '';\n } else if (titleEl && productEl) {\n eachRecommendation.style.display = 'block';\n if (scrollableContent) initSpecificCarousel(scrollableContent);\n }\n });\n },\n handleEarlyAccessPLPLockIcon: function () {\n const earlyAccessPLPContainer = queryAll('.early-access-plp-container');\n if (earlyAccessPLPContainer.length) {\n earlyAccessPLPContainer.forEach(earlyAccessPlpIcon => {\n const lockIconContainer = queryFirst('.loyalty-early-access-lock-container', earlyAccessPlpIcon);\n const earlyAccessWishlistIcon = queryFirst('.product-tile .add-to-wish-list-container', earlyAccessPlpIcon);\n const earlyAccessPLPBadge = queryFirst('.loyalty-product-tile-badge', earlyAccessPlpIcon);\n const { earlyAccessDate } = lockIconContainer.dataset;\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccessDate);\n if (isLoyaltyProgramMember || !isEarlyAccessItem) {\n removeClass(earlyAccessWishlistIcon, HIDDEN_CLASS);\n addClass(lockIconContainer, HIDDEN_CLASS);\n if (!isEarlyAccessItem) {\n addClass(earlyAccessPLPBadge, HIDDEN_CLASS);\n }\n } else {\n addClass(earlyAccessWishlistIcon, HIDDEN_CLASS);\n removeClass([lockIconContainer, earlyAccessPLPBadge], HIDDEN_CLASS);\n }\n });\n }\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected,\n handleEarlyAccessCta: handleEarlyAccessCta\n};\n","'use strict';\n\nimport { queryFirst, addClass, removeClass, hasClass, queryAll, scrollTo, setAttribute, throttle } from '../domUtil';\nimport base from './base';\nimport { updateProductData, handleColor, handleSize } from 'fitpredictor/product/secretsauce';\n\nconst { isShippingPreferencesViewEnabled, isEarlyAccessElement } = require('./helper');\nconst { availabilityMessageTmpl, availabilityMessageOOS, availabilityMessagePreorder, ispuAvailabilityMessageTmpl, ispuLowStockMessageTmpl, promotionMessageTmpl } = require('../templates').productDetail;\nconst $body = $('body');\nconst sizeChartClasses = 'no-scroll size-chart-visible';\nvar Hammer = require('hammerjs');\nconst KEYCODE_TAB = 9;\nconst TabKey = 'Tab';\nconst { IN_STOCK_STATUS: IN_STOCK, NOT_AVAILABLE_STATUS: NOT_AVAILABLE, PREORDER_STATUS: PREORDER, HIDDEN_CLASS } = require('../constants');\nconst { SHIP_TO_LOW_INVENTORY_CLASS } = require('../components/shippingPreference/constants');\nconst { handleEarlyAccessLogin } = require('../loyalty/loyaltyDrawer');\nconst { initPopoverPromotions, initPopoverClose, initPopoverCloseSelector, initPopoverWishList } = require('../popover');\nimport { getNestedValue } from '../util';\nimport { hideStrikeHearts, setWishlistProductId, showStrikeHearts } from '../wishlist/helper';\n\n/**\n * Handling zoomin effect on product image slider\n */\nfunction handleProductImageZoom() {\n const pdpPageCarousels = queryFirst('.product-detail');\n const carousel = $('.primary-images .carousel:not(.tile-carousel)');\n const imageZoomUrl = carousel.data('image');\n const imagePresetUrl = carousel.data('preset');\n\n const imageObserver = new MutationObserver(function (mutationList) {\n for (let mutation of mutationList) {\n if (mutation.type === 'childList') {\n const { target, addedNodes } = mutation;\n const baseImg = queryFirst('.img-fluid', target);\n const zoomAlt = baseImg.getAttribute('alt') + ' Zoomed';\n setAttribute(addedNodes, 'alt', zoomAlt);\n }\n }\n });\n\n if (pdpPageCarousels) {\n const pdpImages = queryAll('.primary-images .carousel-item');\n const pdpIndicators = queryAll('.primary-images .carousel-indicators li');\n\n pdpImages.forEach((img, index) => {\n const imageEl = queryFirst('img', img);\n if (!imageEl) {\n return;\n }\n imageEl.setAttribute('data-src-hires', imageEl.getAttribute('data-src').replace(imagePresetUrl, imageZoomUrl));\n let scale = 0.35;\n let zoomed = false;\n let mobileZoomed = false;\n /**\n * Handling zoomin effect logic\n * @param {jQuery} elm - DOM element for current image\n * @param {boolean} zoomed - boolean value if zoomed or not\n */\n function createTouchZoom(elm) {\n var thisHammer = new Hammer(elm, {});\n thisHammer.domEvents = true;\n thisHammer.get('pinch').set({ enable: true });\n\n let transform = '';\n let el = elm;\n let panSpeed = 1.1;\n let xPos = { current: 0, last: 0, max: 0 };\n let yPos = { current: 0, last: 0, max: 0 };\n let scale = { current: 2, last: 2, max: 4 };\n\n el.style.transform = `translate(${xPos.current}px,${yPos.current}px) scale(${scale.current},${scale.current})`;\n\n thisHammer.on('tap pan pinch panend pinchend', function (e) {\n // Prevent tap events from interfering\n e.srcEvent.stopPropagation();\n e.srcEvent.preventDefault();\n // If zoomed in, pan the image\n if (scale.current !== 1) {\n xPos.current = xPos.last + e.deltaX * panSpeed;\n yPos.current = yPos.last + e.deltaY * panSpeed;\n xPos.max = Math.ceil(((scale.current - 1) * el.clientWidth) / 2);\n yPos.max = Math.ceil(((scale.current - 1) * el.clientHeight) / 2);\n // Keep coordinates within image bounds\n if (xPos.current > xPos.max) {\n xPos.current = xPos.max;\n }\n if (xPos.current < -xPos.max) {\n xPos.current = -xPos.max;\n }\n if (yPos.current > yPos.max) {\n yPos.current = yPos.max;\n }\n if (yPos.current < -yPos.max) {\n yPos.current = -yPos.max;\n }\n }\n\n if (e.type === 'tap') {\n e.preventDefault();\n scale.current++;\n scale.last = scale.current;\n\n if (scale.current > scale.max) {\n scale.current = 1;\n xPos.current = 0;\n yPos.current = 0;\n xPos.last = xPos.current;\n yPos.last = yPos.current;\n scale.last = scale.current;\n transform = `translate(${xPos.current}px,${yPos.current}px) scale(${scale.current},${scale.current})`;\n mobileZoomed = true;\n } else mobileZoomed = false;\n }\n // Scale image with pinch\n if (e.type === 'pinch') {\n scale.current = Math.max(0.99, Math.min(scale.last * e.scale, scale.max));\n }\n // Finish scaling\n if (e.type === 'pinchend') {\n scale.last = scale.current;\n }\n // Finish panning\n if (e.type === 'panend') {\n xPos.last = xPos.current;\n yPos.last = yPos.current;\n }\n\n // Create scale/pan changes if zoomed in\n if (scale.current !== 1) {\n transform = `translate(${xPos.current}px,${yPos.current}px) scale(${scale.current},${scale.current})`;\n }\n // Apply transformation\n if (transform) {\n el.style.transform = transform;\n }\n });\n\n $(el).on('zoom:imageChange', () => {\n thisHammer.off('tap pan pinch panend pinchend');\n scale.current = 1;\n xPos.current = 0;\n yPos.current = 0;\n xPos.last = xPos.current;\n yPos.last = yPos.current;\n scale.last = scale.current;\n el.style.transform = `translate(${xPos.current}px,${yPos.current}px) scale(${scale.current},${scale.current})`;\n el.style['touch-action'] = 'initial';\n mobileZoomed = false;\n zoomed = false;\n });\n }\n\n /** function to create zoom effect on hover\n * @param {jQuery} el - DOM element for current product image\n * @param {number} scale - scale value for the zoom\n */\n function createHoverZoom(el, scale) {\n let hiresUrl = $(el).find('img').attr('data-src-hires');\n if (hiresUrl && hiresUrl !== 'null' && hiresUrl.indexOf('noimagelarge') === -1) {\n $(el).zoom({\n on: 'click',\n url: hiresUrl,\n touch: false,\n magnify: scale\n });\n }\n }\n\n const setZoomOffset = function () {\n if (!zoomed) {\n scale *= 1.5;\n if (scale === 1.18125) {\n zoomed = true;\n }\n createHoverZoom(img, scale);\n } else {\n $(img).trigger('zoom-destroy');\n $(img).find('.zoomImg').remove();\n zoomed = false;\n scale = 0.35;\n createHoverZoom(img, scale);\n }\n };\n\n const allMobileZoom = function (event) {\n const img = event.target;\n if (!zoomed) {\n img.src = img.getAttribute('data-src-hires');\n createTouchZoom(img);\n }\n zoomed = true;\n if (!mobileZoomed) {\n addClass(img.parentNode, 'touch-zoom');\n $('.primary-images .carousel').carousel('dispose');\n img.style['touch-action'] = 'none';\n }\n\n if (mobileZoomed) {\n removeClass(img.parentNode, 'touch-zoom');\n $('.primary-images .carousel.image-slider').carousel();\n $('.primary-images .carousel').on('slide.bs.carousel', () => {\n $('.primary-images .carousel-item img').trigger('zoom:imageChange');\n });\n img.style['touch-action'] = 'initial';\n }\n };\n\n if (window.matchMedia('(max-width: 1024px)').matches) {\n if (window.matchMedia('(max-width: 768px)').matches) {\n if (pdpIndicators) {\n $(pdpIndicators).on('click', () => {\n const touchZoom = queryFirst('.primary-images .carousel-item.touch-zoom');\n zoomed = false;\n mobileZoomed = false;\n if (touchZoom) {\n $('.primary-images .carousel-item.touch-zoom img').trigger('zoom:imageChange');\n removeClass(queryFirst('.primary-images .carousel-item.touch-zoom'), 'touch-zoom');\n }\n $('.primary-images .carousel.image-slider').carousel();\n $('.primary-images .carousel').on('slide.bs.carousel', () => {\n $('.primary-images .carousel-item img').trigger('zoom:imageChange');\n });\n });\n if (index === 0) {\n $('.primary-images .carousel').on('slide.bs.carousel', () => {\n $('.primary-images .carousel-item img').trigger('zoom:imageChange');\n });\n }\n }\n }\n img.addEventListener('click', allMobileZoom);\n } else {\n $(img).one('mouseenter', function () {\n createHoverZoom(img, scale);\n });\n img.addEventListener('click', () => {\n $(pdpImages).not($(img)).each(function () {\n if ($(this).find('.zoomImg').length > 1) {\n $(this).find('.zoomImg').remove();\n scale = 0.35;\n createHoverZoom($(this), scale);\n }\n });\n setZoomOffset();\n });\n\n imageObserver.observe(img, { childList: true });\n }\n });\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {Array} variationAttributes - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateSelectedSwatchProductName(variationAttributes, $productContainer) {\n if (Array.isArray(variationAttributes) && variationAttributes.length) {\n const colorVariationObject = variationAttributes.find(attribute => attribute.attributeId === 'color');\n\n if (colorVariationObject && Array.isArray(colorVariationObject.values) && colorVariationObject.values.length) {\n const selectedSwatchObject = colorVariationObject.values.find(eachValue => eachValue.selected);\n\n $productContainer.find('.selected-swatch-name').text(selectedSwatchObject ? selectedSwatchObject.displayValue : '');\n }\n }\n}\n\n/**\n * This method manages Notify me dialog content.\n *\n * !! For inline NotifyMe box please see handleNotifyMeBlock method\n *\n * @param {Object} productData - Product data\n * @param {Object} productContainer - Product Container DOM element\n */\nfunction handleNotifyMe(productData, productContainer) {\n const addToCartSection = queryFirst('.prices-add-to-cart-actions', productContainer);\n const notifyContainer = queryFirst('.js-notify-me-container', productContainer);\n const notifyMeButton = queryFirst('.notify-me-btn', productContainer);\n const notifyMeDesc = queryFirst('.js-notify-me-desc', productContainer);\n const availabilityMessageEl = queryFirst('.product-availability', productContainer);\n const hiddenClass = 'd-none';\n const { available, isNotifyMeEnabled, id, formattedPrice, forceOutOfStock, imageData } = productData;\n if (!available && isNotifyMeEnabled && !forceOutOfStock) {\n addClass(addToCartSection, hiddenClass);\n if (availabilityMessageEl) {\n addClass(availabilityMessageEl, hiddenClass);\n }\n removeClass([notifyMeDesc, notifyMeButton], hiddenClass);\n const notifyImageElement = queryFirst('.js-notify-img img', notifyContainer);\n if (imageData && notifyImageElement) {\n const { alt, url, srcset } = imageData[0];\n const imageHasLoaded = hasClass(notifyImageElement, 'lz-loaded');\n\n notifyImageElement.setAttribute(imageHasLoaded ? 'src' : 'data-src', url);\n notifyImageElement.setAttribute(imageHasLoaded ? 'srcset' : 'data-srcset', srcset);\n notifyImageElement.setAttribute('alt', alt);\n }\n // Insert price\n queryFirst('.js-notify-price', notifyContainer).textContent = formattedPrice;\n // Insert color value\n const notifyColor = queryFirst('.js-notify-color', notifyContainer);\n queryFirst('.js-notify-color-label', notifyColor).textContent = queryFirst('.selected-swatch', productContainer).dataset.colorLabel;\n queryFirst('.js-notify-color-value', notifyColor).textContent = queryFirst('.ssColor', productContainer).value;\n // Insert size value\n const notifySize = queryFirst('.js-notify-size', notifyContainer);\n queryFirst('.js-notify-size-label', notifySize).textContent = queryFirst('.size-display-name', productContainer).value + ':';\n queryFirst('.js-notify-size-value', notifySize).textContent = queryFirst('.size-btn.selected', productContainer).dataset.attrValue;\n if (id) {\n document.getElementById('notifySku').value = id;\n }\n const customerEmail = (document.getElementById('notifyEmail') || {}).value;\n if (customerEmail) {\n queryFirst('.notify-email').value = customerEmail;\n }\n removeClass(queryFirst('.js-notify-me-desc'), hiddenClass);\n removeClass(queryFirst('.js-notify-form'), hiddenClass);\n addClass(queryFirst('.js-notify-confirm-block'), hiddenClass);\n\n $body.trigger('product:notifyMeShown', productContainer);\n } else {\n removeClass(addToCartSection, hiddenClass);\n if (availabilityMessageEl) {\n removeClass(availabilityMessageEl, hiddenClass);\n }\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n\n $body.trigger('product:notifyMeHidden', productContainer);\n }\n}\n\n/**\n * handles size change\n * @param {Object} productContainer - product container html element\n * @param {string} selectedSizeValue - Selected size value\n */\nfunction onSizeChangeHandler(productContainer, selectedSizeValue) {\n removeClass(queryAll('.size-btn', productContainer), 'selected');\n addClass(this, 'selected');\n const sizeContainer = this.closest('.size-container');\n const assistiveElements = queryAll('.selected-assistive-text', sizeContainer);\n assistiveElements.forEach(eachElement => {\n if (eachElement.textContent.includes(eachElement.dataset.outOfStock)) {\n eachElement.textContent = eachElement.dataset.outOfStock;\n } else {\n eachElement.textContent = '';\n }\n });\n const assistiveElementOfSelected = queryFirst('.selected-assistive-text', this.closest('.size-list'));\n const { selectedText, outOfStock } = assistiveElementOfSelected.dataset;\n assistiveElementOfSelected.textContent = selectedText;\n if (hasClass(this, 'not-available')) {\n assistiveElementOfSelected.textContent += ' ' + outOfStock;\n }\n removeClass(queryFirst('.size-seperator', productContainer), 'd-none');\n const selectedSize = queryFirst('.selected-size', productContainer);\n if (selectedSize) {\n selectedSize.textContent = selectedSizeValue;\n removeClass(selectedSize, 'd-none');\n }\n}\n\n/**\n * update quickview product info on product variation change\n * @param {string} selectedSizeValue - Selected size value\n * @param {int} selectedColorId - selected color id\n * @param {Object} productContainer - product container html element\n * @param {Object} currentSizeElement - current active size element\n */\nfunction updateQuickViewProductInfo(selectedSizeValue, selectedColorId, productContainer, currentSizeElement) {\n const quickViewInfo = window.quickviewProductInfo;\n const { productInfo } = quickViewInfo;\n const variantGroupData = productInfo.variants[selectedColorId];\n const { sizes, images, formattedPrice, standardPrice, price, vgProductDetailsUrl, isDirectlyPurchasable, wishlistDisabled, isFinalSale } = variantGroupData;\n const ispu = base.updateImageDetails(images.ispu);\n const selectedSizeData = sizes[selectedSizeValue];\n const addToCartButton = queryFirst('.add-to-cart', productContainer);\n const hiddenClass = 'd-none';\n const notifyMeButton = queryFirst('.notify-me-btn', productContainer);\n const notifyMeDesc = queryFirst('.notify-me-desc', productContainer);\n const addToCartSection = queryFirst('.prices-add-to-cart-actions', productContainer);\n const availabilityMsgEl = queryFirst('.availability-msg', productContainer);\n let availabilityValue = '';\n let productDetailsUrl = vgProductDetailsUrl;\n const fullPDPLink = queryFirst('.full-pdp-link', productContainer);\n const wishlistButton = queryFirst('.add-to-wish-list', productContainer);\n\n if (wishlistButton && hasClass(wishlistButton, 'added-to-wish-list')) {\n removeClass(wishlistButton, 'added-to-wish-list');\n wishlistButton.disabled = false;\n }\n hideStrikeHearts(productContainer);\n if (wishlistDisabled || !isDirectlyPurchasable || isFinalSale) {\n showStrikeHearts(productContainer);\n }\n\n if (!selectedSizeData || !currentSizeElement) {\n removeClass(addToCartSection, hiddenClass);\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n fullPDPLink.href = productDetailsUrl;\n if (!isDirectlyPurchasable) {\n addToCartButton.disabled = true;\n availabilityValue = availabilityMessageTmpl(availabilityMsgEl.dataset.notPurchasable);\n availabilityMsgEl.innerHTML = availabilityValue;\n } else {\n addToCartButton.disabled = false;\n }\n return;\n }\n\n const { isNotifyMeEnabled, ID, forceOutOfStock, variantProductDetailsUrl, isFinalSale: isFinalSaleVariant, isDirectlyPurchasable: isDirectlyPurchasableVariant, wishlistDisabled: wishlistDisabledVariant } = selectedSizeData;\n productDetailsUrl = variantProductDetailsUrl;\n const { productInventory } = quickViewInfo;\n const { variants } = productInventory;\n const inventoryData = variants[ID];\n const { message, availabilityStatus, isLowInventory } = inventoryData;\n const selectedColorName = queryFirst('.selected-swatch-name').textContent;\n\n if (!isDirectlyPurchasable) {\n availabilityValue = availabilityMessageTmpl(availabilityMsgEl.dataset.notPurchasable);\n } else if (availabilityStatus !== IN_STOCK || isLowInventory) {\n availabilityValue = availabilityMessageTmpl(message);\n }\n fullPDPLink.href = productDetailsUrl;\n\n if (!isDirectlyPurchasable) {\n addToCartButton.disabled = true;\n removeClass(addToCartSection, hiddenClass);\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n } else if (availabilityStatus !== NOT_AVAILABLE && !forceOutOfStock) {\n addToCartButton.disabled = false;\n removeClass(currentSizeElement, 'not-available');\n hideStrikeHearts(productContainer);\n } else {\n addClass(currentSizeElement, 'not-available');\n addToCartButton.disabled = true;\n showStrikeHearts(productContainer);\n if (isNotifyMeEnabled) {\n addClass(addToCartSection, hiddenClass);\n removeClass([notifyMeDesc, notifyMeButton], hiddenClass);\n } else {\n removeClass(addToCartSection, hiddenClass);\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n }\n }\n\n availabilityMsgEl.innerHTML = availabilityValue;\n productContainer.dataset.pid = ID;\n productContainer.dataset.wishlistId = ID;\n setWishlistProductId(ID, productContainer);\n const productData = {\n available: !hasClass(currentSizeElement, 'not-available'),\n isNotifyMeEnabled,\n id: ID,\n formattedPrice,\n forceOutOfStock,\n imageData: ispu\n };\n if (wishlistDisabledVariant || !isDirectlyPurchasableVariant || isFinalSaleVariant) {\n showStrikeHearts(productContainer);\n }\n handleNotifyMe(productData, productContainer);\n\n // secret sauce integration to update product data\n updateProductData(selectedColorName, selectedSizeValue, standardPrice, price, productContainer);\n handleSize(productContainer);\n\n $('body').trigger('product:afterQuickViewSizeChange', {\n ID,\n productContainer,\n monetateData: {\n pdpBreadCrumbs: variantGroupData.pdpBreadCrumbs\n }\n });\n}\n\n/**\n * This method manages Notify me block on PDP\n * @param {Object} productData - Product data\n * @param {Object} productContainer - Product Container DOM element\n */\nfunction handleNotifyMeBlock(productData, productContainer) {\n const addToCartSection = queryFirst('.prices-add-to-cart-actions', productContainer);\n const notifyBlock = queryFirst('.js-notify-me-container', productContainer);\n const availabilityMessageEl = queryFirst('.product-availability', productContainer);\n const { available, isNotifyMeEnabled, id, forceOutOfStock } = productData;\n if (!available && isNotifyMeEnabled && !forceOutOfStock) {\n addClass([addToCartSection, availabilityMessageEl], HIDDEN_CLASS);\n removeClass(notifyBlock, HIDDEN_CLASS);\n\n if (id) queryFirst('#notifySku', notifyBlock).value = id;\n const custEmail = (queryFirst('#notifyEmail') || {}).value;\n if (custEmail) queryFirst('.notify-email').value = custEmail;\n } else {\n removeClass([addToCartSection, availabilityMessageEl], HIDDEN_CLASS);\n addClass(notifyBlock, HIDDEN_CLASS);\n }\n}\n\n/**\n *\n * @param {string} selectedSizeValue - Selected size value\n * @param {int} selectedColorId - selected color id\n * @param {Object} productContainer - product container html element\n * @param {Object} currentSizeElement - current active size element\n */\nfunction updateProductInfo(selectedSizeValue, selectedColorId, productContainer, currentSizeElement) {\n const masterId = productContainer.dataset.masterid;\n const productInfo = window.productInfo[masterId];\n const variantGroupData = productInfo.variants[selectedColorId];\n const { sizes, images, formattedPrice, totalPrice, monogramProductPrice, standardPrice, price, mgFlag, mgLocs, isDirectlyPurchasable, wishlistDisabled, isFinalSale } = variantGroupData;\n const ispu = base.updateImageDetails(images.ispu);\n const selectedSizeData = sizes[selectedSizeValue];\n const addToCartButton = queryFirst('.add-to-cart', productContainer);\n const monogramBtn = queryFirst('.monogram-btn', productContainer);\n const ispuButton = queryFirst('.btn-in-store-pickup');\n const hiddenClass = 'd-none';\n const notifyMeButton = queryFirst('.notify-me-btn', productContainer);\n const notifyMeDesc = queryFirst('.notify-me-desc', productContainer);\n const addToCartSection = queryFirst('.prices-add-to-cart-actions', productContainer);\n const availabilityMsgEl = queryFirst('.availability-msg', productContainer);\n const ispuLowStockMsgEl = queryFirst('.ispu-low-stock-msg', productContainer);\n let availabilityValue = '';\n\n hideStrikeHearts(productContainer);\n if (wishlistDisabled || !isDirectlyPurchasable || isFinalSale) {\n showStrikeHearts(productContainer);\n }\n\n if (!selectedSizeData || !currentSizeElement) {\n if (ispuButton) {\n ispuButton.disabled = true;\n }\n if (monogramBtn) {\n monogramBtn.disabled = true;\n }\n removeClass(addToCartSection, hiddenClass);\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n if (!isDirectlyPurchasable) {\n addToCartButton.disabled = true;\n availabilityValue = availabilityMessageTmpl(availabilityMsgEl.dataset.notPurchasable);\n availabilityMsgEl.innerHTML = availabilityValue;\n if (ispuButton) {\n ispuButton.disabled = true;\n }\n } else {\n addToCartButton.disabled = false;\n }\n return;\n }\n\n const { isNotifyMeEnabled, ID, forceOutOfStock, promotions, isFinalSale: isFinalSaleVariant, isDirectlyPurchasable: isDirectlyPurchasableVariant, wishlistDisabled: wishlistDisabledVariant } = selectedSizeData;\n const { variants } = window.productInventory;\n const inventoryData = variants[ID];\n const { message, availabilityStatus, isLowInventory } = inventoryData;\n\n // Shipping preference view\n const shippingPreferencesEnabled = isShippingPreferencesViewEnabled();\n let ispuAvailabilityValue = '';\n let ispuLowStockValue = '';\n let ispuVariants;\n let ispuInventoryData;\n let ispuMessage;\n let ispuLowStockMessage;\n let ispuAvailabilityStatus;\n let isISPULowInventory;\n if (shippingPreferencesEnabled && window.ispuProductInventory) {\n ispuVariants = window.ispuProductInventory.variants;\n ispuInventoryData = ispuVariants[ID];\n\n if (ispuInventoryData) {\n ispuMessage = ispuInventoryData.message;\n ispuLowStockMessage = ispuInventoryData.lowStockAvailabilityMessage;\n ispuAvailabilityStatus = ispuInventoryData.availabilityStatus;\n isISPULowInventory = ispuInventoryData.isLowInventory;\n }\n }\n\n const selectedColorName = queryFirst('.selected-swatch-name').textContent;\n if (!isDirectlyPurchasable) {\n availabilityValue = availabilityMessageTmpl(availabilityMsgEl.dataset.notPurchasable);\n } else {\n if (availabilityStatus !== IN_STOCK || isLowInventory) {\n const breadcrumbItems = queryAll('.breadcrumb-item');\n const categoryUrl = breadcrumbItems ? breadcrumbItems.pop().lastElementChild.href : null;\n if (availabilityStatus === NOT_AVAILABLE && categoryUrl) {\n availabilityValue = availabilityMessageOOS(message, categoryUrl);\n } else if (availabilityStatus === PREORDER && categoryUrl) {\n availabilityValue = availabilityMessagePreorder(message, categoryUrl);\n }\n else {\n availabilityValue = availabilityMessageTmpl(message);\n }\n if (isLowInventory) addClass(currentSizeElement, SHIP_TO_LOW_INVENTORY_CLASS);\n }\n\n // Shipping preference view\n if (ispuAvailabilityStatus && (ispuAvailabilityStatus !== IN_STOCK || isISPULowInventory)) {\n ispuAvailabilityValue = ispuAvailabilityMessageTmpl(ispuMessage);\n ispuLowStockValue = ispuLowStockMessage ? ispuLowStockMessageTmpl(ispuLowStockMessage) : '';\n }\n }\n\n if (!isDirectlyPurchasable) {\n addToCartButton.disabled = true;\n removeClass(addToCartSection, hiddenClass);\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n } else if ((availabilityStatus !== NOT_AVAILABLE || (ispuAvailabilityStatus && ispuAvailabilityStatus !== NOT_AVAILABLE)) &&\n !forceOutOfStock) {\n addToCartButton.disabled = false;\n removeClass(currentSizeElement, 'not-available');\n hideStrikeHearts(productContainer);\n } else {\n addClass(currentSizeElement, 'not-available');\n addToCartButton.disabled = true;\n showStrikeHearts(productContainer);\n if (isNotifyMeEnabled) {\n addClass(addToCartSection, hiddenClass);\n removeClass([notifyMeDesc, notifyMeButton], hiddenClass);\n } else {\n removeClass(addToCartSection, hiddenClass);\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n }\n }\n if (availabilityStatus === PREORDER) {\n addClass(currentSizeElement, 'pre-order');\n }\n\n if (shippingPreferencesEnabled) {\n $body.trigger('product:inventoryStatus', {\n shipToAddressAvailabilityStatus: availabilityStatus,\n inStorePickUpAvailabilityStatus: ispuAvailabilityStatus || NOT_AVAILABLE,\n isStorePickUpLowInventory: isISPULowInventory,\n inStorePickUpAvailabilityMessage: ispuAvailabilityValue,\n inStorePickUpLowStockMessage: ispuLowStockValue,\n productContainer\n });\n }\n availabilityMsgEl.innerHTML = availabilityValue;\n productContainer.dataset.pid = ID;\n queryFirst('.product-id', productContainer).textContent = ID;\n setWishlistProductId(ID, productContainer);\n productContainer.dataset.wishlistId = ID;\n const productData = {\n available: !hasClass(currentSizeElement, 'not-available'),\n isNotifyMeEnabled,\n id: ID,\n formattedPrice,\n forceOutOfStock,\n imageData: ispu\n };\n if (wishlistDisabledVariant || !isDirectlyPurchasableVariant || isFinalSaleVariant) {\n showStrikeHearts(productContainer);\n }\n handleNotifyMeBlock(productData, productContainer);\n if (!isDirectlyPurchasable) {\n if (ispuButton) {\n ispuButton.disabled = true;\n }\n } else if (ispuButton) {\n ispuButton.disabled = false;\n ispuButton.dataset.pid = ID;\n const pickupImageElement = queryFirst('.pickup-product-img img', productContainer);\n if (pickupImageElement && ispu) {\n const { alt, url, srcset } = ispu[0];\n const imageHasLoaded = hasClass(pickupImageElement, 'lz-loaded');\n\n pickupImageElement.setAttribute(imageHasLoaded ? 'src' : 'data-src', url);\n pickupImageElement.setAttribute(imageHasLoaded ? 'srcset' : 'data-srcset', srcset);\n pickupImageElement.setAttribute('alt', alt);\n }\n queryFirst('.pickup-price').textContent = formattedPrice;\n queryFirst('.pickup-color .selected-color').textContent = selectedColorName;\n const pickupSize = queryFirst('.pickup-size');\n queryFirst('.size-label', pickupSize).textContent = queryFirst('.size-display-name').value;\n const sizeSelected = queryFirst('.size-card .size-btn.selected');\n if (sizeSelected) {\n queryFirst('.selected-size', pickupSize).textContent = sizeSelected.dataset.attrValue;\n }\n }\n\n const product = {};\n if (mgFlag && mgLocs && mgLocs.length > 0) {\n const monogramImages = images.monogram || [];\n let url = '';\n let srcset = '';\n if (monogramImages.length) {\n const updatedImageData = base.updateImageDetails(monogramImages)[0];\n url = updatedImageData.url;\n srcset = updatedImageData.srcset;\n }\n const monogramObject = {\n monogramProductID: ID,\n monogramImageURL: url,\n monogramImageSrcSetURL: srcset,\n monogramLocations: mgLocs,\n monogramSelectedColor: selectedColorName,\n monogramSelectedSize: selectedSizeValue,\n productPrice: formattedPrice,\n monogramProductPrice,\n totalPrice: totalPrice\n };\n product.monogramObject = monogramObject;\n }\n\n // secret sauce integration to update product data\n updateProductData(selectedColorName, selectedSizeValue, standardPrice, price, productContainer);\n handleSize(productContainer);\n $('body').trigger('product:afterSizeChange', {\n data: {\n product\n },\n ID,\n productContainer\n });\n if (availabilityStatus !== NOT_AVAILABLE && !forceOutOfStock && !hasClass(monogramBtn, hiddenClass) && isDirectlyPurchasable) {\n monogramBtn.disabled = false;\n } else {\n monogramBtn.disabled = true;\n }\n\n // update promotion messages display for selected variation\n queryFirst('.promotions').innerHTML = promotions ? promotions.filter((promotion) => promotion.calloutMsg).map((promotion, promotionIdx) => {\n return promotionMessageTmpl(promotion.calloutMsg, promotion.details, promotionIdx);\n }).join('') : '';\n\n if (wishlistDisabled) {\n showStrikeHearts(productContainer);\n }\n\n // pick new promotion popover elements\n initPopoverPromotions();\n initPopoverCloseSelector();\n initPopoverWishList();\n initPopoverClose();\n}\n\nconst init = () => {\n $('body').on('product:handleImageZoom', handleProductImageZoom);\n $('.carousel.image-slider').carousel();\n};\n\nconst handleLastLinkTab = e => {\n const sizeChartCatBtn = queryFirst('#sizechart-menu-toggle');\n const isTabPressed = e.key === TabKey || e.keyCode === KEYCODE_TAB;\n if (!isTabPressed) {\n return;\n }\n\n if (!e.shiftKey) {\n sizeChartCatBtn.focus();\n }\n};\n\n/**\n * Toogle Size chart and select needed category\n * @param {Object} $this - Size chart link JQUERY element\n * @param {Object} $prodSizeChart) - Size chart window element\n */\nfunction toogleActiveSizeChartTab($this, $prodSizeChart) {\n const $lpSlideout = $('.lp-sizechart');\n const { sizefamily: activeCategoryVal, defaulttext: defaultText } = $this.data();\n const $activeCategoryEl = $prodSizeChart.find(`a[href=\"#${activeCategoryVal}-size\"]`);\n const $lpSizechartTitle = $prodSizeChart.find('.lp-sizechart-category-btn');\n $lpSizechartTitle.focus();\n $activeCategoryEl.tab('show');\n $lpSizechartTitle.text($activeCategoryEl.text().length ? $activeCategoryEl.text() : defaultText);\n\n $prodSizeChart.animate(\n {\n right: '0'\n },\n 500\n );\n $prodSizeChart.addClass('active');\n $lpSlideout.toggleClass('lp-slideout-open');\n $body.toggleClass(sizeChartClasses);\n}\n\nexport default {\n init: init,\n\n availability: base.availability,\n\n addToCart: base.addToCart,\n\n scrollFitRatingToReviews: function () {\n $(document).on('click', 'button.fit-review, button.no-fit-review', function (e) {\n e.preventDefault();\n const bvReviews = document.getElementById('bazaarvoiceReviews');\n if (bvReviews) {\n scrollTo(window.scrollY + bvReviews.getBoundingClientRect().top, 0);\n }\n });\n },\n\n handleProductImageZoom: handleProductImageZoom,\n\n updateAttribute: function () {\n $('body').on('product:afterAttributeSelect', function (e, response) {\n const { container } = response;\n const { id, variationAttributes } = response.data.product;\n if ($('.product-detail>.bundle-items').length) {\n container.data('pid', id);\n container.find('.product-id').text(id);\n } else if ($('.product-set-detail').eq(0)) {\n container.data('pid', id);\n container.find('.product-id').text(id);\n } else {\n $('.product-id').text(id);\n $('.product-detail:not(\".bundle-item\")').data('pid', id);\n }\n updateSelectedSwatchProductName(variationAttributes, container);\n $('body').trigger('product:handleImageZoom');\n });\n },\n\n selectSizeAttribute: function () {\n $(document).on('click', '.set-items .size-btn, .product-quickview .size-btn', function (e) {\n e.preventDefault();\n const buttonElement = e.target;\n if (!hasClass(buttonElement, 'selected')) {\n const $productContainer = $(this).closest('.product-detail');\n const url = buttonElement.dataset.attrUrl;\n if ($productContainer.hasClass('cached-quick-view')) {\n const productContainer = this.closest('.product-detail');\n const selectedColorElement = queryFirst('.color-attribute .swatch-circle.selected', productContainer);\n const selectedColorId = selectedColorElement.dataset.attrValue;\n const selectedSizeValue = this.dataset.attrValue;\n onSizeChangeHandler.apply(this, [productContainer, selectedSizeValue]);\n updateQuickViewProductInfo(selectedSizeValue, selectedColorId, productContainer, this);\n } else {\n base.attributeSelect(url, $productContainer, buttonElement);\n }\n }\n });\n $('body').on('product:quickViewAttributeChange', (e, response) => {\n const selectedSizeElement = queryFirst('.product-quickview.cached-quick-view .size-btn.selected');\n const selectedValue = selectedSizeElement ? selectedSizeElement.dataset.attrValue : '';\n updateQuickViewProductInfo(selectedValue, response.variantGroupId, response.container[0], selectedSizeElement);\n });\n window.addEventListener('resize', throttle(() => {\n const quickViewCarouselEl = queryFirst('.product-quickview.cached-quick-view .carousel');\n if (quickViewCarouselEl) {\n quickViewCarouselEl.style.minHeight = '';\n }\n }, 16));\n },\n afterAttributeSelect: function () {\n $('body').on('product:afterAttributeSelect', (event, response) => {\n const { selectedSizeElement } = response;\n const { product } = response.data;\n const { id, readyToOrder, available, forceOutOfStock, price, wishListID, images, isDirectlyPurchasable, wishlistDisabled } = product;\n const { ispu } = images;\n const responseContainer = response.container[0];\n const addToCartButton = queryFirst('.add-to-cart', responseContainer);\n responseContainer.dataset.pid = id;\n responseContainer.dataset.wishlistId = wishListID;\n setWishlistProductId(wishListID, responseContainer);\n\n let ssSize = 'unkown';\n const hiddenClass = 'd-none';\n if (hasClass(responseContainer, 'product-quickview') && addToCartButton) {\n addToCartButton.disabled = false;\n }\n if (selectedSizeElement) {\n ssSize = selectedSizeElement.dataset.attrValue;\n removeClass(queryAll('.size-btn', responseContainer), 'selected');\n addClass(selectedSizeElement, 'selected');\n const sizeCard = selectedSizeElement.closest('.size-card');\n const selectedSize = queryFirst('.selected-size', sizeCard);\n if (selectedSize) {\n const sizeSeparator = queryFirst('.size-seperator', sizeCard);\n selectedSize.textContent = selectedSizeElement.dataset.attrValue;\n removeClass([sizeSeparator, selectedSize], hiddenClass);\n }\n const sizeContainer = selectedSizeElement.closest('.size-container');\n const assistiveElements = queryAll('.selected-assistive-text', sizeContainer);\n assistiveElements.forEach(eachElement => {\n if (eachElement.textContent.includes(eachElement.dataset.outOfStock)) {\n eachElement.textContent = eachElement.dataset.outOfStock;\n } else {\n eachElement.textContent = '';\n }\n });\n const assistiveElementOfSelected = queryFirst('.selected-assistive-text', selectedSizeElement.closest('.size-list'));\n const { selectedText, outOfStock } = assistiveElementOfSelected.dataset;\n assistiveElementOfSelected.textContent = selectedText;\n if (hasClass(selectedSizeElement, 'not-available')) {\n assistiveElementOfSelected.textContent += ' ' + outOfStock;\n }\n if (addToCartButton) {\n const restrictedFromOrder = !readyToOrder || !available || forceOutOfStock;\n addToCartButton.disabled = restrictedFromOrder;\n if (restrictedFromOrder) {\n showStrikeHearts(responseContainer);\n } else {\n hideStrikeHearts(responseContainer);\n }\n }\n\n const quickviewContainer = selectedSizeElement.closest('.product-quickview');\n if (quickviewContainer) {\n const addToCartSection = queryFirst('.prices-add-to-cart-actions', responseContainer);\n const notifyMeButton = queryFirst('.notify-me-btn', responseContainer);\n const notifyMeDesc = queryFirst('.notify-me-desc', responseContainer);\n const availabilityMessageEl = queryFirst('.product-availability', responseContainer);\n const { isNotifyMeEnabled, isDirectlyPurchasable } = product;\n const salesPrice = price.type === 'range' ? price.min.sales : price.sales;\n const productData = {\n available,\n isNotifyMeEnabled,\n id,\n formattedPrice: salesPrice.formatted,\n forceOutOfStock,\n imageData: ispu\n };\n handleNotifyMe(productData, quickviewContainer);\n const updateCartButton = queryFirst('.update-cart-product-global', quickviewContainer);\n if (updateCartButton) {\n const { giftWrapAvailableFlag } = product;\n updateCartButton.dataset.giftWrapAvailable = giftWrapAvailableFlag;\n }\n if (isDirectlyPurchasable === false) {\n removeClass(addToCartSection, hiddenClass);\n if (availabilityMessageEl) {\n removeClass(availabilityMessageEl, hiddenClass);\n }\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n }\n }\n\n const ispuButton = queryFirst('.btn-in-store-pickup', responseContainer);\n if (ispuButton) {\n ispuButton.dataset.pid = id;\n ispuButton.disabled = false;\n const pickupImageElement = queryFirst('.pickup-product-img img', responseContainer);\n if (pickupImageElement && ispu) {\n const { alt, url, srcset } = ispu[0];\n pickupImageElement.setAttribute('src', url);\n pickupImageElement.setAttribute('srcset', srcset);\n pickupImageElement.setAttribute('alt', alt);\n }\n queryFirst('.pickup-product-name', responseContainer).textContent = product.productName;\n queryFirst('.pickup-price').textContent = product.price.sales.formatted;\n const selectedSwatchName = queryFirst('.selected-swatch-name', responseContainer);\n if (selectedSwatchName) {\n queryFirst('.pickup-color .selected-color', responseContainer).textContent = selectedSwatchName.textContent;\n }\n const pickupSize = queryFirst('.pickup-size', responseContainer);\n queryFirst('.size-label', pickupSize).textContent = queryFirst('.size-display-name', responseContainer).value;\n const sizeSelected = queryFirst('.size-card .size-btn.selected', responseContainer);\n if (sizeSelected) {\n queryFirst('.selected-size', pickupSize).textContent = sizeSelected.dataset.attrValue;\n }\n }\n }\n if (hasClass(responseContainer, 'product-quickview') && isDirectlyPurchasable === false) {\n const addToCartSection = queryFirst('.prices-add-to-cart-actions', responseContainer);\n const notifyMeButton = queryFirst('.notify-me-btn', responseContainer);\n const notifyMeDesc = queryFirst('.notify-me-desc', responseContainer);\n const availabilityMessageEl = queryFirst('.product-availability', responseContainer);\n removeClass(addToCartSection, hiddenClass);\n if (addToCartButton) {\n addToCartButton.disabled = true;\n }\n if (availabilityMessageEl) {\n removeClass(availabilityMessageEl, hiddenClass);\n }\n addClass([notifyMeDesc, notifyMeButton], hiddenClass);\n }\n const wishlistButton = queryFirst('.add-to-wish-list', responseContainer);\n if (wishlistButton && hasClass(wishlistButton, 'added-to-wish-list')) {\n removeClass(wishlistButton, 'added-to-wish-list');\n wishlistButton.disabled = false;\n const assistiveText = wishlistButton.getAttribute('data-assistive-text');\n wishlistButton.setAttribute('aria-label', assistiveText);\n }\n if (!hasClass(responseContainer, 'gift-card-main') && !document.getElementById('chooseBonusProductModal')) {\n const ssColorElement = queryFirst('.color-container .color-attribute.selected', responseContainer);\n const ssColor = (ssColorElement && ssColorElement.dataset.attrDisplayvalue) || 'unknown';\n const { type } = price;\n const pricesObject = type === 'range' ? price.min : price;\n const { sales, list } = pricesObject;\n const ssSalesPrice = (sales && sales.value.toString()) || 'unknown';\n const ssPrice = (list && list.value.toString()) || ssSalesPrice;\n updateProductData(ssColor, ssSize, ssPrice, ssSalesPrice, responseContainer);\n if (ssSize === 'unknown') {\n handleColor(responseContainer);\n } else {\n handleSize(responseContainer);\n }\n }\n if (selectedSizeElement) {\n const productSetModal = selectedSizeElement.closest('#productSetModal');\n if (productSetModal) {\n const addAllToToteButton = queryFirst('.add-to-cart-global', productSetModal);\n if (addAllToToteButton) {\n const productsAvailability = queryAll('.product-availability', productSetModal).filter(item => !hasClass(item.closest('.product-detail'), 'hidden-set'));\n const numberOfProducts = productsAvailability.length;\n\n // Check to enable add to tote button, if atleast one product exists\n let enable = true;\n if (!numberOfProducts) {\n enable = false;\n }\n addAllToToteButton.disabled = !enable;\n }\n }\n }\n\n if (wishlistDisabled) {\n showStrikeHearts(responseContainer);\n }\n $.spinner().stop();\n });\n },\n selectPdpSizeAttribute: function () {\n $(document).on('click', '.pdp-container .size-btn', function (e) {\n e.preventDefault();\n\n const productContainer = this.closest('.product-detail');\n const selectedColorElement = queryFirst('.color-attribute .swatch-circle.selected', productContainer);\n const selectedColorId = selectedColorElement.dataset.attrValue;\n const selectedSizeValue = this.dataset.attrValue;\n onSizeChangeHandler.apply(this, [productContainer, selectedSizeValue]);\n updateProductInfo(selectedSizeValue, selectedColorId, productContainer, this);\n $body.trigger('product:pdpSizeSelected', {\n selectedColorElement,\n selectedSizeElement: this,\n productContainer\n });\n });\n $('body').on('product:afterAttributeChange', (e, response) => {\n const selectedSizeElement = queryFirst('.pdp-container .size-btn.selected');\n const selectedValue = selectedSizeElement ? selectedSizeElement.dataset.attrValue : '';\n updateProductInfo(selectedValue, response.variantGroupId, response.container[0], selectedSizeElement);\n });\n\n const swatchEl = queryFirst('.pdp-container button.color-attribute .swatch-circle.selected');\n\n if (swatchEl) {\n const sizeElements = queryAll('.pdp-container .size-btn');\n\n if (sizeElements.length) {\n if (sizeElements.length === 1) {\n queryFirst('.pdp-container .size-btn').click();\n } else {\n const selectedSizeEl = queryFirst('.pdp-container .size-btn.selected');\n\n if (selectedSizeEl) {\n selectedSizeEl.click();\n }\n }\n\n if (!queryFirst('.pdp-container .size-btn.not-purchasable')) {\n const allSizesSoldOut = sizeElements.every((sizeElement) => hasClass(sizeElement, 'not-available'));\n\n // In case if all product sizes sold out and Notify me box not showed\n // we hide this variation from swatches and select first color variation that have\n // available sizes\n if (allSizesSoldOut) {\n removeClass(swatchEl, 'selectable');\n\n const allSelectableSwatches = queryAll('.pdp-container button.color-attribute .swatch-circle.selectable');\n const notifyMeBoxHidden = queryFirst('.notify-me-box.d-none'); // PDP case\n const notifyMeHidden = queryFirst('.notify-me-desc.d-none'); // Quick view case\n\n if (allSelectableSwatches.length && (notifyMeBoxHidden !== null || notifyMeHidden !== null)) {\n // Hide the selected swatch because it's out of stock\n addClass(swatchEl.closest('li'), 'd-none');\n allSelectableSwatches[0].click();\n }\n }\n }\n }\n }\n },\n\n updateAttributesAndDetails: function () {\n $('body').on('product:statusUpdate', function (e, data) {\n var $productContainer = $('.product-detail[data-pid=\"' + data.id + '\"]');\n\n $productContainer\n .find('.description-and-detail .product-attributes')\n .empty()\n .html(data.attributesHtml);\n\n if (data.shortDescription) {\n $productContainer.find('.description-and-detail .description').removeClass('hidden-xl-down');\n $productContainer\n .find('.description-and-detail .description .content')\n .empty()\n .html(data.shortDescription);\n } else {\n $productContainer.find('.description-and-detail .description').addClass('hidden-xl-down');\n }\n\n if (data.longDescription) {\n $productContainer.find('.description-and-detail .details').removeClass('hidden-xl-down');\n $productContainer\n .find('.description-and-detail .details .content')\n .empty()\n .html(data.longDescription);\n } else {\n $productContainer.find('.description-and-detail .details').addClass('hidden-xl-down');\n }\n });\n },\n\n showSpinner: function () {\n $('body').on('product:beforeAddToCart product:beforeAttributeSelect', function () {\n const productSetModal = document.getElementById('productSetModal');\n const quickViewModal = document.getElementById('quickViewModal');\n if (productSetModal && hasClass(productSetModal, 'show')) {\n $(productSetModal)\n .spinner()\n .start();\n } else if (quickViewModal && hasClass(quickViewModal, 'show')) {\n $(quickViewModal)\n .spinner()\n .start();\n } else {\n $.spinner().start();\n }\n });\n },\n updateAvailability: function () {\n $('body').on('product:updateAvailability', function (e, response) {\n $('div.availability', response.$productContainer)\n .attr('data-ready-to-order', response.product.readyToOrder)\n .attr('data-available', response.product.available);\n\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (response.product.readyToOrder) {\n availabilityMessages.forEach(message => {\n availabilityValue += availabilityMessageTmpl(message);\n });\n }\n\n $('.availability-msg', response.$productContainer)\n .empty()\n .html(availabilityValue);\n\n if ($('.global-availability').length) {\n var allAvailable = $('.product-availability')\n .toArray()\n .every(function (item) {\n return $(item).data('available');\n });\n\n var allReady = $('.product-availability')\n .toArray()\n .every(function (item) {\n return $(item).data('ready-to-order');\n });\n\n $('.global-availability')\n .data('ready-to-order', allReady)\n .data('available', allAvailable);\n\n $('.global-availability .availability-msg')\n .empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n }\n });\n },\n sizeChart: function () {\n var $prodSizeChart = $('.size-chart-collapsible');\n $('body').on('click', '.size-chart .size-chart-link', function (e) {\n e.preventDefault();\n const element = $(this);\n const url = element.data('href');\n const $lpSlideout = $('.lp-sizechart');\n const setStickyNav = queryFirst('.custom-set-detail-sticky-nav');\n if ($prodSizeChart.is(':empty')) {\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $prodSizeChart.append(data.content);\n },\n complete: function () {\n toogleActiveSizeChartTab(element, $prodSizeChart);\n\n const lastLinkEl = queryFirst('.return-policy-link');\n if (lastLinkEl) {\n lastLinkEl.addEventListener('keydown', handleLastLinkTab);\n }\n }\n });\n } else {\n toogleActiveSizeChartTab(element, $prodSizeChart);\n }\n if (setStickyNav) {\n addClass(setStickyNav, 'd-none');\n }\n $lpSlideout.trigger('shown.lp.sizeguide');\n });\n\n $('body').on('click touchstart', function (e) {\n if (e.target.matches('#sizechart-close') || (e.target.matches('.size-chart-bg') && $prodSizeChart.hasClass('active'))) {\n $prodSizeChart.removeClass('active');\n $('.lp-slideout').removeClass('lp-slideout-open');\n $body.removeClass(sizeChartClasses);\n queryFirst('.size-chart .size-chart-link').focus(); // set focus back to trigger element\n }\n });\n },\n\n focusChooseBonusProductModal: base.focusChooseBonusProductModal(),\n renderSizeElements: base.renderSizeElements,\n handleEarlyAccessPLPLockIcon: base.handleEarlyAccessPLPLockIcon(),\n handleEarlyAccessLockIcon: function () {\n const productContainer = queryFirst('.pdp-container');\n const productContainerEarlyAccessIcon = queryFirst('.loyalty-early-access-lock-container', productContainer);\n if (productContainerEarlyAccessIcon) {\n const { earlyAccessDate } = productContainerEarlyAccessIcon.dataset;\n const earlyAccessItem = isEarlyAccessElement(earlyAccessDate);\n base.handleEarlyAccessCta(productContainer, earlyAccessItem);\n }\n },\n handleOfflineProduct: function () {\n const offlineContainerEl = queryFirst('.offline-product-detail');\n if (offlineContainerEl) {\n const pid = offlineContainerEl.dataset.pid;\n const availabilityStatus = getNestedValue(window, `productInventory.variants[${pid}].availabilityStatus`);\n if (availabilityStatus === IN_STOCK) {\n const { search: currentSearch } = window.location;\n const TS_PARAM = 'timestamp=';\n if (!currentSearch.includes(TS_PARAM)) {\n window.location.search = (currentSearch ? currentSearch + '&' : '') + TS_PARAM + new Date().getTime();\n }\n }\n }\n },\n handlePdpNonEarlyAccessLoyalty: function () {\n // Sign in/Create account modal for non-early access product\n\n const signInCreateAccountModal = queryFirst('#loyalty-early-access-register');\n const loyaltyEnrollNowModal = queryFirst('#loyalty-enrollnow-modal');\n const pdpSignInCreateAccountButton = queryAll('.pdp-non-early-access-login');\n const earlyAccessSignInInfo = queryAll('.early-access-sign-info');\n const pdpSignInInfo = queryFirst('.pdp-sign-in-info');\n const earlyAccessSignInText = queryFirst('.early-access-sign-in-text');\n const welcomeDialogEarlyAccessMsgEl = queryFirst('.js-loyalty-welcome-early-access-msg');\n const welcomeDialogMsgEl = queryFirst('.js-loyalty-welcome-msg');\n const joinButton = queryFirst('.join-now-button');\n const earlyAccessWelcomeCta = queryFirst('.loyalty-early-access-welcome-cta');\n const loyaltyWelcomeDialog = queryFirst('#loyalty-welcome-popup');\n const $nonEarlyAccessLogin = $('.pdp-non-early-access-login');\n\n $nonEarlyAccessLogin.on('click', function () {\n const button = this;\n handleEarlyAccessLogin(button);\n const { pdpSignInTab } = button.dataset;\n $(signInCreateAccountModal).modal('show');\n $(`.nav-tabs a[href=\"#${pdpSignInTab}\"]`).tab('show');\n if (pdpSignInCreateAccountButton.length) {\n addClass(earlyAccessSignInInfo, HIDDEN_CLASS);\n addClass(earlyAccessSignInText, HIDDEN_CLASS);\n removeClass(pdpSignInInfo, HIDDEN_CLASS);\n }\n\n // return focus to trigger after modal is closed\n $(signInCreateAccountModal).one('hidden.bs.modal', () => button.focus());\n });\n\n if (joinButton) {\n joinButton.addEventListener('click', e => {\n e.preventDefault();\n $(loyaltyEnrollNowModal).modal('show');\n addClass(welcomeDialogMsgEl, HIDDEN_CLASS);\n removeClass(welcomeDialogEarlyAccessMsgEl, HIDDEN_CLASS);\n });\n }\n if (earlyAccessWelcomeCta) {\n earlyAccessWelcomeCta.addEventListener('click', function () {\n location.reload();\n });\n }\n $(loyaltyWelcomeDialog).off('hidden.bs.modal').on('hidden.bs.modal', function () {\n location.reload();\n });\n }\n};\n","'use strict';\n\nconst { queryFirst } = require('../domUtil');\nconst { getNestedValue } = require('../util');\nconst { selectStyleMessageTmpl, ispuSelectStyleMessageTmpl } = require('../templates').productDetail;\nconst { EMPTY_STRING } = require('../constants');\n\n/**\n * Function to check if shipping preferences view is enabled or not\n * @returns { boolean } - returns isEnabled flag value\n */\nfunction isShippingPreferencesViewEnabled() {\n return getNestedValue(window, 'lillyUtils.shippingPreferencesConfig.isEnabled') || false;\n}\n\n/**\n * Function to toggle select color or size info\n * @param {HTMLElement} productContainer - current product element\n */\nfunction toggleSelectSizeInfo(productContainer) {\n const selectedSizeEl = queryFirst('.size-btn.selected', productContainer);\n const availabilityMessageEl = queryFirst('.product-availability .availability-msg', productContainer);\n if (availabilityMessageEl) {\n if (!selectedSizeEl) {\n availabilityMessageEl.innerHTML = selectStyleMessageTmpl(availabilityMessageEl.dataset.selectStylesMessage);\n }\n }\n\n if (isShippingPreferencesViewEnabled()) {\n const ispuAvailabilityMessageEl = queryFirst('.ispu-preference-container .select-size-info-msg', productContainer);\n if (ispuAvailabilityMessageEl) {\n const messages = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig.messages') || {};\n const { selectStylesMessage } = messages;\n if (!selectedSizeEl && selectStylesMessage) {\n ispuAvailabilityMessageEl.innerHTML = ispuSelectStyleMessageTmpl(selectStylesMessage);\n }\n }\n }\n}\n/**\n * Helper method to check if product is on early access or not\n * @param {Object|String} earlyAccess - product | early access date\n * @return {Boolean} true, if early access product or false for not\n */\nfunction isEarlyAccessElement(earlyAccess) {\n let isEarlyAccessItem = false;\n const earlyAccessDate = earlyAccess && earlyAccess.earlyAccessUntilDate || earlyAccess;\n if (earlyAccessDate && earlyAccessDate !== 'false') {\n if (new Date(earlyAccessDate).getTime() > new Date().getTime()) {\n isEarlyAccessItem = true;\n }\n }\n return isEarlyAccessItem;\n}\n\nmodule.exports = {\n toggleSelectSizeInfo: toggleSelectSizeInfo,\n isEarlyAccessElement: isEarlyAccessElement,\n isShippingPreferencesViewEnabled: isShippingPreferencesViewEnabled\n};\n\n","/* eslint-disable no-param-reassign */\n'use strict';\n\nconst { queryFirst, queryAll, addClass, hasClass, removeClass } = require('../domUtil');\n\nconst { initOnce } = require('../util');\nconst hiddenClass = 'd-none';\nconst mql = window.matchMedia('(max-width: 767px)');\nlet initialMonogramClick = false;\n\nconst styleMap = {\n singleLetterStyle: 'Single Letter',\n doubleLetterStyle: 'Double Letter',\n tripleLetterStyle: 'Triple Letter',\n traditionalLetterStyle: 'Traditional'\n};\n\nconst colorMap = [\n {\n name: 'Indigo',\n rgb: 'rgb(0, 0, 102)'\n },\n {\n name: 'Resort White',\n rgb: 'rgb(246, 246, 246)'\n },\n {\n name: 'Rosseau Pink',\n rgb: 'rgb(255,209,255)'\n },\n {\n name: 'Gold',\n rgb: 'rgb(221, 161, 69)'\n }\n];\n\nconst selectedMonogramValues = {\n monogramInitials: '',\n monogramStyle: '',\n monogramColor: 'Indigo',\n placementSelect: ''\n};\n\nlet enableContinue = false;\n\nlet allInputText = '';\n\nlet monogramData = {};\n\nconst monogramContinueButton = queryFirst('.monogram-continue-btn');\nconst monogramModalEl = queryFirst('.monogram-modal');\nconst initialsButtons = queryFirst('.monogram-style .selected');\nconst monongramUlEl = queryFirst('.monogram-color');\nconst selectedClass = 'selected';\nconst activeViewClass = 'active-view';\nconst monogramConfirmationView = queryFirst('.monogram-confirmation-view');\nconst detailViewEl = queryFirst('.monogram-detail-view');\n\n// check selectedMonogramValues and enable continue button if values are set\nconst updateMonogramValues = (type, value) => {\n selectedMonogramValues[type] = value;\n\n const { monogramInitials, monogramStyle, monogramColor, placementSelect } = selectedMonogramValues;\n\n if (monogramInitials.length === 0 || !monogramStyle || !monogramColor || !placementSelect) {\n enableContinue = false;\n monogramContinueButton.setAttribute('disabled', true);\n return;\n }\n\n enableContinue = true;\n monogramContinueButton.removeAttribute('disabled');\n removeClass(queryFirst('.monogram-incomplete-label'), 'show-error');\n};\n\n// This method adds assistive text for selected options at various stages of monogramming selection\nconst changeSelectedAssistiveText = (assistiveElementSelector, selectedElement) => {\n queryAll(assistiveElementSelector).forEach(eachElement => {\n eachElement.textContent = '';\n });\n const selectedAssistiveElement = queryFirst('.selected-assistive-text', selectedElement);\n selectedAssistiveElement.textContent = selectedAssistiveElement.dataset.selectedText;\n};\n\n// toggle style and sample text length\nconst toggleStyle = style => {\n const monogramDetails = queryFirst('.monogram-customize-details');\n const initialsSampleAll = queryAll('.product-initials-sample');\n const traditionalSampleAll = queryAll('.product-traditional-sample');\n const inputValue = allInputText;\n const monogramStyle = monogramDetails.querySelector('.monogramStyle');\n\n const setInitials = value => {\n initialsSampleAll.forEach(el => {\n el.textContent = value;\n });\n };\n\n const selectStyle = (styleSelect, textValue) => {\n const selectedStyleElement = document.getElementById(styleSelect);\n selectedStyleElement.className = 'selectable selected';\n changeSelectedAssistiveText('.monogram-style .selectable .selected-assistive-text', selectedStyleElement);\n monogramStyle.value = styleMap[styleSelect] || '';\n updateMonogramValues('monogramStyle', styleMap[styleSelect]);\n updateMonogramValues('monogramInitials', (textValue || inputValue).toUpperCase());\n\n if (styleSelect === 'traditionalLetterStyle') {\n traditionalSampleAll.forEach(el => {\n el.querySelector('.first').textContent = textValue.charAt(0);\n el.querySelector('.middle').textContent = textValue.charAt(2);\n el.querySelector('.last').textContent = textValue.charAt(1);\n });\n } else {\n setInitials(textValue || inputValue);\n }\n };\n\n removeClass(queryAll('.monogram-style .selectable'), 'selected');\n addClass(initialsSampleAll, 'active');\n removeClass(traditionalSampleAll, 'active');\n removeClass(queryFirst('.initials'), 'show-labels');\n\n const letter1 = inputValue.charAt(0);\n const letter2 = inputValue.charAt(1);\n const letter3 = inputValue.charAt(2);\n\n switch (style) {\n case 0:\n setInitials('');\n removeClass(initialsButtons, 'selected');\n updateMonogramValues('monogramInitials', '');\n updateMonogramValues('monogramStyle', '');\n addClass(queryFirst('.monogram-incomplete-label'), 'show-error');\n break;\n case 1:\n case 'singleLetterStyle':\n selectStyle('singleLetterStyle', letter1);\n break;\n\n case 2:\n selectStyle('doubleLetterStyle', inputValue.substr(0, 2));\n break;\n\n case 'doubleLetterStyle':\n if (inputValue.length === 1) {\n selectStyle('singleLetterStyle');\n } else if (inputValue.length === 3) {\n selectStyle(style, letter1 + letter3);\n } else {\n selectStyle(style, inputValue.substr(0, 2));\n }\n break;\n\n case 3:\n case 'tripleLetterStyle':\n if (inputValue.length === 2) {\n selectStyle('doubleLetterStyle');\n } else if (inputValue.length === 1) {\n selectStyle('singleLetterStyle');\n } else {\n selectStyle('tripleLetterStyle');\n }\n break;\n\n case 'traditionalLetterStyle':\n if (inputValue.length === 2) {\n selectStyle('doubleLetterStyle');\n } else if (inputValue.length === 1) {\n selectStyle('singleLetterStyle');\n } else {\n addClass(queryFirst('.initials'), 'show-labels');\n removeClass(initialsSampleAll, 'active');\n addClass(traditionalSampleAll, 'active');\n selectStyle('traditionalLetterStyle', letter1 + letter2 + letter3);\n }\n break;\n\n default:\n setInitials('');\n break;\n }\n};\n\n// resets monnogram values / settings\nconst resetMonogram = () => {\n // reset initials\n allInputText = '';\n updateMonogramValues('monogramInitials', '');\n queryAll('.monogram-initials').forEach(el => {\n el.value = '';\n });\n\n // reset color\n updateMonogramValues('monogramColor', 'Indigo');\n removeClass(queryAll('.monogram-color li'), selectedClass);\n addClass(queryFirst('.monogram-color li'), selectedClass);\n queryAll('.monogram-img-wrapper').forEach(el => {\n el.setAttribute('style', `color:${colorMap[0].rgb}`);\n });\n\n // reset style\n toggleStyle(0);\n\n // reset placement\n updateMonogramValues('placementSelect', monogramData.monogramLocations[0].displayValue);\n removeClass(queryAll('.monogram-placement li'), selectedClass);\n addClass(queryFirst('.monogram-placement li'), selectedClass);\n\n // set monongram modal to first view\n removeClass(monogramConfirmationView, activeViewClass);\n removeClass(detailViewEl, hiddenClass);\n addClass(monogramConfirmationView, hiddenClass);\n};\n\nconst initListeners = () => {\n // Update Selected Sample Text upon entering initials\n queryAll('.monogram-initials').forEach((el, i, list) => {\n initOnce(el, 'keyup', e => {\n const windowTest = w => {\n if (w.matches) {\n initOnce(el, 'keydown', e => {\n const isTabEnterPressed = e.key === 'Tab' || e.keyCode === 9 || e.key === 'Backspace' || e.keyCode === 9 || e.key === 'Delete' || e.keyCode === 46;\n const max = 1;\n if (el.value.length >= max && !isTabEnterPressed) {\n e.preventDefault();\n return;\n }\n });\n }\n };\n windowTest(mql);\n\n const { target } = e;\n const { keyCode } = e;\n const valid = (keyCode > 46 && keyCode < 91) || (keyCode > 185 && keyCode < 93) || (keyCode > 218 && keyCode < 223) || keyCode === 8;\n const replaceReg = /[^a-z]/gi;\n\n allInputText = '';\n target.value = target.value.replace(replaceReg, '');\n queryAll('.monogram-initials').forEach(elem => {\n allInputText += elem.value;\n });\n\n if (valid) {\n toggleStyle(allInputText.length);\n if (list[i + 1] && target.value) {\n list[i + 1].focus();\n }\n }\n });\n });\n\n // Update Selected Sample Text Style on style type click\n queryAll('.monogram-style button').forEach(el => {\n initOnce(el, 'click', e => {\n const style = e.target.closest('li').id;\n toggleStyle(style);\n });\n });\n\n // Update Selected Sample Text Color on color type click\n initOnce(queryFirst('.monogram-close'), 'click', () => {\n resetMonogram();\n });\n\n // Update Selected Sample Text Color on color type click\n initOnce(monongramUlEl, 'click', e => {\n const { target } = e;\n const parentLI = target.closest('li');\n const btnEl = target.closest('.color-swatch');\n\n if (!btnEl || hasClass(parentLI, selectedClass)) return;\n\n queryAll('.monogram-img-wrapper').forEach(element => {\n element.style.color = btnEl.dataset.colorRgb;\n });\n removeClass(queryAll('.monogram-color li'), selectedClass);\n addClass(parentLI, selectedClass);\n changeSelectedAssistiveText('.monogram-color .selectable .selected-assistive-text', target.closest('.selectable'));\n\n // update monogram obj\n updateMonogramValues('monogramColor', btnEl.dataset.colorName);\n });\n\n // Update Selected Placement selction on img click\n initOnce(queryFirst('.monogram-placement'), 'click', e => {\n const { target } = e;\n const parentLI = target.closest('li');\n const btnEl = target.closest('.placement-swatch');\n\n if (!btnEl || hasClass(parentLI, selectedClass)) return;\n\n removeClass(queryAll('.monogram-placement li'), selectedClass);\n addClass(parentLI, selectedClass);\n changeSelectedAssistiveText('.monogram-placement .selectable .selected-assistive-text', target.closest('.selectable'));\n\n // update monogram obj\n updateMonogramValues('placementSelect', btnEl.dataset.placement);\n\n queryFirst('.monogram-confirmation-placement span').textContent = selectedMonogramValues.placementSelect;\n });\n\n // Enable and show monogram confirmation menu if values selected\n initOnce(monogramContinueButton, 'click', () => {\n addClass(monogramConfirmationView, activeViewClass);\n addClass(detailViewEl, hiddenClass);\n removeClass(monogramConfirmationView, hiddenClass);\n });\n\n initOnce(queryFirst('.monogram-continue'), 'click', () => {\n if (!enableContinue) {\n addClass(queryFirst('.monogram-incomplete-label'), 'show-error');\n }\n });\n\n // Go back to monogram selection from confrimation menu\n initOnce(queryFirst('.monogram-go-back'), 'click', () => {\n removeClass(monogramConfirmationView, activeViewClass);\n addClass(monogramConfirmationView, hiddenClass);\n removeClass(detailViewEl, hiddenClass);\n });\n\n initOnce(queryFirst('.monogram-add-to-tote-btn'), 'click', event => {\n event.preventDefault();\n const data = queryFirst('.monogram-add-to-tote-btn').dataset;\n const url = data.monogramUrl;\n\n var form = {\n pid: monogramData.monogramProductID,\n monogramValues: JSON.stringify(selectedMonogramValues)\n };\n const spinner = $.spinner();\n spinner.start();\n $('body').trigger('product:beforeAddToCart');\n $.ajax({\n url: url,\n type: 'post',\n data: form,\n success: function (responseData) {\n const { error } = responseData;\n $('#monogram-modal').modal('hide');\n if (error) {\n // show add to cart toast\n $('.add-to-cart-messages').remove();\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
      ');\n }\n\n $('.add-to-cart-messages').append('
      ' + responseData.message + '
      ');\n\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n } else {\n $('.minicart').trigger('count:update', responseData);\n $('body').trigger('product:afterAddToCart', responseData);\n }\n resetMonogram();\n spinner.stop();\n },\n error: function () {\n spinner.stop();\n }\n });\n });\n};\n\n// update dynamic monogram text labels\nconst appendDynamicText = () => {\n queryAll('.monogram-pattern-img').forEach(el => {\n el.innerHTML = `\"${monogramData.monogramSelectedColor}\"`;\n });\n\n queryAll('.product-name', monogramModalEl).textContent = monogramData.monogramProductName;\n\n queryAll('.monogram-product-price').forEach(el => {\n el.textContent = monogramData.productPrice;\n });\n\n queryAll('.monogram-price').forEach(el => {\n el.textContent = monogramData.monogramProductPrice;\n });\n\n queryFirst('.monogram-pattern span').textContent = monogramData.monogramSelectedColor;\n\n queryFirst('.monogram-size span').textContent = monogramData.monogramSelectedSize;\n\n queryFirst('.monogram-price-label span').textContent = monogramData.monogramProductPrice;\n\n queryFirst('.monogram-total span').textContent = monogramData.totalPrice;\n};\n\nconst appendColorSwatches = () => {\n if (!colorMap || !colorMap.length) return;\n let monogramColorHtml = '';\n const { stepTitle } = queryFirst('.monogram-customize-details .product-colors .step-title').dataset;\n const { selectedText } = queryFirst('.monogram-customize-details .selected-assistive-text').dataset;\n\n colorMap.forEach((swatch, i) => {\n if (!swatch) {\n return;\n }\n monogramColorHtml += `
    5. \n \n ${swatch.name}\n \n ${i === 0 ? selectedText : ''}\n \n
    6. `;\n });\n monongramUlEl.innerHTML = monogramColorHtml;\n};\n\nconst appendPositionSwatches = () => {\n const btnPositionData = monogramData.monogramLocations;\n if (!btnPositionData || !btnPositionData.length) return;\n let monogramPositionHtml = '';\n const { stepTitle } = queryFirst('.monogram-customize-details .placement .step-title').dataset;\n const { selectedText } = queryFirst('.monogram-customize-details .selected-assistive-text').dataset;\n\n btnPositionData.forEach((el, i) => {\n if (!el) {\n return;\n }\n const { displayValue, imgURL, value } = el;\n if (i === 0) {\n updateMonogramValues('placementSelect', displayValue);\n queryFirst('.monogram-confirmation-placement span').textContent = displayValue;\n }\n monogramPositionHtml += `
    7. \n \n ${displayValue}\n \n ${i === 0 ? selectedText : ''}\n \n
    8. `;\n });\n queryFirst('.monogram-placement').innerHTML = monogramPositionHtml;\n updateMonogramValues('placementSelect', btnPositionData[0].displayValue);\n};\n\nmodule.exports = {\n checkMonogram: () => {\n const monogramButton = queryFirst('.monogram-btn');\n if (monogramContinueButton) {\n $('body').on('product:afterAttributeSelect product:afterSizeChange', (e, response) => {\n removeClass(monogramConfirmationView, activeViewClass);\n removeClass(detailViewEl, hiddenClass);\n if ('monogramObject' in response.data.product) {\n monogramData = response.data.product.monogramObject;\n appendDynamicText();\n if (!initialMonogramClick) {\n appendPositionSwatches();\n appendColorSwatches();\n }\n initListeners();\n if (monogramButton) {\n removeClass(monogramButton, hiddenClass);\n }\n initialMonogramClick = true;\n } else if (monogramButton) {\n addClass(monogramButton, hiddenClass);\n }\n });\n }\n }\n};\n","'use strict';\n\nconst base = require('./base').default;\nconst detail = require('./detail').default;\nconst { updateSelectedSwatchProductName, injectAfterpay, injectFitPredictor, injectLongDescription, updateFullProductLink } = require('../quickView/quickViewHelpers').default;\nconst focusHelper = require('base/components/focus');\nconst { getJSON } = require('../util');\nconst { getLastElementInRow, getStyles, hasClass, queryFirst, remove, scrollTo } = require('../domUtil');\nconst { quickView: quickViewTemplates } = require('../templates');\nconst $window = $(window);\nconst $body = $('body');\nconst { ajaxFormInvalid, ajaxFormSubmit } = require('../clientSideValidation');\nconst header = queryFirst('.main-header');\nconst { handleEarlyAccessLogin } = require('../loyalty/loyaltyDrawer');\n\n/**\n * OOTB function\n * Generates the modal window on the first call.\n * @param {HTMLElement} srcElement - quick view initiator element\n */\nfunction getModalHtmlElement(srcElement) {\n const quickViewModalEl = document.getElementById('quickViewModal');\n remove(quickViewModalEl);\n const quickview = $(quickViewTemplates.quickViewModal);\n quickview.data('srcElement', srcElement);\n $('body').append(quickview);\n}\n\n/**\n * OOTB function\n * Parse HTML code in Ajax response\n *\n * @param {string} html - Rendered HTML from quickview template\n * @return {QuickViewHtml} - QuickView content components\n */\nfunction parseHtml(html) {\n const $html = $('
      ').append($.parseHTML(html));\n const body = $html.find('.product-quickview');\n return { body };\n}\n\n/**\n * Modifies a quickview template to include elements specific to this implementation\n * @param {string} template - The rendered template\n * @returns {string} Modified template\n */\nfunction modifyTemplate(template) {\n const openTagIndex = template.indexOf('>') + 1;\n\n return template.substr(0, openTagIndex) + template.substr(openTagIndex);\n}\n\n/**\n * Returns the additional offset that should be scrolled depending on whether the navigation menu is sticky\n * @returns {number} Main navigation offset\n */\nfunction getNavOffset() {\n return hasClass(header, 'sticky') ? header.offsetHeight : 0;\n}\n\n/**\n * Function to attach form validation events\n */\nfunction attachFormEvents() {\n const quickViewFormSelector = '.product-quickview form';\n ajaxFormInvalid(quickViewFormSelector);\n ajaxFormSubmit(quickViewFormSelector);\n}\n\n/**\n * OOTB function with changes\n * replaces the content in the modal window on for the selected product variation.\n * @param {string} selectedValueUrl - url to be used to retrieve a new product model\n * @param {jQuery.event} event - Event object which trigger the action\n */\nfunction fillModalElement(selectedValueUrl, event) {\n const quickViewModal = $('#quickViewModal');\n const { initPopoverClose, initPopoverWishList } = require('../popover');\n\n $.spinner().start();\n\n getJSON(\n selectedValueUrl,\n 'GET',\n null,\n data => {\n const { quickviewProductInfo, earlyAccessDate } = data;\n var parsedHtml = parseHtml(data.renderedTemplate);\n\n if (quickViewModal) {\n quickViewModal.find('.modal-body').html(parsedHtml.body);\n quickViewModal.find('.size-chart').attr('href', data.productUrl);\n quickViewModal.find('.enter-message').text(data.enterDialogMessage);\n\n updateFullProductLink(data.quickViewFullDetailMsg, data.productUrl, quickViewModal);\n injectAfterpay(quickViewModal);\n injectFitPredictor(quickViewModal);\n initPopoverWishList();\n initPopoverClose();\n\n if (quickviewProductInfo) {\n window.quickviewProductInfo = quickviewProductInfo;\n const swatchEl = quickViewModal.find('.color-attribute .swatch-value');\n const selectedSwatchEl = quickViewModal.find('.color-attribute .swatch-value.selected');\n const sizeElements = quickViewModal.find('.size-btn');\n if (quickviewProductInfo && swatchEl.length && !selectedSwatchEl) {\n quickViewModal.find('.color-attribute').eq(0).click();\n }\n if (selectedSwatchEl && sizeElements.length === 1 && !sizeElements.hasClass('selected')) {\n sizeElements.click();\n }\n }\n\n quickViewModal.modal('show');\n if (earlyAccessDate) {\n const { isEarlyAccessElement } = require('./helper');\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccessDate);\n const quickViewContainer = queryFirst('.product-quickview');\n base.handleEarlyAccessCta(quickViewContainer, isEarlyAccessItem);\n const earlyAccessGuestSignIn = queryFirst('.js-early-access-sign-in-cta', quickViewContainer);\n earlyAccessGuestSignIn.addEventListener('click', e => {\n e.preventDefault();\n handleEarlyAccessLogin(earlyAccessGuestSignIn);\n quickViewModal.modal('hide');\n });\n }\n requestAnimationFrame(() => {\n $body.trigger('quickview:visible');\n });\n\n // Only for Gift card quickview attach form events\n if (data.gcType) {\n attachFormEvents();\n\n if (data.gcType === 'pgc' && queryFirst('.cart-page')) {\n const productLineItemEl = event.target.closest('.product-info-p-giftcard');\n // Return if the line item is not pgiftcard\n if (!productLineItemEl) {\n return;\n }\n\n const lineItemAmountEl = queryFirst('.gift-card-amount', productLineItemEl);\n if (lineItemAmountEl) {\n quickViewModal\n .find('.gift-card-custom-input-group .form-control')\n .val(lineItemAmountEl.value)\n .trigger('keyup');\n quickViewModal\n .find('.gift-card-amount')\n .val(lineItemAmountEl.value);\n }\n }\n }\n }\n\n $.spinner().stop();\n },\n () => $.spinner().stop()\n );\n}\n\n/**\n * Replaces the content in a quickview container with the template returned by the specified endpoint\n * @param {JQuery} container - jQuery element to inject HTML into\n * @param {string} url - URL of the endpoint that will return a rendered template\n * @param {JQuery} selectedProductDescriptionElement - jQuery element of selected product SEO long description\n */\nfunction injectQuickView(container, url, selectedProductDescriptionElement) {\n const spinner = $.spinner();\n const stopSpinner = () => { spinner.stop(); };\n\n const { initPopoverEarlyAccessLocked, initPopoverClose, initPopoverWishList } = require('../popover');\n spinner.start();\n\n getJSON(\n url,\n 'GET',\n null,\n data => {\n const { quickviewProductInfo, earlyAccessDate } = data;\n const parent = container.parent();\n const scrollHeight = parent.prop('scrollHeight');\n const scrollY = $window.scrollTop();\n const filledContainers = $('.quickview-container').not(container);\n let containerTop = container.offset().top;\n const isNewContainerBelow = !!filledContainers.length && !!filledContainers.filter((i, openContainer) => $(openContainer).offset().top < containerTop).length;\n\n filledContainers.remove();\n\n if (quickviewProductInfo) {\n window.quickviewProductInfo = quickviewProductInfo;\n }\n\n requestAnimationFrame(() => {\n containerTop = container.offset().top - getNavOffset();\n\n // If the target container is below an a container that's already injected,\n // the emptying of the existing container will cause the content to jump.\n // To offset this, we can scroll up by the difference in scrollHeight.\n if (isNewContainerBelow) {\n scrollTo(scrollY - (scrollHeight - parent.prop('scrollHeight')), 0);\n }\n\n // Modify the template returned by the endpoint so we can keep the OOTB code and\n // so that the OOTB template can be used in other implementation types (e.g. dialogs)\n container.html(modifyTemplate(data.renderedTemplate));\n const sizeElements = container.find('.size-btn');\n const swatchEl = container.find('.color-attribute .swatch-value');\n const selectedSwatchEl = container.find('.color-attribute .swatch-value.selected');\n if (quickviewProductInfo && swatchEl.length && !selectedSwatchEl) {\n container.find('.color-attribute').eq(0).click();\n }\n\n if (selectedSwatchEl && sizeElements.length === 1 && !sizeElements.hasClass('selected')) {\n sizeElements.click();\n }\n\n // Only for Gift card quickview attach form events\n if (data.gcType) {\n attachFormEvents();\n }\n\n updateFullProductLink(data.quickViewFullDetailMsg, data.productUrl, container);\n injectAfterpay(container);\n injectFitPredictor(container);\n injectLongDescription(selectedProductDescriptionElement, container);\n initPopoverWishList();\n initPopoverClose();\n\n stopSpinner();\n scrollTo(containerTop);\n\n requestAnimationFrame(() => {\n $body.trigger('quickview:visible');\n });\n\n const wishlistButton = queryFirst('.add-to-wish-list', container[0]);\n\n if (wishlistButton) {\n setTimeout(() => {\n wishlistButton.focus();\n }, 0);\n }\n if (earlyAccessDate) {\n const { isEarlyAccessElement } = require('./helper');\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccessDate);\n const quickViewContainer = queryFirst('.quickview-container');\n\n // attaching popover event to tooltip for AJAX call\n initPopoverEarlyAccessLocked();\n initPopoverClose();\n\n base.handleEarlyAccessCta(quickViewContainer, isEarlyAccessItem);\n const earlyAccessGuestSignIn = queryFirst('.js-early-access-sign-in-cta', quickViewContainer);\n earlyAccessGuestSignIn.addEventListener('click', e => {\n e.preventDefault();\n handleEarlyAccessLogin(earlyAccessGuestSignIn);\n });\n }\n });\n },\n stopSpinner\n );\n}\n\nlet $quickViewTriggerElement = null;\n\nfunction backFocusToTrigger() {\n if ($quickViewTriggerElement) {\n $quickViewTriggerElement.focus();\n $quickViewTriggerElement = null;\n }\n}\n\nmodule.exports = {\n showQuickview: () => {\n $body.on('click', '.product-grid .quickview', e => {\n e.preventDefault();\n\n const { target } = e;\n const $target = $(target);\n const container = $target.closest('.product-tile-container');\n const quickviewURL = $target.closest('.quickview').attr('data-href');\n const lastElementInRow = getLastElementInRow(container[0]);\n const quickviewContainer = $(quickViewTemplates.container).insertAfter(lastElementInRow);\n const seoLongDescriptionElement = $target.parents('.product-tile-container').find('.seo-long-description');\n\n injectQuickView(quickviewContainer, quickviewURL, seoLongDescriptionElement);\n\n $target.trigger('quickview:show');\n $quickViewTriggerElement = $target;\n });\n $body.on('click', `\n .recommendations-products .quickview,\n .product-listing .quickview,\n .shop-by-style .quickview,\n .style-component .quickview,\n .shop-the-print-tiles .quickview,\n .cart-page .product-edit .edit,\n .cart-page .bundle-edit .edit`, e => {\n e.preventDefault();\n const $target = $(e.target);\n getModalHtmlElement($target);\n const selectedValueUrl = $target.data('href');\n fillModalElement(selectedValueUrl, e);\n $target.trigger('quickview:show');\n $quickViewTriggerElement = $target;\n });\n\n $body.on('click', '.quickview-container .close-quickview', e => {\n const container = e.target.closest('.quickview-container');\n if (container) {\n const target = $(container).prev();\n const padding = parseInt(getStyles(container, 'padding-top'), 10);\n\n remove(container);\n $body.trigger('quickview:close');\n\n // Scroll back to the target row so the user doesn't lose their position\n scrollTo(target.offset().top - padding - getNavOffset(), 250);\n backFocusToTrigger(); // since it is not BP Modal we need to handle it separately\n } else {\n $('#quickViewModal').modal('hide');\n }\n });\n\n $body.on('click', '.product-quickview .notify-me-btn', function (e) {\n e.preventDefault();\n $(this).closest('.product-quickview').find('#notifyMe').modal('show');\n });\n },\n focusQuickview: function () {\n $body.on('shown.bs.modal', '#quickViewModal', function () {\n $('#quickViewModal .close-quickview').focus();\n });\n $body.on('hidden.bs.modal', '#quickViewModal', backFocusToTrigger);\n },\n trapQuickviewFocus: function () {\n $body.on('keydown', '.product-quickview', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '.product-quickview',\n firstElementSelector: '.close-quickview',\n lastElementSelector: '.full-pdp-link',\n nextToLastElementSelector: '.add-to-cart'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n availability: base.availability,\n addToCart: base.addToCart,\n showSpinner: function () {\n $body.on('product:beforeAddToCart', function (e, data) {\n $(data).closest('.product-quickview').spinner().start();\n });\n },\n sizeChart: detail.sizeChart,\n hideDialog: function () {\n $body.on('product:afterAddToCart', function () {\n $('#quickViewModal').modal('hide');\n\n const isCartPage = queryFirst('.cart-container');\n const addToCartWarningDialog = queryFirst('#add-to-cart-warning-dialog') || false;\n if (isCartPage && !addToCartWarningDialog) {\n location.reload();\n }\n });\n },\n beforeUpdateAttribute: function () {\n $body.on('product:beforeAttributeSelect', function () {\n $('.product-quickview').spinner().start();\n });\n },\n updateAttribute: function () {\n $body.on('product:afterAttributeSelect', function (e, response) {\n const quickView = response.container[0];\n\n if (hasClass(quickView, 'product-quickview')) {\n const { productDetailsUrl } = response.data.product;\n const fullPDPLink = queryFirst('.full-pdp-link', quickView);\n fullPDPLink.setAttribute('href', productDetailsUrl);\n\n updateSelectedSwatchProductName(response.data.product.variationAttributes, $(quickView));\n }\n });\n },\n updateAddToCart: function () {\n $body.on('product:updateAddToCart', function (e, response) {\n const quickView = queryFirst('.product-quickview');\n\n if (quickView) {\n const disabled = !response.product.readyToOrder || !response.product.available;\n\n let buttonToUpdate;\n const addToCartButton = queryFirst('button.add-to-cart', quickView);\n if (addToCartButton) {\n buttonToUpdate = addToCartButton;\n } else {\n const updateCartButton = queryFirst('.update-cart-product-global', quickView);\n if (updateCartButton) {\n buttonToUpdate = updateCartButton;\n }\n }\n\n if (buttonToUpdate) {\n if (disabled) {\n buttonToUpdate.setAttribute('disabled', disabled);\n } else {\n buttonToUpdate.removeAttribute('disabled');\n }\n }\n }\n });\n },\n updateAvailability: function () {\n $body.on('product:updateAvailability', function (e, response) {\n const quickView = queryFirst('.product-quickview');\n\n if (quickView) {\n $('.product-availability', response.$productContainer)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available)\n .find('.availability-msg')\n .empty()\n .html(response.message);\n }\n });\n }\n};\n","'use strict';\n\nconst { queryFirst } = require('../domUtil');\nconst { sauce } = require('fitpredictor/product/secretsauce');\n\n/**\n * Updates the product view when a product attribute is selected or deselected or when changing quantity\n * @param {Array} variationAttributes - Array of product variation attributes\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateSelectedSwatchProductName(variationAttributes, $productContainer) {\n if (Array.isArray(variationAttributes) && variationAttributes.length) {\n const colorVariationObject = variationAttributes.find(attribute => attribute.attributeId === 'color');\n\n if (colorVariationObject && Array.isArray(colorVariationObject.values) && colorVariationObject.values.length) {\n const selectedSwatchObject = colorVariationObject.values.find(eachValue => eachValue.selected);\n $productContainer.find('.selected-swatch-name').text(selectedSwatchObject ? selectedSwatchObject.displayValue : '');\n }\n }\n}\n\n/**\n * Function to initialize Fit predictor on quick view\n * @param {jQuery} containerEl - Quickview container element\n */\nfunction injectFitPredictor(containerEl) {\n if (!!document.getElementById('fitPredictorEnabled')) {\n sauce($('.product-detail.product-quickview', containerEl));\n }\n}\n\n/**\n * Initialize Afterpay in QuickViews\n */\nfunction injectAfterpay() {\n require('afterpay/afterpay')({\n anchors: '.product-quickview-detail',\n observerTargets: '.prices',\n priceTargets: ['.sales .price-value', '.list .price-value', '.sales .value'],\n renderMode: 'adjacent',\n renderTarget: '.prices',\n showExcluded: false\n });\n}\n\n/**\n * Function to sets href for full pdp link\n * @param {string} label - Label to set\n * @param {string} link - href value\n * @param {jQuery} containerEl - Parent DOM element\n */\nfunction updateFullProductLink(label, link, containerEl) {\n containerEl.find('.full-pdp-link').text(label).attr('href', link);\n}\n\n/**\n * Function to add long Description on quick view\n * @param {jQuery} description - Product Description getting DOM element\n * @param {jQuery} containerEl - Parent DOM element\n */\nfunction injectLongDescription(description, containerEl) {\n containerEl.find('.long-description').html(description.html());\n}\n\nexport default {\n updateSelectedSwatchProductName,\n injectAfterpay,\n injectFitPredictor,\n updateFullProductLink,\n injectLongDescription\n}\n","/**\n * HTML Templates for use in client-side rendering.\n *\n * @module dom.templates\n * @version 1.0.0\n */\n\n'use strict';\n\n/**\n * QuickView Templates\n */\nexports.quickView = {\n container: '
      ',\n quickViewModal: `\n
      \n \n
      \n
      \n
      \n
      \n
      \n
      \n `\n};\n\n/**\n * Get All Wishlist Collection Templates\n */\nexports.addToWishlist = {\n container: '
      ',\n addToWishlistModal: `\n
      \n \n
      \n
      \n
      \n \n
      \n
      \n
      \n
      \n
      \n \n\n `\n};\n\n/**\n * Cart error message template\n */\nexports.cart = {\n errorMessage: '

      {0}

      ',\n cartAvailabilityMessageOOS: (message, url) => (`\n
    9. ${message}\n Browse Similar Styles

      \n
    10. \n `),\n};\n\n/**\n * Cart & Checkout promo template\n */\nexports.promo = {\n shippingMethod: `\n
      \n
      \n

      \n {0}:{1}\n

      \n

      \n {3}\n

      \n
      \n
      \n

      \n {2}\n

      \n
      \n
      `,\n checkoutNormalShipping: '{0}',\n checkoutDiscountShipping: `\n {0}\n {1}\n `\n};\n\n/**\n * Checkout template\n */\nexports.checkout = {\n discountPrice: '{0}{1}'\n};\n\n/**\n * Selected swatch name template\n */\nexports.swatchNameTemplate = {\n swatchNameHtml: '

      Color: {0}

      '\n};\n\nexports.emptySwatchTemplate = '{0}';\n\n/*\n * Address Suggestions template\n */\nexports.addressSuggestions = {\n suggestionTextTemplate: '

      ',\n suggestionsTemplate: `\n
      \n
      \n \n \n
      \n
      `\n};\n\n/*\n * Approaching Discounts template\n */\nexports.approachingDiscounts = {\n discountContainerTemplate: '
        ',\n singleDiscountTemplate: '
      • {0}
      • ',\n multipleDiscountsTemplate: `\n
      • \n
        \n
        \n
          {0}
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
      • `,\n nonCouponBasedAdjustmentTemplate: `
        \n
        \n

        {0}

        \n

        \n {1}\n

        \n
        \n

        {2}

        \n
        `\n};\n\n/**\n * Video Template\n * @param {Object} options video setting values\n * @return {html} video html template\n */\nexports.videoTemplate = (options = {}) => {\n // Note: I don't believe this template is used anywhere anymore\n const { loop = '', videoUrl = '', imgUrl = '', classNames = '', autoplay = false, muted = true, controls = false, icontitle = '', icondesc = '' } = options;\n\n return `\n
        \n \n \n
        \n `;\n};\n\n/**\n * Image Template\n * @param {string} imgUrl value\n * @param {string} altText value\n * @param {string} classNames value\n * @return {html} video html template\n */\nexports.imageTemplate = (imgUrl, altText, classNames) => {\n return `\n
        \n \"${altText}\"/\n
        \n `;\n};\n\n/**\n * Size option template\n * @param {string} url - Size variant url\n * @param {string} value - Size value\n * @return {html} size option html template\n */\nexports.sizeOptionTemplate = (url, value) => {\n return ``;\n};\n\n/**\n * Function to rerender size button element\n * @param {Object} variantData - variant details\n * @param {string} ariaLabel - aria label\n * @param {string} ariaDescribedby - aria described by\n * @param {string} selectedText - selected text\n * @param {string} oosMessage - out of the stock text\n * @return {html} size button html template\n */\nexports.sizeButtonTemplate = (variantData, ariaLabel, ariaDescribedby, selectedText, oosMessage) => {\n const { selected, forceOutOfStock, inStock, value, url } = variantData;\n return `
      • \n \n ${selected ? selectedText : ''} ${!inStock || forceOutOfStock ? oosMessage : ''}\n
      • `;\n};\n\n/**\n * Function to render empty wishlist markup for guest user\n * @param {string} emptyWishlistMessage - empty wishlist message\n * @return {html} wishlist html template\n */\nexports.guestEmptyWishlistTemplate = (emptyWishlistMessage, emptyWishlistContentAssetBody) => {\n return `
        \n
        \n

        ${emptyWishlistMessage}

        \n ${emptyWishlistContentAssetBody}\n
        \n
        `;\n};\n\n/**\n * Function to render empty wishlist markup for guest user\n * @param {string} emptySFLMessage - empty SFL message\n * @param {string} continueShopURL - continue shopping URL\n * @param {string} continueShopMsg - continue shopping message\n * @param {string} signInMsg - sign In message\n * @param {string} signInSFLURL - sign in URL\n * @return {html} SFL html template\n */\nexports.emptySFL = (emptySFLMessage, continueShopURL, continueShopMsg, signInMsg, signInSFLURL) => {\n return `
        \n
        \n
        \n
        \n

        ${emptySFLMessage}

        \n ${signInMsg}\n \n ${continueShopMsg}
        \n
        \n
        \n
        \n
        `;\n};\n\n/**\n * GWP Site Templates\n */\nexports.gwpSizeTemplate = {\n singleSize: '{0}',\n multiSize: `\n
        \n \n \n
        \n `,\n multiDefaultSizeOption: '',\n multiSizeOption: ''\n};\n\n/**\n * Address autocomplete templates\n */\nexports.autoComplete = {\n suggestionLink: (suggestion, addressLine, secondaryEntryAddressLine) => (`\n 1}\"\n data-secondary-entry-search-value=\"${secondaryEntryAddressLine}\"\n >${addressLine}\n `),\n suggestionContainer: containerClass => (`
        `)\n};\n\nexports.contactUsTemplate = {\n signupError: (msg) => (`
        ${msg}
        `),\n defaultSignupError: `
        We're sorry, an unexpected error occurred. Please try again.
        `// eslint-disable-line quotes\n};\n\nexports.browserWarningTemplate = `\n We're sorry, this browser is no longer supported.
        \n Please update your browser for a smoother, more secure shopping experience. We recommend downloading the latest version of\n Google Chrome,\n Microsoft Edge or\n Mozilla Firefox.\n`;\n\n/*\n * Shipping preference radio buttons\n */\nexports.shippingPreferenceTemplates = {\n shippingPreferences: (ispuRadioLabel, ispuRadioValue, shipToRadioLabel, shipToRadioValue, changeStoreLabel, preferISPU = false) => (`\n
        \n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n \n
        \n
        \n
        \n
        \n
        \n `),\n storeDetail: (storeId, name, address1, city, stateCode, postalCode) => (`\n
        \n
        ${name}
        \n
        \n
        ${address1},\n ${city}, ${stateCode} ${postalCode}\n
        \n
        \n
        \n `)\n};\n\n/*\n * Product detail page - messaging templates\n */\nexports.productDetail = {\n selectStyleMessageTmpl: message => `
      • ${message}

      • `,\n availabilityMessageTmpl: message => `
      • ${message}

      • `,\n availabilityMessageOOS: (message, url) => (`\n
      • ${message}\n Browse Similar Styles

        \n
      • \n `),\n availabilityMessagePreorder: (message, url) => (`\n
      • \n

        ${message}

        \n Shop for Similar Styles
        \n
      • \n `),\n ispuSelectStyleMessageTmpl: message => `

        ${message}

        `,\n ispuAvailabilityMessageTmpl: message => `

        ${message}

        `,\n ispuLowStockMessageTmpl: message => `
      • ${message}

      • `,\n promotionMessageTmpl: (calloutMsg, details, index) => `
        \n
        \n
        \n ${calloutMsg}\n
        \n ` + ((details) ? `\n
        \n \n
        \n
        ${details}
        \n
        \n
        \n ` : '')\n + `
        \n
        `\n};\n\nexports.dialogTemplate = options => {\n const {\n buttons = [{ text: 'OK', primary: true, link: '' }],\n className = '',\n modalContentHeading = '',\n modalContentBody = '',\n id = 'dialog-' + Date.now(),\n slideOut = false\n } = options;\n\n const buttonSpace = Math.floor(12 / buttons.length);\n\n return `\n
        \n
        \n
        \n
        \n ${slideOut && modalContentHeading ? `

        ${modalContentHeading}

        ` : ''}\n \n
        \n ${!slideOut && modalContentHeading ? `

        ${modalContentHeading}

        ` : ''}\n
        ${modalContentBody}
        \n
        \n ${buttons.map(button => `\n
        \n ${button.link ?\n `${button.text}` :\n ``\n }\n
        `).join('')\n }\n
        \n
        \n
        \n
        \n `;\n};\n\nexports.errorTextTemplate = errorMessage => `

        ${errorMessage}

        `;\n\nexports.oneTrust = {\n privacyDialogCookieBanner: `\n \n `\n};\nexports.loyalty = {\n carouselBadge: '
        {0}
        '\n};\n\nexports.styliticsTemplates = {\n shopTheModelBadge: '

        As seen above

        '\n};\n\nexports.returnsPageTemplates = {\n defaultError: 'We're sorry, an unexpected error occurred. Please try again.',\n errorMessage: (message) => (`
        ${message}
        `)\n};\n\nexports.cyberSource = {\n secureAcceptanceTag: paymentType => `Secure Acceptance ${paymentType}`,\n boltPayPaymentTag: (paymentType, paymentLastFour, expMonth, expYear) => `\n
        ${paymentType}\n
        ${paymentLastFour}
        \n
        ${expMonth}/${expYear}
        `,\n paypalPaymentTag: (paypalMethod, paypalAmount) => `${paypalMethod}
        ${paypalAmount}
        `,\n creditCardPaymentTag: (cardType, creditCardType, maskedCardNumber, cardEndIn, cardExpMonth, cardExpYear) => `
        ${cardType} ${creditCardType}
        \n ${maskedCardNumber}
        ${cardEndIn} ${cardExpMonth}/${cardExpYear}
        `\n};\n\nexports.checkoutErrorTemplate = {\n checkoutErrorMsg: errorMsg => `
        \n ${errorMsg}\n
        `\n};\n","const { addClass, hasClass, queryFirst } = require('./domUtil');\n\n/**\n * Tokenize strings\n *\n * @param {string | Object} string Resource message that need to be tokenized\n * @param {string | Object} values Values that need to be replaced.\n * @param {string | Object} leftToken Left token type with default as {{\n * @param {string | Object} rightToken Right token type with defaulat as }}\n * @return {string} Updated string.\n */\nexports.tokenize = (string, values, leftToken = '{{', rightToken = '}}') => {\n if (typeof values !== 'object') return string;\n const operators = /([{}+.\\-!?[\\]])/g;\n return string.replace(new RegExp(leftToken.replace(operators, '\\\\$1') + '[\\\\r\\\\n\\\\s\\\\t]*([\\\\s\\\\S]+?)[\\\\r\\\\n\\\\s\\\\t]*' + rightToken.replace(operators, '\\\\$1'), 'igm'), (_, code) => {\n return values[code] || '';\n });\n};\n\n/**\n * Transforms all text to a kebab-case string.\n * @param {string} text - The text to transform\n * @returns {string} - The transformed string value\n * @example toKebabCase('.suggestions-related-products', ['.product-tile', '.link']) // suggestions-related-products-product-tile-link\n */\nconst toKebabCase = exports.toKebabCase = (...values) => values.map(value => {\n if (!Array.isArray(value)) value = [value];\n return value.map(text => typeof text === 'undefined' ? '' : String(text).toLowerCase().replace(/\\W/g, '-').trim()).join('-');\n}).join('-').replace(/-+/g, '-').replace(/^-+|-+$/g, '');\n\n/**\n * Transforms any input into a hash value.\n * @param {*} input - The input to transform\n * @returns {string} - The transformed string hash value\n * @example hashValue(function(a){ return a++; }) // 66756e6374696f6e2861297b2072657475726e20612b2b3b207d\n */\nexports.hashValue = input => {\n let value = JSON.stringify(String(input));\n\n if (value === '\"[object Object]\"') {\n // Sort the object first so hashes match despite key order\n value = JSON.stringify(Object.keys(input).sort().reduce((result, key) => {\n result[key] = input[key];\n return result;\n }, {}));\n }\n\n if (value.startsWith('\"') && value.endsWith('\"')) {\n value = value.substr(1, value.length - 2);\n }\n\n return value.split(\"\").map(digit => digit.charCodeAt(0).toString(16)).join('');\n};\n\n/**\n * Transforms all text to a valid dataset key.\n * @param {string} text - The text to transform\n * @returns {string} - The transformed string value\n * @example toDatasetKey('.suggestions-related-products', ['.product-tile', '.link']) // suggestionsRelatedProductsProductTileLink\n */\nexports.toDatasetKey = (...values) => toKebabCase(...values).split('-').map((text, index) => index === 0 ? text : text.charAt(0).toUpperCase() + text.substr(1)).join('');\n\n/**\n * Format dynamic resource messages.\n *\n * @param {string | Object} string Resource message that need to be tokenized\n * @param {string | Object} tokens Tokens that need to be replaced.\n * @return {string} Updated string.\n */\nexports.formatMessage = (string, ...tokens) => {\n return this.tokenize(\n string,\n tokens.reduce((result, item, index) => {\n result[index] = item;\n return result;\n }, {}),\n '{',\n '}'\n );\n};\n\n/**\n * Safely gets nested object properties. Returns the value if found, undefined if not found.\n * @param {*} obj The parent object in which the property exists\n * @param {*} keyString String denoting where in the parent object your target property should exist\n * @param {...any} replaceValues Values in the keyString to replace -- reference in the keyString with a number encapsulated in {} (e.g. {0}, {1}, etc)\n * @return {Object} returns nested object properties\n */\nexports.getNestedValue = function (obj, keyString, ...replaceValues) {\n const keys = keyString.split(/\\[|\\]|\\./).filter(el => el !== '');\n\n return keys.reduce((o, i) => (o || {})[/\\{\\d+\\}/.test(i) ? replaceValues[i.split(/\\{|\\}/)[1]] : i], obj);\n};\n\n/**\n * Ensures an event handler is only bound to an element once\n * @param {HTMLElement} element The element to bind the event to\n * @param {string} eventType The type of event\n * @param {function} handler The handler to execute when the event occurs, or the immediate callback if not defined\n * @param {string} initFlag The name of the flag to use for init\n */\nexports.initOnce = (element, eventType = '', handler, initFlag = '') => {\n const flag = 'init' + initFlag + eventType.toLowerCase();\n\n if (!element || element.dataset[flag]) return;\n\n element.dataset[flag] = true;\n if (eventType) {\n element.addEventListener(eventType, handler);\n } else {\n handler();\n }\n};\n\n/**\n * appends params to a url\n * @param {string} url - Original url\n * @param {Object} params - Parameters to append\n * @returns {string} result url with appended parameters\n */\nexports.appendToUrl = (url, params) => {\n let newUrl = url;\n newUrl +=\n (newUrl.indexOf('?') !== -1 ? '&' : '?') +\n Object.keys(params)\n .map(key => key + '=' + encodeURIComponent(params[key]))\n .join('&');\n\n return newUrl;\n};\n\n/**\n * This method performs an ajax call\n * @param {string} url endpoint url\n * @param {string} type ajax method type\n * @param {Object} data data for an ajax call\n * @param {function} onSuccess success call back function\n * @param {function} onError error call back function\n * @return {function} returns ajax function\n */\nexports.getJSON = (url, type, data = {}, onSuccess = function () { }, onError = function () { }) => {\n return $.ajax({\n url,\n type,\n dataType: 'json',\n data,\n success: onSuccess,\n error: onError\n });\n};\n\n/**\n * This method renders geo location\n * @param {function} successCallback Success callback function\n * @param {Object} mixin additional parameters\n * @param {function} errorCallback Error callback function\n */\nexports.geolocate = (successCallback, mixin = {}, errorCallback) => {\n if (!navigator.geolocation) return;\n const data = Object.assign({}, mixin);\n const successHandler = response => {\n const { coords } = response;\n if (coords) {\n const { latitude, longitude } = coords;\n data.latitude = latitude;\n data.longitude = longitude;\n }\n\n if (successCallback) {\n successCallback(data);\n }\n };\n const errorHandler = error => {\n if (errorCallback) {\n errorCallback(data);\n }\n };\n navigator.geolocation.getCurrentPosition(\n successHandler,\n errorHandler,\n {\n maximumAge: 0\n }\n );\n};\n\n/**\n * This method stores data in key-value pair into browser's localStorage\n * @param {string} key Identifier to be stored\n * @param {string | Object} value Value to be stored\n */\nexports.setItemInLocalStorage = function (key, value) {\n if (!window.localStorage || !key) {\n return;\n }\n\n localStorage.setItem(key, JSON.stringify(value));\n};\n\n/**\n * This method stores data into browser's localStorage\n * @param {string} key Identifier for retrieving the value\n * @return {string | Object | boolean} returns parsed value\n */\nexports.getItemFromLocalStorage = function (key) {\n if (!window.localStorage || !key) {\n return false;\n }\n\n const value = localStorage.getItem(key);\n\n if (!value) {\n return false;\n }\n\n return JSON.parse(value);\n};\n\n/**\n * This method removes data from browser's localStorage\n * @param {string} key Identifier\n */\nexports.removeItemFromLocalStorage = function (key) {\n if (!window.localStorage || !key) {\n return;\n }\n\n localStorage.removeItem(key);\n};\n\n/**\n * This method formats phone number\n * @param {HTMLElement} element - current element for which formatting should be one\n */\nexports.formatPhoneNumber = function (element) {\n function formatValue(numbers) {\n const char = { 0: '(', 3: ') ', 6: '-' };\n element.value = '';\n for (let i = 0, l = numbers.length; i < l; i++) {\n element.value += (char[i] || '') + numbers[i];\n }\n }\n if (!element) {\n return;\n }\n element.addEventListener('keypress', function () {\n const numbers = element.value.replace(/\\D/g, '');\n formatValue(numbers);\n });\n element.addEventListener('paste', function (event) {\n event.preventDefault();\n addClass(this, 'is-invalid');\n if (hasClass(event.target, 'is-invalid')) {\n const errorMessageElmParent = event.target.parentNode;\n const errorMessageElm = queryFirst('.invalid-feedback', errorMessageElmParent);\n errorMessageElm.textContent = event.target.dataset.patternMismatch;\n }\n });\n element.addEventListener('input', function () {\n const numbers = element.value.replace(/\\D/g, '');\n formatValue(numbers);\n });\n};\n\n/**\n * @function\n * @desc Determines if the device that is being used is mobile\n * @returns {Boolean}\n */\nexports.isMobile = function () {\n const mobileAgentHash = ['mobile', 'tablet', 'phone', 'ipad', 'ipod', 'android', 'blackberry', 'windows ce', 'opera mini', 'palm'];\n let idx = 0;\n let isMobile = false;\n const userAgent = navigator.userAgent.toLowerCase();\n\n while (mobileAgentHash[idx] && !isMobile) {\n isMobile = userAgent.indexOf(mobileAgentHash[idx]) >= 0;\n idx++;\n }\n return isMobile;\n};\n\n/**\n * @function\n * @desc Fixes position sticky scrolling behavior for elements with greater height than widnow height. Ensures content is scrollable above the fold\n * @param {Array} items - items to set scroll height position\n */\nexports.stickyScrollPosition = items => {\n const $window = $(window);\n const handleStickyPositionOnScroll = item => {\n let ticking = false;\n const detailStickyScroll = () => {\n ticking = false;\n const itemHeight = item.getBoundingClientRect().height;\n const windowHeight = window.innerHeight;\n const newTop = itemHeight - windowHeight + 95;\n\n if (itemHeight > windowHeight - 95) {\n item.style.top = `${-newTop}px`;\n } else {\n item.style.top = '100px';\n }\n };\n const requestTick = () => {\n if (!ticking) {\n requestAnimationFrame(detailStickyScroll);\n }\n ticking = true;\n };\n const onScroll = () => {\n requestTick(item);\n };\n $window.scroll(onScroll);\n };\n\n items.forEach(item => {\n handleStickyPositionOnScroll(item);\n });\n};\n\n/**\n * Determines whether the user is browsing with an old/unsupported browser.\n * @returns {boolean} True if the browser is old/unsupported.\n */\nexports.isUnsupportedBrowser = () => {\n const { userAgent } = navigator;\n const sitePrefs = document.getElementById('site-prefs');\n\n if (!sitePrefs) return false;\n\n let unsupportedBrowserTypes;\n\n if (sitePrefs.dataset) {\n ({ unsupportedBrowserTypes } = sitePrefs.dataset);\n } else {\n // For old IE\n unsupportedBrowserTypes = sitePrefs.getAttribute('data-unsupported-browser-types');\n }\n\n return JSON.parse(unsupportedBrowserTypes).some(function (uaFragment) {\n return ~userAgent.indexOf(uaFragment);\n });\n};\n\n/**\n * Get remaining time object for given time string \n * @param {string} endtime - remaining time string comes as parameter\n * @return {Object} remainTimeObject - Date Object with day, hours, minutes, Sec\n */\nexports.getTimeRemaining = (endtime) => {\n const total = Date.parse(endtime) - Date.now();\n const seconds = Math.floor((total / 1000) % 60).toString();\n const minutes = Math.floor((total / 1000 / 60) % 60).toString();\n const hours = Math.floor((total / (1000 * 60 * 60)) % 24).toString();\n const days = Math.floor(total / (1000 * 60 * 60 * 24));\n\n return {\n total,\n days,\n hours,\n minutes,\n seconds\n };\n};\n\n/**\n * Checks if an email value is in the correct format for Bolt.\n * Note that this does not meet LP's standards for email validation\n * @param {string} email - email string to check if valid\n * @returns {boolean} Whether email is valid\n */\nexports.validateEmailBolt = email => /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/.test(email);\n","'use strict';\nconst { HIDDEN_CLASS } = require('../constants');\nconst { removeClass, queryFirst, addClass } = require('../domUtil');\n\n/**\n * Show strike heart\n * @param {Element} productContainer product container with hearts\n */\nfunction showStrikeHearts(productContainer) {\n removeClass(queryFirst('.wishlist-strike', productContainer), HIDDEN_CLASS);\n addClass(queryFirst('.wishlist-add-update', productContainer), HIDDEN_CLASS);\n}\n\n/**\n * Hide strike heart\n * @param {Element} productContainer product container with hearts\n */\nfunction hideStrikeHearts(productContainer) {\n addClass(queryFirst('.wishlist-strike', productContainer), HIDDEN_CLASS);\n removeClass(queryFirst('.wishlist-add-update', productContainer), HIDDEN_CLASS);\n}\n\n/**\n * Update wishlists data attribute to theirs product ID\n * @param {string} id product ID string\n * @param {string | Object} container Parent element, if it not provided\n */\nfunction setWishlistProductId(id, container = document.body) {\n if (id) {\n const wishlistBtn = queryFirst('.wishlist-add-update button', container);\n const wishlistStrikeBtn = queryFirst('.wishlist-strike button', container);\n\n if (wishlistBtn) wishlistBtn.dataset.productId = id;\n if (wishlistStrikeBtn) wishlistStrikeBtn.dataset.productId = id;\n }\n}\nmodule.exports = {\n hideStrikeHearts: hideStrikeHearts,\n showStrikeHearts: showStrikeHearts,\n setWishlistProductId: setWishlistProductId\n};\n","'use strict';\n\nvar storeLocator = require('base/storeLocator/storeLocator');\n\n/**\n * Restores Quantity Selector to its original state.\n * @param {HTMLElement} $quantitySelect - The Quantity Select Element\n */\nfunction restoreQuantityOptions($quantitySelect) {\n var originalHTML = $quantitySelect.data('originalHTML');\n if (originalHTML) {\n $quantitySelect.html(originalHTML);\n }\n}\n\n/**\n * Sets the data attribute of Quantity Selector to save its original state.\n * @param {HTMLElement} $quantitySelect - The Quantity Select Element\n */\nfunction setOriginalQuantitySelect($quantitySelect) {\n if (!$quantitySelect.data('originalHTML')) {\n $quantitySelect.data('originalHTML', $quantitySelect.html());\n } // If it's already there, don't re-set it\n}\n\n/**\n * Updates the Quantity Selector based on the In Store Quantity.\n * @param {string} quantitySelector - Quantity Selector\n * @param {string} quantityOptionSelector - Quantity Option Selector\n * @param {number} productAtsValue - Inventory in the selected store\n */\nfunction updateQOptions(quantitySelector, quantityOptionSelector, productAtsValue) {\n var selectedQuantity = $(quantitySelector).val();\n restoreQuantityOptions($(quantitySelector));\n for (var i = $(quantityOptionSelector).length - 1; i >= productAtsValue; i--) {\n $(quantityOptionSelector).eq(i).remove();\n }\n $(quantitySelector + ' option[value=\"' + selectedQuantity + '\"]').attr('selected', 'selected');\n}\n\n/**\n * Generates the modal window on the first call.\n */\nfunction getModalHtmlElement() {\n if ($('#inStoreInventoryModal').length !== 0) {\n $('#inStoreInventoryModal').remove();\n }\n var htmlString = ''\n + '
        '\n + '
        '\n + ''\n + '
        '\n + '
        '\n + ' '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        ';\n $('body').append(htmlString);\n $('#inStoreInventoryModal').modal('show');\n}\n\n/**\n * Replaces the content in the modal window with find stores components and\n * the result store list.\n * @param {string} pid - The product ID to search for\n * @param {number} quantity - Number of products to search inventory for\n * @param {number} selectedPostalCode - The postal code to search for inventory\n * @param {number} selectedRadius - The radius to search for inventory\n */\nfunction fillModalElement(pid, quantity, selectedPostalCode, selectedRadius) {\n var requestData = {\n products: pid + ':' + quantity\n };\n\n if (selectedRadius) {\n requestData.radius = selectedRadius;\n }\n\n if (selectedPostalCode) {\n requestData.postalCode = selectedPostalCode;\n }\n\n $('#inStoreInventoryModal').spinner().start();\n $.ajax({\n url: $('.btn-get-in-store-inventory').data('action-url'),\n data: requestData,\n method: 'GET',\n success: function (response) {\n $('.modal-body').empty();\n $('.modal-body').html(response.storesResultsHtml);\n storeLocator.search();\n storeLocator.changeRadius();\n storeLocator.selectStore();\n storeLocator.updateSelectStoreButton();\n\n $('.btn-storelocator-search').attr('data-search-pid', pid);\n\n if (selectedRadius) {\n $('#radius').val(selectedRadius);\n }\n\n if (selectedPostalCode) {\n $('#store-postal-code').val(selectedPostalCode);\n }\n\n if (!$('.results').data('has-results')) {\n $('.store-locator-no-results').show();\n }\n\n $('#inStoreInventoryModal').modal('show');\n $('#inStoreInventoryModal').spinner().stop();\n },\n error: function () {\n $('#inStoreInventoryModal').spinner().stop();\n }\n });\n}\n\n/**\n * Remove the selected store.\n * @param {HTMLElement} $container - the target html element\n */\nfunction deselectStore($container) {\n var storeElement = $($container).find('.selected-store-with-inventory');\n $(storeElement).find('.card-body').empty();\n $(storeElement).addClass('display-none');\n $($container).find('.btn-get-in-store-inventory').show();\n $($container).find('.quantity-select').removeData('originalHTML');\n}\n\n/**\n * Update quantity options. Only display quantity options that are available for the store.\n * @param {sring} searchPID - The product ID of the selected product.\n * @param {number} storeId - The store ID selected for in store pickup.\n */\nfunction updateQuantityOptions(searchPID, storeId) {\n var selectorPrefix = '.product-detail[data-pid=\"' + searchPID + '\"]';\n var productIdSelector = selectorPrefix + ' .product-id';\n var quantitySelector = selectorPrefix + ' .quantity-select';\n var quantityOptionSelector = quantitySelector + ' option';\n\n setOriginalQuantitySelect($(quantitySelector));\n\n var requestData = {\n pid: $(productIdSelector).text(),\n quantitySelected: $(quantitySelector).val(),\n storeId: storeId\n };\n\n $.ajax({\n url: $('.btn-get-in-store-inventory').data('ats-action-url'),\n data: requestData,\n method: 'GET',\n success: function (response) {\n // Update Quantity dropdown, Remove quantity greater than inventory\n var productAtsValue = response.atsValue;\n var availabilityValue = '';\n\n var $productContainer = $('.product-detail[data-pid=\"' + searchPID + '\"]');\n\n if (!response.product.readyToOrder) {\n availabilityValue = '
        ' + response.resources.info_selectforstock + '
        ';\n } else {\n response.product.messages.forEach(function (message) {\n availabilityValue += '
        ' + message + '
        ';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n\n $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n product: response.product, $productContainer: $productContainer\n });\n\n updateQOptions(quantitySelector, quantityOptionSelector, productAtsValue);\n }\n });\n}\n\nmodule.exports = {\n updateSelectStore: function () {\n $('body').on('product:updateAddToCart', function (e, response) {\n $('.btn-get-in-store-inventory', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available ||\n !response.product.availableForInStorePickup));\n });\n },\n removeSelectedStoreOnAttributeChange: function () {\n $('body').on('product:afterAttributeSelect', function (e, response) {\n response.container.attr('data-pid', response.data.product.id);\n deselectStore(response.container);\n });\n },\n updateAddToCartFormData: function () {\n $('body').on('updateAddToCartFormData', function (e, form) {\n if (form.pidsObj) {\n var pidsObj = JSON.parse(form.pidsObj);\n pidsObj.forEach(function (product) {\n var storeElement = $('.product-detail[data-pid=\"' +\n product.pid\n + '\"]').find('.store-name');\n product.storeId = $(storeElement).length// eslint-disable-line no-param-reassign\n ? $(storeElement).attr('data-store-id')\n : null;\n });\n\n form.pidsObj = JSON.stringify(pidsObj);// eslint-disable-line no-param-reassign\n }\n\n var storeElement = $('.product-detail[data-pid=\"'\n + form.pid\n + '\"]');\n\n if ($(storeElement).length) {\n form.storeId = $(storeElement).find('.store-name') // eslint-disable-line\n .attr('data-store-id');\n }\n });\n },\n showInStoreInventory: function () {\n $('.btn-get-in-store-inventory').on('click', function (e) {\n var pid = $(this).closest('.product-detail').attr('data-pid');\n var quantity = $(this).closest('.product-detail').find('.quantity-select').val();\n getModalHtmlElement();\n fillModalElement(pid, quantity);\n e.stopPropagation();\n });\n },\n removeStoreSelection: function () {\n $('body').on('click', '#remove-store-selection', (function () {\n deselectStore($(this).closest('.product-detail'));\n $(document).trigger('store:afterRemoveStoreSelection', $(this).closest('.product-detail').find('.quantity-select'));\n }));\n },\n selectStoreWithInventory: function () {\n $('body').on('store:selected', function (e, data) {\n var searchPID = $('.btn-storelocator-search').attr('data-search-pid');\n var storeElement = $('.product-detail[data-pid=\"' + searchPID + '\"]');\n $(storeElement).find('.selected-store-with-inventory .card-body').empty();\n $(storeElement).find('.selected-store-with-inventory .card-body').append(data.storeDetailsHtml);\n $(storeElement).find('.store-name').attr('data-store-id', data.storeID);\n $(storeElement).find('.selected-store-with-inventory').removeClass('display-none');\n\n var $changeStoreButton = $(storeElement).find('.change-store');\n $($changeStoreButton).data('postal', data.searchPostalCode);\n $($changeStoreButton).data('radius', data.searchRadius);\n\n $(storeElement).find('.btn-get-in-store-inventory').hide();\n\n updateQuantityOptions(searchPID, data.storeID);\n\n $('#inStoreInventoryModal').modal('hide');\n $('#inStoreInventoryModal').remove();\n });\n },\n changeStore: function () {\n $('body').on('click', '.change-store', (function () {\n var pid = $(this).closest('.product-detail').attr('data-pid');\n var quantity = $(this).closest('.product-detail').find('.quantity-select').val();\n getModalHtmlElement();\n fillModalElement(pid, quantity, $(this).data('postal'), $(this).data('radius'));\n }));\n }\n};\n","'use strict';\n\nvar scrollAnimate = require('../components/scrollAnimate');\n\n/**\n * Display error messages and highlight form fields with errors.\n * @param {string} parentSelector - the form which contains the fields\n * @param {Object} fieldErrors - the fields with errors\n */\nfunction loadFormErrors(parentSelector, fieldErrors) { // eslint-disable-line\n // Display error messages and highlight form fields with errors.\n $.each(fieldErrors, function (attr) {\n $('*[name=' + attr + ']', parentSelector)\n .addClass('is-invalid')\n .siblings('.invalid-feedback')\n .html(fieldErrors[attr]);\n });\n // Animate to top of form that has errors\n scrollAnimate($(parentSelector));\n}\n\n/**\n * Clear the form errors.\n * @param {string} parentSelector - the parent form selector.\n */\nfunction clearPreviousErrors(parentSelector) {\n $(parentSelector).find('.form-control.is-invalid').removeClass('is-invalid');\n $('.error-message').hide();\n}\n\nmodule.exports = {\n loadFormErrors: loadFormErrors,\n clearPreviousErrors: clearPreviousErrors\n};\n","'use strict';\n\nmodule.exports = function (element, message) {\n var errorHtml = '
        ' +\n '' + message + '
        ';\n\n $(element).append(errorHtml);\n};\n","'use strict';\n\nmodule.exports = {\n setTabNextFocus: function (focusParams) {\n var KEYCODE_TAB = 9;\n var isTabPressed = (focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB);\n\n if (!isTabPressed) {\n return;\n }\n\n var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector);\n var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector);\n\n if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) {\n lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector);\n if ($('.product-quickview.product-set').length > 0) {\n var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons');\n lastFocusableEl = linkElements[linkElements.length - 1];\n }\n }\n\n if (focusParams.event.shiftKey) /* shift + tab */ {\n if ($(':focus').is(firstFocusableEl)) {\n lastFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n } else /* tab */ {\n if ($(':focus').is(lastFocusableEl)) { // eslint-disable-line\n firstFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n }\n }\n};\n","'use strict';\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n var feedbackElement = $(formElement).find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('
        '));\n } else {\n feedbackElement.html(payload.fields[key]);\n }\n feedbackElement.siblings('.form-control').addClass('is-invalid');\n }\n }\n });\n }\n if (payload && payload.error) {\n var form = $(formElement).prop('tagName') === 'FORM'\n ? $(formElement)\n : $(formElement).parents('form');\n\n form.prepend('
        '\n + payload.error.join('
        ') + '
        ');\n }\n};\n","'use strict';\n\nmodule.exports = function (element) {\n var position = element && element.length ? element.offset().top : 0;\n $('html, body').animate({\n scrollTop: position\n }, 500);\n if (!element) {\n $('.logo-home').focus();\n }\n};\n","'use strict';\n\nvar formValidation = require('../components/formValidation');\nvar createErrorNotification = require('../components/errorNotification');\n\nmodule.exports = {\n login: function () {\n $('form.login').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('form.login').trigger('login:submit', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n $('form.login').trigger('login:error', data);\n } else {\n $('form.login').trigger('login:success', data);\n location.href = data.redirectUrl;\n }\n },\n error: function (data) {\n if (data.responseJSON.redirectUrl) {\n window.location.href = data.responseJSON.redirectUrl;\n } else {\n $('form.login').trigger('login:error', data);\n form.spinner().stop();\n }\n }\n });\n return false;\n });\n },\n\n register: function () {\n $('form.registration').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('form.registration').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n $('form.registration').trigger('login:register:error', data);\n formValidation(form, data);\n } else {\n $('form.registration').trigger('login:register:success', data);\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification($('.error-messaging'), err.responseJSON.errorMessage);\n }\n\n form.spinner().stop();\n }\n });\n return false;\n });\n },\n\n resetPassword: function () {\n $('.reset-password-form').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('.reset-password-form').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n } else {\n $('.request-password-title').text(data.receivedMsgHeading);\n $('.request-password-body').empty()\n .append('

        ' + data.receivedMsgBody + '

        ');\n if (!data.mobile) {\n $('#submitEmailButton').text(data.buttonText)\n .attr('data-dismiss', 'modal');\n } else {\n $('.send-email-btn').empty()\n .html(''\n + data.buttonText + ''\n );\n }\n }\n },\n error: function () {\n form.spinner().stop();\n }\n });\n return false;\n });\n },\n\n clearResetForm: function () {\n $('#login .modal').on('hidden.bs.modal', function () {\n $('#reset-password-email').val('');\n $('.modal-dialog .form-control.is-invalid').removeClass('is-invalid');\n });\n }\n};\n","/* globals google */\n'use strict';\n\n/**\n * appends params to a url\n * @param {string} url - Original url\n * @param {Object} params - Parameters to append\n * @returns {string} result url with appended parameters\n */\nfunction appendToUrl(url, params) {\n var newUrl = url;\n newUrl += (newUrl.indexOf('?') !== -1 ? '&' : '?') + Object.keys(params).map(function (key) {\n return key + '=' + encodeURIComponent(params[key]);\n }).join('&');\n\n return newUrl;\n}\n\n/**\n * Uses google maps api to render a map\n */\nfunction maps() {\n var map;\n var infowindow = new google.maps.InfoWindow();\n\n // Init U.S. Map in the center of the viewport\n var latlng = new google.maps.LatLng(37.09024, -95.712891);\n var mapOptions = {\n scrollwheel: false,\n zoom: 4,\n center: latlng\n };\n\n map = new google.maps.Map($('.map-canvas')[0], mapOptions);\n var mapdiv = $('.map-canvas').attr('data-locations');\n\n mapdiv = JSON.parse(mapdiv);\n\n var bounds = new google.maps.LatLngBounds();\n\n // Customized google map marker icon with svg format\n var markerImg = {\n path: 'M13.5,30.1460153 L16.8554555,25.5 L20.0024287,25.5 C23.039087,25.5 25.5,' +\n '23.0388955 25.5,20.0024287 L25.5,5.99757128 C25.5,2.96091298 23.0388955,0.5 ' +\n '20.0024287,0.5 L5.99757128,0.5 C2.96091298,0.5 0.5,2.96110446 0.5,5.99757128 ' +\n 'L0.5,20.0024287 C0.5,23.039087 2.96110446,25.5 5.99757128,25.5 L10.1445445,' +\n '25.5 L13.5,30.1460153 Z',\n fillColor: '#0070d2',\n fillOpacity: 1,\n scale: 1.1,\n strokeColor: 'white',\n strokeWeight: 1,\n anchor: new google.maps.Point(13, 30),\n labelOrigin: new google.maps.Point(12, 12)\n };\n\n Object.keys(mapdiv).forEach(function (key) {\n var item = mapdiv[key];\n var lable = parseInt(key, 10) + 1;\n var storeLocation = new google.maps.LatLng(item.latitude, item.longitude);\n var marker = new google.maps.Marker({\n position: storeLocation,\n map: map,\n title: item.name,\n icon: markerImg,\n label: { text: lable.toString(), color: 'white', fontSize: '16px' }\n });\n\n marker.addListener('click', function () {\n infowindow.setOptions({\n content: item.infoWindowHtml\n });\n infowindow.open(map, marker);\n });\n\n // Create a minimum bound based on a set of storeLocations\n bounds.extend(marker.position);\n });\n // Fit the all the store marks in the center of a minimum bounds when any store has been found.\n if (mapdiv && mapdiv.length !== 0) {\n map.fitBounds(bounds);\n }\n}\n\n/**\n * Renders the results of the search and updates the map\n * @param {Object} data - Response from the server\n */\nfunction updateStoresResults(data) {\n var $resultsDiv = $('.results');\n var $mapDiv = $('.map-canvas');\n var hasResults = data.stores.length > 0;\n\n if (!hasResults) {\n $('.store-locator-no-results').show();\n } else {\n $('.store-locator-no-results').hide();\n }\n\n $resultsDiv.empty()\n .data('has-results', hasResults)\n .data('radius', data.radius)\n .data('search-key', data.searchKey);\n\n $mapDiv.attr('data-locations', data.locations);\n\n if ($mapDiv.data('has-google-api')) {\n maps();\n } else {\n $('.store-locator-no-apiKey').show();\n }\n\n if (data.storesResultsHtml) {\n $resultsDiv.append(data.storesResultsHtml);\n }\n}\n\n/**\n * Search for stores with new zip code\n * @param {HTMLElement} element - the target html element\n * @returns {boolean} false to prevent default event\n */\nfunction search(element) {\n var dialog = element.closest('.in-store-inventory-dialog');\n var spinner = dialog.length ? dialog.spinner() : $.spinner();\n spinner.start();\n var $form = element.closest('.store-locator');\n var radius = $('.results').data('radius');\n var url = $form.attr('action');\n var urlParams = { radius: radius };\n\n var payload = $form.is('form') ? $form.serialize() : { postalCode: $form.find('[name=\"postalCode\"]').val() };\n\n url = appendToUrl(url, urlParams);\n\n $.ajax({\n url: url,\n type: $form.attr('method'),\n data: payload,\n dataType: 'json',\n success: function (data) {\n spinner.stop();\n updateStoresResults(data);\n $('.select-store').prop('disabled', true);\n }\n });\n return false;\n}\n\nmodule.exports = {\n init: function () {\n if ($('.map-canvas').data('has-google-api')) {\n maps();\n } else {\n $('.store-locator-no-apiKey').show();\n }\n\n if (!$('.results').data('has-results')) {\n $('.store-locator-no-results').show();\n }\n },\n\n detectLocation: function () {\n // clicking on detect location.\n $('.detect-location').on('click', function () {\n $.spinner().start();\n if (!navigator.geolocation) {\n $.spinner().stop();\n return;\n }\n\n navigator.geolocation.getCurrentPosition(function (position) {\n var $detectLocationButton = $('.detect-location');\n var url = $detectLocationButton.data('action');\n var radius = $('.results').data('radius');\n var urlParams = {\n radius: radius,\n lat: position.coords.latitude,\n long: position.coords.longitude\n };\n\n url = appendToUrl(url, urlParams);\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $.spinner().stop();\n updateStoresResults(data);\n $('.select-store').prop('disabled', true);\n }\n });\n });\n });\n },\n\n search: function () {\n $('.store-locator-container form.store-locator').submit(function (e) {\n e.preventDefault();\n search($(this));\n });\n $('.store-locator-container .btn-storelocator-search[type=\"button\"]').click(function (e) {\n e.preventDefault();\n search($(this));\n });\n },\n\n changeRadius: function () {\n $('.store-locator-container .radius').change(function () {\n var radius = $(this).val();\n var searchKeys = $('.results').data('search-key');\n var url = $(this).data('action-url');\n var urlParams = {};\n\n if (searchKeys.postalCode) {\n urlParams = {\n radius: radius,\n postalCode: searchKeys.postalCode\n };\n } else if (searchKeys.lat && searchKeys.long) {\n urlParams = {\n radius: radius,\n lat: searchKeys.lat,\n long: searchKeys.long\n };\n }\n\n url = appendToUrl(url, urlParams);\n var dialog = $(this).closest('.in-store-inventory-dialog');\n var spinner = dialog.length ? dialog.spinner() : $.spinner();\n spinner.start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n spinner.stop();\n updateStoresResults(data);\n $('.select-store').prop('disabled', true);\n }\n });\n });\n },\n selectStore: function () {\n $('.store-locator-container').on('click', '.select-store', (function (e) {\n e.preventDefault();\n var selectedStore = $(':checked', '.results-card .results');\n var data = {\n storeID: selectedStore.val(),\n searchRadius: $('#radius').val(),\n searchPostalCode: $('.results').data('search-key').postalCode,\n storeDetailsHtml: selectedStore.siblings('label').find('.store-details').html(),\n event: e\n };\n\n $('body').trigger('store:selected', data);\n }));\n },\n updateSelectStoreButton: function () {\n $('body').on('change', '.select-store-input', (function () {\n $('.select-store').prop('disabled', false);\n }));\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar 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\tvar 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","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","'use strict';\n\nimport quickView from './quickView';\n\nexport default {\n showQuickview: quickView.showQuickview,\n focusQuickview: quickView.focusQuickview,\n trapQuickviewFocus: quickView.trapQuickviewFocus,\n hideDialog: quickView.hideDialog,\n updateAttribute: quickView.updateAttribute,\n updateAddToCart: quickView.updateAddToCart,\n updateAvailability: quickView.updateAvailability\n};\n","'use strict';\n\nimport { queryFirst, addClass, removeClass } from '../domUtil';\nimport { getJSON } from '../util';\n\nconst $body = $('body');\nconst hiddenClass = 'd-none';\n\nexport default {\n validateEmail: function () {\n $body.on('blur', '.notify-email', e => {\n const { target } = e;\n const { value } = target;\n const emailFormGroup = target.closest('.form-group');\n const emailError = queryFirst('.email-error', emailFormGroup);\n const { missingError, patternMismatch } = target.dataset;\n const invalidClass = 'is-invalid';\n if (!value) {\n addClass(target, invalidClass);\n emailError.textContent = missingError;\n } else if (target.checkValidity && !target.checkValidity()) {\n addClass(target, invalidClass);\n emailError.textContent = patternMismatch;\n } else {\n removeClass(target, invalidClass);\n }\n });\n },\n notifyMeSubmit: function () {\n $body.on('submit', '.js-notify-form', e => {\n e.preventDefault();\n const { target } = e;\n const actionUrl = target.getAttribute('action');\n const data = {\n productID: queryFirst('#notifySku').value,\n email: queryFirst('.notify-email').value,\n subscribe: document.getElementById('notify-checkbox').checked\n };\n const $notifyMe = $('#notifyMe');\n $notifyMe.spinner().start();\n getJSON(actionUrl, 'POST', data, (data) => {\n const confirmMessage = data.message;\n addClass(queryFirst('.notify-me-container .js-notify-me-desc'), hiddenClass);\n addClass(queryFirst('.js-notify-form'), hiddenClass);\n const successMessage = queryFirst('.js-notify-confirm-msg');\n successMessage.innerHTML = confirmMessage;\n removeClass(queryFirst('.js-notify-confirm-block'), hiddenClass);\n removeClass(queryFirst('.footer-close-link'), hiddenClass);\n $notifyMe.spinner().stop();\n }, () => {\n $notifyMe.spinner().stop();\n });\n });\n },\n notifyMeContainerSubmit: function () {\n $body.on('submit', '.js-notify-form-inline', e => {\n e.preventDefault();\n const { target } = e;\n const actionUrl = target.getAttribute('action');\n const data = {\n productID: queryFirst('#notifySku', target).value,\n email: queryFirst('#emailInput', target).value,\n subscribe: queryFirst('#notify-checkbox', target).checked\n };\n const $container = $('.js-notify-me-container');\n $container.spinner().start();\n getJSON(actionUrl, 'POST', data, (data) => {\n $container.spinner().stop();\n const notifyMeContainer = queryFirst('.js-notify-me-container');\n const notifyConfirm = queryFirst('.js-notify-confirm-msg', notifyMeContainer);\n if (data.message && notifyConfirm) notifyConfirm.innerHTML = data.message;\n\n if (data.sucess !== 'error') {\n const productName = notifyMeContainer.getAttribute('data-nm-p-name');\n const productColor = queryFirst('.selected-swatch-name').textContent;\n const productSize = queryFirst('.size-accordion .details-text').textContent;\n\n const pNameEl = queryFirst('.js-notifyme-name', notifyMeContainer);\n pNameEl.textContent = productName;\n\n if (productColor) {\n const pColorEl = queryFirst('.js-notifyme-color', notifyMeContainer);\n pColorEl.textContent = productColor;\n }\n if (productSize) {\n const pSizeEl = queryFirst('.js-notifyme-size', notifyMeContainer);\n pSizeEl.textContent = productSize;\n }\n }\n\n addClass(queryFirst('.js-notify-form-inline', notifyMeContainer), hiddenClass);\n removeClass(queryFirst('.js-confirmed-block', notifyMeContainer), hiddenClass);\n queryFirst('.js-close-notifyme').focus();\n }, () => {\n $container.spinner().stop();\n });\n });\n },\n closeNotifyMeForm: function () {\n $body.on('click', '.js-close-notifyme', e => {\n e.preventDefault();\n addClass(queryFirst('.js-confirmed-block'), hiddenClass);\n removeClass(queryFirst('.js-notify-form-inline'), hiddenClass);\n });\n },\n preSelectNotifyCheckbox: function () {\n $body.on('shown.bs.modal', '#notifyMe', function (e) {\n // pre-select notifyMe checkbox after modal is opened\n const notifyMeId = queryFirst('#notify-checkbox', e.currentTarget);\n if (notifyMeId && !notifyMeId.checked) notifyMeId.checked = true;\n });\n }\n};\n","'use strict';\n\nimport { matchesBreakpoint, queryFirst, queryAll } from './domUtil';\nimport { stickyScrollPosition } from './util';\nimport { sauce } from 'fitpredictor/product/secretsauce';\nimport detail from './product/detail';\nimport pdpQuickView from './product/pdpQuickView';\nimport notifyMe from './components/notifyMe';\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./components/shippingPreference'));\n processInclude(detail);\n processInclude(notifyMe);\n processInclude(require('./components/imageSlider'));\n processInclude(require('./components/pickUpInStore'));\n processInclude(require('instore/product/pdpInstoreInventory'));\n if (!!queryFirst('#fitPredictorEnabled')) {\n sauce($('.product-detail.product-wrapper'));\n }\n processInclude(require('./product/monogram'));\n const pdpContainer = queryFirst('.pdp-container');\n if (pdpContainer) {\n const selectedSize = queryFirst('.size-btn.selected');\n if (selectedSize) {\n selectedSize.click();\n }\n }\n processInclude(pdpQuickView);\n\n // Afterpay\n require('afterpay/afterpay')({\n anchors: '.product-price-row',\n renderMode: 'adjacent',\n observerTargets: '.prices',\n priceTargets: ['.sales .price-value', '.list .price-value', '.sales .value'],\n showExcluded: false\n });\n\n if (matchesBreakpoint('md')) {\n stickyScrollPosition(queryAll('.pdp-details'));\n }\n});\n"],"names":["_require","require","getProductData","queryFirst","queryAll","formatMessage","afterpayTimeout","Date","now","elementArray","items","scope","Array","isArray","document","reduce","results","item","forEach","parent","matches","push","concat","module","exports","afterpay","options","arguments","length","undefined","_options$alwaysShow","alwaysShow","anchors","observerTargets","price","priceTargets","renderMode","renderTarget","_options$showExcluded","showExcluded","_options$thresholds","thresholds","_options$logoPosition","logoPosition","window","presentAfterpay","setTimeout","args","apply","this","bind","afterpayPrefsEl","getElementById","value","afterpayPrefs","dataset","apConfig","afterpayLogoColor","currency","locale","exclusions","JSON","parse","apThresholds","minMaxThreshold","min","max","updateAmount","config","stringValue","String","isDecimalValue","indexOf","intValue","parseInt","replace","trim","amount","getPrice","observerTarget","element","innerText","renderAfterpay","instance","anchor","mode","_uData$action","_config$minMaxThresho","uData","utag_data","notWithinThreshold","excluded","hidden","excludedMessageKey","productElements","action","split","shift","toLowerCase","_getProductData","masterId","productName","afterpayNode","createElement","afterpayMessage","parentElement","insertBefore","firstChild","lastToken","pop","tokenText","join","excludedMultiSuffix","textContent","notWithinThresholdMessage","instanceNode","target","insertAdjacentElement","replaceChild","appendChild","slice","call","instanceConfig","Object","assign","anchorObserverTargets","priceValue","result","isNaN","apInstance","observer","MutationObserver","mutations","observe","childList","subtree","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","e","r","t","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","_defineProperty","i","toPrimitive","TypeError","_toPrimitive","_toPropertyKey","defineProperty","configurable","writable","_slicedToArray","_arrayWithHoles","l","n","u","a","f","next","done","return","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_arrayLikeToArray","toString","name","from","test","hasClass","_require2","toDatasetKey","hashValue","_require3","VIEW_PROMO","SELECT_PROMO","SELECT_ITEM","VIEW_ITEM_LIST","ADD_TO_CART","P_PRODUCT_LIST_KEY","P_PROMO_NAME_KEY","P_PROMO_CREATIVE_NAME","PERSISTED_DATA_NAME","STORAGE_EXP_TIME","gaInitKeyPrefix","gaRetriggerFlag","gaFieldPipe","customEventPattern","gaBindings","UDOProperties","UDOArrays","promoSensitiveEvents","productListSensitiveEvents","normalize","_len","fields","_key","map","field","values","text","smartNormalize","key","includes","normalizePayload","payload","entries","_ref","_ref2","getPageContext","srcElement","_window2$utag_data","sectionSrcElement","dialog","closest","$","data","jQuery","pageSection","pageSubsection","isCartPage","cartNav","removeDialog","selectedTab","uaAttributes","event_label","event_category","event_action","omitUADefaults","getOwnPropertyDescriptors","defineProperties","_objectSpread","page_section","page_subsection","caching_enabled","logged_in_status","user_loggedin_status","affiliation","loyalty_status","loyalty_program_member","page_name","title","page_type","page_category","page_subcategory","product_category","product_color","product_id","product_original_price","product_name","product_price","product_quantity","product_size","product_variant","product_badge","getStoredDataLayerInfo","localStorage","dataStr","getItem","console","error","removeItem","_data$key","timestamp","setItem","stringify","setStoredDataLayerInfo","storePersistentData","eventName","event_name","productList","category_id","promoName","promo_name","promoCreative","promo_creative","warn","sendEventGA","eventType","Promise","resolve","reject","utag","Error","bindGA","elements","_options$bindOptions","bindOptions","callback","_options$eventType","eventCondition","_options$isCustomEven","isCustomEvent","_options$normalize","usesNormalize","_options$retriggerEve","retriggerEvent","_options$usesContext","usesContext","_options$usesDataset","usesDataset","_options$updatesUDO","updatesUDO","_options$gaEventType","gaEventType","nodeList","NodeList","once","bindEngine","initFlag","targetSelectors","binding","isRebind","willRetrigger","ctrlKey","shiftKey","gaRetriggered","tagPayload","_target$dataset","eventCategory","eventAction","eventLabel","bindPayload","productListName","product_list","product_list_category","promoCreativeName","preventDefault","stopPropagation","pageContext","fromEntries","_ref3","preservedUDOProperties","substring","property","lazyUDOProperties","charAt","UDOUpdates","finally","trigger","productSetItem","productSetItems","productSetIndex","fill","sendEventGAWithContext","contextElem","normalizeData","delimiter","getText","elem","textNode","childNodes","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","find","child","nodeType","Node","TEXT_NODE","EXCLUSIVE_EXPERIENCES_TOOLTIP_CID","REWARDS_TOOLTIP_CID","OFFERS_TOOLTIP_CID","BENEFITS_TOOLTIP_CID","TELL_A_FRIEND_TOOLTIP_CID","STYLE_QUIZ_TOOLTIP_CID","MEMBERSHIP_FAQ_TOOLTIP_CID","TOOL_TIP_CONTENT","LOYALTY_TOOLTIP_ICON","ANALYTIC_EVENT_CLASS","BENEFIT_MODAL_CLOSE_ICON","BENEFIT_DETAIL_MODAL","BENEFIT_SWATCH_THUMBNAIL_MODAL","BENEFIT_SWATCH_TITLE","DOWNLOAD_SWATCH_CTA","GO_TO_ACCOUNT_CTA","BENEFIT_SWATCH_TAB","REFER_FRIEND_CTA","REFER_FRIEND_CTA_LINK","REFER_FRIEND_TEXT_FIELD","STYLE_QUIZ_PENDING_QUIZ","MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_CTA","MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_ALL_CTA","MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LINK","EXCLUSIVE_ARROW_RIGHT","EXCLUSIVE_ARROW_LEFT","EXCLUSIVE_PIP","ARROW_CLICKS","EXCLUSIVE_PIP_ACTION","MODULE_CHANGE","ARROW_NEXT","ARROW_PREVIOUS","EXCLUSIVE_VIEWALL","EXCLUSIVE_EXPERIENCE_CTA","EXCLUSIVE_RIGHT_SECTION","EXCLUSIVE_CONTENT_SLOTS_CLICK","EXCLUSIVE_SELECT_CONTENT","EXCLUSIVE_EXPERIENCE_NAME","EXCLUSIVE_CLICK_TO_VIEWALL","EXCLUSIVE_VIEWALL_EXCLUSIVE_EXPERIENCES","EXCLUSIVE_TOOLTIP","REFER_FRIEND_TOOLTIP","EXCLUSIVE_OPEN_TOOLTIP","HOW_TO_EARN_LINK","VIEW_POINT_ACTIVITY_CTA","REWARD_START_SHOPPING","REWARD_VIEW_CODE_CTA","VOUCHER_MODAL_CLOSE_CTA","OFFER_FLIP_CARD_CTA","VIEW_COPY_CODE_CTA","OFFER_DETAIL_CLOSE","BONUS_POINTS_DAY","EARLY_ACCESS","LOYALTY_PROGRAM_MODAL","LOYALTY_ACCOUNT_CARD","VIEW_LOYALTY_DASHBOARD","LOYALTY_DRAWER_LINK","LOYALTY_OPT_IN_CHECKBOX","ORDER_CONFIRM_REGISTER_MODAL","ORDER_CONFIRM_GUEST_ELEMENT","CREATE_ACCOUNT_ORDER_CONFIRM","LOYALTY_NEXT_BUTTON","CLOSE_WELCOME_MODAL","CLOSE_ENROLL_NOW_MODAL","ENROLL_LOYALTY_CTA","GUEST_LOYALTY_ENROLL","STYLE_QUIZ_START_CTA","STYLE_QUIZ_GO_TO_DASHBOARD","SWATCH_SELECTION_WRAPPER","NEXT_QUESTION_CTA","PREVIOUS_QUESTION_CTA","SUBMIT_QUIZ_CTA","SKIP_THIS_QUESTION_CTA","FINISH_LATER_CTA","START_SHOPPING_CTA","CONTENT_SLOT_SELECTORS","LOYALTY_BENEFIT_LABEL","LOYALTY_ANNUAL_GIFT_ID","ANNUAL_GIFT_LABEL","LOYALTY_BIRTHDAY_TREAT_LABEL","LOYALTY_DIGITAL_WALLPAPER_LABEL","MODAL_CLOSE_LABEL","MODAL_VOUCHER_CLOSE_LABEL","MODAL_SELECTED_LABEL","MODAL_DOWNLOAD_LABEL","CLICK_EVENT_ACTION","SHARE_EVENT_ACTION","LOYALTY_DASHBOARD_LABEL","LOYALTY_BENEFIT_TOOLTIP_LABEL","BENEFIT_LABEL","LOYALTY_EXCLUSIVE_EXPERIENCE_TOOLTIP_LABEL","LOYALTY_EXCLUSIVE_EXPERIENCE_LABEL","LOYALTY_MEMBERSHIP_FAQ_TOOLTIP_LABEL","TOOLTIP_LABEL","OPEN_TOOLTIP_LABEL","CLOSE_TOOLTIP_LABEL","STYLE_QUIZ_TOOLTIP_LABEL","STYLE_QUIZ_PAGE_SECTION","LOYALTY_REFER_A_FRIEND_SECTION","LOYALTY_MEMBERSHIP_FAQ_SECTION","LOYALTY_MODAL_PAGE_SUBSECTION","LOYALTY_REFER_A_FRIEND_LABEL_SECTION","LOYALTY_REFER_A_FRIEND_TOOLTIP","LOYALTY_EVENT_LABEL","MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ACTION","MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ALL_ACTION","MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LABEL","REWARDS_TOOLTIP_LABEL","REWARDS_PAGE_SECTION_LABEL","EVENT_CLICK_LINK_ACTION","REWARDS_HOW_TO_EARN_EVENT_LABEL","REWARDS_VIEW_POINT_ACTIVITY_LABEL","REWARDS_START_SHOPPING_LABEL","REWARDS_VIEW_CODE_ACTION","REWARDS_VIEW_CODE_LABEL","REWARDS_VOUCHER_MODAL","REWARDS_VOUCHER_LABEL","REWARDS_VOUCHER_PAGE_SECTION","OFFER_TOOLTIP_LABEL","OFFER_PAGE_SECTION","TAP_TO_REVEAL_ACTION","VIEW_AND_OFFER_CODE_CTA","OFFER_CLOSE_EVENT_LABEL","LOYALTY_PROGRAM_LABEL","LOYALTY_PROGRAM_ACTION","LOYALTY_PROGRAM_SUCCESS_ENROLL","ENROLL_LOYALTY","LOYALTY_DASHBOARD_ACTION","OPEN_LABEL","MY_ACCOUNT_NAME","ACCOUNT_PAGE_TYPE","MY_ACCOUNT_TAB","LOYALTY_PROGRAM_DETAILS","LOYALTY_OPT_IN_ACTION","LOYALTY_OPT_IN_CHECKBOX_SELECT_ACTION","LOYALTY_OPT_IN_CHECKBOX_DESELECT_ACTION","ACCOUNT_SIGN_IN_CATEGORY","CREATE_AN_ACCOUNT_ACTION","SUBMIT_LOYALTY_OPT_IN","SUBMIT_LOYALTY_NOT_OPT_IN","LOYALTY_PROGRAM_WELCOME","LOYALTY_PROGRAM_ENROLLMENT","LOYALTY_PROGRAM_ENROLL_SUCCESS","LOYALTY_STYLE_QUIZ_LABEL","LOYALTY_STYLE_QUIZ_GET_STARTED_ACTION","LOYALTY_STYLE_QUIZ_GO_TO_DASHBOARD","LOYALTY_STYLE_QUIZ_PAGE_NAME","LOYALTY_STYLE_QUIZ_QUESTION","OPTION_SELECTED","OPTION_DESELECTED","STYLE_QUIZ_NEXT_CTA","STYLE_QUIZ_PREVIOUS_CTA","STYLE_QUIZ_SUBMIT_CTA","STYLE_QUIZ_SKIP_THIS_QUESTION_CTA","STYLE_QUIZ_FINISH_LATER","START_SHOPPING","STYLE_QUIZ_THANK_YOU_PAGE","PDP_SELECTIONS","PDP_INTERACTION","CHANGE_STORE","VIEW_ITEM","SIGN_IN_OR_CREATE_ACCOUNT_ACTION","START_LABEL","PDP_PAGE_NAME","PRODUCT_PAGE_TYPE","CREATE_ACCOUNT_ACTION","SUBMIT_EVENT_LABEL","JOIN_CLUB_LILLY_EVENT","INITIATE_ACTION","LOYALTY_ENROLLMENT_CATEGORY","ACCOUNT_DASHBOARD_PAGE","GET_DIRECTIONS","STORE_INTERACTION","LOYALTY_VIEW_VOUCHER_CODE_LABEL","REWARDS_POINT_ACTIVITY_LABEL","REWARDS_SHOP_TAB_LABEL","SHARED_WISHLIST_CREATE_ACCOUNT_CATEGORY","SHARED_WISHLIST_CREATE_ACCOUNT_ACTION","SHARED_WISHLIST_CREATE_ACCOUNT_LABEL","SHARED_WISHLIST_PAGE_SUBSECTION","SHARED_WISHLIST_NON_LOYALTY_CATEGORY","SHARED_WISHLIST_NON_LOYALTY_ACTION","SHARED_WISHLIST_NON_LOYALTY_LABEL","LOYALTY_ENROLL_MODAL_INTERACTION_TYPE","SIGN_IN_OR_SIGN_UP_ENROLL_MODAL","LOYALTY_ENROLLMENT_EVENT_NAME","LOYALTY_VOUCHERS_EVENT_NAME","BOLT_INTERACTION","LOYALTY_DASHBOARD_REWARDS_EVENT_NAME","BOLT_MODAL_PROCEED","BOLT_MODAL_CLOSE","LOYALTY_REWARDS_EVENT_NAME","BOLT_SIGN_OUT","NEWSLETTER_SIGNUP_COMPLETE","NEWSLETTER_SIGNUP_FAILURE","isFitPredictorEnabled","noop","selector","querySelector","querySelectorAll","el","classList","c","contains","getPriceFromContainer","priceContainerId","container","parseFloat","getSalePrice","getSelectedColor","colorElement","getSelectedSize","sizeElement","getSizes","sizeArray","size","attrValue","startFP","ssp","getAvailableSizes","updateProductSetData","$container","context","sizes","availableSizes","each","attr","productId","first","val","salePrice","color","sizeType","productContext","$giftCardAmount","pid","masterid","useSale","prediction","event","productContainer","getAttribute","service","sizeOption","setAttribute","handleColor","attribute","handleSize","sauce","deviceWidth","channelValue","custID","email","screen","width","layout","language","market","shippingCountry","userId","emailHash","crumb","pt","bc","breadcrumb","type","html","setupTrigger","initializeDom","ssAddToCart","_container$dataset","variantId","quantity","startOM","startSF","updateProductData","newColor","setSelectedColor","newSize","setSelectedSize","newPrice","priceElement","setPrice","newSalePrice","salesPriceElement","setSalePrice","exported","alias","method","featureSwitch","exportName","VENDOR_PREFIXES","TEST_ELEMENT","TYPE_FUNCTION","round","Math","abs","setTimeoutContext","fn","timeout","bindFn","invokeArrayArg","arg","obj","hasOwnProperty","deprecate","message","deprecationMessage","stack","log","output","index","source","nextKey","extend","dest","src","merge","inherit","base","properties","childP","baseP","create","_super","boolOrFn","ifUndefined","val1","val2","addEventListeners","types","handler","splitStr","addEventListener","removeEventListeners","removeEventListener","hasParent","node","parentNode","inStr","str","inArray","findByKey","toArray","uniqueArray","sort","b","prefixed","prefix","prop","camelProp","toUpperCase","_uniqueId","getWindowForElement","doc","ownerDocument","defaultView","parentWindow","SUPPORT_TOUCH","SUPPORT_POINTER_EVENTS","SUPPORT_ONLY_TOUCH","navigator","userAgent","INPUT_TYPE_TOUCH","INPUT_TYPE_MOUSE","COMPUTE_INTERVAL","INPUT_START","INPUT_END","INPUT_CANCEL","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","PROPS_XY","PROPS_CLIENT_XY","Input","manager","self","inputTarget","domHandler","ev","enable","init","inputHandler","input","pointersLen","pointers","changedPointersLen","changedPointers","isFirst","isFinal","session","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","center","getCenter","timeStamp","deltaTime","angle","getAngle","distance","getDistance","offset","offsetDelta","prevDelta","prevInput","x","deltaX","y","deltaY","computeDeltaXY","offsetDirection","getDirection","start","end","overallVelocity","getVelocity","overallVelocityX","overallVelocityY","scale","rotation","getRotation","maxPointers","velocity","velocityX","velocityY","direction","last","lastInterval","v","computeIntervalInputData","srcEvent","computeInputData","emit","recognize","clientX","clientY","p1","p2","props","sqrt","atan2","PI","evEl","evTarget","evWin","destroy","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","MOUSE_ELEMENT_EVENTS","MOUSE_WINDOW_EVENTS","MouseInput","pressed","button","which","pointerType","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","PointerEventInput","store","pointerEvents","MSPointerEvent","PointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","splice","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","SingleTouchInput","started","normalizeSingleTouches","all","touches","changed","changedTouches","TOUCH_INPUT_MAP","TOUCH_TARGET_EVENTS","TouchInput","targetIds","getTouches","allTouches","identifier","targetTouches","changedTargetTouches","touch","DEDUP_TIMEOUT","TouchMouseInput","mouse","primaryTouch","lastTouches","recordTouches","eventData","setLastTouch","lastTouch","lts","isSyntheticEvent","dx","dy","inputEvent","inputData","isMouse","sourceCapabilities","firesTouchEvents","PREFIXED_TOUCH_ACTION","style","NATIVE_TOUCH_ACTION","TOUCH_ACTION_COMPUTE","TOUCH_ACTION_AUTO","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_NONE","TOUCH_ACTION_PAN_X","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MAP","touchMap","cssSupports","CSS","supports","getTouchActionProps","TouchAction","set","compute","actions","update","touchAction","recognizers","recognizer","getTouchAction","hasPanX","hasPanY","cleanTouchActions","preventDefaults","prevented","hasNone","isTapPointer","isTapMovement","isTapTouchTime","preventSrc","STATE_POSSIBLE","STATE_FAILED","Recognizer","defaults","id","state","simultaneous","requireFail","stateStr","directionStr","getRecognizerByNameIfManager","otherRecognizer","get","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","count","Hammer","preset","Manager","handlers","oldCssProps","inputClass","toggleCssProps","add","recognizeWith","requireFailure","cssProps","dropRecognizeWith","dropRequireFailure","hasRequireFailures","canRecognizeWith","additionalEvent","tryEmit","canEmit","inputDataClone","reset","process","attrTest","optionPointers","isRecognized","isValid","threshold","directionTest","hasMoved","inOut","time","validPointers","validMovement","validTime","clearTimeout","taps","interval","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","VERSION","domEvents","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","stop","force","stopped","curRecognizer","existing","remove","on","events","off","gestureEvent","createEvent","initEvent","gesture","dispatchEvent","triggerDomEvent","INPUT_MOVE","STATE_BEGAN","STATE_CHANGED","STATE_ENDED","STATE_RECOGNIZED","STATE_CANCELLED","Tap","Pan","Swipe","Pinch","Rotate","Press","define","scrollAnimate","baseFormErrors","loadFormErrors","parentSelector","fieldErrors","addClass","siblings","clearPreviousErrors","removeClass","hide","isInViewport","scrollTo","errorTextTemplate","formHelpers","checkoutContainerEl","checkoutContainer","showClass","scrollToError","formEl","headerEl","headerHeight","offsetHeight","invalidEl","top","validateForm","valid","checkValidity","stopImmediatePropagation","validity","clearForm","form","getValidationMessage","validationMessage","$this","patternMismatchValue","rangeErrorValue","missingErrorValue","badInputErrorValue","stepMismatchErrorValue","typeMismatchErrorValue","_this$validity","patternMismatch","rangeOverflow","rangeUnderflow","tooLong","tooShort","valueMissing","badInput","stepMismatch","typeMismatch","onFormInvalidHandler","setCustomValidity","parents","onFormSubmit","updatePaymentValidation","isRequired","required","validateInputs","invalid","ajaxFormInvalid","formElSelector","submit","ajaxFormSubmit","validateCheckoutForm","guestCustomerForm","registeredCustomerForm","shippingForm","billingForm","submitShippingBtn","billingAddress","reauthForm","disabled","submitReauthBtn","spinner","submitCustomerBtn","submitCustomerLoginBtn","click","errorElement","shippingError","addressMode","customerType","giftCheckbox","giftMessageContainer","giftMessageEl","innerHTML","checked","submitPaymentBtn","isPaymentDisabled","isCreditTabActive","isBoltTabActive","isNewPayment","checkIsBoltEnabledEl","isBoltEnabled","savedPaymentCvv","isCardExpired","creditCardExpirationMonthEl","creditCardExpirationYearEl","cardExpiredError","boltCardExpireMonth","boltCardExpireYear","today","expDate","setFullYear","boltExpiredCardError","dwfrm_billing_creditCardFields_expirationMonth","dwfrm_billing_creditCardFields_expirationYear","checkoutStage","link","enableFormSubmitButton","formElements","selectorContainer","notMatchedClass","matchedClass","$form","isConfirmPassword","isNewPassword","isConfirmRegistrationPassword","isRegistrationPassword","isPasswordMatched","isValidForm","confirmPasswordMatches","passwordFieldId","newPasswordValue","confirmPasswordValue","isPasswordMatches","isValidForms","checkPasswordMatch","thisValue","regexPattern","regexpattern","RegExp","mismatchError","buttonClick","functions","enableOrDisableButton","formElement","debounce","SCROLLABLE_CONTENT_SELECTOR","initSpecificCarousel","scrollableContainerEl","parentEl","leftArrowEl","left","scrollLeft","offsetWidth","behavior","rightArrowEl","scrollWidth","initCarousel","hasEtmc","_etmc","trackCart","trackPageView","trackWishlist","setUserInfo","startCoord","isTouchingCarousel","$window","$document","$body","activeClass","initScrollSlider","carousels","array","carousel","indicators","matchMedia","slideItem","slideIndicatorPosition","offsetTop","relatedTarget","handleDesktopCarousel","initOnce","currentScrollPos","scrollY","pageYOffset","ticking","carouselIndicatorScroll","sliderContainer","sliderContainerOffsetTop","offsetParent","getOffsetTop","sliderContainerOffsetEnd","scrollDistance","getBoundingClientRect","activeIndex","some","scroll","requestAnimationFrame","handleCarouselOnScroll","ready","response","carouselIndicatorsElement","resize","throttle","pdpCarouselEl","minHeight","getNestedValue","currentCoord","coordsAreNumbers","cancelable","passive","NOT_AVAILABLE_STATUS","PREORDER_STATUS","PDPNarvarEDD","lillyUtils","isEDDEnabled","EDD_INFO_SELECTOR","isEDDApplicable","availabilityStatus","injectEDDInfo","productContainerEl","eddEl","estimatedDeliveryTime","removeEDDInfo","cartTemplates","cart","approachingDiscountsTemplates","approachingDiscounts","promoTemplates","promo","displayFlex","emptySFL","lpRegisteredUserEmailEl","lpRegisteredUserEmail","boltCheckoutAccountExistEl","validateBasket","errorHtml","errorMessage","empty","append","emptyCart","resources","emptyCartMsg","numItems","cartErrors","minicartCountOfItems","couponErrorMessage","checkoutButtonElement","expressCheckoutSection","gwpProductsLength","cartWithSFLElement","oosProduct","chooseGwpMessage","monogramRestrictionLength","numLowInventoryWarnings","removeAttribute","HIDDEN_CLASS","href","grandTotalVal","cartPage","zeroTotal","boltCheckoutCtaEl","_checkoutButtonElemen","isBoltEnable","isBoltUserLoggedIn","checkBoltAccountUrl","encodeURIComponent","ajax","url","success","has_bolt_account","enableOrDisableCheckoutButton","hiddenClass","toggleLocationIcon","isGeolocationAllowed","locationInactiveIcon","locationActiveIcon","ispuContainer","ispuModalContainer","pickUpInStoreButton","isRecognizedUser","ispuClosestParent","isInCartPage","isInPdpPage","handleStoreResults","noStoresMessage","storeResults","productDetails","storesResultsHtml","preferredStore","setItemInLocalStorage","PREFERRED_STORE_ID","ID","noStoresErrorMessage","handleConfirmStoreResults","storeConfirm","storeForm","errorCallBack","handleInStore","locationData","latitude","longitude","address","actionUrl","forceGeoLocation","ispuContainerDataset","products","editStore","inputSearchParameter","selectStoreView","storeId","getItemFromLocalStorage","storeID","getJSON","handlePreferredStore","googleKey","swatchName","mixinData","includeGoogleMaps","uuid","geolocate","modal","_event$target$dataset","getLatLong","isEditStore","storePickupInfo","ispuLineItems","ispuLineItemsData","productsInfo","ispuLineItem","_ispuLineItem$dataset","_ispuContainer$datase","lineItemErrorMessage","cartProductsHtml","discountsHtml","totals","couponsEl","cookie","getTime","discounts","shippingMethod","promotionsListContainer","cartShippingMethodContainer","checkoutShippingMethodContainer","checkoutShippingMethodTitle","promotionsHtml","promoTemplate","cloneNode","promoContainer","promoText","promoTitle","promoValue","description","eachDiscount","applied","couponData","relationship","couponCode","totalPrice","isDiscounted","shippingLabel","displayName","shippingCost","estimatedArrivalTime","checkoutDiscountShipping","adjustedShippingCost","checkoutNormalShipping","updatePromoCodeDetails","selectedShippingMethod","giftWrapQuantity","giftWrapTotalPrice","giftWrapISPUTotalPrice","giftWrapISPUQuantity","giftWrapContainer","giftWrapISPUContainer","nonCouponContainer","freeprice","formattedPrice","cartWithSFLCountTotal","numberOfItems","subTotal","totalAmount","totalTax","orderLevelDiscountTotal","formatted","nonCouponPromotionsHTML","nonCouponBasedAdjustments","couponItem","nonCouponBasedAdjustmentTemplate","discountPrice","callOutMsg","renderedPromotions","UUID","priceTotal","renderedPrice","updateCartTotals","toggle","findStoreSubmit","confirmSection","geolocateError","appendToUrl","shippingPreferences","ispuSelectStyleMessageTmpl","isShippingPreferencesViewEnabled","_require4","getChangeStoreLinkEl","getSelectedPreferenceEl","getShippingPreferencesContainerEl","getISPUradioButtonEl","getSelectedSizeEl","getShipToAddressradioButtonEl","getISPUPreferenceContentEl","addStoreNameClass","removeStoreNameClass","selectISPURadioButton","selectShipToRadioButton","getPreferedShippingPreference","disableISPURadioButton","disableShipToRadioButton","getShipToAddressContentEl","updateVisibilityOfLowInventoryMsg","_require5","updateShipToInventoryMessages","updateISPUInventoryMessages","clearAllInventoryMessages","updateServiceResponseMessage","clearServiceResponseMessage","_require6","injectISPUDeliveryMessage","clearISPUDeliveryMessage","showISPUDeliveryMessage","hideISPUDeliveryMessage","_require7","getStoreDetailEl","addStoreDetail","_require8","_require9","EMPTY_STRING","_require10","DISABLED_CLASS","PRODUCT_DETAIL_CONTAINER_SELECTOR","SHIPPING_PREFERENCES_CONTAINER_SELECTOR","ISPU_SELECT_STYLE_MESSAGE_SELECTOR","ISPU_SERVICE_ERROR_ATTR_NAME","ISPU_RADIO_VALUE","SHIP_TO_RADIO_VALUE","SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR","CHANGE_STORE_LINK_SELECTOR","SHIPPING_PREFERENCE_KEY","RADIO_BUTTON_LABEL_SELECTOR","STORE_DETAIL_SELECTOR","ISPU_INFO_MESSAGE_SELECTOR","PDP_CONTAINER_SELECTOR","AVAILABILITY_MSG_SELECTOR","NOT_AVAILABLE_CLASS","ISPU_SERVICE_BLOCKED","PRE_ORDER_CLASS","SHIP_TO_LOW_INVENTORY_CLASS","$shippingPreferenceContainer","shippingPreferencesConfig","isEnabled","messages","reasonCodes","inventoryCache","clearAllMessages","resetPreferences","shipToRadioButtonEl","nextElementSibling","shipToAddressContentEl","ispuRadioButtonEl","ispuPreferenceContentEl","handleISPUInventoryResponse","storeDetailEl","_window","ispuProductInventory","productInfo","selectedColorValue","variationGroup","changeStoreLinkEl","selectedSizeEl","instorePickupStoreMsg","ispuAvailabilityMessageEl","selectStylesMessage","sizeBtn","attributeValue","getVariationJson","variants","wrapErrorMessage","reasonCode","NO_STORES_FOUND","STORES_SERVICE_DOWN","STORE_UNAVAILABLE","preferISPU","shippingPreferencesContainerEl","preferenceIspuLabel","preferenceShipToAddressLabel","changeStoreLabel","shippingPreferencesHTML","injectShippingPreferences","selectedSwatchButton","params","skipCall","sessionStoreId","noStoresFound","paramHash","urlWithParams","$spinner","handleISPUInventoryError","$event","availabilityElement","storeServiceResponse","shipToAddressAvailabilityStatus","inStorePickUpAvailabilityStatus","isStorePickUpLowInventory","inStorePickUpAvailabilityMessage","inStorePickUpLowStockMessage","hasAttribute","preferenceValue","ispuContentEl","ispuLabelEl","selectedPreferenceEl","shipToContentEl","shipToLabelEl","radioButtonEl","$inStorePickupButton","$targetModal","one","focus","STORE_DETAIL_CONTAINER_SELECTOR","ISPU_PREFERENCE_CONTAINER_SELECTOR","ISPU_PREFERENCE_CONTENT_SELECTOR","ISPU_RADIO_SELECTOR","SHIP_TO_ADDRESS_RADIO_SELECTOR","STORE_SERVICE_INFO_MESSAGE_SELECTOR","STORE_AVAILABILITY_MESSAGE_SELECTOR","SHIP_TO_INFO_MESSAGE_SELECTOR","ISPU_STORE_NAME_CLASS","CHECKOUT_HIDDEN_CLASS","PREFERENCE_SELECTOR","SHIP_TO_ADDRESS_CONTENT_SELECTOR","BOLT_PAY","INVENTORY_MSG_SELECTOR","LOW_STOCK_ISPU_SELECTOR","WISHLIST_NAME_REGEX","TRACKER_FUNCTIONAL_COOKIE","LOYALTY_POSTAL_CODE_REGEX","MY_ACCOUNT","ORDER_CONFIRMATION","injectMessageAndUpdateElementState","getISPUNotAvailableMessageEl","getShipToNotAvailableMessageEl","getISPUInventoryLevelMessageEl","getStoreServiceResponseMessageEl","shipToAvailabilityStatus","shipToAvailableMessageEl","notAvailableShipToMessage","ispuAvailabilityStatus","ispuAvailabilityMessage","ispuLowInventoryMessage","ispuNotAvailableMessageEl","ispuInventoryLevelMessageEl","ispuLowInventoryMessageEl","getISPULowInventoryMessageEl","notAvailableISPUMessage","wrapText","ispuServiceResponseEl","getISPUDeliveryMessageEl","ispuDeliveryMessageEl","storeNameEl","enableISPUSection","disableISPUSection","enableShipToContent","disableShipToContent","shippingPreferenceValue","activeStoreFilter","ispuLowStockEl","ispuLowInventory","ispuLowInventoryMsg","storeDetail","getStoreDetailContainerEl","storeDetailContainerEl","address1","city","stateCode","postalCode","storeDetailHTML","breakpoints","xs","sm","md","lg","xl","INVALID_CLASS","INVISIBLE_CLASS","NO_SCROLL_CLASS","IS_STICKY_CLASS","SELECTED_CLASS","IN_STOCK_STATUS","KEYCODE_TAB","KEYCODE_ESCAPE","KEYCODE_UP","KEYCODE_DOWN","KEYCODE_ENTER","EVENT_KEY_ENTER","SEARCH_TYPE","SEARCH_SUBMIT","SEARCH_SUGGESTIONS","POPULAR_SEARCHES","loadScript","isAsync","script","async","onload","body","loadInput","referrerID","getStyles","styles","getComputedStyle","rules","rule","removeChild","_len2","_key2","_el$classList","_node$classList","_len3","_key3","_el$classList2","_node$classList2","toggleClass","_len4","_key4","_el$classList3","_node$classList3","_len5","classes","_key5","every","className","limit","waitCallback","isThrottling","_len6","_key6","returnValue","_this","timer","minimumDelay","condition","unrestrictedCallback","_len7","_key7","_len8","_key8","newTarget","makeArray","outerHeight","marginTop","marginBottom","isInViewportCheck","boundsTop","numberOfViewportToCheck","nextViewportLazyLoad","viewport","innerHeight","bounds","clientHeight","rect","bottom","right","innerWidth","documentElement","clientWidth","cartElement","duration","getLastElementInRow","sibling","scrollHeight","previousElementSibling","updateUrlQueryParam","fragment","queryParamsElement","permaLink","history","pushState","path","newUrl","location","getCharacterCount","waitForElement","disconnect","eventTypes","_options$bindEngine","_options$once","useJQuery","_options$targetSelect","extraData","Element","Event","targetElement","_targetElement","$element","variationGroupId","originalPrice","productPrice","isPreorder","productData","containerData","monetatePid","isQuickview","productInventory","wishlistId","productSize","colorCode","productSet","productBadge","colorEl","swatchButton","attrDisplayvalue","tileEl","standardPrice","groupId","productNameEl","productSizeEl","valueId","originalPriceEl","productPriceEl","productColorEl","productColor","matchesBreakpoint","breakpoint","getCSRFToken","token","renderFragment","template","content","getCookieMap","keyValue","_keyValue$trim$split2","decodeURIComponent","setCookie","minutes","date","setTime","toGMTString","validateDate","monthSelector","dateSelector","m","d","mlength","labelOption","Option","option","selected","isVisible","HTMLElement","display","visibility","overflowY","height","maxHeight","toFormData","includeUndefined","formData","FormData","googleMapScript","geocoder","head","callBack","mixin","google","maps","Geocoder","geocode","status","GeocoderStatus","OK","geometry","lat","lng","formValidation","baseLogin","formatPhoneNumber","registrationFormPhone","loyaltyGuestReferralModal","guestCheckoutSignInModal","cancelBtnRegistrationModal","registerLeft","registerRight","register","dataType","serialize","reload","redirectUrl","err","responseJSON","createErrorNotification","resetPassword","resetPasswordDialog","emailEl","handleLogin","loginBtnEl","$loginFormEl","enableLoginButton","btn","mobileImg","desktopImg","getTimeRemaining","loyaltyWelcomeDialog","loyaltyEnrollNowDialog","invalidClass","exclusiveCarouselIdSelector","root","loyaltyEarlyAccessRegisterForm","earlyAccessPdpSignInRegistration","swatchImageDownload","swatchImageDownloaded","downloadCtaDesktop","downloadCtaMobile","welcomeDialogEarlyAccessMsgEl","welcomeDialogMsgEl","handleEarlyAccessEnrollModal","removeWelcomeModalShowSession","handlePdpEarlyAccessLoginRegistration","isLoyaltyMember","showWelcomeModal","loyaltyEnrollModalForm","loyaltyEnrollPostalCodeEl","loyaltyGuestEnrollment","closeButton","welcomeSessionUrl","attachLoginRegistrationFormEvents","handleEarlyAccessLogin","earlyAccessCta","initPopover","initPopoverClose","POPOVER_CLICK_BOTTOM","accountRegistrationForm","loginForm","keepUserLoggedIn","isPersistentLoginEnabled","signInForm","registerForm","accountHelpEl","earlyAccessRegisterLeft","earlyAccessRegisterRight","loyaltyRegistrationForm","loyaltyLoginForm","addToLoyaltyProgram","createAcctBtn","earlyAccessMsg","earlyAccessProduct","currentTarget","signInContainer","keepUserSignedInPopover","keepUserSignedContainer","loyaltyProgramMemberId","earlyAccessSignIn","optedInToLoyalty","earlyAccessRegistration","hideShowDrawerImage","drawerMobileImg","drawerDesktopImg","desktopImageWrapper","mobileImageWrapper","drawerMobileImgEl","drawerDesktopImgEl","loyaltyDrawerImageView","updateReferralBg","loyaltyReferralBg","_loyaltyReferralBg$da","bgColor","bgImageDesktop","bgImageMobile","setProperty","drawerImage","loyaltyModalEl","withImageEl","withoutImageEl","loyaltyDrawerBackground","updateImgURLOnDownloadCta","selectedWallpaperId","selectTab","imageElement","swatchImageDownloadCtaDesktop","swatchImageDownloadCtaMobile","swatchImageDownloadedCtaDesktop","swatchImageDownloadedCtaMobile","_imageElement$dataset","desktopDownloadedImage","mobileDownloadedImage","wrap","carouselControlsToggle","exclusiveCarousel","carouselControl","lastElementChild","firstElementChild","previousControl","nextControl","hash","exclusiveExperiencesTile","_loop","exclusiveModule","countDownTime","countDownTimer","countDownEle","countDownEleNoDays","countDataMsg","counterMsg","countDataMsgNoDays","timeinterval","setInterval","tokenize","newCountDataMsg","days","total","clearInterval","updateClock","exclusiveExperiencesCountDown","earlyAccessBtn","loyaltyDrawer","loyaltyAppImage","loyaltyDrawerContent","isAppDrawer","drawerAppImgEl","appImageWrapper","appMobileImgEl","isLoyaltyProgramDrawerClick","isLoyaltyProgramOverviewFromHeader","loyaltyContainer","guestEnrollment","memberSignInEnrollment","loyaltyIsImage","closeButtonLabel","drawerTitle","drawerCloseButtonLabel","drawerTitleE1","drawerCloseButtonE1","ariaLabel","loyaltyEnrollPostalCodeContainer","loyaltyEnrollPostalEl","loyaltyEnrollCheckboxEl","enrollNowSource","loyaltyRemoveClass","loyaltyEnrollNowSubmit","postalCodeEl","referrerIDEl","postalCodeRegex","regexp","invalidFeedback","requestData","lillyLoyaltyProgram","loyaltyUnenrollDashboard","accountLoyaltyDashboard","showWelcomePopup","loyaltyDashboardShow","checkLoyaltyAccess","showEnrollmentModel","imageUrls","modelImages","enrollmentModel","welcomeModel","loyaltyaccesspopupmobile","LoyaltyguestenrollmentnonloyaltyD2x","loyaltywelcomepopupmobile","LoyaltywelcomeloyaltyD2x","loyaltyDashboardOffersTile","expirationDateTime","cardFlippedEl","cardFront","_e$target$dataset","expiryDate","formatString","offerDiscountDialog","offerDiscountTileData","offerDiscountModalData","copyCodeText","getFormatDateString","select","setSelectionRange","clipboard","writeText","loyaltyReferralDrawer","referralUrlElement","referralUrl","loyaltyCopyReferralUrl","copyReferralUrl","copyCta","copiedLinkCta","then","loyaltyOopsRefreshSection","successServiceResData","tooltipModule","tooltipInnerData","serviceResHTMLData","updatedToolTip","popContent","tooltipIcon","popover","placement","clickEvent","clicked","scrollableContent","referralModuleBg","referralSection","loyaltyEarlyAccessSignUp","phInfoPopover","fpoInfoPopover","checkoutBenefitsInfoPopover","cvvInfoPopover","giftCardInfoPopover","birthdayInfoPopover","deliveryFeeInfoPopover","boltSignoutMessage","earlyAccessMessage","giftReturnNumberInfoPopover","keepUserSignedInContainer","earlyAccessLockedSelector","pdpChatWrapper","pdpChatPopover","pdpChatContainer","initPopoverCloseSelector","tooltipSelector","initPopoverPromotions","popoverContent","initPopoverWishList","initPopoverEarlyAccessLocked","initPopoverAll","_regeneratorRuntime","asyncIterator","toStringTag","Generator","Context","makeInvokeMethod","tryCatch","h","s","GeneratorFunction","GeneratorFunctionPrototype","p","getPrototypeOf","g","defineIteratorMethods","_invoke","AsyncIterator","invoke","__await","callInvokeWithMethodAndArg","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","isGeneratorFunction","mark","setPrototypeOf","__proto__","awrap","reverse","prev","rval","handle","complete","finish","catch","delegateYield","asyncGeneratorStep","focusHelper","toggleSelectSizeInfo","isEarlyAccessElement","swatchNameTemplate","sizeOptionTemplate","sizeButtonTemplate","gwpSizeTemplate","dialogTemplate","loyaltyTemplates","loyalty","$gwpDialog","readyClass","selectedProductClass","notAvailable","loyaltyProfile","isLoyaltyProgramMember","isLoyaltyAuthenticated","isLoyaltyEnabled","isContentModulesFetched","getPidValue","$el","getQuantitySelector","updateAttrs","attrs","$productContainer","msgs","attrsWithSwatches","isChoiceOfBonusProducts","$attrValue","$swatchButton","assistiveSelectedText","bonusVariationUrl","removeAttr","selectable","processSwatchValues","$bonusProductItem","sizeContainer","singleSize","displayValue","loopStatus","resetUrl","selectLabel","selectId","sizeOptions","multiDefaultSizeOption","inStock","forceOutOfStock","outOfStockMsg","outOfStock","multiSizeOption","multiSize","$attr","selectSizeEl","selectedValue","not","selectedOptions","isOffline","sizeListItemEl","assistiveElement","_assistiveElement$dat","selectedText","optionEl","selectedIndex","processNonSwatchValues","updateOptions","$optionEl","handleEarlyAccessCta","isEarlyAccessProduct","earlyAccessLockIcon","earlyAccessWishlistIcon","addToCartCta","earlyAccessPdpEl","earlyAccessGuest","earlyAccessRegistered","createCarousel","imgs","isEarlyAccess","earlyAccessText","videoUrl","carouselId","displayCounter","counterHtml","dataSrc","imageZoomUrl","imagePresetUrl","enableCache","carouselBadge","srcset","alt","appendTo","addToWishlistIconPdp","loyaltyEarlyAccessEl","addToCartButtonPdp","pdpNonEarlyAccessLoginEl","loyaltyEarlyAccessLockContainer","firstImageElement","videoTemplate","templateVideoElement","eachElement","load","detach","handleVariantResponse","_response$product","product","variationAttributes","productType","readyToOrder","bonusVariationAtrributes","isFinalSale","isDirectlyPurchasable","earlyAccess","saleMessageEl","sizeElements","primaryImageUrls","images","checkout","large","productImageElement","setModalImages","ispu","swatchNameElement","selectedSwatch","selectedSwatchName","swatchHtml","swatchNameHtml","selectedSwatchElement","$priceSelector","replaceWith","promotionElement","promotionsPopover","availabilityValue","availabilityMessages","availability","availabilityMsgEl","notPurchasable","updateAvailability","attributes","attributeGroup","label","getAttributesHtml","updateQuantities","quantities","optionsHtml","attributeSelect","selectedValueUrl","selectedSizeElement","$choiceOfBonusProductEl","updateProductPrice","priceTemplate","priceSection","priceContainer","strikeThroughContainer","salesContainer","fixedPrice","fixedStandardPrice","toFixed","updateSizeElements","variantsList","quickviewProductInfo","_sizeContainer$datase","describedby","sizeButtonHtml","eachVariant","eachSize","sizeId","inventoryData","variantData","updateImageDetails","imageObj","srcsetPresets","srcsetString","imageScene7","updateProductDetails","currentElement","promotionMessageTmpl","elementData","variantGroupId","swatchContainer","assistiveElements","assistiveTextElement","monogramBtn","_productInfo$variants","shopThePrint","mgFlag","mgLocs","hasWaysToWear","promotions","setWishlistProductId","colorElements","customPageTitle","pageTitle","includeLillyColor","lillyColorName","customPageDescription","pageDescription","titleElement","descriptionElement","waysToWearEl","variationGridUrl","colorlabel","colorLabel","longDescriptionElement","longDescription","lillyColor","productFinalSaleMessage","productFreeReturnsMessage","variationUrl","waysToWearContainer","IntersectionObserver","_ref4","entry","isIntersecting","always","unobserve","destroyContentModulesIntersectionObserver","updateContentModules","rootMargin","dynamicallyFetchContentModules","shopThePrintElement","outerHTML","updateShopThePrint","ssColor","ssSizeElement","ssSize","promotion","calloutMsg","promotionIdx","details","carouselContainerEl","carouselContainerHeight","wishlistButton","assistiveText","swatchParam","queryParams","search","UpdatedParams","eachParam","replaceState","parseHtml","$html","parseHTML","selectedProducts","footer","handlePostCartAdd","displayModal","addToCartWarningDialog","isOnCartPage","pathname","buttons","primary","redirectLink","modalContentHeading","messageHeading","modalContentBody","messageBodyOnCart","messageBodyOffCart","messageType","getChildProducts","childProducts","getOptions","$elOption","urlValue","selectedValueId","optionId","setControlsEnabled","controls","blocker","blockerActiveClass","control","blockElement","methods","editBonusProducts","bonusUrl","bonusChoiceRuleBased","showProductsUrlRuleBased","showProductsUrlListBased","maxBonusItems","addToCartUrl","pliUUID","pageSize","bonusDiscountLineItems","parsedHtml","renderedTemplate","enterDialogMessage","insertAfter","selectedBonusProducts","modalDialog","selectedProductsCount","eachProductList","bonusAccordionContainer","maxCount","maxItems","productListLength","eachProduct","selectedProduct","selectBonusCheckbox","productDialog","accordionContainer","bonusAccordionElements","addToCart","sizeEl","isSizeSelected","isSelectedSizeUnavailable","children","firstOption","validProducts","chooseBonusProducts","focusChooseBonusProductModal","onClosingChooseBonusProductModal","trapChooseBonusProductModalFocus","focusParams","containerSelector","firstElementSelector","lastElementSelector","setTabNextFocus","colorAttribute","productDetailContainer","_productInfo$variants2","pdpBreadCrumbs","monetateData","updateQuickViewDetails","_data$product","selectColorAttribute","renderSizeElements","swatchEl","_productInfo$variants3","wishlistDisabled","showStrikeHearts","selectAttribute","_ref6","_callee","$target","storeLocatorContainer","ispuAddToCart","pdpSetData","isPDPSet","setPids","setModal","modalProducts","analyticsData","closestUrl","res","resData","_queryFirst2","_context","modalProduct","_queryFirst","sizeSelected","pidsObj","listName","utagPromoName","utagPromoCreativeName","utagListName","fetch","ok","json","t0","_next","_throw","_x","selectBonusProduct","$choiceOfBonusProduct","maxPids","totalQty","choiceOfBonusProduct","selectedProductElement","bonusCountElement","selectedCount","enableAddTocart","optionID","selectedBonusProductHtml","bonusDrawer","bonusTile","targetCheckbox","accordion","checkedBox","removeBonusProduct","$selected","enableBonusProductSelection","available","bonusProductDialog","showMoreBonusProducts","addBonusProductsToCart","$readyToOrderBonusProducts","queryString","pidsObject","bonusProducts","qtyOption","qty","revealRecommendations","eachRecommendation","titleEl","productEl","handleEarlyAccessPLPLockIcon","earlyAccessPLPContainer","earlyAccessPlpIcon","lockIconContainer","earlyAccessPLPBadge","earlyAccessDate","isEarlyAccessItem","getQuantitySelected","_require$productDetai","availabilityMessageTmpl","availabilityMessageOOS","availabilityMessagePreorder","ispuAvailabilityMessageTmpl","ispuLowStockMessageTmpl","sizeChartClasses","IN_STOCK","NOT_AVAILABLE","PREORDER","handleProductImageZoom","pdpPageCarousels","imageObserver","mutationList","_step","_iterator","_n","F","_createForOfIteratorHelper","mutation","addedNodes","zoomAlt","pdpImages","pdpIndicators","img","imageEl","zoomed","mobileZoomed","touchZoom","elm","thisHammer","transform","xPos","current","yPos","ceil","createTouchZoom","createHoverZoom","hiresUrl","zoom","magnify","handleNotifyMe","addToCartSection","notifyContainer","notifyMeButton","notifyMeDesc","availabilityMessageEl","isNotifyMeEnabled","imageData","notifyImageElement","_imageData$","imageHasLoaded","notifyColor","notifySize","customerEmail","onSizeChangeHandler","selectedSizeValue","assistiveElementOfSelected","_assistiveElementOfSe","selectedSize","updateQuickViewProductInfo","selectedColorId","currentSizeElement","quickViewInfo","variantGroupData","vgProductDetailsUrl","selectedSizeData","addToCartButton","productDetailsUrl","fullPDPLink","hideStrikeHearts","variantProductDetailsUrl","isFinalSaleVariant","isDirectlyPurchasableVariant","wishlistDisabledVariant","isLowInventory","selectedColorName","updateProductInfo","monogramProductPrice","ispuButton","ispuInventoryData","ispuMessage","ispuLowStockMessage","isISPULowInventory","shippingPreferencesEnabled","ispuAvailabilityValue","ispuLowStockValue","lowStockAvailabilityMessage","breadcrumbItems","categoryUrl","notifyBlock","custEmail","handleNotifyMeBlock","pickupImageElement","_ispu$","pickupSize","monogramImages","monogram","updatedImageData","monogramObject","monogramProductID","monogramImageURL","monogramImageSrcSetURL","monogramLocations","monogramSelectedColor","monogramSelectedSize","handleLastLinkTab","sizeChartCatBtn","keyCode","toogleActiveSizeChartTab","$prodSizeChart","$lpSlideout","_$this$data","activeCategoryVal","sizefamily","defaultText","defaulttext","$activeCategoryEl","$lpSizechartTitle","tab","animate","scrollFitRatingToReviews","bvReviews","updateAttribute","_response$data$produc","eq","colorVariationObject","attributeId","selectedSwatchObject","eachValue","updateSelectedSwatchProductName","selectSizeAttribute","buttonElement","attrUrl","quickViewCarouselEl","afterAttributeSelect","wishListID","responseContainer","sizeCard","sizeSeparator","_assistiveElementOfSe2","restrictedFromOrder","quickviewContainer","sales","updateCartButton","giftWrapAvailableFlag","giftWrapAvailable","_ispu$2","ssColorElement","pricesObject","list","ssSalesPrice","ssPrice","productSetModal","addAllToToteButton","selectPdpSizeAttribute","selectedColorElement","allSelectableSwatches","notifyMeBoxHidden","notifyMeHidden","updateAttributesAndDetails","attributesHtml","shortDescription","showSpinner","quickViewModal","allAvailable","allReady","info_selectforstock","sizeChart","setStickyNav","is","lastLinkEl","handleEarlyAccessLockIcon","productContainerEarlyAccessIcon","earlyAccessItem","handleOfflineProduct","offlineContainerEl","currentSearch","TS_PARAM","handlePdpNonEarlyAccessLoyalty","signInCreateAccountModal","loyaltyEnrollNowModal","pdpSignInCreateAccountButton","earlyAccessSignInInfo","pdpSignInInfo","earlyAccessSignInText","joinButton","earlyAccessWelcomeCta","pdpSignInTab","selectStyleMessageTmpl","earlyAccessUntilDate","mql","initialMonogramClick","styleMap","singleLetterStyle","doubleLetterStyle","tripleLetterStyle","traditionalLetterStyle","colorMap","rgb","selectedMonogramValues","monogramInitials","monogramStyle","monogramColor","placementSelect","enableContinue","allInputText","monogramData","monogramContinueButton","monogramModalEl","initialsButtons","monongramUlEl","selectedClass","activeViewClass","monogramConfirmationView","detailViewEl","updateMonogramValues","changeSelectedAssistiveText","assistiveElementSelector","selectedElement","selectedAssistiveElement","toggleStyle","monogramDetails","initialsSampleAll","traditionalSampleAll","inputValue","setInitials","selectStyle","styleSelect","textValue","selectedStyleElement","letter1","letter2","letter3","substr","resetMonogram","checkMonogram","monogramButton","monogramProductName","btnPositionData","monogramPositionHtml","stepTitle","imgURL","appendPositionSwatches","monogramColorHtml","swatch","appendColorSwatches","isTabEnterPressed","parentLI","btnEl","colorRgb","colorName","monogramUrl","monogramValues","responseData","detail","_require$default","injectAfterpay","injectFitPredictor","injectLongDescription","updateFullProductLink","quickViewTemplates","quickView","header","getNavOffset","attachFormEvents","quickViewFormSelector","$quickViewTriggerElement","backFocusToTrigger","showQuickview","quickviewURL","lastElementInRow","selectedProductDescriptionElement","stopSpinner","scrollTop","filledContainers","containerTop","isNewContainerBelow","openContainer","openTagIndex","selectedSwatchEl","gcType","quickViewFullDetailMsg","productUrl","quickViewContainer","earlyAccessGuestSignIn","injectQuickView","quickViewModalEl","quickview","getModalHtmlElement","productLineItemEl","lineItemAmountEl","padding","focusQuickview","trapQuickviewFocus","nextToLastElementSelector","hideDialog","beforeUpdateAttribute","updateAddToCart","buttonToUpdate","containerEl","addToWishlist","addToWishlistModal","cartAvailabilityMessageOOS","emptySwatchTemplate","addressSuggestions","suggestionTextTemplate","suggestionsTemplate","discountContainerTemplate","singleDiscountTemplate","multipleDiscountsTemplate","_options$loop","loop","_options$videoUrl","_options$imgUrl","imgUrl","_options$classNames","classNames","_options$autoplay","autoplay","_options$muted","muted","_options$controls","_options$icontitle","icontitle","_options$icondesc","icondesc","imageTemplate","altText","ariaDescribedby","oosMessage","guestEmptyWishlistTemplate","emptyWishlistMessage","emptyWishlistContentAssetBody","emptySFLMessage","continueShopURL","continueShopMsg","signInMsg","signInSFLURL","autoComplete","suggestionLink","suggestion","addressLine","secondaryEntryAddressLine","street_line","secondary","zipcode","suggestionContainer","containerClass","contactUsTemplate","signupError","msg","defaultSignupError","browserWarningTemplate","shippingPreferenceTemplates","ispuRadioLabel","ispuRadioValue","shipToRadioLabel","shipToRadioValue","productDetail","_options$buttons","_options$className","_options$modalContent","_options$modalContent2","_options$id","_options$slideOut","slideOut","buttonSpace","floor","oneTrust","privacyDialogCookieBanner","styliticsTemplates","shopTheModelBadge","returnsPageTemplates","defaultError","cyberSource","secureAcceptanceTag","paymentType","boltPayPaymentTag","paymentLastFour","expMonth","expYear","paypalPaymentTag","paypalMethod","paypalAmount","creditCardPaymentTag","cardType","creditCardType","maskedCardNumber","cardEndIn","cardExpMonth","cardExpYear","checkoutErrorTemplate","checkoutErrorMsg","errorMsg","string","leftToken","rightToken","operators","_","code","toKebabCase","startsWith","endsWith","digit","charCodeAt","tokens","keyString","replaceValues","flag","onSuccess","onError","successCallback","errorCallback","geolocation","getCurrentPosition","coords","maximumAge","removeItemFromLocalStorage","formatValue","numbers","char","errorMessageElmParent","isMobile","mobileAgentHash","idx","stickyScrollPosition","detailStickyScroll","itemHeight","windowHeight","newTop","handleStickyPositionOnScroll","isUnsupportedBrowser","unsupportedBrowserTypes","sitePrefs","uaFragment","endtime","seconds","hours","validateEmailBolt","wishlistBtn","wishlistStrikeBtn","storeLocator","htmlString","fillModalElement","selectedPostalCode","selectedRadius","radius","changeRadius","selectStore","updateSelectStoreButton","show","deselectStore","storeElement","removeData","updateSelectStore","availableForInStorePickup","removeSelectedStoreOnAttributeChange","updateAddToCartFormData","showInStoreInventory","removeStoreSelection","selectStoreWithInventory","searchPID","storeDetailsHtml","$changeStoreButton","searchPostalCode","searchRadius","$quantitySelect","selectorPrefix","productIdSelector","quantitySelector","quantityOptionSelector","quantitySelected","productAtsValue","atsValue","originalHTML","selectedQuantity","updateQOptions","updateQuantityOptions","changeStore","firstFocusableEl","lastFocusableEl","linkElements","feedbackElement","prepend","position","login","receivedMsgHeading","receivedMsgBody","mobile","returnUrl","buttonText","clearResetForm","infowindow","InfoWindow","mapOptions","scrollwheel","LatLng","Map","mapdiv","LatLngBounds","markerImg","fillColor","fillOpacity","strokeColor","strokeWeight","Point","labelOrigin","lable","storeLocation","marker","Marker","icon","fontSize","addListener","setOptions","infoWindowHtml","open","fitBounds","updateStoresResults","$resultsDiv","$mapDiv","hasResults","stores","searchKey","locations","urlParams","detectLocation","long","change","searchKeys","selectedStore","include","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","validateEmail","emailFormGroup","emailError","missingError","notifyMeSubmit","productID","subscribe","$notifyMe","confirmMessage","notifyMeContainerSubmit","notifyMeContainer","notifyConfirm","sucess","closeNotifyMeForm","preSelectNotifyCheckbox","notifyMeId","processInclude","notifyMe","pdpQuickView"],"sourceRoot":""}