// ==UserScript==
// @name 爱问答助手
// @namespace aiask/askHelper
// @version 1.0.5
// @author aiask
// @description 全平台问答助手,一键获取整个页面的试题答案,目前支持【超星学习通、国开、广开】,更多平台开发中...
// @license MIT
// @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 *://*.asklib.com/*
// @match *://*.chaoxing.com/*
// @match *://lms.ouchn.cn/*
// @match *://tongyi.aliyun.com/qianwen/*
// @match *://chatglm.cn/*
// @match *://*.zhihuishu.com/*
// @match *://course.ougd.cn/*
// @match *://moodle.syxy.ouchn.cn/*
// @match *://moodle.qwbx.ouchn.cn/*
// @match *://elearning.bjou.edu.cn/*
// @match *://whkpc.hnqtyq.cn:5678/*
// @match *://study.ouchn.cn/*
// @require https://cdn.bootcdn.net/ajax/libs/vue/3.4.21/vue.global.prod.js
// @require https://cdn.bootcdn.net/ajax/libs/vue-demi/0.14.6/index.iife.js
// @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
// @require https://cdn.bootcdn.net/ajax/libs/element-plus/2.6.3/index.full.min.js
// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js
// @require https://cdn.bootcdn.net/ajax/libs/highlight.js/11.9.0/highlight.min.js
// @require https://cdn.bootcdn.net/ajax/libs/markdown-it/13.0.1/markdown-it.min.js
// @resource ElementPlus https://cdn.bootcdn.net/ajax/libs/element-plus/2.6.3/index.min.css
// @resource ttf https://www.forestpolice.org/ttf/2.0/table.json
// @connect 127.0.0.1
// @connect 62.234.36.191
// @connect icodef.com
// @connect muketool.com
// @connect 82.157.105.20
// @grant GM_addStyle
// @grant GM_getResourceText
// @grant GM_getValue
// @grant GM_info
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @run-at document-start
// @downloadURL none
// ==/UserScript==
(e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const i=document.createElement("style");i.textContent=e,document.head.append(i)})(" button[data-v-6d85ad8a]{margin:10px}.aah_plat span[data-v-6d85ad8a]{margin:5px}.el-row{margin-bottom:20px}.el-row:last-child{margin-bottom:0}.el-col{border-radius:4px}.grid-content{border-radius:4px;min-height:36px}.aah_btn{width:100%}.aah_title img{max-width:100%;height:auto;overflow:hidden}.aah_title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;margin-bottom:10px}.aah_active{box-shadow:0 0 5px #0af}.aah_password input{--el-input-inner-height: calc(var(--el-input-height, 32px) - 2px);background:none;border:none;box-sizing:border-box;color:var(--el-input-text-color, var(--el-text-color-regular));flex-grow:1;font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);outline:none;padding:0;width:100%;margin:auto}.el-input__inner{border:none!important;margin:auto;--el-input-inner-height: calc(var(--el-input-height, 32px) - 2px);background:none;border:none;box-sizing:border-box;color:var(--el-input-text-color, var(--el-text-color-regular));flex-grow:1;font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);outline:none;padding:0;width:100%}.aah_bomHet50{padding:13px 0 13px 10px}.aah_bomHet50 span{display:inline-block;line-height:24px;padding-left:14px;color:#a8a8b3}.aah_bomHet50 span i{display:inline-block;width:10px;height:10px;border:1px solid #DBDFE9;border-radius:2px;vertical-align:middle;margin-right:4px;margin-top:-2px}.aah_bomHet50 .dq i{background-color:#ecf5ff;box-shadow:0 0 5px #0af}.aah_bomHet50 .yp i{background-color:#f0f9eb;border-color:#409eff}.aah_bomHet50 .wp i{background-color:#fef0f0;border-color:#f56c6c}.aah_wrapper>div{pointer-events:none}.aah_wrapper>div>div{pointer-events:none}.el-dialog{pointer-events:auto}.minimized-dialog img{pointer-events:auto;width:50px!important;z-index:100;position:fixed;bottom:0;right:0}.aah_breadcrumb{margin-bottom:20px} ");
(function (vue, ElementPlus, $, markdownit, hljs) {
'use strict';
var _GM_getResourceText = /* @__PURE__ */ (() => typeof GM_getResourceText != "undefined" ? GM_getResourceText : void 0)();
var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
var _GM_info = /* @__PURE__ */ (() => typeof GM_info != "undefined" ? GM_info : void 0)();
var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
var _GM_xmlhttpRequest = /* @__PURE__ */ (() => typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : void 0)();
var _unsafeWindow = /* @__PURE__ */ (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)();
var isVue2 = false;
/*!
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
let activePinia;
const setActivePinia = (pinia) => activePinia = pinia;
const piniaSymbol = (
/* istanbul ignore next */
Symbol()
);
function isPlainObject(o) {
return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
}
var MutationType;
(function(MutationType2) {
MutationType2["direct"] = "direct";
MutationType2["patchObject"] = "patch object";
MutationType2["patchFunction"] = "patch function";
})(MutationType || (MutationType = {}));
function createPinia() {
const scope = vue.effectScope(true);
const state = scope.run(() => vue.ref({}));
let _p = [];
let toBeInstalled = [];
const pinia = vue.markRaw({
install(app) {
setActivePinia(pinia);
{
pinia._a = app;
app.provide(piniaSymbol, pinia);
app.config.globalProperties.$pinia = pinia;
toBeInstalled.forEach((plugin) => _p.push(plugin));
toBeInstalled = [];
}
},
use(plugin) {
if (!this._a && !isVue2) {
toBeInstalled.push(plugin);
} else {
_p.push(plugin);
}
return this;
},
_p,
// it's actually undefined here
// @ts-expect-error
_a: null,
_e: scope,
_s: /* @__PURE__ */ new Map(),
state
});
return pinia;
}
const noop = () => {
};
function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
subscriptions.push(callback);
const removeSubscription = () => {
const idx = subscriptions.indexOf(callback);
if (idx > -1) {
subscriptions.splice(idx, 1);
onCleanup();
}
};
if (!detached && vue.getCurrentScope()) {
vue.onScopeDispose(removeSubscription);
}
return removeSubscription;
}
function triggerSubscriptions(subscriptions, ...args) {
subscriptions.slice().forEach((callback) => {
callback(...args);
});
}
const fallbackRunWithContext = (fn) => fn();
function mergeReactiveObjects(target, patchToApply) {
if (target instanceof Map && patchToApply instanceof Map) {
patchToApply.forEach((value, key2) => target.set(key2, value));
}
if (target instanceof Set && patchToApply instanceof Set) {
patchToApply.forEach(target.add, target);
}
for (const key2 in patchToApply) {
if (!patchToApply.hasOwnProperty(key2))
continue;
const subPatch = patchToApply[key2];
const targetValue = target[key2];
if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key2) && !vue.isRef(subPatch) && !vue.isReactive(subPatch)) {
target[key2] = mergeReactiveObjects(targetValue, subPatch);
} else {
target[key2] = subPatch;
}
}
return target;
}
const skipHydrateSymbol = (
/* istanbul ignore next */
Symbol()
);
function shouldHydrate(obj) {
return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
}
const { assign } = Object;
function isComputed(o) {
return !!(vue.isRef(o) && o.effect);
}
function createOptionsStore(id, options, pinia, hot) {
const { state, actions, getters } = options;
const initialState = pinia.state.value[id];
let store;
function setup() {
if (!initialState && true) {
{
pinia.state.value[id] = state ? state() : {};
}
}
const localState = vue.toRefs(pinia.state.value[id]);
return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
computedGetters[name] = vue.markRaw(vue.computed(() => {
setActivePinia(pinia);
const store2 = pinia._s.get(id);
return getters[name].call(store2, store2);
}));
return computedGetters;
}, {}));
}
store = createSetupStore(id, setup, options, pinia, hot, true);
return store;
}
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
let scope;
const optionsForPlugin = assign({ actions: {} }, options);
const $subscribeOptions = {
deep: true
// flush: 'post',
};
let isListening;
let isSyncListening;
let subscriptions = [];
let actionSubscriptions = [];
let debuggerEvents;
const initialState = pinia.state.value[$id];
if (!isOptionsStore && !initialState && true) {
{
pinia.state.value[$id] = {};
}
}
vue.ref({});
let activeListener;
function $patch(partialStateOrMutator) {
let subscriptionMutation;
isListening = isSyncListening = false;
if (typeof partialStateOrMutator === "function") {
partialStateOrMutator(pinia.state.value[$id]);
subscriptionMutation = {
type: MutationType.patchFunction,
storeId: $id,
events: debuggerEvents
};
} else {
mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
subscriptionMutation = {
type: MutationType.patchObject,
payload: partialStateOrMutator,
storeId: $id,
events: debuggerEvents
};
}
const myListenerId = activeListener = Symbol();
vue.nextTick().then(() => {
if (activeListener === myListenerId) {
isListening = true;
}
});
isSyncListening = true;
triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
}
const $reset = isOptionsStore ? function $reset2() {
const { state } = options;
const newState = state ? state() : {};
this.$patch(($state) => {
assign($state, newState);
});
} : (
/* istanbul ignore next */
noop
);
function $dispose() {
scope.stop();
subscriptions = [];
actionSubscriptions = [];
pinia._s.delete($id);
}
function wrapAction(name, action) {
return function() {
setActivePinia(pinia);
const args = Array.from(arguments);
const afterCallbackList = [];
const onErrorCallbackList = [];
function after(callback) {
afterCallbackList.push(callback);
}
function onError(callback) {
onErrorCallbackList.push(callback);
}
triggerSubscriptions(actionSubscriptions, {
args,
name,
store,
after,
onError
});
let ret;
try {
ret = action.apply(this && this.$id === $id ? this : store, args);
} catch (error) {
triggerSubscriptions(onErrorCallbackList, error);
throw error;
}
if (ret instanceof Promise) {
return ret.then((value) => {
triggerSubscriptions(afterCallbackList, value);
return value;
}).catch((error) => {
triggerSubscriptions(onErrorCallbackList, error);
return Promise.reject(error);
});
}
triggerSubscriptions(afterCallbackList, ret);
return ret;
};
}
const partialStore = {
_p: pinia,
// _s: scope,
$id,
$onAction: addSubscription.bind(null, actionSubscriptions),
$patch,
$reset,
$subscribe(callback, options2 = {}) {
const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
const stopWatcher = scope.run(() => vue.watch(() => pinia.state.value[$id], (state) => {
if (options2.flush === "sync" ? isSyncListening : isListening) {
callback({
storeId: $id,
type: MutationType.direct,
events: debuggerEvents
}, state);
}
}, assign({}, $subscribeOptions, options2)));
return removeSubscription;
},
$dispose
};
const store = vue.reactive(partialStore);
pinia._s.set($id, store);
const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
const setupStore = runWithContext(() => pinia._e.run(() => (scope = vue.effectScope()).run(setup)));
for (const key2 in setupStore) {
const prop = setupStore[key2];
if (vue.isRef(prop) && !isComputed(prop) || vue.isReactive(prop)) {
if (!isOptionsStore) {
if (initialState && shouldHydrate(prop)) {
if (vue.isRef(prop)) {
prop.value = initialState[key2];
} else {
mergeReactiveObjects(prop, initialState[key2]);
}
}
{
pinia.state.value[$id][key2] = prop;
}
}
} else if (typeof prop === "function") {
const actionValue = wrapAction(key2, prop);
{
setupStore[key2] = actionValue;
}
optionsForPlugin.actions[key2] = prop;
} else
;
}
{
assign(store, setupStore);
assign(vue.toRaw(store), setupStore);
}
Object.defineProperty(store, "$state", {
get: () => pinia.state.value[$id],
set: (state) => {
$patch(($state) => {
assign($state, state);
});
}
});
pinia._p.forEach((extender) => {
{
assign(store, scope.run(() => extender({
store,
app: pinia._a,
pinia,
options: optionsForPlugin
})));
}
});
if (initialState && isOptionsStore && options.hydrate) {
options.hydrate(store.$state, initialState);
}
isListening = true;
isSyncListening = true;
return store;
}
function defineStore(idOrOptions, setup, setupOptions) {
let id;
let options;
const isSetupStore = typeof setup === "function";
if (typeof idOrOptions === "string") {
id = idOrOptions;
options = isSetupStore ? setupOptions : setup;
} else {
options = idOrOptions;
id = idOrOptions.id;
}
function useStore(pinia, hot) {
const hasContext = vue.hasInjectionContext();
pinia = // in test mode, ignore the argument provided as we can always retrieve a
// pinia instance with getActivePinia()
pinia || (hasContext ? vue.inject(piniaSymbol, null) : null);
if (pinia)
setActivePinia(pinia);
pinia = activePinia;
if (!pinia._s.has(id)) {
if (isSetupStore) {
createSetupStore(id, setup, options, pinia);
} else {
createOptionsStore(id, options, pinia);
}
}
const store = pinia._s.get(id);
return store;
}
useStore.$id = id;
return useStore;
}
const prefix = "AiAsk_";
class Cache {
/**
* 封装缓存
* @param key 缓存key
* @param value 缓存值
* @param expire 过期时间
*
* @returns 缓存值
*/
static set(key2, value, expire = 0) {
key2 = prefix + key2;
if (expire > 0) {
_GM_setValue(key2, {
value,
expire: (/* @__PURE__ */ new Date()).getTime() + expire * 1e3
});
} else {
_GM_setValue(key2, {
value,
expire: 0
});
}
return _GM_getValue(key2);
}
/**
* 获取缓存
* @param key 缓存key
*
* @returns 缓存值
*/
static get(key2, defaultVal = null) {
key2 = prefix + key2;
let cache = _GM_getValue(key2);
if (cache && cache.expire > 0 && cache.expire < (/* @__PURE__ */ new Date()).getTime()) {
_GM_setValue(key2, null);
return defaultVal;
}
return cache ? cache.value : defaultVal;
}
}
/*! @license DOMPurify 3.0.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.11/LICENSE */
const {
entries,
setPrototypeOf,
isFrozen,
getPrototypeOf,
getOwnPropertyDescriptor
} = Object;
let {
freeze,
seal,
create
} = Object;
let {
apply,
construct
} = typeof Reflect !== "undefined" && Reflect;
if (!freeze) {
freeze = function freeze2(x) {
return x;
};
}
if (!seal) {
seal = function seal2(x) {
return x;
};
}
if (!apply) {
apply = function apply2(fun, thisValue, args) {
return fun.apply(thisValue, args);
};
}
if (!construct) {
construct = function construct2(Func, args) {
return new Func(...args);
};
}
const arrayForEach = unapply(Array.prototype.forEach);
const arrayPop = unapply(Array.prototype.pop);
const arrayPush = unapply(Array.prototype.push);
const stringToLowerCase = unapply(String.prototype.toLowerCase);
const stringToString = unapply(String.prototype.toString);
const stringMatch = unapply(String.prototype.match);
const stringReplace = unapply(String.prototype.replace);
const stringIndexOf = unapply(String.prototype.indexOf);
const stringTrim = unapply(String.prototype.trim);
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
const regExpTest = unapply(RegExp.prototype.test);
const typeErrorCreate = unconstruct(TypeError);
function unapply(func) {
return function(thisArg) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return apply(func, thisArg, args);
};
}
function unconstruct(func) {
return function() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return construct(func, args);
};
}
function addToSet(set, array) {
let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
if (setPrototypeOf) {
setPrototypeOf(set, null);
}
let l = array.length;
while (l--) {
let element = array[l];
if (typeof element === "string") {
const lcElement = transformCaseFunc(element);
if (lcElement !== element) {
if (!isFrozen(array)) {
array[l] = lcElement;
}
element = lcElement;
}
}
set[element] = true;
}
return set;
}
function cleanArray(array) {
for (let index = 0; index < array.length; index++) {
const isPropertyExist = objectHasOwnProperty(array, index);
if (!isPropertyExist) {
array[index] = null;
}
}
return array;
}
function clone(object) {
const newObject = create(null);
for (const [property, value] of entries(object)) {
const isPropertyExist = objectHasOwnProperty(object, property);
if (isPropertyExist) {
if (Array.isArray(value)) {
newObject[property] = cleanArray(value);
} else if (value && typeof value === "object" && value.constructor === Object) {
newObject[property] = clone(value);
} else {
newObject[property] = value;
}
}
}
return newObject;
}
function lookupGetter(object, prop) {
while (object !== null) {
const desc = getOwnPropertyDescriptor(object, prop);
if (desc) {
if (desc.get) {
return unapply(desc.get);
}
if (typeof desc.value === "function") {
return unapply(desc.value);
}
}
object = getPrototypeOf(object);
}
function fallbackValue() {
return null;
}
return fallbackValue;
}
const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
const text = freeze(["#text"]);
const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
const IS_ALLOWED_URI = seal(
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
// eslint-disable-line no-useless-escape
);
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
const ATTR_WHITESPACE = seal(
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
// eslint-disable-line no-control-regex
);
const DOCTYPE_NAME = seal(/^html$/i);
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
__proto__: null,
MUSTACHE_EXPR,
ERB_EXPR,
TMPLIT_EXPR,
DATA_ATTR,
ARIA_ATTR,
IS_ALLOWED_URI,
IS_SCRIPT_OR_DATA,
ATTR_WHITESPACE,
DOCTYPE_NAME,
CUSTOM_ELEMENT
});
const getGlobal = function getGlobal2() {
return typeof window === "undefined" ? null : window;
};
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
return null;
}
let suffix = null;
const ATTR_NAME = "data-tt-policy-suffix";
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
suffix = purifyHostElement.getAttribute(ATTR_NAME);
}
const policyName = "dompurify" + (suffix ? "#" + suffix : "");
try {
return trustedTypes.createPolicy(policyName, {
createHTML(html2) {
return html2;
},
createScriptURL(scriptUrl) {
return scriptUrl;
}
});
} catch (_) {
console.warn("TrustedTypes policy " + policyName + " could not be created.");
return null;
}
};
function createDOMPurify() {
let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
const DOMPurify = (root) => createDOMPurify(root);
DOMPurify.version = "3.0.11";
DOMPurify.removed = [];
if (!window2 || !window2.document || window2.document.nodeType !== 9) {
DOMPurify.isSupported = false;
return DOMPurify;
}
let {
document: document2
} = window2;
const originalDocument = document2;
const currentScript = originalDocument.currentScript;
const {
DocumentFragment,
HTMLTemplateElement,
Node,
Element,
NodeFilter,
NamedNodeMap = window2.NamedNodeMap || window2.MozNamedAttrMap,
HTMLFormElement,
DOMParser: DOMParser2,
trustedTypes
} = window2;
const ElementPrototype = Element.prototype;
const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
if (typeof HTMLTemplateElement === "function") {
const template = document2.createElement("template");
if (template.content && template.content.ownerDocument) {
document2 = template.content.ownerDocument;
}
}
let trustedTypesPolicy;
let emptyHTML = "";
const {
implementation,
createNodeIterator,
createDocumentFragment,
getElementsByTagName
} = document2;
const {
importNode
} = originalDocument;
let hooks = {};
DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
const {
MUSTACHE_EXPR: MUSTACHE_EXPR2,
ERB_EXPR: ERB_EXPR2,
TMPLIT_EXPR: TMPLIT_EXPR2,
DATA_ATTR: DATA_ATTR2,
ARIA_ATTR: ARIA_ATTR2,
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA2,
ATTR_WHITESPACE: ATTR_WHITESPACE2,
CUSTOM_ELEMENT: CUSTOM_ELEMENT2
} = EXPRESSIONS;
let {
IS_ALLOWED_URI: IS_ALLOWED_URI$1
} = EXPRESSIONS;
let ALLOWED_TAGS = null;
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
let ALLOWED_ATTR = null;
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
tagNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
attributeNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
allowCustomizedBuiltInElements: {
writable: true,
configurable: false,
enumerable: true,
value: false
}
}));
let FORBID_TAGS = null;
let FORBID_ATTR = null;
let ALLOW_ARIA_ATTR = true;
let ALLOW_DATA_ATTR = true;
let ALLOW_UNKNOWN_PROTOCOLS = false;
let ALLOW_SELF_CLOSE_IN_ATTR = true;
let SAFE_FOR_TEMPLATES = false;
let WHOLE_DOCUMENT = false;
let SET_CONFIG = false;
let FORCE_BODY = false;
let RETURN_DOM = false;
let RETURN_DOM_FRAGMENT = false;
let RETURN_TRUSTED_TYPE = false;
let SANITIZE_DOM = true;
let SANITIZE_NAMED_PROPS = false;
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
let KEEP_CONTENT = true;
let IN_PLACE = false;
let USE_PROFILES = {};
let FORBID_CONTENTS = null;
const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
let DATA_URI_TAGS = null;
const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
let URI_SAFE_ATTRIBUTES = null;
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
let NAMESPACE = HTML_NAMESPACE;
let IS_EMPTY_INPUT = false;
let ALLOWED_NAMESPACES = null;
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
let PARSER_MEDIA_TYPE = null;
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
let transformCaseFunc = null;
let CONFIG = null;
const formElement = document2.createElement("form");
const isRegexOrFunction = function isRegexOrFunction2(testValue) {
return testValue instanceof RegExp || testValue instanceof Function;
};
const _parseConfig = function _parseConfig2() {
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (CONFIG && CONFIG === cfg) {
return;
}
if (!cfg || typeof cfg !== "object") {
cfg = {};
}
cfg = clone(cfg);
PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(
clone(DEFAULT_URI_SAFE_ATTRIBUTES),
// eslint-disable-line indent
cfg.ADD_URI_SAFE_ATTR,
// eslint-disable-line indent
transformCaseFunc
// eslint-disable-line indent
) : DEFAULT_URI_SAFE_ATTRIBUTES;
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(
clone(DEFAULT_DATA_URI_TAGS),
// eslint-disable-line indent
cfg.ADD_DATA_URI_TAGS,
// eslint-disable-line indent
transformCaseFunc
// eslint-disable-line indent
) : DEFAULT_DATA_URI_TAGS;
FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
RETURN_DOM = cfg.RETURN_DOM || false;
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
FORCE_BODY = cfg.FORCE_BODY || false;
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
IN_PLACE = cfg.IN_PLACE || false;
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
}
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
}
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
}
if (SAFE_FOR_TEMPLATES) {
ALLOW_DATA_ATTR = false;
}
if (RETURN_DOM_FRAGMENT) {
RETURN_DOM = true;
}
if (USE_PROFILES) {
ALLOWED_TAGS = addToSet({}, text);
ALLOWED_ATTR = [];
if (USE_PROFILES.html === true) {
addToSet(ALLOWED_TAGS, html$1);
addToSet(ALLOWED_ATTR, html);
}
if (USE_PROFILES.svg === true) {
addToSet(ALLOWED_TAGS, svg$1);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.svgFilters === true) {
addToSet(ALLOWED_TAGS, svgFilters);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.mathMl === true) {
addToSet(ALLOWED_TAGS, mathMl$1);
addToSet(ALLOWED_ATTR, mathMl);
addToSet(ALLOWED_ATTR, xml);
}
}
if (cfg.ADD_TAGS) {
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
ALLOWED_TAGS = clone(ALLOWED_TAGS);
}
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
}
if (cfg.ADD_ATTR) {
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
ALLOWED_ATTR = clone(ALLOWED_ATTR);
}
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
}
if (cfg.ADD_URI_SAFE_ATTR) {
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
}
if (cfg.FORBID_CONTENTS) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
}
if (KEEP_CONTENT) {
ALLOWED_TAGS["#text"] = true;
}
if (WHOLE_DOCUMENT) {
addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
}
if (ALLOWED_TAGS.table) {
addToSet(ALLOWED_TAGS, ["tbody"]);
delete FORBID_TAGS.tbody;
}
if (cfg.TRUSTED_TYPES_POLICY) {
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
}
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
}
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
emptyHTML = trustedTypesPolicy.createHTML("");
} else {
if (trustedTypesPolicy === void 0) {
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
}
if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
emptyHTML = trustedTypesPolicy.createHTML("");
}
}
if (freeze) {
freeze(cfg);
}
CONFIG = cfg;
};
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
const HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
const _checkValidNamespace = function _checkValidNamespace2(element) {
let parent = getParentNode(element);
if (!parent || !parent.tagName) {
parent = {
namespaceURI: NAMESPACE,
tagName: "template"
};
}
const tagName = stringToLowerCase(element.tagName);
const parentTagName = stringToLowerCase(parent.tagName);
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
return false;
}
if (element.namespaceURI === SVG_NAMESPACE) {
if (parent.namespaceURI === HTML_NAMESPACE) {
return tagName === "svg";
}
if (parent.namespaceURI === MATHML_NAMESPACE) {
return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
}
return Boolean(ALL_SVG_TAGS[tagName]);
}
if (element.namespaceURI === MATHML_NAMESPACE) {
if (parent.namespaceURI === HTML_NAMESPACE) {
return tagName === "math";
}
if (parent.namespaceURI === SVG_NAMESPACE) {
return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
}
return Boolean(ALL_MATHML_TAGS[tagName]);
}
if (element.namespaceURI === HTML_NAMESPACE) {
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
return false;
}
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
return false;
}
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
}
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
return true;
}
return false;
};
const _forceRemove = function _forceRemove2(node) {
arrayPush(DOMPurify.removed, {
element: node
});
try {
node.parentNode.removeChild(node);
} catch (_) {
node.remove();
}
};
const _removeAttribute = function _removeAttribute2(name, node) {
try {
arrayPush(DOMPurify.removed, {
attribute: node.getAttributeNode(name),
from: node
});
} catch (_) {
arrayPush(DOMPurify.removed, {
attribute: null,
from: node
});
}
node.removeAttribute(name);
if (name === "is" && !ALLOWED_ATTR[name]) {
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
try {
_forceRemove(node);
} catch (_) {
}
} else {
try {
node.setAttribute(name, "");
} catch (_) {
}
}
}
};
const _initDocument = function _initDocument2(dirty) {
let doc = null;
let leadingWhitespace = null;
if (FORCE_BODY) {
dirty = "
' + hljs.highlight(str, { language: lang, ignoreIllegals: true }).value + "
";
} catch (__) {
}
}
return '' + md.utils.escapeHtml(str) + "
";
}
});
return md.render(this.questionList[this.questionInx].aiMsg);
}
}
});
const ApiCache = Cache.get("apiList", []);
const DefApi = {
name: "",
url: "",
method: "GET",
params: [],
response: [],
request: [],
headers: []
};
const DefParam = {
name: "",
value: "",
type: "sys"
};
const testQuestionData = {
"question": "急性吗啡中毒的拮抗剂是:",
"options": ["纳酪酮", "曲马朵", "尼莫地平", "阿托品", "肾上腺素"],
"type": "0",
"questionData": "",
"workType": "ks"
};
const useApiStore = defineStore("api", {
state: () => ({
apiList: ApiCache,
// 当前编辑的接口
currentApi: DefApi,
currentParam: DefParam
}),
actions: {
// 删除接口
deleteApi(index) {
this.apiList.splice(index, 1);
Cache.set("apiList", this.apiList);
},
// 添加接口
addApi() {
this.apiList.push(this.currentApi);
console.log(this.currentParam);
Cache.set("apiList", this.apiList);
},
// 更新接口
updateApi(index, api) {
this.apiList[index] = api;
Cache.set("apiList", this.apiList);
},
// 添加参数
addParam() {
this.currentApi.params.push({
name: this.currentParam.name,
value: this.currentParam.value,
type: this.currentParam.type
});
this.currentParam = DefParam;
},
// 删除参数
deleteParam(index) {
this.currentApi.params.splice(index, 1);
},
// 恢复默认
reset() {
this.currentApi = DefApi;
this.currentParam = DefParam;
},
// 编辑接口
editApi(index) {
this.currentApi = this.apiList[index];
},
// 编辑参数
editParam(index) {
this.currentParam = this.currentApi.params[index];
},
// 测试API
testApi(index) {
let api = this.apiList[index];
console.log(api);
let data = {};
api.params.forEach((item) => {
console.log(item.value);
switch (item.value) {
case "$question":
data[item.name] = testQuestionData.question;
console.log(testQuestionData.question);
break;
case "$options":
data[item.name] = testQuestionData.options;
break;
case "$typeid":
data[item.name] = testQuestionData.type;
break;
case "$questionData":
data[item.name] = testQuestionData.questionData;
break;
case "$workType":
data[item.name] = testQuestionData.workType;
break;
case "$timestamp":
data[item.name] = (/* @__PURE__ */ new Date()).getTime();
break;
case "$random":
data[item.name] = Math.random();
break;
default:
data[item.name] = item.value;
}
});
console.log(api.url, api.method, data);
return requestFetch(api.url, api.method, data, {});
}
},
getters: {}
});
const mini = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1702363595473'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9984'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M253.360825%201024l-115.279176-58.836014v-53.205773c-64.888522-68.266667-62.917938-94.728797%2014.075602-153.424055-23.506254-17.594502-63.762474%202.674364-77.275052-36.315051%2047.434777-42.930584%2070.378007-101.062818%2087.972509-162.010172a326.694708%20326.694708%200%200%201%20208.037388-226.617182c4.644948-89.380069%2086.84646-143.430378%20178.478626-112.604811l-35.611272%2090.36536c105.144742%207.319313%20192.413471%2045.041924%20256.316701%20123.302268%2040.537732%2015.483162%2038.84866-34.766735%2069.251959-40.819244l11.964261%2058.27299%2050.390653-27.306667c28.151203%2018.72055-5.207973%2031.951615-10.415945%2052.220482%2014.779381%2020.12811%2028.995739%2040.537732%2044.4789%2060.243573a142.867354%20142.867354%200%200%201%2028.995739%20114.153128c-12.527285%2077.838076-30.262543%20154.831615-41.100756%20233.091958a1276.938557%201276.938557%200%200%200-5.207972%20139.48921h-21.113402l-89.239313-70.378007%209.993677-10.415945-17.735258%2036.878076L731.931271%20959.956014l-39.411683%2023.787766-42.226804-21.113402c-28.151203%2014.075601-52.501993%2036.03354-86.564949%2027.306667l-9.008385-37.863368H332.747216l-26.602886%2071.926323z%20m-9.993677-380.041237l-0.844536%200.985292%20126.680412%2019.705842%2010.838213%2010.978969c-29.277251%2032.373883-19.846598%2074.178419-29.699519%20110.493471L384.404674%20816.38488l-35.189004%2094.869553a412.274364%20412.274364%200%200%200%20233.514227%202.11134l9.712165-26.602886%2012.808797%2015.905429-11.823505%2050.672165%205.348728%204.644949c16.749966-11.682749%2033.218419-24.210034%2050.812921-34.62598a84.453608%2084.453608%200%200%201%2026.039863-5.348728l7.460069%2033.922199L731.931271%20928.145155l52.924262%2014.075601c-1.829828-43.212096-2.955876-80.934708-5.911753-118.516564%200-4.92646-9.852921-9.289897-15.060893-14.075601l-5.630241-23.224742%2014.075601-100.922062h18.72055l3.237389-1.266804c-11.964261%20106.411546%208.023093%20202.266392%2087.127972%20281.512027%208.726873-48.842337%2016.60921-93.321237%2024.632302-137.659381%207.460069-40.96%2015.060893-81.92%2022.520963-122.88%2010.556701-48.420069%2025.476838-97.262405-10.978969-140.756014L886.762887%20602.435739c0-16.468454%201.126048-33.077663%201.126048-49.546117%200-70.378007-53.205773-104.722474-115.982956-76.289759a232.951203%20232.951203%200%200%201-32.936907%209.430652c16.046186-32.373883-3.5189-52.924261-25.476838-70.378006a292.209485%20292.209485%200%200%200-209.304193-70.378007c-11.401237%200.70378-22.802474%200-40.25622%200l45.182681-104.581718c-40.396976%2010.978969-74.037663%2014.779381-94.728798%2045.464192s14.920137%2045.88646%2020.831891%2069.674227C325.005636%20360.194639%20232.528935%20436.343643%20198.606735%20548.948454l-70.378006%20172.707628%2049.123848%203.518901%205.630241%2054.191065c32.514639-26.039863%2026.039863-61.08811%2030.262543-92.898969h17.876014v58.413746l30.966323%206.33402c1.40756-6.615533%202.392852-11.682749%203.659656-16.468453%209.149141-34.625979-19.705842-59.117526-22.380206-91.491409zM205.50378%20822.859656l-6.474777%2020.83189-25.336082%2084.453609c1.548316%208.867629%200%2023.224742%205.067216%2025.476838%2032.373883%2016.046186%2065.733058%2029.277251%20104.159451%2045.745705%2021.113402-65.451546%2063.621718-114.434639%2069.53347-180.871478C315.152715%20802.309278%20281.512027%20786.966873%20247.730584%20774.158076c-17.031478-6.756289-36.315052-10.978969-35.048247%2019.002061z%20m121.753952-38.848659l10.556701-90.224605-48.138557-6.193265v78.964124z%20m-168.907217%2096.980893l23.083987-73.474639c-28.151203-10.415945-47.575533-9.289897-56.302406%2015.483161s2.674364%2042.789828%2032.936907%2057.991478z'%20fill='%23353947'%20p-id='9985'%3e%3c/path%3e%3cpath%20d='M198.606735%20548.948454c33.922199-112.604811%20126.680412-188.472302%20235.907079-192.272715-5.911753-23.787766-41.100756-39.55244-20.83189-69.674227s54.331821-34.485223%2094.728798-45.464192l-45.182681%20104.581718h40.25622a292.209485%20292.209485%200%200%201%20209.304193%2070.378007c21.957938%2017.735258%2042.226804%2038.285636%2025.476838%2070.378007l0.985292-0.985293c-30.966323%2026.743643-32.796151%2059.399038-19.846598%2095.151066l25.195327%2040.96-40.819244-6.193265-103.174158-14.075601-62.214158-93.039725-31.670104%2050.672165c-19.42433-5.630241-26.602887%200.844536-20.691134%2020.691134L464.494845%20579.210997a165.669828%20165.669828%200%200%200-100.077525-17.172234l-10.415945-86.564949L316.560275%20506.721649l-44.338144%2042.226805z%20m255.190653-62.917939l-10.556701-10.556701c-17.172234-17.031478-35.048247-15.060893-47.29402%203.378145s-4.785704%2036.73732%2012.105017%2050.249897c20.12811%2016.046186%2034.907491%209.712165%2045.745704-11.541993%2014.216357-10.838213%2015.201649-21.394914%200-31.81086z'%20fill='%23F5F5F6'%20p-id='9986'%20data-spm-anchor-id='a313x.search_index.0.i5.dc0f3a810XA6r8'%20class='selected'%3e%3c/path%3e%3cpath%20d='M592.442062%20886.762887l-9.712165%2026.602886a412.274364%20412.274364%200%200%201-233.514227-2.11134l35.189004-94.869553-34.062956-30.544055c9.852921-36.315052%200-78.119588%2029.699519-110.493471a198.184467%20198.184467%200%200%200%20105.426254-94.869553c16.327698%202.392852%2026.039863-1.689072%2020.691134-20.691134l31.670104-4.926461L600.887423%20633.402062c0%207.882337-1.970584%2018.01677%201.970584%2023.083986%2030.966323%2038.707904%2023.787766%2080.934708%2014.075601%20123.865292-8.586117%2036.03354-16.468454%2071.363299-24.491546%20106.411547zM442.818419%20663.523849c0%2014.075601-2.81512%2023.64701%200%2026.884398%2020.268866%2020.691134%2020.83189%2045.604948%2019.565086%2071.926323a96.840137%2096.840137%200%200%200%203.237388%2031.107079c5.911753%2020.409622%2012.668041%2041.382268%2038.426392%2044.056633A48.560825%2048.560825%200%200%200%20557.393814%20802.309278a696.601512%20696.601512%200%200%200%2018.579794-80.371683c6.052509-6.474777%2035.470515-2.533608%2018.157526-36.596564z'%20fill='%23F5F5F6'%20p-id='9987'%3e%3c/path%3e%3cpath%20d='M600.605911%20602.013471l103.174158%2014.075601%2040.819244%205.348729c37.863368%209.993677%2022.94323%2041.241512%2026.46213%2065.170034l-14.075601%20100.922062-49.827629%2078.119588-21.394914%2031.529347-10.134433%2021.394914a84.453608%2084.453608%200%200%200-26.039863%205.348728c-17.594502%2010.415945-34.062955%2022.94323-50.812921%2034.62598v-5.207973h-5.067216l11.823505-50.672165c16.046186-61.932646%2032.936907-123.724536%2047.716289-185.938694%205.348729-22.661718-25.476838-68.266667-51.938969-82.62378zM927.300619%20706.735945c-7.460069%2040.96-15.060893%2081.92-22.520963%20122.88-8.023093%2044.338144-15.90543%2088.817045-24.632302%20137.659381-79.10488-79.386392-98.52921-175.241237-87.127973-281.512027z'%20fill='%23B3DCF8'%20p-id='9988'%3e%3c/path%3e%3cpath%20d='M199.029003%20843.691546l6.474777-20.83189h45.604949c2.11134-39.270928-20.972646-30.262543-38.426392-30.121787-1.548316-29.981031%2018.01677-25.758351%2035.048247-18.579793%2034.062955%2013.231065%2067.422131%2028.151203%20104.722474%2044.4789-5.911753%2066.436838-48.420069%20115.419931-69.53347%20180.871478-38.426392-16.186942-71.926323-29.418007-104.159451-45.182681-4.785704-2.252096-3.5189-16.60921-5.067216-25.476838h33.499931l26.321375-70.378007z'%20fill='%2387BC85'%20p-id='9989'%3e%3c/path%3e%3cpath%20d='M738.265292%20486.030515a232.951203%20232.951203%200%200%200%2032.936907-9.430652c62.777182-28.151203%20116.405223%206.615533%20115.982956%2076.289759%200%2016.468454-0.70378%2033.077663-1.126048%2049.546117l1.126048-0.985292-12.105018-2.674365-21.53567%2016.749966-29.981031%208.304605A86.564948%2086.564948%200%200%201%20731.931271%20564.572371c2.392852-26.462131%204.644948-52.924261%207.037801-79.527148z%20m113.730859%2061.79189l-61.369622-52.501993c-3.941168%2035.752027-6.615533%2059.821306-10.275189%2093.180481z'%20fill='%23F5F5F6'%20p-id='9990'%20data-spm-anchor-id='a313x.search_index.0.i3.dc0f3a810XA6r8'%20class=''%3e%3c/path%3e%3cpath%20d='M198.606735%20548.948454h73.615396c-28.151203%2042.226804-74.178419%2076.852784-59.117526%20137.659381-4.22268%2031.810859%202.252096%2066.859107-30.262543%2092.898969l-6.052509-54.472577-49.123849-3.518901z'%20fill='%23AED4EF'%20p-id='9991'%3e%3c/path%3e%3cpath%20d='M927.300619%20706.735945l-134.281238-21.113402-3.237388%201.266804%206.897045-37.863368%2027.025154-7.74158%2031.247835-8.867629%2029.840275-20.691134%202.392853-10.275189-0.422268%200.985292%2030.262543-36.73732c35.752027%2043.77512%2020.83189%2092.617457%2010.275189%20141.037526zM369.625292%20663.946117l-126.680412-19.705842a171.300069%20171.300069%200%200%201%2016.749965-41.100756c21.817182-29.277251%2046.167973-56.302405%2069.533471-84.453608%203.237388%209.149141%206.756289%2018.157526%209.571409%2027.306666q15.623918%2049.123849%2030.966323%2098.52921z'%20fill='%23F5F5F6'%20p-id='9992'%3e%3c/path%3e%3cpath%20d='M763.179107%20810.473127c5.207973%204.644948%2014.075601%209.008385%2015.060893%2014.075602%202.955876%2037.581856%204.081924%2075.304467%205.911753%20118.516563l-52.924262-14.075601-47.9978%2023.787766-7.600825-34.766735c14.075601-1.970584%2020.550378-7.882337%2010.978969-21.817182%2021.394914%2011.682749%2023.787766-9.993677%2033.359175-19.002062z'%20fill='%23AED4EF'%20p-id='9993'%3e%3c/path%3e%3cpath%20d='M601.168935%20634.105842c26.462131%2014.075601%2057.287698%2059.962062%2051.938969%2082.62378-14.075601%2062.214158-31.670103%20124.006048-47.716289%20185.938694L592.442062%20886.762887c8.023093-35.329759%2015.90543-70.378007%2024.35079-105.989279%2010.134433-42.930584%2017.31299-85.157388-14.075601-123.865292-3.5189-4.785704-0.985292-14.920137-1.548316-22.802474zM328.806048%20518.404399c-23.365498%2028.151203-47.716289%2055.457869-69.533471%2084.453608a171.300069%20171.300069%200%200%200-16.749965%2041.100756l0.844536-0.985292-12.386529%2043.07134h-17.876014C198.043711%20625.660481%20243.507904%20591.175258%20272.222131%20548.948454l44.338144-42.226805z'%20fill='%23484F5E'%20p-id='9994'%3e%3c/path%3e%3cpath%20d='M327.257732%20784.010997l-37.581856-17.453746v-78.964124l48.138557%206.193265z'%20fill='%23D55375'%20p-id='9995'%3e%3c/path%3e%3cpath%20d='M823.704192%20641.284399l-27.025154%207.74158-6.897045%2037.863368h-18.72055c-3.5189-23.928522%2011.401237-55.176357-26.46213-65.170034l-25.195327-40.96%2012.527285-16.186942a86.564948%2086.564948%200%200%200%2091.350653%2059.258282zM369.625292%20663.946117v-19.846598l12.245773-12.949553c8.445361%201.266804%2020.409622%206.897045%2024.773059%203.237388%2020.550378-17.031478%2038.989416-36.455808%2058.132233-55.176357l20.972646%201.548316A198.184467%20198.184467%200%200%201%20380.041237%20675.628866z'%20fill='%23484F5E'%20p-id='9996'%3e%3c/path%3e%3cpath%20d='M199.029003%20843.691546l34.485224%2014.075602-26.321375%2070.378007h-33.499931z'%20fill='%23CAE7AF'%20p-id='9997'%3e%3c/path%3e%3cpath%20d='M230.980619%20686.326323l12.386529-43.07134c2.674364%2031.670103%2031.529347%2056.302405%2022.23945%2091.350653-1.266804%204.785704-2.252096%209.852921-3.659656%2016.468453l-30.966323-6.33402z'%20fill='%23F5F5F6'%20p-id='9998'%3e%3c/path%3e%3cpath%20d='M763.179107%20810.473127l-44.056633%2067.703643-11.964261-12.527285%2050.390653-78.4011z'%20fill='%23484F5E'%20p-id='9999'%3e%3c/path%3e%3cpath%20d='M212.682337%20792.737869c17.453746%200%2040.537732-9.149141%2038.426392%2030.121787H205.50378z'%20fill='%23CDEAB1'%20p-id='10000'%3e%3c/path%3e%3cpath%20d='M598.916838%20957.98543l-5.348728-4.644949h5.067216z'%20fill='%23484F5E'%20p-id='10001'%3e%3c/path%3e%3cpath%20d='M464.494845%20579.210997c-19.142818%2018.72055-37.581856%2038.14488-58.132233%2055.176357-4.363436%203.659656-16.327698-1.970584-24.773059-3.237388l-17.172233-69.111203A165.669828%20165.669828%200%200%201%20464.494845%20579.210997z'%20fill='%23AED4EF'%20p-id='10002'%3e%3c/path%3e%3cpath%20d='M364.41732%20562.038763l17.172233%2069.111203-12.245773%2012.949553q-15.342405-49.123849-30.966323-98.52921c-2.81512-9.149141-6.334021-18.157526-9.571409-27.306666l-12.245773-11.541994%2037.4411-30.966323z'%20fill='%23353947'%20p-id='10003'%3e%3c/path%3e%3cpath%20d='M600.605911%20602.013471v31.670103l-62.214158-79.245636-31.670104%204.926461%2031.388592-50.390653z'%20fill='%23484F5E'%20p-id='10004'%3e%3c/path%3e%3cpath%20d='M453.797388%20517.278351c-10.838213%2021.254158-25.617595%2028.151203-45.745704%2011.541993-16.890722-14.075601-24.632302-31.529347-12.105017-50.249897s30.121787-20.409622%2047.29402-3.378145c-23.506254%200.985292-34.766735%2011.541993-29.136495%2039.411684l39.693196%203.096633z'%20fill='%23AED4EF'%20p-id='10005'%3e%3c/path%3e%3cpath%20d='M731.931271%20564.572371l-12.808797%2015.623918c-12.949553-35.752027-11.119725-68.407423%2019.846598-95.151066-2.11134%2026.602887-4.363436%2053.065017-7.037801%2079.527148z'%20fill='%23353947'%20p-id='10006'%3e%3c/path%3e%3cpath%20d='M506.721649%20559.786667c5.348729%2019.002062-4.363436%2023.083986-20.691134%2020.691134-6.193265-19.846598%200.985292-26.321375%2020.691134-20.691134z'%20fill='%23484F5E'%20p-id='10007'%3e%3c/path%3e%3cpath%20d='M453.797388%20485.749003c15.201649%2010.415945%2014.075601%2020.972646%200%2031.529348v-31.81086zM443.240687%20475.192302l10.556701%2010.556701-10.556701-10.556701z'%20fill='%23AED4EF'%20p-id='10008'%3e%3c/path%3e%3cpath%20d='M442.818419%20663.523849l151.312715%2022.098694c17.31299%2034.062955-12.105017%2030.121787-18.157526%2036.596564A696.601512%20696.601512%200%200%201%20557.393814%20802.309278a48.560825%2048.560825%200%200%201-52.783505%2034.907492c-25.758351-2.674364-32.514639-23.64701-38.426391-44.056633a96.840137%2096.840137%200%200%201-3.237389-31.107079c1.266804-26.321375%200-51.235189-19.565086-71.926323-3.378144-2.955876-0.563024-12.386529-0.563024-26.602886z%20m66.296083%20153.987079c41.523024-26.462131%2042.226804-60.38433%2034.766735-98.52921l-55.317113-10.275189c-0.422268%2038.707904-15.201649%2075.163711%2020.550378%20108.804399zM707.158213%20865.649485l11.964261%2012.527285c-9.571409%209.008385-11.964261%2030.684811-33.359175%2019.002062z'%20fill='%23353947'%20p-id='10009'%3e%3c/path%3e%3cpath%20d='M686.185567%20896.756564c9.571409%2014.075601%202.955876%2019.846598-10.978969%2021.817182zM851.996151%20547.822405l-71.644811%2040.678488c3.659656-33.359175%206.334021-57.428454%2010.275189-93.180481z'%20fill='%23353947'%20p-id='10010'%3e%3c/path%3e%3cpath%20d='M884.792302%20611.725636l-29.840275%2020.691134-1.40756-16.890722%2021.53567-16.749966z'%20fill='%23484F5E'%20p-id='10011'%20data-spm-anchor-id='a313x.search_index.0.i4.dc0f3a810XA6r8'%20class='selected'%3e%3c/path%3e%3cpath%20d='M853.544467%20615.526048l1.40756%2016.890722-31.247835%208.867629v-17.453746zM884.792302%20611.725636l-9.712165-12.949554%2012.105018%202.674365z'%20fill='%23353947'%20p-id='10012'%3e%3c/path%3e%3cpath%20d='M443.522199%20474.91079l10.556701%2010.556701v31.951616l-39.693196-3.096633c-6.193265-27.869691%205.630241-38.426392%2029.136495-39.411684z'%20fill='%23F5F5F6'%20p-id='10013'%3e%3c/path%3e%3cpath%20d='M509.114502%20817.510928c-35.752027-33.640687-20.972646-70.378007-20.550378-108.804399l55.317113%2010.275189c7.882337%2038.14488%206.756289%2072.067079-34.766735%2098.52921z'%20fill='%23E25679'%20p-id='10014'%3e%3c/path%3e%3c/svg%3e";
const _withScopeId = (n) => (vue.pushScopeId("data-v-6d85ad8a"), n = n(), vue.popScopeId(), n);
const _hoisted_1$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("p", null, "本脚本仅供学习交流,请勿用作任何非法用途。", -1));
const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("p", null, "如果有其他平台需要答题功能,请反馈给作者,会根据需求量酌情增加", -1));
const _hoisted_3$2 = { class: "aah_plat" };
const _hoisted_4$2 = { key: 0 };
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
__name: "Home",
setup(__props) {
const appStore = useAppStore();
scriptInfo$1.script.downloadURL ?? "#";
const debug = vue.ref(true);
return (_ctx, _cache) => {
const _component_el_alert = vue.resolveComponent("el-alert");
const _component_el_divider = vue.resolveComponent("el-divider");
const _component_el_tag = vue.resolveComponent("el-tag");
const _component_el_button = vue.resolveComponent("el-button");
const _component_el_col = vue.resolveComponent("el-col");
const _component_el_row = vue.resolveComponent("el-row");
return vue.openBlock(), vue.createBlock(_component_el_row, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_col, { span: 24 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_alert, {
type: "info",
closable: false
}, {
title: vue.withCtx(() => [
_hoisted_1$4,
_hoisted_2$2
]),
_: 1
}),
vue.createVNode(_component_el_divider, null, {
default: vue.withCtx(() => [
vue.createTextVNode("功能列表")
]),
_: 1
}),
vue.createElementVNode("div", _hoisted_3$2, [
vue.createVNode(_component_el_tag, null, {
default: vue.withCtx(() => [
vue.createTextVNode("多平台答案检索")
]),
_: 1
}),
vue.createVNode(_component_el_tag, null, {
default: vue.withCtx(() => [
vue.createTextVNode("AI辅助答题")
]),
_: 1
}),
vue.createVNode(_component_el_tag, null, {
default: vue.withCtx(() => [
vue.createTextVNode("解除复制限制")
]),
_: 1
}),
vue.createVNode(_component_el_tag, null, {
default: vue.withCtx(() => [
vue.createTextVNode("更多功能待添加..")
]),
_: 1
})
]),
debug.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
vue.createVNode(_component_el_button, {
type: "primary",
plain: "",
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(appStore).setPage("Base"))
}, {
default: vue.withCtx(() => [
vue.createTextVNode("基础配置")
]),
_: 1
}),
vue.createVNode(_component_el_button, {
type: "primary",
plain: "",
onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(appStore).setPage("api"))
}, {
default: vue.withCtx(() => [
vue.createTextVNode("题库配置")
]),
_: 1
}),
vue.createVNode(_component_el_button, {
type: "primary",
plain: "",
onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(appStore).setPage("ask"))
}, {
default: vue.withCtx(() => [
vue.createTextVNode("答题页")
]),
_: 1
}),
vue.createVNode(_component_el_button, {
type: "primary",
plain: "",
onClick: _cache[3] || (_cache[3] = ($event) => vue.unref(appStore).setPage("ai"))
}, {
default: vue.withCtx(() => [
vue.createTextVNode("AI")
]),
_: 1
})
])) : vue.createCommentVNode("", true)
]),
_: 1
})
]),
_: 1
});
};
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key2, val] of props) {
target[key2] = val;
}
return target;
};
const Home = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-6d85ad8a"]]);
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
__name: "Note",
setup(__props) {
vue.ref("1");
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("h1", null, "这是一个公告");
};
}
});
const _hoisted_1$3 = { style: { "margin": "10px" } };
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
__name: "Base",
setup(__props) {
const appStore = useAppStore();
vue.watch(appStore.app, (newVal) => {
console.log(newVal);
appStore.setConfig(newVal);
});
vue.watch(appStore.ConfigInput, (newVal) => {
for (let key2 in newVal) {
for (let key1 in newVal[key2]) {
let item = newVal[key2][key1];
appStore.app[item.name] = item.value;
}
}
console.log(appStore.app);
appStore.setConfig(appStore.app);
});
const ConfigInput2 = appStore.ConfigInput;
return (_ctx, _cache) => {
const _component_el_alert = vue.resolveComponent("el-alert");
const _component_el_col = vue.resolveComponent("el-col");
const _component_el_switch = vue.resolveComponent("el-switch");
const _component_el_input = vue.resolveComponent("el-input");
const _component_el_input_number = vue.resolveComponent("el-input-number");
const _component_el_option = vue.resolveComponent("el-option");
const _component_el_select = vue.resolveComponent("el-select");
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
const _component_el_row = vue.resolveComponent("el-row");
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
vue.createVNode(_component_el_alert, {
title: "配置修改后会自动保存,直接刷新页面即可",
type: "info",
closable: false,
"show-icon": ""
}),
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(ConfigInput2).base, (item1) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
vue.createVNode(_component_el_row, {
class: "row-bg",
justify: "space-between",
align: "middle"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_col, { span: 6 }, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(item1.label), 1)
]),
_: 2
}, 1024),
vue.createVNode(_component_el_col, {
span: 18,
style: { "text-align": "right" }
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_tooltip, {
class: "grid-content ep-bg-purple-light",
effect: "dark",
content: item1.desc || "",
placement: "top"
}, {
default: vue.withCtx(() => [
item1.type === "switch" ? (vue.openBlock(), vue.createBlock(_component_el_switch, {
key: 0,
modelValue: item1.value,
"onUpdate:modelValue": ($event) => item1.value = $event
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : item1.type === "input" ? (vue.openBlock(), vue.createBlock(_component_el_input, {
key: 1,
modelValue: item1.value,
"onUpdate:modelValue": ($event) => item1.value = $event
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : item1.type === "number" ? (vue.openBlock(), vue.createBlock(_component_el_input_number, {
key: 2,
modelValue: item1.value,
"onUpdate:modelValue": ($event) => item1.value = $event
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : item1.type === "select" ? (vue.openBlock(), vue.createBlock(_component_el_select, {
key: 3,
modelValue: item1.value,
"onUpdate:modelValue": ($event) => item1.value = $event,
placeholder: "请选择"
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item1.options, (item2) => {
return vue.openBlock(), vue.createBlock(_component_el_option, {
key: item2.value,
label: item2.label,
value: item2.value
}, null, 8, ["label", "value"]);
}), 128))
]),
_: 2
}, 1032, ["modelValue", "onUpdate:modelValue"])) : item1.type === "checkbox" ? (vue.openBlock(), vue.createBlock(_component_el_checkbox_group, {
key: 4,
modelValue: item1.value,
"onUpdate:modelValue": ($event) => item1.value = $event
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item1.options, (item2) => {
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
key: item2.value,
label: item2.value,
name: item2.value
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(item2.label), 1)
]),
_: 2
}, 1032, ["label", "name"]);
}), 128))
]),
_: 2
}, 1032, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("", true)
]),
_: 2
}, 1032, ["content"])
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]);
}), 256))
], 64);
};
}
});
const _hoisted_1$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "aah_bomHet50" }, [
/* @__PURE__ */ vue.createElementVNode("span", { class: "dq" }, [
/* @__PURE__ */ vue.createElementVNode("i"),
/* @__PURE__ */ vue.createTextVNode("当前题目")
]),
/* @__PURE__ */ vue.createElementVNode("span", { class: "yp" }, [
/* @__PURE__ */ vue.createElementVNode("i"),
/* @__PURE__ */ vue.createTextVNode("已作答")
]),
/* @__PURE__ */ vue.createElementVNode("span", { class: "wp" }, [
/* @__PURE__ */ vue.createElementVNode("i"),
/* @__PURE__ */ vue.createTextVNode("无答案")
]),
/* @__PURE__ */ vue.createElementVNode("span", { class: "zp" }, [
/* @__PURE__ */ vue.createElementVNode("i"),
/* @__PURE__ */ vue.createTextVNode("未作答")
])
], -1);
const _hoisted_2$1 = ["innerHTML"];
const _hoisted_3$1 = ["innerHTML"];
const _hoisted_4$1 = {
key: 0,
style: { "color": "green" }
};
const _hoisted_5$1 = {
key: 1,
style: { "color": "red" }
};
const _hoisted_6$1 = { key: 0 };
const _hoisted_7 = { key: 1 };
const _hoisted_8 = ["innerHTML"];
const _hoisted_9 = { key: 0 };
const _hoisted_10 = ["innerHTML"];
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
__name: "Ask",
setup(__props) {
const ask = useAskStore();
const app = useAppStore();
const getOptionIndex = (inx) => {
return String.fromCharCode(65 + inx);
};
vue.watch(app.app, (newVal) => {
console.log(newVal);
app.setConfig(newVal);
});
const watchAutoNext = () => {
console.log(ask.autoNext);
Cache.set("autoNext", ask.autoNext);
};
const watchSkipFinish = () => {
console.log(ask.skipFinish);
Cache.set("skipFinish", ask.skipFinish);
};
const watchAutoAnswer = () => {
console.log(ask.autoAnswer);
Cache.set("autoAnswer", ask.autoAnswer);
};
const watchFreeFirst = () => {
console.log(ask.freeFirst);
Cache.set("freeFirst", ask.freeFirst);
};
return (_ctx, _cache) => {
const _component_el_alert = vue.resolveComponent("el-alert");
const _component_el_button = vue.resolveComponent("el-button");
const _component_el_col = vue.resolveComponent("el-col");
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
const _component_el_input = vue.resolveComponent("el-input");
const _component_el_form_item = vue.resolveComponent("el-form-item");
const _component_el_form = vue.resolveComponent("el-form");
const _component_el_tag = vue.resolveComponent("el-tag");
const _component_el_divider = vue.resolveComponent("el-divider");
const _component_el_row = vue.resolveComponent("el-row");
const _component_el_empty = vue.resolveComponent("el-empty");
const _directive_loading = vue.resolveDirective("loading");
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
vue.createVNode(_component_el_alert, {
style: { "margin-bottom": "10px" },
title: "答题默认免费题库优先,请确保题库配置正确",
type: "info",
"show-icon": ""
}),
vue.unref(ask).current ? (vue.openBlock(), vue.createBlock(_component_el_row, { key: 0 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_col, { span: 12 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_button, {
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(ask).start ? vue.unref(ask).pause() : vue.unref(ask).toggleStart()),
size: "small",
class: "aah_btn",
type: "primary",
plain: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(vue.unref(ask).start ? "暂停答题" : "开始答题"), 1)
]),
_: 1
})
]),
_: 1
}),
vue.createVNode(_component_el_col, { span: 12 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_button, {
onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(ask).restart()),
size: "small",
class: "aah_btn",
type: "primary",
plain: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode("重新答题")
]),
_: 1
})
]),
_: 1
}),
vue.createVNode(_component_el_col, { span: 24 }, {
default: vue.withCtx(() => [
_hoisted_1$2
]),
_: 1
}),
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(ask).questionList, (val, inx) => {
return vue.openBlock(), vue.createBlock(_component_el_col, { span: 3 }, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(_component_el_button, {
class: vue.normalizeClass(inx == vue.unref(ask).questionInx ? "aah_active" : ""),
style: { "width": "30px", "margin-bottom": "4px" },
key: inx,
onClick: ($event) => vue.unref(ask).toQuestion(inx),
size: "small",
type: val.status == 1 ? "primary" : val.status == 2 ? "danger" : "",
plain: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(inx + 1), 1)
]),
_: 2
}, 1032, ["class", "onClick", "type"]))
]),
_: 2
}, 1024);
}), 256)),
vue.createVNode(_component_el_col, { span: 24 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_form, { "label-width": "auto" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_checkbox, {
onChange: watchSkipFinish,
modelValue: vue.unref(ask).skipFinish,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(ask).skipFinish = $event),
label: "跳过已作答"
}, null, 8, ["modelValue"]),
vue.createVNode(_component_el_checkbox, {
onChange: watchAutoAnswer,
modelValue: vue.unref(ask).autoAnswer,
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.unref(ask).autoAnswer = $event),
label: "自动答题"
}, null, 8, ["modelValue"]),
vue.createVNode(_component_el_checkbox, {
onChange: watchAutoNext,
modelValue: vue.unref(ask).autoNext,
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.unref(ask).autoNext = $event),
label: "自动跳转"
}, null, 8, ["modelValue"]),
vue.createVNode(_component_el_checkbox, {
onChange: watchFreeFirst,
modelValue: vue.unref(ask).freeFirst,
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => vue.unref(ask).freeFirst = $event),
label: "免费题库优先"
}, null, 8, ["modelValue"]),
vue.createVNode(_component_el_form_item, { label: "秘钥" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_input, {
class: "aah_password",
placeholder: "请输入你购买的秘钥",
modelValue: vue.unref(app).app.key,
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => vue.unref(app).app.key = $event),
"show-password": ""
}, null, 8, ["modelValue"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}),
vue.unref(ask).formMap ? (vue.openBlock(), vue.createBlock(_component_el_col, {
key: 0,
span: 24
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(ask).formMap, (val, key2) => {
return vue.openBlock(), vue.createBlock(_component_el_tag, {
key: key2,
style: { "margin-right": "10px" }
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(key2) + ":" + vue.toDisplayString(val) + " 次", 1)
]),
_: 2
}, 1024);
}), 128))
]),
_: 1
})) : vue.createCommentVNode("", true),
vue.createVNode(_component_el_divider, null, {
default: vue.withCtx(() => [
vue.createTextVNode("当前题目"),
vue.createVNode(_component_el_button, {
onClick: _cache[7] || (_cache[7] = ($event) => vue.unref(ask).reAnswer(vue.unref(ask).questionInx)),
style: { "color": "red", "font-size": "10px" },
link: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode("重答")
]),
_: 1
}),
vue.createVNode(_component_el_divider, { direction: "vertical" }),
vue.createVNode(_component_el_button, {
onClick: _cache[8] || (_cache[8] = ($event) => vue.unref(ask).aiAnswer(vue.unref(ask).questionInx)),
style: { "color": "red", "font-size": "10px" },
link: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode("AI答题")
]),
_: 1
})
]),
_: 1
}),
vue.createVNode(_component_el_col, { span: 24 }, {
default: vue.withCtx(() => [
vue.createElementVNode("div", {
class: "aah_title",
innerHTML: "[" + vue.unref(typeChange2)(vue.unref(ask).current.type ?? "") + "]" + vue.unref(ask).current.question
}, null, 8, _hoisted_2$1),
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(ask).current.options, (val, inx) => {
return vue.openBlock(), vue.createElementBlock("p", {
style: vue.normalizeStyle(vue.unref(ask).current.form && vue.unref(ask).current.form.match && vue.unref(ask).current.form.match.includes(inx) ? "color:green;" : ""),
class: "aah_options",
innerHTML: getOptionIndex(inx) + ". " + val
}, null, 12, _hoisted_3$1);
}), 256)),
vue.unref(ask).current.form ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$1, " 采用【" + vue.toDisplayString(vue.unref(ask).current.form.form) + "】的答案 ", 1)) : vue.createCommentVNode("", true),
vue.unref(ask).current.type == "8" ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$1, " 当前题型暂不支持,请反馈给作者吧 ")) : vue.createCommentVNode("", true)
]),
_: 1
}),
vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_col, {
span: 24,
"element-loading-text": "正在搜索中"
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(ask).current.answer, (item) => {
return vue.openBlock(), vue.createElementBlock("div", null, [
vue.createVNode(_component_el_divider, null, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(`${item.form}(${item.duration}ms)`), 1)
]),
_: 2
}, 1024),
typeof item.answer === "object" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.answer, (ans) => {
return vue.openBlock(), vue.createElementBlock("p", null, [
vue.createVNode(_component_el_input, {
value: ans,
readonly: "",
style: { "width": "100%" }
}, null, 8, ["value"])
]);
}), 256))
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
vue.createElementVNode("div", {
innerHTML: item.answer ? item.answer : item.msg ?? "暂无答案"
}, null, 8, _hoisted_8)
]))
]);
}), 256)),
vue.unref(ask).current.aiMsg ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
vue.createVNode(_component_el_divider, null, {
default: vue.withCtx(() => [
vue.createTextVNode("AI回答(仅供参考)")
]),
_: 1
}),
vue.createElementVNode("div", {
innerHTML: vue.unref(ask).currentAiMd
}, null, 8, _hoisted_10)
])) : vue.createCommentVNode("", true)
]),
_: 1
})), [
[_directive_loading, vue.unref(ask).loading]
])
]),
_: 1
})) : (vue.openBlock(), vue.createBlock(_component_el_empty, {
key: 1,
description: "暂无题目数据"
}))
], 64);
};
}
});
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
__name: "Api",
setup(__props) {
const apiStore = useApiStore();
const deleteRow = (index) => {
apiStore.deleteApi(index);
};
const paramVisible = vue.ref(false);
const addParam = () => {
if (apiStore.currentParam.name == "") {
ElementPlus.ElNotification({
title: "参数效验不通过",
message: "参数名不能为空",
type: "error"
});
return;
}
if (apiStore.currentParam.value == "") {
ElementPlus.ElNotification({
title: "参数效验不通过",
message: "参数值不能为空",
type: "error"
});
return;
}
const index = apiStore.currentApi.params.findIndex((item) => item.name == apiStore.currentParam.name);
if (index != -1) {
apiStore.currentApi.params[index] = apiStore.currentParam;
ElementPlus.ElNotification({
title: "更新成功",
message: "参数已更新",
type: "success"
});
paramVisible.value = false;
return;
}
apiStore.addParam();
paramVisible.value = false;
};
const addApi = () => {
if (apiStore.currentApi.name == "") {
ElementPlus.ElNotification({
title: "参数效验不通过",
message: "接口名不能为空",
type: "error"
});
return;
}
if (apiStore.currentApi.url == "") {
ElementPlus.ElNotification({
title: "参数效验不通过",
message: "接口地址不能为空",
type: "error"
});
return;
}
if (apiStore.currentApi.params.length == 0) {
ElementPlus.ElNotification({
title: "参数效验不通过",
message: "参数不能为空",
type: "error"
});
return;
}
const index = apiStore.apiList.findIndex((item) => item.name == apiStore.currentApi.name);
if (index != -1) {
apiStore.updateApi(index, apiStore.currentApi);
ElementPlus.ElNotification({
title: "更新成功",
message: "接口已更新",
type: "success"
});
}
apiStore.addApi();
apiStore.reset();
};
const editApi = (index) => {
apiStore.editApi(index);
};
const editParam = (index) => {
apiStore.editParam(index);
paramVisible.value = true;
};
const testApi = (index) => {
apiStore.testApi(index).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err);
ElementPlus.ElNotification({
title: "请求失败",
message: err,
type: "error"
});
});
};
return (_ctx, _cache) => {
const _component_el_alert = vue.resolveComponent("el-alert");
const _component_el_input = vue.resolveComponent("el-input");
const _component_el_form_item = vue.resolveComponent("el-form-item");
const _component_el_option = vue.resolveComponent("el-option");
const _component_el_select = vue.resolveComponent("el-select");
const _component_el_button = vue.resolveComponent("el-button");
const _component_el_form = vue.resolveComponent("el-form");
const _component_el_dialog = vue.resolveComponent("el-dialog");
const _component_el_table_column = vue.resolveComponent("el-table-column");
const _component_el_table = vue.resolveComponent("el-table");
const _component_el_col = vue.resolveComponent("el-col");
const _component_el_row = vue.resolveComponent("el-row");
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
vue.createVNode(_component_el_alert, {
title: "当前功能开发中,若您有急需添加的API可以先反馈给作者",
type: "error"
}),
vue.createVNode(_component_el_dialog, {
modelValue: paramVisible.value,
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => paramVisible.value = $event),
title: "添加参数",
style: { "width": "400px" }
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_form, {
model: vue.unref(apiStore).currentParam,
"label-width": "auto"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_form_item, { label: "参数名" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_input, {
modelValue: vue.unref(apiStore).currentParam.name,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.unref(apiStore).currentParam.name = $event),
autocomplete: "off"
}, null, 8, ["modelValue"])
]),
_: 1
}),
vue.createVNode(_component_el_form_item, { label: "参数类型" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_select, {
modelValue: vue.unref(apiStore).currentParam.type,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(apiStore).currentParam.type = $event),
placeholder: "请选择"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_option, {
label: "内置参数",
value: "sys"
}),
vue.createVNode(_component_el_option, {
label: "自定义参数",
value: "diy"
})
]),
_: 1
}, 8, ["modelValue"])
]),
_: 1
}),
vue.createVNode(_component_el_form_item, { label: "参数值" }, {
default: vue.withCtx(() => [
vue.unref(apiStore).currentParam.type == "diy" ? (vue.openBlock(), vue.createBlock(_component_el_input, {
key: 0,
modelValue: vue.unref(apiStore).currentParam.value,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(apiStore).currentParam.value = $event),
autocomplete: "off"
}, null, 8, ["modelValue"])) : (vue.openBlock(), vue.createBlock(_component_el_select, {
key: 1,
modelValue: vue.unref(apiStore).currentParam.value,
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.unref(apiStore).currentParam.value = $event),
placeholder: "请选择"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_option, {
label: "题型(字符串)",
value: "$type"
}),
vue.createVNode(_component_el_option, {
label: "题型(数字)",
value: "$typeid"
}),
vue.createVNode(_component_el_option, {
label: "题干(题目)",
value: "$question"
}),
vue.createVNode(_component_el_option, {
label: "选项",
value: "$options"
}),
vue.createVNode(_component_el_option, {
label: "时间戳",
value: "$timestamp"
}),
vue.createVNode(_component_el_option, {
label: "随机数",
value: "$random"
})
]),
_: 1
}, 8, ["modelValue"]))
]),
_: 1
}),
vue.createVNode(_component_el_form_item, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_button, {
onClick: addParam,
plain: "",
style: { "width": "100%" }
}, {
default: vue.withCtx(() => [
vue.createTextVNode("添加")
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}, 8, ["model"])
]),
_: 1
}, 8, ["modelValue"]),
vue.createVNode(_component_el_table, {
data: vue.unref(apiStore).apiList,
style: { "width": "100%", "margin-bottom": "10px" },
"empty-text": "暂无数据"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_table_column, {
prop: "name",
label: "接口名",
width: "120"
}),
vue.createVNode(_component_el_table_column, {
prop: "url",
label: "接口地址",
width: "120"
}),
vue.createVNode(_component_el_table_column, {
prop: "method",
label: "请求方式",
width: "120"
}),
vue.createVNode(_component_el_table_column, {
fixed: "right",
label: "操作",
width: "120"
}, {
default: vue.withCtx((scope) => [
vue.createVNode(_component_el_button, {
link: "",
type: "primary",
size: "small",
onClick: vue.withModifiers(($event) => deleteRow(scope.$index), ["prevent"])
}, {
default: vue.withCtx(() => [
vue.createTextVNode(" 删除 ")
]),
_: 2
}, 1032, ["onClick"]),
vue.createVNode(_component_el_button, {
link: "",
type: "primary",
size: "small",
onClick: vue.withModifiers(($event) => editApi(scope.$index), ["prevent"])
}, {
default: vue.withCtx(() => [
vue.createTextVNode(" 编辑 ")
]),
_: 2
}, 1032, ["onClick"]),
vue.createVNode(_component_el_button, {
link: "",
type: "primary",
size: "small",
onClick: vue.withModifiers(($event) => testApi(scope.$index), ["prevent"])
}, {
default: vue.withCtx(() => [
vue.createTextVNode(" 测试 ")
]),
_: 2
}, 1032, ["onClick"])
]),
_: 1
})
]),
_: 1
}, 8, ["data"]),
vue.createVNode(_component_el_row, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_col, { span: 24 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_form, {
model: vue.unref(apiStore).currentApi,
"label-width": "80px"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_form_item, { label: "接口名" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_input, {
modelValue: vue.unref(apiStore).currentApi.name,
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => vue.unref(apiStore).currentApi.name = $event),
placeholder: "请输入接口名"
}, null, 8, ["modelValue"])
]),
_: 1
}),
vue.createVNode(_component_el_form_item, { label: "接口地址" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_input, {
modelValue: vue.unref(apiStore).currentApi.url,
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => vue.unref(apiStore).currentApi.url = $event),
placeholder: "请输入接口地址"
}, null, 8, ["modelValue"])
]),
_: 1
}),
vue.createVNode(_component_el_form_item, { label: "请求方式" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_select, {
modelValue: vue.unref(apiStore).currentApi.method,
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => vue.unref(apiStore).currentApi.method = $event),
placeholder: "请选择"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_option, {
label: "GET",
value: "GET"
}),
vue.createVNode(_component_el_option, {
label: "POST",
value: "POST"
})
]),
_: 1
}, 8, ["modelValue"])
]),
_: 1
}),
vue.createVNode(_component_el_form_item, { label: "请求参数" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_table, {
data: vue.unref(apiStore).currentApi.params,
style: { "width": "100%" },
"empty-text": "暂无参数"
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_table_column, {
prop: "name",
label: "参数名",
width: "120"
}),
vue.createVNode(_component_el_table_column, {
prop: "value",
label: "参数值",
width: "120"
}),
vue.createVNode(_component_el_table_column, {
fixed: "right",
label: "操作",
width: "120"
}, {
default: vue.withCtx((scope) => [
vue.createVNode(_component_el_button, {
link: "",
type: "primary",
size: "small",
onClick: vue.withModifiers(($event) => vue.unref(apiStore).deleteParam(scope.$index), ["prevent"])
}, {
default: vue.withCtx(() => [
vue.createTextVNode(" 删除 ")
]),
_: 2
}, 1032, ["onClick"]),
vue.createVNode(_component_el_button, {
link: "",
type: "primary",
size: "small",
onClick: vue.withModifiers(($event) => editParam(scope.$index), ["prevent"])
}, {
default: vue.withCtx(() => [
vue.createTextVNode(" 编辑 ")
]),
_: 2
}, 1032, ["onClick"])
]),
_: 1
})
]),
_: 1
}, 8, ["data"]),
vue.createVNode(_component_el_button, {
type: "primary",
onClick: _cache[8] || (_cache[8] = ($event) => paramVisible.value = true),
text: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode("添加参数")
]),
_: 1
})
]),
_: 1
}),
vue.createVNode(_component_el_form_item, null, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_button, {
type: "primary",
onClick: addApi,
plain: ""
}, {
default: vue.withCtx(() => [
vue.createTextVNode("添加")
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}, 8, ["model"])
]),
_: 1
})
]),
_: 1
})
], 64);
};
}
});
const _sfc_main$1 = {};
const _hoisted_1$1 = {
src: "https://chatglm.cn/miniapp/home",
width: "100%",
height: "600px",
frameborder: "0",
style: { "border": "none", "overflow": "hidden" }
};
function _sfc_render(_ctx, _cache) {
return vue.openBlock(), vue.createElementBlock("iframe", _hoisted_1$1);
}
const Ai = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
const _hoisted_1 = { class: "aah_wrapper" };
const _hoisted_2 = ["src"];
const _hoisted_3 = ["id"];
const _hoisted_4 = {
key: 0,
class: "aah_breadcrumb"
};
const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("strong", null, "home", -1);
const _hoisted_6 = ["src"];
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "App",
setup(__props) {
const appStore = useAppStore();
const askStore = useAskStore();
_unsafeWindow[key] = { "app": appStore, "ask": askStore };
document.onkeydown = function(e) {
if (e.ctrlKey && e.key == "p") {
appStore.app.showFloat = !appStore.app.showFloat;
}
};
return (_ctx, _cache) => {
const _component_el_button = vue.resolveComponent("el-button");
const _component_el_breadcrumb_item = vue.resolveComponent("el-breadcrumb-item");
const _component_el_breadcrumb = vue.resolveComponent("el-breadcrumb");
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
const _component_el_dialog = vue.resolveComponent("el-dialog");
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
vue.createVNode(_component_el_dialog, {
modelValue: vue.unref(appStore).app.showFloat,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(appStore).app.showFloat = $event),
title: "爱问答助手",
draggable: "",
overflow: "",
"show-close": true,
modal: false,
"close-on-click-modal": false,
style: vue.normalizeStyle(vue.unref(appStore).page === "ai" ? "width: 70vh;" : "width: 400px;")
}, {
header: vue.withCtx(({ close, titleId, titleClass }) => [
vue.createElementVNode("img", {
src: vue.unref(scriptInfo$1).script.icon,
alt: "icon",
style: { "width": "20px", "height": "20px", "margin-right": "10px", "vertical-align": "middle" }
}, null, 8, _hoisted_2),
vue.createElementVNode("span", {
id: titleId,
class: vue.normalizeClass(titleClass)
}, vue.toDisplayString(`${vue.unref(scriptInfo$1).script.name} - ${vue.unref(scriptInfo$1).script.version}`), 11, _hoisted_3),
vue.createTextVNode(" "),
vue.createVNode(_component_el_button, { link: "" }, {
default: vue.withCtx(() => [
vue.createTextVNode("log")
]),
_: 1
})
]),
default: vue.withCtx(() => [
vue.createVNode(_component_el_scrollbar, { "max-height": "55vh" }, {
default: vue.withCtx(() => [
vue.unref(appStore).page != "home" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
vue.createVNode(_component_el_breadcrumb, { separator: "/" }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_breadcrumb_item, {
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(appStore).setPage("home"))
}, {
default: vue.withCtx(() => [
_hoisted_5
]),
_: 1
}),
vue.createVNode(_component_el_breadcrumb_item, null, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(vue.unref(appStore).page), 1)
]),
_: 1
})
]),
_: 1
})
])) : vue.createCommentVNode("", true),
vue.unref(appStore).page == "home" ? (vue.openBlock(), vue.createBlock(Home, { key: 1 })) : vue.unref(appStore).page == "note" ? (vue.openBlock(), vue.createBlock(_sfc_main$5, { key: 2 })) : vue.unref(appStore).page == "Base" ? (vue.openBlock(), vue.createBlock(_sfc_main$4, { key: 3 })) : vue.unref(appStore).page == "ask" ? (vue.openBlock(), vue.createBlock(_sfc_main$3, { key: 4 })) : vue.unref(appStore).page == "api" ? (vue.openBlock(), vue.createBlock(_sfc_main$2, { key: 5 })) : vue.unref(appStore).page == "ai" ? (vue.openBlock(), vue.createBlock(Ai, { key: 6 })) : vue.createCommentVNode("", true)
]),
_: 1
})
]),
_: 1
}, 8, ["modelValue", "style"]),
vue.withDirectives(vue.createElementVNode("div", {
class: "minimized-dialog",
onClick: _cache[4] || (_cache[4] = ($event) => vue.unref(appStore).app.showFloat = true)
}, [
vue.createElementVNode("div", {
onClick: _cache[3] || (_cache[3] = ($event) => vue.unref(appStore).app.showFloat = true)
}, [
vue.createElementVNode("img", {
width: "104vh",
src: vue.unref(mini),
onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(appStore).app.showFloat = true)
}, null, 8, _hoisted_6)
])
], 512), [
[vue.vShow, !vue.unref(appStore).app.showFloat]
])
]);
};
}
});
const cssLoader = (e) => {
const t = GM_getResourceText(e);
return GM_addStyle(t), t;
};
cssLoader("ElementPlus");
const LoadVue = () => {
const pinia = createPinia();
const app = vue.createApp(_sfc_main);
app.use(ElementPlus);
app.use(pinia);
app.mount(
(() => {
const app2 = document.createElement("div");
app2.id = "AiAskApp";
document.body.append(app2);
return app2;
})()
);
};
comHook();
parseRuleHook(rule);
_unsafeWindow.onload = async () => {
allowCopy();
if (_unsafeWindow !== _unsafeWindow.top && !/\/work\/doHomeWorkNew/i.test(location.pathname)) {
return;
}
LoadVue();
parseRule(rule);
};
})(Vue, ElementPlus, $, markdownit, hljs);