(function () { 'use strict'; function hasVideos() { return document.querySelectorAll('video').length > 0; } function initVideoPlayer() { if (!hasVideos()) return; document.querySelectorAll('video').forEach(function (video) { video.disablePictureInPicture = true; }); var script = document.createElement('script'); script.src = 'https://cdn.jsdelivr.net/npm/lazy-load-video@latest/dist/custom-video.js'; script.async = true; document.head.appendChild(script); var hero = document.querySelector('.section.is-hero'); var heroVideo = hero && hero.querySelector('.header_background-video-wrapper video'); if (hero && heroVideo) { var visibilityObserver = new IntersectionObserver(function (entries) { var entry = entries[0]; if (!entry) return; if (entry.isIntersecting) { heroVideo.play().catch(function () {}); } else { heroVideo.pause(); } }, { threshold: 0 }); visibilityObserver.observe(hero); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initVideoPlayer); } else { initVideoPlayer(); } })();