{"version":3,"sources":["initializeHomepage.js"],"names":["win","$","fp","home","setHeroSize","initialLoad","height","window","headerHeight","outerHeight","specialMessageHeight","fixedFooterHeight","logoMobileHeight","specialMessage","length","is","fixedFooter","logoMobile","maxHeight","css","removeClass","setTimeout","addClass","init","video","videoButton","videoButtonIcon","controlAnnouncements","document","getElementById","querySelector","addEventListener","paused","play","setAttribute","classList","replace","textContent","pause","resize","setBgImage","imgInfo","slideshowEl","screenSize","filteredImages","Array","isArray","pixelDensity","devicePixelRatio","width","innerWidth","filter","img","assetSize","randomImage","Math","floor","random","style","backgroundImage","imagePath","altText"],"mappings":"AAAA,CAAA,SAAAA,EAAAC,GACA,aACAC,EAAAF,EAAAE,GAAA,KAAA,IAAAF,EAAAE,GAAAF,EAAAE,GAAA,GACAA,EAAAC,KAAA,KAAA,IAAAD,EAAAC,KAAAD,EAAAC,KAAA,GA4BA,SAAAC,EAAAC,GACA,IAAAC,EAAAL,EAAAM,MAAA,EAAAD,OAAA,EACAE,EAAAP,EAAA,QAAA,EAAAQ,YAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,GAGAC,EADAZ,EAAA,iCAAA,GACAa,QAAAD,EAAAE,GAAA,UAAA,IACAL,EAAAG,EAAAJ,YAAA,IAIAO,EADAf,EAAA,eAAA,GACAa,QAAAE,EAAAD,GAAA,UAAA,IACAJ,EAAAK,EAAAP,YAAA,GAbA,IAgBAQ,EAAAhB,EAAA,cAAA,EAKAiB,EAAAZ,EAAAI,EAAAF,GAHAI,EADAK,EAAAH,QAAAG,EAAAF,GAAA,UAAA,EACAE,EAAAR,YAAA,EAGAG,GAAAD,EACAV,EAAA,YAAA,EAAAkB,IAAA,SAAAD,CAAA,EAGAb,IACAJ,EAAA,MAAA,EAAAmB,YAAA,oBAAA,EACAC,WAAA,WACApB,EAAA,MAAA,EAAAqB,SAAA,UAAA,CACA,EAAA,GAAA,EAEA,CAvCApB,EAAAC,KA4GA,CACAoB,KAAA,WA3BA,IACAC,EACAC,EACA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{\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 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 fp.home = (function () {\n var windowHeight;\n var initialized = false;\n\n // =========================================\n // Set Hero Size\n // =========================================\n var setHeroSize = function (initialLoad) {\n var height = $(window).height();\n var headerHeight = $('header').outerHeight(); // Fixed: added parentheses\n var specialMessageHeight = 0; // Default to 0 in case special message (banner) doesn't exist\n var fixedFooterHeight = 0; // Default to 0 in case fixed footer doesn't exist\n var logoMobileHeight = 0; // Default to 0 in case logo-mobile doesn't exist\n\n var specialMessage = $('#special-message.message-banner');\n if (specialMessage.length && specialMessage.is(':visible')) {\n specialMessageHeight = specialMessage.outerHeight();\n }\n\n var fixedFooter = $('#fixed-footer');\n if (fixedFooter.length && fixedFooter.is(':visible')) {\n fixedFooterHeight = fixedFooter.outerHeight();\n }\n\n var logoMobile = $('#logo-mobile');\n if (logoMobile.length && logoMobile.is(':visible')) {\n logoMobileHeight = logoMobile.outerHeight();\n }\n\n var maxHeight = height - specialMessageHeight - headerHeight - logoMobileHeight - fixedFooterHeight;\n $('.slideshow').css('height', maxHeight);\n //console.log(\"SLIDESHOW HEIGHT: \" + maxHeight);\n\n if (initialLoad) {\n $('body').removeClass('fade-home-contents');\n setTimeout(function () {\n $('body').addClass('hero-set');\n }, 1000);\n }\n };\n\n // =========================================\n // Set Background Image\n // =========================================\n var setBgImage = function (imgInfo) {\n if (!Array.isArray(imgInfo) || !imgInfo.length) {\n //console.warn(\"[setBgImage] Invalid or empty imgInfo array.\");\n return;\n }\n\n var slideshowEl = document.querySelector('.slideshow.slideshow-photo');\n\n if (!slideshowEl) {\n //console.warn(\"[setBgImage] .slideshow.slideshow-photo not found in DOM.\");\n return;\n }\n\n var screenSize = getScreenSize();\n var filteredImages = imgInfo.filter(function (img) {\n return img.assetSize === screenSize;\n });\n\n if (!filteredImages.length) {\n //console.warn(`[setBgImage] No matching images found for screen size: ${screenSize}`);\n return;\n }\n\n var randomImage = filteredImages[Math.floor(Math.random() * filteredImages.length)];\n\n slideshowEl.style.backgroundImage = `url('${randomImage.imagePath}')`;\n\n if (randomImage.altText) {\n slideshowEl.setAttribute('aria-label', randomImage.altText);\n slideshowEl.setAttribute('role', 'img');\n }\n\n //console.log(`[setBgImage] Applied background: ${randomImage.imagePath}`);\n };\n\n // =========================================\n // Set Video Controls\n // =========================================\n var setupVideoControls = function () {\n var video = document.getElementById('bg-video');\n var videoButton = document.getElementById('video-pause-play');\n var videoButtonIcon = videoButton ? videoButton.querySelector('span') : null; // Fixed here\n var controlAnnouncements = document.getElementById('video-control-announcements');\n\n if (!video || !videoButton || !controlAnnouncements) {\n return;\n }\n\n videoButton.addEventListener('click', function () {\n if (!video.paused) {\n video.pause();\n videoButton.setAttribute('aria-label', 'Play video');\n videoButtonIcon.classList.replace('icon-pause', 'icon-play');\n controlAnnouncements.textContent = 'Video paused';\n } else {\n video.play();\n videoButton.setAttribute('aria-label', 'Pause video');\n videoButtonIcon.classList.replace('icon-play', 'icon-pause');\n controlAnnouncements.textContent = 'Video playing';\n }\n });\n };\n\n // Public API\n return {\n init: function () {\n $('.homepage-link').addClass('selected');\n\n // Initialize hero size\n setHeroSize(true);\n\n // Initialize video controls\n setupVideoControls();\n\n $(window).resize(function () {\n setHeroSize(false);\n });\n },\n setBgImage: setBgImage\n };\n })();\n})(window, $);"]}