// ==UserScript==
// @name 煎蛋吐槽记录器
// @namespace yunyuyuan/jandan-recorder
// @version 1.2.4
// @author yunyuyuan
// @description 煎蛋吐槽记录器,自动记录发送过的主题和评论
// @license MIT
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAnCAYAAAB0Q6rCAAAAAXNSR0IB2cksfwAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAWcSURBVFhHzZlbaBxVGMe/md3s5rbZxBirEUVpoFJbxURS7C1WUdNY6oVqsT4p+CoKvvkgWvRJK7UoKAqKQmt8kJaKbUkq7YNiiOnFerc3TWxj7jVJk93NHP//M3PC7mbTnZ0E3T/82Jlzm+985/KdmbUkUxXgbrAcRIEC/4do12VwEhwBCTBHW8EFQCOLidPgAaBlPLwZ7HUv5Sg4BKb0XQEK27Z9fzzeHAuF4gdHR4+MplKXTBaw3UvfqgSbwJ1gBqwHXwOJgF7A3rzKhIXIWbPu7cTqtT3O5i3LvKSF6j1A244Bix5uBt+CH8GtILCc1tZo79DwW5ZYTzqiukNijSslF2dsteOmri62H0RcS+fAtaCBw3QjoLq838B6+cCqpJq2kiWOVVHmhFqqrPCDTkq1hSdC1V6RIJoGJ9xLqafBZh7T7b6kXhJbnW0pVX1N5arbQ7WUPv9OZ7ykWkWkTCRV6sh01JFQpSTCSxXyl0d0OdRxfm2IwvPZO9SV5Hi/ekpsAZ+BD8FTIK+ck6uWSDT1DC6XoZtJnWgpRyWlJPGL3ayGrFvYe3pjJqzGIw3O0XC91ScpLD5LStDl49bkzAfWHSdGdd38+hK0gvXBDP6+cSke225VhxslaTrvCa6bM1b0i/FniS1qbOawTE9vs2871e+l5tOswb62Gg4fsIlOCCfDMApbDSyLZlGKfEyJDEq9vAhghxzlSDTErY63ul3ga4r48rDzU+M2/NwFJlEjKcq6Bo/aZFXa12ljfD0K4mBMWaLG1TkJyRfo8hhcAcOtCplxDtkrju1zC85RYVNC/dbULrUlj8loyqS4D+cOTo/6NRjVdMDlrLfTKl2FARtM7LIbep71UrJV4JSI4VExPK3SgycOxiHukH6NpViWHWTdirT2dNu6O3nly2AMnzt7DSEQJNhSrMO6bCOjTWsRDabYXDoUPVaoh035XO35kH+D08WHGi/z14/RfBLLBx0ZT4VXRY2JCRybvhHZt1+k47BI/99u+rxCXm+fyEGcAVmnqxvxlgE3gOGFV4GHRsZEPsa+8sobIrveF/n9rJueU95onPpZ5M13RbbvEGnH5jU+6aYXqgB9RLjFljaGk+7gsMgwgmvCDc5XFD3Ksqxz6R/silkB0q8KNxgPKsfW1NwosvEekZbVInW1bvq8Ql79EpENa906jSuxI3IPL2CxGXHA8ke6gaY9Vk14q4y4gYMe5jxO4dZGlyvKcUTIY0ACb2UTCBoIyros68zGjloEjqHUTrvuu+e8lGwVFjiyFcLcq6pBgEKAroZ3tbEU5zHOYhkwDYZFMCo1V7t1YlVpxhaoQAZrT9LZnLsmWnMRnYcVp8EZD17/Cfh2yDosT/iGFlDBDM4WV/sFGLYXF3tAu8dusB8MIg8/iyEajNa0AiyBNE2jmQHQn8Ug8vhVAZcL0KxtNHhhhhrRIM7XXCzMWGq2BRqMGKTF9/95ZMWE520cA3NSDeKgDJRmwTSTn6susYAongFziZnYCLUu0nIeEs8D7JTyIngNZMhxNjyKlYIOmRWWQ3+g7x+h7RFc8xEUilt1eMlvuxyXm1VIL7hsxUJT2ELGsY902nZHp5earp2A5+QfwErj6sfBp+6l3vMOAB61TT5ik37dLlSsj9gmX+m73MImJwgn+pRtvMxpGgMPAX7xoVgmo52nAf3DwovNbmD8ni06KFcdw1/gEaA1O5k91YOHwQrAdwOKlYKKIeUJwE2tAzCq4uiUIX7LWwf4PY+fzIxN3NmPg8/BEBP+K90L+P2BHe8B14N0cZiZt0bfFYluB1zYNOwM4PdnI2PwRn1XRLoB8AskjRsAOOdpFa3BVBxwrtJAztH7AL9LF63BFBfgJ4BGcmNn8C5qg41eBzTU0AaKXi8AY3DRe9iI/2NsB/welEci/wJWQ/u2OAjS/QAAAABJRU5ErkJggg==
// @match *://*.jandan.net/*
// @require https://unpkg.com/[email protected]/dist/vue.global.prod.js
// @grant GM_addStyle
// @grant unsafeWindow
// ==/UserScript==
(e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const a=document.createElement("style");a.textContent=e,document.head.append(a)})(" .table-container[data-v-d5b34e8b]{overflow:auto;flex-grow:1;align-self:stretch;border:1px solid #c1c1c1}table[data-v-d5b34e8b]{width:100%;border-collapse:collapse}table thead[data-v-d5b34e8b]{border-radius:12px 12px 0 0}table thead th[data-v-d5b34e8b]{padding:10px 0;font-size:16px;position:sticky;top:0;z-index:1;background:#c8c8c8}table tbody tr.is-child td[data-v-d5b34e8b]{border-color:transparent}table tbody td[data-v-d5b34e8b]{font-size:14px;padding:8px 0;border-top:1px solid rgb(218,218,218)}@media screen and (min-width: 769px){table tbody td[data-v-d5b34e8b]{min-width:80px}}.settings-container{width:100%;overflow:auto;text-align:center}.settings-container>div{padding:20px 0;border-bottom:1px solid gray}.settings-container .github svg{height:30px;width:30px}#jandan-recorder-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999;background:#0009}#jandan-recorder-modal .inner{background:#fff;color:#000;width:70%;height:calc(100% - 100px);margin:50px auto auto;padding:10px;border-radius:12px;box-shadow:0 0 12px #0003;display:flex;align-items:center;flex-direction:column}@media screen and (min-width: 769px){#jandan-recorder-modal .inner{min-width:400px}}@media screen and (max-width: 768px){#jandan-recorder-modal .inner{width:90%}}#jandan-recorder-modal .header{position:relative;margin-bottom:10px;width:100%}#jandan-recorder-modal .header .switcher{font-size:15px;padding:4px 8px;margin:auto}#jandan-recorder-modal .header .close{position:absolute;right:0;cursor:pointer}#jandan-recorder-modal .header .close svg{stroke:#000;width:25px;height:25px}#jandan-recorder-modal .header .close:hover svg{stroke:red}#header .nav-items .nav-item:last-of-type{display:flex}#header .nav-items .nav-item:last-of-type .jandan-record-link{cursor:pointer}.jandan-record-link{word-break:keep-all}.jandan-record-rainbow-text{font-size:1.1rem!important;background:linear-gradient(to right,#66f,#09f,#0f0,#f39,#66f);-webkit-background-clip:text!important;background-clip:text!important;color:transparent!important;animation:rainbowanimation 6s ease-in-out infinite!important;background-size:400% 100%!important}.jandan-record-reply-ref{text-decoration:underline}#jandan-record-reply-tooltip{position:fixed;z-index:9999;border-radius:8px;box-shadow:0 0 10px #0003;border:1px solid #cfcfcf;padding:12px;background:#fff;max-width:400px;max-height:50vh;overflow:auto}@keyframes rainbowanimation{0%,to{background-position:0 0}50%{background-position:100% 0}} ");
(function (vue) {
'use strict';
const InterceptUrls = [
/**
* TODO 文章发布: N/A
*/
/**
* 创建 问答/树洞/随手拍/无聊图 : /api/comment/create, /jandan-comment.php
request
{
author: "",
email: "",
comment: "",
comment_post_ID: ""
}
response string(id)
*/
"/api/comment/create",
"/jandan-comment.php",
/**
* 楼中回复: /api/tucao/create
request
{
content: "",
comment_id?: 5637737, // 树洞id
comment_post_ID: 102312
}
response
{
"code": 0,
"msg": "success",
"data": {
"comment_ID": 12039174,
"comment_author": "xiaoc",
"comment_content": "祝福!",
"comment_date": "2024-03-04T15:53:55.267675774+08:00",
"comment_date_int": 1709538835,
"comment_post_ID": 5637795,
"comment_parent": 102312,
"comment_reply_ID": 0,
"is_jandan_user": 0,
"is_tip_user": 0,
"vote_negative": 0,
"vote_positive": 0
}
}
*/
"/api/tucao/create",
/**
* BBS发布: /api/forum/posts
request
{
"title": "",
"content": "",
"page_id": 112928
}
response
{
"code": 0,
"msg": "success",
"data": ""
"post_id": ???
}
*/
// TODO "/api/forum/posts", 没有返回id,所以暂时不做
/**
* BBS吐槽: /api/forum/replies
request
{
"content": "",
"post_id": 1282,
"page_id": 112928
}
*/
"/api/forum/replies"
];
const OneDay = 1e3 * 60 * 60 * 24;
const ShowModalEvent = "show-modal";
const PushRecordEvent = "push-record";
const AjaxSuccessEvent = "ajax-success";
const SettingsStorageKey = "jandan-recorder-settings";
const SettingsKeyAutoDeleteDay = "auto-delete-day";
const SettingsKeyAutoDelete404 = "auto-delete-404";
const SettingsKeyFoldItem = "fold-item";
const SettingsKeyRGBName = "rgb-name";
const SettingsKeyBBSReply = "bbs-reply";
const DefaultSettings = {
[SettingsKeyAutoDeleteDay]: "0",
[SettingsKeyAutoDelete404]: false,
[SettingsKeyFoldItem]: true,
[SettingsKeyRGBName]: true,
[SettingsKeyBBSReply]: true
};
var _unsafeWindow = /* @__PURE__ */ (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)();
function mitt(n) {
return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
var i = n.get(t);
i ? i.push(e) : n.set(t, [e]);
}, off: function(t, e) {
var i = n.get(t);
i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
}, emit: function(t, e) {
var i = n.get(t);
i && i.slice().map(function(n2) {
n2(e);
}), (i = n.get("*")) && i.slice().map(function(n2) {
n2(t, e);
});
} };
}
const emitter = mitt();
const _window = _unsafeWindow || window;
const $ = (_window == null ? void 0 : _window.jQuery) || (_window == null ? void 0 : _window.$);
const _withScopeId = (n) => (vue.pushScopeId("data-v-d5b34e8b"), n = n(), vue.popScopeId(), n);
const _hoisted_1$2 = { class: "table-container" };
const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
const _hoisted_3$2 = ["onClick"];
const _hoisted_4$1 = ["href"];
const _hoisted_5$1 = ["onClick"];
const _hoisted_6$1 = { key: 0 };
const ListStorageKey = "jandan-recorder";
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
__name: "list",
setup(__props) {
const settings = vue.readonly(vue.inject("settings"));
const inSetting = vue.readonly(vue.inject("inSetting"));
const list = vue.reactive([]);
const openedUrls = vue.reactive(/* @__PURE__ */ new Set());
const listWithFold = vue.computed(() => {
if (settings[SettingsKeyFoldItem]) {
const result = [];
for (const item of list) {
const sameUrlItemIdx = result.findIndex((i) => i.url === item.url);
if (sameUrlItemIdx > -1) {
const sameUrlItem = result[sameUrlItemIdx];
sameUrlItem.childrenNum += 1;
result.splice(sameUrlItemIdx + sameUrlItem.childrenNum, 0, { ...item, isChild: true });
} else {
result.push({ ...item, childrenNum: 0 });
}
}
return result;
} else {
return list;
}
});
const getListFromStorage = () => {
list.splice(0, list.length, ...JSON.parse(localStorage.getItem(ListStorageKey) || "[]"));
};
const saveList = () => {
localStorage.setItem(ListStorageKey, JSON.stringify(vue.toRaw(list)));
getListFromStorage();
};
emitter.on(PushRecordEvent, (newItem) => {
if (!newItem) return;
list.unshift(newItem);
saveList();
});
const removeListItem = (idx) => {
list.splice(idx, 1);
saveList();
};
const toggleOpened = (url) => {
if (openedUrls.has(url)) {
openedUrls.delete(url);
} else {
openedUrls.add(url);
}
};
vue.watch(inSetting, (inSetting2) => {
if (!inSetting2) {
getListFromStorage();
}
});
vue.onMounted(() => {
getListFromStorage();
const now2 = Date.now();
const autoDeleteDay = parseInt(settings[SettingsKeyAutoDeleteDay]);
if (typeof autoDeleteDay === "number" && autoDeleteDay > 0) {
list.splice(0, list.length, ...list.filter((item) => {
return item.timestamp > now2 - OneDay * autoDeleteDay;
}));
}
saveList();
if (settings[SettingsKeyAutoDelete404]) {
const allUrls = new Set(list.map((item) => item.url));
(async () => {
for (const url of allUrls) {
const biggest = list.filter((item) => item.url === url).map((item) => item.lastCheck404 || 0).sort((a, b) => a - b).pop();
if (biggest < now2 - OneDay) {
const res = await fetch(url);
if (res.status === 404) {
list.splice(0, list.length, ...list.filter((item) => {
return item.url !== url;
}));
}
list.forEach((item) => {
if (item.url === url) {
item.lastCheck404 = now2;
}
});
await new Promise((resolve) => setTimeout(resolve, 1e3));
}
saveList();
}
})();
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
vue.createElementVNode("table", null, [
vue.createElementVNode("thead", null, [
vue.createElementVNode("tr", null, [
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(["日期", "类型", "内容", "网址", "操作"], (i) => {
return vue.createElementVNode("th", { key: i }, vue.toDisplayString(i), 1);
}), 64))
])
]),
vue.createElementVNode("tbody", null, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(listWithFold.value, (item, idx) => {
return vue.openBlock(), vue.createElementBlock("tr", {
key: item.timestamp,
class: vue.normalizeClass({ "is-child": item.isChild })
}, [
!item.isChild || openedUrls.has(item.url) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
vue.createElementVNode("td", null, vue.toDisplayString(new Date(item.timestamp).toLocaleString()), 1),
vue.createElementVNode("td", null, vue.toDisplayString(item.isCreate ? "楼主" : "吐槽"), 1),
vue.createElementVNode("td", null, [
vue.createTextVNode(vue.toDisplayString(item.content) + " ", 1),
vue.unref(settings)[vue.unref(SettingsKeyFoldItem)] && item.childrenNum ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
_hoisted_2$2,
vue.createElementVNode("button", {
onClick: ($event) => toggleOpened(item.url)
}, vue.toDisplayString(openedUrls.has(item.url) ? "收起" : "展开") + vue.toDisplayString(item.childrenNum) + "条 ", 9, _hoisted_3$2)
], 64)) : vue.createCommentVNode("", true)
]),
vue.createElementVNode("td", null, [
vue.createElementVNode("a", {
target: "_blank",
href: item.urlWithAnchor || item.url
}, "前往", 8, _hoisted_4$1)
]),
vue.createElementVNode("td", null, [
vue.createElementVNode("button", {
onClick: ($event) => removeListItem(idx)
}, " 删除 ", 8, _hoisted_5$1)
])
], 64)) : vue.createCommentVNode("", true)
], 2);
}), 128)),
list.length === 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$1, "一条都没有,赶快去吐槽吧!")) : vue.createCommentVNode("", true)
])
])
]);
};
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const ListComp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-d5b34e8b"]]);
const _hoisted_1$1 = { class: "settings-container" };
const _hoisted_2$1 = { title: "每次打开网站时检查" };
const _hoisted_3$1 = { title: "每天自动检查一次" };
const _hoisted_4 = { title: "在同一个贴子下面有多个吐槽,则自动折叠,但依然可以手动展开" };
const _hoisted_5 = { title: "给自己的昵称加上牛逼闪闪的RGB特效" };
const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "jandan-record-rainbow-text" }, "个人名称RGB特效", -1);
const _hoisted_7 = { title: "给BBS加上回复按钮,修复楼层显示,气泡显示引用内容" };
const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("span", null, "BBS增强", -1);
const _hoisted_9 = /* @__PURE__ */ vue.createElementVNode("p", null, [
/* @__PURE__ */ vue.createElementVNode("a", {
class: "github",
target: "_blank",
href: "https://github.com/yunyuyuan/jandan-recorder"
}, [
/* @__PURE__ */ vue.createElementVNode("svg", { viewBox: "0 0 16 16" }, [
/* @__PURE__ */ vue.createElementVNode("path", { d: "M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z" })
])
])
], -1);
const _hoisted_10 = /* @__PURE__ */ vue.createElementVNode("span", { style: { "color": "grey", "margin": "0 10px" } }, "|", -1);
const _hoisted_11 = /* @__PURE__ */ vue.createElementVNode("a", {
target: "_blank",
href: "https://update.gf.qytechs.cn/scripts/488975/%E7%85%8E%E8%9B%8B%E5%90%90%E6%A7%BD%E8%AE%B0%E5%BD%95%E5%99%A8.user.js"
}, "检查更新", -1);
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
__name: "settings",
setup(__props) {
const version = "v1.2.4";
const settings = vue.inject("settings");
const refreshSettings = () => {
Object.assign(settings, {
...DefaultSettings,
...JSON.parse(localStorage.getItem(SettingsStorageKey) || "{}")
});
};
const updateSettings = (newSettings) => {
localStorage.setItem(SettingsStorageKey, JSON.stringify({
...vue.toRaw(settings),
...newSettings
}));
};
const inputAutoDeleteDay = (e) => {
const val = parseInt(e.target.value || "");
updateSettings({
[SettingsKeyAutoDeleteDay]: isNaN(val) || val < 1 ? "0" : val.toString()
});
};
const inputAutoDelete404 = (e) => {
updateSettings({
[SettingsKeyAutoDelete404]: e.target.checked
});
refreshSettings();
};
const toggleFoldItem = (e) => {
updateSettings({
[SettingsKeyFoldItem]: e.target.checked
});
refreshSettings();
};
const toggleRGBName = (e) => {
updateSettings({
[SettingsKeyRGBName]: e.target.checked
});
refreshSettings();
};
const toggleBBSReply = (e) => {
updateSettings({
[SettingsKeyBBSReply]: e.target.checked
});
refreshSettings();
alert("刷新网页后生效");
};
vue.onMounted(() => {
refreshSettings();
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
vue.createElementVNode("div", _hoisted_2$1, [
vue.createTextVNode(" 自动删除 "),
vue.withDirectives(vue.createElementVNode("input", {
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.unref(settings)[vue.unref(SettingsKeyAutoDeleteDay)] = $event),
type: "number",
min: "0",
step: "1",
onInput: inputAutoDeleteDay,
onFocusout: refreshSettings
}, null, 544), [
[vue.vModelText, vue.unref(settings)[vue.unref(SettingsKeyAutoDeleteDay)]]
]),
vue.createTextVNode(" 天前的记录(默认设置为0则不自动删除) ")
]),
vue.createElementVNode("div", _hoisted_3$1, [
vue.withDirectives(vue.createElementVNode("input", {
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(settings)[vue.unref(SettingsKeyAutoDelete404)] = $event),
type: "checkbox",
onChange: inputAutoDelete404
}, null, 544), [
[vue.vModelCheckbox, vue.unref(settings)[vue.unref(SettingsKeyAutoDelete404)]]
]),
vue.createTextVNode(" 自动删除已失效(404)的记录 ")
]),
vue.createElementVNode("div", _hoisted_4, [
vue.withDirectives(vue.createElementVNode("input", {
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(settings)[vue.unref(SettingsKeyFoldItem)] = $event),
type: "checkbox",
onChange: toggleFoldItem
}, null, 544), [
[vue.vModelCheckbox, vue.unref(settings)[vue.unref(SettingsKeyFoldItem)]]
]),
vue.createTextVNode(" 折叠主题相同的项目 ")
]),
vue.createElementVNode("div", _hoisted_5, [
vue.withDirectives(vue.createElementVNode("input", {
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.unref(settings)[vue.unref(SettingsKeyRGBName)] = $event),
type: "checkbox",
onChange: toggleRGBName
}, null, 544), [
[vue.vModelCheckbox, vue.unref(settings)[vue.unref(SettingsKeyRGBName)]]
]),
vue.createTextVNode(" 🪄"),
_hoisted_6,
vue.createTextVNode("🪄 ")
]),
vue.createElementVNode("div", _hoisted_7, [
vue.withDirectives(vue.createElementVNode("input", {
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.unref(settings)[vue.unref(SettingsKeyBBSReply)] = $event),
type: "checkbox",
onChange: toggleBBSReply
}, null, 544), [
[vue.vModelCheckbox, vue.unref(settings)[vue.unref(SettingsKeyBBSReply)]]
]),
_hoisted_8
]),
vue.createElementVNode("div", null, [
_hoisted_9,
vue.createElementVNode("p", null, [
vue.createTextVNode(" 当前版本:" + vue.toDisplayString(vue.unref(version)), 1),
_hoisted_10,
_hoisted_11
])
])
]);
};
}
});
const _hoisted_1 = { class: "header" };
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("svg", {
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, [
/* @__PURE__ */ vue.createElementVNode("path", {
d: "M21 21L12 12M12 12L3 3M12 12L21.0001 3M12 12L3 21.0001",
"stroke-width": "2",
"stroke-linecap": "round",
"stroke-linejoin": "round"
})
], -1);
const _hoisted_3 = [
_hoisted_2
];
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
__name: "modal",
setup(__props) {
const inSetting = vue.inject("inSetting");
const showModal = vue.ref(false);
emitter.on(ShowModalEvent, () => {
showModal.value = true;
});
const close = () => {
showModal.value = false;
};
return (_ctx, _cache) => {
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
id: "jandan-recorder-modal",
onMousedown: _cache[3] || (_cache[3] = ($event) => showModal.value = false)
}, [
vue.createElementVNode("div", {
class: "inner",
onMousedown: _cache[2] || (_cache[2] = (e) => e.stopPropagation())
}, [
vue.createElementVNode("div", _hoisted_1, [
vue.createElementVNode("button", {
class: "switcher",
onClick: _cache[0] || (_cache[0] = ($event) => inSetting.value = !vue.unref(inSetting))
}, vue.toDisplayString(vue.unref(inSetting) ? "返回列表(设置会自动保存)" : "前往设置"), 1),
vue.createElementVNode("span", {
class: "close",
onClick: _cache[1] || (_cache[1] = ($event) => close())
}, _hoisted_3)
]),
vue.withDirectives(vue.createVNode(ListComp, null, null, 512), [
[vue.vShow, !vue.unref(inSetting)]
]),
vue.withDirectives(vue.createVNode(_sfc_main$2, null, null, 512), [
[vue.vShow, vue.unref(inSetting)]
])
], 32)
], 544)), [
[vue.vShow, showModal.value]
]);
};
}
});
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
var _freeGlobal = freeGlobal$1;
var freeGlobal = _freeGlobal;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root$9 = freeGlobal || freeSelf || Function("return this")();
var _root = root$9;
var root$8 = _root;
var Symbol$5 = root$8.Symbol;
var _Symbol = Symbol$5;
var Symbol$4 = _Symbol;
var objectProto$b = Object.prototype;
var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
var nativeObjectToString$1 = objectProto$b.toString;
var symToStringTag$1 = Symbol$4 ? Symbol$4.toStringTag : void 0;
function getRawTag$1(value) {
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1), tag = value[symToStringTag$1];
try {
value[symToStringTag$1] = void 0;
var unmasked = true;
} catch (e) {
}
var result = nativeObjectToString$1.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag$1] = tag;
} else {
delete value[symToStringTag$1];
}
}
return result;
}
var _getRawTag = getRawTag$1;
var objectProto$a = Object.prototype;
var nativeObjectToString = objectProto$a.toString;
function objectToString$1(value) {
return nativeObjectToString.call(value);
}
var _objectToString = objectToString$1;
var Symbol$3 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
var symToStringTag = Symbol$3 ? Symbol$3.toStringTag : void 0;
function baseGetTag$5(value) {
if (value == null) {
return value === void 0 ? undefinedTag : nullTag;
}
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
}
var _baseGetTag = baseGetTag$5;
function isObject$5(value) {
var type = typeof value;
return value != null && (type == "object" || type == "function");
}
var isObject_1 = isObject$5;
var baseGetTag$4 = _baseGetTag, isObject$4 = isObject_1;
var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
function isFunction$2(value) {
if (!isObject$4(value)) {
return false;
}
var tag = baseGetTag$4(value);
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
}
var isFunction_1 = isFunction$2;
var root$7 = _root;
var coreJsData$1 = root$7["__core-js_shared__"];
var _coreJsData = coreJsData$1;
var coreJsData = _coreJsData;
var maskSrcKey = function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
return uid ? "Symbol(src)_1." + uid : "";
}();
function isMasked$1(func) {
return !!maskSrcKey && maskSrcKey in func;
}
var _isMasked = isMasked$1;
var funcProto$1 = Function.prototype;
var funcToString$1 = funcProto$1.toString;
function toSource$2(func) {
if (func != null) {
try {
return funcToString$1.call(func);
} catch (e) {
}
try {
return func + "";
} catch (e) {
}
}
return "";
}
var _toSource = toSource$2;
var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var funcProto = Function.prototype, objectProto$9 = Object.prototype;
var funcToString = funcProto.toString;
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
var reIsNative = RegExp(
"^" + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative$1(value) {
if (!isObject$3(value) || isMasked(value)) {
return false;
}
var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource$1(value));
}
var _baseIsNative = baseIsNative$1;
function getValue$1(object, key) {
return object == null ? void 0 : object[key];
}
var _getValue = getValue$1;
var baseIsNative = _baseIsNative, getValue = _getValue;
function getNative$7(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : void 0;
}
var _getNative = getNative$7;
var getNative$6 = _getNative;
var defineProperty$1 = function() {
try {
var func = getNative$6(Object, "defineProperty");
func({}, "", {});
return func;
} catch (e) {
}
}();
var _defineProperty = defineProperty$1;
var defineProperty = _defineProperty;
function baseAssignValue$1(object, key, value) {
if (key == "__proto__" && defineProperty) {
defineProperty(object, key, {
"configurable": true,
"enumerable": true,
"value": value,
"writable": true
});
} else {
object[key] = value;
}
}
var _baseAssignValue = baseAssignValue$1;
function arrayAggregator$1(array, setter, iteratee, accumulator) {
var index = -1, length = array == null ? 0 : array.length;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
var _arrayAggregator = arrayAggregator$1;
function createBaseFor$1(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
var _createBaseFor = createBaseFor$1;
var createBaseFor = _createBaseFor;
var baseFor$1 = createBaseFor();
var _baseFor = baseFor$1;
function baseTimes$1(n, iteratee) {
var index = -1, result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
var _baseTimes = baseTimes$1;
function isObjectLike$5(value) {
return value != null && typeof value == "object";
}
var isObjectLike_1 = isObjectLike$5;
var baseGetTag$3 = _baseGetTag, isObjectLike$4 = isObjectLike_1;
var argsTag$2 = "[object Arguments]";
function baseIsArguments$1(value) {
return isObjectLike$4(value) && baseGetTag$3(value) == argsTag$2;
}
var _baseIsArguments = baseIsArguments$1;
var baseIsArguments = _baseIsArguments, isObjectLike$3 = isObjectLike_1;
var objectProto$8 = Object.prototype;
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
var propertyIsEnumerable$1 = objectProto$8.propertyIsEnumerable;
var isArguments$2 = baseIsArguments(/* @__PURE__ */ function() {
return arguments;
}()) ? baseIsArguments : function(value) {
return isObjectLike$3(value) && hasOwnProperty$6.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
};
var isArguments_1 = isArguments$2;
var isArray$9 = Array.isArray;
var isArray_1 = isArray$9;
var isBuffer$2 = { exports: {} };
function stubFalse() {
return false;
}
var stubFalse_1 = stubFalse;
isBuffer$2.exports;
(function(module, exports) {
var root2 = _root, stubFalse2 = stubFalse_1;
var freeExports = exports && !exports.nodeType && exports;
var freeModule = freeExports && true && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var Buffer = moduleExports ? root2.Buffer : void 0;
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
var isBuffer2 = nativeIsBuffer || stubFalse2;
module.exports = isBuffer2;
})(isBuffer$2, isBuffer$2.exports);
var isBufferExports = isBuffer$2.exports;
var MAX_SAFE_INTEGER$1 = 9007199254740991;
var reIsUint = /^(?:0|[1-9]\d*)$/;
function isIndex$2(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER$1 : length;
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
}
var _isIndex = isIndex$2;
var MAX_SAFE_INTEGER = 9007199254740991;
function isLength$3(value) {
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
var isLength_1 = isLength$3;
var baseGetTag$2 = _baseGetTag, isLength$2 = isLength_1, isObjectLike$2 = isObjectLike_1;
var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
function baseIsTypedArray$1(value) {
return isObjectLike$2(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$2(value)];
}
var _baseIsTypedArray = baseIsTypedArray$1;
function baseUnary$1(func) {
return function(value) {
return func(value);
};
}
var _baseUnary = baseUnary$1;
var _nodeUtil = { exports: {} };
_nodeUtil.exports;
(function(module, exports) {
var freeGlobal2 = _freeGlobal;
var freeExports = exports && !exports.nodeType && exports;
var freeModule = freeExports && true && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var freeProcess = moduleExports && freeGlobal2.process;
var nodeUtil2 = function() {
try {
var types = freeModule && freeModule.require && freeModule.require("util").types;
if (types) {
return types;
}
return freeProcess && freeProcess.binding && freeProcess.binding("util");
} catch (e) {
}
}();
module.exports = nodeUtil2;
})(_nodeUtil, _nodeUtil.exports);
var _nodeUtilExports = _nodeUtil.exports;
var baseIsTypedArray = _baseIsTypedArray, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
var isTypedArray_1 = isTypedArray$2;
var baseTimes = _baseTimes, isArguments$1 = isArguments_1, isArray$8 = isArray_1, isBuffer$1 = isBufferExports, isIndex$1 = _isIndex, isTypedArray$1 = isTypedArray_1;
var objectProto$7 = Object.prototype;
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
function arrayLikeKeys$1(value, inherited) {
var isArr = isArray$8(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty$5.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
isIndex$1(key, length)))) {
result.push(key);
}
}
return result;
}
var _arrayLikeKeys = arrayLikeKeys$1;
var objectProto$6 = Object.prototype;
function isPrototype$1(value) {
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$6;
return value === proto;
}
var _isPrototype = isPrototype$1;
function overArg$1(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
var _overArg = overArg$1;
var overArg = _overArg;
var nativeKeys$1 = overArg(Object.keys, Object);
var _nativeKeys = nativeKeys$1;
var isPrototype = _isPrototype, nativeKeys = _nativeKeys;
var objectProto$5 = Object.prototype;
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
function baseKeys$1(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty$4.call(object, key) && key != "constructor") {
result.push(key);
}
}
return result;
}
var _baseKeys = baseKeys$1;
var isFunction = isFunction_1, isLength$1 = isLength_1;
function isArrayLike$2(value) {
return value != null && isLength$1(value.length) && !isFunction(value);
}
var isArrayLike_1 = isArrayLike$2;
var arrayLikeKeys = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
function keys$3(object) {
return isArrayLike$1(object) ? arrayLikeKeys(object) : baseKeys(object);
}
var keys_1 = keys$3;
var baseFor = _baseFor, keys$2 = keys_1;
function baseForOwn$1(object, iteratee) {
return object && baseFor(object, iteratee, keys$2);
}
var _baseForOwn = baseForOwn$1;
var isArrayLike = isArrayLike_1;
function createBaseEach$1(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
while (fromRight ? index-- : ++index < length) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
var _createBaseEach = createBaseEach$1;
var baseForOwn = _baseForOwn, createBaseEach = _createBaseEach;
var baseEach$1 = createBaseEach(baseForOwn);
var _baseEach = baseEach$1;
var baseEach = _baseEach;
function baseAggregator$1(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection2) {
setter(accumulator, value, iteratee(value), collection2);
});
return accumulator;
}
var _baseAggregator = baseAggregator$1;
function listCacheClear$1() {
this.__data__ = [];
this.size = 0;
}
var _listCacheClear = listCacheClear$1;
function eq$2(value, other) {
return value === other || value !== value && other !== other;
}
var eq_1 = eq$2;
var eq$1 = eq_1;
function assocIndexOf$4(array, key) {
var length = array.length;
while (length--) {
if (eq$1(array[length][0], key)) {
return length;
}
}
return -1;
}
var _assocIndexOf = assocIndexOf$4;
var assocIndexOf$3 = _assocIndexOf;
var arrayProto = Array.prototype;
var splice = arrayProto.splice;
function listCacheDelete$1(key) {
var data = this.__data__, index = assocIndexOf$3(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
var _listCacheDelete = listCacheDelete$1;
var assocIndexOf$2 = _assocIndexOf;
function listCacheGet$1(key) {
var data = this.__data__, index = assocIndexOf$2(data, key);
return index < 0 ? void 0 : data[index][1];
}
var _listCacheGet = listCacheGet$1;
var assocIndexOf$1 = _assocIndexOf;
function listCacheHas$1(key) {
return assocIndexOf$1(this.__data__, key) > -1;
}
var _listCacheHas = listCacheHas$1;
var assocIndexOf = _assocIndexOf;
function listCacheSet$1(key, value) {
var data = this.__data__, index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
var _listCacheSet = listCacheSet$1;
var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
function ListCache$4(entries) {
var index = -1, length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
ListCache$4.prototype.clear = listCacheClear;
ListCache$4.prototype["delete"] = listCacheDelete;
ListCache$4.prototype.get = listCacheGet;
ListCache$4.prototype.has = listCacheHas;
ListCache$4.prototype.set = listCacheSet;
var _ListCache = ListCache$4;
var ListCache$3 = _ListCache;
function stackClear$1() {
this.__data__ = new ListCache$3();
this.size = 0;
}
var _stackClear = stackClear$1;
function stackDelete$1(key) {
var data = this.__data__, result = data["delete"](key);
this.size = data.size;
return result;
}
var _stackDelete = stackDelete$1;
function stackGet$1(key) {
return this.__data__.get(key);
}
var _stackGet = stackGet$1;
function stackHas$1(key) {
return this.__data__.has(key);
}
var _stackHas = stackHas$1;
var getNative$5 = _getNative, root$6 = _root;
var Map$4 = getNative$5(root$6, "Map");
var _Map = Map$4;
var getNative$4 = _getNative;
var nativeCreate$4 = getNative$4(Object, "create");
var _nativeCreate = nativeCreate$4;
var nativeCreate$3 = _nativeCreate;
function hashClear$1() {
this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
this.size = 0;
}
var _hashClear = hashClear$1;
function hashDelete$1(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
var _hashDelete = hashDelete$1;
var nativeCreate$2 = _nativeCreate;
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
var objectProto$4 = Object.prototype;
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
function hashGet$1(key) {
var data = this.__data__;
if (nativeCreate$2) {
var result = data[key];
return result === HASH_UNDEFINED$2 ? void 0 : result;
}
return hasOwnProperty$3.call(data, key) ? data[key] : void 0;
}
var _hashGet = hashGet$1;
var nativeCreate$1 = _nativeCreate;
var objectProto$3 = Object.prototype;
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
function hashHas$1(key) {
var data = this.__data__;
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$2.call(data, key);
}
var _hashHas = hashHas$1;
var nativeCreate = _nativeCreate;
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
function hashSet$1(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
return this;
}
var _hashSet = hashSet$1;
var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
function Hash$1(entries) {
var index = -1, length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
Hash$1.prototype.clear = hashClear;
Hash$1.prototype["delete"] = hashDelete;
Hash$1.prototype.get = hashGet;
Hash$1.prototype.has = hashHas;
Hash$1.prototype.set = hashSet;
var _Hash = Hash$1;
var Hash = _Hash, ListCache$2 = _ListCache, Map$3 = _Map;
function mapCacheClear$1() {
this.size = 0;
this.__data__ = {
"hash": new Hash(),
"map": new (Map$3 || ListCache$2)(),
"string": new Hash()
};
}
var _mapCacheClear = mapCacheClear$1;
function isKeyable$1(value) {
var type = typeof value;
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
}
var _isKeyable = isKeyable$1;
var isKeyable = _isKeyable;
function getMapData$4(map, key) {
var data = map.__data__;
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
}
var _getMapData = getMapData$4;
var getMapData$3 = _getMapData;
function mapCacheDelete$1(key) {
var result = getMapData$3(this, key)["delete"](key);
this.size -= result ? 1 : 0;
return result;
}
var _mapCacheDelete = mapCacheDelete$1;
var getMapData$2 = _getMapData;
function mapCacheGet$1(key) {
return getMapData$2(this, key).get(key);
}
var _mapCacheGet = mapCacheGet$1;
var getMapData$1 = _getMapData;
function mapCacheHas$1(key) {
return getMapData$1(this, key).has(key);
}
var _mapCacheHas = mapCacheHas$1;
var getMapData = _getMapData;
function mapCacheSet$1(key, value) {
var data = getMapData(this, key), size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
var _mapCacheSet = mapCacheSet$1;
var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
function MapCache$3(entries) {
var index = -1, length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
MapCache$3.prototype.clear = mapCacheClear;
MapCache$3.prototype["delete"] = mapCacheDelete;
MapCache$3.prototype.get = mapCacheGet;
MapCache$3.prototype.has = mapCacheHas;
MapCache$3.prototype.set = mapCacheSet;
var _MapCache = MapCache$3;
var ListCache$1 = _ListCache, Map$2 = _Map, MapCache$2 = _MapCache;
var LARGE_ARRAY_SIZE = 200;
function stackSet$1(key, value) {
var data = this.__data__;
if (data instanceof ListCache$1) {
var pairs = data.__data__;
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache$2(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
var _stackSet = stackSet$1;
var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
function Stack$2(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
Stack$2.prototype.clear = stackClear;
Stack$2.prototype["delete"] = stackDelete;
Stack$2.prototype.get = stackGet;
Stack$2.prototype.has = stackHas;
Stack$2.prototype.set = stackSet;
var _Stack = Stack$2;
var HASH_UNDEFINED = "__lodash_hash_undefined__";
function setCacheAdd$1(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
var _setCacheAdd = setCacheAdd$1;
function setCacheHas$1(value) {
return this.__data__.has(value);
}
var _setCacheHas = setCacheHas$1;
var MapCache$1 = _MapCache, setCacheAdd = _setCacheAdd, setCacheHas = _setCacheHas;
function SetCache$1(values) {
var index = -1, length = values == null ? 0 : values.length;
this.__data__ = new MapCache$1();
while (++index < length) {
this.add(values[index]);
}
}
SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
SetCache$1.prototype.has = setCacheHas;
var _SetCache = SetCache$1;
function arraySome$1(array, predicate) {
var index = -1, length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
var _arraySome = arraySome$1;
function cacheHas$1(cache, key) {
return cache.has(key);
}
var _cacheHas = cacheHas$1;
var SetCache = _SetCache, arraySome = _arraySome, cacheHas = _cacheHas;
var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
var arrStacked = stack.get(array);
var othStacked = stack.get(other);
if (arrStacked && othStacked) {
return arrStacked == other && othStacked == array;
}
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
stack.set(array, other);
stack.set(other, array);
while (++index < arrLength) {
var arrValue = array[index], othValue = other[index];
if (customizer) {
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== void 0) {
if (compared) {
continue;
}
result = false;
break;
}
if (seen) {
if (!arraySome(other, function(othValue2, othIndex) {
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
result = false;
break;
}
}
stack["delete"](array);
stack["delete"](other);
return result;
}
var _equalArrays = equalArrays$2;
var root$5 = _root;
var Uint8Array$1 = root$5.Uint8Array;
var _Uint8Array = Uint8Array$1;
function mapToArray$1(map) {
var index = -1, result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
var _mapToArray = mapToArray$1;
function setToArray$1(set) {
var index = -1, result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
var _setToArray = setToArray$1;
var Symbol$2 = _Symbol, Uint8Array = _Uint8Array, eq = eq_1, equalArrays$1 = _equalArrays, mapToArray = _mapToArray, setToArray = _setToArray;
var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag$1 = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", symbolTag$1 = "[object Symbol]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]";
var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : void 0;
function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag$1:
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
return object == other + "";
case mapTag$1:
var convert = mapToArray;
case setTag$1:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG$2;
stack.set(object, other);
var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack["delete"](object);
return result;
case symbolTag$1:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
var _equalByTag = equalByTag$1;
function arrayPush$1(array, values) {
var index = -1, length = values.length, offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
var _arrayPush = arrayPush$1;
var arrayPush = _arrayPush, isArray$7 = isArray_1;
function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray$7(object) ? result : arrayPush(result, symbolsFunc(object));
}
var _baseGetAllKeys = baseGetAllKeys$1;
function arrayFilter$1(array, predicate) {
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
var _arrayFilter = arrayFilter$1;
function stubArray$1() {
return [];
}
var stubArray_1 = stubArray$1;
var arrayFilter = _arrayFilter, stubArray = stubArray_1;
var objectProto$2 = Object.prototype;
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
var nativeGetSymbols = Object.getOwnPropertySymbols;
var getSymbols$1 = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
var _getSymbols = getSymbols$1;
var baseGetAllKeys = _baseGetAllKeys, getSymbols = _getSymbols, keys$1 = keys_1;
function getAllKeys$1(object) {
return baseGetAllKeys(object, keys$1, getSymbols);
}
var _getAllKeys = getAllKeys$1;
var getAllKeys = _getAllKeys;
var COMPARE_PARTIAL_FLAG$3 = 1;
var objectProto$1 = Object.prototype;
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
return false;
}
}
var objStacked = stack.get(object);
var othStacked = stack.get(other);
if (objStacked && othStacked) {
return objStacked == other && othStacked == object;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key], othValue = other[key];
if (customizer) {
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
}
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
result = false;
break;
}
skipCtor || (skipCtor = key == "constructor");
}
if (result && !skipCtor) {
var objCtor = object.constructor, othCtor = other.constructor;
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
result = false;
}
}
stack["delete"](object);
stack["delete"](other);
return result;
}
var _equalObjects = equalObjects$1;
var getNative$3 = _getNative, root$4 = _root;
var DataView$1 = getNative$3(root$4, "DataView");
var _DataView = DataView$1;
var getNative$2 = _getNative, root$3 = _root;
var Promise$2 = getNative$2(root$3, "Promise");
var _Promise = Promise$2;
var getNative$1 = _getNative, root$2 = _root;
var Set$2 = getNative$1(root$2, "Set");
var _Set = Set$2;
var getNative = _getNative, root$1 = _root;
var WeakMap$1 = getNative(root$1, "WeakMap");
var _WeakMap = WeakMap$1;
var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$1 = _Set, WeakMap = _WeakMap, baseGetTag$1 = _baseGetTag, toSource = _toSource;
var mapTag = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
var dataViewTag = "[object DataView]";
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap);
var getTag$1 = baseGetTag$1;
if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap && getTag$1(new WeakMap()) != weakMapTag) {
getTag$1 = function(value) {
var result = baseGetTag$1(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
var _getTag = getTag$1;
var Stack$1 = _Stack, equalArrays = _equalArrays, equalByTag = _equalByTag, equalObjects = _equalObjects, getTag = _getTag, isArray$6 = isArray_1, isBuffer = isBufferExports, isTypedArray = isTypedArray_1;
var COMPARE_PARTIAL_FLAG$2 = 1;
var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray$6(object), othIsArr = isArray$6(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack$1());
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack$1());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack$1());
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
var _baseIsEqualDeep = baseIsEqualDeep$1;
var baseIsEqualDeep = _baseIsEqualDeep, isObjectLike$1 = isObjectLike_1;
function baseIsEqual$2(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || !isObjectLike$1(value) && !isObjectLike$1(other)) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
}
var _baseIsEqual = baseIsEqual$2;
var Stack = _Stack, baseIsEqual$1 = _baseIsEqual;
var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
function baseIsMatch$1(object, source, matchData, customizer) {
var index = matchData.length, length = index, noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0], objValue = object[key], srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === void 0 && !(key in object)) {
return false;
}
} else {
var stack = new Stack();
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === void 0 ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
return false;
}
}
}
return true;
}
var _baseIsMatch = baseIsMatch$1;
var isObject$2 = isObject_1;
function isStrictComparable$2(value) {
return value === value && !isObject$2(value);
}
var _isStrictComparable = isStrictComparable$2;
var isStrictComparable$1 = _isStrictComparable, keys = keys_1;
function getMatchData$1(object) {
var result = keys(object), length = result.length;
while (length--) {
var key = result[length], value = object[key];
result[length] = [key, value, isStrictComparable$1(value)];
}
return result;
}
var _getMatchData = getMatchData$1;
function matchesStrictComparable$2(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
};
}
var _matchesStrictComparable = matchesStrictComparable$2;
var baseIsMatch = _baseIsMatch, getMatchData = _getMatchData, matchesStrictComparable$1 = _matchesStrictComparable;
function baseMatches$1(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
var _baseMatches = baseMatches$1;
var baseGetTag = _baseGetTag, isObjectLike = isObjectLike_1;
var symbolTag = "[object Symbol]";
function isSymbol$4(value) {
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
}
var isSymbol_1 = isSymbol$4;
var isArray$5 = isArray_1, isSymbol$3 = isSymbol_1;
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
function isKey$3(value, object) {
if (isArray$5(value)) {
return false;
}
var type = typeof value;
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol$3(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
}
var _isKey = isKey$3;
var MapCache = _MapCache;
var FUNC_ERROR_TEXT$1 = "Expected a function";
function memoize$1(func, resolver) {
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
throw new TypeError(FUNC_ERROR_TEXT$1);
}
var memoized = function() {
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize$1.Cache || MapCache)();
return memoized;
}
memoize$1.Cache = MapCache;
var memoize_1 = memoize$1;
var memoize = memoize_1;
var MAX_MEMOIZE_SIZE = 500;
function memoizeCapped$1(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
var _memoizeCapped = memoizeCapped$1;
var memoizeCapped = _memoizeCapped;
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var reEscapeChar = /\\(\\)?/g;
var stringToPath$1 = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46) {
result.push("");
}
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
});
return result;
});
var _stringToPath = stringToPath$1;
function arrayMap$1(array, iteratee) {
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
var _arrayMap = arrayMap$1;
var Symbol$1 = _Symbol, arrayMap = _arrayMap, isArray$4 = isArray_1, isSymbol$2 = isSymbol_1;
var INFINITY$1 = 1 / 0;
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
function baseToString$1(value) {
if (typeof value == "string") {
return value;
}
if (isArray$4(value)) {
return arrayMap(value, baseToString$1) + "";
}
if (isSymbol$2(value)) {
return symbolToString ? symbolToString.call(value) : "";
}
var result = value + "";
return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
}
var _baseToString = baseToString$1;
var baseToString = _baseToString;
function toString$1(value) {
return value == null ? "" : baseToString(value);
}
var toString_1 = toString$1;
var isArray$3 = isArray_1, isKey$2 = _isKey, stringToPath = _stringToPath, toString = toString_1;
function castPath$2(value, object) {
if (isArray$3(value)) {
return value;
}
return isKey$2(value, object) ? [value] : stringToPath(toString(value));
}
var _castPath = castPath$2;
var isSymbol$1 = isSymbol_1;
var INFINITY = 1 / 0;
function toKey$4(value) {
if (typeof value == "string" || isSymbol$1(value)) {
return value;
}
var result = value + "";
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
}
var _toKey = toKey$4;
var castPath$1 = _castPath, toKey$3 = _toKey;
function baseGet$2(object, path) {
path = castPath$1(path, object);
var index = 0, length = path.length;
while (object != null && index < length) {
object = object[toKey$3(path[index++])];
}
return index && index == length ? object : void 0;
}
var _baseGet = baseGet$2;
var baseGet$1 = _baseGet;
function get$1(object, path, defaultValue) {
var result = object == null ? void 0 : baseGet$1(object, path);
return result === void 0 ? defaultValue : result;
}
var get_1 = get$1;
function baseHasIn$1(object, key) {
return object != null && key in Object(object);
}
var _baseHasIn = baseHasIn$1;
var castPath = _castPath, isArguments = isArguments_1, isArray$2 = isArray_1, isIndex = _isIndex, isLength = isLength_1, toKey$2 = _toKey;
function hasPath$1(object, path, hasFunc) {
path = castPath(path, object);
var index = -1, length = path.length, result = false;
while (++index < length) {
var key = toKey$2(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && (isArray$2(object) || isArguments(object));
}
var _hasPath = hasPath$1;
var baseHasIn = _baseHasIn, hasPath = _hasPath;
function hasIn$1(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
var hasIn_1 = hasIn$1;
var baseIsEqual = _baseIsEqual, get = get_1, hasIn = hasIn_1, isKey$1 = _isKey, isStrictComparable = _isStrictComparable, matchesStrictComparable = _matchesStrictComparable, toKey$1 = _toKey;
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
function baseMatchesProperty$1(path, srcValue) {
if (isKey$1(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey$1(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
var _baseMatchesProperty = baseMatchesProperty$1;
function identity$1(value) {
return value;
}
var identity_1 = identity$1;
function baseProperty$1(key) {
return function(object) {
return object == null ? void 0 : object[key];
};
}
var _baseProperty = baseProperty$1;
var baseGet = _baseGet;
function basePropertyDeep$1(path) {
return function(object) {
return baseGet(object, path);
};
}
var _basePropertyDeep = basePropertyDeep$1;
var baseProperty = _baseProperty, basePropertyDeep = _basePropertyDeep, isKey = _isKey, toKey = _toKey;
function property$1(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
var property_1 = property$1;
var baseMatches = _baseMatches, baseMatchesProperty = _baseMatchesProperty, identity = identity_1, isArray$1 = isArray_1, property = property_1;
function baseIteratee$1(value) {
if (typeof value == "function") {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == "object") {
return isArray$1(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
}
return property(value);
}
var _baseIteratee = baseIteratee$1;
var arrayAggregator = _arrayAggregator, baseAggregator = _baseAggregator, baseIteratee = _baseIteratee, isArray = isArray_1;
function createAggregator$1(setter, initializer) {
return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
return func(collection, setter, baseIteratee(iteratee), accumulator);
};
}
var _createAggregator = createAggregator$1;
var baseAssignValue = _baseAssignValue, createAggregator = _createAggregator;
var keyBy = createAggregator(function(result, value, key) {
baseAssignValue(result, key, value);
});
var keyBy_1 = keyBy;
const keyBy$1 = /* @__PURE__ */ getDefaultExportFromCjs(keyBy_1);
const currentBBSConfig = {
id: 0,
total: 0,
isAsc: true,
replies: {}
};
function addMyLink(userData) {
var _a;
if (!document.getElementById("my-bbs-link") && _window.location.pathname === "/bbs" && userData) {
const myBbs = document.createElement("a");
myBbs.innerText = "我的贴子";
myBbs.id = "my-bbs-link";
myBbs.href = `/bbs#/user/${userData.id}`;
myBbs.target = "_blank";
(_a = document.querySelector(".list-header")) == null ? void 0 : _a.appendChild(myBbs);
}
}
function postProcessBBSReplies(data) {
setTimeout(() => {
var _a;
const threadContainer = document.getElementById("thread-container");
if (threadContainer && _window.location.pathname.startsWith("/bbs")) {
const bbsId = parseInt(_window.location.href.replace(/^.*?jandan.net\/bbs#\/topic\/(\d+)$/, "$1"));
if (bbsId !== currentBBSConfig.id) {
currentBBSConfig.replies = {};
}
currentBBSConfig.id = bbsId;
if (data) {
currentBBSConfig.total = data.response.total;
currentBBSConfig.isAsc = data.isAsc;
Object.assign(currentBBSConfig.replies, keyBy$1(data.response.list, "reply_id"));
}
const currentPage = parseInt(((_a = threadContainer.querySelector(".page-nav li button.active")) == null ? void 0 : _a.innerHTML) || "");
if (currentPage > 0) {
const refPages = /* @__PURE__ */ new Set();
threadContainer.querySelectorAll(".reply-container > div").forEach((reply, index) => {
var _a2, _b;
const actualFloor = (currentPage - 1) * 40 + index + 1;
reply.querySelector(".floor-number").innerText = `${currentBBSConfig.isAsc ? actualFloor : currentBBSConfig.total - actualFloor + 1}楼`;
if (!reply.querySelector(".topic-function .reply-button")) {
const replyBtn = document.createElement("span");
replyBtn.classList.add("reply-button");
replyBtn.style.cursor = "pointer";
replyBtn.innerText = "回复";
replyBtn.onclick = function() {
var _a3, _b2, _c;
const headEl = this.parentElement.parentElement.querySelector(".topic-author");
const replyName = (_a3 = headEl == null ? void 0 : headEl.querySelector("b")) == null ? void 0 : _a3.innerHTML;
const floorNum = (_b2 = headEl == null ? void 0 : headEl.querySelector(".floor-number")) == null ? void 0 : _b2.innerHTML.replace(/^(\d+).*?$/, "$1");
const textarea = document.querySelector("#thread-container .thread-form textarea");
textarea.value += `${textarea.value ? "\n\n" : ""}@${replyName} ${(_c = this.nextElementSibling) == null ? void 0 : _c.innerHTML}(${floorNum}楼) `;
textarea.scrollIntoView();
textarea.focus();
};
(_a2 = reply.querySelector(".topic-function")) == null ? void 0 : _a2.prepend(" / ");
(_b = reply.querySelector(".topic-function")) == null ? void 0 : _b.prepend(replyBtn);
}
const replyContentEl = reply.querySelector(".topic-content");
replyContentEl.innerHTML = replyContentEl.innerHTML.replaceAll(/(^|<br>)(@.*?\s+#(\d+)\((\d+)楼\))/g, (_, _1, _2, _3, _4) => {
const reply_id = _3;
const floor = +_4;
const page = Math.ceil((currentBBSConfig.isAsc ? floor : currentBBSConfig.total - floor + 1) / 40);
if (!currentBBSConfig.replies[reply_id]) {
refPages.add(page);
}
return `${_1}<span class='jandan-record-reply-ref'>${_2}</span>`;
});
});
refPages.forEach((page) => _window.axios.get(`/api/forum/replies/${currentBBSConfig.id}?order=${currentBBSConfig.isAsc ? "asc" : "desc"}&page=${page}`).then());
}
}
}, 500);
}
function tooltipListener(event) {
var _a;
let tooltip = document.getElementById("jandan-record-reply-tooltip");
const target = event.target;
if ((_a = target.classList) == null ? void 0 : _a.contains("jandan-record-reply-ref")) {
if (!tooltip) {
tooltip = document.createElement("div");
tooltip.id = "jandan-record-reply-tooltip";
document.body.appendChild(tooltip);
}
if (tooltip.style.display == "block") return;
const reply_id = parseInt(target.innerText.replace(/^.*?\s+#(\d+)\(\d+楼\)$/, "$1"));
const corresponding = currentBBSConfig.replies[reply_id];
tooltip.innerHTML = corresponding ? corresponding.content : "loading...";
const rect = target.getBoundingClientRect();
tooltip.style.display = "block";
tooltip.style.left = `${rect.left}px`;
tooltip.style.top = `${rect.top - tooltip.offsetHeight}px`;
} else if (target.id === "jandan-record-reply-tooltip") ;
else if (tooltip) {
tooltip.style.display = "none";
}
}
function initBBSReplyTooltipListener() {
document.addEventListener("mousemove", tooltipListener);
document.addEventListener("click", tooltipListener);
}
const addRGB = (nickname) => {
getAllNickNameEl().forEach((el) => {
if (el.innerText == nickname) {
el.classList.add("jandan-record-rainbow-text");
} else {
el.classList.remove("jandan-record-rainbow-text");
}
});
};
const rmRGB = () => {
getAllNickNameEl().forEach((el) => {
el.classList.remove("jandan-record-rainbow-text");
});
};
const getAllNickNameEl = () => {
const result = [];
const url = _window.location.pathname.replace(/^(\/[^/]+).*?$/, "$1");
switch (url) {
case "/treehole":
case "/qa":
case "/ooxx":
case "/pic":
case "/top":
case "/t":
result.push(...document.querySelectorAll(".row >.author >strong[title]"));
result.push(...document.querySelectorAll(".tucao-author >span:first-of-type"));
result.push(...document.querySelectorAll("#comments .comment-topic >b:first-of-type"));
result.push(...document.querySelectorAll(".commentlist >li[id] > b:first-of-type"));
break;
case "/dzh":
result.push(...document.querySelectorAll(".tucao-author-bar .tucao-author"));
break;
case "/bbs":
result.push(...document.querySelectorAll(".topic-author .author-link"));
result.push(...document.querySelectorAll(".thread-info .author-link,.reply .topic-author >b"));
break;
case "/p":
result.push(...document.querySelectorAll(".reply-container .jdcomment-author >b"));
break;
}
return result;
};
var root = _root;
var now$1 = function() {
return root.Date.now();
};
var now_1 = now$1;
var reWhitespace = /\s/;
function trimmedEndIndex$1(string) {
var index = string.length;
while (index-- && reWhitespace.test(string.charAt(index))) {
}
return index;
}
var _trimmedEndIndex = trimmedEndIndex$1;
var trimmedEndIndex = _trimmedEndIndex;
var reTrimStart = /^\s+/;
function baseTrim$1(string) {
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
}
var _baseTrim = baseTrim$1;
var baseTrim = _baseTrim, isObject$1 = isObject_1, isSymbol = isSymbol_1;
var NAN = 0 / 0;
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary = /^0b[01]+$/i;
var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
function toNumber$1(value) {
if (typeof value == "number") {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject$1(value)) {
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
value = isObject$1(other) ? other + "" : other;
}
if (typeof value != "string") {
return value === 0 ? value : +value;
}
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
var toNumber_1 = toNumber$1;
var isObject = isObject_1, now = now_1, toNumber = toNumber_1;
var FUNC_ERROR_TEXT = "Expected a function";
var nativeMax = Math.max, nativeMin = Math.min;
function debounce(func, wait, options) {
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = "maxWait" in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = "trailing" in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs, thisArg = lastThis;
lastArgs = lastThis = void 0;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
lastInvokeTime = time;
timerId = setTimeout(timerExpired, wait);
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = void 0;
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = void 0;
return result;
}
function cancel() {
if (timerId !== void 0) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = void 0;
}
function flush() {
return timerId === void 0 ? result : trailingEdge(now());
}
function debounced() {
var time = now(), isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === void 0) {
return leadingEdge(lastCallTime);
}
if (maxing) {
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === void 0) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
var debounce_1 = debounce;
const debounce$1 = /* @__PURE__ */ getDefaultExportFromCjs(debounce_1);
function processResponse(url, requestData, res) {
let item = null;
const now2 = Date.now();
switch (url) {
case "/jandan-comment.php":
case "/api/comment/create":
item = {
url: `/t/${res}`,
urlWithAnchor: `/t/${res}`,
isCreate: true,
content: requestData.comment,
timestamp: now2,
lastCheck404: now2
};
break;
case "/api/tucao/create":
if (res.msg == "success") {
const isPost = _window.location.pathname.startsWith("/p/");
item = {
url: isPost ? `/p/${requestData.comment_post_ID}` : `/t/${requestData.comment_id}`,
urlWithAnchor: isPost ? `/p/${requestData.comment_post_ID}` : `/t/${requestData.comment_id}#tucao-${res.data.comment_ID}`,
isCreate: false,
content: requestData.content,
timestamp: now2,
lastCheck404: now2
};
}
break;
case "/api/forum/replies":
if (res.msg == "success") {
item = {
url: `/bbs#/topic/${requestData.post_id}`,
urlWithAnchor: `/bbs#/topic/${requestData.post_id}`,
isCreate: false,
content: requestData.content,
timestamp: now2,
lastCheck404: now2
};
}
break;
}
item && emitter.emit(PushRecordEvent, item);
}
function parseRequestData(requestData) {
let result = requestData;
const parsedObj = {};
if (typeof requestData == "string") {
try {
return JSON.parse(requestData);
} catch {
for (const [key, value] of new URLSearchParams(requestData)) {
parsedObj[key] = value;
}
result = parsedObj;
}
} else if (requestData instanceof FormData) {
requestData.forEach(function(value, key) {
parsedObj[key] = value;
});
result = parsedObj;
}
return result;
}
function initHttpInterception(enableBBSReply = false) {
if ($) {
$(document).on("ajaxSuccess", function(_event, _jqXHR, settings, data) {
try {
emitter.emit(AjaxSuccessEvent);
const url = settings.url;
if (InterceptUrls.includes(url)) {
processResponse(url, parseRequestData(settings.data), data);
}
} catch {
}
});
}
if (_window.axios) {
_window.axios.interceptors.response.use((response) => {
try {
emitter.emit(AjaxSuccessEvent);
processResponse(response.config.url, parseRequestData(response.config.data), response.data);
if (enableBBSReply && /^\/api\/forum\/replies\/\d+/.test(response.config.url)) {
postProcessBBSReplies({
response: response.data.data,
isAsc: response.config.url.includes("order=asc")
});
}
} catch {
}
return response;
});
}
}
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "App",
setup(__props) {
const settings = vue.reactive({
...DefaultSettings,
...JSON.parse(localStorage.getItem(SettingsStorageKey) || "{}")
});
const userData = vue.reactive({});
vue.provide("settings", settings);
vue.provide("inSetting", vue.ref(false));
vue.provide("userData", userData);
const documentMutation = debounce$1(() => {
addMyLink(userData);
if (settings[SettingsKeyRGBName]) {
setTimeout(() => {
addRGB(userData.nickname);
});
}
}, 200);
vue.watch(settings, ({ [SettingsKeyRGBName]: rgbEnabled }) => {
if (!rgbEnabled) {
rmRGB();
} else {
addRGB(userData.nickname);
}
});
vue.onMounted(() => {
fetch("/api/member/get_info").then((res) => {
if (res.ok) {
res.json().then((res2) => {
var _a;
if ((_a = res2.data) == null ? void 0 : _a.id) {
Object.assign(userData, res2.data);
}
});
}
});
emitter.on(AjaxSuccessEvent, documentMutation);
const observer = new MutationObserver(documentMutation);
observer.observe(document.body, { childList: true, subtree: true });
documentMutation();
initHttpInterception(settings[SettingsKeyBBSReply]);
if (settings[SettingsKeyBBSReply]) {
initBBSReplyTooltipListener();
postProcessBBSReplies();
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(_sfc_main$1);
};
}
});
vue.createApp(_sfc_main).mount(
(() => {
const app = document.createElement("div");
document.body.append(app);
return app;
})()
);
const memberLink = document.querySelector('a[href="/member"]');
const myPost = document.createElement("a");
myPost.classList.add("nav-link", "jandan-record-link");
myPost.innerText = "我的吐槽";
myPost.onclick = () => {
emitter.emit(ShowModalEvent);
};
memberLink.parentElement.appendChild(myPost);
console.log("煎蛋吐槽记录器加载成功!");
})(Vue);