{"version":3,"sources":["initializeHomePage.js"],"names":["win","$","initialized","fp","home","init","debouncedResizeHandler","handleResize","hasClass","setTimeout","addClass","sizeDetector","root","document","documentElement","headerHeight","outerHeight","style","setProperty","logoMobileHeight","utilityHeight","specialMessageHeight","css","stickyFooterHeight","window","scroll","scrollTop","removeClass","func","delay","let","timeoutId","context","this","args","arguments","clearTimeout","apply","addEventListener","setBgImage","imgInfo","pixelDensity","devicePixelRatio","screenSize","width","innerWidth","filteredImages","filter","img","assetSize","length","randomBackgroundImage","Math","floor","random","slideshowEl","getElementsByClassName","backgroundImage","imagePath","altText","setAttribute"],"mappings":"AAAA,CAAA,SAAAA,EAAAC,GACA,aACA,IAKAC,EALAC,EAAAH,EAAAG,GAAA,KAAA,IAAAH,EAAAG,GAAAH,EAAAG,GAAA,GACAA,EAAAC,KAAA,KAAA,IAAAD,EAAAC,KAAAD,EAAAC,KAAA,GAEAD,EAAAC,MAEAF,EAAA,CAAA,EAqBA,CACAG,KAAA,WACA,IAwGAC,EApBA,SAAAC,IAZAN,EAAA,MAAA,EAAAO,SAAA,UAAA,GACAC,WAAA,WACAR,EAAA,MAAA,EAAAS,SAAA,UAAA,CACA,EAAA,GAAA,EAWAC,CAvDA,MAAAC,EAAAC,SAAAC,gBAEA,IAAAC,EAAAd,EAAA,QAAA,EAAAe,YAAA,EACAD,MAAAA,IACAA,EAAA,GAEAH,EAAAK,MAAAC,YAAA,kBAAAH,EAAA,IAAA,EAGAI,OAAAA,EADAlB,EAAA,cAAA,EAAAe,YAAA,KAEAG,EAAA,GAEAP,EAAAK,MAAAC,YAAA,uBAAAC,EAAA,IAAA,EAGAC,OAAAA,EADAnB,EAAA,UAAA,EAAAe,YAAA,KAEAI,EAAA,GAEAR,EAAAK,MAAAC,YAAA,mBAAAE,EAAA,IAAA,EAGAC,OAAAA,EADApB,EAAA,iCAAA,EAAAe,YAAA,IACA,SAAAf,EAAA,iCAAA,EAAAqB,IAAA,SAAA,IACAD,EAAA,GAEAT,EAAAK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EACAJ,EAAAK,aAAA,OAAA,KAAA,GAEA,CACA,EAEA,EAAApC,OAAAvB,CAAA","file":"homepage-567fd2f77d.js","sourcesContent":["(function (win, $) {\n 'use strict';\n var fp = (win.fp = typeof win.fp !== 'undefined' ? win.fp : {}),\n home = (fp.home = typeof fp.home !== 'undefined' ? fp.home : {});\n\n fp.home = (function () {\n var windowHeight;\n var initialized = false;\n\n var getScreenSize = function () {\n var pixelDensity = window.devicePixelRatio || 1;\n var width = window.innerWidth * pixelDensity;\n\n if (width >= 2400) {\n return 'xlarge';\n }\n if (width >= 1400) {\n return 'large';\n }\n if (width >= 1000) {\n return 'medium';\n }\n if (width >= 600) {\n return 'small';\n }\n return 'xsmall';\n };\n\n return {\n init: function () {\n if (initialized) {\n return;\n }\n initialized = true;\n\n // =========================================\n // Set selected nav\n // =========================================\n $('.homepage-link').addClass('selected');\n\n // =========================================\n // Detect scroll\n // =========================================\n\n $(window).scroll(function () {\n var height = $(window).scrollTop();\n\n if (height > 50) {\n $('body').addClass(\"scrolled-down\");\n } else {\n $('body').removeClass(\"scrolled-down\");\n }\n });\n\n // =========================================\n // Detect sizes\n // =========================================\n\n function sizeDetector() {\n // Define header and mobile utility height and set css variable\n\n const root = document.documentElement;\n\n var headerHeight = $('header').outerHeight();\n if (headerHeight === undefined || headerHeight === null) {\n headerHeight = 0;\n }\n root.style.setProperty(\"--header-height\", headerHeight + \"px\");\n\n var logoMobileHeight = $('#logo-mobile').outerHeight();\n if (logoMobileHeight === undefined || logoMobileHeight === null) {\n logoMobileHeight = 0;\n }\n root.style.setProperty(\"--logo-mobile-height\", logoMobileHeight + \"px\");\n\n var utilityHeight = $('#utility').outerHeight();\n if (utilityHeight === undefined || utilityHeight === null) {\n utilityHeight = 0;\n }\n root.style.setProperty(\"--utility-height\", utilityHeight + \"px\");\n\n var specialMessageHeight = $('#special-message.message-banner').outerHeight();\n if (specialMessageHeight === undefined || specialMessageHeight === null || $('#special-message.message-banner').css('display') === 'none') {\n specialMessageHeight = 0;\n }\n root.style.setProperty(\"--special-message-height\", specialMessageHeight + \"px\");\n\n var stickyFooterHeight = $('#ao-sticky').outerHeight();\n if (stickyFooterHeight === undefined || stickyFooterHeight === null || $('#ao-sticky').css('display') === 'none') {\n stickyFooterHeight = 0;\n }\n root.style.setProperty(\"--sticky-footer-height\", stickyFooterHeight + \"px\");\n\n }\n\n // =========================================\n // Adjust size of hero\n // =========================================\n\n function setHeroSize() {\n\n // This, along with some CSS, helps smooth out scrolling on small screens\n if (!$('body').hasClass('hero-set')) {\n setTimeout(function () {\n $('body').addClass('hero-set');\n }, 1000);\n }\n }\n\n // =========================================\n // Window Resize Handler\n // =========================================\n\n // Function to be called after window resize\n function handleResize() {\n setHeroSize();\n sizeDetector();\n //console.log(\"Window has finished resizing!\");\n }\n\n // Debounce function\n function debounce(func, delay) {\n let timeoutId;\n return function () {\n const context = this;\n const args = arguments;\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n func.apply(context, args);\n }, delay);\n };\n }\n\n // Debounced version of handleResize\n const debouncedResizeHandler = debounce(handleResize, 250); // Adjust delay as needed\n\n // Event listener for window resize\n window.addEventListener('resize', debouncedResizeHandler);\n\n // Triggered on initial load\n window.addEventListener('load', function () {\n setTimeout(handleResize, 250); // Same delay as for window resizing\n });\n\n },\n\n setBgImage: function (imgInfo) {\n var screenSize = getScreenSize();\n var filteredImages = imgInfo.filter(function (img) {\n return img.assetSize === screenSize;\n });\n if (filteredImages.length === 0) {\n return;\n }\n\n var randomNumber = Math.floor(Math.random() * filteredImages.length);\n var randomBackgroundImage = filteredImages[randomNumber];\n\n var slideshowEl = document.getElementsByClassName('slideshow')[0];\n slideshowEl.style.backgroundImage = \"url('\" + randomBackgroundImage.imagePath + \"')\";\n if (randomBackgroundImage.altText) {\n slideshowEl.setAttribute(\"aria-label\", randomBackgroundImage.altText);\n slideshowEl.setAttribute('role', 'img');\n }\n }\n };\n })();\n})(window, $);"]}