HEX
Server: nginx/1.28.3
System: Linux ip-172-31-12-242 6.17.0-1007-aws #7~24.04.1-Ubuntu SMP Thu Jan 22 21:04:49 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/panel/BTPanel/static/js/login-legacy.js
!function(){function e(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t,o){return t=r(t),function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,n()?Reflect.construct(t,o||[],r(e).constructor):t.apply(e,o))}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(n=function(){return!!e})()}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return u(l,"_invoke",function(n,r,o){var i,s,c,l=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return i=t,s=0,c=e,h.n=n,a}};function m(n,r){for(s=n,c=r,t=0;!d&&l&&!o&&t<u.length;t++){var o,i=u[t],m=h.p,f=i[2];n>3?(o=f===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=m&&((o=n<2&&m<i[1])?(s=0,h.v=r,h.n=i[1]):m<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,f),s=u,c=f;(t=s<2?e:c)||!d;){i||(s?s<3?(s>1&&(h.n=-1),m(s,c)):h.n=c:h.v=c);try{if(l=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?c:n.call(r,h))!==a)break}catch(t){i=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,o,i),!0),l}var a={};function s(){}function c(){}function d(){}t=Object.getPrototypeOf;var h=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),m=d.prototype=s.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,o,"GeneratorFunction")),e.prototype=Object.create(m),e}return c.prototype=d,u(m,"constructor",d),u(d,"constructor",c),c.displayName="GeneratorFunction",u(d,o,"GeneratorFunction"),u(m),u(m,o,"Generator"),u(m,r,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),(l=function(){return{w:i,m:f}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function i(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},u(e,t,n,r)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function f(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){m(i,r,o,a,s,"next",e)}function s(e){m(i,r,o,a,s,"throw",e)}a(void 0)})}}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w(r.key),r)}}function y(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}System.register([],function(n,r){"use strict";return{execute:function(){var n=function(){return y(function e(){var t=this;g(this,e),b(this,"autoLoginParams",{password:"",username:""}),b(this,"BASE64_ALPHABET","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),b(this,"standardBase64Encode",function(e){for(var n="",r=0,o=(new TextEncoder).encode(e);r<o.length;){var i=o[r++]||0,a=o[r++]||0,s=o[r++]||0,c=i>>2,l=(3&i)<<4|a>>4,u=(15&a)<<2|s>>6,d=63&s;n+=t.BASE64_ALPHABET[c],n+=t.BASE64_ALPHABET[l],n+=r>o.length+1?"=":t.BASE64_ALPHABET[u],n+=r>o.length?"=":t.BASE64_ALPHABET[d]}return n}),b(this,"standardBase64Decode",function(e){e=e.replace(/[^A-Za-z0-9+/=]/g,"");for(var n="",r=0;r<e.length;){var o=t.BASE64_ALPHABET.indexOf(e[r++]||"="),i=t.BASE64_ALPHABET.indexOf(e[r++]||"="),a=t.BASE64_ALPHABET.indexOf(e[r++]||"="),s=t.BASE64_ALPHABET.indexOf(e[r++]||"="),c=o<<2|i>>4,l=(15&i)<<4|a>>2,u=(3&a)<<6|s;n+=String.fromCharCode(c),-1!==a&&(n+=String.fromCharCode(l)),-1!==s&&(n+=String.fromCharCode(u))}return(new TextDecoder).decode((new TextEncoder).encode(n))}),b(this,"base64UrlSafeEncode",function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.standardBase64Encode(e);return r=r.replace(/\+/g,"-").replace(/\//g,"_"),n&&(r=r.replace(/=/g,"")),r}),b(this,"base64UrlSafeDecode",function(e){var n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4;return r>0&&(n+="=".repeat(r)),t.standardBase64Decode(n)})},[{key:"checkAutoLogin",value:function(){var e=this;return new Promise(function(t,n){var r=new URL(window.location.href);""!==r.search&&(new URLSearchParams(r.search).forEach(function(t,n){e.autoLoginParams[n]=t}),e.autoLoginParams.username&&e.autoLoginParams.password&&t(e.autoLoginParams))})}},{key:"bindEvent",value:function(e,t,n){e&&e.addEventListener?e.addEventListener(t,n,!1):e&&e.attachEvent?e.attachEvent("on".concat(t),n||null):e["on".concat(t)]=n||null}},{key:"delegateEvent",value:function(e,t,n,r){"string"==typeof n&&e?e.addEventListener(t,function(e){var t=e.target.closest(n);this.contains(t)&&r&&r.call(t,e)},!1):"string"!=typeof n&&this.bindEvent(e,t,n)}},{key:"convertType",value:function(e,t){if(p(e)===t)return e;if("string"===t)return String(e);if("number"===t)return Number(e);throw new Error("Unsupported target type: ".concat(t))}},{key:"renderSelect",value:function(e){var t=this,n=e.el,r=e.options,o=e.active,i=e.change,a=e.size,s=document.createElement("div"),c=document.createElement("div");if(n.classList.add("form-select-module"),n.innerHTML="",a&&n.classList.add(a),c.classList.add("select-list"),r.length>0){var l=o;void 0===o&&(l=r[0].key);for(var u=0;u<r.length;u++){var d=document.createElement("div");d.classList.add("select-item"),"boolean"==typeof r[u].disabled&&r[u].disabled&&d.classList.add("disabled"),d.innerText=r[u].label,d.dataset.key=r[u].key,d.dataset.disabled="".concat(Number(r[u].disabled)),r[u].key===l&&(d.classList.add("active"),s.innerText=r[u].label),c.appendChild(d)}}s.classList.add("select-display"),n.appendChild(s),n.appendChild(c);var h=function(e){e.target.classList.contains("disabled")&&e.target.classList.contains("select-item")?t.message({message:"当前选项不可选",type:"error",time:2e3}):(n.classList.remove("active"),window.removeEventListener("click",h))};return this.delegateEvent(s,"click",function(e){e.stopPropagation(),n.classList.toggle("active"),n.classList.contains("active")?window.addEventListener("click",h):window.removeEventListener("click",h)}),this.delegateEvent(c,"click",".select-item",function(e){var o=e.target,a=o.dataset,l=a.key,u=a.disabled,d=o.innerText;if(!Number(u)){var h=r.findIndex(function(e){return e.key===t.convertType(l,p(e.key))});c.querySelectorAll(".select-item").forEach(function(e,t){h===t?e.classList.add("active"):e.classList.remove("active")}),s.innerText=d,n.classList.remove("active"),l&&(n.dataset.key=l),i&&l&&i(l,h)}}),window.removeEventListener("click",h),n.dataset.key}},{key:"validateForm",value:function(e){var t=this,n=e.rules,r={},o={},i=function(e){if(Object.prototype.hasOwnProperty.call(n,e)){o[e]=document.querySelector('[name="'.concat(e,'"]'));var i=n[e];i.trigger&&i.trigger.forEach(function(a){var s=!1;r[e]=function(e){var t=o[e];return i.validator(t.value.trim(),function(e){try{if(e)throw new Error(e);var n,r;s=!1,null===(n=t.parentElement)||void 0===n||null===(n=n.querySelector(".error-tips"))||void 0===n||n.remove(),null===(r=t.parentElement)||void 0===r||r.classList.remove("error")}catch(l){var o,i,a=l.message.replace("Error: ",""),c=null===(o=t.parentElement)||void 0===o?void 0:o.querySelector(".error-tips");if(a)s=!0,null===(i=t.parentElement)||void 0===i||i.classList.add("error"),c?c.innerText=a:t.insertAdjacentHTML("afterend",'<div class="error-tips">'.concat(a,"</div>"))}}),!s||new Error("".concat(e,":").concat(o[e].value))},t.bindEvent(o[e],a,function(){if("isShow"in n[e]&&!n[e].isShow())return!0;var t=this.getAttribute("name");t&&r[t]&&r[t](t)})})}};for(var a in n)i(a);return function(e){var t=0;for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var a=r[i];try{if("isShow"in n[i]&&!n[i].isShow())continue;var s=a(i);if("object"===p(s))throw s}catch(s){return t++,o[i].focus(),!1}}if(!t){var c={};for(var l in o)if(Object.prototype.hasOwnProperty.call(o,l)){var u=o[l].value;c[l]=u.trim()}e(c)}}}},{key:"handleTransformRequest",value:function(e){var t="";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t+="".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(r),"&")}return t=t.slice(0,-1)}},{key:"request",value:(r=f(l().m(function e(){var t,n,r,o,i=this,a=arguments;return l().w(function(e){for(;;)if(0===e.n)return n=(t=a.length>0&&void 0!==a[0]?a[0]:{method:"post",data:{},url:""}).url,r=t.data,o=t.method,e.a(2,new Promise(function(e,t){var a=new XMLHttpRequest;a.open(o,n,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.timeout=25e4,a.onreadystatechange=function(){if(4===a.readyState)if(a.status>=200&&a.status<300)try{e(h(h({},a),{},{data:JSON.parse(a.responseText)}))}catch(n){e(h(h({},a),{},{data:a.responseText,error:n}))}else t(new Error(a.statusText))},a.ontimeout=function(){return t(new Error("Request timed out"))},a.onerror=function(){return t(new Error("Network error"))},a.send(i.handleTransformRequest(r))}))},e)})),function(){return r.apply(this,arguments)})},{key:"rsaEncrypt",value:(n=f(l().m(function e(t){var n,r,o,i;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=window,r=n.JSEncrypt,!((o=window.vite_public_encryption).length<10)){e.n=1;break}return e.a(2,t);case 1:return(i=new r).setPublicKey(o),e.a(2,i.encrypt(t))}},e)})),function(e){return n.apply(this,arguments)})},{key:"encryptionPasskey",value:(t=f(l().m(function e(t){var n,r,o,i,a,s,c,u,d,h,m,f,p,g;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=window,r=n.JSEncrypt,(o=window.vite_public_encryption)&&!(o.length<10)){e.n=1;break}return e.a(2,t);case 1:if(e.p=1,(i=new r).setPublicKey(o),a=117,s=new TextEncoder,c=s.encode(t),u="",!(c.length<=a)){e.n=3;break}if(d=i.encrypt(t)){e.n=2;break}return e.a(2,t);case 2:u=d,e.n=8;break;case 3:h=[],m=0;case 4:if(!(m<c.length)){e.n=7;break}if(f=c.slice(m,m+a),p=(new TextDecoder).decode(f),g=i.encrypt(p)){e.n=5;break}return e.a(2,t);case 5:h.push(g);case 6:m+=a,e.n=4;break;case 7:u=h.join("\n");case 8:return e.a(2,u);case 9:return e.p=9,e.v,e.a(2,t)}},e,null,[[1,9]])})),function(e){return t.apply(this,arguments)})},{key:"encryptionData",value:(e=f(l().m(function e(t){var n,r;return l().w(function(e){for(;;)switch(e.n){case 0:return n=window,r=n.md5,e.n=1,this.rsaEncrypt(r(r(t.username+window.vite_public_login_token)));case 1:return t.username=e.v,e.n=2,this.rsaEncrypt(r("".concat(r(t.password),"_bt.cn")));case 2:return t.password=e.v,e.a(2,t)}},e,this)})),function(t){return e.apply(this,arguments)})},{key:"removeEmpty",value:function(e){return Object.entries(e).reduce(function(e,t){var n=a(t,2),r=n[0],o=n[1];return null!=o&&""!==o&&(e[r]=o),e},{})}},{key:"loading",value:function(e){var t=document.createElement("div");t.id="full-loading",t.className="el-loading-mask login-loading",t.style.cssText="background-color: rgba(0, 0, 0, 0.3); z-index: 3006;";var n=document.createElement("div");n.className="el-loading-spinner";var r=document.createElement("i");r.className="svgtofont-loading",r.innerHTML='\n\t\t\t<svg aria-hidden="true" style="color: var(--el-color-primary);"><use href="#icon-tools-logo"></use></svg>\n\t\t';var o=document.createElement("p");return o.className="el-loading-text",o.textContent=e,n.appendChild(r),n.appendChild(o),t.appendChild(n),window.document.body.appendChild(t),{close:function(){var e=document.getElementById("full-loading");e&&e.remove()}}}},{key:"message",value:function(e){var t,n=e.message,r=e.type,o=e.time,i=void 0===o?3e3:o,a=e.close,s=void 0!==a&&a;null===(t=document.getElementById("el-message"))||void 0===t||t.remove();var c="success"===r?"circle-check-filled":"circle-close-filled",l='<div id="el-message" class="el-message el-message--'.concat(r,'" style="z-index: 4001;">\n\t\t\t\t').concat(s?'<div class="el-dialog-close"></div>':"",'\n\t\t\t\t<div class="el-message__icon loading-icon svgtofont-el-').concat(c,'"></div>\n\t\t\t\t<div class="el-message__content">').concat(n||"","</div>\n\t\t\t</div>");window.document.body.insertAdjacentHTML("beforeend",l),i&&window.setTimeout(function(){var e=document.getElementById("el-message");e&&e.remove()},i),s&&this.bindEvent(document.querySelector(".el-dialog-close"),"click",function(){var e;null===(e=document.getElementById("el-message"))||void 0===e||e.remove()})}},{key:"tooltip",value:function(e){var t,n=e.el,r=e.text;null===(t=document.getElementById("el-tooltip"))||void 0===t||t.remove();var o='<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\t\t\t\t<div class="leading-8 p-[8px]">'.concat(r,'</div>\n\t\t\t\t<div class="popper__arrow" style="left: 154px;"></div>\n\t\t</div>');window.document.body.insertAdjacentHTML("beforeend",o);var i=document.getElementById("el-tooltip"),a=0;this.bindEvent(n,"mouseenter",function(e){var t=e;clearTimeout(a),i.style.display="block",i.style.left="".concat(t.clientX-t.offsetX-150,"px"),i.style.top="".concat(t.clientY-t.offsetY-i.clientHeight-10,"px")}),this.bindEvent(n,"mouseleave",function(){clearTimeout(a),a=window.setTimeout(function(){i.style.display="none"},100)}),this.bindEvent(i,"mouseenter",function(){clearTimeout(a),i.style.display="block"}),this.bindEvent(i,"mouseleave",function(){clearTimeout(a),a=window.setTimeout(function(){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)")}},{key:"base64UrlToArrayBuffer",value:function(e){for(var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return r.buffer}},{key:"arrayBufferToBase64Url",value:function(e){for(var t=new Uint8Array(e),n="",r=0;r<t.byteLength;r++)n+=String.fromCharCode(t[r]);return window.btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}}],[{key:"getLogoSrc",value:function(){var e;return(null===(e=window.vite_public_panel_theme)||void 0===e?void 0:e.login.logo)||"/static/icons/logo-green.svg"}}]);var e,t,n,r}(),r=function(n){function r(e){var n;return g(this,r),b(n=t(this,r),"el",void 0),b(n,"formData",void 0),b(n,"formVerify",void 0),b(n,"node",void 0),b(n,"codeCheck",void 0),b(n,"hostCheck",void 0),b(n,"googleCheck",void 0),b(n,"loginErrorTimer",void 0),b(n,"timer",void 0),b(n,"submitError",void 0),b(n,"wechatWindow",void 0),n.initData(e),n.nodeMount(),n.render(),n.event(),n}return o(r,n),y(r,[{key:"initData",value:function(e){var t=localStorage.getItem("safeMode");this.el="string"==typeof e?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}}},{key:"nodeMount",value:function(){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")}}},{key:"render",value:function(){var e=this,t=this.node.formSafeMode;this.renderSelect({el:t,options:[{key:1,label:"安全登录模式(推荐)"},{key:0,label:"普通登录模式(不推荐)"}],active:this.formData.safeMode,change:function(t){e.formData.safe_mode=Number(t)}}),this.renderHostsList(),this.codeVerify(this.codeCheck),this.cutCheckCode()}},{key:"event",value:function(){var e=this,t=this.node,n=t.cutCode,r=t.formSubmit,o=t.formPasskeySubmit,i=t.wechatLoginBtn,a=t.inputPassword,s=t.inputUsername,c=t.formGoogleVerifyInput,l=t.formGoogleVerifySubmit,u=t.formTipsQuestion,d=t.inputCode;this.formVerify.form=this.validateForm({el:this.node.loginForm,rules:{username:{validator:function(e,t){""===e?t(new Error("账号不能为空")):e.length<3?t(new Error("账号长度必须大于等于3位")):t()},trigger:["input","blur"]},password:{validator:function(e,t){""===e?t(new Error("密码不能为空")):t()},trigger:["input","blur"]},code:{isShow:function(){return e.codeCheck},validator:function(e,t){""===e?t(new Error("验证码不能为空")):4!==e.length?t(new Error("验证码长度错误,必须为4位")):t()},trigger:["input","blur"]}}}),this.formVerify.vcode=this.validateForm({el:this.node.formGoogleVerifyView,rules:{vcode:{validator:function(e,t){""===e?t(new Error("动态口令不能为空")):e.length<6?t(new Error("动态口令长度必须为6位")):t()},trigger:["input","blur"]}}}),this.bindEvent(n,"click",this.cutCheckCode.bind(this)),this.bindEvent(this.node.closePopupBtn,"click",function(){e.googleVerify(!1)}),this.bindEvent(r,"click",this.submitLoginInfo.bind(this,"form")),this.bindEvent(s,"keyup",function(e){13===e.keyCode&&(r.focus(),r.click())}),this.bindEvent(a,"keyup",function(e){13===e.keyCode&&(r.focus(),r.click())}),this.bindEvent(d,"keyup",function(e){13===e.keyCode&&(r.focus(),r.click())}),this.bindEvent(l,"click",this.submitLoginInfo.bind(this,"vcode")),this.bindEvent(c,"keyup",function(e){13===e.keyCode&&l.click()}),this.tooltip({el:u,text:'\n\t\t\t\t<div class="mb-[.8rem]">\n\t\t\t\t\t<div class="font-bold">安全登录模式(推荐)</div>\n\t\t\t\t\t<div>在安全模式下,将加强登录会话的安全性,防止“重放攻击”风险,强烈建议使用安全模式登录面板。</div>\n\t\t\t\t\t<div class="text-danger"> 注意:在安全模式下,极少数网络环境可能出现无限退出的情况。 </div>\n\t\t\t\t</div>\n\t\t\t\t<div class="font-bold">普通登录模式(不推荐)</div>\n\t\t\t\t<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(o,"click",this.passkeyLogin.bind(this)),this.bindEvent(i,"click",this.wechatLogin.bind(this))}},{key:"renderHostsList",value:(v=f(l().m(function e(){var t,n,r,o,i,a;return l().w(function(e){for(;;)switch(e.n){case 0:if(t=this.node.formCdnAccelerate,n=window.vite_public_hosts_list||[],this.hostCheck=n.length>0,t.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){e.n=1;break}return e.a(2,!1);case 1:for(r=[],o=[],i=0;i<n.length;i++)a=n[i],r.push({key:a.url,label:a.name}),o.push(this.getHostDelay(a.url));this.monitorHostSpeed(r,o);case 2:return e.a(2)}},e,this)})),function(){return v.apply(this,arguments)})},{key:"monitorHostSpeed",value:(m=f(l().m(function e(t,n){var r;return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all(n);case 1:r=e.v,t=t.map(function(e,t){return{key:e.key,label:"".concat(e.label).concat(r[t]?"(".concat(r[t],"ms)"):""),state:r[t],disabled:!r[t]}}).sort(function(e,t){return!1===e.state?1:e.state-t.state}),this.createHostSelect(t);case 2:return e.a(2)}},e,this)})),function(e,t){return m.apply(this,arguments)})},{key:"createHostSelect",value:function(t){var n=this,r=this.node.formCdnAccelerate;t&&(this.formData.cdn_url=t[0].key),this.renderSelect({el:r,size:"small",options:[{key:"",label:"不使用加速"}].concat(e(t)),active:t[0].key,change:function(e){n.formData.cdn_url=e}})}},{key:"getHostDelay",value:(d=f(l().m(function e(t){var n,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=(new Date).getTime(),e.n=1,this.request({method:"get",url:"https://".concat(t,"/test.txt"),data:{time:n}});case 1:if("boolean"!=typeof e.v.data){e.n=2;break}return r=(new Date).getTime(),e.a(2,Promise.resolve(r-n));case 2:return e.a(2,Promise.resolve(!1));case 3:return e.p=3,e.v,e.a(2,Promise.resolve(!1))}},e,this,[[0,3]])})),function(e){return d.apply(this,arguments)})},{key:"getUrlInfo",value:function(){var e=this.node,t=e.formSubmit,n=e.inputUsername,r=e.inputPassword,o=window.location.href.split("?")[1],i=new URLSearchParams("?".concat(o)),a=i.get("username"),s=i.get("password");a&&s&&(n.value=a,r.value=s,t.click())}},{key:"cutCheckCode",value:function(){this.node.cutCode.querySelector("img").src="/code?t=".concat((new Date).getTime())}},{key:"googleVerify",value:function(e){var t=this.node,n=t.formGoogleVerifyView,r=t.formGoogleVerifyInput;this.googleCheck=e,this.formData.vcode="",r.value="",e?(n.classList.remove("!hidden"),r.focus()):n.classList.add("!hidden")}},{key:"codeVerify",value:function(e){var t=this.node,n=t.inputCode,r=t.codeView;this.codeCheck=e,this.formData.code="",r.classList[e?"remove":"add"]("!hidden"),n.value=""}},{key:"setFormSubmitError",value:function(e){var t,n,r=this.node.formSubmit;return null===(t=r.parentElement)||void 0===t||null===(t=t.querySelector(".error-tips"))||void 0===t||t.remove(),null===(n=r.parentElement)||void 0===n||n.classList.add("error"),r.insertAdjacentHTML("afterend",'<div class="error-tips">'.concat(e,"</div>")),{close:function(){var e,t;null===(e=r.parentElement)||void 0===e||e.classList.remove("error"),null===(t=r.parentElement)||void 0===t||null===(t=t.querySelector(".error-tips"))||void 0===t||t.remove()}}}},{key:"submitLoginInfo",value:(u=f(l().m(function e(t){var n,r=this;return l().w(function(e){for(;;)switch(e.n){case 0:n=this.node.inputPassword,this.formVerify[t](function(){var e=f(l().m(function e(o){var i,a,s,c,u,d,m,f;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return i=r.loading("正在登录面板,请稍候..."),a=h(h({},r.formData),o),r.formData=h({},a),"string"==typeof t&&"vcode"===t&&(a.vcode=o.vcode),e.n=1,r.encryptionData(a);case 1:return s=e.v,r.hostCheck&&(s.cdn_url=r.formData.cdn_url),r.googleCheck&&(s.vcode=r.formData.vcode),r.codeCheck&&(s.code=r.formData.code),s=r.removeEmpty(s),e.p=2,sessionStorage.setItem("sendXhr","1"),e.n=3,r.request({method:"post",url:"/login",data:s});case 3:c=e.v,u=c.data,i.close(),r.submitError&&r.submitError.close(),r.loginErrorTimer=!1,"number"==typeof u&&1===u?r.googleVerify(!0):"object"===p(u)?(d=u.status,m=u.msg,d?(r.message({type:"success",message:m}),sessionStorage.setItem("loginInfo",JSON.stringify(u)),setTimeout(function(){window.location.href="/"},500)):(r.message({type:"error",message:m}),"vcode"===t?r.googleVerify(!0):(n.value="",r.googleVerify(!1),r.codeVerify(!0),r.cutCheckCode(),-1!==m.indexOf("验证码错误")&&r.cutCheckCode(),r.countdownInfo(m)))):r.message({message:u,type:"error",time:0,close:!0}),e.n=5;break;case 4:e.p=4,f=e.v,r.message({type:"error",message:f,close:!0}),i.close();case 5:return e.a(2)}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}());case 1:return e.a(2)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"countdownInfo",value:function(e){var t=this,n=0;if(e.indexOf("多次登录失败")>-1){var r=e.match(/\d+/g);r?(this.loginErrorTimer=!0,n=r[0],this.timer&&clearInterval(this.timer),this.timer=window.setInterval(function(){n--,t.submitError=t.setFormSubmitError(e.replace(/\d+/g,n.toString())),(n<=0||!t.loginErrorTimer)&&(clearInterval(t.timer),t.submitError.close(),n=0)},1e3)):setTimeout(function(){t.submitError.close()},3e3)}}},{key:"wechatLogin",value:(c=f(l().m(function e(){var t,n,r,o,i,a,s,c=this;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=this.loading("正在获取微信登录二维码,请稍候..."),e.p=1,e.n=2,this.request({method:"post",url:"/login",data:{wechat_action:"get_qrcode"}});case 2:n=e.v,r=n.data,t.close(),r.status?(o=window.screen.width/2-300,i=window.screen.height/2-250,a=r.msg.url.replace("login.html","new/wxBindPanel.html"),this.wechatWindow=window.open(a,"wechat_auth","width=".concat(600,",height=").concat(500,",left=").concat(o,",top=").concat(i)),s=function(e){var t,n;switch(null===(t=e.data)||void 0===t?void 0:t.type){case"wechat_auth_error":c.message({type:"error",message:e.data.msg,close:!0});try{var r;null===(r=c.wechatWindow)||void 0===r||r.close(),c.wechatLogin()}catch(l){}break;case"wechat_auth_complete":var o=e.data.data||{},i=o.code,a=o.state;null===(n=c.wechatWindow)||void 0===n||n.close(),window.removeEventListener("message",s),c.handleWechatLogin(i,a)}},window.addEventListener("message",s)):this.message({type:"error",message:r.msg||"获取微信登录二维码失败",close:!0}),e.n=4;break;case 3:e.p=3,e.v,t.close(),this.message({type:"error",message:"获取微信登录二维码失败",close:!0});case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return c.apply(this,arguments)})},{key:"handleWechatLogin",value:(s=f(l().m(function e(t,n){var r,o,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=this.loading("正在登录,请稍候..."),e.p=1,e.n=2,this.request({method:"post",url:"/login",data:{wechat_action:"checklogin",wxcode:t,state:n}});case 2:o=e.v,i=o.data,r.close(),i.status?(this.message({type:"success",message:i.msg||"微信登录成功"}),sessionStorage.setItem("loginInfo",JSON.stringify(i)),setTimeout(function(){window.location.href="/"},500)):this.message({type:"error",message:i.msg||"微信登录失败",close:!0}),e.n=4;break;case 3:e.p=3,e.v,r.close(),this.message({type:"error",message:"微信登录失败",close:!0});case 4:return e.a(2)}},e,this,[[1,3]])})),function(e,t){return s.apply(this,arguments)})},{key:"checkWebAuthnSupport",value:function(){return window.isSecureContext?!!window.PublicKeyCredential||(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)}},{key:"passkeyLogin",value:(a=f(l().m(function e(){var t,n,r,o,i,a,s,c,u;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.checkWebAuthnSupport()){e.n=1;break}return e.a(2);case 1:return t=this.loading("正在登录面板,请稍候..."),e.p=2,e.n=3,this.encryptionPasskey(JSON.stringify({origin:window.location.origin}));case 3:return n=e.v,e.n=4,this.request({method:"post",url:"/login",data:{passkey_action:"options",passkey_token:n}});case 4:if(r=e.v,o=r.data,t.close(),!o.hasOwnProperty("msg")){e.n=5;break}return this.message({type:o.status?"success":"error",message:o.msg,close:!o.status}),e.a(2);case 5:return e.n=6,this.getCredential(o);case 6:if(i=e.v){e.n=7;break}return e.a(2);case 7:return t=this.loading("正在验证Passkey,请稍候..."),e.n=8,this.encryptionPasskey(JSON.stringify({challenge:o.challenge,credential:i}));case 8:return a=e.v,e.n=9,this.request({method:"post",url:"/login",data:{passkey_action:"do_auth",passkey_token:a}});case 9:s=e.v,c=s.data,t.close(),c.status?(this.message({type:"success",message:c.msg}),sessionStorage.setItem("loginInfo",JSON.stringify(c)),setTimeout(function(){window.location.href="/"},1500)):this.message({type:"error",message:c.msg||"登录失败,请重试",close:!0}),e.n=11;break;case 10:e.p=10,u=e.v,this.message({type:"error",message:u,close:!0}),t.close();case 11:return e.a(2)}},e,this,[[2,10]])})),function(){return a.apply(this,arguments)})},{key:"getCredential",value:(i=f(l().m(function e(t){var n,r,o=this;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n={challenge:this.base64UrlToArrayBuffer(t.challenge),rpId:t.rpId,allowCredentials:t.allowCredentials?t.allowCredentials.map(function(e){return h(h({},e),{},{id:o.base64UrlToArrayBuffer(e.id)})}):[],userVerification:t.userVerification||"preferred",timeout:t.timeout||6e4},e.n=1,navigator.credentials.get({publicKey:n});case 1:if(r=e.v){e.n=2;break}throw new Error("用户取消了操作");case 2:return e.a(2,{id:window.md5(r.id),rawId:this.arrayBufferToBase64Url(r.rawId),response:{clientDataJSON:this.arrayBufferToBase64Url(r.response.clientDataJSON),authenticatorData:this.arrayBufferToBase64Url(r.response.authenticatorData),signature:this.arrayBufferToBase64Url(r.response.signature),userHandle:r.response.userHandle?this.arrayBufferToBase64Url(r.response.userHandle):null},type:r.type});case 3:return e.p=3,e.v,this.message({type:"error",message:"登录失败,请使用密码登录",close:!0}),e.a(2,null)}},e,this,[[0,3]])})),function(e){return i.apply(this,arguments)})}]);var i,a,s,c,u,d,m,v}(n),i=function(e){function n(e){var r;return g(this,n),b(r=t(this,n),"el",void 0),b(r,"node",void 0),b(r,"pollingQuery",!0),b(r,"timer",null),r.el="string"==typeof e?document.querySelector(e):e,r.node={cutTips:null,loginAccount:null,loginScan:null},r.render(),r}return o(n,e),y(n,[{key:"render",value:function(){this.getSacnLoginInfo()}},{key:"qrCodeRender",value:(s=f(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:(n=document.getElementById("canvas"))&&(n.innerHTML=""),new window.QRCode(n,t,{color:{dark:"#000000",light:"#ffffff"},width:"140px",height:"140px",errorCorrectionLevel:"Q"});case 1:return e.a(2)}},e)})),function(e){return s.apply(this,arguments)})},{key:"getSacnLoginInfo",value:(a=f(l().m(function e(){var t,n,r,o,i,a,s,c,u,d,h,m,f,g;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=!1,e.n=1,this.request({method:"post",url:"/public?name=app&fun=login_qrcode"});case 1:n=e.v,"object"===p(r=n.data)&&(o=r.status,i=r.msg,o?(c=i.replace(/(panel_url=)[^&]*/i,function(e,t){return"".concat(t+window.location.protocol,"//").concat(window.location.host)}),this.qrCodeRender(o?c:"https://www.bt.cn/download/app.html"),this.pollingQuerySacnInfo(),null===(a=document.querySelector(".login-scan-success"))||void 0===a||a.classList.remove("!hidden"),null===(s=document.querySelector(".login-scan-error"))||void 0===s||s.classList.add("!hidden"),(u=document.querySelector(".app-login-btn"))&&(u.classList.remove("hide"),t=!0)):(null===(d=document.querySelector(".login-scan-success"))||void 0===d||d.classList.add("!hidden"),null===(h=document.querySelector(".login-scan-error"))||void 0===h||h.classList.remove("!hidden"))),m=window.vite_public_wechat_status,f=window.vite_public_passkey_status,m||f||t||(g=document.querySelector(".login-third-party"))&&g.classList.add("hide"),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,this,[[0,2]])})),function(){return a.apply(this,arguments)})},{key:"pollingQuerySacnInfo",value:(i=f(l().m(function e(){var t,n,r,o,i=this;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,this.pollingQuery){e.n=1;break}return e.a(2,!1);case 1:return e.n=2,this.request({method:"post",url:"/public?name=app&fun=is_scan_ok"});case 2:t=e.v,n=t.data,r=n.status,o=n.msg,"object"===p(n)&&r?this.loginAdmin(o):this.timer=setTimeout(function(){var e=localStorage.getItem("loginType");if(i.timer&&"account"===e)return clearTimeout(i.timer);i.pollingQuerySacnInfo()},2500),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,this,[[0,3]])})),function(){return i.apply(this,arguments)})},{key:"loginAdmin",value:(r=f(l().m(function e(t){var n,r,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.request({method:"post",url:"/public?name=app&fun=set_login",data:{secret_key:t}});case 1:n=e.v,r=n.data,o=r.status,"object"===p(r)&&o&&(this.message({type:"success",message:"登录成功,正在跳转中"}),window.location.href="/"),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,this,[[0,2]])})),function(e){return r.apply(this,arguments)})}]);var r,i,a,s}(n),s=function(){return y(function e(){g(this,e),b(this,"defaultColors",{primary:"#20a53a",success:"#67c23a",warning:"#f2711c",danger:"#db2828",error:"#db2828",info:"#909399"}),b(this,"lightRatios",{3:.3,5:.5,7:.7,8:.8,9:.9}),b(this,"darkRatios",{2:.2}),b(this,"darkModeLightRatios",{3:.15,5:.25,7:.35,8:.45,9:.55}),b(this,"darkModeDarkRatios",{2:.3})},[{key:"hexToRgb",value:function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}},{key:"rgbToHex",value:function(e,t,n){return"#".concat(((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1))}},{key:"mixColors",value:function(e,t,n){return{r:Math.round(e.r*(1-n)+t.r*n),g:Math.round(e.g*(1-n)+t.g*n),b:Math.round(e.b*(1-n)+t.b*n)}}},{key:"generateLightColor",value:function(e,t){var n=this.hexToRgb(e);if(!n)throw new Error("Invalid color format: ".concat(e));var r=this.mixColors(n,{r:255,g:255,b:255},this.lightRatios[t]);return this.rgbToHex(r.r,r.g,r.b)}},{key:"generateDarkColor",value:function(e,t){var n=this.hexToRgb(e);if(!n)throw new Error("Invalid color format: ".concat(e));var r=this.mixColors(n,{r:0,g:0,b:0},this.darkRatios[t]);return this.rgbToHex(r.r,r.g,r.b)}},{key:"generateDarkModeLightColor",value:function(e,t){var n=this.hexToRgb(e);if(!n)throw new Error("Invalid color format: ".concat(e));var r=this.mixColors(n,{r:0,g:0,b:0},this.darkModeLightRatios[t]);return this.rgbToHex(r.r,r.g,r.b)}},{key:"generateDarkModeDarkColor",value:function(e,t){var n=this.hexToRgb(e);if(!n)throw new Error("Invalid color format: ".concat(e));var r=this.mixColors(n,{r:255,g:255,b:255},this.darkModeDarkRatios[t]);return this.rgbToHex(r.r,r.g,r.b)}},{key:"generateColorVariables",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=h(h({},this.defaultColors),t),o=h({darkMode:!1},n),i={};return Object.keys(r).forEach(function(t){var n=r[t];n&&(i["--el-color-".concat(t)]=n,o.darkMode?([3,5,7,8,9].forEach(function(r){i["--el-color-".concat(t,"-light-").concat(r)]=e.generateDarkModeLightColor(n,r)}),i["--el-color-".concat(t,"-dark-2")]=e.generateDarkModeDarkColor(n,2)):([3,5,7,8,9].forEach(function(r){i["--el-color-".concat(t,"-light-").concat(r)]=e.generateLightColor(n,r)}),i["--el-color-".concat(t,"-dark-2")]=e.generateDarkColor(n,2)))}),i}},{key:"applyColorVariables",value:function(e){}},{key:"generateAndApplyColors",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.generateColorVariables(e,t)}}])}(),c=function(){return y(function e(){g(this,e),b(this,"styleElement",null),b(this,"styleId","dynamic-theme-variables"),b(this,"currentVariables",{}),this.init()},[{key:"init",value:function(){this.createStyleElement()}},{key:"createStyleElement",value:function(){var e=document.getElementById(this.styleId);if(e)return this.styleElement=e,e;var t=document.createElement("style");t.id=this.styleId,t.type="text/css";return t.textContent="\n\t\t\t/* View Transitions API 支持 */\n\t\t\t::view-transition-old(root),\n\t\t\t::view-transition-new(root) {\n\t\t\t\tanimation-duration: 0.5s;\n\t\t\t\tz-index: 99999;\n\t\t\t}\n\n\t\t\t/* 当支持View Transitions时的圆形扩散动画 */\n\t\t\thtml.theme-switching::view-transition-old(root) {\n\t\t\t\tclip-path: circle(var(--circle-size, 100%) at var(--circle-x, 50%) var(--circle-y, 50%));\n\t\t\t}\n\n\t\t\thtml.theme-switching::view-transition-new(root) {\n\t\t\t\tclip-path: circle(var(--circle-size, 0px) at var(--circle-x, 50%) var(--circle-y, 50%));\n\t\t\t}\n\n\t\t\t/* 降级动画 - 当不支持View Transitions时 */\n\t\t\t.theme-transition-fallback {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100vw;\n\t\t\t\theight: 100vh;\n\t\t\t\tbackground: var(--fallback-bg-color, #ffffff);\n\t\t\t\tborder-radius: 50%;\n\t\t\t\ttransform: scale(0);\n\t\t\t\ttransform-origin: var(--circle-x, 50%) var(--circle-y, 50%);\n\t\t\t\tz-index: 99999;\n\t\t\t\tpointer-events: none;\n\t\t\t\ttransition: transform 0.5s ease-in-out;\n\t\t\t}\n\n\t\t\t.theme-transition-fallback.active {\n\t\t\t\ttransform: scale(3);\n\t\t\t}\n\n\t\t\t/* 主题切换按钮状态 */\n\t\t\t.theme-toggle-button {\n\t\t\t\ttransition: transform 0.2s ease;\n\t\t\t}\n\n\t\t\t.theme-toggle-button:hover {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t}\n\n\t\t\t.theme-toggle-button.transitioning {\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t",document.head.appendChild(t),this.styleElement=t,t}},{key:"registerVariables",value:function(e,t){var n={};Object.keys(e).forEach(function(r){var o=t?"--".concat(t,"-").concat(r.replace(/^--/,"")):r;n[o]=e[r]}),Object.assign(this.currentVariables,n),this.updateStyles()}},{key:"registerColorVariables",value:function(e,t){this.registerVariables(e,t)}},{key:"registerThemeVariables",value:function(e){var t={};if(e.theme&&e.theme.color&&(t["--theme-primary-color"]=e.theme.color),e.interface&&e.interface.rounded)switch(e.interface.rounded){case"none":t["--el-border-radius-small"]="0px",t["--el-border-radius-base"]="0px",t["--el-border-radius-medium"]="0px",t["--el-border-radius-large"]="0px",t["--el-border-radius-extra-large"]="0px";break;case"smaller":t["--el-border-radius-small"]="2px",t["--el-border-radius-base"]="2px",t["--el-border-radius-medium"]="2px",t["--el-border-radius-large"]="4px",t["--el-border-radius-extra-large"]="6px";break;case"small":t["--el-border-radius-small"]="2px",t["--el-border-radius-base"]="4px",t["--el-border-radius-medium"]="6px",t["--el-border-radius-large"]="8px",t["--el-border-radius-extra-large"]="16px";break;case"medium":t["--el-border-radius-small"]="4px",t["--el-border-radius-base"]="6px",t["--el-border-radius-medium"]="8px",t["--el-border-radius-large"]="12px",t["--el-border-radius-extra-large"]="20px";break;case"large":t["--el-border-radius-small"]="8px",t["--el-border-radius-base"]="12px",t["--el-border-radius-medium"]="16px",t["--el-border-radius-large"]="20px",t["--el-border-radius-extra-large"]="24px";break;default:t["--el-border-radius-small"]="4px",t["--el-border-radius-base"]="6px",t["--el-border-radius-medium"]="8px",t["--el-border-radius-large"]="12px",t["--el-border-radius-extra-large"]="16px"}e.login&&(e.login.bg_image&&(t["--login-bg-image"]="url('".concat(e.login.bg_image,"')")),void 0!==e.login.bg_image_opacity&&(t["--login-bg-opacity"]=String(e.login.bg_image_opacity/100)),void 0!==e.login.content_opacity&&(t["--login-content-opacity"]=String(e.login.content_opacity/100)),e.login.logo&&(t["--login-logo-url"]="url('".concat(e.login.logo,"')"))),e.logo&&(e.logo.image&&(t["--logo-image-url"]="url('".concat(e.logo.image,"')")),e.logo.favicon&&(t["--logo-favicon-url"]="url('".concat(e.logo.favicon,"')"))),this.registerVariables(t,"")}},{key:"removeVariablesByNamespace",value:function(e){var t=this,n="--".concat(e,"-");Object.keys(this.currentVariables).forEach(function(e){e.startsWith(n)&&delete t.currentVariables[e]}),this.updateStyles()}},{key:"clearAllVariables",value:function(){this.currentVariables={},this.updateStyles()}},{key:"updateStyles",value:function(){this.styleElement||this.createStyleElement();var e=this.generateCSSRules();this.styleElement&&(this.styleElement.textContent=e)}},{key:"getSystemTheme",value:function(){try{return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}},{key:"isDark",value:function(){try{var e=window.vite_public_panel_theme.theme.preset;return"auto"===e?"dark"===this.getSystemTheme():"dark"===e}catch(t){return!1}}},{key:"generateCSSRules",value:function(){var e=this,t=Object.keys(this.currentVariables).map(function(t){return"  ".concat(t,": ").concat(e.currentVariables[t],";")}).join("\n");return"".concat(this.isDark()?"html.dark {":":root {","\n").concat(t,"\n}")}},{key:"getCurrentVariables",value:function(){return h({},this.currentVariables)}},{key:"getVariable",value:function(e){return this.currentVariables[e]}},{key:"hasVariable",value:function(e){return e in this.currentVariables}},{key:"destroy",value:function(){this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement),this.styleElement=null,this.currentVariables={}}}])}(),u=function(){return y(function e(){var t=this;g(this,e),b(this,"currentTheme",void 0),b(this,"themeToggleBtn",void 0),b(this,"themeIcon",void 0),b(this,"colorGenerator",void 0),b(this,"styleManager",void 0),b(this,"panelTheme",void 0),this.themeToggleBtn=null,this.themeIcon=null,this.colorGenerator=new s,this.styleManager=new c,this.panelTheme=window.vite_public_panel_theme||null,this.currentTheme=this.getInitialTheme(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){return t.init()}):this.init()},[{key:"init",value:function(){this.bindElements(),this.applyTheme(this.currentTheme),this.updateThemeIcon(this.currentTheme),this.updateThemeTips(this.currentTheme),this.bindEvents()}},{key:"bindElements",value:function(){this.themeToggleBtn=document.querySelector("#theme-toggle-btn"),this.themeIcon=document.querySelector("#theme-toggle-btn .theme-icon")}},{key:"bindEvents",value:function(){var e=this;this.themeToggleBtn&&(this.themeToggleBtn.classList.add("theme-toggle-button"),this.themeToggleBtn.addEventListener("click",function(t){e.toggleTheme(t)}))}},{key:"toggleTheme",value:(t=f(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(!document.documentElement.classList.contains("theme-switching")){e.n=1;break}return e.a(2);case 1:if(n="light"===this.currentTheme?"dark":"light",!t){e.n=3;break}return e.n=2,this.animateThemeToggle(t,n);case 2:e.n=4;break;case 3:this.setTheme(n);case 4:return e.a(2)}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"animateThemeToggle",value:(e=f(l().m(function e(t,n){var r,o,i,a,s=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),t.stopPropagation(),r=t.clientX,o=t.clientY,i=Math.hypot(Math.max(r,window.innerWidth-r),Math.max(o,window.innerHeight-o)),document.documentElement.style.setProperty("--circle-x","".concat(r,"px")),document.documentElement.style.setProperty("--circle-y","".concat(o,"px")),document.documentElement.style.setProperty("--circle-size","".concat(2*i,"px")),document.documentElement.classList.add("theme-switching"),this.themeToggleBtn&&this.themeToggleBtn.classList.add("transitioning"),a=function(){s.setTheme(n)},"function"==typeof document.startViewTransition)try{document.startViewTransition(a).finished.then(function(){document.documentElement.classList.remove("theme-switching"),s.themeToggleBtn&&s.themeToggleBtn.classList.remove("transitioning")}).catch(function(e){document.documentElement.classList.remove("theme-switching"),s.themeToggleBtn&&s.themeToggleBtn.classList.remove("transitioning")})}catch(c){setTimeout(function(){a(),document.documentElement.classList.remove("theme-switching")},100)}else this.createFallbackAnimation(r,o,"dark"===n?"#1a1a1a":"#ffffff"),setTimeout(a,250),setTimeout(function(){document.documentElement.classList.remove("theme-switching"),s.removeFallbackAnimation(),s.themeToggleBtn&&s.themeToggleBtn.classList.remove("transitioning")},500);case 1:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})},{key:"createFallbackAnimation",value:function(e,t,n){var r=document.createElement("div");r.className="theme-transition-fallback",r.style.setProperty("--circle-x","".concat(e,"px")),r.style.setProperty("--circle-y","".concat(t,"px")),r.style.setProperty("--fallback-bg-color",n),r.id="theme-fallback-animation",document.body.appendChild(r),setTimeout(function(){r.classList.add("active")},10)}},{key:"removeFallbackAnimation",value:function(){var e=document.getElementById("theme-fallback-animation");e&&e.remove()}},{key:"setTheme",value:function(e){this.currentTheme=e,this.applyTheme(e),this.updateThemeIcon(e),this.updateThemeTips(e)}},{key:"applyThemeImmediate",value:function(e){var t=document.documentElement;"dark"===e?t.setAttribute("data-theme","dark"):t.removeAttribute("data-theme")}},{key:"applyTheme",value:function(e){this.applyThemeImmediate(e),this.applyPanelThemeColors()}},{key:"applyPanelThemeColors",value:function(){var e;if(this.panelTheme){var t="dark"===this.currentTheme,n=(null===(e=this.panelTheme.theme)||void 0===e?void 0:e.color)||"#20a53a",r=this.colorGenerator.generateAndApplyColors({primary:n,success:"#67c23a",warning:"#f2711c",danger:"#db2828",error:"#db2828",info:"#909399"},{darkMode:t});this.styleManager.registerColorVariables(r,""),this.applyDarkModeSpecialStyles(n,t),this.applyInterfaceStyles()}}},{key:"applyInterfaceStyles",value:function(){this.panelTheme&&this.styleManager.registerThemeVariables(this.panelTheme)}},{key:"applyDarkModeSpecialStyles",value:function(e,t){var n="dark-mode-special-styles",r=document.getElementById(n);if(t&&"#F4D1B4"===e){if(!r){var o=document.createElement("style");o.id=n,o.textContent="\n\t\t\t\t\t/* 暗金色主题特定样式修正 */\n\t\t\t\t\thtml.dark {\n\t\t\t\t\t\t--el-color-primary: #F4D1B4 !important;\n\t\t\t\t\t\t--el-color-primary-light-3: #EAC2A5 !important;\n\t\t\t\t\t\t--el-color-primary-light-5: #E0B396 !important;\n\t\t\t\t\t\t--el-color-primary-light-7: #D6A487 !important;\n\t\t\t\t\t\t--el-color-primary-light-8: #CC9578 !important;\n\t\t\t\t\t\t--el-color-primary-light-9: #C28669 !important;\n\t\t\t\t\t\t--el-color-primary-dark-2: #F4D1B4 !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .tips .tips-text{\n\t\t\t\t\t\tcolor: #a9750b !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .el-button--primary {\n\t\t\t\t\t\tcolor: #1F1F1F !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .el-checkbox__input.is-checked .el-checkbox__inner::after {\n\t\t\t\t\t\tborder-color: #1F1F1F !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .el-radio-button.is-active .el-radio-button__original-radio:not(:disabled)+.el-radio-button__inner {\n\t\t\t\t\t\tcolor: #1F1F1F !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .class-item.on {\n\t\t\t\t\t\tcolor: #1F1F1F !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .message-number {\n\t\t\t\t\t\tcolor: #1F1F1F !important;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml.dark .el-switch.is-checked .el-switch__core .el-switch__action {\n\t\t\t\t\t\tbackground-color: #1F1F1F !important;\n\t\t\t\t\t}\n\t\t\t\t\thtml.dark .form-select-module .select-list .select-item:hover{\n\t\t\t\t\t\tbackground-color: #1F1F1F !important;\n\t\t\t\t\t}\n\t\t\t\t",document.head.appendChild(o)}}else r&&r.remove()}},{key:"updateThemeIcon",value:function(e){this.themeIcon&&(this.themeIcon.innerHTML="dark"===e?'\n\t\t\t\t<circle cx="12" cy="12" r="5"/>\n\t\t\t\t<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\t\t\t':'\n\t\t\t\t<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>\n\t\t\t')}},{key:"updateThemeTips",value:function(e){this.themeToggleBtn&&("dark"===e?this.themeToggleBtn.setAttribute("title","切换到亮色主题"):this.themeToggleBtn.setAttribute("title","切换到暗色主题"))}},{key:"getStoredTheme",value:function(){return localStorage.getItem("theme")}},{key:"getInitialTheme",value:function(){var e;if(void 0!==(null===(e=this.panelTheme)||void 0===e||null===(e=e.theme)||void 0===e?void 0:e.preset))return this.panelTheme.theme.preset;var t=this.getStoredTheme();return t||this.detectSystemTheme()}},{key:"detectSystemTheme",value:function(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}},{key:"getStyleManager",value:function(){return this.styleManager}},{key:"registerCustomVariables",value:function(e,t){this.styleManager.registerVariables(e,t)}},{key:"getAllVariables",value:function(){return this.styleManager.getCurrentVariables()}}]);var e,t}(),d=function(e){function n(e){var r;g(this,n),b(r=t(this,n),"loginType",void 0),b(r,"el",void 0),b(r,"node",void 0),b(r,"autoLoginParams",void 0),b(r,"themeManager",void 0),b(r,"loginAccountInstance",null);var o=document.querySelector("#login-main");r.loginType=localStorage.getItem("loginType")||"account",r.el=document.querySelector(e.el),r.node={cutTips:null,loginAccount:null,loginScan:null},r.autoLoginParams={password:"",username:""},r.themeManager=new u,r.render(),o&&(o.style.display="block");var i=window.vite_public_passkey_status,a=document.querySelector(".passkey-login-btn");i&&a&&a.classList.remove("hide");var s=window.vite_public_wechat_status,c=document.querySelector(".wechat-login-btn");s&&c&&c.classList.remove("hide");var l=document.querySelector(".login-account");return null!=l&&l.classList.value.includes("hidden")||r.checkAppLoginStatus(),r}return o(n,e),y(n,[{key:"checkAppLoginStatus",value:(a=f(l().m(function e(){var t,n,r,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=!1,e.p=1,e.n=2,this.request({method:"get",url:"/public?name=app&fun=login_qrcode"});case 2:n=e.v,null!=(r=n.data)&&r.status&&(o=document.querySelector(".app-login-btn"))&&(o.classList.remove("hide"),t=!0),e.n=4;break;case 3:e.p=3,e.v;case 4:this.checkThirdPartyLoginVisible(t);case 5:return e.a(2)}},e,this,[[1,3]])})),function(){return a.apply(this,arguments)})},{key:"checkThirdPartyLoginVisible",value:function(e){var t=window.vite_public_wechat_status,n=window.vite_public_passkey_status;if(!t&&!n&&!e){var r=document.querySelector(".login-third-party");r&&r.classList.add("hide")}}},{key:"initPageStyle",value:function(){var e,t,n=window.vite_public_panel_theme,r=null==n||null===(e=n.login)||void 0===e?void 0:e.is_show_bg,o=null==n||null===(t=n.login)||void 0===t?void 0:t.is_show_logo,i=((null==n?void 0:n.login)||{}).bg_image,a=this.el.querySelector("#login-images");a&&r&&i&&(a.style.backgroundImage="url('".concat(i,"')"),a.style.opacity="var(--login-bg-opacity, 1)",a.style.display="block");var s=this.el.querySelector("#login-svg");if(s)if(o){s.classList.remove("!hidden");var c,l=s.querySelector("#login-logo");if(l)l.src=(null==n||null===(c=n.login)||void 0===c?void 0:c.logo)||"/static/icons/logo-green.svg"}else s.classList.add("!hidden");var u=this.el.querySelector("#cut-login-type");u&&(u.style.top=o?"110px":"20px",u.className="cut-login-type ".concat(this.loginType))}},{key:"domMount",value:function(){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")}},{key:"eventMount",value:function(){var e=this.node,t=e.cutLoginType,n=(e.cutTips,e.appLoginBtn);this.bindEvent(t,"click",this.cutType.bind(this)),this.bindEvent(n,"click",this.cutType.bind(this))}},{key:"setLoginScan",value:function(){var e=this.node,t=e.loginScan,n=e.loginAccount,r=e.cutLoginType;this.loginType="scan",t.classList.remove("!hidden"),n.classList.add("!hidden"),r.classList.remove("!hidden"),new i(this.node.loginScan)}},{key:"cutType",value:function(){var e=this.node,t=e.cutLoginType,n=e.cutTips;t.classList.add("account"===this.loginType?"scan":"account"),t.classList.remove("account"===this.loginType?"account":"scan"),"account"===this.loginType?(this.setLoginScan(),n.innerText="切换账号登录",localStorage.setItem("loginType","scan"),this.updateLoginTypeIcon("scan"),t.classList.remove("!hidden")):(this.setLoginAccount(),n.innerText="切换扫码登录",localStorage.setItem("loginType","account"),this.updateLoginTypeIcon("account"),t.classList.add("!hidden"))}},{key:"setLoginAccount",value:function(){var e=this.node,t=e.loginScan,n=e.loginAccount,o=e.cutLoginType;this.loginType="account",t.classList.add("!hidden"),n.classList.remove("!hidden"),o.classList.add("!hidden"),this.loginAccountInstance||(this.loginAccountInstance=new r(this.node.loginAccount))}},{key:"updateLoginTypeIcon",value:function(e){var t=this.node.cutLoginType;if(t){var n=t.querySelector(".login-type-icon");if(n){var r="account"===e?'<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"/>';n.innerHTML=r}}}},{key:"render",value:function(){this.initPageStyle(),this.loginType=localStorage.getItem("loginType")||"account";var e=this.el.querySelector("#login-title-text");e&&(e.textContent=window.vite_public_title,e.title=window.vite_public_title),this.domMount(),this.eventMount(),"account"===this.loginType?this.setLoginAccount():this.setLoginScan()}}]);var a}(n);new d({el:"#app"})}}})}();