1let e=null,t=null,o=null;function n(e,t){e.classList.add("video-block__video_preview"),e.style.display="block",e.style.width="100%",e.style.aspectRatio="16 / 9",e.style.backgroundImage=`url("https://i.ytimg.com/vi/${t}/hqdefault.jpg")`,e.style.backgroundPosition="center",e.style.backgroundSize="cover",e.style.backgroundRepeat="no-repeat",e.style.cursor="pointer",e.setAttribute("role","button"),e.tabIndex=0}function r(){!function(){if(document.querySelector('meta[name="referrer"]'))return;const e=document.createElement("meta");e.name="referrer",e.content="strict-origin-when-cross-origin",document.head.appendChild(e)}(),document.querySelectorAll(".energy .video-block").forEach((r=>{const i=r.querySelector(".video-block__video"),a=r.querySelector(".video-block__link")?.dataset.videoId;if(!i||!a||"1"===i.dataset.mainYoutubeInit)return;i.dataset.mainYoutubeInit="1",i.dataset.videoId=a,n(i,a);const d=()=>async function(r,i){await(window.YT?.Player?Promise.resolve(window.YT):e||(e=new Promise((e=>{const t=window.onYouTubeIframeAPIReady;if(window.onYouTubeIframeAPIReady=()=>{"function"==typeof t&&t(),e(window.YT)},!document.querySelector('script[src="https://www.youtube.com/iframe_api"]')){const e=document.createElement("script");e.src="https://www.youtube.com/iframe_api",document.head.appendChild(e)}})),e)),t&&o===r?t.playVideo():(t&&o&&(t.stopVideo(),t.destroy(),n(o,o.dataset.videoId)),function(e){e.classList.remove("video-block__video_preview"),e.style.backgroundImage="",e.style.backgroundPosition="",e.style.backgroundSize="",e.style.backgroundRepeat=""}(r),o=r,t=new YT.Player(r,{videoId:i,playerVars:{playsinline:1,controls:1,rel:0,widget_referrer:window.location.origin},events:{onReady:e=>{e.target.playVideo()},onError:e=>{}}}))}(i,a);i.addEventListener("click",d),i.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d())}))}))}export{r as initMainYoutubeVideos};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.