// ==UserScript== // @name 爱问答助手 // @namespace aiask/askHelper // @version 2.4.10 // @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 *://chatglm.cn/* // @match *://xinghuo.xfyun.cn/* // @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/* // @require https://lib.baomitu.com/vue/3.4.27/vue.global.min.js // @require https://lib.baomitu.com/vue-demi/0.14.6/index.iife.js // @require data:application/javascript,%3Bwindow.Vue%3DVue%3B // @require https://cdn.jsdelivr.net/npm/@iconify/vue@5.0.0/dist/iconify.js // @require https://lib.baomitu.com/jquery/3.6.0/jquery.min.js // @require https://lib.baomitu.com/dompurify/3.1.6/purify.min.js // @require https://lib.baomitu.com/crypto-js/4.2.0/crypto-js.min.js // @connect 127.0.0.1 // @connect icodef.com // @connect muketool.com // @connect wk66.top // @connect 82.157.105.20 // @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 aiask.site // @connect * // @grant GM.xmlHttpRequest // @grant GM_addStyle // @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 (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const a=document.createElement("style");a.textContent=e,document.head.append(a)})(" .modal-panel-large[data-v-9e0b5f5c]{width:90vw;max-width:1000px;max-height:90vh;overflow-y:auto}.form-section[data-v-9e0b5f5c]{margin-bottom:32px;padding:20px;background:#f8fafc;border-radius:8px;border:1px solid #e2e8f0}.section-header[data-v-9e0b5f5c]{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #e2e8f0}.section-icon[data-v-9e0b5f5c]{font-size:20px}.section-header h4[data-v-9e0b5f5c]{margin:0;color:#374151;font-weight:600}.sub-questions-editor[data-v-9e0b5f5c]{display:flex;flex-direction:column;gap:24px}.sub-question-editor[data-v-9e0b5f5c]{background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:20px}.sub-question-header[data-v-9e0b5f5c]{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #f1f5f9}.sub-question-number[data-v-9e0b5f5c]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:#3b82f6;color:#fff;border-radius:50%;font-size:14px;font-weight:600}.base-select-small[data-v-9e0b5f5c]{padding:6px 12px;font-size:14px}.btn-small[data-v-9e0b5f5c]{padding:6px 12px;font-size:12px}.form-row[data-v-9e0b5f5c]{margin-bottom:16px}.form-row label[data-v-9e0b5f5c]{display:block;margin-bottom:6px;font-weight:500;color:#374151}.base-input[data-v-9e0b5f5c]{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;transition:border-color .2s}.base-input[data-v-9e0b5f5c]:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.base-select[data-v-9e0b5f5c]{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;background:#fff}.option-list[data-v-9e0b5f5c],.answer-list[data-v-9e0b5f5c]{display:flex;flex-direction:column;gap:8px}.option-row[data-v-9e0b5f5c],.answer-row[data-v-9e0b5f5c]{display:flex;align-items:center;gap:8px}.option-selector[data-v-9e0b5f5c]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:2px solid #d1d5db;border-radius:50%;background:#fff;color:#6b7280;font-weight:600;cursor:pointer;transition:all .2s}.option-selector[data-v-9e0b5f5c]:hover{border-color:#3b82f6;color:#3b82f6}.option-selector.active[data-v-9e0b5f5c]{background:#3b82f6;border-color:#3b82f6;color:#fff}.flex-grow[data-v-9e0b5f5c]{flex:1}.btn[data-v-9e0b5f5c]{padding:8px 16px;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;border:1px solid transparent}.btn-primary[data-v-9e0b5f5c]{background:#3b82f6;color:#fff}.btn-primary[data-v-9e0b5f5c]:hover{background:#2563eb}.btn-outline[data-v-9e0b5f5c]{background:#fff;border-color:#d1d5db;color:#374151}.btn-outline[data-v-9e0b5f5c]:hover{background:#f9fafb;border-color:#9ca3af}.btn-danger[data-v-9e0b5f5c]{background:#ef4444;color:#fff}.btn-danger[data-v-9e0b5f5c]:hover{background:#dc2626}.btn[data-v-9e0b5f5c]:disabled{opacity:.5;cursor:not-allowed}.modal-mask[data-v-9e0b5f5c]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-panel[data-v-9e0b5f5c]{background:#fff;border-radius:12px;box-shadow:0 20px 25px -5px #0000001a;width:90vw;max-width:600px;max-height:80vh;overflow-y:auto}.modal-header[data-v-9e0b5f5c]{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #e5e7eb}.modal-header h3[data-v-9e0b5f5c]{margin:0;color:#111827;font-weight:600}.modal-close[data-v-9e0b5f5c]{width:32px;height:32px;border:none;background:#f3f4f6;border-radius:50%;color:#6b7280;font-size:18px;cursor:pointer;transition:all .2s}.modal-close[data-v-9e0b5f5c]:hover{background:#e5e7eb;color:#374151}.modal-body[data-v-9e0b5f5c]{padding:24px}.modal-footer[data-v-9e0b5f5c]{display:flex;justify-content:flex-end;gap:12px;padding:20px 24px;border-top:1px solid #e5e7eb;background:#f9fafb}.preview-container[data-v-71cc29f1]{padding:16px;background:#f8f9fa;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;line-height:1.5}.toolbar[data-v-71cc29f1]{display:flex;justify-content:space-between;align-items:center;background:#fff;padding:12px 16px;border-radius:8px;box-shadow:0 2px 4px #0000001a;margin-bottom:16px;gap:16px}.toolbar-left .page-title[data-v-71cc29f1]{margin:0;font-size:16px;font-weight:600;color:#333}.toolbar-right[data-v-71cc29f1]{display:flex;align-items:center;gap:12px}.search-box[data-v-71cc29f1]{position:relative;display:flex;align-items:center}.search-input[data-v-71cc29f1]{width:200px;padding:6px 12px;border:1px solid #ddd;border-radius:4px;font-size:13px;outline:none}.search-input[data-v-71cc29f1]:focus{border-color:#007bff}.clear-btn[data-v-71cc29f1]{position:absolute;right:4px;width:20px;height:20px;border:none;background:#dc3545;color:#fff;border-radius:50%;cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center}.page-size[data-v-71cc29f1]{padding:4px 8px;border:1px solid #ddd;border-radius:4px;font-size:12px;background:#fff}.search-info[data-v-71cc29f1]{background:#e3f2fd;color:#1976d2;padding:8px 12px;border-radius:4px;margin-bottom:12px;font-size:13px}.questions-container[data-v-71cc29f1]{background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;overflow:hidden}.loading[data-v-71cc29f1]{display:flex;align-items:center;justify-content:center;padding:40px;gap:12px;color:#666}.spinner[data-v-71cc29f1]{width:20px;height:20px;border:2px solid #f3f3f3;border-top:2px solid #007bff;border-radius:50%;animation:spin-71cc29f1 1s linear infinite}@keyframes spin-71cc29f1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.empty[data-v-71cc29f1]{text-align:center;padding:40px 20px;color:#666}.empty-icon[data-v-71cc29f1]{font-size:48px;margin-bottom:12px}.empty p[data-v-71cc29f1]{margin:0 0 16px}.btn-clear[data-v-71cc29f1]{background:#007bff;color:#fff;border:none;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:13px}.btn-clear[data-v-71cc29f1]:hover{background:#0056b3}.questions-list[data-v-71cc29f1]{display:flex;flex-direction:column}.question-item[data-v-71cc29f1]{border-bottom:1px solid #eee;padding:16px}.question-item[data-v-71cc29f1]:last-child{border-bottom:none}.question-header[data-v-71cc29f1]{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.question-info[data-v-71cc29f1]{display:flex;align-items:center;gap:8px}.question-num[data-v-71cc29f1]{background:#007bff;color:#fff;padding:2px 8px;border-radius:12px;font-size:12px;font-weight:500;min-width:24px;text-align:center}.question-type[data-v-71cc29f1]{background:#f8f9fa;color:#495057;padding:2px 8px;border-radius:12px;font-size:11px;border:1px solid #dee2e6}.question-actions[data-v-71cc29f1]{display:flex;gap:4px}.btn-edit[data-v-71cc29f1],.btn-delete[data-v-71cc29f1]{width:28px;height:28px;border:none;border-radius:4px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center}.btn-edit[data-v-71cc29f1]{background:#e3f2fd;color:#1976d2}.btn-edit[data-v-71cc29f1]:hover{background:#bbdefb}.btn-delete[data-v-71cc29f1]{background:#ffebee;color:#d32f2f}.btn-delete[data-v-71cc29f1]:hover{background:#ffcdd2}.question-content[data-v-71cc29f1]{line-height:1.6}.question-text[data-v-71cc29f1]{margin-bottom:12px;color:#333}.question-text img[data-v-71cc29f1]{max-width:100%;height:auto;border-radius:4px;margin:8px 0}.options[data-v-71cc29f1]{margin-bottom:12px}.reading-type[data-v-71cc29f1]{background:#f8f9fa;border:1px solid #dee2e6;border-radius:6px;padding:12px}.reading-title[data-v-71cc29f1]{font-weight:600;color:#495057;margin-bottom:8px;font-size:13px}.sub-questions[data-v-71cc29f1]{display:flex;flex-direction:column;gap:8px}.sub-question[data-v-71cc29f1]{background:#fff;padding:8px;border-radius:4px;border:1px solid #e9ecef;font-size:13px}.sub-num[data-v-71cc29f1]{color:#007bff;font-weight:600;margin-right:4px}.sub-type[data-v-71cc29f1]{color:#6c757d;font-size:11px;margin-right:8px}.sub-text[data-v-71cc29f1]{color:#495057;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.more-subs[data-v-71cc29f1]{text-align:center;color:#6c757d;font-size:12px;font-style:italic;padding:4px}.complex-type[data-v-71cc29f1]{background:#fff3cd;color:#856404;padding:8px 12px;border-radius:4px;font-size:13px;border:1px solid #ffeaa7}.normal-options[data-v-71cc29f1]{display:flex;flex-direction:column;gap:6px}.option[data-v-71cc29f1]{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:4px;background:#f8f9fa;position:relative}.option.correct[data-v-71cc29f1]{background:#d4edda;border:1px solid #c3e6cb}.option-label[data-v-71cc29f1]{color:#495057;font-weight:500;min-width:20px}.option-text[data-v-71cc29f1]{flex:1;color:#333}.correct-mark[data-v-71cc29f1]{color:#28a745;font-weight:700;font-size:16px}.answer[data-v-71cc29f1]{background:#d4edda;border:1px solid #c3e6cb;border-radius:4px;padding:8px 12px;margin-top:8px}.answer-label[data-v-71cc29f1]{color:#155724;font-weight:600;margin-right:8px}.answer-list[data-v-71cc29f1]{display:inline-flex;flex-wrap:wrap;gap:4px}.answer-item[data-v-71cc29f1]{background:#28a745;color:#fff;padding:2px 8px;border-radius:12px;font-size:12px}.answer-text[data-v-71cc29f1]{color:#155724;display:inline}.no-answer[data-v-71cc29f1]{color:#6c757d;font-style:italic}.pagination[data-v-71cc29f1]{display:flex;justify-content:center;align-items:center;gap:12px;padding:16px;background:#fff;border-top:1px solid #eee;margin-top:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.page-btn[data-v-71cc29f1]{background:#f8f9fa;border:1px solid #dee2e6;color:#495057;padding:6px 12px;border-radius:4px;cursor:pointer;font-size:13px}.page-btn[data-v-71cc29f1]:hover:not(:disabled){background:#e9ecef}.page-btn[data-v-71cc29f1]:disabled{opacity:.5;cursor:not-allowed}.page-info[data-v-71cc29f1]{display:flex;align-items:center;gap:4px;color:#495057;font-size:13px}.page-input[data-v-71cc29f1]{width:40px;text-align:center;border:1px solid #dee2e6;border-radius:4px;padding:2px 4px;font-size:13px}.total-info[data-v-71cc29f1]{color:#6c757d;font-size:12px}.highlight[data-v-71cc29f1]{background:#fff3cd;color:#856404;padding:1px 2px;border-radius:2px}@media (max-width: 600px){.toolbar[data-v-71cc29f1]{flex-direction:column;align-items:stretch;gap:12px}.toolbar-right[data-v-71cc29f1]{justify-content:space-between}.search-input[data-v-71cc29f1]{width:150px}.question-header[data-v-71cc29f1]{flex-direction:column;align-items:flex-start;gap:8px}.pagination[data-v-71cc29f1]{flex-wrap:wrap;gap:8px}} "); (function (vue, vue$1, V, J, K) { 'use strict'; var e = Object.defineProperty, __publicField = (t, n, a) => ((t, n, a) => n in t ? e(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a)(t, "symbol" != typeof n ? n + "" : n, a); let W; const setActivePinia = e => W = e, Q = Symbol(); function isPlainObject(e) { return e && "object" == typeof e && "[object Object]" === Object.prototype.toString.call(e) && "function" != typeof e.toJSON; } var Y, X; (X = Y || (Y = {})).direct = "direct", X.patchObject = "patch object", X.patchFunction = "patch function"; const noop = () => {}; function addSubscription(e, t, n, a = noop) { e.push(t); const removeSubscription = () => { const n = e.indexOf(t); n > -1 && (e.splice(n, 1), a()); }; return !n && vue.getCurrentScope() && vue.onScopeDispose(removeSubscription), removeSubscription; } function triggerSubscriptions(e, ...t) { e.slice().forEach((e => { e(...t); })); } const fallbackRunWithContext = e => e(), Z = Symbol(), ee = Symbol(); function mergeReactiveObjects(e, t) { e instanceof Map && t instanceof Map ? t.forEach(((t, n) => e.set(n, t))) : e instanceof Set && t instanceof Set && t.forEach(e.add, e); for (const n in t) { if (!t.hasOwnProperty(n)) continue; const a = t[n], i = e[n]; isPlainObject(i) && isPlainObject(a) && e.hasOwnProperty(n) && !vue.isRef(a) && !vue.isReactive(a) ? e[n] = mergeReactiveObjects(i, a) : e[n] = a; } return e; } const te = Symbol(); const {assign: ne} = Object; function createSetupStore(e, a, i = {}, o, d, u) { let m; const f = ne({ actions: {} }, i), g = { deep: !0 }; let y, v, b, x = [], w = []; const k = o.state.value[e]; let _; function $patch(t) { let n; y = v = !1, "function" == typeof t ? (t(o.state.value[e]), n = { type: Y.patchFunction, storeId: e, events: b }) : (mergeReactiveObjects(o.state.value[e], t), n = { type: Y.patchObject, payload: t, storeId: e, events: b }); const a = _ = Symbol(); vue.nextTick().then((() => { _ === a && (y = !0); })), v = !0, triggerSubscriptions(x, n, o.state.value[e]); } u || k || (o.state.value[e] = {}), vue.ref({}); const q = u ? function() { const {state: e} = i, t = e ? e() : {}; this.$patch((e => { ne(e, t); })); } : noop; const action = (t, n = "") => { if (Z in t) return t[ee] = n, t; const wrappedAction = function() { setActivePinia(o); const n = Array.from(arguments), a = [], i = []; let s; triggerSubscriptions(w, { args: n, name: wrappedAction[ee], store: T, after: function(e) { a.push(e); }, onError: function(e) { i.push(e); } }); try { s = t.apply(this && this.$id === e ? this : T, n); } catch (r) { throw triggerSubscriptions(i, r), r; } return s instanceof Promise ? s.then((e => (triggerSubscriptions(a, e), e))).catch((e => (triggerSubscriptions(i, e), Promise.reject(e)))) : (triggerSubscriptions(a, s), s); }; return wrappedAction[Z] = !0, wrappedAction[ee] = n, wrappedAction; }, A = { _p: o, $id: e, $onAction: addSubscription.bind(null, w), $patch: $patch, $reset: q, $subscribe(t, n = {}) { const a = addSubscription(x, t, n.detached, (() => i())), i = m.run((() => vue.watch((() => o.state.value[e]), (a => { ("sync" === n.flush ? v : y) && t({ storeId: e, type: Y.direct, events: b }, a); }), ne({}, g, n)))); return a; }, $dispose: function() { m.stop(), x = [], w = [], o._s.delete(e); } }, T = vue.reactive(A); o._s.set(e, T); const C = (o._a && o._a.runWithContext || fallbackRunWithContext)((() => o._e.run((() => (m = vue.effectScope()).run((() => a({ action: action }))))))); for (const t in C) { const n = C[t]; if (vue.isRef(n) && (!vue.isRef(E = n) || !E.effect) || vue.isReactive(n)) u || (!k || isPlainObject(S = n) && S.hasOwnProperty(te) || (vue.isRef(n) ? n.value = k[t] : mergeReactiveObjects(n, k[t])), o.state.value[e][t] = n); else if ("function" == typeof n) { const e = action(n, t); C[t] = e, f.actions[t] = n; } } var S, E; return ne(T, C), ne(vue.toRaw(T), C), Object.defineProperty(T, "$state", { get: () => o.state.value[e], set: e => { $patch((t => { ne(t, e); })); } }), o._p.forEach((e => { ne(T, m.run((() => e({ store: T, app: o._a, pinia: o, options: f })))); })), k && u && i.hydrate && i.hydrate(T.$state, k), y = !0, v = !0, T; } function defineStore(e, t, n) { let s, r; const l = "function" == typeof t; function useStore(e, n) { const c = vue.hasInjectionContext(); (e = e || (c ? vue.inject(Q, null) : null)) && setActivePinia(e), (e = W)._s.has(s) || (l ? createSetupStore(s, t, r, e) : function(e, t, n) { const {state: i, actions: o, getters: s} = t, r = n.state.value[e]; createSetupStore(e, (function() { r || (n.state.value[e] = i ? i() : {}); const t = vue.toRefs(n.state.value[e]); return ne(t, o, Object.keys(s || {}).reduce(((t, i) => (t[i] = vue.markRaw(vue.computed((() => { setActivePinia(n); const t = n._s.get(e); return s[i].call(t, t); }))), t)), {})); }), t, n, 0, !0); }(s, r, e)); return e._s.get(s); } return "string" == typeof e ? (s = e, r = l ? n : t) : (r = e, s = e.id), useStore.$id = s, useStore; } var ae = (() => "undefined" != typeof GM_deleteValue ? GM_deleteValue : void 0)(), ie = (() => "undefined" != typeof GM_getValue ? GM_getValue : void 0)(), oe = (() => "undefined" != typeof GM_info ? GM_info : void 0)(), se = (() => "undefined" != typeof GM_listValues ? GM_listValues : void 0)(), re = (() => "undefined" != typeof GM_setValue ? GM_setValue : void 0)(), le = (() => "undefined" != typeof GM_xmlhttpRequest ? GM_xmlhttpRequest : void 0)(), ce = (() => "undefined" != typeof unsafeWindow ? unsafeWindow : void 0)(); const pe = "AiAsk_"; class Cache { static set(e, t, n = 0) { e = pe + e; const a = { value: t, expire: n > 0 ? Date.now() + 1e3 * n : 0 }; return re(e, a), ie(e); } static get(e, t = null) { const n = ie(e = pe + e); return n && n.expire && n.expire < Date.now() ? (ae(e), t) : n ? n.value : t; } static match(e) { return e = pe + e, se().filter((t => t.startsWith(e))); } static matchGet(e) { const t = pe + e; let n = se().filter((e => e.startsWith(t))).map((e => { const t = ie(e, { value: null, expire: 0 }).value; return t && (t.key = e.replace(pe, "")), t; })).filter((e => null !== e)); return n.sort(((e, t) => (t.createTime || 0) - (e.createTime || 0))), n; } static remove(e) { ae(pe + e); } static clear() { se().filter((e => e.startsWith(pe))).forEach(ae); } static matchRemove(e) { e = pe + e, se().filter((t => t.startsWith(e))).forEach(ae); } } function getDefaultExportFromCjs(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var de, ue, he = { exports: {} }, me = { exports: {} }; de = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ue = { rotl: function(e, t) { return e << t | e >>> 32 - t; }, rotr: function(e, t) { return e << 32 - t | e >>> t; }, endian: function(e) { if (e.constructor == Number) return 16711935 & ue.rotl(e, 8) | 4278255360 & ue.rotl(e, 24); for (var t = 0; t < e.length; t++) e[t] = ue.endian(e[t]); return e; }, randomBytes: function(e) { for (var t = []; e > 0; e--) t.push(Math.floor(256 * Math.random())); return t; }, bytesToWords: function(e) { for (var t = [], n = 0, a = 0; n < e.length; n++, a += 8) t[a >>> 5] |= e[n] << 24 - a % 32; return t; }, wordsToBytes: function(e) { for (var t = [], n = 0; n < 32 * e.length; n += 8) t.push(e[n >>> 5] >>> 24 - n % 32 & 255); return t; }, bytesToHex: function(e) { for (var t = [], n = 0; n < e.length; n++) t.push((e[n] >>> 4).toString(16)), t.push((15 & e[n]).toString(16)); return t.join(""); }, hexToBytes: function(e) { for (var t = [], n = 0; n < e.length; n += 2) t.push(parseInt(e.substr(n, 2), 16)); return t; }, bytesToBase64: function(e) { for (var t = [], n = 0; n < e.length; n += 3) for (var a = e[n] << 16 | e[n + 1] << 8 | e[n + 2], i = 0; i < 4; i++) 8 * n + 6 * i <= 8 * e.length ? t.push(de.charAt(a >>> 6 * (3 - i) & 63)) : t.push("="); return t.join(""); }, base64ToBytes: function(e) { e = e.replace(/[^A-Z0-9+\/]/gi, ""); for (var t = [], n = 0, a = 0; n < e.length; a = ++n % 4) 0 != a && t.push((de.indexOf(e.charAt(n - 1)) & Math.pow(2, -2 * a + 8) - 1) << 2 * a | de.indexOf(e.charAt(n)) >>> 6 - 2 * a); return t; } }, me.exports = ue; var fe, ge, ye, ve, be, xe = me.exports, we = { utf8: { stringToBytes: function(e) { return we.bin.stringToBytes(unescape(encodeURIComponent(e))); }, bytesToString: function(e) { return decodeURIComponent(escape(we.bin.bytesToString(e))); } }, bin: { stringToBytes: function(e) { for (var t = [], n = 0; n < e.length; n++) t.push(255 & e.charCodeAt(n)); return t; }, bytesToString: function(e) { for (var t = [], n = 0; n < e.length; n++) t.push(String.fromCharCode(e[n])); return t.join(""); } } }, ke = we, isBuffer_1 = function(e) { return null != e && (isBuffer(e) || function(e) { return "function" == typeof e.readFloatLE && "function" == typeof e.slice && isBuffer(e.slice(0, 0)); }(e) || !!e._isBuffer); }; function isBuffer(e) { return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e); } fe = xe, ge = ke.utf8, ye = isBuffer_1, ve = ke.bin, (be = function(e, t) { e.constructor == String ? e = t && "binary" === t.encoding ? ve.stringToBytes(e) : ge.stringToBytes(e) : ye(e) ? e = Array.prototype.slice.call(e, 0) : Array.isArray(e) || e.constructor === Uint8Array || (e = e.toString()); for (var n = fe.bytesToWords(e), a = 8 * e.length, i = 1732584193, o = -271733879, s = -1732584194, r = 271733878, l = 0; l < n.length; l++) n[l] = 16711935 & (n[l] << 8 | n[l] >>> 24) | 4278255360 & (n[l] << 24 | n[l] >>> 8); n[a >>> 5] |= 128 << a % 32, n[14 + (a + 64 >>> 9 << 4)] = a; var c = be._ff, p = be._gg, d = be._hh, u = be._ii; for (l = 0; l < n.length; l += 16) { var h = i, m = o, f = s, g = r; i = c(i, o, s, r, n[l + 0], 7, -680876936), r = c(r, i, o, s, n[l + 1], 12, -389564586), s = c(s, r, i, o, n[l + 2], 17, 606105819), o = c(o, s, r, i, n[l + 3], 22, -1044525330), i = c(i, o, s, r, n[l + 4], 7, -176418897), r = c(r, i, o, s, n[l + 5], 12, 1200080426), s = c(s, r, i, o, n[l + 6], 17, -1473231341), o = c(o, s, r, i, n[l + 7], 22, -45705983), i = c(i, o, s, r, n[l + 8], 7, 1770035416), r = c(r, i, o, s, n[l + 9], 12, -1958414417), s = c(s, r, i, o, n[l + 10], 17, -42063), o = c(o, s, r, i, n[l + 11], 22, -1990404162), i = c(i, o, s, r, n[l + 12], 7, 1804603682), r = c(r, i, o, s, n[l + 13], 12, -40341101), s = c(s, r, i, o, n[l + 14], 17, -1502002290), i = p(i, o = c(o, s, r, i, n[l + 15], 22, 1236535329), s, r, n[l + 1], 5, -165796510), r = p(r, i, o, s, n[l + 6], 9, -1069501632), s = p(s, r, i, o, n[l + 11], 14, 643717713), o = p(o, s, r, i, n[l + 0], 20, -373897302), i = p(i, o, s, r, n[l + 5], 5, -701558691), r = p(r, i, o, s, n[l + 10], 9, 38016083), s = p(s, r, i, o, n[l + 15], 14, -660478335), o = p(o, s, r, i, n[l + 4], 20, -405537848), i = p(i, o, s, r, n[l + 9], 5, 568446438), r = p(r, i, o, s, n[l + 14], 9, -1019803690), s = p(s, r, i, o, n[l + 3], 14, -187363961), o = p(o, s, r, i, n[l + 8], 20, 1163531501), i = p(i, o, s, r, n[l + 13], 5, -1444681467), r = p(r, i, o, s, n[l + 2], 9, -51403784), s = p(s, r, i, o, n[l + 7], 14, 1735328473), i = d(i, o = p(o, s, r, i, n[l + 12], 20, -1926607734), s, r, n[l + 5], 4, -378558), r = d(r, i, o, s, n[l + 8], 11, -2022574463), s = d(s, r, i, o, n[l + 11], 16, 1839030562), o = d(o, s, r, i, n[l + 14], 23, -35309556), i = d(i, o, s, r, n[l + 1], 4, -1530992060), r = d(r, i, o, s, n[l + 4], 11, 1272893353), s = d(s, r, i, o, n[l + 7], 16, -155497632), o = d(o, s, r, i, n[l + 10], 23, -1094730640), i = d(i, o, s, r, n[l + 13], 4, 681279174), r = d(r, i, o, s, n[l + 0], 11, -358537222), s = d(s, r, i, o, n[l + 3], 16, -722521979), o = d(o, s, r, i, n[l + 6], 23, 76029189), i = d(i, o, s, r, n[l + 9], 4, -640364487), r = d(r, i, o, s, n[l + 12], 11, -421815835), s = d(s, r, i, o, n[l + 15], 16, 530742520), i = u(i, o = d(o, s, r, i, n[l + 2], 23, -995338651), s, r, n[l + 0], 6, -198630844), r = u(r, i, o, s, n[l + 7], 10, 1126891415), s = u(s, r, i, o, n[l + 14], 15, -1416354905), o = u(o, s, r, i, n[l + 5], 21, -57434055), i = u(i, o, s, r, n[l + 12], 6, 1700485571), r = u(r, i, o, s, n[l + 3], 10, -1894986606), s = u(s, r, i, o, n[l + 10], 15, -1051523), o = u(o, s, r, i, n[l + 1], 21, -2054922799), i = u(i, o, s, r, n[l + 8], 6, 1873313359), r = u(r, i, o, s, n[l + 15], 10, -30611744), s = u(s, r, i, o, n[l + 6], 15, -1560198380), o = u(o, s, r, i, n[l + 13], 21, 1309151649), i = u(i, o, s, r, n[l + 4], 6, -145523070), r = u(r, i, o, s, n[l + 11], 10, -1120210379), s = u(s, r, i, o, n[l + 2], 15, 718787259), o = u(o, s, r, i, n[l + 9], 21, -343485551), i = i + h >>> 0, o = o + m >>> 0, s = s + f >>> 0, r = r + g >>> 0; } return fe.endian([ i, o, s, r ]); })._ff = function(e, t, n, a, i, o, s) { var r = e + (t & n | ~t & a) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._gg = function(e, t, n, a, i, o, s) { var r = e + (t & a | n & ~a) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._hh = function(e, t, n, a, i, o, s) { var r = e + (t ^ n ^ a) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._ii = function(e, t, n, a, i, o, s) { var r = e + (n ^ (t | ~a)) + (i >>> 0) + s; return (r << o | r >>> 32 - o) + t; }, be._blocksize = 16, be._digestsize = 16, he.exports = function(e, t) { if (null == e) throw new Error("Illegal argument " + e); var n = fe.wordsToBytes(be(e, t)); return t && t.asBytes ? n : t && t.asString ? ve.bytesToString(n) : fe.bytesToHex(n); }; const _e = getDefaultExportFromCjs(he.exports), qe = [ { type: "hook", name: "\u4e91\u5e55\u5b66\u82d1hook", match: location.host.includes("w-ling.cn"), main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 !== J(".selectDan").length; })); } }); } }, { type: "save", name: "\u4e91\u5e55\u5b66\u82d1\u6536\u5f55", match: () => location.host.includes("w-ling.cn") && location.href.includes("practiceRecord"), question: { html: ".selectDan >div >div", question: ".title", options: ".selectItem label .tagbq", type: ".question-box .tag", workType: "yunmuxueyuan", pageType: "yunmuxueyuan" }, init: async () => { await waitUntil((function() { return isExist(".selectDan >div >div"); })); }, answerHook: e => { const t = J(e.html).parent().find("h3").text().split("\u3001")[1]; e.question = e.question.replace(/^\d+\u3001/, ""), e.question = e.question.replace(/\(\d+\u5206\)$/, ""); let n = J(e.html).find(".anaylize > span:eq(0)").text().replace("\u4f5c\u7b54\u6b63\u786e\uff1a", ""); switch ("" === n && (n = J(e.html).find(".falsanaly > span:eq(1)").text().replace("\u6b63\u786e\u7b54\u6848\uff1a", "")), t) { case "\u5355\u9009\u9898": case "\u591a\u9009\u9898": let t = n.split(""); if (e.answer = t.map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return; e.answer.length > 1 ? e.type = "1" : e.type = "0"; break; case "\u5224\u65ad\u9898": e.type = "3", "T" == n && (e.answer = [ "\u6b63\u786e" ]), "F" == n && (e.answer = [ "\u9519\u8bef" ]); break; case "\u586b\u7a7a\u9898": e.answer = J(e.html).find(".riganswer > span").first().nextAll("span").map(((e, t) => removeHtml(J(t).text()))).get(), e.type = "2"; } return e; } }, { type: "ask", name: "\u4e91\u5e55\u5b66\u82d1", tips: "", match: () => location.host.includes("w-ling.cn") && (location.href.includes("practicePaper") || location.href.includes("examIndex")), types: [ "0", "1", "3" ], question: { html: ".selectDan >div >div", question: ".title", options: ".selectItem label .tagbq", type: ".question-box .tag", workType: "yunmuxueyuan", pageType: "yunmuxueyuan" }, init: async () => { await waitUntil((function() { return 0 !== J(".selectDan >div >div").length; })); }, ischecked: isParentChecked, questionHook: e => { e.question = e.question.replace(/^\d+\u3001/, ""), e.question = e.question.replace(/\(\d+\u5206\)$/, ""); switch (J(e.html).parent().find("h4").text().split("\u3001")[1]) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.type = "3", e.$options = J(e.html).find(".selectItem label"), e.options = e.$options.map(((e, t) => removeHtml(J(t).text()))).get(), e.$options; break; case "\u586b\u7a7a\u9898": e.type = "2"; } return e; }, setAnswer: e => { switch (e.type) { case "3": break; case "2": return J(e.html).find(".tiankong input").each(((t, n) => { let a = J(n).parent()[0].__vue__; J(n).val(e.answer[t]); const i = new Event("input"); n.dispatchEvent(i), a.$emit("change", e.answer[t]); })), !1; } return !0; } } ]; class Answer { constructor() {} static score(e, t) { let n = Cache.get("api_" + e, { score: 0 }); n.score += t, Cache.set("api_" + e, n, 600); } static async getAllAnswers(e) { const t = [ this.getAnswer1(e) ]; return Promise.all(t); } static async getAnswersFree(e) { const t = [ this.getMainAnswer(e), this.getAnswer1(e) ]; return Promise.all(t); } static async getAnswer1(e) { let t = function() { let e = Array.from({ length: 4 }, (() => Math.floor(255 * Math.random()))).join("."); return { "X-Forwarded-For": e, "X-Real-IP": e }; }(); return new Promise((n => { request("http://cx.icodef.com/wyn-nb?v=4", "POST", { question: e.question }, t).then((e => { let t = e[1]; try { e = JSON.parse(e[0].responseText); } catch (i) { n({ form: "\u4e00\u4e4b\u9898\u5e93", answer: null, error: i, duration: t }); } let a = ""; if (1 === e.code) { let t = e.data.replace(/javascript:void\(0\);/g, "").trim().replace(/\n/g, ""); [ "\u53db\u9006", "\u516c\u4f17\u53f7", "\u674e\u6052\u96c5", "\u4e00\u4e4b" ].every((e => !t.includes(e))) && (a = t.split("#")); } n({ form: "\u4e00\u4e4b\u9898\u5e93", answer: a, duration: t }); })).catch((e => { "timeout" === e && this.score("icodef", -1), n({ form: "\u4e00\u4e4b\u9898\u5e93", answer: "", msg: e, duration: 5e3 }); })); })); } static async getAnswer2(e) { return new Promise((t => { [ 0, 1, 2 ].includes(parseInt(e.type)) ? request("https://api.muketool.com/cx/v2/query", "POST", { question: e.question, type: parseInt(e.type) }, {}).then((e => { let n = e[1]; e = JSON.parse(e[0].responseText), t({ form: "muketool", answer: 1 === e.code ? e.data.split("#") : "", duration: n }); })).catch((e => { "timeout" === e && this.score("muketool", -1), t({ form: "muketool", answer: "" }); })) : t({ form: "muketool", answer: "", duration: "\u4e0d\u652f\u6301\u7684\u9898\u578b" }); })); } static getTimestamp() { return Math.floor((new Date).getTime() / 1e3); } static cacheAnswer(e) { const t = { type: e.type, question: e.question, options: e.options, answer: e.answer }, n = questionHash(t.type, t.question, t.options); t.createTime = this.getTimestamp(), Cache.set("ques1_" + n, t); } static async getCacheAnswer(e) { const t = questionHash(e.type, e.question, e.options); e.type, e.question, e.options; let n = Cache.get("ques1_" + t); return n ? { form: "\u672c\u5730\u7f13\u5b58", answer: n.answer, duration: 10 } : { form: "\u672c\u5730\u7f13\u5b58", answer: "", duration: 10, msg: "\u672a\u627e\u5230\u7f13\u5b58" }; } static getMainAnswer(e) { const t = { type: e.type, question: e.question, options: e.options.map((e => e)), workType: e.workType, pageType: e.pageType }; return new Promise((e => { requestApi("https://www.aiask.site/v1/question/search", "POST", t, {}).then((t => { let n = t[1]; 200 === (t = JSON.parse(t[0].responseText)).code && t.data.answer ? e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: t.data.answer, duration: n, msg: t.message }) : 401 === t.code ? e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: "", duration: n, msg: t.message, needLogin: !0 }) : e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: "", duration: n, msg: t.message }); })).catch((t => { e({ form: "\u7231\u95ee\u7b54\u9898\u5e93", answer: "", error: t, duration: 10, msg: "\u8bf7\u6c42\u5931\u8d25" }); })); })); } static async syncQuestionList(e) { return new Promise((t => { requestApi("https://www.aiask.site/v1/question/sync", "POST", e, {}).then((e => { e[0].responseText, t(e[0].responseText); })).catch((e => { t(e); })); })); } static async syncPaper(e) { return new Promise(((t, n) => { requestApi("https://www.aiask.site/v1/question/courseSync", "POST", e, {}).then((e => { try { const n = e[0].responseText, a = JSON.parse(n); a && (200 === a.code || 0 === a.code || a.success), t(a); } catch (n) { t({ code: -1, error: n, msg: "\u54cd\u5e94\u89e3\u6790\u5931\u8d25" }); } })).catch((e => { t({ code: -1, error: e, msg: "\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25" }); })); })); } } const defaultSetAnswer = async (e, t, n, a) => { var i; switch (e) { case "xx": for (let i = 0; i < n.$options.length; i++) if (t.includes(i)) { if (a.ischecked && a.ischecked(n.$options.eq(i))) continue; n.$options.eq(i).click(), await sleep(Math.floor(300 * Math.random() + 200)); } else a.ischecked && a.ischecked(n.$options.eq(i)) && (n.$options.eq(i).click(), await sleep(Math.floor(300 * Math.random() + 200))); break; case "pd": let e = t; 0 == n.options.length ? n.$options.each(((t, n) => { isTrue(e) && isTrue(removeHtml(J(n).html())) && J(n).click(), isFalse(e) && isFalse(removeHtml(J(n).html())) && J(n).click(); })) : n.$options.each(((t, a) => { isTrue(e) && isTrue(n.options[t]) && J(a).click(), isFalse(e) && isFalse(n.options[t]) && J(a).click(); })); break; case "jd": J(n.html).find("textarea").each((function(e) { ce.UE.getEditor(J(this).attr("name")).ready((function() { this.setContent(t[e].replace(/\u7b2c.\u7a7a:/g, "")); })); })), null == (i = J(n.html).find(".savebtndiv>a")) || i.click(); break; case "ydlj": if (Array.isArray(t) && n.options) for (let i = 0; i < t.length && i < n.options.length; i++) { let e = t[i], o = n.options[i]; if (Array.isArray(e) && e.length > 0 && o.$options) for (let t = 0; t < o.$options.length; t++) if (e.includes(t)) { if (a.ischecked && a.ischecked(o.$options.eq(t))) continue; o.$options.eq(t).click(), await sleep(Math.floor(300 * Math.random() + 200)); } else a.ischecked && a.ischecked(o.$options.eq(t)) && (o.$options.eq(t).click(), await sleep(Math.floor(300 * Math.random() + 200))); } } }, applyAnswerResult = async (e, t, n, a) => { let i = !0; a.setAnswerHook && "function" == typeof a.setAnswerHook && await a.setAnswerHook({ type: n.type, answer: t, html: n.html, ques: n }), a.setAnswer && "function" == typeof a.setAnswer && (i = await a.setAnswer({ type: n.type, answer: t, html: n.html, ques: n, rule: a })), i && await defaultSetAnswer(e, t, n, a); }, ApiAnswerMatch = async (e, t, n = !1) => { const a = getAskStore(); let i, o = 0, s = t.type, r = t.html, l = [], c = [ "", l, t, a.rule ]; switch (t.$options && "function" == typeof t.$options && (t.$options = t.$options()), s) { case "0": case "1": for (let i = 0; i < e.length; i++) { let a = e[i].answer; "" == a && (a = []), n && (Array.isArray(a) ? a = a.map((e => { let n = e.charCodeAt() - 65; return t.options[n]; })) : (a = a.replace(/[^a-zA-Z]/g, ""), a = a.split("").map((e => { let n = e.charCodeAt() - 65; return t.options[n]; })))); let o = matchAnswer(a, t.options); e[i].match = o; } if (l = e.filter((e => e.match.length > 0)), 0 === l.length) return { res: e, haveAnswer: !1 }; if (l.length > 1) { if (!l.every((e => e.match.length === l[0].match.length))) { let e = l[0]; for (let t = 1; t < l.length; t++) l[t].match.length > e.match.length && (e = l[t]); l = [ e ]; } } let a = l[0].match; c[0] = "xx", c[1] = a; break; case "3": if (l = e.map((e => { let t = e.answer; return "object" == typeof t && (t = t[0]), isTrue(t) ? e.answer = "\u6b63\u786e" : isFalse(t) ? e.answer = "\u9519\u8bef" : e.answer = "", e; })), l = e.filter((e => "" !== e.answer)), 0 === l.length) return { res: e, haveAnswer: !1 }; c[0] = "pd", c[1] = l[0].answer; break; case "2": case "9": case "4": case "5": case "6": case "7": if (o = J(r).find("textarea").length, 0 === o && (o = t.$options.length), l = e.filter((e => e.answer.length > 0)), 0 === l.length) return { res: e, haveAnswer: !1 }; if (i = l[0].answer, "string" == typeof i && (i = [ i ]), 0 !== o && (l = l.filter((e => ("string" == typeof e.answer ? 1 : e.answer.length) === o)), 0 === l.length)) return { res: e, haveAnswer: !1 }; c[0] = "jd", c[1] = i; break; case "14": if (o = t.$options.length, l = e.filter((e => e.answer.length > 0 && e.answer.length === o)), 0 === l.length) return { res: e, haveAnswer: !1 }; if (i = l[0].answer, l = l.filter((e => ("string" == typeof e.answer ? 1 : e.answer.length) === o)), 0 === l.length) return { res: e, haveAnswer: !1 }; c[0] = "wxtk", c[1] = i; break; case "11": if (l = e.filter((e => "object" == typeof e.answer)), 0 === l.length) return { res: e, haveAnswer: !1 }; i = l[0].answer, c[0] = "lx", c[1] = i; break; case "15": if (l = e.filter((e => Array.isArray(e.answer) && e.answer.length > 0)), 0 === l.length) return { res: e, haveAnswer: !1 }; i = l[0].answer; let s = []; if (t.options && Array.isArray(t.options)) for (let e = 0; e < t.options.length && e < i.length; e++) { let n = t.options[e], a = i[e]; if (n.options && Array.isArray(a)) { let e = matchAnswer(a, n.options); s.push(e); } else s.push([]); } c[0] = "ydlj", c[1] = s, l && l[0] && (l[0].match = s); break; default: return { res: e, haveAnswer: !1 }; } return await applyAnswerResult(c[0], c[1], t, a.rule), { res: e, form: l ? l[0] : [], haveAnswer: !0 }; }, Ae = class _Paper { static getPaper(e) { return Cache.get(`${_Paper.prefix}_${e}`); } static getLastSyncedHashes(e) { const t = Cache.get(`${_Paper.lastSyncedPrefix}_${e}`, { questions: [], chapters: [] }); return { questions: new Set(t.questions || []), chapters: new Set(t.chapters || []) }; } static setLastSyncedHashes(e, t, n) { Cache.set(`${_Paper.lastSyncedPrefix}_${e}`, { questions: t, chapters: n }); } static compareAndGetNewData(e, t) { const n = _Paper.getLastSyncedHashes(t), a = new Set, i = new Set, o = new Map, s = new Map; e.chapter && Array.isArray(e.chapter) && e.chapter.forEach((e => { const t = e.hash; i.add(t); const n = new Map; e.question && Array.isArray(e.question) && e.question.forEach((e => { const t = e.hash; a.add(t), o.set(t, e), n.set(t, e); })), s.set(t, { chapter: e, questions: n }); })); const r = [], l = []; a.forEach((e => { n.questions.has(e) || r.push(e); })), i.forEach((e => { n.chapters.has(e) || l.push(e); })); const c = { hash: e.hash, name: e.name, platform: e.platform, info: e.info, chapter: [] }; return s.forEach(((e, t) => { if (l.includes(t)) c.chapter.push({ hash: e.chapter.hash, name: e.chapter.name, question: Array.from(e.questions.values()) }); else { const t = []; e.questions.forEach(((e, n) => { r.includes(n) && t.push(e); })), t.length > 0 && c.chapter.push({ hash: e.chapter.hash, name: e.chapter.name, question: t }); } })), { newData: c, newQuestionHashes: r, newChapterHashes: l }; } static async setPaper(e, t) { if (!e || !t) return; const n = _Paper.getPaper(e) || { chapter: [] }; t.chapter && t.chapter.forEach((e => { const t = n.chapter.find((t => t.hash === e.hash)); t ? (e.question.forEach((e => { const n = t.question.findIndex((t => t.hash === e.hash)); -1 !== n ? t.question[n] = e : t.question.push(e); })), Object.keys(e).forEach((n => { "question" !== n && (t[n] = e[n]); }))) : n.chapter.push(e); })), Object.keys(t).forEach((e => { "chapter" !== e && (n[e] = t[e]); })), Cache.set(`${_Paper.prefix}_${e}`, n); const {newData: a, newQuestionHashes: i, newChapterHashes: o} = _Paper.compareAndGetNewData(n, e); if (i.length > 0 || o.length > 0) { if (0 === a.chapter.length) return; i.length, o.length; try { const t = await Answer.syncPaper(a); let n; if ("string" == typeof t) try { n = JSON.parse(t); } catch (s) { return; } else n = t; if (!n || 200 !== n.code && 0 !== n.code && !0 !== n.success) JSON.stringify(n); else { const t = _Paper.getLastSyncedHashes(e), n = Array.from(new Set([ ...t.questions, ...i ])), a = Array.from(new Set([ ...t.chapters, ...o ])); _Paper.setLastSyncedHashes(e, n, a), i.length, o.length; } } catch (r) {} } } static hasChapter(e, t) { const n = _Paper.getPaper(e); return !(!n || !n.chapter) && n.chapter.some((e => e.hash === t)); } static getAllPapers() { return Cache.matchGet(`${_Paper.prefix}_`); } }; __publicField(Ae, "prefix", "paper_"), __publicField(Ae, "lastSyncedPrefix", "paper_last_synced_"); let Te = Ae; var Ce = { parse: function(e) { var t = Ce._bin, n = new Uint8Array(e), a = 0; t.readFixed(n, a), a += 4; var i = t.readUshort(n, a); a += 2, t.readUshort(n, a), a += 2, t.readUshort(n, a), a += 2, t.readUshort(n, a), a += 2; for (var o = [ "cmap", "head", "hhea", "maxp", "hmtx", "name", "OS/2", "post", "loca", "glyf", "kern", "CFF ", "GPOS", "GSUB", "SVG " ], s = { _data: n }, r = {}, l = 0; l < i; l++) { var c = t.readASCII(n, a, 4); a += 4, t.readUint(n, a), a += 4; var p = t.readUint(n, a); a += 4; var d = t.readUint(n, a); a += 4, r[c] = { offset: p, length: d }; } for (l = 0; l < o.length; l++) { var u = o[l]; r[u] && (s[u.trim()] = Ce[u.trim()].parse(n, r[u].offset, r[u].length, s)); } return s; }, _tabOffset: function(e, t) { for (var n = Ce._bin, a = n.readUshort(e, 4), i = 12, o = 0; o < a; o++) { var s = n.readASCII(e, i, 4); i += 4, n.readUint(e, i), i += 4; var r = n.readUint(e, i); if (i += 4, n.readUint(e, i), i += 4, s == t) return r; } return 0; } }; Ce._bin = { readFixed: function(e, t) { return (e[t] << 8 | e[t + 1]) + (e[t + 2] << 8 | e[t + 3]) / 65540; }, readF2dot14: function(e, t) { return Ce._bin.readShort(e, t) / 16384; }, readInt: function(e, t) { var n = Ce._bin.t.uint8; return n[0] = e[t + 3], n[1] = e[t + 2], n[2] = e[t + 1], n[3] = e[t], Ce._bin.t.int32[0]; }, readInt8: function(e, t) { return Ce._bin.t.uint8[0] = e[t], Ce._bin.t.int8[0]; }, readShort: function(e, t) { var n = Ce._bin.t.uint8; return n[1] = e[t], n[0] = e[t + 1], Ce._bin.t.int16[0]; }, readUshort: function(e, t) { return e[t] << 8 | e[t + 1]; }, readUshorts: function(e, t, n) { for (var a = [], i = 0; i < n; i++) a.push(Ce._bin.readUshort(e, t + 2 * i)); return a; }, readUint: function(e, t) { var n = Ce._bin.t.uint8; return n[3] = e[t], n[2] = e[t + 1], n[1] = e[t + 2], n[0] = e[t + 3], Ce._bin.t.uint32[0]; }, readUint64: function(e, t) { return 4294967296 * Ce._bin.readUint(e, t) + Ce._bin.readUint(e, t + 4); }, readASCII: function(e, t, n) { for (var a = "", i = 0; i < n; i++) a += String.fromCharCode(e[t + i]); return a; }, readUnicode: function(e, t, n) { for (var a = "", i = 0; i < n; i++) { var o = e[t++] << 8 | e[t++]; a += String.fromCharCode(o); } return a; }, _tdec: window.TextDecoder ? new window.TextDecoder : null, readUTF8: function(e, t, n) { var a = Ce._bin._tdec; return a && 0 == t && n == e.length ? a.decode(e) : Ce._bin.readASCII(e, t, n); }, readBytes: function(e, t, n) { for (var a = [], i = 0; i < n; i++) a.push(e[t + i]); return a; }, readASCIIArray: function(e, t, n) { for (var a = [], i = 0; i < n; i++) a.push(String.fromCharCode(e[t + i])); return a; } }, Ce._bin.t = { buff: new ArrayBuffer(8) }, Ce._bin.t.int8 = new Int8Array(Ce._bin.t.buff), Ce._bin.t.uint8 = new Uint8Array(Ce._bin.t.buff), Ce._bin.t.int16 = new Int16Array(Ce._bin.t.buff), Ce._bin.t.uint16 = new Uint16Array(Ce._bin.t.buff), Ce._bin.t.int32 = new Int32Array(Ce._bin.t.buff), Ce._bin.t.uint32 = new Uint32Array(Ce._bin.t.buff), Ce._lctf = {}, Ce._lctf.parse = function(e, t, n, a, i) { var o = Ce._bin, s = {}, r = t; o.readFixed(e, t), t += 4; var l = o.readUshort(e, t); t += 2; var c = o.readUshort(e, t); t += 2; var p = o.readUshort(e, t); return t += 2, s.scriptList = Ce._lctf.readScriptList(e, r + l), s.featureList = Ce._lctf.readFeatureList(e, r + c), s.lookupList = Ce._lctf.readLookupList(e, r + p, i), s; }, Ce._lctf.readLookupList = function(e, t, n) { var a = Ce._bin, i = t, o = [], s = a.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) { var l = a.readUshort(e, t); t += 2; var c = Ce._lctf.readLookupTable(e, i + l, n); o.push(c); } return o; }, Ce._lctf.readLookupTable = function(e, t, n) { var a = Ce._bin, i = t, o = { tabs: [] }; o.ltype = a.readUshort(e, t), t += 2, o.flag = a.readUshort(e, t), t += 2; var s = a.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) { var l = a.readUshort(e, t); t += 2; var c = n(e, o.ltype, i + l); o.tabs.push(c); } return o; }, Ce._lctf.numOfOnes = function(e) { for (var t = 0, n = 0; n < 32; n++) e >>> n & 1 && t++; return t; }, Ce._lctf.readClassDef = function(e, t) { var n = Ce._bin, a = [], i = n.readUshort(e, t); if (t += 2, 1 == i) { var o = n.readUshort(e, t); t += 2; var s = n.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) a.push(o + r), a.push(o + r), a.push(n.readUshort(e, t)), t += 2; } if (2 == i) { var l = n.readUshort(e, t); t += 2; for (r = 0; r < l; r++) a.push(n.readUshort(e, t)), t += 2, a.push(n.readUshort(e, t)), t += 2, a.push(n.readUshort(e, t)), t += 2; } return a; }, Ce._lctf.getInterval = function(e, t) { for (var n = 0; n < e.length; n += 3) { var a = e[n], i = e[n + 1]; if (e[n + 2], a <= t && t <= i) return n; } return -1; }, Ce._lctf.readValueRecord = function(e, t, n) { var a = Ce._bin, i = []; return i.push(1 & n ? a.readShort(e, t) : 0), t += 1 & n ? 2 : 0, i.push(2 & n ? a.readShort(e, t) : 0), t += 2 & n ? 2 : 0, i.push(4 & n ? a.readShort(e, t) : 0), t += 4 & n ? 2 : 0, i.push(8 & n ? a.readShort(e, t) : 0), t += 8 & n ? 2 : 0, i; }, Ce._lctf.readCoverage = function(e, t) { var n = Ce._bin, a = {}; a.fmt = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); return t += 2, 1 == a.fmt && (a.tab = n.readUshorts(e, t, i)), 2 == a.fmt && (a.tab = n.readUshorts(e, t, 3 * i)), a; }, Ce._lctf.coverageIndex = function(e, t) { var n = e.tab; if (1 == e.fmt) return n.indexOf(t); if (2 == e.fmt) { var a = Ce._lctf.getInterval(n, t); if (-1 != a) return n[a + 2] + (t - n[a]); } return -1; }, Ce._lctf.readFeatureList = function(e, t) { var n = Ce._bin, a = t, i = [], o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readASCII(e, t, 4); t += 4; var l = n.readUshort(e, t); t += 2, i.push({ tag: r.trim(), tab: Ce._lctf.readFeatureTable(e, a + l) }); } return i; }, Ce._lctf.readFeatureTable = function(e, t) { var n = Ce._bin; n.readUshort(e, t), t += 2; var a = n.readUshort(e, t); t += 2; for (var i = [], o = 0; o < a; o++) i.push(n.readUshort(e, t + 2 * o)); return i; }, Ce._lctf.readScriptList = function(e, t) { var n = Ce._bin, a = t, i = {}, o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readASCII(e, t, 4); t += 4; var l = n.readUshort(e, t); t += 2, i[r.trim()] = Ce._lctf.readScriptTable(e, a + l); } return i; }, Ce._lctf.readScriptTable = function(e, t) { var n = Ce._bin, a = t, i = {}, o = n.readUshort(e, t); t += 2, i.default = Ce._lctf.readLangSysTable(e, a + o); var s = n.readUshort(e, t); t += 2; for (var r = 0; r < s; r++) { var l = n.readASCII(e, t, 4); t += 4; var c = n.readUshort(e, t); t += 2, i[l.trim()] = Ce._lctf.readLangSysTable(e, a + c); } return i; }, Ce._lctf.readLangSysTable = function(e, t) { var n = Ce._bin, a = {}; n.readUshort(e, t), t += 2, a.reqFeature = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); return t += 2, a.features = n.readUshorts(e, t, i), a; }, Ce.CFF = {}, Ce.CFF.parse = function(e, t, n) { var a = Ce._bin; (e = new Uint8Array(e.buffer, t, n))[t = 0], e[++t], e[++t], e[++t], t++; var i = []; t = Ce.CFF.readIndex(e, t, i); for (var o = [], s = 0; s < i.length - 1; s++) o.push(a.readASCII(e, t + i[s], i[s + 1] - i[s])); t += i[i.length - 1]; var r = []; t = Ce.CFF.readIndex(e, t, r); var l = []; for (s = 0; s < r.length - 1; s++) l.push(Ce.CFF.readDict(e, t + r[s], t + r[s + 1])); t += r[r.length - 1]; var c = l[0], p = []; t = Ce.CFF.readIndex(e, t, p); var d = []; for (s = 0; s < p.length - 1; s++) d.push(a.readASCII(e, t + p[s], p[s + 1] - p[s])); if (t += p[p.length - 1], Ce.CFF.readSubrs(e, t, c), c.CharStrings) { t = c.CharStrings; p = []; t = Ce.CFF.readIndex(e, t, p); var u = []; for (s = 0; s < p.length - 1; s++) u.push(a.readBytes(e, t + p[s], p[s + 1] - p[s])); c.CharStrings = u; } c.Encoding && (c.Encoding = Ce.CFF.readEncoding(e, c.Encoding, c.CharStrings.length)), c.charset && (c.charset = Ce.CFF.readCharset(e, c.charset, c.CharStrings.length)), c.Private && (t = c.Private[1], c.Private = Ce.CFF.readDict(e, t, t + c.Private[0]), c.Private.Subrs && Ce.CFF.readSubrs(e, t + c.Private.Subrs, c.Private)); var h = {}; for (var m in c) -1 != [ "FamilyName", "FullName", "Notice", "version", "Copyright" ].indexOf(m) ? h[m] = d[c[m] - 426 + 35] : h[m] = c[m]; return h; }, Ce.CFF.readSubrs = function(e, t, n) { var a = Ce._bin, i = []; t = Ce.CFF.readIndex(e, t, i); var o, s = i.length; o = s < 1240 ? 107 : s < 33900 ? 1131 : 32768, n.Bias = o, n.Subrs = []; for (var r = 0; r < i.length - 1; r++) n.Subrs.push(a.readBytes(e, t + i[r], i[r + 1] - i[r])); }, Ce.CFF.tableSE = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, 113, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 139, 0, 0, 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0 ], Ce.CFF.glyphByUnicode = function(e, t) { for (var n = 0; n < e.charset.length; n++) if (e.charset[n] == t) return n; return -1; }, Ce.CFF.glyphBySE = function(e, t) { return t < 0 || t > 255 ? -1 : Ce.CFF.glyphByUnicode(e, Ce.CFF.tableSE[t]); }, Ce.CFF.readEncoding = function(e, t, n) { Ce._bin; var a = [ ".notdef" ], i = e[t]; if (t++, 0 != i) throw "error: unknown encoding format: " + i; var o = e[t]; t++; for (var s = 0; s < o; s++) a.push(e[t + s]); return a; }, Ce.CFF.readCharset = function(e, t, n) { var a = Ce._bin, i = [ ".notdef" ], o = e[t]; if (t++, 0 == o) for (var s = 0; s < n; s++) { var r = a.readUshort(e, t); t += 2, i.push(r); } else { if (1 != o && 2 != o) throw "error: format: " + o; for (;i.length < n; ) { r = a.readUshort(e, t); t += 2; var l = 0; 1 == o ? (l = e[t], t++) : (l = a.readUshort(e, t), t += 2); for (s = 0; s <= l; s++) i.push(r), r++; } } return i; }, Ce.CFF.readIndex = function(e, t, n) { var a = Ce._bin, i = a.readUshort(e, t), o = e[t += 2]; if (t++, 1 == o) for (var s = 0; s < i + 1; s++) n.push(e[t + s]); else if (2 == o) for (s = 0; s < i + 1; s++) n.push(a.readUshort(e, t + 2 * s)); else if (3 == o) for (s = 0; s < i + 1; s++) n.push(16777215 & a.readUint(e, t + 3 * s - 1)); else if (0 != i) throw "unsupported offset size: " + o + ", count: " + i; return (t += (i + 1) * o) - 1; }, Ce.CFF.getCharString = function(e, t, n) { var a = Ce._bin, i = e[t], o = e[t + 1]; e[t + 2], e[t + 3], e[t + 4]; var s = 1, r = null, l = null; i <= 20 && (r = i, s = 1), 12 == i && (r = 100 * i + o, s = 2), 21 <= i && i <= 27 && (r = i, s = 1), 28 == i && (l = a.readShort(e, t + 1), s = 3), 29 <= i && i <= 31 && (r = i, s = 1), 32 <= i && i <= 246 && (l = i - 139, s = 1), 247 <= i && i <= 250 && (l = 256 * (i - 247) + o + 108, s = 2), 251 <= i && i <= 254 && (l = 256 * -(i - 251) - o - 108, s = 2), 255 == i && (l = a.readInt(e, t + 1) / 65535, s = 5), n.val = null != l ? l : "o" + r, n.size = s; }, Ce.CFF.readCharString = function(e, t, n) { for (var a = t + n, i = Ce._bin, o = []; t < a; ) { var s = e[t], r = e[t + 1]; e[t + 2], e[t + 3], e[t + 4]; var l = 1, c = null, p = null; s <= 20 && (c = s, l = 1), 12 == s && (c = 100 * s + r, l = 2), 19 != s && 20 != s || (c = s, l = 2), 21 <= s && s <= 27 && (c = s, l = 1), 28 == s && (p = i.readShort(e, t + 1), l = 3), 29 <= s && s <= 31 && (c = s, l = 1), 32 <= s && s <= 246 && (p = s - 139, l = 1), 247 <= s && s <= 250 && (p = 256 * (s - 247) + r + 108, l = 2), 251 <= s && s <= 254 && (p = 256 * -(s - 251) - r - 108, l = 2), 255 == s && (p = i.readInt(e, t + 1) / 65535, l = 5), o.push(null != p ? p : "o" + c), t += l; } return o; }, Ce.CFF.readDict = function(e, t, n) { for (var a = Ce._bin, i = {}, o = []; t < n; ) { var s = e[t], r = e[t + 1]; e[t + 2], e[t + 3], e[t + 4]; var l = 1, c = null, p = null; if (28 == s && (p = a.readShort(e, t + 1), l = 3), 29 == s && (p = a.readInt(e, t + 1), l = 5), 32 <= s && s <= 246 && (p = s - 139, l = 1), 247 <= s && s <= 250 && (p = 256 * (s - 247) + r + 108, l = 2), 251 <= s && s <= 254 && (p = 256 * -(s - 251) - r - 108, l = 2), 255 == s) throw p = a.readInt(e, t + 1) / 65535, l = 5, "unknown number"; if (30 == s) { var d = []; for (l = 1; ;) { var u = e[t + l]; l++; var h = u >> 4, m = 15 & u; if (15 != h && d.push(h), 15 != m && d.push(m), 15 == m) break; } for (var f = "", g = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ".", "e", "e-", "reserved", "-", "endOfNumber" ], y = 0; y < d.length; y++) f += g[d[y]]; p = parseFloat(f); } if (s <= 21) if (c = [ "version", "Notice", "FullName", "FamilyName", "Weight", "FontBBox", "BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StdHW", "StdVW", "escape", "UniqueID", "XUID", "charset", "Encoding", "CharStrings", "Private", "Subrs", "defaultWidthX", "nominalWidthX" ][s], l = 1, 12 == s) c = [ "Copyright", "isFixedPitch", "ItalicAngle", "UnderlinePosition", "UnderlineThickness", "PaintType", "CharstringType", "FontMatrix", "StrokeWidth", "BlueScale", "BlueShift", "BlueFuzz", "StemSnapH", "StemSnapV", "ForceBold", 0, 0, "LanguageGroup", "ExpansionFactor", "initialRandomSeed", "SyntheticBase", "PostScript", "BaseFontName", "BaseFontBlend", 0, 0, 0, 0, 0, 0, "ROS", "CIDFontVersion", "CIDFontRevision", "CIDFontType", "CIDCount", "UIDBase", "FDArray", "FDSelect", "FontName" ][r], l = 2; null != c ? (i[c] = 1 == o.length ? o[0] : o, o = []) : o.push(p), t += l; } return i; }, Ce.cmap = {}, Ce.cmap.parse = function(e, t, n) { e = new Uint8Array(e.buffer, t, n), t = 0; var a = Ce._bin, i = {}; a.readUshort(e, t), t += 2; var o = a.readUshort(e, t); t += 2; var s = []; i.tables = []; for (var r = 0; r < o; r++) { var l = a.readUshort(e, t); t += 2; var c = a.readUshort(e, t); t += 2; var p = a.readUint(e, t); t += 4; var d = "p" + l + "e" + c, u = s.indexOf(p); if (-1 == u) { var h; u = i.tables.length, s.push(p); var m = a.readUshort(e, p); 0 == m ? h = Ce.cmap.parse0(e, p) : 4 == m ? h = Ce.cmap.parse4(e, p) : 6 == m ? h = Ce.cmap.parse6(e, p) : 12 == m ? h = Ce.cmap.parse12(e, p) : console.log("unknown format: " + m, l, c, p), i.tables.push(h); } if (null != i[d]) throw "multiple tables for one platform+encoding"; i[d] = u; } return i; }, Ce.cmap.parse0 = function(e, t) { var n = Ce._bin, a = {}; a.format = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); t += 2, n.readUshort(e, t), t += 2, a.map = []; for (var o = 0; o < i - 6; o++) a.map.push(e[t + o]); return a; }, Ce.cmap.parse4 = function(e, t) { var n = Ce._bin, a = t, i = {}; i.format = n.readUshort(e, t), t += 2; var o = n.readUshort(e, t); t += 2, n.readUshort(e, t), t += 2; var s = n.readUshort(e, t); t += 2; var r = s / 2; i.searchRange = n.readUshort(e, t), t += 2, i.entrySelector = n.readUshort(e, t), t += 2, i.rangeShift = n.readUshort(e, t), t += 2, i.endCount = n.readUshorts(e, t, r), t += 2 * r, t += 2, i.startCount = n.readUshorts(e, t, r), t += 2 * r, i.idDelta = []; for (var l = 0; l < r; l++) i.idDelta.push(n.readShort(e, t)), t += 2; for (i.idRangeOffset = n.readUshorts(e, t, r), t += 2 * r, i.glyphIdArray = []; t < a + o; ) i.glyphIdArray.push(n.readUshort(e, t)), t += 2; return i; }, Ce.cmap.parse6 = function(e, t) { var n = Ce._bin, a = {}; a.format = n.readUshort(e, t), t += 2, n.readUshort(e, t), t += 2, n.readUshort(e, t), t += 2, a.firstCode = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); t += 2, a.glyphIdArray = []; for (var o = 0; o < i; o++) a.glyphIdArray.push(n.readUshort(e, t)), t += 2; return a; }, Ce.cmap.parse12 = function(e, t) { var n = Ce._bin, a = {}; a.format = n.readUshort(e, t), t += 2, t += 2, n.readUint(e, t), t += 4, n.readUint(e, t), t += 4; var i = n.readUint(e, t); t += 4, a.groups = []; for (var o = 0; o < i; o++) { var s = t + 12 * o, r = n.readUint(e, s + 0), l = n.readUint(e, s + 4), c = n.readUint(e, s + 8); a.groups.push([ r, l, c ]); } return a; }, Ce.glyf = {}, Ce.glyf.parse = function(e, t, n, a) { for (var i = [], o = 0; o < a.maxp.numGlyphs; o++) i.push(null); return i; }, Ce.glyf._parseGlyf = function(e, t) { var n = Ce._bin, a = e._data, i = Ce._tabOffset(a, "glyf") + e.loca[t]; if (e.loca[t] == e.loca[t + 1]) return null; var o = {}; if (o.noc = n.readShort(a, i), i += 2, o.xMin = n.readShort(a, i), i += 2, o.yMin = n.readShort(a, i), i += 2, o.xMax = n.readShort(a, i), i += 2, o.yMax = n.readShort(a, i), i += 2, o.xMin >= o.xMax || o.yMin >= o.yMax) return null; if (o.noc > 0) { o.endPts = []; for (var s = 0; s < o.noc; s++) o.endPts.push(n.readUshort(a, i)), i += 2; var r = n.readUshort(a, i); if (i += 2, a.length - i < r) return null; o.instructions = n.readBytes(a, i, r), i += r; var l = o.endPts[o.noc - 1] + 1; o.flags = []; for (s = 0; s < l; s++) { var c = a[i]; if (i++, o.flags.push(c), 8 & c) { var p = a[i]; i++; for (var d = 0; d < p; d++) o.flags.push(c), s++; } } o.xs = []; for (s = 0; s < l; s++) { var u = !!(2 & o.flags[s]), h = !!(16 & o.flags[s]); u ? (o.xs.push(h ? a[i] : -a[i]), i++) : h ? o.xs.push(0) : (o.xs.push(n.readShort(a, i)), i += 2); } o.ys = []; for (s = 0; s < l; s++) { u = !!(4 & o.flags[s]), h = !!(32 & o.flags[s]); u ? (o.ys.push(h ? a[i] : -a[i]), i++) : h ? o.ys.push(0) : (o.ys.push(n.readShort(a, i)), i += 2); } var m = 0, f = 0; for (s = 0; s < l; s++) m += o.xs[s], f += o.ys[s], o.xs[s] = m, o.ys[s] = f; } else { var g; o.parts = []; do { g = n.readUshort(a, i), i += 2; var y = { m: { a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0 }, p1: -1, p2: -1 }; if (o.parts.push(y), y.glyphIndex = n.readUshort(a, i), i += 2, 1 & g) { var v = n.readShort(a, i); i += 2; var b = n.readShort(a, i); i += 2; } else { v = n.readInt8(a, i); i++; b = n.readInt8(a, i); i++; } 2 & g ? (y.m.tx = v, y.m.ty = b) : (y.p1 = v, y.p2 = b), 8 & g ? (y.m.a = y.m.d = n.readF2dot14(a, i), i += 2) : 64 & g ? (y.m.a = n.readF2dot14(a, i), i += 2, y.m.d = n.readF2dot14(a, i), i += 2) : 128 & g && (y.m.a = n.readF2dot14(a, i), i += 2, y.m.b = n.readF2dot14(a, i), i += 2, y.m.c = n.readF2dot14(a, i), i += 2, y.m.d = n.readF2dot14(a, i), i += 2); } while (32 & g); if (256 & g) { var x = n.readUshort(a, i); i += 2, o.instr = []; for (s = 0; s < x; s++) o.instr.push(a[i]), i++; } } return o; }, Ce.GPOS = {}, Ce.GPOS.parse = function(e, t, n, a) { return Ce._lctf.parse(e, t, n, a, Ce.GPOS.subt); }, Ce.GPOS.subt = function(e, t, n) { if (2 != t) return null; var a = Ce._bin, i = n, o = {}; o.format = a.readUshort(e, n), n += 2; var s = a.readUshort(e, n); n += 2, o.coverage = Ce._lctf.readCoverage(e, s + i), o.valFmt1 = a.readUshort(e, n), n += 2, o.valFmt2 = a.readUshort(e, n), n += 2; var r = Ce._lctf.numOfOnes(o.valFmt1), l = Ce._lctf.numOfOnes(o.valFmt2); if (1 == o.format) { o.pairsets = []; var c = a.readUshort(e, n); n += 2; for (var p = 0; p < c; p++) { var d = a.readUshort(e, n); n += 2, d += i; var u = a.readUshort(e, d); d += 2; for (var h = [], m = 0; m < u; m++) { var f = a.readUshort(e, d); d += 2, 0 != o.valFmt1 && (w = Ce._lctf.readValueRecord(e, d, o.valFmt1), d += 2 * r), 0 != o.valFmt2 && (k = Ce._lctf.readValueRecord(e, d, o.valFmt2), d += 2 * l), h.push({ gid2: f, val1: w, val2: k }); } o.pairsets.push(h); } } if (2 == o.format) { var g = a.readUshort(e, n); n += 2; var y = a.readUshort(e, n); n += 2; var v = a.readUshort(e, n); n += 2; var b = a.readUshort(e, n); n += 2, o.classDef1 = Ce._lctf.readClassDef(e, i + g), o.classDef2 = Ce._lctf.readClassDef(e, i + y), o.matrix = []; for (p = 0; p < v; p++) { var x = []; for (m = 0; m < b; m++) { var w = null, k = null; 0 != o.valFmt1 && (w = Ce._lctf.readValueRecord(e, n, o.valFmt1), n += 2 * r), 0 != o.valFmt2 && (k = Ce._lctf.readValueRecord(e, n, o.valFmt2), n += 2 * l), x.push({ val1: w, val2: k }); } o.matrix.push(x); } } return o; }, Ce.GSUB = {}, Ce.GSUB.parse = function(e, t, n, a) { return Ce._lctf.parse(e, t, n, a, Ce.GSUB.subt); }, Ce.GSUB.subt = function(e, t, n) { var a = Ce._bin, i = n, o = {}; if (1 != t && 4 != t && 5 != t) return null; o.fmt = a.readUshort(e, n), n += 2; var s = a.readUshort(e, n); if (n += 2, o.coverage = Ce._lctf.readCoverage(e, s + i), 1 == t) { if (1 == o.fmt) o.delta = a.readShort(e, n), n += 2; else if (2 == o.fmt) { var r = a.readUshort(e, n); n += 2, o.newg = a.readUshorts(e, n, r), n += 2 * o.newg.length; } } else if (4 == t) { o.vals = []; r = a.readUshort(e, n); n += 2; for (var l = 0; l < r; l++) { var c = a.readUshort(e, n); n += 2, o.vals.push(Ce.GSUB.readLigatureSet(e, i + c)); } } else if (5 == t) if (2 == o.fmt) { var p = a.readUshort(e, n); n += 2, o.cDef = Ce._lctf.readClassDef(e, i + p), o.scset = []; var d = a.readUshort(e, n); n += 2; for (l = 0; l < d; l++) { var u = a.readUshort(e, n); n += 2, o.scset.push(0 == u ? null : Ce.GSUB.readSubClassSet(e, i + u)); } } else console.log("unknown table format", o.fmt); return o; }, Ce.GSUB.readSubClassSet = function(e, t) { var n = Ce._bin.readUshort, a = t, i = [], o = n(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n(e, t); t += 2, i.push(Ce.GSUB.readSubClassRule(e, a + r)); } return i; }, Ce.GSUB.readSubClassRule = function(e, t) { var n = Ce._bin.readUshort, a = {}, i = n(e, t), o = n(e, t += 2); t += 2, a.input = []; for (var s = 0; s < i - 1; s++) a.input.push(n(e, t)), t += 2; return a.substLookupRecords = Ce.GSUB.readSubstLookupRecords(e, t, o), a; }, Ce.GSUB.readSubstLookupRecords = function(e, t, n) { for (var a = Ce._bin.readUshort, i = [], o = 0; o < n; o++) i.push(a(e, t), a(e, t + 2)), t += 4; return i; }, Ce.GSUB.readChainSubClassSet = function(e, t) { var n = Ce._bin, a = t, i = [], o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readUshort(e, t); t += 2, i.push(Ce.GSUB.readChainSubClassRule(e, a + r)); } return i; }, Ce.GSUB.readChainSubClassRule = function(e, t) { for (var n = Ce._bin, a = {}, i = [ "backtrack", "input", "lookahead" ], o = 0; o < i.length; o++) { var s = n.readUshort(e, t); t += 2, 1 == o && s--, a[i[o]] = n.readUshorts(e, t, s), t += 2 * a[i[o]].length; } s = n.readUshort(e, t); return t += 2, a.subst = n.readUshorts(e, t, 2 * s), t += 2 * a.subst.length, a; }, Ce.GSUB.readLigatureSet = function(e, t) { var n = Ce._bin, a = t, i = [], o = n.readUshort(e, t); t += 2; for (var s = 0; s < o; s++) { var r = n.readUshort(e, t); t += 2, i.push(Ce.GSUB.readLigature(e, a + r)); } return i; }, Ce.GSUB.readLigature = function(e, t) { var n = Ce._bin, a = { chain: [] }; a.nglyph = n.readUshort(e, t), t += 2; var i = n.readUshort(e, t); t += 2; for (var o = 0; o < i - 1; o++) a.chain.push(n.readUshort(e, t)), t += 2; return a; }, Ce.head = {}, Ce.head.parse = function(e, t, n) { var a = Ce._bin, i = {}; return a.readFixed(e, t), t += 4, i.fontRevision = a.readFixed(e, t), t += 4, a.readUint(e, t), t += 4, a.readUint(e, t), t += 4, i.flags = a.readUshort(e, t), t += 2, i.unitsPerEm = a.readUshort(e, t), t += 2, i.created = a.readUint64(e, t), t += 8, i.modified = a.readUint64(e, t), t += 8, i.xMin = a.readShort(e, t), t += 2, i.yMin = a.readShort(e, t), t += 2, i.xMax = a.readShort(e, t), t += 2, i.yMax = a.readShort(e, t), t += 2, i.macStyle = a.readUshort(e, t), t += 2, i.lowestRecPPEM = a.readUshort(e, t), t += 2, i.fontDirectionHint = a.readShort(e, t), t += 2, i.indexToLocFormat = a.readShort(e, t), t += 2, i.glyphDataFormat = a.readShort(e, t), t += 2, i; }, Ce.hhea = {}, Ce.hhea.parse = function(e, t, n) { var a = Ce._bin, i = {}; return a.readFixed(e, t), t += 4, i.ascender = a.readShort(e, t), t += 2, i.descender = a.readShort(e, t), t += 2, i.lineGap = a.readShort(e, t), t += 2, i.advanceWidthMax = a.readUshort(e, t), t += 2, i.minLeftSideBearing = a.readShort(e, t), t += 2, i.minRightSideBearing = a.readShort(e, t), t += 2, i.xMaxExtent = a.readShort(e, t), t += 2, i.caretSlopeRise = a.readShort(e, t), t += 2, i.caretSlopeRun = a.readShort(e, t), t += 2, i.caretOffset = a.readShort(e, t), t += 2, t += 8, i.metricDataFormat = a.readShort(e, t), t += 2, i.numberOfHMetrics = a.readUshort(e, t), t += 2, i; }, Ce.hmtx = {}, Ce.hmtx.parse = function(e, t, n, a) { for (var i = Ce._bin, o = { aWidth: [], lsBearing: [] }, s = 0, r = 0, l = 0; l < a.maxp.numGlyphs; l++) l < a.hhea.numberOfHMetrics && (s = i.readUshort(e, t), t += 2, r = i.readShort(e, t), t += 2), o.aWidth.push(s), o.lsBearing.push(r); return o; }, Ce.kern = {}, Ce.kern.parse = function(e, t, n, a) { var i = Ce._bin, o = i.readUshort(e, t); if (t += 2, 1 == o) return Ce.kern.parseV1(e, t - 2, n, a); var s = i.readUshort(e, t); t += 2; for (var r = { glyph1: [], rval: [] }, l = 0; l < s; l++) { t += 2; n = i.readUshort(e, t); t += 2; var c = i.readUshort(e, t); t += 2; var p = c >>> 8; if (0 != (p &= 15)) throw "unknown kern table format: " + p; t = Ce.kern.readFormat0(e, t, r); } return r; }, Ce.kern.parseV1 = function(e, t, n, a) { var i = Ce._bin; i.readFixed(e, t), t += 4; var o = i.readUint(e, t); t += 4; for (var s = { glyph1: [], rval: [] }, r = 0; r < o; r++) { i.readUint(e, t), t += 4; var l = i.readUshort(e, t); t += 2, i.readUshort(e, t), t += 2; var c = l >>> 8; if (0 != (c &= 15)) throw "unknown kern table format: " + c; t = Ce.kern.readFormat0(e, t, s); } return s; }, Ce.kern.readFormat0 = function(e, t, n) { var a = Ce._bin, i = -1, o = a.readUshort(e, t); t += 2, a.readUshort(e, t), t += 2, a.readUshort(e, t), t += 2, a.readUshort(e, t), t += 2; for (var s = 0; s < o; s++) { var r = a.readUshort(e, t); t += 2; var l = a.readUshort(e, t); t += 2; var c = a.readShort(e, t); t += 2, r != i && (n.glyph1.push(r), n.rval.push({ glyph2: [], vals: [] })); var p = n.rval[n.rval.length - 1]; p.glyph2.push(l), p.vals.push(c), i = r; } return t; }, Ce.loca = {}, Ce.loca.parse = function(e, t, n, a) { var i = Ce._bin, o = [], s = a.head.indexToLocFormat, r = a.maxp.numGlyphs + 1; if (0 == s) for (var l = 0; l < r; l++) o.push(i.readUshort(e, t + (l << 1)) << 1); if (1 == s) for (l = 0; l < r; l++) o.push(i.readUint(e, t + (l << 2))); return o; }, Ce.maxp = {}, Ce.maxp.parse = function(e, t, n) { var a = Ce._bin, i = {}, o = a.readUint(e, t); return t += 4, i.numGlyphs = a.readUshort(e, t), t += 2, 65536 == o && (i.maxPoints = a.readUshort(e, t), t += 2, i.maxContours = a.readUshort(e, t), t += 2, i.maxCompositePoints = a.readUshort(e, t), t += 2, i.maxCompositeContours = a.readUshort(e, t), t += 2, i.maxZones = a.readUshort(e, t), t += 2, i.maxTwilightPoints = a.readUshort(e, t), t += 2, i.maxStorage = a.readUshort(e, t), t += 2, i.maxFunctionDefs = a.readUshort(e, t), t += 2, i.maxInstructionDefs = a.readUshort(e, t), t += 2, i.maxStackElements = a.readUshort(e, t), t += 2, i.maxSizeOfInstructions = a.readUshort(e, t), t += 2, i.maxComponentElements = a.readUshort(e, t), t += 2, i.maxComponentDepth = a.readUshort(e, t), t += 2), i; }, Ce.name = {}, Ce.name.parse = function(e, t, n) { var a = Ce._bin, i = {}; a.readUshort(e, t), t += 2; var o = a.readUshort(e, t); t += 2, a.readUshort(e, t); for (var s, r = t += 2, l = 0; l < o; l++) { var c = a.readUshort(e, t); t += 2; var p = a.readUshort(e, t); t += 2; var d = a.readUshort(e, t); t += 2; var u = a.readUshort(e, t); t += 2; n = a.readUshort(e, t); t += 2; var h = a.readUshort(e, t); t += 2; var m = "p" + c; null == i[m] && (i[m] = {}); var f, g = [ "copyright", "fontFamily", "fontSubfamily", "ID", "fullName", "version", "postScriptName", "trademark", "manufacturer", "designer", "description", "urlVendor", "urlDesigner", "licence", "licenceURL", "---", "typoFamilyName", "typoSubfamilyName", "compatibleFull", "sampleText", "postScriptCID", "wwsFamilyName", "wwsSubfamilyName", "lightPalette", "darkPalette" ][u], y = r + 12 * o + h; if (0 == c) f = a.readUnicode(e, y, n / 2); else if (3 == c && 0 == p) f = a.readUnicode(e, y, n / 2); else if (0 == p) f = a.readASCII(e, y, n); else if (1 == p) f = a.readUnicode(e, y, n / 2); else if (3 == p) f = a.readUnicode(e, y, n / 2); else { if (1 != c) throw "unknown encoding " + p + ", platformID: " + c; f = a.readASCII(e, y, n), console.log("reading unknown MAC encoding " + p + " as ASCII"); } i[m][g] = f, i[m]._lang = d; } for (var v in i) if (null != i[v].postScriptName && 1033 == i[v]._lang) return i[v]; for (var v in i) if (null != i[v].postScriptName && 3084 == i[v]._lang) return i[v]; for (var v in i) if (null != i[v].postScriptName) return i[v]; for (var v in i) { s = v; break; } return console.log("returning name table with languageID " + i[s]._lang), i[s]; }, Ce["OS/2"] = {}, Ce["OS/2"].parse = function(e, t, n) { var a = Ce._bin.readUshort(e, t); t += 2; var i = {}; if (0 == a) Ce["OS/2"].version0(e, t, i); else if (1 == a) Ce["OS/2"].version1(e, t, i); else if (2 == a || 3 == a || 4 == a) Ce["OS/2"].version2(e, t, i); else { if (5 != a) throw "unknown OS/2 table version: " + a; Ce["OS/2"].version5(e, t, i); } return i; }, Ce["OS/2"].version0 = function(e, t, n) { var a = Ce._bin; return n.xAvgCharWidth = a.readShort(e, t), t += 2, n.usWeightClass = a.readUshort(e, t), t += 2, n.usWidthClass = a.readUshort(e, t), t += 2, n.fsType = a.readUshort(e, t), t += 2, n.ySubscriptXSize = a.readShort(e, t), t += 2, n.ySubscriptYSize = a.readShort(e, t), t += 2, n.ySubscriptXOffset = a.readShort(e, t), t += 2, n.ySubscriptYOffset = a.readShort(e, t), t += 2, n.ySuperscriptXSize = a.readShort(e, t), t += 2, n.ySuperscriptYSize = a.readShort(e, t), t += 2, n.ySuperscriptXOffset = a.readShort(e, t), t += 2, n.ySuperscriptYOffset = a.readShort(e, t), t += 2, n.yStrikeoutSize = a.readShort(e, t), t += 2, n.yStrikeoutPosition = a.readShort(e, t), t += 2, n.sFamilyClass = a.readShort(e, t), t += 2, n.panose = a.readBytes(e, t, 10), t += 10, n.ulUnicodeRange1 = a.readUint(e, t), t += 4, n.ulUnicodeRange2 = a.readUint(e, t), t += 4, n.ulUnicodeRange3 = a.readUint(e, t), t += 4, n.ulUnicodeRange4 = a.readUint(e, t), t += 4, n.achVendID = [ a.readInt8(e, t), a.readInt8(e, t + 1), a.readInt8(e, t + 2), a.readInt8(e, t + 3) ], t += 4, n.fsSelection = a.readUshort(e, t), t += 2, n.usFirstCharIndex = a.readUshort(e, t), t += 2, n.usLastCharIndex = a.readUshort(e, t), t += 2, n.sTypoAscender = a.readShort(e, t), t += 2, n.sTypoDescender = a.readShort(e, t), t += 2, n.sTypoLineGap = a.readShort(e, t), t += 2, n.usWinAscent = a.readUshort(e, t), t += 2, n.usWinDescent = a.readUshort(e, t), t += 2; }, Ce["OS/2"].version1 = function(e, t, n) { var a = Ce._bin; return t = Ce["OS/2"].version0(e, t, n), n.ulCodePageRange1 = a.readUint(e, t), t += 4, n.ulCodePageRange2 = a.readUint(e, t), t += 4; }, Ce["OS/2"].version2 = function(e, t, n) { var a = Ce._bin; return t = Ce["OS/2"].version1(e, t, n), n.sxHeight = a.readShort(e, t), t += 2, n.sCapHeight = a.readShort(e, t), t += 2, n.usDefault = a.readUshort(e, t), t += 2, n.usBreak = a.readUshort(e, t), t += 2, n.usMaxContext = a.readUshort(e, t), t += 2; }, Ce["OS/2"].version5 = function(e, t, n) { var a = Ce._bin; return t = Ce["OS/2"].version2(e, t, n), n.usLowerOpticalPointSize = a.readUshort(e, t), t += 2, n.usUpperOpticalPointSize = a.readUshort(e, t), t += 2; }, Ce.post = {}, Ce.post.parse = function(e, t, n) { var a = Ce._bin, i = {}; return i.version = a.readFixed(e, t), t += 4, i.italicAngle = a.readFixed(e, t), t += 4, i.underlinePosition = a.readShort(e, t), t += 2, i.underlineThickness = a.readShort(e, t), t += 2, i; }, Ce.SVG = {}, Ce.SVG.parse = function(e, t, n) { var a = Ce._bin, i = { entries: [] }, o = t; a.readUshort(e, t), t += 2; var s = a.readUint(e, t); t += 4, a.readUint(e, t), t += 4, t = s + o; var r = a.readUshort(e, t); t += 2; for (var l = 0; l < r; l++) { var c = a.readUshort(e, t); t += 2; var p = a.readUshort(e, t); t += 2; var d = a.readUint(e, t); t += 4; var u = a.readUint(e, t); t += 4; for (var h = new Uint8Array(e.buffer, o + d + s, u), m = a.readUTF8(h, 0, h.length), f = c; f <= p; f++) i.entries[f] = m; } return i; }, Ce.SVG.toPath = function(e) { var t = { cmds: [], crds: [] }; if (null == e) return t; for (var n = (new DOMParser).parseFromString(e, "image/svg+xml").firstChild; "svg" != n.tagName; ) n = n.nextSibling; var a = n.getAttribute("viewBox"); a = a ? a.trim().split(" ").map(parseFloat) : [ 0, 0, 1e3, 1e3 ], Ce.SVG._toPath(n.children, t); for (var i = 0; i < t.crds.length; i += 2) { var o = t.crds[i], s = t.crds[i + 1]; o -= a[0], s = -(s -= a[1]), t.crds[i] = o, t.crds[i + 1] = s; } return t; }, Ce.SVG._toPath = function(e, t, n) { for (var a = 0; a < e.length; a++) { var i = e[a], o = i.tagName, s = i.getAttribute("fill"); if (null == s && (s = n), "g" == o) Ce.SVG._toPath(i.children, t, s); else if ("path" == o) { t.cmds.push(s || "#000000"); var r = i.getAttribute("d"), l = Ce.SVG._tokens(r); Ce.SVG._toksToPath(l, t), t.cmds.push("X"); } else "defs" == o || console.log(o, i); } }, Ce.SVG._tokens = function(e) { for (var t = [], n = 0, a = !1, i = ""; n < e.length; ) { var o = e.charCodeAt(n), s = e.charAt(n); n++; var r = 48 <= o && o <= 57 || "." == s || "-" == s; a ? "-" == s ? (t.push(parseFloat(i)), i = s) : r ? i += s : (t.push(parseFloat(i)), "," != s && " " != s && t.push(s), a = !1) : r ? (i = s, a = !0) : "," != s && " " != s && t.push(s); } return a && t.push(parseFloat(i)), t; }, Ce.SVG._toksToPath = function(e, t) { for (var n = 0, a = 0, i = 0, o = 0, s = 0, r = { M: 2, L: 2, H: 1, V: 1, S: 4, C: 6 }, l = t.cmds, c = t.crds; n < e.length; ) { var p = e[n]; if (n++, "z" == p) l.push("Z"), a = o, i = s; else for (var d = p.toUpperCase(), u = r[d], h = Ce.SVG._reps(e, n, u), m = 0; m < h; m++) { var f = 0, g = 0; if (p != d && (f = a, g = i), "M" == d) a = f + e[n++], i = g + e[n++], l.push("M"), c.push(a, i), o = a, s = i; else if ("L" == d) a = f + e[n++], i = g + e[n++], l.push("L"), c.push(a, i); else if ("H" == d) a = f + e[n++], l.push("L"), c.push(a, i); else if ("V" == d) i = g + e[n++], l.push("L"), c.push(a, i); else if ("C" == d) { var y = f + e[n++], v = g + e[n++], b = f + e[n++], x = g + e[n++], w = f + e[n++], k = g + e[n++]; l.push("C"), c.push(y, v, b, x, w, k), a = w, i = k; } else if ("S" == d) { var _ = Math.max(c.length - 4, 0); y = a + a - c[_], v = i + i - c[_ + 1], b = f + e[n++], x = g + e[n++], w = f + e[n++], k = g + e[n++]; l.push("C"), c.push(y, v, b, x, w, k), a = w, i = k; } else console.log("Unknown SVG command " + p); } } }, Ce.SVG._reps = function(e, t, n) { for (var a = t; a < e.length && "string" != typeof e[a]; ) a += n; return (a - t) / n; }, null == Ce && (Ce = {}), null == Ce.U && (Ce.U = {}), Ce.U.codeToGlyph = function(e, t) { var n = e.cmap, a = -1; if (null != n.p0e4 ? a = n.p0e4 : null != n.p3e1 ? a = n.p3e1 : null != n.p1e0 && (a = n.p1e0), -1 == a) throw "no familiar platform and encoding!"; var i = n.tables[a]; if (0 == i.format) return t >= i.map.length ? 0 : i.map[t]; if (4 == i.format) { for (var o = -1, s = 0; s < i.endCount.length; s++) if (t <= i.endCount[s]) { o = s; break; } if (-1 == o) return 0; if (i.startCount[o] > t) return 0; return 65535 & (0 != i.idRangeOffset[o] ? i.glyphIdArray[t - i.startCount[o] + (i.idRangeOffset[o] >> 1) - (i.idRangeOffset.length - o)] : t + i.idDelta[o]); } if (12 == i.format) { if (t > i.groups[i.groups.length - 1][1]) return 0; for (s = 0; s < i.groups.length; s++) { var r = i.groups[s]; if (r[0] <= t && t <= r[1]) return r[2] + (t - r[0]); } return 0; } throw "unknown cmap table format " + i.format; }, Ce.U.glyphToPath = function(e, t) { var n = { cmds: [], crds: [] }; if (e.SVG && e.SVG.entries[t]) { var a = e.SVG.entries[t]; return null == a ? n : ("string" == typeof a && (a = Ce.SVG.toPath(a), e.SVG.entries[t] = a), a); } if (e.CFF) { var i = { x: 0, y: 0, stack: [], nStems: 0, haveWidth: !1, width: e.CFF.Private ? e.CFF.Private.defaultWidthX : 0, open: !1 }; Ce.U._drawCFF(e.CFF.CharStrings[t], i, e.CFF, n); } else e.glyf && Ce.U._drawGlyf(t, e, n); return n; }, Ce.U._drawGlyf = function(e, t, n) { var a = t.glyf[e]; null == a && (a = t.glyf[e] = Ce.glyf._parseGlyf(t, e)), null != a && (a.noc > -1 ? Ce.U._simpleGlyph(a, n) : Ce.U._compoGlyph(a, t, n)); }, Ce.U._simpleGlyph = function(e, t) { for (var n = 0; n < e.noc; n++) { for (var a = 0 == n ? 0 : e.endPts[n - 1] + 1, i = e.endPts[n], o = a; o <= i; o++) { var s = o == a ? i : o - 1, r = o == i ? a : o + 1, l = 1 & e.flags[o], c = 1 & e.flags[s], p = 1 & e.flags[r], d = e.xs[o], u = e.ys[o]; if (o == a) if (l) { if (!c) { Ce.U.P.moveTo(t, d, u); continue; } Ce.U.P.moveTo(t, e.xs[s], e.ys[s]); } else c ? Ce.U.P.moveTo(t, e.xs[s], e.ys[s]) : Ce.U.P.moveTo(t, (e.xs[s] + d) / 2, (e.ys[s] + u) / 2); l ? c && Ce.U.P.lineTo(t, d, u) : p ? Ce.U.P.qcurveTo(t, d, u, e.xs[r], e.ys[r]) : Ce.U.P.qcurveTo(t, d, u, (d + e.xs[r]) / 2, (u + e.ys[r]) / 2); } Ce.U.P.closePath(t); } }, Ce.U._compoGlyph = function(e, t, n) { for (var a = 0; a < e.parts.length; a++) { var i = { cmds: [], crds: [] }, o = e.parts[a]; Ce.U._drawGlyf(o.glyphIndex, t, i); for (var s = o.m, r = 0; r < i.crds.length; r += 2) { var l = i.crds[r], c = i.crds[r + 1]; n.crds.push(l * s.a + c * s.b + s.tx), n.crds.push(l * s.c + c * s.d + s.ty); } for (r = 0; r < i.cmds.length; r++) n.cmds.push(i.cmds[r]); } }, Ce.U._getGlyphClass = function(e, t) { var n = Ce._lctf.getInterval(t, e); return -1 == n ? 0 : t[n + 2]; }, Ce.U.getPairAdjustment = function(e, t, n) { if (e.GPOS) { for (var a = null, i = 0; i < e.GPOS.featureList.length; i++) { var o = e.GPOS.featureList[i]; if ("kern" == o.tag) for (var s = 0; s < o.tab.length; s++) 2 == e.GPOS.lookupList[o.tab[s]].ltype && (a = e.GPOS.lookupList[o.tab[s]]); } if (a) for (i = 0; i < a.tabs.length; i++) { var r = a.tabs[i], l = Ce._lctf.coverageIndex(r.coverage, t); if (-1 != l) { if (1 == r.format) { var c = r.pairsets[l]; for (s = 0; s < c.length; s++) c[s].gid2 == n && (u = c[s]); if (null == u) continue; } else if (2 == r.format) var p = Ce.U._getGlyphClass(t, r.classDef1), d = Ce.U._getGlyphClass(n, r.classDef2), u = r.matrix[p][d]; return u.val1[2]; } } } if (e.kern) { var h = e.kern.glyph1.indexOf(t); if (-1 != h) { var m = e.kern.rval[h].glyph2.indexOf(n); if (-1 != m) return e.kern.rval[h].vals[m]; } } return 0; }, Ce.U.stringToGlyphs = function(e, t) { for (var n = [], a = 0; a < t.length; a++) { var i = t.codePointAt(a); i > 65535 && a++, n.push(Ce.U.codeToGlyph(e, i)); } var o = e.GSUB; if (null == o) return n; for (var s = o.lookupList, r = o.featureList, l = '\n\t" ,.:;!?() \u060c', c = "\u0622\u0623\u0624\u0625\u0627\u0629\u062f\u0630\u0631\u0632\u0648\u0671\u0672\u0673\u0675\u0676\u0677\u0688\u0689\u068a\u068b\u068c\u068d\u068e\u068f\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u06c0\u06c3\u06c4\u06c5\u06c6\u06c7\u06c8\u06c9\u06ca\u06cb\u06cd\u06cf\u06d2\u06d3\u06d5\u06ee\u06ef\u0710\u0715\u0716\u0717\u0718\u0719\u071e\u0728\u072a\u072c\u072f\u074d\u0759\u075a\u075b\u076b\u076c\u0771\u0773\u0774\u0778\u0779\u0840\u0846\u0847\u0849\u0854\u0867\u0869\u086a\u08aa\u08ab\u08ac\u08ae\u08b1\u08b2\u08b9\u0ac5\u0ac7\u0ac9\u0aca\u0ace\u0acf\u0ad0\u0ad1\u0ad2\u0add\u0ae1\u0ae4\u0aef\u0b81\u0b83\u0b84\u0b85\u0b89\u0b8c\u0b8e\u0b8f\u0b91\u0ba9\u0baa\u0bab\u0bac", p = 0; p < n.length; p++) { var d = n[p], u = 0 == p || -1 != l.indexOf(t[p - 1]), h = p == n.length - 1 || -1 != l.indexOf(t[p + 1]); u || -1 == c.indexOf(t[p - 1]) || (u = !0), h || -1 == c.indexOf(t[p]) || (h = !0), h || -1 == "\ua872\u0acd\u0ad7".indexOf(t[p + 1]) || (h = !0), u || -1 == "\ua872\u0acd\u0ad7".indexOf(t[p]) || (u = !0); var m = null; m = u ? h ? "isol" : "init" : h ? "fina" : "medi"; for (var f = 0; f < r.length; f++) if (r[f].tag == m) for (var g = 0; g < r[f].tab.length; g++) { 1 == (x = s[r[f].tab[g]]).ltype && Ce.U._applyType1(n, p, x); } } var y = [ "rlig", "liga", "mset" ]; for (p = 0; p < n.length; p++) { d = n[p]; var v = Math.min(3, n.length - p - 1); for (f = 0; f < r.length; f++) { var b = r[f]; if (-1 != y.indexOf(b.tag)) for (g = 0; g < b.tab.length; g++) for (var x = s[b.tab[g]], w = 0; w < x.tabs.length; w++) if (null != x.tabs[w]) { var k = Ce._lctf.coverageIndex(x.tabs[w].coverage, d); if (-1 != k) if (4 == x.ltype) for (var _ = x.tabs[w].vals[k], q = 0; q < _.length; q++) { var A = _[q], T = A.chain.length; if (!(T > v)) { for (var C = !0, S = 0; S < T; S++) A.chain[S] != n[p + (1 + S)] && (C = !1); if (C) { n[p] = A.nglyph; for (S = 0; S < T; S++) n[p + S + 1] = -1; } } } else if (5 == x.ltype) { var E = x.tabs[w]; if (2 != E.fmt) continue; var I = Ce._lctf.getInterval(E.cDef, d), U = E.cDef[I + 2], H = E.scset[U]; for (a = 0; a < H.length; a++) { var O = H[a], j = O.input; if (!(j.length > v)) { for (C = !0, S = 0; S < j.length; S++) { var z = Ce._lctf.getInterval(E.cDef, n[p + 1 + S]); if (-1 == I && E.cDef[z + 2] != j[S]) { C = !1; break; } } if (C) { var P = O.substLookupRecords; for (q = 0; q < P.length; q += 2) P[q], P[q + 1]; } } } } } } } return n; }, Ce.U._applyType1 = function(e, t, n) { for (var a = e[t], i = 0; i < n.tabs.length; i++) { var o = n.tabs[i], s = Ce._lctf.coverageIndex(o.coverage, a); -1 != s && (1 == o.fmt ? e[t] = e[t] + o.delta : e[t] = o.newg[s]); } }, Ce.U.glyphsToPath = function(e, t, n) { for (var a = { cmds: [], crds: [] }, i = 0, o = 0; o < t.length; o++) { var s = t[o]; if (-1 != s) { for (var r = o < t.length - 1 && -1 != t[o + 1] ? t[o + 1] : 0, l = Ce.U.glyphToPath(e, s), c = 0; c < l.crds.length; c += 2) a.crds.push(l.crds[c] + i), a.crds.push(l.crds[c + 1]); n && a.cmds.push(n); for (c = 0; c < l.cmds.length; c++) a.cmds.push(l.cmds[c]); n && a.cmds.push("X"), i += e.hmtx.aWidth[s], o < t.length - 1 && (i += Ce.U.getPairAdjustment(e, s, r)); } } return a; }, Ce.U.pathToSVG = function(e, t) { null == t && (t = 5); for (var n = [], a = 0, i = { M: 2, L: 2, Q: 4, C: 6 }, o = 0; o < e.cmds.length; o++) { var s = e.cmds[o], r = a + (i[s] ? i[s] : 0); for (n.push(s); a < r; ) { var l = e.crds[a++]; n.push(parseFloat(l.toFixed(t)) + (a == r ? "" : " ")); } } return n.join(""); }, Ce.U.pathToContext = function(e, t) { for (var n = 0, a = e.crds, i = 0; i < e.cmds.length; i++) { var o = e.cmds[i]; "M" == o ? (t.moveTo(a[n], a[n + 1]), n += 2) : "L" == o ? (t.lineTo(a[n], a[n + 1]), n += 2) : "C" == o ? (t.bezierCurveTo(a[n], a[n + 1], a[n + 2], a[n + 3], a[n + 4], a[n + 5]), n += 6) : "Q" == o ? (t.quadraticCurveTo(a[n], a[n + 1], a[n + 2], a[n + 3]), n += 4) : "#" == o.charAt(0) ? (t.beginPath(), t.fillStyle = o) : "Z" == o ? t.closePath() : "X" == o && t.fill(); } }, Ce.U.P = {}, Ce.U.P.moveTo = function(e, t, n) { e.cmds.push("M"), e.crds.push(t, n); }, Ce.U.P.lineTo = function(e, t, n) { e.cmds.push("L"), e.crds.push(t, n); }, Ce.U.P.curveTo = function(e, t, n, a, i, o, s) { e.cmds.push("C"), e.crds.push(t, n, a, i, o, s); }, Ce.U.P.qcurveTo = function(e, t, n, a, i) { e.cmds.push("Q"), e.crds.push(t, n, a, i); }, Ce.U.P.closePath = function(e) { e.cmds.push("Z"); }, Ce.U._drawCFF = function(e, t, n, a) { for (var i = t.stack, o = t.nStems, s = t.haveWidth, r = t.width, l = t.open, c = 0, p = t.x, d = t.y, u = 0, h = 0, m = 0, f = 0, g = 0, y = 0, v = 0, b = 0, x = 0, w = 0, k = { val: 0, size: 0 }; c < e.length; ) { Ce.CFF.getCharString(e, c, k); var _ = k.val; if (c += k.size, "o1" == _ || "o18" == _) i.length % 2 != 0 && !s && (r = i.shift() + n.Private.nominalWidthX), o += i.length >> 1, i.length = 0, s = !0; else if ("o3" == _ || "o23" == _) { i.length % 2 != 0 && !s && (r = i.shift() + n.Private.nominalWidthX), o += i.length >> 1, i.length = 0, s = !0; } else if ("o4" == _) i.length > 1 && !s && (r = i.shift() + n.Private.nominalWidthX, s = !0), l && Ce.U.P.closePath(a), d += i.pop(), Ce.U.P.moveTo(a, p, d), l = !0; else if ("o5" == _) for (;i.length > 0; ) p += i.shift(), d += i.shift(), Ce.U.P.lineTo(a, p, d); else if ("o6" == _ || "o7" == _) for (var q = i.length, A = "o6" == _, T = 0; T < q; T++) { var C = i.shift(); A ? p += C : d += C, A = !A, Ce.U.P.lineTo(a, p, d); } else if ("o8" == _ || "o24" == _) { q = i.length; for (var S = 0; S + 6 <= q; ) u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), p = m + i.shift(), d = f + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, p, d), S += 6; "o24" == _ && (p += i.shift(), d += i.shift(), Ce.U.P.lineTo(a, p, d)); } else { if ("o11" == _) break; if ("o1234" == _ || "o1235" == _ || "o1236" == _ || "o1237" == _) "o1234" == _ && (h = d, m = (u = p + i.shift()) + i.shift(), w = f = h + i.shift(), y = f, b = d, p = (v = (g = (x = m + i.shift()) + i.shift()) + i.shift()) + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)), "o1235" == _ && (u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), x = m + i.shift(), w = f + i.shift(), g = x + i.shift(), y = w + i.shift(), v = g + i.shift(), b = y + i.shift(), p = v + i.shift(), d = b + i.shift(), i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)), "o1236" == _ && (u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), w = f = h + i.shift(), y = f, v = (g = (x = m + i.shift()) + i.shift()) + i.shift(), b = y + i.shift(), p = v + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)), "o1237" == _ && (u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), x = m + i.shift(), w = f + i.shift(), g = x + i.shift(), y = w + i.shift(), v = g + i.shift(), b = y + i.shift(), Math.abs(v - p) > Math.abs(b - d) ? p = v + i.shift() : d = b + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, x, w), Ce.U.P.curveTo(a, g, y, v, b, p, d)); else if ("o14" == _) { if (i.length > 0 && !s && (r = i.shift() + n.nominalWidthX, s = !0), 4 == i.length) { var E = i.shift(), I = i.shift(), U = i.shift(), H = i.shift(), O = Ce.CFF.glyphBySE(n, U), j = Ce.CFF.glyphBySE(n, H); Ce.U._drawCFF(n.CharStrings[O], t, n, a), t.x = E, t.y = I, Ce.U._drawCFF(n.CharStrings[j], t, n, a); } l && (Ce.U.P.closePath(a), l = !1); } else if ("o19" == _ || "o20" == _) { i.length % 2 != 0 && !s && (r = i.shift() + n.Private.nominalWidthX), o += i.length >> 1, i.length = 0, s = !0, c += o + 7 >> 3; } else if ("o21" == _) i.length > 2 && !s && (r = i.shift() + n.Private.nominalWidthX, s = !0), d += i.pop(), p += i.pop(), l && Ce.U.P.closePath(a), Ce.U.P.moveTo(a, p, d), l = !0; else if ("o22" == _) i.length > 1 && !s && (r = i.shift() + n.Private.nominalWidthX, s = !0), p += i.pop(), l && Ce.U.P.closePath(a), Ce.U.P.moveTo(a, p, d), l = !0; else if ("o25" == _) { for (;i.length > 6; ) p += i.shift(), d += i.shift(), Ce.U.P.lineTo(a, p, d); u = p + i.shift(), h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), p = m + i.shift(), d = f + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, p, d); } else if ("o26" == _) for (i.length % 2 && (p += i.shift()); i.length > 0; ) u = p, h = d + i.shift(), p = m = u + i.shift(), d = (f = h + i.shift()) + i.shift(), Ce.U.P.curveTo(a, u, h, m, f, p, d); else if ("o27" == _) for (i.length % 2 && (d += i.shift()); i.length > 0; ) h = d, m = (u = p + i.shift()) + i.shift(), f = h + i.shift(), p = m + i.shift(), d = f, Ce.U.P.curveTo(a, u, h, m, f, p, d); else if ("o10" == _ || "o29" == _) { var z = "o10" == _ ? n.Private : n; if (0 == i.length) console.log("error: empty stack"); else { var P = i.pop(), L = z.Subrs[P + z.Bias]; t.x = p, t.y = d, t.nStems = o, t.haveWidth = s, t.width = r, t.open = l, Ce.U._drawCFF(L, t, n, a), p = t.x, d = t.y, o = t.nStems, s = t.haveWidth, r = t.width, l = t.open; } } else if ("o30" == _ || "o31" == _) { var M = i.length, $ = (S = 0, "o31" == _); for (S += M - (q = -3 & M); S < q; ) $ ? (h = d, m = (u = p + i.shift()) + i.shift(), d = (f = h + i.shift()) + i.shift(), q - S == 5 ? (p = m + i.shift(), S++) : p = m, $ = !1) : (u = p, h = d + i.shift(), m = u + i.shift(), f = h + i.shift(), p = m + i.shift(), q - S == 5 ? (d = f + i.shift(), S++) : d = f, $ = !0), Ce.U.P.curveTo(a, u, h, m, f, p, d), S += 4; } else { if ("o" == (_ + "").charAt(0)) throw console.log("Unknown operation: " + _, e), _; i.push(_); } } } t.x = p, t.y = d, t.nStems = o, t.haveWidth = s, t.width = r, t.open = l; }; const Se = getDefaultExportFromCjs(Ce), decode = async () => { var e; const t = ce.document.querySelectorAll("style"); let n = null; if (t.forEach((e => { var t; -1 !== (null == (t = e.textContent) ? void 0 : t.indexOf("font-cxsecret")) && (n = e); })), !n) return !0; const a = null == (e = n.textContent) ? void 0 : e.match(/base64,([\w\W]+?)'/); if (!a) return; const i = base64ToUint8Array(a[1]), o = Se.parse(i); let s = await ttfDownload1("https://www.forestpolice.org/ttf/2.0/table.json") || await ttfDownload1("https://jsd.vxo.im/gh/chengbianruan/staticfile/c.json") || await ttfDownload1("https://cdn.jsdelivr.net/gh/chengbianruan/staticfile/c.json"); if (!s) return !1; let r = {}; for (let l = 19968; l < 40870; l++) { let e = Se.U.codeToGlyph(o, l); e && (e = Se.U.glyphToPath(o, e), e = somd5(JSON.stringify(e)).slice(24), r[l] = s[e]); } return ce.document.querySelectorAll(".font-cxsecret").forEach((e => { let t = e.innerHTML; Object.keys(r).forEach((e => { const n = new RegExp(String.fromCharCode(e), "g"); t = t.replace(n, String.fromCharCode(r[e])); })), e.innerHTML = t, e.classList.remove("font-cxsecret"); })), !0; }, base64ToUint8Array = e => { const t = atob(e), n = new Uint8Array(t.length); for (let a = 0; a < t.length; a++) n[a] = t.charCodeAt(a); return n; }, Ee = [ { type: "ask", name: "\u5b66\u4e60\u901a\u968f\u5802\u7ec3\u4e60", match: () => location.href.includes("/page/quiz/stu/answerQuestion2"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], minDelay: 100, answerDelay: 1e3, question: { html: ".left-question-list>.question-item", question: ".html-content-box", options: "ul.option-list>li", type: ".grey-text", workType: "stlx", pageType: "cx" }, init: async () => {}, ischecked: isParentChecked, questionHook: e => (e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".grey-text").text()), e) }, { type: "save", name: "\u5b66\u4e60\u901a\u8003\u8bd5\u65b0\u7248\u6536\u5f55", match: () => location.href.includes("work/view") || location.href.includes("test/reVersionPaperMarkContentNew"), question: { html: ".questionLi", question: "h3.mark_name", options: "ul.mark_letter.colorDeep > li", type: ".colorShallow", workType: "zj", pageType: "cx" }, answerHook: e => { let t = removeHtml(J(e.html).find('span[class="colorShallow"]').html()); if ("" === t) return null; let n = t.match(/^\((.+?)\)/); if (null === n) return null; e.type = n[1].split(",")[0], e.question = titleClean(e.question.split(t)[1].trim()).trim(), e.options = removeStartChar(e.options); const a = J(e.html).find(".mark_score>.totalScore>i").text(), i = t.match(/(\d+(\.\d+)?)/); let o, s = J(e.html).find(".marking_dui").length > 0 || Number(a) == ((null == i ? void 0 : i[0]) || 0) && 0 != Number(a), r = typeMatch(t); if (!s) switch (r) { case "0": case "1": case "3": 0 != Number(a) && (s = !0); } switch (r) { case "0": case "1": e.type = r, e.answer = J(e.html).find(".mark_answer>div>span.colorGreen:eq(0)").text().replace("\u6b63\u786e\u7b54\u6848:", "").trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = e.answer.filter((e => "" !== e)), 0 === e.answer.length && s && (e.answer = J(e.html).find(".mark_answer>div>span.colorDeep:eq(0)").text().replace("\u6211\u7684\u7b54\u6848:", "").trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = e.answer.filter((e => "" !== e))); break; case "3": if (e.type = "3", e.options = [], e.answer = judgeAnswer(J(e.html).find(".mark_answer>div>span.colorGreen:eq(0)").text().replace("\u6b63\u786e\u7b54\u6848", "")), e.answer, 0 === e.answer.length) { if (o = removeHtml(J(e.html).find(".mark_answer>div>span.colorDeep:eq(0)").html()), e.answer = judgeAnswer(o), 0 === e.answer.length) return null; if (0 == Number(a) && !s && "3" == r) return null; s || (e.answer = "\u6b63\u786e" === e.answer[0] ? [ "\u9519\u8bef" ] : [ "\u6b63\u786e" ]); } break; case "4": if (e.type = "4", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "5": if (e.type = "5", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "7": if (e.type = "7", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "6": if (e.type = "6", e.answer = removeHtml(J(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.answer.length < 10) return null; e.answer = [ e.answer ]; break; case "2": if (e.type = "2", e.answer = J(e.html).find(".mark_answer>div>.colorGreen:eq(0)>dd").map(((e, t) => removeHtml(J(t).html()).replace(`(${e + 1})`, "").trim())).get(), 0 == e.answer.length) { const t = J(e.html).find(".mark_answer>div>.colorDeep:eq(0)>dd").map(((e, t) => removeHtml(J(t).html()).replace(`(${e + 1})`, "").trim())).get(); J(e.html).find(".mark_answer>div>.colorDeep:eq(0)>dd>.marking_dui").length == t.length && (e.answer = t); } break; default: return null; } return e; }, paper: async e => { const t = { platform: "cx" }, n = J("#courseId").val(), a = (ce.document.body.innerHTML.match(/(?:examId|relationId)=(\d+)/) || [])[1] || "", i = `https://mobilelearn.chaoxing.com/v2/apis/class/getClassDetail?courseId=${n}&classId=${J("#classId").val()}`; await request(i, "GET").then((e => { const n = JSON.parse(e[0].responseText).data.course.data[0]; t.name = n.name, t.info = {}, t.info.imageurl = n.imageurl; })), t.hash = n, t.info = {}, t.chapter = [ { hash: `${a}`, name: J(".mark_title").text().trim(), question: e } ], Te.setPaper(t.hash, t); } }, { type: "hook", name: "hook", match: location.href.includes("work/selectWorkQuestionYiPiYue") && location.href.includes("mooc2=0"), main: e => { location.href.includes("mooc2=0") ? ce.location.href = location.href.replace("mooc2=0", "mooc2=1") : ce.location.href = location.href + "&mooc2=1"; } }, { type: "save", name: "\u5b66\u4e60\u901a\u4f5c\u4e1a\u6536\u5f55\u65b0", match: () => location.href.includes("work/selectWorkQuestionYiPiYue") && location.href.includes("mooc2=1"), question: { html: ".TiMu", question: ".Zy_TItle .clearfix", options: "ul.Zy_ulTop li", type: ".newZy_TItle", workType: "zj", pageType: "cx" }, answerHook: e => { e.type = J(e.html).find(".newZy_TItle").text().replace(/\u3010|\u3011/g, "").trim(); let t, n = J(e.html).find(".marking_dui").length > 0; switch (removeHtml(J(e.html).find(".Py_addpy:eq(0)").html()), e.question = titleClean(e.question).trim(), e.type) { case "\u5355\u9009\u9898": case "\u591a\u9009\u9898": e.type = "\u5355\u9009\u9898" === e.type ? "0" : "1", e.options = J(e.html).find("ul.Zy_ulTop li").map(((e, t) => { let n = J(t).find("i.fl").text().trim(), a = removeHtml(J(t).html()); return "" === n ? a.trim() : a.split(n)[1].trim(); })).get(), e.answer = J(e.html).find(".correctAnswer >.fl.answerCon").text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length && n && (e.answer = J(e.html).find(".myAnswer > .fl.answerCon").text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65]))); break; case "\u5224\u65ad\u9898": if (e.type = "3", e.answer = J(e.html).find(".correctAnswer > .fl.answerCon").text().trim().split("").map((e => e.includes("\u6b63\u786e") || e.includes("\u5bf9") || e.includes("\u221a") ? "\u6b63\u786e" : e.includes("\u9519\u8bef") || e.includes("\u9519") || e.includes("\xd7") ? "\u9519\u8bef" : null)).filter((e => null !== e)), 0 === e.answer.length) { t = removeHtml(J(e.html).find(".fl.answerCon").html()); let [n, a] = [ ".marking_dui", ".marking_cuo" ].map((t => J(e.html).find(t).length)); if (n + a === 0) return null; if (t.includes("\u6b63\u786e") || t.includes("\u5bf9") || t.includes("\u221a")) e.answer = [ "\u6b63\u786e" ]; else { if (!(t.includes("\u9519\u8bef") || t.includes("\u9519") || t.includes("\xd7"))) return null; e.answer = [ "\u9519\u8bef" ]; } 0 === n && 0 !== a && (e.answer = "\u6b63\u786e" === e.answer[0] ? "\u9519\u8bef" : "\u6b63\u786e"); } break; case "\u586b\u7a7a\u9898": e.type = "2", e.answer = J(e.html).find(".correctAnswerBx>.correctAnswer>p:not(.clear)").map(((e, t) => removeHtml(J(t).html()).replace(`(${e + 1})`, "").trim())).get().filter((e => "" !== e)), 0 == e.answer.length && (e.answer = J(e.html).find(".myAllAnswerBx>.myAnswerBx>.myAnswer").map(((e, t) => removeHtml(J(t).html()).replace(/\u7b2c[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\u7a7a\uff1a/, "").trim())).get(), e.answer.length !== J(e.html).find(".marking_dui").length && (e.answer = [])); break; case "\u5206\u5f55\u9898": if (e.type = "9", e.answer = J(e.html).find(".correctAnswerBx>.correctAnswer>p:not(.clear)").map(((e, t) => removeHtml(J(t).html()))).get().filter((e => "" !== e)), e.answer.length != J(e.html).find(".CorrectOrNot").length) { if (J(e.html).find(".marking_cuo").length > 0) return null; if (e.answer = J(e.html).find(".myAnswerBx>.myAnswer>p:not(.clear)").map(((e, t) => removeHtml(J(t).html()))).get().filter((e => "" !== e)), e.answer.length != J(e.html).find(".CorrectOrNot").length) return null; } e.answer; break; case "\u8fde\u7ebf\u9898": e.type = "11"; let a = J(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(), i = J(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(); t = J(e.html).find(".correctAnswer >.fl.answerCon >.collectAnswer").map(((e, t) => removeHtml(J(t).text()))).get(), e.options = [ a, i ]; let o = {}; t.forEach((e => { let [t, n] = e.split("-"); t.charCodeAt(0) >= 65 ? t = (t.charCodeAt(0) - 65).toString() : /^\d+$/.test(t) && (t = (parseInt(t) - 1).toString()), n.charCodeAt(0) >= 65 ? n = (n.charCodeAt(0) - 65).toString() : /^\d+$/.test(n) && (n = (parseInt(n) - 1).toString()), o[a[t]] = i[n]; })), e.answer = o, e.answer; break; case "\u9605\u8bfb\u7406\u89e3": const s = J(e.html).find(".readCompreHensionItem").map(((e, t) => { let n = typeMatch(J(t).find("i.index").text()), a = removeHtml(J(t).find(".clearfix").html()), i = J(t).find("ul.Zy_ulTop>li").map(((e, t) => removeHtml(J(t).html()))).get(); i = removeOptionsStartChar(i); let o = removeHtml(J(t).find(".correctAnswerBx>.correctAnswer>.answerCon").text()), s = []; switch (n) { case "0": case "1": s = o.split("").map((e => i[e.charCodeAt(0) - 65])); break; default: return null; } return 0 === s.length ? null : { type: n, question: a, options: i, answer: s }; })).get(); if (null == s || 0 == s.length) return null; e.answer = s.map((e => e.answer)), e.options = s.map((e => (delete e.answer, e))), e.type = "15"; break; default: return e.type, null; } return e; }, paper: async e => { const t = { platform: "cx" }, n = ce.courseId, a = ce.jobid, i = `https://mobilelearn.chaoxing.com/v2/apis/class/getClassDetail?courseId=${n}&classId=${ce.classId}`; await request(i, "GET").then((e => { const n = JSON.parse(e[0].responseText).data.course.data[0]; t.name = n.name, t.info = {}, t.info.imageurl = n.imageurl; })), t.hash = n, t.info = {}, t.chapter = [ { hash: `${a}`, name: J(".ceyan_name>h3").text().trim(), question: e } ], Te.setPaper(t.hash, t); } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65b0\u7248\u4f5c\u4e1a", match: () => /\/mooc2\/work\/dowork/i.test(location.pathname), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], question: { html: ".questionLi", question: "h3", options: "ul:eq(0) li .after, .answer_p", type: "input[name^=answertype]:eq(0)", workType: "zy", pageType: "cx" }, questionHook: e => { const t = removeHtml(J(e.html).find(".colorShallow").html()); return e.question = titleClean(e.question.split(t)[1].trim()).trim(), e.$options = J(e.html).find(".answerBg"), e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65b0\u7248\u8003\u8bd5", match: () => /exam\/preview/i.test(location.pathname) || /exam\/test\/reVersionTestStartNew/i.test(location.pathname), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], question: { html: ".questionLi", question: "h3", options: "ul:eq(0) li .after, .answer_p", type: "input[name^=type]:not([name=type])", workType: "ks", pageType: "cx" }, questionHook: e => { const t = removeHtml(J(e.html).find(".colorShallow").html()); if (e.question = titleClean(e.question.split(t)[1].trim()).trim(), e.$options = J(e.html).find(".answerBg"), "3" === e.type) e.options = []; return e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); }, next: () => { J('.nextDiv .jb_btn:contains("\u4e0b\u4e00\u9898")').click(); } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65e7\u7248\u4f5c\u4e1a", match: () => /work\/doHomeWorkNew/i.test(location.pathname) && 0 == location.href.includes("mooc2=1"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], init: async () => { if (!(await decode())) return msg("\u9875\u9762\u89e3\u5bc6\u5931\u8d25\uff0c\u65e0\u6cd5\u7b54\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u53cd\u9988\u7ed9\u4f5c\u8005\u5427", "error"), !1; }, question: { html: ".TiMu", question: ".clearfix.fontLabel", options: "ul:eq(0) li .after", type: "input[name^=answertype]:eq(0), .answer_p", workType: "zy", pageType: "cx" }, questionHook: e => { switch (e.question = titleClean(e.question).trim(), e.$options = J(e.html).find(".fl.before"), e.type) { case "3": e.options = J(e.html).find("ul:eq(0) li").map(((e, t) => J(t).find(".ri").length > 0 ? "\u6b63\u786e" : J(t).find(".wr").length > 0 ? "\u9519\u8bef" : isTrue(J(t).attr("aria-label") || "") ? "\u6b63\u786e" : isFalse(J(t).attr("aria-label") || "") ? "\u9519\u8bef" : void 0)).get(), e.$options = J(e.html).find("ul>li"); break; case "11": let t = J(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(), n = J(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(); e.options = [ t, n ], e.$options = J(e.html).find("ul.thirdUlList>li:not(.groupTitile)"); } return e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); }, setAnswer: e => { switch (e.type) { case "11": return e.ques.$options.each(((t, n) => { let a = e.ques.options[0], i = e.ques.options[1], o = e.answer[a[t]], s = i.indexOf(o); o = String.fromCharCode(s + 65), J(n).find("select>option").each(((e, t) => { J(t).val(), J(t).val() == o && J(t).prop("selected", !0); })); })), e.answer, !1; case "3": let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && (isTrue(removeHtml(J(n).html())) || J(n).find(".ri").length > 0) && J(n).find("input").click(), isFalse(t) && (isFalse(removeHtml(J(n).html())) || J(n).find(".wr").length > 0) && J(n).find("input").click(); })), !1; default: return !0; } } }, { type: "ask", name: "\u5b66\u4e60\u901a\u65b0\u7248\u7ae0\u8282", match: () => /work\/doHomeWorkNew/i.test(location.pathname) && location.href.includes("mooc2=1"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ], init: async () => { if (!(await decode())) return msg("\u9875\u9762\u89e3\u5bc6\u5931\u8d25\uff0c\u65e0\u6cd5\u7b54\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u53cd\u9988\u7ed9\u4f5c\u8005\u5427", "error"), !1; }, question: { html: ".TiMu", question: ".clearfix.fontLabel", options: "ul:eq(0) li .after, .answer_p", type: "input[name^=answertype]:eq(0)", workType: "zj", pageType: "cx" }, questionHook: e => { switch (e.question = titleClean(e.question).trim(), e.type) { case "3": e.options = J(e.html).find("ul:eq(0) li").map(((e, t) => "true" === J(t).find(".num_option").attr("data") ? "\u6b63\u786e" : "false" === J(t).find(".num_option").attr("data") ? "\u9519\u8bef" : void 0)).get(), e.options = []; break; case "11": let t = J(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(), n = J(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => { let n = J(t).clone(); return n.find(".fl").remove(), removeHtml(n.html()); })).get(); e.options = [ t, n ], e.$options = J(e.html).find("ul.thirdUlList>li:not(.groupTitile)"); break; case "15": const a = J(e.html).find(".readCompreHensionItem").map(((e, t) => { let n = typeMatch(J(t).find("i.index").text()), a = removeHtml(J(t).find(".clearfix").html()), i = J(t).find("ul.Zy_ulTop>li").map(((e, t) => removeHtml(J(t).html()))).get(); return i = removeOptionsStartChar(i), { type: n, question: a, options: i, $options: J(t).find("ul.Zy_ulTop>li") }; })).get(); if (null == a || 0 == a.length) return null; e.options = a, e.$options = null; break; default: e.type; } return e; }, setAnswerHook: e => { qc(e.html), qc1(e.html); }, setAnswer: e => (e.ques.options, "11" !== e.type || (e.ques.$options.each(((t, n) => { let a = e.ques.options[0], i = e.ques.options[1], o = e.answer[a[t]], s = i.indexOf(o); o = String.fromCharCode(s + 65), ce.$(n).find(".dept_select").chosen().val(o).trigger("chosen:updated"); })), e.answer, !1)) } ], Ie = [ { type: "ask", name: "\u667a\u6167\u6811\u7ae0\u8282", tips: "\u667a\u6167\u6811\u5fc5\u987b\u5f00\u81ea\u52a8\u8df3\u8f6c\uff0c\u5426\u5219\u7b54\u6848\u53ef\u80fd\u65e0\u6cd5\u4fdd\u5b58\u5bfc\u81f4\u4f4e\u5206\uff01", match: () => location.href.includes("zhihuishu.com") && !location.href.includes("checkHomework") && location.host.includes("zhihuishu") && ("/stuExamWeb.html" === location.pathname || location.href.includes("/webExamList/dohomework/") || location.href.includes("/webExamList/doexamination/")), types: [ "0", "1", "2", "3" ], question: { html: ".examPaper_box > div:eq(1) >div:not(.examPaper_partTit)", question: ".subject_describe.dynamic-fonts:eq(0) div:eq(0)", options: ".subject_node .nodeLab .label.clearfix .node_detail", type: ".subject_type span:first-child", workType: "zhs", pageType: "zhs" }, init: async () => { await waitUntil((function() { return !J(".yidun_popup").hasClass("yidun_popup--light") && ce.zhsques; })); }, next: () => { J(".switch-btn-box button:eq(1)").click(); }, questionHook: (e, t) => { const n = ce.zhsques.examBase.workExamParts.map((e => e.questionDtos)).flat()[t]; return e.type = typeConvert(n.questionType.name), e.question = removeHtml(n.name), e.options = n.questionOptions ? n.questionOptions.map((e => removeHtml(e.content))) : [], "3" == e.type && (e.options = []), e; } }, { type: "save", name: "\u667a\u6167\u6811\u4f5c\u4e1a\u6536\u5f55", match: () => location.href.includes("zhihuishu.com") && location.href.includes("checkHomework") && location.host.includes("zhihuishu") && ("/stuExamWeb.html" === location.pathname || location.href.includes("/webExamList/checkHomework/")), question: { html: ".questionType", question: ".subject_describe", options: ".examquestions-answer", type: ".newZy_TItle", workType: "zhs", pageType: "zhs" }, init: async () => { await waitUntil((function() { return J(".questionType").length > 0 && J(".questionType:eq(0)")[0].__vue__.answerImgMap; })); }, answerHook: e => { const t = J(e.html)[0].__vue__, n = t.answerData[t.data.id], a = "1" === n.isCurrent ? n.answer.split(",") : [], i = t.data, o = t.answerImgMap[t.data.id] || ""; t.answerImgMap, t.data.id, somd5(o), e.type = typeMatch(i.questionType.name); const s = []; if (e.options = i.questionOptions.map((e => (a.includes(String(e.id)) && s.push(removeHtml(e.content)), removeHtml(e.content)))), e.answer = s, "3" === e.type) { e.options = []; const t = e.answer[0]; e.answer = isTrue(t) ? [ "\u6b63\u786e" ] : isFalse(t) ? [ "\u9519\u8bef" ] : []; } return e; } }, { type: "save", name: "\u667a\u6167\u6811\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("zhihuishu.com") && location.href.includes("/atHomeworkExam/stu/examQ/doExamnew"), question: { html: ".subjecttype-div.clearfloat", question: ".subjectTitle-p", options: ".TitleOptions-div label", type: ".subjecttopic-div", workType: "zhs", pageType: "zhs" }, init: async () => { await waitUntil((function() { return J(".subjecttype-div.clearfloat").length > 0; })); }, answerHook: e => { const t = J(e.html).find(".Referenceanswer-div.clearFloat>.Referenceanswer-r.fl").text(); return e.question = removeHtml(e.question), e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".subjecttopic-div").text()), e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), "3" == e.type && (e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []), e; } } ], Ue = [ { type: "hook", name: "\u82af\u4f4d\u6559\u80b2hook", match: "www.beeline-ai.com" === location.host, main: async e => { const getPageIdentifier = () => J(".el-main > div:eq(0)").attr("class"); ce.mainClass = getPageIdentifier(); const t = new MutationObserver((async e => { const n = getPageIdentifier(); ce.mainClass !== n && (ce.mainClass = n, "homework-detail-container" === n && await waitUntil((() => 0 === J(".el-loading-mask").length)), vuePageChange(), t.disconnect()); for (const a of e) if ("attributes" === a.type && "class" === a.attributeName) { const e = a.target.textContent; if (e && (e.includes("\u4e0b\u4e00\u9898") || e.includes("\u4e0a\u4e00\u9898"))) { vuePageChange(), t.disconnect(); break; } } })); J("body").length >= 1 && t.observe(J("body")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u82af\u4f4d\u6559\u80b2\u4f5c\u4e1a", tips: "\u82af\u4f4d\u6559\u80b2\u4ec5\u652f\u6301\u9009\u62e9\u5224\u65ad\uff0c\u5176\u4ed6\u9898\u578b\u5f85\u9002\u914d", match: () => "www.beeline-ai.com" === location.host && (/student\/#\/courseInfo\/[A-Za-z0-9]+\/homework/i.test(location.href) || /student\/#\/courseInfo\/[A-Za-z0-9]+\/exam/i.test(location.href)), types: [ "0", "1", "3" ], question: { html: ".content-area > div.content", question: ".content", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "xinwei", pageType: "xinwei" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-box").length; })); }, next: () => { J('.toggle-box > button:contains("\u4e0b\u4e00\u9898")').click(); }, ischecked: isParentChecked, questionHook: e => (e.type = typeMatch(J(e.html).find(".question-box>.tag").text()), e) }, { type: "save", name: "\u82af\u4f4d\u6559\u80b2\u6536\u5f55", match: () => "www.beeline-ai.com" === location.host && location.href.includes("/homeworkDetailPage"), question: { html: ".question-content-body", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "xinwei", pageType: "xinwei" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-content-body").length; })); }, answerHook: e => { e.type = typeMatch(J(e.html).find(".question-box>.tag").text()); let t = J(e.html).find(".answer-area > span:eq(1)").text(); switch (e.type) { case "0": case "1": let n = t.split(","); if (e.answer = n.map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return; break; case "3": "T" == t && (e.answer = [ "\u6b63\u786e" ]), "F" == t && (e.answer = [ "\u9519\u8bef" ]); } return e; } } ], updateAiCookieCredential = (e, t, n, a) => { var i; (null == (i = e.ai) ? void 0 : i.updateCredential) && e.ai.updateCredential(t, { type: "cookie-token", value: n }), ((e, t, n) => { const a = "legacy-glm" === t ? "GLM" : "spark"; e.app.gpt.forEach((e => { e.name === a && (e.key = n); })), e.setConfig(e.app); })(e.app, t, n), msg(a); }, He = [ { type: "hook", name: "\u667a\u666e\u6e05\u8a00token\u83b7\u53d6", match: /chatglm.cn\/main\//i.test(location.href), main: e => { const t = document.cookie.split(";"); let n = ""; t.forEach((e => { /chatglm_refresh_token/i.test(e) && (n = e.split("=")[1]); })), n && updateAiCookieCredential(e, "legacy-glm", n, "\u667a\u666e\u6e05\u8a00token\u83b7\u53d6\u6210\u529f"); } }, { type: "hook", name: "\u8baf\u98de\u661f\u706btoken\u83b7\u53d6", match: /xinghuo.xfyun.cn\/desk/i.test(location.href), main: e => { const t = document.cookie.split(";"); let n = ""; t.forEach((e => { /ssoSessionId/i.test(e) && (n = e.split("=")[1]); })), n && updateAiCookieCredential(e, "legacy-spark", n, "\u8baf\u98de\u661f\u706btoken\u83b7\u53d6\u6210\u529f"); } } ], Oe = { single_selection: "\u5355\u9009\u9898", multiple_selection: "\u591a\u9009\u9898", true_or_false: "\u5224\u65ad\u9898", fill_in_blank: "\u586b\u7a7a\u9898", short_answer: "\u7b80\u7b54\u9898", text: "\u6587\u672c", analysis: "\u7efc\u5408\u9898", matching: "\u5339\u914d\u9898", random: "\u968f\u673a\u9898", cloze: "\u5b8c\u5f62\u586b\u7a7a\u9898" }, je = [ { type: "hook", name: "\u56fd\u5f00hook", match: location.host.includes("ouchn.cn"), main: e => { observeVuePageChange(J("body")[0], getUrl, { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 !== J(".selectDan").length; })); } }); } }, { type: "save", name: "\u56fd\u5f00\u7b54\u6848\u6536\u5f55\u65e7", match: () => /\/exam\/([0-9]+)\/subjects#\/submission\/([0-9]+)/i.test(location.href), question: { html: "li.subject", question: ".summary-title .subject-description", options: ".subject-options li .option-content", type: ".subject-point > span:eq(0)", workType: "guokai", pageType: "guokai" }, init: async () => { await waitUntil((function() { return J(".loading-gif").hasClass("ng-hide"); })); }, answerHook: e => { const t = ce.angular.element(e.html).scope().subject; if ("text" === t.type) return; let n = !1; const a = parseFloat(t.point), i = parseFloat(t.score), o = 0 !== a && a === i; let s = J(`
${e.answer}
`), !1; } return !0; } }, { type: "save", name: "\u804c\u6559\u4e91\u6536\u5f55", match: () => location.href.includes("examrecord_recordDetail.action"), question: { html: ".q_content", question: ".divQuestionTitle", options: ".questionOptions>div.q_option_readonly", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".q_content").length; })); }, answerHook: e => { const t = J(e.html).find(".exam.icon_examright").length, n = J(e.html).find("input[name='quesId']:not([id='']").attr("id"), a = J(`input#qId${n}`).attr("qtype"), i = J(e.html).find("span[name^='questionIndex']").text().trim() + "\u3001", o = J(e.html).find(".q_score").text().trim(); switch (e.question = e.question.replace(i, "").replace(o, "").trim(), e.options = J(e.html).find(".questionOptions>div.q_option_readonly").map(((e, t) => { let n = J(t).find("span[name='optionIndexName']").text().trim(); return removeHtml(J(t).html()).replace(n, "").trim(); })).get(), a) { case "\u5355\u9879\u9009\u62e9\u9898": case "\u5355\u9009\u9898": case "singlechoice": e.type = "0"; break; case "\u591a\u9879\u9009\u62e9\u9898": case "\u591a\u9009\u9898": case "multichoice": e.type = "1"; break; case "\u5224\u65ad\u9898": case "bijudgement": e.type = "3"; break; case "fillblank": case "\u586b\u7a7a\u9898": e.type = "2"; const t = J(e.html).find(".answerOption>span:eq(0)").clone(); t.find(".exam_answers").remove(), e.question = titleClean(removeHtml(t.html())).replace(/\uff08.*?\u5206\uff09/g, "").trim(); break; case "cloze": case "\u5b8c\u5f62\u586b\u7a7a": e.type = "14", e.options = J(e.html).find(".questionOptions>.exam_cloze_choice").map(((e, t) => [ J(t).find(".optionContent").map(((e, t) => removeHtml(J(t).html()))).get() ])).get(), e.answer = J(e.html).find(".exam_rightAnswer .answer_table .one_answer>span").map(((t, n) => { const a = J(n).text().trim(); return e.options[t][a.charCodeAt(0) - 65]; })).get(); break; case "textarea": e.type = "4", e.options = [], e.answer = removeHtml(J(e.html).find(".exam_rightAnswer .has_standard_answer").html()); } switch (e.type) { case "0": case "1": if (e.answer = J(e.html).find('.exam_rightAnswer .exam_answers_tit>span[name="rightAnswer"]').text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer, 0 == e.answer.length) { if (0 == t) return; e.answer = J(e.html).find('.exam_stu_answer span[name="stuAnswer"]').text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])); } break; case "2": e.answer = 0 == t ? J(e.html).find(".exam_rightAnswer span.fillblank_answer").map(((e, t) => removeHtml(J(t).html()))).get() : J(e.html).find(".exam_stu_answer span.fillblank_answer").map(((e, t) => removeHtml(J(t).html()))).get(), e.answer; break; case "3": e.options = []; let n = J(e.html).find('.exam_stu_answer span[name="stuAnswer"]').text().trim(); [ "\u6b63\u786e", "\u9519\u8bef" ].includes(n) && t && (e.answer = [ n ]); } return e; } }, { type: "save", name: "\u667a\u6167\u804c\u6559\u6536\u5f55", match: () => "zjy2.icve.com.cn" === location.host && (location.href.includes("/spocviewsJob") || location.href.includes("/viewExam")), question: { html: ".subjectDet", question: ".seeTitle .htmlP.ql-editor", options: ".optionList .htmlP.ql-editor", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".subjectDet").length; })); }, answerHook: e => { const t = J(e.html).find(".xvhao").text().trim(); e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")); let n = J(e.html).find(".answer").text().trim(); switch (e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "2": e.options = [], e.answer = J(e.html).find(".answer>span").map(((e, t) => removeHtml(J(t).html()))).get(); break; case "3": e.options = J(e.html).find(".optionList>div").map(((e, t) => removeHtml(J(t).html()))).get(), e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = judgeAnswer(e.answer[0]), e.options = []; break; case "11": const t = J(e.html).find(".optionList .matching>.htmlP.ql-editor").map(((e, t) => removeHtml(J(t).html()))).get(), a = J(e.html).find(".optionList>.text .htmlP.ql-editor").map(((e, t) => removeHtml(J(t).html()))).get(); e.options = [ t, a ]; let i = {}; n = J(e.html).find(".answer>span").map(((e, n) => { let [o, s] = J(n).text().trim().split("."); o.charCodeAt(0) >= 65 ? o = (o.charCodeAt(0) - 65).toString() : /^\d+$/.test(o) && (o = (parseInt(o) - 1).toString()), s.charCodeAt(0) >= 65 ? s = (s.charCodeAt(0) - 65).toString() : /^\d+$/.test(s) && (s = (parseInt(s) - 1).toString()), i[t[o]] = a[s]; })), e.answer = i; } return e; } }, { type: "ask", name: "\u667a\u6167\u804c\u6559+\u7b54\u9898", tips: "\u8be5\u5e73\u53f0\u95ee\u9898\u8f83\u591a\uff0c\u9047\u5230\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.href.includes("coursePreview/jobTest") || location.href.includes("spockeepTest") || location.href.includes("spocjobTest"), types: [ "0", "1", "3" ], question: { html: ".subjectDet", question: ".ql-editor", options: ".optionList .ql-editor", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".subjectDet").length; })); }, ischecked: e => e.parent().parent().parent().hasClass("is-checked"), questionHook: e => { const t = J(e.html).find(".title.titleTwo").text().trim(); if (e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")), "3" === e.type) e.options = [], e.$options = J(e.html).find(".optionList>div label"); return e; } }, { type: "save", name: "\u667a\u6167\u804c\u6559+\u6536\u5f55", match: () => "zyk.icve.com.cn" === location.host && (location.href.includes("/coursePreview/viewJob1") || location.href.includes("/viewExam")), question: { html: ".subjectDet", question: ".seeTitle>span:eq(1)", options: ".optionList>div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".subjectDet").length; })); }, answerHook: e => { e.options = removeStartChar(e.options); const t = J(e.html).find(".xvhao").text().trim(); e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")); let n = J(e.html).find(".answer").text().trim(); switch (e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "2": e.options = [], e.answer = J(e.html).find(".answer>span").map(((e, t) => removeHtml(J(t).html()))).get(); break; case "3": e.options = J(e.html).find(".optionList>div").map(((e, t) => removeHtml(J(t).html()))).get(), e.answer = n.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = judgeAnswer(e.answer[0]), e.options = []; } return e; } }, { type: "save", name: "ai\u4f18\u8bfe\u6536\u5f55\u65b0", match: () => "ai.icve.com.cn" === location.host && location.href.includes("/review-exam/"), question: { html: () => { let e = J(".examination-paper")[0].__vue__.sjAllInfo.questions, t = []; return e.sort(((e, t) => e.txdm - t.txdm)), e.forEach((e => { t.push(e); })), t; }, question: ".seeTitle>span:eq(1)", options: ".optionList>div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".examination-paper")[0].__vue__.sjAllInfo.questions.length; })); let e = J(".examination-paper")[0].__vue__.sjAllInfo.questions, t = []; e.sort(((e, t) => e.txdm - t.txdm)), e.forEach((e => { t.push(e); })), ce.quesList = t; }, answerHook: (e, t) => { const n = e.html; e.type = typeMatch(n.type), e.question = titleClean(n.tmmc); let a = []; switch (e.type) { case "3": "1" == n.answer && (e.answer = [ "\u6b63\u786e" ]), "0" == n.answer && (e.answer = [ "\u9519\u8bef" ]); break; case "2": e.answer = n.answer.split(","); break; case "4": e.answer = n.answer; break; case "0": case "1": e.options = n.sjtmxxlist.map((e => ("1" == e.sfzqda && a.push(removeHtml(e.xxnr)), removeHtml(e.xxnr)))), e.answer = a; } return e; }, paper: async e => {} }, { type: "ask", name: "ai\u4f18\u8bfe\u7b54\u9898", tips: "", match: () => "ai.icve.com.cn" === location.host && location.href.includes("/preview-exam/"), types: [ "0", "1" ], question: { html: () => { let e = J(".examination-paper")[0].__vue__.tmActivelist, t = []; return e.sort(((e, t) => e.px - t.px)), e.forEach((e => { t.push(e); })), t; }, question: ".seeTitle>span:eq(1)", options: "label", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== J(".examination-paper")[0].__vue__.tmActivelist.length; })); }, toquestion: e => { J(".topic-zpx-list .topic-zpx-main span:eq(" + e + ")").click(); }, ischecked: e => e.hasClass("wrongXz"), questionHook: e => { var t; const n = e.html, a = J(".examination-paper")[0].__vue__.topList, i = []; Object.keys(a).forEach((e => { a[e].forEach((t => { i.push({ id: t.id, type: t.txdmmc || e }); })); })); const o = (null == (t = i.find((e => e.id === n.id))) ? void 0 : t.type) || "\u5176\u4ed6"; e.type = typeMatch(o), e.question = titleClean(n.title); const s = n.dataArr.map((e => removeHtml(e.Content))); return e.options = s, e.answer = [], e.html = J(".content-center"), e.$options = () => J("label"), e; } } ], Me = [ { type: "ask", name: "\u5ddd\u519c\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.host.includes("cnzx.info") && location.href.includes("KaoShi/ShiTiYe.aspx"), types: [ "0", "1", "3" ], question: { html: "li.question", question: ".wenti >p.stem", options: ".wenti > ol > li", type: ".question_head > span:eq(0)", workType: "cnzx", pageType: "cnzx" }, init: async () => {}, ischecked: e => e.find("input").prop("checked"), questionHook: e => (e.$options = J(e.html).find(".wenti > ol > li input"), 0 !== e.options.length && (e.type = "radio" === e.$options.eq(0).attr("type") ? "0" : "1", 2 === e.options.length && e.options.includes("\u6b63\u786e") && e.options.includes("\u9519\u8bef") && (e.type = "3", e.options = [])), e), setAnswer: e => "3" !== e.type || (J(e.html).find(".wenti > ol > li").each(((t, n) => { isTrue(e.answer) && isTrue(removeHtml(J(n).html())) && e.ques.$options.eq(t).click(), isFalse(e.answer) && isFalse(removeHtml(J(n).html())) && e.ques.$options.eq(t).click(); })), !1), finish: e => { J("li.paginationjs-next.J-paginationjs-next").click(); } }, { type: "save", name: "\u5ddd\u519c\u5728\u7ebf\u6536\u5f55", match: () => location.host.includes("cnzx.info") && location.href.includes("ZaiXianLianXi.aspx"), question: { html: ".ShiTi>.ShiTiMiaoShu", question: ".ShiTiMiaoShu", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "cnzx", pageType: "cnzx" }, init: async () => {}, answerHook: e => { J(e.html).text(), e.question = removeHtml(titleClean(removeHtml(J(e.html).html()))); let t = J("ul.TiXing>li.DangQianTiXing:eq(0)>a").text(), n = [], a = J(e.html).next(); switch (e.options = removeStartChar(a.find("ul li").map(((e, t) => (J(t).hasClass("DaAn1") && n.push(e), titleClean(removeHtml(J(t).html()))))).get()), e.answer = n.map((t => e.options[t])), t) { case "\u5355\u9009\u9898": case "\u8bcd\u6c47\u4e0e\u7ed3\u6784": case "\u4ea4\u9645\u7528\u8bed": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.type = "3", e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []; } return e; } } ], $e = [ { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u65e7\u7248)", tips: "", match: () => location.href.includes("study/html/content/studying/?courseOpenId=") || location.href.includes("study/html/content/sxsk/?courseOpenId=") || location.href.includes("study/html/content/tkOnline/?courseOpenId=") || location.href.includes("study/html/content/bkExam/?courseOpenId="), types: [ "0", "1", "3" ], question: { html: ".e-q-body>.e-q", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".e-q-body>.e-q") && isExist(".e-item"); })), !isExist(".photo-time") && !isExist(".btn_save")) return !1; }, ischecked: e => e.parent().hasClass("checked"), questionHook: e => { var t; const n = J(e.html).parent().parent(); switch (e.type = n ? null == (t = n.attr("id")) ? void 0 : t.trim() : "", e.type) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.$options = J(e.html).find("ul>li"); break; case "4": e.type = "2"; break; case "5": e.type = "4"; break; default: e.type, e.type = "8"; } return e; }, setAnswer: e => { switch (e.type) { case "4": case "2": return J(e.html).find("textarea.answer-input").focus(), J(e.html).find(" textarea.answer-input"), J(e.html).find(".answer-input.edui-default").each(((t, n) => { let a = J(n).attr("id"), i = ce.UE.getEditor(a); i.ready((function() { i.setContent(`${e.answer[t]}
`); })); })), J(e.html).find(".answer-input").blur(), !1; } return !0; } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u65e7\u7248)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("study/html/content/studying/?courseOpenId=") || location.href.includes("study/html/content/sxsk/?courseOpenId=") || location.href.includes("study/html/content/tkOnline/?courseOpenId=") || location.href.includes("study/html/content/bkExam/?courseOpenId="), question: { html: ".e-q-body>.e-q", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".e-save"), isExist(".e-q-body>.e-q") && isExist(".w_e-q-panel"); })), !isExist(".e-quest-review")) return !1; }, answerHook: e => { var t; const n = J(e.html).parent().parent(); e.type = n ? null == (t = n.attr("id")) ? void 0 : t.trim() : "", e.$options = J(e.html).find("ul>li"); let a = J(e.html).find("ul>li.checked").map(((e, t) => removeHtml(J(t).find(".ErichText").html()))).get(); const i = J(e.html).find(".e-q-right").length > 0; e.answer = a.filter((e => "" !== e)); let o = J(e.html).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(J(t).html()))).get(); 1 === o.length && o[0].length > 1 && (o = o[0].split("\u3001")); let s = o.map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })).filter((e => "" !== e && void 0 !== e)); switch (e.type) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.answer = J(e.html).find("ul>li.checked").map(((e, t) => removeHtml(J(t).html()))).get(), e.options = [], isTrue(e.answer[0]) ? e.answer = [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? e.answer = [ "\u9519\u8bef" ] : e.answer = []; break; case "4": e.type = "2", e.options = []; break; case "5": e.type = "4", s = [ removeHtml(J(e.html).find(".e-ans-ref>.e-ans-r").html()) ], e.options = []; break; case "11": e.type = "19"; const t = J(e.html).find("form").map(((e, t) => ({ type: "0", question: removeHtml(J(t).find(".e-q-q .ErichText").html()), options: J(t).find("ul li .ErichText").map(((e, t) => removeHtml(J(t).html()))).get() }))).get(); s = s.length > 0 ? judgeAnswer(s[0]) : [], e.options = t; default: return void e.type; } if (s.length > 0) return e.answer = s, e; if (!i && "3" === e.type && e.answer.length > 0) { if (e.answer = function(e) { if (!isTrue(e[0]) && !isFalse(e[0])) return e[0], []; return isTrue(e[0]) ? [ "\u9519\u8bef" ] : isFalse(e[0]) ? [ "\u6b63\u786e" ] : []; }(e.answer), 0 === e.answer.length) return; } else if (!i) return; return e; }, paper: e => { const t = ce.online, n = { platform: "ahjxjy" }; n.hash = t.courseOpenId, n.name = ce.localStorage.courseNmae, n.info = {}, n.chapter = [ { hash: `${t.cell.id}`, name: t.cell.title, question: e } ], Te.setPaper(n.hash, n); } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u65b0\u7248)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("/myHomework/answerRecord") || location.href.includes("/myHomework/assignment") || location.href.includes("/myExam/examDetails") || location.href.includes("/myExam/examHistory"), question: { html: ".option>div[id='answer-card-area']", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { await waitUntil((function() { return isExist(".option>div[id='answer-card-area']"); })); }, answerHook: (e, t) => { const n = J("micro-app-body>#app>div")[0].__vue__.hierarchyList[t]; e.type = typeMatch(n.name), e.question = titleClean(removeHtml(n.Content)); const {options: a, answer: i} = n.CourseQuestionOptionList.reduce(((e, t) => { const n = removeHtml(t.Content); return t.IsAnswer && e.answer.push(n), e.options.push(n), e; }), { options: [], answer: [] }); return e.options = a, e.answer = "3" === e.type ? [ judgeAnswer(i[0]) ] : i, "3" === e.type && (e.options = []), e; } }, { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u65b0\u7248)", tips: "\u5355\u9898\u95f4\u9694\u5fc5\u987b\u5927\u4e8e 3 \u79d2\uff01\uff01\u5426\u5219\u5bb9\u6613\u5f02\u5e38\uff01\uff01", match: () => location.href.includes("/myHomework/assignment") || location.href.includes("/myExam/examDetails"), types: [ "0", "1", "3" ], minDelay: 3e3, answerDelay: 1e3, question: { html: ".option>div[id='answer-card-area']", question: ".ErichText", options: "ul.answer-list>li", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".option>div[id='answer-card-area']"); })), !J(".submit-area").text().includes("\u63d0\u4ea4")) return !1; const e = J("micro-app-body>#app>div")[0].__vue__, t = e.hierarchyList[0]; e.goAnchor(t.Id); }, toquestion: e => { const t = J("micro-app-body>#app>div")[0].__vue__, n = t.hierarchyList[e]; (null == n ? void 0 : n.Id) && t.goAnchor(n.Id); }, ischecked: e => e.hasClass("on"), questionHook: (e, t) => { const n = J("micro-app-body>#app>div")[0].__vue__.hierarchyList[t]; e.type = typeMatch(n.name), e.question = titleClean(removeHtml(n.Content)); let a = []; return n.CourseQuestionOptionList.forEach((e => { const t = removeHtml(e.Content); e.IsAnswer, a.push(t); })), e.options = a, e.html = "body", e.$options = () => J("ul.answer-list>li"), e; } }, { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u81ea\u8003)", tips: "", match: () => location.href.includes("/userinfo/testPaper"), types: [ "0", "1", "3" ], question: { html: ".item-card-area", question: ".desc", options: "ul>li", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".exam-paper-wrap"); })), isExist(".exam-process-area")) return !1; const e = J(".exam-paper-wrap")[0].__vue__.topicList.map((e => e.getPaperList)).flat(); window.Zques = e; }, ischecked: e => e.parent().hasClass("checked"), questionHook: (e, t) => { const n = Zques[t]; e.type = typeMatch(n.questionTypeName), e.question = titleClean(removeHtml(n.content)); const {options: a, answer: i} = n.courseQuestionOptionList.reduce(((e, t) => { const n = removeHtml(t.content); return t.isAnswer && e.answer.push(n), e.options.push(n), e; }), { options: [], answer: [] }); return e.options = a, e.answer = "3" === e.type ? [ judgeAnswer(i[0]) ] : i, "3" === e.type && (e.options = []), e; }, setAnswer: e => { switch (e.type) { case "4": case "2": return J(e.html).find("textarea.answer-input").focus(), J(e.html).find(" textarea.answer-input"), J(e.html).find(".answer-input.edui-default").each(((t, n) => { let a = J(n).attr("id"), i = ce.UE.getEditor(a); i.ready((function() { i.setContent(`${e.answer[t]}
`); })); })), J(e.html).find(".answer-input").blur(), !1; } return !0; } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u81ea\u8003)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("/userinfo/testPaper"), question: { html: ".item-card-area", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".exam-paper-wrap"); })), !isExist(".score-describe")) return !1; const e = J(".exam-paper-wrap")[0].__vue__.topicList.map((e => e.getPaperList)).flat(); window.Zques = e; }, answerHook: (e, t) => { const n = Zques[t]; e.type = typeMatch(n.questionTypeName), e.question = titleClean(removeHtml(n.content)); const {options: a, answer: i} = n.courseQuestionOptionList.reduce(((e, t) => { const n = removeHtml(t.content); return t.isAnswer && e.answer.push(n), e.options.push(n), e; }), { options: [], answer: [] }); return e.options = a, e.answer = "3" === e.type ? [ judgeAnswer(i[0]) ] : i, "3" === e.type && (e.options = []), e; } } ], Fe = [ { type: "save", name: "\u9752\u4e66\u4f5c\u4e1a\u7b54\u9898\u6536\u5f55", match: () => location.host.includes("qingshuxuetang.com") && (location.href.includes("Student/ExercisePaper?courseId=") || location.href.includes("Student/ViewQuiz?quizId=") || location.href.includes("Student/SimulationExercise/Detail?id=") || location.href.includes("Student/Quiz/Detail?id=")), question: { html: ".paper-container > .question-detail-container", question: ".question-detail-description", options: ".question-detail-options .question-detail-option .option-description-preview", type: ".question-detail-type-desc", workType: "qingshu", pageType: "qingshu" }, init: async () => { await waitUntil((function() { return isExist(".question-detail-container") && ce.qsques; })); }, answerHook: (e, t) => { const n = ce.qsques[t]; switch (e.question = removeHtml(n.description), e.options = n.options ? n.options.map((e => removeHtml(e.description))) : [], e.type = typeConvert(n.typeDesc), e.answer = n.solution.split("").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "3": e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : [ "" ]; break; case "15": e.options = [], e.answer = [], n.subQuestions.forEach((t => { let n = t.options ? t.options.map((e => removeHtml(e.description))) : [], a = t.solution.split("").map((e => n[e.charCodeAt(0) - 65])); e.answer.push(a), e.options.push(n); })); } return e; } }, { type: "ask", name: "\u9752\u4e66\u5b66\u5802\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.host.includes("qingshuxuetang.com") && (location.href.includes("/Student/ExercisePaper") || location.href.includes("Student/ExamPaper") || location.href.includes("Student/ViewQuiz") || location.href.includes("Student/SimulationExercise/Detail") || location.href.includes("Student/Quiz/Detail")), types: [ "0", "1", "3" ], question: { html: ".paper-container > .question-detail-container", question: ".question-detail-description", options: ".question-detail-options .question-detail-option .option-description", type: ".question-detail-type-desc", workType: "qingshu", pageType: "qingshu" }, init: async () => { await waitUntil((function() { return isExist(".question-detail-container") && ce.qsques; })); }, ischecked: e => e.parent().find("input").prop("checked"), toquestion: e => { J(`.group_item:eq(${e})`), J(`.group_item:eq(${e})`).click(); }, questionHook: (e, t) => { const n = ce.qsques[t]; if (e.question = removeHtml(n.description), e.options = n.options ? n.options.map((e => removeHtml(e.description))) : [], e.type = typeConvert(n.typeDesc), "3" === e.type) e.options = []; return e; } } ], Ne = [ { type: "save", name: "\u4f18\u8bfe\u5728\u7ebf\u6536\u5f55", match: () => "cce.org.uooconline.com" === location.host && (location.href.includes("/exam/paper") || location.href.includes("/exam/")), question: { html: ".queContainer", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "uooc", pageType: "uooc" }, init: async () => { await waitUntil((function() { return 0 !== J(".queContainer").length; })); }, answerHook: e => { const t = ce.angular.element(e.html).scope().question; if (e.type = typeConvert(t.type_text), e.question = t.question, e.options = t.options_app.map((e => e.value)), e.answer = t.answer.map((e => t.options[e])), "3" === e.type) e.options = [], e.answer = judgeAnswer(e.answer[0]); return e; } } ], De = [ { type: "ask", name: "\u4eac\u4eba\u5e73\u53f0\u7b54\u9898", tips: "", match: () => location.host.includes("cj-edu.com") && (location.href.includes("/Examination") || location.href.includes("/ExamInfo")), types: [ "0", "1", "3" ], question: { html: ".el-main>.all_subject>div.el-row", question: "div.stem", options: "ul li > label > span.el-radio__label > div:nth-child(2),ul li > label > span.el-checkbox__label > div:nth-child(2)", type: ".question-box .tag", workType: "cjedu", pageType: "cjedu" }, init: async () => { await waitUntil((function() { return 0 !== J(".el-main>.all_subject>div.el-row").length; })); }, ischecked: isParentChecked, questionHook: e => { switch (J(e.html).prevAll("h1").first().text().trim()) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.$options = J(e.html).find("ul li>label"), e.options = [], e.type = "3"; } return e; } }, { type: "save", name: "\u4eac\u4eba\u5e73\u53f0\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("cj-edu.com") && location.href.includes("/ViewAnswerSheet"), question: { html: ".el-main>.all_subject>div.el-row", question: "p.stem", options: "ul li > label > span.el-radio__label > div:nth-child(2),ul li > label > span.el-checkbox__label > div:nth-child(2)", type: ".question-box .tag", workType: "cjedu", pageType: "cjedu" }, init: async () => { await waitUntil((function() { return 0 !== J(".el-main>.all_subject>div.el-row").length; })); }, answerHook: e => { let t = J(e.html).find(".seeStudentAnswer>p.answer").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(), n = J(e.html).prevAll("h1").first().text().trim(); switch (e.options.length > 0 && (e.answer = t.split(",").map((t => e.options[t.charCodeAt(0) - 65]))), n) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.options = [], e.answer = judgeAnswer(t), e.type = "3"; } return e; } } ], Re = [ { type: "hook", name: "hook", match: location.host.includes("ytccr.com"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u7ece\u901a\u7ee7\u6559\u4e91\u7b54\u9898", tips: "", match: () => location.host.includes("ytccr.com") && location.href.includes("learning-work") && location.href.includes("type=3"), types: [ "0", "1", "3" ], question: { html: ".border-item", question: ".title.qa-title", options: ".opts-list .opt-title-cnt", type: ".question-box .tag", workType: "ytccr", pageType: "ytccr" }, init: async () => { await waitUntil((function() { return 0 !== J(".border-item").length; })); }, ischecked: isParentChecked, questionHook: e => { if (e.type = typeConvert(J(e.html).find(".qtype").text().trim()), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u7ece\u901a\u7ee7\u6559\u4e91\u6536\u5f55", match: () => location.host.includes("ytccr.com") && location.href.includes("learning-work") && location.href.includes("type=5"), question: { html: ".border-item", question: ".title.qa-title", options: ".opts-list .opt-title-cnt", type: ".question-box .tag", workType: "ytccr", pageType: "ytccr" }, init: async () => { await waitUntil((function() { return 0 !== J(".border-item").length; })); }, answerHook: e => { e.type = typeConvert(J(e.html).find(".qtype").text().trim()); let t = J(e.html).find(".u-text-success,.u-text-danger").text().split("\uff0c")[0].trim(); if (t = t.match(/[A-Z]+$/)[0].trim(), e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return e; if ("3" === e.type) e.options = [], e.answer = judgeAnswer(e.answer[0]); return e; } } ], Be = [ { type: "ask", name: "\u5b66\u8d77\u8003\u8bd5", tips: "", match: () => location.href.includes("oxer/page/ots/examIndex.html"), types: [ "0", "1", "3" ], question: { html: ".queItemClass", question: "dt > div.din:eq(1)", options: "dd > div", type: ".question-box .tag", workType: "xueqi", pageType: "xueqi" }, init: async () => { await waitUntil((function() { return isExist(".queItemClass"); })), ce.document.onkeydown = null, ce.oncontextmenu = null; }, ischecked: e => e.parent().hasClass("cur"), questionHook: e => { let t = J(e.html).parent().find("div .fb:eq(0)").text().split("\u3001")[1]; if (t.includes("\u5224\u65ad") && (t = "\u5224\u65ad\u9898"), e.type = typeMatch(t), "3" === e.type) e.options = [], e.$options = J(e.html).find("input"); return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).val())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).val())) && J(n).click(); })), !1; } return !0; } }, { type: "save", name: "\u5b66\u671f\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("OTS-UniverDetail.html"), question: { html: ".dl_list", question: "dt > div.fl:eq(1)", options: "dd > var", type: ".question-box .tag", workType: "xueqi", pageType: "xueqi" }, init: async () => { await waitUntil((function() { return isExist(".dl_list"); })); }, answerHook: e => { var t, n, a, i, o; const s = J(e.html).attr("queid"), r = e.html._ms_context_.el.questions.find((e => e.id === s)); r.questionTypeName.includes("\u5224\u65ad") && (r.questionTypeName = "\u5224\u65ad\u9898"), e.type = typeMatch(r.questionTypeName), e.question = removeHtml(r.stem), console.log(r), e.options = (null == (n = null == (t = r.answerArea) ? void 0 : t.optionList) ? void 0 : n.sort(((e, t) => e.sequence - t.sequence)).map((e => removeHtml(e.content)))) || []; let l = r.answer.ans || (null == (a = r.answer.ansL) ? void 0 : a.join("")) || null; if (l) e.answer = l.split("").map((t => e.options[t.charCodeAt(0) - 65])); else { const t = (null == (o = null == (i = r.answerArea) ? void 0 : i.optionList) ? void 0 : o.filter((e => e.isTrue)).map((e => removeHtml(e.content)))) || []; if (0 === r.answerScore) return; e.answer = t; } return "3" === e.type && (e.options = [], e.answer = judgeAnswer(l)), e; }, paper: e => { const t = J(".dl_list:eq(0)")[0]._ms_context_.loop.category, n = J(".dl_list:eq(0)")[0]._ms_context_.oAnswerDetailInfo, a = { platform: "xueqi" }; a.hash = t.code, a.name = t.value, a.info = {}, a.chapter = [ { hash: `${n.arrangementid}`, name: n.arrangementname, question: e } ], Te.setPaper(a.hash, a); } } ], Ge = [ { type: "hook", name: "hook", match: "gdrtvu.exam-cloud.cn" === location.host, main: e => { observeVuePageChange(J("#app")[0], getUrl); } }, { type: "ask", name: "\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("exam-cloud.cn") && location.href.includes("oe-web/online-exam/exam"), types: [ "0", "1", "3" ], question: { html: ".question-container", question: ".question-body:first", options: ".option .question-options", type: ".question-header .container", workType: "guangkai", pageType: "guangkai" }, init: async () => { await waitUntil((function() { return isExist(".question-container"); })); }, ischecked: isParentChecked, questionHook: e => { let t = J(".list .current-question").parent().parent().find(".title").text(); if (console.log(t), t = t.split("\u3001")[1], t = t.replace(/\(.*\)/, "").trim(), console.log(t), e.type = typeConvert(t), "8" == e.type ? e.type = typeMatch(t) : e.type, "3" === e.type) e.options = []; return e; }, finish: e => { J(".next .qm-primary-button").length && J(".next .qm-primary-button")[0].click(); } } ], Ve = [ { type: "hook", name: "hook", match: location.host.includes("open.ha.cn"), main: e => { const getHash = () => J(".stuHomeworkVersionId.active").attr("id"); ce.mainClass = getHash(); let t = new MutationObserver((async e => { getHash(), ce.mainClass !== getHash() && (ce.mainClass = getHash(), vuePageChange(), t.disconnect()); })); J(".homeworkBody").length >= 1 && t.observe(J(".homeworkBody")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u4e91\u4e0a\u6cb3\u5f00\u7b54\u9898", tips: "", match: () => location.host.includes("open.ha.cn") && location.href.includes("/homework/showHomeworkByStatus") && location.href.includes("checked=false"), types: [ "0", "1" ], question: { html: ".layui-colla-content > .insert", question: ".window-title", options: ".option-title", type: ".question-box .tag", workType: "openha", pageType: "openha" }, init: async () => { await waitUntil((function() { return isExist(".layui-colla-content > .insert"); })); }, ischecked: isParentChecked, questionHook: e => (e.options = e.$options.map(((t, n) => { let a = J(n).find(".numberCover").text().trim(); return removeHtml(e.$options.eq(t).html()).replace(a, "").trim(); })).get(), e.type = typeConvert(J(e.html).find(".questionDiv>.float-l:eq(1)").text().trim()), e.$options = J(e.html).find(".option-title .numberCover"), e) }, { type: "save", name: "\u4e91\u4e0a\u6cb3\u5f00\u6536\u5f55", match: () => location.host.includes("open.ha.cn") && location.href.includes("/homework/showHomeworkByStatus") && location.href.includes("checked=true"), question: { html: ".layui-colla-content > .insert", question: ".window-title", options: ".option-title", type: ".question-box .tag", workType: "openha", pageType: "openha" }, init: async () => { await waitUntil((function() { return isExist(".layui-colla-content > .insert"); })); }, answerHook: e => { let t = []; const n = 0 == J(e.html).find(".option-title.error2").length; if (e.options = e.$options.map(((n, a) => { let i = J(a).find(".numberCover").text().trim(), o = removeHtml(e.$options.eq(n).html()).replace(i, "").trim(); return J(a).hasClass("answer-title") && t.push(o), o; })).get(), e.type = typeConvert(J(e.html).find(".questionDiv>.float-l:eq(1)").text().trim()), n) return e.answer = t, J(e.html).find(".option-title.error2"), e; }, paper: e => { const t = ce.homework, n = { platform: "openha" }; n.hash = t.courseId, n.name = t.courseName, n.info = {}, n.chapter = [ { hash: `${t.homeworkId}`, name: t.title, question: e } ], Te.setPaper(n.hash, n); } } ], Je = [ { type: "ask", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u7b54\u9898", tips: "", match: () => location.href.includes("uc/task/startTask"), types: [ "0", "1" ], answerDelay: 1e3, minDelay: 1e3, question: { html: ".carousel-inner>.item.changeless-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".carousel-inner>.item.changeless-box"); })), !isExist("#finish")) return !1; await waitUntil((function() { let e = J(".carousel-inner>article").filter(((e, t) => J(t).hasClass("temporary-box"))).eq(0).index(); return e > 0 ? (J(".slide-tihao:eq(" + e + ")")[0].click(), !1) : (J(".slide-tihao:eq(0)")[0].click(), !0); })); }, toquestion: e => { J(".slide-tihao:eq(" + e + ")")[0].click(); }, ischecked: e => e.find(".checked").length > 0, questionHook: e => (e.type = typeConvert(J(e.html).attr("data-name") || ""), e.$options = J(e.html).find(".ic-options__wrap label"), e.question = e.question.replace(/^\(\d+\)/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e) }, { type: "ask", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.href.includes("uc/exam/record/startExamination"), types: [ "0", "1" ], question: { html: ".trunk-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".trunk-box") && isExist(".ic-ac-checkbox-ol"); })), await waitUntil((function() { return window.scrollTo(0, document.body.scrollHeight), J(".ic-ac-checkbox-ol li").length == J(".trunk-box").length; })), !isExist("#submit-btn")) return !1; }, next: () => { J("#carousel-professional").carousel("next"); }, ischecked: e => e.find(".checked").length > 0, questionHook: e => { const t = J(e.html).attr("data-type"); switch (console.log(t), t) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; case "3": e.type = "3", e.options = []; } return e.question = e.question.replace(/^\d+\u3001/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e.question = e.question.replace(/\[\S+\]$/, "").trim(), e.$options = J(e.html).find(".ic-options__wrap label"), e; } }, { type: "save", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u6536\u5f55", match: () => location.href.includes("uc/task/startTask"), question: { html: ".carousel-inner>.item.changeless-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".carousel-inner>.item.changeless-box") && isExist(".slide-tihao"); })), isExist("#finish")) return !1; await waitUntil((function() { let e = J(".carousel-inner>article").filter(((e, t) => J(t).hasClass("temporary-box"))).eq(0).index(); return e > 0 ? (J(".slide-tihao:eq(" + e + ")")[0].click(), !1) : (J(".slide-tihao:eq(0)")[0].click(), !0); })); }, answerHook: e => { const t = J(e.html).find(".analysis-box .fs20.c-primary.vam").text().trim().split(""); return e.type = typeConvert(J(e.html).attr("data-name") || ""), e.answer = t.map((t => e.options[t.charCodeAt(0) - 65])), e.question = e.question.replace(/^\(\d+\)/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e; } }, { type: "save", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("uc/exam/record/startExamination"), question: { html: ".trunk-box.answer-question", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".trunk-box") && isExist(".ic-ac-correct"); })), await waitUntil((function() { return window.scrollTo(0, document.body.scrollHeight), J(".ic-ac-correct,.ic-ac-error").length == J(".trunk-box").length; })), isExist("#submit-btn")) return !1; }, next: () => { J(".next-slide").click(); }, answerHook: e => { const t = J(e.html).attr("data-type"); console.log(t); const n = J(e.html).find(".ic-options__wrap label").filter(((e, t) => J(t).find(".checked").length > 0)).map(((e, t) => removeHtml(J(t).html()))).get(); switch (e.answer = n.map((t => e.options[t.charCodeAt(0) - 65])), e.question = e.question.replace(/^\d+\u3001/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e.question = e.question.replace(/\[\S+\]$/, "").trim(), t) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; case "3": e.type = "3", e.options = [], e.answer = judgeAnswer(e.answer[0]); } return e; } } ], Ke = [ { type: "hook", name: "hook", match: location.host.includes("sclecb.cn"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => "study.sclecb.cn" === location.host && /\/[0-9]+\/show/i.test(location.href), types: [ "0", "1", "3" ], question: { html: ".testpaper-question.js-testpaper-question", question: ".testpaper-question-stem", options: ".testpaper-question-choices li", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".testpaper-question.js-testpaper-question"); })); }, ischecked: e => e.hasClass("checked"), questionHook: e => { switch (e.options = removeStartChar(e.options), e.$options = J(e.html).find(".testpaper-question-choice-inputs > label > input"), e.type = typeConvert(J(e.html).parent().parent().find(".panel-heading>strong").text().trim()), e.type, e.type) { case "0": case "1": break; case "3": e.$options = J(e.html).find(".radio-inline"); } return e; } }, { type: "ask", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u7b54\u9898\u65e7", tips: "", match: () => location.host.includes("sclecb.cn") && /student\/course\/study\/[0-9a-zA-Z]+\/test\/redo/i.test(location.href), types: [ "0", "1" ], question: { html: ".questiono-item", question: ".clearfix.questiono-header h6", options: ".common_test_option .processing_img", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".questiono-item"); })); }, ischecked: e => e.hasClass("checked"), questionHook: e => { const t = J(e.html).parent().parent().find("div:eq(0)").text().trim(); switch (!0) { case t.includes("\u5355\u9009\u9898"): e.type = "0"; break; case t.includes("\u591a\u9009\u9898"): e.type = "1"; break; case t.includes("\u5224\u65ad\u9898"): e.type = "3", e.options = [], e.$options = J(e.html).find(".common_test_option > label"); break; default: return; } return e; } }, { type: "save", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u6536\u5f55", match: () => "study.sclecb.cn" === location.host && (/task\/[0-9]+\/activity_show/i.test(location.href) || /result\/[0-9]+\/show/i.test(location.href)), question: { html: ".testpaper-question.js-testpaper-question", question: ".testpaper-question-stem", options: ".testpaper-question-choices li", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".testpaper-question.js-testpaper-question"); })); }, answerHook: (e, t) => { let n = []; e.options = e.$options.map(((e, t) => { const a = removeHtml(J(t).clone().find(".testpaper-question-choice-index").remove().end().html()); return J(t).hasClass("testpaper-question-choice-right") && n.push(a), a; })).get(), e.answer = n, e.type = typeConvert(J(".js-panel-card>span").eq(t).prevAll("p").first().text().trim()); const a = J(".js-panel-card>span").eq(t).hasClass("bg-success"); switch (e.type) { case "0": case "1": break; case "3": let t = ""; t = J(e.html).find(".testpaper-question-result").text().replace("\u4f60\u7684\u7b54\u6848\u662f", "").trim(), e.answer = judgeAnswer(t); } if ((a || !(e.answer.length > 0) || "3" != e.type) && a) return e; } } ], We = [ { type: "hook", name: "hook", match: location.host.includes("superchutou.com"), main: e => { observeVuePageChange(J("#root")[0], (() => getUrl())); } }, { type: "ask", name: "\u51fa\u5934\u7cfb\u7edf\u7b54\u9898", tips: "", match: () => location.host.includes("superchutou.com") && location.href.includes("onlineclass/exam/"), types: [ "0", "1" ], question: { html: "[class^='single_excer_item']", question: "[class^='title_content'] > [class^='title_content_text']:eq(1)", options: "[class^='options_content'] label", type: ".question-box .tag", workType: "chutou", pageType: "chutou" }, init: async () => { await waitUntil((function() { return isExist("[class^='single_excer_item']"); })); }, ischecked: isParentChecked, questionHook: e => { let t = J(e.html).find("[class^='title_content'] > span:eq(1)").text(); if (t = t.replace(/\u3010|\u3011/g, "").trim(), e.type = typeConvert(t), e.options = removeStartChar(e.options), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u51fa\u5934\u6536\u5f55", match: () => location.host.includes("superchutou.com") && location.href.includes("/onlineclass/analysis/"), question: { html: "[class^='single_excer_item']", question: "[class^='title_content'] > [class^='title_content_text']:eq(1)", options: "[class^='options_content'] label", type: ".question-box .tag", workType: "chutou", pageType: "chutou" }, init: async () => { await waitUntil((function() { return isExist("dl>dd>span"); })); }, answerHook: e => { let t = J(e.html).find("[class^='title_content'] > span:eq(1)").text(); t = t.replace(/\u3010|\u3011/g, "").trim(), e.type = typeConvert(t), e.options = removeStartChar(e.options); const n = J(e.html).find(".ant-collapse-header>div.ant-row>div.ant-col.ant-col-18>div:eq(1)").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(); switch (e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.options = [], e.answer = judgeAnswer(n); } return e; } } ], Qe = [ { type: "ask", name: "\u826f\u5e08\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.host.includes("ls365.net") && (location.href.includes("student/examing.aspx") || location.href.includes("Student/myhomework.aspx")), types: [ "0", "1" ], question: { html: ".exam_question", question: ".exam_question_title", options: ".question_select .select_detail", type: ".exam_question_title strong", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist(".exam_question"); })); }, ischecked: isParentChecked, questionHook: e => { let t = J(e.html).find(".exam_question_title").clone(); t.find(".question_number").remove(), t.find("strong").remove(), t.find(".exam_feed_back").remove(), e.question = removeHtml(t.html()); let n = J(e.html).find(".exam_question_title strong").text(); return n = n.replace(/\[|\]/g, "").trim(), e.type = typeConvert(n), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("ls365.net") && location.href.includes("User/Student/ViewPaper.aspx"), question: { html: "[name^='anchor_']", question: ".title-img-ctr", options: ".pold .phtml", type: ".QuestionsType", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[name^='anchor_']"); })); }, answerHook: e => { let t = J(e.html).find(".QuestionsType").text(); t = t.replace(/\[|\]/g, "").trim(), e.type = typeConvert(t); let n = J(e.html).find(".my-work-answer>p").filter(((e, t) => t.innerText.includes("\u53c2\u8003\u7b54\u6848"))).map(((e, t) => J(t).find(".two").text())).get(); if (0 !== n.length) return e.answer = n[0].split("").map((t => e.options[t.charCodeAt(0) - 65])), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("ls365.net") && location.href.includes("Student/myhomework_after.aspx"), question: { html: "[name^='anchor_']", question: ".my-work-nav>.col-md-10", options: ".pold .phtml", type: ".QuestionsType", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[name^='anchor_']"); })); }, answerHook: e => { let t = J(e.html).find(".my-work-nav>div:eq(0)>span:eq(0)").text(); t = t.replace(/\[|\]/g, "").trim(), e.type = typeConvert(t); let n = J(e.html).find(".my-work-answer>p").filter(((e, t) => t.innerText.includes("\u53c2\u8003\u7b54\u6848"))).map(((e, t) => J(t).find(".two").text())).get(); if (0 !== n.length) return e.answer = n[0].split("").map((t => e.options[t.charCodeAt(0) - 65])), e; } }, { type: "hook", name: "hook", match: "hbnun.lsedu.vip" === location.host, main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.href.includes("/#/homework/") && !location.href.includes("scene=history"), types: [ "0", "1" ], question: { html: "[id^='question-']", question: ".question-content", options: "button .flex-1.text-left", type: ".self-start.text-3.self-end", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[id^='question-']"); })); }, ischecked: e => J(e).closest("button").hasClass("is-checked") || J(e).closest("button").hasClass("el-button--primary"), questionHook: e => { let t = J(e.html).find(".self-start.text-3.self-end").text(); return t && (t = t.replace(/\[|\]/g, "").trim(), e.type = typeMatch(t)), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u6536\u5f55", match: () => location.href.includes("/#/homework/") && location.href.includes("scene=history"), question: { html: "[id^='question-']", question: ".question-content", options: ".flex.flex-col.space-y-2 .f-c-c.space-x-3 .flex-1", type: ".self-start.text-3.self-end", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[id^='question-']"); })); }, answerHook: e => { let t = J(e.html).find(".self-start.text-3.self-end").text(); t && (t = t.replace(/\[|\]/g, "").trim(), e.type = typeMatch(t)); let n = ""; if (J(e.html).find("div").each(((e, t) => { const a = J(t); if ((a.find("span").filter(((e, t) => J(t).text().trim().includes("\u6807\u51c6\u7b54\u6848\uff1a"))).length > 0 || a.text().trim().includes("\u6807\u51c6\u7b54\u6848\uff1a")) && (n = a.find(".question-content").text().trim(), n)) return !1; })), n) return e.answer = n.split("").map((t => { const n = t.charCodeAt(0) - 65; return e.options && e.options[n] ? e.options[n] : null; })).filter((e => null !== e)), e; } } ], Ye = [ { type: "hook", name: "hook", match: location.host.includes("jijiaox.com"), main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); } }, { type: "ask", name: "\u7ee7\u6559\u4e91\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.host.includes("jijiaox.com") && (location.href.includes("/mg/studentindexexam/") || !location.href.includes("examrec")), types: [ "0", "1", "3", "4" ], question: { html: ".question>div", question: ".topic-title", options: ".ml_2 label", type: ".question-box .tag", workType: "jijiaox", pageType: "jijiaox" }, init: async () => { await waitUntil((function() { return isExist(".question>div"); })); }, ischecked: e => e.hasClass("is-checked"), questionHook: (e, t) => { const n = J(".page")[0].__vue__.$data.testInfo.studentPraxisList[t]; switch (e.options = n.options ? n.options : [], "string" == typeof e.options && (e.options = []), e.question = removeHtml(n.title), n.type) { case "single": e.type = "0"; break; case "muti": e.type = "1"; break; case "charge": e.type = "3"; break; case "text": e.type = "4"; break; default: console.log(n.type, "\u672a\u77e5\u7c7b\u578b"); } return e; }, setAnswer: e => "4" !== e.type || (J(e.html).find(".editor")[0].__vue__.editor.txt.html(e.answer[0]), !1) }, { type: "save", name: "\u7ee7\u6559\u4e91\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("jijiaox.com") && location.href.includes("/mg/studentindexexam/examrec/"), question: { html: ".question>div", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "jijiaox", pageType: "jijiaox" }, init: async () => { await waitUntil((function() { return isExist(".question>div"); })); }, answerHook: (e, t) => { const n = J(".page")[0].__vue__.$data.testInfo.studentPraxisList[t], a = n.answer; switch (e.options = n.options ? n.options : [], "string" == typeof e.options && (e.options = []), e.question = removeHtml(n.title), n.type) { case "single": e.type = "0"; break; case "muti": e.type = "1"; break; case "charge": e.type = "3", e.answer = "1" == a ? [ "\u6b63\u786e" ] : "-1" == a ? [ "\u9519\u8bef" ] : []; break; case "text": e.type = "4", e.answer = [ removeHtml(a) ]; break; default: console.log(n.type, "\u672a\u77e5\u7c7b\u578b"); } switch (e.type) { case "0": case "1": console.log("________", a), e.answer = "string" == typeof a ? a.split("").map((t => e.options[t.charCodeAt(0) - 65])) : a.map((t => (console.log(t), e.options[t.charCodeAt(0) - 65]))); } return console.log(e), e; } } ], Xe = [ { type: "hook", name: "hook", match: location.host.includes("wencaischool.net") && J("#app").length, main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); const t = document.createElement("style"); t.type = "text/css", t.innerHTML = "* {\n font-size: 13px !important;\n }", document.head.appendChild(t); } }, { type: "save", name: "\u67e0\u6aac\u6587\u624d\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("wencaischool.net") && location.href.includes("/separation/exam/index.html"), question: { html: ".tmList", question: ".tmTitleTxt", options: ".perRad .opCont", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist(".tmList") && J("#onlineExamArea")[0].__vue__._data.itemsList.length > 0; })); }, answerHook: (e, t) => { const n = J("#onlineExamArea")[0].__vue__._data.itemsList[t]; e.question = removeHtml(n.itemName), e.options = n.optionNodes.map((e => removeHtml(e.optionContent))); e.type = typeConvert({ 1: "\u586b\u7a7a\u9898", 2: "\u7b80\u7b54\u9898", 3: "\u5355\u9009\u9898", 4: "\u591a\u9009\u9898", 5: "\u9605\u8bfb\u7406\u89e3", 12: "\u5b8c\u5f62\u586b\u7a7a" }[n.itemType]); let a = n.itemAnswer[0].optionContent; switch (e.type) { case "0": case "1": e.answer = a.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "4": e.answer = removeHtml(a); break; case "2": e.answer = n.itemAnswer.map((e => removeHtml(e.optionContent))); } return e; } }, { type: "ask", name: "\u67e0\u6aac\u6587\u624d\u8003\u8bd5\u7b54\u9898", tips: "\u6b64\u5e73\u53f0\u7b54\u9898\u95f4\u9694\u5c3d\u91cf3s\u5de6\u53f3\uff0c\u5426\u5219\u53ef\u80fd\u9009\u4e0d\u4e0a\u7b54\u6848", match: () => location.host.includes("wencaischool.net") && location.href.includes("/separation/exam/index.html"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "14" ], minDelay: 4e3, answerDelay: 1e3, question: { html: ".tmList", question: ".tmTitleTxt", options: ".perRad .opCont", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist(".tmList") && J("#onlineExamArea")[0].__vue__._data.itemsList.length > 0; })); }, ischecked: e => e[0].checked, questionHook: e => { let t = J(e.html).find(".tmc.tm").attr("ttype"); return e.type = typeConvert({ 1: "\u586b\u7a7a\u9898", 2: "\u7b80\u7b54\u9898", 3: "\u5355\u9009\u9898", 4: "\u591a\u9009\u9898", 5: "\u9605\u8bfb\u7406\u89e3", 12: "\u5b8c\u5f62\u586b\u7a7a" }[t]), e.$options = J(e.html).find(".perRad input"), e; }, setAnswer: e => { switch (e.type) { case "4": return J(e.html).find("textarea").focus(), document.execCommand("selectAll"), document.execCommand("insertText", !1, e.answer[0]), !1; case "2": J(e.html).find(".ansbox.inputAnswer input").each((async (t, n) => { n.focus(), document.execCommand("selectAll"); let a = e.answer[t]; document.execCommand("insertText", !1, a), await sleep(1e3); })); } return !0; } }, { type: "ask", name: "\u67e0\u6aac\u6587\u624d\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.host.includes("wencaischool.net") && location.href.includes("/exam/portal/exam.jsp"), types: [ "0", "1", "2", "3" ], question: { html: "table[id^='tblItem_'][islabel='0']", question: "table>tbody>tr:eq(0)>td:eq(0)", options: "table>tbody>tr:eq(1)>td:eq(0) table>tbody>tr>td>label", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist("table[id^='tblItem_'][islabel=0]"); })), J(".aah_wrapper>div").css("z-index", 9999); }, ischecked: e => e[0].checked, questionHook: e => { let t = removeHtml(J(e.html).parent().parent().prevAll("tr").filter((function() { return J(this).find("table[islabel='1']").length > 0; })).first().html()); if (e.type = typeMatch(t), "8" == e.type && t.includes("\u9009\u62e9\u9898") && (e.type = "0"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("2" === e.type) { const t = J(e.html).find("table>tbody>tr:eq(0)>td:eq(0)>input"); t.length == e.answer.length && t.each((async (t, n) => { n.value = "", n.focus(), document.execCommand("selectAll"); let a = e.answer[t]; document.execCommand("insertText", !1, a), await sleep(1e3); })); } return !0; } }, { type: "save", name: "\u67e0\u6aac\u6587\u624d\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("wencaischool.net") && location.href.includes("/exam/portal/view_answer.jsp"), question: { html: "tr[id^='trScore_']", question: "table>tbody>tr:eq(0)>td:eq(0)", options: "table>tbody>tr:eq(1)>td:eq(0) table>tbody>tr>td>label", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => {}, answerHook: (e, t) => { const n = removeHtml(J(e.html).prevAll("tr:not([id])").first().html()); switch (e.type = typeMatch(n), "8" == e.type && n.includes("\u9009\u62e9\u9898") && (e.type = "0"), e.type) { case "0": case "1": case "3": const t = J(e.html).find("table>tbody>tr:eq(1)>td:eq(0)>div[style='color:darkred;font-size:10pt']").text().split("\u7b54\u6848\uff1a")[1].split("]")[0]; e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), "3" == e.type && (e.options = [], e.answer = judgeAnswer(e.answer[0])); break; case "2": const n = J(e.html).find("table>tbody>tr:eq(0)>td:eq(0)").clone(); n.find("input").remove(), e.answer = n.find("nobr").map(((e, t) => { const n = removeHtml(J(t).html()); return /\[\u53c2\u8003\u7b54\u6848\uff1a(.+?)\]/.exec(n)[1]; })).get(), n.find("nobr").remove(), n.find("font").remove(), e.question = removeHtml(n.html()); } return e; } } ], Ze = [ { type: "save", name: "yxlearning\u6536\u5f55", match: () => location.host.includes("yxlearning.com") && location.href.includes("exam/start?myExamRecordId"), question: { html: ".subject>.mb20.sub", question: ".ls1.lh30.text-f666", options: "ul.options>li.cursor-p", type: ".question-box .tag", workType: "yxlearning", pageType: "yxlearning" }, init: async () => { if (await waitUntil((function() { return isExist(".mb20.sub"); })), !ce.yxques) return !1; }, answerHook: (e, t) => { const n = []; ce.yxques.questionStemRPS.forEach(((e, t) => { e.listPaperQuestionRP.forEach(((e, t) => { n.push(e); })); })); const a = n[t]; e.question = titleClean(removeHtml(a.questionName)); const i = a.type, o = []; switch (e.options = removeStartChar(a.paperOptionRPS.map((e => removeHtml(e.context)))), a.paperOptionRPS.forEach(((t, n) => { 1 == t.standardAnswer && o.push(e.options[n]); })), e.answer = o, i) { case 1: e.type = "3", e.options = [], e.answer = judgeAnswer(e.answer[0]); break; case 2: e.type = "0"; break; case 3: e.type = "1"; } return e; } }, { type: "ask", name: "\u65e5\u7167\u4e13\u4e1a\u6280\u672f\u4eba\u5458\u7b54\u9898", tips: "", match: () => location.host.includes("yxlearning.com") && location.href.includes("exam/start?myExamRecordId"), types: [ "0", "1", "3" ], question: { html: ".mb20.sub", question: ".ls1.lh30.text-f666", options: ".cursor-p", type: ".question-box .tag", workType: "yxlearning", pageType: "yxlearning" }, init: async () => { await waitUntil((function() { return isExist(".mb20.sub"); })); }, ischecked: e => e.hasClass("active"), questionHook: e => { if (e.options = removeStartChar(J(e.html).find("ul>li").map(((e, t) => removeHtml(J(t).html()))).get()), e.$options = J(e.html).find("ul>li"), e.type = typeConvert(J(e.html).parent().prevAll(".title").first().find("[du-html='questionStemName']").text().trim()), "3" === e.type) e.options = [], e.$options = J(e.html).find("ul>li"); return e; } } ], et = [ { type: "ask", name: "\u9ea6\u80fd\u7f51\u7b54\u9898", tips: "", match: () => location.href.includes("lms/web/onlineexam/exambegin"), types: [ "0", "1", "3" ], question: { html: "#exam_form>.sdiv", question: ".eptimu_name", options: ".ansdiv > .optiondiv", type: ".eptimu_title", workType: "cjnep", pageType: "cjnep" }, init: async () => { await waitUntil((function() { return isExist(".sdiv"); })); }, toquestion: e => { J(`.controldiv > a:eq(${e})`), J(`.epcl_circle:eq(${e})`)[0].click(); }, ischecked: isParentChecked, questionHook: e => { if (e.question = e.question.replace(/^[0-9]+\u3001/, "").trim(), e.question = titleClean(e.question), e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".eptimu_title").text().trim()), e.$options = J(e.html).find(".ansdiv input"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { switch (e.type) { case "3": let t = e.answer; return J(e.html).find(".ansdiv input").each(((e, n) => { isTrue(t) && "1" == J(n).val() && J(n).click(), isFalse(t) && "0" == J(n).val() && J(n).click(); })), !1; case "2": case "4": case "5": case "6": const n = J(e.html).find(".ansdiv textarea"), a = e.answer.join(";"); n.val(a), n.trigger("input"), n.trigger("keydown"), n.trigger("change"), n.trigger("blur"), n.trigger("focus"); const i = n[0]; if (i) { [ "input", "change", "blur", "focus" ].forEach((e => { const t = new Event(e, { bubbles: !0 }); i.dispatchEvent(t); })); } return !1; } return !0; } }, { type: "save", name: "\u9ea6\u80fd\u7f51\u7b54\u9898\u6536\u5f55", match: () => location.href.includes("lms/web/exam/examshow"), question: { html: "#exam_form>.sdiv", question: ".eptimu_name", options: ".ansdiv > .optiondiv", type: ".eptimu_title", workType: "cjnep", pageType: "cjnep" }, init: async () => { await waitUntil((function() { return isExist(".sdiv"); })); }, answerHook: e => { switch (e.type = typeMatch(J(e.html).find(".eptimu_title").text().trim()), e.question = e.question.replace(/^[0-9]+\u3001/, "").trim(), e.question = titleClean(e.question), e.options = removeStartChar(e.$options.map(((e, t) => { let n = J(t).clone(); return J(n).find("img").remove(), removeHtml(J(n).html()).trim(); })).get()), e.type) { case "0": case "1": e.answer = e.$options.map(((t, n) => { var a; return (null == (a = J(n).find("img").attr("src")) ? void 0 : a.includes("exam-yes")) && e.options[t]; })).get().filter((e => void 0 !== e)); break; case "3": e.answer = e.$options.map(((t, n) => { var a; return (null == (a = J(n).find("img").attr("src")) ? void 0 : a.includes("exam-yes")) && e.options[t]; })).get().filter((e => void 0 !== e)), e.answer = judgeAnswer(e.answer), e.options = []; break; case "4": e.options = []; let t = removeHtml(J(e.html).find(".eptimu_answer.ansdiv").html()).trim(); t.includes("\u6b63\u786e\u7b54\u6848\uff1a") ? e.answer = t.split("\u6b63\u786e\u7b54\u6848\uff1a")[1].trim() : e.answer = []; } return e; } } ], tt = [ { type: "ask", name: "\u9ea6\u80fd\u7f51\u7b54\u9898", tips: "", match: () => location.host.includes("mynep.com") && location.href.includes("my-exam/exambegin"), types: [ "0", "1" ], question: { html: ".et_test", question: ".et_title", options: "ul>.et_answer>label", type: ".question-box .tag", workType: "mynep", pageType: "mynep" }, init: async () => {}, toquestion: e => { ce.select_num(e + 1); }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { e.question = e.question.replace(/\u7b2c\d+\u9898\uff1a/, ""), e.options = removeStartChar(e.options); switch (J(e.html).find('input[id^="question-num-isdone"]').attr("question_num_type_id")) { case "1": e.type = "0"; break; case "2": e.type = "1"; } return e; } }, { type: "save", name: "\u9ea6\u80fd\u7f51\u6536\u5f55", match: () => location.host.includes("mynep.com") && location.href.includes("web/my-exam/examshow"), question: { html: ".et_test", question: ".et_title", options: "ul>.et_answer>label", type: ".question-box .tag", workType: "mynep", pageType: "mynep" }, init: async () => {}, answerHook: e => { const t = J(e.html).find(".et_title").clone(); t.find(".exam-btn").remove(), t.find("div").remove(), e.question = removeHtml(t.html()).replace(/\u7b2c\d+\u9898\uff1a/, "").trim(), e.options = []; const n = []; J(e.html).find(".et_answer>.et_answer>.et_answer>label").map(((t, a) => { e.options.push(removeHtml(J(a).html()).trim()), J(a).parent().find("input").prop("checked") && n.push(t); })).get(), e.options = removeStartChar(e.options), e.answer = n.map((t => e.options[t])); switch (J(e.html).find('input[id^="question-num-isdone"]').attr("question_num_type_id")) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; default: return !1; } return e; } } ], nt = [ { type: "hook", name: "hook", match: location.host.includes("91huayi.com"), main: e => { observeVuePageChange(J(".box")[0], (() => J(".dd_01").attr("questionid")), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === J(".el-loading-mask").length; })); } }); } }, { type: "ask", name: "\u534e\u533b\u7f51\u7b54\u9898", tips: "", match: () => location.host.includes("91huayi.com") && location.href.includes("/ExamInterface/ComputerExamIndex"), types: [ "0", "1" ], question: { html: "#exampage", question: ".dd_01", options: ".dd_02", type: ".big_type", workType: "huayi", pageType: "huayi" }, init: async () => {}, next: () => { var e; null == (e = J("#btnNext")) || e.click(); }, ischecked: e => e.prop("checked"), questionHook: e => { const t = J(e.html).find(".dd_01").clone(); return t.find(".dd_01_red").remove(), e.question = removeHtml(t.html()), e.options = removeStartChar(e.options), e.type = typeMatch(J(e.html).find(".big_type").text()), e.$options = J(e.html).find("dd.q-content input"), e; }, setAnswer: e => { switch (console.log(e), e.type) { case "0": case "1": return e.ques.$options.each(((t, n) => { if (e.answer.includes(t)) { if (e.rule.ischecked && e.rule.ischecked(J(n))) return; n.click(); } else e.rule.ischecked && e.rule.ischecked(J(n)) && n.click(); })), !1; } return !0; } }, { type: "ask", name: "\u534e\u533b\u7f51\u8003\u8bd5", tips: "", match: () => location.host.includes("91huayi.com") && location.href.includes("/pages/exam.aspx?cwid="), types: [ "0" ], question: { html: ".test>table", question: "thead", options: "tbody>tr>td>label", type: ".big_type", workType: "huayi", pageType: "huayi" }, init: async () => {}, next: () => { var e; null == (e = J("#btnNext")) || e.click(); }, ischecked: e => e.prop("checked"), questionHook: e => (e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\u3001/, ""), e.options = removeStartChar(e.options), 0 !== e.options.length && (e.type = "0"), e) } ], at = [ { type: "ask", name: "\u4e91\u5357\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => location.href.includes("hw/student/studentStartHomework.action") && location.host.includes("teach.ynou.edu.cn"), types: [ "0", "1", "3" ], question: { html: ".e_juan02biaoti", question: ".qcontent > p:first", options: ".signDefault>.label", type: ".question-box .tag", workType: "ynou", pageType: "ynou" }, init: async () => { await waitUntil((function() { return 0 !== J(".e_juan02biaoti").length; })), J("body").css("text-align", "left"); }, ischecked: e => (e.find("input").is(":checked"), e.find("input").is(":checked")), questionHook: e => { e.options = []; const t = J(e.html).find(".e_juan02daan").clone(); t.find(".clear").nextAll().remove(); const n = removeHtml(t.html()), a = n.split(/[A][\u3001\.\uff0e]/)[0].trim(); null !== a && (e.question = a), e.question = a, e.question = a; const i = n.match(/(?:[A-G](?:[\u3001.]|\s)?\s?.*?)(?=\s*[A-G](?:[\u3001.]|\s)?|\s*$)/gs); if (null !== i) { const t = removeOptionsStartChar(i.map((e => e.trim()))); !1 !== t && (e.options = t); } const o = J(e.html).find(".signDefault").attr("answer_control"); return "radio" === o && e.options.length > 1 && (e.type = "0"), "checkbox" === o && e.options.length > 1 && (e.type = "1"), "radio" === o && 0 === e.options.length && (e.type = "3"), e; }, setAnswer: e => { if (console.log(e), "3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).html())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).html())) && J(n).click(); })), !1; } return !0; } }, { type: "save", name: "\u6536\u5f55", match: () => location.href.includes("/hw/student/studentViewHomework.action") && location.host.includes("teach.ynou.edu.cn"), question: { html: ".e_juan02biaoti", question: ".qcontent > p:first", options: ".signDefault>.label", type: ".question-box .tag", workType: "ynou", pageType: "ynou" }, init: async () => { await waitUntil((function() { return 0 !== J(".e_juan02biaoti").length; })), J("body").css("text-align", "left"); }, answerHook: e => { e.options = []; const t = J(e.html).find(".e_juan02daan").clone(); t.find(".clear").nextAll().remove(); const n = removeHtml(t.html()), a = n.split(/[A][\u3001\.\uff0e]/)[0].trim(); if (null === a) return null; e.question = a; const i = n.match(/(?:[A-G](?:[\u3001.]|\s)?\s?.*?)(?=\s*[A-G](?:[\u3001.]|\s)?|\s*$)/gs); if (null !== i) { const t = removeOptionsStartChar(i.map((e => e.trim()))); if (0 == t) return null; e.options = t; } const o = J(e.html).find(".signDefault").attr("answer_control"); "radio" === o && e.options.length > 1 && (e.type = "0"), "checkbox" === o && e.options.length > 1 && (e.type = "1"), "radio" === o && 0 === e.options.length && (e.type = "3"); const s = J(e.html).find(".right_answer>font").text(); switch (e.type) { case "0": case "1": e.answer = s.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.answer = isTrue(s) ? "\u6b63\u786e" : isFalse(s) ? "\u9519\u8bef" : ""; } return e; } } ], it = [ { type: "hook", name: "hook", match: location.host.includes("21tb.com"), main: e => { observeVuePageChange(J("#examIngEmsRightPanel")[0], (() => J("#examIngEmsRightPanel").attr("class"))); } }, { type: "ask", name: "21tb\u7b54\u9898", tips: "", match: () => location.host.includes("21tb.com") && location.href.includes("exercise/newExercise.fullExerciseTemp.do"), types: [ "0", "1", "3" ], question: { html: ".paper-content > .question-panel-middle", question: ".question-stem>.name", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (J(".view-paper-content").length > 0) return !1; }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const t = J(e.html).attr("class") || ""; switch (console.log(t), !0) { case t.includes("SINGLE"): e.type = "0"; break; case t.includes("MULTIPLE"): e.type = "1"; break; case t.includes("JUDGMENT"): e.type = "3", e.options = []; } return e; } }, { type: "save", name: "21tb\u6536\u5f55", match: () => location.host.includes("21tb.com") && location.href.includes("exercise/newExercise.fullExerciseTemp.do"), question: { html: "form > .question-panel-middle", question: ".question-stem>.name", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (console.log(J(".view-paper-content").length), 0 == J(".view-paper-content").length) return !1; }, answerHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const t = J(e.html).attr("questtype") || "", n = J(e.html).find(".true-answer").text().split("\uff1a")[1].trim(); switch (!0) { case t.includes("SINGLE"): e.type = "0", e.answer = n.split(", ").map((t => e.options[t.charCodeAt(0) - 65])); break; case t.includes("MULTIPLE"): e.type = "1", e.answer = n.split(", ").map((t => e.options[t.charCodeAt(0) - 65])); break; case t.includes("JUDGMENT"): e.type = "3", e.options = [], e.answer = judgeAnswer(n); } return console.log(e), e; } }, { type: "ask", name: "21tb\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.host.includes("21tb.com") && location.href.includes("ems/html/examCenter/fullExamTemp.do"), types: [ "0", "1", "3" ], question: { html: ".paper-content > .question-panel-middle", question: ".question-stem", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (J(".view-paper-content").length > 0) return !1; }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = J(e.html).find(".question-stem").clone(); t.find(".num").remove(), e.question = titleClean(removeHtml(t.html())).replace(/^\./, ""), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const n = J(e.html).attr("class") || ""; switch (console.log(n), !0) { case n.includes("SINGLE"): e.type = "0"; break; case n.includes("MULTIPLE"): e.type = "1"; break; case n.includes("JUDGMENT"): e.type = "3", e.options = []; } return e; } } ], ot = [ { type: "hook", name: "hook", match: location.host.includes("168wangxiao.com"), main: e => { observeVuePageChange(J("#app")[0], (() => (J(".question-submit-btn").text(), J(".question-submit-btn").text() || J(".listTit>span").text())), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === J(".el-loading-mask").length; })); } }), J("#app").length >= 1 && J("#app")[0]; } }, { type: "ask", name: "168\u7f51\u6821\u7b54\u9898", tips: "168\u7f51\u6821\u76ee\u524d\u652f\u6301\u9009\u62e9\u3001\u5224\u65ad\u3001\u586b\u7a7a\u3001\u7b80\u7b54\uff0c\u5176\u4ed6\u9898\u578b\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/learningCenter/details/"), types: [ "0", "1", "2", "3", "4" ], question: { html: ".question-item-container", question: ".title-content", options: ".options .opt-content", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => (await waitUntil((function() { return 0 !== J(".question-item-container").length; })), !J(".question-submit-btn").text().includes("\u91cd\u65b0\u7b54\u9898")), ischecked: isParentChecked, questionHook: e => { const t = J(e.html).find(".type").text(); return e.type = typeMatch(t), e; }, setAnswer: e => "4" !== e.type || (J(e.html).find(".ql-editor"), J(e.html).find(".ql-editor")[0].innerHTML = e.answer[0], !1) }, { type: "save", name: "168\u7f51\u6821\u7b54\u9898", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/learningCenter/details/"), question: { html: ".question-item-container", question: ".title-content", options: ".options .opt-content", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => (await waitUntil((function() { return 0 !== J(".question-item-container").length; })), J(".question-submit-btn").text().includes("\u91cd\u65b0\u7b54\u9898")), answerHook: e => { const t = J(e.html).find(".type").text(); switch (e.type = typeMatch(t), e.answer = J(e.html).find(".options .opt-content.is-correct-answer").map(((e, t) => removeHtml(J(t).html()))).get(), e.type) { case "2": e.options = [], e.answer = J(e.html).find(".analyze-container>.answer>.text-container>p").map(((e, t) => removeHtml(J(t).html()))).get(); break; case "3": e.options = [], e.answer = [ judgeAnswer(e.answer[0]) ]; break; case "4": e.options = [], e.answer = J(e.html).find(".analyze-container>.answer>.text-container").map(((e, t) => removeHtml(J(t).html()))).get(); } return e; } }, { type: "ask", name: "168\u7f51\u6821\u8003\u8bd5", tips: "", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/examination/answer"), types: [ "0", "1", "2", "3", "4" ], question: { html: ".Answer-area", question: ".listTit>span", options: ".el-checkbox-group>label", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => { await waitUntil((function() { return 0 !== J(".Answer-area").length; })); }, next: () => { J('button:contains("\u4e0b\u4e00\u9898")').click(); }, ischecked: isParentChecked, questionHook: e => (e.options = removeOptionsStartChar(e.options), e.type = typeMatch(J(".tit-type").text()), e), setAnswer: e => "4" !== e.type || (J(e.html).find(".ql-editor"), J(e.html).find(".ql-editor")[0].innerHTML = e.answer[0], !1) } ], st = /^\/web\/cc-detail\/([^/]+)\/act\/quiz-answer\/([^/?#]+)/, rt = /^\/web(?:-old)?\/index\.php$/, lt = { SINGLE: "0", MULTI: "1", TF: "3" }, getMosoteachQuizIds = (e = location.href) => { try { const t = new URL(e); if ("www.mosoteach.cn" !== t.hostname) return null; const n = t.pathname.match(st); return n ? { ccId: n[1], quizId: n[2] } : null; } catch { return null; } }, isMosoteachQuizAnswerUrl = (e = location.href) => null !== getMosoteachQuizIds(e), isMosoteachLegacyQuizReplyUrl = (e = location.href) => { try { const t = new URL(e); return "www.mosoteach.cn" === t.hostname && (!!rt.test(t.pathname) && ("interaction_quiz" === t.searchParams.get("c") && "reply" === t.searchParams.get("m"))); } catch { return !1; } }, isMosoteachAskUrl = (e = location.href) => isMosoteachQuizAnswerUrl(e) || isMosoteachLegacyQuizReplyUrl(e), getOptionNo = e => e.itemNo ?? e.item_no ?? 0, getSortedOptions = e => [ ...e.options || [] ].sort(((e, t) => getOptionNo(e) - getOptionNo(t))), getMosoteachTopicOptions = (e, t) => t(getSortedOptions(e).map((e => e.content || ""))), ct = ".topic-answer-align,.t-option.t-item label,.t-judge.t-item label", pt = ".v-chip__content,.t-type", dt = "__aiAskMosoteachRouteHook", ut = "__aiAskMosoteachHref", ht = "__aiAskMosoteachRouteTimer"; let mt = []; const ft = { cleanText: (e = "") => titleClean(removeHtml(e)), cleanOptions: e => removeStartChar(e.map((e => removeHtml(e)))), judgeAnswer: judgeAnswer }, getMosoteachQuestionType = (e = "", t = []) => ((e = "", t = []) => { const n = lt[e.trim()]; return "0" === n && (e => 2 === e.length && e.every((e => /^(\u6b63\u786e|\u9519\u8bef|\u5bf9|\u9519|\u662f|\u5426|T|F|true|false)$/i.test(e.trim()))))(t) ? "3" : n || ""; })(e, t) || typeMatch(e), getMosoteachQuestionElements = () => isMosoteachLegacyQuizReplyUrl() ? J(".topic-item") : J(".pt-10.d-flex.list-item:has(.topic-subject):has(.topic-answer-align)"), getMosoteachLegacyTopics = () => { var e, t; const n = J("#app")[0], a = null == (t = null == (e = null == n ? void 0 : n.__vue__) ? void 0 : e.$data) ? void 0 : t.topics; return Array.isArray(a) ? a : []; }, cacheMosoteachAnswer = e => { const t = ((e, t, n, a) => { const i = a.cleanText(e), o = ((e, t) => t(e).sort().join("\n"))(t, a.cleanOptions); return n.find((e => { const t = getMosoteachTopicOptions(e, a.cleanOptions).sort().join("\n"); return a.cleanText(e.subject || "") === i && t === o; })); })(e.question, e.options, mt, ft); if (!t) return; const n = ((e, t) => { const n = t.cleanOptions(getSortedOptions(e).map((e => e.content || ""))); return Array.isArray(e.answers) && e.answers.length > 0 ? e.answers.map((e => n[e] || "")).filter(Boolean) : "TF" === e.type ? t.judgeAnswer(e.tfAnswer || "") : []; })(t, ft); if (!n.length) return; const a = { type: e.type, question: e.question, options: "3" === e.type ? [] : e.options, answer: n }; Answer.cacheAnswer(a); }, parseMosoteachDomQuestion = e => { const t = J(e.html), n = t.find(".topic-subject").first().text(), a = t.find(".topic-answer-align"); if (!n || !a.length) return e; e.question = ft.cleanText(n); const i = a.map(((e, t) => J(t).find(".topic-answer").first().text() || J(t).text())).get(); return e.options = ft.cleanOptions(i), e.$options = (e => J(e.map(((e, t) => J(t).closest("label,.d-flex.align-start")[0] || t)).get()))(a), e.type = getMosoteachQuestionType(t.find(".v-chip__content").first().text(), e.options), cacheMosoteachAnswer(e), e; }, parseMosoteachLegacyQuestion = (e, t) => { const n = J(e.html), a = getMosoteachLegacyTopics()[t], i = n.find(ct), o = i.map(((e, t) => J(t).text())).get(); if (a) e.question = ft.cleanText(a.subject || ""), e.options = ((e, t, n) => { const a = n(t); return a.length ? a : getMosoteachTopicOptions(e || {}, n); })(a, o, ft.cleanOptions), e.type = getMosoteachQuestionType(a.type, e.options); else { const t = n.find(".t-subject").first().text(); e.question = ft.cleanText(t || e.question), e.options = ft.cleanOptions(o.length ? o : e.options), e.type = getMosoteachQuestionType(n.find(pt).first().text() || e.type, e.options); } return i.length && (e.$options = i), cacheMosoteachAnswer(e), e; }, watchMosoteachRouteChange = () => { const e = ce; if (e[dt]) return; e[dt] = !0, e[ut] = location.href; const checkRouteChange = () => { e[ut] !== location.href && (e[ut] = location.href, clearTimeout(e[ht]), e[ht] = setTimeout((() => vuePageChange()), 100)); }, bindHistoryChange = e => { const t = history[e]; history[e] = function(...e) { const n = t.apply(this, e); return setTimeout(checkRouteChange, 0), n; }; }; bindHistoryChange("pushState"), bindHistoryChange("replaceState"), window.addEventListener("popstate", (() => setTimeout(checkRouteChange, 0))); }, gt = [ { type: "hook", name: "\u4e91\u73ed\u8bfe\u8def\u7531\u76d1\u542c", match: () => "www.mosoteach.cn" === location.host, main: () => { watchMosoteachRouteChange(); } }, { type: "ask", name: "\u4e91\u73ed\u8bfe\u7b54\u9898", tips: "", match: () => "www.mosoteach.cn" === location.host && isMosoteachAskUrl(), types: [ "0", "1", "3" ], question: { html: getMosoteachQuestionElements, question: ".topic-subject,.t-subject", options: ct, type: pt, workType: "mosoteach", pageType: "mosoteach" }, init: async () => { if (await sleep(500), !isMosoteachAskUrl()) return mt = [], !1; return !!(await (async () => { for (let e = 0; e < 30; e++) { if (getMosoteachQuestionElements().length > 0) return !0; await sleep(200); } return !1; })()) && (mt = isMosoteachQuizAnswerUrl() ? await (async () => { const e = getMosoteachQuizIds(), t = localStorage.getItem("teach_token") || ""; if (!e || !t) return []; try { const n = await fetch(`https://coreapi.mosoteach.cn/ccs/${e.ccId}/quizzes/${e.quizId}/topics?_ts=${Date.now()}`, { headers: { accept: "application/json, text/plain, */*", "x-client-app-id": "MTWEB", "x-client-version": "6.0.0", "x-security-type": "SECURITY_TYPE_TOKEN", "x-token": t }, credentials: "omit" }); if (!n.ok) return []; const a = await n.json(); return Array.isArray(null == a ? void 0 : a.topics) ? a.topics : []; } catch (n) { return []; } })() : getMosoteachLegacyTopics(), !0); }, ischecked: e => { const t = e.find("input").add(e.closest("label,.d-flex.align-start").find("input")).first(); return e.hasClass("is-checked") || e.hasClass("v-item--active") || t.prop("checked") || "true" === t.attr("aria-checked"); }, questionHook: (e, t) => isMosoteachLegacyQuizReplyUrl() ? parseMosoteachLegacyQuestion(e, t) : parseMosoteachDomQuestion(e) } ], yt = [ { type: "hook", name: "hook", match: "www.learnin.com.cn" === location.host, main: e => { observeVuePageChange(J("#app")[0], (() => { try { return J(".page-student-course-topic-do-container")[0].__vue__.$data.topic.studentTopic.id; } catch (e) { return ""; } })); } }, { type: "save", name: "learnin\u6536\u5f55", match: () => "www.learnin.com.cn" === location.host && location.href.includes("/user/#/user/student/course/") && 0 == J("button:contains('\u63d0\u4ea4\u4f5c\u4e1a')").length, question: { html: ".store-question-item-container", question: ".question-title", options: ".question-info>.question-option-list>.option-item", type: ".item-question-header>.header-left", workType: "learnin", pageType: "learnin" }, init: async () => { await waitUntil((function() { return isExist(".store-question-item-container"); })); }, answerHook: (e, t) => { const n = J(".store-question-item-container").eq(t)[0].__vue__.question; switch (n.questionTypeCode) { case "judgment": e.type = "3"; break; case "single": e.type = "0"; break; case "multiple": e.type = "1"; break; default: return e; } e.question = titleClean(removeHtml(n.questionTitle)); let a = [], i = []; return n.optionList.forEach((e => { const t = removeHtml(e.content); e.isAnswer && i.push(t), a.push(t); })), e.options = a, e.answer = i, "3" == e.type && (e.options = [], e.answer = judgeAnswer(i[0])), e; } }, { type: "ask", name: "learnin\u7b54\u9898", tips: "", match: () => "www.learnin.com.cn" === location.host && location.href.includes("/user/#/user/student/course/") && 1 == J("button:contains('\u63d0\u4ea4\u4f5c\u4e1a')").length, types: [ "0", "1", "3" ], question: { html: ".store-question-item-container", question: ".question-title", options: ".question-info>.question-option-list>.option-item>.option-index", type: ".item-question-header>.header-left", workType: "learnin", pageType: "learnin" }, init: async () => { await waitUntil((function() { return isExist(".store-question-item-container"); })); }, ischecked: e => e.hasClass("active"), questionHook: (e, t) => { const n = J(e.html)[0].__vue__.question; switch (n.questionTypeCode) { case "judgment": e.type = "3"; break; case "single": e.type = "0"; break; case "multiple": e.type = "1"; break; default: return e; } e.question = titleClean(removeHtml(n.questionTitle)); let a = []; return n.optionList.forEach((e => { const t = removeHtml(e.content); a.push(t); })), e.options = a, "3" == e.type && (e.options = []), e; } } ], vt = [ { type: "hook", name: "hook", match: location.host.includes("ouchn.edu.cn"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u7535\u5927\u7b54\u9898", tips: "", match: () => location.host.includes("ouchn.edu.cn") && location.href.includes("learningPlatform/#/myExamDetails/examQuestion"), types: [ "0" ], question: { html: ".everyQuest", question: ".topicTitle", options: ".optionList .topicTitle", type: ".question-box .tag", workType: "ouchn", pageType: "ouchn" }, init: async () => { await waitUntil((function() { return isExist(".everyQuest"); })); }, ischecked: isParentChecked, questionHook: e => (e.type = "0", e) }, { type: "save", name: "\u7535\u5927\u6536\u5f55", match: () => location.host.includes("ouchn.edu.cn") && location.href.includes("learningPlatform/#/myExamDetails/testPaper"), question: { html: ".everyQuest", question: ".topicTitle", options: ".optionList .topicTitle", type: ".question-box .tag", workType: "ouchn", pageType: "ouchn" }, init: async () => { await waitUntil((function() { return isExist(".everyQuest"); })); }, answerHook: e => { const t = J(e.html).find('.rightAndWrong>span:contains("\u6b63\u786e\u7b54\u6848")').text().replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), n = e.options; let a = []; return t.split("").forEach((e => { a.push(n[e.charCodeAt(0) - 65]); })), 1 == a.length ? e.type = "0" : e.type = "1", e.answer = a, e; } } ], bt = [ { type: "hook", name: "mooc", match: "www.icourse163.org" === location.host, main: e => { observeVuePageChange(J("#courseLearn-inner-box")[0], (() => J("#courseLearn-inner-box > div:eq(0)").attr("class")), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === J(".el-loading-mask").length; })); } }); } }, { type: "ask", name: "mooc\u7b54\u9898", tips: "\u4e2d\u56fd\u5927\u5b66MOOC\u9650\u5236\u7b54\u9898\u901f\u5ea6\uff0c\u8bf7\u4e0d\u8981\u8fc7\u5feb", match: () => "www.icourse163.org" === location.host && location.href.includes("#/learn/quiz?id="), types: [ "0", "1", "2", "3" ], question: { html: ".u-questionItem", question: ".f-richEditorText", options: "ul.choices>li>input", type: ".qaCate.j-qacate.f-fl", workType: "mooc", pageType: "mooc" }, init: async () => { await waitUntil((function() { return J(".u-questionItem").length, 0 !== J(".u-questionItem").length; })); }, ischecked: isParentChecked, questionHook: (e, t) => { J(e.html).find(".qaCate.j-qacate.f-fl > span:eq(0)").attr("class"); const n = ce.learnUtilQuestionList[t]; switch (e.question = removeHtml(n.title), e.options = n.options.map((e => removeHtml(e.content))), n.type) { case 1: e.type = "0"; break; case 2: e.type = "1"; break; case 3: e.type = "2"; break; case 4: e.type = "3", e.options = []; break; default: n.type, e.type = "8"; } return e; }, setAnswer: e => { switch (e.type) { case "2": return J(e.html).find(".u-baseinputui>textarea").each(((t, n) => { J(n).val(e.answer[t]), J(n).focus(), J(n).blur(); })), !1; case "3": let t = e.answer; J(e.html).find("ul.choices>li").each(((e, n) => { isTrue(t) && J(n).find(".u-icon-correct").length > 0 && J(n).find("input").click(), isFalse(t) && J(n).find(".u-icon-wrong").length > 0 && J(n).find("input").click(); })); } return !0; } }, { type: "save", name: "\u4e2d\u56fd\u5927\u5b66mooc\u6536\u5f55", match: () => "www.icourse163.org" === location.host && location.href.includes("#/learn/quizscore?id="), question: { html: ".u-questionItem", question: ".f-richEditorText", options: "ul.choices li>input", type: ".qaCate.j-qacate.f-fl", workType: "mooc", pageType: "mooc" }, init: async () => { await waitUntil((function() { return J(".u-questionItem").length, 0 !== J(".u-questionItem").length; })); }, answerHook: (e, t) => { const n = ce.learnUtilQuestionList[t]; e.question = removeHtml(n.title); let a = [], i = []; switch (n.options.forEach((e => { a.push(removeHtml(e.content)), e.answer && i.push(removeHtml(e.content)); })), e.options = a, e.answer = i, n.type) { case 1: e.type = "0"; break; case 2: e.type = "1"; break; case 3: e.type = "2", e.answer = [ n.stdAnswer ]; break; case 4: e.type = "3", e.options = []; break; default: n.type; } return e; } } ], xt = [ { type: "ask", name: "\u897f\u8d22\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.href.includes("learnspace/course/test/coursewareTest_intoRedoTestPage.action") || location.href.includes("learnspace/learn/learn/templateeight/index.action") || location.href.includes("learnspace/course/test/coursewareTest_intoTestPage.action"), types: [ "0", "1", "3" ], question: { html: ".bank_test > .test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label, .test_item_theme>label", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { await waitUntil((function() { return isExist(".bank_test > .test_item"); })); }, ischecked: isParentChecked, questionHook: e => { const t = J(e.html).find(".test_item_tit").clone(); if (t.find(".tipNodo").remove(), e.question = removeHtml(t.html()), e.question = titleClean(e.question), e.type = typeMatch(J(e.html).prevAll(".test_item_type").first().text()), e.question = e.question.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim().replace(/^\d+ ./, "").trim(), e.options = removeStartChar(e.options), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u897f\u8d22\u5728\u7ebf\u9636\u6bb5\u6d4b\u9a8c\u6536\u5f55", match: () => location.href.includes("learnspace/course/test/coursewareTest_intoTestAnswerPage.action") || location.href.includes("learnspace/learn/learn/templateeight/index.action"), question: { html: ".bank_test > .test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>.zdh_op_con", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => {}, answerHook: e => { e.type = typeMatch(J(e.html).prevAll(".test_item_type").first().text()), e.question = e.question.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim().replace(/^\d+ ./, "").trim(), e.options = removeStartChar(e.options); const t = J(e.html).find(".test_item_key_tit").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(); switch (e.type) { case "0": case "1": e.answer = t.split("").map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })); break; case "3": e.answer = judgeAnswer(t), e.options = []; } return e; } }, { type: "ask", name: "\u897f\u8d22\u5728\u7ebf\u7efc\u5408\u7ec3\u4e60\u7b54\u9898", tips: "\u897f\u8d22\u5728\u7ebf\u6536\u5f55\u8bf7\u91cd\u65b0\u70b9\u51fb\u9898\u578b\u5207\u6362\u89e6\u53d1", match: () => location.host.includes("swufe-online.com") && location.href.includes("/learnspace/userDefine/t_test.jsp?courseId="), types: [ "0", "1", "3" ], question: { html: ".timu_title", question: ".timu_title", options: ".test_item_theme>ul>li", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { if (await waitUntil((function() { return isExist(".timu_title"); })), !document.body.innerHTML.includes("\u63d0\u4ea4\u7b54\u9898\u540e\u663e\u793a")) return !1; J(".layui-tab-title>li").on("click", (function() { vuePageChange(); })); }, ischecked: isParentChecked, questionHook: (e, t) => { const n = J(e.html).attr("id"); return e.type = typeMatch(J(".layui-this").text()), e.question = removeHtml(J(e.html).html()), e.options = J(`#${n}`).map((function() { let t = [], n = J(this).next(), a = []; for (;n.length && n.hasClass("question-item-opt"); ) a.push(removeHtml(n[0].outerHTML)), t.push(n), n = n.next(); return e.$options = J(t.map((e => e[0]))).find("label"), a; })).get(), e.options = removeStartChar(e.options), e; } }, { type: "save", name: "\u897f\u8d22\u5728\u7ebf\u7efc\u5408\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("swufe-online.com") && location.href.includes("/learnspace/userDefine/t_test.jsp?courseId="), question: { html: ".timu_title", question: ".timu_title", options: ".test_item_theme>ul>li", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { if (await waitUntil((function() { return isExist(".timu_title"); })), document.body.innerHTML.includes("\u63d0\u4ea4\u7b54\u9898\u540e\u663e\u793a")) return !1; J(".layui-tab-title>li").on("click", (function() { vuePageChange(); })); }, answerHook: e => { const t = J(e.html).attr("id"); switch (e.type = typeMatch(J(".layui-this").text()), e.question = removeHtml(J(e.html).html()), e.options = J(`#${t}`).map((function() { let t = [], n = J(this).next(), a = []; for (;n.length && n.hasClass("question-item-opt"); ) a.push(removeHtml(n[0].outerHTML)), t.push(n), n = n.next(); return e.$options = J(t.map((e => e[0]))).find("label"), a; })).get(), e.options = removeStartChar(e.options), e.type) { case "0": case "1": const n = J(`#${t}`).nextAll(".ans").first().find("span:eq(0)").text(); e.answer = n.trim().split("").map((t => { let n = t.charCodeAt() - 65; return e.options[n]; })); break; case "3": e.answer = judgeAnswer(J(`#${t}`).nextAll(".ans").first().find("span:eq(0)").text().trim()), e.options = []; break; case "7": case "4": e.answer = removeHtml(J(`#${t}`).nextAll(".ans").first().html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.options = []; break; default: e.type; } return e; } } ], wt = [ { type: "ask", name: "\u91cd\u5e86\u6cd5\u6cbb\u8003\u8bd5\u7b54\u9898", tips: "\u672c\u5e73\u53f0\u65e0\u7b54\u6848\u6536\u5f55\uff0c\u9700\u8981\u81ea\u884c\u8865\u5145\u9898\u5e93\uff0c\u5efa\u8bae\u4f7f\u7528\u9898\u5e93\u5bfc\u5165\u529f\u80fd", match: () => "ks.cqsdx.cn" === location.host && location.pathname.includes("/exam/user/bind"), types: [ "0", "1", "3" ], question: { html: ".qlist", question: "span:eq(1)", options: "label", type: ".badge.badge-danger", workType: "cqsdx", pageType: "cqsdx" }, init: async () => { await waitUntil((function() { return isExist(".qlist"); })); }, toquestion: e => { J(`#question_card button:eq(${e})`).click(); }, ischecked: e => e.find("div").hasClass("checked"), questionHook: e => { const t = J(e.html).find(".badge.badge-danger").text(); if (e.type = typeMatch(t), e.question = e.question.replace(/\u206B/g, "").trim(), e.options = e.options.map((e => e.replace(/\u206B/g, "").trim())), "3" === e.type) e.options = []; return e; } } ], kt = [ { type: "hook", name: "hook", match: location.host.includes("telfri-edu.com"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "ask", name: "olearn\u7b54\u9898", tips: "", match: () => location.host.includes("telfri-edu.com") && location.href.includes("/learn/homework/do/"), types: [ "0", "1", "3" ], question: { html: ".topic-group>.topic-container", question: ".topic-title", options: ".topic-answer .radio-wrap .radio-text", type: ".question-box .tag", workType: "olearn", pageType: "olearn" }, init: async () => { await waitUntil((function() { return isExist(".topic-group>.topic-container"); })); }, ischecked: e => e.hasClass("is-active"), questionHook: e => { let t = J(e.html).prevAll(".topic-title").first().find(".title-bold").text().trim(); return e.$options = J(e.html).find(".topic-answer .radio-wrap>label"), e.type = typeMatch(t), e; } }, { type: "save", name: "olearn\u6536\u5f55", match: () => location.host.includes("telfri-edu.com") && location.href.includes("/learn/homework/show/"), question: { html: ".topic-group>.topic-container", question: ".topic-title", options: ".topic-answer .radio-wrap .radio-text", type: ".question-box .tag", workType: "olearn", pageType: "olearn" }, init: async () => { await waitUntil((function() { return isExist(".topic-group>.topic-container"); })); }, answerHook: e => { let t = J(e.html).prevAll(".topic-title").first().find(".title-bold").text().trim(); e.type = typeMatch(t); const n = J(e.html).find(".standard-answer>.analysis-text").text().trim(); switch (e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.options = [], e.answer = judgeAnswer(n); } return e; } } ], _t = [ { type: "hook", name: "hook", match: location.host.includes("yxbyun.com"), main: e => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); } }, { type: "save", name: "\u4ebf\u5b66\u5b9d\u6536\u5f55", match: () => location.host.includes("yxbyun.com") && (location.href.includes("yxbstudent/#/testPaper") || location.href.includes("yxbstudent/#/finalExam")), question: { html: ".test_wrap", question: ".content", options: ".el-radio-group input", type: ".question-box .tag", workType: "yxbyun", pageType: "yxbyun" }, init: async () => { await waitUntil((function() { return isExist(".test_wrap"); })); }, answerHook: e => { var t; const n = J(e.html).find("div:eq(0)")[0].__vue__, a = (null == (t = n.pagerData) ? void 0 : t.question) || n.smallPaper.questionTopic; return e.type = typeMatch(n.queTypeName), e.question = titleClean(removeHtml(a.questionTitle)), e.options = (a.optionList || a.questionOptionList).map((e => removeHtml(e.questionContent))), [ "0", "1", "3" ].includes(e.type) && (e.answer = a.questionAnswer.split(",").map((t => e.options[t.charCodeAt(0) - 65]))), "3" === e.type && (e.options = [], e.answer = judgeAnswer(e.answer)), e; } }, { type: "ask", name: "\u4ebf\u5b66\u5b9d\u7b54\u9898", match: () => location.host.includes("yxbyun.com") && (location.href.includes("yxbstudent/#/testPaper") || location.href.includes("yxbstudent/#/finalExam")), types: [ "0", "1", "3" ], question: { html: ".test_wrap", question: ".content", options: ".answer>.daan,.el-radio-group>label", type: ".question-box .tag", workType: "yxbyun", pageType: "yxbyun" }, init: async () => { await waitUntil((function() { return isExist(".test_wrap"); })); }, ischecked: e => e.hasClass("active"), questionHook: e => { var t; const n = J(e.html).find("div:eq(0)")[0].__vue__, a = (null == (t = n.pagerData) ? void 0 : t.question) || n.smallPaper.questionTopic; if (e.type = typeMatch(n.queTypeName), e.question = titleClean(removeHtml(a.questionTitle)), e.options = (a.optionList || a.questionOptionList).map((e => removeHtml(e.questionContent))), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, n) => { isTrue(t) && isTrue(removeHtml(J(n).parent().html())) && J(n).click(), isFalse(t) && isFalse(removeHtml(J(n).parent().html())) && J(n).click(), removeHtml(J(n).parent().html()); })), !1; } return !0; } } ], qt = [ { type: "hook", name: "hook", match: location.host.includes("wdjycj.com") || location.host.includes("iwdjy.com"), main: e => { observeVuePageChange(J("#app")[0], (() => getUrl())); } }, { type: "save", name: "\u6587\u9876\u5728\u7ebf\u6536\u5f55", match: () => location.href.includes("/testpaper-test-result?resultId=") || location.href.includes("/testpaper-test?id"), question: { html: ".st-item", question: ".st-title", options: ".st-main>p", type: ".question-box .tag", workType: "wdzx", pageType: "wdzx" }, init: async () => { await waitUntil((function() { return isExist(".st-item"); })); let e = []; try { J(".exam-html")[0].__vue__.test.lists.forEach(((t, n) => { t.question_lists.forEach(((t, n) => { e.push(t); })); })); } catch (t) {} unsafeWindow.ques = e; }, answerHook: (e, t) => { var n; const a = unsafeWindow.ques[t], i = []; switch (e.question = titleClean(removeHtml(a.content)), e.options = (null == (n = a.appanswer) ? void 0 : n.map((e => { const t = removeHtml(e.text); return e.right && i.push(t), removeHtml(t); }))) || [], a.tm_type) { case 4: e.type = "3", e.answer = judgeAnswer("1" == a.answer ? "\u6b63\u786e" : "0" == a.answer ? "\u9519\u8bef" : ""); break; case 5: e.type = "2", e.question = e.question.replace(/{#answer}/g, "_____"), e.answer = a.answer.split("|").map((e => e.includes("\u203b") ? e.split("\u203b")[0] : e)); break; case 2: e.type = "0", e.answer = i; break; case 3: e.type = "1", e.answer = i; break; case 1: e.type = "4", e.answer = removeHtml(a.answer); break; default: a.tm_type; } return e; } }, { type: "ask", name: "\u6587\u9876\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.href.includes("/testpaper-test?id=") || location.href.includes("/final-exam"), types: [ "0", "1", "2", "3" ], question: { html: ".st-item", question: ".st-title", options: ".st-main>p", type: ".question-box .tag", workType: "wdzx", pageType: "wdzx" }, init: async () => { await waitUntil((function() { return isExist(".st-item"); })); }, toquestion: e => { J(`.card-box .bj:eq(${e})`).click(); }, ischecked: e => J(e).find("input").prop("checked"), questionHook: (e, t) => { e.options = removeOptionsStartChar(e.options); const n = J(e.html).find(".st-title").clone(); J(n).find("strong").remove(), e.question = removeHtml(J(n).html()); let a = J(e.html).prevAll(".title").first().text().trim(); return e.type = typeMatch(a), e.$options = J(e.html).find(".answer-box>.answer>label"), e; }, setAnswer: e => { switch (e.type) { case "4": case "5": case "6": case "7": return J(e.html).find(".answer-text>div")[0].__vue__.msg.yourAnswer = e.answer[0], J(e.html).find(".quill-editor").map(((t, n) => { n.__vue__.value = e.answer[t]; })), !1; case "2": let setYourAnswerById = function(e, t, n) { for (let a of e) if (Array.isArray(a.itemlists)) for (let e of a.itemlists) if (e.id === t) return e.yourAnswer = n, !0; return !1; }; const t = J(e.html).find("span.bj input").attr("name"); return setYourAnswerById(J(".exam-html")[0].__vue__.answerCard, Number(t), e.answer), e.answer, !1; } return !0; } } ], cleanOptionText = e => e.replace(/ /g, " ").replace(/\uff08\u60a8\u7684\u9009\u62e9\uff09/g, "").replace(/\uff08\u6b63\u786e\u7b54\u6848\uff09/g, "").replace(/^\s*[A-Z]\s*[\.\u3001\uff0e]\s*/, "").replace(/\s+/g, " ").trim(), getSectionType = e => { const t = J(e)[0]; if (!t) return typeMatch(""); const n = (t.closest(".exam-section") || document).querySelectorAll(".section-title, .exam-title"); let a = ""; for (let i = 0; i < n.length; i++) { const e = n[i]; if (!(e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING)) break; a = e.textContent || ""; } return typeMatch(a); }, At = [ { type: "ask", name: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u7b54\u9898", tips: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u4ec5\u652f\u6301\u9009\u62e9\u3001\u5224\u65ad\u9898\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301\uff0c\u82e5\u6709\u9700\u8981\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.href.includes("/student/study/examPage") && !location.href.includes("/student/study/examPageShow"), question: { html: ".question-item", question: ".question-content", options: ".answer-option", type: "", workType: "whut", pageType: "whut" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-item").length; })); }, ischecked: e => e.find("input").is(":checked"), questionHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\s*[\u3001.\uff09)]/, "").trim(); const t = []; return e.$options.each(((e, n) => { const a = J(n).clone(); a.find(".el-radio__input, .el-checkbox__input, input").remove(), t.push(cleanOptionText(a.text())); })), e.options = t, e.type = getSectionType(e.html), e.type, e; } }, { type: "save", name: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u6536\u5f55", match: () => location.href.includes("/student/study/examPageShow"), question: { html: ".question-item", question: ".question-content", options: ".option-item", type: "", workType: "whut", pageType: "whut" }, init: async () => { await waitUntil((function() { return 0 !== J(".question-item").length && 0 !== J(".question-item .correct-answer, .question-item .option-item.correct").length; })); }, answerHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\s*[\u3001.\uff09)]/, "").trim(); const t = []; e.$options.each(((e, n) => { const a = J(n).clone(); a.find(".option-label, .user-choice, .correct-answer").remove(), t.push(cleanOptionText(a.text())); })), e.options = t, e.type = getSectionType(e.html); const n = []; return e.$options.each(((t, a) => { (J(a).hasClass("correct") || J(a).find(".correct-answer").length > 0) && n.push(e.options[t]); })), "3" === e.type ? (e.answer = n.length ? n[0] : "", e.options = []) : e.answer = n, e; } } ], Tt = [ { type: "save", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u6536\u5f55", match: () => location.host.includes("dufe.edu.cn") && (location.href.includes("/HomeWorkPaper") || location.href.includes("/HomeWorkHistoryPaper") || location.href.includes("/ExercisesPaper")), question: { html: ".QuestTrunk,.HistoryQuestTrunk", question: ".CBTPaperMain-divInline", options: ".CBTPaperMain-options li", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => { await waitUntil((function() { return isExist(".QuestTrunk,.HistoryQuestTrunk"); })); }, answerHook: e => { const t = e.html.vtree[0].vmodel._trunks[0], n = e.html.vtree[0].vmodel._type; let a = [], i = []; const getOption = () => { t.QUESTION_OPTIONS.forEach((e => { const t = removeHtml(e.OPTION_CONTENT); "1" === e.ISTRUE && a.push(t), i.push(t); })); }; switch (n) { case "001": e.type = "0", getOption(); break; case "002": e.type = "1", getOption(); break; case "004": e.type = "3", e.options = [], a = "1" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u6b63\u786e" ] : "0" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u9519\u8bef" ] : []; break; case "005": e.type = "4", a = [ removeHtml(t.QUESTION_OPTIONS[0].OPTION_CONTENT) ]; } return e.question = titleClean(t.QUESTION_TITLE), e.options = i, e.answer = a, e; } }, { type: "ask", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u7b54\u9898", match: () => location.host.includes("dufe.edu.cn") && (location.href.includes("/HomeWorkPaper") || location.href.includes("/ExercisesPaper")), types: [ "0", "1", "3", "4" ], question: { html: ".QuestTrunk", question: ".CBTPaperMain-divInline", options: ".CBTPaperMain-options li>label", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => {}, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = e.html.vtree[0].vmodel._trunks[0], n = e.html.vtree[0].vmodel._type; let a = [], i = []; const getOption = () => { t.QUESTION_OPTIONS.forEach((e => { const t = removeHtml(e.OPTION_CONTENT); "1" === e.ISTRUE && a.push(t), i.push(t); })); }; switch (n) { case "001": e.type = "0", getOption(); break; case "002": e.type = "1", getOption(); break; case "004": e.type = "3", e.options = [], a = "1" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u6b63\u786e" ] : "0" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u9519\u8bef" ] : []; break; case "005": e.type = "4", a = [ removeHtml(t.QUESTION_OPTIONS[0].OPTION_CONTENT) ]; } return e.question = titleClean(t.QUESTION_TITLE), e.options = i, e.answer = a, e; }, setAnswer: e => { if ("4" === e.type) { const t = J(e.html).find("textarea")[0]; return t._ms_context_._answer = e.answer[0], t._ms_context_._save(), !1; } return !0; } }, { type: "ask", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u7b54\u9898(\u7efc\u5408)", match: () => location.host.includes("dufe.edu.cn") && location.href.includes("/CompHomeworkPaper"), types: [ "0", "1", "3", "4" ], question: { html: ".Question", question: ".CBTPaperMain-trunkTitle", options: "ul.Question-options>li", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => {}, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = (e => { var t; if (e) { const n = Object.keys(e).find((e => e.startsWith("__reactEventHandlers"))); if (n) { const t = e[n]; return console.log("React \u4e8b\u4ef6\u5904\u7406\u5bf9\u8c61:", t), t; } if (!n) { const n = Object.keys(e).find((e => e.startsWith("__reactInternalInstance$") || e.startsWith("__reactFiber$"))); if (n && (null == (t = e[n]) ? void 0 : t.memoizedProps)) return console.log("React \u5185\u90e8\u6570\u636e:", e[n].memoizedProps), e[n].memoizedProps; } } else console.error("\u672a\u627e\u5230 .Question \u5143\u7d20"); })(e.html).children[0]._owner.memoizedProps; return e.type = { SingleChoice: "0", MultipleChoice: "1" }[t.type], e.options = removeStartChar(e.options), e; }, setAnswer: e => { if ("4" === e.type) { const t = J(e.html).find("textarea")[0]; return t._ms_context_._answer = e.answer[0], t._ms_context_._save(), !1; } return !0; } } ], Ct = { single: "0", multiple: "1", judge: "3" }, St = [ { type: "hook", name: "hook", match: location.host.includes("lygtc.edu.cn"), main: () => { observeVuePageChange(J("#app")[0], (() => J("#app")[0].__vue__.$route.path)); } }, { type: "save", name: "\u6625\u98ce\u96e8\u6536\u5f55", match: () => location.host.includes("lygtc.edu.cn") && (location.href.includes("/student/#/my-study/homework/records/detail") || location.href.includes("/student/#/my-study/homework")), question: { html: ".questions>div>div[id],.question>div>div[id]", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "cfy", pageType: "cfy" }, init: async () => { await waitUntil((() => 0 !== J(".questions>div>div[id],.question>div>div[id]").length)); }, answerHook: e => { const t = J(e.html).find(">div")[0].__vue__.question; return e.question = titleClean(removeHtml(t.title)), e.options = JSON.parse(t.options).map((e => e.content)), e.answer = t.answer.split("").map((t => e.options[t.charCodeAt(0) - 65])).filter(Boolean), e.type = Ct[t.type] || "", "judge" === t.type && (e.options = [], e.answer = [ judgeAnswer(t.answer) ]), t.type, e; } }, { type: "ask", name: "\u6625\u98ce\u96e8\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("lygtc.edu.cn") && location.href.includes("/student/#/my-study/homework"), types: Object.values(Ct), question: { html: ".question>div>div[id]", question: ".question-title>.title", options: ".radio-option", type: ".question-box .tag", workType: "cfy", pageType: "cfy" }, init: async () => { await waitUntil((() => 0 !== J(".question>div>div[id]").length)); }, ischecked: e => e.find(".el-radio__input.is-checked").length > 0, questionHook: e => { e.options = removeStartChar(e.options); const t = J(e.html).find(">div")[0].__vue__.question; return e.question = titleClean(removeHtml(t.title)), e.options = JSON.parse(t.options).map((e => e.content)), e.type = Ct[t.type] || "", "judge" === t.type && (e.options = [], e.answer = [ judgeAnswer(t.answer) ]), e; } } ], Et = [ { type: "hook", name: "hook", match: location.host.includes("jijiaool.com"), main: e => { observeVuePageChange(J(".contentIframe")[0], (() => J(".contentIframe").attr("src"))); } }, { type: "ask", name: "\u7ee7\u6559\u5728\u7ebf\u7b54\u9898", match: () => location.href.includes("jijiaool.com") && location.href.includes("/Learning/CourseOnlineExamination"), types: [ "0", "1" ], question: { html: ".bank_test>.test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label", type: ".question-box .tag", workType: "jijiaool", pageType: "jijiaool" }, init: async () => { await waitUntil((function() { return isExist(".bank_test>.test_item"); })); }, ischecked: isParentChecked, questionHook: e => { e.options = removeOptionsStartChar(e.options); const t = J(e.html).prevAll(".test_item_type").first().text().trim(); return e.type = typeMatch(t), e; } }, { type: "save", name: "\u7ee7\u6559\u5728\u7ebf\u6536\u5f55", match: () => location.href.includes("jijiaool.com") && location.href.includes("/Learning/CourseExamWorkPageDetail"), question: { html: ".bank_test>.test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label", type: ".question-box .tag", workType: "jijiaool", pageType: "jijiaool" }, init: async () => { await waitUntil((function() { return isExist(".bank_test>.test_item"); })); }, answerHook: e => { const t = J(e.html).find(".test_item_tit").clone(); t.find(".tipNodo").remove(), e.question = titleClean(removeHtml(t.html())), e.options = removeOptionsStartChar(e.options); const n = removeHtml(J(e.html).find(".test_item_tit:eq(1)").html().replace(/ \u6b63\u786e\u7b54\u6848\uff1a/g, "").trim()), a = J(e.html).prevAll(".test_item_type").first().text().trim(); switch (e.type = typeMatch(a), e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.answer = judgeAnswer(n), e.options = []; } return e; } } ], It = [ { type: "save", name: "\u5317\u4eac\u8054\u5927\u5b66\u5802\u6536\u5f55", match: () => location.host.includes("jxjypt.cn") && location.href.includes("/paper/start?pid="), question: { html: "#questionModule>ul>li", question: ".sub-dotitle>pre", options: "dl.sub-answer>dd", type: ".sub-dotitle>i", workType: "jhjypt", pageType: "jhjypt" }, init: async () => {}, answerHook: e => { let t = removeHtml(J(e.html).find(".refer-answer>span>em.right ,.solution .so-timu .wenzi:eq(0)").html()); if (void 0 === t || "undefined" == t) return null; switch (e.options = removeStartChar(e.options), e.type = typeMatch(removeHtml(J(e.html).find(".sub-dotitle>i").text().replace("\n", "").replace(" ", ""))), e.type) { case "0": case "1": e.answer = [], t.split("").forEach((t => { e.answer.push(e.options[t.charCodeAt() - 65]); })); break; case "2": case "4": case "5": case "6": case "7": e.answer = t; } return e; } }, { type: "ask", name: "\u5317\u4eac\u8054\u5927\u5b66\u5802\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("jxjypt.cn") && location.href.includes("/paper/start?pid="), types: [ "0", "1", "2", "3", "4", "5", "6", "7" ], minDelay: 1e3, answerDelay: 1e3, question: { html: "#questionModule>ul>li", question: ".sub-dotitle>pre", options: "dl.sub-answer>dd", type: ".sub-dotitle>i", workType: "jhjypt", pageType: "jhjypt" }, init: async () => { if (await waitUntil((function() { return 0 !== J("#questionModule>ul>li").length; })), !isExist("#btn_submit")) return !1; try { const e = ce.addEventListener; ce.addEventListener = function(t, n, a) { if ("visibilitychange" !== t) return e.call(this, t, n, a); }, ce.paper && void 0 !== ce.paper.isCut && (ce.paper.isCut = 0), Object.defineProperty(ce.document, "visibilityState", { get: function() { return "visible"; }, configurable: !0 }), Object.defineProperty(ce.document, "hidden", { get: function() { return !1; }, configurable: !0 }); } catch (e) {} }, ischecked: e => e.hasClass("cho-this"), questionHook: e => (e.options = removeStartChar(e.options), e.type = typeMatch(removeHtml(J(e.html).find(".sub-dotitle>i").text().replace("\n", "").replace(" ", ""))), e), setAnswer: e => { switch (e.type) { case "2": case "4": case "5": case "6": case "7": const t = J(e.html).find(".e__textarea"); if (t.length > 0) { const n = t[0]; n.value = e.answer, t.focus(); [ "input", "change", "keyup", "keydown", "blur", "paste" ].forEach((e => { const t = new Event(e, { bubbles: !0, cancelable: !0 }); n.dispatchEvent(t); })), t.trigger("input").trigger("change").trigger("keyup").trigger("blur"), setTimeout((() => { t.trigger("change"); }), 100), e.answer; } return !1; } return !0; } } ], Ut = Object.freeze(Object.defineProperty({ __proto__: null, a21tb: it, ahjxjy: $e, cfy: St, chaoxing: Ee, chatglm: He, chengjiaoyun: ze, chutou: We, cjedu: De, cjnep: et, cloudwis: Je, cnzx: Me, cqsdx: wt, dufe: Tt, gkks: Ge, guokai: je, huayi: nt, jhjypt: It, jijiaool: Et, jijiaox: Ye, jsou: Pe, learnin: yt, ls365: Qe, mooc: bt, mosoteach: gt, mynep: tt, olearn: kt, openha: Ve, ouchn: vt, qingshu: Fe, sclecb: Ke, swufe: xt, uooc: Ne, wdjycj: qt, wencai: Xe, whut: At, wx168: ot, xinwei: Ue, xueqi: Be, ynou: at, ytccr: Re, yunmuxueyuan: qe, yxbyun: _t, yxlearning: Ze, zhihuishu: Ie, zhijiaoyun: Le }, Symbol.toStringTag, { value: "Module" })), resolveRuleHtml = e => "function" == typeof e ? e() : e; const createQuestionData = (e, t) => { const n = J(t), a = removeHtml(n.find(e.question).html()), i = n.find(e.options).map(((e, t) => removeHtml(J(t).html()))).get(); return { question: titleClean(a ?? ""), options: i, $options: n.find(e.options), type: n.find(e.type).val(), html: n[0], workType: e.workType, pageType: e.pageType }; }, Ht = []; for (const Fd in Ut) Ht.push(...Ut[Fd]); const isRuleMatched = e => "function" == typeof e.match ? e.match() : Boolean(e.match), parseRule = async e => { await waitUntil((() => void 0 !== ce[Mt + "app"])); const t = e.filter(isRuleMatched), n = getAppStore(), a = { app: n, ask: getAskStore(), ai: ce[Mt + "ai"] }; if (!t.length) return n.app.alert = "\u5f53\u524d\u6ca1\u6709\u4efb\u52a1", console.log("\u6ca1\u6709\u5339\u914d\u5230\u89c4\u5219", "error"), void addLog("\u6ca1\u6709\u5339\u914d\u5230\u89c4\u5219", "error"); for (const i of t) { if (console.log(`\u5339\u914d\u5230\u89c4\u5219\uff1a${i.name}`, "success"), addLog(`\u5339\u914d\u5230\u89c4\u5219\uff1a${i.name}`, "success"), i.init) { let e = await i.init(); if ("boolean" == typeof e && !1 === e) continue; } n.alert = `\u5f53\u524d\u4efb\u52a1:${i.name}`, "hook" === i.type && i.main(a), "ask" === i.type && askParser(i, a), "save" === i.type && await saveParser(i, a); } }, saveParser = async (e, t) => { const n = t.app, a = t.ask; a.rule = e, e.tips && (a.tips = e.tips); const i = questionSaveParser(e.question, e.answerHook || null).filter((e => null != e && 0 !== e.answer.length && "" !== e.answer && "8" != e.type)).map((e => (e.question = titleClean(e.question), e))); a.saveQuestionData = i, i.forEach((e => { 0 !== e.answer.length && Answer.cacheAnswer(e); })), await async function({questionList: e, pageType: t, paper: n, onPaperError: a, beforeSync: i, syncQuestionList: o}) { if (n) try { await n(e); } catch (r) { null == a || a(r); } const s = { questionList: e, pageType: t }; return null == i || i(s), e.length && await o(s), s; }({ questionList: i, pageType: e.question.pageType, paper: e.paper && "function" == typeof e.paper ? e.paper : void 0, onPaperError: () => addLog("\u6574\u5377\u7f13\u5b58\u5f02\u5e38", "error"), beforeSync: () => n.setPage("question"), syncQuestionList: e => Answer.syncQuestionList(e) }), n.app.alert = `\u9898\u5e93\u6536\u5f55\u5b8c\u6210\uff0c\u5171\u7f13\u5b58${i.length}\u9053\u9898\u76ee`, msg(`\u9898\u5e93\u6536\u5f55\u5b8c\u6210\uff0c\u5171\u7f13\u5b58${i.length}\u9053\u9898\u76ee`, "success"), e.next && e.next(); }, askParser = (e, t) => { const n = t.app, a = t.ask; a.rule = e, e.minDelay && (a.minDelay = e.minDelay, a.delay < a.minDelay && (a.delay = a.minDelay)), e.tips && (a.tips = e.tips), n.app.showFloat = !n.app.hideFloat, n.setPage("ask"), a.clearQuestion(); questionParser(e.question, e.questionHook || null).map((e => (e.question = titleClean(e.question), "3" == e.type && (e.options = []), e))).forEach((e => { a.addQuestion(e); })), a.autoAnswer && a.toggleStart(); }, questionSaveParser = (e, t) => { const n = resolveRuleHtml(e.html); return J(n).map(((n, a) => { let i = { ...createQuestionData(e, a), $answer: J(a).find(e.answer), answer: [] }; try { t && (i = t(i, n)); } catch (o) { console.log("\u6536\u5f55hook\u62a5\u9519", o); } return null == i || null == i ? null : (i.question && "" != i.question && (i.question = titleClean(i.question)), i.options && i.options.length > 0 && "object" != typeof i.options[0] && (i.options = removeStartChar(i.options)), { question: i.question, options: i.options, answer: i.answer, type: i.type, hash: questionHash(i.type, i.question, i.options) }); })).get(); }, questionParser = (e, t) => { const n = resolveRuleHtml(e.html); return J(n).map(((n, a) => { let i = createQuestionData(e, a); return t && (i = t(i, n)), i; })).get(); }; class AnonymousIdentityOptimized { static generateShortId() { return Date.now().toString(36).padStart(8, "0").slice(-8) + Array.from({ length: 8 }, (() => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Math.floor(62 * Math.random())])).join(""); } static validateId(e) { return /^[0-9A-Za-z]{16}$/.test(e); } static getAnonymousId() { if (this.cachedAnonymousId) return this.cachedAnonymousId; let e = ie(this.STORAGE_KEY); return e && this.validateId(e) || (e = this.generateShortId(), re(this.STORAGE_KEY, e)), this.cachedAnonymousId = e, e; } static getStableCanvasFingerprint() { try { const e = document.createElement("canvas"); e.width = 220, e.height = 30; const t = e.getContext("2d", { willReadFrequently: !0 }); if (!t) return ""; t.textBaseline = "alphabetic", t.fillStyle = "#000", t.font = "16px Arial", t.fillText("AiAsk,\ud83c\udf10.\ud83d\ude00", 2, 20); const n = t.getImageData(0, 0, 220, 30).data; let a = 0; for (let i = 0; i < n.length; i += 40) a = (a << 5) - a + n[i], a |= 0; return a.toString(36); } catch (e) { return ""; } } static getWebGLFingerprint() { try { const e = document.createElement("canvas"), t = e.getContext("webgl") || e.getContext("experimental-webgl"); if (!t) return ""; const n = t.getExtension("WEBGL_debug_renderer_info"); if (!n) return t.getParameter(t.VERSION) + "|" + t.getParameter(t.VENDOR); const a = t.getParameter(n.UNMASKED_VENDOR_WEBGL); return a + "|" + t.getParameter(n.UNMASKED_RENDERER_WEBGL); } catch (e) { return ""; } } static getDeviceFingerprint() { if (this.cachedFingerprint) return this.cachedFingerprint; const e = ie(this.FINGERPRINT_KEY); if (e && e.version === this.FP_VERSION && e.value) return this.cachedFingerprint = e.value, e.value, e.value; const t = [ this.normalizeUserAgent(navigator.userAgent), navigator.language, navigator.platform, screen.colorDepth, screen.pixelDepth || screen.colorDepth, (new Date).getTimezoneOffset(), navigator.hardwareConcurrency || 0, navigator.maxTouchPoints || 0, navigator.deviceMemory || 0, this.getWebGLFingerprint(), this.getStableCanvasFingerprint() ].filter(Boolean).join("|"), n = _e(t).substring(0, 12); return re(this.FINGERPRINT_KEY, { value: n, version: this.FP_VERSION, createdAt: Date.now() }), this.cachedFingerprint = n, n; } static normalizeUserAgent(e) { return e.includes("Chrome") ? "Chrome" : e.includes("Firefox") ? "Firefox" : e.includes("Safari") ? "Safari" : e.includes("Edge") ? "Edge" : e.includes("Opera") ? "Opera" : "Unknown"; } static getIdentity() { return { anonymous_id: this.getAnonymousId(), device_fingerprint: this.getDeviceFingerprint() }; } static clear() { re(this.STORAGE_KEY, null), re(this.FINGERPRINT_KEY, null), this.cachedAnonymousId = null, this.cachedFingerprint = null; } static regenerateFingerprint() { return re(this.FINGERPRINT_KEY, null), this.cachedFingerprint = null, this.getDeviceFingerprint(); } static getDebugInfo() { return { anonymous_id: this.getAnonymousId(), device_fingerprint: this.getDeviceFingerprint(), fingerprint_components: { browser: this.normalizeUserAgent(navigator.userAgent), language: navigator.language, platform: navigator.platform, screen_color: screen.colorDepth, timezone: (new Date).getTimezoneOffset(), hardware: navigator.hardwareConcurrency, webgl: this.getWebGLFingerprint() }, storage: { fp_stored: ie(this.FINGERPRINT_KEY), id_stored: ie(this.STORAGE_KEY) } }; } static async testStability(e = 10) { const t = []; for (let a = 0; a < e; a++) { this.cachedFingerprint = null; const e = this.getDeviceFingerprint(); t.push(e), await new Promise((e => setTimeout(e, 100))); } const n = new Set(t); n.size, n.size, Array.from(n), n.size, 1 === n.size || n.size; } } __publicField(AnonymousIdentityOptimized, "STORAGE_KEY", "anonymous_id"), __publicField(AnonymousIdentityOptimized, "FINGERPRINT_KEY", "device_fingerprint"), __publicField(AnonymousIdentityOptimized, "FP_VERSION", "v2"), __publicField(AnonymousIdentityOptimized, "cachedAnonymousId", null), __publicField(AnonymousIdentityOptimized, "cachedFingerprint", null); const normalizeRequestApiResponse = async (e, t) => { let n; try { n = JSON.parse(e.responseText); } catch { throw new Error("\u63a5\u53e3\u54cd\u5e94\u4e0d\u662f\u6709\u6548 JSON"); } if (!(null == n ? void 0 : n.encrypted)) return e; const a = await t(String(n.data ?? "")); if (!a) throw new Error("\u63a5\u53e3\u54cd\u5e94\u89e3\u5bc6\u5931\u8d25"); return { ...e, responseText: a }; }, Ot = 864e5, jt = [ { id: "492563", name: "GreasyFork", home: "https://greasyfork.org/zh-CN/scripts/492563-%E7%88%B1%E9%97%AE%E7%AD%94%E5%8A%A9%E6%89%8B", updateurl: "https://greasyfork.org/zh-CN/scripts/492563.json", getdata: e => { const t = JSON.parse(e[0].responseText); return { version: t.version, code_updated_at: formatDate(t.code_updated_at) }; } }, { id: "2384", name: "\u811a\u672c\u732b", home: "https://scriptcat.org/zh-CN/script-show-page/2384", updateurl: "https://scriptcat.org/api/v2/scripts/2384", getdata: e => { const t = JSON.parse(e[0].responseText); return { version: t.data.script.version, code_updated_at: formatDate(new Date(1e3 * t.data.updatetime).toISOString()) }; } } ]; function getAppStore() { return ce[Mt + "app"]; } function getAskStore() { return ce[Mt + "ask"]; } function request(e, t, n = void 0, a = void 0, i = 5e3) { "GET" === t && n && (e += `?${new URLSearchParams(n).toString()}`), "POST" === t && (a = { ...a }); const o = { "User-Agent": ce.navigator.userAgent, "Content-Type": "application/json", referer: location.href, ...a }; return new Promise(((a, s) => { const r = Date.now(); le({ method: t, url: e, headers: o, data: "GET" !== t ? JSON.stringify(n) : void 0, timeout: i, onload: function(e) { const t = Date.now(); a([ e, t - r ]); }, ontimeout: () => s(new Error("\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6")), onerror: e => { s(e); } }); })); } function requestApi(e, t, n = void 0, a = void 0, i = 5e3) { return "GET" === t && n && (e += `?${new URLSearchParams(n).toString()}`), new Promise((async (o, s) => { const r = Cache.get("user", {}), l = r && r.user && r.api_key; let c; if ("POST" === t) { if (!l) { const e = AnonymousIdentityOptimized.getIdentity(); n = { ...n, anonymous_id: e.anonymous_id, device_fingerprint: e.device_fingerprint }; } const e = get_t(n); a = { ...a, aka: e }, c = await encrypt(JSON.stringify(n), e); } else a = { ...a, aka: get_t({}) }; const p = { "User-Agent": ce.navigator.userAgent, "Content-Type": "application/json", referer: location.href, v: $t.script.version, ...a }; if (l) p.Authorization = `Bearer ${r.api_key}`; else { const e = AnonymousIdentityOptimized.getIdentity(); p["X-Anonymous-ID"] = e.anonymous_id, p["X-Device-FP"] = e.device_fingerprint; } const d = Date.now(); JSON.stringify(n), le({ method: t, url: e, headers: p, data: "GET" !== t ? JSON.stringify({ data: c }) : void 0, timeout: i, onload: async function(e) { const t = Date.now() - d; try { const n = await normalizeRequestApiResponse(e, decrypt); JSON.parse(n.responseText), o([ n, t ]); } catch (n) { s(n); } }, ontimeout: () => s(new Error("\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6")), onerror: e => { s(e); } }); })); } const vuePageChange = async () => { if (ce.vuePageChangeLock) return; ce.vuePageChangeLock = !0; const e = getAppStore(), t = getAskStore(); t.questionInx = 0, e.app.showFloat = !1, e.setPage("home"), t.clearQuestion(), await parseRule(Ht), ce.vuePageChangeLock = !1; }, observeVuePageChange = (e, t, n = {}) => { if (ce.mainClass = t(), !e) return; const a = new MutationObserver((async () => { const e = t(); ce.mainClass !== e && (ce.mainClass = e, n.beforeChange && await n.beforeChange(e), await vuePageChange(), a.disconnect()); })); a.observe(e, { subtree: !0, attributes: !0, childList: !0 }); }, addLog = (e, t = "info") => { const n = getAppStore(), a = (new Date).toLocaleString(); try { n.addLog({ time: a, type: t, content: e }); } catch (i) { console.log(e); } }, compareVersions = (e, t) => { const normalize = e => e.split(".").map(Number), n = normalize(e), a = normalize(t); for (let i = 0; i < Math.max(n.length, a.length); i++) { const e = n[i] || 0, t = a[i] || 0; if (t > e) return !0; if (t < e) return !1; } return !1; }, updateFn = async (e = !0) => { if (!getAppStore().app.checkUpdate) return; const t = Cache.get("lastCheckTime"); if (e && t && Date.now() - t < Ot) { new Date(t + Ot).toLocaleString(); } else try { const e = await Promise.allSettled(jt.map((async e => { try { e.name, e.updateurl, addLog(`[${e.name}] \u5f00\u59cb\u68c0\u6d4b\u66f4\u65b0`, "info"); const t = await request(e.updateurl, "GET", {}, {}), n = e.getdata(t); return e.name, { script: e, updateInfo: n }; } catch (t) { throw e.name, String(t), addLog(`[${e.name}] \u66f4\u65b0\u68c0\u6d4b\u5931\u8d25: ${String(t)}`, "error"), t; } }))); Cache.set("lastCheckTime", Date.now()); const t = e.filter((e => "fulfilled" === e.status)); e.filter((e => "rejected" === e.status)); if (0 === t.length) return void msg("\u6240\u6709\u66f4\u65b0\u6e90\u68c0\u6d4b\u5931\u8d25\uff0c\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005\u3002", "error"); let n = !1, a = !0; for (const {value: i} of t) { const {script: e, updateInfo: t} = i; if (compareVersions($t.script.version, t.version)) { msg(`\n\u68c0\u6d4b\u5230\u65b0\u7248\u672c\uff1a${t.version}
\n\u811a\u672c\u6e90\uff1a${e.name}
\n\u66f4\u65b0\u65f6\u95f4\uff1a${t.code_updated_at}
\n \n")).replace(/<\/xmp>/g, ""); let a = (e = V.sanitize(e, { ALLOWED_TAGS: [ "img", "br", "sub", "sup" ], ALLOWED_ATTR: [ "src", "href" ], ALLOW_DATA_ATTR: !1, KEEP_CONTENT: !0 })).match(/
${escapeHtml(n.trim())}`))),
t = t.replace(/`([^`]+)`/g, ((e, t) => protect(`${escapeHtml(t)}`))),
t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, ((e, t, n) => protect(`${t}`))),
t = t.replace(/\*\*(.+?)\*\*/g, "$1"), t = t.replace(/__(.+?)__/g, "$1"),
t = t.replace(/\*(.+?)\*/g, "$1"), t = t.replace(/_(.+?)_/g, "$1"),
t = t.replace(/^### (.+)$/gm, "