{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_storefront_naturesmenu/cartridge/client/default/js/util.js","webpack:///./cartridges/app_storefront_naturesmenu/cartridge/client/default/js/storePage.js","webpack:///./cartridges/app_storefront_naturesmenu/cartridge/client/default/js/storePage/petInfoComponent.js","webpack:///./cartridges/app_storefront_naturesmenu/cartridge/client/default/js/storePage/recipePage.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","include","_typeof","keys","forEach","processInclude","require","$","document","ready","seeMoreButton","on","this","addClass","next","removeClass","parent","find","prev","animate","scrollTop","offset","top","$informationTab","$seeMoreButton","window","innerWidth","text","length","show","hide","init","scrollPosition","mediaQuery","matchMedia","triggerOverlay","overlayId","ingredientCard","elementClicked","targetDiv","scrollY","css","concat","toggleClass","eventData","click_path","customerNumber","data","trigger","closeOverlay","$overlay","scrollTo","e","closest","innerText","stopPropagation","$clickedButton","clickedButtonText","_ref","container","_ref2","screenSection","buttonsInSection","filter","trim","buttonIndex","index","headline","first","gtmCustomerNumber","headlineComponent","indexComponent","screen_name","screen_section","event","$overlayContent","is","target","has","handleMediaQueryChange","matches","each","$img","hoverImage","startImage","Image","src","attr","off","addEventListener"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,E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AAMe,OAAOqC,SAAWP,KAK/BQ,EAAgC,iBAAlBJ,GAAoCC,EAAiBlC,OAAS,EAAIkC,EAAiBI,MAAMV,GAAkB,EAAI,KAG7HW,EAA6B,YAAlBN,EACXF,EAAU1C,KAAK,+BAA+BmD,QAAQzC,OAAOqC,OAC7D,GAGAK,EAAoB9D,EAAE,cAAcwC,KAAK,YAGzCuB,EAAoBH,EAAQ,GAAAzB,OAAMyB,EAAQ,KAAM,GAChDI,EAAiBN,EAAW,IAAAvB,OAAOuB,GAAgB,GAInDrB,EAAY,CACd4B,YAAa,UACb3B,WALW,GAAAH,OAAM4B,GAAiB5B,OAAGe,GAAiBf,OAAG6B,GAMzDzB,eAAgBuB,EAChBI,eAAgBZ,GAIpBtD,EAAE,QAAQyC,QAAQ,eAAgBJ,MAItCrC,EAAEC,UAAUG,GAAG,SAAS,SAAU+D,GAC9B,IAAMxB,EAAW3C,EAAE,mBACboE,EAAkBzB,EAASjC,KAAK,oBAElCiC,EAAStB,SAAW+C,EAAgBC,GAAGF,EAAMG,SAAwD,IAA7CF,EAAgBG,IAAIJ,EAAMG,QAAQjD,QAC1FqB,OAKR1C,EAAEkB,QAAQd,GAAG,QAAQ,WAsBjB,SAASoE,EAAuB9C,GACxBA,EAAW+C,QArBfzE,EAAE,kBAAkB0E,MAAK,WACrB,IAAMC,EAAO3E,EAAEK,MACTuE,EAAaD,EAAKnC,KAAK,eACvBqC,EAAaF,EAAKnC,KAAK,gBAEH,IAAIsC,OACZC,IAAMH,EAGxBD,EAAKvE,GAAG,cAAc,WAClBuE,EAAKK,KAAK,MAAOJ,MAIrBD,EAAKvE,GAAG,cAAc,WAClBuE,EAAKK,KAAK,MAAOH,SAUrB7E,EAAE,kBAAkBiF,IAAI,yBAIhCT,EAAuB9C,GAEvBR,OAAOgE,iBAAiB,UAAU","file":"default/js/storePage.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 303);\n","module.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","var processInclude = require('./util');\n\n$(document).ready(function () {\n processInclude(require('./storePage/petInfoComponent'));\n processInclude(require('./storePage/recipePage'));\n});\n","module.exports = {\n seeMoreButton: function () {\n $(document).on('click', '.read-more-button', function () {\n $(this).addClass('d-none');\n $(this).next().removeClass('d-none');\n $(this).parent().find('.customer-review, .pd-content-pet-info-text-main').addClass('expanded');\n $('.pd-content-pet-info').addClass('expanded');\n });\n $(document).on('click', '.read-less-button', function () {\n $(this).addClass('d-none');\n $(this).prev().removeClass('d-none');\n $(this).parent().find('.customer-review, .pd-content-pet-info-text-main').removeClass('expanded');\n $('.pd-content-pet-info').removeClass('expanded');\n $('html, body').animate({\n scrollTop: $('.pd-content-pet-info').offset().top\n }, 500);\n });\n\n var $informationTab = $('.pd-content-pet-info-text-main');\n var $seeMoreButton = $('.read-more-button');\n\n if (window.innerWidth < 426) {\n if ($informationTab.text().length > 200) {\n $seeMoreButton.show();\n }\n else {\n $seeMoreButton.hide();\n }\n }\n else {\n if ($informationTab.text().length > 400) {\n $seeMoreButton.show();\n }\n else {\n $seeMoreButton.hide();\n }\n }\n\n }\n};\n","module.exports = {\n init: function () {\n let scrollPosition = 0;\n const mediaQuery = window.matchMedia('(min-width: 768px)');\n\n const triggerOverlay = (overlayId, ingredientCard, elementClicked) => {\n const targetDiv = $('#' + overlayId);\n if (targetDiv.length) {\n scrollPosition = window.scrollY;\n if (scrollPosition > 0) {\n $('body').css({\n top: `-${scrollPosition}px`,\n });\n }\n $('body').addClass('no-scroll');\n targetDiv.toggleClass('d-none active');\n\n const gtmCustomerNumber = $('.storepage').data('customer');\n\n const eventData = {\n click_path: ingredientCard + '|' + elementClicked,\n customerNumber: gtmCustomerNumber\n };\n\n // Trigger the GTM event\n $('body').trigger('gtm:recipeOverlay', eventData);\n }\n };\n\n // Helper function to close the overlay\n const closeOverlay = () => {\n const $overlay = $('.overlay.active');\n if ($overlay.length) {\n $overlay.toggleClass('d-none active');\n $('body').removeClass('no-scroll').css({ top: '' });\n if (scrollPosition > 0) {\n window.scrollTo(0, scrollPosition);\n }\n scrollPosition = 0; // Reset scroll position tracker\n }\n };\n\n // Event handler for ingredient card CTA button click\n $(document).on('click', '.cta-button-wrapper button', function (e) {\n const overlayId = $(this).data('overlay-id');\n const ingredientCard = $(this).closest('.ingredient-card').find('.headline')[0].innerText;\n\n if (overlayId) {\n triggerOverlay(overlayId, ingredientCard, 'Button');\n e.stopPropagation();\n }\n });\n\n // Event handler for image click within ingredient card\n $(document).on('click', '.ingredient-card .image-wrapper img', function (e) {\n const $ctaButton = $(this).closest('.ingredient-card').find('.cta-button-wrapper button');\n const overlayId = $ctaButton.data('overlay-id');\n const ingredientCard = $(this).closest('.ingredient-card').find('.headline')[0].innerText;\n\n if (overlayId) {\n triggerOverlay(overlayId, ingredientCard, 'Image');\n e.stopPropagation();\n }\n });\n\n // Event handler for overlay close button click\n $(document).on('click', '.overlay-inner-content .close-button', function () {\n closeOverlay();\n });\n\n // Event handler for landing page CTA link click\n $(document).on('click', 'a.btn, button.btn', function () {\n const $clickedButton = $(this);\n const clickedButtonText = $clickedButton[0].innerText;\n\n // Define sections and their selectors\n const sectionMap = [\n { name: 'overlay', container: $clickedButton.closest('.overlay-content') },\n { name: 'header', container: $clickedButton.closest('.navbar, .nav-icons-content') },\n { name: 'footer', container: $clickedButton.closest('.site-footer') },\n { name: 'main section', container: $('.col-12>.experience-component:not(.experience-commerce_layouts-recipeOverlay)') }\n ];\n\n // Find the matching section\n const { name: screenSection, container } = sectionMap.find(({ container }) => container.length) || { name: 'main section', container: $('body') };\n\n // Get all buttons within the identified section that have the same text as the clicked button\n const buttonsInSection = container.find('a.btn, button.btn').filter(function () {\n return $(this).text().trim() === clickedButtonText;\n });\n\n // Get the index of the clicked button only for main section\n // and for buttons that have at least one duplicate (in terms of text inside the button)\n const buttonIndex = screenSection === 'main section' && buttonsInSection.length > 1 ? buttonsInSection.index($clickedButton) + 1 : null;\n\n // Get headline if in the overlay section\n const headline = screenSection === 'overlay'\n ? container.find('.headline-wrapper .headline').first().text().trim()\n : '';\n\n // Get customer number\n const gtmCustomerNumber = $('.storepage').data('customer');\n\n // Construct the click path\n const headlineComponent = headline ? `${headline}|` : '';\n const indexComponent = buttonIndex ? `|${buttonIndex}` : '';\n const clickPath = `${headlineComponent}${clickedButtonText}${indexComponent}`;\n\n // Prepare event data\n const eventData = {\n screen_name: 'recipes',\n click_path: clickPath,\n customerNumber: gtmCustomerNumber,\n screen_section: screenSection\n };\n\n // Trigger the GTM event\n $('body').trigger('gtm:clickCTA', eventData);\n });\n\n // Event handler for clicking outside the overlay\n $(document).on('click', function (event) {\n const $overlay = $('.overlay.active');\n const $overlayContent = $overlay.find('.overlay-content');\n\n if ($overlay.length && !$overlayContent.is(event.target) && $overlayContent.has(event.target).length === 0) {\n closeOverlay();\n }\n });\n\n // Handling dynamic images that change on hover\n $(window).on('load', function () {\n function setupImageHover() {\n $('.dynamic-image').each(function () {\n const $img = $(this);\n const hoverImage = $img.data('hover-image');\n const startImage = $img.data('start-image');\n\n const preloadHoverImage = new Image();\n preloadHoverImage.src = hoverImage;\n\n // Change image to hover version on mouseenter\n $img.on('mouseenter', function () {\n $img.attr('src', hoverImage);\n });\n\n // Change image back to the original on mouseleave\n $img.on('mouseleave', function () {\n $img.attr('src', startImage);\n });\n });\n }\n\n function handleMediaQueryChange(mediaQuery) {\n if (mediaQuery.matches) {\n setupImageHover(); // Apply hover effect on desktop\n } else {\n // Remove hover event listeners when switching to mobile\n $('.dynamic-image').off('mouseenter mouseleave');\n }\n }\n\n handleMediaQueryChange(mediaQuery);\n\n window.addEventListener('resize', () => {\n handleMediaQueryChange;\n });\n });\n }\n};\n"],"sourceRoot":""}