import"./modulepreload-polyfill.b7f2da20.js";const{callNative:n,callNativeSync:a}=window.biliBridgePc;window.initLoginPage=(i,r,l,o)=>{let t="../main/assets/bili-inject.js";a("app/isDev")&&(t=t.replace(/^\.\.\//,"../../app/"));const e=document.querySelector(".login-webview");e.setAttribute("preload",t),e.setAttribute("useragent",navigator.userAgent.replace(/bilibili(?=\/\d*\.\d*\.)/,"bilibili_pc")),e.setAttribute("src",r),e.addEventListener("did-fail-load",()=>{const d=document.querySelector(".network-error");d.style.display="block"}),e.addEventListener("dom-ready",()=>{o&&e.insertCSS(o),l&&e.executeJavaScript(l),setTimeout(()=>{e.style.display="inline-flex",n("auth/loginWebviewReady"),setInterval(()=>n("auth/handleLoginXhr"),1e3)},200)}),window.webviewRef=e};window.addEventListener("load",()=>{if(!a("system/isMac")){const i=document.querySelector(".close-button");i.style.display="flex",i.addEventListener("click",()=>n("window/close"))}});
