"use strict";(globalThis.webpackChunk_plex_client_qt=globalThis.webpackChunk_plex_client_qt||[]).push([["packages_app-splash_showVideoSplashScreen_ts-packages_app-splash_assets_startup_mp4"],{71008:(e,s,t)=>{t.d(s,{showVideoSplashScreen:()=>p});const o=t.p+"assets/startup.c90d1036851e1ca309d0.mp4",n=500,a=2e3;function p(e=!1){const s=document.createElement("video");let t,p;return s.muted=!e,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.transition=`opacity ${n}ms`,document.body.appendChild(s),console.debug("[AppSplash] Loading Animation..."),{start:()=>(s.src=o,t=new Promise((e=>{console.debug("[AppSplash] Playing video.");const t=()=>{console.debug("[AppSplash] Video complete."),e(),s.removeEventListener("ended",o),s.removeEventListener("ended",t),p=Date.now()},o=()=>{console.debug("[AppSplash] Video complete."),e(),s.removeEventListener("ended",t),s.removeEventListener("error",o),p=Date.now()};s.addEventListener("ended",t),s.addEventListener("error",o),s.play()})),t),dismiss:async()=>{if(!t)return console.debug("[AppSplash] Animation failed."),Promise.resolve();await t;const e=Date.now()-p;e<a&&await new Promise((s=>{setTimeout(s,a-e)})),s.style.opacity="0",setTimeout((()=>{console.debug("[AppSplash] Destroying splash screen."),s.remove()}),n)}}}}}]);