1import"./BPlt5jNJ.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="8c4eec68-fdd1-41f5-b6f6-4dafb6a8ea2e",t._sentryDebugIdIdentifier="sentry-dbid-8c4eec68-fdd1-41f5-b6f6-4dafb6a8ea2e")}catch{}{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=Object.assign({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:splash-application":!0})}class i extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videotitle"]}connectedCallback(){this.addEventListener("pointerover",i.warmConnections,{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(e){this.setAttribute("videoid",e)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(e){this.setAttribute("playlistid",e)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(e){this.setAttribute("videotitle",e)}get videoPlay(){return this.getAttribute("videoPlay")||"Play"}set videoPlay(e){this.setAttribute("videoPlay",e)}get videoStartAt(){return Number(this.getAttribute("videoStartAt")||"0")}set videoStartAt(e){this.setAttribute("videoStartAt",String(e))}get autoLoad(){return this.hasAttribute("autoload")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}setupDom(){const e=this.attachShadow({mode:"open"});e.innerHTML=` 2 <style> 3 :host { 4 contain: content; 5 display: block; 6 position: relative; 7 width: 100%; 8 padding-bottom: calc(100% / (16 / 9)); 9 --lyt-animation: all 0.2s cubic-bezier(0, 0, 0.2, 1); 10 --lyt-play-btn-default: #212121; 11 --lyt-play-btn-hover: #f00; 12 } 13 14 #frame, #fallbackPlaceholder, iframe { 15 position: absolute; 16 width: 100%; 17 height: 100%; 18 left: 0; 19 } 20 21 #frame { 22 cursor: pointer; 23 } 24 25 #fallbackPlaceholder { 26 object-fit: cover; 27 } 28 29 #frame::before { 30 content: ''; 31 display: block; 32 position: absolute; 33 top: 0; 34 background-image: linear-gradient(180deg, #111 -20%, transparent 90%); 35 height: 60px; 36 width: 100%; 37 transition: var(--lyt-animation); 38 z-index: 1; 39 } 40 41 #playButton { 42 width: 70px; 43 height: 46px; 44 background-color: var(--lyt-play-btn-hover); 45 z-index: 1; 46 opacity: 0.8; 47 border-radius: 14%; 48 transition: var(--lyt-animation); 49 border: 0; 50 } 51 52 #frame:hover > #playButton { 53 background-color: var(--lyt-play-btn-hover); 54 opacity: 1; 55 } 56 57 #playButton:before { 58 content: ''; 59 border-style: solid; 60 border-width: 11px 0 11px 19px; 61 border-color: transparent transparent transparent #fff; 62 } 63 64 #playButton, 65 #playButton:before { 66 position: absolute; 67 top: 50%; 68 left: 50%; 69 transform: translate3d(-50%, -50%, 0); 70 } 71 72 /* Post-click styles */ 73 .activated { 74 cursor: unset; 75 } 76 77 #frame.activated::before, 78 #frame.activated > #playButton { 79 display: none; 80 } 81 </style> 82 <div id="frame"> 83 <picture> 84 <!-- <source id="webpPlaceholder" type="image/webp"> --> 85 <source id="jpegPlaceholder" type="image/jpeg"> 86 <img id="fallbackPlaceholder" referrerpolicy="origin"> 87 </picture> 88 <button id="playButton"></button> 89 </div> 90 `,this.domRefFrame=e.querySelector("#frame"),this.domRefImg={fallback:e.querySelector("#fallbackPlaceholder"),jpeg:e.querySelector("#jpegPlaceholder")},this.domRefPlayButton=e.querySelector("#playButton")}setupComponent(){this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay} video: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay} video: ${this.videoTitle}`),this.autoLoad&&this.initIntersectionObserver()}attributeChangedCallback(e,r,a){switch(e){case"videoid":case"playlistid":{r!==a&&(this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1));break}}}addIframe(e=!1){if(!this.isIframeLoaded){const r=e?0:1,a=this.noCookie?"-nocookie":"";let o;this.playlistId?o=`?listType=playlist&list=${this.playlistId}&`:o=`${this.videoId}?`;const s=` 91<iframe frameborder="0" 92allow="accelerometer; autoplay; encrypted-media; gyroscope;
92 picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen 93src="https://www.youtube${a}.com/embed/${o}autoplay=${r}&${this.params}" 94></iframe>`;this.domRefFrame.insertAdjacentHTML("beforeend",s),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0;const n=this.shadowRoot.querySelector("iframe");n&&(n.setAttribute("title",`Youtube video player for ${this.videoTitle}`),e||requestAnimationFrame(()=>n.focus())),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){i.addPrefetch("preconnect","https://i.ytimg.com/");const e=`https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;this.domRefImg.fallback.loading=this.posterLoading,this.domRefImg.jpeg.srcset=e,this.domRefImg.fallback.src=e,this.domRefImg?.fallback?.setAttribute("alt","")}initIntersectionObserver(){const e={root:null,rootMargin:"0px",threshold:0};new IntersectionObserver((a,o)=>{a.forEach(s=>{s.isIntersecting&&!this.isIframeLoaded&&(i.warmConnections(),this.addIframe(!0),o.unobserve(this))})},e).observe(this)}static addPrefetch(e,r,a){const o=document.createElement("link");o.rel=e,o.href=r,a&&(o.as=a),o.crossOrigin="true",document.head.append(o)}static warmConnections(){i.isPreconnected||(i.addPrefetch("preconnect","https://s.ytimg.com"),i.addPrefetch("preconnect","https://www.youtube.com"),i.addPrefetch("preconnect","https://www.google.com"),i.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),i.addPrefetch("preconnect","https://static.doubleclick.net"),i.isPreconnected=!0)}}i.isPreconnected=!1;customElements.define("lite-youtube",i);export{i as LiteYTEmbed};
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.