let videoLazyLoadObserver;document.addEventListener("DOMContentLoaded",()=>{let r=(t,o)=>{let r="VIDEO"===t.tagName?t:t.querySelector("iframe");var e="VIDEO"===t.tagName?"loadeddata":"load";!r.getAttribute("src")&&r.getAttribute("data-src")&&r.setAttribute("src",r.getAttribute("data-src")),r.muted=!0,r.addEventListener(e,()=>{var e;o&&o!==t?o.style.display="none":(e=t.nextElementSibling)&&(e.style.display="none"),r.play()})},t=e=>{var t,e=e.currentTarget;let o;e.classList.contains("wp-block-uicore-icon")?(t=e.closest(".uicore-video"))&&!(o=t.querySelector(".uicore-bl-video")).hasAttribute("data-hide-controls")&&(o.controls=!0):e.classList.contains("uicore-bl-video")?(o=e).hasAttribute("data-hide-controls")||(o.controls=!0):o=e.previousElementSibling,r(o,e)};function e(){videoLazyLoadObserver=new IntersectionObserver(e=>{e.forEach(e=>{var t;e.isIntersecting&&(t=(e=e.target).nextElementSibling,r(e,t),videoLazyLoadObserver.unobserve(e))})},{rootMargin:"350px"}),document.querySelectorAll(".uicore-bl-lazy").forEach(e=>{videoLazyLoadObserver.observe(e)}),window.removeEventListener("scroll",e),window.removeEventListener("click",e),window.removeEventListener("keydown",e)}document.querySelectorAll(".uicore-bl-video-cover, .uicore-bl-video, .wp-block-uicore-icon").forEach(e=>{e.addEventListener("click",t,{once:!0})}),window.addEventListener("scroll",e,{once:!0}),window.addEventListener("click",e,{once:!0}),window.addEventListener("keydown",e,{once:!0})});