From 13e0e78e48a36afd175b18af4021205b595b18a1 Mon Sep 17 00:00:00 2001 From: EduarteXD Date: Sun, 4 May 2025 18:54:06 +0800 Subject: [PATCH] typescript support --- .gitignore | 6 +- .vscode/settings.json | 2 + Legacy/StarCitizenBoxBrowserEx/background.js | 166 ------------ Legacy/StarCitizenBoxBrowserEx/core.js | 251 ------------------ Legacy/StarCitizenBoxBrowserEx/icon.png | Bin 12495 -> 0 bytes Legacy/StarCitizenBoxBrowserEx/injected.js | 22 -- Legacy/StarCitizenBoxBrowserEx/manifest.json | 62 ----- Legacy/StarCitizenBoxBrowserEx/popup.html | 100 ------- .../StarCitizenBoxBrowserEx/rsi_hangar_fix.js | 93 ------- .../thirdparty/jquery.min.js | 2 - .../thirdparty/timeago.full.min.js | 1 - .../background.js | 153 ----------- .../StarCitizenBoxBrowserEx_Firefox/core.js | 194 -------------- .../StarCitizenBoxBrowserEx_Firefox/icon.png | Bin 12495 -> 0 bytes .../manifest.json | 57 ---- .../popup.html | 100 ------- .../thirdparty/jquery.min.js | 2 - .../thirdparty/timeago.full.min.js | 1 - background.js => background.ts | 71 +++-- core.js => core.ts | 59 ++-- dist/chrome/background/service_worker.js | 2 +- dist/chrome/content_scripts/content-0.js | 2 +- dist/chrome/content_scripts/content-1.js | 2 +- dist/chrome/content_scripts/content-2.js | 2 +- dist/firefox/background/scripts.js | 2 +- dist/firefox/content_scripts/content-0.js | 2 +- dist/firefox/content_scripts/content-1.js | 2 +- dist/firefox/content_scripts/content-2.js | 2 +- manifest.json | 8 +- package.json | 4 +- pnpm-lock.yaml | 36 ++- rsi_hangar_fix.js | 93 ------- .../rsi_hangar_fix.js => rsi_hangar_fix.ts | 6 +- tsconfig.json | 25 ++ 34 files changed, 155 insertions(+), 1375 deletions(-) delete mode 100644 Legacy/StarCitizenBoxBrowserEx/background.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx/core.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx/icon.png delete mode 100644 Legacy/StarCitizenBoxBrowserEx/injected.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx/manifest.json delete mode 100644 Legacy/StarCitizenBoxBrowserEx/popup.html delete mode 100644 Legacy/StarCitizenBoxBrowserEx/rsi_hangar_fix.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx/thirdparty/jquery.min.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx/thirdparty/timeago.full.min.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/background.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/core.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/icon.png delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/manifest.json delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/popup.html delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/thirdparty/jquery.min.js delete mode 100644 Legacy/StarCitizenBoxBrowserEx_Firefox/thirdparty/timeago.full.min.js rename background.js => background.ts (74%) rename core.js => core.ts (83%) delete mode 100644 rsi_hangar_fix.js rename Legacy/StarCitizenBoxBrowserEx_Firefox/rsi_hangar_fix.js => rsi_hangar_fix.ts (94%) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 6a125e8..6dc2b88 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ node_modules # testing coverage +# dist/ + # misc .DS_Store @@ -24,4 +26,6 @@ yarn-debug.log* yarn-error.log* # extension.js -extension-env.d.ts \ No newline at end of file +extension-env.d.ts + +.vscode/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 7b7fd16..83c64da 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,9 @@ "clazz", "erkul", "robertsspaceindustries", + "SWTT", "timeago", + "uexcorp", "WARBOND" ] } \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx/background.js b/Legacy/StarCitizenBoxBrowserEx/background.js deleted file mode 100644 index e99e7d2..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/background.js +++ /dev/null @@ -1,166 +0,0 @@ -let dataVersion = null - -chrome.runtime.onInstalled.addListener(function () { - _checkVersion().then(_ => { - }); - console.log("SWTT init"); -}); - -chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { - if (request.action === "_loadLocalizationData") { - _initLocalization(request.url).then(data => { - sendResponse({result: data}); - }); - return true; - } -}); - -async function _checkVersion() { - dataVersion = await _getJsonData("versions.json"); - console.log("Localization Version ==="); - console.log(dataVersion); -} - -async function _initLocalization(url) { - console.log("url ===" + url); - if (dataVersion == null) { - await _checkVersion(); - return _initLocalization(url); - } - let v = dataVersion - // TODO check version - let data = {}; - - if (url.includes("robertsspaceindustries.com") || url.includes("manual")) { - data["zh-CN"] = await _getJsonData("zh-CN-rsi.json", {cacheKey: "zh-CN", version: v.rsi}); - data["concierge"] = await _getJsonData("concierge.json", {cacheKey: "concierge", version: v.concierge}); - data["orgs"] = await _getJsonData("orgs.json", v.orgs); - data["address"] = await _getJsonData("addresses.json", {cacheKey: "orgs", version: v.addresses}); - data["hangar"] = await _getJsonData("hangar.json", {cacheKey: "hangar", version: v.hangar}); - } else if (url.includes("uexcorp.space")) { - data["UEX"] = await _getJsonData("zh-CN-uex.json", {cacheKey: "uex", version: v.uex}); - } else if (url.includes("erkul.games")) { - data["DPS"] = await _getJsonData("zh-CN-dps.json", {cacheKey: "dps", version: v.dps}); - } - // update data - let replaceWords = []; - - function addLocalizationResource(key) { - replaceWords.push(...getLocalizationResource(data, key)); - } - - if (url.includes("robertsspaceindustries.com") || url.includes("manual")) { - const org = "https://robertsspaceindustries.com/orgs"; - const citizens = "https://robertsspaceindustries.com/citizens"; - const organization = "https://robertsspaceindustries.com/account/organization"; - const concierge = "https://robertsspaceindustries.com/account/concierge"; - const referral = "https://robertsspaceindustries.com/account/referral-program"; - const address = "https://robertsspaceindustries.com/account/addresses"; - const hangar = "https://robertsspaceindustries.com/account/pledges"; - const spectrum = "https://robertsspaceindustries.com/spectrum/community/"; - if (url.startsWith(spectrum)) { - return; - } - addLocalizationResource("zh-CN"); - if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) { - replaceWords.push({"word": 'members', "replacement": '名成员'}); - addLocalizationResource("orgs"); - } - if (url.startsWith(address)) { - addLocalizationResource("address"); - } - - if (url.startsWith(referral)) { - replaceWords.push( - {"word": 'Total recruits: ', "replacement": '总邀请数:'}, - {"word": 'Prospects ', "replacement": '未完成的邀请'}, - {"word": 'Recruits', "replacement": '已完成的邀请'} - ); - } - - if (url.startsWith(concierge)) { - replaceWords = []; - addLocalizationResource("concierge"); - } - - if (url.startsWith(hangar)) { - addLocalizationResource("hangar"); - } - } else if (url.includes("uexcorp.space")) { - addLocalizationResource("UEX"); - } else if (url.includes("erkul.games")) { - addLocalizationResource("DPS"); - } - return replaceWords; -} - - -function getLocalizationResource(localizationResource, key) { - const localizations = []; - const dict = localizationResource[key]; - if (typeof dict === "object") { - for (const [k, v] of Object.entries(dict)) { - const trimmedKey = k - .toString() - .trim() - .toLowerCase() - .replace(/\xa0/g, ' ') - .replace(/\s{2,}/g, ' '); - localizations.push({"word": trimmedKey, "replacement": v.toString()}); - } - } - return localizations; -} - -async function _getJsonData(fileName, {cacheKey = "", version = null} = {}) { - url = "https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/" + fileName; - if (cacheKey && cacheKey !== "") { - const localVersion = await getLocalData(`${cacheKey}_version`); - const data = await getLocalData(cacheKey); - if (data && typeof data === 'object' && Object.keys(data).length > 0 && localVersion === version) { - return data; - } - } - const startTime = new Date(); - const response = await fetch(url, {method: 'GET', mode: 'cors'}); - const endTime = new Date(); - const data = await response.json(); - if (cacheKey && cacheKey !== "") { - console.log(`update ${cacheKey} v == ${version} time == ${(endTime - startTime) / 1000}s`); - await setLocalData(cacheKey, data); - await setLocalData(`${cacheKey}_version`, version); - } - return data; -} - -function getLocalData(key) { - return new Promise((resolve) => { - chrome.storage.local.get([key], (result) => { - const data = result[key]; - resolve(data || null); - }); - }); -} - -function setLocalData(key, data) { - return new Promise((resolve) => { - const newData = {}; - newData[key] = data; - chrome.storage.local.set(newData, () => { - resolve(); - }); - }); -} - -chrome.contextMenus.create({ - id: "translate", - title: "翻译本页面", - contexts: ["page"] -}); - -chrome.contextMenus.onClicked.addListener((info, tab) => { - console.log("contextMenus", info, tab); - _initLocalization("manual").then(data => { - chrome.tabs.sendMessage(tab.id, {action: "_initTranslation", data}); - }); -}); diff --git a/Legacy/StarCitizenBoxBrowserEx/core.js b/Legacy/StarCitizenBoxBrowserEx/core.js deleted file mode 100644 index c21a63c..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/core.js +++ /dev/null @@ -1,251 +0,0 @@ -let SCLocalizationReplaceLocalesMap = {}; -let SCLocalizationEnableSplitMode = false; - -function InitWebLocalization() { - // init script - LocalizationWatchUpdate(); - // load Data - _loadLocalizationData(); -} - -function LocalizationWatchUpdate() { - const m = window.MutationObserver || window.WebKitMutationObserver; - const observer = new m(function (mutations, observer) { - for (let mutationRecord of mutations) { - for (let node of mutationRecord.addedNodes) { - traverseElement(node); - } - } - }); - - observer.observe(document.body, { - subtree: true, - characterData: true, - childList: true, - }); - - if (window.location.href.includes("robertsspaceindustries.com")) { - console.log("SCLocalizationEnableSplitMode = true"); - SCLocalizationEnableSplitMode = true; - } - - if (window.location.hostname.includes("www.erkul.games")) { - document.body.addEventListener("click", function (event) { - setTimeout(function () { - allTranslate().then(_ => { - }); - }, 200); - }); - } -} - -function WebLocalizationUpdateReplaceWords(w) { - let replaceWords = w.sort(function (a, b) { - return b.word.length - a.word.length; - }); - replaceWords.forEach(({ word, replacement }) => { - SCLocalizationReplaceLocalesMap[word] = replacement; - }); - if (window.location.hostname.startsWith("issue-council.robertsspaceindustries.com")) { - SCLocalizationReplaceLocalesMap["save"] = "保存"; - } - allTranslate().then(_ => { - }); - // console.log("WebLocalizationUpdateReplaceWords ==" + w) -} - -async function allTranslate() { - async function replaceTextNode(node1) { - if (node1.nodeType === Node.TEXT_NODE) { - node1.nodeValue = GetSCLocalizationTranslateString(node1.nodeValue); - } else { - for (let i = 0; i < node1.childNodes.length; i++) { - await replaceTextNode(node1.childNodes[i]); - } - } - } - - await replaceTextNode(document.body); -} - -function traverseElement(el) { - if (!shouldTranslateEl(el)) { - return - } - - for (const child of el.childNodes) { - if (["RELATIVE-TIME", "TIME-AGO"].includes(el.tagName)) { - translateRelativeTimeEl(el); - return; - } - - if (child.nodeType === Node.TEXT_NODE) { - translateElement(child); - } else if (child.nodeType === Node.ELEMENT_NODE) { - if (child.tagName === "INPUT") { - translateElement(child); - } else { - traverseElement(child); - } - } else { - // pass - } - } -} - -function translateElement(el) { - // Get the text field name - let k; - if (el.tagName === "INPUT") { - if (el.type === 'button' || el.type === 'submit') { - k = 'value'; - } else { - k = 'placeholder'; - } - } else { - k = 'data'; - } - el[k] = GetSCLocalizationTranslateString(el[k]); -} - -function translateRelativeTimeEl(el) { - const lang = (navigator.language || navigator.userLanguage); - const datetime = $(el).attr('datetime'); - $(el).text(timeago.format(datetime, lang.replace('-', '_'))); -} - -function shouldTranslateEl(el) { - const blockIds = []; - const blockClass = [ - "css-truncate" // 过滤文件目录 - ]; - const blockTags = ["IMG", "svg", "mat-icon"]; - if (blockTags.includes(el.tagName)) { - return false; - } - if (el.id && blockIds.includes(el.id)) { - return false; - } - if (el.classList) { - for (let clazz of blockClass) { - if (el.classList.contains(clazz)) { - return false; - } - } - } - return true; -} - -function GetSCLocalizationTranslateString(txtSrc) { - const key = txtSrc.toLowerCase().replace(/\xa0/g, ' ').replace(/\s{2,}/g, ' ').trim(); - const sourceKey = txtSrc.replace(/\xa0/g, ' ').replace(/\s{2,}/g, ' ').trim(); - let noTheKey = key.replace("the ", ""); - let noHorizontalKey = key.replace("- ", ""); - - if (SCLocalizationReplaceLocalesMap[key]) { - txtSrc = SCLocalizationReplaceLocalesMap[key] - } else if (SCLocalizationEnableSplitMode) { - if (sourceKey.includes(" - ")) { - let nodeValue = txtSrc - let splitKey = sourceKey.split(" - "); - if (splitKey[0].toLowerCase() === "upgrade" && key.includes("to") && key.endsWith("edition")) { - // 升级包规则 - let noVersionStr = key.replace("STANDARD EDITION".toLowerCase(), "").replace("upgrade", "").replace("WARBOND EDITION".toLowerCase(), "") - let shipNames = noVersionStr.split(" to ") - let finalString = "升级包 " + GetSCLocalizationTranslateString(shipNames[0]) + " 到 " + GetSCLocalizationTranslateString(shipNames[1]); - if (key.endsWith("WARBOND EDITION".toLowerCase())) { - finalString = finalString + " 战争债券版" - } else { - finalString = finalString + " 标准版" - } - txtSrc = finalString - } else { - // 机库通用规则 - splitKey.forEach(function (splitKey) { - if (SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) { - nodeValue = nodeValue.replace(splitKey, SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) - } else { - nodeValue = nodeValue.replace(splitKey, GetSCLocalizationTranslateString(splitKey)) - } - }); - txtSrc = nodeValue - } - } else if (key.endsWith("starter pack") || key.endsWith("starter package")) { - let shipName = key.replace("starter package", "").replace("starter pack", "").trim() - if (SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]) { - shipName = SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]; - } - txtSrc = shipName + " 新手包"; - } else if (key.startsWith("the ") && SCLocalizationReplaceLocalesMap[noTheKey]) { - txtSrc = SCLocalizationReplaceLocalesMap[noTheKey]; - } else if (key.startsWith("- ") && SCLocalizationReplaceLocalesMap[noHorizontalKey]) { - txtSrc = "- " + SCLocalizationReplaceLocalesMap[noHorizontalKey]; - } - } - return txtSrc -} - -InitWebLocalization(); - -function _loadLocalizationData() { - chrome.runtime.sendMessage({ action: "_loadLocalizationData", url: window.location.href }, function (response) { - WebLocalizationUpdateReplaceWords(response.result); - }); -} - -chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (request.action === "_initTranslation") { - SCLocalizationEnableSplitMode = true; - WebLocalizationUpdateReplaceWords(request.data); - } -}); - -// 注入脚本到网页上下文 -const script = document.createElement('script'); -script.src = chrome.runtime.getURL('injected.js'); -script.onload = function () { - this.remove(); -}; -(document.head || document.documentElement).appendChild(script); - -// 监听来自网页的消息 -window.addEventListener('message', async (event) => { - if (event.source !== window || !event.data || event.data.type !== 'SC_TRANSLATE_REQUEST') return; - - console.log("event.data ==" + JSON.stringify(event.data)); - - const { action, payload, requestId } = event.data; - - let response = { success: false }; - - if (action === 'translate') { - try { - SCLocalizationEnableSplitMode = true; - chrome.runtime.sendMessage({ action: "_loadLocalizationData", url: "manual" }, function (response) { - WebLocalizationUpdateReplaceWords(response.result); - }); - } catch (error) { - response = { success: false, error: error.message }; - } - } else if (action === 'updateReplaceWords') { - try { - if (payload && payload.words && Array.isArray(payload.words)) { - WebLocalizationUpdateReplaceWords(payload.words); - response = { success: true }; - } else { - response = { success: false, error: 'Invalid words format' }; - } - } catch (error) { - response = { success: false, error: error.message }; - } - } - - // 发送响应回网页 - window.postMessage({ - type: 'SC_TRANSLATE_RESPONSE', - requestId, - response - }, '*'); -}); - -window.postMessage({ type: 'SC-BOX-TRANSLATE-API-AVAILABLE' }, '*'); \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx/icon.png b/Legacy/StarCitizenBoxBrowserEx/icon.png deleted file mode 100644 index 3ceb859b5da506dd8a03c4dcac03502a7c3e90a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12495 zcmbWebx>SE(>J=fySrPEMS=zo?g<{;A-KCQ?!kjB65J)YYj9aS1b259zdX^XsY|()$48`c+mE zP(4Y0_&$NRl2Dca0O}IZo=p(m=O|8cx~>2KX8(UW%&=prIRLdSV93b+nMo%G*5_^t1M%07$jy$gmD-F8|+ zLPTeTqBn6N+F>IjV8f#12lajT{9RGIlFjIMuBq*=?YTIRGu`l4>`+;|v;3?&_qF@1 z{4Ced$@%}XiBgKX4Q*rt<_Cuey{YCou>MoXfMwizbfKX;$6 z^FXM|y}-k0iapyHgQj%@_OY`O{(6~YBovh4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zla5%@8tiz6&@KW zhDL4n1{VsKWsE4%zy*;;Y?t>=eB=4ubi|(auAc3I^B-KxgkqG>5qEapnQO>NxUJ{_ z+Y0Hmo%5xq$?d)(qW{P*a;e^T(Jl~U7Xx;o3x%7yYius@L!BHZ5qBt*gQOI_-Bf_9 zht(I>ZxsF`p3$>QR7~=pFsRwg!N!^Lalin#WsG7qocM2-9#ED3GSxVtP^IiZH%u&2YXGitAmvxQI6(Tk!X|PEP0= zC-=bnVcE_NbfB&WfFG@LYdanWc%}>}$}4kEZ@tFUo>wg3P94!} z&7W=cSMKUm4OxWw5Xo}=l*V?VNXE3pE&4TbUHLw}K7I`N&1bL^Ta2KX=dj0?+dy|J zfuRmr0#DLw&Tw(Xc7|8?SNZavcx^6M9Tc_y*b)&pr&X0{J{$B6UXmb+OG||inc=tq z5~BdrbTeq1F&{ILu~CV+xoWI!tN)&C2}==k&J-jC$&YVIYrA2jD`CPWF?M5jbJk^d zzy~42(pcjF=v{Q7=3C>`N0AQ$E|L1p%Y&Jb)Y!64+|K4i64X+_m~~QssbN!xevCY_ zHu>N#HMVJUv=MwzDeIm)obeUy05E=)-k8Q(5Kt*WJ-P$HzTW2r{Mi8{hKe%;*a9LS zqW(kE`xh?2+yy(5uA433;Q-tWpaw;T<%RV~V-MhUmjd^QS|m8VvA38sV6cJ6=HOCb z449ptO0vK`5rrms1ooYi7;v$RKlhB5_H#0xZp)S&hZK8^0iU282x_CSBLVCiG8iXyJy3a0&k=`J#D;h@K7IS(_6UiN|_fn|L4AqRW9jVB) zV#)FP9%(=+NR<%;j7XItQ_zD_VKAJYi z8Zx`CnMJEe_fDpAZ1@(kfEblExwb50;ZW_5c6? diff --git a/Legacy/StarCitizenBoxBrowserEx/injected.js b/Legacy/StarCitizenBoxBrowserEx/injected.js deleted file mode 100644 index a4a14da..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/injected.js +++ /dev/null @@ -1,22 +0,0 @@ -// 在网页上下文中定义一个API -window.SCTranslateApi = { - // 手动触发页面翻译 - translate: async () => { - const requestId = Math.random().toString(36).substr(2); - return new Promise((resolve) => { - const handler = (event) => { - if (event.data.type === 'SC_TRANSLATE_RESPONSE' && event.data.requestId === requestId) { - window.removeEventListener('message', handler); - resolve(event.data.response); - } - }; - window.addEventListener('message', handler); - - window.postMessage({ - type: 'SC_TRANSLATE_REQUEST', - action: 'translate', - requestId - }, '*'); - }); - } -}; \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx/manifest.json b/Legacy/StarCitizenBoxBrowserEx/manifest.json deleted file mode 100644 index 84af67b..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/manifest.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "manifest_version": 3, - "name": "星际公民盒子浏览器拓展", - "version": "0.0.11", - "description": "为星际公民网站及工具站提供汉化", - "author": "xkeyC", - "icons": { - "16": "icon.png", - "48": "icon.png", - "192": "icon.png" - }, - "host_permissions": [ - "https://git.scbox.xkeyc.cn/*" - ], - "permissions": [ - "storage", - "contextMenus" - ], - "action": { - "default_popup": "popup.html" - }, - "background": { - "service_worker": "background.js" - }, - "content_scripts": [ - { - "matches": [ - "*://*/*" - ], - "exclude_matches": [ - "https://robertsspaceindustries.com/spectrum/*" - ], - "js": [ - "core.js", - "thirdparty/timeago.full.min.js" - ] - }, - { - "matches": [ - "https://www.erkul.games/*" - ], - "js": [ - "thirdparty/jquery.min.js" - ] - }, - { - "matches": [ - "https://robertsspaceindustries.com/*" - ], - "js": [ - "rsi_hangar_fix.js" - ], - "run_at": "document_idle" - } - ], - "web_accessible_resources": [ - { - "resources": ["injected.js"], - "matches": [""] - } - ] -} \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx/popup.html b/Legacy/StarCitizenBoxBrowserEx/popup.html deleted file mode 100644 index 4b32c06..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/popup.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - 星际公民盒子浏览器拓展 - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx/rsi_hangar_fix.js b/Legacy/StarCitizenBoxBrowserEx/rsi_hangar_fix.js deleted file mode 100644 index a8e66ce..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/rsi_hangar_fix.js +++ /dev/null @@ -1,93 +0,0 @@ -// from https://github.com/cfdxkk/RSI-Hangar-Button -// LICENSE GLWT(Good Luck With That) Public License -(function () { - /** - * 寻找元素直到元素被加载 - * @param dom 查找的根元素 - * @param selector 元素的查找 - * @param callback 查找到的回调 - * @param interval 查找的间隔,默认 100 毫秒 - */ - function waitForElement(dom, selector, callback, interval = 100) { - const checkExist = setInterval(() => { - const element = dom.querySelector(selector) - if (element) { - clearInterval(checkExist) // 停止轮询 - callback(element) - } - }, interval) - } - - /** - * 开始监听抽屉,如果监听到点击事件,则添加按钮 - * @param element - */ - function startObserve(element) { - // 创建一个 MutationObserver 实例,监听元素的子元素变化 - const observer = new MutationObserver((mutationsList) => { - for (const mutation of mutationsList) { - if (mutation.type === 'childList' && mutation.addedNodes.length > 0) { - mutation.addedNodes.forEach(node => { - if (node.nodeType === 1) { // 只处理元素节点 (忽略文本节点) - waitForElement(node, "a[data-cy-id=\"button\"][href=\"/account/settings\"]", (button) => { - copyAndAddButton(button) - }) - } - }) - } - } - }) - - // 监听子节点变化,并对子树内的变化也进行监听 - observer.observe(element, { childList: true, subtree: true }) - } - - /** - * 复制原有按钮,将其修改为机库按钮并插入到原按钮的上方 - * 在插入前先检查是否已经存在对应的按钮 - * @param {HTMLElement} button 原始按钮 - */ - function copyAndAddButton(button) { - if (!button) return - - // 如果已经存在 href 为 /account/pledges 的按钮,则不再添加 - if (button.parentNode.querySelector('a[data-cy-id="button"][href="/account/pledges"]')) { - return - } - // 复制元素 - const hangarButton = button.cloneNode(true) - - // 修改 href - hangarButton.href = "/account/pledges" - - // 查找按钮中的文本部分 - const hangarButtonText = hangarButton.querySelector('span[data-cy-id="button__text"]') - - // 修改文本 - if (hangarButtonText) { - hangarButtonText.innerText = "My Hangar" - } - - // 查找按钮中的图标部分 - const hangarButtonIcon = hangarButton.querySelector('i[data-cy-id="button__icon"]') - - // 修改图标 - if (hangarButtonIcon) { - hangarButtonIcon.className = "a-button__icon a-icon -gridView" - } - - // 插入到目标元素的前方 - button.parentNode.insertBefore(hangarButton, button) - } - - // 开始查找抽屉,如果找到执行监听回调 - waitForElement(document, "#sidePanel", (risSidePanel) => { - startObserve(risSidePanel) - - // 初始检查:防止首次打开抽屉时按钮已经存在,MutationObserver 不触发 - const button = sidePanel.querySelector('a[data-cy-id="button"][href="/account/settings"]') - if (button) { - copyAndAddButton(button) - } - }) -})() \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx/thirdparty/jquery.min.js b/Legacy/StarCitizenBoxBrowserEx/thirdparty/jquery.min.js deleted file mode 100644 index b061403..0000000 --- a/Legacy/StarCitizenBoxBrowserEx/thirdparty/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0=m[t]&&t=m[e]&&e { - }); - console.log("SWTT init"); -}); - -chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { - if (request.action === "_loadLocalizationData") { - _initLocalization(request.url).then(data => { - sendResponse({result: data}); - }); - return true; - } -}); - -async function _checkVersion() { - dataVersion = await _getJsonData("versions.json"); - console.log("Localization Version ==="); - console.log(dataVersion); -} - -async function _initLocalization(url) { - console.log("url ===" + url); - if (dataVersion == null) { - await _checkVersion(); - return _initLocalization(url); - } - let v = dataVersion - // TODO check version - let data = {}; - - if (url.includes("robertsspaceindustries.com")) { - data["zh-CN"] = await _getJsonData("zh-CN-rsi.json", {cacheKey: "zh-CN", version: v.rsi}); - data["concierge"] = await _getJsonData("concierge.json", {cacheKey: "concierge", version: v.concierge}); - data["orgs"] = await _getJsonData("orgs.json", v.orgs); - data["address"] = await _getJsonData("addresses.json", {cacheKey: "orgs", version: v.addresses}); - data["hangar"] = await _getJsonData("hangar.json", {cacheKey: "hangar", version: v.hangar}); - } else if (url.includes("uexcorp.space")) { - data["UEX"] = await _getJsonData("zh-CN-uex.json", {cacheKey: "uex", version: v.uex}); - } else if (url.includes("erkul.games")) { - data["DPS"] = await _getJsonData("zh-CN-dps.json", {cacheKey: "dps", version: v.dps}); - } - // update data - let replaceWords = []; - - function addLocalizationResource(key) { - replaceWords.push(...getLocalizationResource(data, key)); - } - - if (url.includes("robertsspaceindustries.com")) { - const org = "https://robertsspaceindustries.com/orgs"; - const citizens = "https://robertsspaceindustries.com/citizens"; - const organization = "https://robertsspaceindustries.com/account/organization"; - const concierge = "https://robertsspaceindustries.com/account/concierge"; - const referral = "https://robertsspaceindustries.com/account/referral-program"; - const address = "https://robertsspaceindustries.com/account/addresses"; - const hangar = "https://robertsspaceindustries.com/account/pledges"; - const spectrum = "https://robertsspaceindustries.com/spectrum/community/"; - if (url.startsWith(spectrum)) { - return; - } - addLocalizationResource("zh-CN"); - if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) { - replaceWords.push({"word": 'members', "replacement": '名成员'}); - addLocalizationResource("orgs"); - } - if (url.startsWith(address)) { - addLocalizationResource("address"); - } - - if (url.startsWith(referral)) { - replaceWords.push( - {"word": 'Total recruits: ', "replacement": '总邀请数:'}, - {"word": 'Prospects ', "replacement": '未完成的邀请'}, - {"word": 'Recruits', "replacement": '已完成的邀请'} - ); - } - - if (url.startsWith(concierge)) { - replaceWords = []; - addLocalizationResource("concierge"); - } - - if (url.startsWith(hangar)) { - addLocalizationResource("hangar"); - } - } else if (url.includes("uexcorp.space")) { - addLocalizationResource("UEX"); - } else if (url.includes("erkul.games")) { - addLocalizationResource("DPS"); - } - return replaceWords; -} - - -function getLocalizationResource(localizationResource, key) { - const localizations = []; - const dict = localizationResource[key]; - if (typeof dict === "object") { - for (const [k, v] of Object.entries(dict)) { - const trimmedKey = k - .toString() - .trim() - .toLowerCase() - .replace(/\xa0/g, ' ') - .replace(/\s{2,}/g, ' '); - localizations.push({"word": trimmedKey, "replacement": v.toString()}); - } - } - return localizations; -} - -async function _getJsonData(fileName, {cacheKey = "", version = null} = {}) { - url = "https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/" + fileName; - if (cacheKey && cacheKey !== "") { - const localVersion = await getLocalData(`${cacheKey}_version`); - const data = await getLocalData(cacheKey); - if (data && typeof data === 'object' && Object.keys(data).length > 0 && localVersion === version) { - return data; - } - } - const startTime = new Date(); - const response = await fetch(url, {method: 'GET', mode: 'cors'}); - const endTime = new Date(); - const data = await response.json(); - if (cacheKey && cacheKey !== "") { - console.log(`update ${cacheKey} v == ${version} time == ${(endTime - startTime) / 1000}s`); - await setLocalData(cacheKey, data); - await setLocalData(`${cacheKey}_version`, version); - } - return data; -} - -function getLocalData(key) { - return new Promise((resolve) => { - chrome.storage.local.get([key], (result) => { - const data = result[key]; - resolve(data || null); - }); - }); -} - -function setLocalData(key, data) { - return new Promise((resolve) => { - const newData = {}; - newData[key] = data; - chrome.storage.local.set(newData, () => { - resolve(); - }); - }); -} diff --git a/Legacy/StarCitizenBoxBrowserEx_Firefox/core.js b/Legacy/StarCitizenBoxBrowserEx_Firefox/core.js deleted file mode 100644 index ad31063..0000000 --- a/Legacy/StarCitizenBoxBrowserEx_Firefox/core.js +++ /dev/null @@ -1,194 +0,0 @@ -let SCLocalizationReplaceLocalesMap = {}; -let SCLocalizationEnableSplitMode = false; - -function InitWebLocalization() { - // init script - LocalizationWatchUpdate(); - // load Data - _loadLocalizationData(); -} - -function LocalizationWatchUpdate() { - const m = window.MutationObserver || window.WebKitMutationObserver; - const observer = new m(function (mutations, observer) { - for (let mutationRecord of mutations) { - for (let node of mutationRecord.addedNodes) { - traverseElement(node); - } - } - }); - - observer.observe(document.body, { - subtree: true, - characterData: true, - childList: true, - }); - - if (window.location.href.includes("robertsspaceindustries.com")) { - console.log("SCLocalizationEnableSplitMode = true"); - SCLocalizationEnableSplitMode = true; - } - - if (window.location.hostname.includes("www.erkul.games")) { - document.body.addEventListener("click", function (event) { - setTimeout(function () { - allTranslate().then(_ => { - }); - }, 200); - }); - } -} - -function WebLocalizationUpdateReplaceWords(w) { - let replaceWords = w.sort(function (a, b) { - return b.word.length - a.word.length; - }); - replaceWords.forEach(({word, replacement}) => { - SCLocalizationReplaceLocalesMap[word] = replacement; - }); - if (window.location.hostname.startsWith("issue-council.robertsspaceindustries.com")) { - SCLocalizationReplaceLocalesMap["save"] = "保存"; - } - allTranslate().then(_ => { - }); - // console.log("WebLocalizationUpdateReplaceWords ==" + w) -} - -async function allTranslate() { - async function replaceTextNode(node1) { - if (node1.nodeType === Node.TEXT_NODE) { - node1.nodeValue = GetSCLocalizationTranslateString(node1.nodeValue); - } else { - for (let i = 0; i < node1.childNodes.length; i++) { - await replaceTextNode(node1.childNodes[i]); - } - } - } - - await replaceTextNode(document.body); -} - -function traverseElement(el) { - if (!shouldTranslateEl(el)) { - return - } - - for (const child of el.childNodes) { - if (["RELATIVE-TIME", "TIME-AGO"].includes(el.tagName)) { - translateRelativeTimeEl(el); - return; - } - - if (child.nodeType === Node.TEXT_NODE) { - translateElement(child); - } else if (child.nodeType === Node.ELEMENT_NODE) { - if (child.tagName === "INPUT") { - translateElement(child); - } else { - traverseElement(child); - } - } else { - // pass - } - } -} - -function translateElement(el) { - // Get the text field name - let k; - if (el.tagName === "INPUT") { - if (el.type === 'button' || el.type === 'submit') { - k = 'value'; - } else { - k = 'placeholder'; - } - } else { - k = 'data'; - } - el[k] = GetSCLocalizationTranslateString(el[k]); -} - -function translateRelativeTimeEl(el) { - const lang = (navigator.language || navigator.userLanguage); - const datetime = $(el).attr('datetime'); - $(el).text(timeago.format(datetime, lang.replace('-', '_'))); -} - -function shouldTranslateEl(el) { - const blockIds = []; - const blockClass = [ - "css-truncate" // 过滤文件目录 - ]; - const blockTags = ["IMG", "svg", "mat-icon"]; - if (blockTags.includes(el.tagName)) { - return false; - } - if (el.id && blockIds.includes(el.id)) { - return false; - } - if (el.classList) { - for (let clazz of blockClass) { - if (el.classList.contains(clazz)) { - return false; - } - } - } - return true; -} - -function GetSCLocalizationTranslateString(txtSrc) { - const key = txtSrc.toLowerCase().replace(/\xa0/g, ' ').replace(/\s{2,}/g, ' ').trim(); - const sourceKey = txtSrc.replace(/\xa0/g, ' ').replace(/\s{2,}/g, ' ').trim(); - let noTheKey = key.replace("the ", ""); - let noHorizontalKey = key.replace("- ", ""); - - if (SCLocalizationReplaceLocalesMap[key]) { - txtSrc = SCLocalizationReplaceLocalesMap[key] - } else if (SCLocalizationEnableSplitMode) { - if (sourceKey.includes(" - ")) { - let nodeValue = txtSrc - let splitKey = sourceKey.split(" - "); - if (splitKey[0].toLowerCase() === "upgrade" && key.includes("to") && key.endsWith("edition")) { - // 升级包规则 - let noVersionStr = key.replace("STANDARD EDITION".toLowerCase(), "").replace("upgrade", "").replace("WARBOND EDITION".toLowerCase(), "") - let shipNames = noVersionStr.split(" to ") - let finalString = "升级包 " + GetSCLocalizationTranslateString(shipNames[0]) + " 到 " + GetSCLocalizationTranslateString(shipNames[1]); - if (key.endsWith("WARBOND EDITION".toLowerCase())) { - finalString = finalString + " 战争债券版" - } else { - finalString = finalString + " 标准版" - } - txtSrc = finalString - } else { - // 机库通用规则 - splitKey.forEach(function (splitKey) { - if (SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) { - nodeValue = nodeValue.replace(splitKey, SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) - } else { - nodeValue = nodeValue.replace(splitKey, GetSCLocalizationTranslateString(splitKey)) - } - }); - txtSrc = nodeValue - } - } else if (key.endsWith("starter pack") || key.endsWith("starter package")) { - let shipName = key.replace("starter package", "").replace("starter pack", "").trim() - if (SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]) { - shipName = SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]; - } - txtSrc = shipName + " 新手包"; - } else if (key.startsWith("the ") && SCLocalizationReplaceLocalesMap[noTheKey]) { - txtSrc = SCLocalizationReplaceLocalesMap[noTheKey]; - } else if (key.startsWith("- ") && SCLocalizationReplaceLocalesMap[noHorizontalKey]) { - txtSrc = "- " + SCLocalizationReplaceLocalesMap[noHorizontalKey]; - } - } - return txtSrc -} - -InitWebLocalization(); - -function _loadLocalizationData() { - chrome.runtime.sendMessage({action: "_loadLocalizationData", url: window.location.href}, function (response) { - WebLocalizationUpdateReplaceWords(response.result); - }); -} \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx_Firefox/icon.png b/Legacy/StarCitizenBoxBrowserEx_Firefox/icon.png deleted file mode 100644 index 3ceb859b5da506dd8a03c4dcac03502a7c3e90a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12495 zcmbWebx>SE(>J=fySrPEMS=zo?g<{;A-KCQ?!kjB65J)YYj9aS1b259zdX^XsY|()$48`c+mE zP(4Y0_&$NRl2Dca0O}IZo=p(m=O|8cx~>2KX8(UW%&=prIRLdSV93b+nMo%G*5_^t1M%07$jy$gmD-F8|+ zLPTeTqBn6N+F>IjV8f#12lajT{9RGIlFjIMuBq*=?YTIRGu`l4>`+;|v;3?&_qF@1 z{4Ced$@%}XiBgKX4Q*rt<_Cuey{YCou>MoXfMwizbfKX;$6 z^FXM|y}-k0iapyHgQj%@_OY`O{(6~YBovh4M(f^4Q@auBT1Eh6c6Q-?yVr~3Cu+jD z3;i=)j|D-_{Q&~uVUu>%6E2KYpF*EhVlR>0Iyp8EPCn9ryTK}8)%xp2ze(q`QlB`p z6yVSCTv*`0<}S_oxsUfA2}rLn*P;_uGV8QyYL4KG`1shKm-Pp}|ExFF4Jd9J-x0LB z9)1c4>*J0ArmF$QMGnn#Aw8kwswCDN{f_3RT{<7zEbOc|8pPgK()k-;3xBwO?;k69 zkR<9bU$b@WEbMBvIlHE;*;mh)`Uyo*T~+pUhTSF*^Urh8GOpQtu?K&}%`6Wcs`;sv(kHM78XixO8>l06|o|sAqT*mEAy8#ih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w}K7I`N&1bL^Ta2KX=dj0?+dy|J zfuRmr0#DLw&Tw(Xc7|8?SNZavcx^6M9Tc_y*b)&pr&X0{J{$B6UXmb+OG||inc=tq z5~BdrbTeq1F&{ILu~CV+xoWI!tN)&C2}==k&J-jC$&YVIYrA2jD`CPWF?M5jbJk^d zzy~42(pcjF=v{Q7=3C>`N0AQ$E|L1p%Y&Jb)Y!64+|K4i64X+_m~~QssbN!xevCY_ zHu>N#HMVJUv=MwzDeIm)obeUy05E=)-k8Q(5Kt*WJ-P$HzTW2r{Mi8{hKe%;*a9LS zqW(kE`xh?2+yy(5uA433;Q-tWpaw;T<%RV~V-MhUmjd^QS|m8VvA38sV6cJ6=HOCb z449ptO0vK`5rrms1ooYi7;v$RKlhB5_H#0xZp)S&hZK8^0iU282x_CSBLVCiG8iXyJy3a0&k=`J#D;h@K7IS(_6UiN|_fn|L4AqRW9jVB) zV#)FP9%(=+NR<%;j7XItQ_zD_VKAJYi z8Zx`CnMJEe_fDpAZ1@(kfEblExwb50;ZW_5c6? diff --git a/Legacy/StarCitizenBoxBrowserEx_Firefox/manifest.json b/Legacy/StarCitizenBoxBrowserEx_Firefox/manifest.json deleted file mode 100644 index 20d29f1..0000000 --- a/Legacy/StarCitizenBoxBrowserEx_Firefox/manifest.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "manifest_version": 2, - "name": "星际公民盒子浏览器拓展", - "version": "0.0.11", - "description": "为星际公民网站及工具站提供汉化", - "author": "xkeyC", - "icons": { - "192": "icon.png" - }, - "permissions": [ - "storage", - "https://git.scbox.xkeyc.cn/*" - ], - "browser_action": { - "default_icon": "icon.png", - "default_popup": "popup.html" - }, - "background": { - "scripts": [ - "background.js" - ] - }, - "content_scripts": [ - { - "matches": [ - "https://robertsspaceindustries.com/*", - "https://*.robertsspaceindustries.com/*", - "https://www.erkul.games/*", - "https://uexcorp.space/*" - ], - "exclude_matches": [ - "https://robertsspaceindustries.com/spectrum/*" - ], - "js": [ - "core.js", - "thirdparty/timeago.full.min.js" - ] - }, - { - "matches": [ - "https://www.erkul.games/*" - ], - "js": [ - "thirdparty/jquery.min.js" - ] - }, - { - "matches": [ - "https://robertsspaceindustries.com/*" - ], - "js": [ - "rsi_hangar_fix.js" - ], - "run_at": "document_idle" - } - ] -} \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx_Firefox/popup.html b/Legacy/StarCitizenBoxBrowserEx_Firefox/popup.html deleted file mode 100644 index 4b32c06..0000000 --- a/Legacy/StarCitizenBoxBrowserEx_Firefox/popup.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - 星际公民盒子浏览器拓展 - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx_Firefox/thirdparty/jquery.min.js b/Legacy/StarCitizenBoxBrowserEx_Firefox/thirdparty/jquery.min.js deleted file mode 100644 index b061403..0000000 --- a/Legacy/StarCitizenBoxBrowserEx_Firefox/thirdparty/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0=m[t]&&t=m[e]&&e { @@ -15,13 +31,13 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { } }); -async function _checkVersion() { - dataVersion = await _getJsonData("versions.json"); +async function _checkVersion(): Promise { + dataVersion = await _getJsonData("versions.json") as VersionData; console.log("Localization Version ==="); console.log(dataVersion); } -async function _initLocalization(url) { +async function _initLocalization(url: string): Promise { console.log("url ===" + url); if (dataVersion == null) { await _checkVersion(); @@ -29,12 +45,12 @@ async function _initLocalization(url) { } let v = dataVersion // TODO check version - let data = {}; + let data: Record = {}; if (url.includes("robertsspaceindustries.com") || url.includes("manual")) { data["zh-CN"] = await _getJsonData("zh-CN-rsi.json", {cacheKey: "zh-CN", version: v.rsi}); data["concierge"] = await _getJsonData("concierge.json", {cacheKey: "concierge", version: v.concierge}); - data["orgs"] = await _getJsonData("orgs.json", v.orgs); + data["orgs"] = await _getJsonData("orgs.json", {cacheKey: "orgs", version: v.orgs}); data["address"] = await _getJsonData("addresses.json", {cacheKey: "orgs", version: v.addresses}); data["hangar"] = await _getJsonData("hangar.json", {cacheKey: "hangar", version: v.hangar}); } else if (url.includes("uexcorp.space")) { @@ -43,9 +59,9 @@ async function _initLocalization(url) { data["DPS"] = await _getJsonData("zh-CN-dps.json", {cacheKey: "dps", version: v.dps}); } // update data - let replaceWords = []; + let replaceWords: ReplaceWord[] = []; - function addLocalizationResource(key) { + function addLocalizationResource(key: string): void { replaceWords.push(...getLocalizationResource(data, key)); } @@ -59,7 +75,7 @@ async function _initLocalization(url) { const hangar = "https://robertsspaceindustries.com/account/pledges"; const spectrum = "https://robertsspaceindustries.com/spectrum/community/"; if (url.startsWith(spectrum)) { - return; + return []; } addLocalizationResource("zh-CN"); if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) { @@ -95,8 +111,8 @@ async function _initLocalization(url) { } -function getLocalizationResource(localizationResource, key) { - const localizations = []; +function getLocalizationResource(localizationResource: Record, key: string): ReplaceWord[] { + const localizations: ReplaceWord[] = []; const dict = localizationResource[key]; if (typeof dict === "object") { for (const [k, v] of Object.entries(dict)) { @@ -106,14 +122,20 @@ function getLocalizationResource(localizationResource, key) { .toLowerCase() .replace(/\xa0/g, ' ') .replace(/\s{2,}/g, ' '); - localizations.push({"word": trimmedKey, "replacement": v.toString()}); + localizations.push({"word": trimmedKey, "replacement": String(v)}); } } return localizations; } -async function _getJsonData(fileName, {cacheKey = "", version = null} = {}) { - url = "https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/" + fileName; +interface JsonDataOptions { + cacheKey?: string; + version?: string | null; +} + +async function _getJsonData(fileName: string, options: JsonDataOptions = {}): Promise { + const { cacheKey = "", version = null } = options; + const url = "https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/" + fileName; if (cacheKey && cacheKey !== "") { const localVersion = await getLocalData(`${cacheKey}_version`); const data = await getLocalData(cacheKey); @@ -126,14 +148,15 @@ async function _getJsonData(fileName, {cacheKey = "", version = null} = {}) { const endTime = new Date(); const data = await response.json(); if (cacheKey && cacheKey !== "") { - console.log(`update ${cacheKey} v == ${version} time == ${(endTime - startTime) / 1000}s`); + const timeDiff = endTime.getTime() - startTime.getTime(); + console.log(`update ${cacheKey} v == ${version} time == ${timeDiff / 1000}s`); await setLocalData(cacheKey, data); await setLocalData(`${cacheKey}_version`, version); } return data; } -function getLocalData(key) { +function getLocalData(key: string): Promise { return new Promise((resolve) => { chrome.storage.local.get([key], (result) => { const data = result[key]; @@ -142,9 +165,9 @@ function getLocalData(key) { }); } -function setLocalData(key, data) { - return new Promise((resolve) => { - const newData = {}; +function setLocalData(key: string, data: any): Promise { + return new Promise((resolve) => { + const newData: Record = {}; newData[key] = data; chrome.storage.local.set(newData, () => { resolve(); @@ -156,18 +179,20 @@ chrome.runtime.onInstalled.addListener(function () { chrome.contextMenus.create({ id: "translate", title: "切换翻译", - contexts: ["page"] + contexts: ["all"] }); }); chrome.contextMenus.onClicked.addListener((info, tab) => { console.log("contextMenus", info, tab); - let passedUrl = "manual" + let passedUrl = "manual"; const supportedSites = ["robertsspaceindustries.com", "erkul.games", "uexcorp.space"]; - if (supportedSites.find(site => tab.url.includes(site))) { + if (tab && tab.url && supportedSites.find(site => tab.url!.includes(site))) { passedUrl = tab.url; } _initLocalization(passedUrl).then(data => { - chrome.tabs.sendMessage(tab.id, {action: "_toggleTranslation", data}); + if (tab && tab.id !== undefined) { + chrome.tabs.sendMessage(tab.id, {action: "_toggleTranslation", data}); + } }); }); diff --git a/core.js b/core.ts similarity index 83% rename from core.js rename to core.ts index cf474a5..b05262f 100644 --- a/core.js +++ b/core.ts @@ -1,3 +1,6 @@ +declare const $: any; +declare const timeago: any; + let SCLocalizationReplaceLocalesMap = {}; let SCLocalizationEnableSplitMode = false; let SCLocalizationTranslating = false; @@ -10,11 +13,11 @@ function InitWebLocalization() { } function LocalizationWatchUpdate() { - const m = window.MutationObserver || window.WebKitMutationObserver; - const observer = new m(function (mutations, observer) { + const m = window.MutationObserver || (window as any).WebKitMutationObserver; + const observer = new m(function (mutations: MutationRecord[], observer: MutationObserver) { for (let mutationRecord of mutations) { for (let node of mutationRecord.addedNodes) { - traverseElement(node); + traverseElement(node as Element); } } }); @@ -56,54 +59,54 @@ function WebLocalizationUpdateReplaceWords(w) { async function allTranslate() { SCLocalizationTranslating = true; - async function replaceTextNode(node, parentNode) { + async function replaceTextNode(node: Node, parentNode?: Element) { if (node.nodeType === Node.TEXT_NODE) { // 保存原始文本内容 - const originalText = node.nodeValue; + const originalText = node.nodeValue || ''; const translatedText = GetSCLocalizationTranslateString(originalText); // 只有当文本发生变化时才保存原始文本 - if (originalText !== translatedText) { + if (originalText !== translatedText && parentNode) { const originalValue = parentNode.getAttribute('data-original-value') || ""; parentNode.setAttribute('data-original-value', originalValue + originalText); node.nodeValue = translatedText; } } else { for (let i = 0; i < node.childNodes.length; i++) { - await replaceTextNode(node.childNodes[i], node); + await replaceTextNode(node.childNodes[i], node as Element); } } } - await replaceTextNode(document.body); + await replaceTextNode(document.body, document.body); } -async function undoTranslate() { +async function undoTranslate(): Promise<{success: boolean}> { SCLocalizationTranslating = false; - document.querySelectorAll('*[data-original-value]').forEach(element => { - element.innerText = element.getAttribute('data-original-value'); + document.querySelectorAll('*[data-original-value]').forEach((element: Element) => { + (element as HTMLElement).innerText = element.getAttribute('data-original-value') || ''; element.removeAttribute('data-original-value'); }); // 处理输入元素 const inputElements = document.querySelectorAll('input[type="button"], input[type="submit"], input[type="text"], input[type="password"]'); - inputElements.forEach(el => { + inputElements.forEach((el: Element) => { // 尝试从 data-original-value 属性恢复原始值 if (el.hasAttribute('data-original-value')) { - if (el.type === 'button' || el.type === 'submit') { - el.value = el.getAttribute('data-original-value'); + if ((el as HTMLInputElement).type === 'button' || (el as HTMLInputElement).type === 'submit') { + (el as HTMLInputElement).value = el.getAttribute('data-original-value') || ''; } else { - el.placeholder = el.getAttribute('data-original-value'); + (el as HTMLInputElement).placeholder = el.getAttribute('data-original-value') || ''; } el.removeAttribute('data-original-value'); } }); - return { success: true }; + return Promise.resolve({ success: true }); } -function traverseElement(el) { +function traverseElement(el: Element) { if (!SCLocalizationTranslating) { return; } @@ -121,10 +124,10 @@ function traverseElement(el) { if (child.nodeType === Node.TEXT_NODE) { translateElement(child, el); } else if (child.nodeType === Node.ELEMENT_NODE) { - if (child.tagName === "INPUT") { + if ((child as Element).tagName === "INPUT") { translateElement(child, el); } else { - traverseElement(child, el); + traverseElement(child as Element); } } else { // pass @@ -160,14 +163,14 @@ function translateElement(el, parentNode) { el[k] = translatedText; } -function translateRelativeTimeEl(el) { - const lang = (navigator.language || navigator.userLanguage); - const datetime = $(el).attr('datetime'); - $(el).text(timeago.format(datetime, lang.replace('-', '_'))); +function translateRelativeTimeEl(el: Element) { + const lang = (navigator.language || navigator.language); + const datetime = ($ as any)(el).attr('datetime'); + ($ as any)(el).text((timeago as any).format(datetime, lang.replace('-', '_'))); } -function shouldTranslateEl(el) { - const blockIds = []; +function shouldTranslateEl(el: Element) { + const blockIds: string[] = []; const blockClass = [ "css-truncate" // 过滤文件目录 ]; @@ -262,7 +265,7 @@ window.addEventListener('message', async (event) => { const { action } = event.data; - let response = { success: false }; + let response: {success: boolean, error?: string} = { success: false }; if (action === 'translate') { try { @@ -271,13 +274,13 @@ window.addEventListener('message', async (event) => { WebLocalizationUpdateReplaceWords(response.result); }); response = { success: true }; - } catch (error) { + } catch (error: any) { response = { success: false, error: error.message }; } } else if (action === 'undoTranslate') { try { response = await undoTranslate(); - } catch (error) { + } catch (error: any) { response = { success: false, error: error.message }; } } diff --git a/dist/chrome/background/service_worker.js b/dist/chrome/background/service_worker.js index 8e0be6d..5b745a6 100644 --- a/dist/chrome/background/service_worker.js +++ b/dist/chrome/background/service_worker.js @@ -1 +1 @@ -(()=>{var e={},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.rv=()=>"1.3.8",s.ruid="bundler=rspack@1.3.8";let r=null;async function n(){r=await a("versions.json"),console.log("Localization Version ==="),console.log(r)}async function o(e){if(console.log("url ==="+e),null==r)return await n(),o(e);let t=r,s={};e.includes("robertsspaceindustries.com")||e.includes("manual")?(s["zh-CN"]=await a("zh-CN-rsi.json",{cacheKey:"zh-CN",version:t.rsi}),s.concierge=await a("concierge.json",{cacheKey:"concierge",version:t.concierge}),s.orgs=await a("orgs.json",t.orgs),s.address=await a("addresses.json",{cacheKey:"orgs",version:t.addresses}),s.hangar=await a("hangar.json",{cacheKey:"hangar",version:t.hangar})):e.includes("uexcorp.space")?s.UEX=await a("zh-CN-uex.json",{cacheKey:"uex",version:t.uex}):e.includes("erkul.games")&&(s.DPS=await a("zh-CN-dps.json",{cacheKey:"dps",version:t.dps}));let c=[];function i(e){c.push(...function(e,t){let s=[],r=e[t];if("object"==typeof r)for(let[e,t]of Object.entries(r)){let r=e.toString().trim().toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ");s.push({word:r,replacement:t.toString()})}return s}(s,e))}if(e.includes("robertsspaceindustries.com")||e.includes("manual")){if(e.startsWith("https://robertsspaceindustries.com/spectrum/community/"))return;i("zh-CN"),(e.startsWith("https://robertsspaceindustries.com/orgs")||e.startsWith("https://robertsspaceindustries.com/citizens")||e.startsWith("https://robertsspaceindustries.com/account/organization"))&&(c.push({word:"members",replacement:"名成员"}),i("orgs")),e.startsWith("https://robertsspaceindustries.com/account/addresses")&&i("address"),e.startsWith("https://robertsspaceindustries.com/account/referral-program")&&c.push({word:"Total recruits: ",replacement:"总邀请数:"},{word:"Prospects ",replacement:"未完成的邀请"},{word:"Recruits",replacement:"已完成的邀请"}),e.startsWith("https://robertsspaceindustries.com/account/concierge")&&(c=[],i("concierge")),e.startsWith("https://robertsspaceindustries.com/account/pledges")&&i("hangar")}else e.includes("uexcorp.space")?i("UEX"):e.includes("erkul.games")&&i("DPS");return c}async function a(e,{cacheKey:t="",version:s=null}={}){if(url="https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/"+e,t&&""!==t){let e=await c(`${t}_version`),r=await c(t);if(r&&"object"==typeof r&&Object.keys(r).length>0&&e===s)return r}let r=new Date,n=await fetch(url,{method:"GET",mode:"cors"}),o=new Date,u=await n.json();return t&&""!==t&&(console.log(`update ${t} v == ${s} time == ${(o-r)/1e3}s`),await i(t,u),await i(`${t}_version`,s)),u}function c(e){return new Promise(t=>{chrome.storage.local.get([e],s=>{t(s[e]||null)})})}function i(e,t){return new Promise(s=>{let r={};r[e]=t,chrome.storage.local.set(r,()=>{s()})})}chrome.runtime.onInstalled.addListener(function(){n().then(e=>{}),console.log("SWTT init")}),chrome.runtime.onMessage.addListener(function(e,t,s){if("_loadLocalizationData"===e.action)return o(e.url).then(e=>{s({result:e})}),!0}),chrome.runtime.onInstalled.addListener(function(){chrome.contextMenus.create({id:"translate",title:"切换翻译",contexts:["page"]})}),chrome.contextMenus.onClicked.addListener((e,t)=>{console.log("contextMenus",e,t);let s="manual";["robertsspaceindustries.com","erkul.games","uexcorp.space"].find(e=>t.url.includes(e))&&(s=t.url),o(s).then(e=>{chrome.tabs.sendMessage(t.id,{action:"_toggleTranslation",data:e})})})})(); \ No newline at end of file +(()=>{var e={},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.rv=()=>"1.3.8",s.ruid="bundler=rspack@1.3.8";let r=null;async function n(){r=await a("versions.json"),console.log("Localization Version ==="),console.log(r)}async function o(e){if(console.log("url ==="+e),null==r)return await n(),o(e);let t=r,s={};e.includes("robertsspaceindustries.com")||e.includes("manual")?(s["zh-CN"]=await a("zh-CN-rsi.json",{cacheKey:"zh-CN",version:t.rsi}),s.concierge=await a("concierge.json",{cacheKey:"concierge",version:t.concierge}),s.orgs=await a("orgs.json",{cacheKey:"orgs",version:t.orgs}),s.address=await a("addresses.json",{cacheKey:"orgs",version:t.addresses}),s.hangar=await a("hangar.json",{cacheKey:"hangar",version:t.hangar})):e.includes("uexcorp.space")?s.UEX=await a("zh-CN-uex.json",{cacheKey:"uex",version:t.uex}):e.includes("erkul.games")&&(s.DPS=await a("zh-CN-dps.json",{cacheKey:"dps",version:t.dps}));let c=[];function i(e){c.push(...function(e,t){let s=[],r=e[t];if("object"==typeof r)for(let[e,t]of Object.entries(r)){let r=e.toString().trim().toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ");s.push({word:r,replacement:String(t)})}return s}(s,e))}if(e.includes("robertsspaceindustries.com")||e.includes("manual")){if(e.startsWith("https://robertsspaceindustries.com/spectrum/community/"))return[];i("zh-CN"),(e.startsWith("https://robertsspaceindustries.com/orgs")||e.startsWith("https://robertsspaceindustries.com/citizens")||e.startsWith("https://robertsspaceindustries.com/account/organization"))&&(c.push({word:"members",replacement:"名成员"}),i("orgs")),e.startsWith("https://robertsspaceindustries.com/account/addresses")&&i("address"),e.startsWith("https://robertsspaceindustries.com/account/referral-program")&&c.push({word:"Total recruits: ",replacement:"总邀请数:"},{word:"Prospects ",replacement:"未完成的邀请"},{word:"Recruits",replacement:"已完成的邀请"}),e.startsWith("https://robertsspaceindustries.com/account/concierge")&&(c=[],i("concierge")),e.startsWith("https://robertsspaceindustries.com/account/pledges")&&i("hangar")}else e.includes("uexcorp.space")?i("UEX"):e.includes("erkul.games")&&i("DPS");return c}async function a(e,t={}){let{cacheKey:s="",version:r=null}=t;if(s&&""!==s){let e=await c(`${s}_version`),t=await c(s);if(t&&"object"==typeof t&&Object.keys(t).length>0&&e===r)return t}let n=new Date,o=await fetch("https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/"+e,{method:"GET",mode:"cors"}),l=new Date,u=await o.json();if(s&&""!==s){let e=l.getTime()-n.getTime();console.log(`update ${s} v == ${r} time == ${e/1e3}s`),await i(s,u),await i(`${s}_version`,r)}return u}function c(e){return new Promise(t=>{chrome.storage.local.get([e],s=>{t(s[e]||null)})})}function i(e,t){return new Promise(s=>{let r={};r[e]=t,chrome.storage.local.set(r,()=>{s()})})}chrome.runtime.onInstalled.addListener(function(){n().then(e=>{}),console.log("SWTT init")}),chrome.runtime.onMessage.addListener(function(e,t,s){if("_loadLocalizationData"===e.action)return o(e.url).then(e=>{s({result:e})}),!0}),chrome.runtime.onInstalled.addListener(function(){chrome.contextMenus.create({id:"translate",title:"切换翻译",contexts:["all"]})}),chrome.contextMenus.onClicked.addListener((e,t)=>{console.log("contextMenus",e,t);let s="manual";t&&t.url&&["robertsspaceindustries.com","erkul.games","uexcorp.space"].find(e=>t.url.includes(e))&&(s=t.url),o(s).then(e=>{t&&void 0!==t.id&&chrome.tabs.sendMessage(t.id,{action:"_toggleTranslation",data:e})})})})(); \ No newline at end of file diff --git a/dist/chrome/content_scripts/content-0.js b/dist/chrome/content_scripts/content-0.js index 46253e1..89a2a96 100644 --- a/dist/chrome/content_scripts/content-0.js +++ b/dist/chrome/content_scripts/content-0.js @@ -1 +1 @@ -(()=>{var s={756:function(){let s={},e=!1,n=!1;function a(e){e.sort(function(s,e){return e.word.length-s.word.length}).forEach(({word:e,replacement:n})=>{s[e]=n}),window.location.hostname.startsWith("issue-council.robertsspaceindustries.com")&&(s.save="保存"),t().then(s=>{})}async function t(){async function s(e,n){if(e.nodeType===Node.TEXT_NODE){let s=e.nodeValue,a=u(s);if(s!==a){let t=n.getAttribute("data-original-value")||"";n.setAttribute("data-original-value",t+s),e.nodeValue=a}}else for(let n=0;n{s.innerText=s.getAttribute("data-original-value"),s.removeAttribute("data-original-value")}),document.querySelectorAll('input[type="button"], input[type="submit"], input[type="text"], input[type="password"]').forEach(s=>{s.hasAttribute("data-original-value")&&("button"===s.type||"submit"===s.type?s.value=s.getAttribute("data-original-value"):s.placeholder=s.getAttribute("data-original-value"),s.removeAttribute("data-original-value"))}),{success:!0}}function i(s,e){let n,a;if("INPUT"===s.tagName){if(n="button"===s.type||"submit"===s.type?"value":"placeholder",a=u(s[n]),s[n]===a)return;let t=e.getAttribute("data-original-value")||"";s.setAttribute("data-original-value",t+s[n])}else{if(a=u(s[n="data"]),s[n]===a)return;let t=e.getAttribute("data-original-value")||"";e.setAttribute("data-original-value",t+s[n])}s[n]=a}function u(n){let a=n.toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),t=n.replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),r=a.replace("the ",""),i=a.replace("- ","");if(s[a])n=s[a];else if(e)if(t.includes(" - ")){let e=n,r=t.split(" - ");if("upgrade"===r[0].toLowerCase()&&a.includes("to")&&a.endsWith("edition")){let s=a.replace("standard edition","").replace("upgrade","").replace("warbond edition","").split(" to "),e="升级包 "+u(s[0])+" 到 "+u(s[1]);a.endsWith("warbond edition")?e+=" 战争债券版":e+=" 标准版",n=e}else r.forEach(function(n){e=s[n.toLowerCase()]?e.replace(n,s[n.toLowerCase()]):e.replace(n,u(n))}),n=e}else if(a.endsWith("starter pack")||a.endsWith("starter package")){let e=a.replace("starter package","").replace("starter pack","").trim();s[e.toLowerCase()]&&(e=s[e.toLowerCase()]),n=e+" 新手包"}else a.startsWith("the ")&&s[r]?n=s[r]:a.startsWith("- ")&&s[i]&&(n="- "+s[i]);return n}new(window.MutationObserver||window.WebKitMutationObserver)(function(s,e){for(let e of s)for(let s of e.addedNodes)!function s(e){if(n&&function(s){if(["IMG","svg","mat-icon"].includes(s.tagName)||s.id&&[].includes(s.id))return!1;if(s.classList){for(let e of["css-truncate"])if(s.classList.contains(e))return!1}return!0}(e))for(let n of e.childNodes){if(["RELATIVE-TIME","TIME-AGO"].includes(e.tagName))return void function(s){let e=navigator.language||navigator.userLanguage,n=$(s).attr("datetime");$(s).text(timeago.format(n,e.replace("-","_")))}(e);n.nodeType===Node.TEXT_NODE?i(n,e):n.nodeType===Node.ELEMENT_NODE&&("INPUT"===n.tagName?i(n,e):s(n,e))}}(s)}).observe(document.body,{subtree:!0,characterData:!0,childList:!0}),window.location.href.includes("robertsspaceindustries.com")&&(e=!0),window.location.hostname.includes("www.erkul.games")&&document.body.addEventListener("click",function(s){setTimeout(function(){t().then(s=>{})},200)}),chrome.runtime.sendMessage({action:"_loadLocalizationData",url:window.location.href},function(s){a(s.result)}),chrome.runtime.onMessage.addListener((s,t,i)=>{if("_toggleTranslation"===s.action){if(n){n=!1,r();return}e=!0,a(s.data)}}),window.addEventListener("message",async s=>{if(s.source!==window||!s.data||"SC_TRANSLATE_REQUEST"!==s.data.type)return;let{action:n}=s.data;if("translate"===n)try{e=!0,chrome.runtime.sendMessage({action:"_loadLocalizationData",url:"manual"},function(s){a(s.result)})}catch(s){s.message}else if("undoTranslate"===n)try{await r()}catch(s){s.message}}),window.postMessage({type:"SC-BOX-TRANSLATE-API-AVAILABLE"},"*")},928:function(s,e){(function(s){"use strict";var e=["second","minute","hour","day","week","month","year"];function n(s,n){if(0===n)return["just now","right now"];var a=e[Math.floor(n/2)];return 1=u[t]&&t=u[n]&&n"1.3.8",n.ruid="bundler=rspack@1.3.8",n(756),n(928)})(); \ No newline at end of file +(()=>{var s={242:function(){let s={},e=!1,n=!1;function a(e){e.sort(function(s,e){return e.word.length-s.word.length}).forEach(({word:e,replacement:n})=>{s[e]=n}),window.location.hostname.startsWith("issue-council.robertsspaceindustries.com")&&(s.save="保存"),t().then(s=>{})}async function t(){async function s(e,n){if(e.nodeType===Node.TEXT_NODE){let s=e.nodeValue||"",a=u(s);if(s!==a&&n){let t=n.getAttribute("data-original-value")||"";n.setAttribute("data-original-value",t+s),e.nodeValue=a}}else for(let n=0;n{s.innerText=s.getAttribute("data-original-value")||"",s.removeAttribute("data-original-value")}),document.querySelectorAll('input[type="button"], input[type="submit"], input[type="text"], input[type="password"]').forEach(s=>{s.hasAttribute("data-original-value")&&("button"===s.type||"submit"===s.type?s.value=s.getAttribute("data-original-value")||"":s.placeholder=s.getAttribute("data-original-value")||"",s.removeAttribute("data-original-value"))}),Promise.resolve({success:!0})}function i(s,e){let n,a;if("INPUT"===s.tagName){if(n="button"===s.type||"submit"===s.type?"value":"placeholder",a=u(s[n]),s[n]===a)return;let t=e.getAttribute("data-original-value")||"";s.setAttribute("data-original-value",t+s[n])}else{if(a=u(s[n="data"]),s[n]===a)return;let t=e.getAttribute("data-original-value")||"";e.setAttribute("data-original-value",t+s[n])}s[n]=a}function u(n){let a=n.toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),t=n.replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),r=a.replace("the ",""),i=a.replace("- ","");if(s[a])n=s[a];else if(e)if(t.includes(" - ")){let e=n,r=t.split(" - ");if("upgrade"===r[0].toLowerCase()&&a.includes("to")&&a.endsWith("edition")){let s=a.replace("standard edition","").replace("upgrade","").replace("warbond edition","").split(" to "),e="升级包 "+u(s[0])+" 到 "+u(s[1]);a.endsWith("warbond edition")?e+=" 战争债券版":e+=" 标准版",n=e}else r.forEach(function(n){e=s[n.toLowerCase()]?e.replace(n,s[n.toLowerCase()]):e.replace(n,u(n))}),n=e}else if(a.endsWith("starter pack")||a.endsWith("starter package")){let e=a.replace("starter package","").replace("starter pack","").trim();s[e.toLowerCase()]&&(e=s[e.toLowerCase()]),n=e+" 新手包"}else a.startsWith("the ")&&s[r]?n=s[r]:a.startsWith("- ")&&s[i]&&(n="- "+s[i]);return n}new(window.MutationObserver||window.WebKitMutationObserver)(function(s,e){for(let e of s)for(let s of e.addedNodes)!function s(e){if(n&&function(s){if(["IMG","svg","mat-icon"].includes(s.tagName)||s.id&&[].includes(s.id))return!1;if(s.classList){for(let e of["css-truncate"])if(s.classList.contains(e))return!1}return!0}(e))for(let n of e.childNodes){if(["RELATIVE-TIME","TIME-AGO"].includes(e.tagName))return void function(s){let e=navigator.language||navigator.language,n=$(s).attr("datetime");$(s).text(timeago.format(n,e.replace("-","_")))}(e);n.nodeType===Node.TEXT_NODE?i(n,e):n.nodeType===Node.ELEMENT_NODE&&("INPUT"===n.tagName?i(n,e):s(n))}}(s)}).observe(document.body,{subtree:!0,characterData:!0,childList:!0}),window.location.href.includes("robertsspaceindustries.com")&&(e=!0),window.location.hostname.includes("www.erkul.games")&&document.body.addEventListener("click",function(s){setTimeout(function(){t().then(s=>{})},200)}),chrome.runtime.sendMessage({action:"_loadLocalizationData",url:window.location.href},function(s){a(s.result)}),chrome.runtime.onMessage.addListener((s,t,i)=>{if("_toggleTranslation"===s.action){if(n){n=!1,r();return}e=!0,a(s.data)}}),window.addEventListener("message",async s=>{if(s.source!==window||!s.data||"SC_TRANSLATE_REQUEST"!==s.data.type)return;let{action:n}=s.data;if("translate"===n)try{e=!0,chrome.runtime.sendMessage({action:"_loadLocalizationData",url:"manual"},function(s){a(s.result)})}catch(s){s.message}else if("undoTranslate"===n)try{await r()}catch(s){s.message}}),window.postMessage({type:"SC-BOX-TRANSLATE-API-AVAILABLE"},"*")},148:function(s,e){(function(s){"use strict";var e=["second","minute","hour","day","week","month","year"];function n(s,n){if(0===n)return["just now","right now"];var a=e[Math.floor(n/2)];return 1=u[t]&&t=u[n]&&n"1.3.8",n.ruid="bundler=rspack@1.3.8",n(242),n(148)})(); \ No newline at end of file diff --git a/dist/chrome/content_scripts/content-1.js b/dist/chrome/content_scripts/content-1.js index 60004cc..adeefb1 100644 --- a/dist/chrome/content_scripts/content-1.js +++ b/dist/chrome/content_scripts/content-1.js @@ -1 +1 @@ -(()=>{var e={282:function(e){!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,u={},l=u.toString,c=u.hasOwnProperty,f=c.toString,p=f.call(Object),d={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g=function(e){return null!=e&&e===e.window},v=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||v).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[l.call(e)]||"object":typeof e}var b="3.5.1",w=function(e,t){return new w.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!h(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=RegExp(M+"|>"),X=new RegExp(F),V=RegExp("^"+I+"$"),G={ID:RegExp("^#("+I+")"),CLASS:RegExp("^\\.("+I+")"),TAG:RegExp("^("+I+"|[*])"),ATTR:RegExp("^"+W),PSEUDO:RegExp("^"+F),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,et=RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),en=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},er=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ei=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},eo=function(){p()},ea=em(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(j=O.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){H={apply:j.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function es(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&eg(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(er,ei):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+ey(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(t){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace($,"$1"),t,r,i)}function eu(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function el(e){return e[b]=!0,e}function ec(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ef(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ep(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n){for(;n=n.nextSibling;)if(n===t)return -1}return e?1:-1}function ed(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||!e!==t.isDisabled&&ea(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function eh(e){return el(function(t){return t*=1,el(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function eg(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=es.support={},o=es.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=es.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement&&(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",eo,!1):i.attachEvent&&i.attachEvent("onunload",eo)),n.scope=ec(function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ec(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ec(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ec(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ec(function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ec(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ec(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),x=(t=K.test(h.compareDocumentPosition))||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t){for(;t=t.parentNode;)if(t===e)return!0}return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return ep(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ep(a[r],s[r]):a[r]==w?-1:+(s[r]==w)}),d},es.matches=function(e,t){return es(e,null,null,t)},es.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,en),e[3]=(e[3]||e[4]||e[5]||"").replace(et,en),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||es.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&es.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(et,en).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=es.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return h(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return -1)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,j=w(v);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,eh=/^$|^module$|\/(?:java|ecma)script/i;ec=v.createDocumentFragment().appendChild(v.createElement("div")),(ef=v.createElement("input")).setAttribute("type","radio"),ef.setAttribute("checked","checked"),ef.setAttribute("name","t"),ec.appendChild(ef),d.checkClone=ec.cloneNode(!0).cloneNode(!0).lastChild.checked,ec.innerHTML="",d.noCloneChecked=!!ec.cloneNode(!0).lastChild.defaultValue,ec.innerHTML="",d.option=!!ec.lastChild;var eg={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ev(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function ey(e,t){for(var n=0,r=e.length;n",""]);var em=/<|&#?\w+;/;function ex(e,t,n,r,i){for(var o,a,s,u,l,c=t.createDocumentFragment(),f=[],p=0,d=e.length;p\s*$/g;function eq(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function eL(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function eH(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function eO(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;nw.inArray(this,e)&&(w.cleanData(ev(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var eM=RegExp("^("+ee+")(?!px)[a-z%]+$","i"),eI=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},eW=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},eF=RegExp(en.join("|"),"i");function eB(e,t,n){var r,i,o,a,s=e.style;return(n=n||eI(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ei(e)||(a=w.style(e,t)),!d.pixelBoxStyles()&&eM.test(a)&&eF.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function e$(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",er.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),er.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=v.createElement("div"),c=v.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(d,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r;return null==s&&(t=v.createElement("table"),n=v.createElement("tr"),r=v.createElement("div"),t.style.cssText="position:absolute;left:-11111px",n.style.height="1px",r.style.height="9px",er.appendChild(t).appendChild(n).appendChild(r),s=3r.indexOf(" "+o+" ")&&(r+=o+" ");i!==(s=to(r))&&n.setAttribute("class",s)}}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(h(e))return this.each(function(t){w(this).removeClass(e.call(this,t,ta(this)))});if(!arguments.length)return this.attr("class","");if((t=ts(e)).length){for(;n=this[u++];)if(i=ta(n),r=1===n.nodeType&&" "+to(i)+" "){for(a=0;o=t[a++];)for(;-1m.indexOf(":")&&"on"+m,(t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:w.makeArray(n,[t]),p=w.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(u=p.delegateType||m,tl.test(u+m)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||v)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)d=a,t.type=1").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){n&&n()}}});var tH,tO=[],tP=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tO.pop()||w.expando+"_"+tp.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(tP.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&tP.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(tP,"$1"+i):!1!==t.jsonp&&(t.url+=(td.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,tO.push(i)),a&&h(o)&&o(a[0]),a=o=void 0}),"script"}),(tH=v.implementation.createHTMLDocument("").body).innerHTML="
",d.createHTMLDocument=2===tH.childNodes.length,w.parseHTML=function(e,t,n){var r,i,o;return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(r)):t=v),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ex([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return -1").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),h(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||er})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return $(this,function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=e$(d.pixelPosition,function(e,n){if(n)return n=eB(e,t),eM.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1==arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return 0"1.3.8",n.ruid="bundler=rspack@1.3.8",n(282)})(); \ No newline at end of file +(()=>{var e={317:function(e){!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,u={},l=u.toString,c=u.hasOwnProperty,f=c.toString,p=f.call(Object),d={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g=function(e){return null!=e&&e===e.window},v=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||v).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[l.call(e)]||"object":typeof e}var b="3.5.1",w=function(e,t){return new w.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!h(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=RegExp(M+"|>"),X=new RegExp(F),V=RegExp("^"+I+"$"),G={ID:RegExp("^#("+I+")"),CLASS:RegExp("^\\.("+I+")"),TAG:RegExp("^("+I+"|[*])"),ATTR:RegExp("^"+W),PSEUDO:RegExp("^"+F),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,et=RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),en=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},er=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ei=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},eo=function(){p()},ea=em(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(j=O.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){H={apply:j.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function es(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&eg(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(er,ei):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+ey(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(t){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace($,"$1"),t,r,i)}function eu(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function el(e){return e[b]=!0,e}function ec(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ef(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ep(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n){for(;n=n.nextSibling;)if(n===t)return -1}return e?1:-1}function ed(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||!e!==t.isDisabled&&ea(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function eh(e){return el(function(t){return t*=1,el(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function eg(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=es.support={},o=es.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=es.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement&&(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",eo,!1):i.attachEvent&&i.attachEvent("onunload",eo)),n.scope=ec(function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ec(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ec(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ec(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ec(function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ec(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ec(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),x=(t=K.test(h.compareDocumentPosition))||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t){for(;t=t.parentNode;)if(t===e)return!0}return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return ep(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ep(a[r],s[r]):a[r]==w?-1:+(s[r]==w)}),d},es.matches=function(e,t){return es(e,null,null,t)},es.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,en),e[3]=(e[3]||e[4]||e[5]||"").replace(et,en),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||es.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&es.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(et,en).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=es.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return h(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return -1)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,j=w(v);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,eh=/^$|^module$|\/(?:java|ecma)script/i;ec=v.createDocumentFragment().appendChild(v.createElement("div")),(ef=v.createElement("input")).setAttribute("type","radio"),ef.setAttribute("checked","checked"),ef.setAttribute("name","t"),ec.appendChild(ef),d.checkClone=ec.cloneNode(!0).cloneNode(!0).lastChild.checked,ec.innerHTML="",d.noCloneChecked=!!ec.cloneNode(!0).lastChild.defaultValue,ec.innerHTML="",d.option=!!ec.lastChild;var eg={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ev(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function ey(e,t){for(var n=0,r=e.length;n",""]);var em=/<|&#?\w+;/;function ex(e,t,n,r,i){for(var o,a,s,u,l,c=t.createDocumentFragment(),f=[],p=0,d=e.length;p\s*$/g;function eq(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function eL(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function eH(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function eO(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;nw.inArray(this,e)&&(w.cleanData(ev(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var eM=RegExp("^("+ee+")(?!px)[a-z%]+$","i"),eI=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},eW=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},eF=RegExp(en.join("|"),"i");function eB(e,t,n){var r,i,o,a,s=e.style;return(n=n||eI(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ei(e)||(a=w.style(e,t)),!d.pixelBoxStyles()&&eM.test(a)&&eF.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function e$(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",er.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),er.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=v.createElement("div"),c=v.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(d,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r;return null==s&&(t=v.createElement("table"),n=v.createElement("tr"),r=v.createElement("div"),t.style.cssText="position:absolute;left:-11111px",n.style.height="1px",r.style.height="9px",er.appendChild(t).appendChild(n).appendChild(r),s=3r.indexOf(" "+o+" ")&&(r+=o+" ");i!==(s=to(r))&&n.setAttribute("class",s)}}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(h(e))return this.each(function(t){w(this).removeClass(e.call(this,t,ta(this)))});if(!arguments.length)return this.attr("class","");if((t=ts(e)).length){for(;n=this[u++];)if(i=ta(n),r=1===n.nodeType&&" "+to(i)+" "){for(a=0;o=t[a++];)for(;-1m.indexOf(":")&&"on"+m,(t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:w.makeArray(n,[t]),p=w.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(u=p.delegateType||m,tl.test(u+m)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||v)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)d=a,t.type=1").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){n&&n()}}});var tH,tO=[],tP=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tO.pop()||w.expando+"_"+tp.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(tP.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&tP.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(tP,"$1"+i):!1!==t.jsonp&&(t.url+=(td.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,tO.push(i)),a&&h(o)&&o(a[0]),a=o=void 0}),"script"}),(tH=v.implementation.createHTMLDocument("").body).innerHTML="
",d.createHTMLDocument=2===tH.childNodes.length,w.parseHTML=function(e,t,n){var r,i,o;return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(r)):t=v),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ex([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return -1").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),h(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||er})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return $(this,function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=e$(d.pixelPosition,function(e,n){if(n)return n=eB(e,t),eM.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1==arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return 0"1.3.8",n.ruid="bundler=rspack@1.3.8",n(317)})(); \ No newline at end of file diff --git a/dist/chrome/content_scripts/content-2.js b/dist/chrome/content_scripts/content-2.js index 495a033..a7ac07b 100644 --- a/dist/chrome/content_scripts/content-2.js +++ b/dist/chrome/content_scripts/content-2.js @@ -1 +1 @@ -(()=>{var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.rv=()=>"1.3.8",r.ruid="bundler=rspack@1.3.8",function(){function e(t,r,n,o=100){let a=setInterval(()=>{let e=t.querySelector(r);e&&(clearInterval(a),n(e))},o)}function t(e){if(!e||e.parentNode.querySelector('a[data-cy-id="button"][href="/account/pledges"]'))return;let t=e.cloneNode(!0);t.href="/account/pledges";let r=t.querySelector('span[data-cy-id="button__text"]');r&&(r.innerText="My Hangar");let n=t.querySelector('i[data-cy-id="button__icon"]');n&&(n.className="a-button__icon a-icon -gridView"),e.parentNode.insertBefore(t,e)}e(document,"#sidePanel",r=>{new MutationObserver(r=>{for(let n of r)"childList"===n.type&&n.addedNodes.length>0&&n.addedNodes.forEach(r=>{1===r.nodeType&&e(r,'a[data-cy-id="button"][href="/account/settings"]',e=>{t(e)})})}).observe(r,{childList:!0,subtree:!0});let n=sidePanel.querySelector('a[data-cy-id="button"][href="/account/settings"]');n&&t(n)})}()})(); \ No newline at end of file +(()=>{var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.rv=()=>"1.3.8",r.ruid="bundler=rspack@1.3.8",function(){function e(t,r,n,o=100){let a=setInterval(()=>{let e=t.querySelector(r);e&&(clearInterval(a),n(e))},o)}function t(e){if(!e||e.parentNode.querySelector('a[data-cy-id="button"][href="/account/pledges"]'))return;let t=e.cloneNode(!0);t.href="/account/pledges";let r=t.querySelector('span[data-cy-id="button__text"]');r&&(r.innerText="My Hangar");let n=t.querySelector('i[data-cy-id="button__icon"]');n&&(n.className="a-button__icon a-icon -gridView"),e.parentNode.insertBefore(t,e)}e(document,"#sidePanel",r=>{new MutationObserver(r=>{for(let n of r)"childList"===n.type&&n.addedNodes.length>0&&n.addedNodes.forEach(r=>{1===r.nodeType&&e(r,'a[data-cy-id="button"][href="/account/settings"]',e=>{t(e)})})}).observe(r,{childList:!0,subtree:!0});let n=r.querySelector('a[data-cy-id="button"][href="/account/settings"]');n&&t(n)})}()})(); \ No newline at end of file diff --git a/dist/firefox/background/scripts.js b/dist/firefox/background/scripts.js index 8e0be6d..5b745a6 100644 --- a/dist/firefox/background/scripts.js +++ b/dist/firefox/background/scripts.js @@ -1 +1 @@ -(()=>{var e={},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.rv=()=>"1.3.8",s.ruid="bundler=rspack@1.3.8";let r=null;async function n(){r=await a("versions.json"),console.log("Localization Version ==="),console.log(r)}async function o(e){if(console.log("url ==="+e),null==r)return await n(),o(e);let t=r,s={};e.includes("robertsspaceindustries.com")||e.includes("manual")?(s["zh-CN"]=await a("zh-CN-rsi.json",{cacheKey:"zh-CN",version:t.rsi}),s.concierge=await a("concierge.json",{cacheKey:"concierge",version:t.concierge}),s.orgs=await a("orgs.json",t.orgs),s.address=await a("addresses.json",{cacheKey:"orgs",version:t.addresses}),s.hangar=await a("hangar.json",{cacheKey:"hangar",version:t.hangar})):e.includes("uexcorp.space")?s.UEX=await a("zh-CN-uex.json",{cacheKey:"uex",version:t.uex}):e.includes("erkul.games")&&(s.DPS=await a("zh-CN-dps.json",{cacheKey:"dps",version:t.dps}));let c=[];function i(e){c.push(...function(e,t){let s=[],r=e[t];if("object"==typeof r)for(let[e,t]of Object.entries(r)){let r=e.toString().trim().toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ");s.push({word:r,replacement:t.toString()})}return s}(s,e))}if(e.includes("robertsspaceindustries.com")||e.includes("manual")){if(e.startsWith("https://robertsspaceindustries.com/spectrum/community/"))return;i("zh-CN"),(e.startsWith("https://robertsspaceindustries.com/orgs")||e.startsWith("https://robertsspaceindustries.com/citizens")||e.startsWith("https://robertsspaceindustries.com/account/organization"))&&(c.push({word:"members",replacement:"名成员"}),i("orgs")),e.startsWith("https://robertsspaceindustries.com/account/addresses")&&i("address"),e.startsWith("https://robertsspaceindustries.com/account/referral-program")&&c.push({word:"Total recruits: ",replacement:"总邀请数:"},{word:"Prospects ",replacement:"未完成的邀请"},{word:"Recruits",replacement:"已完成的邀请"}),e.startsWith("https://robertsspaceindustries.com/account/concierge")&&(c=[],i("concierge")),e.startsWith("https://robertsspaceindustries.com/account/pledges")&&i("hangar")}else e.includes("uexcorp.space")?i("UEX"):e.includes("erkul.games")&&i("DPS");return c}async function a(e,{cacheKey:t="",version:s=null}={}){if(url="https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/"+e,t&&""!==t){let e=await c(`${t}_version`),r=await c(t);if(r&&"object"==typeof r&&Object.keys(r).length>0&&e===s)return r}let r=new Date,n=await fetch(url,{method:"GET",mode:"cors"}),o=new Date,u=await n.json();return t&&""!==t&&(console.log(`update ${t} v == ${s} time == ${(o-r)/1e3}s`),await i(t,u),await i(`${t}_version`,s)),u}function c(e){return new Promise(t=>{chrome.storage.local.get([e],s=>{t(s[e]||null)})})}function i(e,t){return new Promise(s=>{let r={};r[e]=t,chrome.storage.local.set(r,()=>{s()})})}chrome.runtime.onInstalled.addListener(function(){n().then(e=>{}),console.log("SWTT init")}),chrome.runtime.onMessage.addListener(function(e,t,s){if("_loadLocalizationData"===e.action)return o(e.url).then(e=>{s({result:e})}),!0}),chrome.runtime.onInstalled.addListener(function(){chrome.contextMenus.create({id:"translate",title:"切换翻译",contexts:["page"]})}),chrome.contextMenus.onClicked.addListener((e,t)=>{console.log("contextMenus",e,t);let s="manual";["robertsspaceindustries.com","erkul.games","uexcorp.space"].find(e=>t.url.includes(e))&&(s=t.url),o(s).then(e=>{chrome.tabs.sendMessage(t.id,{action:"_toggleTranslation",data:e})})})})(); \ No newline at end of file +(()=>{var e={},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.rv=()=>"1.3.8",s.ruid="bundler=rspack@1.3.8";let r=null;async function n(){r=await a("versions.json"),console.log("Localization Version ==="),console.log(r)}async function o(e){if(console.log("url ==="+e),null==r)return await n(),o(e);let t=r,s={};e.includes("robertsspaceindustries.com")||e.includes("manual")?(s["zh-CN"]=await a("zh-CN-rsi.json",{cacheKey:"zh-CN",version:t.rsi}),s.concierge=await a("concierge.json",{cacheKey:"concierge",version:t.concierge}),s.orgs=await a("orgs.json",{cacheKey:"orgs",version:t.orgs}),s.address=await a("addresses.json",{cacheKey:"orgs",version:t.addresses}),s.hangar=await a("hangar.json",{cacheKey:"hangar",version:t.hangar})):e.includes("uexcorp.space")?s.UEX=await a("zh-CN-uex.json",{cacheKey:"uex",version:t.uex}):e.includes("erkul.games")&&(s.DPS=await a("zh-CN-dps.json",{cacheKey:"dps",version:t.dps}));let c=[];function i(e){c.push(...function(e,t){let s=[],r=e[t];if("object"==typeof r)for(let[e,t]of Object.entries(r)){let r=e.toString().trim().toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ");s.push({word:r,replacement:String(t)})}return s}(s,e))}if(e.includes("robertsspaceindustries.com")||e.includes("manual")){if(e.startsWith("https://robertsspaceindustries.com/spectrum/community/"))return[];i("zh-CN"),(e.startsWith("https://robertsspaceindustries.com/orgs")||e.startsWith("https://robertsspaceindustries.com/citizens")||e.startsWith("https://robertsspaceindustries.com/account/organization"))&&(c.push({word:"members",replacement:"名成员"}),i("orgs")),e.startsWith("https://robertsspaceindustries.com/account/addresses")&&i("address"),e.startsWith("https://robertsspaceindustries.com/account/referral-program")&&c.push({word:"Total recruits: ",replacement:"总邀请数:"},{word:"Prospects ",replacement:"未完成的邀请"},{word:"Recruits",replacement:"已完成的邀请"}),e.startsWith("https://robertsspaceindustries.com/account/concierge")&&(c=[],i("concierge")),e.startsWith("https://robertsspaceindustries.com/account/pledges")&&i("hangar")}else e.includes("uexcorp.space")?i("UEX"):e.includes("erkul.games")&&i("DPS");return c}async function a(e,t={}){let{cacheKey:s="",version:r=null}=t;if(s&&""!==s){let e=await c(`${s}_version`),t=await c(s);if(t&&"object"==typeof t&&Object.keys(t).length>0&&e===r)return t}let n=new Date,o=await fetch("https://git.scbox.xkeyc.cn/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales/"+e,{method:"GET",mode:"cors"}),l=new Date,u=await o.json();if(s&&""!==s){let e=l.getTime()-n.getTime();console.log(`update ${s} v == ${r} time == ${e/1e3}s`),await i(s,u),await i(`${s}_version`,r)}return u}function c(e){return new Promise(t=>{chrome.storage.local.get([e],s=>{t(s[e]||null)})})}function i(e,t){return new Promise(s=>{let r={};r[e]=t,chrome.storage.local.set(r,()=>{s()})})}chrome.runtime.onInstalled.addListener(function(){n().then(e=>{}),console.log("SWTT init")}),chrome.runtime.onMessage.addListener(function(e,t,s){if("_loadLocalizationData"===e.action)return o(e.url).then(e=>{s({result:e})}),!0}),chrome.runtime.onInstalled.addListener(function(){chrome.contextMenus.create({id:"translate",title:"切换翻译",contexts:["all"]})}),chrome.contextMenus.onClicked.addListener((e,t)=>{console.log("contextMenus",e,t);let s="manual";t&&t.url&&["robertsspaceindustries.com","erkul.games","uexcorp.space"].find(e=>t.url.includes(e))&&(s=t.url),o(s).then(e=>{t&&void 0!==t.id&&chrome.tabs.sendMessage(t.id,{action:"_toggleTranslation",data:e})})})})(); \ No newline at end of file diff --git a/dist/firefox/content_scripts/content-0.js b/dist/firefox/content_scripts/content-0.js index 352d182..89a2a96 100644 --- a/dist/firefox/content_scripts/content-0.js +++ b/dist/firefox/content_scripts/content-0.js @@ -1 +1 @@ -(()=>{var s={756:function(){let s={},n=!1,e=!1;function a(n){n.sort(function(s,n){return n.word.length-s.word.length}).forEach(({word:n,replacement:e})=>{s[n]=e}),window.location.hostname.startsWith("issue-council.robertsspaceindustries.com")&&(s.save="保存"),t().then(s=>{})}async function t(){async function s(n,e){if(n.nodeType===Node.TEXT_NODE){let s=n.nodeValue,a=u(s);s!==a&&(e.setAttribute("data-original-value",s),n.nodeValue=a)}else for(let e=0;e{s.innerText=s.getAttribute("data-original-value"),s.removeAttribute("data-original-value")}),document.querySelectorAll('input[type="button"], input[type="submit"], input[type="text"], input[type="password"]').forEach(s=>{s.hasAttribute("data-original-value")&&("button"===s.type||"submit"===s.type?s.value=s.getAttribute("data-original-value"):s.placeholder=s.getAttribute("data-original-value"),s.removeAttribute("data-original-value"))}),{success:!0}}function i(s,n){let e;"INPUT"===s.tagName?(e="button"===s.type||"submit"===s.type?"value":"placeholder",s.setAttribute("data-original-value",s[e])):(e="data",n.setAttribute("data-original-value",s[e])),s[e]=u(s[e])}function u(e){let a=e.toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),t=e.replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),r=a.replace("the ",""),i=a.replace("- ","");if(s[a])e=s[a];else if(n)if(t.includes(" - ")){let n=e,r=t.split(" - ");if("upgrade"===r[0].toLowerCase()&&a.includes("to")&&a.endsWith("edition")){let s=a.replace("standard edition","").replace("upgrade","").replace("warbond edition","").split(" to "),n="升级包 "+u(s[0])+" 到 "+u(s[1]);a.endsWith("warbond edition")?n+=" 战争债券版":n+=" 标准版",e=n}else r.forEach(function(e){n=s[e.toLowerCase()]?n.replace(e,s[e.toLowerCase()]):n.replace(e,u(e))}),e=n}else if(a.endsWith("starter pack")||a.endsWith("starter package")){let n=a.replace("starter package","").replace("starter pack","").trim();s[n.toLowerCase()]&&(n=s[n.toLowerCase()]),e=n+" 新手包"}else a.startsWith("the ")&&s[r]?e=s[r]:a.startsWith("- ")&&s[i]&&(e="- "+s[i]);return e}new(window.MutationObserver||window.WebKitMutationObserver)(function(s,n){for(let n of s)for(let s of n.addedNodes)!function s(n){if(e&&function(s){if(["IMG","svg","mat-icon"].includes(s.tagName)||s.id&&[].includes(s.id))return!1;if(s.classList){for(let n of["css-truncate"])if(s.classList.contains(n))return!1}return!0}(n))for(let e of n.childNodes){if(["RELATIVE-TIME","TIME-AGO"].includes(n.tagName))return void function(s){let n=navigator.language||navigator.userLanguage,e=$(s).attr("datetime");$(s).text(timeago.format(e,n.replace("-","_")))}(n);e.nodeType===Node.TEXT_NODE?i(e,n):e.nodeType===Node.ELEMENT_NODE&&("INPUT"===e.tagName?i(e,n):s(e,n))}}(s)}).observe(document.body,{subtree:!0,characterData:!0,childList:!0}),window.location.href.includes("robertsspaceindustries.com")&&(n=!0),window.location.hostname.includes("www.erkul.games")&&document.body.addEventListener("click",function(s){setTimeout(function(){t().then(s=>{})},200)}),chrome.runtime.sendMessage({action:"_loadLocalizationData",url:window.location.href},function(s){a(s.result)}),chrome.runtime.onMessage.addListener((s,t,i)=>{if("_toggleTranslation"===s.action){if(e){e=!1,r();return}n=!0,a(s.data)}}),window.addEventListener("message",async s=>{if(s.source!==window||!s.data||"SC_TRANSLATE_REQUEST"!==s.data.type)return;let{action:e}=s.data;if("translate"===e)try{n=!0,chrome.runtime.sendMessage({action:"_loadLocalizationData",url:"manual"},function(s){a(s.result)})}catch(s){s.message}else if("undoTranslate"===e)try{await r()}catch(s){s.message}}),window.postMessage({type:"SC-BOX-TRANSLATE-API-AVAILABLE"},"*")},928:function(s,n){(function(s){"use strict";var n=["second","minute","hour","day","week","month","year"];function e(s,e){if(0===e)return["just now","right now"];var a=n[Math.floor(e/2)];return 1=u[t]&&t=u[e]&&e"1.3.8",e.ruid="bundler=rspack@1.3.8",e(756),e(928)})(); \ No newline at end of file +(()=>{var s={242:function(){let s={},e=!1,n=!1;function a(e){e.sort(function(s,e){return e.word.length-s.word.length}).forEach(({word:e,replacement:n})=>{s[e]=n}),window.location.hostname.startsWith("issue-council.robertsspaceindustries.com")&&(s.save="保存"),t().then(s=>{})}async function t(){async function s(e,n){if(e.nodeType===Node.TEXT_NODE){let s=e.nodeValue||"",a=u(s);if(s!==a&&n){let t=n.getAttribute("data-original-value")||"";n.setAttribute("data-original-value",t+s),e.nodeValue=a}}else for(let n=0;n{s.innerText=s.getAttribute("data-original-value")||"",s.removeAttribute("data-original-value")}),document.querySelectorAll('input[type="button"], input[type="submit"], input[type="text"], input[type="password"]').forEach(s=>{s.hasAttribute("data-original-value")&&("button"===s.type||"submit"===s.type?s.value=s.getAttribute("data-original-value")||"":s.placeholder=s.getAttribute("data-original-value")||"",s.removeAttribute("data-original-value"))}),Promise.resolve({success:!0})}function i(s,e){let n,a;if("INPUT"===s.tagName){if(n="button"===s.type||"submit"===s.type?"value":"placeholder",a=u(s[n]),s[n]===a)return;let t=e.getAttribute("data-original-value")||"";s.setAttribute("data-original-value",t+s[n])}else{if(a=u(s[n="data"]),s[n]===a)return;let t=e.getAttribute("data-original-value")||"";e.setAttribute("data-original-value",t+s[n])}s[n]=a}function u(n){let a=n.toLowerCase().replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),t=n.replace(/\xa0/g," ").replace(/\s{2,}/g," ").trim(),r=a.replace("the ",""),i=a.replace("- ","");if(s[a])n=s[a];else if(e)if(t.includes(" - ")){let e=n,r=t.split(" - ");if("upgrade"===r[0].toLowerCase()&&a.includes("to")&&a.endsWith("edition")){let s=a.replace("standard edition","").replace("upgrade","").replace("warbond edition","").split(" to "),e="升级包 "+u(s[0])+" 到 "+u(s[1]);a.endsWith("warbond edition")?e+=" 战争债券版":e+=" 标准版",n=e}else r.forEach(function(n){e=s[n.toLowerCase()]?e.replace(n,s[n.toLowerCase()]):e.replace(n,u(n))}),n=e}else if(a.endsWith("starter pack")||a.endsWith("starter package")){let e=a.replace("starter package","").replace("starter pack","").trim();s[e.toLowerCase()]&&(e=s[e.toLowerCase()]),n=e+" 新手包"}else a.startsWith("the ")&&s[r]?n=s[r]:a.startsWith("- ")&&s[i]&&(n="- "+s[i]);return n}new(window.MutationObserver||window.WebKitMutationObserver)(function(s,e){for(let e of s)for(let s of e.addedNodes)!function s(e){if(n&&function(s){if(["IMG","svg","mat-icon"].includes(s.tagName)||s.id&&[].includes(s.id))return!1;if(s.classList){for(let e of["css-truncate"])if(s.classList.contains(e))return!1}return!0}(e))for(let n of e.childNodes){if(["RELATIVE-TIME","TIME-AGO"].includes(e.tagName))return void function(s){let e=navigator.language||navigator.language,n=$(s).attr("datetime");$(s).text(timeago.format(n,e.replace("-","_")))}(e);n.nodeType===Node.TEXT_NODE?i(n,e):n.nodeType===Node.ELEMENT_NODE&&("INPUT"===n.tagName?i(n,e):s(n))}}(s)}).observe(document.body,{subtree:!0,characterData:!0,childList:!0}),window.location.href.includes("robertsspaceindustries.com")&&(e=!0),window.location.hostname.includes("www.erkul.games")&&document.body.addEventListener("click",function(s){setTimeout(function(){t().then(s=>{})},200)}),chrome.runtime.sendMessage({action:"_loadLocalizationData",url:window.location.href},function(s){a(s.result)}),chrome.runtime.onMessage.addListener((s,t,i)=>{if("_toggleTranslation"===s.action){if(n){n=!1,r();return}e=!0,a(s.data)}}),window.addEventListener("message",async s=>{if(s.source!==window||!s.data||"SC_TRANSLATE_REQUEST"!==s.data.type)return;let{action:n}=s.data;if("translate"===n)try{e=!0,chrome.runtime.sendMessage({action:"_loadLocalizationData",url:"manual"},function(s){a(s.result)})}catch(s){s.message}else if("undoTranslate"===n)try{await r()}catch(s){s.message}}),window.postMessage({type:"SC-BOX-TRANSLATE-API-AVAILABLE"},"*")},148:function(s,e){(function(s){"use strict";var e=["second","minute","hour","day","week","month","year"];function n(s,n){if(0===n)return["just now","right now"];var a=e[Math.floor(n/2)];return 1=u[t]&&t=u[n]&&n"1.3.8",n.ruid="bundler=rspack@1.3.8",n(242),n(148)})(); \ No newline at end of file diff --git a/dist/firefox/content_scripts/content-1.js b/dist/firefox/content_scripts/content-1.js index 60004cc..adeefb1 100644 --- a/dist/firefox/content_scripts/content-1.js +++ b/dist/firefox/content_scripts/content-1.js @@ -1 +1 @@ -(()=>{var e={282:function(e){!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,u={},l=u.toString,c=u.hasOwnProperty,f=c.toString,p=f.call(Object),d={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g=function(e){return null!=e&&e===e.window},v=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||v).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[l.call(e)]||"object":typeof e}var b="3.5.1",w=function(e,t){return new w.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!h(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=RegExp(M+"|>"),X=new RegExp(F),V=RegExp("^"+I+"$"),G={ID:RegExp("^#("+I+")"),CLASS:RegExp("^\\.("+I+")"),TAG:RegExp("^("+I+"|[*])"),ATTR:RegExp("^"+W),PSEUDO:RegExp("^"+F),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,et=RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),en=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},er=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ei=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},eo=function(){p()},ea=em(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(j=O.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){H={apply:j.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function es(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&eg(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(er,ei):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+ey(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(t){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace($,"$1"),t,r,i)}function eu(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function el(e){return e[b]=!0,e}function ec(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ef(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ep(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n){for(;n=n.nextSibling;)if(n===t)return -1}return e?1:-1}function ed(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||!e!==t.isDisabled&&ea(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function eh(e){return el(function(t){return t*=1,el(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function eg(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=es.support={},o=es.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=es.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement&&(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",eo,!1):i.attachEvent&&i.attachEvent("onunload",eo)),n.scope=ec(function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ec(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ec(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ec(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ec(function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ec(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ec(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),x=(t=K.test(h.compareDocumentPosition))||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t){for(;t=t.parentNode;)if(t===e)return!0}return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return ep(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ep(a[r],s[r]):a[r]==w?-1:+(s[r]==w)}),d},es.matches=function(e,t){return es(e,null,null,t)},es.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,en),e[3]=(e[3]||e[4]||e[5]||"").replace(et,en),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||es.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&es.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(et,en).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=es.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return h(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return -1)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,j=w(v);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,eh=/^$|^module$|\/(?:java|ecma)script/i;ec=v.createDocumentFragment().appendChild(v.createElement("div")),(ef=v.createElement("input")).setAttribute("type","radio"),ef.setAttribute("checked","checked"),ef.setAttribute("name","t"),ec.appendChild(ef),d.checkClone=ec.cloneNode(!0).cloneNode(!0).lastChild.checked,ec.innerHTML="",d.noCloneChecked=!!ec.cloneNode(!0).lastChild.defaultValue,ec.innerHTML="",d.option=!!ec.lastChild;var eg={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ev(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function ey(e,t){for(var n=0,r=e.length;n",""]);var em=/<|&#?\w+;/;function ex(e,t,n,r,i){for(var o,a,s,u,l,c=t.createDocumentFragment(),f=[],p=0,d=e.length;p\s*$/g;function eq(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function eL(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function eH(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function eO(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;nw.inArray(this,e)&&(w.cleanData(ev(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var eM=RegExp("^("+ee+")(?!px)[a-z%]+$","i"),eI=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},eW=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},eF=RegExp(en.join("|"),"i");function eB(e,t,n){var r,i,o,a,s=e.style;return(n=n||eI(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ei(e)||(a=w.style(e,t)),!d.pixelBoxStyles()&&eM.test(a)&&eF.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function e$(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",er.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),er.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=v.createElement("div"),c=v.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(d,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r;return null==s&&(t=v.createElement("table"),n=v.createElement("tr"),r=v.createElement("div"),t.style.cssText="position:absolute;left:-11111px",n.style.height="1px",r.style.height="9px",er.appendChild(t).appendChild(n).appendChild(r),s=3r.indexOf(" "+o+" ")&&(r+=o+" ");i!==(s=to(r))&&n.setAttribute("class",s)}}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(h(e))return this.each(function(t){w(this).removeClass(e.call(this,t,ta(this)))});if(!arguments.length)return this.attr("class","");if((t=ts(e)).length){for(;n=this[u++];)if(i=ta(n),r=1===n.nodeType&&" "+to(i)+" "){for(a=0;o=t[a++];)for(;-1m.indexOf(":")&&"on"+m,(t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:w.makeArray(n,[t]),p=w.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(u=p.delegateType||m,tl.test(u+m)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||v)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)d=a,t.type=1").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){n&&n()}}});var tH,tO=[],tP=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tO.pop()||w.expando+"_"+tp.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(tP.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&tP.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(tP,"$1"+i):!1!==t.jsonp&&(t.url+=(td.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,tO.push(i)),a&&h(o)&&o(a[0]),a=o=void 0}),"script"}),(tH=v.implementation.createHTMLDocument("").body).innerHTML="
",d.createHTMLDocument=2===tH.childNodes.length,w.parseHTML=function(e,t,n){var r,i,o;return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(r)):t=v),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ex([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return -1").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),h(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||er})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return $(this,function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=e$(d.pixelPosition,function(e,n){if(n)return n=eB(e,t),eM.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1==arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return 0"1.3.8",n.ruid="bundler=rspack@1.3.8",n(282)})(); \ No newline at end of file +(()=>{var e={317:function(e){!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,u={},l=u.toString,c=u.hasOwnProperty,f=c.toString,p=f.call(Object),d={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g=function(e){return null!=e&&e===e.window},v=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||v).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[l.call(e)]||"object":typeof e}var b="3.5.1",w=function(e,t){return new w.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!h(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=RegExp(M+"|>"),X=new RegExp(F),V=RegExp("^"+I+"$"),G={ID:RegExp("^#("+I+")"),CLASS:RegExp("^\\.("+I+")"),TAG:RegExp("^("+I+"|[*])"),ATTR:RegExp("^"+W),PSEUDO:RegExp("^"+F),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,et=RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),en=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},er=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ei=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},eo=function(){p()},ea=em(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(j=O.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){H={apply:j.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function es(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&eg(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(er,ei):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+ey(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(t){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace($,"$1"),t,r,i)}function eu(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function el(e){return e[b]=!0,e}function ec(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ef(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ep(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n){for(;n=n.nextSibling;)if(n===t)return -1}return e?1:-1}function ed(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||!e!==t.isDisabled&&ea(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function eh(e){return el(function(t){return t*=1,el(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function eg(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=es.support={},o=es.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=es.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement&&(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",eo,!1):i.attachEvent&&i.attachEvent("onunload",eo)),n.scope=ec(function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ec(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ec(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ec(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(et,en);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ec(function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ec(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ec(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),x=(t=K.test(h.compareDocumentPosition))||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t){for(;t=t.parentNode;)if(t===e)return!0}return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return ep(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ep(a[r],s[r]):a[r]==w?-1:+(s[r]==w)}),d},es.matches=function(e,t){return es(e,null,null,t)},es.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,en),e[3]=(e[3]||e[4]||e[5]||"").replace(et,en),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||es.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&es.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(et,en).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=es.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return h(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return -1)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,j=w(v);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,eh=/^$|^module$|\/(?:java|ecma)script/i;ec=v.createDocumentFragment().appendChild(v.createElement("div")),(ef=v.createElement("input")).setAttribute("type","radio"),ef.setAttribute("checked","checked"),ef.setAttribute("name","t"),ec.appendChild(ef),d.checkClone=ec.cloneNode(!0).cloneNode(!0).lastChild.checked,ec.innerHTML="",d.noCloneChecked=!!ec.cloneNode(!0).lastChild.defaultValue,ec.innerHTML="",d.option=!!ec.lastChild;var eg={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ev(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function ey(e,t){for(var n=0,r=e.length;n",""]);var em=/<|&#?\w+;/;function ex(e,t,n,r,i){for(var o,a,s,u,l,c=t.createDocumentFragment(),f=[],p=0,d=e.length;p\s*$/g;function eq(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function eL(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function eH(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function eO(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;nw.inArray(this,e)&&(w.cleanData(ev(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var eM=RegExp("^("+ee+")(?!px)[a-z%]+$","i"),eI=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},eW=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},eF=RegExp(en.join("|"),"i");function eB(e,t,n){var r,i,o,a,s=e.style;return(n=n||eI(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ei(e)||(a=w.style(e,t)),!d.pixelBoxStyles()&&eM.test(a)&&eF.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function e$(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",er.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),er.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=v.createElement("div"),c=v.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(d,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r;return null==s&&(t=v.createElement("table"),n=v.createElement("tr"),r=v.createElement("div"),t.style.cssText="position:absolute;left:-11111px",n.style.height="1px",r.style.height="9px",er.appendChild(t).appendChild(n).appendChild(r),s=3r.indexOf(" "+o+" ")&&(r+=o+" ");i!==(s=to(r))&&n.setAttribute("class",s)}}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(h(e))return this.each(function(t){w(this).removeClass(e.call(this,t,ta(this)))});if(!arguments.length)return this.attr("class","");if((t=ts(e)).length){for(;n=this[u++];)if(i=ta(n),r=1===n.nodeType&&" "+to(i)+" "){for(a=0;o=t[a++];)for(;-1m.indexOf(":")&&"on"+m,(t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:w.makeArray(n,[t]),p=w.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(u=p.delegateType||m,tl.test(u+m)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||v)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)d=a,t.type=1").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){n&&n()}}});var tH,tO=[],tP=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tO.pop()||w.expando+"_"+tp.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(tP.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&tP.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(tP,"$1"+i):!1!==t.jsonp&&(t.url+=(td.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,tO.push(i)),a&&h(o)&&o(a[0]),a=o=void 0}),"script"}),(tH=v.implementation.createHTMLDocument("").body).innerHTML="
",d.createHTMLDocument=2===tH.childNodes.length,w.parseHTML=function(e,t,n){var r,i,o;return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(r)):t=v),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ex([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return -1").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),h(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||er})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return $(this,function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=e$(d.pixelPosition,function(e,n){if(n)return n=eB(e,t),eM.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1==arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return 0"1.3.8",n.ruid="bundler=rspack@1.3.8",n(317)})(); \ No newline at end of file diff --git a/dist/firefox/content_scripts/content-2.js b/dist/firefox/content_scripts/content-2.js index 495a033..a7ac07b 100644 --- a/dist/firefox/content_scripts/content-2.js +++ b/dist/firefox/content_scripts/content-2.js @@ -1 +1 @@ -(()=>{var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.rv=()=>"1.3.8",r.ruid="bundler=rspack@1.3.8",function(){function e(t,r,n,o=100){let a=setInterval(()=>{let e=t.querySelector(r);e&&(clearInterval(a),n(e))},o)}function t(e){if(!e||e.parentNode.querySelector('a[data-cy-id="button"][href="/account/pledges"]'))return;let t=e.cloneNode(!0);t.href="/account/pledges";let r=t.querySelector('span[data-cy-id="button__text"]');r&&(r.innerText="My Hangar");let n=t.querySelector('i[data-cy-id="button__icon"]');n&&(n.className="a-button__icon a-icon -gridView"),e.parentNode.insertBefore(t,e)}e(document,"#sidePanel",r=>{new MutationObserver(r=>{for(let n of r)"childList"===n.type&&n.addedNodes.length>0&&n.addedNodes.forEach(r=>{1===r.nodeType&&e(r,'a[data-cy-id="button"][href="/account/settings"]',e=>{t(e)})})}).observe(r,{childList:!0,subtree:!0});let n=sidePanel.querySelector('a[data-cy-id="button"][href="/account/settings"]');n&&t(n)})}()})(); \ No newline at end of file +(()=>{var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.rv=()=>"1.3.8",r.ruid="bundler=rspack@1.3.8",function(){function e(t,r,n,o=100){let a=setInterval(()=>{let e=t.querySelector(r);e&&(clearInterval(a),n(e))},o)}function t(e){if(!e||e.parentNode.querySelector('a[data-cy-id="button"][href="/account/pledges"]'))return;let t=e.cloneNode(!0);t.href="/account/pledges";let r=t.querySelector('span[data-cy-id="button__text"]');r&&(r.innerText="My Hangar");let n=t.querySelector('i[data-cy-id="button__icon"]');n&&(n.className="a-button__icon a-icon -gridView"),e.parentNode.insertBefore(t,e)}e(document,"#sidePanel",r=>{new MutationObserver(r=>{for(let n of r)"childList"===n.type&&n.addedNodes.length>0&&n.addedNodes.forEach(r=>{1===r.nodeType&&e(r,'a[data-cy-id="button"][href="/account/settings"]',e=>{t(e)})})}).observe(r,{childList:!0,subtree:!0});let n=r.querySelector('a[data-cy-id="button"][href="/account/settings"]');n&&t(n)})}()})(); \ No newline at end of file diff --git a/manifest.json b/manifest.json index e9b5f28..2258ab5 100644 --- a/manifest.json +++ b/manifest.json @@ -21,8 +21,8 @@ "default_popup": "popup.html" }, "background": { - "chromium:service_worker": "background.js", - "firefox:scripts": ["background.js"] + "chromium:service_worker": "background.ts", + "firefox:scripts": ["background.ts"] }, "content_scripts": [ { @@ -33,7 +33,7 @@ "https://robertsspaceindustries.com/spectrum/*" ], "js": [ - "core.js", + "core.ts", "thirdparty/timeago.full.min.js" ], "run_at": "document_end" @@ -52,7 +52,7 @@ "https://robertsspaceindustries.com/*" ], "js": [ - "rsi_hangar_fix.js" + "rsi_hangar_fix.ts" ], "run_at": "document_idle" } diff --git a/package.json b/package.json index d79a3d2..c5ada99 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,9 @@ }, "dependencies": {}, "devDependencies": { - "extension": "^2.0.0-rc.23" + "extension": "^2.0.0-rc.23", + "@types/node": "^22.10.5", + "typescript": "5.3.3" }, "private": true, "author": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b6dba1..aa17f3e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,15 @@ importers: .: devDependencies: + '@types/node': + specifier: ^22.10.5 + version: 22.15.3 extension: specifier: ^2.0.0-rc.23 - version: 2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(webpack@5.99.7) + version: 2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(typescript@5.3.3)(webpack@5.99.7) + typescript: + specifier: 5.3.3 + version: 5.3.3 packages: @@ -2290,6 +2296,11 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -3542,12 +3553,14 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig@9.0.0: + cosmiconfig@9.0.0(typescript@5.3.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 js-yaml: 4.1.0 parse-json: 5.2.0 + optionalDependencies: + typescript: 5.3.3 optional: true cross-spawn@7.0.6: @@ -3779,7 +3792,7 @@ snapshots: go-git-it: 2.0.4 package-manager-detector: 0.2.11 - extension-develop@2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(webpack@5.99.7): + extension-develop@2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(typescript@5.3.3)(webpack@5.99.7): dependencies: '@colors/colors': 1.6.0 '@rspack/core': 1.3.8(@swc/helpers@0.5.17) @@ -3826,12 +3839,12 @@ snapshots: '@rspack/plugin-react-refresh': 1.4.1(react-refresh@0.14.2) babel-loader: 9.2.1(@babel/core@7.27.1)(webpack@5.99.7) less-loader: 12.3.0(@rspack/core@1.3.8(@swc/helpers@0.5.17))(less@4.3.0)(webpack@5.99.7) - postcss-loader: 8.1.1(@rspack/core@1.3.8(@swc/helpers@0.5.17))(postcss@8.5.3)(webpack@5.99.7) + postcss-loader: 8.1.1(@rspack/core@1.3.8(@swc/helpers@0.5.17))(postcss@8.5.3)(typescript@5.3.3)(webpack@5.99.7) postcss-preset-env: 10.1.6(postcss@8.5.3) react-refresh: 0.14.2 sass-loader: 16.0.5(@rspack/core@1.3.8(@swc/helpers@0.5.17))(webpack@5.99.7) svelte-loader: 3.2.4(svelte@5.28.2) - svelte-preprocess: 6.0.3(@babel/core@7.27.1)(less@4.3.0)(postcss@8.5.3)(svelte@5.28.2) + svelte-preprocess: 6.0.3(@babel/core@7.27.1)(less@4.3.0)(postcss@8.5.3)(svelte@5.28.2)(typescript@5.3.3) vue-loader: 17.4.2(@vue/compiler-sfc@3.5.13)(webpack@5.99.7) vue-style-loader: 4.1.3 vue-template-compiler: 2.7.16 @@ -3859,7 +3872,7 @@ snapshots: - webpack-cli - webpack-hot-middleware - extension@2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(webpack@5.99.7): + extension@2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(typescript@5.3.3)(webpack@5.99.7): dependencies: '@colors/colors': 1.6.0 '@types/chrome': 0.0.287 @@ -3869,7 +3882,7 @@ snapshots: '@types/react-dom': 19.1.3(@types/react@19.1.2) commander: 12.1.0 extension-create: 2.0.1 - extension-develop: 2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(webpack@5.99.7) + extension-develop: 2.0.0-rc.23(@babel/core@7.27.1)(@prefresh/babel-plugin@0.5.1)(@types/express@4.17.21)(less@4.3.0)(svelte@5.28.2)(typescript@5.3.3)(webpack@5.99.7) semver: 7.7.1 update-check: 1.5.4 webextension-polyfill: 0.12.0 @@ -4570,9 +4583,9 @@ snapshots: postcss: 8.5.3 optional: true - postcss-loader@8.1.1(@rspack/core@1.3.8(@swc/helpers@0.5.17))(postcss@8.5.3)(webpack@5.99.7): + postcss-loader@8.1.1(@rspack/core@1.3.8(@swc/helpers@0.5.17))(postcss@8.5.3)(typescript@5.3.3)(webpack@5.99.7): dependencies: - cosmiconfig: 9.0.0 + cosmiconfig: 9.0.0(typescript@5.3.3) jiti: 1.21.7 postcss: 8.5.3 semver: 7.7.1 @@ -5018,13 +5031,14 @@ snapshots: svelte-hmr: 0.14.12(svelte@5.28.2) optional: true - svelte-preprocess@6.0.3(@babel/core@7.27.1)(less@4.3.0)(postcss@8.5.3)(svelte@5.28.2): + svelte-preprocess@6.0.3(@babel/core@7.27.1)(less@4.3.0)(postcss@8.5.3)(svelte@5.28.2)(typescript@5.3.3): dependencies: svelte: 5.28.2 optionalDependencies: '@babel/core': 7.27.1 less: 4.3.0 postcss: 8.5.3 + typescript: 5.3.3 optional: true svelte@5.28.2: @@ -5093,6 +5107,8 @@ snapshots: typedarray@0.0.6: {} + typescript@5.3.3: {} + undici-types@6.21.0: {} universalify@2.0.1: {} diff --git a/rsi_hangar_fix.js b/rsi_hangar_fix.js deleted file mode 100644 index a8e66ce..0000000 --- a/rsi_hangar_fix.js +++ /dev/null @@ -1,93 +0,0 @@ -// from https://github.com/cfdxkk/RSI-Hangar-Button -// LICENSE GLWT(Good Luck With That) Public License -(function () { - /** - * 寻找元素直到元素被加载 - * @param dom 查找的根元素 - * @param selector 元素的查找 - * @param callback 查找到的回调 - * @param interval 查找的间隔,默认 100 毫秒 - */ - function waitForElement(dom, selector, callback, interval = 100) { - const checkExist = setInterval(() => { - const element = dom.querySelector(selector) - if (element) { - clearInterval(checkExist) // 停止轮询 - callback(element) - } - }, interval) - } - - /** - * 开始监听抽屉,如果监听到点击事件,则添加按钮 - * @param element - */ - function startObserve(element) { - // 创建一个 MutationObserver 实例,监听元素的子元素变化 - const observer = new MutationObserver((mutationsList) => { - for (const mutation of mutationsList) { - if (mutation.type === 'childList' && mutation.addedNodes.length > 0) { - mutation.addedNodes.forEach(node => { - if (node.nodeType === 1) { // 只处理元素节点 (忽略文本节点) - waitForElement(node, "a[data-cy-id=\"button\"][href=\"/account/settings\"]", (button) => { - copyAndAddButton(button) - }) - } - }) - } - } - }) - - // 监听子节点变化,并对子树内的变化也进行监听 - observer.observe(element, { childList: true, subtree: true }) - } - - /** - * 复制原有按钮,将其修改为机库按钮并插入到原按钮的上方 - * 在插入前先检查是否已经存在对应的按钮 - * @param {HTMLElement} button 原始按钮 - */ - function copyAndAddButton(button) { - if (!button) return - - // 如果已经存在 href 为 /account/pledges 的按钮,则不再添加 - if (button.parentNode.querySelector('a[data-cy-id="button"][href="/account/pledges"]')) { - return - } - // 复制元素 - const hangarButton = button.cloneNode(true) - - // 修改 href - hangarButton.href = "/account/pledges" - - // 查找按钮中的文本部分 - const hangarButtonText = hangarButton.querySelector('span[data-cy-id="button__text"]') - - // 修改文本 - if (hangarButtonText) { - hangarButtonText.innerText = "My Hangar" - } - - // 查找按钮中的图标部分 - const hangarButtonIcon = hangarButton.querySelector('i[data-cy-id="button__icon"]') - - // 修改图标 - if (hangarButtonIcon) { - hangarButtonIcon.className = "a-button__icon a-icon -gridView" - } - - // 插入到目标元素的前方 - button.parentNode.insertBefore(hangarButton, button) - } - - // 开始查找抽屉,如果找到执行监听回调 - waitForElement(document, "#sidePanel", (risSidePanel) => { - startObserve(risSidePanel) - - // 初始检查:防止首次打开抽屉时按钮已经存在,MutationObserver 不触发 - const button = sidePanel.querySelector('a[data-cy-id="button"][href="/account/settings"]') - if (button) { - copyAndAddButton(button) - } - }) -})() \ No newline at end of file diff --git a/Legacy/StarCitizenBoxBrowserEx_Firefox/rsi_hangar_fix.js b/rsi_hangar_fix.ts similarity index 94% rename from Legacy/StarCitizenBoxBrowserEx_Firefox/rsi_hangar_fix.js rename to rsi_hangar_fix.ts index a8e66ce..551bd97 100644 --- a/Legacy/StarCitizenBoxBrowserEx_Firefox/rsi_hangar_fix.js +++ b/rsi_hangar_fix.ts @@ -81,11 +81,11 @@ } // 开始查找抽屉,如果找到执行监听回调 - waitForElement(document, "#sidePanel", (risSidePanel) => { - startObserve(risSidePanel) + waitForElement(document, "#sidePanel", (rsiSidePanel) => { + startObserve(rsiSidePanel) // 初始检查:防止首次打开抽屉时按钮已经存在,MutationObserver 不触发 - const button = sidePanel.querySelector('a[data-cy-id="button"][href="/account/settings"]') + const button = rsiSidePanel.querySelector('a[data-cy-id="button"][href="/account/settings"]') if (button) { copyAndAddButton(button) } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f7ab03c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "allowJs": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "lib": ["dom", "dom.iterable", "esnext"], + "moduleResolution": "node", + "module": "esnext", + "noEmit": true, + "resolveJsonModule": true, + "strict": true, + "target": "esnext", + "verbatimModuleSyntax": true, + "useDefineForClassFields": true, + "skipLibCheck": true, + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + } + }, + "include": ["./"], + "exclude": ["node_modules", "dist"], +}