// ==UserScript==
// @name 爱问答助手
// @namespace aiask/askHelper
// @version 2.5.2
// @author aiask
// @description 全平台问答助手,一键获取整个页面的试题答案,目前支持【超星学习通、知到智慧树、国家开放大学、广东开放大学、江苏开放大学、上海开放大学、云南开放大学、芯位教育、云慕学苑、职教云、川农在线、安徽继续教育平台、青书学堂、睿学在线、成教云、京人平台、绎通继教云、学起Plus、云上河开、河南继续教育、四川开放大学、良师在线、继教云、日照专业技术人员继续教育、麦能网、21tb、168网校、云班课、电大中专、learnin、西财在线、春风雨】,更多平台开发中...
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAHVQTFRFR3BMgICBQD8/QUVHQ0ZIRUhKX2FiQD8/Tk1NP0VJPzs7Pz8/QD4+UE9QQD8/PVlnQD8/M6vj////n5+fN5C60NDQSl9qOXWSZL/qTFNXzOr4QWl8yMjItLS02traOIOnNZzN6OfnlJeZ9/f3PYGgpdrzmdXxgSBJqQAAABB0Uk5TAP5E6vys+7/Q0RhsfPFV/OwFarYAAAEESURBVHjapdHrboMgGIBhUHBaD/sAlTE8VOt2/5c4GlBMRZOl7w8j+kQQ0FaVwbG48IDq+piMPcgkO1bD/8DXvhD4/fb9ePDuGiqa2krV7pO1AxSLYIl2ABoeTLSvYMBi4N0sphOAlVaqg1aTPggmZYYaFvNMBYGQz6G6m2vbhEBvF81MxALFTDpbQQd3ZhvBgxqiFfBEO/CJ7ZxkNPcUbWBwn5DJw4KSsJHcHPCTLLDuQxpLkiMLbAIWJs1wBRVkyAFXT7Sa+AYQjTywNfOD74DNA18I9Ifjpg7Es/3Jj5eKyIEcBgNwhk5L8XMPonMQQcfNhBfRpIfbFbiRskCX5enFyz/07TSN9vGxKwAAAABJRU5ErkJggg==
// @match *://*.chaoxing.com/*
// @match *://*.hlju.edu.cn/*
// @match *://*.ecust.edu.cn/*
// @match *://lms.ouchn.cn/*
// @match *://*.ouchn.cn/*
// @match *://xczxzdbf.moodle.qwbx.ouchn.cn/*
// @match *://study.ouchn.cn/*
// @match *://moodle.syxy.ouchn.cn/*
// @match *://moodle.qwbx.ouchn.cn/*
// @match *://*.tongyi.com/*
// @match *://chat.deepseek.com/*
// @match *://*.zhihuishu.com/*
// @match *://course.ougd.cn/*
// @match *://elearning.bjou.edu.cn/*
// @match *://whkpc.hnqtyq.cn:5678/*
// @match *://www.51xinwei.com/*
// @match *://*.w-ling.cn/*
// @match *://*.edu-edu.com/*
// @match *://xuexi.jsou.cn/*
// @match *://*.icve.com.cn/*
// @match *://zice.cnzx.info/*
// @match *://any.cnzx.info:81/*
// @match *://www.icourse163.org/*
// @match *://*.shou.org.cn/*
// @match *://*.ahjxjy.cn/*
// @match *://*.chinaedu.net/*
// @match *://*.qingshuxuetang.com/*
// @match *://cce.org.uooconline.com/*
// @match *://*.courshare.cn/*
// @match *://*.cep.webtrn.cn/*
// @match *://*.webtrn.cn/*
// @match *://*.cj-edu.com/*
// @match *://*.ytccr.com/*
// @match *://*.exam-cloud.cn/*
// @match *://gdrtvu.exam-cloud.cn/*
// @match *://*.open.ha.cn/*
// @match *://lhycjy.cloudwis.tech/*
// @match *://*.sclecb.cn/*
// @match *://*.web2.superchutou.com/*
// @match *://*.ls365.net/*
// @match *://*.jijiaox.com/*
// @match *://*.wencaischool.net/*
// @match *://sdrz.gxk.yxlearning.com/*
// @match *://*.crjxjy.net/*
// @match *://*.cjnep.net/*
// @match *://*.91huayi.com/*
// @match *://teach.ynou.edu.cn/*
// @match *://*.edu-edu.com.cn/*
// @match *://*.21tb.com/*
// @match *://*.168wangxiao.com/*
// @match *://*.mynep.com/*
// @match *://www.mosoteach.cn/*
// @match *://*.aufe.edu.cn/*
// @match *://*.learnin.com.cn/*
// @match *://*.ouchn.edu.cn/*
// @match *://*.swufe-online.com/*
// @match *://ks.cqsdx.cn/*
// @match *://*.qau.edu.cn/*
// @match *://*.gdufemooc.cn/*
// @match *://*.telfri-edu.com/*
// @match *://www.beeline-ai.com/*
// @match *://*.wxic.edu.cn/*
// @match *://*.yxbyun.com/*
// @match *://*.wdjycj.com/*
// @match *://*.hbcjpt.com/*
// @match *://*.csmu.edu.cn/*
// @match *://*.ketangx.net/*
// @match *://*.cnzx.info/*
// @match *://www.asklib.com/*
// @match *://*.xust.edu.cn/*
// @match *://*.whut.edu.cn/*
// @match *://*.lut.edu.cn/*
// @match *://*.wwwwsoft.com/*
// @match *://*.dufe.edu.cn/*
// @match *://*.lygtc.edu.cn/*
// @match *://*.iwdjy.com/*
// @match *://*.jijiaool.com/*
// @match *://lms.cjzx.hblll.com/*
// @match *://*.ouc-online.com.cn/*
// @match *://*.lsedu.vip/*
// @match *://*.jxjypt.cn/*
// @match *://*.jsnu.edu.cn/*
// @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/vue/3.4.27/vue.global.min.js
// @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/vue-demi/0.14.6/index.iife.js
// @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
// @require https://fastly.jsdelivr.net/npm/@iconify/vue@5.0.0/dist/iconify.js
// @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/jquery/3.6.0/jquery.min.js
// @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/dompurify/3.1.6/purify.min.js
// @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/crypto-js/4.2.0/crypto-js.min.js
// @require https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/pinia/2.2.4/pinia.iife.prod.js
// @connect 127.0.0.1
// @connect icodef.com
// @connect muketool.com
// @connect wk66.top
// @connect zhihuishu.com
// @connect greasyfork.org
// @connect chaoxing.com
// @connect shou.org.cn
// @connect jsdelivr.net
// @connect jsdmirror.cn
// @connect gitee.com
// @connect vxo.im
// @connect zeroai.chat
// @connect forestpolice.org
// @connect scriptcat.org
// @connect api.github.com
// @connect aiask.site
// @connect api.deepseek.com
// @connect dashscope.aliyuncs.com
// @connect open.bigmodel.cn
// @connect qianfan.baidubce.com
// @connect ark.cn-beijing.volces.com
// @connect api.hunyuan.cloud.tencent.com
// @connect api.longcat.chat
// @connect api.moonshot.ai
// @connect api.siliconflow.cn
// @connect api.openai.com
// @connect api.anthropic.com
// @connect generativelanguage.googleapis.com
// @connect openrouter.ai
// @connect api.groq.com
// @connect api.together.ai
// @connect api.mistral.ai
// @grant GM.xmlHttpRequest
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_info
// @grant GM_listValues
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
// hello
(function (vue, vue$1, z, pinia, F, N) {
'use strict';
var e = Object.defineProperty, __publicField = (t, a, n) => ((t, a, n) => a in t ? e(t, a, {
enumerable: true,
configurable: true,
writable: true,
value: n
}) : t[a] = n)(t, "symbol" != typeof a ? a + "" : a, n);
var D = (() => "undefined" != typeof GM_deleteValue ? GM_deleteValue : void 0)(), R = (() => "undefined" != typeof GM_getValue ? GM_getValue : void 0)(), B = (() => "undefined" != typeof GM_info ? GM_info : void 0)(), V = (() => "undefined" != typeof GM_listValues ? GM_listValues : void 0)(), G = (() => "undefined" != typeof GM_setValue ? GM_setValue : void 0)(), K = (() => "undefined" != typeof GM_xmlhttpRequest ? GM_xmlhttpRequest : void 0)(), W = (() => "undefined" != typeof unsafeWindow ? unsafeWindow : void 0)();
const Q = "AiAsk_";
class Cache {
static set(e, t, a = 0) {
e = Q + e;
const n = {
value: t,
expire: a > 0 ? Date.now() + 1e3 * a : 0
};
return G(e, n), R(e);
}
static get(e, t = null) {
const a = R(e = Q + e);
return a && a.expire && a.expire < Date.now() ? (D(e), t) : a ? a.value : t;
}
static match(e) {
return e = Q + e, V().filter((t => t.startsWith(e)));
}
static matchGet(e) {
const t = Q + e;
let a = V().filter((e => e.startsWith(t))).map((e => function(e, t, a) {
if (t && t.expire && t.expire < Date.now()) return a(e), null;
const n = t ? t.value : null;
return n && (n.key = e.replace("AiAsk_", "")), n;
}(e, R(e, {
value: null,
expire: 0
}), D))).filter((e => null !== e));
return a.sort(((e, t) => (t.createTime || 0) - (e.createTime || 0))), a;
}
static remove(e) {
D(Q + e);
}
static clear() {
V().filter((e => e.startsWith(Q))).forEach(D);
}
static matchRemove(e) {
e = Q + e, V().filter((t => t.startsWith(e))).forEach(D);
}
}
let J = null;
function log$1(...e) {}
const addLog = (e, t = "info") => {
try {
const a = null == J ? void 0 : J(), n = (new Date).toLocaleString();
null == a || a.addLog({
time: n,
type: t,
content: e
}), a || console.log(e);
} catch (a) {
console.log(e);
}
}, Y = "aah-notice-global-style", X = `\n#${Y} {}\n#aah-notice-container {\n position: fixed;\n top: 20px;\n right: 20px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n z-index: 2147483647;\n pointer-events: none;\n width: min(390px, calc(100vw - 32px));\n}\n.aah-notice {\n display: grid;\n grid-template-columns: 7px 40px minmax(0, 1fr);\n align-items: start;\n width: 100%;\n min-height: 74px;\n border: 1px solid rgba(15, 23, 42, 0.1);\n border-radius: 10px;\n background: #ffffff;\n box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22), 0 4px 14px rgba(15, 23, 42, 0.1);\n color: #111827;\n font-size: 13px;\n line-height: 1.5;\n pointer-events: auto;\n transform: translateX(0);\n opacity: 1;\n animation: aah-notice-enter 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);\n transition: opacity 0.2s ease, transform 0.2s ease;\n overflow: hidden;\n}\n.aah-notice-bar {\n width: 100%;\n height: 100%;\n background: var(--aah-notice-accent);\n}\n.aah-notice-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n margin: 14px 0 0 12px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: var(--aah-notice-soft);\n color: var(--aah-notice-accent-dark);\n font-weight: 900;\n font-size: 15px;\n line-height: 1;\n}\n.aah-notice-body {\n min-width: 0;\n padding: 12px 14px 13px 5px;\n}\n.aah-notice-title {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 5px;\n color: #0f172a;\n font-size: 14px;\n font-weight: 800;\n line-height: 1.3;\n}\n.aah-notice-type {\n display: inline-flex;\n align-items: center;\n border-radius: 999px;\n padding: 2px 7px;\n background: var(--aah-notice-soft);\n color: var(--aah-notice-accent-dark);\n font-size: 11px;\n font-weight: 800;\n}\n.aah-notice-content {\n min-width: 0;\n color: #475569;\n overflow-wrap: anywhere;\n}\n.aah-notice-content p {\n margin: 0 0 6px;\n}\n.aah-notice-content p:last-child {\n margin-bottom: 0;\n}\n.aah-notice-content strong {\n color: #0f172a;\n}\n.aah-notice-content a {\n display: inline-flex;\n align-items: center;\n margin-top: 8px;\n border-radius: 7px;\n padding: 6px 9px;\n background: #eff6ff;\n color: #1d4ed8;\n font-weight: 800;\n text-decoration: none;\n}\n.aah-notice-content a:hover {\n text-decoration: underline;\n}\n.aah-notice-success {\n --aah-notice-accent: #16a34a;\n --aah-notice-accent-dark: #15803d;\n --aah-notice-soft: #dcfce7;\n}\n.aah-notice-error {\n --aah-notice-accent: #dc2626;\n --aah-notice-accent-dark: #b91c1c;\n --aah-notice-soft: #fee2e2;\n}\n.aah-notice-warning {\n --aah-notice-accent: #f97316;\n --aah-notice-accent-dark: #c2410c;\n --aah-notice-soft: #ffedd5;\n}\n.aah-notice-info {\n --aah-notice-accent: #2563eb;\n --aah-notice-accent-dark: #1d4ed8;\n --aah-notice-soft: #dbeafe;\n}\n.aah-notice.hide {\n opacity: 0;\n transform: translateX(18px);\n}\n@keyframes aah-notice-enter {\n from {\n opacity: 0;\n transform: translateX(18px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}`, Z = {
success: "\u2713",
error: "!",
warning: "!",
info: "i"
}, ee = {
success: "\u64cd\u4f5c\u6210\u529f",
error: "\u64cd\u4f5c\u5931\u8d25",
warning: "\u8bf7\u6ce8\u610f",
info: "\u63d0\u793a"
}, te = {
success: "\u6210\u529f",
error: "\u9519\u8bef",
warning: "\u8b66\u544a",
info: "\u4fe1\u606f"
};
function msg(e, t = "info") {
try {
if (!document.getElementById(Y)) {
const e = document.createElement("style");
e.id = Y, e.textContent = X, document.head.appendChild(e);
}
const a = "aah-notice-container";
let n = document.getElementById(a);
n || (n = document.createElement("div"), n.id = a, document.body.appendChild(n));
const r = document.createElement("div");
r.className = `aah-notice aah-notice-${t}`;
const s = document.createElement("span");
s.className = "aah-notice-bar";
const i = document.createElement("span");
i.className = "aah-notice-icon", i.textContent = Z[t] || Z.info;
const o = document.createElement("div");
o.className = "aah-notice-body";
const l = document.createElement("div");
l.className = "aah-notice-title", l.appendChild(document.createTextNode(ee[t] || ee.info));
const c = document.createElement("span");
c.className = "aah-notice-type", c.textContent = te[t] || te.info, l.appendChild(c);
const p = document.createElement("div");
p.className = "aah-notice-content", p.innerHTML = z.sanitize(e), o.appendChild(l),
o.appendChild(p), r.appendChild(s), r.appendChild(i), r.appendChild(o), n.appendChild(r),
setTimeout((() => {
r.classList.add("hide"), setTimeout((() => r.remove()), 220);
}), 2800), addLog(e, t);
} catch (a) {
addLog(`\u6d88\u606f\u901a\u77e5\u5931\u8d25\u3010${e}\u3011`, "error");
}
}
async function encrypt(e = "", t = "asdgdfghfghfghfg", a = "1234567890123456") {
try {
if (!e) return "";
if (t = t.substring(0, 16), a = a.substring(0, 16), !window.crypto || !window.crypto.subtle) {
const n = F.enc.Utf8.parse(t), r = F.enc.Utf8.parse(a);
return F.AES.encrypt(e, n, {
iv: r,
mode: F.mode.CBC,
padding: F.pad.Pkcs7
}).toString();
}
const r = new TextEncoder, s = r.encode(e), i = r.encode(t), o = r.encode(a), l = await crypto.subtle.importKey("raw", i, {
name: "AES-CBC"
}, !1, [ "encrypt" ]), c = await crypto.subtle.encrypt({
name: "AES-CBC",
iv: o
}, l, s), p = new Uint8Array(c), u = 1024;
let d, m = "";
for (let e = 0; e < p.length; e += u) {
const t = p.slice(e, Math.min(e + u, p.length));
m += String.fromCharCode.apply(null, Array.from(t));
}
try {
d = btoa(m);
} catch (n) {
d = m.split("").map((e => ("0" + e.charCodeAt(0).toString(16)).slice(-2))).join("");
}
return d;
} catch (r) {
return addLog(`\u52a0\u5bc6\u5f02\u5e38: ${r instanceof Error ? r.message : "\u672a\u77e5\u9519\u8bef"}`, "error"),
"";
}
}
async function decrypt(e = "", t = "asdgdfghfghfghfg", a = "1234567890123456") {
try {
if (!e) return "";
if (t = t.substring(0, 16), a = a.substring(0, 16), !window.crypto || !window.crypto.subtle) {
const n = F.enc.Utf8.parse(t), r = F.enc.Utf8.parse(a);
return F.AES.decrypt(e, n, {
iv: r,
mode: F.mode.CBC,
padding: F.pad.Pkcs7
}).toString(F.enc.Utf8);
}
/^[A-Za-z0-9+/]*={0,2}$/.test(e);
const r = new TextEncoder, s = r.encode(t), i = r.encode(a);
let o;
try {
o = atob(e);
} catch (n) {
throw new Error("Base64 \u89e3\u7801\u5931\u8d25\uff0c\u6570\u636e\u683c\u5f0f\u4e0d\u6b63\u786e");
}
const l = new Uint8Array(o.length);
for (let e = 0; e < o.length; e++) l[e] = o.charCodeAt(e);
if (l.length % 16 != 0) throw new Error("\u52a0\u5bc6\u6570\u636e\u957f\u5ea6\u4e0d\u6b63\u786e\uff0c\u4e0d\u662f16\u7684\u500d\u6570");
const c = await crypto.subtle.importKey("raw", s, {
name: "AES-CBC"
}, !1, [ "decrypt" ]), p = await crypto.subtle.decrypt({
name: "AES-CBC",
iv: i
}, c, l);
return new TextDecoder("utf-8", {
fatal: !0
}).decode(p);
} catch (r) {
return addLog(`\u89e3\u5bc6\u5f02\u5e38: ${r instanceof Error ? r.message : "\u672a\u77e5\u9519\u8bef"}`, "error"),
"";
}
}
function md5(e) {
return F.MD5(e).toString();
}
function somd5(e) {
return md5(e);
}
const isPlainObject$1 = e => "object" == typeof e && null !== e && !Array.isArray(e), flattenForSignature = (e, t = "") => {
const a = [];
return Object.keys(e).sort().forEach((n => {
if (!t && "html" === n) return;
const r = t ? `${t}.${n}` : n, s = e[n];
(e => null == e || !(!Array.isArray(e) || 0 !== e.length) || !(!isPlainObject$1(e) || 0 !== Object.keys(e).length))(s) || (Array.isArray(s) ? a.push(`${r}=${(e => e.every((e => "object" != typeof e)) ? [ ...e ].sort().join(",") : JSON.stringify(e))(s)}`) : isPlainObject$1(s) ? a.push(...flattenForSignature(s, r)) : a.push(`${r}=${String(s)}`));
})), a;
};
function get_t(e = {}) {
return md5(flattenForSignature(e).join("&"));
}
const ae = {
"\u5355\u9009\u9898": "0",
"\u591a\u9009\u9898": "1",
"\u586b\u7a7a\u9898": "2",
"\u5224\u65ad\u9898": "3",
"\u7b80\u7b54\u9898": "4",
"\u95ee\u7b54\u9898": "4",
"\u540d\u8bcd\u89e3\u91ca": "5",
"\u8bba\u8ff0\u9898": "6",
"\u8ba1\u7b97\u9898": "7",
"\u5206\u5f55\u9898": "9",
"\u8d44\u6599\u9898": "10",
"\u8fde\u7ebf\u9898": "11",
"\u5339\u914d\u9898": "11",
"\u6392\u5e8f\u9898": "13",
"\u5b8c\u578b\u586b\u7a7a": "14",
"\u5b8c\u5f62\u586b\u7a7a\u9898": "14",
"\u9605\u8bfb\u7406\u89e3": "15",
"\u7a0b\u5e8f\u9898": "17",
"\u53e3\u8bed\u9898": "18",
"\u542c\u529b\u9898": "19",
"\u5171\u7528\u9009\u9879\u9898": "20",
"\u6d4b\u8bc4\u9898": "21",
"\u949f\u8868\u9898": "23",
"\u9009\u8bcd\u586b\u7a7a": "24",
"\u9009\u505a\u9898": "25",
"\u5176\u5b83": "8"
}, ne = function(e) {
let t = "";
for (;t.length < e; t += Math.random().toString(36).substring(2)) ;
return t.substring(0, e);
}(9) + "_", re = B;
W.ksv = md5(re.script.author + re.script.name.replace(/server:/, "").trim());
const se = {
home: {
page: "overview",
subPage: ""
},
Base: {
page: "system",
subPage: "settings"
},
question: {
page: "library",
subPage: "manage"
},
preview: {
page: "library",
subPage: "preview"
},
questionTool: {
page: "library",
subPage: "tool"
},
log: {
page: "system",
subPage: "logs"
},
user: {
page: "system",
subPage: "account"
}
};
function resolveNextPage(e, t) {
return void 0 !== se[e] ? se[e] : {
page: e,
subPage: t ?? ""
};
}
function normalizeDialogWidth(e) {
const t = "number" == typeof e ? e : Number(e);
return Number.isFinite(t) ? Math.max(480, Math.min(1200, Math.round(t))) : 480;
}
const ie = {
debug: true,
searchApi: [],
defaultShowFloat: false,
showFloat: false,
showBoard: true,
checkUpdate: true,
hideFloat: false,
alert: "\u70b9\u6211\u6709\u60ca\u559c",
alertBubble: true,
iframe: false,
key: "",
gpt: [],
gptIndex: 0,
askGpt: false,
hotkey: "Ctrl+Shift+H",
hotkeyEnabled: true,
theme: "auto",
page: "overview",
subPage: "",
dialogWidth: 480
};
const oe = function() {
const e = Cache.get("app") || {}, t = {
...ie
};
for (const [a, n] of Object.entries(e)) "gpt" !== a && "alert" !== a && void 0 !== n && (t[a] = n);
if (e.gpt) {
const a = new Map;
e.gpt.forEach((e => {
a.set(e.name, e.key);
})), t.gpt = ie.gpt.map((e => ({
...e,
key: a.get(e.name) || ""
})));
}
return t.alert = ie.alert, t.gptIndex >= t.gpt.length && (t.gptIndex = 0), t.dialogWidth = normalizeDialogWidth(t.dialogWidth),
t;
}();
function getApp() {
return Cache.get("app") || ie;
}
!function(e) {
const t = {
...Cache.get("app"),
...e
};
Cache.set("app", t);
}(oe);
const le = {
display: [ {
type: "switch",
label: "\u9ed8\u8ba4\u663e\u793a\u60ac\u6d6e",
name: "defaultShowFloat",
value: oe.defaultShowFloat,
desc: "\u6253\u5f00\u9875\u9762\u65f6\u662f\u5426\u663e\u793a\u60ac\u6d6e\u7a97",
options: []
}, {
type: "switch",
label: "\u5f3a\u5236\u9690\u85cf",
name: "hideFloat",
value: oe.hideFloat,
desc: "\u4ec5\u70ed\u952e\u6216\u70b9\u51fb\u53f3\u4e0b\u89d2\u56fe\u7247\u624d\u663e\u793a\u60ac\u6d6e\u7a97",
options: []
}, {
type: "switch",
label: "\u6c14\u6ce1\u63d0\u793a",
name: "alertBubble",
value: oe.alertBubble,
desc: "\u53f3\u4e0b\u89d2\u6c14\u6ce1\u63d0\u793a\u662f\u5426\u5f00\u542f",
options: []
} ],
system: [ {
type: "switch",
label: "\u68c0\u6d4b\u66f4\u65b0",
name: "checkUpdate",
value: oe.checkUpdate,
desc: "\u6253\u5f00\u9875\u9762\u65f6\u662f\u5426\u68c0\u6d4b\u66f4\u65b0",
options: []
}, {
type: "switch",
label: "iframe\u4f18\u5316(\u6d4b\u8bd5)",
name: "iframe",
value: oe.iframe,
desc: "\u9488\u5bf9\u6df1\u5ea6\u5d4c\u5957\u7f51\u9875\u7684\u4f18\u5316\uff0c\u9002\u5408\u5355\u4efb\u52a1\u9875\u4f7f\u7528\uff0c\u591a\u4efb\u52a1\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5f39\u7a97\u8fc7\u591a\u3002\n \u6ce8\u610f\uff1a\u8be5\u529f\u80fd\u4e3a\u6d4b\u8bd5\u529f\u80fd\uff0c\u53ef\u80fd\u5b58\u5728\u672a\u77e5\u95ee\u9898\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528",
options: []
} ],
ai: [],
hotkey: [ {
type: "switch",
label: "\u542f\u7528\u5feb\u6377\u952e",
name: "hotkeyEnabled",
value: oe.hotkeyEnabled,
desc: "\u662f\u5426\u542f\u7528\u5feb\u6377\u952e\u663e\u9690\u60ac\u6d6e\u7a97",
options: []
}, {
type: "hotkey",
label: "\u5feb\u6377\u952e\u8bbe\u7f6e",
name: "hotkey",
value: oe.hotkey,
desc: "\u70b9\u51fb\u8f93\u5165\u6846\u540e\u6309\u4e0b\u60f3\u8981\u8bbe\u7f6e\u7684\u5feb\u6377\u952e\u7ec4\u5408\uff08\u652f\u6301Ctrl\u3001Shift\u3001Alt\u7ec4\u5408\u952e\uff09",
options: []
} ]
}, ce = pinia.defineStore("app", {
state: () => {
const e = resolveNextPage(oe.page, oe.subPage);
return {
app: oe,
script: re.script,
page: e.page,
subPage: e.subPage,
ConfigInput: le,
activeSettingSection: "",
logs: [ {
time: (new Date).toLocaleString(),
type: "success",
content: "\u521d\u59cb\u5316\u65e5\u5fd7\u6210\u529f"
} ]
};
},
actions: {
setConfig(e) {
const t = {
...this.app,
...e
};
"dialogWidth" in e && (t.dialogWidth = normalizeDialogWidth(e.dialogWidth)), this.app = t,
Cache.set("app", this.app);
},
setPage(e, t) {
const a = resolveNextPage(e, t);
this.page = a.page, this.subPage = a.subPage, this.app = {
...this.app,
page: a.page,
subPage: a.subPage
}, Cache.set("app", this.app);
},
setActiveSettingSection(e) {
this.activeSettingSection = e;
},
setDialogWidth(e) {
const t = normalizeDialogWidth(e);
this.app.dialogWidth = t, Cache.set("app", this.app);
},
addLog(e) {
this.logs.length > 100 && this.logs.shift(), this.logs.push(e);
}
}
}), pe = Cache.get("apiList", []), ue = [ {
name: "\u4e00\u4e4b\u9898\u5e93",
url: "http://cx.icodef.com/wyn-nb?v=4",
method: "POST",
type: "json",
headers: {},
params: [],
data: {
question: "$question",
options: "$options",
type: "$type"
},
response: {
type: "field",
value: "data"
},
weight: 0
} ], de = pinia.defineStore("api", {
state: () => ({
apiList: pe,
defApiList: ue
}),
actions: {},
getters: {
getApiList() {
return this.apiList.forEach(((e, t) => {
e.name === this.defApiList[t].name && (this.defApiList[t] = e);
})), this.apiList.concat(this.defApiList);
}
}
}), getImageSrc = e => {
const t = String(e).match(/(?:^|\s)src\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i);
return t && (t[1] || t[2] || t[3]) || "";
}, stripImageSrcQuery = e => e.replace(/[?#].*$/, ""), cleanQuestionText = e => String(e ?? "").replace(/
]*)>/gi, ((e, t) => getImageSrc(t))).replace(/
/gi, "\n").replace(/<(\/)?(p|div).*?>/gi, "\n").replace(/<[^>]+>/g, "").replace(/[\t\r\xa0]/g, " ").replace(/[\u2000-\u200a]/g, " ").replace(/ {2,}/g, " ").replace(/\n{2,}/g, "\n").trim(), cleanQuestionTextWithImageHtml = e => {
const t = [];
return String(e ?? "").replace(/
]*)>/gi, ((e, a) => {
const n = getImageSrc(a);
if (!n) return "";
const r = `\0AAH_IMAGE_PLACEHOLDER_${t.length}\0`;
return t.push(`
/g, ">"))(n)}">`),
r;
})).replace(/
/gi, "\n").replace(/<(\/)?(p|div).*?>/gi, "\n").replace(/<[^>]+>/g, "").replace(/\u0000AAH_IMAGE_PLACEHOLDER_(\d+)\u0000/g, ((e, a) => t[Number(a)] || "")).replace(/[\t\r\xa0]/g, " ").replace(/[\u2000-\u200a]/g, " ").replace(/ {2,}/g, " ").replace(/\n{2,}/g, "\n").trim();
}, cleanQuestionTitle = e => e.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim(), normalizeComparableText = e => (e => {
if (/^[+-]?\d+(\.\d+)?$/.test(e)) return e;
const t = e.replace(/\s+/g, "");
return t.replace(new RegExp("\\p{P}", "gu"), "") || t;
})((e => String(e ?? "").replace(/
]*)>/gi, ((e, t) => stripImageSrcQuery(getImageSrc(t)))).replace(/<[^>]*>/g, ""))(e)).trim(), removeOptionPrefixes = (e, {removeBareLetter: t = false} = {}) => e.map(((e, a) => {
const n = String.fromCharCode(65 + a), r = t ? `^${n}(?:\\s*[.\u3001\uff0e)\uff09:\uff1a]\\s*|\\s+)?` : `^${n}\\s*[.\u3001\uff0e)\uff09:\uff1a]\\s*`;
return e.replace(new RegExp(r), "").trim();
})), normalizeHashText = e => String(e ?? "").replace(/
]*)>/gi, ((e, t) => {
const a = getImageSrc(t);
return a ? `
` : "";
})), questionHash = (e, t, a, n = true) => {
if (("15" === e || 15 === e) && Array.isArray(a) && a.length > 0 && "object" == typeof a[0]) {
const r = a.map((e => {
if (e.question && e.options) {
const t = Array.from(e.options).map(normalizeHashText);
n && t.sort();
const a = t.join("");
return `${e.type || "0"}${normalizeHashText(e.question)}${a}`;
}
return "";
})).filter(Boolean);
let s = `${e}${normalizeHashText(t)}${r.join("")}`;
return s = s.replace(/\s/g, ""), md5(s);
}
const r = Array.from(a).map(normalizeHashText);
n && r.sort();
const s = r.join("");
let i = `${e}${normalizeHashText(t)}${s}`;
return i = i.replace(/\s/g, ""), md5(i);
}, sanitizeHtml = (e, t, a) => {
const n = z.sanitize;
return "function" == typeof n ? n(e, {
ALLOWED_TAGS: t,
ALLOWED_ATTR: a,
ALLOW_DATA_ATTR: false,
KEEP_CONTENT: true
}) : ((e, t, a) => {
const n = new Set(t), r = new Set(a);
return e.replace(/