File: /www/server/panel/BTPanel/static/js/login.js
var T=Object.defineProperty;var S=(g,s,e)=>s in g?T(g,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):g[s]=e;var h=(g,s,e)=>(S(g,typeof s!="symbol"?s+"":s,e),e);function B(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}class v{constructor(){h(this,"autoLoginParams",{password:"",username:""});h(this,"BASE64_ALPHABET","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");h(this,"standardBase64Encode",s=>{let e="",t=0;const i=new TextEncoder().encode(s);for(;t<i.length;){const o=i[t++]||0,r=i[t++]||0,n=i[t++]||0,a=o>>2,l=(o&3)<<4|r>>4,c=(r&15)<<2|n>>6,u=n&63;e+=this.BASE64_ALPHABET[a],e+=this.BASE64_ALPHABET[l],e+=t>i.length+1?"=":this.BASE64_ALPHABET[c],e+=t>i.length?"=":this.BASE64_ALPHABET[u]}return e});h(this,"standardBase64Decode",s=>{s=s.replace(/[^A-Za-z0-9+/=]/g,"");let e="",t=0;for(;t<s.length;){const i=this.BASE64_ALPHABET.indexOf(s[t++]||"="),o=this.BASE64_ALPHABET.indexOf(s[t++]||"="),r=this.BASE64_ALPHABET.indexOf(s[t++]||"="),n=this.BASE64_ALPHABET.indexOf(s[t++]||"="),a=i<<2|o>>4,l=(o&15)<<4|r>>2,c=(r&3)<<6|n;e+=String.fromCharCode(a),r!==-1&&(e+=String.fromCharCode(l)),n!==-1&&(e+=String.fromCharCode(c))}return new TextDecoder().decode(new TextEncoder().encode(e))});h(this,"base64UrlSafeEncode",(s,e=!0)=>{let t=this.standardBase64Encode(s);return t=t.replace(/\+/g,"-").replace(/\//g,"_"),e&&(t=t.replace(/=/g,"")),t});h(this,"base64UrlSafeDecode",s=>{let e=s.replace(/-/g,"+").replace(/_/g,"/");const t=(4-e.length%4)%4;return t>0&&(e+="=".repeat(t)),this.standardBase64Decode(e)})}static getLogoSrc(){var s;return((s=window.vite_public_panel_theme)==null?void 0:s.login.logo)||"/static/icons/logo-green.svg"}checkAutoLogin(){return new Promise((s,e)=>{const t=new URL(window.location.href);t.search!==""&&(new URLSearchParams(t.search).forEach((o,r)=>{this.autoLoginParams[r]=o}),this.autoLoginParams.username&&this.autoLoginParams.password&&s(this.autoLoginParams))})}bindEvent(s,e,t){s&&s.addEventListener?s.addEventListener(e,t,!1):s&&s.attachEvent?s.attachEvent("on".concat(e),t||null):s["on".concat(e)]=t||null}delegateEvent(s,e,t,i){typeof t=="string"&&s?s.addEventListener(e,function(o){const n=o.target.closest(t);this.contains(n)&&i&&i.call(n,o)},!1):typeof t!="string"&&this.bindEvent(s,e,t)}convertType(s,e){if(typeof s===e)return s;if(e==="string")return String(s);if(e==="number")return Number(s);throw new Error("Unsupported target type: ".concat(e))}renderSelect(s){const{el:e,options:t,active:i,change:o,size:r}=s,n=document.createElement("div"),a=document.createElement("div");if(e.classList.add("form-select-module"),e.innerHTML="",r&&e.classList.add(r),a.classList.add("select-list"),t.length>0){let c=i;typeof i>"u"&&(c=t[0].key);for(let u=0;u<t.length;u++){const d=document.createElement("div");d.classList.add("select-item"),typeof t[u].disabled=="boolean"&&t[u].disabled&&d.classList.add("disabled"),d.innerText=t[u].label,d.dataset.key=t[u].key,d.dataset.disabled="".concat(Number(t[u].disabled)),t[u].key===c&&(d.classList.add("active"),n.innerText=t[u].label),a.appendChild(d)}}n.classList.add("select-display"),e.appendChild(n),e.appendChild(a);const l=c=>{c.target.classList.contains("disabled")&&c.target.classList.contains("select-item")?this.message({message:"当前选项不可选",type:"error",time:2e3}):(e.classList.remove("active"),window.removeEventListener("click",l))};return this.delegateEvent(n,"click",c=>{c.stopPropagation(),e.classList.toggle("active"),e.classList.contains("active")?window.addEventListener("click",l):window.removeEventListener("click",l)}),this.delegateEvent(a,"click",".select-item",c=>{const u=c.target,{key:d,disabled:m}=u.dataset,y=u.innerText;if(Number(m))return;const p=t.findIndex(f=>f.key===this.convertType(d,typeof f.key));a.querySelectorAll(".select-item").forEach((f,b)=>{p===b?f.classList.add("active"):f.classList.remove("active")}),n.innerText=y,e.classList.remove("active"),d&&(e.dataset.key=d),o&&d&&o(d,p)}),window.removeEventListener("click",l),e.dataset.key}validateForm(s){const{rules:e}=s,t={},i={};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){i[o]=document.querySelector('[name="'.concat(o,'"]'));const r=e[o];r.trigger&&r.trigger.forEach(n=>{let a=!1;t[o]=l=>{const c=i[l];return r.validator(c.value.trim(),function(u){var d,m,y,p,w;try{if(u)throw new Error(u);a=!1,(m=(d=c.parentElement)==null?void 0:d.querySelector(".error-tips"))==null||m.remove(),(y=c.parentElement)==null||y.classList.remove("error")}catch(f){const b=f.message.replace("Error: ",""),k=(p=c.parentElement)==null?void 0:p.querySelector(".error-tips");b&&(a=!0,(w=c.parentElement)==null||w.classList.add("error"),k?k.innerText=b:c.insertAdjacentHTML("afterend",'<div class="error-tips">'.concat(b,"</div>")))}}),a?new Error("".concat(l,":").concat(i[l].value)):!0},this.bindEvent(i[o],n,function(){if("isShow"in e[o]&&!e[o].isShow())return!0;const l=this.getAttribute("name");l&&t[l]&&t[l](l)})})}return o=>{let r=0;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const a=t[n];try{if("isShow"in e[n]&&!e[n].isShow())continue;const l=a(n);if(typeof l=="object")throw l}catch(l){return r++,i[n].focus(),!1}}if(!r){const n={};for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a)){const l=i[a],{value:c}=l;n[a]=c.trim()}o(n)}}}handleTransformRequest(s){let e="";for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)){const i=s[t];e+="".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(i),"&")}return e=e.slice(0,-1),e}async request({url:s,data:e,method:t}={method:"post",data:{},url:""}){return new Promise((i,o)=>{const r=new XMLHttpRequest;r.open(t,s,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.timeout=25e4,r.onreadystatechange=()=>{if(r.readyState===4)if(r.status>=200&&r.status<300)try{i({...r,data:JSON.parse(r.responseText)})}catch(n){i({...r,data:r.responseText,error:n})}else o(new Error(r.statusText))},r.ontimeout=()=>o(new Error("Request timed out")),r.onerror=()=>o(new Error("Network error")),r.send(this.handleTransformRequest(e))})}async rsaEncrypt(s){const{JSEncrypt:e}=window,t=window.vite_public_encryption;if(t.length<10)return s;const i=new e;return i.setPublicKey(t),i.encrypt(s)}async encryptionPasskey(s){const{JSEncrypt:e}=window,t=window.vite_public_encryption;if(!t||t.length<10)return s;try{const i=new e;i.setPublicKey(t);const o=117,n=new TextEncoder().encode(s);let a="";if(n.length<=o){const l=i.encrypt(s);if(!l)return s;a=l}else{const l=[];for(let c=0;c<n.length;c+=o){const u=n.slice(c,c+o),d=new TextDecoder().decode(u),m=i.encrypt(d);if(!m)return s;l.push(m)}a=l.join("\n")}return a}catch(i){return s}}async encryptionData(s){const{md5:e}=window;return s.username=await this.rsaEncrypt(e(e(s.username+window.vite_public_login_token))),s.password=await this.rsaEncrypt(e("".concat(e(s.password),"_bt.cn"))),s}removeEmpty(s){return Object.entries(s).reduce((e,[t,i])=>(i!=null&&i!==""&&(e[t]=i),e),{})}loading(s){const e=document.createElement("div");e.id="full-loading",e.className="el-loading-mask login-loading",e.style.cssText="background-color: rgba(0, 0, 0, 0.3); z-index: 3006;";const t=document.createElement("div");t.className="el-loading-spinner";const i=document.createElement("i");i.className="svgtofont-loading",i.innerHTML='\n <svg aria-hidden="true" style="color: var(--el-color-primary);"><use href="#icon-tools-logo"></use></svg>\n ';const o=document.createElement("p");return o.className="el-loading-text",o.textContent=s,t.appendChild(i),t.appendChild(o),e.appendChild(t),window.document.body.appendChild(e),{close(){const r=document.getElementById("full-loading");r&&r.remove()}}}message({message:s,type:e,time:t=3e3,close:i=!1}){var n;(n=document.getElementById("el-message"))==null||n.remove();const o=e==="success"?"circle-check-filled":"circle-close-filled",r='<div id="el-message" class="el-message el-message--'.concat(e,'" style="z-index: 4001;">\n ').concat(i?'<div class="el-dialog-close"></div>':"",'\n <div class="el-message__icon loading-icon svgtofont-el-').concat(o,'"></div>\n <div class="el-message__content">').concat(s||"","</div>\n </div>");window.document.body.insertAdjacentHTML("beforeend",r),t&&window.setTimeout(()=>{const a=document.getElementById("el-message");a&&a.remove()},t),i&&this.bindEvent(document.querySelector(".el-dialog-close"),"click",()=>{var a;(a=document.getElementById("el-message"))==null||a.remove()})}tooltip({el:s,text:e}){var r;(r=document.getElementById("el-tooltip"))==null||r.remove();const t='<div id="el-tooltip" x-placement="top" class="el-tooltip__popper is-dark el-tooltip-white overview-popover w-[40rem] custom-login-popover" style="transform-origin: center bottom; z-index: 3009; display: none;">\n <div class="leading-8 p-[8px]">'.concat(e,'</div>\n <div class="popper__arrow" style="left: 154px;"></div>\n </div>');window.document.body.insertAdjacentHTML("beforeend",t);const i=document.getElementById("el-tooltip");let o=0;this.bindEvent(s,"mouseenter",n=>{const a=n;clearTimeout(o),i.style.display="block",i.style.left="".concat(a.clientX-a.offsetX-150,"px"),i.style.top="".concat(a.clientY-a.offsetY-i.clientHeight-10,"px")}),this.bindEvent(s,"mouseleave",()=>{clearTimeout(o),o=window.setTimeout(()=>{i.style.display="none"},100)}),this.bindEvent(i,"mouseenter",()=>{clearTimeout(o),i.style.display="block"}),this.bindEvent(i,"mouseleave",()=>{clearTimeout(o),o=window.setTimeout(()=>{i.style.display="none"},100)}),i.style.left="calc(50% - ".concat(i.offsetWidth/2,"px)"),i.style.top="calc(50% - ".concat(i.offsetHeight/2,"px)")}base64UrlToArrayBuffer(s){const e=s.replace(/-/g,"+").replace(/_/g,"/"),t=window.atob(e),i=new Uint8Array(t.length);for(let o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return i.buffer}arrayBufferToBase64Url(s){const e=new Uint8Array(s);let t="";for(let i=0;i<e.byteLength;i++)t+=String.fromCharCode(e[i]);return window.btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}}class E extends v{constructor(e){super();h(this,"el");h(this,"formData");h(this,"formVerify");h(this,"node");h(this,"codeCheck");h(this,"hostCheck");h(this,"googleCheck");h(this,"loginErrorTimer");h(this,"timer");h(this,"submitError");h(this,"wechatWindow");this.initData(e),this.nodeMount(),this.render(),this.event()}initData(e){const t=localStorage.getItem("safeMode");this.el=typeof e=="string"?document.querySelector(e):e,this.formData={},this.node={},this.formData.safe_mode=Number(t||1),this.codeCheck=window.vite_public_login_check,this.formVerify={form:null,vcode:null}}nodeMount(){this.node={loginForm:this.el.querySelector(".login-form"),inputUsername:this.el.querySelector('[name="username"]'),inputPassword:this.el.querySelector('[name="password"]'),codeView:this.el.querySelector(".login-code-view"),inputCode:this.el.querySelector('[name="code"]'),cutCode:this.el.querySelector(".cut-login-code"),formSafeMode:this.el.querySelector(".login-safe-mode"),formSubmit:this.el.querySelector(".login-submit"),formPasskeySubmit:this.el.querySelector(".login-passkey-submit"),formGoogleVerifySubmit:this.el.querySelector(".login-google-verify-submit"),closePopupBtn:this.el.querySelector(".close-popup-btn"),formGoogleVerifyView:this.el.querySelector(".google-verify-view"),formGoogleVerifyInput:this.el.querySelector('[name="vcode"]'),formCdnAccelerate:this.el.querySelector(".login-cdn-accelerate"),formTipsQuestion:this.el.querySelector(".svgtofont-el-question-filled"),wechatLoginBtn:this.el.querySelector(".wechat-login-btn"),appLoginBtn:this.el.querySelector(".app-login-btn")}}render(){const{formSafeMode:e}=this.node;this.renderSelect({el:e,options:[{key:1,label:"安全登录模式(推荐)"},{key:0,label:"普通登录模式(不推荐)"}],active:this.formData.safeMode,change:t=>{this.formData.safe_mode=Number(t)}}),this.renderHostsList(),this.codeVerify(this.codeCheck),this.cutCheckCode()}event(){const{cutCode:e,formSubmit:t,formPasskeySubmit:i,wechatLoginBtn:o,inputPassword:r,inputUsername:n,formGoogleVerifyInput:a,formGoogleVerifySubmit:l,formTipsQuestion:c,inputCode:u}=this.node;this.formVerify.form=this.validateForm({el:this.node.loginForm,rules:{username:{validator:(d,m)=>{d===""?m(new Error("账号不能为空")):d.length<3?m(new Error("账号长度必须大于等于3位")):m()},trigger:["input","blur"]},password:{validator:(d,m)=>{d===""?m(new Error("密码不能为空")):m()},trigger:["input","blur"]},code:{isShow:()=>this.codeCheck,validator:(d,m)=>{d===""?m(new Error("验证码不能为空")):d.length!==4?m(new Error("验证码长度错误,必须为4位")):m()},trigger:["input","blur"]}}}),this.formVerify.vcode=this.validateForm({el:this.node.formGoogleVerifyView,rules:{vcode:{validator:(d,m)=>{d===""?m(new Error("动态口令不能为空")):d.length<6?m(new Error("动态口令长度必须为6位")):m()},trigger:["input","blur"]}}}),this.bindEvent(e,"click",this.cutCheckCode.bind(this)),this.bindEvent(this.node.closePopupBtn,"click",()=>{this.googleVerify(!1)}),this.bindEvent(t,"click",this.submitLoginInfo.bind(this,"form")),this.bindEvent(n,"keyup",d=>{d.keyCode===13&&(t.focus(),t.click())}),this.bindEvent(r,"keyup",d=>{d.keyCode===13&&(t.focus(),t.click())}),this.bindEvent(u,"keyup",d=>{d.keyCode===13&&(t.focus(),t.click())}),this.bindEvent(l,"click",this.submitLoginInfo.bind(this,"vcode")),this.bindEvent(a,"keyup",d=>{d.keyCode===13&&l.click()}),this.tooltip({el:c,text:'\n <div class="mb-[.8rem]">\n <div class="font-bold">安全登录模式(推荐)</div>\n <div>在安全模式下,将加强登录会话的安全性,防止“重放攻击”风险,强烈建议使用安全模式登录面板。</div>\n <div class="text-danger"> 注意:在安全模式下,极少数网络环境可能出现无限退出的情况。 </div>\n </div>\n <div class="font-bold">普通登录模式(不推荐)</div>\n <div>兼容性好,但存在“重放攻击”的风险,建议在开启面板SSL的情况下再使用普通模式。</div>'}),this.checkAutoLogin(),this.node.inputUsername.value=this.autoLoginParams.username,this.node.inputPassword.value=this.autoLoginParams.password,this.autoLoginParams.username&&this.autoLoginParams.password&&this.node.formSubmit.click(),this.bindEvent(i,"click",this.passkeyLogin.bind(this)),this.bindEvent(o,"click",this.wechatLogin.bind(this))}async renderHostsList(){const{formCdnAccelerate:e}=this.node,t=window.vite_public_hosts_list||[];if(this.hostCheck=t.length>0,e.classList[this.hostCheck?"remove":"add"]("!hidden"),document.querySelector(".cdn-node").classList[this.hostCheck?"remove":"add"]("!hidden"),this.hostCheck&&(document.querySelector(".noreferrer_tips").innerText="联系客服"),!this.hostCheck)return!1;const i=[],o=[];for(let r=0;r<t.length;r++){const n=t[r];i.push({key:n.url,label:n.name}),o.push(this.getHostDelay(n.url))}this.monitorHostSpeed(i,o)}async monitorHostSpeed(e,t){const i=await Promise.all(t);e=e.map((o,r)=>({key:o.key,label:"".concat(o.label).concat(i[r]?"(".concat(i[r],"ms)"):""),state:i[r],disabled:!i[r]})).sort((o,r)=>o.state===!1?1:o.state-r.state),this.createHostSelect(e)}createHostSelect(e){const{formCdnAccelerate:t}=this.node;e&&(this.formData.cdn_url=e[0].key),this.renderSelect({el:t,size:"small",options:[{key:"",label:"不使用加速"},...e],active:e[0].key,change:i=>{this.formData.cdn_url=i}})}async getHostDelay(e){try{const t=new Date().getTime(),{data:i}=await this.request({method:"get",url:"https://".concat(e,"/test.txt"),data:{time:t}});if(typeof i=="boolean"){const o=new Date().getTime();return Promise.resolve(o-t)}return Promise.resolve(!1)}catch(t){return Promise.resolve(!1)}}getUrlInfo(){const{formSubmit:e,inputUsername:t,inputPassword:i}=this.node,r=window.location.href.split("?")[1],n=new URLSearchParams("?".concat(r)),a=n.get("username"),l=n.get("password");a&&l&&(t.value=a,i.value=l,e.click())}cutCheckCode(){this.node.cutCode.querySelector("img").src="/code?t=".concat(new Date().getTime())}googleVerify(e){const{formGoogleVerifyView:t,formGoogleVerifyInput:i}=this.node;this.googleCheck=e,this.formData.vcode="",i.value="",e?(t.classList.remove("!hidden"),i.focus()):t.classList.add("!hidden")}codeVerify(e){const{inputCode:t,codeView:i}=this.node;this.codeCheck=e,this.formData.code="",i.classList[e?"remove":"add"]("!hidden"),t.value=""}setFormSubmitError(e){var i,o,r;const{formSubmit:t}=this.node;return(o=(i=t.parentElement)==null?void 0:i.querySelector(".error-tips"))==null||o.remove(),(r=t.parentElement)==null||r.classList.add("error"),t.insertAdjacentHTML("afterend",'<div class="error-tips">'.concat(e,"</div>")),{close:()=>{var n,a,l;(n=t.parentElement)==null||n.classList.remove("error"),(l=(a=t.parentElement)==null?void 0:a.querySelector(".error-tips"))==null||l.remove()}}}async submitLoginInfo(e){const{inputPassword:t}=this.node;this.formVerify[e](async i=>{const o=this.loading("正在登录面板,请稍候..."),r={...this.formData,...i};this.formData={...r},typeof e=="string"&&e==="vcode"&&(r.vcode=i.vcode);let n=await this.encryptionData(r);this.hostCheck&&(n.cdn_url=this.formData.cdn_url),this.googleCheck&&(n.vcode=this.formData.vcode),this.codeCheck&&(n.code=this.formData.code),n=this.removeEmpty(n);try{sessionStorage.setItem("sendXhr","1");const{data:a}=await this.request({method:"post",url:"/login",data:n});if(o.close(),this.submitError&&this.submitError.close(),this.loginErrorTimer=!1,typeof a=="number"&&a===1)this.googleVerify(!0);else if(typeof a=="object"){const{status:l,msg:c}=a;l?(this.message({type:"success",message:c}),sessionStorage.setItem("loginInfo",JSON.stringify(a)),setTimeout(()=>{window.location.href="/"},500)):(this.message({type:"error",message:c}),e==="vcode"?this.googleVerify(!0):(t.value="",this.googleVerify(!1),this.codeVerify(!0),this.cutCheckCode(),c.indexOf("验证码错误")!==-1&&this.cutCheckCode(),this.countdownInfo(c)))}else this.message({message:a,type:"error",time:0,close:!0})}catch(a){this.message({type:"error",message:a,close:!0}),o.close()}})}countdownInfo(e){let t=0;if(!(e.indexOf("多次登录失败")>-1))return;const i=e.match(/\d+/g);i?(this.loginErrorTimer=!0,t=i[0],this.timer&&clearInterval(this.timer),this.timer=window.setInterval(()=>{t--,this.submitError=this.setFormSubmitError(e.replace(/\d+/g,t.toString())),(t<=0||!this.loginErrorTimer)&&(clearInterval(this.timer),this.submitError.close(),t=0)},1e3)):setTimeout(()=>{this.submitError.close()},3e3)}async wechatLogin(){const e=this.loading("正在获取微信登录二维码,请稍候...");try{const{data:t}=await this.request({method:"post",url:"/login",data:{wechat_action:"get_qrcode"}});if(e.close(),t.status){const r=window.screen.width/2-300,n=window.screen.height/2-500/2,a=t.msg.url.replace("login.html","new/wxBindPanel.html");this.wechatWindow=window.open(a,"wechat_auth","width=600,height=500,left=".concat(r,",top=").concat(n));const l=c=>{var u,d,m;switch((u=c.data)==null?void 0:u.type){case"wechat_auth_error":this.message({type:"error",message:c.data.msg,close:!0});try{(d=this.wechatWindow)==null||d.close(),this.wechatLogin()}catch(w){}break;case"wechat_auth_complete":const{code:y,state:p}=c.data.data||{};(m=this.wechatWindow)==null||m.close(),window.removeEventListener("message",l),this.handleWechatLogin(y,p);break}};window.addEventListener("message",l)}else this.message({type:"error",message:t.msg||"获取微信登录二维码失败",close:!0})}catch(t){e.close(),this.message({type:"error",message:"获取微信登录二维码失败",close:!0})}}async handleWechatLogin(e,t){const i=this.loading("正在登录,请稍候...");try{const{data:o}=await this.request({method:"post",url:"/login",data:{wechat_action:"checklogin",wxcode:e,state:t}});i.close(),o.status?(this.message({type:"success",message:o.msg||"微信登录成功"}),sessionStorage.setItem("loginInfo",JSON.stringify(o)),setTimeout(()=>{window.location.href="/"},500)):this.message({type:"error",message:o.msg||"微信登录失败",close:!0})}catch(o){i.close(),this.message({type:"error",message:"微信登录失败",close:!0})}}checkWebAuthnSupport(){return window.isSecureContext?window.PublicKeyCredential?!0:(this.message({type:"error",message:"您的浏览器不支持WebAuthn",close:!0}),this.node.formPasskeySubmit.disabled=!0,!1):(this.message({type:"error",message:"需要在HTTPS或localhost环境下使用",close:!0}),this.node.formPasskeySubmit.disabled=!0,!1)}async passkeyLogin(){if(!this.checkWebAuthnSupport())return;let e=this.loading("正在登录面板,请稍候...");try{const t=await this.encryptionPasskey(JSON.stringify({origin:window.location.origin})),{data:i}=await this.request({method:"post",url:"/login",data:{passkey_action:"options",passkey_token:t}});if(e.close(),i.hasOwnProperty("msg")){this.message({type:i.status?"success":"error",message:i.msg,close:!i.status});return}const o=await this.getCredential(i);if(!o)return;e=this.loading("正在验证Passkey,请稍候...");const r=await this.encryptionPasskey(JSON.stringify({challenge:i.challenge,credential:o})),{data:n}=await this.request({method:"post",url:"/login",data:{passkey_action:"do_auth",passkey_token:r}});e.close(),n.status?(this.message({type:"success",message:n.msg}),sessionStorage.setItem("loginInfo",JSON.stringify(n)),setTimeout(()=>{window.location.href="/"},1500)):this.message({type:"error",message:n.msg||"登录失败,请重试",close:!0})}catch(t){this.message({type:"error",message:t,close:!0}),e.close()}}async getCredential(e){try{const t={challenge:this.base64UrlToArrayBuffer(e.challenge),rpId:e.rpId,allowCredentials:e.allowCredentials?e.allowCredentials.map(o=>({...o,id:this.base64UrlToArrayBuffer(o.id)})):[],userVerification:e.userVerification||"preferred",timeout:e.timeout||6e4},i=await navigator.credentials.get({publicKey:t});if(!i)throw new Error("用户取消了操作");return{id:window.md5(i.id),rawId:this.arrayBufferToBase64Url(i.rawId),response:{clientDataJSON:this.arrayBufferToBase64Url(i.response.clientDataJSON),authenticatorData:this.arrayBufferToBase64Url(i.response.authenticatorData),signature:this.arrayBufferToBase64Url(i.response.signature),userHandle:i.response.userHandle?this.arrayBufferToBase64Url(i.response.userHandle):null},type:i.type}}catch(t){return this.message({type:"error",message:"登录失败,请使用密码登录",close:!0}),null}}}class L extends v{constructor(e){super();h(this,"el");h(this,"node");h(this,"pollingQuery",!0);h(this,"timer",null);typeof e=="string"?this.el=document.querySelector(e):this.el=e,this.node={cutTips:null,loginAccount:null,loginScan:null},this.render()}render(){this.getSacnLoginInfo()}async qrCodeRender(e){const t=document.getElementById("canvas");t&&(t.innerHTML=""),new window.QRCode(t,e,{color:{dark:"#000000",light:"#ffffff"},width:"140px",height:"140px",errorCorrectionLevel:"Q"})}async getSacnLoginInfo(){var e,t,i,o;try{let r=!1;const{data:n}=await this.request({method:"post",url:"/public?name=app&fun=login_qrcode"});if(typeof n=="object"){const{status:c,msg:u}=n;if(c){const d=u.replace(/(panel_url=)[^&]*/i,(y,p)=>"".concat(p+window.location.protocol,"//").concat(window.location.host));this.qrCodeRender(c?d:"https://www.bt.cn/download/app.html"),this.pollingQuerySacnInfo(),(e=document.querySelector(".login-scan-success"))==null||e.classList.remove("!hidden"),(t=document.querySelector(".login-scan-error"))==null||t.classList.add("!hidden");const m=document.querySelector(".app-login-btn");m&&(m.classList.remove("hide"),r=!0)}else(i=document.querySelector(".login-scan-success"))==null||i.classList.add("!hidden"),(o=document.querySelector(".login-scan-error"))==null||o.classList.remove("!hidden")}const a=window.vite_public_wechat_status,l=window.vite_public_passkey_status;if(!a&&!l&&!r){const c=document.querySelector(".login-third-party");c&&c.classList.add("hide")}}catch(r){}}async pollingQuerySacnInfo(){try{if(!this.pollingQuery)return!1;const{data:e}=await this.request({method:"post",url:"/public?name=app&fun=is_scan_ok"}),{status:t,msg:i}=e;typeof e=="object"&&t?this.loginAdmin(i):this.timer=setTimeout(()=>{const o=localStorage.getItem("loginType");if(this.timer&&o==="account")return clearTimeout(this.timer);this.pollingQuerySacnInfo()},2500)}catch(e){}}async loginAdmin(e){try{const{data:t}=await this.request({method:"post",url:"/public?name=app&fun=set_login",data:{secret_key:e}}),{status:i}=t;typeof t=="object"&&i&&(this.message({type:"success",message:"登录成功,正在跳转中"}),window.location.href="/")}catch(t){}}}class x{constructor(){h(this,"defaultColors",{primary:"#20a53a",success:"#67c23a",warning:"#f2711c",danger:"#db2828",error:"#db2828",info:"#909399"});h(this,"lightRatios",{3:.3,5:.5,7:.7,8:.8,9:.9});h(this,"darkRatios",{2:.2});h(this,"darkModeLightRatios",{3:.15,5:.25,7:.35,8:.45,9:.55});h(this,"darkModeDarkRatios",{2:.3})}hexToRgb(s){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(s);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}rgbToHex(s,e,t){return"#".concat(((1<<24)+(s<<16)+(e<<8)+t).toString(16).slice(1))}mixColors(s,e,t){return{r:Math.round(s.r*(1-t)+e.r*t),g:Math.round(s.g*(1-t)+e.g*t),b:Math.round(s.b*(1-t)+e.b*t)}}generateLightColor(s,e){const t=this.hexToRgb(s);if(!t)throw new Error("Invalid color format: ".concat(s));const i={r:255,g:255,b:255},o=this.mixColors(t,i,this.lightRatios[e]);return this.rgbToHex(o.r,o.g,o.b)}generateDarkColor(s,e){const t=this.hexToRgb(s);if(!t)throw new Error("Invalid color format: ".concat(s));const i={r:0,g:0,b:0},o=this.mixColors(t,i,this.darkRatios[e]);return this.rgbToHex(o.r,o.g,o.b)}generateDarkModeLightColor(s,e){const t=this.hexToRgb(s);if(!t)throw new Error("Invalid color format: ".concat(s));const i={r:0,g:0,b:0},o=this.mixColors(t,i,this.darkModeLightRatios[e]);return this.rgbToHex(o.r,o.g,o.b)}generateDarkModeDarkColor(s,e){const t=this.hexToRgb(s);if(!t)throw new Error("Invalid color format: ".concat(s));const i={r:255,g:255,b:255},o=this.mixColors(t,i,this.darkModeDarkRatios[e]);return this.rgbToHex(o.r,o.g,o.b)}generateColorVariables(s={},e={}){const t={...this.defaultColors,...s},i={darkMode:!1,...e},o={};return Object.keys(t).forEach(r=>{const n=t[r];n&&(o["--el-color-".concat(r)]=n,i.darkMode?([3,5,7,8,9].forEach(a=>{o["--el-color-".concat(r,"-light-").concat(a)]=this.generateDarkModeLightColor(n,a)}),o["--el-color-".concat(r,"-dark-2")]=this.generateDarkModeDarkColor(n,2)):([3,5,7,8,9].forEach(a=>{o["--el-color-".concat(r,"-light-").concat(a)]=this.generateLightColor(n,a)}),o["--el-color-".concat(r,"-dark-2")]=this.generateDarkColor(n,2)))}),o}applyColorVariables(s){}generateAndApplyColors(s,e={}){return this.generateColorVariables(s,e)}}class _{constructor(){h(this,"styleElement",null);h(this,"styleId","dynamic-theme-variables");h(this,"currentVariables",{});this.init()}init(){this.createStyleElement()}createStyleElement(){const s=document.getElementById(this.styleId);if(s)return this.styleElement=s,s;const e=document.createElement("style");e.id=this.styleId,e.type="text/css";const t="\n /* View Transitions API 支持 */\n ::view-transition-old(root),\n ::view-transition-new(root) {\n animation-duration: 0.5s;\n z-index: 99999;\n }\n\n /* 当支持View Transitions时的圆形扩散动画 */\n html.theme-switching::view-transition-old(root) {\n clip-path: circle(var(--circle-size, 100%) at var(--circle-x, 50%) var(--circle-y, 50%));\n }\n\n html.theme-switching::view-transition-new(root) {\n clip-path: circle(var(--circle-size, 0px) at var(--circle-x, 50%) var(--circle-y, 50%));\n }\n\n /* 降级动画 - 当不支持View Transitions时 */\n .theme-transition-fallback {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: var(--fallback-bg-color, #ffffff);\n border-radius: 50%;\n transform: scale(0);\n transform-origin: var(--circle-x, 50%) var(--circle-y, 50%);\n z-index: 99999;\n pointer-events: none;\n transition: transform 0.5s ease-in-out;\n }\n\n .theme-transition-fallback.active {\n transform: scale(3);\n }\n\n /* 主题切换按钮状态 */\n .theme-toggle-button {\n transition: transform 0.2s ease;\n }\n\n .theme-toggle-button:hover {\n transform: scale(1.1);\n }\n\n .theme-toggle-button.transitioning {\n pointer-events: none;\n }\n ";return e.textContent=t,document.head.appendChild(e),this.styleElement=e,e}registerVariables(s,e){const t={};Object.keys(s).forEach(i=>{const o=e?"--".concat(e,"-").concat(i.replace(/^--/,"")):i;t[o]=s[i]}),Object.assign(this.currentVariables,t),this.updateStyles()}registerColorVariables(s,e){this.registerVariables(s,e)}registerThemeVariables(s){const e={};if(s.theme&&s.theme.color&&(e["--theme-primary-color"]=s.theme.color),s.interface&&s.interface.rounded)switch(s.interface.rounded){case"none":e["--el-border-radius-small"]="0px",e["--el-border-radius-base"]="0px",e["--el-border-radius-medium"]="0px",e["--el-border-radius-large"]="0px",e["--el-border-radius-extra-large"]="0px";break;case"smaller":e["--el-border-radius-small"]="2px",e["--el-border-radius-base"]="2px",e["--el-border-radius-medium"]="2px",e["--el-border-radius-large"]="4px",e["--el-border-radius-extra-large"]="6px";break;case"small":e["--el-border-radius-small"]="2px",e["--el-border-radius-base"]="4px",e["--el-border-radius-medium"]="6px",e["--el-border-radius-large"]="8px",e["--el-border-radius-extra-large"]="16px";break;case"medium":e["--el-border-radius-small"]="4px",e["--el-border-radius-base"]="6px",e["--el-border-radius-medium"]="8px",e["--el-border-radius-large"]="12px",e["--el-border-radius-extra-large"]="20px";break;case"large":e["--el-border-radius-small"]="8px",e["--el-border-radius-base"]="12px",e["--el-border-radius-medium"]="16px",e["--el-border-radius-large"]="20px",e["--el-border-radius-extra-large"]="24px";break;default:e["--el-border-radius-small"]="4px",e["--el-border-radius-base"]="6px",e["--el-border-radius-medium"]="8px",e["--el-border-radius-large"]="12px",e["--el-border-radius-extra-large"]="16px";break}s.login&&(s.login.bg_image&&(e["--login-bg-image"]="url('".concat(s.login.bg_image,"')")),s.login.bg_image_opacity!==void 0&&(e["--login-bg-opacity"]=String(s.login.bg_image_opacity/100)),s.login.content_opacity!==void 0&&(e["--login-content-opacity"]=String(s.login.content_opacity/100)),s.login.logo&&(e["--login-logo-url"]="url('".concat(s.login.logo,"')"))),s.logo&&(s.logo.image&&(e["--logo-image-url"]="url('".concat(s.logo.image,"')")),s.logo.favicon&&(e["--logo-favicon-url"]="url('".concat(s.logo.favicon,"')"))),this.registerVariables(e,"")}removeVariablesByNamespace(s){const e="--".concat(s,"-");Object.keys(this.currentVariables).forEach(t=>{t.startsWith(e)&&delete this.currentVariables[t]}),this.updateStyles()}clearAllVariables(){this.currentVariables={},this.updateStyles()}updateStyles(){this.styleElement||this.createStyleElement();const s=this.generateCSSRules();this.styleElement&&(this.styleElement.textContent=s)}getSystemTheme(){try{return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(s){return"light"}}isDark(){try{const{preset:s}=window.vite_public_panel_theme.theme;return s==="auto"?this.getSystemTheme()==="dark":s==="dark"}catch(s){return!1}}generateCSSRules(){const s=Object.keys(this.currentVariables).map(e=>" ".concat(e,": ").concat(this.currentVariables[e],";")).join("\n");return"".concat(this.isDark()?"html.dark {":":root {","\n").concat(s,"\n}")}getCurrentVariables(){return{...this.currentVariables}}getVariable(s){return this.currentVariables[s]}hasVariable(s){return s in this.currentVariables}destroy(){this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement),this.styleElement=null,this.currentVariables={}}}class C{constructor(){h(this,"currentTheme");h(this,"themeToggleBtn");h(this,"themeIcon");h(this,"colorGenerator");h(this,"styleManager");h(this,"panelTheme");this.themeToggleBtn=null,this.themeIcon=null,this.colorGenerator=new x,this.styleManager=new _,this.panelTheme=window.vite_public_panel_theme||null,this.currentTheme=this.getInitialTheme(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.init()):this.init()}init(){this.bindElements(),this.applyTheme(this.currentTheme),this.updateThemeIcon(this.currentTheme),this.updateThemeTips(this.currentTheme),this.bindEvents()}bindElements(){this.themeToggleBtn=document.querySelector("#theme-toggle-btn"),this.themeIcon=document.querySelector("#theme-toggle-btn .theme-icon")}bindEvents(){this.themeToggleBtn&&(this.themeToggleBtn.classList.add("theme-toggle-button"),this.themeToggleBtn.addEventListener("click",s=>{this.toggleTheme(s)}))}async toggleTheme(s){if(document.documentElement.classList.contains("theme-switching"))return;const e=this.currentTheme==="light"?"dark":"light";s?await this.animateThemeToggle(s,e):this.setTheme(e)}async animateThemeToggle(s,e){s.preventDefault(),s.stopPropagation();const t=s.clientX,i=s.clientY,o=Math.hypot(Math.max(t,window.innerWidth-t),Math.max(i,window.innerHeight-i));document.documentElement.style.setProperty("--circle-x","".concat(t,"px")),document.documentElement.style.setProperty("--circle-y","".concat(i,"px")),document.documentElement.style.setProperty("--circle-size","".concat(o*2,"px")),document.documentElement.classList.add("theme-switching"),this.themeToggleBtn&&this.themeToggleBtn.classList.add("transitioning");const r=()=>{this.setTheme(e)};if(typeof document.startViewTransition=="function")try{document.startViewTransition(r).finished.then(()=>{document.documentElement.classList.remove("theme-switching"),this.themeToggleBtn&&this.themeToggleBtn.classList.remove("transitioning")}).catch(a=>{document.documentElement.classList.remove("theme-switching"),this.themeToggleBtn&&this.themeToggleBtn.classList.remove("transitioning")})}catch(n){setTimeout(()=>{r(),document.documentElement.classList.remove("theme-switching")},100)}else this.createFallbackAnimation(t,i,e==="dark"?"#1a1a1a":"#ffffff"),setTimeout(r,250),setTimeout(()=>{document.documentElement.classList.remove("theme-switching"),this.removeFallbackAnimation(),this.themeToggleBtn&&this.themeToggleBtn.classList.remove("transitioning")},500)}createFallbackAnimation(s,e,t){const i=document.createElement("div");i.className="theme-transition-fallback",i.style.setProperty("--circle-x","".concat(s,"px")),i.style.setProperty("--circle-y","".concat(e,"px")),i.style.setProperty("--fallback-bg-color",t),i.id="theme-fallback-animation",document.body.appendChild(i),setTimeout(()=>{i.classList.add("active")},10)}removeFallbackAnimation(){const s=document.getElementById("theme-fallback-animation");s&&s.remove()}setTheme(s){this.currentTheme=s,this.applyTheme(s),this.updateThemeIcon(s),this.updateThemeTips(s)}applyThemeImmediate(s){const e=document.documentElement;s==="dark"?e.setAttribute("data-theme","dark"):e.removeAttribute("data-theme")}applyTheme(s){this.applyThemeImmediate(s),this.applyPanelThemeColors()}applyPanelThemeColors(){var i;if(!this.panelTheme)return;const s=this.currentTheme==="dark",e=((i=this.panelTheme.theme)==null?void 0:i.color)||"#20a53a",t=this.colorGenerator.generateAndApplyColors({primary:e,success:"#67c23a",warning:"#f2711c",danger:"#db2828",error:"#db2828",info:"#909399"},{darkMode:s});this.styleManager.registerColorVariables(t,""),this.applyDarkModeSpecialStyles(e,s),this.applyInterfaceStyles()}applyInterfaceStyles(){this.panelTheme&&this.styleManager.registerThemeVariables(this.panelTheme)}applyDarkModeSpecialStyles(s,e){const t="dark-mode-special-styles",i=document.getElementById(t);if(e&&s==="#F4D1B4"){if(!i){const r=document.createElement("style");r.id=t,r.textContent="\n /* 暗金色主题特定样式修正 */\n html.dark {\n --el-color-primary: #F4D1B4 !important;\n --el-color-primary-light-3: #EAC2A5 !important;\n --el-color-primary-light-5: #E0B396 !important;\n --el-color-primary-light-7: #D6A487 !important;\n --el-color-primary-light-8: #CC9578 !important;\n --el-color-primary-light-9: #C28669 !important;\n --el-color-primary-dark-2: #F4D1B4 !important;\n }\n\n html.dark .tips .tips-text{\n color: #a9750b !important;\n }\n\n html.dark .el-button--primary {\n color: #1F1F1F !important;\n }\n\n html.dark .el-checkbox__input.is-checked .el-checkbox__inner::after {\n border-color: #1F1F1F !important;\n }\n\n html.dark .el-radio-button.is-active .el-radio-button__original-radio:not(:disabled)+.el-radio-button__inner {\n color: #1F1F1F !important;\n }\n\n html.dark .class-item.on {\n color: #1F1F1F !important;\n }\n\n html.dark .message-number {\n color: #1F1F1F !important;\n }\n\n html.dark .el-switch.is-checked .el-switch__core .el-switch__action {\n background-color: #1F1F1F !important;\n }\n html.dark .form-select-module .select-list .select-item:hover{\n background-color: #1F1F1F !important;\n }\n ",document.head.appendChild(r)}}else i&&i.remove()}updateThemeIcon(s){this.themeIcon&&(s==="dark"?this.themeIcon.innerHTML='\n <circle cx="12" cy="12" r="5"/>\n <path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>\n ':this.themeIcon.innerHTML='\n <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>\n ')}updateThemeTips(s){this.themeToggleBtn&&(s==="dark"?this.themeToggleBtn.setAttribute("title","切换到亮色主题"):this.themeToggleBtn.setAttribute("title","切换到暗色主题"))}getStoredTheme(){return localStorage.getItem("theme")}getInitialTheme(){var e,t;if(((t=(e=this.panelTheme)==null?void 0:e.theme)==null?void 0:t.preset)!==void 0)return this.panelTheme.theme.preset;const s=this.getStoredTheme();return s||this.detectSystemTheme()}detectSystemTheme(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}getStyleManager(){return this.styleManager}registerCustomVariables(s,e){this.styleManager.registerVariables(s,e)}getAllVariables(){return this.styleManager.getCurrentVariables()}}class A extends v{constructor(e){super();h(this,"loginType");h(this,"el");h(this,"node");h(this,"autoLoginParams");h(this,"themeManager");h(this,"loginAccountInstance",null);const t=document.querySelector("#login-main");this.loginType=localStorage.getItem("loginType")||"account",this.el=document.querySelector(e.el),this.node={cutTips:null,loginAccount:null,loginScan:null},this.autoLoginParams={password:"",username:""},this.themeManager=new C,this.render(),t&&(t.style.display="block");const i=window.vite_public_passkey_status,o=document.querySelector(".passkey-login-btn");i&&o&&o.classList.remove("hide");const r=window.vite_public_wechat_status,n=document.querySelector(".wechat-login-btn");r&&n&&n.classList.remove("hide");const a=document.querySelector(".login-account");a!=null&&a.classList.value.includes("hidden")||this.checkAppLoginStatus()}async checkAppLoginStatus(){let e=!1;try{const{data:t}=await this.request({method:"get",url:"/public?name=app&fun=login_qrcode"});if(t!=null&&t.status){const i=document.querySelector(".app-login-btn");i&&(i.classList.remove("hide"),e=!0)}}catch(t){}this.checkThirdPartyLoginVisible(e)}checkThirdPartyLoginVisible(e){const t=window.vite_public_wechat_status,i=window.vite_public_passkey_status;if(!t&&!i&&!e){const o=document.querySelector(".login-third-party");o&&o.classList.add("hide")}}initPageStyle(){var l,c,u;const e=window.vite_public_panel_theme,t=(l=e==null?void 0:e.login)==null?void 0:l.is_show_bg,i=(c=e==null?void 0:e.login)==null?void 0:c.is_show_logo,{bg_image:o}=(e==null?void 0:e.login)||{},r=this.el.querySelector("#login-images");r&&t&&o&&(r.style.backgroundImage="url('".concat(o,"')"),r.style.opacity="var(--login-bg-opacity, 1)",r.style.display="block");const n=this.el.querySelector("#login-svg");if(n)if(!i)n.classList.add("!hidden");else{n.classList.remove("!hidden");const d=n.querySelector("#login-logo");d&&(d.src=((u=e==null?void 0:e.login)==null?void 0:u.logo)||"/static/icons/logo-green.svg")}const a=this.el.querySelector("#cut-login-type");a&&(a.style.top=i?"110px":"20px",a.className="cut-login-type ".concat(this.loginType))}domMount(){this.node.cutTips=this.el.querySelector(".tips-text"),this.node.cutLoginType=this.el.querySelector("#cut-login-type"),this.node.loginAccount=this.el.querySelector("#login-account"),this.node.loginScan=this.el.querySelector("#login-scan"),this.node.appLoginBtn=this.el.querySelector(".app-login-btn")}eventMount(){const{cutLoginType:e,cutTips:t,appLoginBtn:i}=this.node;this.bindEvent(e,"click",this.cutType.bind(this)),this.bindEvent(i,"click",this.cutType.bind(this))}setLoginScan(){const{loginScan:e,loginAccount:t,cutLoginType:i}=this.node;this.loginType="scan",e.classList.remove("!hidden"),t.classList.add("!hidden"),i.classList.remove("!hidden"),new L(this.node.loginScan)}cutType(){const{cutLoginType:e,cutTips:t}=this.node;e.classList.add(this.loginType==="account"?"scan":"account"),e.classList.remove(this.loginType==="account"?"account":"scan"),this.loginType==="account"?(this.setLoginScan(),t.innerText="切换账号登录",localStorage.setItem("loginType","scan"),this.updateLoginTypeIcon("scan"),e.classList.remove("!hidden")):(this.setLoginAccount(),t.innerText="切换扫码登录",localStorage.setItem("loginType","account"),this.updateLoginTypeIcon("account"),e.classList.add("!hidden"))}setLoginAccount(){const{loginScan:e,loginAccount:t,cutLoginType:i}=this.node;this.loginType="account",e.classList.add("!hidden"),t.classList.remove("!hidden"),i.classList.add("!hidden"),this.loginAccountInstance||(this.loginAccountInstance=new E(this.node.loginAccount))}updateLoginTypeIcon(e){const{cutLoginType:t}=this.node;if(t){const i=t.querySelector(".login-type-icon");if(i){const o=e==="account"?'<rect x="3" y="3" width="5" height="5"/><rect x="3" y="16" width="5" height="5"/><rect x="16" y="3" width="5" height="5"/><path d="m5 5 0 0"/><path d="m5 18 0 0"/><path d="m18 5 0 0"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>':'<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>';i.innerHTML=o}}}render(){this.initPageStyle(),this.loginType=localStorage.getItem("loginType")||"account";const e=this.el.querySelector("#login-title-text");e&&(e.textContent=window.vite_public_title,e.title=window.vite_public_title),this.domMount(),this.eventMount(),this.loginType==="account"?this.setLoginAccount():this.setLoginScan()}}new A({el:"#app"});export{B as __vite_legacy_guard};