V2Next-Mobile

V2Next - 一个好用的V2EX脚本! 移动端专用

当前为 2024-02-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name V2Next-Mobile
  3. // @namespace http://tampermonkey.net/
  4. // @version 8.0.9
  5. // @author zyronon
  6. // @description V2Next - 一个好用的V2EX脚本! 移动端专用
  7. // @license GPL License
  8. // @icon https://v2next.netlify.app/favicon.ico
  9. // @homepage https://github.com/zyronon/web-scripts
  10. // @homepageURL https://github.com/zyronon/web-scripts
  11. // @supportURL https://update.greasyfork.org/scripts/485356/V2Next-Mobile.user.js
  12. // @match https://v2ex.com/
  13. // @match https://v2ex.com/?tab=*
  14. // @match https://v2ex.com/t/*
  15. // @match https://v2ex.com/recent*
  16. // @match https://v2ex.com/go/*
  17. // @match https://v2ex.com/member/*
  18. // @match https://v2ex.com/changes*
  19. // @match https://*.v2ex.com/
  20. // @match https://*.v2ex.com/?tab=*
  21. // @match https://*.v2ex.com/t/*
  22. // @match https://*.v2ex.com/recent*
  23. // @match https://*.v2ex.com/go/*
  24. // @match https://*.v2ex.com/member/*
  25. // @match https://*.v2ex.com/changes*
  26. // @require http://code.jquery.com/jquery-3.7.1.min.js
  27. // @require https://cdn.jsdelivr.net/npm/vue@3.4.14/dist/vue.global.prod.js
  28. // @grant GM_addStyle
  29. // @grant GM_notification
  30. // @grant GM_openInTab
  31. // @grant GM_registerMenuCommand
  32. // ==/UserScript==
  33.  
  34.  
  35. (function (vue) {
  36. 'use strict';
  37.  
  38. var PageType = /* @__PURE__ */ ((PageType2) => {
  39. PageType2["Home"] = "Home";
  40. PageType2["Node"] = "Node";
  41. PageType2["Post"] = "Post";
  42. PageType2["Member"] = "Member";
  43. PageType2["Changes"] = "Changes";
  44. return PageType2;
  45. })(PageType || {});
  46. var CommentDisplayType = /* @__PURE__ */ ((CommentDisplayType2) => {
  47. CommentDisplayType2[CommentDisplayType2["FloorInFloor"] = 0] = "FloorInFloor";
  48. CommentDisplayType2[CommentDisplayType2["FloorInFloorNoCallUser"] = 4] = "FloorInFloorNoCallUser";
  49. CommentDisplayType2[CommentDisplayType2["FloorInFloorNested"] = 5] = "FloorInFloorNested";
  50. CommentDisplayType2[CommentDisplayType2["Like"] = 1] = "Like";
  51. CommentDisplayType2[CommentDisplayType2["V2exOrigin"] = 2] = "V2exOrigin";
  52. CommentDisplayType2[CommentDisplayType2["OnlyOp"] = 3] = "OnlyOp";
  53. CommentDisplayType2[CommentDisplayType2["New"] = 6] = "New";
  54. return CommentDisplayType2;
  55. })(CommentDisplayType || {});
  56. const MAX_REPLY_LIMIT = 400;
  57. const _sfc_main$r = {
  58. name: "Tooltip",
  59. props: {
  60. title: {
  61. type: String,
  62. default() {
  63. return "";
  64. }
  65. },
  66. disabled: {
  67. type: Boolean,
  68. default() {
  69. return false;
  70. }
  71. }
  72. },
  73. data() {
  74. return {
  75. show: false
  76. };
  77. },
  78. methods: {
  79. showPop(e2) {
  80. if (this.disabled)
  81. return;
  82. if (!this.title)
  83. return;
  84. e2.stopPropagation();
  85. let rect = e2.target.getBoundingClientRect();
  86. this.show = true;
  87. vue.nextTick(() => {
  88. var _a, _b;
  89. let tip = (_b = (_a = this.$refs) == null ? void 0 : _a.tip) == null ? void 0 : _b.getBoundingClientRect();
  90. if (!tip)
  91. return;
  92. if (rect.top < 50) {
  93. this.$refs.tip.style.top = rect.top + rect.height + 10 + "px";
  94. } else {
  95. this.$refs.tip.style.top = rect.top - tip.height - 10 + "px";
  96. }
  97. let tipWidth = tip.width;
  98. let rectWidth = rect.width;
  99. this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + "px";
  100. });
  101. }
  102. },
  103. render() {
  104. let Vnode = this.$slots.default()[0];
  105. return vue.createVNode(vue.Fragment, null, [this.show && this.title && vue.createVNode(vue.Teleport, {
  106. "to": "body"
  107. }, {
  108. default: () => [vue.createVNode(vue.Transition, {
  109. "name": "fade"
  110. }, {
  111. default: () => [vue.createVNode("div", {
  112. "ref": "tip",
  113. "className": "tip"
  114. }, [this.title])]
  115. })]
  116. }), vue.createVNode(Vnode, {
  117. "onClick": () => this.show = false,
  118. "onmouseenter": (e2) => this.showPop(e2),
  119. "onmouseleave": () => this.show = false
  120. }, null)]);
  121. }
  122. };
  123. const _export_sfc = (sfc, props) => {
  124. const target = sfc.__vccOpts || sfc;
  125. for (const [key, val] of props) {
  126. target[key] = val;
  127. }
  128. return target;
  129. };
  130. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-ee672411"]]);
  131. const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
  132. __name: "BaseSwitch",
  133. props: {
  134. modelValue: { type: Boolean }
  135. },
  136. emits: ["update:modelValue"],
  137. setup(__props, { emit: __emit }) {
  138. return (_ctx, _cache) => {
  139. return vue.openBlock(), vue.createElementBlock("div", {
  140. class: vue.normalizeClass(["switch", { active: _ctx.modelValue }]),
  141. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  142. }, null, 2);
  143. };
  144. }
  145. });
  146. const BaseSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-e7c0fbef"]]);
  147. const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
  148. const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
  149. const colonSeparated = value.split(":");
  150. if (value.slice(0, 1) === "@") {
  151. if (colonSeparated.length < 2 || colonSeparated.length > 3) {
  152. return null;
  153. }
  154. provider = colonSeparated.shift().slice(1);
  155. }
  156. if (colonSeparated.length > 3 || !colonSeparated.length) {
  157. return null;
  158. }
  159. if (colonSeparated.length > 1) {
  160. const name2 = colonSeparated.pop();
  161. const prefix = colonSeparated.pop();
  162. const result = {
  163. // Allow provider without '@': "provider:prefix:name"
  164. provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
  165. prefix,
  166. name: name2
  167. };
  168. return validate && !validateIconName(result) ? null : result;
  169. }
  170. const name = colonSeparated[0];
  171. const dashSeparated = name.split("-");
  172. if (dashSeparated.length > 1) {
  173. const result = {
  174. provider,
  175. prefix: dashSeparated.shift(),
  176. name: dashSeparated.join("-")
  177. };
  178. return validate && !validateIconName(result) ? null : result;
  179. }
  180. if (allowSimpleName && provider === "") {
  181. const result = {
  182. provider,
  183. prefix: "",
  184. name
  185. };
  186. return validate && !validateIconName(result, allowSimpleName) ? null : result;
  187. }
  188. return null;
  189. };
  190. const validateIconName = (icon, allowSimpleName) => {
  191. if (!icon) {
  192. return false;
  193. }
  194. return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
  195. };
  196. const defaultIconDimensions = Object.freeze(
  197. {
  198. left: 0,
  199. top: 0,
  200. width: 16,
  201. height: 16
  202. }
  203. );
  204. const defaultIconTransformations = Object.freeze({
  205. rotate: 0,
  206. vFlip: false,
  207. hFlip: false
  208. });
  209. const defaultIconProps = Object.freeze({
  210. ...defaultIconDimensions,
  211. ...defaultIconTransformations
  212. });
  213. const defaultExtendedIconProps = Object.freeze({
  214. ...defaultIconProps,
  215. body: "",
  216. hidden: false
  217. });
  218. function mergeIconTransformations(obj1, obj2) {
  219. const result = {};
  220. if (!obj1.hFlip !== !obj2.hFlip) {
  221. result.hFlip = true;
  222. }
  223. if (!obj1.vFlip !== !obj2.vFlip) {
  224. result.vFlip = true;
  225. }
  226. const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
  227. if (rotate) {
  228. result.rotate = rotate;
  229. }
  230. return result;
  231. }
  232. function mergeIconData(parent, child) {
  233. const result = mergeIconTransformations(parent, child);
  234. for (const key in defaultExtendedIconProps) {
  235. if (key in defaultIconTransformations) {
  236. if (key in parent && !(key in result)) {
  237. result[key] = defaultIconTransformations[key];
  238. }
  239. } else if (key in child) {
  240. result[key] = child[key];
  241. } else if (key in parent) {
  242. result[key] = parent[key];
  243. }
  244. }
  245. return result;
  246. }
  247. function getIconsTree(data, names) {
  248. const icons = data.icons;
  249. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  250. const resolved = /* @__PURE__ */ Object.create(null);
  251. function resolve(name) {
  252. if (icons[name]) {
  253. return resolved[name] = [];
  254. }
  255. if (!(name in resolved)) {
  256. resolved[name] = null;
  257. const parent = aliases[name] && aliases[name].parent;
  258. const value = parent && resolve(parent);
  259. if (value) {
  260. resolved[name] = [parent].concat(value);
  261. }
  262. }
  263. return resolved[name];
  264. }
  265. (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
  266. return resolved;
  267. }
  268. function internalGetIconData(data, name, tree) {
  269. const icons = data.icons;
  270. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  271. let currentProps = {};
  272. function parse(name2) {
  273. currentProps = mergeIconData(
  274. icons[name2] || aliases[name2],
  275. currentProps
  276. );
  277. }
  278. parse(name);
  279. tree.forEach(parse);
  280. return mergeIconData(data, currentProps);
  281. }
  282. function parseIconSet(data, callback) {
  283. const names = [];
  284. if (typeof data !== "object" || typeof data.icons !== "object") {
  285. return names;
  286. }
  287. if (data.not_found instanceof Array) {
  288. data.not_found.forEach((name) => {
  289. callback(name, null);
  290. names.push(name);
  291. });
  292. }
  293. const tree = getIconsTree(data);
  294. for (const name in tree) {
  295. const item = tree[name];
  296. if (item) {
  297. callback(name, internalGetIconData(data, name, item));
  298. names.push(name);
  299. }
  300. }
  301. return names;
  302. }
  303. const optionalPropertyDefaults = {
  304. provider: "",
  305. aliases: {},
  306. not_found: {},
  307. ...defaultIconDimensions
  308. };
  309. function checkOptionalProps(item, defaults) {
  310. for (const prop in defaults) {
  311. if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
  312. return false;
  313. }
  314. }
  315. return true;
  316. }
  317. function quicklyValidateIconSet(obj) {
  318. if (typeof obj !== "object" || obj === null) {
  319. return null;
  320. }
  321. const data = obj;
  322. if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
  323. return null;
  324. }
  325. if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
  326. return null;
  327. }
  328. const icons = data.icons;
  329. for (const name in icons) {
  330. const icon = icons[name];
  331. if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
  332. icon,
  333. defaultExtendedIconProps
  334. )) {
  335. return null;
  336. }
  337. }
  338. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  339. for (const name in aliases) {
  340. const icon = aliases[name];
  341. const parent = icon.parent;
  342. if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
  343. icon,
  344. defaultExtendedIconProps
  345. )) {
  346. return null;
  347. }
  348. }
  349. return data;
  350. }
  351. const dataStorage = /* @__PURE__ */ Object.create(null);
  352. function newStorage(provider, prefix) {
  353. return {
  354. provider,
  355. prefix,
  356. icons: /* @__PURE__ */ Object.create(null),
  357. missing: /* @__PURE__ */ new Set()
  358. };
  359. }
  360. function getStorage(provider, prefix) {
  361. const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
  362. return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
  363. }
  364. function addIconSet(storage2, data) {
  365. if (!quicklyValidateIconSet(data)) {
  366. return [];
  367. }
  368. return parseIconSet(data, (name, icon) => {
  369. if (icon) {
  370. storage2.icons[name] = icon;
  371. } else {
  372. storage2.missing.add(name);
  373. }
  374. });
  375. }
  376. function addIconToStorage(storage2, name, icon) {
  377. try {
  378. if (typeof icon.body === "string") {
  379. storage2.icons[name] = { ...icon };
  380. return true;
  381. }
  382. } catch (err) {
  383. }
  384. return false;
  385. }
  386. let simpleNames = false;
  387. function allowSimpleNames(allow) {
  388. if (typeof allow === "boolean") {
  389. simpleNames = allow;
  390. }
  391. return simpleNames;
  392. }
  393. function getIconData(name) {
  394. const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
  395. if (icon) {
  396. const storage2 = getStorage(icon.provider, icon.prefix);
  397. const iconName = icon.name;
  398. return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
  399. }
  400. }
  401. function addIcon(name, data) {
  402. const icon = stringToIcon(name, true, simpleNames);
  403. if (!icon) {
  404. return false;
  405. }
  406. const storage2 = getStorage(icon.provider, icon.prefix);
  407. return addIconToStorage(storage2, icon.name, data);
  408. }
  409. function addCollection(data, provider) {
  410. if (typeof data !== "object") {
  411. return false;
  412. }
  413. if (typeof provider !== "string") {
  414. provider = data.provider || "";
  415. }
  416. if (simpleNames && !provider && !data.prefix) {
  417. let added = false;
  418. if (quicklyValidateIconSet(data)) {
  419. data.prefix = "";
  420. parseIconSet(data, (name, icon) => {
  421. if (icon && addIcon(name, icon)) {
  422. added = true;
  423. }
  424. });
  425. }
  426. return added;
  427. }
  428. const prefix = data.prefix;
  429. if (!validateIconName({
  430. provider,
  431. prefix,
  432. name: "a"
  433. })) {
  434. return false;
  435. }
  436. const storage2 = getStorage(provider, prefix);
  437. return !!addIconSet(storage2, data);
  438. }
  439. const defaultIconSizeCustomisations = Object.freeze({
  440. width: null,
  441. height: null
  442. });
  443. const defaultIconCustomisations = Object.freeze({
  444. // Dimensions
  445. ...defaultIconSizeCustomisations,
  446. // Transformations
  447. ...defaultIconTransformations
  448. });
  449. const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
  450. const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
  451. function calculateSize(size, ratio, precision) {
  452. if (ratio === 1) {
  453. return size;
  454. }
  455. precision = precision || 100;
  456. if (typeof size === "number") {
  457. return Math.ceil(size * ratio * precision) / precision;
  458. }
  459. if (typeof size !== "string") {
  460. return size;
  461. }
  462. const oldParts = size.split(unitsSplit);
  463. if (oldParts === null || !oldParts.length) {
  464. return size;
  465. }
  466. const newParts = [];
  467. let code = oldParts.shift();
  468. let isNumber = unitsTest.test(code);
  469. while (true) {
  470. if (isNumber) {
  471. const num = parseFloat(code);
  472. if (isNaN(num)) {
  473. newParts.push(code);
  474. } else {
  475. newParts.push(Math.ceil(num * ratio * precision) / precision);
  476. }
  477. } else {
  478. newParts.push(code);
  479. }
  480. code = oldParts.shift();
  481. if (code === void 0) {
  482. return newParts.join("");
  483. }
  484. isNumber = !isNumber;
  485. }
  486. }
  487. const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
  488. function iconToSVG(icon, customisations) {
  489. const fullIcon = {
  490. ...defaultIconProps,
  491. ...icon
  492. };
  493. const fullCustomisations = {
  494. ...defaultIconCustomisations,
  495. ...customisations
  496. };
  497. const box = {
  498. left: fullIcon.left,
  499. top: fullIcon.top,
  500. width: fullIcon.width,
  501. height: fullIcon.height
  502. };
  503. let body = fullIcon.body;
  504. [fullIcon, fullCustomisations].forEach((props) => {
  505. const transformations = [];
  506. const hFlip = props.hFlip;
  507. const vFlip = props.vFlip;
  508. let rotation = props.rotate;
  509. if (hFlip) {
  510. if (vFlip) {
  511. rotation += 2;
  512. } else {
  513. transformations.push(
  514. "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
  515. );
  516. transformations.push("scale(-1 1)");
  517. box.top = box.left = 0;
  518. }
  519. } else if (vFlip) {
  520. transformations.push(
  521. "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
  522. );
  523. transformations.push("scale(1 -1)");
  524. box.top = box.left = 0;
  525. }
  526. let tempValue;
  527. if (rotation < 0) {
  528. rotation -= Math.floor(rotation / 4) * 4;
  529. }
  530. rotation = rotation % 4;
  531. switch (rotation) {
  532. case 1:
  533. tempValue = box.height / 2 + box.top;
  534. transformations.unshift(
  535. "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  536. );
  537. break;
  538. case 2:
  539. transformations.unshift(
  540. "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
  541. );
  542. break;
  543. case 3:
  544. tempValue = box.width / 2 + box.left;
  545. transformations.unshift(
  546. "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  547. );
  548. break;
  549. }
  550. if (rotation % 2 === 1) {
  551. if (box.left !== box.top) {
  552. tempValue = box.left;
  553. box.left = box.top;
  554. box.top = tempValue;
  555. }
  556. if (box.width !== box.height) {
  557. tempValue = box.width;
  558. box.width = box.height;
  559. box.height = tempValue;
  560. }
  561. }
  562. if (transformations.length) {
  563. body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
  564. }
  565. });
  566. const customisationsWidth = fullCustomisations.width;
  567. const customisationsHeight = fullCustomisations.height;
  568. const boxWidth = box.width;
  569. const boxHeight = box.height;
  570. let width;
  571. let height;
  572. if (customisationsWidth === null) {
  573. height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  574. width = calculateSize(height, boxWidth / boxHeight);
  575. } else {
  576. width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
  577. height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  578. }
  579. const attributes = {};
  580. const setAttr = (prop, value) => {
  581. if (!isUnsetKeyword(value)) {
  582. attributes[prop] = value.toString();
  583. }
  584. };
  585. setAttr("width", width);
  586. setAttr("height", height);
  587. attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
  588. return {
  589. attributes,
  590. body
  591. };
  592. }
  593. const regex = /\sid="(\S+)"/g;
  594. const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
  595. let counter = 0;
  596. function replaceIDs(body, prefix = randomPrefix) {
  597. const ids = [];
  598. let match;
  599. while (match = regex.exec(body)) {
  600. ids.push(match[1]);
  601. }
  602. if (!ids.length) {
  603. return body;
  604. }
  605. const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
  606. ids.forEach((id) => {
  607. const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
  608. const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  609. body = body.replace(
  610. // Allowed characters before id: [#;"]
  611. // Allowed characters after id: [)"], .[a-z]
  612. new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
  613. "$1" + newID + suffix + "$3"
  614. );
  615. });
  616. body = body.replace(new RegExp(suffix, "g"), "");
  617. return body;
  618. }
  619. const storage = /* @__PURE__ */ Object.create(null);
  620. function setAPIModule(provider, item) {
  621. storage[provider] = item;
  622. }
  623. function getAPIModule(provider) {
  624. return storage[provider] || storage[""];
  625. }
  626. function createAPIConfig(source) {
  627. let resources;
  628. if (typeof source.resources === "string") {
  629. resources = [source.resources];
  630. } else {
  631. resources = source.resources;
  632. if (!(resources instanceof Array) || !resources.length) {
  633. return null;
  634. }
  635. }
  636. const result = {
  637. // API hosts
  638. resources,
  639. // Root path
  640. path: source.path || "/",
  641. // URL length limit
  642. maxURL: source.maxURL || 500,
  643. // Timeout before next host is used.
  644. rotate: source.rotate || 750,
  645. // Timeout before failing query.
  646. timeout: source.timeout || 5e3,
  647. // Randomise default API end point.
  648. random: source.random === true,
  649. // Start index
  650. index: source.index || 0,
  651. // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
  652. dataAfterTimeout: source.dataAfterTimeout !== false
  653. };
  654. return result;
  655. }
  656. const configStorage = /* @__PURE__ */ Object.create(null);
  657. const fallBackAPISources = [
  658. "https://api.simplesvg.com",
  659. "https://api.unisvg.com"
  660. ];
  661. const fallBackAPI = [];
  662. while (fallBackAPISources.length > 0) {
  663. if (fallBackAPISources.length === 1) {
  664. fallBackAPI.push(fallBackAPISources.shift());
  665. } else {
  666. if (Math.random() > 0.5) {
  667. fallBackAPI.push(fallBackAPISources.shift());
  668. } else {
  669. fallBackAPI.push(fallBackAPISources.pop());
  670. }
  671. }
  672. }
  673. configStorage[""] = createAPIConfig({
  674. resources: ["https://api.iconify.design"].concat(fallBackAPI)
  675. });
  676. function addAPIProvider(provider, customConfig) {
  677. const config2 = createAPIConfig(customConfig);
  678. if (config2 === null) {
  679. return false;
  680. }
  681. configStorage[provider] = config2;
  682. return true;
  683. }
  684. function getAPIConfig(provider) {
  685. return configStorage[provider];
  686. }
  687. const detectFetch = () => {
  688. let callback;
  689. try {
  690. callback = fetch;
  691. if (typeof callback === "function") {
  692. return callback;
  693. }
  694. } catch (err) {
  695. }
  696. };
  697. let fetchModule = detectFetch();
  698. function calculateMaxLength(provider, prefix) {
  699. const config2 = getAPIConfig(provider);
  700. if (!config2) {
  701. return 0;
  702. }
  703. let result;
  704. if (!config2.maxURL) {
  705. result = 0;
  706. } else {
  707. let maxHostLength = 0;
  708. config2.resources.forEach((item) => {
  709. const host = item;
  710. maxHostLength = Math.max(maxHostLength, host.length);
  711. });
  712. const url = prefix + ".json?icons=";
  713. result = config2.maxURL - maxHostLength - config2.path.length - url.length;
  714. }
  715. return result;
  716. }
  717. function shouldAbort(status) {
  718. return status === 404;
  719. }
  720. const prepare = (provider, prefix, icons) => {
  721. const results = [];
  722. const maxLength = calculateMaxLength(provider, prefix);
  723. const type = "icons";
  724. let item = {
  725. type,
  726. provider,
  727. prefix,
  728. icons: []
  729. };
  730. let length = 0;
  731. icons.forEach((name, index) => {
  732. length += name.length + 1;
  733. if (length >= maxLength && index > 0) {
  734. results.push(item);
  735. item = {
  736. type,
  737. provider,
  738. prefix,
  739. icons: []
  740. };
  741. length = name.length;
  742. }
  743. item.icons.push(name);
  744. });
  745. results.push(item);
  746. return results;
  747. };
  748. function getPath(provider) {
  749. if (typeof provider === "string") {
  750. const config2 = getAPIConfig(provider);
  751. if (config2) {
  752. return config2.path;
  753. }
  754. }
  755. return "/";
  756. }
  757. const send = (host, params, callback) => {
  758. if (!fetchModule) {
  759. callback("abort", 424);
  760. return;
  761. }
  762. let path = getPath(params.provider);
  763. switch (params.type) {
  764. case "icons": {
  765. const prefix = params.prefix;
  766. const icons = params.icons;
  767. const iconsList = icons.join(",");
  768. const urlParams = new URLSearchParams({
  769. icons: iconsList
  770. });
  771. path += prefix + ".json?" + urlParams.toString();
  772. break;
  773. }
  774. case "custom": {
  775. const uri = params.uri;
  776. path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
  777. break;
  778. }
  779. default:
  780. callback("abort", 400);
  781. return;
  782. }
  783. let defaultError = 503;
  784. fetchModule(host + path).then((response) => {
  785. const status = response.status;
  786. if (status !== 200) {
  787. setTimeout(() => {
  788. callback(shouldAbort(status) ? "abort" : "next", status);
  789. });
  790. return;
  791. }
  792. defaultError = 501;
  793. return response.json();
  794. }).then((data) => {
  795. if (typeof data !== "object" || data === null) {
  796. setTimeout(() => {
  797. if (data === 404) {
  798. callback("abort", data);
  799. } else {
  800. callback("next", defaultError);
  801. }
  802. });
  803. return;
  804. }
  805. setTimeout(() => {
  806. callback("success", data);
  807. });
  808. }).catch(() => {
  809. callback("next", defaultError);
  810. });
  811. };
  812. const fetchAPIModule = {
  813. prepare,
  814. send
  815. };
  816. function sortIcons(icons) {
  817. const result = {
  818. loaded: [],
  819. missing: [],
  820. pending: []
  821. };
  822. const storage2 = /* @__PURE__ */ Object.create(null);
  823. icons.sort((a, b) => {
  824. if (a.provider !== b.provider) {
  825. return a.provider.localeCompare(b.provider);
  826. }
  827. if (a.prefix !== b.prefix) {
  828. return a.prefix.localeCompare(b.prefix);
  829. }
  830. return a.name.localeCompare(b.name);
  831. });
  832. let lastIcon = {
  833. provider: "",
  834. prefix: "",
  835. name: ""
  836. };
  837. icons.forEach((icon) => {
  838. if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
  839. return;
  840. }
  841. lastIcon = icon;
  842. const provider = icon.provider;
  843. const prefix = icon.prefix;
  844. const name = icon.name;
  845. const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
  846. const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
  847. let list;
  848. if (name in localStorage2.icons) {
  849. list = result.loaded;
  850. } else if (prefix === "" || localStorage2.missing.has(name)) {
  851. list = result.missing;
  852. } else {
  853. list = result.pending;
  854. }
  855. const item = {
  856. provider,
  857. prefix,
  858. name
  859. };
  860. list.push(item);
  861. });
  862. return result;
  863. }
  864. function removeCallback(storages, id) {
  865. storages.forEach((storage2) => {
  866. const items = storage2.loaderCallbacks;
  867. if (items) {
  868. storage2.loaderCallbacks = items.filter((row) => row.id !== id);
  869. }
  870. });
  871. }
  872. function updateCallbacks(storage2) {
  873. if (!storage2.pendingCallbacksFlag) {
  874. storage2.pendingCallbacksFlag = true;
  875. setTimeout(() => {
  876. storage2.pendingCallbacksFlag = false;
  877. const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
  878. if (!items.length) {
  879. return;
  880. }
  881. let hasPending = false;
  882. const provider = storage2.provider;
  883. const prefix = storage2.prefix;
  884. items.forEach((item) => {
  885. const icons = item.icons;
  886. const oldLength = icons.pending.length;
  887. icons.pending = icons.pending.filter((icon) => {
  888. if (icon.prefix !== prefix) {
  889. return true;
  890. }
  891. const name = icon.name;
  892. if (storage2.icons[name]) {
  893. icons.loaded.push({
  894. provider,
  895. prefix,
  896. name
  897. });
  898. } else if (storage2.missing.has(name)) {
  899. icons.missing.push({
  900. provider,
  901. prefix,
  902. name
  903. });
  904. } else {
  905. hasPending = true;
  906. return true;
  907. }
  908. return false;
  909. });
  910. if (icons.pending.length !== oldLength) {
  911. if (!hasPending) {
  912. removeCallback([storage2], item.id);
  913. }
  914. item.callback(
  915. icons.loaded.slice(0),
  916. icons.missing.slice(0),
  917. icons.pending.slice(0),
  918. item.abort
  919. );
  920. }
  921. });
  922. });
  923. }
  924. }
  925. let idCounter = 0;
  926. function storeCallback(callback, icons, pendingSources) {
  927. const id = idCounter++;
  928. const abort = removeCallback.bind(null, pendingSources, id);
  929. if (!icons.pending.length) {
  930. return abort;
  931. }
  932. const item = {
  933. id,
  934. icons,
  935. callback,
  936. abort
  937. };
  938. pendingSources.forEach((storage2) => {
  939. (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
  940. });
  941. return abort;
  942. }
  943. function listToIcons(list, validate = true, simpleNames2 = false) {
  944. const result = [];
  945. list.forEach((item) => {
  946. const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
  947. if (icon) {
  948. result.push(icon);
  949. }
  950. });
  951. return result;
  952. }
  953. var defaultConfig = {
  954. resources: [],
  955. index: 0,
  956. timeout: 2e3,
  957. rotate: 750,
  958. random: false,
  959. dataAfterTimeout: false
  960. };
  961. function sendQuery(config2, payload, query, done) {
  962. const resourcesCount = config2.resources.length;
  963. const startIndex = config2.random ? Math.floor(Math.random() * resourcesCount) : config2.index;
  964. let resources;
  965. if (config2.random) {
  966. let list = config2.resources.slice(0);
  967. resources = [];
  968. while (list.length > 1) {
  969. const nextIndex = Math.floor(Math.random() * list.length);
  970. resources.push(list[nextIndex]);
  971. list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
  972. }
  973. resources = resources.concat(list);
  974. } else {
  975. resources = config2.resources.slice(startIndex).concat(config2.resources.slice(0, startIndex));
  976. }
  977. const startTime = Date.now();
  978. let status = "pending";
  979. let queriesSent = 0;
  980. let lastError;
  981. let timer = null;
  982. let queue = [];
  983. let doneCallbacks = [];
  984. if (typeof done === "function") {
  985. doneCallbacks.push(done);
  986. }
  987. function resetTimer() {
  988. if (timer) {
  989. clearTimeout(timer);
  990. timer = null;
  991. }
  992. }
  993. function abort() {
  994. if (status === "pending") {
  995. status = "aborted";
  996. }
  997. resetTimer();
  998. queue.forEach((item) => {
  999. if (item.status === "pending") {
  1000. item.status = "aborted";
  1001. }
  1002. });
  1003. queue = [];
  1004. }
  1005. function subscribe(callback, overwrite) {
  1006. if (overwrite) {
  1007. doneCallbacks = [];
  1008. }
  1009. if (typeof callback === "function") {
  1010. doneCallbacks.push(callback);
  1011. }
  1012. }
  1013. function getQueryStatus() {
  1014. return {
  1015. startTime,
  1016. payload,
  1017. status,
  1018. queriesSent,
  1019. queriesPending: queue.length,
  1020. subscribe,
  1021. abort
  1022. };
  1023. }
  1024. function failQuery() {
  1025. status = "failed";
  1026. doneCallbacks.forEach((callback) => {
  1027. callback(void 0, lastError);
  1028. });
  1029. }
  1030. function clearQueue() {
  1031. queue.forEach((item) => {
  1032. if (item.status === "pending") {
  1033. item.status = "aborted";
  1034. }
  1035. });
  1036. queue = [];
  1037. }
  1038. function moduleResponse(item, response, data) {
  1039. const isError = response !== "success";
  1040. queue = queue.filter((queued) => queued !== item);
  1041. switch (status) {
  1042. case "pending":
  1043. break;
  1044. case "failed":
  1045. if (isError || !config2.dataAfterTimeout) {
  1046. return;
  1047. }
  1048. break;
  1049. default:
  1050. return;
  1051. }
  1052. if (response === "abort") {
  1053. lastError = data;
  1054. failQuery();
  1055. return;
  1056. }
  1057. if (isError) {
  1058. lastError = data;
  1059. if (!queue.length) {
  1060. if (!resources.length) {
  1061. failQuery();
  1062. } else {
  1063. execNext();
  1064. }
  1065. }
  1066. return;
  1067. }
  1068. resetTimer();
  1069. clearQueue();
  1070. if (!config2.random) {
  1071. const index = config2.resources.indexOf(item.resource);
  1072. if (index !== -1 && index !== config2.index) {
  1073. config2.index = index;
  1074. }
  1075. }
  1076. status = "completed";
  1077. doneCallbacks.forEach((callback) => {
  1078. callback(data);
  1079. });
  1080. }
  1081. function execNext() {
  1082. if (status !== "pending") {
  1083. return;
  1084. }
  1085. resetTimer();
  1086. const resource = resources.shift();
  1087. if (resource === void 0) {
  1088. if (queue.length) {
  1089. timer = setTimeout(() => {
  1090. resetTimer();
  1091. if (status === "pending") {
  1092. clearQueue();
  1093. failQuery();
  1094. }
  1095. }, config2.timeout);
  1096. return;
  1097. }
  1098. failQuery();
  1099. return;
  1100. }
  1101. const item = {
  1102. status: "pending",
  1103. resource,
  1104. callback: (status2, data) => {
  1105. moduleResponse(item, status2, data);
  1106. }
  1107. };
  1108. queue.push(item);
  1109. queriesSent++;
  1110. timer = setTimeout(execNext, config2.rotate);
  1111. query(resource, payload, item.callback);
  1112. }
  1113. setTimeout(execNext);
  1114. return getQueryStatus;
  1115. }
  1116. function initRedundancy(cfg) {
  1117. const config2 = {
  1118. ...defaultConfig,
  1119. ...cfg
  1120. };
  1121. let queries = [];
  1122. function cleanup() {
  1123. queries = queries.filter((item) => item().status === "pending");
  1124. }
  1125. function query(payload, queryCallback, doneCallback) {
  1126. const query2 = sendQuery(
  1127. config2,
  1128. payload,
  1129. queryCallback,
  1130. (data, error) => {
  1131. cleanup();
  1132. if (doneCallback) {
  1133. doneCallback(data, error);
  1134. }
  1135. }
  1136. );
  1137. queries.push(query2);
  1138. return query2;
  1139. }
  1140. function find(callback) {
  1141. return queries.find((value) => {
  1142. return callback(value);
  1143. }) || null;
  1144. }
  1145. const instance = {
  1146. query,
  1147. find,
  1148. setIndex: (index) => {
  1149. config2.index = index;
  1150. },
  1151. getIndex: () => config2.index,
  1152. cleanup
  1153. };
  1154. return instance;
  1155. }
  1156. function emptyCallback$1() {
  1157. }
  1158. const redundancyCache = /* @__PURE__ */ Object.create(null);
  1159. function getRedundancyCache(provider) {
  1160. if (!redundancyCache[provider]) {
  1161. const config2 = getAPIConfig(provider);
  1162. if (!config2) {
  1163. return;
  1164. }
  1165. const redundancy = initRedundancy(config2);
  1166. const cachedReundancy = {
  1167. config: config2,
  1168. redundancy
  1169. };
  1170. redundancyCache[provider] = cachedReundancy;
  1171. }
  1172. return redundancyCache[provider];
  1173. }
  1174. function sendAPIQuery(target, query, callback) {
  1175. let redundancy;
  1176. let send2;
  1177. if (typeof target === "string") {
  1178. const api = getAPIModule(target);
  1179. if (!api) {
  1180. callback(void 0, 424);
  1181. return emptyCallback$1;
  1182. }
  1183. send2 = api.send;
  1184. const cached = getRedundancyCache(target);
  1185. if (cached) {
  1186. redundancy = cached.redundancy;
  1187. }
  1188. } else {
  1189. const config2 = createAPIConfig(target);
  1190. if (config2) {
  1191. redundancy = initRedundancy(config2);
  1192. const moduleKey = target.resources ? target.resources[0] : "";
  1193. const api = getAPIModule(moduleKey);
  1194. if (api) {
  1195. send2 = api.send;
  1196. }
  1197. }
  1198. }
  1199. if (!redundancy || !send2) {
  1200. callback(void 0, 424);
  1201. return emptyCallback$1;
  1202. }
  1203. return redundancy.query(query, send2, callback)().abort;
  1204. }
  1205. const browserCacheVersion = "iconify2";
  1206. const browserCachePrefix = "iconify";
  1207. const browserCacheCountKey = browserCachePrefix + "-count";
  1208. const browserCacheVersionKey = browserCachePrefix + "-version";
  1209. const browserStorageHour = 36e5;
  1210. const browserStorageCacheExpiration = 168;
  1211. function getStoredItem(func, key) {
  1212. try {
  1213. return func.getItem(key);
  1214. } catch (err) {
  1215. }
  1216. }
  1217. function setStoredItem(func, key, value) {
  1218. try {
  1219. func.setItem(key, value);
  1220. return true;
  1221. } catch (err) {
  1222. }
  1223. }
  1224. function removeStoredItem(func, key) {
  1225. try {
  1226. func.removeItem(key);
  1227. } catch (err) {
  1228. }
  1229. }
  1230. function setBrowserStorageItemsCount(storage2, value) {
  1231. return setStoredItem(storage2, browserCacheCountKey, value.toString());
  1232. }
  1233. function getBrowserStorageItemsCount(storage2) {
  1234. return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
  1235. }
  1236. const browserStorageConfig = {
  1237. local: true,
  1238. session: true
  1239. };
  1240. const browserStorageEmptyItems = {
  1241. local: /* @__PURE__ */ new Set(),
  1242. session: /* @__PURE__ */ new Set()
  1243. };
  1244. let browserStorageStatus = false;
  1245. function setBrowserStorageStatus(status) {
  1246. browserStorageStatus = status;
  1247. }
  1248. let _window = typeof window === "undefined" ? {} : window;
  1249. function getBrowserStorage(key) {
  1250. const attr = key + "Storage";
  1251. try {
  1252. if (_window && _window[attr] && typeof _window[attr].length === "number") {
  1253. return _window[attr];
  1254. }
  1255. } catch (err) {
  1256. }
  1257. browserStorageConfig[key] = false;
  1258. }
  1259. function iterateBrowserStorage(key, callback) {
  1260. const func = getBrowserStorage(key);
  1261. if (!func) {
  1262. return;
  1263. }
  1264. const version = getStoredItem(func, browserCacheVersionKey);
  1265. if (version !== browserCacheVersion) {
  1266. if (version) {
  1267. const total2 = getBrowserStorageItemsCount(func);
  1268. for (let i = 0; i < total2; i++) {
  1269. removeStoredItem(func, browserCachePrefix + i.toString());
  1270. }
  1271. }
  1272. setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
  1273. setBrowserStorageItemsCount(func, 0);
  1274. return;
  1275. }
  1276. const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
  1277. const parseItem = (index) => {
  1278. const name = browserCachePrefix + index.toString();
  1279. const item = getStoredItem(func, name);
  1280. if (typeof item !== "string") {
  1281. return;
  1282. }
  1283. try {
  1284. const data = JSON.parse(item);
  1285. if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
  1286. callback(data, index)) {
  1287. return true;
  1288. }
  1289. } catch (err) {
  1290. }
  1291. removeStoredItem(func, name);
  1292. };
  1293. let total = getBrowserStorageItemsCount(func);
  1294. for (let i = total - 1; i >= 0; i--) {
  1295. if (!parseItem(i)) {
  1296. if (i === total - 1) {
  1297. total--;
  1298. setBrowserStorageItemsCount(func, total);
  1299. } else {
  1300. browserStorageEmptyItems[key].add(i);
  1301. }
  1302. }
  1303. }
  1304. }
  1305. function initBrowserStorage() {
  1306. if (browserStorageStatus) {
  1307. return;
  1308. }
  1309. setBrowserStorageStatus(true);
  1310. for (const key in browserStorageConfig) {
  1311. iterateBrowserStorage(key, (item) => {
  1312. const iconSet = item.data;
  1313. const provider = item.provider;
  1314. const prefix = iconSet.prefix;
  1315. const storage2 = getStorage(
  1316. provider,
  1317. prefix
  1318. );
  1319. if (!addIconSet(storage2, iconSet).length) {
  1320. return false;
  1321. }
  1322. const lastModified = iconSet.lastModified || -1;
  1323. storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
  1324. return true;
  1325. });
  1326. }
  1327. }
  1328. function updateLastModified(storage2, lastModified) {
  1329. const lastValue = storage2.lastModifiedCached;
  1330. if (
  1331. // Matches or newer
  1332. lastValue && lastValue >= lastModified
  1333. ) {
  1334. return lastValue === lastModified;
  1335. }
  1336. storage2.lastModifiedCached = lastModified;
  1337. if (lastValue) {
  1338. for (const key in browserStorageConfig) {
  1339. iterateBrowserStorage(key, (item) => {
  1340. const iconSet = item.data;
  1341. return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
  1342. });
  1343. }
  1344. }
  1345. return true;
  1346. }
  1347. function storeInBrowserStorage(storage2, data) {
  1348. if (!browserStorageStatus) {
  1349. initBrowserStorage();
  1350. }
  1351. function store(key) {
  1352. let func;
  1353. if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
  1354. return;
  1355. }
  1356. const set = browserStorageEmptyItems[key];
  1357. let index;
  1358. if (set.size) {
  1359. set.delete(index = Array.from(set).shift());
  1360. } else {
  1361. index = getBrowserStorageItemsCount(func);
  1362. if (!setBrowserStorageItemsCount(func, index + 1)) {
  1363. return;
  1364. }
  1365. }
  1366. const item = {
  1367. cached: Math.floor(Date.now() / browserStorageHour),
  1368. provider: storage2.provider,
  1369. data
  1370. };
  1371. return setStoredItem(
  1372. func,
  1373. browserCachePrefix + index.toString(),
  1374. JSON.stringify(item)
  1375. );
  1376. }
  1377. if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
  1378. return;
  1379. }
  1380. if (!Object.keys(data.icons).length) {
  1381. return;
  1382. }
  1383. if (data.not_found) {
  1384. data = Object.assign({}, data);
  1385. delete data.not_found;
  1386. }
  1387. if (!store("local")) {
  1388. store("session");
  1389. }
  1390. }
  1391. function emptyCallback() {
  1392. }
  1393. function loadedNewIcons(storage2) {
  1394. if (!storage2.iconsLoaderFlag) {
  1395. storage2.iconsLoaderFlag = true;
  1396. setTimeout(() => {
  1397. storage2.iconsLoaderFlag = false;
  1398. updateCallbacks(storage2);
  1399. });
  1400. }
  1401. }
  1402. function loadNewIcons(storage2, icons) {
  1403. if (!storage2.iconsToLoad) {
  1404. storage2.iconsToLoad = icons;
  1405. } else {
  1406. storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
  1407. }
  1408. if (!storage2.iconsQueueFlag) {
  1409. storage2.iconsQueueFlag = true;
  1410. setTimeout(() => {
  1411. storage2.iconsQueueFlag = false;
  1412. const { provider, prefix } = storage2;
  1413. const icons2 = storage2.iconsToLoad;
  1414. delete storage2.iconsToLoad;
  1415. let api;
  1416. if (!icons2 || !(api = getAPIModule(provider))) {
  1417. return;
  1418. }
  1419. const params = api.prepare(provider, prefix, icons2);
  1420. params.forEach((item) => {
  1421. sendAPIQuery(provider, item, (data) => {
  1422. if (typeof data !== "object") {
  1423. item.icons.forEach((name) => {
  1424. storage2.missing.add(name);
  1425. });
  1426. } else {
  1427. try {
  1428. const parsed = addIconSet(
  1429. storage2,
  1430. data
  1431. );
  1432. if (!parsed.length) {
  1433. return;
  1434. }
  1435. const pending = storage2.pendingIcons;
  1436. if (pending) {
  1437. parsed.forEach((name) => {
  1438. pending.delete(name);
  1439. });
  1440. }
  1441. storeInBrowserStorage(storage2, data);
  1442. } catch (err) {
  1443. console.error(err);
  1444. }
  1445. }
  1446. loadedNewIcons(storage2);
  1447. });
  1448. });
  1449. });
  1450. }
  1451. }
  1452. const loadIcons = (icons, callback) => {
  1453. const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
  1454. const sortedIcons = sortIcons(cleanedIcons);
  1455. if (!sortedIcons.pending.length) {
  1456. let callCallback = true;
  1457. if (callback) {
  1458. setTimeout(() => {
  1459. if (callCallback) {
  1460. callback(
  1461. sortedIcons.loaded,
  1462. sortedIcons.missing,
  1463. sortedIcons.pending,
  1464. emptyCallback
  1465. );
  1466. }
  1467. });
  1468. }
  1469. return () => {
  1470. callCallback = false;
  1471. };
  1472. }
  1473. const newIcons = /* @__PURE__ */ Object.create(null);
  1474. const sources = [];
  1475. let lastProvider, lastPrefix;
  1476. sortedIcons.pending.forEach((icon) => {
  1477. const { provider, prefix } = icon;
  1478. if (prefix === lastPrefix && provider === lastProvider) {
  1479. return;
  1480. }
  1481. lastProvider = provider;
  1482. lastPrefix = prefix;
  1483. sources.push(getStorage(provider, prefix));
  1484. const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
  1485. if (!providerNewIcons[prefix]) {
  1486. providerNewIcons[prefix] = [];
  1487. }
  1488. });
  1489. sortedIcons.pending.forEach((icon) => {
  1490. const { provider, prefix, name } = icon;
  1491. const storage2 = getStorage(provider, prefix);
  1492. const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
  1493. if (!pendingQueue.has(name)) {
  1494. pendingQueue.add(name);
  1495. newIcons[provider][prefix].push(name);
  1496. }
  1497. });
  1498. sources.forEach((storage2) => {
  1499. const { provider, prefix } = storage2;
  1500. if (newIcons[provider][prefix].length) {
  1501. loadNewIcons(storage2, newIcons[provider][prefix]);
  1502. }
  1503. });
  1504. return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
  1505. };
  1506. function mergeCustomisations(defaults, item) {
  1507. const result = {
  1508. ...defaults
  1509. };
  1510. for (const key in item) {
  1511. const value = item[key];
  1512. const valueType = typeof value;
  1513. if (key in defaultIconSizeCustomisations) {
  1514. if (value === null || value && (valueType === "string" || valueType === "number")) {
  1515. result[key] = value;
  1516. }
  1517. } else if (valueType === typeof result[key]) {
  1518. result[key] = key === "rotate" ? value % 4 : value;
  1519. }
  1520. }
  1521. return result;
  1522. }
  1523. const separator = /[\s,]+/;
  1524. function flipFromString(custom, flip) {
  1525. flip.split(separator).forEach((str) => {
  1526. const value = str.trim();
  1527. switch (value) {
  1528. case "horizontal":
  1529. custom.hFlip = true;
  1530. break;
  1531. case "vertical":
  1532. custom.vFlip = true;
  1533. break;
  1534. }
  1535. });
  1536. }
  1537. function rotateFromString(value, defaultValue = 0) {
  1538. const units = value.replace(/^-?[0-9.]*/, "");
  1539. function cleanup(value2) {
  1540. while (value2 < 0) {
  1541. value2 += 4;
  1542. }
  1543. return value2 % 4;
  1544. }
  1545. if (units === "") {
  1546. const num = parseInt(value);
  1547. return isNaN(num) ? 0 : cleanup(num);
  1548. } else if (units !== value) {
  1549. let split = 0;
  1550. switch (units) {
  1551. case "%":
  1552. split = 25;
  1553. break;
  1554. case "deg":
  1555. split = 90;
  1556. }
  1557. if (split) {
  1558. let num = parseFloat(value.slice(0, value.length - units.length));
  1559. if (isNaN(num)) {
  1560. return 0;
  1561. }
  1562. num = num / split;
  1563. return num % 1 === 0 ? cleanup(num) : 0;
  1564. }
  1565. }
  1566. return defaultValue;
  1567. }
  1568. function iconToHTML(body, attributes) {
  1569. let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  1570. for (const attr in attributes) {
  1571. renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
  1572. }
  1573. return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
  1574. }
  1575. function encodeSVGforURL(svg) {
  1576. return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
  1577. }
  1578. function svgToData(svg) {
  1579. return "data:image/svg+xml," + encodeSVGforURL(svg);
  1580. }
  1581. function svgToURL(svg) {
  1582. return 'url("' + svgToData(svg) + '")';
  1583. }
  1584. const defaultExtendedIconCustomisations = {
  1585. ...defaultIconCustomisations,
  1586. inline: false
  1587. };
  1588. const svgDefaults = {
  1589. "xmlns": "http://www.w3.org/2000/svg",
  1590. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  1591. "aria-hidden": true,
  1592. "role": "img"
  1593. };
  1594. const commonProps = {
  1595. display: "inline-block"
  1596. };
  1597. const monotoneProps = {
  1598. backgroundColor: "currentColor"
  1599. };
  1600. const coloredProps = {
  1601. backgroundColor: "transparent"
  1602. };
  1603. const propsToAdd = {
  1604. Image: "var(--svg)",
  1605. Repeat: "no-repeat",
  1606. Size: "100% 100%"
  1607. };
  1608. const propsToAddTo = {
  1609. webkitMask: monotoneProps,
  1610. mask: monotoneProps,
  1611. background: coloredProps
  1612. };
  1613. for (const prefix in propsToAddTo) {
  1614. const list = propsToAddTo[prefix];
  1615. for (const prop in propsToAdd) {
  1616. list[prefix + prop] = propsToAdd[prop];
  1617. }
  1618. }
  1619. const customisationAliases = {};
  1620. ["horizontal", "vertical"].forEach((prefix) => {
  1621. const attr = prefix.slice(0, 1) + "Flip";
  1622. customisationAliases[prefix + "-flip"] = attr;
  1623. customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
  1624. customisationAliases[prefix + "Flip"] = attr;
  1625. });
  1626. function fixSize(value) {
  1627. return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
  1628. }
  1629. const render = (icon, props) => {
  1630. const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
  1631. const componentProps = { ...svgDefaults };
  1632. const mode = props.mode || "svg";
  1633. const style = {};
  1634. const propsStyle = props.style;
  1635. const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
  1636. for (let key in props) {
  1637. const value = props[key];
  1638. if (value === void 0) {
  1639. continue;
  1640. }
  1641. switch (key) {
  1642. case "icon":
  1643. case "style":
  1644. case "onLoad":
  1645. case "mode":
  1646. break;
  1647. case "inline":
  1648. case "hFlip":
  1649. case "vFlip":
  1650. customisations[key] = value === true || value === "true" || value === 1;
  1651. break;
  1652. case "flip":
  1653. if (typeof value === "string") {
  1654. flipFromString(customisations, value);
  1655. }
  1656. break;
  1657. case "color":
  1658. style.color = value;
  1659. break;
  1660. case "rotate":
  1661. if (typeof value === "string") {
  1662. customisations[key] = rotateFromString(value);
  1663. } else if (typeof value === "number") {
  1664. customisations[key] = value;
  1665. }
  1666. break;
  1667. case "ariaHidden":
  1668. case "aria-hidden":
  1669. if (value !== true && value !== "true") {
  1670. delete componentProps["aria-hidden"];
  1671. }
  1672. break;
  1673. default: {
  1674. const alias = customisationAliases[key];
  1675. if (alias) {
  1676. if (value === true || value === "true" || value === 1) {
  1677. customisations[alias] = true;
  1678. }
  1679. } else if (defaultExtendedIconCustomisations[key] === void 0) {
  1680. componentProps[key] = value;
  1681. }
  1682. }
  1683. }
  1684. }
  1685. const item = iconToSVG(icon, customisations);
  1686. const renderAttribs = item.attributes;
  1687. if (customisations.inline) {
  1688. style.verticalAlign = "-0.125em";
  1689. }
  1690. if (mode === "svg") {
  1691. componentProps.style = {
  1692. ...style,
  1693. ...customStyle
  1694. };
  1695. Object.assign(componentProps, renderAttribs);
  1696. let localCounter = 0;
  1697. let id = props.id;
  1698. if (typeof id === "string") {
  1699. id = id.replace(/-/g, "_");
  1700. }
  1701. componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
  1702. return vue.h("svg", componentProps);
  1703. }
  1704. const { body, width, height } = icon;
  1705. const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
  1706. const html = iconToHTML(body, {
  1707. ...renderAttribs,
  1708. width: width + "",
  1709. height: height + ""
  1710. });
  1711. componentProps.style = {
  1712. ...style,
  1713. "--svg": svgToURL(html),
  1714. "width": fixSize(renderAttribs.width),
  1715. "height": fixSize(renderAttribs.height),
  1716. ...commonProps,
  1717. ...useMask ? monotoneProps : coloredProps,
  1718. ...customStyle
  1719. };
  1720. return vue.h("span", componentProps);
  1721. };
  1722. allowSimpleNames(true);
  1723. setAPIModule("", fetchAPIModule);
  1724. if (typeof document !== "undefined" && typeof window !== "undefined") {
  1725. initBrowserStorage();
  1726. const _window2 = window;
  1727. if (_window2.IconifyPreload !== void 0) {
  1728. const preload = _window2.IconifyPreload;
  1729. const err = "Invalid IconifyPreload syntax.";
  1730. if (typeof preload === "object" && preload !== null) {
  1731. (preload instanceof Array ? preload : [preload]).forEach((item) => {
  1732. try {
  1733. if (
  1734. // Check if item is an object and not null/array
  1735. typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
  1736. typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
  1737. !addCollection(item)
  1738. ) {
  1739. console.error(err);
  1740. }
  1741. } catch (e2) {
  1742. console.error(err);
  1743. }
  1744. });
  1745. }
  1746. }
  1747. if (_window2.IconifyProviders !== void 0) {
  1748. const providers = _window2.IconifyProviders;
  1749. if (typeof providers === "object" && providers !== null) {
  1750. for (let key in providers) {
  1751. const err = "IconifyProviders[" + key + "] is invalid.";
  1752. try {
  1753. const value = providers[key];
  1754. if (typeof value !== "object" || !value || value.resources === void 0) {
  1755. continue;
  1756. }
  1757. if (!addAPIProvider(key, value)) {
  1758. console.error(err);
  1759. }
  1760. } catch (e2) {
  1761. console.error(err);
  1762. }
  1763. }
  1764. }
  1765. }
  1766. }
  1767. const emptyIcon = {
  1768. ...defaultIconProps,
  1769. body: ""
  1770. };
  1771. const Icon = vue.defineComponent({
  1772. // Do not inherit other attributes: it is handled by render()
  1773. inheritAttrs: false,
  1774. // Set initial data
  1775. data() {
  1776. return {
  1777. // Mounted status
  1778. iconMounted: false,
  1779. // Callback counter to trigger re-render
  1780. counter: 0
  1781. };
  1782. },
  1783. mounted() {
  1784. this._name = "";
  1785. this._loadingIcon = null;
  1786. this.iconMounted = true;
  1787. },
  1788. unmounted() {
  1789. this.abortLoading();
  1790. },
  1791. methods: {
  1792. abortLoading() {
  1793. if (this._loadingIcon) {
  1794. this._loadingIcon.abort();
  1795. this._loadingIcon = null;
  1796. }
  1797. },
  1798. // Get data for icon to render or null
  1799. getIcon(icon, onload) {
  1800. if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
  1801. this._name = "";
  1802. this.abortLoading();
  1803. return {
  1804. data: icon
  1805. };
  1806. }
  1807. let iconName;
  1808. if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
  1809. this.abortLoading();
  1810. return null;
  1811. }
  1812. const data = getIconData(iconName);
  1813. if (!data) {
  1814. if (!this._loadingIcon || this._loadingIcon.name !== icon) {
  1815. this.abortLoading();
  1816. this._name = "";
  1817. if (data !== null) {
  1818. this._loadingIcon = {
  1819. name: icon,
  1820. abort: loadIcons([iconName], () => {
  1821. this.counter++;
  1822. })
  1823. };
  1824. }
  1825. }
  1826. return null;
  1827. }
  1828. this.abortLoading();
  1829. if (this._name !== icon) {
  1830. this._name = icon;
  1831. if (onload) {
  1832. onload(icon);
  1833. }
  1834. }
  1835. const classes = ["iconify"];
  1836. if (iconName.prefix !== "") {
  1837. classes.push("iconify--" + iconName.prefix);
  1838. }
  1839. if (iconName.provider !== "") {
  1840. classes.push("iconify--" + iconName.provider);
  1841. }
  1842. return { data, classes };
  1843. }
  1844. },
  1845. // Render icon
  1846. render() {
  1847. this.counter;
  1848. const props = this.$attrs;
  1849. const icon = this.iconMounted ? this.getIcon(props.icon, props.onLoad) : null;
  1850. if (!icon) {
  1851. return render(emptyIcon, props);
  1852. }
  1853. let newProps = props;
  1854. if (icon.classes) {
  1855. newProps = {
  1856. ...props,
  1857. class: (typeof props["class"] === "string" ? props["class"] + " " : "") + icon.classes.join(" ")
  1858. };
  1859. }
  1860. return render({
  1861. ...defaultIconProps,
  1862. ...icon.data
  1863. }, newProps);
  1864. }
  1865. });
  1866. const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
  1867. __name: "BackIcon",
  1868. setup(__props) {
  1869. return (_ctx, _cache) => {
  1870. return vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  1871. class: "back-icon",
  1872. icon: "octicon:arrow-left-24",
  1873. width: "22"
  1874. });
  1875. };
  1876. }
  1877. });
  1878. const _hoisted_1$n = { class: "nav-bar" };
  1879. const _hoisted_2$j = {
  1880. key: 0,
  1881. class: "title"
  1882. };
  1883. const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
  1884. __name: "NavBar",
  1885. props: {
  1886. title: {}
  1887. },
  1888. emits: ["back"],
  1889. setup(__props, { emit: __emit }) {
  1890. const emit = __emit;
  1891. return (_ctx, _cache) => {
  1892. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
  1893. vue.createVNode(_sfc_main$p, {
  1894. onClick: _cache[0] || (_cache[0] = ($event) => emit("back"))
  1895. }),
  1896. _ctx.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$j, vue.toDisplayString(_ctx.title), 1)) : vue.createCommentVNode("", true)
  1897. ]);
  1898. };
  1899. }
  1900. });
  1901. const NavBar = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-fda0acaa"]]);
  1902. const _hoisted_1$m = { class: "display-type" };
  1903. const _hoisted_2$i = { style: { "position": "relative" } };
  1904. const _hoisted_3$f = {
  1905. key: 0,
  1906. class: "type-list"
  1907. };
  1908. const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
  1909. __name: "BaseSelect",
  1910. props: {
  1911. displayType: {}
  1912. },
  1913. emits: ["update:displayType"],
  1914. setup(__props, { emit: __emit }) {
  1915. const props = __props;
  1916. const emit = __emit;
  1917. let state = vue.reactive({
  1918. showChangeDisplayType: false,
  1919. lastDisplayType: null
  1920. });
  1921. function changeOption(item) {
  1922. if (![CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  1923. state.lastDisplayType = props.displayType;
  1924. }
  1925. emit("update:displayType", item);
  1926. state.showChangeDisplayType = false;
  1927. }
  1928. function clickDisplayType() {
  1929. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  1930. return changeOption(state.lastDisplayType ?? CommentDisplayType.FloorInFloorNoCallUser);
  1931. }
  1932. state.showChangeDisplayType = !state.showChangeDisplayType;
  1933. }
  1934. const currentDisplayType = vue.computed(() => {
  1935. let judge = props.displayType;
  1936. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  1937. judge = state.lastDisplayType;
  1938. }
  1939. switch (judge) {
  1940. case CommentDisplayType.FloorInFloorNoCallUser:
  1941. return "楼中楼";
  1942. case CommentDisplayType.FloorInFloor:
  1943. return "楼中楼(@)";
  1944. case CommentDisplayType.FloorInFloorNested:
  1945. return "冗余楼中楼";
  1946. case CommentDisplayType.V2exOrigin:
  1947. return "V2原版";
  1948. case CommentDisplayType.OnlyOp:
  1949. return "只看楼主";
  1950. default:
  1951. return "楼中楼";
  1952. }
  1953. });
  1954. return (_ctx, _cache) => {
  1955. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
  1956. vue.createElementVNode("div", {
  1957. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).Like && "active"]),
  1958. onClick: _cache[0] || (_cache[0] = ($event) => changeOption(vue.unref(CommentDisplayType).Like))
  1959. }, "最热 ", 2),
  1960. vue.createElementVNode("div", _hoisted_2$i, [
  1961. vue.createElementVNode("div", {
  1962. class: vue.normalizeClass(["type", ![vue.unref(CommentDisplayType).New, vue.unref(CommentDisplayType).Like].includes(_ctx.displayType) && "active"]),
  1963. onClick: clickDisplayType
  1964. }, [
  1965. vue.createElementVNode("span", null, vue.toDisplayString(currentDisplayType.value), 1),
  1966. vue.createVNode(vue.unref(Icon), { icon: "mingcute:down-line" })
  1967. ], 2),
  1968. vue.unref(state).showChangeDisplayType ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f, [
  1969. vue.createElementVNode("div", {
  1970. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNoCallUser && "active"]),
  1971. onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNoCallUser), ["stop"]))
  1972. }, "楼中楼 ", 2),
  1973. vue.createElementVNode("div", {
  1974. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloor && "active"]),
  1975. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloor), ["stop"]))
  1976. }, "楼中楼(@) ", 2),
  1977. vue.createElementVNode("div", {
  1978. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNested && "active"]),
  1979. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNested), ["stop"]))
  1980. }, "冗余楼中楼 ", 2),
  1981. vue.createElementVNode("div", {
  1982. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).OnlyOp && "active"]),
  1983. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).OnlyOp), ["stop"]))
  1984. }, "只看楼主 ", 2),
  1985. vue.createElementVNode("div", {
  1986. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).V2exOrigin && "active"]),
  1987. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).V2exOrigin), ["stop"]))
  1988. }, "V2原版 ", 2)
  1989. ])) : vue.createCommentVNode("", true)
  1990. ])
  1991. ]);
  1992. };
  1993. }
  1994. });
  1995. const BaseSelect = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-1d327f48"]]);
  1996. const eventBus = {
  1997. eventMap: /* @__PURE__ */ new Map(),
  1998. on(eventType, cb) {
  1999. let cbs = this.eventMap.get(eventType);
  2000. if (cbs) {
  2001. cbs.push(cb);
  2002. } else {
  2003. cbs = [cb];
  2004. }
  2005. this.eventMap.set(eventType, cbs);
  2006. },
  2007. emit(eventType, val) {
  2008. let cbs = this.eventMap.get(eventType);
  2009. if (cbs) {
  2010. cbs.map((cb) => cb(val));
  2011. }
  2012. },
  2013. off(eventType) {
  2014. let cbs = this.eventMap.has(eventType);
  2015. if (cbs) {
  2016. this.eventMap.delete(eventType);
  2017. }
  2018. },
  2019. clear() {
  2020. this.eventMap = /* @__PURE__ */ new Map();
  2021. }
  2022. };
  2023. const CMD = {
  2024. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  2025. SHOW_MSG: "SHOW_MSG",
  2026. SET_CALL: "SET_CALL",
  2027. SHOW_CALL: "SHOW_CALL",
  2028. REFRESH_ONCE: "REFRESH_ONCE",
  2029. ADD_REPLY: "ADD_REPLY",
  2030. IGNORE: "IGNORE",
  2031. MERGE: "MERGE",
  2032. MERGE_CONFIG: "MERGE_CONFIG",
  2033. REMOVE: "REMOVE",
  2034. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  2035. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  2036. ADD_TAG: "ADD_TAG",
  2037. REMOVE_TAG: "REMOVE_TAG",
  2038. RELATION_REPLY: "RELATION_REPLY",
  2039. JUMP: "JUMP",
  2040. ADD_READ: "ADD_READ",
  2041. REFRESH_POST: "REFRESH_POST",
  2042. SHOW_COMMENT_OPTIONS: "SHOW_COMMENT_OPTIONS",
  2043. SHOW_EDITOR: "COMMENT_REPLY"
  2044. };
  2045. const _withScopeId$e = (n2) => (vue.pushScopeId("data-v-a64ba8b8"), n2 = n2(), vue.popScopeId(), n2);
  2046. const _hoisted_1$l = { class: "font-size" };
  2047. const _hoisted_2$h = { class: "steps" };
  2048. const _hoisted_3$e = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", {
  2049. class: "text",
  2050. style: { "font-size": "1.2rem" }
  2051. }, "小", -1));
  2052. const _hoisted_4$d = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2053. const _hoisted_5$b = [
  2054. _hoisted_3$e,
  2055. _hoisted_4$d
  2056. ];
  2057. const _hoisted_6$a = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "text" }, "标准", -1));
  2058. const _hoisted_7$9 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2059. const _hoisted_8$9 = [
  2060. _hoisted_6$a,
  2061. _hoisted_7$9
  2062. ];
  2063. const _hoisted_9$9 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", {
  2064. class: "text",
  2065. style: { "font-size": "1.8rem" }
  2066. }, "大", -1));
  2067. const _hoisted_10$8 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2068. const _hoisted_11$8 = [
  2069. _hoisted_9$9,
  2070. _hoisted_10$8
  2071. ];
  2072. const _hoisted_12$8 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", {
  2073. class: "text",
  2074. style: { "font-size": "2.2rem" }
  2075. }, "特大", -1));
  2076. const _hoisted_13$8 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2077. const _hoisted_14$7 = [
  2078. _hoisted_12$8,
  2079. _hoisted_13$8
  2080. ];
  2081. const _hoisted_15$7 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "line" }, null, -1));
  2082. const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
  2083. __name: "FontSizeType",
  2084. setup(__props) {
  2085. const config2 = vue.inject("config");
  2086. return (_ctx, _cache) => {
  2087. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
  2088. vue.createElementVNode("div", _hoisted_2$h, [
  2089. vue.createElementVNode("div", {
  2090. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "small" && "active"]]),
  2091. onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "small" }))
  2092. }, _hoisted_5$b, 2),
  2093. vue.createElementVNode("div", {
  2094. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "normal" && "active"]]),
  2095. onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "normal" }))
  2096. }, _hoisted_8$9, 2),
  2097. vue.createElementVNode("div", {
  2098. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "large" && "active"]]),
  2099. onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "large" }))
  2100. }, _hoisted_11$8, 2),
  2101. vue.createElementVNode("div", {
  2102. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "big-large" && "active"]]),
  2103. onClick: _cache[3] || (_cache[3] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "big-large" }))
  2104. }, _hoisted_14$7, 2)
  2105. ]),
  2106. _hoisted_15$7
  2107. ]);
  2108. };
  2109. }
  2110. });
  2111. const FontSizeType = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-a64ba8b8"]]);
  2112. var _GM_notification = /* @__PURE__ */ (() => typeof GM_notification != "undefined" ? GM_notification : void 0)();
  2113. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  2114. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  2115. const functions = {
  2116. //获取所有回复
  2117. getAllReply(repliesMap = []) {
  2118. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  2119. pre = pre.concat(i.replyList);
  2120. return pre;
  2121. }, []);
  2122. },
  2123. //查找子回复
  2124. findChildren(item, endList, all) {
  2125. var _a;
  2126. const fn = (child, endList2, parent) => {
  2127. child.level = parent.level + 1;
  2128. let rIndex = all.findIndex((v) => v.floor === child.floor);
  2129. if (rIndex > -1) {
  2130. all[rIndex].isUse = true;
  2131. }
  2132. parent.children.push(this.findChildren(child, endList2, all));
  2133. };
  2134. item.children = [];
  2135. let floorReplyList = [];
  2136. for (let i = 0; i < endList.length; i++) {
  2137. let currentItem = endList[i];
  2138. if (currentItem.isUse)
  2139. continue;
  2140. if (currentItem.replyFloor === item.floor) {
  2141. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  2142. currentItem.isUse = true;
  2143. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  2144. } else {
  2145. currentItem.isWrong = true;
  2146. }
  2147. }
  2148. }
  2149. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  2150. fn(currentItem, endList2, item);
  2151. });
  2152. let nextMeIndex = endList.findIndex((v) => {
  2153. var _a2;
  2154. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  2155. });
  2156. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  2157. for (let i = 0; i < findList.length; i++) {
  2158. let currentItem = findList[i];
  2159. if (currentItem.isUse)
  2160. continue;
  2161. if (currentItem.replyUsers.length === 1) {
  2162. if (currentItem.replyFloor !== -1) {
  2163. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  2164. continue;
  2165. }
  2166. }
  2167. let endList2 = endList.slice(i + 1);
  2168. if (currentItem.username === item.username) {
  2169. if (currentItem.replyUsers[0] === item.username) {
  2170. fn(currentItem, endList2, item);
  2171. }
  2172. break;
  2173. } else {
  2174. if (currentItem.replyUsers[0] === item.username) {
  2175. fn(currentItem, endList2, item);
  2176. }
  2177. }
  2178. } else {
  2179. if (currentItem.username === item.username)
  2180. break;
  2181. }
  2182. }
  2183. item.children = item.children.sort((a, b) => a.floor - b.floor);
  2184. return item;
  2185. },
  2186. //生成嵌套回复
  2187. createNestedList(allList = []) {
  2188. if (!allList.length)
  2189. return [];
  2190. let list = window.clone(allList);
  2191. let nestedList = [];
  2192. list.map((item, index) => {
  2193. let startList = list.slice(0, index);
  2194. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  2195. let endList = list.slice(index + 1);
  2196. if (index === 0) {
  2197. nestedList.push(this.findChildren(item, endList, list));
  2198. } else {
  2199. if (!item.isUse) {
  2200. let isOneLevelReply = false;
  2201. if (item.replyUsers.length) {
  2202. if (item.replyUsers.length > 1) {
  2203. isOneLevelReply = true;
  2204. } else {
  2205. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  2206. }
  2207. } else {
  2208. isOneLevelReply = true;
  2209. }
  2210. if (isOneLevelReply) {
  2211. item.level = 0;
  2212. nestedList.push(this.findChildren(item, endList, list));
  2213. }
  2214. }
  2215. }
  2216. });
  2217. return nestedList;
  2218. },
  2219. //生成嵌套冗余回复
  2220. createNestedRedundantList(allList = []) {
  2221. if (!allList.length)
  2222. return [];
  2223. let list = window.clone(allList);
  2224. let nestedList = [];
  2225. list.map((item, index) => {
  2226. let startList = list.slice(0, index);
  2227. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  2228. let endList = list.slice(index + 1);
  2229. if (index === 0) {
  2230. nestedList.push(this.findChildren(item, endList, list));
  2231. } else {
  2232. if (!item.isUse) {
  2233. let isOneLevelReply = false;
  2234. if (item.replyUsers.length) {
  2235. if (item.replyUsers.length > 1) {
  2236. isOneLevelReply = true;
  2237. } else {
  2238. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  2239. }
  2240. } else {
  2241. isOneLevelReply = true;
  2242. }
  2243. if (isOneLevelReply) {
  2244. item.level = 0;
  2245. nestedList.push(this.findChildren(item, endList, list));
  2246. }
  2247. } else {
  2248. let newItem = window.clone(item);
  2249. newItem.children = [];
  2250. newItem.level = 0;
  2251. newItem.isDup = true;
  2252. nestedList.push(newItem);
  2253. }
  2254. }
  2255. });
  2256. return nestedList;
  2257. },
  2258. //解析A标签
  2259. parseA(a) {
  2260. let href = a.href;
  2261. let id;
  2262. if (href.includes("/t/")) {
  2263. id = a.pathname.substring("/t/".length);
  2264. }
  2265. return { href, id, title: a.innerText };
  2266. },
  2267. //图片链接转Img标签
  2268. checkPhotoLink2Img(str) {
  2269. if (!str)
  2270. return;
  2271. try {
  2272. let imgWebs = [
  2273. /<a((?!<a).)*href="https?:\/\/((?!<a).)*imgur.com((?!<a).)*>(((?!<a).)*)<\/a>/g,
  2274. /<a((?!<a).)*href="https?:\/\/((?!<a).)*\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG) ((?!<a).)*>(((?!<a).)*)<\/a>/g
  2275. ];
  2276. imgWebs.map((v, i) => {
  2277. let has = str.matchAll(v);
  2278. let res2 = [...has];
  2279. res2.map((r2) => {
  2280. let p = i === 0 ? r2[4] : r2[5];
  2281. if (p) {
  2282. let link = p.toLowerCase();
  2283. let src = p;
  2284. if (link.includes(".png") || link.includes(".jpg") || link.includes(".jpeg") || link.includes(".gif")) {
  2285. } else {
  2286. src = p + ".png";
  2287. }
  2288. str = str.replace(r2[0], `<img src="${src}" data-originUrl="${p}" data-notice="此img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`);
  2289. }
  2290. });
  2291. });
  2292. } catch (e2) {
  2293. console.log("正则解析html里面的a标签的图片链接出错了");
  2294. }
  2295. return str;
  2296. },
  2297. //检测帖子回复长度
  2298. async checkPostReplies(id, needOpen = true) {
  2299. return new Promise(async (resolve) => {
  2300. let res = await functions.getPostDetailByApi(id);
  2301. if ((res == null ? void 0 : res.replies) > MAX_REPLY_LIMIT) {
  2302. if (needOpen) {
  2303. functions.openNewTab(`https://${location.origin}/t/${id}?p=1&script=1`);
  2304. }
  2305. return resolve(true);
  2306. }
  2307. resolve(false);
  2308. });
  2309. },
  2310. async sleep(time) {
  2311. return new Promise((resolve) => {
  2312. setTimeout(resolve, time);
  2313. });
  2314. },
  2315. //打开新标签页
  2316. openNewTab(href, active = false) {
  2317. _GM_openInTab(href, { active });
  2318. },
  2319. async cbChecker(val, count = 0) {
  2320. if (window.cb) {
  2321. window.cb(val);
  2322. } else {
  2323. while (!window.cb && count < 30) {
  2324. await functions.sleep(500);
  2325. count++;
  2326. }
  2327. window.cb && window.cb(val);
  2328. }
  2329. },
  2330. //初始化脚本菜单
  2331. initMonkeyMenu() {
  2332. try {
  2333. _GM_registerMenuCommand("脚本设置", () => {
  2334. functions.cbChecker({ type: "openSetting" });
  2335. });
  2336. _GM_registerMenuCommand("仓库地址", () => {
  2337. functions.openNewTab(window.const.git);
  2338. });
  2339. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  2340. } catch (e2) {
  2341. console.error("无法使用Tampermonkey");
  2342. }
  2343. },
  2344. clone(val) {
  2345. return JSON.parse(JSON.stringify(val));
  2346. },
  2347. feedback() {
  2348. functions.openNewTab(DefaultVal.issue);
  2349. },
  2350. //检测页面类型
  2351. checkPageType(a) {
  2352. let l = a || window.location;
  2353. let data = { pageType: null, pageData: { id: "", pageNo: null } };
  2354. if (l.pathname === "/") {
  2355. data.pageType = PageType.Home;
  2356. } else if (l.pathname === "/changes") {
  2357. data.pageType = PageType.Changes;
  2358. } else if (l.pathname === "/recent") {
  2359. data.pageType = PageType.Changes;
  2360. } else if (l.href.match(/.com\/?tab=/)) {
  2361. data.pageType = PageType.Home;
  2362. } else if (l.href.match(/.com\/go\//)) {
  2363. if (!l.href.includes("/links")) {
  2364. data.pageType = PageType.Node;
  2365. }
  2366. } else if (l.href.match(/.com\/member/)) {
  2367. data.pageType = PageType.Member;
  2368. } else {
  2369. let r2 = l.href.match(/.com\/t\/([\d]+)/);
  2370. if (r2 && !l.pathname.includes("review") && !l.pathname.includes("info")) {
  2371. data.pageType = PageType.Post;
  2372. data.pageData.id = r2[1];
  2373. if (l.search) {
  2374. let pr = l.href.match(/\?p=([\d]+)/);
  2375. if (pr)
  2376. data.pageData.pageNo = Number(pr[1]);
  2377. }
  2378. }
  2379. }
  2380. return data;
  2381. },
  2382. //通过api获取主题详情
  2383. getPostDetailByApi(id) {
  2384. return new Promise((resolve) => {
  2385. fetch(`${location.origin}/api/topics/show.json?id=${id}`).then(async (r2) => {
  2386. if (r2.status === 200) {
  2387. let res = await r2.json();
  2388. if (res) {
  2389. let d2 = res[0];
  2390. resolve(d2);
  2391. }
  2392. }
  2393. });
  2394. });
  2395. },
  2396. appendPostContent(res, el) {
  2397. let a = document.createElement("a");
  2398. a.href = res.href;
  2399. a.classList.add("post-content");
  2400. let div = document.createElement("div");
  2401. div.innerHTML = res.content_rendered;
  2402. a.append(div);
  2403. el.append(a);
  2404. const checkHeight2 = () => {
  2405. var _a;
  2406. if (div.clientHeight < 300) {
  2407. a.classList.add("show-all");
  2408. } else {
  2409. let showMore = document.createElement("div");
  2410. showMore.classList.add("show-more");
  2411. showMore.innerHTML = "显示更多/收起";
  2412. showMore.onclick = function(e2) {
  2413. e2.stopPropagation();
  2414. a.classList.toggle("show-all");
  2415. };
  2416. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  2417. }
  2418. };
  2419. checkHeight2();
  2420. },
  2421. //从本地读取配置
  2422. initConfig() {
  2423. return new Promise((resolve) => {
  2424. let configStr = localStorage.getItem("v2ex-config");
  2425. if (configStr) {
  2426. let configObj = JSON.parse(configStr);
  2427. configObj = configObj[window.user.username ?? "default"];
  2428. if (configObj) {
  2429. window.config = Object.assign(window.config, configObj);
  2430. }
  2431. }
  2432. resolve(window.config);
  2433. });
  2434. }
  2435. };
  2436. const DefaultPost = {
  2437. allReplyUsers: [],
  2438. content_rendered: "",
  2439. createDate: "",
  2440. createDateAgo: "",
  2441. lastReplyDate: "",
  2442. fr: "",
  2443. replyList: [],
  2444. nestedReplies: [],
  2445. nestedRedundReplies: [],
  2446. username: "",
  2447. url: "",
  2448. href: "",
  2449. member: {},
  2450. node: {
  2451. title: "",
  2452. url: ""
  2453. },
  2454. headerTemplate: "",
  2455. title: "",
  2456. id: "",
  2457. type: "post",
  2458. once: "",
  2459. replyCount: 0,
  2460. clickCount: 0,
  2461. thankCount: 0,
  2462. collectCount: 0,
  2463. lastReadFloor: 0,
  2464. isFavorite: false,
  2465. isIgnore: false,
  2466. isThanked: false,
  2467. isReport: false,
  2468. inList: false
  2469. };
  2470. const DefaultUser = {
  2471. tagPrefix: "--用户标签--",
  2472. tags: {},
  2473. tagsId: "",
  2474. username: "",
  2475. avatar: "",
  2476. readPrefix: "--已读楼层--",
  2477. readNoteItemId: "",
  2478. readList: {},
  2479. imgurPrefix: "--imgur图片删除hash--",
  2480. imgurList: {},
  2481. imgurNoteId: ""
  2482. };
  2483. const DefaultConfig = {
  2484. showToolbar: true,
  2485. autoOpenDetail: true,
  2486. openTag: false,
  2487. //给用户打标签
  2488. clickPostItemOpenDetail: true,
  2489. closePostDetailBySpace: true,
  2490. //点击空白处关闭详情
  2491. contentAutoCollapse: true,
  2492. //正文超长自动折叠
  2493. viewType: "table",
  2494. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  2495. newTabOpen: false,
  2496. //新标签打开
  2497. newTabOpenActive: false,
  2498. base64: true,
  2499. //base功能
  2500. sov2ex: false,
  2501. postWidth: "",
  2502. showTopReply: true,
  2503. topReplyLoveMinCount: 3,
  2504. topReplyCount: 3,
  2505. autoJumpLastReadFloor: false,
  2506. rememberLastReadFloor: false,
  2507. autoSignin: true,
  2508. customBgColor: "",
  2509. version: 1,
  2510. collectBrowserNotice: false,
  2511. fontSizeType: "normal"
  2512. };
  2513. const DefaultVal = {
  2514. pageType: void 0,
  2515. pageData: { pageNo: 1 },
  2516. targetUserName: "",
  2517. currentVersion: 1,
  2518. isNight: false,
  2519. cb: null,
  2520. stopMe: null,
  2521. postList: [],
  2522. git: "https://github.com/zyronon/web-scripts",
  2523. shortGit: "zyronon/web-scripts",
  2524. issue: "https://github.com/zyronon/web-scripts/issues",
  2525. pcLog: "https://greasyfork.org/zh-CN/scripts/458024/versions",
  2526. pcScript: "https://greasyfork.org/zh-CN/scripts/458024",
  2527. mobileScript: "https://greasyfork.org/zh-CN/scripts/485356",
  2528. homeUrl: "https://v2next.netlify.app/"
  2529. };
  2530. const _sfc_main$l = {
  2531. name: "Setting",
  2532. components: {
  2533. FontSizeType,
  2534. BaseSelect,
  2535. NavBar,
  2536. BaseSwitch,
  2537. Tooltip,
  2538. Icon
  2539. },
  2540. emits: ["back"],
  2541. props: {
  2542. modelValue: {
  2543. type: Object,
  2544. default() {
  2545. return {};
  2546. }
  2547. },
  2548. show: {
  2549. type: Boolean,
  2550. default() {
  2551. return false;
  2552. }
  2553. },
  2554. to: {
  2555. type: String,
  2556. default() {
  2557. return "";
  2558. }
  2559. }
  2560. },
  2561. data() {
  2562. return {
  2563. activeEruda: !!localStorage.getItem("active-eruda"),
  2564. config: window.clone(this.modelValue)
  2565. };
  2566. },
  2567. computed: {
  2568. DefaultVal() {
  2569. return DefaultVal;
  2570. },
  2571. functions() {
  2572. return functions;
  2573. },
  2574. CommentDisplayType() {
  2575. return CommentDisplayType;
  2576. },
  2577. isNew() {
  2578. return this.config.version < window.currentVersion;
  2579. }
  2580. },
  2581. watch: {
  2582. config: {
  2583. handler(n2) {
  2584. n2.topReplyLoveMinCount = Math.trunc(n2.topReplyLoveMinCount);
  2585. if (n2.topReplyLoveMinCount < 0) {
  2586. n2.topReplyLoveMinCount = 1;
  2587. }
  2588. this.$emit("update:modelValue", n2);
  2589. },
  2590. deep: true
  2591. },
  2592. activeEruda(n2) {
  2593. if (n2) {
  2594. localStorage.setItem("active-eruda", 1);
  2595. } else {
  2596. localStorage.setItem("active-eruda", "");
  2597. }
  2598. }
  2599. }
  2600. };
  2601. const _withScopeId$d = (n2) => (vue.pushScopeId("data-v-424a2b09"), n2 = n2(), vue.popScopeId(), n2);
  2602. const _hoisted_1$k = { class: "mobile-page" };
  2603. const _hoisted_2$g = { class: "page-content" };
  2604. const _hoisted_3$d = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2605. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "关于脚本")
  2606. ], -1));
  2607. const _hoisted_4$c = { class: "row" };
  2608. const _hoisted_5$a = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "GitHub", -1));
  2609. const _hoisted_6$9 = { class: "wrapper" };
  2610. const _hoisted_7$8 = ["href"];
  2611. const _hoisted_8$8 = { class: "row" };
  2612. const _hoisted_9$8 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "反馈 & 建议", -1));
  2613. const _hoisted_10$7 = { class: "wrapper" };
  2614. const _hoisted_11$7 = ["href"];
  2615. const _hoisted_12$7 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2616. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "列表设置")
  2617. ], -1));
  2618. const _hoisted_13$7 = { class: "row" };
  2619. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表展示方式", -1));
  2620. const _hoisted_15$6 = { class: "wrapper" };
  2621. const _hoisted_16$6 = { class: "radio-group2" };
  2622. const _hoisted_17$3 = { class: "row" };
  2623. const _hoisted_18$3 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "帖子弹框显示", -1));
  2624. const _hoisted_19$3 = { class: "wrapper" };
  2625. const _hoisted_20$3 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此选项后,帖子始终会以弹框的方式显示。优先级大于“新标签页打开链接” ", -1));
  2626. const _hoisted_21$2 = { class: "row" };
  2627. const _hoisted_22$2 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "新标签页打开链接", -1));
  2628. const _hoisted_23$2 = { class: "wrapper" };
  2629. const _hoisted_24$2 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 网页上所有链接通过新标签页打开 ", -1));
  2630. const _hoisted_25$2 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2631. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "主题设置")
  2632. ], -1));
  2633. const _hoisted_26$1 = { class: "row" };
  2634. const _hoisted_27$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "回复展示方式", -1));
  2635. const _hoisted_28$1 = { class: "wrapper" };
  2636. const _hoisted_29$1 = { class: "row" };
  2637. const _hoisted_30$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "正文超长自动折叠", -1));
  2638. const _hoisted_31$1 = { class: "wrapper" };
  2639. const _hoisted_32$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2640. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "高赞回复")
  2641. ], -1));
  2642. const _hoisted_33$1 = { class: "row" };
  2643. const _hoisted_34$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示高赞回复", -1));
  2644. const _hoisted_35$1 = { class: "wrapper" };
  2645. const _hoisted_36$1 = { class: "row" };
  2646. const _hoisted_37$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "最多显示多少个高赞回复", -1));
  2647. const _hoisted_38$1 = { class: "wrapper" };
  2648. const _hoisted_39$1 = { class: "row" };
  2649. const _hoisted_40 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "最少需要多少赞才能被判定为高赞", -1));
  2650. const _hoisted_41 = { class: "wrapper" };
  2651. const _hoisted_42 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2652. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "记忆阅读")
  2653. ], -1));
  2654. const _hoisted_43 = { class: "row" };
  2655. const _hoisted_44 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "记录上次阅读楼层(误差1层左右):", -1));
  2656. const _hoisted_45 = { class: "wrapper" };
  2657. const _hoisted_46 = { class: "row" };
  2658. const _hoisted_47 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "打开帖子自动跳转到上次阅读楼层", -1));
  2659. const _hoisted_48 = { class: "wrapper" };
  2660. const _hoisted_49 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2661. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "其他设置")
  2662. ], -1));
  2663. const _hoisted_50 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2664. /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "字体设置")
  2665. ], -1));
  2666. const _hoisted_51 = { class: "row" };
  2667. const _hoisted_52 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "用户打标签(跨平台,数据保存在自己的记事本):", -1));
  2668. const _hoisted_53 = { class: "wrapper" };
  2669. const _hoisted_54 = { class: "row" };
  2670. const _hoisted_55 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "划词显示Base64解码框", -1));
  2671. const _hoisted_56 = { class: "wrapper" };
  2672. const _hoisted_57 = { class: "row" };
  2673. const _hoisted_58 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自动签到", -1));
  2674. const _hoisted_59 = { class: "wrapper" };
  2675. const _hoisted_60 = { class: "row" };
  2676. const _hoisted_61 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "收藏时提醒添加到书签", -1));
  2677. const _hoisted_62 = { class: "wrapper" };
  2678. const _hoisted_63 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " V站帐号一旦被封禁,则无法登录,无法查看账号收藏了 ", -1));
  2679. const _hoisted_64 = { class: "row" };
  2680. const _hoisted_65 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "调试模式", -1));
  2681. const _hoisted_66 = { class: "wrapper" };
  2682. const _hoisted_67 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此项会显示调试控制台,刷新页面生效 ", -1));
  2683. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  2684. const _component_NavBar = vue.resolveComponent("NavBar");
  2685. const _component_BaseSwitch = vue.resolveComponent("BaseSwitch");
  2686. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  2687. const _component_font_size_type = vue.resolveComponent("font-size-type");
  2688. return vue.openBlock(), vue.createBlock(vue.Teleport, { to: $props.to }, [
  2689. vue.createElementVNode("div", _hoisted_1$k, [
  2690. vue.createVNode(_component_NavBar, {
  2691. title: "设置",
  2692. onBack: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("back"))
  2693. }),
  2694. vue.createElementVNode("div", _hoisted_2$g, [
  2695. _hoisted_3$d,
  2696. vue.createElementVNode("div", _hoisted_4$c, [
  2697. _hoisted_5$a,
  2698. vue.createElementVNode("div", _hoisted_6$9, [
  2699. vue.createElementVNode("a", {
  2700. href: $options.DefaultVal.git,
  2701. target: "_blank"
  2702. }, vue.toDisplayString($options.DefaultVal.shortGit), 9, _hoisted_7$8)
  2703. ])
  2704. ]),
  2705. vue.createElementVNode("div", _hoisted_8$8, [
  2706. _hoisted_9$8,
  2707. vue.createElementVNode("div", _hoisted_10$7, [
  2708. vue.createElementVNode("a", {
  2709. href: $options.DefaultVal.issue,
  2710. target: "_blank"
  2711. }, "点此填写Issue", 8, _hoisted_11$7)
  2712. ])
  2713. ]),
  2714. _hoisted_12$7,
  2715. vue.createElementVNode("div", _hoisted_13$7, [
  2716. _hoisted_14$6,
  2717. vue.createElementVNode("div", _hoisted_15$6, [
  2718. vue.createElementVNode("div", _hoisted_16$6, [
  2719. vue.createElementVNode("div", {
  2720. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  2721. onClick: _cache[1] || (_cache[1] = ($event) => $data.config.viewType = "table")
  2722. }, "表格 ", 2),
  2723. vue.createElementVNode("div", {
  2724. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  2725. onClick: _cache[2] || (_cache[2] = ($event) => $data.config.viewType = "card")
  2726. }, "卡片 ", 2)
  2727. ])
  2728. ])
  2729. ]),
  2730. vue.createElementVNode("div", _hoisted_17$3, [
  2731. _hoisted_18$3,
  2732. vue.createElementVNode("div", _hoisted_19$3, [
  2733. vue.createVNode(_component_BaseSwitch, {
  2734. modelValue: $data.config.clickPostItemOpenDetail,
  2735. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.config.clickPostItemOpenDetail = $event)
  2736. }, null, 8, ["modelValue"])
  2737. ])
  2738. ]),
  2739. _hoisted_20$3,
  2740. vue.createElementVNode("div", _hoisted_21$2, [
  2741. _hoisted_22$2,
  2742. vue.createElementVNode("div", _hoisted_23$2, [
  2743. vue.createVNode(_component_BaseSwitch, {
  2744. modelValue: $data.config.newTabOpen,
  2745. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.config.newTabOpen = $event)
  2746. }, null, 8, ["modelValue"])
  2747. ])
  2748. ]),
  2749. _hoisted_24$2,
  2750. _hoisted_25$2,
  2751. vue.createElementVNode("div", _hoisted_26$1, [
  2752. _hoisted_27$1,
  2753. vue.createElementVNode("div", _hoisted_28$1, [
  2754. vue.createVNode(_component_BaseSelect, {
  2755. "display-type": $data.config.commentDisplayType,
  2756. "onUpdate:displayType": _cache[5] || (_cache[5] = ($event) => $data.config.commentDisplayType = $event)
  2757. }, null, 8, ["display-type"])
  2758. ])
  2759. ]),
  2760. vue.createElementVNode("div", _hoisted_29$1, [
  2761. _hoisted_30$1,
  2762. vue.createElementVNode("div", _hoisted_31$1, [
  2763. vue.createVNode(_component_BaseSwitch, {
  2764. modelValue: $data.config.contentAutoCollapse,
  2765. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.config.contentAutoCollapse = $event)
  2766. }, null, 8, ["modelValue"])
  2767. ])
  2768. ]),
  2769. _hoisted_32$1,
  2770. vue.createElementVNode("div", _hoisted_33$1, [
  2771. _hoisted_34$1,
  2772. vue.createElementVNode("div", _hoisted_35$1, [
  2773. vue.createVNode(_component_BaseSwitch, {
  2774. modelValue: $data.config.showTopReply,
  2775. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.config.showTopReply = $event)
  2776. }, null, 8, ["modelValue"])
  2777. ])
  2778. ]),
  2779. vue.createElementVNode("div", _hoisted_36$1, [
  2780. _hoisted_37$1,
  2781. vue.createElementVNode("div", _hoisted_38$1, [
  2782. vue.withDirectives(vue.createElementVNode("input", {
  2783. type: "number",
  2784. min: "1",
  2785. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.config.topReplyCount = $event)
  2786. }, null, 512), [
  2787. [vue.vModelText, $data.config.topReplyCount]
  2788. ])
  2789. ])
  2790. ]),
  2791. vue.createElementVNode("div", _hoisted_39$1, [
  2792. _hoisted_40,
  2793. vue.createElementVNode("div", _hoisted_41, [
  2794. vue.withDirectives(vue.createElementVNode("input", {
  2795. type: "number",
  2796. min: "1",
  2797. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.config.topReplyLoveMinCount = $event)
  2798. }, null, 512), [
  2799. [vue.vModelText, $data.config.topReplyLoveMinCount]
  2800. ])
  2801. ])
  2802. ]),
  2803. _hoisted_42,
  2804. vue.createElementVNode("div", _hoisted_43, [
  2805. _hoisted_44,
  2806. vue.createElementVNode("div", _hoisted_45, [
  2807. vue.createVNode(_component_BaseSwitch, {
  2808. "model-value": $data.config.rememberLastReadFloor,
  2809. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => {
  2810. $data.config.rememberLastReadFloor = !$data.config.rememberLastReadFloor;
  2811. $data.config.autoJumpLastReadFloor = false;
  2812. })
  2813. }, null, 8, ["model-value"])
  2814. ])
  2815. ]),
  2816. vue.createElementVNode("div", _hoisted_46, [
  2817. _hoisted_47,
  2818. vue.createElementVNode("div", _hoisted_48, [
  2819. vue.createVNode(_component_BaseSwitch, {
  2820. modelValue: $data.config.autoJumpLastReadFloor,
  2821. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.config.autoJumpLastReadFloor = $event)
  2822. }, null, 8, ["modelValue"])
  2823. ])
  2824. ]),
  2825. _hoisted_49,
  2826. _hoisted_50,
  2827. vue.createVNode(_component_font_size_type),
  2828. vue.createElementVNode("div", _hoisted_51, [
  2829. _hoisted_52,
  2830. vue.createElementVNode("div", _hoisted_53, [
  2831. vue.createVNode(_component_BaseSwitch, {
  2832. modelValue: $data.config.openTag,
  2833. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.config.openTag = $event)
  2834. }, null, 8, ["modelValue"])
  2835. ])
  2836. ]),
  2837. vue.createElementVNode("div", _hoisted_54, [
  2838. _hoisted_55,
  2839. vue.createElementVNode("div", _hoisted_56, [
  2840. vue.createVNode(_component_BaseSwitch, {
  2841. modelValue: $data.config.base64,
  2842. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.config.base64 = $event)
  2843. }, null, 8, ["modelValue"])
  2844. ])
  2845. ]),
  2846. vue.createElementVNode("div", _hoisted_57, [
  2847. _hoisted_58,
  2848. vue.createElementVNode("div", _hoisted_59, [
  2849. vue.createVNode(_component_BaseSwitch, {
  2850. modelValue: $data.config.autoSignin,
  2851. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.config.autoSignin = $event)
  2852. }, null, 8, ["modelValue"])
  2853. ])
  2854. ]),
  2855. vue.createElementVNode("div", _hoisted_60, [
  2856. _hoisted_61,
  2857. vue.createElementVNode("div", _hoisted_62, [
  2858. vue.createVNode(_component_BaseSwitch, {
  2859. modelValue: $data.config.collectBrowserNotice,
  2860. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.config.collectBrowserNotice = $event)
  2861. }, null, 8, ["modelValue"])
  2862. ])
  2863. ]),
  2864. _hoisted_63,
  2865. vue.createElementVNode("div", _hoisted_64, [
  2866. _hoisted_65,
  2867. vue.createElementVNode("div", _hoisted_66, [
  2868. vue.createVNode(_component_BaseSwitch, {
  2869. modelValue: $data.activeEruda,
  2870. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.activeEruda = $event)
  2871. }, null, 8, ["modelValue"])
  2872. ])
  2873. ]),
  2874. _hoisted_67
  2875. ])
  2876. ])
  2877. ], 8, ["to"]);
  2878. }
  2879. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$9], ["__scopeId", "data-v-424a2b09"]]);
  2880. const _sfc_main$k = {
  2881. name: "Point",
  2882. components: { Icon },
  2883. inject: ["post", "isLogin"],
  2884. props: {
  2885. item: {
  2886. type: Object,
  2887. default() {
  2888. return {};
  2889. }
  2890. },
  2891. full: {
  2892. type: Boolean,
  2893. default() {
  2894. return true;
  2895. }
  2896. },
  2897. apiUrl: ""
  2898. },
  2899. methods: {
  2900. thankError() {
  2901. if (!this.isLogin) {
  2902. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  2903. }
  2904. if (this.item.username === window.user.username) {
  2905. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  2906. }
  2907. if (this.item.isThanked) {
  2908. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  2909. }
  2910. this.thank();
  2911. },
  2912. async thank() {
  2913. this.$emit("addThank");
  2914. let url = `${window.baseUrl}/thank/${this.apiUrl}?once=${this.post.once}`;
  2915. $.post(url).then((res) => {
  2916. if (!res.success) {
  2917. this.$emit("recallThank");
  2918. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  2919. }
  2920. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  2921. }, (err) => {
  2922. this.$emit("recallThank");
  2923. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  2924. eventBus.emit(CMD.REFRESH_ONCE);
  2925. });
  2926. }
  2927. }
  2928. };
  2929. const _hoisted_1$j = {
  2930. key: 2,
  2931. class: "link-num"
  2932. };
  2933. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  2934. const _component_Icon = vue.resolveComponent("Icon");
  2935. return vue.openBlock(), vue.createElementBlock("div", {
  2936. class: "tool",
  2937. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  2938. }, [
  2939. $props.item.isThanked ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  2940. key: 0,
  2941. color: "red",
  2942. icon: "icon-park-solid:like"
  2943. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  2944. key: 1,
  2945. color: "rgb(224,42,42)",
  2946. icon: "icon-park-outline:like"
  2947. })),
  2948. $props.item.thankCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, vue.toDisplayString($props.item.thankCount), 1)) : vue.createCommentVNode("", true)
  2949. ]);
  2950. }
  2951. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$8], ["__scopeId", "data-v-b7c6664e"]]);
  2952. const _sfc_main$j = {};
  2953. const _withScopeId$c = (n2) => (vue.pushScopeId("data-v-e92e0529"), n2 = n2(), vue.popScopeId(), n2);
  2954. const _hoisted_1$i = { class: "more" };
  2955. const _hoisted_2$f = /* @__PURE__ */ _withScopeId$c(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
  2956. const _hoisted_3$c = /* @__PURE__ */ _withScopeId$c(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
  2957. const _hoisted_4$b = /* @__PURE__ */ _withScopeId$c(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
  2958. const _hoisted_5$9 = [
  2959. _hoisted_2$f,
  2960. _hoisted_3$c,
  2961. _hoisted_4$b
  2962. ];
  2963. function _sfc_render$7(_ctx, _cache) {
  2964. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, _hoisted_5$9);
  2965. }
  2966. const MoreIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$7], ["__scopeId", "data-v-e92e0529"]]);
  2967. const _sfc_main$i = {
  2968. name: "Author",
  2969. components: { MoreIcon, Point, Icon },
  2970. inject: ["isLogin", "tags", "config", "isNight"],
  2971. props: {
  2972. modelValue: false,
  2973. comment: {
  2974. type: Object,
  2975. default() {
  2976. return {};
  2977. }
  2978. },
  2979. type: {
  2980. type: String,
  2981. default() {
  2982. return "list";
  2983. }
  2984. }
  2985. },
  2986. computed: {
  2987. eventBus() {
  2988. return eventBus;
  2989. },
  2990. CMD() {
  2991. return CMD;
  2992. },
  2993. pointInfo() {
  2994. return {
  2995. isThanked: this.comment.isThanked,
  2996. thankCount: this.comment.thankCount,
  2997. username: this.comment.username
  2998. };
  2999. },
  3000. myTags() {
  3001. return this.tags[this.comment.username] ?? [];
  3002. }
  3003. },
  3004. methods: {
  3005. addTag() {
  3006. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  3007. },
  3008. removeTag(tag) {
  3009. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  3010. },
  3011. checkIsLogin(emitName = "") {
  3012. if (!this.isLogin) {
  3013. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  3014. return false;
  3015. }
  3016. this.$emit(emitName);
  3017. return true;
  3018. },
  3019. addThank() {
  3020. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  3021. },
  3022. recallThank() {
  3023. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  3024. }
  3025. }
  3026. };
  3027. const _withScopeId$b = (n2) => (vue.pushScopeId("data-v-9041586a"), n2 = n2(), vue.popScopeId(), n2);
  3028. const _hoisted_1$h = { class: "Author-left" };
  3029. const _hoisted_2$e = ["href"];
  3030. const _hoisted_3$b = ["src"];
  3031. const _hoisted_4$a = { class: "info" };
  3032. const _hoisted_5$8 = { class: "top" };
  3033. const _hoisted_6$8 = { class: "texts" };
  3034. const _hoisted_7$7 = ["href"];
  3035. const _hoisted_8$7 = {
  3036. key: 0,
  3037. class: "owner"
  3038. };
  3039. const _hoisted_9$7 = {
  3040. key: 1,
  3041. class: "dup"
  3042. };
  3043. const _hoisted_10$6 = {
  3044. key: 2,
  3045. class: "mod"
  3046. };
  3047. const _hoisted_11$6 = { class: "my-tag" };
  3048. const _hoisted_12$6 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3049. const _hoisted_13$6 = ["onClick"];
  3050. const _hoisted_14$5 = { class: "floor" };
  3051. const _hoisted_15$5 = { class: "ago" };
  3052. const _hoisted_16$5 = { class: "Author-right" };
  3053. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  3054. const _component_Icon = vue.resolveComponent("Icon");
  3055. const _component_Point = vue.resolveComponent("Point");
  3056. const _component_MoreIcon = vue.resolveComponent("MoreIcon");
  3057. return vue.openBlock(), vue.createElementBlock("div", {
  3058. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  3059. }, [
  3060. vue.createElementVNode("div", _hoisted_1$h, [
  3061. !$props.modelValue ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3062. key: 0,
  3063. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", true)),
  3064. color: "#177EC9",
  3065. class: "expand-icon",
  3066. icon: "gravity-ui:chevrons-expand-up-right"
  3067. })) : vue.createCommentVNode("", true),
  3068. $options.config.viewType !== "simple" ? (vue.openBlock(), vue.createElementBlock("a", {
  3069. key: 1,
  3070. class: "base-avatar",
  3071. href: `/member/${$props.comment.username}`
  3072. }, [
  3073. vue.createElementVNode("img", {
  3074. src: $props.comment.avatar,
  3075. alt: ""
  3076. }, null, 8, _hoisted_3$b)
  3077. ], 8, _hoisted_2$e)) : vue.createCommentVNode("", true),
  3078. vue.createElementVNode("div", _hoisted_4$a, [
  3079. vue.createElementVNode("div", _hoisted_5$8, [
  3080. vue.createElementVNode("span", _hoisted_6$8, [
  3081. vue.createElementVNode("strong", null, [
  3082. vue.createElementVNode("a", {
  3083. href: `/member/${$props.comment.username}`,
  3084. class: vue.normalizeClass(["username", { "dark": $options.isNight }])
  3085. }, vue.toDisplayString($props.comment.username), 11, _hoisted_7$7)
  3086. ]),
  3087. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$7, "OP")) : vue.createCommentVNode("", true),
  3088. $props.comment.isDup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$7, "DUP")) : vue.createCommentVNode("", true),
  3089. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$6, "MOD")) : vue.createCommentVNode("", true),
  3090. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  3091. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  3092. return vue.openBlock(), vue.createElementBlock("span", _hoisted_11$6, [
  3093. _hoisted_12$6,
  3094. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  3095. vue.createElementVNode("i", {
  3096. class: "fa fa-trash-o remove",
  3097. onClick: ($event) => $options.removeTag(i)
  3098. }, null, 8, _hoisted_13$6)
  3099. ]);
  3100. }), 256)),
  3101. vue.createElementVNode("span", {
  3102. class: "add-tag ago",
  3103. onClick: _cache[1] || (_cache[1] = (...args) => $options.addTag && $options.addTag(...args)),
  3104. title: "添加标签"
  3105. }, "+")
  3106. ], 64)) : vue.createCommentVNode("", true)
  3107. ])
  3108. ]),
  3109. vue.createElementVNode("div", null, [
  3110. vue.createElementVNode("span", _hoisted_14$5, vue.toDisplayString($props.comment.floor) + "楼", 1),
  3111. vue.createElementVNode("span", _hoisted_15$5, vue.toDisplayString($props.comment.date), 1)
  3112. ])
  3113. ])
  3114. ]),
  3115. vue.createElementVNode("div", _hoisted_16$5, [
  3116. vue.withDirectives(vue.createVNode(_component_Point, {
  3117. item: $options.pointInfo,
  3118. onAddThank: $options.addThank,
  3119. onRecallThank: $options.recallThank,
  3120. "api-url": "reply/" + $props.comment.id
  3121. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3122. [vue.vShow, $props.comment.thankCount]
  3123. ]),
  3124. vue.createVNode(_component_MoreIcon, {
  3125. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => $options.eventBus.emit($options.CMD.SHOW_COMMENT_OPTIONS, { ...$props.comment, top: $props.type === "top" }), ["stop"]))
  3126. })
  3127. ])
  3128. ], 2);
  3129. }
  3130. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$6], ["__scopeId", "data-v-9041586a"]]);
  3131. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  3132. __name: "BaseLoading",
  3133. props: {
  3134. size: { default: "normal" }
  3135. },
  3136. setup(__props) {
  3137. return (_ctx, _cache) => {
  3138. return vue.openBlock(), vue.createElementBlock("div", {
  3139. class: vue.normalizeClass(["loading", [_ctx.size]])
  3140. }, null, 2);
  3141. };
  3142. }
  3143. });
  3144. const BaseLoading = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-2697baa2"]]);
  3145. const _hoisted_1$g = {
  3146. key: 1,
  3147. class: "key-notice"
  3148. };
  3149. const _hoisted_2$d = { class: "key" };
  3150. const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
  3151. __name: "BaseButton",
  3152. props: {
  3153. keyboard: {},
  3154. active: { type: Boolean },
  3155. disabled: { type: Boolean },
  3156. loading: { type: Boolean },
  3157. size: { default: "normal" },
  3158. type: { default: "primary" }
  3159. },
  3160. emits: ["click"],
  3161. setup(__props) {
  3162. return (_ctx, _cache) => {
  3163. return vue.openBlock(), vue.createBlock(Tooltip, {
  3164. disabled: !_ctx.keyboard,
  3165. title: `快捷键: ${_ctx.keyboard}`
  3166. }, {
  3167. default: vue.withCtx(() => [
  3168. vue.createElementVNode("div", vue.mergeProps({ class: "base-button" }, _ctx.$attrs, {
  3169. onClick: _cache[0] || (_cache[0] = (e2) => !_ctx.disabled && !_ctx.loading && _ctx.$emit("click", e2)),
  3170. class: [
  3171. _ctx.active && "active",
  3172. _ctx.size,
  3173. _ctx.type,
  3174. (_ctx.disabled || _ctx.loading) && "disabled",
  3175. !_ctx.disabled && "hvr-grow"
  3176. ]
  3177. }), [
  3178. vue.createElementVNode("span", {
  3179. style: vue.normalizeStyle({ opacity: _ctx.loading ? 0 : 1 })
  3180. }, [
  3181. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  3182. ], 4),
  3183. _ctx.loading ? (vue.openBlock(), vue.createBlock(BaseLoading, {
  3184. key: 0,
  3185. size: "small"
  3186. })) : vue.createCommentVNode("", true),
  3187. _ctx.keyboard ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  3188. vue.createElementVNode("span", _hoisted_2$d, vue.toDisplayString(_ctx.keyboard), 1)
  3189. ])) : vue.createCommentVNode("", true)
  3190. ], 16)
  3191. ]),
  3192. _: 3
  3193. }, 8, ["disabled", "title"]);
  3194. };
  3195. }
  3196. });
  3197. const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-04f4c89d"]]);
  3198. const _withScopeId$a = (n2) => (vue.pushScopeId("data-v-0612e02f"), n2 = n2(), vue.popScopeId(), n2);
  3199. const _hoisted_1$f = { class: "get-cursor" };
  3200. const _hoisted_2$c = ["innerHTML"];
  3201. const _hoisted_3$a = { class: "toolbar" };
  3202. const _hoisted_4$9 = { class: "left" };
  3203. const _hoisted_5$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3204. d: "M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",
  3205. fill: "none",
  3206. stroke: "#929596",
  3207. "stroke-width": "2",
  3208. "stroke-linejoin": "round"
  3209. }, null, -1));
  3210. const _hoisted_6$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3211. d: "M24 35C29 35 31 31 31 31H17C17 31 19 35 24 35Z",
  3212. stroke: "#929596",
  3213. "stroke-width": "2",
  3214. "stroke-linecap": "round",
  3215. "stroke-linejoin": "round"
  3216. }, null, -1));
  3217. const _hoisted_7$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3218. d: "M31 18V22",
  3219. stroke: "#929596",
  3220. "stroke-width": "2",
  3221. "stroke-linecap": "round",
  3222. "stroke-linejoin": "round"
  3223. }, null, -1));
  3224. const _hoisted_8$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3225. d: "M17 18V22",
  3226. stroke: "#929596",
  3227. "stroke-width": "2",
  3228. "stroke-linecap": "round",
  3229. "stroke-linejoin": "round"
  3230. }, null, -1));
  3231. const _hoisted_9$6 = [
  3232. _hoisted_5$7,
  3233. _hoisted_6$7,
  3234. _hoisted_7$6,
  3235. _hoisted_8$6
  3236. ];
  3237. const _hoisted_10$5 = { class: "upload" };
  3238. const _hoisted_11$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  3239. width: "20",
  3240. height: "20",
  3241. viewBox: "0 0 48 48",
  3242. fill: "none",
  3243. xmlns: "http://www.w3.org/2000/svg"
  3244. }, [
  3245. /* @__PURE__ */ vue.createElementVNode("path", {
  3246. "fill-rule": "evenodd",
  3247. "clip-rule": "evenodd",
  3248. d: "M5 10C5 8.89543 5.89543 8 7 8L41 8C42.1046 8 43 8.89543 43 10V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V10Z",
  3249. stroke: "#929596",
  3250. "stroke-width": "2",
  3251. "stroke-linecap": "round",
  3252. "stroke-linejoin": "round"
  3253. }),
  3254. /* @__PURE__ */ vue.createElementVNode("path", {
  3255. "fill-rule": "evenodd",
  3256. "clip-rule": "evenodd",
  3257. d: "M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z",
  3258. stroke: "#929596",
  3259. "stroke-width": "2",
  3260. "stroke-linecap": "round",
  3261. "stroke-linejoin": "round"
  3262. }),
  3263. /* @__PURE__ */ vue.createElementVNode("path", {
  3264. d: "M15 24L20 28L26 21L43 34V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V34L15 24Z",
  3265. fill: "none",
  3266. stroke: "#929596",
  3267. "stroke-width": "2",
  3268. "stroke-linejoin": "round"
  3269. })
  3270. ], -1));
  3271. const _hoisted_12$5 = {
  3272. key: 0,
  3273. style: { "color": "black", "font-size": "1.4rem" }
  3274. };
  3275. const _hoisted_13$5 = { class: "right" };
  3276. const _hoisted_14$4 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典表情", -1));
  3277. const _hoisted_15$4 = { class: "list" };
  3278. const _hoisted_16$4 = ["src", "onClick"];
  3279. const _hoisted_17$2 = { class: "emoji" };
  3280. const _hoisted_18$2 = { class: "title" };
  3281. const _hoisted_19$2 = { class: "list" };
  3282. const _hoisted_20$2 = ["onClick"];
  3283. const _sfc_main$f = {
  3284. __name: "PostEditor",
  3285. props: {
  3286. replyUser: null,
  3287. replyFloor: null,
  3288. useType: {
  3289. type: String,
  3290. default() {
  3291. return "reply-comment";
  3292. }
  3293. }
  3294. },
  3295. emits: ["close"],
  3296. setup(__props, { expose: __expose, emit: __emit }) {
  3297. let props = __props;
  3298. let { replyUser, replyFloor, useType } = props;
  3299. let replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  3300. const emits = __emit;
  3301. const post = vue.inject("post");
  3302. const show = vue.inject("show");
  3303. const isNight = vue.inject("isNight");
  3304. const allReplyUsers = vue.inject("allReplyUsers");
  3305. let isFocus = vue.ref(false);
  3306. const loading = vue.ref(false);
  3307. const uploadLoading = vue.ref(false);
  3308. const isShowEmoticons = vue.ref(false);
  3309. const editorId = vue.ref("editorId_" + Date.now());
  3310. const content = vue.ref(replyInfo);
  3311. const txtRef = vue.ref(null);
  3312. const cursorRef = vue.ref(null);
  3313. const emoticonsRef = vue.ref(null);
  3314. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  3315. vue.watch(props, (n2) => {
  3316. replyUser = props.replyUser;
  3317. replyFloor = props.replyFloor;
  3318. useType = props.useType;
  3319. replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  3320. content.value = replyInfo;
  3321. });
  3322. const emojiEmoticons = [
  3323. {
  3324. title: "小黄脸",
  3325. list: [
  3326. "😀",
  3327. "😁",
  3328. "😂",
  3329. "🤣",
  3330. "😅",
  3331. "😊",
  3332. "😋",
  3333. "😘",
  3334. "🥰",
  3335. "😗",
  3336. "🤩",
  3337. "🤔",
  3338. "🤨",
  3339. "😐",
  3340. "😑",
  3341. "🙄",
  3342. "😏",
  3343. "😪",
  3344. "😫",
  3345. "🥱",
  3346. "😜",
  3347. "😒",
  3348. "😔",
  3349. "😨",
  3350. "😰",
  3351. "😱",
  3352. "🥵",
  3353. "😡",
  3354. "🥳",
  3355. "🥺",
  3356. "🤭",
  3357. "🧐",
  3358. "😎",
  3359. "🤓",
  3360. "😭",
  3361. "🤑",
  3362. "🤮"
  3363. ]
  3364. },
  3365. {
  3366. title: "手势",
  3367. list: [
  3368. "🙋",
  3369. "🙎",
  3370. "🙅",
  3371. "🙇",
  3372. "🤷",
  3373. "🤏",
  3374. "👉",
  3375. "✌️",
  3376. "🤘",
  3377. "🤙",
  3378. "👌",
  3379. "🤌",
  3380. "👍",
  3381. "👎",
  3382. "👋",
  3383. "🤝",
  3384. "🙏",
  3385. "👏"
  3386. ]
  3387. },
  3388. {
  3389. title: "庆祝",
  3390. list: ["✨", "🎉", "🎊"]
  3391. },
  3392. {
  3393. title: "其他",
  3394. list: ["👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶", "🐒", "🙈", "🙉", "🙊", "🐵"]
  3395. }
  3396. ];
  3397. const classicsEmoticons = [
  3398. {
  3399. name: "[狗头]",
  3400. low: "https://i.imgur.com/io2SM1h.png",
  3401. high: "https://i.imgur.com/0icl60r.png"
  3402. },
  3403. {
  3404. name: "[马]",
  3405. low: "https://i.imgur.com/8EKZv7I.png",
  3406. high: "https://i.imgur.com/ANFUX52.png"
  3407. },
  3408. {
  3409. name: "[不高兴]",
  3410. low: "https://i.imgur.com/huX6coX.png",
  3411. high: "https://i.imgur.com/N7JEuvc.png"
  3412. },
  3413. {
  3414. name: "[呵呵]",
  3415. low: "https://i.imgur.com/RvoLAbX.png",
  3416. high: "https://i.imgur.com/xSzIqrK.png"
  3417. },
  3418. {
  3419. name: "[真棒]",
  3420. low: "https://i.imgur.com/xr1UOz1.png",
  3421. high: "https://i.imgur.com/w8YEw9Q.png"
  3422. },
  3423. {
  3424. name: "[鄙视]",
  3425. low: "https://i.imgur.com/u6jlqVq.png",
  3426. high: "https://i.imgur.com/8JFNANq.png"
  3427. },
  3428. {
  3429. name: "[疑问]",
  3430. low: "https://i.imgur.com/F29pmQ6.png",
  3431. high: "https://i.imgur.com/EbbTQAR.png"
  3432. },
  3433. {
  3434. name: "[吐舌]",
  3435. low: "https://i.imgur.com/InmIzl9.png",
  3436. high: "https://i.imgur.com/Ovj56Cd.png"
  3437. },
  3438. // {
  3439. // name: '[嘲笑]',
  3440. // low: 'https://i.imgur.com/BaWcsMR.png',
  3441. // high: 'https://i.imgur.com/0OGfJw4.png'
  3442. // },
  3443. // {
  3444. // name: '[滑稽]',
  3445. // low: 'https://i.imgur.com/lmbN0yI.png',
  3446. // high: 'https://i.imgur.com/Pc0wH85.png'
  3447. // },
  3448. {
  3449. name: "[笑眼]",
  3450. low: "https://i.imgur.com/ZveiiGy.png",
  3451. high: "https://i.imgur.com/PI1CfEr.png"
  3452. },
  3453. {
  3454. name: "[狂汗]",
  3455. low: "https://i.imgur.com/veWihk6.png",
  3456. high: "https://i.imgur.com/3LtHdQv.png"
  3457. },
  3458. {
  3459. name: "[大哭]",
  3460. low: "https://i.imgur.com/hu4oR6C.png",
  3461. high: "https://i.imgur.com/b4X9XLE.png"
  3462. },
  3463. {
  3464. name: "[喷]",
  3465. low: "https://i.imgur.com/bkw3VRr.png",
  3466. high: "https://i.imgur.com/wnZL13L.png"
  3467. },
  3468. {
  3469. name: "[苦笑]",
  3470. low: "https://i.imgur.com/VUWFktU.png",
  3471. high: "https://i.imgur.com/NAfspZ1.png"
  3472. },
  3473. {
  3474. name: "[喝酒]",
  3475. low: "https://i.imgur.com/2ZZSapE.png",
  3476. high: "https://i.imgur.com/rVbSVak.png"
  3477. },
  3478. {
  3479. name: "[吃瓜]",
  3480. low: "https://i.imgur.com/ee8Lq7H.png",
  3481. high: "https://i.imgur.com/0L26og9.png"
  3482. },
  3483. {
  3484. name: "[捂脸]",
  3485. low: "https://i.imgur.com/krir4IG.png",
  3486. high: "https://i.imgur.com/qqBqgVm.png"
  3487. },
  3488. {
  3489. name: "[呕]",
  3490. low: "https://i.imgur.com/6CUiUxv.png",
  3491. high: "https://i.imgur.com/kgdxRsG.png"
  3492. },
  3493. {
  3494. name: "[阴险]",
  3495. low: "https://i.imgur.com/MA8YqTP.png",
  3496. high: "https://i.imgur.com/e94jbaT.png"
  3497. },
  3498. {
  3499. name: "[怒]",
  3500. low: "https://i.imgur.com/n4kWfGB.png",
  3501. high: "https://i.imgur.com/iMXxNxh.png"
  3502. },
  3503. {
  3504. name: "[衰]",
  3505. low: "https://i.imgur.com/voHFDyQ.png",
  3506. high: "https://i.imgur.com/XffE6gu.png"
  3507. },
  3508. {
  3509. name: "[合十]",
  3510. low: "https://i.imgur.com/I8x3ang.png",
  3511. high: "https://i.imgur.com/T4rJVee.png"
  3512. },
  3513. {
  3514. name: "[赞]",
  3515. low: "https://i.imgur.com/lG44yUl.png",
  3516. high: "https://i.imgur.com/AoF5PLp.png"
  3517. },
  3518. {
  3519. name: "[踩]",
  3520. low: "https://i.imgur.com/cJp0uKZ.png",
  3521. high: "https://i.imgur.com/1XYGfXj.png"
  3522. },
  3523. {
  3524. name: "[爱心]",
  3525. low: "https://i.imgur.com/sLENaF5.png",
  3526. high: "https://i.imgur.com/dND56oX.png"
  3527. },
  3528. {
  3529. name: "[心碎]",
  3530. low: "https://i.imgur.com/AZxJzve.png",
  3531. high: "https://i.imgur.com/RiUsPci.png"
  3532. }
  3533. ];
  3534. const imgurClientIdPool = [
  3535. "3107b9ef8b316f3",
  3536. "442b04f26eefc8a",
  3537. "59cfebe717c09e4",
  3538. "60605aad4a62882",
  3539. "6c65ab1d3f5452a",
  3540. "83e123737849aa9",
  3541. "9311f6be1c10160",
  3542. "c4a4a563f698595",
  3543. "81be04b9e4a08ce"
  3544. ];
  3545. const editorClass = vue.computed(() => {
  3546. return [isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  3547. });
  3548. const cursorHtml = vue.computed(() => {
  3549. var _a;
  3550. if (!txtRef.value || !content.value)
  3551. return "";
  3552. let index = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  3553. return content.value.substring(0, index).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  3554. });
  3555. const disabled = vue.computed(() => {
  3556. if (content.value) {
  3557. return content.value === replyInfo;
  3558. } else {
  3559. return true;
  3560. }
  3561. });
  3562. function focus() {
  3563. txtRef.value.focus();
  3564. }
  3565. __expose({ content, focus });
  3566. function drop(e2) {
  3567. e2.preventDefault();
  3568. upload(e2.dataTransfer.files[0]);
  3569. }
  3570. async function upload(file) {
  3571. if (!file)
  3572. return;
  3573. if (uploadLoading.value)
  3574. return;
  3575. uploadLoading.value = true;
  3576. const formData = new FormData();
  3577. formData.append("image", file);
  3578. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  3579. const clidenId = imgurClientIdPool[randomIndex];
  3580. const res = await fetch("https://api.imgur.com/3/upload", {
  3581. method: "POST",
  3582. headers: { Authorization: `Client-ID ${clidenId}` },
  3583. body: formData
  3584. });
  3585. uploadLoading.value = false;
  3586. if (res.ok) {
  3587. const resData = await res.json();
  3588. if (resData.success) {
  3589. return insert(" " + resData.data.link + " ");
  3590. }
  3591. }
  3592. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  3593. }
  3594. async function submit() {
  3595. if (disabled.value || loading.value)
  3596. return;
  3597. loading.value = true;
  3598. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  3599. let item2 = classicsEmoticons.find((v) => v.name === match);
  3600. if (item2) {
  3601. return item2.low + " ";
  3602. }
  3603. return match;
  3604. });
  3605. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  3606. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  3607. });
  3608. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  3609. let item2 = classicsEmoticons.find((v) => v.name === match);
  3610. if (item2) {
  3611. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  3612. }
  3613. return match;
  3614. });
  3615. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  3616. if (matchUsers) {
  3617. matchUsers.map((i) => {
  3618. let username = i.replace("@", "").replace(" ", "");
  3619. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  3620. });
  3621. }
  3622. show_content = show_content.replaceAll("\n", "<br/>");
  3623. let item = {
  3624. thankCount: 0,
  3625. isThanked: false,
  3626. isOp: post.value.username === window.user.username,
  3627. isDup: false,
  3628. id: Date.now(),
  3629. username: window.user.username,
  3630. avatar: window.user.avatar,
  3631. date: "几秒前",
  3632. floor: post.value.replyCount + 1,
  3633. reply_content: show_content ?? "",
  3634. children: [],
  3635. replyUsers: replyUser ? [replyUser] : [],
  3636. replyFloor: replyFloor || -1,
  3637. level: useType === "reply-comment" ? 1 : 0
  3638. };
  3639. item.hideCallUserReplyContent = item.reply_content;
  3640. if (item.replyUsers.length === 1) {
  3641. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  3642. }
  3643. console.log("回复", item);
  3644. let url = `${window.baseUrl}/t/${post.value.id}`;
  3645. $.post(url, { content: submit_content, once: post.value.once }).then(
  3646. // $.post(url, {content: submit_content, once: 123}).then(
  3647. (res) => {
  3648. loading.value = false;
  3649. let r2 = res.search("你上一条回复的内容和这条相同");
  3650. if (r2 > -1)
  3651. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  3652. r2 = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  3653. if (r2 > -1)
  3654. return eventBus.emit(CMD.SHOW_MSG, {
  3655. type: "error",
  3656. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  3657. });
  3658. let r22 = res.search("创建新回复");
  3659. if (r22 > -1) {
  3660. eventBus.emit(CMD.REFRESH_ONCE, res);
  3661. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复出现了问题,请使用原版进行回复" });
  3662. let clientWidth = window.document.body.clientWidth;
  3663. let windowWidth = 1200;
  3664. let left = clientWidth / 2 - windowWidth / 2;
  3665. let newWin = window.open("创建新回复", "", `width=${windowWidth},height=600,left=${left},top=100`);
  3666. newWin.document.write(res);
  3667. let loop = setInterval(function() {
  3668. if (newWin.closed) {
  3669. clearInterval(loop);
  3670. eventBus.emit(CMD.REFRESH_POST);
  3671. }
  3672. }, 1e3);
  3673. return;
  3674. }
  3675. content.value = replyInfo;
  3676. emits("close");
  3677. eventBus.emit(CMD.REFRESH_ONCE, res);
  3678. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  3679. eventBus.emit(CMD.ADD_REPLY, item);
  3680. },
  3681. (err) => {
  3682. console.log("err", err);
  3683. loading.value = false;
  3684. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  3685. }
  3686. ).catch((r2) => {
  3687. console.log("catch", r2);
  3688. });
  3689. }
  3690. function showEmoticons(e2) {
  3691. if (isShowEmoticons.value) {
  3692. return isShowEmoticons.value = false;
  3693. }
  3694. let rect = e2.currentTarget.getBoundingClientRect();
  3695. emoticonsRef.value.style.left = rect.left + 30 + "px";
  3696. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  3697. isShowEmoticons.value = true;
  3698. }
  3699. function off() {
  3700. eventBus.emit(CMD.SHOW_CALL, { show: false });
  3701. eventBus.off(CMD.SET_CALL);
  3702. }
  3703. function checkHeight2() {
  3704. txtRef.value.style.height = 0;
  3705. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  3706. }
  3707. function insert(str) {
  3708. let cursorPos = txtRef.value.selectionStart;
  3709. let start = content.value.slice(0, cursorPos);
  3710. let end = content.value.slice(cursorPos, content.value.length);
  3711. content.value = start + str + end;
  3712. let moveCursorPos = start.length + str.length;
  3713. setTimeout(() => {
  3714. txtRef.value.focus();
  3715. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  3716. checkHeight2();
  3717. });
  3718. }
  3719. function showCallPopover(text) {
  3720. let r2 = cursorRef.value.getBoundingClientRect();
  3721. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r2.top, left: r2.left, text });
  3722. eventBus.off(CMD.SET_CALL);
  3723. eventBus.on(CMD.SET_CALL, (e2) => {
  3724. let cursorPos = txtRef.value.selectionStart;
  3725. let start = content.value.slice(0, cursorPos);
  3726. let end = content.value.slice(cursorPos, content.value.length);
  3727. let lastCallPos = start.lastIndexOf("@");
  3728. start = content.value.slice(0, lastCallPos + 1);
  3729. if (e2 === "管理员") {
  3730. e2 = "Livid @Kai @Olivia @GordianZ @sparanoid";
  3731. }
  3732. if (e2 === "所有人") {
  3733. e2 = allReplyUsers.value.map((v, i) => {
  3734. if (i)
  3735. return "@" + v;
  3736. else
  3737. return v;
  3738. }).join(" ");
  3739. }
  3740. content.value = start + e2 + " " + end;
  3741. let moveCursorPos = start.length + e2.length + 1;
  3742. setTimeout(() => {
  3743. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  3744. checkHeight2();
  3745. });
  3746. eventBus.off(CMD.SET_CALL);
  3747. });
  3748. }
  3749. function onKeydown(e2) {
  3750. let code = e2.keyCode;
  3751. switch (code) {
  3752. case 8:
  3753. if (content.value === "@") {
  3754. off();
  3755. }
  3756. break;
  3757. case 37:
  3758. case 38:
  3759. case 39:
  3760. case 40:
  3761. setTimeout(() => onInput({ data: "" }), 100);
  3762. break;
  3763. case 27:
  3764. e2.preventDefault();
  3765. e2.stopPropagation();
  3766. e2.stopImmediatePropagation();
  3767. return false;
  3768. case 13:
  3769. if (e2.ctrlKey)
  3770. submit();
  3771. if (e2.metaKey)
  3772. submit();
  3773. break;
  3774. }
  3775. }
  3776. function onInput(e2) {
  3777. let cursorPos = txtRef.value.selectionStart;
  3778. if (!content.value)
  3779. return;
  3780. if (e2.data === " ") {
  3781. return off();
  3782. }
  3783. if (e2.data === "@") {
  3784. if (content.value.length !== 1) {
  3785. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  3786. return showCallPopover("");
  3787. }
  3788. } else {
  3789. return showCallPopover("");
  3790. }
  3791. off();
  3792. } else {
  3793. let judgeStr = content.value.slice(0, cursorPos);
  3794. let lastCallPos = judgeStr.lastIndexOf("@");
  3795. if (lastCallPos === -1) {
  3796. return off();
  3797. }
  3798. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  3799. let hasSpace = callStr.includes(" ");
  3800. if (hasSpace) {
  3801. off();
  3802. } else {
  3803. if (lastCallPos === 0) {
  3804. return showCallPopover(callStr.replace("@", ""));
  3805. }
  3806. if (content.value.length !== 1) {
  3807. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  3808. return showCallPopover(callStr.replace("@", ""));
  3809. }
  3810. } else {
  3811. return showCallPopover(callStr.replace("@", ""));
  3812. }
  3813. off();
  3814. }
  3815. }
  3816. }
  3817. function onPaste(e2) {
  3818. const dataTransferItemList = e2.clipboardData.items;
  3819. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  3820. return item.type.indexOf("image") !== -1;
  3821. });
  3822. if (items.length === 0) {
  3823. return;
  3824. }
  3825. const dataTransferItem = items[0];
  3826. const blob = dataTransferItem.getAsFile();
  3827. upload(blob);
  3828. }
  3829. function onBlur() {
  3830. document.removeEventListener("paste", onPaste);
  3831. isFocus.value = false;
  3832. }
  3833. function onFocusin() {
  3834. document.addEventListener("paste", onPaste);
  3835. }
  3836. vue.watch(() => show, (n2) => {
  3837. if (n2.value)
  3838. isShowEmoticons.value = false;
  3839. }, { deep: true });
  3840. vue.onMounted(() => {
  3841. $(`.${editorId.value}`).each(function() {
  3842. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  3843. }).on("input", function() {
  3844. this.style.height = 0;
  3845. this.style.height = this.scrollHeight + "px";
  3846. });
  3847. });
  3848. return (_ctx, _cache) => {
  3849. return vue.openBlock(), vue.createElementBlock("div", {
  3850. class: vue.normalizeClass(["post-editor-wrapper", editorClass.value])
  3851. }, [
  3852. vue.withDirectives(vue.createElementVNode("textarea", {
  3853. class: vue.normalizeClass(["post-editor", editorId.value]),
  3854. ref_key: "txtRef",
  3855. ref: txtRef,
  3856. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  3857. onBlur,
  3858. onFocusin,
  3859. placeholder: "请尽量让自己的回复能够对别人有帮助",
  3860. onInput,
  3861. onKeydown,
  3862. onDrop: drop,
  3863. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  3864. }, null, 34), [
  3865. [vue.vModelText, content.value]
  3866. ]),
  3867. vue.createElementVNode("div", _hoisted_1$f, [
  3868. vue.createElementVNode("span", { innerHTML: cursorHtml.value }, null, 8, _hoisted_2$c),
  3869. vue.createElementVNode("span", {
  3870. class: "cursor",
  3871. ref_key: "cursorRef",
  3872. ref: cursorRef
  3873. }, "|", 512)
  3874. ]),
  3875. vue.createElementVNode("div", _hoisted_3$a, [
  3876. vue.createElementVNode("div", _hoisted_4$9, [
  3877. (vue.openBlock(), vue.createElementBlock("svg", {
  3878. onClick: showEmoticons,
  3879. width: "20",
  3880. height: "20",
  3881. viewBox: "0 0 48 48",
  3882. fill: "none",
  3883. xmlns: "http://www.w3.org/2000/svg"
  3884. }, _hoisted_9$6)),
  3885. vue.createElementVNode("div", _hoisted_10$5, [
  3886. vue.createElementVNode("input", {
  3887. type: "file",
  3888. accept: "image/*",
  3889. onChange: _cache[2] || (_cache[2] = (e2) => upload(e2.currentTarget.files[0]))
  3890. }, null, 32),
  3891. _hoisted_11$5
  3892. ]),
  3893. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12$5, "上传中.....")) : vue.createCommentVNode("", true)
  3894. ]),
  3895. vue.createElementVNode("div", _hoisted_13$5, [
  3896. vue.createVNode(BaseButton, {
  3897. size: "small",
  3898. disabled: disabled.value,
  3899. loading: loading.value,
  3900. onClick: submit
  3901. }, {
  3902. default: vue.withCtx(() => [
  3903. vue.createTextVNode("回复 ")
  3904. ]),
  3905. _: 1
  3906. }, 8, ["disabled", "loading"])
  3907. ])
  3908. ]),
  3909. vue.withDirectives(vue.createElementVNode("div", {
  3910. class: "emoticon-pack",
  3911. ref_key: "emoticonsRef",
  3912. ref: emoticonsRef
  3913. }, [
  3914. vue.createElementVNode("i", {
  3915. class: "fa fa-times",
  3916. "aria-hidden": "true",
  3917. onClick: _cache[3] || (_cache[3] = ($event) => isShowEmoticons.value = false)
  3918. }),
  3919. _hoisted_14$4,
  3920. vue.createElementVNode("div", _hoisted_15$4, [
  3921. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(classicsEmoticons, (item) => {
  3922. return vue.createElementVNode("img", {
  3923. src: item.high,
  3924. onClick: ($event) => {
  3925. insert(item.name);
  3926. isShowEmoticons.value = false;
  3927. }
  3928. }, null, 8, _hoisted_16$4);
  3929. }), 64))
  3930. ]),
  3931. vue.createElementVNode("div", _hoisted_17$2, [
  3932. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(emojiEmoticons, (item) => {
  3933. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  3934. vue.createElementVNode("div", _hoisted_18$2, vue.toDisplayString(item.title), 1),
  3935. vue.createElementVNode("div", _hoisted_19$2, [
  3936. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  3937. return vue.openBlock(), vue.createElementBlock("span", {
  3938. onClick: ($event) => {
  3939. insert(emoji);
  3940. isShowEmoticons.value = false;
  3941. }
  3942. }, vue.toDisplayString(emoji), 9, _hoisted_20$2);
  3943. }), 256))
  3944. ])
  3945. ], 64);
  3946. }), 64))
  3947. ])
  3948. ], 512), [
  3949. [vue.vShow, isShowEmoticons.value]
  3950. ])
  3951. ], 2);
  3952. };
  3953. }
  3954. };
  3955. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-0612e02f"]]);
  3956. const _hoisted_1$e = {
  3957. key: 0,
  3958. class: "html-wrapper"
  3959. };
  3960. const _hoisted_2$b = ["innerHTML"];
  3961. const checkHeight = 900;
  3962. const _sfc_main$e = {
  3963. __name: "BaseHtmlRender",
  3964. props: ["html"],
  3965. setup(__props) {
  3966. const config2 = vue.inject("config");
  3967. const props = __props;
  3968. const contentRef = vue.ref(null);
  3969. const htmlMask = vue.ref(false);
  3970. const handOpen = vue.ref(false);
  3971. function mouseup(e2) {
  3972. if (!config2.value.base64)
  3973. return;
  3974. let selectionText = window.win().getSelection().toString();
  3975. if (selectionText) {
  3976. let r2 = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  3977. if (r2) {
  3978. if (r2[0].length < 4)
  3979. return;
  3980. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r2[0], e: e2 });
  3981. }
  3982. }
  3983. }
  3984. vue.watch(config2.value, (newVale) => {
  3985. if (!newVale.contentAutoCollapse) {
  3986. htmlMask.value = false;
  3987. }
  3988. });
  3989. vue.watch([() => contentRef.value, () => props.html], () => {
  3990. if (!contentRef.value || !props.html)
  3991. return;
  3992. if (!config2.value.contentAutoCollapse)
  3993. return;
  3994. contentRef.value.querySelectorAll("img").forEach((item) => {
  3995. item.removeEventListener("load", checkContentHeight);
  3996. item.addEventListener("load", checkContentHeight);
  3997. });
  3998. checkContentHeight();
  3999. }, { immediate: true, flush: "post" });
  4000. function checkContentHeight() {
  4001. if (handOpen.value)
  4002. return;
  4003. let rect = contentRef.value.getBoundingClientRect();
  4004. htmlMask.value = rect.height >= checkHeight;
  4005. }
  4006. return (_ctx, _cache) => {
  4007. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
  4008. vue.createElementVNode("div", {
  4009. class: vue.normalizeClass({ htmlMask: htmlMask.value })
  4010. }, [
  4011. vue.createElementVNode("div", {
  4012. ref_key: "contentRef",
  4013. ref: contentRef,
  4014. innerHTML: props.html,
  4015. onMouseup: mouseup
  4016. }, null, 40, _hoisted_2$b)
  4017. ], 2),
  4018. htmlMask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  4019. key: 0,
  4020. class: "expand",
  4021. onClick: _cache[0] || (_cache[0] = ($event) => {
  4022. htmlMask.value = false;
  4023. handOpen.value = true;
  4024. })
  4025. }, "展开")) : vue.createCommentVNode("", true)
  4026. ])) : vue.createCommentVNode("", true);
  4027. };
  4028. }
  4029. };
  4030. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-f8165980"]]);
  4031. const _sfc_main$d = {
  4032. name: "Comment",
  4033. components: { MoreIcon, BaseHtmlRender, Author, PostEditor, Point },
  4034. inject: ["post", "show", "isNight", "config"],
  4035. props: {
  4036. modelValue: {
  4037. reply_content: ""
  4038. },
  4039. type: {
  4040. type: String,
  4041. default() {
  4042. return "list";
  4043. }
  4044. }
  4045. },
  4046. data() {
  4047. return {
  4048. edit: false,
  4049. ding: false,
  4050. expand: true,
  4051. expandWrong: false,
  4052. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4053. cssStyle: null,
  4054. floor: this.modelValue.floor
  4055. };
  4056. },
  4057. watch: {
  4058. show(e2) {
  4059. if (e2) {
  4060. this.edit = false;
  4061. }
  4062. },
  4063. postDetailWidth(n2, o) {
  4064. this.checkIsTooLong(n2);
  4065. }
  4066. },
  4067. computed: {
  4068. eventBus() {
  4069. return eventBus;
  4070. },
  4071. CMD() {
  4072. return CMD;
  4073. },
  4074. CommentDisplayType() {
  4075. return CommentDisplayType;
  4076. },
  4077. myClass() {
  4078. return {
  4079. isOp: this.modelValue.isOp,
  4080. ding: this.ding,
  4081. isLevelOne: this.modelValue.level === 0,
  4082. ["c_" + this.floor]: this.type !== "top"
  4083. };
  4084. }
  4085. },
  4086. mounted() {
  4087. this.checkIsTooLong();
  4088. },
  4089. methods: {
  4090. checkIsTooLong() {
  4091. let rect = this.$refs.comment.getBoundingClientRect();
  4092. let postDetailWidth = document.body.clientWidth;
  4093. let ban = postDetailWidth / 2;
  4094. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  4095. this.expand = false;
  4096. let padding = 2;
  4097. this.cssStyle = {
  4098. padding: "1rem 0",
  4099. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  4100. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  4101. background: this.isNight ? "#18222d" : "white"
  4102. };
  4103. }
  4104. },
  4105. //高亮一下
  4106. showDing() {
  4107. this.ding = true;
  4108. setTimeout(() => {
  4109. this.ding = false;
  4110. }, 2e3);
  4111. },
  4112. toggle() {
  4113. this.expand = !this.expand;
  4114. }
  4115. }
  4116. };
  4117. const _withScopeId$9 = (n2) => (vue.pushScopeId("data-v-312e9541"), n2 = n2(), vue.popScopeId(), n2);
  4118. const _hoisted_1$d = ["data-floor"];
  4119. const _hoisted_2$a = { class: "comment-content" };
  4120. const _hoisted_3$9 = { class: "right" };
  4121. const _hoisted_4$8 = { class: "w" };
  4122. const _hoisted_5$6 = {
  4123. key: 0,
  4124. class: "wrong-wrapper"
  4125. };
  4126. const _hoisted_6$6 = ["href"];
  4127. const _hoisted_7$5 = { class: "del-line" };
  4128. const _hoisted_8$5 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("i", {
  4129. class: "fa fa-question-circle-o wrong-icon",
  4130. "aria-hidden": "true"
  4131. }, null, -1));
  4132. const _hoisted_9$5 = {
  4133. key: 0,
  4134. class: "warning"
  4135. };
  4136. const _hoisted_10$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4137. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4138. const _hoisted_12$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4139. const _hoisted_13$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4140. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4141. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("a", {
  4142. href: "https://github.com/zyronon/web-scripts/issues",
  4143. target: "_blank"
  4144. }, "这里", -1));
  4145. const _hoisted_16$3 = { class: "simple-wrapper" };
  4146. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  4147. const _component_Author = vue.resolveComponent("Author");
  4148. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4149. const _component_Comment = vue.resolveComponent("Comment", true);
  4150. return vue.openBlock(), vue.createElementBlock("div", {
  4151. class: vue.normalizeClass(["comment", $options.myClass]),
  4152. ref: "comment",
  4153. "data-floor": $data.floor
  4154. }, [
  4155. vue.createVNode(_component_Author, {
  4156. modelValue: $data.expand,
  4157. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4158. comment: $props.modelValue,
  4159. type: $props.type
  4160. }, null, 8, ["modelValue", "comment", "type"]),
  4161. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4162. key: 0,
  4163. class: "more ago",
  4164. onClick: _cache[1] || (_cache[1] = ($event) => $data.expand = !$data.expand)
  4165. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  4166. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4167. key: 1,
  4168. class: "comment-content-w",
  4169. style: vue.normalizeStyle($data.cssStyle)
  4170. }, [
  4171. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4172. key: 0,
  4173. class: "more ago",
  4174. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  4175. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  4176. vue.createElementVNode("div", _hoisted_2$a, [
  4177. vue.createElementVNode("div", {
  4178. class: "left expand-line",
  4179. onClick: _cache[3] || (_cache[3] = (...args) => $options.toggle && $options.toggle(...args))
  4180. }),
  4181. vue.createElementVNode("div", _hoisted_3$9, [
  4182. vue.createElementVNode("div", _hoisted_4$8, [
  4183. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$6, [
  4184. vue.createElementVNode("span", {
  4185. onClick: _cache[4] || (_cache[4] = ($event) => $data.expandWrong = !$data.expandWrong),
  4186. title: "点击楼层号查看提示"
  4187. }, [
  4188. vue.createElementVNode("a", {
  4189. href: "/member/" + $props.modelValue.replyUsers[0]
  4190. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$6),
  4191. vue.createElementVNode("span", _hoisted_7$5, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  4192. _hoisted_8$5
  4193. ]),
  4194. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$5, [
  4195. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  4196. _hoisted_10$4,
  4197. vue.createTextVNode(" 原因可能有下面几种: "),
  4198. _hoisted_11$4,
  4199. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  4200. _hoisted_12$4,
  4201. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  4202. _hoisted_13$4,
  4203. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  4204. _hoisted_14$3,
  4205. vue.createTextVNode(" 四、脚本解析错误,请在 "),
  4206. _hoisted_15$3,
  4207. vue.createTextVNode("反馈 ")
  4208. ])) : vue.createCommentVNode("", true)
  4209. ])) : vue.createCommentVNode("", true),
  4210. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && this.type !== "top" ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4211. key: 1,
  4212. class: "reply_content",
  4213. html: $props.modelValue.hideCallUserReplyContent
  4214. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4215. key: 2,
  4216. class: "reply_content",
  4217. html: $props.modelValue.reply_content
  4218. }, null, 8, ["html"]))
  4219. ]),
  4220. vue.createElementVNode("div", _hoisted_16$3, [
  4221. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4222. return vue.openBlock(), vue.createBlock(_component_Comment, {
  4223. modelValue: $props.modelValue.children[index],
  4224. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4225. key: index
  4226. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4227. }), 128))
  4228. ])
  4229. ])
  4230. ]),
  4231. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4232. key: 1,
  4233. class: "more ago",
  4234. onClick: _cache[5] || (_cache[5] = ($event) => $data.expand = !$data.expand)
  4235. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  4236. ], 4)) : vue.createCommentVNode("", true)
  4237. ], 10, _hoisted_1$d);
  4238. }
  4239. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$5], ["__scopeId", "data-v-312e9541"]]);
  4240. const _sfc_main$c = {
  4241. name: "Toolbar",
  4242. components: { Icon, BaseLoading },
  4243. inject: [
  4244. "isLogin",
  4245. "post",
  4246. "pageType"
  4247. ],
  4248. data() {
  4249. return {
  4250. timer: null,
  4251. loading: false,
  4252. loading3: false
  4253. };
  4254. },
  4255. methods: {
  4256. checkIsLogin(emitName = "") {
  4257. if (!this.isLogin) {
  4258. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4259. return false;
  4260. }
  4261. this.$emit(emitName);
  4262. return true;
  4263. },
  4264. async toggleFavorite() {
  4265. if (config.collectBrowserNotice) {
  4266. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记添加到书签哦" });
  4267. }
  4268. if (!this.checkIsLogin())
  4269. return;
  4270. let isFavorite = this.post.isFavorite;
  4271. let url = `${window.baseUrl}/${isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  4272. this.loading = true;
  4273. let apiRes = await fetch(url);
  4274. this.loading = false;
  4275. if (apiRes.redirected) {
  4276. let htmlText = await apiRes.text();
  4277. if (htmlText.search(this.post.isFavorite ? "加入收藏" : "取消收藏")) {
  4278. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  4279. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  4280. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4281. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  4282. return;
  4283. }
  4284. }
  4285. eventBus.emit(CMD.REFRESH_ONCE);
  4286. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  4287. }
  4288. }
  4289. };
  4290. const _hoisted_1$c = { class: "toolbar" };
  4291. const _hoisted_2$9 = { class: "left" };
  4292. const _hoisted_3$8 = { class: "right" };
  4293. const _hoisted_4$7 = { key: 2 };
  4294. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  4295. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  4296. const _component_Icon = vue.resolveComponent("Icon");
  4297. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
  4298. vue.createElementVNode("div", _hoisted_2$9, [
  4299. vue.createElementVNode("div", null, vue.toDisplayString($options.post.createDate.substring(0, 16)), 1)
  4300. ]),
  4301. vue.createElementVNode("div", _hoisted_3$8, [
  4302. vue.createElementVNode("div", {
  4303. class: vue.normalizeClass(["tool", { disabled: $data.loading }]),
  4304. onClick: _cache[0] || (_cache[0] = (...args) => $options.toggleFavorite && $options.toggleFavorite(...args))
  4305. }, [
  4306. $data.loading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  4307. key: 0,
  4308. size: "small"
  4309. })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  4310. $options.post.isFavorite ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  4311. key: 0,
  4312. color: "rgb(224,42,42)",
  4313. icon: "iconoir:star-solid"
  4314. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  4315. key: 1,
  4316. icon: "iconoir:star"
  4317. }))
  4318. ], 64)),
  4319. $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$7, vue.toDisplayString($options.post.collectCount), 1)) : vue.createCommentVNode("", true)
  4320. ], 2),
  4321. vue.createElementVNode("div", {
  4322. class: "tool",
  4323. onClick: _cache[1] || (_cache[1] = ($event) => $options.checkIsLogin("reply"))
  4324. }, [
  4325. vue.createVNode(_component_Icon, { icon: "mynaui:message" })
  4326. ])
  4327. ])
  4328. ]);
  4329. }
  4330. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$4], ["__scopeId", "data-v-6234240d"]]);
  4331. const _withScopeId$8 = (n2) => (vue.pushScopeId("data-v-0869dab5"), n2 = n2(), vue.popScopeId(), n2);
  4332. const _hoisted_1$b = {
  4333. class: "comment",
  4334. ref: "comment"
  4335. };
  4336. const _hoisted_2$8 = ["href"];
  4337. const _hoisted_3$7 = ["src"];
  4338. const _hoisted_4$6 = { class: "texts" };
  4339. const _hoisted_5$5 = {
  4340. key: 0,
  4341. class: "point"
  4342. };
  4343. const _hoisted_6$5 = { class: "link-num" };
  4344. const _hoisted_7$4 = { class: "my-tag" };
  4345. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  4346. const _hoisted_9$4 = {
  4347. key: 2,
  4348. class: "ago"
  4349. };
  4350. const _hoisted_10$3 = {
  4351. key: 3,
  4352. class: "mod"
  4353. };
  4354. const _hoisted_11$3 = {
  4355. key: 4,
  4356. class: "owner"
  4357. };
  4358. const _hoisted_12$3 = ["href"];
  4359. const _hoisted_13$3 = {
  4360. key: 5,
  4361. class: "owner"
  4362. };
  4363. const _hoisted_14$2 = {
  4364. key: 6,
  4365. class: "mod"
  4366. };
  4367. const _hoisted_15$2 = {
  4368. key: 7,
  4369. class: "ago"
  4370. };
  4371. const _hoisted_16$2 = { class: "my-tag" };
  4372. const _hoisted_17$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  4373. const _hoisted_18$1 = {
  4374. key: 9,
  4375. class: "point"
  4376. };
  4377. const _hoisted_19$1 = { class: "link-num" };
  4378. const _hoisted_20$1 = ["href"];
  4379. const _hoisted_21$1 = ["src"];
  4380. const _hoisted_22$1 = { class: "Author-right" };
  4381. const _hoisted_23$1 = { class: "floor" };
  4382. const _hoisted_24$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  4383. const _hoisted_25$1 = [
  4384. _hoisted_24$1
  4385. ];
  4386. const _sfc_main$b = {
  4387. __name: "SingleComment",
  4388. props: {
  4389. comment: {
  4390. reply_content: ""
  4391. },
  4392. isRight: {
  4393. type: Boolean,
  4394. default() {
  4395. return false;
  4396. }
  4397. }
  4398. },
  4399. setup(__props) {
  4400. const config2 = vue.inject("config");
  4401. const isLogin = vue.inject("isLogin");
  4402. const tags = vue.inject("tags");
  4403. const props = __props;
  4404. const myTags = vue.computed(() => {
  4405. return tags[props.comment.username] ?? [];
  4406. });
  4407. function jump() {
  4408. eventBus.emit(CMD.JUMP, props.comment.floor);
  4409. }
  4410. return (_ctx, _cache) => {
  4411. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
  4412. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  4413. key: 0,
  4414. class: "base-avatar",
  4415. href: `/member/${__props.comment.username}`
  4416. }, [
  4417. vue.createElementVNode("img", {
  4418. src: __props.comment.avatar,
  4419. alt: ""
  4420. }, null, 8, _hoisted_3$7)
  4421. ], 8, _hoisted_2$8)) : vue.createCommentVNode("", true),
  4422. vue.createElementVNode("div", {
  4423. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  4424. }, [
  4425. vue.createElementVNode("div", _hoisted_4$6, [
  4426. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  4427. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4428. key: 0,
  4429. color: "red",
  4430. icon: "icon-park-solid:like"
  4431. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4432. key: 1,
  4433. color: "rgb(224,42,42)",
  4434. icon: "icon-park-outline:like"
  4435. })),
  4436. vue.createElementVNode("div", _hoisted_6$5, vue.toDisplayString(__props.comment.thankCount), 1)
  4437. ])) : vue.createCommentVNode("", true),
  4438. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(myTags.value, (i) => {
  4439. return vue.openBlock(), vue.createElementBlock("span", _hoisted_7$4, [
  4440. _hoisted_8$4,
  4441. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  4442. ]);
  4443. }), 256)) : vue.createCommentVNode("", true),
  4444. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$4, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  4445. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, "MOD")) : vue.createCommentVNode("", true),
  4446. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$3, "OP")) : vue.createCommentVNode("", true),
  4447. vue.createElementVNode("a", {
  4448. href: `/member/${__props.comment.username}`,
  4449. class: "username"
  4450. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_12$3),
  4451. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$3, "OP")) : vue.createCommentVNode("", true),
  4452. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$2, "MOD")) : vue.createCommentVNode("", true),
  4453. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_15$2, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  4454. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(myTags.value, (i) => {
  4455. return vue.openBlock(), vue.createElementBlock("span", _hoisted_16$2, [
  4456. _hoisted_17$1,
  4457. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  4458. ]);
  4459. }), 256)) : vue.createCommentVNode("", true),
  4460. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, [
  4461. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4462. key: 0,
  4463. color: "red",
  4464. icon: "icon-park-solid:like"
  4465. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4466. key: 1,
  4467. color: "rgb(224,42,42)",
  4468. icon: "icon-park-outline:like"
  4469. })),
  4470. vue.createElementVNode("div", _hoisted_19$1, vue.toDisplayString(__props.comment.thankCount), 1)
  4471. ])) : vue.createCommentVNode("", true)
  4472. ]),
  4473. vue.createVNode(BaseHtmlRender, {
  4474. class: "reply_content",
  4475. html: __props.comment.reply_content
  4476. }, null, 8, ["html"])
  4477. ], 2),
  4478. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  4479. key: 1,
  4480. class: "base-avatar",
  4481. href: `/member/${__props.comment.username}`
  4482. }, [
  4483. vue.createElementVNode("img", {
  4484. src: __props.comment.avatar,
  4485. alt: ""
  4486. }, null, 8, _hoisted_21$1)
  4487. ], 8, _hoisted_20$1)) : vue.createCommentVNode("", true),
  4488. vue.createElementVNode("div", _hoisted_22$1, [
  4489. vue.createElementVNode("div", _hoisted_23$1, vue.toDisplayString(__props.comment.floor) + "楼", 1),
  4490. vue.createElementVNode("div", {
  4491. class: "tool jump",
  4492. onClick: jump
  4493. }, _hoisted_25$1)
  4494. ])
  4495. ], 512);
  4496. };
  4497. }
  4498. };
  4499. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-0869dab5"]]);
  4500. function debounce(fn, delay, scope) {
  4501. let timer = null;
  4502. return function() {
  4503. let context = scope || this, args = arguments;
  4504. clearTimeout(timer);
  4505. timer = setTimeout(function() {
  4506. fn.apply(context, args);
  4507. timer = null;
  4508. }, delay);
  4509. };
  4510. }
  4511. async function copy(text) {
  4512. if (navigator.clipboard) {
  4513. await navigator.clipboard.writeText(text);
  4514. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  4515. return true;
  4516. } else {
  4517. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  4518. }
  4519. }
  4520. const _sfc_main$a = {
  4521. name: "FromBottomDialog",
  4522. props: {
  4523. modelValue: {
  4524. type: Boolean,
  4525. default: false
  4526. },
  4527. mode: {
  4528. type: String,
  4529. // default: 'dark'
  4530. default: "light"
  4531. // default: 'white'
  4532. },
  4533. maskMode: {
  4534. type: String,
  4535. default: "dark"
  4536. },
  4537. height: {
  4538. type: String,
  4539. default: "70vh"
  4540. },
  4541. showHengGang: {
  4542. type: Boolean,
  4543. default: true
  4544. },
  4545. pageId: {
  4546. type: String,
  4547. default: null,
  4548. required: true
  4549. },
  4550. borderRadius: {
  4551. type: String,
  4552. default: "1rem 1rem 0 0"
  4553. },
  4554. tag: {
  4555. type: String,
  4556. default: ""
  4557. }
  4558. },
  4559. watch: {
  4560. modelValue(newVal) {
  4561. let page = document.getElementById(this.pageId);
  4562. if (newVal) {
  4563. page.style.overflow = "hidden";
  4564. this.scroll = page.scrollTop;
  4565. let mask = $(`<div class="mask fade-in ${this.maskMode}"></div>`);
  4566. mask.on("click", (e2) => {
  4567. this.hide(false);
  4568. });
  4569. page.appendChild(mask[0]);
  4570. } else {
  4571. page.style.overflow = "unset";
  4572. let mask = $(".mask");
  4573. mask.removeClass("fade-in");
  4574. mask.addClass("fade-out");
  4575. setTimeout(() => {
  4576. mask.remove();
  4577. }, 250);
  4578. }
  4579. }
  4580. },
  4581. data() {
  4582. return {
  4583. scroll: 0,
  4584. startLocationY: 0,
  4585. moveYDistance: 0,
  4586. startTime: 0,
  4587. pagePosition: null
  4588. };
  4589. },
  4590. computed: {},
  4591. created() {
  4592. },
  4593. methods: {
  4594. beforeEnter(el) {
  4595. el.style["transition-duration"] = `250ms`;
  4596. el.style["transform"] = `translate3d(0,${this.height},0)`;
  4597. },
  4598. enter(el, done) {
  4599. setTimeout(() => {
  4600. el.style["transform"] = `translate3d(0,0,0)`;
  4601. }, 0);
  4602. setTimeout(() => {
  4603. el.style["transform"] = `none`;
  4604. done();
  4605. }, 250);
  4606. },
  4607. afterEnter() {
  4608. },
  4609. beforeLeave(el) {
  4610. el.style["transition-duration"] = `250ms`;
  4611. el.style["transform"] = `translate3d(0,0,0)`;
  4612. },
  4613. leave(el, done) {
  4614. let maxHeight = $(".FromBottomDialog").css("max-height");
  4615. el.style["transform"] = `translate3d(0,${maxHeight},0)`;
  4616. setTimeout(done, 250);
  4617. },
  4618. afterLeave() {
  4619. },
  4620. hide(val = false) {
  4621. this.$emit("update:modelValue", val);
  4622. this.$emit("cancel");
  4623. },
  4624. start(e2) {
  4625. if (this.$refs.dialog.scrollTop !== 0)
  4626. return;
  4627. this.startLocationY = e2.touches[0].pageY;
  4628. this.startTime = Date.now();
  4629. this.$refs.dialog.style["transition-duration"] = `0ms`;
  4630. },
  4631. move(e2) {
  4632. if (this.$refs.dialog.scrollTop !== 0)
  4633. return;
  4634. this.moveYDistance = e2.touches[0].pageY - this.startLocationY;
  4635. if (this.moveYDistance > 0) {
  4636. this.$refs.dialog.style["transform"] = `translate3d(0,${this.moveYDistance}px,0)`;
  4637. }
  4638. },
  4639. end(e2) {
  4640. if (Date.now() - this.startTime < 150 && Math.abs(this.moveYDistance) < 30) {
  4641. return;
  4642. }
  4643. if (this.$refs.dialog.scrollTop !== 0)
  4644. return;
  4645. let clientHeight = this.$refs.dialog.clientHeight;
  4646. this.$refs.dialog.style["transition-duration"] = `250ms`;
  4647. if (Math.abs(this.moveYDistance) > clientHeight / 2) {
  4648. this.$refs.dialog.style["transform"] = `translate3d(0,${clientHeight}px,0)`;
  4649. setTimeout(this.hide, 250);
  4650. } else {
  4651. this.$refs.dialog.style["transform"] = `translate3d(0,0,0)`;
  4652. setTimeout(() => {
  4653. if (this.$refs.dialog) {
  4654. this.$refs.dialog.style["transform"] = `none`;
  4655. }
  4656. }, 250);
  4657. }
  4658. this.moveYDistance = 0;
  4659. }
  4660. }
  4661. };
  4662. const __injectCSSVars__ = () => {
  4663. vue.useCssVars((_ctx) => ({
  4664. "0013fa15": _ctx.borderRadius
  4665. }));
  4666. };
  4667. const __setup__ = _sfc_main$a.setup;
  4668. _sfc_main$a.setup = __setup__ ? (props, ctx) => {
  4669. __injectCSSVars__();
  4670. return __setup__(props, ctx);
  4671. } : __injectCSSVars__;
  4672. const _withScopeId$7 = (n2) => (vue.pushScopeId("data-v-3a54f208"), n2 = n2(), vue.popScopeId(), n2);
  4673. const _hoisted_1$a = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "gang-content" }, null, -1));
  4674. const _hoisted_2$7 = [
  4675. _hoisted_1$a
  4676. ];
  4677. const _hoisted_3$6 = { class: "dialog-wrapper" };
  4678. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  4679. return vue.openBlock(), vue.createBlock(vue.Transition, {
  4680. onBeforeEnter: $options.beforeEnter,
  4681. onEnter: $options.enter,
  4682. onAfterEnter: $options.afterEnter,
  4683. onBeforeLeave: $options.beforeLeave,
  4684. onLeave: $options.leave,
  4685. onAfterLeave: $options.afterLeave,
  4686. css: false
  4687. }, {
  4688. default: vue.withCtx(() => [
  4689. $props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", {
  4690. key: 0,
  4691. ref: "dialog",
  4692. class: vue.normalizeClass(["FromBottomDialog", [$props.mode, $props.showHengGang ? "" : "no-heng-gang"]]),
  4693. style: vue.normalizeStyle({ "max-height": $props.height }),
  4694. onTouchstart: _cache[0] || (_cache[0] = (...args) => $options.start && $options.start(...args)),
  4695. onTouchmove: _cache[1] || (_cache[1] = (...args) => $options.move && $options.move(...args)),
  4696. onTouchend: _cache[2] || (_cache[2] = (...args) => $options.end && $options.end(...args))
  4697. }, [
  4698. vue.renderSlot(_ctx.$slots, "header", {}, void 0, true),
  4699. $props.showHengGang ? (vue.openBlock(), vue.createElementBlock("div", {
  4700. key: 0,
  4701. class: vue.normalizeClass(["heng-gang", $props.mode])
  4702. }, _hoisted_2$7, 2)) : vue.createCommentVNode("", true),
  4703. vue.createElementVNode("div", _hoisted_3$6, [
  4704. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  4705. ])
  4706. ], 38)) : vue.createCommentVNode("", true)
  4707. ]),
  4708. _: 3
  4709. }, 8, ["onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"]);
  4710. }
  4711. const FromBottomDialog = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$3], ["__scopeId", "data-v-3a54f208"]]);
  4712. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-ae322b31"), n2 = n2(), vue.popScopeId(), n2);
  4713. const _hoisted_1$9 = { class: "wrapper" };
  4714. const _hoisted_2$6 = { class: "options" };
  4715. const _hoisted_3$5 = { class: "icon-wrap" };
  4716. const _hoisted_4$5 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "分享", -1));
  4717. const _hoisted_5$4 = { class: "icon-wrap" };
  4718. const _hoisted_6$4 = { class: "icon-wrap" };
  4719. const _hoisted_7$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  4720. const _hoisted_8$3 = { class: "icon-wrap" };
  4721. const _hoisted_9$3 = { class: "icon-wrap" };
  4722. const _hoisted_10$2 = { class: "icon-wrap" };
  4723. const _hoisted_11$2 = { class: "icon-wrap" };
  4724. const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "复制链接", -1));
  4725. const _hoisted_13$2 = { class: "icon-wrap" };
  4726. const _hoisted_14$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "复制内容", -1));
  4727. const _hoisted_15$1 = { class: "icon-wrap" };
  4728. const _hoisted_16$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "刷新", -1));
  4729. const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
  4730. __name: "PostOptions",
  4731. props: {
  4732. modelValue: { type: Boolean },
  4733. post: {}
  4734. },
  4735. emits: ["close", "reply", "refresh", "merge", "update:modelValue"],
  4736. setup(__props, { emit: __emit }) {
  4737. let state = vue.reactive({
  4738. timer: null,
  4739. loading: false,
  4740. loading1: false,
  4741. loading2: false,
  4742. loading3: false,
  4743. loading4: false
  4744. });
  4745. const props = __props;
  4746. const emit = __emit;
  4747. const isLogin = vue.inject("isLogin");
  4748. const pageType = vue.inject("pageType");
  4749. const config2 = vue.inject("config");
  4750. function close() {
  4751. emit("close");
  4752. emit("update:modelValue", false);
  4753. }
  4754. function checkIsLogin() {
  4755. if (!isLogin.value) {
  4756. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4757. return false;
  4758. }
  4759. return true;
  4760. }
  4761. async function copyLink() {
  4762. let text = props.post.url;
  4763. if (await copy(text)) {
  4764. close();
  4765. }
  4766. }
  4767. async function copyContent() {
  4768. let text = props.post.headerTemplate;
  4769. text = $(`<div>${text}</div>`).text();
  4770. if (await copy(text)) {
  4771. close();
  4772. }
  4773. }
  4774. function share() {
  4775. var _a;
  4776. let username = ((_a = window.user) == null ? void 0 : _a.username) ?? "";
  4777. let url = `https://twitter.com/intent/tweet?url=${location.origin}/t/${props.post.id}?r=${username}&related=v2ex&text=${props.post.title}`;
  4778. window.open(url, "_blank");
  4779. close();
  4780. }
  4781. function reply() {
  4782. if (!checkIsLogin())
  4783. return;
  4784. emit("reply");
  4785. close();
  4786. }
  4787. async function toggleIgnore() {
  4788. if (!checkIsLogin())
  4789. return;
  4790. if (state.loading2)
  4791. return;
  4792. let isIgnore = props.post.isIgnore;
  4793. let url = `${location.origin}/${isIgnore ? "unignore" : "ignore"}/topic/${props.post.id}?once=${props.post.once}`;
  4794. state.loading2 = true;
  4795. let apiRes = await fetch(url);
  4796. state.loading2 = false;
  4797. if (apiRes.redirected) {
  4798. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isIgnore ? "取消成功" : "忽略成功" });
  4799. } else {
  4800. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  4801. }
  4802. if (isIgnore) {
  4803. eventBus.emit(CMD.MERGE, { isIgnore: !isIgnore });
  4804. } else {
  4805. if (pageType.value === PageType.Post) {
  4806. location.href = location.origin;
  4807. } else {
  4808. eventBus.emit(CMD.IGNORE);
  4809. }
  4810. }
  4811. eventBus.emit(CMD.REFRESH_ONCE);
  4812. close();
  4813. }
  4814. async function toggleFavorite() {
  4815. if (!checkIsLogin())
  4816. return;
  4817. if (state.loading)
  4818. return;
  4819. let isFavorite = props.post.isFavorite;
  4820. if (!isFavorite && config2.value.collectBrowserNotice) {
  4821. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记添加到书签哦" });
  4822. }
  4823. let url = `${location.origin}/${isFavorite ? "unfavorite" : "favorite"}/topic/${props.post.id}?once=${props.post.once}`;
  4824. state.loading = true;
  4825. let apiRes = await fetch(url);
  4826. state.loading = false;
  4827. if (apiRes.redirected) {
  4828. let htmlText = await apiRes.text();
  4829. if (htmlText.search(isFavorite ? "加入收藏" : "取消收藏")) {
  4830. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  4831. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? props.post.collectCount - 1 : props.post.collectCount + 1 });
  4832. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4833. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  4834. return close();
  4835. }
  4836. }
  4837. eventBus.emit(CMD.REFRESH_ONCE);
  4838. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4839. }
  4840. async function report() {
  4841. if (!checkIsLogin())
  4842. return;
  4843. if (state.loading1)
  4844. return;
  4845. let isReport = props.post.isReport;
  4846. if (isReport) {
  4847. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4848. return;
  4849. }
  4850. let url = `${location.origin}/report/topic/${props.post.id}?once=${props.post.once}`;
  4851. state.loading1 = true;
  4852. let apiRes = await fetch(url);
  4853. state.loading1 = false;
  4854. if (apiRes.redirected) {
  4855. let htmlText = await apiRes.text();
  4856. if (htmlText.search("你已对本主题进行了报告")) {
  4857. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4858. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4859. eventBus.emit(CMD.MERGE, { isReport: !isReport });
  4860. return close();
  4861. }
  4862. }
  4863. eventBus.emit(CMD.REFRESH_ONCE);
  4864. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4865. }
  4866. async function thank() {
  4867. if (!isLogin.value) {
  4868. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4869. }
  4870. if (props.post.username === window.user.username) {
  4871. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  4872. }
  4873. let isThanked = props.post.isThanked;
  4874. if (isThanked) {
  4875. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  4876. }
  4877. if (state.loading4)
  4878. return;
  4879. eventBus.emit(CMD.MERGE, { isThanked: !isThanked });
  4880. let url = `${location.origin}/thank/reply/${props.post.id}?once=${props.post.once}`;
  4881. state.loading4 = true;
  4882. await fetch(url);
  4883. state.loading4 = false;
  4884. $.post(url).then((res) => {
  4885. if (!res.success) {
  4886. eventBus.emit(CMD.MERGE, { isThanked: !isThanked });
  4887. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  4888. }
  4889. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  4890. }, (err) => {
  4891. state.loading4 = false;
  4892. eventBus.emit(CMD.MERGE, { isThanked: !isThanked });
  4893. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  4894. eventBus.emit(CMD.REFRESH_ONCE);
  4895. });
  4896. close();
  4897. }
  4898. return (_ctx, _cache) => {
  4899. return vue.openBlock(), vue.createBlock(FromBottomDialog, {
  4900. "page-id": "post-detail",
  4901. height: "40rem",
  4902. "model-value": _ctx.modelValue,
  4903. onCancel: _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", false))
  4904. }, {
  4905. default: vue.withCtx(() => [
  4906. vue.createElementVNode("div", _hoisted_1$9, [
  4907. vue.createElementVNode("div", _hoisted_2$6, [
  4908. vue.createElementVNode("div", {
  4909. class: "item",
  4910. onClick: share
  4911. }, [
  4912. vue.createElementVNode("div", _hoisted_3$5, [
  4913. vue.createVNode(vue.unref(Icon), {
  4914. color: "rgb(57,174,85)",
  4915. icon: "uil:share"
  4916. })
  4917. ]),
  4918. _hoisted_4$5
  4919. ]),
  4920. vue.createElementVNode("div", {
  4921. class: "item",
  4922. onClick: toggleIgnore
  4923. }, [
  4924. vue.createElementVNode("div", _hoisted_5$4, [
  4925. vue.unref(state).loading2 ? (vue.openBlock(), vue.createBlock(BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  4926. _ctx.post.isIgnore ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4927. key: 0,
  4928. color: "rgb(224,42,42)",
  4929. icon: "mdi:eye-off-outline"
  4930. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4931. key: 1,
  4932. color: "rgb(57,174,85)",
  4933. icon: "mdi:eye-outline"
  4934. }))
  4935. ], 64))
  4936. ]),
  4937. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isIgnore ? "取消" : "") + "忽略", 1)
  4938. ]),
  4939. vue.createElementVNode("div", {
  4940. class: "item",
  4941. onClick: reply
  4942. }, [
  4943. vue.createElementVNode("div", _hoisted_6$4, [
  4944. vue.createVNode(vue.unref(Icon), {
  4945. color: "rgb(57,174,85)",
  4946. icon: "mynaui:message"
  4947. })
  4948. ]),
  4949. _hoisted_7$3
  4950. ]),
  4951. vue.createElementVNode("div", {
  4952. class: "item",
  4953. onClick: thank
  4954. }, [
  4955. vue.createElementVNode("div", _hoisted_8$3, [
  4956. _ctx.post.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4957. key: 0,
  4958. icon: "flat-color-icons:like"
  4959. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4960. key: 1,
  4961. color: "rgb(57,174,85)",
  4962. icon: "icon-park-outline:like"
  4963. }))
  4964. ]),
  4965. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isThanked ? "已" : "") + "感谢", 1)
  4966. ]),
  4967. vue.createElementVNode("div", {
  4968. class: "item",
  4969. onClick: toggleFavorite
  4970. }, [
  4971. vue.createElementVNode("div", _hoisted_9$3, [
  4972. vue.unref(state).loading ? (vue.openBlock(), vue.createBlock(BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  4973. _ctx.post.isFavorite ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4974. key: 0,
  4975. color: "rgb(224,42,42)",
  4976. icon: "iconoir:star-solid"
  4977. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4978. key: 1,
  4979. color: "rgb(57,174,85)",
  4980. icon: "iconoir:star"
  4981. }))
  4982. ], 64))
  4983. ]),
  4984. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isFavorite ? "取消" : "") + "收藏", 1)
  4985. ]),
  4986. vue.createElementVNode("div", {
  4987. class: vue.normalizeClass(["item", [_ctx.post.isReport && "disabled"]]),
  4988. onClick: report
  4989. }, [
  4990. vue.createElementVNode("div", _hoisted_10$2, [
  4991. vue.unref(state).loading1 ? (vue.openBlock(), vue.createBlock(BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4992. key: 1,
  4993. class: "black",
  4994. icon: "solar:danger-triangle-outline"
  4995. }))
  4996. ]),
  4997. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isReport ? "已报告" : "报告问题"), 1)
  4998. ], 2),
  4999. vue.createElementVNode("div", {
  5000. class: "item",
  5001. onClick: copyLink
  5002. }, [
  5003. vue.createElementVNode("div", _hoisted_11$2, [
  5004. vue.createVNode(vue.unref(Icon), {
  5005. class: "black",
  5006. icon: "solar:link-broken"
  5007. })
  5008. ]),
  5009. _hoisted_12$2
  5010. ]),
  5011. vue.createElementVNode("div", {
  5012. class: "item",
  5013. onClick: copyContent
  5014. }, [
  5015. vue.createElementVNode("div", _hoisted_13$2, [
  5016. vue.createVNode(vue.unref(Icon), {
  5017. class: "black",
  5018. icon: "octicon:copy-24"
  5019. })
  5020. ]),
  5021. _hoisted_14$1
  5022. ]),
  5023. vue.createElementVNode("div", {
  5024. class: "item",
  5025. onClick: _cache[0] || (_cache[0] = ($event) => (emit("refresh"), close()))
  5026. }, [
  5027. vue.createElementVNode("div", _hoisted_15$1, [
  5028. vue.createVNode(vue.unref(Icon), {
  5029. class: "black",
  5030. icon: "ion:refresh"
  5031. })
  5032. ]),
  5033. _hoisted_16$1
  5034. ])
  5035. ]),
  5036. vue.createVNode(FontSizeType),
  5037. vue.createElementVNode("div", {
  5038. class: "cancel",
  5039. onClick: close
  5040. }, "取消")
  5041. ])
  5042. ]),
  5043. _: 1
  5044. }, 8, ["model-value"]);
  5045. };
  5046. }
  5047. });
  5048. const PostOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-ae322b31"]]);
  5049. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-8ef13a81"), n2 = n2(), vue.popScopeId(), n2);
  5050. const _hoisted_1$8 = { class: "wrapper" };
  5051. const _hoisted_2$5 = { class: "options" };
  5052. const _hoisted_3$4 = { class: "icon-wrap" };
  5053. const _hoisted_4$4 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "忽略", -1));
  5054. const _hoisted_5$3 = { class: "icon-wrap" };
  5055. const _hoisted_6$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "复制", -1));
  5056. const _hoisted_7$2 = { class: "icon-wrap" };
  5057. const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  5058. const _hoisted_9$2 = { class: "icon-wrap" };
  5059. const _hoisted_10$1 = { class: "icon-wrap" };
  5060. const _hoisted_11$1 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  5061. const _hoisted_12$1 = { class: "icon-wrap" };
  5062. const _hoisted_13$1 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  5063. const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
  5064. __name: "CommentOptions",
  5065. props: {
  5066. modelValue: { type: Boolean },
  5067. comment: {},
  5068. post: {}
  5069. },
  5070. emits: ["close", "reply", "merge", "update:modelValue"],
  5071. setup(__props, { emit: __emit }) {
  5072. const props = __props;
  5073. const emit = __emit;
  5074. const config2 = vue.inject("config");
  5075. const isLogin = vue.inject("isLogin");
  5076. function close() {
  5077. emit("close");
  5078. emit("update:modelValue", false);
  5079. }
  5080. function checkIsLogin() {
  5081. if (!isLogin.value) {
  5082. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  5083. return false;
  5084. }
  5085. return true;
  5086. }
  5087. async function handleCopy() {
  5088. let text = props.comment.reply_content;
  5089. if (config2.value.commentDisplayType === CommentDisplayType.FloorInFloorNoCallUser) {
  5090. text = props.comment.hideCallUserReplyContent;
  5091. }
  5092. text = $(`<div>${text}</div>`).text();
  5093. if (await copy(text)) {
  5094. close();
  5095. }
  5096. }
  5097. async function hide() {
  5098. if (!checkIsLogin())
  5099. return;
  5100. let url = `${window.baseUrl}/ignore/reply/${props.comment.id}?once=${props.post.once}`;
  5101. eventBus.emit(CMD.REMOVE, props.comment.floor);
  5102. close();
  5103. $.post(url).then((res) => {
  5104. eventBus.emit(CMD.REFRESH_ONCE);
  5105. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  5106. }, (err) => {
  5107. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  5108. });
  5109. }
  5110. function jump() {
  5111. eventBus.emit(CMD.JUMP, props.comment.floor);
  5112. close();
  5113. }
  5114. function showRelationReply() {
  5115. if (!props.comment.replyUsers.length) {
  5116. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  5117. return;
  5118. }
  5119. eventBus.emit(CMD.RELATION_REPLY, {
  5120. left: props.comment.replyUsers,
  5121. right: props.comment.username,
  5122. rightFloor: props.comment.floor
  5123. });
  5124. close();
  5125. }
  5126. function recallThank() {
  5127. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: props.comment.id, type: "recall" });
  5128. }
  5129. function thank() {
  5130. if (!checkIsLogin())
  5131. return;
  5132. if (props.comment.username === window.user.username) {
  5133. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  5134. }
  5135. if (props.comment.isThanked) {
  5136. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  5137. }
  5138. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: props.comment.id, type: "add" });
  5139. let url = `${window.baseUrl}/thank/reply/${props.comment.id}?once=${props.post.once}`;
  5140. $.post(url).then((res) => {
  5141. if (!res.success) {
  5142. recallThank();
  5143. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  5144. }
  5145. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  5146. }, (err) => {
  5147. recallThank();
  5148. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  5149. eventBus.emit(CMD.REFRESH_ONCE);
  5150. });
  5151. close();
  5152. }
  5153. return (_ctx, _cache) => {
  5154. return vue.openBlock(), vue.createBlock(FromBottomDialog, {
  5155. "page-id": "post-detail",
  5156. height: "40rem",
  5157. "model-value": _ctx.modelValue,
  5158. onCancel: _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", false))
  5159. }, {
  5160. default: vue.withCtx(() => [
  5161. vue.createElementVNode("div", _hoisted_1$8, [
  5162. vue.createElementVNode("div", _hoisted_2$5, [
  5163. vue.createElementVNode("div", {
  5164. class: "item",
  5165. onClick: hide
  5166. }, [
  5167. vue.createElementVNode("div", _hoisted_3$4, [
  5168. vue.createVNode(vue.unref(Icon), { icon: "solar:forbidden-circle-outline" })
  5169. ]),
  5170. _hoisted_4$4
  5171. ]),
  5172. vue.createElementVNode("div", {
  5173. class: "item",
  5174. onClick: handleCopy
  5175. }, [
  5176. vue.createElementVNode("div", _hoisted_5$3, [
  5177. vue.createVNode(vue.unref(Icon), { icon: "octicon:copy-24" })
  5178. ]),
  5179. _hoisted_6$3
  5180. ]),
  5181. vue.createElementVNode("div", {
  5182. class: vue.normalizeClass(["item", [!_ctx.comment.replyUsers.length && "disabled"]]),
  5183. onClick: showRelationReply
  5184. }, [
  5185. vue.createElementVNode("div", _hoisted_7$2, [
  5186. vue.createVNode(vue.unref(Icon), { icon: "iconoir:page-search" })
  5187. ]),
  5188. _hoisted_8$2
  5189. ], 2),
  5190. vue.createElementVNode("div", {
  5191. class: vue.normalizeClass(["item", [_ctx.comment.isThanked && "full"]]),
  5192. onClick: thank
  5193. }, [
  5194. vue.createElementVNode("div", _hoisted_9$2, [
  5195. _ctx.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5196. key: 0,
  5197. icon: "icon-park-solid:like"
  5198. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5199. key: 1,
  5200. icon: "icon-park-outline:like"
  5201. }))
  5202. ]),
  5203. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.comment.isThanked ? "已" : "") + "感谢", 1)
  5204. ], 2),
  5205. vue.createElementVNode("div", {
  5206. class: "item",
  5207. onClick: _cache[0] || (_cache[0] = ($event) => emit("reply"))
  5208. }, [
  5209. vue.createElementVNode("div", _hoisted_10$1, [
  5210. vue.createVNode(vue.unref(Icon), { icon: "mynaui:message" })
  5211. ]),
  5212. _hoisted_11$1
  5213. ]),
  5214. _ctx.comment.top ? (vue.openBlock(), vue.createElementBlock("div", {
  5215. key: 0,
  5216. class: "item",
  5217. onClick: jump
  5218. }, [
  5219. vue.createElementVNode("div", _hoisted_12$1, [
  5220. vue.createVNode(vue.unref(Icon), { icon: "icon-park-outline:to-bottom" })
  5221. ]),
  5222. _hoisted_13$1
  5223. ])) : vue.createCommentVNode("", true)
  5224. ]),
  5225. vue.createElementVNode("div", {
  5226. class: "cancel",
  5227. onClick: close
  5228. }, "取消")
  5229. ])
  5230. ]),
  5231. _: 1
  5232. }, 8, ["model-value"]);
  5233. };
  5234. }
  5235. });
  5236. const CommentOptions = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-8ef13a81"]]);
  5237. const _hoisted_1$7 = { class: "comments" };
  5238. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  5239. __name: "RelationReply",
  5240. props: {
  5241. modelValue: { type: Boolean },
  5242. relationReply: {},
  5243. targetUser: {},
  5244. post: {}
  5245. },
  5246. emits: ["close", "reply", "merge", "update:modelValue"],
  5247. setup(__props, { emit: __emit }) {
  5248. const emit = __emit;
  5249. vue.inject("config");
  5250. vue.inject("isLogin");
  5251. return (_ctx, _cache) => {
  5252. return vue.openBlock(), vue.createBlock(FromBottomDialog, {
  5253. "page-id": "post-detail",
  5254. height: "70vh",
  5255. "model-value": _ctx.modelValue,
  5256. onCancel: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", false))
  5257. }, {
  5258. default: vue.withCtx(() => [
  5259. vue.createElementVNode("div", _hoisted_1$7, [
  5260. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.relationReply, (item, index) => {
  5261. return vue.openBlock(), vue.createBlock(SingleComment, {
  5262. "is-right": item.username === _ctx.targetUser.right,
  5263. key: item.floor,
  5264. comment: item
  5265. }, null, 8, ["is-right", "comment"]);
  5266. }), 128))
  5267. ])
  5268. ]),
  5269. _: 1
  5270. }, 8, ["model-value"]);
  5271. };
  5272. }
  5273. });
  5274. const _sfc_main$6 = {
  5275. name: "detail",
  5276. emits: ["saveReadList", "refresh"],
  5277. components: {
  5278. BackIcon: _sfc_main$p,
  5279. BaseSelect,
  5280. RelationReply: _sfc_main$7,
  5281. CommentOptions,
  5282. FromBottomDialog,
  5283. PostOptions,
  5284. MoreIcon,
  5285. BaseButton,
  5286. SingleComment,
  5287. Comment,
  5288. PostEditor,
  5289. Point,
  5290. Toolbar,
  5291. BaseHtmlRender,
  5292. Tooltip,
  5293. BaseLoading,
  5294. Icon
  5295. },
  5296. inject: ["allReplyUsers", "user", "post", "tags", "isLogin", "config", "pageType", "isNight"],
  5297. props: {
  5298. modelValue: {
  5299. type: Boolean,
  5300. default() {
  5301. return false;
  5302. }
  5303. },
  5304. loading: {
  5305. type: Boolean,
  5306. default() {
  5307. return false;
  5308. }
  5309. },
  5310. refreshLoading: {
  5311. type: Boolean,
  5312. default() {
  5313. return false;
  5314. }
  5315. },
  5316. displayType: CommentDisplayType.FloorInFloorNoCallUser
  5317. },
  5318. data() {
  5319. return {
  5320. isSticky: false,
  5321. showPostOptions: false,
  5322. showCommentOptions: false,
  5323. selectCallIndex: 0,
  5324. showCallList: false,
  5325. showRelationReply: false,
  5326. replyText: "",
  5327. callStyle: {
  5328. top: 0,
  5329. left: 0
  5330. },
  5331. targetUser: {
  5332. left: [],
  5333. right: "",
  5334. rightFloor: -1
  5335. },
  5336. debounceScroll: () => {
  5337. },
  5338. read: {
  5339. floor: 0,
  5340. total: 0
  5341. },
  5342. currentFloor: "",
  5343. showOpTag: false,
  5344. currentComment: null
  5345. };
  5346. },
  5347. computed: {
  5348. eventBus() {
  5349. return eventBus;
  5350. },
  5351. CMD() {
  5352. return CMD;
  5353. },
  5354. replyUser() {
  5355. if (this.currentComment)
  5356. return this.currentComment.username;
  5357. return null;
  5358. },
  5359. replyFloor() {
  5360. if (this.currentComment)
  5361. return this.currentComment.floor;
  5362. return null;
  5363. },
  5364. isMy() {
  5365. return this.post.member.username === window.user.username;
  5366. },
  5367. myTags() {
  5368. return this.tags[this.post.member.username] ?? [];
  5369. },
  5370. CommentDisplayType() {
  5371. return CommentDisplayType;
  5372. },
  5373. isPost() {
  5374. return this.pageType === PageType.Post;
  5375. },
  5376. filterCallList() {
  5377. if (this.showCallList) {
  5378. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  5379. if (this.replyText)
  5380. return list.filter((i) => i.search(this.replyText) > -1);
  5381. return list;
  5382. }
  5383. return [];
  5384. },
  5385. topReply() {
  5386. return this.post.replyList.filter((v) => v.thankCount >= this.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, this.config.topReplyCount);
  5387. },
  5388. replyList() {
  5389. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  5390. return this.post.nestedReplies;
  5391. if (this.displayType === CommentDisplayType.Like) {
  5392. return window.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  5393. }
  5394. if (this.displayType === CommentDisplayType.V2exOrigin)
  5395. return this.post.replyList;
  5396. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  5397. return this.post.nestedRedundReplies;
  5398. if (this.displayType === CommentDisplayType.OnlyOp)
  5399. return this.post.replyList.filter((v) => {
  5400. var _a;
  5401. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  5402. });
  5403. return [];
  5404. },
  5405. //关联回复
  5406. relationReply() {
  5407. if (this.targetUser.left.length && this.targetUser.right) {
  5408. return this.post.replyList.filter((v) => {
  5409. if (this.targetUser.left.includes(v.username)) {
  5410. if (v.floor > this.targetUser.rightFloor) {
  5411. if (v.replyUsers.includes(this.targetUser.right)) {
  5412. return true;
  5413. }
  5414. } else {
  5415. return true;
  5416. }
  5417. }
  5418. if (v.username === this.targetUser.right) {
  5419. for (let i = 0; i < this.targetUser.left.length; i++) {
  5420. if (v.replyUsers.includes(this.targetUser.left[i])) {
  5421. return true;
  5422. }
  5423. }
  5424. }
  5425. });
  5426. }
  5427. return [];
  5428. }
  5429. },
  5430. watch: {
  5431. "post.id"(n2, o) {
  5432. if (this.$refs["post-editor"]) {
  5433. this.$refs["post-editor"].content = "";
  5434. vue.nextTick(() => {
  5435. this.scrollTop(false);
  5436. });
  5437. }
  5438. },
  5439. "post.headerTemplate"(n2, o) {
  5440. let mountEl = document.querySelector(".main-wrapper .post-wrapper .html-wrapper .header");
  5441. if (mountEl) {
  5442. this.showOpTag = true;
  5443. }
  5444. },
  5445. modelValue: {
  5446. handler(newVal) {
  5447. if (this.isPost) {
  5448. return;
  5449. }
  5450. if (newVal) {
  5451. if (!window.history.state) {
  5452. window.history.pushState({}, 0, this.post.href);
  5453. }
  5454. this.read = this.post.read;
  5455. this.currentFloor = "";
  5456. vue.nextTick(() => {
  5457. window.document.title = this.post.title ?? "V2EX";
  5458. });
  5459. } else {
  5460. this.$emit("saveReadList");
  5461. window.document.title = "V2EX";
  5462. this.isSticky = false;
  5463. this.showRelationReply = false;
  5464. if (window.history.state) {
  5465. window.history.back();
  5466. }
  5467. }
  5468. }
  5469. }
  5470. },
  5471. mounted() {
  5472. this.debounceScroll = debounce(this.scroll, 300, false);
  5473. if (this.isLogin) {
  5474. const observer = new IntersectionObserver(
  5475. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  5476. { threshold: [1] }
  5477. );
  5478. observer.observe(this.$refs.replyBox);
  5479. window.addEventListener("keydown", this.onKeyDown);
  5480. }
  5481. eventBus.on(CMD.SHOW_CALL, (val) => {
  5482. if (val.show) {
  5483. this.showCallList = true;
  5484. this.replyText = val.text;
  5485. if (this.isPost) {
  5486. this.callStyle.top = val.top + $(window.win()).scrollTop() + -40 + "px";
  5487. } else {
  5488. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  5489. }
  5490. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  5491. if (this.selectCallIndex >= this.filterCallList.length) {
  5492. this.selectCallIndex = 0;
  5493. }
  5494. } else {
  5495. this.replyText = "";
  5496. this.showCallList = false;
  5497. this.selectCallIndex = 0;
  5498. }
  5499. });
  5500. eventBus.on(CMD.RELATION_REPLY, (val) => {
  5501. this.targetUser = val;
  5502. this.showRelationReply = true;
  5503. });
  5504. eventBus.on(CMD.JUMP, this.jump);
  5505. if (this.isPost) {
  5506. window.addEventListener("scroll", this.debounceScroll);
  5507. }
  5508. eventBus.on(CMD.SHOW_COMMENT_OPTIONS, (comment) => {
  5509. this.currentComment = comment;
  5510. this.showCommentOptions = true;
  5511. });
  5512. eventBus.on(CMD.SHOW_EDITOR, (comment) => {
  5513. this.currentComment = comment;
  5514. this.isSticky = true;
  5515. setTimeout(() => {
  5516. var _a;
  5517. (_a = this.$refs["post-editor"]) == null ? void 0 : _a.focus();
  5518. }, 300);
  5519. });
  5520. },
  5521. beforeUnmount() {
  5522. window.removeEventListener("keydown", this.onKeyDown);
  5523. eventBus.off(CMD.SHOW_CALL);
  5524. },
  5525. methods: {
  5526. clickAvatar() {
  5527. window.functions.clickAvatar(".post-wrapper ");
  5528. },
  5529. addTag() {
  5530. eventBus.emit(CMD.ADD_TAG, this.post.member.username);
  5531. },
  5532. removeTag(tag) {
  5533. eventBus.emit(CMD.REMOVE_TAG, { username: this.post.member.username, tag });
  5534. },
  5535. scroll() {
  5536. if (!this.config.rememberLastReadFloor)
  5537. return;
  5538. let height = window.innerHeight * 0.3;
  5539. let comments = $(".comments .comment");
  5540. let forCount = 0;
  5541. for (let i = 0; i < comments.length; i++) {
  5542. forCount++;
  5543. let ins = comments[i];
  5544. let rect = ins.getBoundingClientRect();
  5545. if (rect.top > height) {
  5546. let lastReadFloor = Number(ins.dataset["floor"]);
  5547. console.log("当前阅读楼层", lastReadFloor);
  5548. eventBus.emit(CMD.ADD_READ, {
  5549. floor: lastReadFloor > 3 ? lastReadFloor : 0,
  5550. total: this.post.replyList.length
  5551. });
  5552. if (lastReadFloor > 3) {
  5553. this.read.floor = 0;
  5554. }
  5555. break;
  5556. }
  5557. }
  5558. if (forCount === comments.length) {
  5559. console.log("看到最后了");
  5560. eventBus.emit(CMD.ADD_READ, {
  5561. floor: forCount,
  5562. total: this.post.replyList.length
  5563. });
  5564. }
  5565. },
  5566. jump(floor) {
  5567. let lastItem = this.replyList[this.replyList.length - 1];
  5568. if (floor === "") {
  5569. floor = lastItem.floor;
  5570. } else {
  5571. try {
  5572. floor = Number(floor);
  5573. } catch (e2) {
  5574. floor = lastItem.floor;
  5575. }
  5576. if (floor === 0) {
  5577. floor = 1;
  5578. }
  5579. if (floor > lastItem.floor)
  5580. floor = lastItem.floor;
  5581. }
  5582. if (!this.post.replyList.length) {
  5583. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  5584. this.read.floor = 0;
  5585. return;
  5586. }
  5587. if (floor > this.post.replyList.length) {
  5588. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5589. this.read.floor = 0;
  5590. return;
  5591. }
  5592. let comment = $(`.c_${floor}`);
  5593. if (!comment.length) {
  5594. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5595. this.read.floor = 0;
  5596. return;
  5597. }
  5598. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  5599. comment.addClass("ding");
  5600. this.read.floor = 0;
  5601. this.currentFloor = floor + 1;
  5602. setTimeout(() => {
  5603. comment.removeClass("ding");
  5604. }, 2e3);
  5605. },
  5606. jumpLastRead(floor) {
  5607. if (this.config.autoJumpLastReadFloor) {
  5608. if (!floor)
  5609. return;
  5610. setTimeout(() => {
  5611. console.log("上次跳转", floor);
  5612. this.jump(floor);
  5613. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "已跳转到上次阅读位置" });
  5614. }, 300);
  5615. }
  5616. },
  5617. collapseTopReplyList() {
  5618. $(this.$refs.topReply).slideToggle("fast");
  5619. },
  5620. goBottom() {
  5621. this.isSticky = false;
  5622. setTimeout(() => {
  5623. let postWrapper = document.querySelector(".post-wrapper");
  5624. postWrapper.scrollTo({ top: this.$refs["detail"].clientHeight, behavior: "smooth" });
  5625. });
  5626. },
  5627. close() {
  5628. this.$emit("update:modelValue", false);
  5629. },
  5630. setCall(e2) {
  5631. eventBus.emit(CMD.SET_CALL, e2);
  5632. this.showCallList = false;
  5633. },
  5634. onKeyDown(e2) {
  5635. if (!this.modelValue)
  5636. return;
  5637. if (!this.showCallList)
  5638. return;
  5639. let length = this.filterCallList.slice(0, 10).length;
  5640. if (e2.keyCode === 13) {
  5641. this.setCall(this.filterCallList[this.selectCallIndex]);
  5642. e2.preventDefault();
  5643. }
  5644. if (e2.keyCode === 38) {
  5645. this.selectCallIndex--;
  5646. if (this.selectCallIndex < 0) {
  5647. this.selectCallIndex = length - 1;
  5648. }
  5649. e2.preventDefault();
  5650. }
  5651. if (e2.keyCode === 40) {
  5652. this.selectCallIndex++;
  5653. if (this.selectCallIndex > length - 1) {
  5654. this.selectCallIndex = 0;
  5655. }
  5656. e2.preventDefault();
  5657. }
  5658. },
  5659. scrollTop(anim = true) {
  5660. document.querySelector(".post-wrapper").scrollTo({ top: 0, behavior: anim ? "smooth" : "instant" });
  5661. }
  5662. }
  5663. };
  5664. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-546d3b11"), n2 = n2(), vue.popScopeId(), n2);
  5665. const _hoisted_1$6 = { class: "left" };
  5666. const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "/" }, "V2EX", -1));
  5667. const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "chevron" }, "  ›  ", -1));
  5668. const _hoisted_4$3 = ["href"];
  5669. const _hoisted_5$2 = { class: "right" };
  5670. const _hoisted_6$2 = ["src"];
  5671. const _hoisted_7$1 = { class: "my-box post-main-body" };
  5672. const _hoisted_8$1 = { class: "box-content" };
  5673. const _hoisted_9$1 = { class: "box-header" };
  5674. const _hoisted_10 = { class: "gray" };
  5675. const _hoisted_11 = ["href"];
  5676. const _hoisted_12 = ["src"];
  5677. const _hoisted_13 = { class: "info" };
  5678. const _hoisted_14 = { class: "top" };
  5679. const _hoisted_15 = ["href"];
  5680. const _hoisted_16 = {
  5681. key: 0,
  5682. class: "center"
  5683. };
  5684. const _hoisted_17 = { class: "my-tag" };
  5685. const _hoisted_18 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5686. const _hoisted_19 = ["onClick"];
  5687. const _hoisted_20 = { class: "bottom" };
  5688. const _hoisted_21 = ["title"];
  5689. const _hoisted_22 = ["href"];
  5690. const _hoisted_23 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-info-circle" }, null, -1));
  5691. const _hoisted_24 = [
  5692. _hoisted_23
  5693. ];
  5694. const _hoisted_25 = ["href"];
  5695. const _hoisted_26 = {
  5696. key: 0,
  5697. class: "my-box"
  5698. };
  5699. const _hoisted_27 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "" }, "高赞回复", -1));
  5700. const _hoisted_28 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "top-reply" }, [
  5701. /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-compress" })
  5702. ], -1));
  5703. const _hoisted_29 = [
  5704. _hoisted_27,
  5705. _hoisted_28
  5706. ];
  5707. const _hoisted_30 = { ref: "topReply" };
  5708. const _hoisted_31 = {
  5709. key: 1,
  5710. class: "my-cell flex comments-header"
  5711. };
  5712. const _hoisted_32 = {
  5713. key: 2,
  5714. class: "my-box comment-wrapper"
  5715. };
  5716. const _hoisted_33 = {
  5717. key: 0,
  5718. class: "loading-wrapper"
  5719. };
  5720. const _hoisted_34 = {
  5721. key: 1,
  5722. class: "comments"
  5723. };
  5724. const _hoisted_35 = {
  5725. key: 3,
  5726. id: "no-comments-yet"
  5727. };
  5728. const _hoisted_36 = { class: "my-cell flex" };
  5729. const _hoisted_37 = { class: "notice-right gray" };
  5730. const _hoisted_38 = { class: "p1" };
  5731. const _hoisted_39 = ["onClick"];
  5732. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  5733. const _component_BackIcon = vue.resolveComponent("BackIcon");
  5734. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5735. const _component_MoreIcon = vue.resolveComponent("MoreIcon");
  5736. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  5737. const _component_Toolbar = vue.resolveComponent("Toolbar");
  5738. const _component_Comment = vue.resolveComponent("Comment");
  5739. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  5740. const _component_PostEditor = vue.resolveComponent("PostEditor");
  5741. const _component_post_options = vue.resolveComponent("post-options");
  5742. const _component_comment_options = vue.resolveComponent("comment-options");
  5743. const _component_relation_reply = vue.resolveComponent("relation-reply");
  5744. return vue.openBlock(), vue.createBlock(vue.Teleport, { to: ".post-wrapper" }, [
  5745. vue.createElementVNode("div", {
  5746. class: vue.normalizeClass(["post-detail", [
  5747. $options.isNight ? "isNight" : "",
  5748. $options.pageType
  5749. ]]),
  5750. ref: "detail",
  5751. id: "post-detail",
  5752. onScroll: _cache[20] || (_cache[20] = (...args) => $data.debounceScroll && $data.debounceScroll(...args))
  5753. }, [
  5754. vue.createElementVNode("div", {
  5755. class: "my-box nav-bar",
  5756. onDblclick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  5757. }, [
  5758. vue.createElementVNode("div", _hoisted_1$6, [
  5759. !$options.isPost ? (vue.openBlock(), vue.createBlock(_component_BackIcon, {
  5760. key: 0,
  5761. onClick: vue.withModifiers($options.close, ["stop"])
  5762. }, null, 8, ["onClick"])) : vue.createCommentVNode("", true),
  5763. $options.isPost ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5764. _hoisted_2$4,
  5765. _hoisted_3$3
  5766. ], 64)) : vue.createCommentVNode("", true),
  5767. vue.createElementVNode("a", {
  5768. href: $options.post.node.url
  5769. }, vue.toDisplayString($options.post.node.title), 9, _hoisted_4$3)
  5770. ]),
  5771. vue.createElementVNode("div", _hoisted_5$2, [
  5772. $props.refreshLoading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, { key: 0 })) : vue.createCommentVNode("", true),
  5773. vue.createVNode(_component_MoreIcon, {
  5774. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $data.showPostOptions = true, ["stop"]))
  5775. }),
  5776. $options.user.avatar ? (vue.openBlock(), vue.createElementBlock("img", {
  5777. key: 1,
  5778. onClick: _cache[1] || (_cache[1] = (...args) => $options.clickAvatar && $options.clickAvatar(...args)),
  5779. style: { "margin-right": "0" },
  5780. class: "avatar mobile",
  5781. src: $options.user.avatar
  5782. }, null, 8, _hoisted_6$2)) : vue.createCommentVNode("", true)
  5783. ])
  5784. ], 32),
  5785. vue.createElementVNode("div", _hoisted_7$1, [
  5786. vue.createElementVNode("div", _hoisted_8$1, [
  5787. vue.createElementVNode("div", _hoisted_9$1, [
  5788. vue.createElementVNode("small", _hoisted_10, [
  5789. $options.post.member.avatar_large ? (vue.openBlock(), vue.createElementBlock("a", {
  5790. key: 0,
  5791. class: "base-avatar",
  5792. href: `/member/${$options.post.member.username}`
  5793. }, [
  5794. vue.createElementVNode("img", {
  5795. src: $options.post.member.avatar_large
  5796. }, null, 8, _hoisted_12)
  5797. ], 8, _hoisted_11)) : vue.createCommentVNode("", true),
  5798. vue.createElementVNode("div", _hoisted_13, [
  5799. vue.createElementVNode("div", _hoisted_14, [
  5800. vue.createElementVNode("a", {
  5801. href: `/member/${$options.post.member.username}`
  5802. }, vue.toDisplayString($options.post.member.username), 9, _hoisted_15),
  5803. $options.post.member.createDate ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  5804. vue.createTextVNode(" · "),
  5805. vue.createElementVNode("span", {
  5806. class: vue.normalizeClass($options.post.member.isNew && "danger")
  5807. }, vue.toDisplayString($options.post.member.createDate), 3)
  5808. ], 64)) : vue.createCommentVNode("", true)
  5809. ]),
  5810. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
  5811. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  5812. return vue.openBlock(), vue.createElementBlock("span", _hoisted_17, [
  5813. _hoisted_18,
  5814. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  5815. vue.createElementVNode("i", {
  5816. class: "fa fa-trash-o remove",
  5817. onClick: ($event) => $options.removeTag(i)
  5818. }, null, 8, _hoisted_19)
  5819. ]);
  5820. }), 256)),
  5821. vue.createElementVNode("span", {
  5822. class: "add-tag ago",
  5823. onClick: _cache[3] || (_cache[3] = (...args) => $options.addTag && $options.addTag(...args)),
  5824. title: "添加标签"
  5825. }, "+")
  5826. ])) : vue.createCommentVNode("", true),
  5827. vue.createElementVNode("div", _hoisted_20, [
  5828. $options.post.createDateAgo ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  5829. vue.createElementVNode("span", {
  5830. title: $options.post.createDate
  5831. }, vue.toDisplayString($options.post.createDateAgo), 9, _hoisted_21),
  5832. vue.createTextVNode(" · ")
  5833. ], 64)) : vue.createCommentVNode("", true),
  5834. vue.createTextVNode(" " + vue.toDisplayString($options.post.clickCount) + " 次点击 ", 1),
  5835. $options.isMy ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5836. vue.createTextVNode("   "),
  5837. vue.createElementVNode("a", {
  5838. href: `/t/${$options.post.id}/info`
  5839. }, _hoisted_24, 8, _hoisted_22),
  5840. vue.createTextVNode("   "),
  5841. vue.createElementVNode("a", {
  5842. href: `/append/topic/${$options.post.id}`,
  5843. class: "op"
  5844. }, "APPEND", 8, _hoisted_25)
  5845. ], 64)) : vue.createCommentVNode("", true)
  5846. ])
  5847. ])
  5848. ]),
  5849. vue.createElementVNode("h1", null, vue.toDisplayString($options.post.title), 1)
  5850. ]),
  5851. vue.createVNode(_component_BaseHtmlRender, {
  5852. html: $options.post.headerTemplate
  5853. }, null, 8, ["html"])
  5854. ]),
  5855. vue.createVNode(_component_Toolbar, {
  5856. onReply: _cache[4] || (_cache[4] = ($event) => {
  5857. $data.isSticky = !$data.isSticky;
  5858. $data.currentComment = null;
  5859. })
  5860. })
  5861. ]),
  5862. $options.topReply.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, [
  5863. vue.createElementVNode("div", {
  5864. class: "my-cell flex",
  5865. onClick: _cache[5] || (_cache[5] = (...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args))
  5866. }, _hoisted_29),
  5867. vue.createElementVNode("div", _hoisted_30, [
  5868. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.topReply, (item, index) => {
  5869. return vue.openBlock(), vue.createBlock(_component_Comment, {
  5870. key: item.floor,
  5871. type: "top",
  5872. modelValue: $options.topReply[index],
  5873. "onUpdate:modelValue": ($event) => $options.topReply[index] = $event
  5874. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  5875. }), 128))
  5876. ], 512)
  5877. ])) : vue.createCommentVNode("", true),
  5878. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_31, [
  5879. vue.createElementVNode("span", null, vue.toDisplayString($options.post.replyCount) + " 条回复", 1),
  5880. vue.createVNode(_component_BaseSelect, {
  5881. "display-type": $props.displayType,
  5882. "onUpdate:displayType": _cache[6] || (_cache[6] = (e2) => _ctx.$emit("update:displayType", e2))
  5883. }, null, 8, ["display-type"])
  5884. ])) : vue.createCommentVNode("", true),
  5885. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_32, [
  5886. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_33, [
  5887. vue.createVNode(_component_BaseLoading, { size: "large" })
  5888. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
  5889. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index) => {
  5890. return vue.openBlock(), vue.createBlock(_component_Comment, {
  5891. key: item.floor,
  5892. modelValue: $options.replyList[index],
  5893. "onUpdate:modelValue": ($event) => $options.replyList[index] = $event
  5894. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  5895. }), 128)) : vue.createCommentVNode("", true)
  5896. ]))
  5897. ])) : vue.createCommentVNode("", true),
  5898. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_35, "目前尚无回复")) : vue.createCommentVNode("", true),
  5899. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  5900. key: 4,
  5901. class: vue.normalizeClass(["my-box", { "sticky": $data.isSticky }]),
  5902. ref: "replyBox"
  5903. }, [
  5904. vue.createElementVNode("div", _hoisted_36, [
  5905. vue.createElementVNode("span", null, vue.toDisplayString($data.currentComment ? `回复${$data.currentComment.floor}楼` : "回复主题"), 1),
  5906. vue.createElementVNode("div", _hoisted_37, [
  5907. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  5908. key: 0,
  5909. style: { "margin-right": "2rem" },
  5910. onClick: _cache[7] || (_cache[7] = ($event) => {
  5911. $data.isSticky = false;
  5912. $data.currentComment = null;
  5913. })
  5914. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  5915. vue.createElementVNode("a", {
  5916. onClick: _cache[8] || (_cache[8] = (...args) => $options.scrollTop && $options.scrollTop(...args))
  5917. }, "回到顶部")
  5918. ])
  5919. ]),
  5920. vue.createElementVNode("div", _hoisted_38, [
  5921. vue.createVNode(_component_PostEditor, {
  5922. onClose: $options.goBottom,
  5923. ref: "post-editor",
  5924. useType: $data.currentComment ? "reply-comment" : "reply-post",
  5925. replyUser: $options.replyUser,
  5926. replyFloor: $options.replyFloor,
  5927. onClick: _cache[9] || (_cache[9] = ($event) => $data.isSticky = true)
  5928. }, null, 8, ["onClose", "useType", "replyUser", "replyFloor"])
  5929. ])
  5930. ], 2)) : vue.createCommentVNode("", true),
  5931. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  5932. key: 5,
  5933. class: "call-list",
  5934. style: vue.normalizeStyle($data.callStyle)
  5935. }, [
  5936. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList, (item, index) => {
  5937. return vue.openBlock(), vue.createElementBlock("div", {
  5938. class: vue.normalizeClass(["call-item", { select: index === $data.selectCallIndex }]),
  5939. onClick: ($event) => $options.setCall(item)
  5940. }, [
  5941. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  5942. ], 10, _hoisted_39);
  5943. }), 256))
  5944. ], 4)) : vue.createCommentVNode("", true),
  5945. vue.createVNode(_component_post_options, {
  5946. onMerge: _cache[10] || (_cache[10] = (val) => {
  5947. $options.post = Object.assign($options.post, val);
  5948. console.log("va", val, $options.post);
  5949. }),
  5950. post: $options.post,
  5951. onReply: _cache[11] || (_cache[11] = ($event) => ($options.eventBus.emit($options.CMD.SHOW_EDITOR, null), $data.showPostOptions = false)),
  5952. onRefresh: _cache[12] || (_cache[12] = ($event) => _ctx.$emit("refresh")),
  5953. modelValue: $data.showPostOptions,
  5954. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.showPostOptions = $event)
  5955. }, null, 8, ["post", "modelValue"]),
  5956. vue.createVNode(_component_comment_options, {
  5957. onMerge: _cache[14] || (_cache[14] = (val) => $data.currentComment = Object.assign($data.currentComment, val)),
  5958. onRecallThank: _cache[15] || (_cache[15] = ($event) => $data.currentComment.isThanked = false),
  5959. post: $options.post,
  5960. comment: $data.currentComment,
  5961. onClose: _cache[16] || (_cache[16] = ($event) => $data.currentComment = null),
  5962. onReply: _cache[17] || (_cache[17] = ($event) => ($options.eventBus.emit($options.CMD.SHOW_EDITOR, $data.currentComment), $data.showCommentOptions = false)),
  5963. modelValue: $data.showCommentOptions,
  5964. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.showCommentOptions = $event)
  5965. }, null, 8, ["post", "comment", "modelValue"]),
  5966. vue.createVNode(_component_relation_reply, {
  5967. post: $options.post,
  5968. "relation-reply": $options.relationReply,
  5969. modelValue: $data.showRelationReply,
  5970. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.showRelationReply = $event),
  5971. "target-user": $data.targetUser
  5972. }, null, 8, ["post", "relation-reply", "modelValue", "target-user"])
  5973. ], 34)
  5974. ]);
  5975. }
  5976. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2], ["__scopeId", "data-v-546d3b11"]]);
  5977. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-1988f33b"), n2 = n2(), vue.popScopeId(), n2);
  5978. const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  5979. width: "24",
  5980. height: "24",
  5981. viewBox: "0 0 48 48",
  5982. fill: "none",
  5983. xmlns: "http://www.w3.org/2000/svg"
  5984. }, [
  5985. /* @__PURE__ */ vue.createElementVNode("path", {
  5986. d: "M17 32L19.1875 27M31 32L28.8125 27M19.1875 27L24 16L28.8125 27M19.1875 27H28.8125",
  5987. stroke: "#929596",
  5988. "stroke-width": "4",
  5989. "stroke-linecap": "round",
  5990. "stroke-linejoin": "round"
  5991. }),
  5992. /* @__PURE__ */ vue.createElementVNode("path", {
  5993. d: "M43.1999 20C41.3468 10.871 33.2758 4 23.5999 4C13.9241 4 5.85308 10.871 4 20L10 18",
  5994. stroke: "#929596",
  5995. "stroke-width": "4",
  5996. "stroke-linecap": "round",
  5997. "stroke-linejoin": "round"
  5998. }),
  5999. /* @__PURE__ */ vue.createElementVNode("path", {
  6000. d: "M4 28C5.85308 37.129 13.9241 44 23.5999 44C33.2758 44 41.3468 37.129 43.1999 28L38 30",
  6001. stroke: "#929596",
  6002. "stroke-width": "4",
  6003. "stroke-linecap": "round",
  6004. "stroke-linejoin": "round"
  6005. })
  6006. ], -1));
  6007. const _hoisted_2$3 = { key: 1 };
  6008. const _sfc_main$5 = {
  6009. __name: "Base64Tooltip",
  6010. setup(__props) {
  6011. const tooltip = vue.ref(null);
  6012. const show = vue.ref(false);
  6013. const originalText = vue.ref("");
  6014. const decodeText = vue.ref("");
  6015. const styleObject = vue.reactive({
  6016. left: "-100vw",
  6017. top: "-100vh"
  6018. });
  6019. vue.onMounted(() => {
  6020. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  6021. setTimeout(() => show.value = true);
  6022. originalText.value = text;
  6023. decodeText.value = "";
  6024. styleObject.left = e2.clientX + "px";
  6025. styleObject.top = e2.clientY + 20 + "px";
  6026. });
  6027. window.addEventListener("click", (e2) => {
  6028. if (!tooltip.value)
  6029. return;
  6030. if (!tooltip.value.contains(e2.target) && show.value) {
  6031. show.value = false;
  6032. }
  6033. }, { capture: true });
  6034. const fn = () => show.value && (show.value = false);
  6035. $(".post-detail", window.win().doc).on("scroll", fn);
  6036. });
  6037. function base64ToArrayBuffer(base64) {
  6038. let binary_string = window.atob(base64);
  6039. let len = binary_string.length;
  6040. let bytes = new Uint8Array(len);
  6041. for (let i = 0; i < len; i++) {
  6042. bytes[i] = binary_string.charCodeAt(i);
  6043. }
  6044. return bytes.buffer;
  6045. }
  6046. function decode() {
  6047. try {
  6048. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  6049. decodeText.value = r2;
  6050. });
  6051. } catch (e2) {
  6052. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  6053. }
  6054. }
  6055. return (_ctx, _cache) => {
  6056. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  6057. class: "base64_tooltip",
  6058. style: vue.normalizeStyle(styleObject),
  6059. onClick: decode,
  6060. ref_key: "tooltip",
  6061. ref: tooltip
  6062. }, [
  6063. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6064. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  6065. _hoisted_1$5
  6066. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
  6067. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  6068. vue.createVNode(BaseButton, {
  6069. class: "btn",
  6070. size: "small",
  6071. onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(copy)(decodeText.value))
  6072. }, {
  6073. default: vue.withCtx(() => [
  6074. vue.createTextVNode("点击复制")
  6075. ]),
  6076. _: 1
  6077. })
  6078. ]))
  6079. ], 4)), [
  6080. [vue.vShow, show.value]
  6081. ]);
  6082. };
  6083. }
  6084. };
  6085. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-1988f33b"]]);
  6086. const _sfc_main$4 = {
  6087. name: "Msg",
  6088. components: { Icon },
  6089. props: {
  6090. type: "",
  6091. text: ""
  6092. },
  6093. created() {
  6094. setTimeout(() => {
  6095. this.$emit("close");
  6096. }, 3e3);
  6097. }
  6098. };
  6099. const _hoisted_1$4 = { class: "right" };
  6100. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  6101. const _component_Icon = vue.resolveComponent("Icon");
  6102. return vue.openBlock(), vue.createElementBlock("div", {
  6103. class: vue.normalizeClass(["msg", $props.type])
  6104. }, [
  6105. vue.createElementVNode("div", {
  6106. class: "left",
  6107. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  6108. }, [
  6109. vue.createVNode(_component_Icon, { icon: "ic:round-close" })
  6110. ]),
  6111. vue.createElementVNode("div", _hoisted_1$4, vue.toDisplayString($props.text), 1)
  6112. ], 2);
  6113. }
  6114. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-0dcc0508"]]);
  6115. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-674b86aa"), n2 = n2(), vue.popScopeId(), n2);
  6116. const _hoisted_1$3 = {
  6117. key: 0,
  6118. class: "tag-modal modal"
  6119. };
  6120. const _hoisted_2$2 = { class: "wrapper" };
  6121. const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  6122. const _hoisted_4$2 = { class: "option" };
  6123. const _hoisted_5$1 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  6124. const _hoisted_6$1 = { class: "btns" };
  6125. const _sfc_main$3 = {
  6126. __name: "TagModal",
  6127. props: ["tags"],
  6128. emits: ["update:tags"],
  6129. setup(__props, { emit: __emit }) {
  6130. const tagModal = vue.reactive({
  6131. show: false,
  6132. currentUsername: "",
  6133. tag: ""
  6134. });
  6135. const props = __props;
  6136. const emit = __emit;
  6137. const inputRef = vue.ref();
  6138. vue.onMounted(() => {
  6139. eventBus.on(CMD.ADD_TAG, (username) => {
  6140. tagModal.currentUsername = username;
  6141. tagModal.show = true;
  6142. vue.nextTick(() => {
  6143. inputRef.value.focus();
  6144. });
  6145. });
  6146. });
  6147. async function addTag() {
  6148. if (!tagModal.tag) {
  6149. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请输入标签" });
  6150. return;
  6151. }
  6152. let oldTag = window.clone(props.tags);
  6153. let tempTag = window.clone(props.tags);
  6154. let userTags = tempTag[tagModal.currentUsername] ?? [];
  6155. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  6156. if (rIndex > -1) {
  6157. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  6158. return;
  6159. } else {
  6160. userTags.push(tagModal.tag);
  6161. }
  6162. tempTag[tagModal.currentUsername] = userTags;
  6163. emit("update:tags", tempTag);
  6164. tagModal.tag = "";
  6165. tagModal.show = false;
  6166. let res = await window.parse.saveTags(tempTag);
  6167. if (!res) {
  6168. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  6169. emit("update:tags", oldTag);
  6170. }
  6171. }
  6172. return (_ctx, _cache) => {
  6173. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6174. default: vue.withCtx(() => [
  6175. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  6176. vue.createElementVNode("div", {
  6177. class: "mask",
  6178. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  6179. }),
  6180. vue.createElementVNode("div", _hoisted_2$2, [
  6181. _hoisted_3$2,
  6182. vue.createElementVNode("div", _hoisted_4$2, [
  6183. _hoisted_5$1,
  6184. vue.createElementVNode("div", null, [
  6185. vue.createElementVNode("b", null, vue.toDisplayString(tagModal.currentUsername), 1)
  6186. ])
  6187. ]),
  6188. vue.withDirectives(vue.createElementVNode("input", {
  6189. type: "text",
  6190. ref_key: "inputRef",
  6191. ref: inputRef,
  6192. style: { "width": "100%" },
  6193. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  6194. onKeydown: vue.withKeys(addTag, ["enter"])
  6195. }, null, 544), [
  6196. [vue.vModelText, tagModal.tag]
  6197. ]),
  6198. vue.createElementVNode("div", _hoisted_6$1, [
  6199. vue.createVNode(BaseButton, {
  6200. type: "link",
  6201. onClick: _cache[2] || (_cache[2] = ($event) => tagModal.show = false)
  6202. }, {
  6203. default: vue.withCtx(() => [
  6204. vue.createTextVNode("取消")
  6205. ]),
  6206. _: 1
  6207. }),
  6208. vue.createVNode(BaseButton, { onClick: addTag }, {
  6209. default: vue.withCtx(() => [
  6210. vue.createTextVNode("确定")
  6211. ]),
  6212. _: 1
  6213. })
  6214. ])
  6215. ])
  6216. ])) : vue.createCommentVNode("", true)
  6217. ]),
  6218. _: 1
  6219. });
  6220. };
  6221. }
  6222. };
  6223. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-674b86aa"]]);
  6224. const _hoisted_1$2 = { class: "msgs" };
  6225. const _sfc_main$2 = {
  6226. __name: "MsgModal",
  6227. setup(__props) {
  6228. const msgList = vue.reactive([
  6229. // {type: 'success', text: '123', id: Date.now()}
  6230. ]);
  6231. vue.onMounted(() => {
  6232. eventBus.on(CMD.SHOW_MSG, (val) => {
  6233. msgList.push({ ...val, id: Date.now() });
  6234. });
  6235. });
  6236. function removeMsg(id) {
  6237. let rIndex = msgList.findIndex((item) => item.id === id);
  6238. if (rIndex > -1) {
  6239. msgList.splice(rIndex, 1);
  6240. }
  6241. }
  6242. return (_ctx, _cache) => {
  6243. return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  6244. vue.createElementVNode("div", _hoisted_1$2, [
  6245. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  6246. return vue.openBlock(), vue.createBlock(Msg, {
  6247. key: v.id,
  6248. type: v.type,
  6249. text: v.text,
  6250. onClose: ($event) => removeMsg(v.id)
  6251. }, null, 8, ["type", "text", "onClose"]);
  6252. }), 128))
  6253. ])
  6254. ]);
  6255. };
  6256. }
  6257. };
  6258. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-93c4dec0"]]);
  6259. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  6260. function e(e2) {
  6261. console.error(e2);
  6262. }
  6263. function r(e2, t) {
  6264. let r2 = e2.substr(t, 2);
  6265. return parseInt(r2, 16);
  6266. }
  6267. function n(href, index) {
  6268. let o = "", a = r(href, index);
  6269. for (let i = index + 2; i < href.length; i += 2) {
  6270. let l = r(href, i) ^ a;
  6271. o += String.fromCharCode(l);
  6272. }
  6273. try {
  6274. o = decodeURIComponent(escape(o));
  6275. } catch (u2) {
  6276. e(u2);
  6277. }
  6278. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  6279. return d.childNodes[0].getAttribute("href") || "";
  6280. }
  6281. function decodeEmail(body) {
  6282. try {
  6283. let as = body.find(u);
  6284. as.each(function() {
  6285. try {
  6286. let o = this, a = o.parentNode, i = o.getAttribute(f);
  6287. if (i) {
  6288. let l = n(i, 0), d2 = document.createTextNode(l);
  6289. a.replaceChild(d2, o);
  6290. }
  6291. } catch (h2) {
  6292. e(h2);
  6293. }
  6294. });
  6295. } catch (s) {
  6296. e(s);
  6297. }
  6298. }
  6299. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-19a5903e"), n2 = n2(), vue.popScopeId(), n2);
  6300. const _hoisted_1$1 = {
  6301. key: 0,
  6302. class: "tag-modal modal"
  6303. };
  6304. const _hoisted_2$1 = { class: "modal-root" };
  6305. const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 提醒系统 ", -1));
  6306. const _hoisted_4$1 = ["innerHTML"];
  6307. const _sfc_main$1 = {
  6308. __name: "NotificationModal",
  6309. props: ["modelValue", "h"],
  6310. emits: ["update:modelValue"],
  6311. setup(__props, { emit: __emit }) {
  6312. const emit = __emit;
  6313. vue.onMounted(() => {
  6314. });
  6315. function close() {
  6316. emit("update:modelValue", false);
  6317. }
  6318. return (_ctx, _cache) => {
  6319. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6320. default: vue.withCtx(() => [
  6321. __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  6322. vue.createElementVNode("div", {
  6323. class: "mask",
  6324. onClick: vue.withModifiers(close, ["stop"])
  6325. }),
  6326. vue.createElementVNode("div", _hoisted_2$1, [
  6327. vue.createElementVNode("div", { class: "modal-header" }, [
  6328. _hoisted_3$1,
  6329. vue.createElementVNode("i", {
  6330. class: "fa fa-times",
  6331. onClick: close
  6332. })
  6333. ]),
  6334. vue.createElementVNode("div", {
  6335. innerHTML: __props.h,
  6336. class: "modal-body"
  6337. }, null, 8, _hoisted_4$1)
  6338. ])
  6339. ])) : vue.createCommentVNode("", true)
  6340. ]),
  6341. _: 1
  6342. });
  6343. };
  6344. }
  6345. };
  6346. const NotificationModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-19a5903e"]]);
  6347. const _sfc_main = {
  6348. components: {
  6349. BaseButton,
  6350. NotificationModal,
  6351. BaseLoading,
  6352. BaseSwitch,
  6353. MsgModal,
  6354. TagModal,
  6355. Tooltip,
  6356. Setting,
  6357. PostDetail,
  6358. Base64Tooltip,
  6359. Msg
  6360. },
  6361. provide() {
  6362. return {
  6363. user: vue.computed(() => window.user),
  6364. isLogin: vue.computed(() => this.isLogin),
  6365. isNight: vue.computed(() => this.isNight),
  6366. pageType: vue.computed(() => this.pageType),
  6367. tags: vue.computed(() => this.tags),
  6368. show: vue.computed(() => this.show),
  6369. post: vue.computed(() => this.current),
  6370. config: vue.computed(() => this.config),
  6371. allReplyUsers: vue.computed(() => {
  6372. var _a, _b, _c;
  6373. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  6374. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  6375. }
  6376. return [];
  6377. })
  6378. };
  6379. },
  6380. data() {
  6381. return {
  6382. loading: window.pageType === PageType.Post,
  6383. refreshLoading: false,
  6384. loadMore: false,
  6385. isLogin: !!window.user.username,
  6386. pageType: window.pageType,
  6387. isNight: window.isNight,
  6388. stopMe: window.stopMe,
  6389. //停止使用脚本
  6390. show: false,
  6391. current: window.clone(window.initPost),
  6392. list: [],
  6393. config: window.clone(window.config),
  6394. tags: window.user.tags,
  6395. readList: window.user.readList,
  6396. notificationModal: {
  6397. show: false,
  6398. h: ""
  6399. },
  6400. step: 0
  6401. };
  6402. },
  6403. computed: {
  6404. targetUserTags() {
  6405. return this.tags[window.targetUserName] ?? [];
  6406. },
  6407. isList() {
  6408. return [PageType.Home, PageType.Node].includes(this.pageType);
  6409. },
  6410. isPost() {
  6411. return this.pageType === PageType.Post;
  6412. },
  6413. isMember() {
  6414. return this.pageType === PageType.Member;
  6415. }
  6416. },
  6417. watch: {
  6418. config: {
  6419. handler(newVal) {
  6420. let config2 = { [window.user.username ?? "default"]: newVal };
  6421. localStorage.setItem("v2ex-config", JSON.stringify(config2));
  6422. window.config = newVal;
  6423. },
  6424. deep: true
  6425. },
  6426. tags(newVal) {
  6427. window.user.tags = newVal;
  6428. },
  6429. "config.viewType"(newVal) {
  6430. if (!newVal)
  6431. return;
  6432. if (newVal === "card") {
  6433. $(".post-item").each(function() {
  6434. $(this).addClass("preview");
  6435. });
  6436. } else {
  6437. $(".post-item").each(function() {
  6438. $(this).removeClass("preview");
  6439. });
  6440. }
  6441. },
  6442. "config.fontSizeType": {
  6443. handler(newVal) {
  6444. switch (newVal) {
  6445. case "small":
  6446. return $("html").css("font-size", "8px");
  6447. case "normal":
  6448. return $("html").css("font-size", "10px");
  6449. case "large":
  6450. return $("html").css("font-size", "12px");
  6451. case "big-large":
  6452. return $("html").css("font-size", "14px");
  6453. }
  6454. },
  6455. deep: true
  6456. },
  6457. show(n2) {
  6458. if (n2)
  6459. this.step++;
  6460. else
  6461. this.step--;
  6462. this.slide("post");
  6463. }
  6464. },
  6465. created() {
  6466. let that = this;
  6467. this.initEvent();
  6468. window.cb = this.winCb;
  6469. if (!window.canParseV2exPage)
  6470. return;
  6471. document.addEventListener("click", this.clickA, true);
  6472. $(document).on("click", ".post-item", function(e2) {
  6473. if (e2.currentTarget.getAttribute("script"))
  6474. return;
  6475. if (that.stopMe)
  6476. return true;
  6477. if (this.classList.contains("preview")) {
  6478. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG") {
  6479. console.log("点空白处", this);
  6480. let id = this.dataset["id"];
  6481. let href = this.dataset["href"];
  6482. if (id) {
  6483. that.clickPost(e2, id, href);
  6484. } else {
  6485. if (href)
  6486. location.href = href;
  6487. }
  6488. }
  6489. }
  6490. });
  6491. window.onpopstate = (event) => {
  6492. if (event.state) {
  6493. if (!this.show)
  6494. this.show = true;
  6495. } else {
  6496. if (this.show)
  6497. this.show = false;
  6498. }
  6499. };
  6500. window.onbeforeunload = () => {
  6501. };
  6502. window.deleteNotification = (nId, token) => {
  6503. console.log("deleteNotification", nId, token);
  6504. let item = $("#n_" + nId);
  6505. item.slideUp("fast");
  6506. $.post({
  6507. url: "/delete/notification/" + nId + "?once=" + token,
  6508. success() {
  6509. $.get({
  6510. url: "/notifications/below/" + window.notificationBottom,
  6511. success(data, status, request) {
  6512. item.remove();
  6513. $("#notifications").append(data);
  6514. window.notificationBottom = request.getResponseHeader("X-V2EX-New-Notification-Bottom");
  6515. },
  6516. error() {
  6517. item.slideDown("fast");
  6518. }
  6519. });
  6520. },
  6521. error() {
  6522. item.slideDown("fast");
  6523. }
  6524. });
  6525. };
  6526. },
  6527. beforeUnmount() {
  6528. eventBus.clear();
  6529. document.removeEventListener("click", this.clickA, true);
  6530. },
  6531. methods: {
  6532. async getUnreadMessagesCount() {
  6533. var _a, _b;
  6534. const res = await fetch(`${location.origin}/mission`);
  6535. const htmlText = await res.text();
  6536. const $page = $(htmlText);
  6537. const text = $page.find('#Rightbar a[href^="/notifications"]').text();
  6538. if (text.includes("未读提醒")) {
  6539. const countStr = (_a = text.match(/\d+/)) == null ? void 0 : _a.at(0);
  6540. if (countStr) {
  6541. return Number((_b = text.match(/\d+/)) == null ? void 0 : _b.at(0));
  6542. }
  6543. } else {
  6544. return 0;
  6545. }
  6546. throw new Error("无法获取未读消息数量");
  6547. },
  6548. clickA(e2) {
  6549. if (!(e2 == null ? void 0 : e2.target))
  6550. return;
  6551. if (e2.target.tagName !== "A")
  6552. return;
  6553. let that = this;
  6554. if (e2.target.getAttribute("script"))
  6555. return;
  6556. if (that.stopMe)
  6557. return true;
  6558. let { href, id, title } = functions.parseA(e2.target);
  6559. if (href.includes("/settings/night/toggle"))
  6560. return;
  6561. if (href.includes("/?tab="))
  6562. return;
  6563. if (href.includes("/go"))
  6564. return;
  6565. if (href === window.origin + "/#;")
  6566. return;
  6567. if (href === window.origin + "/")
  6568. return;
  6569. if (href === window.origin + "/recent")
  6570. return;
  6571. if (href.includes("/notifications"))
  6572. return;
  6573. if (href === window.origin + "/script-setting") {
  6574. window.functions.clickAvatar(this.show ? ".post-wrapper " : "");
  6575. this.slide("setting", this.step++);
  6576. that.stopEvent(e2);
  6577. return;
  6578. }
  6579. if (id) {
  6580. that.clickPost(e2, id, href, title);
  6581. } else {
  6582. if (that.config.newTabOpen) {
  6583. that.stopEvent(e2);
  6584. functions.openNewTab(href);
  6585. }
  6586. }
  6587. },
  6588. stopEvent(e2) {
  6589. e2.preventDefault();
  6590. e2.stopPropagation();
  6591. },
  6592. saveReadList() {
  6593. if (this.config.rememberLastReadFloor) {
  6594. window.parse.saveReadList(this.readList);
  6595. }
  6596. },
  6597. async clickPost(e2, id, href, title = "") {
  6598. if (id) {
  6599. if (this.config.clickPostItemOpenDetail) {
  6600. this.stopEvent(e2);
  6601. let index = this.list.findIndex((v) => v.id == id);
  6602. let postItem = this.clone(window.initPost);
  6603. if (index > -1) {
  6604. postItem = this.list[index];
  6605. }
  6606. if (!postItem.title) {
  6607. postItem.title = title ?? "加载中";
  6608. }
  6609. postItem.inList = index > -1;
  6610. if (postItem.inList) {
  6611. if (postItem.replyCount > MAX_REPLY_LIMIT) {
  6612. return functions.openNewTab(`${location.origin}/t/${id}?p=1&script=1`);
  6613. }
  6614. }
  6615. postItem.id = id;
  6616. postItem.href = href;
  6617. if (!postItem.headerTemplate) {
  6618. let template = `
  6619. <div class="cell">
  6620. <div class="topic_content">
  6621. <div class="markdown_body">
  6622. ${(postItem == null ? void 0 : postItem.content_rendered) ?? ""}
  6623. </div>
  6624. </div>
  6625. </div>
  6626. `;
  6627. postItem.headerTemplate = template;
  6628. }
  6629. this.getPostDetail(postItem);
  6630. return;
  6631. }
  6632. if (this.config.newTabOpen) {
  6633. this.stopEvent(e2);
  6634. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1`);
  6635. }
  6636. }
  6637. },
  6638. showPost() {
  6639. $(".slide-list").css("transition", `0s`);
  6640. setTimeout(() => {
  6641. $(".slide-list").css("transition", `transform .3s`);
  6642. }, 500);
  6643. this.show = true;
  6644. $("#site-header").css("margin-top", "-42px");
  6645. $(`#Wrapper .box:lt(5)`).each(function() {
  6646. $(this).hide();
  6647. });
  6648. },
  6649. slide(to = "post", v) {
  6650. if (this.step === 1) {
  6651. if (to === "post") {
  6652. $(".post-wrapper").css("z-index", 10);
  6653. $(".setting-wrapper").css("z-index", 9);
  6654. } else {
  6655. $(".post-wrapper").css("z-index", 9);
  6656. $(".setting-wrapper").css("z-index", 10);
  6657. }
  6658. }
  6659. $(".slide-list").css("transform", `translateX(-${this.step * 100}vw)`);
  6660. },
  6661. async winCb({ type, value }) {
  6662. console.log("回调的类型", type, value);
  6663. if (type === "syncData") {
  6664. this.list = window.postList;
  6665. this.config = window.config;
  6666. this.stopMe = window.stopMe;
  6667. this.tags = window.user.tags;
  6668. this.readList = window.user.readList;
  6669. this.current.read = this.readList[this.current.id] ?? {};
  6670. if (this.show && this.isPost && this.current.read.floor) {
  6671. this.$refs.postDetail.read = this.current.read;
  6672. }
  6673. }
  6674. if (type === "warningNotice") {
  6675. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: value });
  6676. }
  6677. if (this.stopMe)
  6678. return;
  6679. if (type === "restorePost") {
  6680. this.show = false;
  6681. this.loading = false;
  6682. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  6683. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  6684. $(this).show();
  6685. });
  6686. }
  6687. if (type === "postContent") {
  6688. this.current = Object.assign(this.current, value);
  6689. this.current.inList = true;
  6690. this.showPost();
  6691. }
  6692. if (type === "postReplies") {
  6693. this.current = Object.assign(this.current, value);
  6694. this.list.push(this.clone(this.current));
  6695. this.loading = false;
  6696. }
  6697. },
  6698. clone(val) {
  6699. return functions.clone(val);
  6700. },
  6701. regenerateReplyList() {
  6702. if (this.current.replyList.length) {
  6703. this.current.replyCount = this.current.replyList.length;
  6704. let res = functions.createNestedList(this.current.replyList);
  6705. if (res) {
  6706. this.current.nestedReplies = res;
  6707. }
  6708. let dup_res = functions.createNestedRedundantList(this.current.replyList);
  6709. if (dup_res) {
  6710. this.current.nestedRedundReplies = dup_res;
  6711. }
  6712. } else {
  6713. this.current.replyCount = 0;
  6714. this.current.nestedReplies = [];
  6715. this.current.nestedRedundReplies = [];
  6716. }
  6717. if (this.list.length) {
  6718. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  6719. if (rIndex > -1) {
  6720. this.list[rIndex] = this.clone(this.current);
  6721. }
  6722. }
  6723. },
  6724. initEvent() {
  6725. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  6726. console.log("CHANGE_COMMENT_THANK", val);
  6727. const { id, type } = val;
  6728. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  6729. if (currentI > -1) {
  6730. this.current.replyList[currentI].isThanked = type === "add";
  6731. if (type === "add") {
  6732. this.current.replyList[currentI].thankCount++;
  6733. } else {
  6734. this.current.replyList[currentI].thankCount--;
  6735. }
  6736. this.regenerateReplyList();
  6737. }
  6738. });
  6739. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  6740. const { id, type } = val;
  6741. this.current.isThanked = type === "add";
  6742. if (type === "add") {
  6743. this.current.thankCount++;
  6744. } else {
  6745. this.current.thankCount--;
  6746. }
  6747. let currentI = this.list.findIndex((i) => i.id === id);
  6748. if (currentI > -1) {
  6749. this.list[currentI].isThanked = type === "add";
  6750. if (type === "add") {
  6751. this.list[currentI].thankCount++;
  6752. } else {
  6753. this.list[currentI].thankCount++;
  6754. }
  6755. }
  6756. });
  6757. eventBus.on(CMD.REMOVE, (val) => {
  6758. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  6759. if (removeIndex > -1) {
  6760. this.current.replyList.splice(removeIndex, 1);
  6761. }
  6762. this.regenerateReplyList();
  6763. });
  6764. eventBus.on(CMD.IGNORE, () => {
  6765. this.show = false;
  6766. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  6767. if (rIndex > -1) {
  6768. this.list.splice(rIndex, 1);
  6769. }
  6770. let el = document.querySelector(`.id_${this.current.id}`);
  6771. if (el)
  6772. el.remove();
  6773. this.current = this.clone(window.initPost);
  6774. });
  6775. eventBus.on(CMD.MERGE, (val) => {
  6776. this.current = Object.assign(this.current, val);
  6777. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  6778. if (rIndex > -1) {
  6779. this.list[rIndex] = this.clone(this.current);
  6780. }
  6781. });
  6782. eventBus.on(CMD.MERGE_CONFIG, (val) => {
  6783. this.config = Object.assign(this.config, val);
  6784. });
  6785. eventBus.on(CMD.ADD_READ, (val) => {
  6786. this.readList[this.current.id] = val;
  6787. });
  6788. eventBus.on(CMD.ADD_REPLY, (item) => {
  6789. this.current.replyList.push(item);
  6790. this.regenerateReplyList();
  6791. });
  6792. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  6793. if (once) {
  6794. if (typeof once === "string") {
  6795. let res = once.match(/var once = "([\d]+)";/);
  6796. if (res && res[1]) {
  6797. this.current.once = Number(res[1]);
  6798. return;
  6799. }
  6800. }
  6801. if (typeof once === "number") {
  6802. this.current.once = once;
  6803. return;
  6804. }
  6805. }
  6806. window.fetchOnce().then((r2) => {
  6807. this.current.once = r2;
  6808. });
  6809. });
  6810. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  6811. let oldTag = this.clone(this.tags);
  6812. let tags = this.tags[username] ?? [];
  6813. let rIndex = tags.findIndex((v) => v === tag);
  6814. if (rIndex > -1) {
  6815. tags.splice(rIndex, 1);
  6816. }
  6817. this.tags[username] = tags;
  6818. let res = await window.parse.saveTags(this.tags);
  6819. if (!res) {
  6820. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  6821. this.tags = oldTag;
  6822. }
  6823. });
  6824. eventBus.on(CMD.REFRESH_POST, () => this.getPostDetail(this.current));
  6825. },
  6826. async getPostDetail(post) {
  6827. this.current = post;
  6828. this.current.read = this.readList[this.current.id] ?? { floor: 0, total: 0 };
  6829. this.show = true;
  6830. if (!this.current.inList) {
  6831. this.loading = true;
  6832. let r2 = await functions.checkPostReplies(post.id, true);
  6833. if (r2) {
  6834. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "由于回复数量较多,已为您单独打开此主题" });
  6835. this.loading = this.show = false;
  6836. return;
  6837. }
  6838. }
  6839. let url = window.baseUrl + "/t/" + post.id;
  6840. this.current.url = url;
  6841. let alreadyHasReply = this.current.replyList.length;
  6842. if (alreadyHasReply) {
  6843. this.refreshLoading = true;
  6844. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  6845. } else {
  6846. this.loading = true;
  6847. }
  6848. let apiRes = await window.fetch(url + "?p=1");
  6849. if (apiRes.status === 404) {
  6850. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  6851. return this.refreshLoading = this.loading = false;
  6852. }
  6853. if (apiRes.status === 403) {
  6854. this.refreshLoading = this.show = this.loading = false;
  6855. functions.openNewTab(`${location.origin}/t/${post.id}?p=1&script=0`);
  6856. return;
  6857. }
  6858. if (apiRes.redirected) {
  6859. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  6860. return this.refreshLoading = this.loading = false;
  6861. }
  6862. let htmlText = await apiRes.text();
  6863. let hasPermission = htmlText.search("你要查看的页面需要先登录");
  6864. if (hasPermission > -1) {
  6865. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录" });
  6866. return this.refreshLoading = this.loading = false;
  6867. }
  6868. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  6869. let body = $(bodyText[0]);
  6870. decodeEmail(body);
  6871. await window.parse.getPostDetail(this.current, body, htmlText);
  6872. let index = this.list.findIndex((v) => v.id == this.current.id);
  6873. if (index > -1) {
  6874. this.list[index] = this.clone(this.current);
  6875. } else {
  6876. this.list.push(this.clone(this.current));
  6877. }
  6878. this.refreshLoading = this.loading = false;
  6879. if (!alreadyHasReply) {
  6880. vue.nextTick(() => {
  6881. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  6882. });
  6883. }
  6884. await window.parse.parseOp(this.current);
  6885. console.log("当前帖子", this.current);
  6886. },
  6887. addTargetUserTag() {
  6888. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  6889. },
  6890. removeTargetUserTag(tag) {
  6891. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  6892. }
  6893. }
  6894. };
  6895. const _withScopeId = (n2) => (vue.pushScopeId("data-v-ab0da04d"), n2 = n2(), vue.popScopeId(), n2);
  6896. const _hoisted_1 = {
  6897. key: 0,
  6898. class: "target-user-tags p1"
  6899. };
  6900. const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  6901. const _hoisted_3 = { class: "my-tag" };
  6902. const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  6903. const _hoisted_5 = ["onClick"];
  6904. const _hoisted_6 = {
  6905. key: 1,
  6906. class: "my-box p2",
  6907. style: { "margin-top": "2rem" }
  6908. };
  6909. const _hoisted_7 = {
  6910. key: 0,
  6911. class: "flex flex-center"
  6912. };
  6913. const _hoisted_8 = {
  6914. key: 1,
  6915. class: "loaded"
  6916. };
  6917. const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "楼中楼解析完成", -1));
  6918. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  6919. const _component_Setting = vue.resolveComponent("Setting");
  6920. const _component_PostDetail = vue.resolveComponent("PostDetail");
  6921. const _component_TagModal = vue.resolveComponent("TagModal");
  6922. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  6923. const _component_MsgModal = vue.resolveComponent("MsgModal");
  6924. vue.resolveComponent("NotificationModal");
  6925. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  6926. const _component_BaseButton = vue.resolveComponent("BaseButton");
  6927. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  6928. vue.createVNode(_component_Setting, {
  6929. modelValue: $data.config,
  6930. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  6931. onBack: _cache[1] || (_cache[1] = ($event) => $options.slide("post", $data.step--)),
  6932. to: ".setting-wrapper"
  6933. }, null, 8, ["modelValue"]),
  6934. vue.createVNode(_component_Setting, {
  6935. modelValue: $data.config,
  6936. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.config = $event),
  6937. onBack: _cache[3] || (_cache[3] = ($event) => $options.slide("post", $data.step--)),
  6938. to: ".setting-wrapper2"
  6939. }, null, 8, ["modelValue"]),
  6940. vue.createVNode(_component_PostDetail, {
  6941. modelValue: $data.show,
  6942. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.show = $event),
  6943. ref: "postDetail",
  6944. displayType: $data.config.commentDisplayType,
  6945. "onUpdate:displayType": _cache[5] || (_cache[5] = ($event) => $data.config.commentDisplayType = $event),
  6946. onSaveReadList: $options.saveReadList,
  6947. onRefresh: _cache[6] || (_cache[6] = ($event) => $options.getPostDetail($data.current)),
  6948. loading: $data.loading,
  6949. refreshLoading: $data.refreshLoading
  6950. }, null, 8, ["modelValue", "displayType", "onSaveReadList", "loading", "refreshLoading"]),
  6951. vue.createVNode(_component_TagModal, {
  6952. tags: $data.tags,
  6953. "onUpdate:tags": _cache[7] || (_cache[7] = ($event) => $data.tags = $event)
  6954. }, null, 8, ["tags"]),
  6955. vue.createVNode(_component_Base64Tooltip),
  6956. vue.createVNode(_component_MsgModal),
  6957. vue.createCommentVNode("", true),
  6958. !$data.stopMe ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6959. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  6960. _hoisted_2,
  6961. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  6962. return vue.openBlock(), vue.createElementBlock("span", _hoisted_3, [
  6963. _hoisted_4,
  6964. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  6965. vue.createElementVNode("i", {
  6966. class: "fa fa-trash-o remove",
  6967. onClick: ($event) => $options.removeTargetUserTag(i)
  6968. }, null, 8, _hoisted_5)
  6969. ]);
  6970. }), 256)),
  6971. vue.createElementVNode("span", {
  6972. class: "add-tag ago",
  6973. onClick: _cache[9] || (_cache[9] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  6974. title: "添加标签"
  6975. }, "+")
  6976. ])) : vue.createCommentVNode("", true),
  6977. $options.isPost && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
  6978. $data.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
  6979. vue.createVNode(_component_BaseLoading)
  6980. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
  6981. _hoisted_9,
  6982. vue.createVNode(_component_BaseButton, {
  6983. size: "small",
  6984. onClick: $options.showPost
  6985. }, {
  6986. default: vue.withCtx(() => [
  6987. vue.createTextVNode("点击显示")
  6988. ]),
  6989. _: 1
  6990. }, 8, ["onClick"])
  6991. ]))
  6992. ])) : vue.createCommentVNode("", true)
  6993. ], 64)) : vue.createCommentVNode("", true)
  6994. ], 64);
  6995. }
  6996. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ab0da04d"]]);
  6997. let isMobile = !document.querySelector("#Rightbar");
  6998. let $section = document.createElement("section");
  6999. $section.id = "app";
  7000. function run() {
  7001. window.baseUrl = location.origin;
  7002. window.initPost = DefaultPost;
  7003. window.win = function() {
  7004. return window;
  7005. };
  7006. window.win().doc = window.win().document;
  7007. window.win().query = (v) => window.win().document.querySelector(v);
  7008. window.query = (v) => window.win().document.querySelector(v);
  7009. window.clone = (val) => JSON.parse(JSON.stringify(val));
  7010. window.user = DefaultUser;
  7011. window.targetUserName = "";
  7012. window.pageType = void 0;
  7013. window.pageData = { pageNo: 1 };
  7014. window.config = { ...DefaultConfig, ...{ viewType: "card" } };
  7015. window.const = {
  7016. git: "https://github.com/zyronon/v2ex-script",
  7017. issue: "https://github.com/zyronon/v2ex-script/issues"
  7018. };
  7019. window.currentVersion = 1;
  7020. window.isNight = $(".Night").length === 1;
  7021. window.cb = null;
  7022. window.stopMe = false;
  7023. window.postList = [];
  7024. window.parse = {
  7025. //解析帖子内容
  7026. async parsePostContent(post, body, htmlText) {
  7027. var _a, _b;
  7028. let once = htmlText.match(/var once = "([\d]+)";/);
  7029. if (once && once[1]) {
  7030. post.once = once[1];
  7031. }
  7032. post.isReport = htmlText.includes("你已对本主题进行了报告");
  7033. let wrapperClass = "Wrapper";
  7034. let wrapper;
  7035. let boxs;
  7036. if (body.length > 1) {
  7037. body.each(function() {
  7038. if (this.id === wrapperClass) {
  7039. wrapper = $(this);
  7040. boxs = this.querySelectorAll(".box");
  7041. }
  7042. });
  7043. } else {
  7044. wrapper = body;
  7045. boxs = body.find(`#${wrapperClass} .box`);
  7046. }
  7047. let box1 = $(boxs[0]);
  7048. let header1 = wrapper.find(".header");
  7049. if (!post.title || !post.content_rendered) {
  7050. let h1 = wrapper.find("h1");
  7051. if (h1) {
  7052. post.title = h1[0].innerText;
  7053. }
  7054. }
  7055. let as = wrapper.find(".header > a");
  7056. if (as.length) {
  7057. post.node.title = as[1].innerText;
  7058. post.node.url = as[1].href;
  7059. }
  7060. let aName = header1.find("small.gray a:nth-child(1)");
  7061. if (aName) {
  7062. post.member.username = aName[0].innerText;
  7063. }
  7064. let small = header1.find("small.gray");
  7065. if (small[0]) {
  7066. let spanEl = (_b = (_a = small[0]) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.nodeValue;
  7067. if (spanEl) {
  7068. let dianIndex = spanEl.indexOf("·");
  7069. post.createDateAgo = spanEl.substring(4, dianIndex - 1);
  7070. let text = spanEl.substring(dianIndex + 1).trim();
  7071. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  7072. let clickCountReg = [...reg3];
  7073. if (clickCountReg.length) {
  7074. post.clickCount = Number(clickCountReg[0][1]);
  7075. }
  7076. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  7077. clickCountReg = [...reg3];
  7078. if (clickCountReg.length) {
  7079. post.clickCount = Number(clickCountReg[0][1]);
  7080. }
  7081. }
  7082. }
  7083. let avatarEl = header1.find(".avatar");
  7084. if (avatarEl) {
  7085. post.member.avatar_large = avatarEl[0].src;
  7086. }
  7087. let topic_buttons = box1.find(".inner .fr");
  7088. if (topic_buttons.length) {
  7089. let favoriteNode = topic_buttons.find(".op:first");
  7090. if (favoriteNode.length) {
  7091. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  7092. }
  7093. let ignoreNode = topic_buttons.find(".tb");
  7094. if (ignoreNode.length) {
  7095. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  7096. }
  7097. let thankNode = topic_buttons.find(".topic_thanked");
  7098. if (thankNode.length) {
  7099. post.isThanked = true;
  7100. }
  7101. let span = topic_buttons.find("span");
  7102. if (span.length) {
  7103. let text = span[0].innerText;
  7104. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  7105. let collectCountReg = [...reg1];
  7106. if (collectCountReg.length) {
  7107. post.collectCount = Number(collectCountReg[0][1]);
  7108. }
  7109. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  7110. collectCountReg = [...reg1];
  7111. if (collectCountReg.length) {
  7112. post.collectCount = Number(collectCountReg[0][1]);
  7113. }
  7114. }
  7115. }
  7116. let header = $(boxs[0]);
  7117. let temp = header.clone();
  7118. temp.find(".topic_buttons").remove();
  7119. temp.find(".inner").remove();
  7120. temp.find(".header").remove();
  7121. let html = temp.html();
  7122. html = functions.checkPhotoLink2Img(html);
  7123. post.headerTemplate = html;
  7124. return post;
  7125. },
  7126. //解析OP信息
  7127. async parseOp(post) {
  7128. if (!post.member.id) {
  7129. let userRes = await fetch(window.baseUrl + "/api/members/show.json?username=" + post.member.username);
  7130. if (userRes.status === 200) {
  7131. post.member = await userRes.json();
  7132. }
  7133. }
  7134. if (post.member.id) {
  7135. let date = new Date(post.member.created * 1e3);
  7136. let createStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
  7137. date.setHours(0);
  7138. date.setMinutes(0);
  7139. date.setSeconds(0);
  7140. date.setMilliseconds(0);
  7141. let now = /* @__PURE__ */ new Date();
  7142. now.setHours(0);
  7143. now.setMinutes(0);
  7144. now.setSeconds(0);
  7145. now.setMilliseconds(0);
  7146. let d2 = now.getTime() - date.getTime();
  7147. let isNew = d2 <= 1e3 * 60 * 60 * 24 * 7;
  7148. post.member.createDate = createStr + " 注册";
  7149. post.member.isNew = isNew;
  7150. } else {
  7151. post.member.createDate = "用户已被注销/封禁";
  7152. post.member.isNew = true;
  7153. }
  7154. return post;
  7155. },
  7156. //获取帖子所有回复
  7157. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  7158. var _a, _b;
  7159. if (body.find("#no-comments-yet").length) {
  7160. return post;
  7161. }
  7162. let wrapperClass = "Wrapper";
  7163. let boxs;
  7164. let box;
  7165. if (body.length > 1) {
  7166. body.each(function() {
  7167. if (this.id === wrapperClass) {
  7168. boxs = this.querySelectorAll(".box");
  7169. box = boxs[2];
  7170. }
  7171. });
  7172. } else {
  7173. boxs = body.find(`#${wrapperClass} .box`);
  7174. box = boxs[2];
  7175. }
  7176. let cells = box.querySelectorAll(".cell");
  7177. if (cells && cells.length) {
  7178. post.fr = boxs[1].querySelector(".inner").innerHTML;
  7179. cells = Array.from(cells);
  7180. let snow = cells[0].querySelector(".snow");
  7181. post.createDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  7182. let repliesMap = [];
  7183. if (cells[1].id) {
  7184. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  7185. let replyList = functions.getAllReply(repliesMap);
  7186. post.replyList = replyList;
  7187. post.replyCount = replyList.length;
  7188. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  7189. let nestedList = functions.createNestedList(replyList);
  7190. let nestedRedundantList = functions.createNestedRedundantList(replyList);
  7191. if (nestedList)
  7192. post.nestedReplies = nestedList;
  7193. if (nestedRedundantList)
  7194. post.nestedRedundReplies = nestedRedundantList;
  7195. return post;
  7196. } else {
  7197. let promiseList = [];
  7198. return new Promise((resolve, reject) => {
  7199. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7200. let pages = cells[1].querySelectorAll("a.page_normal");
  7201. pages = Array.from(pages);
  7202. let url = window.baseUrl + "/t/" + post.id;
  7203. for (let i = 0; i < pages.length; i++) {
  7204. let currentPageNo = Number(pages[i].innerText);
  7205. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  7206. }
  7207. Promise.allSettled(promiseList).then(
  7208. (results) => {
  7209. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  7210. let replyList = functions.getAllReply(repliesMap);
  7211. post.replyList = replyList;
  7212. post.replyCount = replyList.length;
  7213. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  7214. let nestedList = functions.createNestedList(replyList);
  7215. let nestedRedundantList = functions.createNestedRedundantList(replyList);
  7216. if (nestedList)
  7217. post.nestedReplies = nestedList;
  7218. if (nestedRedundantList)
  7219. post.nestedRedundReplies = nestedRedundantList;
  7220. resolve(post);
  7221. }
  7222. );
  7223. });
  7224. }
  7225. }
  7226. },
  7227. //请求帖子其他页的回复
  7228. fetchPostOtherPageReplies(href, pageNo) {
  7229. return new Promise((resolve) => {
  7230. $.get(href).then((res) => {
  7231. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7232. let wrapperClass = "Wrapper";
  7233. let box;
  7234. $(s[0]).each(function() {
  7235. if (this.id === wrapperClass) {
  7236. box = this.querySelectorAll(".box")[2];
  7237. }
  7238. });
  7239. let cells = box.querySelectorAll(".cell");
  7240. cells = Array.from(cells);
  7241. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7242. }).catch((r2) => {
  7243. if (r2.status === 403) {
  7244. functions.cbChecker({ type: "restorePost", value: null });
  7245. }
  7246. });
  7247. });
  7248. },
  7249. //解析页面的回复
  7250. parsePageReplies(nodes) {
  7251. let replyList = [];
  7252. nodes.forEach((node, index) => {
  7253. if (!node.id)
  7254. return;
  7255. let item = {
  7256. level: 0,
  7257. thankCount: 0,
  7258. isThanked: false,
  7259. isOp: false,
  7260. isDup: false,
  7261. id: node.id.replace("r_", "")
  7262. };
  7263. let reply_content = node.querySelector(".reply_content");
  7264. item.reply_content = functions.checkPhotoLink2Img(reply_content.innerHTML);
  7265. item.reply_text = reply_content.textContent;
  7266. let { users, floor } = this.parseReplyContent(item.reply_content);
  7267. item.hideCallUserReplyContent = item.reply_content;
  7268. if (users.length === 1) {
  7269. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  7270. }
  7271. item.replyUsers = users;
  7272. item.replyFloor = floor;
  7273. let spans = node.querySelectorAll("span");
  7274. let ago = spans[1];
  7275. item.date = ago.textContent;
  7276. let userNode = node.querySelector("strong a");
  7277. item.username = userNode.textContent;
  7278. let avatar = node.querySelector("td img");
  7279. item.avatar = avatar.src;
  7280. let no = node.querySelector(".no");
  7281. item.floor = Number(no.textContent);
  7282. let thank_area = node.querySelector(".thank_area");
  7283. if (thank_area) {
  7284. item.isThanked = thank_area.classList.contains("thanked");
  7285. }
  7286. let small = spans[2];
  7287. if (small) {
  7288. item.thankCount = Number(small.textContent);
  7289. }
  7290. let op = node.querySelector(".op");
  7291. if (op) {
  7292. item.isOp = true;
  7293. }
  7294. let mod = node.querySelector(".mod");
  7295. if (mod) {
  7296. item.isMod = true;
  7297. }
  7298. replyList.push(item);
  7299. });
  7300. return replyList;
  7301. },
  7302. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  7303. parseReplyContent(str) {
  7304. if (!str)
  7305. return;
  7306. let users = [];
  7307. let getUsername = (userStr) => {
  7308. let endIndex = userStr.indexOf('">');
  7309. if (endIndex > -1) {
  7310. let user = userStr.substring(0, endIndex);
  7311. if (!users.find((i) => i === user)) {
  7312. users.push(user);
  7313. }
  7314. }
  7315. };
  7316. let userReg = /@<a href="\/member\/([\s\S]+?)<\/a>/g;
  7317. let has = str.matchAll(userReg);
  7318. let res2 = [...has];
  7319. if (res2.length > 1) {
  7320. res2.map((item) => {
  7321. getUsername(item[1]);
  7322. });
  7323. }
  7324. if (res2.length === 1) {
  7325. getUsername(res2[0][1]);
  7326. }
  7327. let floor = -1;
  7328. if (users.length === 1) {
  7329. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>[\s]+#([\d]+)/g;
  7330. let hasFloor = str.matchAll(floorReg);
  7331. let res = [...hasFloor];
  7332. if (res.length) {
  7333. floor = Number(res[0][1]);
  7334. }
  7335. }
  7336. return { users, floor };
  7337. },
  7338. //获取帖子详情
  7339. async getPostDetail(post, body, htmlText, pageNo = 1) {
  7340. post = await this.parsePostContent(post, body, htmlText);
  7341. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  7342. },
  7343. //解析页面帖子列表
  7344. parsePagePostList(list, box) {
  7345. list.forEach((itemDom) => {
  7346. let item = window.clone(window.initPost);
  7347. let item_title = itemDom.querySelector(".item_title");
  7348. itemDom.classList.add("post-item");
  7349. if (!item_title)
  7350. return;
  7351. let a = item_title.querySelector("a");
  7352. let { href, id } = functions.parseA(a);
  7353. item.id = Number(id);
  7354. a.href = item.href = href;
  7355. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  7356. itemDom.classList.add(`id_${id}`);
  7357. itemDom.dataset["href"] = href;
  7358. itemDom.dataset["id"] = id;
  7359. window.postList.push(item);
  7360. if (![PageType.Member].includes(window.pageType)) {
  7361. let headerWrap = $(`
  7362. <div class="new-item">
  7363. <div class="left">
  7364. <div class="top">
  7365. <div class="r">
  7366. <div class="small fade"></div>
  7367. <div class="small fade"></div>
  7368. </div>
  7369. </div>
  7370. <div class="bottom"></div>
  7371. </div>
  7372. <div class="right"></div>
  7373. </div>`);
  7374. headerWrap.find(".bottom").append(item_title);
  7375. headerWrap.find(".right").append(itemDom.querySelector(".count_livid"));
  7376. headerWrap.find(".top").prepend(itemDom.querySelector("td:first-child a"));
  7377. let info = itemDom.querySelector("td:nth-child(3)");
  7378. if (window.pageType === PageType.Node)
  7379. ;
  7380. if ([PageType.Changes, PageType.Home].includes(window.pageType)) {
  7381. let s1 = info.querySelector("span:first-child");
  7382. let t = headerWrap.find(".top .r div:first");
  7383. t.append(s1.querySelector("strong"));
  7384. t.append(` `);
  7385. t.append(s1.querySelector("a"));
  7386. }
  7387. let b = headerWrap.find(".top .r div:last");
  7388. b.append(info.querySelector("span:last-child").innerHTML);
  7389. itemDom.append(headerWrap[0]);
  7390. itemDom.querySelector("table").remove();
  7391. }
  7392. });
  7393. const setF = (res) => {
  7394. var _a;
  7395. let rIndex = window.postList.findIndex((w) => w.id === res.id);
  7396. if (rIndex > -1) {
  7397. window.postList[rIndex] = Object.assign(window.postList[rIndex], res);
  7398. }
  7399. let itemDom = box.querySelector(`.id_${res.id}`);
  7400. itemDom.classList.add("preview");
  7401. if (res.content_rendered) {
  7402. let a = document.createElement("a");
  7403. a.href = res.href;
  7404. a.classList.add("post-content");
  7405. let div = document.createElement("div");
  7406. div.innerHTML = res.content_rendered;
  7407. a.append(div);
  7408. itemDom.append(a);
  7409. if (div.clientHeight < 300) {
  7410. a.classList.add("show-all");
  7411. } else {
  7412. let showMore = document.createElement("div");
  7413. showMore.classList.add("show-more");
  7414. showMore.innerHTML = "显示更多/收起";
  7415. showMore.onclick = function(e2) {
  7416. e2.stopPropagation();
  7417. a.classList.toggle("show-all");
  7418. };
  7419. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  7420. }
  7421. }
  7422. };
  7423. if (window.config.viewType === "card") {
  7424. let cacheDataStr = localStorage.getItem("cacheData");
  7425. let cacheData = [];
  7426. if (cacheDataStr) {
  7427. cacheData = JSON.parse(cacheDataStr);
  7428. let now = Date.now();
  7429. cacheData = cacheData.filter((v) => {
  7430. return v.created > now / 1e3 - 60 * 60 * 24 * 3;
  7431. });
  7432. }
  7433. let fetchIndex = 0;
  7434. for (let i = 0; i < window.postList.length; i++) {
  7435. let item = window.postList[i];
  7436. let rItem = cacheData.find((w) => w.id === item.id);
  7437. if (rItem) {
  7438. rItem.href = item.href;
  7439. setF(rItem);
  7440. } else {
  7441. fetchIndex++;
  7442. setTimeout(() => {
  7443. $.get(item.url).then((v) => {
  7444. let res = v[0];
  7445. res.href = item.href;
  7446. cacheData.push(res);
  7447. localStorage.setItem("cacheData", JSON.stringify(cacheData));
  7448. setF(res);
  7449. });
  7450. }, fetchIndex < 4 ? 0 : (fetchIndex - 4) * 1e3);
  7451. }
  7452. }
  7453. }
  7454. },
  7455. //创建记事本子条目
  7456. async createNoteItem(itemName) {
  7457. return;
  7458. },
  7459. //编辑记事本子条目
  7460. async editNoteItem(val, id) {
  7461. return;
  7462. },
  7463. //标签操作
  7464. async saveTags(val) {
  7465. return;
  7466. },
  7467. //已读楼层操作
  7468. async saveReadList(val) {
  7469. return;
  7470. },
  7471. //imgur图片删除hash操作
  7472. async saveImgurList(val) {
  7473. return;
  7474. }
  7475. };
  7476. window.vals = {};
  7477. window.functions = {
  7478. clickAvatar(prex) {
  7479. let menu = $(`${prex}#menu-body`);
  7480. if (menu.css("--show-dropdown") === "block") {
  7481. menu.css("--show-dropdown", "none");
  7482. } else {
  7483. menu.css("--show-dropdown", "block");
  7484. }
  7485. }
  7486. };
  7487. function initStyle() {
  7488. let style2 = `
  7489. }
  7490. `;
  7491. let addStyle2 = document.createElement("style");
  7492. addStyle2.rel = "stylesheet";
  7493. addStyle2.type = "text/css";
  7494. addStyle2.innerHTML = style2;
  7495. window.document.head.append(addStyle2);
  7496. }
  7497. function qianDao() {
  7498. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  7499. if (window.pageType === PageType.Home) {
  7500. let qiandao = window.query('.box .inner a[href="/mission/daily"]');
  7501. if (qiandao) {
  7502. qianDao_(qiandao, timeNow);
  7503. } else if (window.win().doc.getElementById("gift_v2excellent")) {
  7504. window.win().doc.getElementById("gift_v2excellent").click();
  7505. localStorage.setItem("menu_clockInTime", timeNow);
  7506. console.info("[V2EX - 超级增强] 自动签到完成!");
  7507. } else {
  7508. console.info("[V2EX - 超级增强] 自动签到完成!");
  7509. }
  7510. } else {
  7511. let timeOld = localStorage.getItem("menu_clockInTime");
  7512. if (!timeOld || timeOld != timeNow) {
  7513. qianDaoStatus_(timeNow);
  7514. } else {
  7515. console.info("[V2EX - 超级增强] 自动签到完成!");
  7516. }
  7517. }
  7518. }
  7519. function qianDao_(qiandao, timeNow) {
  7520. let url = window.baseUrl + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  7521. console.log("url", url);
  7522. $.get(url).then((r2) => {
  7523. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7524. let html = $(bodyText[0]);
  7525. if (html.find("li.fa.fa-ok-sign").length) {
  7526. html = html.find("#Main").text().match(/已连续登录 (\d+?) 天/)[0];
  7527. localStorage.setItem("menu_clockInTime", timeNow);
  7528. console.info("[V2EX - 超级增强] 自动签到完成!");
  7529. if (qiandao) {
  7530. qiandao.textContent = `自动签到完成!${html}`;
  7531. qiandao.href = "javascript:void(0);";
  7532. }
  7533. } else {
  7534. _GM_notification({
  7535. text: "自动签到失败!请关闭其他插件或脚本。\n如果连续几天都签到失败,请联系作者解决!",
  7536. timeout: 4e3,
  7537. onclick() {
  7538. functions.feedback();
  7539. }
  7540. });
  7541. console.warn("[V2EX 增强] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  7542. if (qiandao)
  7543. qiandao.textContent = "自动签到失败!请尝试手动签到!";
  7544. }
  7545. });
  7546. }
  7547. function qianDaoStatus_(timeNow) {
  7548. $.get(window.baseUrl + "/mission/daily").then((r2) => {
  7549. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7550. let html = $(bodyText[0]);
  7551. if (html.find('input[value^="领取"]').length) {
  7552. qianDao_(null, timeNow);
  7553. } else {
  7554. console.info("[V2EX 增强] 已经签过到了。");
  7555. localStorage.setItem("menu_clockInTime", timeNow);
  7556. }
  7557. });
  7558. }
  7559. async function initNoteData() {
  7560. return;
  7561. }
  7562. function initConfig() {
  7563. return new Promise((resolve) => {
  7564. let configStr = localStorage.getItem("v2ex-config");
  7565. if (configStr) {
  7566. let configObj = JSON.parse(configStr);
  7567. configObj = configObj[window.user.username ?? "default"];
  7568. if (configObj) {
  7569. window.config = Object.assign(window.config, configObj);
  7570. }
  7571. }
  7572. resolve(window.config);
  7573. });
  7574. }
  7575. function addSettingText() {
  7576. let setting = $(`<a href="/script-setting" class="top">脚本管理</a>`);
  7577. $("#menu-body .cell:first").append(setting);
  7578. }
  7579. async function init() {
  7580. window.addEventListener("error", (e2) => {
  7581. let dom = e2.target;
  7582. let originImgUrl = dom.getAttribute("data-originurl");
  7583. if (originImgUrl) {
  7584. let a = document.createElement("a");
  7585. a.href = originImgUrl;
  7586. a.setAttribute("notice", "此标签由v2ex超级增强脚本转换图片失败后恢复");
  7587. a.innerText = originImgUrl;
  7588. dom.parentNode.replaceChild(a, dom);
  7589. }
  7590. }, true);
  7591. if (window.isNight) {
  7592. document.documentElement.classList.add("dark");
  7593. }
  7594. let { pageData, pageType } = functions.checkPageType();
  7595. window.pageType = pageType;
  7596. window.pageData = pageData;
  7597. addSettingText();
  7598. functions.initMonkeyMenu();
  7599. let s = $(`
  7600. <div class="slide">
  7601. <div class="slide-list">
  7602. <div class="slide-item page0"></div>
  7603. <div class="slide-item page1">
  7604. <div class="post-wrapper"></div>
  7605. <div class="setting-wrapper"></div>
  7606. </div>
  7607. <div class="slide-item page2">
  7608. <div class="setting-wrapper2"></div>
  7609. </div>
  7610. </div>
  7611. </div>`);
  7612. $("body").append(s);
  7613. $("body").children().slice(0, 4).each(function() {
  7614. $(".page0").append(this);
  7615. });
  7616. $(".post-wrapper").append($("#site-header").clone());
  7617. let top2 = $("#menu-body .cell:first .top:first");
  7618. if (top2.length && ["个人主页", "Profile"].includes(top2.text())) {
  7619. window.user.username = top2.attr("href").replace("/member/", "");
  7620. window.user.avatar = $("#menu-entry .avatar").attr("src");
  7621. }
  7622. initConfig().then(async (r2) => {
  7623. initStyle();
  7624. try {
  7625. if (window.config.autoSignin && window.user.username) {
  7626. qianDao();
  7627. }
  7628. } catch (e2) {
  7629. console.log("签到失败");
  7630. }
  7631. if (window.user.username) {
  7632. initNoteData();
  7633. }
  7634. let box;
  7635. let list;
  7636. let first;
  7637. let last;
  7638. switch (window.pageType) {
  7639. case PageType.Node:
  7640. box = document.querySelectorAll("#Wrapper .box");
  7641. box[1].style.background = "unset";
  7642. box[1].style.borderBottom = "none";
  7643. box[1].style["border-radius"] = "0";
  7644. box[1].style["box-shadow"] = "none";
  7645. first = $(box[1]).children().first();
  7646. first.addClass("cell post-item");
  7647. if (window.config.viewType === "card")
  7648. first[0].classList.add("preview");
  7649. last = $(box[1]).children().last();
  7650. last.addClass("cell post-item");
  7651. if (window.config.viewType === "card")
  7652. last[0].classList.add("preview");
  7653. list = box[1].querySelectorAll(".cell");
  7654. box[0].before($section);
  7655. window.parse.parsePagePostList(list, box[1]);
  7656. break;
  7657. case PageType.Home:
  7658. box = document.querySelector("#Wrapper .box");
  7659. let headerWrap = $('<div class="cell post-item"></div>');
  7660. if (window.config.viewType === "card")
  7661. headerWrap[0].classList.add("preview");
  7662. $(box).prepend(headerWrap);
  7663. $(box).children().slice(1, 3).each(function() {
  7664. headerWrap.append(this);
  7665. });
  7666. last = $(box).children().last();
  7667. last.addClass("cell post-item");
  7668. if (window.config.viewType === "card")
  7669. last[0].classList.add("preview");
  7670. box.style.background = "unset";
  7671. box.style["border-radius"] = "0";
  7672. box.style["box-shadow"] = "none";
  7673. list = box.querySelectorAll(".item");
  7674. list[0].before($section);
  7675. window.parse.parsePagePostList(list, box);
  7676. break;
  7677. case PageType.Changes:
  7678. box = document.querySelector("#Wrapper .box");
  7679. box.style.background = "unset";
  7680. box.style["border-radius"] = "0";
  7681. box.style["box-shadow"] = "none";
  7682. first = $(box).children().first();
  7683. first.addClass("cell post-item");
  7684. if (window.config.viewType === "card")
  7685. first[0].classList.add("preview");
  7686. last = $(box).children().last();
  7687. last.addClass("cell post-item");
  7688. if (window.config.viewType === "card")
  7689. last[0].classList.add("preview");
  7690. list = box.querySelectorAll(".item");
  7691. list[0].before($section);
  7692. window.parse.parsePagePostList(list, box);
  7693. break;
  7694. case PageType.Post:
  7695. box = document.querySelector("#Wrapper .box");
  7696. box.after($section);
  7697. let r22 = await functions.checkPostReplies(window.pageData.id, false);
  7698. if (r22) {
  7699. window.stopMe = true;
  7700. functions.cbChecker({ type: "syncData" });
  7701. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,脚本已停止解析楼中楼" });
  7702. return;
  7703. }
  7704. let post = functions.clone(window.initPost);
  7705. post.id = window.pageData.id;
  7706. let body = $(document.body);
  7707. let htmlText = document.documentElement.outerHTML;
  7708. window.parse.parsePostContent(
  7709. post,
  7710. body,
  7711. htmlText
  7712. ).then(async (res) => {
  7713. await functions.cbChecker({ type: "postContent", value: res });
  7714. await window.parse.parseOp(res);
  7715. });
  7716. window.parse.getPostAllReplies(
  7717. post,
  7718. body,
  7719. htmlText,
  7720. window.pageData.pageNo
  7721. ).then(async (res1) => {
  7722. await functions.cbChecker({ type: "postReplies", value: res1 });
  7723. });
  7724. break;
  7725. case PageType.Member:
  7726. box = document.querySelectorAll("#Wrapper .box");
  7727. window.targetUserName = box[0].querySelector("h1").textContent;
  7728. if (window.config.openTag) {
  7729. box[0].style.borderBottom = "none";
  7730. box[0].style["border-bottom-left-radius"] = "0";
  7731. box[0].style["border-bottom-right-radius"] = "0";
  7732. }
  7733. list = box[2].querySelectorAll(".cell");
  7734. box[0].after($section);
  7735. window.parse.parsePagePostList(list, box[2]);
  7736. break;
  7737. default:
  7738. window.stopMe = true;
  7739. functions.cbChecker({ type: "syncData" });
  7740. console.error("未知页面");
  7741. break;
  7742. }
  7743. });
  7744. }
  7745. window.canParseV2exPage = !window.location.search.includes("script");
  7746. if (window.canParseV2exPage) {
  7747. init();
  7748. } else {
  7749. let box = document.querySelector("#Wrapper #Main .box");
  7750. box.after($section);
  7751. window.stopMe = true;
  7752. functions.cbChecker({ type: "syncData" });
  7753. if (window.location.search.includes("script=0")) {
  7754. functions.cbChecker({ type: "warningNotice", value: "脚本无法查看此主题,已为您单独打开此主题" });
  7755. }
  7756. if (window.location.search.includes("script=1")) {
  7757. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,已为您单独打开此主题并停止解析楼中楼" });
  7758. }
  7759. }
  7760. }
  7761. if (isMobile) {
  7762. (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const o=document.createElement("style");o.textContent=e,document.head.append(o)})(' .tip[data-v-ee672411]{position:fixed;font-size:1.6rem;z-index:9999;max-width:10rem;border-radius:.5rem;padding:1rem;color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.v-enter-active[data-v-e7c0fbef],.v-leave-active[data-v-e7c0fbef]{transition:opacity .3s ease}.v-enter-from[data-v-e7c0fbef],.v-leave-to[data-v-e7c0fbef]{opacity:0}.fade-in[data-v-e7c0fbef]{animation:fade-in-e7c0fbef .3s}.fade-out[data-v-e7c0fbef]{animation:fade-out-e7c0fbef .4s}@keyframes fade-in-e7c0fbef{0%{opacity:0}to{opacity:1}}@keyframes fade-out-e7c0fbef{0%{opacity:1}to{opacity:0;display:none}}.username[data-v-e7c0fbef]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-e7c0fbef]{font-size:1.4rem;color:#e02a2a}.owner[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-e7c0fbef]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove[data-v-e7c0fbef]{margin-left:.5rem;display:none}.add-tag[data-v-e7c0fbef]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor[data-v-e7c0fbef]{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar[data-v-e7c0fbef]{margin-right:1rem;display:inline-flex}.base-avatar img[data-v-e7c0fbef]{width:2.8rem;height:2.8rem;border-radius:.4rem}html[data-v-e7c0fbef]{font-size:10px}[data-v-e7c0fbef]:root{--box-border-radius: 8px}#site-header[data-v-e7c0fbef]{height:4rem}#site-header #site-header-menu #menu-body[data-v-e7c0fbef]{top:5rem;right:1rem}#Wrapper .cell .count_livid[data-v-e7c0fbef]{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a[data-v-e7c0fbef]{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item[data-v-e7c0fbef]{background:var(--box-background-color)}.post-item .new-item[data-v-e7c0fbef]{display:flex;justify-content:space-between}.post-item .new-item .left .top[data-v-e7c0fbef]{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small[data-v-e7c0fbef],.post-item .new-item .left a.node[data-v-e7c0fbef]{font-size:1.2rem}.post-item .new-item .left .bottom[data-v-e7c0fbef]{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title[data-v-e7c0fbef]{font-size:1.6rem}.post-item .new-item .left .bottom a[data-v-e7c0fbef]{text-decoration:none!important}.post-item .new-item .right[data-v-e7c0fbef]{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid[data-v-e7c0fbef]{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content[data-v-e7c0fbef]{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote[data-v-e7c0fbef]{margin-top:.5rem}.post-item .post-content p[data-v-e7c0fbef]:first-child{margin-top:0}.post-item .post-content[data-v-e7c0fbef]:visited{color:var(--link-visited-color)}.post-item .show-more[data-v-e7c0fbef]{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview[data-v-e7c0fbef]{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link[data-v-e7c0fbef]:link{color:#000!important}.preview .show-all[data-v-e7c0fbef]{max-height:unset;-webkit-mask-image:none}.preview .post-content[data-v-e7c0fbef]{height:unset!important}.preview .show-more[data-v-e7c0fbef]{display:flex}.preview .item_title[data-v-e7c0fbef]{font-weight:700}.Night .post-item[data-v-e7c0fbef]{background:#18222d!important}.Night .preview[data-v-e7c0fbef]{border:1px solid #3b536e}.Night .preview>.post-content[data-v-e7c0fbef]:link{color:#d1d5d9}.Night .preview>.post-content[data-v-e7c0fbef]:visited{color:#393f4e!important}.Night .preview .topic-link[data-v-e7c0fbef]:link{color:#c0dbff!important}[data-v-e7c0fbef]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark[data-v-e7c0fbef]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex[data-v-e7c0fbef]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-e7c0fbef]{justify-content:flex-end}.flex-center[data-v-e7c0fbef]{justify-content:center}.p1[data-v-e7c0fbef]{padding:1rem}.p2[data-v-e7c0fbef]{padding:2rem}.p0[data-v-e7c0fbef]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-e7c0fbef]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-e7c0fbef]{text-decoration:none}.tool[data-v-e7c0fbef]{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-e7c0fbef]{width:2.2rem!important;height:2.2rem!important}.tool.disabled[data-v-e7c0fbef]{cursor:not-allowed}.tool span[data-v-e7c0fbef]{line-height:1rem}.my-node[data-v-e7c0fbef]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs[data-v-e7c0fbef]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-e7c0fbef]{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content[data-v-e7c0fbef]{padding:.5rem}.my-cell[data-v-e7c0fbef]{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-e7c0fbef]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-e7c0fbef]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-e7c0fbef]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-e7c0fbef]{position:relative}.radio-group2[data-v-e7c0fbef]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-e7c0fbef]{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-e7c0fbef]:first-child{border-left:none}.radio-group2 .active[data-v-e7c0fbef]{background:var(--color-active);color:#fff}.pop-confirm[data-v-e7c0fbef]{position:relative;display:inline-flex;justify-content:center}input[data-v-e7c0fbef]{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-e7c0fbef]:focus{border:1px solid var(--color-active)}.danger[data-v-e7c0fbef]{color:red!important}.topic_content[data-v-e7c0fbef],.reply_content[data-v-e7c0fbef]{font-size:1.6rem}.mask[data-v-e7c0fbef]{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark[data-v-e7c0fbef]{background:#000000bb}.mask.light[data-v-e7c0fbef]{background:transparent}.mask.lightgray[data-v-e7c0fbef]{background:rgba(0,0,0,.25)}.mask.white[data-v-e7c0fbef]{background:transparent}.slide[data-v-e7c0fbef]{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list[data-v-e7c0fbef]{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item[data-v-e7c0fbef]{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1[data-v-e7c0fbef]{overflow:hidden!important}.post-wrapper[data-v-e7c0fbef],.setting-wrapper[data-v-e7c0fbef]{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper[data-v-e7c0fbef],.setting-wrapper2[data-v-e7c0fbef]{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page[data-v-e7c0fbef]{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content[data-v-e7c0fbef]{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.switch[data-v-e7c0fbef]{width:4.5rem;height:2.2rem;border-radius:2rem;position:relative;display:flex;align-items:center;background:var(--color-swtich-bg);transition:all .3s}.switch.active[data-v-e7c0fbef]{background:var(--color-active)}.switch.active[data-v-e7c0fbef]:before{right:.2rem}.switch[data-v-e7c0fbef]:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;background:white;border-radius:50%}.nav-bar[data-v-fda0acaa]{box-sizing:border-box;width:100%;height:5rem;padding:0 var(--space);display:flex;align-items:center;justify-content:center;position:relative;font-size:2rem;color:var(--color-font-pure)}.nav-bar[data-v-fda0acaa] .back-icon{left:var(--space);position:absolute}.display-type[data-v-1d327f48]{height:3rem;padding:0 .3rem;background:var(--color-main-bg);border-radius:1rem;display:flex;font-size:1.4rem;align-items:center;color:#a9a9a9}.display-type .type[data-v-1d327f48]{border-radius:.8rem;padding:0 1.3rem;height:2.5rem;align-items:center;display:flex;position:relative}.display-type .type.active[data-v-1d327f48]{background:var(--color-second-bg);color:var(--color-font-pure);box-shadow:0 0 6px 0 var(--color-tooltip-shadow)}.display-type .type-list[data-v-1d327f48]{position:absolute;background:white;right:0;top:3rem;font-size:1.4rem;box-shadow:0 0 6px 0 var(--color-tooltip-shadow);border-radius:.6rem;z-index:9;color:var(--color-font)}.display-type .type-list .item[data-v-1d327f48]{word-break:keep-all;padding:.8rem 1rem}.display-type .type-list .item.active[data-v-1d327f48]{color:var(--color-font-pure)}.display-type svg[data-v-1d327f48]{width:1.5rem}.font-size[data-v-a64ba8b8]{margin-bottom:3rem;display:flex;flex-direction:column;align-items:center;justify-content:center}.font-size .steps[data-v-a64ba8b8]{width:100%;border-radius:10rpx;display:flex;justify-content:space-between;align-items:center;position:relative;z-index:2}.font-size .steps .step[data-v-a64ba8b8]{width:100%;font-size:20rpx;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:4.8rem;gap:1.5rem;color:gray}.font-size .steps .step .text[data-v-a64ba8b8]{font-size:1.4rem}.font-size .steps .step .point[data-v-a64ba8b8]{border-radius:50%;min-width:6px;min-height:6px;background:#adadad}.font-size .steps .step.active[data-v-a64ba8b8]{color:var(--color-font-pure)}.font-size .steps .step.active .point[data-v-a64ba8b8]{box-shadow:0 0 1px 1px #f1f1f1;background:white;transform:scale(3)}.font-size .line[data-v-a64ba8b8]{position:relative;z-index:1;margin-top:-4px;height:2px;width:76%;background:var(--color-font)}.row[data-v-424a2b09]{min-height:4rem;display:flex;justify-content:space-between;align-items:center;color:var(--color-font-8)}.row .wrapper[data-v-424a2b09]{height:3rem;flex:1;display:flex;justify-content:flex-end;align-items:center;gap:var(--space)}.row .main-title[data-v-424a2b09]{font-size:2.2rem;font-weight:700}.row .item-title[data-v-424a2b09]{font-size:1.8rem}.desc[data-v-424a2b09]{margin-bottom:1rem;font-size:1.4rem;text-align:left;color:var(--color-font)}.tool>svg[data-v-b7c6664e]{width:1.8rem!important;height:1.8rem!important}.more[data-v-e92e0529]{height:1.6rem;width:2.08rem;padding:1rem .8rem 1rem 0;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end}.more div[data-v-e92e0529]{background:var(--color-floor-font);width:.3rem;height:.3rem;border-radius:50%}.Author[data-v-9041586a]{display:flex;align-items:center;justify-content:space-between;font-size:1.2rem;position:relative}.Author.expand[data-v-9041586a]{margin-bottom:0}.Author .Author-left[data-v-9041586a]{display:flex;align-items:center;width:80%;word-break:break-all}.Author .Author-left .info[data-v-9041586a]{display:flex;flex-direction:column}.Author .Author-left .username[data-v-9041586a]{font-size:1.4rem;margin-right:1rem}.Author .Author-left .expand-icon[data-v-9041586a]{margin-right:.8rem;width:2.4rem;height:2.4rem;transform:rotate(90deg)}.Author .Author-left .texts[data-v-9041586a]{flex:1}.Author .Author-left .owner[data-v-9041586a]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .dup[data-v-9041586a]{display:inline-block;background-color:transparent;color:red;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid red;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .mod[data-v-9041586a]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.Author .Author-right[data-v-9041586a]{position:absolute;right:0;display:flex;align-items:center}.loading[data-v-2697baa2]{border:2px solid;border-color:var(--color-loading-2) var(--color-loading-1) var(--color-loading-1) var(--color-loading-1);border-radius:100%;animation:circle-2697baa2 infinite 1s linear;width:2rem;height:2rem}.loading.small[data-v-2697baa2]{width:1.2rem;height:1.2rem}.loading.large[data-v-2697baa2]{width:3rem;height:3rem}@keyframes circle-2697baa2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.base-button[data-v-04f4c89d]{border-radius:.6rem;padding:0 1.5rem;display:inline-flex;align-items:center;justify-content:center;transition:all .3s;height:3.6rem;line-height:1;position:relative}.base-button .loading[data-v-04f4c89d]{position:absolute}.base-button.disabled[data-v-04f4c89d]{opacity:.6;cursor:not-allowed;-webkit-user-select:none;user-select:none}.base-button.small[data-v-04f4c89d]{height:3rem}.base-button.small>span[data-v-04f4c89d]{font-size:1.3rem}.base-button.large[data-v-04f4c89d]{height:5rem;font-size:1.8rem;padding:0 2.2rem}.base-button.large>span[data-v-04f4c89d]{font-size:1.8rem}.base-button.primary[data-v-04f4c89d]{background:var(--color-active)}.base-button.primary>span[data-v-04f4c89d]{color:#fff}.base-button.gary[data-v-04f4c89d]{background:#4b5563}.base-button.link[data-v-04f4c89d]{border-radius:0;border-bottom:2px solid transparent}.base-button.link>span[data-v-04f4c89d]{color:var(--color-font-8)}.base-button.active[data-v-04f4c89d]{opacity:.4}.key-notice[data-v-04f4c89d]{margin-left:1rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;color:#fff}.key-notice .key[data-v-04f4c89d]{transform:scale(.8)}.post-editor-wrapper[data-v-0612e02f]{width:100%;box-sizing:border-box;position:relative;overflow:hidden;transition:all .3s;color:var(--color-font)}.post-editor-wrapper.isFocus .post-editor[data-v-0612e02f]{border:1px solid var(--color-active)}.post-editor-wrapper .post-editor[data-v-0612e02f]{border:1px solid var(--color-line);border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.6rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure)}.post-editor-wrapper .toolbar[data-v-0612e02f]{box-sizing:border-box;padding:.5rem 1rem;width:100%;position:relative;display:flex;justify-content:space-between;align-items:center}.post-editor-wrapper .toolbar .left[data-v-0612e02f]{display:flex;gap:1rem}.post-editor-wrapper .toolbar .left .upload input[data-v-0612e02f]{position:absolute;width:20px;height:20px;opacity:0}.post-editor-wrapper .toolbar span[data-v-0612e02f]{color:gray;font-size:1.3rem}.post-editor-wrapper .get-cursor[data-v-0612e02f]{border:1px solid var(--color-line);border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.6rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);position:absolute;top:0;z-index:-100}.post-editor-wrapper .emoticon-pack[data-v-0612e02f]{z-index:999999999;border-radius:1rem;padding:1rem;width:31rem;max-width:31rem;height:30rem;max-height:30rem;overflow:auto;background:var(--color-third-bg);border:1px solid var(--color-font-3);box-shadow:0 9px 24px -3px #0000000f,0 4px 8px -1px #0000001f;position:fixed;bottom:11rem;left:14rem}.post-editor-wrapper .emoticon-pack i[data-v-0612e02f]{position:absolute;right:2rem;font-size:2rem;color:#e2e2e2}.post-editor-wrapper .emoticon-pack .list[data-v-0612e02f]{margin:1rem 0}.post-editor-wrapper .emoticon-pack img[data-v-0612e02f]{width:3rem;height:3rem;padding:.5rem}.post-editor-wrapper .emoticon-pack span[data-v-0612e02f]{display:inline-block;font-size:2.3rem;padding:.5rem}.v-enter-active[data-v-f8165980],.v-leave-active[data-v-f8165980]{transition:opacity .3s ease}.v-enter-from[data-v-f8165980],.v-leave-to[data-v-f8165980]{opacity:0}.fade-in[data-v-f8165980]{animation:fade-in-f8165980 .3s}.fade-out[data-v-f8165980]{animation:fade-out-f8165980 .4s}@keyframes fade-in-f8165980{0%{opacity:0}to{opacity:1}}@keyframes fade-out-f8165980{0%{opacity:1}to{opacity:0;display:none}}.username[data-v-f8165980]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-f8165980]{font-size:1.4rem;color:#e02a2a}.owner[data-v-f8165980]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-f8165980]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-f8165980]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove[data-v-f8165980]{margin-left:.5rem;display:none}.add-tag[data-v-f8165980]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor[data-v-f8165980]{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar[data-v-f8165980]{margin-right:1rem;display:inline-flex}.base-avatar img[data-v-f8165980]{width:2.8rem;height:2.8rem;border-radius:.4rem}html[data-v-f8165980]{font-size:10px}[data-v-f8165980]:root{--box-border-radius: 8px}#site-header[data-v-f8165980]{height:4rem}#site-header #site-header-menu #menu-body[data-v-f8165980]{top:5rem;right:1rem}#Wrapper .cell .count_livid[data-v-f8165980]{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a[data-v-f8165980]{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item[data-v-f8165980]{background:var(--box-background-color)}.post-item .new-item[data-v-f8165980]{display:flex;justify-content:space-between}.post-item .new-item .left .top[data-v-f8165980]{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small[data-v-f8165980],.post-item .new-item .left a.node[data-v-f8165980]{font-size:1.2rem}.post-item .new-item .left .bottom[data-v-f8165980]{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title[data-v-f8165980]{font-size:1.6rem}.post-item .new-item .left .bottom a[data-v-f8165980]{text-decoration:none!important}.post-item .new-item .right[data-v-f8165980]{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid[data-v-f8165980]{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content[data-v-f8165980]{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote[data-v-f8165980]{margin-top:.5rem}.post-item .post-content p[data-v-f8165980]:first-child{margin-top:0}.post-item .post-content[data-v-f8165980]:visited{color:var(--link-visited-color)}.post-item .show-more[data-v-f8165980]{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview[data-v-f8165980]{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link[data-v-f8165980]:link{color:#000!important}.preview .show-all[data-v-f8165980]{max-height:unset;-webkit-mask-image:none}.preview .post-content[data-v-f8165980]{height:unset!important}.preview .show-more[data-v-f8165980]{display:flex}.preview .item_title[data-v-f8165980]{font-weight:700}.Night .post-item[data-v-f8165980]{background:#18222d!important}.Night .preview[data-v-f8165980]{border:1px solid #3b536e}.Night .preview>.post-content[data-v-f8165980]:link{color:#d1d5d9}.Night .preview>.post-content[data-v-f8165980]:visited{color:#393f4e!important}.Night .preview .topic-link[data-v-f8165980]:link{color:#c0dbff!important}[data-v-f8165980]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark[data-v-f8165980]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex[data-v-f8165980]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-f8165980]{justify-content:flex-end}.flex-center[data-v-f8165980]{justify-content:center}.p1[data-v-f8165980]{padding:1rem}.p2[data-v-f8165980]{padding:2rem}.p0[data-v-f8165980]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-f8165980]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-f8165980]{text-decoration:none}.tool[data-v-f8165980]{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-f8165980]{width:2.2rem!important;height:2.2rem!important}.tool.disabled[data-v-f8165980]{cursor:not-allowed}.tool span[data-v-f8165980]{line-height:1rem}.my-node[data-v-f8165980]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs[data-v-f8165980]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-f8165980]{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content[data-v-f8165980]{padding:.5rem}.my-cell[data-v-f8165980]{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-f8165980]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-f8165980]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-f8165980]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-f8165980]{position:relative}.radio-group2[data-v-f8165980]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-f8165980]{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-f8165980]:first-child{border-left:none}.radio-group2 .active[data-v-f8165980]{background:var(--color-active);color:#fff}.pop-confirm[data-v-f8165980]{position:relative;display:inline-flex;justify-content:center}input[data-v-f8165980]{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-f8165980]:focus{border:1px solid var(--color-active)}.danger[data-v-f8165980]{color:red!important}.topic_content[data-v-f8165980],.reply_content[data-v-f8165980]{font-size:1.6rem}.mask[data-v-f8165980]{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark[data-v-f8165980]{background:#000000bb}.mask.light[data-v-f8165980]{background:transparent}.mask.lightgray[data-v-f8165980]{background:rgba(0,0,0,.25)}.mask.white[data-v-f8165980]{background:transparent}.slide[data-v-f8165980]{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list[data-v-f8165980]{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item[data-v-f8165980]{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1[data-v-f8165980]{overflow:hidden!important}.post-wrapper[data-v-f8165980],.setting-wrapper[data-v-f8165980]{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper[data-v-f8165980],.setting-wrapper2[data-v-f8165980]{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page[data-v-f8165980]{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content[data-v-f8165980]{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.html-wrapper[data-v-f8165980]{position:relative}.html-wrapper .htmlMask[data-v-f8165980]{max-height:90rem;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent)}.html-wrapper .expand[data-v-f8165980]{position:absolute;z-index:1;bottom:2rem;padding:.2rem 1.5rem;border-radius:2rem;border:1px solid gray;background:white;color:gray;left:50%;transform:translate(-50%)}.comment[data-v-312e9541]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-312e9541]{border-bottom:1px solid var(--color-line);padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-312e9541]{background:rgba(255,255,0,.3)!important}.comment .comment-content-w .more[data-v-312e9541]{text-align:center;margin:1rem 0}.comment .comment-content[data-v-312e9541]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-312e9541]{margin-top:.6rem;width:1.8rem;min-width:1.8rem;position:relative}.comment .comment-content .expand-line[data-v-312e9541]:after{position:absolute;left:30%;content:" ";height:100%;width:0;border-right:1px solid var(--color-line)}.comment .comment-content .right[data-v-312e9541]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-312e9541]{margin:.5rem 0}.wrong-wrapper[data-v-312e9541]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper .del-line[data-v-312e9541]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-312e9541]{margin-left:.5rem}.wrong-wrapper .warning[data-v-312e9541]{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;padding:1rem 0;margin-top:1rem;font-size:1.2rem;color:red}.toolbar[data-v-6234240d]{border-top:1px solid var(--color-line);height:4rem;padding:0 1rem;display:flex;align-items:center;color:var(--color-font);font-size:1.4rem;justify-content:space-between}.toolbar .left[data-v-6234240d],.toolbar .right[data-v-6234240d]{gap:1rem;display:flex}.toolbar .right[data-v-6234240d]{gap:.6rem}.comment[data-v-0869dab5]{width:100%;box-sizing:border-box;display:flex;gap:1rem;padding:1rem;border-bottom:1px solid var(--color-line)}.comment .base-avatar[data-v-0869dab5]{display:flex;margin-right:0}.comment .base-avatar img[data-v-0869dab5]{width:2.8rem;height:2.8rem;border-radius:.3rem}.comment .comment-body[data-v-0869dab5]{flex:1;display:flex;flex-direction:column}.comment .comment-body .texts[data-v-0869dab5]{display:flex;align-items:center}.comment .comment-body .reply_content[data-v-0869dab5]{margin-top:1rem;max-width:calc(100% - 5rem)}.comment .isRight[data-v-0869dab5]{align-items:flex-end}.comment .isRight .owner[data-v-0869dab5],.comment .isRight .mod[data-v-0869dab5],.comment .isRight .username[data-v-0869dab5]{margin:0 0 0 1rem}.comment .Author-right[data-v-0869dab5]{display:flex;flex-direction:column;align-items:center}.comment .Author-right .floor[data-v-0869dab5]{margin:0;border-radius:.5rem;background-color:var(--color-floor);padding:3px 9px}.comment .Author-right .jump[data-v-0869dab5]{color:#929596;margin-top:.4rem;font-size:1.4rem}.comment .point[data-v-0869dab5]{margin:0 1rem;display:flex;gap:.5rem;align-items:center}.comment .point svg[data-v-0869dab5]{font-size:1.6rem}.FromBottomDialog[data-v-3a54f208]{z-index:11;position:fixed;width:100%;overflow-y:auto;bottom:0;box-sizing:border-box;border-radius:var(--0013fa15);transition:all .3s;background:var(--color-four-bg)}.FromBottomDialog.no-heng-gang[data-v-3a54f208]{padding-top:0}.FromBottomDialog .heng-gang[data-v-3a54f208]{border-radius:.5rem .5rem 0 0;border-radius:var(--0013fa15);z-index:3;width:100%;position:fixed;min-height:3rem;display:flex;justify-content:center;align-items:center}.FromBottomDialog .heng-gang .gang-content[data-v-3a54f208]{background:darkgray;border-radius:2px;height:.4rem;width:3rem}.FromBottomDialog .dialog-wrapper[data-v-3a54f208]{margin-top:3rem}.wrapper .options[data-v-ae322b31]{padding:1rem 2rem 3rem;display:grid;grid-template-columns:repeat(5,1fr);justify-content:space-between;gap:2rem}.wrapper .options .item[data-v-ae322b31]{display:flex;flex-direction:column;align-items:center;color:gray;font-size:1.2rem}.wrapper .options .item.disabled[data-v-ae322b31]{opacity:.5}.wrapper .options .item.disabled svg[data-v-ae322b31]{color:gray!important}.wrapper .options .item .icon-wrap[data-v-ae322b31]{margin-bottom:.5rem;width:100%;height:15vw;display:flex;justify-content:center;align-items:center;background:var(--color-second-bg);border-radius:1rem}.wrapper .options .item .icon-wrap svg[data-v-ae322b31]{font-size:3rem}.wrapper .options .black[data-v-ae322b31]{color:var(--color-font-pure)}.wrapper .cancel[data-v-ae322b31]{border-top:1px solid var(--color-tooltip-bg);display:flex;align-items:center;justify-content:center;font-size:1.6rem;height:5rem;color:#646f81}.wrapper .options[data-v-8ef13a81]{padding:1rem 2rem 3rem;display:grid;grid-template-columns:repeat(5,1fr);justify-content:space-between;gap:2rem}.wrapper .options .item[data-v-8ef13a81]{display:flex;flex-direction:column;align-items:center;color:gray;font-size:1.2rem}.wrapper .options .item.disabled[data-v-8ef13a81]{opacity:.5}.wrapper .options .item.disabled svg[data-v-8ef13a81]{color:gray!important}.wrapper .options .item.full svg[data-v-8ef13a81]{color:#e02a2a!important}.wrapper .options .item .icon-wrap[data-v-8ef13a81]{margin-bottom:.5rem;width:100%;height:15vw;display:flex;justify-content:center;align-items:center;background:var(--color-second-bg);border-radius:1rem}.wrapper .options .item .icon-wrap svg[data-v-8ef13a81]{font-size:3rem;color:#39ae55}.wrapper .cancel[data-v-8ef13a81]{border-top:1px solid var(--color-line2);display:flex;align-items:center;justify-content:center;font-size:1.6rem;height:5rem;color:#646f81}.sticky{position:sticky;bottom:-2px;z-index:2;background:var(--box-background-hover-color)!important}.sticky[stuck]{box-shadow:0 2px 20px #00000059!important}.v-enter-active[data-v-546d3b11],.v-leave-active[data-v-546d3b11]{transition:opacity .3s ease}.v-enter-from[data-v-546d3b11],.v-leave-to[data-v-546d3b11]{opacity:0}.fade-in[data-v-546d3b11]{animation:fade-in-546d3b11 .3s}.fade-out[data-v-546d3b11]{animation:fade-out-546d3b11 .4s}@keyframes fade-in-546d3b11{0%{opacity:0}to{opacity:1}}@keyframes fade-out-546d3b11{0%{opacity:1}to{opacity:0;display:none}}.username[data-v-546d3b11]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-546d3b11]{font-size:1.4rem;color:#e02a2a}.owner[data-v-546d3b11]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-546d3b11]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-546d3b11]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove[data-v-546d3b11]{margin-left:.5rem;display:none}.add-tag[data-v-546d3b11]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor[data-v-546d3b11]{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar[data-v-546d3b11]{margin-right:1rem;display:inline-flex}.base-avatar img[data-v-546d3b11]{width:2.8rem;height:2.8rem;border-radius:.4rem}html[data-v-546d3b11]{font-size:10px}[data-v-546d3b11]:root{--box-border-radius: 8px}#site-header[data-v-546d3b11]{height:4rem}#site-header #site-header-menu #menu-body[data-v-546d3b11]{top:5rem;right:1rem}#Wrapper .cell .count_livid[data-v-546d3b11]{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a[data-v-546d3b11]{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item[data-v-546d3b11]{background:var(--box-background-color)}.post-item .new-item[data-v-546d3b11]{display:flex;justify-content:space-between}.post-item .new-item .left .top[data-v-546d3b11]{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small[data-v-546d3b11],.post-item .new-item .left a.node[data-v-546d3b11]{font-size:1.2rem}.post-item .new-item .left .bottom[data-v-546d3b11]{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title[data-v-546d3b11]{font-size:1.6rem}.post-item .new-item .left .bottom a[data-v-546d3b11]{text-decoration:none!important}.post-item .new-item .right[data-v-546d3b11]{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid[data-v-546d3b11]{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content[data-v-546d3b11]{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote[data-v-546d3b11]{margin-top:.5rem}.post-item .post-content p[data-v-546d3b11]:first-child{margin-top:0}.post-item .post-content[data-v-546d3b11]:visited{color:var(--link-visited-color)}.post-item .show-more[data-v-546d3b11]{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview[data-v-546d3b11]{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link[data-v-546d3b11]:link{color:#000!important}.preview .show-all[data-v-546d3b11]{max-height:unset;-webkit-mask-image:none}.preview .post-content[data-v-546d3b11]{height:unset!important}.preview .show-more[data-v-546d3b11]{display:flex}.preview .item_title[data-v-546d3b11]{font-weight:700}.Night .post-item[data-v-546d3b11]{background:#18222d!important}.Night .preview[data-v-546d3b11]{border:1px solid #3b536e}.Night .preview>.post-content[data-v-546d3b11]:link{color:#d1d5d9}.Night .preview>.post-content[data-v-546d3b11]:visited{color:#393f4e!important}.Night .preview .topic-link[data-v-546d3b11]:link{color:#c0dbff!important}[data-v-546d3b11]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark[data-v-546d3b11]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex[data-v-546d3b11]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-546d3b11]{justify-content:flex-end}.flex-center[data-v-546d3b11]{justify-content:center}.p1[data-v-546d3b11]{padding:1rem}.p2[data-v-546d3b11]{padding:2rem}.p0[data-v-546d3b11]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-546d3b11]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-546d3b11]{text-decoration:none}.tool[data-v-546d3b11]{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-546d3b11]{width:2.2rem!important;height:2.2rem!important}.tool.disabled[data-v-546d3b11]{cursor:not-allowed}.tool span[data-v-546d3b11]{line-height:1rem}.my-node[data-v-546d3b11]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs[data-v-546d3b11]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-546d3b11]{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content[data-v-546d3b11]{padding:.5rem}.my-cell[data-v-546d3b11]{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-546d3b11]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-546d3b11]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-546d3b11]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-546d3b11]{position:relative}.radio-group2[data-v-546d3b11]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-546d3b11]{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-546d3b11]:first-child{border-left:none}.radio-group2 .active[data-v-546d3b11]{background:var(--color-active);color:#fff}.pop-confirm[data-v-546d3b11]{position:relative;display:inline-flex;justify-content:center}input[data-v-546d3b11]{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-546d3b11]:focus{border:1px solid var(--color-active)}.danger[data-v-546d3b11]{color:red!important}.topic_content[data-v-546d3b11],.reply_content[data-v-546d3b11]{font-size:1.6rem}.mask[data-v-546d3b11]{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark[data-v-546d3b11]{background:#000000bb}.mask.light[data-v-546d3b11]{background:transparent}.mask.lightgray[data-v-546d3b11]{background:rgba(0,0,0,.25)}.mask.white[data-v-546d3b11]{background:transparent}.slide[data-v-546d3b11]{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list[data-v-546d3b11]{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item[data-v-546d3b11]{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1[data-v-546d3b11]{overflow:hidden!important}.post-wrapper[data-v-546d3b11],.setting-wrapper[data-v-546d3b11]{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper[data-v-546d3b11],.setting-wrapper2[data-v-546d3b11]{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page[data-v-546d3b11]{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content[data-v-546d3b11]{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.post-detail[data-v-546d3b11]{text-align:start;background:var(--color-main-bg);font-size:1.6rem;display:flex;justify-content:center;flex-wrap:wrap;padding-bottom:10rem}.post-detail[data-v-546d3b11] .subtle{background-color:#ecfdf5e6;border-left:4px solid #a7f3d0}.post-detail.isNight[data-v-546d3b11] .subtle{background-color:#1a3332;border-left:4px solid #047857}.post-detail .nav-bar[data-v-546d3b11]{position:fixed;top:0;z-index:9;height:4.6rem;display:flex;justify-content:space-between;align-items:center;padding:1rem;margin-bottom:-1px}.post-detail .nav-bar svg[data-v-546d3b11]{width:2rem;height:2rem;color:var(--color-font)}.post-detail .nav-bar .left[data-v-546d3b11],.post-detail .nav-bar .right[data-v-546d3b11]{display:flex;align-items:center;gap:1rem}.post-detail .post-main-body .box-header[data-v-546d3b11]{padding:0 .5rem}.post-detail .post-main-body .box-header h1[data-v-546d3b11]{font-size:2.2rem;font-weight:700}.post-detail .post-main-body .box-header small[data-v-546d3b11]{display:flex;align-items:center}.post-detail .loading-wrapper[data-v-546d3b11]{height:20rem;display:flex;justify-content:center;align-items:center}.post-detail .comments-header[data-v-546d3b11]{width:100%;padding:0 1rem;box-sizing:border-box;background:var(--box-background-color)}.post-detail #no-comments-yet[data-v-546d3b11]{color:#a9a9a9;font-weight:700;text-align:center;width:100%;margin:2rem 1rem;box-sizing:border-box}.post-detail .relationReply[data-v-546d3b11]{position:fixed;width:25vw;top:6.5rem;bottom:15rem;z-index:100;transform:translate(calc(100% + 2rem));font-size:2rem;overflow:hidden}.post-detail .relationReply .my-cell[data-v-546d3b11]{background:var(--color-second-bg);border-radius:var(--box-border-radius) var(--box-border-radius) 0 0}.post-detail .relationReply .comments[data-v-546d3b11]{max-height:calc(100% - 4.2rem);overflow:auto;background:var(--color-second-bg);border-radius:0 0 var(--box-border-radius) var(--box-border-radius)}.post-detail .call-list[data-v-546d3b11]{z-index:9;position:absolute;top:12rem;border:1px solid var(--color-main-bg);background:var(--color-call-list-bg);box-shadow:0 5px 15px #0000001a;overflow:auto;max-height:30rem;border-radius:var(--box-border-radius);min-width:8rem;box-sizing:content-box}.post-detail .call-list .call-item[data-v-546d3b11]{border-top:1px solid var(--color-main-bg);height:3rem;display:flex;padding:0 1rem;align-items:center;font-size:14px;box-sizing:border-box}.post-detail .call-list .call-item .select[data-v-546d3b11],.post-detail .call-list .call-item.select[data-v-546d3b11]{background:var(--color-main-bg);text-decoration:none}.post-detail .call-list .call-item[data-v-546d3b11]:nth-child(1){border-top:1px solid transparent}.post-detail .top-reply[data-v-546d3b11]{color:var(--color-font-3);font-size:2rem;margin-right:1rem}.base64_tooltip[data-v-1988f33b]{box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;background:var(--color-third-bg);min-height:2.2rem;max-width:20rem;padding:1rem;position:fixed;z-index:9998;display:flex;align-items:center;border-radius:.5rem;line-break:anywhere;font-size:1.4rem;color:var(--color-font-8)}.base64_tooltip svg[data-v-1988f33b]{margin-left:1rem;min-width:1.8rem}.base64_tooltip[data-v-1988f33b] .base-button{margin-left:1rem;margin-top:1rem}.msg[data-v-0dcc0508]{cursor:default;margin-bottom:2rem;display:flex;font-size:1.4rem;box-sizing:border-box;border-radius:var(--box-border-radius);color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.msg.success .left[data-v-0dcc0508]{background:var(--color-active)}.msg.warning .left[data-v-0dcc0508]{background:#c8c002}.msg.error .left[data-v-0dcc0508]{background:red}.msg .left[data-v-0dcc0508]{border-radius:var(--box-border-radius) 0 0 var(--box-border-radius);display:flex;align-items:center;background:var(--color-active)}.msg .left svg[data-v-0dcc0508]{color:#fff;font-size:2.2rem;margin:0 .6rem}.msg .right[data-v-0dcc0508]{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.tag-modal .wrapper[data-v-674b86aa]{z-index:9;background:var(--color-main-bg);color:var(--color-font-8);border-radius:1.6rem;font-size:1.4rem;padding:2rem 4rem;width:25rem}.tag-modal .wrapper .title[data-v-674b86aa]{font-weight:700}.tag-modal .wrapper .btns[data-v-674b86aa]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.msgs[data-v-93c4dec0]{position:fixed;margin-left:calc(50% - 40vw);width:80vw;z-index:9999;bottom:0;left:0;right:0}.tag-modal .modal-root[data-v-19a5903e]{z-index:9;background:var(--color-second-bg);color:var(--color-font-8);border-radius:1.6rem;font-size:1.4rem;width:50vw;height:70vh;display:flex;flex-direction:column}.tag-modal .modal-root .modal-header[data-v-19a5903e]{padding:2.4rem;display:flex;justify-content:space-between}.tag-modal .modal-root .modal-header .title[data-v-19a5903e]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.tag-modal .modal-root .modal-header i[data-v-19a5903e]{font-size:2.2rem}.tag-modal .modal-root .modal-body[data-v-19a5903e]{padding:2rem;padding-top:0;flex:1;overflow:auto}.tag-modal .modal-root .modal-body[data-v-19a5903e] .cell{padding:2rem}.v-enter-active,.v-leave-active{transition:opacity .3s ease}.v-enter-from,.v-leave-to{opacity:0}.fade-in{animation:fade-in .3s}.fade-out{animation:fade-out .4s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0;display:none}}.username{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num{font-size:1.4rem;color:#e02a2a}.owner{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove{margin-left:.5rem;display:none}.add-tag{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar{margin-right:1rem;display:inline-flex}.base-avatar img{width:2.8rem;height:2.8rem;border-radius:.4rem}html{font-size:10px}:root{--box-border-radius: 8px}#site-header{height:4rem}#site-header #site-header-menu #menu-body{top:5rem;right:1rem}#Wrapper .cell .count_livid{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item{background:var(--box-background-color)}.post-item .new-item{display:flex;justify-content:space-between}.post-item .new-item .left .top{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small,.post-item .new-item .left a.node{font-size:1.2rem}.post-item .new-item .left .bottom{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title{font-size:1.6rem}.post-item .new-item .left .bottom a{text-decoration:none!important}.post-item .new-item .right{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote{margin-top:.5rem}.post-item .post-content p:first-child{margin-top:0}.post-item .post-content:visited{color:var(--link-visited-color)}.post-item .show-more{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link:link{color:#000!important}.preview .show-all{max-height:unset;-webkit-mask-image:none}.preview .post-content{height:unset!important}.preview .show-more{display:flex}.preview .item_title{font-weight:700}.Night .post-item{background:#18222d!important}.Night .preview{border:1px solid #3b536e}.Night .preview>.post-content:link{color:#d1d5d9}.Night .preview>.post-content:visited{color:#393f4e!important}.Night .preview .topic-link:link{color:#c0dbff!important}:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex{display:flex;align-items:center;justify-content:space-between}.flex-end{justify-content:flex-end}.flex-center{justify-content:center}.p1{padding:1rem}.p2{padding:2rem}.p0{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a{text-decoration:none}.tool{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg{width:2.2rem!important;height:2.2rem!important}.tool.disabled{cursor:not-allowed}.tool span{line-height:1rem}.my-node{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content{padding:.5rem}.my-cell{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option{display:flex;align-items:center;padding:.6rem 0}.modal .option>span{position:relative}.radio-group2{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio:first-child{border-left:none}.radio-group2 .active{background:var(--color-active);color:#fff}.pop-confirm{position:relative;display:inline-flex;justify-content:center}input{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input:focus{border:1px solid var(--color-active)}.danger{color:red!important}.topic_content,.reply_content{font-size:1.6rem}.mask{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark{background:#000000bb}.mask.light{background:transparent}.mask.lightgray{background:rgba(0,0,0,.25)}.mask.white{background:transparent}.slide{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1{overflow:hidden!important}.post-wrapper,.setting-wrapper{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper,.setting-wrapper2{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.target-user-tags[data-v-ab0da04d]{background:var(--color-second-bg);color:var(--color-font);word-break:break-all;text-align:start;font-size:1.4rem;box-shadow:0 2px 3px #0000001a;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.target-user-tags .add-tag[data-v-ab0da04d]{display:inline-block}.loaded[data-v-ab0da04d]{font-size:1.4rem;display:flex;align-items:center;gap:1rem} ');
  7763. console.log("V2EX 移动端");
  7764. (function() {
  7765. if (/eruda=1/.test(location.href) || localStorage.getItem("active-eruda")) {
  7766. let src = "//cdn.jsdelivr.net/npm/eruda@3.0.1";
  7767. console.log(1);
  7768. let s = document.createElement("script");
  7769. s.src = src;
  7770. s.onload = () => {
  7771. let s1 = document.createElement("script");
  7772. s1.innerText = `eruda.init();`;
  7773. document.body.append(s1);
  7774. };
  7775. document.body.append(s);
  7776. }
  7777. })();
  7778. run();
  7779. let vueApp = vue.createApp(App);
  7780. vueApp.config.unwrapInjectedRef = true;
  7781. vueApp.mount($section);
  7782. }
  7783.  
  7784. })(Vue);