(async function(){console.log("[About] 模块脚本启动 (JS 重构版)...");const container=document.getElementById("about_container");if(!container){console.error("[About] 找不到 ID 为 about_container 的容器");return}container.style.display="block";try{const config=window.pluginConfig||pluginConfig;const userToken=await window.configAPI.getUserToken();const about_url=config.about_url;let url=`${about_url}?v=${config.version}`;console.log(`[About] 请求版本信息: ${url}`);const responseData=await window.NetworkClient.get(url,{},{skipAuth:true,showProgress:false,ignoreErrors:false});const progressData=responseData.data||responseData;if(!progressData){throw new Error("API 返回数据为空")}const messageHtml=`\n            <div style="text-align: center; line-height: 1.8;">\n                <p><strong>当前版本:</strong> v${config.version}</p>\n                <p><strong>最后发布的版本：</strong>${progressData.latestVersion}</p>\n                <h3 style="margin: 15px 0 10px 0; color: #3273dc;">${progressData.message}</h3>\n                <p><strong>下载地址：</strong><a href="${progressData.downloadUrl}" target="_blank">${progressData.downloadUrl}</a></p>\n                <p><strong>官方网站：</strong><a href="${progressData.webUrl}" target="_blank">${progressData.webUrlNohttp}</a></p>\n            </div>\n        `;const actions=[];if(config.version!==progressData.latestVersion){actions.push({text:"立即升级",callback:async event=>{if(window.NetworkClient&&typeof window.NetworkClient.updateProgressUI==="function"){window.NetworkClient.updateProgressUI(0,"准备下载...")}else{showLoading()}console.log(JSON.stringify(progressData));const btn=event?.target;if(btn)btn.disabled=true;let progressListener=null;try{progressListener=progressData=>{if(window.NetworkClient&&typeof window.NetworkClient.updateProgressUI==="function"){if(progressData.status==="progress"){window.NetworkClient.updateProgressUI(progressData.percent,progressData.message)}else if(progressData.status==="indeterminate"){window.NetworkClient.updateProgressUI(-1,progressData.message)}else if(progressData.status==="done"){window.NetworkClient.updateProgressUI(100,"正在升级...切勿中断...")}else if(progressData.status==="error"){}}};window.ipcRenderer.on("update-progress",progressListener);const result=await window.configAPI.doUpdate(progressData);window.configAPI.restartApp();return result}catch(error){console.error("[Update] 调用失败:",error);indow.ipcRenderer.removeListener("update-progress",progressListener);if(confirm("升级失败！是否立即重启应用？")){window.configAPI.restartApp()}}finally{window.ipcRenderer.removeListener("update-progress",progressListener);if(btn)btn.disabled=false;window.NetworkClient.hideProgressUI();hideLoading()}}})}else{actions.push({text:"当前已是最新版本",callback:()=>{ModuleLoader.load("sounds")}})}if(typeof showMsgInContent==="function"){showMsgInContent(messageHtml,actions)}else{container.innerHTML=messageHtml}}catch(error){console.error("[About] 渲染过程出错:",error);const errorMsg=typeof decodeUnicodeString==="function"?decodeUnicodeString(error.message):error.message;if(typeof showErrorInContent==="function"){showErrorInContent(`加载关于信息失败：${errorMsg}`,[{text:"重试",callback:()=>{ModuleLoader.load("about")}},{text:"返回",callback:()=>{ModuleLoader.load("sounds")}}])}else{container.innerHTML=`<div style="color:red; padding:20px;">加载失败：${errorMsg}</div>`}}finally{hideLoading()}})();