diff --git a/404.html b/404.html index a201594a4..a0540feb4 100644 --- a/404.html +++ b/404.html @@ -1,34 +1,21 @@ - +
That's a Four-Oh-Four.
English
Appearance
404
But if you don't change your direction, and if you keep looking, you may end up where you are heading.
: plain text - // : Image - // : Audio and video - // : PDF (Chrome) - // body > #outerContainer:first-child + #printContainer:last-child: PDF (Firefox) - document.querySelector('body > pre:only-child, body > img:only-child, body > video:only-child, body > embed:only-child, body > #outerContainer:first-child + #printContainer:last-child')) { - return; - } - if (window.name === 'mynovelreader-iframe') { - return; - } - function CheckIframe() { - if (window.name === 'superpreloader-iframe') { - return true; - } else { - return false; - } - } - - // how to trigger lazy_load - // https://wiki.greasespot.net/Generate_Click_Events - if (CheckIframe()) { - // 搜狗,iframe里面怎么不加载js啊? - // 去掉了原版的另一种方法,因为新版本 chrome 已经支持。旧版本 chrome iframe里面 无法访问window.parent,返回undefined - var domLoaded = function domLoaded() { - //window.scroll(window.scrollX, 99999); - var mutationObserver = window.frameElement ? JSON.parse(window.frameElement.getAttribute('mutationObserver')) : null; - if (!mutationObserver) { - window.parent.postMessage('superpreloader-iframe:DOMLoaded', '*'); - } else { - var observers = mutationObserver.observers; - - /**@type {Promise} */ - var p = null; - /**@type {Array} */ - var parr = []; - if (observers) { - ['attributes', 'addedNodes', 'removedNodes'].forEach(function (key) { - var el = getAllElements(observers[key]); - if (el.length > 0) { - if (mutationObserver.relatedObj) { - //el.forEach((x) => { - // p.push(elementReady(x, key)); - //}); - parr.push(elementReady(el[el.length - 1], key)); - el[0].scrollIntoView(); - el[el.length - 1].scrollIntoView(); - } else { - parr.push(elementReady(el[el.length - 1], key)); - } - } - }); - } - if (p) { - p = Promise.all(parr); - } else { - p = Promise.resolve(undefined); - } - var timeout = mutationObserver.timeout && 0; - setTimeout(function () { - p.then(function (values) { - if (values) { - values.forEach(function (_ref) { - _ref.element; - _ref.type; - _ref.mutationList; - var observer = _ref.observer; - observer.disconnect(); - }); - } - //window.scrollTo(0, scrollLocation); - window.parent.postMessage('superpreloader-iframe:DOMLoaded', '*'); - }); - }, timeout); - } - }; - //@ts-ignore - if (window.opera) { - document.addEventListener('DOMContentLoaded', domLoaded, false); - } else { - domLoaded(); - } - return; - } - - // 在以下网站上允许在非顶层窗口上加载JS..比如猫扑之类的框架集网页. - var DIExclude = [['猫扑帖子', true, /^https?:\/\/dzh\.mop\.com\/[a-z]{3,6}\/\d{8}\/.*\.shtml$/i], ['铁血社区', true, /^https?:\/\/bbs\.tiexue\.net\/.*\.html$/i], ['铁血社区-2', true, /^https?:\/\/bbs\.qichelian\.com\/bbsqcl\.php\?fid/i], - // 像 http://so.baiduyun.me/ 内嵌的百度、Google 框架 - ['百度网盘搜索引擎-百度', true, /^https?:\/\/www\.baidu\.com\/baidu/i], ['百度网盘搜索引擎-Google', true, /^https?:\/\/74\.125\.128\.147\/custom/i]]; - - // 页面不刷新的站点 - var HashchangeSites = [{ - url: /^https?:\/\/(www|encrypted)\.google(stable)?\..{2,9}\/(webhp|#|$|\?)/, - timer: 2000, - mutationSelector: '#main' - }, - // 运营商可能会在 #wd= 前面添加 ?tn=07084049_pg - { - url: /^https?:\/\/www\.baidu\.com\/($|#wd=)/, - timer: 1000, - mutationSelector: '#wrapper_wrapper' - }, { - url: /^https?:\/\/www\.newsmth\.net/, - timer: 1000 - }]; - - // ///////// ----- End of Rules obtained from online json files -------/////////// - - // 分页导航的6个图标以及颜色设置: - var sep_icons = { - top: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNrclE0rRGEUx8c1GUpRJIVIZGdhZCVr38GGhaI0ZXwCkliglChZEcvJxhdgYWOjLEUpm/EyiLzze+o8dTzdO3PljoVTv7rPc8/5d+6555xYrEhWop6boda5+6l9wjWcWpF+WIbqCJJ9hFRcDr3QAIkIhKugz5PDfkSixkphz5aiAnqgE8rgWRxGoSOPyBkswQuUwyscw4HrmFCZL8Kt/JAg7mEFPEmo4FdPwk0BUcsdzIap0TQ8qMAPuICcEjLnd+VjSjcfJNgIc/DkZGSymYGsnK9EZMrxe4MFaNGiZjC2fT5zQ3p7QDK1dR2GSljziclAvRUe8nHYVA4jjvC43NfAuk/smB2QNqcsWxKcLbAKTFnS0hWD6n27Fd6FLqiDI5iQmQ9jpiVT0sNJ6aYd7dAE3QHBbinSAX5JWWaxuLo8F35jh/bBK9Y+/r/Cl6pLcnna8NvuDGMnslpbZRpXZYT/3r4EGACZL3ZL2afNFAAAAABJRU5ErkJggg==', - bottom: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXFJREFUeNrM1c8rBGEcx/FdtCEkLqYtpdwkKSUHUhxwITdK+Z3yM2cOLnJ39Cc44SgHScmJwlFxsIdlCScO6/2t76Onp52dXTtbnno1M8+Pz84+zzMzkcg/KA3oRTzM0A4cI4VTdIUVPIM3pPGO5aABJTkGx1BqjYmFFZxW7nnBwXmXogWX6bEGc2jEIU7+kNWDUSSwZyqndSvJ3N1g2Bm0oLtB2j+w7rQP4MpqXzRT0YRaPW/BthMedYLs60HsoE2vq9BsPwAJa8XFLUa0fUrvROo/saT1Q9adGimdlt8yj6TT6Q6d2vaida9YRbtP6EqmBZC5fHA6X+AAz1bwEc6cfk9+oaZM4NoZJL70+J2hTaZtNpet041zK8yP/Mgl+rOF1emr0UM1xnAfEPyISd0Jno6vtx+QuM6PZ22lpO7dbEV2Siv6rPeIjNs1HdYC7ixfG+YBqdTVDqPIv6iIWvO7iXGUFxAqi72PraJ9IH8EGACQcYjYRd5GHwAAAABJRU5ErkJggg==', - pre: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAASlJREFUeNpiYBjOoBiIrwJxFRAzUsvQViD+CMT/gfgTEPdRy9BPUENh+AsQ91JiaAuSS9HxZ3INb8Hi0v+UurwF6qL/ROBvQNxDrKFfkTT+A+JnQPwBKfJA/L9Ian7ic7kMEHcC8Q80F3UAcRsQv4by30INaUJT9weaWhSQDRUB4uVYvLkYiAWAOBopvEFBlArEPEA8G4ue9UAsATM4EYuCJUgKMtAMLoSKCwPxXCx6c1igClTQgmUZVPNrHMEGy3mgYCkCYiYgTkCSV4UZvA2IjYBYDIgvQbPvOyJTECid5wHxbyA2BuL3QLwRWYEsEJvg0IweFEU41IEMlgcxWJAEH0MxJeAsjMFEq6Jw+Br8BimVfMCTDEkG7EBcA8T3oWUJx4DVYwABBgCannnSzbgwIQAAAABJRU5ErkJggg==', - next: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT1JREFUeNrc1b1KA0EYheEl/iARFFEkKl6D0UK8CrEVrCwEexFCtBIlRWIjsfEiLL0FKzs7QUWxM2piFMUkvhPOwLAs2TGuCn7wkNll5jC7+w0Jgv9avdjAObbQn1TwCu7QwhWW4xakPIOHMKzxGCaSCm6ioXHLZ0Hqpz7KrwRPIvvNvBlM2zYyNY8cMjhDHo9fCBzErnIqKNjgRSxpvIABbOLes2MKWHfuXdhXcR2avKrJ4zGhI9gLhQbq9XaZgGO1kutIOzIHpKp7NawhjYOINSeY6lFwHacw17P6NTWHd4xqnNbcS83LObtsaCPbEW+gXUW8ODswC27xoOsn3ODDmfOGss9XLuE54jGjvPqGuuG1mFDzZIfdNHynnde7DbW1r5DwTstJHP2iE55YqD36ebXZDvr+7L/sU4ABAIpVZWnoA5GkAAAAAElFTkSuQmCC', - next_gray: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtxJREFUeNrclc9L2mEcx7/6NbVZqRVj7pIOlIUuZ1HMgv0BDcqT7JrskH13ELPBF7eTvz10HznWQBlBRIfBXIfBLmqXscvYZWPKrMNIU9Apmrr34/w6i0ovMZjw+H0+z/N8Xt+Pn/fn80hR/+WHYRhBIpFwRKPRz/F4/KnD4RB28xH0Ah4cHHyoUCjsIpFIIZPJHkml0m9Yfn2ZD78XcL1eH6rValIMCmMUtqKbD7/HbNQxaq15oxcH/lXpcmXgtnh2u/2mXC6/DqE+sSxLlUqlniE0TVPBYJAqFot6+GV9Pt+PJthms80sLS2xEonkhlgs/jgwMOBcXV3N5fP5rlCcp9bX1yWLi4uecrk8U6lUshDY3wRbLJYFGKZsNksq4N78/LwY9hOn05k5Ojqi+PzTGePxeFwZUl6vd8hkMvkPDg6sZJ2M5eXlr1wqUu2kA5JOpy2IAO+oO9fW1n5mMpk2nDjmcjkKNU25XC652Wx2pVIp65mXJ2nyjUPpqakpNZxuA8Y5T87OzsobjcYHpVKpGhsbe1CtVkXYqxQKhTdqtfqL1Wr1JpPJxxyU5Lq/vz8aCoX8TTDatYiFhF6vxx5tAJwm8OPj48m5ubmKSqUaAWwSa9eQw6JGo/luNBoNh4eHbAe0JhAINsLh8LNAIJCiudhxB+Qh2ludTifDAQLvI3AIch+Rkl8jJlrhCbOqgfoLmDepOF/BfGNra2sFFZFtvqgzMbFYjAiyp9Vqh4VC4cTJyYmQ90epIQJtHRO1bA5aRhAvdnZ2GI/H87cEz5YPgeOS2RsfHx9B7u+gOi68yQAtYX9zd3eXgZCna/s8By5ypGUUzhOISHgO9BfWXwG6chZ6IbiVc6LwnsFgGIVAepLzjk4rYW1ze3ubcbvd53fjZV2FaqGQ63fT09PDMO9i9BEoon0J9Rm/339xm3dr2f39fVLX7wFvoMVvoYWfRyIRFndD/Z/8nf0WYAA8EC1Z/ZNm4gAAAABJRU5ErkJggg==', - pre_gray: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAslJREFUeNrclTtMWmEUxz/uvTzlIUhpNMR0aGNjrNHSmHTqRJyadujQDbSGRwJUaYCmDizqUEw6ODVNGgbpYCfSpFINCQzFR9oyMXRsXFCsAXkIKNL/R7gGWxOsSdPEk5zc3O+e87vn+59zv0vIpbSJiQmyubn5LBKJpNbX11+4XC5Buxy2XYDNZiMOh2OW4ziPTCbTi8XikeHh4SsSieQTXnIxsN1uJ1ardVYgEDgPDw+V9Xqd1Go1Mcuyg7AuuVy+sra29ndgVEnGx8dnhEKhs1qtKgE/eXZ8fCzC+q3+/n6tSqVaSSQS5wM7nU5iMplmsF1XpVI5BeXt6OhIBFkGAe9SKpV/wNmzKjWbzRT6tFwuK86CUqPrkIVWPjQwMKBWKBSn4Ozv0LGxsRmRSDSFSjua0Do8TRWAS+B5+B68g/IhixCNvQPN1WjuieZsS/f1aNQ0wzBuaCqlUCQRtVr9Es1K4kVDWJNhrQjAIiqMlkqle804FnkjBoOhEzv4vrGxkW2ALRaLFrq+QoAV2nE8tLe3dzEYDE5vb2939vX1PcBkiKVSaQ1jForFYq+NRqMum83ebsYzmJq7sGu4xhkKxsDfB/AxnO860ev1oeXlZU8gEMgmk0kFqmw8o9dUKiWfn58vhMPh54h7S+OpQXNSLBYfejyeR1yzw9dbRon09PS8W11dnfL5fJl8Pk+0Wi3hk5vyCNBY4vV6f0Im9+joKJNOp818o8G70ah4aWnpIzSKYCa/dXd3B+PxuHNycjKzs7NzAms1+qFQy+VydDRz0WjUpdPp3tB8TFM0FAqFGxXPzc19plJrNJqraMoXt9tNt3Suc+Tg4ICeJfmFhQVLoVAwoKG7fr//B8cHAL6Fy9ZFDinaG/r5w77ya8y/OhEvKRhjtIup2YMTeBb3mXY53HnAmNkP+/v7NzHTTwAO4f79f/ud/RJgAOLcRNZqLojMAAAAAElFTkSuQmCC', - text_span_style: 'color:#595959!important;' - }; - - // 悬浮窗的状态颜色. - var FWKG_color = { - loading: '#8B00E8', - // 读取中状态 - prefetcher: '#5564AF', - // 预读状态 - autopager: '#038B00', - // 翻页状态 - Apause: '#B7B700', - // 翻页状态(暂停). - Astop: '#A00000', - // 翻页状态(停止)(翻页完成,或者被异常停止.)(无法再开启) - dot: '#00FF05' // 读取完后,会显示一个小点,那么小点的颜色. - }; - - // 上一页关键字 - var prePageKey = ['上一页', '上一頁', '上1页', '上1頁', '上页', '上頁', '翻上頁', '翻上页', '上一张', '上一張', '上一幅', '上一章', '上一节', '上一節', '上一篇', '前一页', '前一頁', '后退', '後退', '上篇', 'previous', 'previous Page', '前へ', '前のページ']; - - // 下一页关键字 - var nextPageKey = ['下一页', '下一頁', '下1页', '下1頁', '下页', '下页 ›', '下頁', '翻页', '翻頁', '翻下頁', '翻下页', '下一张', '下一張', '下一幅', '下一章', '下一节', '下一節', '下一篇', '前进', '下篇', '后页', '往后', 'Next', 'Next Page', '次へ', '次のページ', '次のページ »', '下一页 →', '下一頁 →', '下1页 →', '下1頁 →', '下页 →', '下頁 →', '翻页 →', '翻頁 →', '翻下頁 →', '翻下页 →', '下一张 →', '下一張 →', '下一幅 →', '下一章 →', '下一节 →', '下一節 →', '下一篇 →', '前进 →', '下篇 →', '后页 →', '往后 →', 'Next →', 'Next Page →', '次へ →', '次のページ →', '下一页 »', '下一頁 »', '下1页 »', '下1頁 »', '下页 »', '下頁 »', '翻页 »', '翻頁 »', '翻下頁 »', '翻下页 »', '下一张 »', '下一張 »', '下一幅 »', '下一章 »', '下一节 »', '下一節 »', '下一篇 »', '前进 »', '下篇 »', '后页 »', '往后 »', 'Next »', 'Next Page »', '次へ »', '后一页', '後一頁', '下一页 ›', '下一頁 ›', '下1页 ›', '下1頁 ›', '下頁 ›', '翻页 ›', '翻頁 ›', '翻下頁 ›', '翻下页 ›', '下一张 ›', '下一張 ›', '下一幅 ›', '下一章 ›', '下一节 ›', '下一節 ›', '下一篇 ›', '前进 ›', '下篇 ›', '后页 ›', '往后 ›', 'Next ›', 'Next >', 'Next Page ›', '次へ ›', '次のページ ›', '»', '→', '早期文章→']; - // THX to https://greasyfork.org/en/forum/discussion/39361/x - // 出在自动翻页信息附加显示真实相对页面信息,一般能智能识别出来。如果还有站点不能识别,可以把地址的特征字符串加到下面 - // 最好不要乱加,一些不规律的站点显示出来的数字也没有意义 - var REALPAGE_SITE_PATTERN = ['search?', 'search_', 'forum', 'thread']; - - // ------------------------下面的不要管他----------------- - /// //////////////////////////////////////////////////////////////// - // eslint-disable-next-line prettier/prettier - Promise.all([loadSettings(), getServerIp(location.hostname)]).then(function (_ref2) { - var _ref3 = _slicedToArray(_ref2, 2), - values = _ref3[0], - serverIp = _ref3[1]; - var jsonRule = values.jsonRule; - var prefs = values.prefs, - SITEINFO_D = values.SITEINFO_D, - autoMatch = values.autoMatch; - values.version; - var blackList = values.blackList; - if (prefs.debug) { - logger.setLevel('debug'); - } else { - logger.setLevel(5); - } - logger.debug("[Super-preloader]", 'Script Manager: ', JSON.stringify({ - name: SCRIPT_MANAGER.name, - version: SCRIPT_MANAGER.version || 'unknown' - })); - logger.debug("[Super-preloader]", 'Browser: ', JSON.stringify(BROWSER)); - logger.debug("[Super-preloader]", `Server ip: ', ${serverIp}`); - var setup = function setup() { - var d = document; - - /** - * - * @param {string} s s - * @returns {HTMLInputElement} elem - */ - var $ = function $(s) { - // @ts-ignore - return d.getElementById('sp-prefs-' + s); - }; - if ($('setup')) return; - var styleNode = addStyle(spcss['sp-prefs-setup']); - if (prefs.customCSS.length > 0) { - addStyle(prefs.customCSS); - } - var div = d.createElement('div'); - div.id = 'sp-prefs-setup'; - div.style.position = 'fixed'; - if (prefs.FW_position !== 2) { - div.style.right = '38px'; - div.style.top = '20px'; - } else { - div.style.right = `${prefs.FW_offset[1]}px`; - div.style.top = `${prefs.FW_offset[0]}px`; - } - var nextUpdateDate = prefs.disableBuiltinSubscriptionRules ? 'N/A' : jsonRuleLoader.expire.toDateString(); - div.innerHTML = template['sp-prefs']({ - prefs, - scriptInfo, - nextUpdateDate: nextUpdateDate - }); - d.body.appendChild(div); - var close = function close() { - if (styleNode) { - styleNode.parentNode.removeChild(styleNode); - } - var div = $('setup'); - div.parentNode.removeChild(div); - }; - var on = function on(node, e, f) { - node.addEventListener(e, f, false); - }; - on($('ok'), 'click', function () { - Object.keys(factorySettings.prefs).forEach(function (key) { - var el = $(key); - if (el !== null) { - prefs[key] = getProperty(el); - } - }); - if (prefs.debug) { - logger.setLevel('debug'); - } else { - logger.setLevel(5); - } - autoMatch.keyMatch = !$('autoMatchKeyMatch').checked; - SITEINFO_D.useiframe = !!$('SITEINFO_D-useiframe').checked; - SITEINFO_D.autopager.enable = !!$('SITEINFO_D-a_enable').checked; - SITEINFO_D.autopager.force_enable = !!$('SITEINFO_D-a_force_enable').checked; - autoMatch.useiframe = SITEINFO_D.useiframe; - saveSettings({ - prefs, - SITEINFO_D, - autoMatch - }).then(function () { - SP.loadSetting(); - close(); - location.reload(); - }); - }); - on($('reset'), 'click', function () { - $('setup').innerHTML = template.spinner.reset; - addStyle(spcss['sp-prefs-spinner']); - resetSettings().then(function () { - location.reload(); - }); - }); - if (prefs.disableBuiltinSubscriptionRules) { - $('updaterule').setAttribute('disabled', ''); - } - on($('updaterule'), 'click', function () { - if (prefs.disableBuiltinSubscriptionRules) return; - $('setup').innerHTML = template.spinner.update; - addStyle(spcss['sp-prefs-spinner']); - jsonRuleLoader.updateRule(true).then(function () { - jsonRule = jsonRuleLoader.getRule(); - SP.loadSetting(); - close(); - location.reload(); - }); - }); - on($('cancel'), 'click', close); - $('debug').checked = logger.getLevel() === logger.levels.DEBUG; - $('ChineseUI').checked = prefs.ChineseUI; - $('floatWindow').checked = prefs.floatWindow; - $('enableHistory').checked = prefs.enableHistory; - // $('forceTargetWindow').checked = prefs.forceTargetWindow; - $('dblclick_pause').checked = prefs.dblclick_pause; - $('SITEINFO_D-useiframe').checked = SITEINFO_D.useiframe; - $('SITEINFO_D-a_enable').checked = SITEINFO_D.autopager.enable; - $('arrowKeyPage').checked = prefs.arrowKeyPage; - $('SITEINFO_D-a_force_enable').checked = SITEINFO_D.autopager.force_enable; - $('excludes').value = prefs.excludes; - $('custom_siteinfo').value = prefs.custom_siteinfo; - $('customCSS').value = prefs.customCSS; - $('disableBuiltinRules').checked = prefs.disableBuiltinRules; - $('disableBuiltinSubscriptionRules').checked = prefs.disableBuiltinSubscriptionRules; - $('autoMatchKeyMatch').checked = !autoMatch.keyMatch; - }; - - // main functions - var SP = { - spinit: function spinit() { - if (document.body.getAttribute('name') === 'MyNovelReader') { - return; - } - this.loadSetting(); - if (userLang === 'zh_CN') { - GM.registerMenuCommand('Super_preloaderPlus_one_New 设置', setup); - } else { - GM.registerMenuCommand('Super_preloaderPlus_one_New Settings', setup); - } - - // 查找是否是页面不刷新的站点 - var locationHref = location.href; - var hashSite = _find(HashchangeSites, function (x) { - return toRE(x.url).test(locationHref); - }); - if (hashSite) { - isHashchangeSite = true; - hashchangeTimer = hashSite.timer; - logger.debug("[Super-preloader]", 'This site does not refresh the page.', hashSite); - var p1 = new Promise(function (resolve, reject) { - setTimeout(resolve, hashchangeTimer); - }); - p1.then(function (values) { - init(window, document); - }); - } else { - init(window, document); - } - // 分辨率 高度 > 宽度 的是手机 - if (window.screen.height > window.screen.width) { - addStyle('div.sp-separator { min-width:auto !important; }'); - } - }, - loadSetting: function loadSetting() { - var a_enable = SITEINFO_D.autopager.enable; - if (a_enable !== undefined) { - SITEINFO_D.autopager.enable = a_enable; - } - var loadDblclickPause = function loadDblclickPause(reload) { - var dblclickPause = prefs.dblclick_pause; - if (dblclickPause) { - prefs.mouseA = false; - prefs.Pbutton = [0, 0, 0]; - } - if (reload) location.reload(); - }; - var loadCustomSiteInfo = function loadCustomSiteInfo() { - var userRules; - try { - // eslint-disable-next-line no-new-func - userRules = new Function('', 'return ' + prefs.custom_siteinfo)(); - } catch (e) { - logger.error("[Super-preloader]", 'Custom site rule error:', prefs.custom_siteinfo); - } - if (_isArray(userRules)) { - SSRules = SSRules.concat(userRules); - } - }; - loadDblclickPause(); - loadCustomSiteInfo(); - } - }; - SP.spinit(); - /** - * - * @param {Window} window window - * @param {Document} document document - * @returns {void} - */ - function init(window, document) { - var startTime = new Date(); - // eslint-disable-next-line valid-jsdoc - /**@type {(...rest:any[])=>void} */ - var nullFn = function nullFn() {}; // 空函数. - var url = document.location.href.replace(/#.*$/, ''); // url 去掉hash - var cplink = url; // 翻上来的最近的页面的url; - document.domain; // 取得域名. - var domain_port = url.match(/https?:\/\/([^\/]+)/)[1]; // 端口和域名,用来验证是否跨域. - - // 新加的,以示区别 - var remove = []; // 需要移除的事件 - - // 悬浮窗 - var floatWO = { - updateColor: nullFn, - loadedIcon: nullFn, - CmodeIcon: nullFn - }; - /** - * - * @param {IRuntimeRule} SSS a rule - * @returns {void} - */ - function floatWindow(SSS) { - // inject css - addStyle(spcss['sp-fw']); - - // create container - var div = document.createElement('div'); - div.id = 'sp-fw-container'; - div.innerHTML = template.floatWindow(); - document.body.appendChild(div); - - // helper function to get element - /** - * - * @param {string} id id - * @returns {HTMLInputElement} return - * */ - function $(id) { - //@ts-ignore - return document.getElementById(id); - } - var rect = $('sp-fw-rect'); // 悬浮窗的小正方形,用颜色描述当前的状态. - var spanel = $('sp-fw-content'); // 设置面板. - - // 设置面板显隐 - var spanelc = { - show: function show() { - spanel.style.display = 'block'; - }, - hide: function hide() { - spanel.style.display = 'none'; - } - }; - spanelc.hide(); - var rectt1, rectt2; - rect.addEventListener('mouseover', function (e) { - rectt1 = setTimeout(spanelc.show, 100); - }, false); - rect.addEventListener('mouseleave', function (e) { - clearTimeout(rectt1); - }, false); - div.addEventListener('mouseover', function (e) { - clearTimeout(rectt2); - }, false); - div.addEventListener('mouseleave', function (e) { - // Firefox bug - // https://stackoverflow.com/questions/46831247/select-triggers-mouseleave-event-on-parent-element-in-mozilla-firefox - if (e.relatedTarget === null) return; - rectt2 = setTimeout(spanelc.hide, 288); - }, false); - var dot = $('sp-fw-dot'); // 载入完成后,显示的小点 - dot.style.backgroundColor = FWKG_color.dot; - var cur_mode = $('sp-fw-cur-mode'); // 当载入状态时,用来描述当前是翻页模式,还是预读模式. - cur_mode.style.backgroundColor = SSS.a_enable ? FWKG_color.autopager : FWKG_color.prefetcher; - var a_enable = $('sp-fw-a_enable'); // 启用翻页模式 - var autopager_field = $('sp-fw-autopager-field'); // 翻页设置区域 - - // 预读设置 - var useiframe = $('sp-fw-useiframe'); - var viewcontent = $('sp-fw-viewcontent'); - - // 翻页设置 - var a_useiframe = $('sp-fw-a_useiframe'); - var a_iloaded = $('sp-fw-a_iloaded'); - var a_itimeout = $('sp-fw-a_itimeout'); - var a_manualA = $('sp-fw-a_manualA'); - var a_remain = $('sp-fw-a_remain'); - var a_maxpage = $('sp-fw-a_maxpage'); - var a_separator = $('sp-fw-a_separator'); - var a_ipages_0 = $('sp-fw-a_ipages_0'); - var a_ipages_1 = $('sp-fw-a_ipages_1'); - var a_force = $('sp-fw-a_force'); - - // newIframe 输入框的点击 - var a_newIframe = $('sp-fw-a_newIframe'); - a_newIframe.addEventListener('click', function () { - a_useiframe.checked = a_newIframe.checked; - }, false); - var a_starti = $('sp-fw-a_starti'); // 开始立即翻页 - a_starti.addEventListener('click', function (e) { - //@ts-ignore - if (e.currentTarget.disabled) return; - var value = parseInt(a_ipages_1.value); - if (isNaN(value) || value < 0) { - value = SSS.a_ipages[1]; - //@ts-ignore - a_ipages_1.value = value; - } - autoPO.startipages(value); - }, false); - - // 总开关 - var enable = $('sp-fw-enable'); - $('sp-fw-setup').addEventListener('click', setup, false); - - // 保存设置按钮. - var savebutton = $('sp-fw-savebutton'); - savebutton.addEventListener('click', function (e) { - var value = { - Rurl: SSS.Rurl, - useiframe: getProperty(useiframe), - viewcontent: getProperty(viewcontent), - enable: getProperty(enable) - }; - if (SSS.a_enable !== undefined) { - /** @type {(s:HTMLElement)=>number} */ - //@ts-ignore - var getPropertyNumber = getProperty; - value.a_enable = getProperty(a_enable) === 'autopager'; - value.a_useiframe = getProperty(a_useiframe); - value.a_newIframe = getProperty(a_newIframe); - value.a_iloaded = getProperty(a_iloaded); - value.a_manualA = getProperty(a_manualA); - value.a_force = getProperty(a_force); - var t_a_itimeout = getPropertyNumber(a_itimeout); - value.a_itimeout = isNaN(t_a_itimeout) ? SSS.a_itimeout : t_a_itimeout >= 0 ? t_a_itimeout : 0; - var t_a_remain = getPropertyNumber(a_remain); - value.a_remain = isNaN(t_a_remain) ? SSS.a_remain : Number(t_a_remain); - var t_a_maxpage = getPropertyNumber(a_maxpage); - value.a_maxpage = isNaN(t_a_maxpage) ? SSS.a_maxpage : t_a_maxpage >= 1 ? t_a_maxpage : 1; - var t_a_ipages_1 = getPropertyNumber(a_ipages_1); - value.a_ipages = [getProperty(a_ipages_0), isNaN(t_a_ipages_1) ? SSS.a_ipages[1] : t_a_ipages_1 >= 0 ? t_a_ipages_1 : 1]; - value.a_separator = getProperty(a_separator); - } - saveLocalSetting(value); - if (e.shiftKey ? !prefs.FW_RAS : prefs.FW_RAS) { - // 按住shift键,执行反向操作. - setTimeout(function () { - location.reload(); - }, 1); - } - }, false); - - // 载入翻页设置. - if (SSS.a_enable === undefined) { - // 未定义翻页功能. - a_enable.disabled = true; - autopager_field.style.display = 'none'; - } else { - setProperty(a_enable, SSS.a_enable ? 'autopager' : 'preloader'); - setProperty(a_useiframe, SSS.a_useiframe); - setProperty(a_newIframe, SSS.a_newIframe); - setProperty(a_iloaded, SSS.a_iloaded); - setProperty(a_itimeout, SSS.a_itimeout); - setProperty(a_manualA, SSS.a_manualA); - setProperty(a_force, SSS.a_force); - setProperty(a_remain, SSS.a_remain); - setProperty(a_maxpage, SSS.a_maxpage); - setProperty(a_separator, SSS.a_separator); - setProperty(a_ipages_0, SSS.a_ipages[0]); - setProperty(a_ipages_1, SSS.a_ipages[1]); - } - if (!SSS.a_enable) { - // 当前不是翻页模式,禁用立即翻页按钮. - a_starti.disabled = true; - } - if (!SSS.hasRule) { - // 如果没有高级规则,那么此项不允许操作. - a_force.disabled = true; - } - - // 载入预读设置. - setProperty(useiframe, SSS.useiframe); - setProperty(viewcontent, SSS.viewcontent); - - // 总开关 - setProperty(enable, SSS.enable); - var FWKG_state = { - loading: '读取中状态', - prefetcher: '预读状态', - autopager: '翻页状态', - Apause: '翻页状态(暂停)', - Astop: '翻页状态(停止)(翻页完成,或者被异常停止)(无法再开启)', - dot: '读取完后' - }; - if (userLang !== 'zh_CN') { - FWKG_state.loading = 'Loading'; - FWKG_state.prefetcher = 'Prefetching'; - FWKG_state.autopager = 'Autopagger (Running)'; - FWKG_state.Apause = 'Autopagger (Pause)'; - FWKG_state.Astop = 'Autopagger (Stop)'; - FWKG_state.dot = 'Finish loading'; - } - floatWO = { - updateColor: function updateColor(state) { - rect.style.backgroundColor = FWKG_color[state]; - rect.setAttribute('title', FWKG_state[state]); - }, - loadedIcon: function loadedIcon(command) { - dot.style.display = command == 'show' ? 'block' : 'none'; - }, - CmodeIcon: function CmodeIcon(command) { - cur_mode.style.display = command == 'show' ? 'block' : 'none'; - } - }; - var vertical = parseInt(prefs.FW_offset[0] + '', 10); - var horiz = parseInt(prefs.FW_offset[1] + '', 10); - var FW_position = prefs.FW_position; - - // 非opera用fixed定位. - div.style.position = 'fixed'; - switch (FW_position) { - case 1: - div.style.top = vertical + 'px'; - div.style.left = horiz + 'px'; - break; - case 2: - div.style.top = vertical + 'px'; - div.style.right = horiz + 'px'; - break; - case 3: - div.style.bottom = vertical + 'px'; - div.style.right = horiz + 'px'; - break; - case 4: - div.style.bottom = vertical + 'px'; - div.style.left = horiz + 'px'; - break; - } - } - function sp_transition(start, end) { - //@ts-ignore - var TweenF = sp_transition.TweenF; - if (!TweenF) { - TweenF = Tween[TweenM[prefs.s_method]]; - TweenF = TweenF[TweenEase[prefs.s_ease]] || TweenF; - //@ts-ignore - sp_transition.TweenF = TweenF; - } - var frameSpeed = 1000 / prefs.s_FPS; - var t = 0; // 次数,开始 - var b = start; // 开始 - var c = end - start; // 结束 - var d = Math.ceil(prefs.s_duration / frameSpeed); // 次数,结束 - - var x = window.scrollX; - function transition() { - var y = Math.ceil(TweenF(t, b, c, d)); - window.scroll(x, y); - if (t < d) { - t++; - setTimeout(transition, frameSpeed); - } - } - transition(); - } - function sepHandler(e) { - e.stopPropagation(); - var div = e.currentTarget; - var target = e.target; - function getRelativeDiv(which) { - var id = div.id; - id = id.replace(/(sp-separator-)(.+)/, function (a, b, c) { - return b + String(Number(c) + (which == 'pre' ? -1 : 1)); - }); - return id ? document.getElementById(id) : null; - } - function scrollIt(a, b) { - // a=a!==undefined? a : window.scrollY; - if (prefs.sepT) { - sp_transition(a, b); - } else { - window.scroll(window.scrollX, b); - } - } - var o_scrollY, divS; - switch (target.className) { - case 'sp-sp-gotop': - scrollIt(window.scrollY, 0); - break; - case 'sp-sp-gopre': - { - var prediv = getRelativeDiv('pre'); - if (!prediv) return; - o_scrollY = window.scrollY; - var preDS = prediv.getBoundingClientRect().top; - if (prefs.sepP) { - divS = div.getBoundingClientRect().top; - preDS = o_scrollY - (divS - preDS); - } else { - preDS += o_scrollY - 6; - } - scrollIt(o_scrollY, preDS); - break; - } - case 'sp-sp-gonext': - { - var nextdiv = getRelativeDiv('next'); - if (!nextdiv) return; - o_scrollY = window.scrollY; - var nextDS = nextdiv.getBoundingClientRect().top; - if (prefs.sepP) { - divS = div.getBoundingClientRect().top; - nextDS = o_scrollY + (-divS + nextDS); - } else { - nextDS += o_scrollY - 6; - } - scrollIt(o_scrollY, nextDS); - break; - } - case 'sp-sp-gobottom': - scrollIt(window.scrollY, Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)); - break; - } - } - - // autopager - var autoPO = { - /**@type {(value?:number)=>void} f*/ - startipages: nullFn - }; - var hashchangeAdded = false; - /** - * @param {IRuntimeRule} SSS a rule - * @param {*} floatWO float window object - * @returns {void} - */ - function autopager(SSS, floatWO) { - // return; - // 更新悬浮窗的颜色. - floatWO.updateColor('autopager'); - - // 获取插入位置节点. - var insertPoint; - var pageElement; - var insertMode; - if (SSS.a_HT_insert) { - insertPoint = getElement(SSS.a_HT_insert[0]); - insertMode = SSS.a_HT_insert[1]; - } else { - pageElement = getAllElements(SSS.a_pageElement, document, document, null, cplink); - if (pageElement.length > 0) { - var pELast = pageElement[pageElement.length - 1]; - insertPoint = pELast.nextSibling ? pELast.nextSibling : pELast.parentNode.appendChild(document.createTextNode(' ')); - } - insertMode = -1; - } - if (insertPoint) { - logger.debug("[Super-preloader]", 'Verify that the insertion position node can be found: success', insertPoint); - } else { - logger.error("[Super-preloader]", 'Verify that the insertion position node can be found: failed. JS execution stopped', SSS.a_HT_insert ? SSS.a_HT_insert[0] : ''); - floatWO.updateColor('Astop'); - return; - } - if (window.navigator.language != 'en') { - logger.debug("[Super-preloader]", 'Language: ', window.navigator.language); - } - if (pageElement === undefined) { - pageElement = getAllElements(SSS.a_pageElement); - } - if (pageElement.length > 0) { - logger.debug("[Super-preloader]", 'Verify that the main element can be found: success', pageElement); - } else { - logger.error("[Super-preloader]", 'Verify that the main element can be found: failure', SSS.a_pageElement); - floatWO.updateColor('Astop'); - return; - } - if (SSS.a_stylish) { - // 插入自定义样式 - addStyle(SSS.a_stylish, 'Super_preloader-style'); - } - - /** @type {Node} */ - var insertPointP; - if (insertMode != 2) { - insertPointP = insertPoint.parentNode; - } - var addIntoDoc; - if (insertMode == -1 || insertMode == 1) { - addIntoDoc = function addIntoDoc(obj) { - return insertPointP.insertBefore(obj, insertPoint); - }; - } else if (insertMode == 2) { - addIntoDoc = function addIntoDoc(obj) { - return insertPoint.appendChild(obj); - }; - } else if (insertMode == 0) { - addIntoDoc = function addIntoDoc(obj) { - return insertPointP.insertBefore(obj, insertPoint.nextSibling); - }; - } - - /** @type {HTMLDocument} */ - var doc, win; - function XHRLoaded(res) { - var str = res.data; - doc = win = createDocumentByString(str); - if (!doc) { - logger.error("[Super-preloader]", 'Document object creation failed'); - removeL(); - return; - } - floatWO.updateColor('autopager'); - floatWO.CmodeIcon('hide'); - floatWO.loadedIcon('show'); - working = false; - scroll(); - } - function XHRNotLoaded(res) { - logger.error("[Super-preloader]", 'XHR is failed to be loaded'); - logger.error("[Super-preloader]", res); - removeL(); - } - function removeL(isRemoveAddPage) { - logger.debug("[Super-preloader]", 'Remove various event listeners'); - floatWO.updateColor('Astop'); - var _remove = remove; - for (var i = 0, ii = _remove.length; i < ii; i++) { - _remove[i](); - } - if (isRemoveAddPage) { - var separator = document.querySelector('.sp-separator'); - if (separator) { - var insertBefore = insertPoint; - if (insertMode == 2) { - var l = insertPoint.children.length; - if (l > 0) { - insertBefore = insertPoint.children[l - 1]; - } - } - var range = document.createRange(); - range.setStartBefore(separator); - range.setEndBefore(insertBefore); - range.deleteContents(); - range.detach(); - if (insertMode == 2) { - // 还需要额外移除? - insertPoint.removeChild(insertBefore); - } - } - var style = document.getElementById('Super_preloader-style'); - if (style) { - style.parentNode.removeChild(style); - } - } - } - if (isHashchangeSite && !hashchangeAdded) { - window.addEventListener('hashchange', onhashChange, false); - hashchangeAdded = true; - logger.debug("[Super-preloader]", 'Successfully added hashchange event'); - } - function onhashChange(event) { - logger.debug("[Super-preloader]", 'hashchange event triggered'); - removeL(true); - setTimeout(function () { - nextlinkElem = getElement(SSS.nextLink || 'auto;'); - nextlink = elemToHref(nextlinkElem); - // preLink = getElement(SSS.preLink || 'auto;'); - autopager(SSS, floatWO); - }, hashchangeTimer); - } - - /** @type {HTMLIFrameElement} */ - var iframe; - var messageR; - - /** - * Event handler of iframe loaded - * @param {IFrameLoadedEvent} event Iframe loaded event - * @returns {void} - */ - function iframeLoaded(event) { - var iframe = event.currentTarget; - var body = iframe.contentDocument.body; - if (body && body.firstChild) { - setTimeout(function () { - doc = iframe.contentDocument; - removeScripts(doc, SSS.a_scriptFilter); - win = iframe.contentWindow || doc; - floatWO.updateColor('autopager'); - floatWO.CmodeIcon('hide'); - floatWO.loadedIcon('show'); - working = false; - scroll(); - }, SSS.a_itimeout); - } - } - - /** - * Load next page in iframe - * @param {string} link Link of the next page - * @returns {void} - */ - function iframeRequest(link) { - messageR = false; - if (SSS.a_newIframe || !iframe) { - var insertLoc = null; - var i = document.createElement('iframe'); - iframe = i; - i.name = 'superpreloader-iframe'; - i.width = '100%'; - i.height = '0'; - i.frameBorder = '0'; - i.style.cssText = '\ + } + }); + document.body.appendChild(div); + noticeDiv = div; + } + clearTimeout(noticeDivto); + clearTimeout(noticeDivto2); + noticeDiv.innerHTML = html_txt; + noticeDiv.style.display = 'block'; + noticeDiv.style.opacity = '0.96'; + if (showTime === undefined) { + showTime = 1666; + } + if (showTime > 0) { + noticeDivto2 = setTimeout(function () { + noticeDiv.style.opacity = '0'; + }, showTime); + noticeDivto = setTimeout(function () { + noticeDiv.style.display = 'none'; + }, showTime + 300); + } + } + + var spcss = {}; //@ts-check + spcss["sp-separator"] = _wcImport4; + spcss["sp-prefs-spinner"] = _wcImport3; + spcss["sp-prefs-setup"] = _wcImport2; + spcss["sp-fw"] = _wcImport; + (function () { + // use charset from currentDocument + var gotConfig = { + html: true, + encoding: document.characterSet + }; + logger.setLevel('warn'); + + // `options.cookie`, dirty fix for older versions of TM and VM on Firefox + if (BROWSER.name === 'firefox') { + if (SCRIPT_MANAGER.name === 'Violentmonkey' && compareVersions(SCRIPT_MANAGER.version, '2.12.3') <= 0 || SCRIPT_MANAGER.name === 'Tampermonkey' && compareVersions(SCRIPT_MANAGER.version, '4.10.6103') < 0) { + logger.warn("[Super-preloader]", `${SCRIPT_MANAGER.name} v${SCRIPT_MANAGER.version} has a flaw with Firefox, which may affect this script`); + logger.warn("[Super-preloader]", 'Check https://github.com/Tampermonkey/tampermonkey/issues/786 and https://github.com/violentmonkey/violentmonkey/issues/606 to learn more'); + gotConfig.cookie = true; + } + } else if (SCRIPT_MANAGER.name === 'Tampermonkey' && BROWSER.name === 'safari') { + logger.warn("[Super-preloader]", `${SCRIPT_MANAGER.name} has a flaw with Safari, which may affect this script`); + logger.warn("[Super-preloader]", 'Check https://github.com/Tampermonkey/tampermonkey/issues/786 and https://github.com/violentmonkey/violentmonkey/issues/606 to learn more'); + gotConfig.cookie = true; + } + if (SCRIPT_MANAGER.name.toLowerCase().includes('adguard')) { + logger.warn("[Super-preloader]", `${SCRIPT_MANAGER.name} has issues with some specific like Google due to the way it injects script`); + } + var got = got$1.create(gotConfig); + var scriptInfo = SCRIPT_INFO; + + // ---------------------------------- + // all rules + /** @type {IRule[]} */ + var SSRules = []; + // ---------------------------------- + + // Check if we are looking at a file instead of a webpage + if ( + // : SVG Document + document.documentElement.matches('svg') || + // : plain text + // : Image + // : Audio and video + // : PDF (Chrome) + // body > #outerContainer:first-child + #printContainer:last-child: PDF (Firefox) + document.querySelector('body > pre:only-child, body > img:only-child, body > video:only-child, body > embed:only-child, body > #outerContainer:first-child + #printContainer:last-child')) { + return; + } + if (window.name === 'mynovelreader-iframe') { + return; + } + function CheckIframe() { + if (window.name === 'superpreloader-iframe') { + return true; + } else { + return false; + } + } + + // how to trigger lazy_load + // https://wiki.greasespot.net/Generate_Click_Events + if (CheckIframe()) { + // 搜狗,iframe里面怎么不加载js啊? + // 去掉了原版的另一种方法,因为新版本 chrome 已经支持。旧版本 chrome iframe里面 无法访问window.parent,返回undefined + var domLoaded = function domLoaded() { + //window.scroll(window.scrollX, 99999); + var mutationObserver = window.frameElement ? JSON.parse(window.frameElement.getAttribute('mutationObserver')) : null; + if (!mutationObserver) { + window.parent.postMessage('superpreloader-iframe:DOMLoaded', '*'); + } else { + var observers = mutationObserver.observers; + + /**@type {Promise} */ + var p = null; + /**@type {Array} */ + var parr = []; + if (observers) { + ['attributes', 'addedNodes', 'removedNodes'].forEach(function (key) { + var el = getAllElements(observers[key]); + if (el.length > 0) { + if (mutationObserver.relatedObj) { + //el.forEach((x) => { + // p.push(elementReady(x, key)); + //}); + parr.push(elementReady(el[el.length - 1], key)); + el[0].scrollIntoView(); + el[el.length - 1].scrollIntoView(); + } else { + parr.push(elementReady(el[el.length - 1], key)); + } + } + }); + } + if (p) { + p = Promise.all(parr); + } else { + p = Promise.resolve(undefined); + } + var timeout = mutationObserver.timeout && 0; + setTimeout(function () { + p.then(function (values) { + if (values) { + values.forEach(function (_ref) { + _ref.element; + _ref.type; + _ref.mutationList; + var observer = _ref.observer; + observer.disconnect(); + }); + } + //window.scrollTo(0, scrollLocation); + window.parent.postMessage('superpreloader-iframe:DOMLoaded', '*'); + }); + }, timeout); + } + }; + //@ts-ignore + if (window.opera) { + document.addEventListener('DOMContentLoaded', domLoaded, false); + } else { + domLoaded(); + } + return; + } + + // 在以下网站上允许在非顶层窗口上加载JS..比如猫扑之类的框架集网页. + var DIExclude = [['猫扑帖子', true, /^https?:\/\/dzh\.mop\.com\/[a-z]{3,6}\/\d{8}\/.*\.shtml$/i], ['铁血社区', true, /^https?:\/\/bbs\.tiexue\.net\/.*\.html$/i], ['铁血社区-2', true, /^https?:\/\/bbs\.qichelian\.com\/bbsqcl\.php\?fid/i], + // 像 http://so.baiduyun.me/ 内嵌的百度、Google 框架 + ['百度网盘搜索引擎-百度', true, /^https?:\/\/www\.baidu\.com\/baidu/i], ['百度网盘搜索引擎-Google', true, /^https?:\/\/74\.125\.128\.147\/custom/i]]; + + // 页面不刷新的站点 + var HashchangeSites = [{ + url: /^https?:\/\/(www|encrypted)\.google(stable)?\..{2,9}\/(webhp|#|$|\?)/, + timer: 2000, + mutationSelector: '#main' + }, + // 运营商可能会在 #wd= 前面添加 ?tn=07084049_pg + { + url: /^https?:\/\/www\.baidu\.com\/($|#wd=)/, + timer: 1000, + mutationSelector: '#wrapper_wrapper' + }, { + url: /^https?:\/\/www\.newsmth\.net/, + timer: 1000 + }]; + + // ///////// ----- End of Rules obtained from online json files -------/////////// + + // 分页导航的6个图标以及颜色设置: + var sep_icons = { + top: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNrclE0rRGEUx8c1GUpRJIVIZGdhZCVr38GGhaI0ZXwCkliglChZEcvJxhdgYWOjLEUpm/EyiLzze+o8dTzdO3PljoVTv7rPc8/5d+6555xYrEhWop6boda5+6l9wjWcWpF+WIbqCJJ9hFRcDr3QAIkIhKugz5PDfkSixkphz5aiAnqgE8rgWRxGoSOPyBkswQuUwyscw4HrmFCZL8Kt/JAg7mEFPEmo4FdPwk0BUcsdzIap0TQ8qMAPuICcEjLnd+VjSjcfJNgIc/DkZGSymYGsnK9EZMrxe4MFaNGiZjC2fT5zQ3p7QDK1dR2GSljziclAvRUe8nHYVA4jjvC43NfAuk/smB2QNqcsWxKcLbAKTFnS0hWD6n27Fd6FLqiDI5iQmQ9jpiVT0sNJ6aYd7dAE3QHBbinSAX5JWWaxuLo8F35jh/bBK9Y+/r/Cl6pLcnna8NvuDGMnslpbZRpXZYT/3r4EGACZL3ZL2afNFAAAAABJRU5ErkJggg==', + bottom: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXFJREFUeNrM1c8rBGEcx/FdtCEkLqYtpdwkKSUHUhxwITdK+Z3yM2cOLnJ39Cc44SgHScmJwlFxsIdlCScO6/2t76Onp52dXTtbnno1M8+Pz84+zzMzkcg/KA3oRTzM0A4cI4VTdIUVPIM3pPGO5aABJTkGx1BqjYmFFZxW7nnBwXmXogWX6bEGc2jEIU7+kNWDUSSwZyqndSvJ3N1g2Bm0oLtB2j+w7rQP4MpqXzRT0YRaPW/BthMedYLs60HsoE2vq9BsPwAJa8XFLUa0fUrvROo/saT1Q9adGimdlt8yj6TT6Q6d2vaida9YRbtP6EqmBZC5fHA6X+AAz1bwEc6cfk9+oaZM4NoZJL70+J2hTaZtNpet041zK8yP/Mgl+rOF1emr0UM1xnAfEPyISd0Jno6vtx+QuM6PZ22lpO7dbEV2Siv6rPeIjNs1HdYC7ixfG+YBqdTVDqPIv6iIWvO7iXGUFxAqi72PraJ9IH8EGACQcYjYRd5GHwAAAABJRU5ErkJggg==', + pre: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAASlJREFUeNpiYBjOoBiIrwJxFRAzUsvQViD+CMT/gfgTEPdRy9BPUENh+AsQ91JiaAuSS9HxZ3INb8Hi0v+UurwF6qL/ROBvQNxDrKFfkTT+A+JnQPwBKfJA/L9Ian7ic7kMEHcC8Q80F3UAcRsQv4by30INaUJT9weaWhSQDRUB4uVYvLkYiAWAOBopvEFBlArEPEA8G4ue9UAsATM4EYuCJUgKMtAMLoSKCwPxXCx6c1igClTQgmUZVPNrHMEGy3mgYCkCYiYgTkCSV4UZvA2IjYBYDIgvQbPvOyJTECid5wHxbyA2BuL3QLwRWYEsEJvg0IweFEU41IEMlgcxWJAEH0MxJeAsjMFEq6Jw+Br8BimVfMCTDEkG7EBcA8T3oWUJx4DVYwABBgCannnSzbgwIQAAAABJRU5ErkJggg==', + next: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT1JREFUeNrc1b1KA0EYheEl/iARFFEkKl6D0UK8CrEVrCwEexFCtBIlRWIjsfEiLL0FKzs7QUWxM2piFMUkvhPOwLAs2TGuCn7wkNll5jC7+w0Jgv9avdjAObbQn1TwCu7QwhWW4xakPIOHMKzxGCaSCm6ioXHLZ0Hqpz7KrwRPIvvNvBlM2zYyNY8cMjhDHo9fCBzErnIqKNjgRSxpvIABbOLes2MKWHfuXdhXcR2avKrJ4zGhI9gLhQbq9XaZgGO1kutIOzIHpKp7NawhjYOINSeY6lFwHacw17P6NTWHd4xqnNbcS83LObtsaCPbEW+gXUW8ODswC27xoOsn3ODDmfOGss9XLuE54jGjvPqGuuG1mFDzZIfdNHynnde7DbW1r5DwTstJHP2iE55YqD36ebXZDvr+7L/sU4ABAIpVZWnoA5GkAAAAAElFTkSuQmCC', + next_gray: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtxJREFUeNrclc9L2mEcx7/6NbVZqRVj7pIOlIUuZ1HMgv0BDcqT7JrskH13ELPBF7eTvz10HznWQBlBRIfBXIfBLmqXscvYZWPKrMNIU9Apmrr34/w6i0ovMZjw+H0+z/N8Xt+Pn/fn80hR/+WHYRhBIpFwRKPRz/F4/KnD4RB28xH0Ah4cHHyoUCjsIpFIIZPJHkml0m9Yfn2ZD78XcL1eH6rValIMCmMUtqKbD7/HbNQxaq15oxcH/lXpcmXgtnh2u/2mXC6/DqE+sSxLlUqlniE0TVPBYJAqFot6+GV9Pt+PJthms80sLS2xEonkhlgs/jgwMOBcXV3N5fP5rlCcp9bX1yWLi4uecrk8U6lUshDY3wRbLJYFGKZsNksq4N78/LwY9hOn05k5Ojqi+PzTGePxeFwZUl6vd8hkMvkPDg6sZJ2M5eXlr1wqUu2kA5JOpy2IAO+oO9fW1n5mMpk2nDjmcjkKNU25XC652Wx2pVIp65mXJ2nyjUPpqakpNZxuA8Y5T87OzsobjcYHpVKpGhsbe1CtVkXYqxQKhTdqtfqL1Wr1JpPJxxyU5Lq/vz8aCoX8TTDatYiFhF6vxx5tAJwm8OPj48m5ubmKSqUaAWwSa9eQw6JGo/luNBoNh4eHbAe0JhAINsLh8LNAIJCiudhxB+Qh2ludTifDAQLvI3AIch+Rkl8jJlrhCbOqgfoLmDepOF/BfGNra2sFFZFtvqgzMbFYjAiyp9Vqh4VC4cTJyYmQ90epIQJtHRO1bA5aRhAvdnZ2GI/H87cEz5YPgeOS2RsfHx9B7u+gOi68yQAtYX9zd3eXgZCna/s8By5ypGUUzhOISHgO9BfWXwG6chZ6IbiVc6LwnsFgGIVAepLzjk4rYW1ze3ubcbvd53fjZV2FaqGQ63fT09PDMO9i9BEoon0J9Rm/339xm3dr2f39fVLX7wFvoMVvoYWfRyIRFndD/Z/8nf0WYAA8EC1Z/ZNm4gAAAABJRU5ErkJggg==', + pre_gray: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAslJREFUeNrclTtMWmEUxz/uvTzlIUhpNMR0aGNjrNHSmHTqRJyadujQDbSGRwJUaYCmDizqUEw6ODVNGgbpYCfSpFINCQzFR9oyMXRsXFCsAXkIKNL/R7gGWxOsSdPEk5zc3O+e87vn+59zv0vIpbSJiQmyubn5LBKJpNbX11+4XC5Buxy2XYDNZiMOh2OW4ziPTCbTi8XikeHh4SsSieQTXnIxsN1uJ1ardVYgEDgPDw+V9Xqd1Go1Mcuyg7AuuVy+sra29ndgVEnGx8dnhEKhs1qtKgE/eXZ8fCzC+q3+/n6tSqVaSSQS5wM7nU5iMplmsF1XpVI5BeXt6OhIBFkGAe9SKpV/wNmzKjWbzRT6tFwuK86CUqPrkIVWPjQwMKBWKBSn4Ozv0LGxsRmRSDSFSjua0Do8TRWAS+B5+B68g/IhixCNvQPN1WjuieZsS/f1aNQ0wzBuaCqlUCQRtVr9Es1K4kVDWJNhrQjAIiqMlkqle804FnkjBoOhEzv4vrGxkW2ALRaLFrq+QoAV2nE8tLe3dzEYDE5vb2939vX1PcBkiKVSaQ1jForFYq+NRqMum83ebsYzmJq7sGu4xhkKxsDfB/AxnO860ev1oeXlZU8gEMgmk0kFqmw8o9dUKiWfn58vhMPh54h7S+OpQXNSLBYfejyeR1yzw9dbRon09PS8W11dnfL5fJl8Pk+0Wi3hk5vyCNBY4vV6f0Im9+joKJNOp818o8G70ah4aWnpIzSKYCa/dXd3B+PxuHNycjKzs7NzAms1+qFQy+VydDRz0WjUpdPp3tB8TFM0FAqFGxXPzc19plJrNJqraMoXt9tNt3Suc+Tg4ICeJfmFhQVLoVAwoKG7fr//B8cHAL6Fy9ZFDinaG/r5w77ya8y/OhEvKRhjtIup2YMTeBb3mXY53HnAmNkP+/v7NzHTTwAO4f79f/ud/RJgAOLcRNZqLojMAAAAAElFTkSuQmCC', + text_span_style: 'color:#595959!important;' + }; + + // 悬浮窗的状态颜色. + var FWKG_color = { + loading: '#8B00E8', + // 读取中状态 + prefetcher: '#5564AF', + // 预读状态 + autopager: '#038B00', + // 翻页状态 + Apause: '#B7B700', + // 翻页状态(暂停). + Astop: '#A00000', + // 翻页状态(停止)(翻页完成,或者被异常停止.)(无法再开启) + dot: '#00FF05' // 读取完后,会显示一个小点,那么小点的颜色. + }; + + // 上一页关键字 + var prePageKey = ['上一页', '上一頁', '上1页', '上1頁', '上页', '上頁', '翻上頁', '翻上页', '上一张', '上一張', '上一幅', '上一章', '上一节', '上一節', '上一篇', '前一页', '前一頁', '后退', '後退', '上篇', 'previous', 'previous Page', '前へ', '前のページ']; + + // 下一页关键字 + var nextPageKey = ['下一页', '下一頁', '下1页', '下1頁', '下页', '下页 ›', '下頁', '翻页', '翻頁', '翻下頁', '翻下页', '下一张', '下一張', '下一幅', '下一章', '下一节', '下一節', '下一篇', '前进', '下篇', '后页', '往后', 'Next', 'Next Page', '次へ', '次のページ', '次のページ »', '下一页 →', '下一頁 →', '下1页 →', '下1頁 →', '下页 →', '下頁 →', '翻页 →', '翻頁 →', '翻下頁 →', '翻下页 →', '下一张 →', '下一張 →', '下一幅 →', '下一章 →', '下一节 →', '下一節 →', '下一篇 →', '前进 →', '下篇 →', '后页 →', '往后 →', 'Next →', 'Next Page →', '次へ →', '次のページ →', '下一页 »', '下一頁 »', '下1页 »', '下1頁 »', '下页 »', '下頁 »', '翻页 »', '翻頁 »', '翻下頁 »', '翻下页 »', '下一张 »', '下一張 »', '下一幅 »', '下一章 »', '下一节 »', '下一節 »', '下一篇 »', '前进 »', '下篇 »', '后页 »', '往后 »', 'Next »', 'Next Page »', '次へ »', '后一页', '後一頁', '下一页 ›', '下一頁 ›', '下1页 ›', '下1頁 ›', '下頁 ›', '翻页 ›', '翻頁 ›', '翻下頁 ›', '翻下页 ›', '下一张 ›', '下一張 ›', '下一幅 ›', '下一章 ›', '下一节 ›', '下一節 ›', '下一篇 ›', '前进 ›', '下篇 ›', '后页 ›', '往后 ›', 'Next ›', 'Next >', 'Next Page ›', '次へ ›', '次のページ ›', '»', '→', '早期文章→']; + // THX to https://greasyfork.org/en/forum/discussion/39361/x + // 出在自动翻页信息附加显示真实相对页面信息,一般能智能识别出来。如果还有站点不能识别,可以把地址的特征字符串加到下面 + // 最好不要乱加,一些不规律的站点显示出来的数字也没有意义 + var REALPAGE_SITE_PATTERN = ['search?', 'search_', 'forum', 'thread']; + + // ------------------------下面的不要管他----------------- + /// //////////////////////////////////////////////////////////////// + // eslint-disable-next-line prettier/prettier + Promise.all([loadSettings(), getServerIp(location.hostname)]).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + values = _ref3[0], + serverIp = _ref3[1]; + var jsonRule = values.jsonRule; + var prefs = values.prefs, + SITEINFO_D = values.SITEINFO_D, + autoMatch = values.autoMatch; + values.version; + var blackList = values.blackList; + if (prefs.debug) { + logger.setLevel('debug'); + } else { + logger.setLevel(5); + } + logger.debug("[Super-preloader]", 'Script Manager: ', JSON.stringify({ + name: SCRIPT_MANAGER.name, + version: SCRIPT_MANAGER.version || 'unknown' + })); + logger.debug("[Super-preloader]", 'Browser: ', JSON.stringify(BROWSER)); + logger.debug("[Super-preloader]", `Server ip: ', ${serverIp}`); + var setup = function setup() { + var d = document; + + /** + * + * @param {string} s s + * @returns {HTMLInputElement} elem + */ + var $ = function $(s) { + // @ts-ignore + return d.getElementById('sp-prefs-' + s); + }; + if ($('setup')) return; + var styleNode = addStyle(spcss['sp-prefs-setup']); + if (prefs.customCSS.length > 0) { + addStyle(prefs.customCSS); + } + var div = d.createElement('div'); + div.id = 'sp-prefs-setup'; + div.style.position = 'fixed'; + if (prefs.FW_position !== 2) { + div.style.right = '38px'; + div.style.top = '20px'; + } else { + div.style.right = `${prefs.FW_offset[1]}px`; + div.style.top = `${prefs.FW_offset[0]}px`; + } + var nextUpdateDate = prefs.disableBuiltinSubscriptionRules ? 'N/A' : jsonRuleLoader.expire.toDateString(); + div.innerHTML = template['sp-prefs']({ + prefs, + scriptInfo, + nextUpdateDate: nextUpdateDate + }); + d.body.appendChild(div); + var close = function close() { + if (styleNode) { + styleNode.parentNode.removeChild(styleNode); + } + var div = $('setup'); + div.parentNode.removeChild(div); + }; + var on = function on(node, e, f) { + node.addEventListener(e, f, false); + }; + on($('ok'), 'click', function () { + Object.keys(factorySettings.prefs).forEach(function (key) { + var el = $(key); + if (el !== null) { + prefs[key] = getProperty(el); + } + }); + if (prefs.debug) { + logger.setLevel('debug'); + } else { + logger.setLevel(5); + } + autoMatch.keyMatch = !$('autoMatchKeyMatch').checked; + SITEINFO_D.useiframe = !!$('SITEINFO_D-useiframe').checked; + SITEINFO_D.autopager.enable = !!$('SITEINFO_D-a_enable').checked; + SITEINFO_D.autopager.force_enable = !!$('SITEINFO_D-a_force_enable').checked; + autoMatch.useiframe = SITEINFO_D.useiframe; + saveSettings({ + prefs, + SITEINFO_D, + autoMatch + }).then(function () { + SP.loadSetting(); + close(); + location.reload(); + }); + }); + on($('reset'), 'click', function () { + $('setup').innerHTML = template.spinner.reset; + addStyle(spcss['sp-prefs-spinner']); + resetSettings().then(function () { + location.reload(); + }); + }); + if (prefs.disableBuiltinSubscriptionRules) { + $('updaterule').setAttribute('disabled', ''); + } + on($('updaterule'), 'click', function () { + if (prefs.disableBuiltinSubscriptionRules) return; + $('setup').innerHTML = template.spinner.update; + addStyle(spcss['sp-prefs-spinner']); + jsonRuleLoader.updateRule(true).then(function () { + jsonRule = jsonRuleLoader.getRule(); + SP.loadSetting(); + close(); + location.reload(); + }); + }); + on($('cancel'), 'click', close); + $('debug').checked = logger.getLevel() === logger.levels.DEBUG; + $('ChineseUI').checked = prefs.ChineseUI; + $('floatWindow').checked = prefs.floatWindow; + $('enableHistory').checked = prefs.enableHistory; + // $('forceTargetWindow').checked = prefs.forceTargetWindow; + $('dblclick_pause').checked = prefs.dblclick_pause; + $('SITEINFO_D-useiframe').checked = SITEINFO_D.useiframe; + $('SITEINFO_D-a_enable').checked = SITEINFO_D.autopager.enable; + $('arrowKeyPage').checked = prefs.arrowKeyPage; + $('SITEINFO_D-a_force_enable').checked = SITEINFO_D.autopager.force_enable; + $('excludes').value = prefs.excludes; + $('custom_siteinfo').value = prefs.custom_siteinfo; + $('customCSS').value = prefs.customCSS; + $('disableBuiltinRules').checked = prefs.disableBuiltinRules; + $('disableBuiltinSubscriptionRules').checked = prefs.disableBuiltinSubscriptionRules; + $('autoMatchKeyMatch').checked = !autoMatch.keyMatch; + }; + + // main functions + var SP = { + spinit: function spinit() { + if (document.body.getAttribute('name') === 'MyNovelReader') { + return; + } + this.loadSetting(); + if (userLang === 'zh_CN') { + GM.registerMenuCommand('Super_preloaderPlus_one_New 设置', setup); + } else { + GM.registerMenuCommand('Super_preloaderPlus_one_New Settings', setup); + } + + // 查找是否是页面不刷新的站点 + var locationHref = location.href; + var hashSite = _find(HashchangeSites, function (x) { + return toRE(x.url).test(locationHref); + }); + if (hashSite) { + isHashchangeSite = true; + hashchangeTimer = hashSite.timer; + logger.debug("[Super-preloader]", 'This site does not refresh the page.', hashSite); + var p1 = new Promise(function (resolve, reject) { + setTimeout(resolve, hashchangeTimer); + }); + p1.then(function (values) { + init(window, document); + }); + } else { + init(window, document); + } + // 分辨率 高度 > 宽度 的是手机 + if (window.screen.height > window.screen.width) { + addStyle('div.sp-separator { min-width:auto !important; }'); + } + }, + loadSetting: function loadSetting() { + var a_enable = SITEINFO_D.autopager.enable; + if (a_enable !== undefined) { + SITEINFO_D.autopager.enable = a_enable; + } + var loadDblclickPause = function loadDblclickPause(reload) { + var dblclickPause = prefs.dblclick_pause; + if (dblclickPause) { + prefs.mouseA = false; + prefs.Pbutton = [0, 0, 0]; + } + if (reload) location.reload(); + }; + var loadCustomSiteInfo = function loadCustomSiteInfo() { + var userRules; + try { + // eslint-disable-next-line no-new-func + userRules = new Function('', 'return ' + prefs.custom_siteinfo)(); + } catch (e) { + logger.error("[Super-preloader]", 'Custom site rule error:', prefs.custom_siteinfo); + } + if (_isArray(userRules)) { + SSRules = SSRules.concat(userRules); + } + }; + loadDblclickPause(); + loadCustomSiteInfo(); + } + }; + SP.spinit(); + /** + * + * @param {Window} window window + * @param {Document} document document + * @returns {void} + */ + function init(window, document) { + var startTime = new Date(); + // eslint-disable-next-line valid-jsdoc + /**@type {(...rest:any[])=>void} */ + var nullFn = function nullFn() {}; // 空函数. + var url = document.location.href.replace(/#.*$/, ''); // url 去掉hash + var cplink = url; // 翻上来的最近的页面的url; + document.domain; // 取得域名. + var domain_port = url.match(/https?:\/\/([^\/]+)/)[1]; // 端口和域名,用来验证是否跨域. + + // 新加的,以示区别 + var remove = []; // 需要移除的事件 + + // 悬浮窗 + var floatWO = { + updateColor: nullFn, + loadedIcon: nullFn, + CmodeIcon: nullFn + }; + /** + * + * @param {IRuntimeRule} SSS a rule + * @returns {void} + */ + function floatWindow(SSS) { + // inject css + addStyle(spcss['sp-fw']); + + // create container + var div = document.createElement('div'); + div.id = 'sp-fw-container'; + div.innerHTML = template.floatWindow(); + document.body.appendChild(div); + + // helper function to get element + /** + * + * @param {string} id id + * @returns {HTMLInputElement} return + * */ + function $(id) { + //@ts-ignore + return document.getElementById(id); + } + var rect = $('sp-fw-rect'); // 悬浮窗的小正方形,用颜色描述当前的状态. + var spanel = $('sp-fw-content'); // 设置面板. + + // 设置面板显隐 + var spanelc = { + show: function show() { + spanel.style.display = 'block'; + }, + hide: function hide() { + spanel.style.display = 'none'; + } + }; + spanelc.hide(); + var rectt1, rectt2; + rect.addEventListener('mouseover', function (e) { + rectt1 = setTimeout(spanelc.show, 100); + }, false); + rect.addEventListener('mouseleave', function (e) { + clearTimeout(rectt1); + }, false); + div.addEventListener('mouseover', function (e) { + clearTimeout(rectt2); + }, false); + div.addEventListener('mouseleave', function (e) { + // Firefox bug + // https://stackoverflow.com/questions/46831247/select-triggers-mouseleave-event-on-parent-element-in-mozilla-firefox + if (e.relatedTarget === null) return; + rectt2 = setTimeout(spanelc.hide, 288); + }, false); + var dot = $('sp-fw-dot'); // 载入完成后,显示的小点 + dot.style.backgroundColor = FWKG_color.dot; + var cur_mode = $('sp-fw-cur-mode'); // 当载入状态时,用来描述当前是翻页模式,还是预读模式. + cur_mode.style.backgroundColor = SSS.a_enable ? FWKG_color.autopager : FWKG_color.prefetcher; + var a_enable = $('sp-fw-a_enable'); // 启用翻页模式 + var autopager_field = $('sp-fw-autopager-field'); // 翻页设置区域 + + // 预读设置 + var useiframe = $('sp-fw-useiframe'); + var viewcontent = $('sp-fw-viewcontent'); + + // 翻页设置 + var a_useiframe = $('sp-fw-a_useiframe'); + var a_iloaded = $('sp-fw-a_iloaded'); + var a_itimeout = $('sp-fw-a_itimeout'); + var a_manualA = $('sp-fw-a_manualA'); + var a_remain = $('sp-fw-a_remain'); + var a_maxpage = $('sp-fw-a_maxpage'); + var a_separator = $('sp-fw-a_separator'); + var a_ipages_0 = $('sp-fw-a_ipages_0'); + var a_ipages_1 = $('sp-fw-a_ipages_1'); + var a_force = $('sp-fw-a_force'); + + // newIframe 输入框的点击 + var a_newIframe = $('sp-fw-a_newIframe'); + a_newIframe.addEventListener('click', function () { + a_useiframe.checked = a_newIframe.checked; + }, false); + var a_starti = $('sp-fw-a_starti'); // 开始立即翻页 + a_starti.addEventListener('click', function (e) { + //@ts-ignore + if (e.currentTarget.disabled) return; + var value = parseInt(a_ipages_1.value); + if (isNaN(value) || value < 0) { + value = SSS.a_ipages[1]; + //@ts-ignore + a_ipages_1.value = value; + } + autoPO.startipages(value); + }, false); + + // 总开关 + var enable = $('sp-fw-enable'); + $('sp-fw-setup').addEventListener('click', setup, false); + + // 保存设置按钮. + var savebutton = $('sp-fw-savebutton'); + savebutton.addEventListener('click', function (e) { + var value = { + Rurl: SSS.Rurl, + useiframe: getProperty(useiframe), + viewcontent: getProperty(viewcontent), + enable: getProperty(enable) + }; + if (SSS.a_enable !== undefined) { + /** @type {(s:HTMLElement)=>number} */ + //@ts-ignore + var getPropertyNumber = getProperty; + value.a_enable = getProperty(a_enable) === 'autopager'; + value.a_useiframe = getProperty(a_useiframe); + value.a_newIframe = getProperty(a_newIframe); + value.a_iloaded = getProperty(a_iloaded); + value.a_manualA = getProperty(a_manualA); + value.a_force = getProperty(a_force); + var t_a_itimeout = getPropertyNumber(a_itimeout); + value.a_itimeout = isNaN(t_a_itimeout) ? SSS.a_itimeout : t_a_itimeout >= 0 ? t_a_itimeout : 0; + var t_a_remain = getPropertyNumber(a_remain); + value.a_remain = isNaN(t_a_remain) ? SSS.a_remain : Number(t_a_remain); + var t_a_maxpage = getPropertyNumber(a_maxpage); + value.a_maxpage = isNaN(t_a_maxpage) ? SSS.a_maxpage : t_a_maxpage >= 1 ? t_a_maxpage : 1; + var t_a_ipages_1 = getPropertyNumber(a_ipages_1); + value.a_ipages = [getProperty(a_ipages_0), isNaN(t_a_ipages_1) ? SSS.a_ipages[1] : t_a_ipages_1 >= 0 ? t_a_ipages_1 : 1]; + value.a_separator = getProperty(a_separator); + } + saveLocalSetting(value); + if (e.shiftKey ? !prefs.FW_RAS : prefs.FW_RAS) { + // 按住shift键,执行反向操作. + setTimeout(function () { + location.reload(); + }, 1); + } + }, false); + + // 载入翻页设置. + if (SSS.a_enable === undefined) { + // 未定义翻页功能. + a_enable.disabled = true; + autopager_field.style.display = 'none'; + } else { + setProperty(a_enable, SSS.a_enable ? 'autopager' : 'preloader'); + setProperty(a_useiframe, SSS.a_useiframe); + setProperty(a_newIframe, SSS.a_newIframe); + setProperty(a_iloaded, SSS.a_iloaded); + setProperty(a_itimeout, SSS.a_itimeout); + setProperty(a_manualA, SSS.a_manualA); + setProperty(a_force, SSS.a_force); + setProperty(a_remain, SSS.a_remain); + setProperty(a_maxpage, SSS.a_maxpage); + setProperty(a_separator, SSS.a_separator); + setProperty(a_ipages_0, SSS.a_ipages[0]); + setProperty(a_ipages_1, SSS.a_ipages[1]); + } + if (!SSS.a_enable) { + // 当前不是翻页模式,禁用立即翻页按钮. + a_starti.disabled = true; + } + if (!SSS.hasRule) { + // 如果没有高级规则,那么此项不允许操作. + a_force.disabled = true; + } + + // 载入预读设置. + setProperty(useiframe, SSS.useiframe); + setProperty(viewcontent, SSS.viewcontent); + + // 总开关 + setProperty(enable, SSS.enable); + var FWKG_state = { + loading: '读取中状态', + prefetcher: '预读状态', + autopager: '翻页状态', + Apause: '翻页状态(暂停)', + Astop: '翻页状态(停止)(翻页完成,或者被异常停止)(无法再开启)', + dot: '读取完后' + }; + if (userLang !== 'zh_CN') { + FWKG_state.loading = 'Loading'; + FWKG_state.prefetcher = 'Prefetching'; + FWKG_state.autopager = 'Autopagger (Running)'; + FWKG_state.Apause = 'Autopagger (Pause)'; + FWKG_state.Astop = 'Autopagger (Stop)'; + FWKG_state.dot = 'Finish loading'; + } + floatWO = { + updateColor: function updateColor(state) { + rect.style.backgroundColor = FWKG_color[state]; + rect.setAttribute('title', FWKG_state[state]); + }, + loadedIcon: function loadedIcon(command) { + dot.style.display = command == 'show' ? 'block' : 'none'; + }, + CmodeIcon: function CmodeIcon(command) { + cur_mode.style.display = command == 'show' ? 'block' : 'none'; + } + }; + var vertical = parseInt(prefs.FW_offset[0] + '', 10); + var horiz = parseInt(prefs.FW_offset[1] + '', 10); + var FW_position = prefs.FW_position; + + // 非opera用fixed定位. + div.style.position = 'fixed'; + switch (FW_position) { + case 1: + div.style.top = vertical + 'px'; + div.style.left = horiz + 'px'; + break; + case 2: + div.style.top = vertical + 'px'; + div.style.right = horiz + 'px'; + break; + case 3: + div.style.bottom = vertical + 'px'; + div.style.right = horiz + 'px'; + break; + case 4: + div.style.bottom = vertical + 'px'; + div.style.left = horiz + 'px'; + break; + } + } + function sp_transition(start, end) { + //@ts-ignore + var TweenF = sp_transition.TweenF; + if (!TweenF) { + TweenF = Tween[TweenM[prefs.s_method]]; + TweenF = TweenF[TweenEase[prefs.s_ease]] || TweenF; + //@ts-ignore + sp_transition.TweenF = TweenF; + } + var frameSpeed = 1000 / prefs.s_FPS; + var t = 0; // 次数,开始 + var b = start; // 开始 + var c = end - start; // 结束 + var d = Math.ceil(prefs.s_duration / frameSpeed); // 次数,结束 + + var x = window.scrollX; + function transition() { + var y = Math.ceil(TweenF(t, b, c, d)); + window.scroll(x, y); + if (t < d) { + t++; + setTimeout(transition, frameSpeed); + } + } + transition(); + } + function sepHandler(e) { + e.stopPropagation(); + var div = e.currentTarget; + var target = e.target; + function getRelativeDiv(which) { + var id = div.id; + id = id.replace(/(sp-separator-)(.+)/, function (a, b, c) { + return b + String(Number(c) + (which == 'pre' ? -1 : 1)); + }); + return id ? document.getElementById(id) : null; + } + function scrollIt(a, b) { + // a=a!==undefined? a : window.scrollY; + if (prefs.sepT) { + sp_transition(a, b); + } else { + window.scroll(window.scrollX, b); + } + } + var o_scrollY, divS; + switch (target.className) { + case 'sp-sp-gotop': + scrollIt(window.scrollY, 0); + break; + case 'sp-sp-gopre': + { + var prediv = getRelativeDiv('pre'); + if (!prediv) return; + o_scrollY = window.scrollY; + var preDS = prediv.getBoundingClientRect().top; + if (prefs.sepP) { + divS = div.getBoundingClientRect().top; + preDS = o_scrollY - (divS - preDS); + } else { + preDS += o_scrollY - 6; + } + scrollIt(o_scrollY, preDS); + break; + } + case 'sp-sp-gonext': + { + var nextdiv = getRelativeDiv('next'); + if (!nextdiv) return; + o_scrollY = window.scrollY; + var nextDS = nextdiv.getBoundingClientRect().top; + if (prefs.sepP) { + divS = div.getBoundingClientRect().top; + nextDS = o_scrollY + (-divS + nextDS); + } else { + nextDS += o_scrollY - 6; + } + scrollIt(o_scrollY, nextDS); + break; + } + case 'sp-sp-gobottom': + scrollIt(window.scrollY, Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)); + break; + } + } + + // autopager + var autoPO = { + /**@type {(value?:number)=>void} f*/ + startipages: nullFn + }; + var hashchangeAdded = false; + /** + * @param {IRuntimeRule} SSS a rule + * @param {*} floatWO float window object + * @returns {void} + */ + function autopager(SSS, floatWO) { + // return; + // 更新悬浮窗的颜色. + floatWO.updateColor('autopager'); + + // 获取插入位置节点. + var insertPoint; + var pageElement; + var insertMode; + if (SSS.a_HT_insert) { + insertPoint = getElement(SSS.a_HT_insert[0]); + insertMode = SSS.a_HT_insert[1]; + } else { + pageElement = getAllElements(SSS.a_pageElement, document, document, null, cplink); + if (pageElement.length > 0) { + var pELast = pageElement[pageElement.length - 1]; + insertPoint = pELast.nextSibling ? pELast.nextSibling : pELast.parentNode.appendChild(document.createTextNode(' ')); + } + insertMode = -1; + } + if (insertPoint) { + logger.debug("[Super-preloader]", 'Verify that the insertion position node can be found: success', insertPoint); + } else { + logger.error("[Super-preloader]", 'Verify that the insertion position node can be found: failed. JS execution stopped', SSS.a_HT_insert ? SSS.a_HT_insert[0] : ''); + floatWO.updateColor('Astop'); + return; + } + if (window.navigator.language != 'en') { + logger.debug("[Super-preloader]", 'Language: ', window.navigator.language); + } + if (pageElement === undefined) { + pageElement = getAllElements(SSS.a_pageElement); + } + if (pageElement.length > 0) { + logger.debug("[Super-preloader]", 'Verify that the main element can be found: success', pageElement); + } else { + logger.error("[Super-preloader]", 'Verify that the main element can be found: failure', SSS.a_pageElement); + floatWO.updateColor('Astop'); + return; + } + if (SSS.a_stylish) { + // 插入自定义样式 + addStyle(SSS.a_stylish, 'Super_preloader-style'); + } + + /** @type {Node} */ + var insertPointP; + if (insertMode != 2) { + insertPointP = insertPoint.parentNode; + } + var addIntoDoc; + if (insertMode == -1 || insertMode == 1) { + addIntoDoc = function addIntoDoc(obj) { + return insertPointP.insertBefore(obj, insertPoint); + }; + } else if (insertMode == 2) { + addIntoDoc = function addIntoDoc(obj) { + return insertPoint.appendChild(obj); + }; + } else if (insertMode == 0) { + addIntoDoc = function addIntoDoc(obj) { + return insertPointP.insertBefore(obj, insertPoint.nextSibling); + }; + } + + /** @type {HTMLDocument} */ + var doc, win; + function XHRLoaded(res) { + var str = res.data; + doc = win = createDocumentByString(str); + if (!doc) { + logger.error("[Super-preloader]", 'Document object creation failed'); + removeL(); + return; + } + floatWO.updateColor('autopager'); + floatWO.CmodeIcon('hide'); + floatWO.loadedIcon('show'); + working = false; + scroll(); + } + function XHRNotLoaded(res) { + logger.error("[Super-preloader]", 'XHR is failed to be loaded'); + logger.error("[Super-preloader]", res); + removeL(); + } + function removeL(isRemoveAddPage) { + logger.debug("[Super-preloader]", 'Remove various event listeners'); + floatWO.updateColor('Astop'); + var _remove = remove; + for (var i = 0, ii = _remove.length; i < ii; i++) { + _remove[i](); + } + if (isRemoveAddPage) { + var separator = document.querySelector('.sp-separator'); + if (separator) { + var insertBefore = insertPoint; + if (insertMode == 2) { + var l = insertPoint.children.length; + if (l > 0) { + insertBefore = insertPoint.children[l - 1]; + } + } + var range = document.createRange(); + range.setStartBefore(separator); + range.setEndBefore(insertBefore); + range.deleteContents(); + range.detach(); + if (insertMode == 2) { + // 还需要额外移除? + insertPoint.removeChild(insertBefore); + } + } + var style = document.getElementById('Super_preloader-style'); + if (style) { + style.parentNode.removeChild(style); + } + } + } + if (isHashchangeSite && !hashchangeAdded) { + window.addEventListener('hashchange', onhashChange, false); + hashchangeAdded = true; + logger.debug("[Super-preloader]", 'Successfully added hashchange event'); + } + function onhashChange(event) { + logger.debug("[Super-preloader]", 'hashchange event triggered'); + removeL(true); + setTimeout(function () { + nextlinkElem = getElement(SSS.nextLink || 'auto;'); + nextlink = elemToHref(nextlinkElem); + // preLink = getElement(SSS.preLink || 'auto;'); + autopager(SSS, floatWO); + }, hashchangeTimer); + } + + /** @type {HTMLIFrameElement} */ + var iframe; + var messageR; + + /** + * Event handler of iframe loaded + * @param {IFrameLoadedEvent} event Iframe loaded event + * @returns {void} + */ + function iframeLoaded(event) { + var iframe = event.currentTarget; + var body = iframe.contentDocument.body; + if (body && body.firstChild) { + setTimeout(function () { + doc = iframe.contentDocument; + removeScripts(doc, SSS.a_scriptFilter); + win = iframe.contentWindow || doc; + floatWO.updateColor('autopager'); + floatWO.CmodeIcon('hide'); + floatWO.loadedIcon('show'); + working = false; + scroll(); + }, SSS.a_itimeout); + } + } + + /** + * Load next page in iframe + * @param {string} link Link of the next page + * @returns {void} + */ + function iframeRequest(link) { + messageR = false; + if (SSS.a_newIframe || !iframe) { + var insertLoc = null; + var i = document.createElement('iframe'); + iframe = i; + i.name = 'superpreloader-iframe'; + i.width = '100%'; + i.height = '0'; + i.frameBorder = '0'; + i.style.cssText = '\ margin:0!important;\ padding:0!important;\ visibility:hidden!important;\ '; - if (SSS.a_sandbox != false) { - //sandbox is readonly property - //i.sandbox = SSS.a_sandbox; - i.setAttribute('sandbox', ''); - } - i.src = link; - if (SSS.a_mutationObserver) { - i.setAttribute('mutationObserver', JSON.stringify(SSS.a_mutationObserver)); - if (SSS.a_mutationObserver.relatedObj) { - insertLoc = getAllElements(SSS.a_mutationObserver.relatedObj); - if (insertLoc.length > 0) { - insertLoc = insertLoc[0]; - } else { - insertLoc = null; - } - } - } - if (SSS.a_iloaded) { - i.addEventListener('load', iframeLoaded, false); - remove.push(function () { - i.removeEventListener('load', iframeLoaded, false); - }); - } else { - var messagehandler = function messagehandler(e) { - if (!messageR && e.data == 'superpreloader-iframe:DOMLoaded') { - messageR = true; - iframeLoaded.call(i, { - currentTarget: i - }); - if (SSS.a_newIframe) { - window.removeEventListener('message', messagehandler, false); - } - } - }; - window.addEventListener('message', messagehandler, false); - remove.push(function () { - window.removeEventListener('message', messagehandler, false); - }); - } - if (insertLoc) { - insertLoc.parentNode.insertBefore(i, insertLoc); - } else { - document.body.appendChild(i); - } - } else { - iframe.src = link; - iframe.contentDocument.location.replace(link); - if (SSS.a_reload) { - iframe.contentWindow.location.reload(); - } - } - } - - /** - * Send XHR request to obtain next page content - * @param {string} link Link of next page - * @returns {void} - */ - function XHRrequest(link) { - var reqConf = { - headers: SSS.a_headers ? SSS.a_headers : { - Referer: cplink - } - }; - got.get(link, reqConf).then( - /** - * Handling of XHR request - * @param {ResponseObject} res Response of got - * @returns {void} - */ - function (res) { - if (res.finalUrl === cplink) { - logger.debug("[Super-preloader]", 'Same final address'); - XHRNotLoaded(res); - } else { - XHRLoaded(res); - logger.debug("[Super-preloader]", 'XHRrequest complete'); - } - }).catch( - /** - * Error handling of XHR request - * @param {ResponseObject} res Response of got - * @returns {void} - */ - function (res) { - XHRNotLoaded(res); - }); - } - var working; - function doRequest() { - working = true; - floatWO.updateColor('loading'); - floatWO.CmodeIcon('show'); - logger.debug("[Super-preloader]", 'Get next page', SSS.a_useiframe ? '(iframe method)' : '(XHR method)', nextlink); - pagedLinks.push(nextlink); - if (SSS.a_useiframe) { - iframeRequest(nextlink); - } else { - if (/(?:http|\/).*/.test(nextlink)) { - // request next page by XHR - XHRrequest(nextlink); - } else { - logger.error("[Super-preloader]", 'Lazyload or Invalid nextLinkElem', nextlinkElem); - } - } - } - var _SSS$a_ipages = _slicedToArray(SSS.a_ipages, 2), - _SSS$a_ipages$ = _SSS$a_ipages[0], - ipagesmode = _SSS$a_ipages$ === void 0 ? false : _SSS$a_ipages$, - _SSS$a_ipages$2 = _SSS$a_ipages[1], - ipagesnumber = _SSS$a_ipages$2 === void 0 ? 2 : _SSS$a_ipages$2; - if (ipagesmode && ipagesnumber === 0) { - ipagesnumber = Number.MAX_SAFE_INTEGER; - } - var scrollDo = nullFn; - var afterInsertDo = nullFn; - if (prefs.Aplus) { - afterInsertDo = doRequest; - doRequest(); - } else { - scrollDo = doRequest; - if (ipagesmode) doRequest(); - } - var manualDiv; - function manualAdiv() { - if (!manualDiv) { - addStyle(spcss['sp-separator']); - var spage = /*#__PURE__*/function () { - var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(el) { - var value; - return _regeneratorRuntime.wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - if (!doc) { - _context.next = 7; - break; - } - value = Number(el.value); - if (isNaN(value) || value < 1) { - el.value = value = 1; - } - ipagesmode = true; - ipagesnumber = value + paged; - _context.next = 7; - return insertedIntoDoc(); - case 7: - case "end": - return _context.stop(); - } - }, _callee); - })); - return function spage(_x) { - return _ref4.apply(this, arguments); - }; - }(); - var div = createDOM('div', { - attr: { - id: 'sp-sp-manualdiv', - class: 'sp-separator' - }, - children: [createDOM('span', { - attr: { - class: 'sp-md-span' - }, - innerHTML: userLang === 'zh_CN' ? '下' : 'Next' - }), createDOM('input', { - attr: { - type: 'number', - value: 1, - min: 1, - title: userLang === 'zh_CN' ? '输入你想要拼接的页数(必须>=1),然后按回车.' : 'Type number of pageringzing and press enter', - id: 'sp-sp-md-number' - }, - eventListener: [{ - type: 'keyup', - listener: function listener(e) { - if (e.keyCode == 13) { - // 回车 - spage(e.target); - } - } - }] - }), createDOM('span', { - attr: { - class: 'sp-md-span' - }, - innerHTML: userLang === 'zh_CN' ? '页' : 'page' - }), createDOM('img', { - attr: { - id: 'sp-sp-md-imgnext', - src: _sep_icons.next - } - }), createDOM('div', { - attr: { - class: 'sp-someinfo', - id: 'sp-separator-hover' - }, - children: [createDOM('a', { - attr: { - href: 'https://github.com/machsix/Super-preloader', - target: '_blank' - }, - innerHTML: 'Powered by Super-preloader' - })] - })] - }); - manualDiv = div; - document.body.appendChild(div); - div.addEventListener('click', function (e) { - //@ts-ignore - if (e.target.id === 'sp-sp-md-number') return; - spage(document.getElementById('sp-sp-md-number')).then(function () { - manualDiv.remove(); - }); - }, false); - } - addIntoDoc(manualDiv); - //manualDiv.style.display = "block"; - } - function beforeInsertIntoDoc() { - return _beforeInsertIntoDoc.apply(this, arguments); - } - function _beforeInsertIntoDoc() { - _beforeInsertIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() { - return _regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) switch (_context3.prev = _context3.next) { - case 0: - working = true; - if (!(SSS.a_manualA && !ipagesmode)) { - _context3.next = 6; - break; - } - // 显示手动翻页触发条. - logger.debug("[Super-preloader]", 'Manual stitching'); - manualAdiv(); - _context3.next = 9; - break; - case 6: - // 直接拼接. - logger.debug("[Super-preloader]", 'Direct stitching'); - _context3.next = 9; - return insertedIntoDoc(); - case 9: - case "end": - return _context3.stop(); - } - }, _callee3); - })); - return _beforeInsertIntoDoc.apply(this, arguments); - } - var sepStyle; - //looks like goNextImg is useless here. - //const goNextImg = [false]; - var sNumber = prefs.sepStartN; - var _sep_icons = sep_icons; - var curNumber = sNumber; - function createSep(lastUrl, currentUrl, nextUrl) { - var div = document.createElement('div'); - if (SSS.a_separator) { - if (!sepStyle) { - sepStyle = addStyle(spcss['sp-separator']); - if (prefs.customCSS.length > 0) addStyle(prefs.customCSS); - } - div.className = 'sp-separator'; - div.id = 'sp-separator-' + curNumber; - div.addEventListener('click', sepHandler, false); - var pageStr = ''; - if (userLang === 'zh_CN') { - pageStr = '第 ' + curNumber + ' 页' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); - } else { - pageStr = 'Page ' + curNumber + '' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); - } - div.appendChild(createDOM('a', { - attr: { - class: 'sp-sp-nextlink', - target: '_blank', - href: currentUrl, - title: currentUrl - }, - innerHTML: pageStr - })); - div.appendChild(createDOM('img', { - attr: { - src: _sep_icons.top, - class: 'sp-sp-gotop', - alt: userLang === 'zh_CN' ? '去到顶部' : 'To Top', - title: userLang === 'zh_CN' ? '去到顶部' : 'To Top' - } - })); - div.appendChild(createDOM('img', { - attr: { - src: curNumber == sNumber ? _sep_icons.pre_gray : _sep_icons.pre, - class: 'sp-sp-gopre', - title: userLang === 'zh_CN' ? '上滚一页' : 'Scroll up a page' - } - })); - var i_next = createDOM('img', { - attr: { - src: _sep_icons.next_gray, - class: 'sp-sp-gonext', - title: userLang === 'zh_CN' ? '下滚一页' : 'Scroll down a page' - } - }); - - //if (goNextImg.length == 2) { - // goNextImg.shift(); - //} - //goNextImg.push(i_next); - div.appendChild(i_next); - div.appendChild(createDOM('img', { - attr: { - src: _sep_icons.bottom, - class: 'sp-sp-gobottom', - alt: userLang === 'zh_CN' ? '去到底部' : 'To Bottom', - title: userLang === 'zh_CN' ? '去到底部' : 'To Bottom' - } - })); - div.appendChild(createDOM('div', { - attr: { - class: 'sp-someinfo', - id: 'sp-separator-hover' - }, - children: [createDOM('a', { - attr: { - href: 'https://github.com/machsix/Super-preloader', - target: '_blank' - }, - innerHTML: 'Powered by Super-preloader' - })] - })); - curNumber += 1; - } else { - div.style.cssText = '\ + if (SSS.a_sandbox != false) { + //sandbox is readonly property + //i.sandbox = SSS.a_sandbox; + i.setAttribute('sandbox', ''); + } + i.src = link; + if (SSS.a_mutationObserver) { + i.setAttribute('mutationObserver', JSON.stringify(SSS.a_mutationObserver)); + if (SSS.a_mutationObserver.relatedObj) { + insertLoc = getAllElements(SSS.a_mutationObserver.relatedObj); + if (insertLoc.length > 0) { + insertLoc = insertLoc[0]; + } else { + insertLoc = null; + } + } + } + if (SSS.a_iloaded) { + i.addEventListener('load', iframeLoaded, false); + remove.push(function () { + i.removeEventListener('load', iframeLoaded, false); + }); + } else { + var messagehandler = function messagehandler(e) { + if (!messageR && e.data == 'superpreloader-iframe:DOMLoaded') { + messageR = true; + iframeLoaded.call(i, { + currentTarget: i + }); + if (SSS.a_newIframe) { + window.removeEventListener('message', messagehandler, false); + } + } + }; + window.addEventListener('message', messagehandler, false); + remove.push(function () { + window.removeEventListener('message', messagehandler, false); + }); + } + if (insertLoc) { + insertLoc.parentNode.insertBefore(i, insertLoc); + } else { + document.body.appendChild(i); + } + } else { + iframe.src = link; + iframe.contentDocument.location.replace(link); + if (SSS.a_reload) { + iframe.contentWindow.location.reload(); + } + } + } + + /** + * Send XHR request to obtain next page content + * @param {string} link Link of next page + * @returns {void} + */ + function XHRrequest(link) { + var reqConf = { + headers: SSS.a_headers ? SSS.a_headers : { + Referer: cplink + } + }; + got.get(link, reqConf).then( + /** + * Handling of XHR request + * @param {ResponseObject} res Response of got + * @returns {void} + */ + function (res) { + if (res.finalUrl === cplink) { + logger.debug("[Super-preloader]", 'Same final address'); + XHRNotLoaded(res); + } else { + XHRLoaded(res); + logger.debug("[Super-preloader]", 'XHRrequest complete'); + } + }).catch( + /** + * Error handling of XHR request + * @param {ResponseObject} res Response of got + * @returns {void} + */ + function (res) { + XHRNotLoaded(res); + }); + } + var working; + function doRequest() { + working = true; + floatWO.updateColor('loading'); + floatWO.CmodeIcon('show'); + logger.debug("[Super-preloader]", 'Get next page', SSS.a_useiframe ? '(iframe method)' : '(XHR method)', nextlink); + pagedLinks.push(nextlink); + if (SSS.a_useiframe) { + iframeRequest(nextlink); + } else { + if (/(?:http|\/).*/.test(nextlink)) { + // request next page by XHR + XHRrequest(nextlink); + } else { + logger.error("[Super-preloader]", 'Lazyload or Invalid nextLinkElem', nextlinkElem); + } + } + } + var _SSS$a_ipages = _slicedToArray(SSS.a_ipages, 2), + _SSS$a_ipages$ = _SSS$a_ipages[0], + ipagesmode = _SSS$a_ipages$ === void 0 ? false : _SSS$a_ipages$, + _SSS$a_ipages$2 = _SSS$a_ipages[1], + ipagesnumber = _SSS$a_ipages$2 === void 0 ? 2 : _SSS$a_ipages$2; + if (ipagesmode && ipagesnumber === 0) { + ipagesnumber = Number.MAX_SAFE_INTEGER; + } + var scrollDo = nullFn; + var afterInsertDo = nullFn; + if (prefs.Aplus) { + afterInsertDo = doRequest; + doRequest(); + } else { + scrollDo = doRequest; + if (ipagesmode) doRequest(); + } + var manualDiv; + function manualAdiv() { + if (!manualDiv) { + addStyle(spcss['sp-separator']); + var spage = /*#__PURE__*/function () { + var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(el) { + var value; + return _regeneratorRuntime.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + if (!doc) { + _context.next = 7; + break; + } + value = Number(el.value); + if (isNaN(value) || value < 1) { + el.value = value = 1; + } + ipagesmode = true; + ipagesnumber = value + paged; + _context.next = 7; + return insertedIntoDoc(); + case 7: + case "end": + return _context.stop(); + } + }, _callee); + })); + return function spage(_x) { + return _ref4.apply(this, arguments); + }; + }(); + var div = createDOM('div', { + attr: { + id: 'sp-sp-manualdiv', + class: 'sp-separator' + }, + children: [createDOM('span', { + attr: { + class: 'sp-md-span' + }, + innerHTML: userLang === 'zh_CN' ? '下' : 'Next' + }), createDOM('input', { + attr: { + type: 'number', + value: 1, + min: 1, + title: userLang === 'zh_CN' ? '输入你想要拼接的页数(必须>=1),然后按回车.' : 'Type number of pageringzing and press enter', + id: 'sp-sp-md-number' + }, + eventListener: [{ + type: 'keyup', + listener: function listener(e) { + if (e.keyCode == 13) { + // 回车 + spage(e.target); + } + } + }] + }), createDOM('span', { + attr: { + class: 'sp-md-span' + }, + innerHTML: userLang === 'zh_CN' ? '页' : 'page' + }), createDOM('img', { + attr: { + id: 'sp-sp-md-imgnext', + src: _sep_icons.next + } + }), createDOM('div', { + attr: { + class: 'sp-someinfo', + id: 'sp-separator-hover' + }, + children: [createDOM('a', { + attr: { + href: 'https://github.com/machsix/Super-preloader', + target: '_blank' + }, + innerHTML: 'Powered by Super-preloader' + })] + })] + }); + manualDiv = div; + document.body.appendChild(div); + div.addEventListener('click', function (e) { + //@ts-ignore + if (e.target.id === 'sp-sp-md-number') return; + spage(document.getElementById('sp-sp-md-number')).then(function () { + manualDiv.remove(); + }); + }, false); + } + addIntoDoc(manualDiv); + //manualDiv.style.display = "block"; + } + function beforeInsertIntoDoc() { + return _beforeInsertIntoDoc.apply(this, arguments); + } + function _beforeInsertIntoDoc() { + _beforeInsertIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() { + return _regeneratorRuntime.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + working = true; + if (!(SSS.a_manualA && !ipagesmode)) { + _context3.next = 6; + break; + } + // 显示手动翻页触发条. + logger.debug("[Super-preloader]", 'Manual stitching'); + manualAdiv(); + _context3.next = 9; + break; + case 6: + // 直接拼接. + logger.debug("[Super-preloader]", 'Direct stitching'); + _context3.next = 9; + return insertedIntoDoc(); + case 9: + case "end": + return _context3.stop(); + } + }, _callee3); + })); + return _beforeInsertIntoDoc.apply(this, arguments); + } + var sepStyle; + //looks like goNextImg is useless here. + //const goNextImg = [false]; + var sNumber = prefs.sepStartN; + var _sep_icons = sep_icons; + var curNumber = sNumber; + function createSep(lastUrl, currentUrl, nextUrl) { + var div = document.createElement('div'); + if (SSS.a_separator) { + if (!sepStyle) { + sepStyle = addStyle(spcss['sp-separator']); + if (prefs.customCSS.length > 0) addStyle(prefs.customCSS); + } + div.className = 'sp-separator'; + div.id = 'sp-separator-' + curNumber; + div.addEventListener('click', sepHandler, false); + var pageStr = ''; + if (userLang === 'zh_CN') { + pageStr = '第 ' + curNumber + ' 页' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); + } else { + pageStr = 'Page ' + curNumber + '' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); + } + div.appendChild(createDOM('a', { + attr: { + class: 'sp-sp-nextlink', + target: '_blank', + href: currentUrl, + title: currentUrl + }, + innerHTML: pageStr + })); + div.appendChild(createDOM('img', { + attr: { + src: _sep_icons.top, + class: 'sp-sp-gotop', + alt: userLang === 'zh_CN' ? '去到顶部' : 'To Top', + title: userLang === 'zh_CN' ? '去到顶部' : 'To Top' + } + })); + div.appendChild(createDOM('img', { + attr: { + src: curNumber == sNumber ? _sep_icons.pre_gray : _sep_icons.pre, + class: 'sp-sp-gopre', + title: userLang === 'zh_CN' ? '上滚一页' : 'Scroll up a page' + } + })); + var i_next = createDOM('img', { + attr: { + src: _sep_icons.next_gray, + class: 'sp-sp-gonext', + title: userLang === 'zh_CN' ? '下滚一页' : 'Scroll down a page' + } + }); + + //if (goNextImg.length == 2) { + // goNextImg.shift(); + //} + //goNextImg.push(i_next); + div.appendChild(i_next); + div.appendChild(createDOM('img', { + attr: { + src: _sep_icons.bottom, + class: 'sp-sp-gobottom', + alt: userLang === 'zh_CN' ? '去到底部' : 'To Bottom', + title: userLang === 'zh_CN' ? '去到底部' : 'To Bottom' + } + })); + div.appendChild(createDOM('div', { + attr: { + class: 'sp-someinfo', + id: 'sp-separator-hover' + }, + children: [createDOM('a', { + attr: { + href: 'https://github.com/machsix/Super-preloader', + target: '_blank' + }, + innerHTML: 'Powered by Super-preloader' + })] + })); + curNumber += 1; + } else { + div.style.cssText = '\ height:0!important;\ width:0!important;\ margin:0!important;\ @@ -11249,415 +10777,415 @@ display:block!important;\ visibility:hidden!important;\ '; - } - return div; - } - var paged = 0; - function insertedIntoDoc() { - return _insertedIntoDoc.apply(this, arguments); - } // 返回,剩余高度是总高度的比值. - function _insertedIntoDoc() { - _insertedIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() { - var docTitle, fragment, pageElements, ii, lastUrl, nl, i, pe_x, pe_x_nn, nodes, nodes_x, imgs, arr, sepdiv, toInsert, insertParent, colNodes, _ncol, trs, _ncol2, oldE, oldE_lt, newE, newE_lt, oldE_x, newE_x, ev, delayiframe; - return _regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) switch (_context4.prev = _context4.next) { - case 0: - if (doc) { - _context4.next = 3; - break; - } - logger.error("[Super-preloader]", 'No document'); - return _context4.abrupt("return"); - case 3: - if (!SSS.a_documentFilter) { - _context4.next = 13; - break; - } - _context4.prev = 4; - _context4.next = 7; - return SSS.a_documentFilter(doc, typeof nextlink === 'string' && nextlink); - case 7: - logger.debug("[Super-preloader]", 'Successfully executeed documentFilter'); - _context4.next = 13; - break; - case 10: - _context4.prev = 10; - _context4.t0 = _context4["catch"](4); - logger.error("[Super-preloader]", 'Error executing documentFilter', _context4.t0, SSS.a_documentFilter.toString()); - case 13: - docTitle = getElementByCSS('title', doc).textContent; - fragment = document.createDocumentFragment(); - pageElements = getAllElements(SSS.a_pageElement, undefined, doc, win, typeof nextlink === 'string' && nextlink); - ii = pageElements.length; - if (!(ii <= 0)) { - _context4.next = 23; - break; - } - logger.error("[Super-preloader]", 'Failed to get the main content of the next page', SSS.a_pageElement); - removeL(); - return _context4.abrupt("return"); - case 23: - logger.debug("[Super-preloader]", 'Successfully got the main content of the next page', pageElements); - case 24: - // 提前查找下一页链接,后面再赋值 - lastUrl = cplink; - cplink = String(nextlink); - /** @type {HTMLElement | String} */ - nl = getElement(SSS.nextLink, undefined, doc, win); - if (nl) { - if (nl === nextlinkElem) { - nextlinkElem = null; - } else { - nextlinkElem = nl; - } - } else { - nextlinkElem = null; - } - nextlink = elemToHref(nextlinkElem); - // 有部分下一页的信息是在script中(比如新加的csdn的规则),因此先查找下一页信息,再执行 removeScripts - removeScripts(doc, SSS.a_scriptFilter); - i = 0; - case 31: - if (!(i < ii)) { - _context4.next = 40; - break; - } - pe_x = pageElements[i]; - pe_x_nn = pe_x.nodeName; - if (!(pe_x_nn == 'BODY' || pe_x_nn == 'HTML' || pe_x_nn == 'SCRIPT')) { - _context4.next = 36; - break; - } - return _context4.abrupt("continue", 37); - case 36: - fragment.appendChild(pe_x); - case 37: - i++; - _context4.next = 31; - break; - case 40: - if (SSS.filter && typeof SSS.filter === 'string') { - // 功能未完善. - nodes = []; - try { - nodes = getAllElements(SSS.filter, fragment); - } catch (e) {} - for (i = nodes.length - 1; i >= 0; i--) { - nodes_x = nodes[i]; - nodes_x.parentNode.removeChild(nodes_x); - } - } - - // lazyImgSrc - if (SSS.lazyImgSrc) { - handleLazyImgSrc(SSS.lazyImgSrc, fragment); - } - //@ts-ignore - if (!window.opera && SSS.a_useiframe && !SSS.a_iloaded) { - imgs = getAllElements('css;img[src]', fragment); // 收集所有图片 - } - - // 处理下一页内容部分链接是否新标签页打开 - if (prefs.forceTargetWindow) { - arr = Array.prototype.slice.call(fragment.querySelectorAll('a[href]:not([href^="mailto:"]):not([href^="javascript:"]):not([href^="#"])')); - arr.forEach(function (elem) { - elem.setAttribute('target', '_blank'); - if (elem.getAttribute('onclick') == 'atarget(this)') { - // 卡饭论坛的控制是否在新标签页打开 - elem.removeAttribute('onclick'); - } - }); - } - - /** @type {HTMLElement} */ - sepdiv = createSep(lastUrl, cplink, nextlink); - toInsert = sepdiv; - if (SSS.a_sepdivDom !== undefined && typeof SSS.a_sepdivDom === 'function') { - toInsert = SSS.a_sepdivDom(doc, sepdiv); - } else if (pageElements[0] && pageElements[0].tagName === 'TR' && pageElements[pageElements.length - 1].tagName === 'TR') { - insertParent = insertPoint.parentNode; - colNodes = getAllElements('child::tr[1]/child::*[self::td or self::th]', insertParent); - if (colNodes.length == 0) { - colNodes = getAllElements('child::*[self::td or self::th]', pageElements[0]); - } - _ncol = [].reduce.call(colNodes, function (acc, cur) { - return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); - }, 0); - toInsert = createDOM('tr', { - children: [createDOM('td', { - attr: { - colspan: _ncol - }, - children: [sepdiv] - })] - }); - } else if (pageElements[0] && pageElements[0].tagName === 'TBODY' && pageElements[pageElements.length - 1].tagName === 'TBODY') { - // https://bbs.kafan.cn/forum-8-1.html - trs = pageElements[pageElements.length - 1].getElementsByTagName('tr'); - if (trs) { - _ncol2 = [].reduce.call(trs[trs.length - 1].children, function (acc, cur) { - return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); - }, 0); - toInsert = createDOM('tbody', { - children: [createDOM('tr', { - children: [createDOM('td', { - attr: { - colspan: _ncol2 - }, - children: [sepdiv] - })] - })] - }); - } else { - logger.warn("[Super-preloader]", 'No trs found'); - } - } - fragment.insertBefore(toInsert, fragment.firstChild); - addIntoDoc(fragment); - - // filter - if (SSS.filter && typeof SSS.filter === 'function') { - try { - SSS.filter(pageElements); - logger.debug("[Super-preloader]", 'Execution of filter(pages) succeeded'); - } catch (e) { - logger.error("[Super-preloader]", 'Error executing filter(pages)', e, SSS.filter.toString()); - } - } - if (imgs) { - // 非opera,在iframeDOM取出数据时需要重载图片. - setTimeout(function () { - var _imgs = imgs; - var i, ii, img; - for (i = 0, ii = _imgs.length; i < ii; i++) { - img = _imgs[i]; - var src = img.src; - img.src = src; - } - }, 99); - } - if (SSS.a_replaceE) { - oldE = getAllElements(SSS.a_replaceE); - oldE_lt = oldE.length; - if (oldE_lt > 0) { - newE = getAllElements(SSS.a_replaceE, undefined, doc, win); - newE_lt = newE.length; - if (newE_lt == oldE_lt) { - // 替换 - - for (i = 0; i < newE_lt; i++) { - oldE_x = oldE[i]; - newE_x = newE[i]; - newE_x = doc.importNode(newE_x, true); - oldE_x.parentNode.replaceChild(newE_x, oldE_x); - } - } - } - } - paged += 1; - if (ipagesmode && paged >= ipagesnumber) { - ipagesmode = false; - } - floatWO.loadedIcon('hide'); - if (manualDiv) { - manualDiv.style.display = 'none'; - } - //if (goNextImg[0]) goNextImg[0].src = _sep_icons.next; - ev = document.createEvent('Event'); - ev.initEvent('Super_preloaderPageLoaded', true, false); - document.dispatchEvent(ev); - if (prefs.enableHistory) { - try { - window.history.pushState(null, docTitle, cplink); - } catch (e) {} - } - if (!(paged >= SSS.a_maxpage)) { - _context4.next = 66; - break; - } - logger.debug("[Super-preloader]", `Reached the set maximum number of page turns ${SSS.a_maxpage}`); - notice('Status:' + 'Reached the set maximum number of page turns:' + SSS.a_maxpage + ''); - removeL(); - return _context4.abrupt("return"); - case 66: - delayiframe = function delayiframe(fn) { - setTimeout(fn, 199); - }; - if (nextlink && !pagedLinks.includes(nextlink)) { - // debug('Found the next page link:', nextlink); - doc = win = null; - if (ipagesmode) { - if (SSS.a_useiframe) { - // 延时点,firefox,太急会卡-_-! - delayiframe(doRequest); - } else { - doRequest(); - } - } else { - working = false; - if (SSS.a_useiframe) { - delayiframe(afterInsertDo); - } else { - afterInsertDo(); - } - } - } else { - logger.error("[Super-preloader]", 'No next page link found.', SSS.nextLink); - removeL(); - } - case 68: - case "end": - return _context4.stop(); - } - }, _callee4, null, [[4, 10]]); - })); - return _insertedIntoDoc.apply(this, arguments); - } - var relatedObj_0, relatedObj_1; - if (SSS.a_relatedObj) { - if (_isArray(SSS.a_relatedObj)) { - relatedObj_0 = SSS.a_relatedObj[0]; - relatedObj_1 = SSS.a_relatedObj[1]; - } else { - relatedObj_0 = SSS.a_pageElement; - relatedObj_1 = 'bottom'; - } - } - function getRemain() { - var _cplink = cplink || undefined; - var scrolly = window.scrollY; - var windowHeight = window.innerHeight; - document.body.clientHeight; - var obj = getLastVisibleElement(relatedObj_0, _cplink); - var scrollH = obj && obj.nodeType == 1 ? obj.getBoundingClientRect()[relatedObj_1] + scrolly : Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); - var exElementHeight = 0; - if (SSS.a_excludeElement != undefined) { - var exElementNode = getLastVisibleElement(SSS.a_excludeElement, _cplink); - if (exElementNode !== null) { - exElementHeight = exElementNode.offsetHeight; - } - } - return (scrollH - scrolly - windowHeight - exElementHeight) / windowHeight; // 剩余高度于页面总高度的比例. - } - var pause = false; - if (prefs.pauseA) { - var Sbutton = ['target', 'shiftKey', 'ctrlKey', 'altKey']; - var ltype = prefs.mouseA ? 'mousedown' : 'dblclick'; - var button_1 = Sbutton[prefs.Pbutton[0]]; - var button_2 = Sbutton[prefs.Pbutton[1]]; - var button_3 = Sbutton[prefs.Pbutton[2]]; - var pauseIt = function pauseIt() { - pause = !pause; - if (prefs.stop_ipage) ipagesmode = false; - if (pause) { - floatWO.updateColor('Apause'); - if (userLang === 'zh_CN') { - notice('状态:' + '自动翻页 暂停.', prefs.disappearDelay); - } else { - notice('Status:' + 'Autopagger Pause.', prefs.disappearDelay); - } - } else { - floatWO.updateColor('autopager'); - floatWO.CmodeIcon('hide'); - if (userLang === 'zh_CN') { - notice('状态:' + '自动翻页 启用.'); - } else { - notice('Status:' + 'Autopagger Enable.'); - } - } - scroll(); - }; - var Sctimeout; - var clearPause = function clearPause() { - clearTimeout(Sctimeout); - document.removeEventListener('mouseup', clearPause, false); - }; - var pausehandler = function pausehandler(e) { - if (!SSS.a_manualA || ipagesmode) { - if (e[button_1] && e[button_2] && e[button_3]) { - if (e.type == 'mousedown') { - document.addEventListener('mouseup', clearPause, false); - Sctimeout = setTimeout(pauseIt, prefs.Atimeout); - } else { - pauseIt(); - } - } - } - }; - document.addEventListener(ltype, pausehandler, false); - remove.push(function () { - document.removeEventListener(ltype, pausehandler, false); - }); - } - function scroll() { - if (!pause && !working && (getRemain() <= SSS.a_remain || ipagesmode)) { - if (doc) { - // 有的话,就插入到文档. - beforeInsertIntoDoc(); - } else { - // 否则就请求文档. - scrollDo(); - } - } - } - var timeout; - function timeoutfn() { - clearTimeout(timeout); - timeout = setTimeout(scroll, 100); - } - window.addEventListener('scroll', timeoutfn, false); - remove.push(function () { - window.removeEventListener('scroll', timeoutfn, false); - }); - autoPO = { - startipages: function () { - var _startipages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) { - return _regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - if (!(value > 0)) { - _context2.next = 8; - break; - } - ipagesmode = true; - ipagesnumber = value + paged; - notice('Status:' + 'Current number of pages turned: ' + paged + ',' + 'Continue to turn page ' + ipagesnumber + ''); - if (!SSS.a_manualA) { - _context2.next = 7; - break; - } - _context2.next = 7; - return insertedIntoDoc(); - case 7: - scroll(); - case 8: - case "end": - return _context2.stop(); - } - }, _callee2); - })); - function startipages(_x2) { - return _startipages.apply(this, arguments); - } - return startipages; - }() - }; - } - - /** - * prefetcher - * @param {IRuntimeRule} SSS a rule - * @param {*} floatWO float window object - * @returns {void} - */ - function prefetcher(SSS, floatWO) { - function cContainer() { - var div = document.createElement('div'); - /** @type {HTMLElement} */ - //@ts-ignore - var div2 = div.cloneNode(false); - var hr = document.createElement('hr'); - div.style.cssText = '\ + } + return div; + } + var paged = 0; + function insertedIntoDoc() { + return _insertedIntoDoc.apply(this, arguments); + } // 返回,剩余高度是总高度的比值. + function _insertedIntoDoc() { + _insertedIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() { + var docTitle, fragment, pageElements, ii, lastUrl, nl, i, pe_x, pe_x_nn, nodes, nodes_x, imgs, arr, sepdiv, toInsert, insertParent, colNodes, _ncol, trs, _ncol2, oldE, oldE_lt, newE, newE_lt, oldE_x, newE_x, ev, delayiframe; + return _regeneratorRuntime.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (doc) { + _context4.next = 3; + break; + } + logger.error("[Super-preloader]", 'No document'); + return _context4.abrupt("return"); + case 3: + if (!SSS.a_documentFilter) { + _context4.next = 13; + break; + } + _context4.prev = 4; + _context4.next = 7; + return SSS.a_documentFilter(doc, typeof nextlink === 'string' && nextlink); + case 7: + logger.debug("[Super-preloader]", 'Successfully executeed documentFilter'); + _context4.next = 13; + break; + case 10: + _context4.prev = 10; + _context4.t0 = _context4["catch"](4); + logger.error("[Super-preloader]", 'Error executing documentFilter', _context4.t0, SSS.a_documentFilter.toString()); + case 13: + docTitle = getElementByCSS('title', doc).textContent; + fragment = document.createDocumentFragment(); + pageElements = getAllElements(SSS.a_pageElement, undefined, doc, win, typeof nextlink === 'string' && nextlink); + ii = pageElements.length; + if (!(ii <= 0)) { + _context4.next = 23; + break; + } + logger.error("[Super-preloader]", 'Failed to get the main content of the next page', SSS.a_pageElement); + removeL(); + return _context4.abrupt("return"); + case 23: + logger.debug("[Super-preloader]", 'Successfully got the main content of the next page', pageElements); + case 24: + // 提前查找下一页链接,后面再赋值 + lastUrl = cplink; + cplink = String(nextlink); + /** @type {HTMLElement | String} */ + nl = getElement(SSS.nextLink, undefined, doc, win); + if (nl) { + if (nl === nextlinkElem) { + nextlinkElem = null; + } else { + nextlinkElem = nl; + } + } else { + nextlinkElem = null; + } + nextlink = elemToHref(nextlinkElem); + // 有部分下一页的信息是在script中(比如新加的csdn的规则),因此先查找下一页信息,再执行 removeScripts + removeScripts(doc, SSS.a_scriptFilter); + i = 0; + case 31: + if (!(i < ii)) { + _context4.next = 40; + break; + } + pe_x = pageElements[i]; + pe_x_nn = pe_x.nodeName; + if (!(pe_x_nn == 'BODY' || pe_x_nn == 'HTML' || pe_x_nn == 'SCRIPT')) { + _context4.next = 36; + break; + } + return _context4.abrupt("continue", 37); + case 36: + fragment.appendChild(pe_x); + case 37: + i++; + _context4.next = 31; + break; + case 40: + if (SSS.filter && typeof SSS.filter === 'string') { + // 功能未完善. + nodes = []; + try { + nodes = getAllElements(SSS.filter, fragment); + } catch (e) {} + for (i = nodes.length - 1; i >= 0; i--) { + nodes_x = nodes[i]; + nodes_x.parentNode.removeChild(nodes_x); + } + } + + // lazyImgSrc + if (SSS.lazyImgSrc) { + handleLazyImgSrc(SSS.lazyImgSrc, fragment); + } + //@ts-ignore + if (!window.opera && SSS.a_useiframe && !SSS.a_iloaded) { + imgs = getAllElements('css;img[src]', fragment); // 收集所有图片 + } + + // 处理下一页内容部分链接是否新标签页打开 + if (prefs.forceTargetWindow) { + arr = Array.prototype.slice.call(fragment.querySelectorAll('a[href]:not([href^="mailto:"]):not([href^="javascript:"]):not([href^="#"])')); + arr.forEach(function (elem) { + elem.setAttribute('target', '_blank'); + if (elem.getAttribute('onclick') == 'atarget(this)') { + // 卡饭论坛的控制是否在新标签页打开 + elem.removeAttribute('onclick'); + } + }); + } + + /** @type {HTMLElement} */ + sepdiv = createSep(lastUrl, cplink, nextlink); + toInsert = sepdiv; + if (SSS.a_sepdivDom !== undefined && typeof SSS.a_sepdivDom === 'function') { + toInsert = SSS.a_sepdivDom(doc, sepdiv); + } else if (pageElements[0] && pageElements[0].tagName === 'TR' && pageElements[pageElements.length - 1].tagName === 'TR') { + insertParent = insertPoint.parentNode; + colNodes = getAllElements('child::tr[1]/child::*[self::td or self::th]', insertParent); + if (colNodes.length == 0) { + colNodes = getAllElements('child::*[self::td or self::th]', pageElements[0]); + } + _ncol = [].reduce.call(colNodes, function (acc, cur) { + return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); + }, 0); + toInsert = createDOM('tr', { + children: [createDOM('td', { + attr: { + colspan: _ncol + }, + children: [sepdiv] + })] + }); + } else if (pageElements[0] && pageElements[0].tagName === 'TBODY' && pageElements[pageElements.length - 1].tagName === 'TBODY') { + // https://bbs.kafan.cn/forum-8-1.html + trs = pageElements[pageElements.length - 1].getElementsByTagName('tr'); + if (trs) { + _ncol2 = [].reduce.call(trs[trs.length - 1].children, function (acc, cur) { + return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); + }, 0); + toInsert = createDOM('tbody', { + children: [createDOM('tr', { + children: [createDOM('td', { + attr: { + colspan: _ncol2 + }, + children: [sepdiv] + })] + })] + }); + } else { + logger.warn("[Super-preloader]", 'No trs found'); + } + } + fragment.insertBefore(toInsert, fragment.firstChild); + addIntoDoc(fragment); + + // filter + if (SSS.filter && typeof SSS.filter === 'function') { + try { + SSS.filter(pageElements); + logger.debug("[Super-preloader]", 'Execution of filter(pages) succeeded'); + } catch (e) { + logger.error("[Super-preloader]", 'Error executing filter(pages)', e, SSS.filter.toString()); + } + } + if (imgs) { + // 非opera,在iframeDOM取出数据时需要重载图片. + setTimeout(function () { + var _imgs = imgs; + var i, ii, img; + for (i = 0, ii = _imgs.length; i < ii; i++) { + img = _imgs[i]; + var src = img.src; + img.src = src; + } + }, 99); + } + if (SSS.a_replaceE) { + oldE = getAllElements(SSS.a_replaceE); + oldE_lt = oldE.length; + if (oldE_lt > 0) { + newE = getAllElements(SSS.a_replaceE, undefined, doc, win); + newE_lt = newE.length; + if (newE_lt == oldE_lt) { + // 替换 + + for (i = 0; i < newE_lt; i++) { + oldE_x = oldE[i]; + newE_x = newE[i]; + newE_x = doc.importNode(newE_x, true); + oldE_x.parentNode.replaceChild(newE_x, oldE_x); + } + } + } + } + paged += 1; + if (ipagesmode && paged >= ipagesnumber) { + ipagesmode = false; + } + floatWO.loadedIcon('hide'); + if (manualDiv) { + manualDiv.style.display = 'none'; + } + //if (goNextImg[0]) goNextImg[0].src = _sep_icons.next; + ev = document.createEvent('Event'); + ev.initEvent('Super_preloaderPageLoaded', true, false); + document.dispatchEvent(ev); + if (prefs.enableHistory) { + try { + window.history.pushState(null, docTitle, cplink); + } catch (e) {} + } + if (!(paged >= SSS.a_maxpage)) { + _context4.next = 66; + break; + } + logger.debug("[Super-preloader]", `Reached the set maximum number of page turns ${SSS.a_maxpage}`); + notice('Status:' + 'Reached the set maximum number of page turns:' + SSS.a_maxpage + ''); + removeL(); + return _context4.abrupt("return"); + case 66: + delayiframe = function delayiframe(fn) { + setTimeout(fn, 199); + }; + if (nextlink && !pagedLinks.includes(nextlink)) { + // debug('Found the next page link:', nextlink); + doc = win = null; + if (ipagesmode) { + if (SSS.a_useiframe) { + // 延时点,firefox,太急会卡-_-! + delayiframe(doRequest); + } else { + doRequest(); + } + } else { + working = false; + if (SSS.a_useiframe) { + delayiframe(afterInsertDo); + } else { + afterInsertDo(); + } + } + } else { + logger.error("[Super-preloader]", 'No next page link found.', SSS.nextLink); + removeL(); + } + case 68: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[4, 10]]); + })); + return _insertedIntoDoc.apply(this, arguments); + } + var relatedObj_0, relatedObj_1; + if (SSS.a_relatedObj) { + if (_isArray(SSS.a_relatedObj)) { + relatedObj_0 = SSS.a_relatedObj[0]; + relatedObj_1 = SSS.a_relatedObj[1]; + } else { + relatedObj_0 = SSS.a_pageElement; + relatedObj_1 = 'bottom'; + } + } + function getRemain() { + var _cplink = cplink || undefined; + var scrolly = window.scrollY; + var windowHeight = window.innerHeight; + document.body.clientHeight; + var obj = getLastVisibleElement(relatedObj_0, _cplink); + var scrollH = obj && obj.nodeType == 1 ? obj.getBoundingClientRect()[relatedObj_1] + scrolly : Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); + var exElementHeight = 0; + if (SSS.a_excludeElement != undefined) { + var exElementNode = getLastVisibleElement(SSS.a_excludeElement, _cplink); + if (exElementNode !== null) { + exElementHeight = exElementNode.offsetHeight; + } + } + return (scrollH - scrolly - windowHeight - exElementHeight) / windowHeight; // 剩余高度于页面总高度的比例. + } + var pause = false; + if (prefs.pauseA) { + var Sbutton = ['target', 'shiftKey', 'ctrlKey', 'altKey']; + var ltype = prefs.mouseA ? 'mousedown' : 'dblclick'; + var button_1 = Sbutton[prefs.Pbutton[0]]; + var button_2 = Sbutton[prefs.Pbutton[1]]; + var button_3 = Sbutton[prefs.Pbutton[2]]; + var pauseIt = function pauseIt() { + pause = !pause; + if (prefs.stop_ipage) ipagesmode = false; + if (pause) { + floatWO.updateColor('Apause'); + if (userLang === 'zh_CN') { + notice('状态:' + '自动翻页 暂停.', prefs.disappearDelay); + } else { + notice('Status:' + 'Autopagger Pause.', prefs.disappearDelay); + } + } else { + floatWO.updateColor('autopager'); + floatWO.CmodeIcon('hide'); + if (userLang === 'zh_CN') { + notice('状态:' + '自动翻页 启用.'); + } else { + notice('Status:' + 'Autopagger Enable.'); + } + } + scroll(); + }; + var Sctimeout; + var clearPause = function clearPause() { + clearTimeout(Sctimeout); + document.removeEventListener('mouseup', clearPause, false); + }; + var pausehandler = function pausehandler(e) { + if (!SSS.a_manualA || ipagesmode) { + if (e[button_1] && e[button_2] && e[button_3]) { + if (e.type == 'mousedown') { + document.addEventListener('mouseup', clearPause, false); + Sctimeout = setTimeout(pauseIt, prefs.Atimeout); + } else { + pauseIt(); + } + } + } + }; + document.addEventListener(ltype, pausehandler, false); + remove.push(function () { + document.removeEventListener(ltype, pausehandler, false); + }); + } + function scroll() { + if (!pause && !working && (getRemain() <= SSS.a_remain || ipagesmode)) { + if (doc) { + // 有的话,就插入到文档. + beforeInsertIntoDoc(); + } else { + // 否则就请求文档. + scrollDo(); + } + } + } + var timeout; + function timeoutfn() { + clearTimeout(timeout); + timeout = setTimeout(scroll, 100); + } + window.addEventListener('scroll', timeoutfn, false); + remove.push(function () { + window.removeEventListener('scroll', timeoutfn, false); + }); + autoPO = { + startipages: function () { + var _startipages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) { + return _regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(value > 0)) { + _context2.next = 8; + break; + } + ipagesmode = true; + ipagesnumber = value + paged; + notice('Status:' + 'Current number of pages turned: ' + paged + ',' + 'Continue to turn page ' + ipagesnumber + ''); + if (!SSS.a_manualA) { + _context2.next = 7; + break; + } + _context2.next = 7; + return insertedIntoDoc(); + case 7: + scroll(); + case 8: + case "end": + return _context2.stop(); + } + }, _callee2); + })); + function startipages(_x2) { + return _startipages.apply(this, arguments); + } + return startipages; + }() + }; + } + + /** + * prefetcher + * @param {IRuntimeRule} SSS a rule + * @param {*} floatWO float window object + * @returns {void} + */ + function prefetcher(SSS, floatWO) { + function cContainer() { + var div = document.createElement('div'); + /** @type {HTMLElement} */ + //@ts-ignore + var div2 = div.cloneNode(false); + var hr = document.createElement('hr'); + div.style.cssText = '\ margin:3px!important;\ padding:5px!important;\ border-radius:8px!important;\ @@ -11668,8 +11196,8 @@ float:none!important;\ display:none!important;\ '; - div.title = 'Prefetched content'; - div2.style.cssText = '\ + div.title = 'Prefetched content'; + div2.style.cssText = '\ text-align:left!important;\ color:red!important;\ font-size:13px!important;\ @@ -11677,1163 +11205,1163 @@ display:block!important;\ position:static!important;\ '; - hr.style.cssText = '\ + hr.style.cssText = '\ display:block!important;\ border:1px inset #000!important;\ '; - div.appendChild(div2); - div.appendChild(hr); - document.body.appendChild(div); - return { - div: div, - div2: div2 - }; - } - floatWO.updateColor('prefetcher'); - floatWO.updateColor('loading'); - floatWO.CmodeIcon('show'); - if (SSS.useiframe) { - var iframe = document.createElement('iframe'); - iframe.name = 'superpreloader-iframe'; - iframe.src = String(nextlink); - iframe.width = '100%'; - iframe.height = '0'; - iframe.frameBorder = '0'; - iframe.style.cssText = '\ + div.appendChild(div2); + div.appendChild(hr); + document.body.appendChild(div); + return { + div: div, + div2: div2 + }; + } + floatWO.updateColor('prefetcher'); + floatWO.updateColor('loading'); + floatWO.CmodeIcon('show'); + if (SSS.useiframe) { + var iframe = document.createElement('iframe'); + iframe.name = 'superpreloader-iframe'; + iframe.src = String(nextlink); + iframe.width = '100%'; + iframe.height = '0'; + iframe.frameBorder = '0'; + iframe.style.cssText = '\ margin:0!important;\ padding:0!important;\ '; - iframe.addEventListener('load', function (e) { - //@ts-ignore - var body = e.currentTarget.contentDocument.body; - if (body && body.firstChild) { - floatWO.updateColor('prefetcher'); - floatWO.CmodeIcon('hide'); - floatWO.loadedIcon('show'); - //@ts-ignore - e.currentTarget.removeEventListener('load', arguments.callee, false); - if (SSS.lazyImgSrc) { - handleLazyImgSrc(SSS.lazyImgSrc, body); - } - } - }, false); - if (SSS.viewcontent) { - var container = cContainer(); - container.div.style.display = 'block'; - container.div2.innerHTML = 'iframe full prefetch: ' + '' + 'Prefetch URL: ' + '' + nextlink + ''; - iframe.height = '300px'; - container.div.appendChild(iframe); - } else { - document.body.appendChild(iframe); - } - } else { - var reqConf = { - headers: SSS.a_headers ? SSS.a_headers : { - Referer: cplink - } - }; - got.get(nextlink, reqConf).then(function (res) { - var doc = createDocumentByString(res.data); - if (!doc) { - logger.error("[Super-preloader]", 'Document object creation failed!'); - return; - } - if (SSS.lazyImgSrc) { - handleLazyImgSrc(SSS.lazyImgSrc, doc); - } - var images = doc.images; - var isl = images.length; - var img; - var iarray = []; - var i; - var existSRC = {}; - var isrc; - for (i = isl - 1; i >= 0; i--) { - isrc = images[i].getAttribute('src'); - if (!isrc || existSRC[isrc]) { - continue; - } else { - existSRC[isrc] = true; - } - img = document.createElement('img'); - img.src = isrc; - iarray.push(img); - } - var container = cContainer(); - var div = container.div; - i = iarray.length; - container.div2.innerHTML = 'Number of prefetched pictures: ' + '' + i + '' + '' + 'Prefetch URL:' + '' + nextlink + ''; - logger.info("[Super-preloader]", 'Number of prefetched pictures: ' + i + 'Prefetch URL: ' + nextlink); - for (i -= 1; i >= 0; i--) { - div.appendChild(iarray[i]); - } - if (SSS.viewcontent) { - container.div.style.display = 'block'; - } - floatWO.updateColor('prefetcher'); - floatWO.loadedIcon('show'); - floatWO.CmodeIcon('hide'); - }); - } - } - - // 执行开始../////////////////// - - // 分析黑名单 - var blackList_re = new RegExp(blackList.map(function (x) { - if (x.substring(0, 3).toLowerCase() == 're:') { - return x.substring(4); - } else { - return wildcardToRegExpStr(x); - } - }).join('|')); - if (blackList_re.test(url)) { - logger.debug("[Super-preloader]", 'Matched blacklist, JS execution stopped'); - return; - } - - // 是否在frame上加载.. - if (prefs.DisableI && window.self != window.parent) { - var isReturn = !_find(DIExclude, function (x) { - //@ts-ignore - return x[1] && x[2].test(url); - }); - if (isReturn) { - logger.debug("[Super-preloader]", `The page with url:${url} is not a top-level window, JS execution stopped`); - return; - } - } - logger.debug("[Super-preloader]", `Page url is: ${url}, JS loaded successfully`); - - // 第一阶段..分析高级模式.. - if (prefs.disableBuiltinRules) { - logger.warn("[Super-preloader]", 'Builtin js rules are disabled'); - } else { - SSRules = SSRules.concat(jsSiteRule); - } - if (prefs.disableBuiltinSubscriptionRules) { - logger.warn("[Super-preloader]", 'Remote json rules are disabled'); - } else { - SSRules = SSRules.concat(jsonRule); - } - if (!prefs.disableBuiltinRules) { - SSRules = SSRules.concat(jsGeneralRule); - } - if (!prefs.numOfRule || prefs.numOfRule != SSRules.length) { - prefs.numOfRule = SSRules.length; - GM.setValue('prefs', prefs); - } - - // 重要的变量两枚. - /** @type {Array} */ - var pagedLinks = [document.location.href]; - /** @type {HTMLElement|string} */ - var nextlinkElem; - /** @type {string} */ - var nextlink; - /** @type {HTMLElement|string} */ - var prelink; - - //= ============== - - /**@type {IRuntimeRule} */ - var SSS = {}; - var findCurSiteInfo = /*#__PURE__*/function () { - var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() { - var SIIAD, Rurl, ii, _loop, _ret, i, FA; - return _regeneratorRuntime.wrap(function _callee5$(_context6) { - while (1) switch (_context6.prev = _context6.next) { - case 0: - SIIAD = SITEINFO_D.autopager; - ii = SSRules.length; - if (userLang === 'zh_CN') { - logger.debug("[Super-preloader]", `高级规则数目:${ii}`); - logger.debug("[Super-preloader]", `Number of rules > ${ii - jsonRule.length} from other sources, such as: wedata.net`); - } else { - logger.debug("[Super-preloader]", `Number of advanced rules:${ii}`); - } - _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() { - var SII, SIIA, documentFilter, pageElement; - return _regeneratorRuntime.wrap(function _loop$(_context5) { - while (1) switch (_context5.prev = _context5.next) { - case 0: - SII = SSRules[i]; - if (!(SII.autopager && SII.autopager.ip)) { - _context5.next = 4; - break; - } - if (!(SII.autopager.ip.indexOf(serverIp) < 0)) { - _context5.next = 4; - break; - } - return _context5.abrupt("return", 0); - case 4: - Rurl = toRE(SII.url); - if (!Rurl.test(url)) { - _context5.next = 75; - break; - } - if (userLang === 'zh_CN') { - logger.debug("[Super-preloader]", 'Find current site rules:', SII); - logger.debug("[Super-preloader]", `规则ID: ${i + 1}`); - } else { - logger.debug("[Super-preloader]", 'Find rule for this website:', SII); - logger.debug("[Super-preloader]", `Rule ID: ${i + 1}`); - } - - // 运行规则的 startFilter - if (!(SII.autopager && SII.autopager.startFilter)) { - _context5.next = 17; - break; - } - _context5.prev = 8; - _context5.next = 11; - return SII.autopager.startFilter(document, window); - case 11: - logger.debug("[Super-preloader]", 'startFilter executed successfully'); - _context5.next = 17; - break; - case 14: - _context5.prev = 14; - _context5.t0 = _context5["catch"](8); - logger.error("[Super-preloader]", 'Error executing startFilter', _context5.t0); - case 17: - if (!(SII.nextLink === 'null;')) { - _context5.next = 21; - break; - } - logger.debug("[Super-preloader]", 'Find the rule for a site without nextpage', SII); - SSS.hasRule = false; - return _context5.abrupt("return", 1); - case 21: - nextlinkElem = getElement(SII.nextLink || 'auto;'); - if (nextlinkElem) { - _context5.next = 25; - break; - } - logger.warn("[Super-preloader]", 'Could not find the next page link, continue searching for other rules, skiping rule:', SII); - return _context5.abrupt("return", 0); - case 25: - // extract next page link from an a link - nextlink = getFullHref(nextlinkElem); - if (!(nextlink === document.location.href)) { - _context5.next = 29; - break; - } - nextlinkElem = null; - return _context5.abrupt("return", 0); - case 29: - if (SII.preLink && SII.preLink != 'auto;') { - // 如果设定了具体的preLink - prelink = getElement(SII.preLink); - } else { - if (prefs.autoGetPreLink) { - prelink = getElement('auto;'); - } - } - SSS = {}; - SSS.Rurl = String(Rurl); - SSS.nextLink = SII.nextLink || 'auto;'; - SSS.viewcontent = SII.viewcontent; - SSS.enable = SII.enable === undefined ? SITEINFO_D.enable : SII.enable; - SSS.useiframe = SII.useiframe === undefined ? SITEINFO_D.useiframe : SII.useiframe; - if (SII.pageElement) { - // 如果是Oautopager的规则.. - if (typeof SII.autopager !== 'object') SII.autopager = {}; - SII.autopager.pageElement = SII.pageElement; - if (!SII.autopager.useiframe) SII.autopager.useiframe = SII.useiframe; - if (SII.preLink) SII.autopager.preLink = SII.preLink; - if (SII.insertBefore) SII.autopager.HT_insert = [SII.insertBefore, 1]; - } - - // 自动翻页设置. - SIIA = SII.autopager; - if (!SIIA) { - _context5.next = 68; - break; - } - SSS.a_pageElement = SIIA.pageElement; - if (SSS.a_pageElement) { - _context5.next = 42; - break; - } - return _context5.abrupt("return", 1); - case 42: - SSS.a_manualA = SIIA.manualA === undefined ? SIIAD.manualA : SIIA.manualA; - SSS.a_enable = SIIA.enable === undefined ? SIIAD.enable : SIIA.enable; - SSS.a_useiframe = SIIA.useiframe === undefined ? SIIAD.useiframe : SIIA.useiframe; - SSS.a_mutationObserver = SSS.a_useiframe ? SIIA.mutationObserver === undefined ? null : SIIA.mutationObserver : null; - SSS.a_newIframe = SIIA.newIframe === undefined ? SIIAD.newIframe : SIIA.newIframe; - SSS.a_iloaded = SIIA.iloaded === undefined ? SIIAD.iloaded : SIIA.iloaded; - SSS.a_itimeout = SIIA.itimeout === undefined ? SIIAD.itimeout : SIIA.itimeout; - SSS.a_remain = SIIA.remain === undefined ? SIIAD.remain : SIIA.remain; - SSS.a_maxpage = SIIA.maxpage === undefined ? SIIAD.maxpage : SIIA.maxpage; - SSS.a_separator = SIIA.separator === undefined ? SIIAD.separator : SIIA.separator; - SSS.a_sepdivDom = SIIA.sepdivDom === undefined ? undefined : SIIA.sepdivDom; - SSS.a_separatorReal = SIIA.separatorReal === undefined ? SIIAD.separatorReal : SIIA.separatorReal; - SSS.a_replaceE = SIIA.replaceE; - SSS.a_HT_insert = SIIA.HT_insert; - SSS.a_relatedObj = SIIA.relatedObj === undefined ? SIIAD.relatedObj : SIIA.relatedObj; - SSS.a_ipages = SIIA.ipages === undefined ? SIIAD.ipages : SIIA.ipages; - - // new - SSS.filter = SII.filter || SIIA.filter; // 新增了函数的形式,原来的功能是移除 pageElement - documentFilter = SII.documentFilter || SIIA.documentFilter; - if (documentFilter === 'startFilter') { - SSS.a_documentFilter = function (doc) { - return SII.autopager.startFilter(doc); - }; - } else if (typeof documentFilter === 'function') { - SSS.a_documentFilter = documentFilter; - } else { - SSS.a_documentFilter = undefined; - } - SSS.a_scriptFilter = SIIA.scriptFilter === undefined ? '' : SIIA.scriptFilter; - SSS.a_stylish = SII.stylish || SIIA.stylish; - SSS.lazyImgSrc = SIIA.lazyImgSrc; - SSS.a_headers = SIIA.headers === undefined ? undefined : SIIA.headers; // custom header for XHRLoaded - SSS.a_reload = SIIA.reload === undefined ? SIIAD.reload : SIIA.reload; // force reload iframe - SSS.a_sandbox = SIIA.sandbox === undefined ? SIIAD.sandbox : SIIA.sandbox; - - // 在翻页的时候会有一些其他元素占据了页面的高度,导致翻页不精准。 - // 比如正文下面的推荐文章列表(占据超过整个页面10%就很难受) - SSS.a_excludeElement = SIIA.excludeElement; - case 68: - // 检验是否存在内容 - pageElement = getElement(SSS.a_pageElement); - if (!(!pageElement || Array.isArray(pageElement) && pageElement.length === 0)) { - _context5.next = 73; - break; - } - nextlinkElem = null; - logger.error("[Super-preloader]", 'Could not find content, skiping rule:', SII, 'Continue to search for other rules.'); - return _context5.abrupt("return", 0); - case 73: - SSS.hasRule = true; - return _context5.abrupt("return", 1); - case 75: - case "end": - return _context5.stop(); - } - }, _loop, null, [[8, 14]]); - }); - i = 0; - case 5: - if (!(i < ii)) { - _context6.next = 15; - break; - } - return _context6.delegateYield(_loop(), "t0", 7); - case 7: - _ret = _context6.t0; - if (!(_ret === 0)) { - _context6.next = 10; - break; - } - return _context6.abrupt("continue", 12); - case 10: - if (!(_ret === 1)) { - _context6.next = 12; - break; - } - return _context6.abrupt("break", 15); - case 12: - i++; - _context6.next = 5; - break; - case 15: - if (!SSS.hasRule) { - // 自动搜索. - if (!autoMatch.keyMatch) { - logger.warn("[Super-preloader]", 'Auto match is disabled'); - } else { - logger.warn("[Super-preloader]", 'No rules are found. Auto match starts'); - nextlinkElem = autoGetLink(); - if (nextlinkElem) { - // 强制模式. - FA = autoMatch.FA; - SSS.Rurl = window.localStorage ? 'am:' + (url.match(/^https?:\/\/[^:]*\//i) || [])[0] : 'am:automatch'; - SSS.enable = true; - SSS.nextLink = 'auto;'; - SSS.viewcontent = autoMatch.viewcontent; - SSS.useiframe = autoMatch.useiframe || SITEINFO_D.autopager.useiframe; - SSS.a_force = true; - SSS.a_manualA = FA.manualA; - SSS.a_enable = FA.enable || SITEINFO_D.autopager.force_enable; // Force join is enabled when this becomes true - SSS.a_useiframe = FA.useiframe || SITEINFO_D.useiframe; - SSS.a_iloaded = FA.iloaded; - SSS.a_itimeout = FA.itimeout; - SSS.a_remain = FA.remain; - SSS.a_maxpage = FA.maxpage; - SSS.a_separator = FA.separator; - SSS.a_ipages = FA.ipages; - } - } - } - - // 如果规则没 lazyImgSrc,设置默认值 - if (!SSS.lazyImgSrc) { - SSS.lazyImgSrc = prefs.lazyImgSrc; - } - logger.debug("[Super-preloader]", `Total time spent on searching for advanced rules and automatic matching: ${new Date().getTime() - startTime.getTime()}ms`); - case 18: - case "end": - return _context6.stop(); - } - }, _callee5); - })); - return function findCurSiteInfo() { - return _ref5.apply(this, arguments); - }; - }(); - findCurSiteInfo().then(function () { - // 上下页都没有找到啊 - if (!nextlinkElem && !prelink) { - logger.warn("[Super-preloader]", `No related links found, JS execution stopped. Total time spent: ${new Date().getTime() - startTime.getTime()}ms`); - return; - } else if (!nextlink) { - logger.error("[Super-preloader]", 'The link to the next page does not exist, JS cannot continue.'); - logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); - return; - } else { - logger.debug("[Super-preloader]", 'Previous link element:', prelink); - logger.debug("[Super-preloader]", 'Next link element:', nextlinkElem); - nextlink = elemToHref(nextlinkElem); - logger.debug("[Super-preloader]", 'Next link:', nextlink); - //@ts-ignore - prelink = prelink ? prelink.href || prelink : undefined; - } - var keyBinding = { - go: function go() { - if (typeof nextlink === 'string') window.location.href = nextlink; - }, - back: function back() { - //fixme - if (!prelink) getElement('auto;'); - if (typeof prelink === 'string') window.location.href = prelink; - }, - register: function register( /**@type {IPrefs} */prefs) { - var _this = this; - if (prefs.arrowKeyPage) { - logger.debug("[Super-preloader]", 'Adding left and right arrow keys to autopager listener.'); - document.addEventListener('keyup', function (e) { - //@ts-ignore - var tarNN = e.target.nodeName; - if (tarNN != 'BODY' && tarNN != 'HTML') return; - - // check is a combo pressed - if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) { - return; - } - switch (e.keyCode) { - case 37: - _this.back(); - break; - case 39: - _this.go(); - break; - } - }, false); - - // 监听下一页事件. - logger.debug("[Super-preloader]", '添加鼠标手势翻页监听'); - document.addEventListener('superPreloader.go', function () { - _this.go(); - }, false); - - // 监听下一页事件. - document.addEventListener('superPreloader.back', function () { - _this.back(); - }, false); - } - } - }; - keyBinding.register(prefs); - loadLocalSetting(SSS); - if (!SSS.enable) { - logger.warn("[Super-preloader]", 'This rule is disabled, script execution is stopped'); - logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); - return; - } - if (!SSS.hasRule) { - SSS.a_force = true; - } - if (SSS.a_force) { - SSS.a_pageElement = '//body/*'; - SSS.a_HT_insert = undefined; - SSS.a_relatedObj = undefined; - } - if (prefs.floatWindow) { - logger.debug("[Super-preloader]", 'Creating a floating window'); - floatWindow(SSS); - var floatWindowWidth = getFloatWindowWith(); - displace(document.getElementById('sp-fw-container'), { - handle: document.getElementById('sp-fw-rect'), - customMove: function customMove(el, x, y) { - delete el.style.left; - delete el.style.bottom; - var right = document.body.clientWidth - floatWindowWidth - x; - if (right < 0) { - right = 0; - } else if (right > window.innerWidth - floatWindowWidth) { - right = window.innerWidth - floatWindowWidth; - } - var top = y; - if (top > window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight) { - top = window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight; - } else if (top < 0) { - top = 0; - } - el.style.right = `${right}px`; - el.style.top = `${top}px`; - }, - onMouseUp: function onMouseUp(el) { - prefs.FW_offset[0] = parseInt(el.style.top.replace('px', ''), 10); - prefs.FW_offset[1] = parseInt(el.style.right.replace('px', ''), 10); - prefs.FW_position = 2; - GM.setValue('prefs', prefs); - } - }); - document.getElementById('sp-fw-container').style.position = 'fixed'; - } - logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); - - // 预读或者翻页. - if (SSS.a_enable) { - logger.debug("[Super-preloader]", 'Initializing, autopager mode.'); - autopager(SSS, floatWO); - } else { - logger.debug("[Super-preloader]", 'Initializing, prefetch mode.'); - prefetcher(SSS, floatWO); - } - }); - - // 获取单个元素,混合 - /** - * - * @param {string|Function|Array|IHrefIncObject} selector selector - * @param {HTMLElement|Document=} contextNode element - * @param {Document=} doc document - * @param {Window=} win window - * @returns {HTMLElement} element - */ - function getElement(selector, contextNode, doc, win) { - var _cplink = cplink; - var ret; - if (!selector) return ret; - doc = doc || document; - win = win || window; - contextNode = contextNode || doc; - if (typeof selector === 'string') { - if (selector.search(/^css;/i) === 0) { - ret = getElementByCSS(selector.slice(4), contextNode); - } else if (selector.toLowerCase() == 'auto;') { - ret = autoGetLink(doc); - } else { - ret = getElementByXpath(selector, contextNode, doc); - } - } else if (typeof selector === 'function') { - ret = selector(doc, win, _cplink); - } else if (selector instanceof Array) { - for (var i = 0, l = selector.length; i < l; i++) { - ret = getElement(selector[i], contextNode, doc, win); - if (ret) { - break; - } - } - } else { - ret = hrefInc(selector, doc, win, _cplink); - } - return ret; - } - var docChecked; - /** - * - * @param {Document=} doc document - * @param {Window=} win window - * @returns {HTMLElement} a - */ - function autoGetLink(doc, win) { - if (!autoMatch.keyMatch) return; - //@ts-ignore - if (!parseKWRE.done) { - parseKWRE(); - //@ts-ignore - parseKWRE.done = true; - } - var startTime = new Date(); - doc = doc || document; - if (doc == document) { - // 当前文档,只检查一次. - if (docChecked) { - // @ts-ignore - return nextlink; - } - docChecked = true; - } - var _prePageKey = prePageKey; - var _nextPageKey = nextPageKey; - var _nPKL = nextPageKey.length; - var _pPKL = prePageKey.length; - var _getFullHref = getFullHref; - var _getAllElementsByXpath = getAllElementsByXpath; - var _Number = Number; - var _domain_port = domain_port; - var alllinks = doc.links; - var alllinksl = alllinks.length; - var curLHref = cplink; - var _nextlink; - var _prelink; - //@ts-ignore - if (!autoGetLink.checked) { - // 第一次检查 - _nextlink = nextlink; - _prelink = prelink; - } else { - _prelink = true; - } - var DCEnable = autoMatch.digitalCheck; - var DCRE = /^\s*\D{0,1}(\d+)\D{0,1}\s*$/; - var i, a, atext, numtext; - var aP; - var initSD; - var searchD = 1; - var preS1; - var preS2; - var searchedD; - var pSNText; - var preSS; - var nodeType; - var nextS1, nextS2, nSNText, nextSS; - var aimgs, j, jj, aimg_x, xbreak, k, keytext; - function finalCheck(a, type) { - var ahref = a.getAttribute('href'); // 在chrome上当是非当前页面文档对象的时候直接用a.href访问,不返回href - if (ahref == '#') { - return null; - } - ahref = _getFullHref(ahref); // 从相对路径获取完全的href; - - // 3个条件:http协议链接,非跳到当前页面的链接,非跨域 - if (/^https?:/i.test(ahref) && ahref.replace(/#.*$/, '') != curLHref && ahref.match(/https?:\/\/([^\/]+)/)[1] == _domain_port) { - logger.debug("[Super-preloader]", type == 'pre' ? 'previous' : 'next' + 'match:', atext); - return a; // 返回对象A - // return ahref; - } - } - logger.debug("[Super-preloader]", `Number of full document links:${alllinksl}`); - for (i = 0; i < alllinksl; i++) { - if (_nextlink && _prelink) break; - a = alllinks[i]; - if (!a) continue; // undefined跳过 - // links集合返回的本来就是包含href的a元素..所以不用检测 - // if(!a.hasAttribute("href"))continue; - atext = a.textContent; - if (atext) { - if (DCEnable) { - numtext = atext.match(DCRE); - if (numtext) { - // 是不是纯数字 - // debug(numtext); - numtext = numtext[1]; - aP = a; - initSD = 0; - if (!_nextlink) { - preS1 = a.previousSibling; - preS2 = a.previousElementSibling; - while (!(preS1 || preS2) && initSD < searchD) { - aP = aP.parentNode; - if (aP) { - preS1 = aP.previousSibling; - //@ts-ignore - preS2 = aP.previousElementSibling; - } - initSD++; - } - searchedD = initSD > 0; - if (preS1 || preS2) { - pSNText = preS1 ? preS1.textContent.match(DCRE) : ''; - if (pSNText) { - preSS = preS1; - } else { - pSNText = preS2 ? preS2.textContent.match(DCRE) : ''; - preSS = preS2; - } - if (pSNText) { - pSNText = pSNText[1]; - if (_Number(pSNText) == _Number(numtext) - 1) { - nodeType = preSS.nodeType; - if (nodeType == 3 || nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', preSS, doc).length === 0 : !preSS.hasAttribute('href') || _getFullHref(preSS.getAttribute('href')) == curLHref)) { - _nextlink = finalCheck(a, 'next'); - } - continue; - } - } - } - } - if (!_prelink) { - nextS1 = a.nextSibling; - nextS2 = a.nextElementSibling; - while (!(nextS1 || nextS2) && initSD < searchD) { - aP = aP.parentNode; - if (aP) { - nextS1 = a.nextSibling; - nextS2 = a.nextElementSibling; - } - initSD++; - } - searchedD = initSD > 0; - if (nextS1 || nextS2) { - nSNText = nextS1 ? nextS1.textContent.match(DCRE) : ''; - if (nSNText) { - nextSS = nextS1; - } else { - nSNText = nextS2 ? nextS2.textContent.match(DCRE) : ''; - nextSS = nextS2; - } - if (nSNText) { - nSNText = nSNText[1]; - if (_Number(nSNText) == _Number(numtext) + 1) { - nodeType = nextSS.nodeType; - if (nodeType == 3 || - // @ts-ignore - nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', nextSS, doc).length === 0 : !nextSS.hasAttribute('href') || _getFullHref(nextSS.getAttribute('href')) == curLHref)) { - _prelink = finalCheck(a, 'pre'); - } - } - } - } - } - continue; - } - } - } else { - atext = a.title; - } - if (!atext) { - aimgs = a.getElementsByTagName('img'); - for (j = 0, jj = aimgs.length; j < jj; j++) { - aimg_x = aimgs[j]; - atext = aimg_x.alt || aimg_x.title; - if (atext) break; - } - } - if (!atext) continue; - if (!_nextlink) { - xbreak = false; - for (k = 0; k < _nPKL; k++) { - keytext = _nextPageKey[k]; - //@ts-ignore - if (!keytext.test(atext)) continue; - _nextlink = finalCheck(a, 'next'); - xbreak = true; - break; - } - if (xbreak || _nextlink) continue; - } - if (!_prelink) { - for (k = 0; k < _pPKL; k++) { - keytext = _prePageKey[k]; - //@ts-ignore - if (!keytext.test(atext)) continue; - _prelink = finalCheck(a, 'pre'); - break; - } - } - } - logger.debug("[Super-preloader]", `Time to search ${i} links:${new Date().getTime() - startTime.getTime()}ms`); - //@ts-ignore - if (!autoGetLink.checked) { - // 只在第一次检测的时候,抛出上一页链接. - prelink = _prelink; - //@ts-ignore - autoGetLink.checked = true; - } - return _nextlink; - } - function parseKWRE() { - function modifyPageKey(name, pageKey, pageKeyLength) { - function strMTE(str) { - return str.replace(/\\/g, '\\\\').replace(/\+/g, '\\+').replace(/\./g, '\\.').replace(/\?/g, '\\?').replace(/\{/g, '\\{').replace(/\}/g, '\\}').replace(/\[/g, '\\[').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/\$/g, '\\$').replace(/\*/g, '\\*').replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/\|/g, '\\|').replace(/\//g, '\\/'); - } - var pfwordl = autoMatch.pfwordl; - var sfwordl = autoMatch.sfwordl; - var RE_enable_a = pfwordl[name].enable; - var RE_maxPrefix = pfwordl[name].maxPrefix; - var RE_character_a = pfwordl[name].character; - var RE_enable_b = sfwordl[name].enable; - var RE_maxSubfix = sfwordl[name].maxSubfix; - var RE_character_b = sfwordl[name].character; - var plwords, slwords, rep; - plwords = RE_maxPrefix > 0 ? '[' + (RE_enable_a ? strMTE(RE_character_a.join('')) : '.') + ']{0,' + RE_maxPrefix + '}' : ''; - plwords = '^\\s*' + plwords; - slwords = RE_maxSubfix > 0 ? '[' + (RE_enable_b ? strMTE(RE_character_b.join('')) : '.') + ']{0,' + RE_maxSubfix + '}' : ''; - slwords = slwords + '\\s*$'; - rep = autoMatch.cases ? '' : 'i'; - for (var i = 0; i < pageKeyLength; i++) { - pageKey[i] = new RegExp(plwords + strMTE(pageKey[i]) + slwords, rep); - } - return pageKey; - } - - // 转成正则. - prePageKey = modifyPageKey('previous', prePageKey, prePageKey.length); - nextPageKey = modifyPageKey('next', nextPageKey, nextPageKey.length); - } - } - - // By lastDream2013 略加修改,原版只能用于 Firefox - function getRalativePageStr(lastUrl, currentUrl, nextUrl) { - var getRalativePageNumArray = function getRalativePageNumArray(lasturl, url) { - if (!lasturl || !url) { - return [0, 0]; - } - var lasturlarray = lasturl.split(/-|\.|\&|\/|=|#|\?/); - var urlarray = url.split(/-|\.|\&|\/|=|#|\?/); - var url_info; - var lasturl_info; - // 一些 url_info 为 p1,p2,p3 之类的 - var handleInfo = function handleInfo(s) { - if (s) { - return s.replace(/^p/, ''); - } - return s; - }; - while (urlarray.length !== 0) { - url_info = handleInfo(urlarray.pop()); - lasturl_info = handleInfo(lasturlarray.pop()); - if (url_info != lasturl_info) { - if (/[0-9]+/.test(url_info) && (url_info == '2' || /[0-9]+/.test(lasturl_info))) { - return [parseInt(lasturl_info) || 1, parseInt(url_info)]; - } - } - } - return [0, 0]; - }; - var relativeOff; - - // 论坛和搜索引擎网页显示实际页面信息 - var relativePageNumarray = []; - if (nextUrl) { - relativePageNumarray = getRalativePageNumArray(currentUrl, nextUrl); - } else { - relativePageNumarray = getRalativePageNumArray(lastUrl, currentUrl); - relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; // 用的上一页的相对信息比较的,要补充差值…… - relativePageNumarray[1] = relativePageNumarray[1] + relativeOff; - relativePageNumarray[0] = relativePageNumarray[0] + relativeOff; - } - - // console.log('[获取实际页数] ', '要比较的3个页数:',arguments, ',得到的差值:', relativePageNumarray); - if (isNaN(relativePageNumarray[0]) || isNaN(relativePageNumarray[1])) { - return ''; - } - var realPageSiteMatch = false; - relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; - // 上一页与下一页差值为1,并最大数值不超过10000(一般论坛也不会超过这么多页……) - if (relativeOff === 1 && relativePageNumarray[1] < 10000) { - realPageSiteMatch = true; - } - - // 上一页与下一页差值不为1,但上一页与下一页差值能被上一页与下一面所整除的,有规律的页面 - if (!realPageSiteMatch && relativeOff !== 1) { - if (relativePageNumarray[1] % relativeOff === 0 && relativePageNumarray[0] % relativeOff === 0) { - realPageSiteMatch = true; - } - } - if (!realPageSiteMatch) { - // 不满足以上条件,再根据地址特征来匹配 - var sitePattern; - for (var i = 0, length = REALPAGE_SITE_PATTERN.length; i < length; i++) { - sitePattern = REALPAGE_SITE_PATTERN[i]; - if (currentUrl.toLocaleLowerCase().indexOf(sitePattern) >= 0) { - realPageSiteMatch = true; - break; - } - } - } - var relativePageStr; - if (realPageSiteMatch) { - // 如果匹配就显示实际网页信息 - if (userLang === 'zh_CN') { - if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { - // 一般是搜索引擎的第xx - xx项…… - relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' 项 ]'; - } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { - // 一般的翻页数,差值应该是1 - relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' 页 ]'; - } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { - // 找不到的话…… - relativePageStr = ' [ 实际网页结束 ]'; - } - } else { - if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { - // 一般是搜索引擎的第xx - xx项…… - relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' ]'; - } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { - // 一般的翻页数,差值应该是1 - relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' ]'; - } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { - // 找不到的话…… - relativePageStr = ' [ Actual elements ends ]'; - } - } - } else { - relativePageStr = ''; - } - return relativePageStr || ''; - } - }).catch(function (err) { - console.log(err); - }); - - // ------------------------下面的不要管他----------------- - /// //////////////////////////////////////////////////////////////// - - // 变量 - var isHashchangeSite = false; - var hashchangeTimer = 0; - - // ==================== libs ============================== - /** - * - * @param {IHrefIncObject} obj obj - * @param {Document=} doc document - * @param {Window=} win window - * @param {string=} cplink cplink - * @returns {string} next link - * @description 地址栏递增处理函数 - */ - function hrefInc(obj, doc, win, cplink) { - var _cplink = cplink; - function getHref(href) { - var mFails = obj.mFails; - if (!mFails) return href; - var str; - if (typeof mFails === 'string') { - str = mFails; - } else { - var array = []; - for (var i = 0, ii = mFails.length; i < ii; i++) { - var fx = mFails[i]; - if (!fx) continue; - if (typeof fx !== 'string' || fx.indexOf('re;') === 0) { - var fxre = typeof fx === 'string' ? toRE(fx.slice(3)) : fx; - var mValue = href.match(fxre); - if (!mValue) return href; - array.push(mValue); - } else { - array.push(fx); - } - } - str = array.join(''); - } - return str; - } - var sa = obj.startAfter; - var index; - if (typeof sa === 'string') { - if (sa[0] == '#') { - _cplink = doc.location.href; - } - index = _cplink.indexOf(sa); - if (index == -1) { - _cplink = getHref(_cplink); - index = _cplink.indexOf(sa); - if (index == -1) return; - } - } else { - var tsa = _cplink.match(sa); - if (!tsa) { - _cplink = getHref(_cplink); - sa = (_cplink.match(sa) || [])[0]; - if (!sa) return; - index = _cplink.indexOf(sa); - if (index == -1) return; - } else { - sa = tsa[0]; - index = _cplink.indexOf(sa); - } - } - index += sa.length; - var max = obj.max === undefined ? 9999 : obj.max; - var min = obj.min === undefined ? 1 : obj.min; - var aStr = _cplink.slice(0, index); - var bStr = _cplink.slice(index); - var nbStr = bStr.replace(/^(\d+)(.*)$/, function (a, b, c) { - b = Number(b) + obj.inc; - if (b >= max || b < min) return a; - return b + c; - }); - if (nbStr !== bStr) { - var ilresult; - try { - ilresult = obj.isLast(doc, unsafeWindow, _cplink); - } catch (e) {} - if (ilresult) return; - return aStr + nbStr; - } - } - - // ==================== functions ============================== - function handleLazyImgSrc(rule, doc) { - var imgAttrs = rule.split('|'); - imgAttrs.forEach(function (attr) { - attr = attr.trim(); - [].forEach.call(doc.querySelectorAll('img[' + attr + ']'), function (img) { - var newSrc = img.getAttribute(attr); - if (newSrc && newSrc != img.src) { - img.setAttribute('src', newSrc); - img.removeAttribute(attr); - } - }); - }); - } - - /** - * - * @param {HTMLDocument} doc Document Fragment - * @param {String} scriptFilter Regex string - * @description Remove scripts node from doc - * @returns {void} - */ - function removeScripts(doc, scriptFilter) { - var scripts = getAllElements('css;script', doc); - var regFilter; - if (scriptFilter) { - regFilter = toRE(scriptFilter); - } - /** @type {HTMLScriptElement} */ - var scripts_x; - for (var i = scripts.length - 1; i >= 0; i--) { - //@ts-ignore - scripts_x = scripts[i]; - var iremove = false; - if (regFilter) { - if (scripts_x.hasOwnProperty('src')) { - if (!regFilter.test(scripts_x.src)) { - iremove = true; - } - } - if (scripts_x.text) { - if (!regFilter.test(scripts_x.text)) { - iremove = true; - } - } - if (iremove) { - scripts_x.parentNode.removeChild(scripts_x); - } - } else { - scripts_x.parentNode.removeChild(scripts_x); - } - } - } - - /** - * - * @param {string} str str - * @returns {HTMLDocument} document - */ - function createDocumentByString(str) { - // string转为DOM - if (!str) { - logger.error("[Super-preloader]", 'No string found to be converted to DOM'); - return; - } - if (document.documentElement.nodeName != 'HTML') { - return new DOMParser().parseFromString(str, 'application/xhtml+xml'); - } - /**@type {HTMLDocument} */ - var doc; - try { - // firefox and chrome 30+,Opera 12 会报错 - doc = new DOMParser().parseFromString(str, 'text/html'); - } catch (ex) {} - if (doc) { - return doc; - } - if (document.implementation.createHTMLDocument) { - doc = document.implementation.createHTMLDocument('superPreloader'); - } else { - try { - //@ts-ignore - doc = document.cloneNode(false); - doc.appendChild(doc.importNode(document.documentElement, false)); - doc.documentElement.appendChild(doc.createElement('head')); - doc.documentElement.appendChild(doc.createElement('body')); - } catch (e) {} - } - if (!doc) return; - var range = document.createRange(); - range.selectNodeContents(document.body); - var fragment = range.createContextualFragment(str); - doc.body.appendChild(fragment); - var headChildNames = { - TITLE: true, - META: true, - LINK: true, - STYLE: true, - BASE: true - }; - var child; - var body = doc.body; - var bchilds = body.childNodes; - for (var i = bchilds.length - 1; i >= 0; i--) { - // 移除head的子元素 - child = bchilds[i]; - if (headChildNames[child.nodeName]) body.removeChild(child); - } - return doc; - } - - /** - * - * @param {string|HTMLElement} href href - * @returns {string} href - * @description 从相对路径的a.href获取完全的href值. - */ - function getFullHref(href) { - // getAttribute may give relative url but href always give full url - if (typeof href !== 'string') href = href.getAttribute('href'); - - /** @type {HTMLAnchorElement} */ - // @ts-ignore - var a = getFullHref.a; - if (!a) { - //@ts-ignore - getFullHref.a = a = document.createElement('a'); - } - a.href = href; - return a.href; - } - function getFloatWindowWith() { - var el = document.getElementById('sp-fw-container'); - /** @type {HTMLElement} */ - //@ts-ignore - var elc = el.cloneNode(true); - elc.id = `${el.id}`; - elc.style.visibility = 'hidden'; - //@ts-ignore - elc.querySelector('#sp-fw-content').style.display = 'block'; - document.body.appendChild(elc); - //@ts-ignore - var width = elc.querySelector('#sp-fw-content').offsetWidth; - elc.remove(); - return width; - } - - /** - * Get next page link from an element - * @param {string | HTMLElement} elem nextlink element - * @returns {String} link of next page - */ - function elemToHref(elem) { - if (!elem) return undefined; - if (typeof elem === 'string' || elem.hasAttribute('href')) { - return getFullHref(elem); - } else { - // eslint-disable-next-line no-script-url - return 'javascript:void(0);'; // pseudo href - } - } - })(); - -})(); + iframe.addEventListener('load', function (e) { + //@ts-ignore + var body = e.currentTarget.contentDocument.body; + if (body && body.firstChild) { + floatWO.updateColor('prefetcher'); + floatWO.CmodeIcon('hide'); + floatWO.loadedIcon('show'); + //@ts-ignore + e.currentTarget.removeEventListener('load', arguments.callee, false); + if (SSS.lazyImgSrc) { + handleLazyImgSrc(SSS.lazyImgSrc, body); + } + } + }, false); + if (SSS.viewcontent) { + var container = cContainer(); + container.div.style.display = 'block'; + container.div2.innerHTML = 'iframe full prefetch: ' + '' + 'Prefetch URL: ' + '' + nextlink + ''; + iframe.height = '300px'; + container.div.appendChild(iframe); + } else { + document.body.appendChild(iframe); + } + } else { + var reqConf = { + headers: SSS.a_headers ? SSS.a_headers : { + Referer: cplink + } + }; + got.get(nextlink, reqConf).then(function (res) { + var doc = createDocumentByString(res.data); + if (!doc) { + logger.error("[Super-preloader]", 'Document object creation failed!'); + return; + } + if (SSS.lazyImgSrc) { + handleLazyImgSrc(SSS.lazyImgSrc, doc); + } + var images = doc.images; + var isl = images.length; + var img; + var iarray = []; + var i; + var existSRC = {}; + var isrc; + for (i = isl - 1; i >= 0; i--) { + isrc = images[i].getAttribute('src'); + if (!isrc || existSRC[isrc]) { + continue; + } else { + existSRC[isrc] = true; + } + img = document.createElement('img'); + img.src = isrc; + iarray.push(img); + } + var container = cContainer(); + var div = container.div; + i = iarray.length; + container.div2.innerHTML = 'Number of prefetched pictures: ' + '' + i + '' + '' + 'Prefetch URL:' + '' + nextlink + ''; + logger.info("[Super-preloader]", 'Number of prefetched pictures: ' + i + 'Prefetch URL: ' + nextlink); + for (i -= 1; i >= 0; i--) { + div.appendChild(iarray[i]); + } + if (SSS.viewcontent) { + container.div.style.display = 'block'; + } + floatWO.updateColor('prefetcher'); + floatWO.loadedIcon('show'); + floatWO.CmodeIcon('hide'); + }); + } + } + + // 执行开始../////////////////// + + // 分析黑名单 + var blackList_re = new RegExp(blackList.map(function (x) { + if (x.substring(0, 3).toLowerCase() == 're:') { + return x.substring(4); + } else { + return wildcardToRegExpStr(x); + } + }).join('|')); + if (blackList_re.test(url)) { + logger.debug("[Super-preloader]", 'Matched blacklist, JS execution stopped'); + return; + } + + // 是否在frame上加载.. + if (prefs.DisableI && window.self != window.parent) { + var isReturn = !_find(DIExclude, function (x) { + //@ts-ignore + return x[1] && x[2].test(url); + }); + if (isReturn) { + logger.debug("[Super-preloader]", `The page with url:${url} is not a top-level window, JS execution stopped`); + return; + } + } + logger.debug("[Super-preloader]", `Page url is: ${url}, JS loaded successfully`); + + // 第一阶段..分析高级模式.. + if (prefs.disableBuiltinRules) { + logger.warn("[Super-preloader]", 'Builtin js rules are disabled'); + } else { + SSRules = SSRules.concat(jsSiteRule); + } + if (prefs.disableBuiltinSubscriptionRules) { + logger.warn("[Super-preloader]", 'Remote json rules are disabled'); + } else { + SSRules = SSRules.concat(jsonRule); + } + if (!prefs.disableBuiltinRules) { + SSRules = SSRules.concat(jsGeneralRule); + } + if (!prefs.numOfRule || prefs.numOfRule != SSRules.length) { + prefs.numOfRule = SSRules.length; + GM.setValue('prefs', prefs); + } + + // 重要的变量两枚. + /** @type {Array} */ + var pagedLinks = [document.location.href]; + /** @type {HTMLElement|string} */ + var nextlinkElem; + /** @type {string} */ + var nextlink; + /** @type {HTMLElement|string} */ + var prelink; + + //= ============== + + /**@type {IRuntimeRule} */ + var SSS = {}; + var findCurSiteInfo = /*#__PURE__*/function () { + var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() { + var SIIAD, Rurl, ii, _loop, _ret, i, FA; + return _regeneratorRuntime.wrap(function _callee5$(_context6) { + while (1) switch (_context6.prev = _context6.next) { + case 0: + SIIAD = SITEINFO_D.autopager; + ii = SSRules.length; + if (userLang === 'zh_CN') { + logger.debug("[Super-preloader]", `高级规则数目:${ii}`); + logger.debug("[Super-preloader]", `Number of rules > ${ii - jsonRule.length} from other sources, such as: wedata.net`); + } else { + logger.debug("[Super-preloader]", `Number of advanced rules:${ii}`); + } + _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() { + var SII, SIIA, documentFilter, pageElement; + return _regeneratorRuntime.wrap(function _loop$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + SII = SSRules[i]; + if (!(SII.autopager && SII.autopager.ip)) { + _context5.next = 4; + break; + } + if (!(SII.autopager.ip.indexOf(serverIp) < 0)) { + _context5.next = 4; + break; + } + return _context5.abrupt("return", 0); + case 4: + Rurl = toRE(SII.url); + if (!Rurl.test(url)) { + _context5.next = 75; + break; + } + if (userLang === 'zh_CN') { + logger.debug("[Super-preloader]", 'Find current site rules:', SII); + logger.debug("[Super-preloader]", `规则ID: ${i + 1}`); + } else { + logger.debug("[Super-preloader]", 'Find rule for this website:', SII); + logger.debug("[Super-preloader]", `Rule ID: ${i + 1}`); + } + + // 运行规则的 startFilter + if (!(SII.autopager && SII.autopager.startFilter)) { + _context5.next = 17; + break; + } + _context5.prev = 8; + _context5.next = 11; + return SII.autopager.startFilter(document, window); + case 11: + logger.debug("[Super-preloader]", 'startFilter executed successfully'); + _context5.next = 17; + break; + case 14: + _context5.prev = 14; + _context5.t0 = _context5["catch"](8); + logger.error("[Super-preloader]", 'Error executing startFilter', _context5.t0); + case 17: + if (!(SII.nextLink === 'null;')) { + _context5.next = 21; + break; + } + logger.debug("[Super-preloader]", 'Find the rule for a site without nextpage', SII); + SSS.hasRule = false; + return _context5.abrupt("return", 1); + case 21: + nextlinkElem = getElement(SII.nextLink || 'auto;'); + if (nextlinkElem) { + _context5.next = 25; + break; + } + logger.warn("[Super-preloader]", 'Could not find the next page link, continue searching for other rules, skiping rule:', SII); + return _context5.abrupt("return", 0); + case 25: + // extract next page link from an a link + nextlink = getFullHref(nextlinkElem); + if (!(nextlink === document.location.href)) { + _context5.next = 29; + break; + } + nextlinkElem = null; + return _context5.abrupt("return", 0); + case 29: + if (SII.preLink && SII.preLink != 'auto;') { + // 如果设定了具体的preLink + prelink = getElement(SII.preLink); + } else { + if (prefs.autoGetPreLink) { + prelink = getElement('auto;'); + } + } + SSS = {}; + SSS.Rurl = String(Rurl); + SSS.nextLink = SII.nextLink || 'auto;'; + SSS.viewcontent = SII.viewcontent; + SSS.enable = SII.enable === undefined ? SITEINFO_D.enable : SII.enable; + SSS.useiframe = SII.useiframe === undefined ? SITEINFO_D.useiframe : SII.useiframe; + if (SII.pageElement) { + // 如果是Oautopager的规则.. + if (typeof SII.autopager !== 'object') SII.autopager = {}; + SII.autopager.pageElement = SII.pageElement; + if (!SII.autopager.useiframe) SII.autopager.useiframe = SII.useiframe; + if (SII.preLink) SII.autopager.preLink = SII.preLink; + if (SII.insertBefore) SII.autopager.HT_insert = [SII.insertBefore, 1]; + } + + // 自动翻页设置. + SIIA = SII.autopager; + if (!SIIA) { + _context5.next = 68; + break; + } + SSS.a_pageElement = SIIA.pageElement; + if (SSS.a_pageElement) { + _context5.next = 42; + break; + } + return _context5.abrupt("return", 1); + case 42: + SSS.a_manualA = SIIA.manualA === undefined ? SIIAD.manualA : SIIA.manualA; + SSS.a_enable = SIIA.enable === undefined ? SIIAD.enable : SIIA.enable; + SSS.a_useiframe = SIIA.useiframe === undefined ? SIIAD.useiframe : SIIA.useiframe; + SSS.a_mutationObserver = SSS.a_useiframe ? SIIA.mutationObserver === undefined ? null : SIIA.mutationObserver : null; + SSS.a_newIframe = SIIA.newIframe === undefined ? SIIAD.newIframe : SIIA.newIframe; + SSS.a_iloaded = SIIA.iloaded === undefined ? SIIAD.iloaded : SIIA.iloaded; + SSS.a_itimeout = SIIA.itimeout === undefined ? SIIAD.itimeout : SIIA.itimeout; + SSS.a_remain = SIIA.remain === undefined ? SIIAD.remain : SIIA.remain; + SSS.a_maxpage = SIIA.maxpage === undefined ? SIIAD.maxpage : SIIA.maxpage; + SSS.a_separator = SIIA.separator === undefined ? SIIAD.separator : SIIA.separator; + SSS.a_sepdivDom = SIIA.sepdivDom === undefined ? undefined : SIIA.sepdivDom; + SSS.a_separatorReal = SIIA.separatorReal === undefined ? SIIAD.separatorReal : SIIA.separatorReal; + SSS.a_replaceE = SIIA.replaceE; + SSS.a_HT_insert = SIIA.HT_insert; + SSS.a_relatedObj = SIIA.relatedObj === undefined ? SIIAD.relatedObj : SIIA.relatedObj; + SSS.a_ipages = SIIA.ipages === undefined ? SIIAD.ipages : SIIA.ipages; + + // new + SSS.filter = SII.filter || SIIA.filter; // 新增了函数的形式,原来的功能是移除 pageElement + documentFilter = SII.documentFilter || SIIA.documentFilter; + if (documentFilter === 'startFilter') { + SSS.a_documentFilter = function (doc) { + return SII.autopager.startFilter(doc); + }; + } else if (typeof documentFilter === 'function') { + SSS.a_documentFilter = documentFilter; + } else { + SSS.a_documentFilter = undefined; + } + SSS.a_scriptFilter = SIIA.scriptFilter === undefined ? '' : SIIA.scriptFilter; + SSS.a_stylish = SII.stylish || SIIA.stylish; + SSS.lazyImgSrc = SIIA.lazyImgSrc; + SSS.a_headers = SIIA.headers === undefined ? undefined : SIIA.headers; // custom header for XHRLoaded + SSS.a_reload = SIIA.reload === undefined ? SIIAD.reload : SIIA.reload; // force reload iframe + SSS.a_sandbox = SIIA.sandbox === undefined ? SIIAD.sandbox : SIIA.sandbox; + + // 在翻页的时候会有一些其他元素占据了页面的高度,导致翻页不精准。 + // 比如正文下面的推荐文章列表(占据超过整个页面10%就很难受) + SSS.a_excludeElement = SIIA.excludeElement; + case 68: + // 检验是否存在内容 + pageElement = getElement(SSS.a_pageElement); + if (!(!pageElement || Array.isArray(pageElement) && pageElement.length === 0)) { + _context5.next = 73; + break; + } + nextlinkElem = null; + logger.error("[Super-preloader]", 'Could not find content, skiping rule:', SII, 'Continue to search for other rules.'); + return _context5.abrupt("return", 0); + case 73: + SSS.hasRule = true; + return _context5.abrupt("return", 1); + case 75: + case "end": + return _context5.stop(); + } + }, _loop, null, [[8, 14]]); + }); + i = 0; + case 5: + if (!(i < ii)) { + _context6.next = 15; + break; + } + return _context6.delegateYield(_loop(), "t0", 7); + case 7: + _ret = _context6.t0; + if (!(_ret === 0)) { + _context6.next = 10; + break; + } + return _context6.abrupt("continue", 12); + case 10: + if (!(_ret === 1)) { + _context6.next = 12; + break; + } + return _context6.abrupt("break", 15); + case 12: + i++; + _context6.next = 5; + break; + case 15: + if (!SSS.hasRule) { + // 自动搜索. + if (!autoMatch.keyMatch) { + logger.warn("[Super-preloader]", 'Auto match is disabled'); + } else { + logger.warn("[Super-preloader]", 'No rules are found. Auto match starts'); + nextlinkElem = autoGetLink(); + if (nextlinkElem) { + // 强制模式. + FA = autoMatch.FA; + SSS.Rurl = window.localStorage ? 'am:' + (url.match(/^https?:\/\/[^:]*\//i) || [])[0] : 'am:automatch'; + SSS.enable = true; + SSS.nextLink = 'auto;'; + SSS.viewcontent = autoMatch.viewcontent; + SSS.useiframe = autoMatch.useiframe || SITEINFO_D.autopager.useiframe; + SSS.a_force = true; + SSS.a_manualA = FA.manualA; + SSS.a_enable = FA.enable || SITEINFO_D.autopager.force_enable; // Force join is enabled when this becomes true + SSS.a_useiframe = FA.useiframe || SITEINFO_D.useiframe; + SSS.a_iloaded = FA.iloaded; + SSS.a_itimeout = FA.itimeout; + SSS.a_remain = FA.remain; + SSS.a_maxpage = FA.maxpage; + SSS.a_separator = FA.separator; + SSS.a_ipages = FA.ipages; + } + } + } + + // 如果规则没 lazyImgSrc,设置默认值 + if (!SSS.lazyImgSrc) { + SSS.lazyImgSrc = prefs.lazyImgSrc; + } + logger.debug("[Super-preloader]", `Total time spent on searching for advanced rules and automatic matching: ${new Date().getTime() - startTime.getTime()}ms`); + case 18: + case "end": + return _context6.stop(); + } + }, _callee5); + })); + return function findCurSiteInfo() { + return _ref5.apply(this, arguments); + }; + }(); + findCurSiteInfo().then(function () { + // 上下页都没有找到啊 + if (!nextlinkElem && !prelink) { + logger.warn("[Super-preloader]", `No related links found, JS execution stopped. Total time spent: ${new Date().getTime() - startTime.getTime()}ms`); + return; + } else if (!nextlink) { + logger.error("[Super-preloader]", 'The link to the next page does not exist, JS cannot continue.'); + logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); + return; + } else { + logger.debug("[Super-preloader]", 'Previous link element:', prelink); + logger.debug("[Super-preloader]", 'Next link element:', nextlinkElem); + nextlink = elemToHref(nextlinkElem); + logger.debug("[Super-preloader]", 'Next link:', nextlink); + //@ts-ignore + prelink = prelink ? prelink.href || prelink : undefined; + } + var keyBinding = { + go: function go() { + if (typeof nextlink === 'string') window.location.href = nextlink; + }, + back: function back() { + //fixme + if (!prelink) getElement('auto;'); + if (typeof prelink === 'string') window.location.href = prelink; + }, + register: function register( /**@type {IPrefs} */prefs) { + var _this = this; + if (prefs.arrowKeyPage) { + logger.debug("[Super-preloader]", 'Adding left and right arrow keys to autopager listener.'); + document.addEventListener('keyup', function (e) { + //@ts-ignore + var tarNN = e.target.nodeName; + if (tarNN != 'BODY' && tarNN != 'HTML') return; + + // check is a combo pressed + if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) { + return; + } + switch (e.keyCode) { + case 37: + _this.back(); + break; + case 39: + _this.go(); + break; + } + }, false); + + // 监听下一页事件. + logger.debug("[Super-preloader]", '添加鼠标手势翻页监听'); + document.addEventListener('superPreloader.go', function () { + _this.go(); + }, false); + + // 监听下一页事件. + document.addEventListener('superPreloader.back', function () { + _this.back(); + }, false); + } + } + }; + keyBinding.register(prefs); + loadLocalSetting(SSS); + if (!SSS.enable) { + logger.warn("[Super-preloader]", 'This rule is disabled, script execution is stopped'); + logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); + return; + } + if (!SSS.hasRule) { + SSS.a_force = true; + } + if (SSS.a_force) { + SSS.a_pageElement = '//body/*'; + SSS.a_HT_insert = undefined; + SSS.a_relatedObj = undefined; + } + if (prefs.floatWindow) { + logger.debug("[Super-preloader]", 'Creating a floating window'); + floatWindow(SSS); + var floatWindowWidth = getFloatWindowWith(); + displace(document.getElementById('sp-fw-container'), { + handle: document.getElementById('sp-fw-rect'), + customMove: function customMove(el, x, y) { + delete el.style.left; + delete el.style.bottom; + var right = document.body.clientWidth - floatWindowWidth - x; + if (right < 0) { + right = 0; + } else if (right > window.innerWidth - floatWindowWidth) { + right = window.innerWidth - floatWindowWidth; + } + var top = y; + if (top > window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight) { + top = window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight; + } else if (top < 0) { + top = 0; + } + el.style.right = `${right}px`; + el.style.top = `${top}px`; + }, + onMouseUp: function onMouseUp(el) { + prefs.FW_offset[0] = parseInt(el.style.top.replace('px', ''), 10); + prefs.FW_offset[1] = parseInt(el.style.right.replace('px', ''), 10); + prefs.FW_position = 2; + GM.setValue('prefs', prefs); + } + }); + document.getElementById('sp-fw-container').style.position = 'fixed'; + } + logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); + + // 预读或者翻页. + if (SSS.a_enable) { + logger.debug("[Super-preloader]", 'Initializing, autopager mode.'); + autopager(SSS, floatWO); + } else { + logger.debug("[Super-preloader]", 'Initializing, prefetch mode.'); + prefetcher(SSS, floatWO); + } + }); + + // 获取单个元素,混合 + /** + * + * @param {string|Function|Array|IHrefIncObject} selector selector + * @param {HTMLElement|Document=} contextNode element + * @param {Document=} doc document + * @param {Window=} win window + * @returns {HTMLElement} element + */ + function getElement(selector, contextNode, doc, win) { + var _cplink = cplink; + var ret; + if (!selector) return ret; + doc = doc || document; + win = win || window; + contextNode = contextNode || doc; + if (typeof selector === 'string') { + if (selector.search(/^css;/i) === 0) { + ret = getElementByCSS(selector.slice(4), contextNode); + } else if (selector.toLowerCase() == 'auto;') { + ret = autoGetLink(doc); + } else { + ret = getElementByXpath(selector, contextNode, doc); + } + } else if (typeof selector === 'function') { + ret = selector(doc, win, _cplink); + } else if (selector instanceof Array) { + for (var i = 0, l = selector.length; i < l; i++) { + ret = getElement(selector[i], contextNode, doc, win); + if (ret) { + break; + } + } + } else { + ret = hrefInc(selector, doc, win, _cplink); + } + return ret; + } + var docChecked; + /** + * + * @param {Document=} doc document + * @param {Window=} win window + * @returns {HTMLElement} a + */ + function autoGetLink(doc, win) { + if (!autoMatch.keyMatch) return; + //@ts-ignore + if (!parseKWRE.done) { + parseKWRE(); + //@ts-ignore + parseKWRE.done = true; + } + var startTime = new Date(); + doc = doc || document; + if (doc == document) { + // 当前文档,只检查一次. + if (docChecked) { + // @ts-ignore + return nextlink; + } + docChecked = true; + } + var _prePageKey = prePageKey; + var _nextPageKey = nextPageKey; + var _nPKL = nextPageKey.length; + var _pPKL = prePageKey.length; + var _getFullHref = getFullHref; + var _getAllElementsByXpath = getAllElementsByXpath; + var _Number = Number; + var _domain_port = domain_port; + var alllinks = doc.links; + var alllinksl = alllinks.length; + var curLHref = cplink; + var _nextlink; + var _prelink; + //@ts-ignore + if (!autoGetLink.checked) { + // 第一次检查 + _nextlink = nextlink; + _prelink = prelink; + } else { + _prelink = true; + } + var DCEnable = autoMatch.digitalCheck; + var DCRE = /^\s*\D{0,1}(\d+)\D{0,1}\s*$/; + var i, a, atext, numtext; + var aP; + var initSD; + var searchD = 1; + var preS1; + var preS2; + var searchedD; + var pSNText; + var preSS; + var nodeType; + var nextS1, nextS2, nSNText, nextSS; + var aimgs, j, jj, aimg_x, xbreak, k, keytext; + function finalCheck(a, type) { + var ahref = a.getAttribute('href'); // 在chrome上当是非当前页面文档对象的时候直接用a.href访问,不返回href + if (ahref == '#') { + return null; + } + ahref = _getFullHref(ahref); // 从相对路径获取完全的href; + + // 3个条件:http协议链接,非跳到当前页面的链接,非跨域 + if (/^https?:/i.test(ahref) && ahref.replace(/#.*$/, '') != curLHref && ahref.match(/https?:\/\/([^\/]+)/)[1] == _domain_port) { + logger.debug("[Super-preloader]", type == 'pre' ? 'previous' : 'next' + 'match:', atext); + return a; // 返回对象A + // return ahref; + } + } + logger.debug("[Super-preloader]", `Number of full document links:${alllinksl}`); + for (i = 0; i < alllinksl; i++) { + if (_nextlink && _prelink) break; + a = alllinks[i]; + if (!a) continue; // undefined跳过 + // links集合返回的本来就是包含href的a元素..所以不用检测 + // if(!a.hasAttribute("href"))continue; + atext = a.textContent; + if (atext) { + if (DCEnable) { + numtext = atext.match(DCRE); + if (numtext) { + // 是不是纯数字 + // debug(numtext); + numtext = numtext[1]; + aP = a; + initSD = 0; + if (!_nextlink) { + preS1 = a.previousSibling; + preS2 = a.previousElementSibling; + while (!(preS1 || preS2) && initSD < searchD) { + aP = aP.parentNode; + if (aP) { + preS1 = aP.previousSibling; + //@ts-ignore + preS2 = aP.previousElementSibling; + } + initSD++; + } + searchedD = initSD > 0; + if (preS1 || preS2) { + pSNText = preS1 ? preS1.textContent.match(DCRE) : ''; + if (pSNText) { + preSS = preS1; + } else { + pSNText = preS2 ? preS2.textContent.match(DCRE) : ''; + preSS = preS2; + } + if (pSNText) { + pSNText = pSNText[1]; + if (_Number(pSNText) == _Number(numtext) - 1) { + nodeType = preSS.nodeType; + if (nodeType == 3 || nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', preSS, doc).length === 0 : !preSS.hasAttribute('href') || _getFullHref(preSS.getAttribute('href')) == curLHref)) { + _nextlink = finalCheck(a, 'next'); + } + continue; + } + } + } + } + if (!_prelink) { + nextS1 = a.nextSibling; + nextS2 = a.nextElementSibling; + while (!(nextS1 || nextS2) && initSD < searchD) { + aP = aP.parentNode; + if (aP) { + nextS1 = a.nextSibling; + nextS2 = a.nextElementSibling; + } + initSD++; + } + searchedD = initSD > 0; + if (nextS1 || nextS2) { + nSNText = nextS1 ? nextS1.textContent.match(DCRE) : ''; + if (nSNText) { + nextSS = nextS1; + } else { + nSNText = nextS2 ? nextS2.textContent.match(DCRE) : ''; + nextSS = nextS2; + } + if (nSNText) { + nSNText = nSNText[1]; + if (_Number(nSNText) == _Number(numtext) + 1) { + nodeType = nextSS.nodeType; + if (nodeType == 3 || + // @ts-ignore + nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', nextSS, doc).length === 0 : !nextSS.hasAttribute('href') || _getFullHref(nextSS.getAttribute('href')) == curLHref)) { + _prelink = finalCheck(a, 'pre'); + } + } + } + } + } + continue; + } + } + } else { + atext = a.title; + } + if (!atext) { + aimgs = a.getElementsByTagName('img'); + for (j = 0, jj = aimgs.length; j < jj; j++) { + aimg_x = aimgs[j]; + atext = aimg_x.alt || aimg_x.title; + if (atext) break; + } + } + if (!atext) continue; + if (!_nextlink) { + xbreak = false; + for (k = 0; k < _nPKL; k++) { + keytext = _nextPageKey[k]; + //@ts-ignore + if (!keytext.test(atext)) continue; + _nextlink = finalCheck(a, 'next'); + xbreak = true; + break; + } + if (xbreak || _nextlink) continue; + } + if (!_prelink) { + for (k = 0; k < _pPKL; k++) { + keytext = _prePageKey[k]; + //@ts-ignore + if (!keytext.test(atext)) continue; + _prelink = finalCheck(a, 'pre'); + break; + } + } + } + logger.debug("[Super-preloader]", `Time to search ${i} links:${new Date().getTime() - startTime.getTime()}ms`); + //@ts-ignore + if (!autoGetLink.checked) { + // 只在第一次检测的时候,抛出上一页链接. + prelink = _prelink; + //@ts-ignore + autoGetLink.checked = true; + } + return _nextlink; + } + function parseKWRE() { + function modifyPageKey(name, pageKey, pageKeyLength) { + function strMTE(str) { + return str.replace(/\\/g, '\\\\').replace(/\+/g, '\\+').replace(/\./g, '\\.').replace(/\?/g, '\\?').replace(/\{/g, '\\{').replace(/\}/g, '\\}').replace(/\[/g, '\\[').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/\$/g, '\\$').replace(/\*/g, '\\*').replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/\|/g, '\\|').replace(/\//g, '\\/'); + } + var pfwordl = autoMatch.pfwordl; + var sfwordl = autoMatch.sfwordl; + var RE_enable_a = pfwordl[name].enable; + var RE_maxPrefix = pfwordl[name].maxPrefix; + var RE_character_a = pfwordl[name].character; + var RE_enable_b = sfwordl[name].enable; + var RE_maxSubfix = sfwordl[name].maxSubfix; + var RE_character_b = sfwordl[name].character; + var plwords, slwords, rep; + plwords = RE_maxPrefix > 0 ? '[' + (RE_enable_a ? strMTE(RE_character_a.join('')) : '.') + ']{0,' + RE_maxPrefix + '}' : ''; + plwords = '^\\s*' + plwords; + slwords = RE_maxSubfix > 0 ? '[' + (RE_enable_b ? strMTE(RE_character_b.join('')) : '.') + ']{0,' + RE_maxSubfix + '}' : ''; + slwords = slwords + '\\s*$'; + rep = autoMatch.cases ? '' : 'i'; + for (var i = 0; i < pageKeyLength; i++) { + pageKey[i] = new RegExp(plwords + strMTE(pageKey[i]) + slwords, rep); + } + return pageKey; + } + + // 转成正则. + prePageKey = modifyPageKey('previous', prePageKey, prePageKey.length); + nextPageKey = modifyPageKey('next', nextPageKey, nextPageKey.length); + } + } + + // By lastDream2013 略加修改,原版只能用于 Firefox + function getRalativePageStr(lastUrl, currentUrl, nextUrl) { + var getRalativePageNumArray = function getRalativePageNumArray(lasturl, url) { + if (!lasturl || !url) { + return [0, 0]; + } + var lasturlarray = lasturl.split(/-|\.|\&|\/|=|#|\?/); + var urlarray = url.split(/-|\.|\&|\/|=|#|\?/); + var url_info; + var lasturl_info; + // 一些 url_info 为 p1,p2,p3 之类的 + var handleInfo = function handleInfo(s) { + if (s) { + return s.replace(/^p/, ''); + } + return s; + }; + while (urlarray.length !== 0) { + url_info = handleInfo(urlarray.pop()); + lasturl_info = handleInfo(lasturlarray.pop()); + if (url_info != lasturl_info) { + if (/[0-9]+/.test(url_info) && (url_info == '2' || /[0-9]+/.test(lasturl_info))) { + return [parseInt(lasturl_info) || 1, parseInt(url_info)]; + } + } + } + return [0, 0]; + }; + var relativeOff; + + // 论坛和搜索引擎网页显示实际页面信息 + var relativePageNumarray = []; + if (nextUrl) { + relativePageNumarray = getRalativePageNumArray(currentUrl, nextUrl); + } else { + relativePageNumarray = getRalativePageNumArray(lastUrl, currentUrl); + relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; // 用的上一页的相对信息比较的,要补充差值…… + relativePageNumarray[1] = relativePageNumarray[1] + relativeOff; + relativePageNumarray[0] = relativePageNumarray[0] + relativeOff; + } + + // console.log('[获取实际页数] ', '要比较的3个页数:',arguments, ',得到的差值:', relativePageNumarray); + if (isNaN(relativePageNumarray[0]) || isNaN(relativePageNumarray[1])) { + return ''; + } + var realPageSiteMatch = false; + relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; + // 上一页与下一页差值为1,并最大数值不超过10000(一般论坛也不会超过这么多页……) + if (relativeOff === 1 && relativePageNumarray[1] < 10000) { + realPageSiteMatch = true; + } + + // 上一页与下一页差值不为1,但上一页与下一页差值能被上一页与下一面所整除的,有规律的页面 + if (!realPageSiteMatch && relativeOff !== 1) { + if (relativePageNumarray[1] % relativeOff === 0 && relativePageNumarray[0] % relativeOff === 0) { + realPageSiteMatch = true; + } + } + if (!realPageSiteMatch) { + // 不满足以上条件,再根据地址特征来匹配 + var sitePattern; + for (var i = 0, length = REALPAGE_SITE_PATTERN.length; i < length; i++) { + sitePattern = REALPAGE_SITE_PATTERN[i]; + if (currentUrl.toLocaleLowerCase().indexOf(sitePattern) >= 0) { + realPageSiteMatch = true; + break; + } + } + } + var relativePageStr; + if (realPageSiteMatch) { + // 如果匹配就显示实际网页信息 + if (userLang === 'zh_CN') { + if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { + // 一般是搜索引擎的第xx - xx项…… + relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' 项 ]'; + } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { + // 一般的翻页数,差值应该是1 + relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' 页 ]'; + } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { + // 找不到的话…… + relativePageStr = ' [ 实际网页结束 ]'; + } + } else { + if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { + // 一般是搜索引擎的第xx - xx项…… + relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' ]'; + } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { + // 一般的翻页数,差值应该是1 + relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' ]'; + } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { + // 找不到的话…… + relativePageStr = ' [ Actual elements ends ]'; + } + } + } else { + relativePageStr = ''; + } + return relativePageStr || ''; + } + }).catch(function (err) { + console.log(err); + }); + + // ------------------------下面的不要管他----------------- + /// //////////////////////////////////////////////////////////////// + + // 变量 + var isHashchangeSite = false; + var hashchangeTimer = 0; + + // ==================== libs ============================== + /** + * + * @param {IHrefIncObject} obj obj + * @param {Document=} doc document + * @param {Window=} win window + * @param {string=} cplink cplink + * @returns {string} next link + * @description 地址栏递增处理函数 + */ + function hrefInc(obj, doc, win, cplink) { + var _cplink = cplink; + function getHref(href) { + var mFails = obj.mFails; + if (!mFails) return href; + var str; + if (typeof mFails === 'string') { + str = mFails; + } else { + var array = []; + for (var i = 0, ii = mFails.length; i < ii; i++) { + var fx = mFails[i]; + if (!fx) continue; + if (typeof fx !== 'string' || fx.indexOf('re;') === 0) { + var fxre = typeof fx === 'string' ? toRE(fx.slice(3)) : fx; + var mValue = href.match(fxre); + if (!mValue) return href; + array.push(mValue); + } else { + array.push(fx); + } + } + str = array.join(''); + } + return str; + } + var sa = obj.startAfter; + var index; + if (typeof sa === 'string') { + if (sa[0] == '#') { + _cplink = doc.location.href; + } + index = _cplink.indexOf(sa); + if (index == -1) { + _cplink = getHref(_cplink); + index = _cplink.indexOf(sa); + if (index == -1) return; + } + } else { + var tsa = _cplink.match(sa); + if (!tsa) { + _cplink = getHref(_cplink); + sa = (_cplink.match(sa) || [])[0]; + if (!sa) return; + index = _cplink.indexOf(sa); + if (index == -1) return; + } else { + sa = tsa[0]; + index = _cplink.indexOf(sa); + } + } + index += sa.length; + var max = obj.max === undefined ? 9999 : obj.max; + var min = obj.min === undefined ? 1 : obj.min; + var aStr = _cplink.slice(0, index); + var bStr = _cplink.slice(index); + var nbStr = bStr.replace(/^(\d+)(.*)$/, function (a, b, c) { + b = Number(b) + obj.inc; + if (b >= max || b < min) return a; + return b + c; + }); + if (nbStr !== bStr) { + var ilresult; + try { + ilresult = obj.isLast(doc, unsafeWindow, _cplink); + } catch (e) {} + if (ilresult) return; + return aStr + nbStr; + } + } + + // ==================== functions ============================== + function handleLazyImgSrc(rule, doc) { + var imgAttrs = rule.split('|'); + imgAttrs.forEach(function (attr) { + attr = attr.trim(); + [].forEach.call(doc.querySelectorAll('img[' + attr + ']'), function (img) { + var newSrc = img.getAttribute(attr); + if (newSrc && newSrc != img.src) { + img.setAttribute('src', newSrc); + img.removeAttribute(attr); + } + }); + }); + } + + /** + * + * @param {HTMLDocument} doc Document Fragment + * @param {String} scriptFilter Regex string + * @description Remove scripts node from doc + * @returns {void} + */ + function removeScripts(doc, scriptFilter) { + var scripts = getAllElements('css;script', doc); + var regFilter; + if (scriptFilter) { + regFilter = toRE(scriptFilter); + } + /** @type {HTMLScriptElement} */ + var scripts_x; + for (var i = scripts.length - 1; i >= 0; i--) { + //@ts-ignore + scripts_x = scripts[i]; + var iremove = false; + if (regFilter) { + if (scripts_x.hasOwnProperty('src')) { + if (!regFilter.test(scripts_x.src)) { + iremove = true; + } + } + if (scripts_x.text) { + if (!regFilter.test(scripts_x.text)) { + iremove = true; + } + } + if (iremove) { + scripts_x.parentNode.removeChild(scripts_x); + } + } else { + scripts_x.parentNode.removeChild(scripts_x); + } + } + } + + /** + * + * @param {string} str str + * @returns {HTMLDocument} document + */ + function createDocumentByString(str) { + // string转为DOM + if (!str) { + logger.error("[Super-preloader]", 'No string found to be converted to DOM'); + return; + } + if (document.documentElement.nodeName != 'HTML') { + return new DOMParser().parseFromString(str, 'application/xhtml+xml'); + } + /**@type {HTMLDocument} */ + var doc; + try { + // firefox and chrome 30+,Opera 12 会报错 + doc = new DOMParser().parseFromString(str, 'text/html'); + } catch (ex) {} + if (doc) { + return doc; + } + if (document.implementation.createHTMLDocument) { + doc = document.implementation.createHTMLDocument('superPreloader'); + } else { + try { + //@ts-ignore + doc = document.cloneNode(false); + doc.appendChild(doc.importNode(document.documentElement, false)); + doc.documentElement.appendChild(doc.createElement('head')); + doc.documentElement.appendChild(doc.createElement('body')); + } catch (e) {} + } + if (!doc) return; + var range = document.createRange(); + range.selectNodeContents(document.body); + var fragment = range.createContextualFragment(str); + doc.body.appendChild(fragment); + var headChildNames = { + TITLE: true, + META: true, + LINK: true, + STYLE: true, + BASE: true + }; + var child; + var body = doc.body; + var bchilds = body.childNodes; + for (var i = bchilds.length - 1; i >= 0; i--) { + // 移除head的子元素 + child = bchilds[i]; + if (headChildNames[child.nodeName]) body.removeChild(child); + } + return doc; + } + + /** + * + * @param {string|HTMLElement} href href + * @returns {string} href + * @description 从相对路径的a.href获取完全的href值. + */ + function getFullHref(href) { + // getAttribute may give relative url but href always give full url + if (typeof href !== 'string') href = href.getAttribute('href'); + + /** @type {HTMLAnchorElement} */ + // @ts-ignore + var a = getFullHref.a; + if (!a) { + //@ts-ignore + getFullHref.a = a = document.createElement('a'); + } + a.href = href; + return a.href; + } + function getFloatWindowWith() { + var el = document.getElementById('sp-fw-container'); + /** @type {HTMLElement} */ + //@ts-ignore + var elc = el.cloneNode(true); + elc.id = `${el.id}`; + elc.style.visibility = 'hidden'; + //@ts-ignore + elc.querySelector('#sp-fw-content').style.display = 'block'; + document.body.appendChild(elc); + //@ts-ignore + var width = elc.querySelector('#sp-fw-content').offsetWidth; + elc.remove(); + return width; + } + + /** + * Get next page link from an element + * @param {string | HTMLElement} elem nextlink element + * @returns {String} link of next page + */ + function elemToHref(elem) { + if (!elem) return undefined; + if (typeof elem === 'string' || elem.hasAttribute('href')) { + return getFullHref(elem); + } else { + // eslint-disable-next-line no-script-url + return 'javascript:void(0);'; // pseudo href + } + } + })(); + +})(_asyncToGenerator, _slicedToArray, _regeneratorRuntime, _defineProperty$1); diff --git a/assets/app.1gO23e7I.js b/assets/app.1gO23e7I.js new file mode 100644 index 000000000..555572cfc --- /dev/null +++ b/assets/app.1gO23e7I.js @@ -0,0 +1 @@ +import{R as i}from"./chunks/theme.Bw3nEMJ8.js";import{U as o,a2 as u,a3 as c,a4 as l,a5 as f,a6 as d,a7 as m,a8 as h,a9 as g,aa as A,ab as y,d as P,u as v,k as w,y as C,ac as R,ad as b,ae as E,af as S}from"./chunks/framework.qh4ipt1c.js";function p(e){if(e.extends){const a=p(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=p(i),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return w(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),b(),E(),s.setup&&s.setup(),()=>S(s.Layout)}});async function D(){globalThis.__VITEPRESS__=!0;const e=j(),a=_();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function _(){return g(T)}function j(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&D().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{D as createApp}; diff --git a/assets/baidu.BzHzvwzy.png b/assets/baidu.BzHzvwzy.png new file mode 100644 index 000000000..819acced1 Binary files /dev/null and b/assets/baidu.BzHzvwzy.png differ diff --git a/assets/chunks/framework.qh4ipt1c.js b/assets/chunks/framework.qh4ipt1c.js new file mode 100644 index 000000000..f6bf13a82 --- /dev/null +++ b/assets/chunks/framework.qh4ipt1c.js @@ -0,0 +1,17 @@ +/** +* @vue/shared v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function us(e,t){const n=new Set(e.split(","));return t?s=>n.has(s.toLowerCase()):s=>n.has(s)}const te={},gt=[],xe=()=>{},oo=()=>!1,Dt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ds=e=>e.startsWith("onUpdate:"),re=Object.assign,hs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lo=Object.prototype.hasOwnProperty,Y=(e,t)=>lo.call(e,t),U=Array.isArray,mt=e=>mn(e)==="[object Map]",Ir=e=>mn(e)==="[object Set]",k=e=>typeof e=="function",se=e=>typeof e=="string",ft=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",Lr=e=>(Z(e)||k(e))&&k(e.then)&&k(e.catch),Mr=Object.prototype.toString,mn=e=>Mr.call(e),co=e=>mn(e).slice(8,-1),Nr=e=>mn(e)==="[object Object]",ps=e=>se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,_t=us(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),_n=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ao=/-(\w)/g,Pe=_n(e=>e.replace(ao,(t,n)=>n?n.toUpperCase():"")),fo=/\B([A-Z])/g,ut=_n(e=>e.replace(fo,"-$1").toLowerCase()),yn=_n(e=>e.charAt(0).toUpperCase()+e.slice(1)),nn=_n(e=>e?`on${yn(e)}`:""),Je=(e,t)=>!Object.is(e,t),Fn=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},uo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ho=e=>{const t=se(e)?Number(e):NaN;return isNaN(t)?e:t};let Ds;const Fr=()=>Ds||(Ds=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function gs(e){if(U(e)){const t={};for(let n=0;n{if(n){const s=n.split(go);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ms(e){let t="";if(se(e))t=e;else if(U(e))for(let n=0;nse(e)?e:e==null?"":U(e)||Z(e)&&(e.toString===Mr||!k(e.toString))?JSON.stringify(e,$r,2):String(e),$r=(e,t)=>t&&t.__v_isRef?$r(e,t.value):mt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[Hn(s,i)+" =>"]=r,n),{})}:Ir(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Hn(n))}:ft(t)?Hn(t):Z(t)&&!U(t)&&!Nr(t)?String(t):t,Hn=(e,t="")=>{var n;return ft(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let we;class vo{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=we,!t&&we&&(this.index=(we.scopes||(we.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=we;try{return we=this,t()}finally{we=n}}}on(){we=this}off(){we=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),et()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=ze,n=lt;try{return ze=!0,lt=this,this._runnings++,Vs(this),this.fn()}finally{Us(this),this._runnings--,lt=n,ze=t}}stop(){this.active&&(Vs(this),Us(this),this.onStop&&this.onStop(),this.active=!1)}}function Co(e){return e.value}function Vs(e){e._trackId++,e._depsLength=0}function Us(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},cn=new WeakMap,ct=Symbol(""),ts=Symbol("");function be(e,t,n){if(ze&<){let s=cn.get(e);s||cn.set(e,s=new Map);let r=s.get(n);r||s.set(n,r=Kr(()=>s.delete(n))),Ur(lt,r)}}function $e(e,t,n,s,r,i){const o=cn.get(e);if(!o)return;let l=[];if(t==="clear")l=[...o.values()];else if(n==="length"&&U(e)){const c=Number(s);o.forEach((f,d)=>{(d==="length"||!ft(d)&&d>=c)&&l.push(f)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":U(e)?ps(n)&&l.push(o.get("length")):(l.push(o.get(ct)),mt(e)&&l.push(o.get(ts)));break;case"delete":U(e)||(l.push(o.get(ct)),mt(e)&&l.push(o.get(ts)));break;case"set":mt(e)&&l.push(o.get(ct));break}ys();for(const c of l)c&&Br(c,4);bs()}function xo(e,t){const n=cn.get(e);return n&&n.get(t)}const So=us("__proto__,__v_isRef,__isVue"),kr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ft)),Bs=To();function To(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=J(this);for(let i=0,o=this.length;i{e[t]=function(...n){Ze(),ys();const s=J(this)[t].apply(this,n);return bs(),et(),s}}),e}function Ao(e){ft(e)||(e=String(e));const t=J(this);return be(t,"has",e),t.hasOwnProperty(e)}class Wr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Vo:Xr:i?zr:Gr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=U(t);if(!r){if(o&&Y(Bs,n))return Reflect.get(Bs,n,s);if(n==="hasOwnProperty")return Ao}const l=Reflect.get(t,n,s);return(ft(n)?kr.has(n):So(n))||(r||be(t,"get",n),i)?l:he(l)?o&&ps(n)?l:l.value:Z(l)?r?wn(l):vn(l):l}}class qr extends Wr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const c=Nt(i);if(!an(s)&&!Nt(s)&&(i=J(i),s=J(s)),!U(t)&&he(i)&&!he(s))return c?!1:(i.value=s,!0)}const o=U(t)&&ps(n)?Number(n)e,bn=e=>Reflect.getPrototypeOf(e);function Kt(e,t,n=!1,s=!1){e=e.__v_raw;const r=J(e),i=J(t);n||(Je(t,i)&&be(r,"get",t),be(r,"get",i));const{has:o}=bn(r),l=s?vs:n?Cs:Pt;if(o.call(r,t))return l(e.get(t));if(o.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function kt(e,t=!1){const n=this.__v_raw,s=J(n),r=J(e);return t||(Je(e,r)&&be(s,"has",e),be(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function Wt(e,t=!1){return e=e.__v_raw,!t&&be(J(e),"iterate",ct),Reflect.get(e,"size",e)}function Ks(e){e=J(e);const t=J(this);return bn(t).has.call(t,e)||(t.add(e),$e(t,"add",e,e)),this}function ks(e,t){t=J(t);const n=J(this),{has:s,get:r}=bn(n);let i=s.call(n,e);i||(e=J(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?Je(t,o)&&$e(n,"set",e,t):$e(n,"add",e,t),this}function Ws(e){const t=J(this),{has:n,get:s}=bn(t);let r=n.call(t,e);r||(e=J(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&$e(t,"delete",e,void 0),i}function qs(){const e=J(this),t=e.size!==0,n=e.clear();return t&&$e(e,"clear",void 0,void 0),n}function qt(e,t){return function(s,r){const i=this,o=i.__v_raw,l=J(o),c=t?vs:e?Cs:Pt;return!e&&be(l,"iterate",ct),o.forEach((f,d)=>s.call(r,c(f),c(d),i))}}function Gt(e,t,n){return function(...s){const r=this.__v_raw,i=J(r),o=mt(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,f=r[e](...s),d=n?vs:t?Cs:Pt;return!t&&be(i,"iterate",c?ts:ct),{next(){const{value:h,done:b}=f.next();return b?{value:h,done:b}:{value:l?[d(h[0]),d(h[1])]:d(h),done:b}},[Symbol.iterator](){return this}}}}function Ve(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Mo(){const e={get(i){return Kt(this,i)},get size(){return Wt(this)},has:kt,add:Ks,set:ks,delete:Ws,clear:qs,forEach:qt(!1,!1)},t={get(i){return Kt(this,i,!1,!0)},get size(){return Wt(this)},has:kt,add:Ks,set:ks,delete:Ws,clear:qs,forEach:qt(!1,!0)},n={get(i){return Kt(this,i,!0)},get size(){return Wt(this,!0)},has(i){return kt.call(this,i,!0)},add:Ve("add"),set:Ve("set"),delete:Ve("delete"),clear:Ve("clear"),forEach:qt(!0,!1)},s={get(i){return Kt(this,i,!0,!0)},get size(){return Wt(this,!0)},has(i){return kt.call(this,i,!0)},add:Ve("add"),set:Ve("set"),delete:Ve("delete"),clear:Ve("clear"),forEach:qt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Gt(i,!1,!1),n[i]=Gt(i,!0,!1),t[i]=Gt(i,!1,!0),s[i]=Gt(i,!0,!0)}),[e,n,t,s]}const[No,Po,Fo,Ho]=Mo();function ws(e,t){const n=t?e?Ho:Fo:e?Po:No;return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Y(n,r)&&r in s?n:s,r,i)}const $o={get:ws(!1,!1)},jo={get:ws(!1,!0)},Do={get:ws(!0,!1)};const Gr=new WeakMap,zr=new WeakMap,Xr=new WeakMap,Vo=new WeakMap;function Uo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return e.__v_skip||!Object.isExtensible(e)?0:Uo(co(e))}function vn(e){return Nt(e)?e:Es(e,!1,Oo,$o,Gr)}function Ko(e){return Es(e,!1,Lo,jo,zr)}function wn(e){return Es(e,!0,Io,Do,Xr)}function Es(e,t,n,s,r){if(!Z(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=Bo(e);if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function At(e){return Nt(e)?At(e.__v_raw):!!(e&&e.__v_isReactive)}function Nt(e){return!!(e&&e.__v_isReadonly)}function an(e){return!!(e&&e.__v_isShallow)}function Yr(e){return e?!!e.__v_raw:!1}function J(e){const t=e&&e.__v_raw;return t?J(t):e}function sn(e){return Object.isExtensible(e)&&Pr(e,"__v_skip",!0),e}const Pt=e=>Z(e)?vn(e):e,Cs=e=>Z(e)?wn(e):e;class Jr{constructor(t,n,s,r){this.getter=t,this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new _s(()=>t(this._value),()=>Rt(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=J(this);return(!t._cacheable||t.effect.dirty)&&Je(t._value,t._value=t.effect.run())&&Rt(t,4),xs(t),t.effect._dirtyLevel>=2&&Rt(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function ko(e,t,n=!1){let s,r;const i=k(e);return i?(s=e,r=xe):(s=e.get,r=e.set),new Jr(s,r,i||!r,n)}function xs(e){var t;ze&<&&(e=J(e),Ur(lt,(t=e.dep)!=null?t:e.dep=Kr(()=>e.dep=void 0,e instanceof Jr?e:void 0)))}function Rt(e,t=4,n){e=J(e);const s=e.dep;s&&Br(s,t)}function he(e){return!!(e&&e.__v_isRef===!0)}function ae(e){return Zr(e,!1)}function Qr(e){return Zr(e,!0)}function Zr(e,t){return he(e)?e:new Wo(e,t)}class Wo{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:J(t),this._value=n?t:Pt(t)}get value(){return xs(this),this._value}set value(t){const n=this.__v_isShallow||an(t)||Nt(t);t=n?t:J(t),Je(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Pt(t),Rt(this,4))}}function ei(e){return he(e)?e.value:e}const qo={get:(e,t,n)=>ei(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return he(r)&&!he(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function ti(e){return At(e)?e:new Proxy(e,qo)}class Go{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:s}=t(()=>xs(this),()=>Rt(this));this._get=n,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}function zo(e){return new Go(e)}class Xo{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return xo(J(this._object),this._key)}}class Yo{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Jo(e,t,n){return he(e)?e:k(e)?new Yo(e):Z(e)&&arguments.length>1?Qo(e,t,n):ae(e)}function Qo(e,t,n){const s=e[t];return he(s)?s:new Xo(e,t,n)}/** +* @vue/runtime-core v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Xe(e,t,n,s){try{return s?e(...s):e()}catch(r){En(r,t,n)}}function Se(e,t,n,s){if(k(e)){const r=Xe(e,t,n,s);return r&&Lr(r)&&r.catch(i=>{En(i,t,n)}),r}if(U(e)){const r=[];for(let i=0;i>>1,r=ue[s],i=Ht(r);iMe&&ue.splice(t,1)}function nl(e){U(e)?yt.push(...e):(!ke||!ke.includes(e,e.allowRecurse?it+1:it))&&yt.push(e),si()}function Gs(e,t,n=Ft?Me+1:0){for(;nHt(n)-Ht(s));if(yt.length=0,ke){ke.push(...t);return}for(ke=t,it=0;ite.id==null?1/0:e.id,sl=(e,t)=>{const n=Ht(e)-Ht(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ri(e){ns=!1,Ft=!0,ue.sort(sl);try{for(Me=0;Mese(S)?S.trim():S)),h&&(r=n.map(uo))}let l,c=s[l=nn(t)]||s[l=nn(Pe(t))];!c&&i&&(c=s[l=nn(ut(t))]),c&&Se(c,e,6,r);const f=s[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Se(f,e,6,r)}}function ii(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!k(e)){const c=f=>{const d=ii(f,t,!0);d&&(l=!0,re(o,d))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(Z(e)&&s.set(e,null),null):(U(i)?i.forEach(c=>o[c]=null):re(o,i),Z(e)&&s.set(e,o),o)}function xn(e,t){return!e||!Dt(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,ut(t))||Y(e,t))}let de=null,Sn=null;function un(e){const t=de;return de=e,Sn=e&&e.type.__scopeId||null,t}function Pa(e){Sn=e}function Fa(){Sn=null}function il(e,t=de,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&ir(-1);const i=un(t);let o;try{o=e(...r)}finally{un(i),s._d&&ir(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function $n(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:f,renderCache:d,props:h,data:b,setupState:S,ctx:M,inheritAttrs:N}=e,B=un(e);let q,G;try{if(n.shapeFlag&4){const m=r||s,L=m;q=Ae(f.call(L,m,d,h,S,b,M)),G=l}else{const m=t;q=Ae(m.length>1?m(h,{attrs:l,slots:o,emit:c}):m(h,null)),G=t.props?l:ol(l)}}catch(m){Mt.length=0,En(m,e,1),q=fe(ye)}let g=q;if(G&&N!==!1){const m=Object.keys(G),{shapeFlag:L}=g;m.length&&L&7&&(i&&m.some(ds)&&(G=ll(G,i)),g=Qe(g,G,!1,!0))}return n.dirs&&(g=Qe(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&(g.transition=n.transition),q=g,un(B),q}const ol=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dt(n))&&((t||(t={}))[n]=e[n]);return t},ll=(e,t)=>{const n={};for(const s in e)(!ds(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function cl(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,f=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?zs(s,o,f):!!o;if(c&8){const d=t.dynamicProps;for(let h=0;he.__isSuspense;function ci(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):nl(e)}const ul=Symbol.for("v-scx"),dl=()=>vt(ul);function ai(e,t){return Tn(e,null,t)}function ja(e,t){return Tn(e,null,{flush:"post"})}const zt={};function Ne(e,t,n){return Tn(e,t,n)}function Tn(e,t,{immediate:n,deep:s,flush:r,once:i,onTrack:o,onTrigger:l}=te){if(t&&i){const O=t;t=(...D)=>{O(...D),L()}}const c=ce,f=O=>s===!0?O:pt(O,s===!1?1:void 0);let d,h=!1,b=!1;if(he(e)?(d=()=>e.value,h=an(e)):At(e)?(d=()=>f(e),h=!0):U(e)?(b=!0,h=e.some(O=>At(O)||an(O)),d=()=>e.map(O=>{if(he(O))return O.value;if(At(O))return f(O);if(k(O))return Xe(O,c,2)})):k(e)?t?d=()=>Xe(e,c,2):d=()=>(S&&S(),Se(e,c,3,[M])):d=xe,t&&s){const O=d;d=()=>pt(O())}let S,M=O=>{S=g.onStop=()=>{Xe(O,c,4),S=g.onStop=void 0}},N;if(Ln)if(M=xe,t?n&&Se(t,c,3,[d(),b?[]:void 0,M]):d(),r==="sync"){const O=dl();N=O.__watcherHandles||(O.__watcherHandles=[])}else return xe;let B=b?new Array(e.length).fill(zt):zt;const q=()=>{if(!(!g.active||!g.dirty))if(t){const O=g.run();(s||h||(b?O.some((D,A)=>Je(D,B[A])):Je(O,B)))&&(S&&S(),Se(t,c,3,[O,B===zt?void 0:b&&B[0]===zt?[]:B,M]),B=O)}else g.run()};q.allowRecurse=!!t;let G;r==="sync"?G=q:r==="post"?G=()=>me(q,c&&c.suspense):(q.pre=!0,c&&(q.id=c.uid),G=()=>Ts(q));const g=new _s(d,xe,G),m=jr(),L=()=>{g.stop(),m&&hs(m.effects,g)};return t?n?q():B=g.run():r==="post"?me(g.run.bind(g),c&&c.suspense):g.run(),N&&N.push(L),L}function hl(e,t,n){const s=this.proxy,r=se(e)?e.includes(".")?fi(s,e):()=>s[e]:e.bind(s,s);let i;k(t)?i=t:(i=t.handler,n=t);const o=Vt(this),l=Tn(r,i.bind(s),n);return o(),l}function fi(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{pt(s,t,n)});else if(Nr(e))for(const s in e)pt(e[s],t,n);return e}function Le(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o{e.isMounted=!0}),mi(()=>{e.isUnmounting=!0}),e}const Ee=[Function,Array],ui={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ee,onEnter:Ee,onAfterEnter:Ee,onEnterCancelled:Ee,onBeforeLeave:Ee,onLeave:Ee,onAfterLeave:Ee,onLeaveCancelled:Ee,onBeforeAppear:Ee,onAppear:Ee,onAfterAppear:Ee,onAppearCancelled:Ee},gl={name:"BaseTransition",props:ui,setup(e,{slots:t}){const n=In(),s=pl();return()=>{const r=t.default&&hi(t.default(),!0);if(!r||!r.length)return;let i=r[0];if(r.length>1){for(const b of r)if(b.type!==ye){i=b;break}}const o=J(e),{mode:l}=o;if(s.isLeaving)return jn(i);const c=Ys(i);if(!c)return jn(i);const f=ss(c,o,s,n);rs(c,f);const d=n.subTree,h=d&&Ys(d);if(h&&h.type!==ye&&!ot(c,h)){const b=ss(h,o,s,n);if(rs(h,b),l==="out-in"&&c.type!==ye)return s.isLeaving=!0,b.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},jn(i);l==="in-out"&&c.type!==ye&&(b.delayLeave=(S,M,N)=>{const B=di(s,h);B[String(h.key)]=h,S[We]=()=>{M(),S[We]=void 0,delete f.delayedLeave},f.delayedLeave=N})}return i}}},ml=gl;function di(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function ss(e,t,n,s){const{appear:r,mode:i,persisted:o=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:f,onEnterCancelled:d,onBeforeLeave:h,onLeave:b,onAfterLeave:S,onLeaveCancelled:M,onBeforeAppear:N,onAppear:B,onAfterAppear:q,onAppearCancelled:G}=t,g=String(e.key),m=di(n,e),L=(A,j)=>{A&&Se(A,s,9,j)},O=(A,j)=>{const w=j[1];L(A,j),U(A)?A.every(V=>V.length<=1)&&w():A.length<=1&&w()},D={mode:i,persisted:o,beforeEnter(A){let j=l;if(!n.isMounted)if(r)j=N||l;else return;A[We]&&A[We](!0);const w=m[g];w&&ot(e,w)&&w.el[We]&&w.el[We](),L(j,[A])},enter(A){let j=c,w=f,V=d;if(!n.isMounted)if(r)j=B||c,w=q||f,V=G||d;else return;let x=!1;const W=A[Xt]=ie=>{x||(x=!0,ie?L(V,[A]):L(w,[A]),D.delayedLeave&&D.delayedLeave(),A[Xt]=void 0)};j?O(j,[A,W]):W()},leave(A,j){const w=String(e.key);if(A[Xt]&&A[Xt](!0),n.isUnmounting)return j();L(h,[A]);let V=!1;const x=A[We]=W=>{V||(V=!0,j(),W?L(M,[A]):L(S,[A]),A[We]=void 0,m[w]===e&&delete m[w])};m[w]=e,b?O(b,[A,x]):x()},clone(A){return ss(A,t,n,s)}};return D}function jn(e){if(An(e))return e=Qe(e),e.children=null,e}function Ys(e){if(!An(e))return e;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&k(n.default))return n.default()}}function rs(e,t){e.shapeFlag&6&&e.component?rs(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function hi(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader,An=e=>e.type.__isKeepAlive;function _l(e,t){gi(e,"a",t)}function yl(e,t){gi(e,"da",t)}function gi(e,t,n=ce){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Rn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)An(r.parent.vnode)&&bl(s,t,n,r),r=r.parent}}function bl(e,t,n,s){const r=Rn(t,e,s,!0);On(()=>{hs(s[t],r)},n)}function Rn(e,t,n=ce,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Ze();const l=Vt(n),c=Se(t,n,e,o);return l(),et(),c});return s?r.unshift(i):r.push(i),i}}const De=e=>(t,n=ce)=>(!Ln||e==="sp")&&Rn(e,(...s)=>t(...s),n),vl=De("bm"),Ct=De("m"),wl=De("bu"),El=De("u"),mi=De("bum"),On=De("um"),Cl=De("sp"),xl=De("rtg"),Sl=De("rtc");function Tl(e,t=ce){Rn("ec",e,t)}function Da(e,t,n,s){let r;const i=n&&n[s];if(U(e)||se(e)){r=new Array(e.length);for(let o=0,l=e.length;ot(o,l,void 0,i&&i[l]));else{const o=Object.keys(e);r=new Array(o.length);for(let l=0,c=o.length;lpn(t)?!(t.type===ye||t.type===_e&&!_i(t.children)):!0)?e:null}function Ua(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:nn(s)]=e[s];return n}const is=e=>e?$i(e)?Ls(e)||e.proxy:is(e.parent):null,Ot=re(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>is(e.parent),$root:e=>is(e.root),$emit:e=>e.emit,$options:e=>Rs(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Ts(e.update)}),$nextTick:e=>e.n||(e.n=Cn.bind(e.proxy)),$watch:e=>hl.bind(e)}),Dn=(e,t)=>e!==te&&!e.__isScriptSetup&&Y(e,t),Al={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let f;if(t[0]!=="$"){const S=o[t];if(S!==void 0)switch(S){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Dn(s,t))return o[t]=1,s[t];if(r!==te&&Y(r,t))return o[t]=2,r[t];if((f=e.propsOptions[0])&&Y(f,t))return o[t]=3,i[t];if(n!==te&&Y(n,t))return o[t]=4,n[t];os&&(o[t]=0)}}const d=Ot[t];let h,b;if(d)return t==="$attrs"&&be(e.attrs,"get",""),d(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==te&&Y(n,t))return o[t]=4,n[t];if(b=c.config.globalProperties,Y(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Dn(r,t)?(r[t]=n,!0):s!==te&&Y(s,t)?(s[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==te&&Y(e,o)||Dn(t,o)||(l=i[0])&&Y(l,o)||Y(s,o)||Y(Ot,o)||Y(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ba(){return Rl().slots}function Rl(){const e=In();return e.setupContext||(e.setupContext=Di(e))}function Js(e){return U(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let os=!0;function Ol(e){const t=Rs(e),n=e.proxy,s=e.ctx;os=!1,t.beforeCreate&&Qs(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:f,created:d,beforeMount:h,mounted:b,beforeUpdate:S,updated:M,activated:N,deactivated:B,beforeDestroy:q,beforeUnmount:G,destroyed:g,unmounted:m,render:L,renderTracked:O,renderTriggered:D,errorCaptured:A,serverPrefetch:j,expose:w,inheritAttrs:V,components:x,directives:W,filters:ie}=t;if(f&&Il(f,s,null),o)for(const X in o){const F=o[X];k(F)&&(s[X]=F.bind(n))}if(r){const X=r.call(n,n);Z(X)&&(e.data=vn(X))}if(os=!0,i)for(const X in i){const F=i[X],Fe=k(F)?F.bind(n,n):k(F.get)?F.get.bind(n,n):xe,Ut=!k(F)&&k(F.set)?F.set.bind(n):xe,tt=ne({get:Fe,set:Ut});Object.defineProperty(s,X,{enumerable:!0,configurable:!0,get:()=>tt.value,set:Oe=>tt.value=Oe})}if(l)for(const X in l)yi(l[X],s,n,X);if(c){const X=k(c)?c.call(n):c;Reflect.ownKeys(X).forEach(F=>{Hl(F,X[F])})}d&&Qs(d,e,"c");function H(X,F){U(F)?F.forEach(Fe=>X(Fe.bind(n))):F&&X(F.bind(n))}if(H(vl,h),H(Ct,b),H(wl,S),H(El,M),H(_l,N),H(yl,B),H(Tl,A),H(Sl,O),H(xl,D),H(mi,G),H(On,m),H(Cl,j),U(w))if(w.length){const X=e.exposed||(e.exposed={});w.forEach(F=>{Object.defineProperty(X,F,{get:()=>n[F],set:Fe=>n[F]=Fe})})}else e.exposed||(e.exposed={});L&&e.render===xe&&(e.render=L),V!=null&&(e.inheritAttrs=V),x&&(e.components=x),W&&(e.directives=W)}function Il(e,t,n=xe){U(e)&&(e=ls(e));for(const s in e){const r=e[s];let i;Z(r)?"default"in r?i=vt(r.from||s,r.default,!0):i=vt(r.from||s):i=vt(r),he(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Qs(e,t,n){Se(U(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function yi(e,t,n,s){const r=s.includes(".")?fi(n,s):()=>n[s];if(se(e)){const i=t[e];k(i)&&Ne(r,i)}else if(k(e))Ne(r,e.bind(n));else if(Z(e))if(U(e))e.forEach(i=>yi(i,t,n,s));else{const i=k(e.handler)?e.handler.bind(n):t[e.handler];k(i)&&Ne(r,i,e)}}function Rs(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(f=>dn(c,f,o,!0)),dn(c,t,o)),Z(t)&&i.set(t,c),c}function dn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&dn(e,i,n,!0),r&&r.forEach(o=>dn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=Ll[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const Ll={data:Zs,props:er,emits:er,methods:Tt,computed:Tt,beforeCreate:pe,created:pe,beforeMount:pe,mounted:pe,beforeUpdate:pe,updated:pe,beforeDestroy:pe,beforeUnmount:pe,destroyed:pe,unmounted:pe,activated:pe,deactivated:pe,errorCaptured:pe,serverPrefetch:pe,components:Tt,directives:Tt,watch:Nl,provide:Zs,inject:Ml};function Zs(e,t){return t?e?function(){return re(k(e)?e.call(this,this):e,k(t)?t.call(this,this):t)}:t:e}function Ml(e,t){return Tt(ls(e),ls(t))}function ls(e){if(U(e)){const t={};for(let n=0;n1)return n&&k(t)?t.call(s&&s.proxy):t}}const vi={},wi=()=>Object.create(vi),Ei=e=>Object.getPrototypeOf(e)===vi;function $l(e,t,n,s=!1){const r={},i=wi();e.propsDefaults=Object.create(null),Ci(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:Ko(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function jl(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=J(r),[c]=e.propsOptions;let f=!1;if((s||o>0)&&!(o&16)){if(o&8){const d=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[b,S]=xi(h,t,!0);re(o,b),S&&l.push(...S)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!c)return Z(e)&&s.set(e,gt),gt;if(U(i))for(let d=0;d-1,S[1]=N<0||M-1||Y(S,"default"))&&l.push(h)}}}const f=[o,l];return Z(e)&&s.set(e,f),f}function tr(e){return e[0]!=="$"&&!_t(e)}function nr(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function sr(e,t){return nr(e)===nr(t)}function rr(e,t){return U(t)?t.findIndex(n=>sr(n,e)):k(t)&&sr(t,e)?0:-1}const Si=e=>e[0]==="_"||e==="$stable",Os=e=>U(e)?e.map(Ae):[Ae(e)],Dl=(e,t,n)=>{if(t._n)return t;const s=il((...r)=>Os(t(...r)),n);return s._c=!1,s},Ti=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Si(r))continue;const i=e[r];if(k(i))t[r]=Dl(r,i,s);else if(i!=null){const o=Os(i);t[r]=()=>o}}},Ai=(e,t)=>{const n=Os(t);e.slots.default=()=>n},Vl=(e,t)=>{const n=e.slots=wi();if(e.vnode.shapeFlag&32){const s=t._;s?(re(n,t),Pr(n,"_",s,!0)):Ti(t,n)}else t&&Ai(e,t)},Ul=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=te;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(re(r,t),!n&&l===1&&delete r._):(i=!t.$stable,Ti(t,r)),o=t}else t&&(Ai(e,t),o={default:1});if(i)for(const l in r)!Si(l)&&o[l]==null&&delete r[l]};function hn(e,t,n,s,r=!1){if(U(e)){e.forEach((b,S)=>hn(b,t&&(U(t)?t[S]:t),n,s,r));return}if(bt(s)&&!r)return;const i=s.shapeFlag&4?Ls(s.component)||s.component.proxy:s.el,o=r?null:i,{i:l,r:c}=e,f=t&&t.r,d=l.refs===te?l.refs={}:l.refs,h=l.setupState;if(f!=null&&f!==c&&(se(f)?(d[f]=null,Y(h,f)&&(h[f]=null)):he(f)&&(f.value=null)),k(c))Xe(c,l,12,[o,d]);else{const b=se(c),S=he(c);if(b||S){const M=()=>{if(e.f){const N=b?Y(h,c)?h[c]:d[c]:c.value;r?U(N)&&hs(N,i):U(N)?N.includes(i)||N.push(i):b?(d[c]=[i],Y(h,c)&&(h[c]=d[c])):(c.value=[i],e.k&&(d[e.k]=c.value))}else b?(d[c]=o,Y(h,c)&&(h[c]=o)):S&&(c.value=o,e.k&&(d[e.k]=o))};o?(M.id=-1,me(M,n)):M()}}}let Ue=!1;const Bl=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Kl=e=>e.namespaceURI.includes("MathML"),Yt=e=>{if(Bl(e))return"svg";if(Kl(e))return"mathml"},Jt=e=>e.nodeType===8;function kl(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:c,createComment:f}}=e,d=(g,m)=>{if(!m.hasChildNodes()){n(null,g,m),fn(),m._vnode=g;return}Ue=!1,h(m.firstChild,g,null,null,null),fn(),m._vnode=g,Ue&&console.error("Hydration completed but contains mismatches.")},h=(g,m,L,O,D,A=!1)=>{A=A||!!m.dynamicChildren;const j=Jt(g)&&g.data==="[",w=()=>N(g,m,L,O,D,j),{type:V,ref:x,shapeFlag:W,patchFlag:ie}=m;let le=g.nodeType;m.el=g,ie===-2&&(A=!1,m.dynamicChildren=null);let H=null;switch(V){case wt:le!==3?m.children===""?(c(m.el=r(""),o(g),g),H=g):H=w():(g.data!==m.children&&(Ue=!0,g.data=m.children),H=i(g));break;case ye:G(g)?(H=i(g),q(m.el=g.content.firstChild,g,L)):le!==8||j?H=w():H=i(g);break;case Lt:if(j&&(g=i(g),le=g.nodeType),le===1||le===3){H=g;const X=!m.children.length;for(let F=0;F{A=A||!!m.dynamicChildren;const{type:j,props:w,patchFlag:V,shapeFlag:x,dirs:W,transition:ie}=m,le=j==="input"||j==="option";if(le||V!==-1){W&&Le(m,null,L,"created");let H=!1;if(G(g)){H=Ri(O,ie)&&L&&L.vnode.props&&L.vnode.props.appear;const F=g.content.firstChild;H&&ie.beforeEnter(F),q(F,g,L),m.el=g=F}if(x&16&&!(w&&(w.innerHTML||w.textContent))){let F=S(g.firstChild,m,g,L,O,D,A);for(;F;){Ue=!0;const Fe=F;F=F.nextSibling,l(Fe)}}else x&8&&g.textContent!==m.children&&(Ue=!0,g.textContent=m.children);if(w)if(le||!A||V&48)for(const F in w)(le&&(F.endsWith("value")||F==="indeterminate")||Dt(F)&&!_t(F)||F[0]===".")&&s(g,F,null,w[F],void 0,void 0,L);else w.onClick&&s(g,"onClick",null,w.onClick,void 0,void 0,L);let X;(X=w&&w.onVnodeBeforeMount)&&Ce(X,L,m),W&&Le(m,null,L,"beforeMount"),((X=w&&w.onVnodeMounted)||W||H)&&ci(()=>{X&&Ce(X,L,m),H&&ie.enter(g),W&&Le(m,null,L,"mounted")},O)}return g.nextSibling},S=(g,m,L,O,D,A,j)=>{j=j||!!m.dynamicChildren;const w=m.children,V=w.length;for(let x=0;x{const{slotScopeIds:j}=m;j&&(D=D?D.concat(j):j);const w=o(g),V=S(i(g),m,w,L,O,D,A);return V&&Jt(V)&&V.data==="]"?i(m.anchor=V):(Ue=!0,c(m.anchor=f("]"),w,V),V)},N=(g,m,L,O,D,A)=>{if(Ue=!0,m.el=null,A){const V=B(g);for(;;){const x=i(g);if(x&&x!==V)l(x);else break}}const j=i(g),w=o(g);return l(g),n(null,m,w,j,L,O,Yt(w),D),j},B=(g,m="[",L="]")=>{let O=0;for(;g;)if(g=i(g),g&&Jt(g)&&(g.data===m&&O++,g.data===L)){if(O===0)return i(g);O--}return g},q=(g,m,L)=>{const O=m.parentNode;O&&O.replaceChild(g,m);let D=L;for(;D;)D.vnode.el===m&&(D.vnode.el=D.subTree.el=g),D=D.parent},G=g=>g.nodeType===1&&g.tagName.toLowerCase()==="template";return[d,h]}const me=ci;function Wl(e){return ql(e,kl)}function ql(e,t){const n=Fr();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:f,setElementText:d,parentNode:h,nextSibling:b,setScopeId:S=xe,insertStaticContent:M}=e,N=(a,u,p,_=null,y=null,C=null,R=void 0,E=null,T=!!u.dynamicChildren)=>{if(a===u)return;a&&!ot(a,u)&&(_=Bt(a),Oe(a,y,C,!0),a=null),u.patchFlag===-2&&(T=!1,u.dynamicChildren=null);const{type:v,ref:I,shapeFlag:$}=u;switch(v){case wt:B(a,u,p,_);break;case ye:q(a,u,p,_);break;case Lt:a==null&&G(u,p,_,R);break;case _e:x(a,u,p,_,y,C,R,E,T);break;default:$&1?L(a,u,p,_,y,C,R,E,T):$&6?W(a,u,p,_,y,C,R,E,T):($&64||$&128)&&v.process(a,u,p,_,y,C,R,E,T,dt)}I!=null&&y&&hn(I,a&&a.ref,C,u||a,!u)},B=(a,u,p,_)=>{if(a==null)s(u.el=l(u.children),p,_);else{const y=u.el=a.el;u.children!==a.children&&f(y,u.children)}},q=(a,u,p,_)=>{a==null?s(u.el=c(u.children||""),p,_):u.el=a.el},G=(a,u,p,_)=>{[a.el,a.anchor]=M(a.children,u,p,_,a.el,a.anchor)},g=({el:a,anchor:u},p,_)=>{let y;for(;a&&a!==u;)y=b(a),s(a,p,_),a=y;s(u,p,_)},m=({el:a,anchor:u})=>{let p;for(;a&&a!==u;)p=b(a),r(a),a=p;r(u)},L=(a,u,p,_,y,C,R,E,T)=>{u.type==="svg"?R="svg":u.type==="math"&&(R="mathml"),a==null?O(u,p,_,y,C,R,E,T):j(a,u,y,C,R,E,T)},O=(a,u,p,_,y,C,R,E)=>{let T,v;const{props:I,shapeFlag:$,transition:P,dirs:K}=a;if(T=a.el=o(a.type,C,I&&I.is,I),$&8?d(T,a.children):$&16&&A(a.children,T,null,_,y,Vn(a,C),R,E),K&&Le(a,null,_,"created"),D(T,a,a.scopeId,R,_),I){for(const Q in I)Q!=="value"&&!_t(Q)&&i(T,Q,null,I[Q],C,a.children,_,y,He);"value"in I&&i(T,"value",null,I.value,C),(v=I.onVnodeBeforeMount)&&Ce(v,_,a)}K&&Le(a,null,_,"beforeMount");const z=Ri(y,P);z&&P.beforeEnter(T),s(T,u,p),((v=I&&I.onVnodeMounted)||z||K)&&me(()=>{v&&Ce(v,_,a),z&&P.enter(T),K&&Le(a,null,_,"mounted")},y)},D=(a,u,p,_,y)=>{if(p&&S(a,p),_)for(let C=0;C<_.length;C++)S(a,_[C]);if(y){let C=y.subTree;if(u===C){const R=y.vnode;D(a,R,R.scopeId,R.slotScopeIds,y.parent)}}},A=(a,u,p,_,y,C,R,E,T=0)=>{for(let v=T;v{const E=u.el=a.el;let{patchFlag:T,dynamicChildren:v,dirs:I}=u;T|=a.patchFlag&16;const $=a.props||te,P=u.props||te;let K;if(p&&nt(p,!1),(K=P.onVnodeBeforeUpdate)&&Ce(K,p,u,a),I&&Le(u,a,p,"beforeUpdate"),p&&nt(p,!0),v?w(a.dynamicChildren,v,E,p,_,Vn(u,y),C):R||F(a,u,E,null,p,_,Vn(u,y),C,!1),T>0){if(T&16)V(E,u,$,P,p,_,y);else if(T&2&&$.class!==P.class&&i(E,"class",null,P.class,y),T&4&&i(E,"style",$.style,P.style,y),T&8){const z=u.dynamicProps;for(let Q=0;Q{K&&Ce(K,p,u,a),I&&Le(u,a,p,"updated")},_)},w=(a,u,p,_,y,C,R)=>{for(let E=0;E{if(p!==_){if(p!==te)for(const E in p)!_t(E)&&!(E in _)&&i(a,E,p[E],null,R,u.children,y,C,He);for(const E in _){if(_t(E))continue;const T=_[E],v=p[E];T!==v&&E!=="value"&&i(a,E,v,T,R,u.children,y,C,He)}"value"in _&&i(a,"value",p.value,_.value,R)}},x=(a,u,p,_,y,C,R,E,T)=>{const v=u.el=a?a.el:l(""),I=u.anchor=a?a.anchor:l("");let{patchFlag:$,dynamicChildren:P,slotScopeIds:K}=u;K&&(E=E?E.concat(K):K),a==null?(s(v,p,_),s(I,p,_),A(u.children||[],p,I,y,C,R,E,T)):$>0&&$&64&&P&&a.dynamicChildren?(w(a.dynamicChildren,P,p,y,C,R,E),(u.key!=null||y&&u===y.subTree)&&Oi(a,u,!0)):F(a,u,p,I,y,C,R,E,T)},W=(a,u,p,_,y,C,R,E,T)=>{u.slotScopeIds=E,a==null?u.shapeFlag&512?y.ctx.activate(u,p,_,R,T):ie(u,p,_,y,C,R,T):le(a,u,T)},ie=(a,u,p,_,y,C,R)=>{const E=a.component=tc(a,_,y);if(An(a)&&(E.ctx.renderer=dt),nc(E),E.asyncDep){if(y&&y.registerDep(E,H),!a.el){const T=E.subTree=fe(ye);q(null,T,u,p)}}else H(E,a,u,p,y,C,R)},le=(a,u,p)=>{const _=u.component=a.component;if(cl(a,u,p))if(_.asyncDep&&!_.asyncResolved){X(_,u,p);return}else _.next=u,tl(_.update),_.effect.dirty=!0,_.update();else u.el=a.el,_.vnode=u},H=(a,u,p,_,y,C,R)=>{const E=()=>{if(a.isMounted){let{next:I,bu:$,u:P,parent:K,vnode:z}=a;{const ht=Ii(a);if(ht){I&&(I.el=z.el,X(a,I,R)),ht.asyncDep.then(()=>{a.isUnmounted||E()});return}}let Q=I,ee;nt(a,!1),I?(I.el=z.el,X(a,I,R)):I=z,$&&Fn($),(ee=I.props&&I.props.onVnodeBeforeUpdate)&&Ce(ee,K,I,z),nt(a,!0);const oe=$n(a),Te=a.subTree;a.subTree=oe,N(Te,oe,h(Te.el),Bt(Te),a,y,C),I.el=oe.el,Q===null&&al(a,oe.el),P&&me(P,y),(ee=I.props&&I.props.onVnodeUpdated)&&me(()=>Ce(ee,K,I,z),y)}else{let I;const{el:$,props:P}=u,{bm:K,m:z,parent:Q}=a,ee=bt(u);if(nt(a,!1),K&&Fn(K),!ee&&(I=P&&P.onVnodeBeforeMount)&&Ce(I,Q,u),nt(a,!0),$&&Pn){const oe=()=>{a.subTree=$n(a),Pn($,a.subTree,a,y,null)};ee?u.type.__asyncLoader().then(()=>!a.isUnmounted&&oe()):oe()}else{const oe=a.subTree=$n(a);N(null,oe,p,_,a,y,C),u.el=oe.el}if(z&&me(z,y),!ee&&(I=P&&P.onVnodeMounted)){const oe=u;me(()=>Ce(I,Q,oe),y)}(u.shapeFlag&256||Q&&bt(Q.vnode)&&Q.vnode.shapeFlag&256)&&a.a&&me(a.a,y),a.isMounted=!0,u=p=_=null}},T=a.effect=new _s(E,xe,()=>Ts(v),a.scope),v=a.update=()=>{T.dirty&&T.run()};v.id=a.uid,nt(a,!0),v()},X=(a,u,p)=>{u.component=a;const _=a.vnode.props;a.vnode=u,a.next=null,jl(a,u.props,_,p),Ul(a,u.children,p),Ze(),Gs(a),et()},F=(a,u,p,_,y,C,R,E,T=!1)=>{const v=a&&a.children,I=a?a.shapeFlag:0,$=u.children,{patchFlag:P,shapeFlag:K}=u;if(P>0){if(P&128){Ut(v,$,p,_,y,C,R,E,T);return}else if(P&256){Fe(v,$,p,_,y,C,R,E,T);return}}K&8?(I&16&&He(v,y,C),$!==v&&d(p,$)):I&16?K&16?Ut(v,$,p,_,y,C,R,E,T):He(v,y,C,!0):(I&8&&d(p,""),K&16&&A($,p,_,y,C,R,E,T))},Fe=(a,u,p,_,y,C,R,E,T)=>{a=a||gt,u=u||gt;const v=a.length,I=u.length,$=Math.min(v,I);let P;for(P=0;P<$;P++){const K=u[P]=T?qe(u[P]):Ae(u[P]);N(a[P],K,p,null,y,C,R,E,T)}v>I?He(a,y,C,!0,!1,$):A(u,p,_,y,C,R,E,T,$)},Ut=(a,u,p,_,y,C,R,E,T)=>{let v=0;const I=u.length;let $=a.length-1,P=I-1;for(;v<=$&&v<=P;){const K=a[v],z=u[v]=T?qe(u[v]):Ae(u[v]);if(ot(K,z))N(K,z,p,null,y,C,R,E,T);else break;v++}for(;v<=$&&v<=P;){const K=a[$],z=u[P]=T?qe(u[P]):Ae(u[P]);if(ot(K,z))N(K,z,p,null,y,C,R,E,T);else break;$--,P--}if(v>$){if(v<=P){const K=P+1,z=KP)for(;v<=$;)Oe(a[v],y,C,!0),v++;else{const K=v,z=v,Q=new Map;for(v=z;v<=P;v++){const ve=u[v]=T?qe(u[v]):Ae(u[v]);ve.key!=null&&Q.set(ve.key,v)}let ee,oe=0;const Te=P-z+1;let ht=!1,Hs=0;const xt=new Array(Te);for(v=0;v=Te){Oe(ve,y,C,!0);continue}let Ie;if(ve.key!=null)Ie=Q.get(ve.key);else for(ee=z;ee<=P;ee++)if(xt[ee-z]===0&&ot(ve,u[ee])){Ie=ee;break}Ie===void 0?Oe(ve,y,C,!0):(xt[Ie-z]=v+1,Ie>=Hs?Hs=Ie:ht=!0,N(ve,u[Ie],p,null,y,C,R,E,T),oe++)}const $s=ht?Gl(xt):gt;for(ee=$s.length-1,v=Te-1;v>=0;v--){const ve=z+v,Ie=u[ve],js=ve+1{const{el:C,type:R,transition:E,children:T,shapeFlag:v}=a;if(v&6){tt(a.component.subTree,u,p,_);return}if(v&128){a.suspense.move(u,p,_);return}if(v&64){R.move(a,u,p,dt);return}if(R===_e){s(C,u,p);for(let $=0;$E.enter(C),y);else{const{leave:$,delayLeave:P,afterLeave:K}=E,z=()=>s(C,u,p),Q=()=>{$(C,()=>{z(),K&&K()})};P?P(C,z,Q):Q()}else s(C,u,p)},Oe=(a,u,p,_=!1,y=!1)=>{const{type:C,props:R,ref:E,children:T,dynamicChildren:v,shapeFlag:I,patchFlag:$,dirs:P}=a;if(E!=null&&hn(E,null,p,a,!0),I&256){u.ctx.deactivate(a);return}const K=I&1&&P,z=!bt(a);let Q;if(z&&(Q=R&&R.onVnodeBeforeUnmount)&&Ce(Q,u,a),I&6)io(a.component,p,_);else{if(I&128){a.suspense.unmount(p,_);return}K&&Le(a,null,u,"beforeUnmount"),I&64?a.type.remove(a,u,p,y,dt,_):v&&(C!==_e||$>0&&$&64)?He(v,u,p,!1,!0):(C===_e&&$&384||!y&&I&16)&&He(T,u,p),_&&Ps(a)}(z&&(Q=R&&R.onVnodeUnmounted)||K)&&me(()=>{Q&&Ce(Q,u,a),K&&Le(a,null,u,"unmounted")},p)},Ps=a=>{const{type:u,el:p,anchor:_,transition:y}=a;if(u===_e){ro(p,_);return}if(u===Lt){m(a);return}const C=()=>{r(p),y&&!y.persisted&&y.afterLeave&&y.afterLeave()};if(a.shapeFlag&1&&y&&!y.persisted){const{leave:R,delayLeave:E}=y,T=()=>R(p,C);E?E(a.el,C,T):T()}else C()},ro=(a,u)=>{let p;for(;a!==u;)p=b(a),r(a),a=p;r(u)},io=(a,u,p)=>{const{bum:_,scope:y,update:C,subTree:R,um:E}=a;_&&Fn(_),y.stop(),C&&(C.active=!1,Oe(R,a,u,p)),E&&me(E,u),me(()=>{a.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&a.asyncDep&&!a.asyncResolved&&a.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},He=(a,u,p,_=!1,y=!1,C=0)=>{for(let R=C;Ra.shapeFlag&6?Bt(a.component.subTree):a.shapeFlag&128?a.suspense.next():b(a.anchor||a.el);let Mn=!1;const Fs=(a,u,p)=>{a==null?u._vnode&&Oe(u._vnode,null,null,!0):N(u._vnode||null,a,u,null,null,null,p),Mn||(Mn=!0,Gs(),fn(),Mn=!1),u._vnode=a},dt={p:N,um:Oe,m:tt,r:Ps,mt:ie,mc:A,pc:F,pbc:w,n:Bt,o:e};let Nn,Pn;return t&&([Nn,Pn]=t(dt)),{render:Fs,hydrate:Nn,createApp:Fl(Fs,Nn)}}function Vn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Ri(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oi(e,t,n=!1){const s=e.children,r=t.children;if(U(s)&&U(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function Ii(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ii(t)}const zl=e=>e.__isTeleport,_e=Symbol.for("v-fgt"),wt=Symbol.for("v-txt"),ye=Symbol.for("v-cmt"),Lt=Symbol.for("v-stc"),Mt=[];let Re=null;function Li(e=!1){Mt.push(Re=e?null:[])}function Xl(){Mt.pop(),Re=Mt[Mt.length-1]||null}let $t=1;function ir(e){$t+=e}function Mi(e){return e.dynamicChildren=$t>0?Re||gt:null,Xl(),$t>0&&Re&&Re.push(e),e}function Ka(e,t,n,s,r,i){return Mi(Fi(e,t,n,s,r,i,!0))}function Ni(e,t,n,s,r){return Mi(fe(e,t,n,s,r,!0))}function pn(e){return e?e.__v_isVNode===!0:!1}function ot(e,t){return e.type===t.type&&e.key===t.key}const Pi=({key:e})=>e??null,rn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?se(e)||he(e)||k(e)?{i:de,r:e,k:t,f:!!n}:e:null);function Fi(e,t=null,n=null,s=0,r=null,i=e===_e?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pi(t),ref:t&&rn(t),scopeId:Sn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:de};return l?(Is(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=se(n)?8:16),$t>0&&!o&&Re&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Re.push(c),c}const fe=Yl;function Yl(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===oi)&&(e=ye),pn(e)){const l=Qe(e,t,!0);return n&&Is(l,n),$t>0&&!i&&Re&&(l.shapeFlag&6?Re[Re.indexOf(e)]=l:Re.push(l)),l.patchFlag|=-2,l}if(oc(e)&&(e=e.__vccOpts),t){t=Jl(t);let{class:l,style:c}=t;l&&!se(l)&&(t.class=ms(l)),Z(c)&&(Yr(c)&&!U(c)&&(c=re({},c)),t.style=gs(c))}const o=se(e)?1:fl(e)?128:zl(e)?64:Z(e)?4:k(e)?2:0;return Fi(e,t,n,s,r,o,i,!0)}function Jl(e){return e?Yr(e)||Ei(e)?re({},e):e:null}function Qe(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,f=t?Ql(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Pi(f),ref:t&&t.ref?n&&i?U(i)?i.concat(rn(t)):[i,rn(t)]:rn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==_e?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Qe(e.ssContent),ssFallback:e.ssFallback&&Qe(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&(d.transition=c.clone(d)),d}function Hi(e=" ",t=0){return fe(wt,null,e,t)}function ka(e,t){const n=fe(Lt,null,e);return n.staticCount=t,n}function Wa(e="",t=!1){return t?(Li(),Ni(ye,null,e)):fe(ye,null,e)}function Ae(e){return e==null||typeof e=="boolean"?fe(ye):U(e)?fe(_e,null,e.slice()):typeof e=="object"?qe(e):fe(wt,null,String(e))}function qe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Qe(e)}function Is(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(U(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Is(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Ei(t)?t._ctx=de:r===3&&de&&(de.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else k(t)?(t={default:t,_ctx:de},n=32):(t=String(t),s&64?(n=16,t=[Hi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ql(...e){const t={};for(let n=0;nce||de;let gn,as;{const e=Fr(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};gn=t("__VUE_INSTANCE_SETTERS__",n=>ce=n),as=t("__VUE_SSR_SETTERS__",n=>Ln=n)}const Vt=e=>{const t=ce;return gn(e),e.scope.on(),()=>{e.scope.off(),gn(t)}},or=()=>{ce&&ce.scope.off(),gn(null)};function $i(e){return e.vnode.shapeFlag&4}let Ln=!1;function nc(e,t=!1){t&&as(t);const{props:n,children:s}=e.vnode,r=$i(e);$l(e,n,r,t),Vl(e,s);const i=r?sc(e,t):void 0;return t&&as(!1),i}function sc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Al);const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?Di(e):null,i=Vt(e);Ze();const o=Xe(s,e,0,[e.props,r]);if(et(),i(),Lr(o)){if(o.then(or,or),t)return o.then(l=>{lr(e,l,t)}).catch(l=>{En(l,e,0)});e.asyncDep=o}else lr(e,o,t)}else ji(e,t)}function lr(e,t,n){k(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Z(t)&&(e.setupState=ti(t)),ji(e,n)}let cr;function ji(e,t,n){const s=e.type;if(!e.render){if(!t&&cr&&!s.render){const r=s.template||Rs(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,f=re(re({isCustomElement:i,delimiters:l},o),c);s.render=cr(r,f)}}e.render=s.render||xe}{const r=Vt(e);Ze();try{Ol(e)}finally{et(),r()}}}const rc={get(e,t){return be(e,"get",""),e[t]}};function Di(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,rc),slots:e.slots,emit:e.emit,expose:t}}function Ls(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ti(sn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ot)return Ot[n](e)},has(t,n){return n in t||n in Ot}}))}function ic(e,t=!0){return k(e)?e.displayName||e.name:e.name||t&&e.__name}function oc(e){return k(e)&&"__vccOpts"in e}const ne=(e,t)=>ko(e,t,Ln);function fs(e,t,n){const s=arguments.length;return s===2?Z(t)&&!U(t)?pn(t)?fe(e,null,[t]):fe(e,t):fe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&pn(n)&&(n=[n]),fe(e,t,n))}const lc="3.4.26";/** +* @vue/runtime-dom v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const cc="http://www.w3.org/2000/svg",ac="http://www.w3.org/1998/Math/MathML",Ge=typeof document<"u"?document:null,ar=Ge&&Ge.createElement("template"),fc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ge.createElementNS(cc,e):t==="mathml"?Ge.createElementNS(ac,e):Ge.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ge.createTextNode(e),createComment:e=>Ge.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ge.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{ar.innerHTML=s==="svg"?`${e}`:s==="mathml"?`${e}`:e;const l=ar.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Be="transition",St="animation",jt=Symbol("_vtc"),Vi=(e,{slots:t})=>fs(ml,uc(e),t);Vi.displayName="Transition";const Ui={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Vi.props=re({},ui,Ui);const st=(e,t=[])=>{U(e)?e.forEach(n=>n(...t)):e&&e(...t)},fr=e=>e?U(e)?e.some(t=>t.length>1):e.length>1:!1;function uc(e){const t={};for(const x in e)x in Ui||(t[x]=e[x]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:f=o,appearToClass:d=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:S=`${n}-leave-to`}=e,M=dc(r),N=M&&M[0],B=M&&M[1],{onBeforeEnter:q,onEnter:G,onEnterCancelled:g,onLeave:m,onLeaveCancelled:L,onBeforeAppear:O=q,onAppear:D=G,onAppearCancelled:A=g}=t,j=(x,W,ie)=>{rt(x,W?d:l),rt(x,W?f:o),ie&&ie()},w=(x,W)=>{x._isLeaving=!1,rt(x,h),rt(x,S),rt(x,b),W&&W()},V=x=>(W,ie)=>{const le=x?D:G,H=()=>j(W,x,ie);st(le,[W,H]),ur(()=>{rt(W,x?c:i),Ke(W,x?d:l),fr(le)||dr(W,s,N,H)})};return re(t,{onBeforeEnter(x){st(q,[x]),Ke(x,i),Ke(x,o)},onBeforeAppear(x){st(O,[x]),Ke(x,c),Ke(x,f)},onEnter:V(!1),onAppear:V(!0),onLeave(x,W){x._isLeaving=!0;const ie=()=>w(x,W);Ke(x,h),Ke(x,b),gc(),ur(()=>{x._isLeaving&&(rt(x,h),Ke(x,S),fr(m)||dr(x,s,B,ie))}),st(m,[x,ie])},onEnterCancelled(x){j(x,!1),st(g,[x])},onAppearCancelled(x){j(x,!0),st(A,[x])},onLeaveCancelled(x){w(x),st(L,[x])}})}function dc(e){if(e==null)return null;if(Z(e))return[Un(e.enter),Un(e.leave)];{const t=Un(e);return[t,t]}}function Un(e){return ho(e)}function Ke(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[jt]||(e[jt]=new Set)).add(t)}function rt(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[jt];n&&(n.delete(t),n.size||(e[jt]=void 0))}function ur(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let hc=0;function dr(e,t,n,s){const r=e._endId=++hc,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=pc(e,t);if(!o)return s();const f=o+"end";let d=0;const h=()=>{e.removeEventListener(f,b),i()},b=S=>{S.target===e&&++d>=c&&h()};setTimeout(()=>{d(n[M]||"").split(", "),r=s(`${Be}Delay`),i=s(`${Be}Duration`),o=hr(r,i),l=s(`${St}Delay`),c=s(`${St}Duration`),f=hr(l,c);let d=null,h=0,b=0;t===Be?o>0&&(d=Be,h=o,b=i.length):t===St?f>0&&(d=St,h=f,b=c.length):(h=Math.max(o,f),d=h>0?o>f?Be:St:null,b=d?d===Be?i.length:c.length:0);const S=d===Be&&/\b(transform|all)(,|$)/.test(s(`${Be}Property`).toString());return{type:d,timeout:h,propCount:b,hasTransform:S}}function hr(e,t){for(;e.lengthpr(n)+pr(e[s])))}function pr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gc(){return document.body.offsetHeight}function mc(e,t,n){const s=e[jt];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const gr=Symbol("_vod"),_c=Symbol("_vsh"),yc=Symbol(""),bc=/(^|;)\s*display\s*:/;function vc(e,t,n){const s=e.style,r=se(n);let i=!1;if(n&&!r){if(t)if(se(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&on(s,l,"")}else for(const o in t)n[o]==null&&on(s,o,"");for(const o in n)o==="display"&&(i=!0),on(s,o,n[o])}else if(r){if(t!==n){const o=s[yc];o&&(n+=";"+o),s.cssText=n,i=bc.test(n)}}else t&&e.removeAttribute("style");gr in e&&(e[gr]=i?s.display:"",e[_c]&&(s.display="none"))}const mr=/\s*!important$/;function on(e,t,n){if(U(n))n.forEach(s=>on(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=wc(e,t);mr.test(n)?e.setProperty(ut(s),n.replace(mr,""),"important"):e[s]=n}}const _r=["Webkit","Moz","ms"],Bn={};function wc(e,t){const n=Bn[t];if(n)return n;let s=Pe(t);if(s!=="filter"&&s in e)return Bn[t]=s;s=yn(s);for(let r=0;r<_r.length;r++){const i=_r[r]+s;if(i in e)return Bn[t]=i}return t}const yr="http://www.w3.org/1999/xlink";function Ec(e,t,n,s,r){if(s&&t.startsWith("xlink:"))n==null?e.removeAttributeNS(yr,t.slice(6,t.length)):e.setAttributeNS(yr,t,n);else{const i=bo(t);n==null||i&&!Hr(n)?e.removeAttribute(t):e.setAttribute(t,i?"":n)}}function Cc(e,t,n,s,r,i,o){if(t==="innerHTML"||t==="textContent"){s&&o(s,r,i),e[t]=n??"";return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const f=l==="OPTION"?e.getAttribute("value")||"":e.value,d=n??"";(f!==d||!("_value"in e))&&(e.value=d),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Hr(n):n==null&&f==="string"?(n="",c=!0):f==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(t)}function xc(e,t,n,s){e.addEventListener(t,n,s)}function Sc(e,t,n,s){e.removeEventListener(t,n,s)}const br=Symbol("_vei");function Tc(e,t,n,s,r=null){const i=e[br]||(e[br]={}),o=i[t];if(s&&o)o.value=s;else{const[l,c]=Ac(t);if(s){const f=i[t]=Ic(s,r);xc(e,l,f,c)}else o&&(Sc(e,l,o,c),i[t]=void 0)}}const vr=/(?:Once|Passive|Capture)$/;function Ac(e){let t;if(vr.test(e)){t={};let s;for(;s=e.match(vr);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ut(e.slice(2)),t]}let Kn=0;const Rc=Promise.resolve(),Oc=()=>Kn||(Rc.then(()=>Kn=0),Kn=Date.now());function Ic(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Se(Lc(s,n.value),t,5,[s])};return n.value=e,n.attached=Oc(),n}function Lc(e,t){if(U(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const wr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Mc=(e,t,n,s,r,i,o,l,c)=>{const f=r==="svg";t==="class"?mc(e,s,f):t==="style"?vc(e,n,s):Dt(t)?ds(t)||Tc(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Nc(e,t,s,f))?Cc(e,t,s,i,o,l,c):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ec(e,t,s,f))};function Nc(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&wr(t)&&k(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return wr(t)&&se(n)?!1:t in e}const Pc=["ctrl","shift","alt","meta"],Fc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Pc.some(n=>e[`${n}Key`]&&!t.includes(n))},qa=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=r=>{if(!("key"in r))return;const i=ut(r.key);if(t.some(o=>o===i||Hc[o]===i))return e(r)})},$c=re({patchProp:Mc},fc);let kn,Er=!1;function jc(){return kn=Er?kn:Wl($c),Er=!0,kn}const za=(...e)=>{const t=jc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Vc(s);if(r)return n(r,!0,Dc(r))},t};function Dc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vc(e){return se(e)?document.querySelector(e):e}const Xa=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Uc=window.__VP_SITE_DATA__;function Ms(e){return jr()?(Eo(e),!0):!1}function Ye(e){return typeof e=="function"?e():ei(e)}const Bi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Bc=Object.prototype.toString,Kc=e=>Bc.call(e)==="[object Object]",Ki=()=>{},Cr=kc();function kc(){var e,t;return Bi&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Wc(e,t){function n(...s){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(r).catch(i)})}return n}const ki=e=>e();function qc(e=ki){const t=ae(!0);function n(){t.value=!1}function s(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:wn(t),pause:n,resume:s,eventFilter:r}}function Gc(e){return e||In()}function Wi(...e){if(e.length!==1)return Jo(...e);const t=e[0];return typeof t=="function"?wn(zo(()=>({get:t,set:Ki}))):ae(t)}function zc(e,t,n={}){const{eventFilter:s=ki,...r}=n;return Ne(e,Wc(s,t),r)}function Xc(e,t,n={}){const{eventFilter:s,...r}=n,{eventFilter:i,pause:o,resume:l,isActive:c}=qc(s);return{stop:zc(e,t,{...r,eventFilter:i}),pause:o,resume:l,isActive:c}}function Ns(e,t=!0,n){Gc()?Ct(e,n):t?e():Cn(e)}function qi(e){var t;const n=Ye(e);return(t=n==null?void 0:n.$el)!=null?t:n}const je=Bi?window:void 0;function Et(...e){let t,n,s,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,s,r]=e,t=je):[t,n,s,r]=e,!t)return Ki;Array.isArray(n)||(n=[n]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,h,b,S)=>(d.addEventListener(h,b,S),()=>d.removeEventListener(h,b,S)),c=Ne(()=>[qi(t),Ye(r)],([d,h])=>{if(o(),!d)return;const b=Kc(h)?{...h}:h;i.push(...n.flatMap(S=>s.map(M=>l(d,S,M,b))))},{immediate:!0,flush:"post"}),f=()=>{c(),o()};return Ms(f),f}function Yc(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ya(...e){let t,n,s={};e.length===3?(t=e[0],n=e[1],s=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],s=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=je,eventName:i="keydown",passive:o=!1,dedupe:l=!1}=s,c=Yc(t);return Et(r,i,d=>{d.repeat&&Ye(l)||c(d)&&n(d)},o)}function Jc(){const e=ae(!1),t=In();return t&&Ct(()=>{e.value=!0},t),e}function Qc(e){const t=Jc();return ne(()=>(t.value,!!e()))}function Gi(e,t={}){const{window:n=je}=t,s=Qc(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=ae(!1),o=f=>{i.value=f.matches},l=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",o):r.removeListener(o))},c=ai(()=>{s.value&&(l(),r=n.matchMedia(Ye(e)),"addEventListener"in r?r.addEventListener("change",o):r.addListener(o),i.value=r.matches)});return Ms(()=>{c(),l(),r=void 0}),i}const Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zt="__vueuse_ssr_handlers__",Zc=ea();function ea(){return Zt in Qt||(Qt[Zt]=Qt[Zt]||{}),Qt[Zt]}function zi(e,t){return Zc[e]||t}function ta(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const na={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},xr="vueuse-storage";function sa(e,t,n,s={}){var r;const{flush:i="pre",deep:o=!0,listenToStorageChanges:l=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:d,window:h=je,eventFilter:b,onError:S=w=>{console.error(w)},initOnMounted:M}=s,N=(d?Qr:ae)(typeof t=="function"?t():t);if(!n)try{n=zi("getDefaultStorage",()=>{var w;return(w=je)==null?void 0:w.localStorage})()}catch(w){S(w)}if(!n)return N;const B=Ye(t),q=ta(B),G=(r=s.serializer)!=null?r:na[q],{pause:g,resume:m}=Xc(N,()=>O(N.value),{flush:i,deep:o,eventFilter:b});h&&l&&Ns(()=>{Et(h,"storage",A),Et(h,xr,j),M&&A()}),M||A();function L(w,V){h&&h.dispatchEvent(new CustomEvent(xr,{detail:{key:e,oldValue:w,newValue:V,storageArea:n}}))}function O(w){try{const V=n.getItem(e);if(w==null)L(V,null),n.removeItem(e);else{const x=G.write(w);V!==x&&(n.setItem(e,x),L(V,x))}}catch(V){S(V)}}function D(w){const V=w?w.newValue:n.getItem(e);if(V==null)return c&&B!=null&&n.setItem(e,G.write(B)),B;if(!w&&f){const x=G.read(V);return typeof f=="function"?f(x,B):q==="object"&&!Array.isArray(x)?{...B,...x}:x}else return typeof V!="string"?V:G.read(V)}function A(w){if(!(w&&w.storageArea!==n)){if(w&&w.key==null){N.value=B;return}if(!(w&&w.key!==e)){g();try{(w==null?void 0:w.newValue)!==G.write(N.value)&&(N.value=D(w))}catch(V){S(V)}finally{w?Cn(m):m()}}}}function j(w){A(w.detail)}return N}function Xi(e){return Gi("(prefers-color-scheme: dark)",e)}function ra(e={}){const{selector:t="html",attribute:n="class",initialValue:s="auto",window:r=je,storage:i,storageKey:o="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:c,emitAuto:f,disableTransition:d=!0}=e,h={auto:"",light:"light",dark:"dark",...e.modes||{}},b=Xi({window:r}),S=ne(()=>b.value?"dark":"light"),M=c||(o==null?Wi(s):sa(o,s,i,{window:r,listenToStorageChanges:l})),N=ne(()=>M.value==="auto"?S.value:M.value),B=zi("updateHTMLAttrs",(m,L,O)=>{const D=typeof m=="string"?r==null?void 0:r.document.querySelector(m):qi(m);if(!D)return;let A;if(d&&(A=r.document.createElement("style"),A.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),r.document.head.appendChild(A)),L==="class"){const j=O.split(/\s/g);Object.values(h).flatMap(w=>(w||"").split(/\s/g)).filter(Boolean).forEach(w=>{j.includes(w)?D.classList.add(w):D.classList.remove(w)})}else D.setAttribute(L,O);d&&(r.getComputedStyle(A).opacity,document.head.removeChild(A))});function q(m){var L;B(t,n,(L=h[m])!=null?L:m)}function G(m){e.onChanged?e.onChanged(m,q):q(m)}Ne(N,G,{flush:"post",immediate:!0}),Ns(()=>G(N.value));const g=ne({get(){return f?M.value:N.value},set(m){M.value=m}});try{return Object.assign(g,{store:M,system:S,state:N})}catch{return g}}function ia(e={}){const{valueDark:t="dark",valueLight:n="",window:s=je}=e,r=ra({...e,onChanged:(l,c)=>{var f;e.onChanged?(f=e.onChanged)==null||f.call(e,l==="dark",c,l):c(l)},modes:{dark:t,light:n}}),i=ne(()=>r.system?r.system.value:Xi({window:s}).value?"dark":"light");return ne({get(){return r.value==="dark"},set(l){const c=l?"dark":"light";i.value===c?r.value="auto":r.value=c}})}function Wn(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Yi(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.preventDefault(),!1)}const en=new WeakMap;function Ja(e,t=!1){const n=ae(t);let s=null;Ne(Wi(e),o=>{const l=Wn(Ye(o));if(l){const c=l;en.get(c)||en.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const r=()=>{const o=Wn(Ye(e));!o||n.value||(Cr&&(s=Et(o,"touchmove",l=>{oa(l)},{passive:!1})),o.style.overflow="hidden",n.value=!0)},i=()=>{var o;const l=Wn(Ye(e));!l||!n.value||(Cr&&(s==null||s()),l.style.overflow=(o=en.get(l))!=null?o:"",en.delete(l),n.value=!1)};return Ms(i),ne({get(){return n.value},set(o){o?r():i()}})}function Qa(e={}){const{window:t=je,behavior:n="auto"}=e;if(!t)return{x:ae(0),y:ae(0)};const s=ae(t.scrollX),r=ae(t.scrollY),i=ne({get(){return s.value},set(l){scrollTo({left:l,behavior:n})}}),o=ne({get(){return r.value},set(l){scrollTo({top:l,behavior:n})}});return Et(t,"scroll",()=>{s.value=t.scrollX,r.value=t.scrollY},{capture:!1,passive:!0}),{x:i,y:o}}function Za(e={}){const{window:t=je,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:s=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0}=e,o=ae(n),l=ae(s),c=()=>{t&&(i?(o.value=t.innerWidth,l.value=t.innerHeight):(o.value=t.document.documentElement.clientWidth,l.value=t.document.documentElement.clientHeight))};if(c(),Ns(c),Et("resize",c,{passive:!0}),r){const f=Gi("(orientation: portrait)");Ne(f,()=>c())}return{width:o,height:l}}var qn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},Gn={};const Ji=/^(?:[a-z]+:|\/\/)/i,la="vitepress-theme-appearance",ca=/#.*$/,aa=/[?#].*$/,fa=/(?:(^|\/)index)?\.(?:md|html)$/,ge=typeof document<"u",Qi={relativePath:"",filePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{sidebar:!1,layout:"page"},lastUpdated:0,isNotFound:!0};function ua(e,t,n=!1){if(t===void 0)return!1;if(e=Sr(`/${e}`),n)return new RegExp(t).test(e);if(Sr(t)!==e)return!1;const s=t.match(ca);return s?(ge?location.hash:"")===s[0]:!0}function Sr(e){return decodeURI(e).replace(aa,"").replace(fa,"$1")}function da(e){return Ji.test(e)}function ha(e,t){var s,r,i,o,l,c,f;const n=Object.keys(e.locales).find(d=>d!=="root"&&!da(d)&&ua(t,`/${d}/`,!0))||"root";return Object.assign({},e,{localeIndex:n,lang:((s=e.locales[n])==null?void 0:s.lang)??e.lang,dir:((r=e.locales[n])==null?void 0:r.dir)??e.dir,title:((i=e.locales[n])==null?void 0:i.title)??e.title,titleTemplate:((o=e.locales[n])==null?void 0:o.titleTemplate)??e.titleTemplate,description:((l=e.locales[n])==null?void 0:l.description)??e.description,head:eo(e.head,((c=e.locales[n])==null?void 0:c.head)??[]),themeConfig:{...e.themeConfig,...(f=e.locales[n])==null?void 0:f.themeConfig}})}function Zi(e,t){const n=t.title||e.title,s=t.titleTemplate??e.titleTemplate;if(typeof s=="string"&&s.includes(":title"))return s.replace(/:title/g,n);const r=pa(e.title,s);return n===r.slice(3)?n:`${n}${r}`}function pa(e,t){return t===!1?"":t===!0||t===void 0?` | ${e}`:e===t?"":` | ${t}`}function ga(e,t){const[n,s]=t;if(n!=="meta")return!1;const r=Object.entries(s)[0];return r==null?!1:e.some(([i,o])=>i===n&&o[r[0]]===r[1])}function eo(e,t){return[...e.filter(n=>!ga(t,n)),...t]}const ma=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g,_a=/^[a-z]:/i;function Tr(e){const t=_a.exec(e),n=t?t[0]:"";return n+e.slice(n.length).replace(ma,"_").replace(/(^|\/)_+(?=[^/]*$)/,"$1")}const zn=new Set;function ya(e){if(zn.size===0){const n=typeof process=="object"&&(Gn==null?void 0:Gn.VITE_EXTRA_EXTENSIONS)||(qn==null?void 0:qn.VITE_EXTRA_EXTENSIONS)||"";("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip"+(n&&typeof n=="string"?","+n:"")).split(",").forEach(s=>zn.add(s))}const t=e.split(".").pop();return t==null||!zn.has(t.toLowerCase())}const ba=Symbol(),at=Qr(Uc);function ef(e){const t=ne(()=>ha(at.value,e.data.relativePath)),n=t.value.appearance,s=n==="force-dark"?ae(!0):n?ia({storageKey:la,initialValue:()=>typeof n=="string"?n:"auto",...typeof n=="object"?n:{}}):ae(!1),r=ae(ge?location.hash:"");return ge&&window.addEventListener("hashchange",()=>{r.value=location.hash}),Ne(()=>e.data,()=>{r.value=ge?location.hash:""}),{site:t,theme:ne(()=>t.value.themeConfig),page:ne(()=>e.data),frontmatter:ne(()=>e.data.frontmatter),params:ne(()=>e.data.params),lang:ne(()=>t.value.lang),dir:ne(()=>e.data.frontmatter.dir||t.value.dir),localeIndex:ne(()=>t.value.localeIndex||"root"),title:ne(()=>Zi(t.value,e.data)),description:ne(()=>e.data.description||t.value.description),isDark:s,hash:ne(()=>r.value)}}function va(){const e=vt(ba);if(!e)throw new Error("vitepress data not properly injected in app");return e}function wa(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function Ar(e){return Ji.test(e)||!e.startsWith("/")?e:wa(at.value.base,e)}function Ea(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t=t.replace(/\/$/,"/index"),ge){const n="/";t=Tr(t.slice(n.length).replace(/\//g,"_")||"index")+".md";let s=__VP_HASH_MAP__[t.toLowerCase()];if(s||(t=t.endsWith("_index.md")?t.slice(0,-9)+".md":t.slice(0,-3)+"_index.md",s=__VP_HASH_MAP__[t.toLowerCase()]),!s)return null;t=`${n}assets/${t}.${s}.js`}else t=`./${Tr(t.slice(1).replace(/\//g,"_"))}.md.js`;return t}let ln=[];function tf(e){ln.push(e),On(()=>{ln=ln.filter(t=>t!==e)})}function Ca(){let e=at.value.scrollOffset,t=0,n=24;if(typeof e=="object"&&"padding"in e&&(n=e.padding,e=e.selector),typeof e=="number")t=e;else if(typeof e=="string")t=Rr(e,n);else if(Array.isArray(e))for(const s of e){const r=Rr(s,n);if(r){t=r;break}}return t}function Rr(e,t){const n=document.querySelector(e);if(!n)return 0;const s=n.getBoundingClientRect().bottom;return s<0?0:s+t}const xa=Symbol(),to="http://a.com",Sa=()=>({path:"/",component:null,data:Qi});function nf(e,t){const n=vn(Sa()),s={route:n,go:r};async function r(l=ge?location.href:"/"){var c,f;l=Xn(l),await((c=s.onBeforeRouteChange)==null?void 0:c.call(s,l))!==!1&&(ge&&l!==Xn(location.href)&&(history.replaceState({scrollPosition:window.scrollY},""),history.pushState({},"",l)),await o(l),await((f=s.onAfterRouteChanged)==null?void 0:f.call(s,l)))}let i=null;async function o(l,c=0,f=!1){var b;if(await((b=s.onBeforePageLoad)==null?void 0:b.call(s,l))===!1)return;const d=new URL(l,to),h=i=d.pathname;try{let S=await e(h);if(!S)throw new Error(`Page not found: ${h}`);if(i===h){i=null;const{default:M,__pageData:N}=S;if(!M)throw new Error(`Invalid route component: ${M}`);n.path=ge?h:Ar(h),n.component=sn(M),n.data=sn(N),ge&&Cn(()=>{let B=at.value.base+N.relativePath.replace(/(?:(^|\/)index)?\.md$/,"$1");if(!at.value.cleanUrls&&!B.endsWith("/")&&(B+=".html"),B!==d.pathname&&(d.pathname=B,l=B+d.search+d.hash,history.replaceState({},"",l)),d.hash&&!c){let q=null;try{q=document.getElementById(decodeURIComponent(d.hash).slice(1))}catch(G){console.warn(G)}if(q){Or(q,d.hash);return}}window.scrollTo(0,c)})}}catch(S){if(!/fetch|Page not found/.test(S.message)&&!/^\/404(\.html|\/)?$/.test(l)&&console.error(S),!f)try{const M=await fetch(at.value.base+"hashmap.json");window.__VP_HASH_MAP__=await M.json(),await o(l,c,!0);return}catch{}i===h&&(i=null,n.path=ge?h:Ar(h),n.component=t?sn(t):null,n.data=Qi)}}return ge&&(history.state===null&&history.replaceState({},""),window.addEventListener("click",l=>{if(l.target.closest("button"))return;const f=l.target.closest("a");if(f&&!f.closest(".vp-raw")&&(f instanceof SVGElement||!f.download)){const{target:d}=f,{href:h,origin:b,pathname:S,hash:M,search:N}=new URL(f.href instanceof SVGAnimatedString?f.href.animVal:f.href,f.baseURI),B=new URL(location.href);!l.ctrlKey&&!l.shiftKey&&!l.altKey&&!l.metaKey&&!d&&b===B.origin&&ya(S)&&(l.preventDefault(),S===B.pathname&&N===B.search?(M!==B.hash&&(history.pushState({},"",h),window.dispatchEvent(new HashChangeEvent("hashchange",{oldURL:B.href,newURL:h}))),M?Or(f,M,f.classList.contains("header-anchor")):window.scrollTo(0,0)):r(h))}},{capture:!0}),window.addEventListener("popstate",async l=>{var c;l.state!==null&&(await o(Xn(location.href),l.state&&l.state.scrollPosition||0),(c=s.onAfterRouteChanged)==null||c.call(s,location.href))}),window.addEventListener("hashchange",l=>{l.preventDefault()})),s}function Ta(){const e=vt(xa);if(!e)throw new Error("useRouter() is called without provider.");return e}function no(){return Ta().route}function Or(e,t,n=!1){let s=null;try{s=e.classList.contains("header-anchor")?e:document.getElementById(decodeURIComponent(t).slice(1))}catch(r){console.warn(r)}if(s){let r=function(){!n||Math.abs(o-window.scrollY)>window.innerHeight?window.scrollTo(0,o):window.scrollTo({left:0,top:o,behavior:"smooth"})};const i=parseInt(window.getComputedStyle(s).paddingTop,10),o=window.scrollY+s.getBoundingClientRect().top-Ca()+i;requestAnimationFrame(r)}}function Xn(e){const t=new URL(e,to);return t.pathname=t.pathname.replace(/(^|\/)index(\.html)?$/,"$1"),at.value.cleanUrls?t.pathname=t.pathname.replace(/\.html$/,""):!t.pathname.endsWith("/")&&!t.pathname.endsWith(".html")&&(t.pathname+=".html"),t.pathname+t.search+t.hash}const Yn=()=>ln.forEach(e=>e()),sf=pi({name:"VitePressContent",props:{as:{type:[Object,String],default:"div"}},setup(e){const t=no(),{site:n}=va();return()=>fs(e.as,n.value.contentProps??{style:{position:"relative"}},[t.component?fs(t.component,{onVnodeMounted:Yn,onVnodeUpdated:Yn,onVnodeUnmounted:Yn}):"404 Page Not Found"])}}),rf=pi({setup(e,{slots:t}){const n=ae(!1);return Ct(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}});function of(){ge&&window.addEventListener("click",e=>{var n;const t=e.target;if(t.matches(".vp-code-group input")){const s=(n=t.parentElement)==null?void 0:n.parentElement;if(!s)return;const r=Array.from(s.querySelectorAll("input")).indexOf(t);if(r<0)return;const i=s.querySelector(".blocks");if(!i)return;const o=Array.from(i.children).find(f=>f.classList.contains("active"));if(!o)return;const l=i.children[r];if(!l||o===l)return;o.classList.remove("active"),l.classList.add("active");const c=s==null?void 0:s.querySelector(`label[for="${t.id}"]`);c==null||c.scrollIntoView({block:"nearest"})}})}function lf(){if(ge){const e=new WeakMap;window.addEventListener("click",t=>{var s;const n=t.target;if(n.matches('div[class*="language-"] > button.copy')){const r=n.parentElement,i=(s=n.nextElementSibling)==null?void 0:s.nextElementSibling;if(!r||!i)return;const o=/language-(shellscript|shell|bash|sh|zsh)/.test(r.className),l=[".vp-copy-ignore",".diff.remove"],c=i.cloneNode(!0);c.querySelectorAll(l.join(",")).forEach(d=>d.remove());let f=c.textContent||"";o&&(f=f.replace(/^ *(\$|>) /gm,"").trim()),Aa(f).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const d=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,d)})}})}}async function Aa(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection(),r=s?s.rangeCount>0&&s.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),r&&(s.removeAllRanges(),s.addRange(r)),n&&n.focus()}}function cf(e,t){let n=!0,s=[];const r=i=>{if(n){n=!1,i.forEach(l=>{const c=Jn(l);for(const f of document.head.children)if(f.isEqualNode(c)){s.push(f);return}});return}const o=i.map(Jn);s.forEach((l,c)=>{const f=o.findIndex(d=>d==null?void 0:d.isEqualNode(l??null));f!==-1?delete o[f]:(l==null||l.remove(),delete s[c])}),o.forEach(l=>l&&document.head.appendChild(l)),s=[...s,...o].filter(Boolean)};ai(()=>{const i=e.data,o=t.value,l=i&&i.description,c=i&&i.frontmatter.head||[],f=Zi(o,i);f!==document.title&&(document.title=f);const d=l||o.description;let h=document.querySelector("meta[name=description]");h?h.getAttribute("content")!==d&&h.setAttribute("content",d):Jn(["meta",{name:"description",content:d}]),r(eo(o.head,Oa(c)))})}function Jn([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),e==="script"&&!t.async&&(s.async=!1),s}function Ra(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function Oa(e){return e.filter(t=>!Ra(t))}const Qn=new Set,so=()=>document.createElement("link"),Ia=e=>{const t=so();t.rel="prefetch",t.href=e,document.head.appendChild(t)},La=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let tn;const Ma=ge&&(tn=so())&&tn.relList&&tn.relList.supports&&tn.relList.supports("prefetch")?Ia:La;function af(){if(!ge||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(i=>{i.forEach(o=>{if(o.isIntersecting){const l=o.target;n.unobserve(l);const{pathname:c}=l;if(!Qn.has(c)){Qn.add(c);const f=Ea(c);f&&Ma(f)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(i=>{const{hostname:o,pathname:l}=new URL(i.href instanceof SVGAnimatedString?i.href.animVal:i.href,i.baseURI),c=l.match(/\.\w+$/);c&&c[0]!==".html"||i.target!=="_blank"&&o===location.hostname&&(l!==location.pathname?n.observe(i):Qn.add(l))})})};Ct(s);const r=no();Ne(()=>r.path,s),On(()=>{n&&n.disconnect()})}export{qa as $,ja as A,El as B,Ca as C,Ha as D,Da as E,_e as F,Qr as G,tf as H,fe as I,$a as J,Ji as K,no as L,Ql as M,vt as N,Za as O,gs as P,Ya as Q,Cn as R,Qa as S,Vi as T,ge as U,wn as V,Ja as W,Hl as X,Ga as Y,Ua as Z,Xa as _,Hi as a,Ba as a0,ka as a1,cf as a2,xa as a3,ef as a4,ba as a5,sf as a6,rf as a7,at as a8,za as a9,nf as aa,Ea as ab,af as ac,lf as ad,of as ae,fs as af,Ni as b,Ka as c,pi as d,Wa as e,ya as f,Ar as g,ne as h,da as i,ae as j,Ct as k,Fi as l,ei as m,ms as n,Li as o,Pa as p,Fa as q,Va as r,ua as s,Na as t,va as u,Gi as v,il as w,Ne as x,ai as y,On as z}; diff --git a/assets/chunks/hhmm.apdfnDZY.js b/assets/chunks/hhmm.apdfnDZY.js new file mode 100644 index 000000000..ee86675b6 --- /dev/null +++ b/assets/chunks/hhmm.apdfnDZY.js @@ -0,0 +1 @@ +const s="/assets/google.AkcAA5qz.png",t="/assets/baidu.BzHzvwzy.png",o="/assets/xkcd.De4VfqBi.png",a="/assets/hhmm.CWWLJcVP.png";export{s as _,t as a,o as b,a as c}; diff --git a/assets/chunks/logo.BLgnOXGY.js b/assets/chunks/logo.BLgnOXGY.js new file mode 100644 index 000000000..f2ef2cd3e --- /dev/null +++ b/assets/chunks/logo.BLgnOXGY.js @@ -0,0 +1 @@ +const s="/assets/logo.Bu5BlKbI.png";export{s as _}; diff --git a/assets/chunks/theme.Bw3nEMJ8.js b/assets/chunks/theme.Bw3nEMJ8.js new file mode 100644 index 000000000..cae9ee1a5 --- /dev/null +++ b/assets/chunks/theme.Bw3nEMJ8.js @@ -0,0 +1 @@ +import{d as _,o as a,c as u,r as l,n as T,a as D,t as w,b as k,w as d,T as de,e as h,_ as b,u as Oe,i as je,f as Ue,g as ve,h as $,j as I,k as W,l as v,m as i,p as C,q as H,s as q,v as ie,x as G,y as Z,z as pe,A as ge,B as Ge,C as ze,D as z,F as M,E,G as ye,H as x,I as m,J as R,K as Pe,L as ee,M as Y,N as te,O as qe,P as Le,Q as We,R as Ke,S as Ve,U as oe,V as Re,W as Se,X as we,Y as Je,Z as Ye,$ as Qe,a0 as Xe}from"./framework.qh4ipt1c.js";const Ze=_({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(o){return(e,t)=>(a(),u("span",{class:T(["VPBadge",e.type])},[l(e.$slots,"default",{},()=>[D(w(e.text),1)])],2))}}),xe={key:0,class:"VPBackdrop"},et=_({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(o){return(e,t)=>(a(),k(de,{name:"fade"},{default:d(()=>[e.show?(a(),u("div",xe)):h("",!0)]),_:1}))}}),tt=b(et,[["__scopeId","data-v-37f86bc0"]]),L=Oe;function ot(o,e){let t,s=!1;return()=>{t&&clearTimeout(t),s?t=setTimeout(o,e):(o(),(s=!0)&&setTimeout(()=>s=!1,e))}}function le(o){return/^\//.test(o)?o:`/${o}`}function fe(o){const{pathname:e,search:t,hash:s,protocol:n}=new URL(o,"http://a.com");if(je(o)||o.startsWith("#")||!n.startsWith("http")||!Ue(e))return o;const{site:r}=L(),c=e.endsWith("/")||e.endsWith(".html")?o:o.replace(/(?:(^\.+)\/)?.*$/,`$1${e.replace(/(\.md)?$/,r.value.cleanUrls?"":".html")}${t}${s}`);return ve(c)}function J({removeCurrent:o=!0,correspondingLink:e=!1}={}){const{site:t,localeIndex:s,page:n,theme:r,hash:c}=L(),f=$(()=>{var P,g;return{index:s.value,label:(P=t.value.locales[s.value])==null?void 0:P.label,link:((g=t.value.locales[s.value])==null?void 0:g.link)||(s.value==="root"?"/":`/${s.value}/`)}});return{localeLinks:$(()=>Object.entries(t.value.locales).flatMap(([P,g])=>o&&f.value.label===g.label?[]:{index:P,text:g.label,link:st(g.link||(P==="root"?"/":`/${P}/`),r.value.i18nRouting!==!1&&e,n.value.relativePath.slice(f.value.link.length-1),!t.value.cleanUrls)+c.value})),currentLang:f}}function st(o,e,t,s){return e?o.replace(/\/$/,"")+le(t.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,s?".html":"")):o}const nt=o=>(C("data-v-9fc9f9e4"),o=o(),H(),o),at={class:"NotFound"},rt={class:"code"},it={class:"title"},lt=nt(()=>v("div",{class:"divider"},null,-1)),ct={class:"quote"},ut={class:"action"},dt=["href","aria-label"],vt=_({__name:"NotFound",setup(o){const{site:e}=L(),{localeLinks:t}=J({removeCurrent:!1}),s=I({link:"/",index:"root"});W(()=>{const r=window.location.pathname.replace(e.value.base,"").replace(/(^.*?\/).*$/,"/$1");t.value.length&&(s.value=t.value.find(({link:c})=>c.startsWith(r))||t.value[0])});const n=$(()=>{var r,c,f,p;return{code:404,title:"PAGE NOT FOUND",quote:"But if you don't change your direction, and if you keep looking, you may end up where you are heading.",linkLabel:"go to home",linkText:"Take me home",...s.value.index==="root"?(r=e.value.themeConfig)==null?void 0:r.notFound:(p=(f=(c=e.value.locales)==null?void 0:c[s.value.index])==null?void 0:f.themeConfig)==null?void 0:p.notFound}});return(r,c)=>(a(),u("div",at,[v("p",rt,w(n.value.code),1),v("h1",it,w(n.value.title),1),lt,v("blockquote",ct,w(n.value.quote),1),v("div",ut,[v("a",{class:"link",href:i(ve)(s.value.link),"aria-label":n.value.linkLabel},w(n.value.linkText),9,dt)])]))}}),pt=b(vt,[["__scopeId","data-v-9fc9f9e4"]]);function Ie(o,e){if(Array.isArray(o))return Q(o);if(o==null)return[];e=le(e);const t=Object.keys(o).sort((n,r)=>r.split("/").length-n.split("/").length).find(n=>e.startsWith(le(n))),s=t?o[t]:[];return Array.isArray(s)?Q(s):Q(s.items,s.base)}function ft(o){const e=[];let t=0;for(const s in o){const n=o[s];if(n.items){t=e.push(n);continue}e[t]||e.push({items:[]}),e[t].items.push(n)}return e}function ht(o){const e=[];function t(s){for(const n of s)n.text&&n.link&&e.push({text:n.text,link:n.link,docFooterText:n.docFooterText}),n.items&&t(n.items)}return t(o),e}function ce(o,e){return Array.isArray(e)?e.some(t=>ce(o,t)):q(o,e.link)?!0:e.items?ce(o,e.items):!1}function Q(o,e){return[...o].map(t=>{const s={...t},n=s.base||e;return n&&s.link&&(s.link=n+s.link),s.items&&(s.items=Q(s.items,n)),s})}function O(){const{frontmatter:o,page:e,theme:t}=L(),s=ie("(min-width: 960px)"),n=I(!1),r=$(()=>{const A=t.value.sidebar,S=e.value.relativePath;return A?Ie(A,S):[]}),c=I(r.value);G(r,(A,S)=>{JSON.stringify(A)!==JSON.stringify(S)&&(c.value=r.value)});const f=$(()=>o.value.sidebar!==!1&&c.value.length>0&&o.value.layout!=="home"),p=$(()=>P?o.value.aside==null?t.value.aside==="left":o.value.aside==="left":!1),P=$(()=>o.value.layout==="home"?!1:o.value.aside!=null?!!o.value.aside:t.value.aside!==!1),g=$(()=>f.value&&s.value),y=$(()=>f.value?ft(c.value):[]);function V(){n.value=!0}function N(){n.value=!1}function B(){n.value?N():V()}return{isOpen:n,sidebar:c,sidebarGroups:y,hasSidebar:f,hasAside:P,leftAside:p,isSidebarEnabled:g,open:V,close:N,toggle:B}}function _t(o,e){let t;Z(()=>{t=o.value?document.activeElement:void 0}),W(()=>{window.addEventListener("keyup",s)}),pe(()=>{window.removeEventListener("keyup",s)});function s(n){n.key==="Escape"&&o.value&&(e(),t==null||t.focus())}}function mt(o){const{page:e,hash:t}=L(),s=I(!1),n=$(()=>o.value.collapsed!=null),r=$(()=>!!o.value.link),c=I(!1),f=()=>{c.value=q(e.value.relativePath,o.value.link)};G([e,o,t],f),W(f);const p=$(()=>c.value?!0:o.value.items?ce(e.value.relativePath,o.value.items):!1),P=$(()=>!!(o.value.items&&o.value.items.length));Z(()=>{s.value=!!(n.value&&o.value.collapsed)}),ge(()=>{(c.value||p.value)&&(s.value=!1)});function g(){n.value&&(s.value=!s.value)}return{collapsed:s,collapsible:n,isLink:r,isActiveLink:c,hasActiveLink:p,hasChildren:P,toggle:g}}function kt(){const{hasSidebar:o}=O(),e=ie("(min-width: 960px)"),t=ie("(min-width: 1280px)");return{isAsideEnabled:$(()=>!t.value&&!e.value?!1:o.value?t.value:e.value)}}const ue=[];function Te(o){return typeof o.outline=="object"&&!Array.isArray(o.outline)&&o.outline.label||o.outlineTitle||"On this page"}function he(o){const e=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(t=>t.id&&t.hasChildNodes()).map(t=>{const s=Number(t.tagName[1]);return{element:t,title:bt(t),link:"#"+t.id,level:s}});return $t(e,o)}function bt(o){let e="";for(const t of o.childNodes)if(t.nodeType===1){if(t.classList.contains("VPBadge")||t.classList.contains("header-anchor")||t.classList.contains("ignore-header"))continue;e+=t.textContent}else t.nodeType===3&&(e+=t.textContent);return e.trim()}function $t(o,e){if(e===!1)return[];const t=(typeof e=="object"&&!Array.isArray(e)?e.level:e)||2,[s,n]=typeof t=="number"?[t,t]:t==="deep"?[2,6]:t;o=o.filter(c=>c.level>=s&&c.level<=n),ue.length=0;for(const{element:c,link:f}of o)ue.push({element:c,link:f});const r=[];e:for(let c=0;c=0;p--){const P=o[p];if(P.level{requestAnimationFrame(r),window.addEventListener("scroll",s)}),Ge(()=>{c(location.hash)}),pe(()=>{window.removeEventListener("scroll",s)});function r(){if(!t.value)return;const f=window.scrollY,p=window.innerHeight,P=document.body.offsetHeight,g=Math.abs(f+p-P)<1,y=ue.map(({element:N,link:B})=>({link:B,top:yt(N)})).filter(({top:N})=>!Number.isNaN(N)).sort((N,B)=>N.top-B.top);if(!y.length){c(null);return}if(f<1){c(null);return}if(g){c(y[y.length-1].link);return}let V=null;for(const{link:N,top:B}of y){if(B>f+ze()+4)break;V=N}c(V)}function c(f){n&&n.classList.remove("active"),f==null?n=null:n=o.value.querySelector(`a[href="${decodeURIComponent(f)}"]`);const p=n;p?(p.classList.add("active"),e.value.style.top=p.offsetTop+39+"px",e.value.style.opacity="1"):(e.value.style.top="33px",e.value.style.opacity="0")}}function yt(o){let e=0;for(;o!==document.body;){if(o===null)return NaN;e+=o.offsetTop,o=o.offsetParent}return e}const Pt=["href","title"],Lt=_({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(o){function e({target:t}){const s=t.href.split("#")[1],n=document.getElementById(decodeURIComponent(s));n==null||n.focus({preventScroll:!0})}return(t,s)=>{const n=z("VPDocOutlineItem",!0);return a(),u("ul",{class:T(["VPDocOutlineItem",t.root?"root":"nested"])},[(a(!0),u(M,null,E(t.headers,({children:r,link:c,title:f})=>(a(),u("li",null,[v("a",{class:"outline-link",href:c,onClick:e,title:f},w(f),9,Pt),r!=null&&r.length?(a(),k(n,{key:0,headers:r},null,8,["headers"])):h("",!0)]))),256))],2)}}}),Ne=b(Lt,[["__scopeId","data-v-e6fbb44e"]]),Vt={class:"content"},St={"aria-level":"2",class:"outline-title",id:"doc-outline-aria-label",role:"heading"},wt=_({__name:"VPDocAsideOutline",setup(o){const{frontmatter:e,theme:t}=L(),s=ye([]);x(()=>{s.value=he(e.value.outline??t.value.outline)});const n=I(),r=I();return gt(n,r),(c,f)=>(a(),u("nav",{"aria-labelledby":"doc-outline-aria-label",class:T(["VPDocAsideOutline",{"has-outline":s.value.length>0}]),ref_key:"container",ref:n,role:"navigation"},[v("div",Vt,[v("div",{class:"outline-marker",ref_key:"marker",ref:r},null,512),v("div",St,w(i(Te)(i(t))),1),m(Ne,{headers:s.value,root:!0},null,8,["headers"])])],2))}}),It=b(wt,[["__scopeId","data-v-03d5e4c2"]]),Tt={class:"VPDocAsideCarbonAds"},Nt=_({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(o){const e=()=>null;return(t,s)=>(a(),u("div",Tt,[m(i(e),{"carbon-ads":t.carbonAds},null,8,["carbon-ads"])]))}}),Mt=o=>(C("data-v-5aeca5f1"),o=o(),H(),o),Bt={class:"VPDocAside"},At=Mt(()=>v("div",{class:"spacer"},null,-1)),Ct=_({__name:"VPDocAside",setup(o){const{theme:e}=L();return(t,s)=>(a(),u("div",Bt,[l(t.$slots,"aside-top",{},void 0,!0),l(t.$slots,"aside-outline-before",{},void 0,!0),m(It),l(t.$slots,"aside-outline-after",{},void 0,!0),At,l(t.$slots,"aside-ads-before",{},void 0,!0),i(e).carbonAds?(a(),k(Nt,{key:0,"carbon-ads":i(e).carbonAds},null,8,["carbon-ads"])):h("",!0),l(t.$slots,"aside-ads-after",{},void 0,!0),l(t.$slots,"aside-bottom",{},void 0,!0)]))}}),Ht=b(Ct,[["__scopeId","data-v-5aeca5f1"]]);function Et(){const{theme:o,page:e}=L();return $(()=>{const{text:t="Edit this page",pattern:s=""}=o.value.editLink||{};let n;return typeof s=="function"?n=s(e.value):n=s.replace(/:path/g,e.value.filePath),{url:n,text:t}})}function Ft(){const{page:o,theme:e,frontmatter:t}=L();return $(()=>{var P,g,y,V,N,B,A,S;const s=Ie(e.value.sidebar,o.value.relativePath),n=ht(s),r=Dt(n,j=>j.link.replace(/[?#].*$/,"")),c=r.findIndex(j=>q(o.value.relativePath,j.link)),f=((P=e.value.docFooter)==null?void 0:P.prev)===!1&&!t.value.prev||t.value.prev===!1,p=((g=e.value.docFooter)==null?void 0:g.next)===!1&&!t.value.next||t.value.next===!1;return{prev:f?void 0:{text:(typeof t.value.prev=="string"?t.value.prev:typeof t.value.prev=="object"?t.value.prev.text:void 0)??((y=r[c-1])==null?void 0:y.docFooterText)??((V=r[c-1])==null?void 0:V.text),link:(typeof t.value.prev=="object"?t.value.prev.link:void 0)??((N=r[c-1])==null?void 0:N.link)},next:p?void 0:{text:(typeof t.value.next=="string"?t.value.next:typeof t.value.next=="object"?t.value.next.text:void 0)??((B=r[c+1])==null?void 0:B.docFooterText)??((A=r[c+1])==null?void 0:A.text),link:(typeof t.value.next=="object"?t.value.next.link:void 0)??((S=r[c+1])==null?void 0:S.link)}}})}function Dt(o,e){const t=new Set;return o.filter(s=>{const n=e(s);return t.has(n)?!1:t.add(n)})}const F=_({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(o){const e=o,t=$(()=>e.tag??(e.href?"a":"span")),s=$(()=>e.href&&Pe.test(e.href));return(n,r)=>(a(),k(R(t.value),{class:T(["VPLink",{link:n.href,"vp-external-link-icon":s.value,"no-icon":n.noIcon}]),href:n.href?i(fe)(n.href):void 0,target:n.target??(s.value?"_blank":void 0),rel:n.rel??(s.value?"noreferrer":void 0)},{default:d(()=>[l(n.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),Ot={class:"VPLastUpdated"},jt=["datetime"],Ut=_({__name:"VPDocFooterLastUpdated",setup(o){const{theme:e,page:t,frontmatter:s,lang:n}=L(),r=$(()=>new Date(s.value.lastUpdated??t.value.lastUpdated)),c=$(()=>r.value.toISOString()),f=I("");return W(()=>{Z(()=>{var p,P,g;f.value=new Intl.DateTimeFormat((P=(p=e.value.lastUpdated)==null?void 0:p.formatOptions)!=null&&P.forceLocale?n.value:void 0,((g=e.value.lastUpdated)==null?void 0:g.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(r.value)})}),(p,P)=>{var g;return a(),u("p",Ot,[D(w(((g=i(e).lastUpdated)==null?void 0:g.text)||i(e).lastUpdatedText||"Last updated")+": ",1),v("time",{datetime:c.value},w(f.value),9,jt)])}}}),Gt=b(Ut,[["__scopeId","data-v-1997c18c"]]),Me=o=>(C("data-v-021f7413"),o=o(),H(),o),zt={key:0,class:"VPDocFooter"},qt={key:0,class:"edit-info"},Wt={key:0,class:"edit-link"},Kt=Me(()=>v("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),Rt={key:1,class:"last-updated"},Jt={key:1,class:"prev-next","aria-labelledby":"doc-footer-aria-label"},Yt=Me(()=>v("span",{class:"visually-hidden",id:"doc-footer-aria-label"},"Pager",-1)),Qt={class:"pager"},Xt=["innerHTML"],Zt=["innerHTML"],xt={class:"pager"},eo=["innerHTML"],to=["innerHTML"],oo=_({__name:"VPDocFooter",setup(o){const{theme:e,page:t,frontmatter:s}=L(),n=Et(),r=Ft(),c=$(()=>e.value.editLink&&s.value.editLink!==!1),f=$(()=>t.value.lastUpdated&&s.value.lastUpdated!==!1),p=$(()=>c.value||f.value||r.value.prev||r.value.next);return(P,g)=>{var y,V,N,B;return p.value?(a(),u("footer",zt,[l(P.$slots,"doc-footer-before",{},void 0,!0),c.value||f.value?(a(),u("div",qt,[c.value?(a(),u("div",Wt,[m(F,{class:"edit-link-button",href:i(n).url,"no-icon":!0},{default:d(()=>[Kt,D(" "+w(i(n).text),1)]),_:1},8,["href"])])):h("",!0),f.value?(a(),u("div",Rt,[m(Gt)])):h("",!0)])):h("",!0),(y=i(r).prev)!=null&&y.link||(V=i(r).next)!=null&&V.link?(a(),u("nav",Jt,[Yt,v("div",Qt,[(N=i(r).prev)!=null&&N.link?(a(),k(F,{key:0,class:"pager-link prev",href:i(r).prev.link},{default:d(()=>{var A;return[v("span",{class:"desc",innerHTML:((A=i(e).docFooter)==null?void 0:A.prev)||"Previous page"},null,8,Xt),v("span",{class:"title",innerHTML:i(r).prev.text},null,8,Zt)]}),_:1},8,["href"])):h("",!0)]),v("div",xt,[(B=i(r).next)!=null&&B.link?(a(),k(F,{key:0,class:"pager-link next",href:i(r).next.link},{default:d(()=>{var A;return[v("span",{class:"desc",innerHTML:((A=i(e).docFooter)==null?void 0:A.next)||"Next page"},null,8,eo),v("span",{class:"title",innerHTML:i(r).next.text},null,8,to)]}),_:1},8,["href"])):h("",!0)])])):h("",!0)])):h("",!0)}}}),so=b(oo,[["__scopeId","data-v-021f7413"]]),no=o=>(C("data-v-1a27caea"),o=o(),H(),o),ao={class:"container"},ro=no(()=>v("div",{class:"aside-curtain"},null,-1)),io={class:"aside-container"},lo={class:"aside-content"},co={class:"content"},uo={class:"content-container"},vo={class:"main"},po=_({__name:"VPDoc",setup(o){const{theme:e}=L(),t=ee(),{hasSidebar:s,hasAside:n,leftAside:r}=O(),c=$(()=>t.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(f,p)=>{const P=z("Content");return a(),u("div",{class:T(["VPDoc",{"has-sidebar":i(s),"has-aside":i(n)}])},[l(f.$slots,"doc-top",{},void 0,!0),v("div",ao,[i(n)?(a(),u("div",{key:0,class:T(["aside",{"left-aside":i(r)}])},[ro,v("div",io,[v("div",lo,[m(Ht,null,{"aside-top":d(()=>[l(f.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":d(()=>[l(f.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":d(()=>[l(f.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":d(()=>[l(f.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":d(()=>[l(f.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":d(()=>[l(f.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):h("",!0),v("div",co,[v("div",uo,[l(f.$slots,"doc-before",{},void 0,!0),v("main",vo,[m(P,{class:T(["vp-doc",[c.value,i(e).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),m(so,null,{"doc-footer-before":d(()=>[l(f.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),l(f.$slots,"doc-after",{},void 0,!0)])])]),l(f.$slots,"doc-bottom",{},void 0,!0)],2)}}}),fo=b(po,[["__scopeId","data-v-1a27caea"]]),ho=_({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(o){const e=o,t=$(()=>e.href&&Pe.test(e.href)),s=$(()=>e.tag||e.href?"a":"button");return(n,r)=>(a(),k(R(s.value),{class:T(["VPButton",[n.size,n.theme]]),href:n.href?i(fe)(n.href):void 0,target:e.target??(t.value?"_blank":void 0),rel:e.rel??(t.value?"noreferrer":void 0)},{default:d(()=>[D(w(n.text),1)]),_:1},8,["class","href","target","rel"]))}}),_o=b(ho,[["__scopeId","data-v-987327ba"]]),mo=["src","alt"],ko=_({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(o){return(e,t)=>{const s=z("VPImage",!0);return e.image?(a(),u(M,{key:0},[typeof e.image=="string"||"src"in e.image?(a(),u("img",Y({key:0,class:"VPImage"},typeof e.image=="string"?e.$attrs:{...e.image,...e.$attrs},{src:i(ve)(typeof e.image=="string"?e.image:e.image.src),alt:e.alt??(typeof e.image=="string"?"":e.image.alt||"")}),null,16,mo)):(a(),u(M,{key:1},[m(s,Y({class:"dark",image:e.image.dark,alt:e.image.alt},e.$attrs),null,16,["image","alt"]),m(s,Y({class:"light",image:e.image.light,alt:e.image.alt},e.$attrs),null,16,["image","alt"])],64))],64)):h("",!0)}}}),X=b(ko,[["__scopeId","data-v-1d8fed93"]]),bo=o=>(C("data-v-b22db234"),o=o(),H(),o),$o={class:"container"},go={class:"main"},yo={key:0,class:"name"},Po=["innerHTML"],Lo=["innerHTML"],Vo=["innerHTML"],So={key:0,class:"actions"},wo={key:0,class:"image"},Io={class:"image-container"},To=bo(()=>v("div",{class:"image-bg"},null,-1)),No=_({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(o){const e=te("hero-image-slot-exists");return(t,s)=>(a(),u("div",{class:T(["VPHero",{"has-image":t.image||i(e)}])},[v("div",$o,[v("div",go,[l(t.$slots,"home-hero-info-before",{},void 0,!0),l(t.$slots,"home-hero-info",{},()=>[t.name?(a(),u("h1",yo,[v("span",{innerHTML:t.name,class:"clip"},null,8,Po)])):h("",!0),t.text?(a(),u("p",{key:1,innerHTML:t.text,class:"text"},null,8,Lo)):h("",!0),t.tagline?(a(),u("p",{key:2,innerHTML:t.tagline,class:"tagline"},null,8,Vo)):h("",!0)],!0),l(t.$slots,"home-hero-info-after",{},void 0,!0),t.actions?(a(),u("div",So,[(a(!0),u(M,null,E(t.actions,n=>(a(),u("div",{key:n.link,class:"action"},[m(_o,{tag:"a",size:"medium",theme:n.theme,text:n.text,href:n.link,target:n.target,rel:n.rel},null,8,["theme","text","href","target","rel"])]))),128))])):h("",!0),l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),t.image||i(e)?(a(),u("div",wo,[v("div",Io,[To,l(t.$slots,"home-hero-image",{},()=>[t.image?(a(),k(X,{key:0,class:"image-src",image:t.image},null,8,["image"])):h("",!0)],!0)])])):h("",!0)])],2))}}),Mo=b(No,[["__scopeId","data-v-b22db234"]]),Bo=_({__name:"VPHomeHero",setup(o){const{frontmatter:e}=L();return(t,s)=>i(e).hero?(a(),k(Mo,{key:0,class:"VPHomeHero",name:i(e).hero.name,text:i(e).hero.text,tagline:i(e).hero.tagline,image:i(e).hero.image,actions:i(e).hero.actions},{"home-hero-info-before":d(()=>[l(t.$slots,"home-hero-info-before")]),"home-hero-info":d(()=>[l(t.$slots,"home-hero-info")]),"home-hero-info-after":d(()=>[l(t.$slots,"home-hero-info-after")]),"home-hero-actions-after":d(()=>[l(t.$slots,"home-hero-actions-after")]),"home-hero-image":d(()=>[l(t.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):h("",!0)}}),Ao=o=>(C("data-v-5e09925b"),o=o(),H(),o),Co={class:"box"},Ho={key:0,class:"icon"},Eo=["innerHTML"],Fo=["innerHTML"],Do=["innerHTML"],Oo={key:4,class:"link-text"},jo={class:"link-text-value"},Uo=Ao(()=>v("span",{class:"vpi-arrow-right link-text-icon"},null,-1)),Go=_({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(o){return(e,t)=>(a(),k(F,{class:"VPFeature",href:e.link,rel:e.rel,target:e.target,"no-icon":!0,tag:e.link?"a":"div"},{default:d(()=>[v("article",Co,[typeof e.icon=="object"&&e.icon.wrap?(a(),u("div",Ho,[m(X,{image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])])):typeof e.icon=="object"?(a(),k(X,{key:1,image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])):e.icon?(a(),u("div",{key:2,class:"icon",innerHTML:e.icon},null,8,Eo)):h("",!0),v("h2",{class:"title",innerHTML:e.title},null,8,Fo),e.details?(a(),u("p",{key:3,class:"details",innerHTML:e.details},null,8,Do)):h("",!0),e.linkText?(a(),u("div",Oo,[v("p",jo,[D(w(e.linkText)+" ",1),Uo])])):h("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),zo=b(Go,[["__scopeId","data-v-5e09925b"]]),qo={key:0,class:"VPFeatures"},Wo={class:"container"},Ko={class:"items"},Ro=_({__name:"VPFeatures",props:{features:{}},setup(o){const e=o,t=$(()=>{const s=e.features.length;if(s){if(s===2)return"grid-2";if(s===3)return"grid-3";if(s%3===0)return"grid-6";if(s>3)return"grid-4"}else return});return(s,n)=>s.features?(a(),u("div",qo,[v("div",Wo,[v("div",Ko,[(a(!0),u(M,null,E(s.features,r=>(a(),u("div",{key:r.title,class:T(["item",[t.value]])},[m(zo,{icon:r.icon,title:r.title,details:r.details,link:r.link,"link-text":r.linkText,rel:r.rel,target:r.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):h("",!0)}}),Jo=b(Ro,[["__scopeId","data-v-409657de"]]),Yo=_({__name:"VPHomeFeatures",setup(o){const{frontmatter:e}=L();return(t,s)=>i(e).features?(a(),k(Jo,{key:0,class:"VPHomeFeatures",features:i(e).features},null,8,["features"])):h("",!0)}}),Qo=_({__name:"VPHomeContent",setup(o){const{width:e}=qe({includeScrollbar:!1});return(t,s)=>(a(),u("div",{class:"vp-doc container",style:Le(i(e)?{"--vp-offset":`calc(50% - ${i(e)/2}px)`}:{})},[l(t.$slots,"default",{},void 0,!0)],4))}}),Xo=b(Qo,[["__scopeId","data-v-7256f64e"]]),Zo={class:"VPHome"},xo=_({__name:"VPHome",setup(o){const{frontmatter:e}=L();return(t,s)=>{const n=z("Content");return a(),u("div",Zo,[l(t.$slots,"home-hero-before",{},void 0,!0),m(Bo,null,{"home-hero-info-before":d(()=>[l(t.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":d(()=>[l(t.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":d(()=>[l(t.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":d(()=>[l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":d(()=>[l(t.$slots,"home-hero-image",{},void 0,!0)]),_:3}),l(t.$slots,"home-hero-after",{},void 0,!0),l(t.$slots,"home-features-before",{},void 0,!0),m(Yo),l(t.$slots,"home-features-after",{},void 0,!0),i(e).markdownStyles!==!1?(a(),k(Xo,{key:0},{default:d(()=>[m(n)]),_:1})):(a(),k(n,{key:1}))])}}}),es=b(xo,[["__scopeId","data-v-9b112d22"]]),ts={},os={class:"VPPage"};function ss(o,e){const t=z("Content");return a(),u("div",os,[l(o.$slots,"page-top"),m(t),l(o.$slots,"page-bottom")])}const ns=b(ts,[["render",ss]]),as=_({__name:"VPContent",setup(o){const{page:e,frontmatter:t}=L(),{hasSidebar:s}=O();return(n,r)=>(a(),u("div",{class:T(["VPContent",{"has-sidebar":i(s),"is-home":i(t).layout==="home"}]),id:"VPContent"},[i(e).isNotFound?l(n.$slots,"not-found",{key:0},()=>[m(pt)],!0):i(t).layout==="page"?(a(),k(ns,{key:1},{"page-top":d(()=>[l(n.$slots,"page-top",{},void 0,!0)]),"page-bottom":d(()=>[l(n.$slots,"page-bottom",{},void 0,!0)]),_:3})):i(t).layout==="home"?(a(),k(es,{key:2},{"home-hero-before":d(()=>[l(n.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":d(()=>[l(n.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":d(()=>[l(n.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":d(()=>[l(n.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":d(()=>[l(n.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":d(()=>[l(n.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":d(()=>[l(n.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":d(()=>[l(n.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":d(()=>[l(n.$slots,"home-features-after",{},void 0,!0)]),_:3})):i(t).layout&&i(t).layout!=="doc"?(a(),k(R(i(t).layout),{key:3})):(a(),k(fo,{key:4},{"doc-top":d(()=>[l(n.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":d(()=>[l(n.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":d(()=>[l(n.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":d(()=>[l(n.$slots,"doc-before",{},void 0,!0)]),"doc-after":d(()=>[l(n.$slots,"doc-after",{},void 0,!0)]),"aside-top":d(()=>[l(n.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":d(()=>[l(n.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":d(()=>[l(n.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":d(()=>[l(n.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":d(()=>[l(n.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":d(()=>[l(n.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),rs=b(as,[["__scopeId","data-v-d775bacf"]]),is={class:"container"},ls=["innerHTML"],cs=["innerHTML"],us=_({__name:"VPFooter",setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:s}=O();return(n,r)=>i(e).footer&&i(t).footer!==!1?(a(),u("footer",{key:0,class:T(["VPFooter",{"has-sidebar":i(s)}])},[v("div",is,[i(e).footer.message?(a(),u("p",{key:0,class:"message",innerHTML:i(e).footer.message},null,8,ls)):h("",!0),i(e).footer.copyright?(a(),u("p",{key:1,class:"copyright",innerHTML:i(e).footer.copyright},null,8,cs)):h("",!0)])],2)):h("",!0)}}),ds=b(us,[["__scopeId","data-v-d072bf94"]]);function vs(){const{theme:o,frontmatter:e}=L(),t=ye([]),s=$(()=>t.value.length>0);return x(()=>{t.value=he(e.value.outline??o.value.outline)}),{headers:t,hasLocalNav:s}}const ps=o=>(C("data-v-cfdfe32f"),o=o(),H(),o),fs={class:"menu-text"},hs=ps(()=>v("span",{class:"vpi-chevron-right icon"},null,-1)),_s={class:"header"},ms={class:"outline"},ks=_({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(o){const e=o,{theme:t}=L(),s=I(!1),n=I(0),r=I(),c=I();function f(y){var V;(V=r.value)!=null&&V.contains(y.target)||(s.value=!1)}G(s,y=>{if(y){document.addEventListener("click",f);return}document.removeEventListener("click",f)}),We("Escape",()=>{s.value=!1}),x(()=>{s.value=!1});function p(){s.value=!s.value,n.value=window.innerHeight+Math.min(window.scrollY-e.navHeight,0)}function P(y){y.target.classList.contains("outline-link")&&(c.value&&(c.value.style.transition="none"),Ke(()=>{s.value=!1}))}function g(){s.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(y,V)=>(a(),u("div",{class:"VPLocalNavOutlineDropdown",style:Le({"--vp-vh":n.value+"px"}),ref_key:"main",ref:r},[y.headers.length>0?(a(),u("button",{key:0,onClick:p,class:T({open:s.value})},[v("span",fs,w(i(Te)(i(t))),1),hs],2)):(a(),u("button",{key:1,onClick:g},w(i(t).returnToTopLabel||"Return to top"),1)),m(de,{name:"flyout"},{default:d(()=>[s.value?(a(),u("div",{key:0,ref_key:"items",ref:c,class:"items",onClick:P},[v("div",_s,[v("a",{class:"top-link",href:"#",onClick:g},w(i(t).returnToTopLabel||"Return to top"),1)]),v("div",ms,[m(Ne,{headers:y.headers},null,8,["headers"])])],512)):h("",!0)]),_:1})],4))}}),bs=b(ks,[["__scopeId","data-v-cfdfe32f"]]),$s=o=>(C("data-v-75cda52d"),o=o(),H(),o),gs={class:"container"},ys=["aria-expanded"],Ps=$s(()=>v("span",{class:"vpi-align-left menu-icon"},null,-1)),Ls={class:"menu-text"},Vs=_({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:s}=O(),{headers:n}=vs(),{y:r}=Ve(),c=I(0);W(()=>{c.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))}),x(()=>{n.value=he(t.value.outline??e.value.outline)});const f=$(()=>n.value.length===0),p=$(()=>f.value&&!s.value),P=$(()=>({VPLocalNav:!0,"has-sidebar":s.value,empty:f.value,fixed:p.value}));return(g,y)=>i(t).layout!=="home"&&(!p.value||i(r)>=c.value)?(a(),u("div",{key:0,class:T(P.value)},[v("div",gs,[i(s)?(a(),u("button",{key:0,class:"menu","aria-expanded":g.open,"aria-controls":"VPSidebarNav",onClick:y[0]||(y[0]=V=>g.$emit("open-menu"))},[Ps,v("span",Ls,w(i(e).sidebarMenuLabel||"Menu"),1)],8,ys)):h("",!0),m(bs,{headers:i(n),navHeight:c.value},null,8,["headers","navHeight"])])],2)):h("",!0)}}),Ss=b(Vs,[["__scopeId","data-v-75cda52d"]]);function ws(){const o=I(!1);function e(){o.value=!0,window.addEventListener("resize",n)}function t(){o.value=!1,window.removeEventListener("resize",n)}function s(){o.value?t():e()}function n(){window.outerWidth>=768&&t()}const r=ee();return G(()=>r.path,t),{isScreenOpen:o,openScreen:e,closeScreen:t,toggleScreen:s}}const Is={},Ts={class:"VPSwitch",type:"button",role:"switch"},Ns={class:"check"},Ms={key:0,class:"icon"};function Bs(o,e){return a(),u("button",Ts,[v("span",Ns,[o.$slots.default?(a(),u("span",Ms,[l(o.$slots,"default",{},void 0,!0)])):h("",!0)])])}const As=b(Is,[["render",Bs],["__scopeId","data-v-60849eec"]]),Be=o=>(C("data-v-b9bf3ea7"),o=o(),H(),o),Cs=Be(()=>v("span",{class:"vpi-sun sun"},null,-1)),Hs=Be(()=>v("span",{class:"vpi-moon moon"},null,-1)),Es=_({__name:"VPSwitchAppearance",setup(o){const{isDark:e,theme:t}=L(),s=te("toggle-appearance",()=>{e.value=!e.value}),n=$(()=>e.value?t.value.lightModeSwitchTitle||"Switch to light theme":t.value.darkModeSwitchTitle||"Switch to dark theme");return(r,c)=>(a(),k(As,{title:n.value,class:"VPSwitchAppearance","aria-checked":i(e),onClick:i(s)},{default:d(()=>[Cs,Hs]),_:1},8,["title","aria-checked","onClick"]))}}),_e=b(Es,[["__scopeId","data-v-b9bf3ea7"]]),Fs={key:0,class:"VPNavBarAppearance"},Ds=_({__name:"VPNavBarAppearance",setup(o){const{site:e}=L();return(t,s)=>i(e).appearance&&i(e).appearance!=="force-dark"?(a(),u("div",Fs,[m(_e)])):h("",!0)}}),Os=b(Ds,[["__scopeId","data-v-de0ca626"]]),me=I();let Ae=!1,re=0;function js(o){const e=I(!1);if(oe){!Ae&&Us(),re++;const t=G(me,s=>{var n,r,c;s===o.el.value||(n=o.el.value)!=null&&n.contains(s)?(e.value=!0,(r=o.onFocus)==null||r.call(o)):(e.value=!1,(c=o.onBlur)==null||c.call(o))});pe(()=>{t(),re--,re||Gs()})}return Re(e)}function Us(){document.addEventListener("focusin",Ce),Ae=!0,me.value=document.activeElement}function Gs(){document.removeEventListener("focusin",Ce)}function Ce(){me.value=document.activeElement}const zs={class:"VPMenuLink"},qs=_({__name:"VPMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,s)=>(a(),u("div",zs,[m(F,{class:T({active:i(q)(i(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel},{default:d(()=>[D(w(t.item.text),1)]),_:1},8,["class","href","target","rel"])]))}}),se=b(qs,[["__scopeId","data-v-31327df9"]]),Ws={class:"VPMenuGroup"},Ks={key:0,class:"title"},Rs=_({__name:"VPMenuGroup",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),u("div",Ws,[e.text?(a(),u("p",Ks,w(e.text),1)):h("",!0),(a(!0),u(M,null,E(e.items,s=>(a(),u(M,null,["link"in s?(a(),k(se,{key:0,item:s},null,8,["item"])):h("",!0)],64))),256))]))}}),Js=b(Rs,[["__scopeId","data-v-4f28a81b"]]),Ys={class:"VPMenu"},Qs={key:0,class:"items"},Xs=_({__name:"VPMenu",props:{items:{}},setup(o){return(e,t)=>(a(),u("div",Ys,[e.items?(a(),u("div",Qs,[(a(!0),u(M,null,E(e.items,s=>(a(),u(M,{key:s.text},["link"in s?(a(),k(se,{key:0,item:s},null,8,["item"])):(a(),k(Js,{key:1,text:s.text,items:s.items},null,8,["text","items"]))],64))),128))])):h("",!0),l(e.$slots,"default",{},void 0,!0)]))}}),Zs=b(Xs,[["__scopeId","data-v-dde3ef49"]]),xs=o=>(C("data-v-a7c773c9"),o=o(),H(),o),en=["aria-expanded","aria-label"],tn={key:0,class:"text"},on=["innerHTML"],sn=xs(()=>v("span",{class:"vpi-chevron-down text-icon"},null,-1)),nn={key:1,class:"vpi-more-horizontal icon"},an={class:"menu"},rn=_({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(o){const e=I(!1),t=I();js({el:t,onBlur:s});function s(){e.value=!1}return(n,r)=>(a(),u("div",{class:"VPFlyout",ref_key:"el",ref:t,onMouseenter:r[1]||(r[1]=c=>e.value=!0),onMouseleave:r[2]||(r[2]=c=>e.value=!1)},[v("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":e.value,"aria-label":n.label,onClick:r[0]||(r[0]=c=>e.value=!e.value)},[n.button||n.icon?(a(),u("span",tn,[n.icon?(a(),u("span",{key:0,class:T([n.icon,"option-icon"])},null,2)):h("",!0),n.button?(a(),u("span",{key:1,innerHTML:n.button},null,8,on)):h("",!0),sn])):(a(),u("span",nn))],8,en),v("div",an,[m(Zs,{items:n.items},{default:d(()=>[l(n.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),ke=b(rn,[["__scopeId","data-v-a7c773c9"]]),ln=["href","aria-label","innerHTML"],cn=_({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(o){const e=o,t=$(()=>typeof e.icon=="object"?e.icon.svg:``);return(s,n)=>(a(),u("a",{class:"VPSocialLink no-icon",href:s.link,"aria-label":s.ariaLabel??(typeof s.icon=="string"?s.icon:""),target:"_blank",rel:"noopener",innerHTML:t.value},null,8,ln))}}),un=b(cn,[["__scopeId","data-v-dad2dcb9"]]),dn={class:"VPSocialLinks"},vn=_({__name:"VPSocialLinks",props:{links:{}},setup(o){return(e,t)=>(a(),u("div",dn,[(a(!0),u(M,null,E(e.links,({link:s,icon:n,ariaLabel:r})=>(a(),k(un,{key:s,icon:n,link:s,ariaLabel:r},null,8,["icon","link","ariaLabel"]))),128))]))}}),be=b(vn,[["__scopeId","data-v-1d3b9c74"]]),pn={key:0,class:"group translations"},fn={class:"trans-title"},hn={key:1,class:"group"},_n={class:"item appearance"},mn={class:"label"},kn={class:"appearance-action"},bn={key:2,class:"group"},$n={class:"item social-links"},gn=_({__name:"VPNavBarExtra",setup(o){const{site:e,theme:t}=L(),{localeLinks:s,currentLang:n}=J({correspondingLink:!0}),r=$(()=>s.value.length&&n.value.label||e.value.appearance||t.value.socialLinks);return(c,f)=>r.value?(a(),k(ke,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:d(()=>[i(s).length&&i(n).label?(a(),u("div",pn,[v("p",fn,w(i(n).label),1),(a(!0),u(M,null,E(i(s),p=>(a(),k(se,{key:p.link,item:p},null,8,["item"]))),128))])):h("",!0),i(e).appearance&&i(e).appearance!=="force-dark"?(a(),u("div",hn,[v("div",_n,[v("p",mn,w(i(t).darkModeSwitchLabel||"Appearance"),1),v("div",kn,[m(_e)])])])):h("",!0),i(t).socialLinks?(a(),u("div",bn,[v("div",$n,[m(be,{class:"social-links-list",links:i(t).socialLinks},null,8,["links"])])])):h("",!0)]),_:1})):h("",!0)}}),yn=b(gn,[["__scopeId","data-v-bbc6fded"]]),Pn=o=>(C("data-v-371faaaa"),o=o(),H(),o),Ln=["aria-expanded"],Vn=Pn(()=>v("span",{class:"container"},[v("span",{class:"top"}),v("span",{class:"middle"}),v("span",{class:"bottom"})],-1)),Sn=[Vn],wn=_({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(o){return(e,t)=>(a(),u("button",{type:"button",class:T(["VPNavBarHamburger",{active:e.active}]),"aria-label":"mobile navigation","aria-expanded":e.active,"aria-controls":"VPNavScreen",onClick:t[0]||(t[0]=s=>e.$emit("click"))},Sn,10,Ln))}}),In=b(wn,[["__scopeId","data-v-371faaaa"]]),Tn=["innerHTML"],Nn=_({__name:"VPNavBarMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,s)=>(a(),k(F,{class:T({VPNavBarMenuLink:!0,active:i(q)(i(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,noIcon:t.item.noIcon,target:t.item.target,rel:t.item.rel,tabindex:"0"},{default:d(()=>[v("span",{innerHTML:t.item.text},null,8,Tn)]),_:1},8,["class","href","noIcon","target","rel"]))}}),Mn=b(Nn,[["__scopeId","data-v-2517eabb"]]),Bn=_({__name:"VPNavBarMenuGroup",props:{item:{}},setup(o){const e=o,{page:t}=L(),s=r=>"link"in r?q(t.value.relativePath,r.link,!!e.item.activeMatch):r.items.some(s),n=$(()=>s(e.item));return(r,c)=>(a(),k(ke,{class:T({VPNavBarMenuGroup:!0,active:i(q)(i(t).relativePath,r.item.activeMatch,!!r.item.activeMatch)||n.value}),button:r.item.text,items:r.item.items},null,8,["class","button","items"]))}}),An=o=>(C("data-v-d955c7d8"),o=o(),H(),o),Cn={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},Hn=An(()=>v("span",{id:"main-nav-aria-label",class:"visually-hidden"},"Main Navigation",-1)),En=_({__name:"VPNavBarMenu",setup(o){const{theme:e}=L();return(t,s)=>i(e).nav?(a(),u("nav",Cn,[Hn,(a(!0),u(M,null,E(i(e).nav,n=>(a(),u(M,{key:n.text},["link"in n?(a(),k(Mn,{key:0,item:n},null,8,["item"])):(a(),k(Bn,{key:1,item:n},null,8,["item"]))],64))),128))])):h("",!0)}}),Fn=b(En,[["__scopeId","data-v-d955c7d8"]]);function Dn(o){const{localeIndex:e,theme:t}=L();function s(n){var B,A,S;const r=n.split("."),c=(B=t.value.search)==null?void 0:B.options,f=c&&typeof c=="object",p=f&&((S=(A=c.locales)==null?void 0:A[e.value])==null?void 0:S.translations)||null,P=f&&c.translations||null;let g=p,y=P,V=o;const N=r.pop();for(const j of r){let U=null;const K=V==null?void 0:V[j];K&&(U=V=K);const ne=y==null?void 0:y[j];ne&&(U=y=ne);const ae=g==null?void 0:g[j];ae&&(U=g=ae),K||(V=U),ne||(y=U),ae||(g=U)}return(g==null?void 0:g[N])??(y==null?void 0:y[N])??(V==null?void 0:V[N])??""}return s}const On=["aria-label"],jn={class:"DocSearch-Button-Container"},Un=v("span",{class:"vp-icon DocSearch-Search-Icon"},null,-1),Gn={class:"DocSearch-Button-Placeholder"},zn=v("span",{class:"DocSearch-Button-Keys"},[v("kbd",{class:"DocSearch-Button-Key"}),v("kbd",{class:"DocSearch-Button-Key"},"K")],-1),$e=_({__name:"VPNavBarSearchButton",setup(o){const t=Dn({button:{buttonText:"Search",buttonAriaLabel:"Search"}});return(s,n)=>(a(),u("button",{type:"button",class:"DocSearch DocSearch-Button","aria-label":i(t)("button.buttonAriaLabel")},[v("span",jn,[Un,v("span",Gn,w(i(t)("button.buttonText")),1)]),zn],8,On))}}),qn={class:"VPNavBarSearch"},Wn={id:"local-search"},Kn={key:1,id:"docsearch"},Rn=_({__name:"VPNavBarSearch",setup(o){const e=()=>null,t=()=>null,{theme:s}=L(),n=I(!1),r=I(!1);W(()=>{});function c(){n.value||(n.value=!0,setTimeout(f,16))}function f(){const g=new Event("keydown");g.key="k",g.metaKey=!0,window.dispatchEvent(g),setTimeout(()=>{document.querySelector(".DocSearch-Modal")||f()},16)}const p=I(!1),P="";return(g,y)=>{var V;return a(),u("div",qn,[i(P)==="local"?(a(),u(M,{key:0},[p.value?(a(),k(i(e),{key:0,onClose:y[0]||(y[0]=N=>p.value=!1)})):h("",!0),v("div",Wn,[m($e,{onClick:y[1]||(y[1]=N=>p.value=!0)})])],64)):i(P)==="algolia"?(a(),u(M,{key:1},[n.value?(a(),k(i(t),{key:0,algolia:((V=i(s).search)==null?void 0:V.options)??i(s).algolia,onVnodeBeforeMount:y[2]||(y[2]=N=>r.value=!0)},null,8,["algolia"])):h("",!0),r.value?h("",!0):(a(),u("div",Kn,[m($e,{onClick:c})]))],64)):h("",!0)])}}}),Jn=_({__name:"VPNavBarSocialLinks",setup(o){const{theme:e}=L();return(t,s)=>i(e).socialLinks?(a(),k(be,{key:0,class:"VPNavBarSocialLinks",links:i(e).socialLinks},null,8,["links"])):h("",!0)}}),Yn=b(Jn,[["__scopeId","data-v-4c68144d"]]),Qn=["href","rel","target"],Xn={key:1},Zn={key:2},xn=_({__name:"VPNavBarTitle",setup(o){const{site:e,theme:t}=L(),{hasSidebar:s}=O(),{currentLang:n}=J(),r=$(()=>{var p;return typeof t.value.logoLink=="string"?t.value.logoLink:(p=t.value.logoLink)==null?void 0:p.link}),c=$(()=>{var p;return typeof t.value.logoLink=="string"||(p=t.value.logoLink)==null?void 0:p.rel}),f=$(()=>{var p;return typeof t.value.logoLink=="string"||(p=t.value.logoLink)==null?void 0:p.target});return(p,P)=>(a(),u("div",{class:T(["VPNavBarTitle",{"has-sidebar":i(s)}])},[v("a",{class:"title",href:r.value??i(fe)(i(n).link),rel:c.value,target:f.value},[l(p.$slots,"nav-bar-title-before",{},void 0,!0),i(t).logo?(a(),k(X,{key:0,class:"logo",image:i(t).logo},null,8,["image"])):h("",!0),i(t).siteTitle?(a(),u("span",Xn,w(i(t).siteTitle),1)):i(t).siteTitle===void 0?(a(),u("span",Zn,w(i(e).title),1)):h("",!0),l(p.$slots,"nav-bar-title-after",{},void 0,!0)],8,Qn)],2))}}),ea=b(xn,[["__scopeId","data-v-0f24fcb7"]]),ta={class:"items"},oa={class:"title"},sa=_({__name:"VPNavBarTranslations",setup(o){const{theme:e}=L(),{localeLinks:t,currentLang:s}=J({correspondingLink:!0});return(n,r)=>i(t).length&&i(s).label?(a(),k(ke,{key:0,class:"VPNavBarTranslations",icon:"vpi-languages",label:i(e).langMenuLabel||"Change language"},{default:d(()=>[v("div",ta,[v("p",oa,w(i(s).label),1),(a(!0),u(M,null,E(i(t),c=>(a(),k(se,{key:c.link,item:c},null,8,["item"]))),128))])]),_:1},8,["label"])):h("",!0)}}),na=b(sa,[["__scopeId","data-v-d5f2cf0c"]]),aa=o=>(C("data-v-1607ff38"),o=o(),H(),o),ra={class:"wrapper"},ia={class:"container"},la={class:"title"},ca={class:"content"},ua={class:"content-body"},da=aa(()=>v("div",{class:"divider"},[v("div",{class:"divider-line"})],-1)),va=_({__name:"VPNavBar",props:{isScreenOpen:{type:Boolean}},emits:["toggle-screen"],setup(o){const{y:e}=Ve(),{hasSidebar:t}=O(),{frontmatter:s}=L(),n=I({});return ge(()=>{n.value={"has-sidebar":t.value,home:s.value.layout==="home",top:e.value===0}}),(r,c)=>(a(),u("div",{class:T(["VPNavBar",n.value])},[v("div",ra,[v("div",ia,[v("div",la,[m(ea,null,{"nav-bar-title-before":d(()=>[l(r.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":d(()=>[l(r.$slots,"nav-bar-title-after",{},void 0,!0)]),_:3})]),v("div",ca,[v("div",ua,[l(r.$slots,"nav-bar-content-before",{},void 0,!0),m(Rn,{class:"search"}),m(Fn,{class:"menu"}),m(na,{class:"translations"}),m(Os,{class:"appearance"}),m(Yn,{class:"social-links"}),m(yn,{class:"extra"}),l(r.$slots,"nav-bar-content-after",{},void 0,!0),m(In,{class:"hamburger",active:r.isScreenOpen,onClick:c[0]||(c[0]=f=>r.$emit("toggle-screen"))},null,8,["active"])])])])]),da],2))}}),pa=b(va,[["__scopeId","data-v-1607ff38"]]),fa={key:0,class:"VPNavScreenAppearance"},ha={class:"text"},_a=_({__name:"VPNavScreenAppearance",setup(o){const{site:e,theme:t}=L();return(s,n)=>i(e).appearance&&i(e).appearance!=="force-dark"?(a(),u("div",fa,[v("p",ha,w(i(t).darkModeSwitchLabel||"Appearance"),1),m(_e)])):h("",!0)}}),ma=b(_a,[["__scopeId","data-v-549ff98c"]]),ka=_({__name:"VPNavScreenMenuLink",props:{item:{}},setup(o){const e=te("close-screen");return(t,s)=>(a(),k(F,{class:"VPNavScreenMenuLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:i(e),innerHTML:t.item.text},null,8,["href","target","rel","onClick","innerHTML"]))}}),ba=b(ka,[["__scopeId","data-v-627cba65"]]),$a=_({__name:"VPNavScreenMenuGroupLink",props:{item:{}},setup(o){const e=te("close-screen");return(t,s)=>(a(),k(F,{class:"VPNavScreenMenuGroupLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:i(e)},{default:d(()=>[D(w(t.item.text),1)]),_:1},8,["href","target","rel","onClick"]))}}),He=b($a,[["__scopeId","data-v-cdb653dc"]]),ga={class:"VPNavScreenMenuGroupSection"},ya={key:0,class:"title"},Pa=_({__name:"VPNavScreenMenuGroupSection",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),u("div",ga,[e.text?(a(),u("p",ya,w(e.text),1)):h("",!0),(a(!0),u(M,null,E(e.items,s=>(a(),k(He,{key:s.text,item:s},null,8,["item"]))),128))]))}}),La=b(Pa,[["__scopeId","data-v-0f2d410a"]]),Va=o=>(C("data-v-17f9732b"),o=o(),H(),o),Sa=["aria-controls","aria-expanded"],wa=["innerHTML"],Ia=Va(()=>v("span",{class:"vpi-plus button-icon"},null,-1)),Ta=["id"],Na={key:1,class:"group"},Ma=_({__name:"VPNavScreenMenuGroup",props:{text:{},items:{}},setup(o){const e=o,t=I(!1),s=$(()=>`NavScreenGroup-${e.text.replace(" ","-").toLowerCase()}`);function n(){t.value=!t.value}return(r,c)=>(a(),u("div",{class:T(["VPNavScreenMenuGroup",{open:t.value}])},[v("button",{class:"button","aria-controls":s.value,"aria-expanded":t.value,onClick:n},[v("span",{class:"button-text",innerHTML:r.text},null,8,wa),Ia],8,Sa),v("div",{id:s.value,class:"items"},[(a(!0),u(M,null,E(r.items,f=>(a(),u(M,{key:f.text},["link"in f?(a(),u("div",{key:f.text,class:"item"},[m(He,{item:f},null,8,["item"])])):(a(),u("div",Na,[m(La,{text:f.text,items:f.items},null,8,["text","items"])]))],64))),128))],8,Ta)],2))}}),Ba=b(Ma,[["__scopeId","data-v-17f9732b"]]),Aa={key:0,class:"VPNavScreenMenu"},Ca=_({__name:"VPNavScreenMenu",setup(o){const{theme:e}=L();return(t,s)=>i(e).nav?(a(),u("nav",Aa,[(a(!0),u(M,null,E(i(e).nav,n=>(a(),u(M,{key:n.text},["link"in n?(a(),k(ba,{key:0,item:n},null,8,["item"])):(a(),k(Ba,{key:1,text:n.text||"",items:n.items},null,8,["text","items"]))],64))),128))])):h("",!0)}}),Ha=_({__name:"VPNavScreenSocialLinks",setup(o){const{theme:e}=L();return(t,s)=>i(e).socialLinks?(a(),k(be,{key:0,class:"VPNavScreenSocialLinks",links:i(e).socialLinks},null,8,["links"])):h("",!0)}}),Ee=o=>(C("data-v-f3b904c4"),o=o(),H(),o),Ea=Ee(()=>v("span",{class:"vpi-languages icon lang"},null,-1)),Fa=Ee(()=>v("span",{class:"vpi-chevron-down icon chevron"},null,-1)),Da={class:"list"},Oa=_({__name:"VPNavScreenTranslations",setup(o){const{localeLinks:e,currentLang:t}=J({correspondingLink:!0}),s=I(!1);function n(){s.value=!s.value}return(r,c)=>i(e).length&&i(t).label?(a(),u("div",{key:0,class:T(["VPNavScreenTranslations",{open:s.value}])},[v("button",{class:"title",onClick:n},[Ea,D(" "+w(i(t).label)+" ",1),Fa]),v("ul",Da,[(a(!0),u(M,null,E(i(e),f=>(a(),u("li",{key:f.link,class:"item"},[m(F,{class:"link",href:f.link},{default:d(()=>[D(w(f.text),1)]),_:2},1032,["href"])]))),128))])],2)):h("",!0)}}),ja=b(Oa,[["__scopeId","data-v-f3b904c4"]]),Ua={class:"container"},Ga=_({__name:"VPNavScreen",props:{open:{type:Boolean}},setup(o){const e=I(null),t=Se(oe?document.body:null);return(s,n)=>(a(),k(de,{name:"fade",onEnter:n[0]||(n[0]=r=>t.value=!0),onAfterLeave:n[1]||(n[1]=r=>t.value=!1)},{default:d(()=>[s.open?(a(),u("div",{key:0,class:"VPNavScreen",ref_key:"screen",ref:e,id:"VPNavScreen"},[v("div",Ua,[l(s.$slots,"nav-screen-content-before",{},void 0,!0),m(Ca,{class:"menu"}),m(ja,{class:"translations"}),m(ma,{class:"appearance"}),m(Ha,{class:"social-links"}),l(s.$slots,"nav-screen-content-after",{},void 0,!0)])],512)):h("",!0)]),_:3}))}}),za=b(Ga,[["__scopeId","data-v-ae2b2cde"]]),qa={key:0,class:"VPNav"},Wa=_({__name:"VPNav",setup(o){const{isScreenOpen:e,closeScreen:t,toggleScreen:s}=ws(),{frontmatter:n}=L(),r=$(()=>n.value.navbar!==!1);return we("close-screen",t),Z(()=>{oe&&document.documentElement.classList.toggle("hide-nav",!r.value)}),(c,f)=>r.value?(a(),u("header",qa,[m(pa,{"is-screen-open":i(e),onToggleScreen:i(s)},{"nav-bar-title-before":d(()=>[l(c.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":d(()=>[l(c.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":d(()=>[l(c.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":d(()=>[l(c.$slots,"nav-bar-content-after",{},void 0,!0)]),_:3},8,["is-screen-open","onToggleScreen"]),m(za,{open:i(e)},{"nav-screen-content-before":d(()=>[l(c.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":d(()=>[l(c.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3},8,["open"])])):h("",!0)}}),Ka=b(Wa,[["__scopeId","data-v-1930908d"]]),Fe=o=>(C("data-v-bbf5bb9d"),o=o(),H(),o),Ra=["role","tabindex"],Ja=Fe(()=>v("div",{class:"indicator"},null,-1)),Ya=Fe(()=>v("span",{class:"vpi-chevron-right caret-icon"},null,-1)),Qa=[Ya],Xa={key:1,class:"items"},Za=_({__name:"VPSidebarItem",props:{item:{},depth:{}},setup(o){const e=o,{collapsed:t,collapsible:s,isLink:n,isActiveLink:r,hasActiveLink:c,hasChildren:f,toggle:p}=mt($(()=>e.item)),P=$(()=>f.value?"section":"div"),g=$(()=>n.value?"a":"div"),y=$(()=>f.value?e.depth+2===7?"p":`h${e.depth+2}`:"p"),V=$(()=>n.value?void 0:"button"),N=$(()=>[[`level-${e.depth}`],{collapsible:s.value},{collapsed:t.value},{"is-link":n.value},{"is-active":r.value},{"has-active":c.value}]);function B(S){"key"in S&&S.key!=="Enter"||!e.item.link&&p()}function A(){e.item.link&&p()}return(S,j)=>{const U=z("VPSidebarItem",!0);return a(),k(R(P.value),{class:T(["VPSidebarItem",N.value])},{default:d(()=>[S.item.text?(a(),u("div",Y({key:0,class:"item",role:V.value},Ye(S.item.items?{click:B,keydown:B}:{},!0),{tabindex:S.item.items&&0}),[Ja,S.item.link?(a(),k(F,{key:0,tag:g.value,class:"link",href:S.item.link,rel:S.item.rel,target:S.item.target},{default:d(()=>[(a(),k(R(y.value),{class:"text",innerHTML:S.item.text},null,8,["innerHTML"]))]),_:1},8,["tag","href","rel","target"])):(a(),k(R(y.value),{key:1,class:"text",innerHTML:S.item.text},null,8,["innerHTML"])),S.item.collapsed!=null&&S.item.items&&S.item.items.length?(a(),u("div",{key:2,class:"caret",role:"button","aria-label":"toggle section",onClick:A,onKeydown:Je(A,["enter"]),tabindex:"0"},Qa,32)):h("",!0)],16,Ra)):h("",!0),S.item.items&&S.item.items.length?(a(),u("div",Xa,[S.depth<5?(a(!0),u(M,{key:0},E(S.item.items,K=>(a(),k(U,{key:K.text,item:K,depth:S.depth+1},null,8,["item","depth"]))),128)):h("",!0)])):h("",!0)]),_:1},8,["class"])}}}),xa=b(Za,[["__scopeId","data-v-bbf5bb9d"]]),De=o=>(C("data-v-5a2494f1"),o=o(),H(),o),er=De(()=>v("div",{class:"curtain"},null,-1)),tr={class:"nav",id:"VPSidebarNav","aria-labelledby":"sidebar-aria-label",tabindex:"-1"},or=De(()=>v("span",{class:"visually-hidden",id:"sidebar-aria-label"}," Sidebar Navigation ",-1)),sr=_({__name:"VPSidebar",props:{open:{type:Boolean}},setup(o){const{sidebarGroups:e,hasSidebar:t}=O(),s=o,n=I(null),r=Se(oe?document.body:null);return G([s,n],()=>{var c;s.open?(r.value=!0,(c=n.value)==null||c.focus()):r.value=!1},{immediate:!0,flush:"post"}),(c,f)=>i(t)?(a(),u("aside",{key:0,class:T(["VPSidebar",{open:c.open}]),ref_key:"navEl",ref:n,onClick:f[0]||(f[0]=Qe(()=>{},["stop"]))},[er,v("nav",tr,[or,l(c.$slots,"sidebar-nav-before",{},void 0,!0),(a(!0),u(M,null,E(i(e),p=>(a(),u("div",{key:p.text,class:"group"},[m(xa,{item:p,depth:0},null,8,["item"])]))),128)),l(c.$slots,"sidebar-nav-after",{},void 0,!0)])],2)):h("",!0)}}),nr=b(sr,[["__scopeId","data-v-5a2494f1"]]),ar=_({__name:"VPSkipLink",setup(o){const e=ee(),t=I();G(()=>e.path,()=>t.value.focus());function s({target:n}){const r=document.getElementById(decodeURIComponent(n.hash).slice(1));if(r){const c=()=>{r.removeAttribute("tabindex"),r.removeEventListener("blur",c)};r.setAttribute("tabindex","-1"),r.addEventListener("blur",c),r.focus(),window.scrollTo(0,0)}}return(n,r)=>(a(),u(M,null,[v("span",{ref_key:"backToTop",ref:t,tabindex:"-1"},null,512),v("a",{href:"#VPContent",class:"VPSkipLink visually-hidden",onClick:s}," Skip to content ")],64))}}),rr=b(ar,[["__scopeId","data-v-5fca3eed"]]),ir=_({__name:"Layout",setup(o){const{isOpen:e,open:t,close:s}=O(),n=ee();G(()=>n.path,s),_t(e,s);const{frontmatter:r}=L(),c=Xe(),f=$(()=>!!c["home-hero-image"]);return we("hero-image-slot-exists",f),(p,P)=>{const g=z("Content");return i(r).layout!==!1?(a(),u("div",{key:0,class:T(["Layout",i(r).pageClass])},[l(p.$slots,"layout-top",{},void 0,!0),m(rr),m(tt,{class:"backdrop",show:i(e),onClick:i(s)},null,8,["show","onClick"]),m(Ka,null,{"nav-bar-title-before":d(()=>[l(p.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":d(()=>[l(p.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":d(()=>[l(p.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":d(()=>[l(p.$slots,"nav-bar-content-after",{},void 0,!0)]),"nav-screen-content-before":d(()=>[l(p.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":d(()=>[l(p.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3}),m(Ss,{open:i(e),onOpenMenu:i(t)},null,8,["open","onOpenMenu"]),m(nr,{open:i(e)},{"sidebar-nav-before":d(()=>[l(p.$slots,"sidebar-nav-before",{},void 0,!0)]),"sidebar-nav-after":d(()=>[l(p.$slots,"sidebar-nav-after",{},void 0,!0)]),_:3},8,["open"]),m(rs,null,{"page-top":d(()=>[l(p.$slots,"page-top",{},void 0,!0)]),"page-bottom":d(()=>[l(p.$slots,"page-bottom",{},void 0,!0)]),"not-found":d(()=>[l(p.$slots,"not-found",{},void 0,!0)]),"home-hero-before":d(()=>[l(p.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":d(()=>[l(p.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":d(()=>[l(p.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":d(()=>[l(p.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":d(()=>[l(p.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":d(()=>[l(p.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":d(()=>[l(p.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":d(()=>[l(p.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":d(()=>[l(p.$slots,"home-features-after",{},void 0,!0)]),"doc-footer-before":d(()=>[l(p.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":d(()=>[l(p.$slots,"doc-before",{},void 0,!0)]),"doc-after":d(()=>[l(p.$slots,"doc-after",{},void 0,!0)]),"doc-top":d(()=>[l(p.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":d(()=>[l(p.$slots,"doc-bottom",{},void 0,!0)]),"aside-top":d(()=>[l(p.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":d(()=>[l(p.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":d(()=>[l(p.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":d(()=>[l(p.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":d(()=>[l(p.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":d(()=>[l(p.$slots,"aside-ads-after",{},void 0,!0)]),_:3}),m(ds),l(p.$slots,"layout-bottom",{},void 0,!0)],2)):(a(),k(g,{key:1}))}}}),lr=b(ir,[["__scopeId","data-v-435f49ed"]]),cr={Layout:lr,enhanceApp:({app:o})=>{o.component("Badge",Ze)}},ur={props:{js:{type:Boolean,default:!0},json:{type:Boolean,default:!0},opt:{type:Boolean,default:!1}}};function dr(o,e,t,s,n,r){const c=z("Badge");return a(),u("span",null,[t.js?(a(),k(c,{key:0,text:"JS",type:"tip"})):h("",!0),t.json?(a(),k(c,{key:1,text:"JSON",type:"warning"})):h("",!0),t.opt?(a(),k(c,{key:2,text:"Optional",type:"danger"})):h("",!0)])}const vr=b(ur,[["render",dr]]),fr={extends:cr,enhanceApp({app:o,router:e,siteData:t}){o.component("Jbadge",vr)}};export{fr as R}; diff --git a/assets/cn_compatibility.md.DFXspByW.js b/assets/cn_compatibility.md.DFXspByW.js new file mode 100644 index 000000000..a803fc242 --- /dev/null +++ b/assets/cn_compatibility.md.DFXspByW.js @@ -0,0 +1 @@ +import{_ as t,c as e,o as r,a1 as o}from"./chunks/framework.qh4ipt1c.js";const b=JSON.parse('{"title":"兼容性","description":"","frontmatter":{},"headers":[],"relativePath":"cn/compatibility.md","filePath":"cn/compatibility.md","lastUpdated":1715146018000}'),a={name:"cn/compatibility.md"},d=o('兼容性 浏览器及脚本管理器 + Firefox + Violentmonkey Chrome/Microsoft Edge Dev + Tampermonkey+ Waterfox + Greasemonkey 4Firefox > ESRChrome > 45 , Edge Dev ChannelLatestScript is tested under:Firefox latest + Violentmonkey (Recommended combination)Microsoft Edge Dev + TampermonkeyWaterfox 56.3 + Greasemonkey 4.9Chrome 48 + TampermonkeyKnown issue:Firefox < 62 + Tampermonkey is incompatible with webpack or core-js. I don't really know where the 🐛 is. I have submitted an issue to Tampermonkey https://github.com/Tampermonkey/tampermonkey/issues/834. Unless he fixes it, I can do nothing.漫画网站 WebsiteChromeFirefox天极动漫频道新闻 yesky✅✅动漫之家 dmzj✅❎看漫画 manhuagui✅ X-Header❎CC 漫画网 tuku✅✅SF 在线漫画✅❎哦漫画 omanhua✅❎汗汗/虎虎漫画✅✅99 漫画✅✅酷酷动漫 kukudm✅✅天使漫画网 tsdm✅✅',6),i=[d];function n(s,h,l,m,p,c){return r(),e("div",null,i)}const u=t(a,[["render",n]]);export{b as __pageData,u as default}; diff --git a/assets/cn_compatibility.md.DFXspByW.lean.js b/assets/cn_compatibility.md.DFXspByW.lean.js new file mode 100644 index 000000000..63fc55377 --- /dev/null +++ b/assets/cn_compatibility.md.DFXspByW.lean.js @@ -0,0 +1 @@ +import{_ as t,c as e,o as r,a1 as o}from"./chunks/framework.qh4ipt1c.js";const b=JSON.parse('{"title":"兼容性","description":"","frontmatter":{},"headers":[],"relativePath":"cn/compatibility.md","filePath":"cn/compatibility.md","lastUpdated":1715146018000}'),a={name:"cn/compatibility.md"},d=o("",6),i=[d];function n(s,h,l,m,p,c){return r(),e("div",null,i)}const u=t(a,[["render",n]]);export{b as __pageData,u as default}; diff --git a/assets/cn_database.md.0MAp0LYl.js b/assets/cn_database.md.0MAp0LYl.js new file mode 100644 index 000000000..9bb006d9c --- /dev/null +++ b/assets/cn_database.md.0MAp0LYl.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a1 as r}from"./chunks/framework.qh4ipt1c.js";const _=JSON.parse('{"title":"规则数据库","description":"","frontmatter":{},"headers":[],"relativePath":"cn/database.md","filePath":"cn/database.md","lastUpdated":1715146018000}'),o={name:"cn/database.md"},i=r('规则数据库 Wedata.net url: http://wedata.net/databases/AutoPagerize/items.jsonalternativeUrl: https://super-preloader.netlify.com/wedata.jsondetailUrl http://wedata.net/databases/AutoPagerize.jsoniBonus: How to login with openID account?Create a yahoo account and enter https://me.yahoo.com to the URL for openID login, then the website will redirect you to yahoo loginmachsix.github.io url: https://machsix.github.io/Super-preloader/mydata.jsonalternativeUrl: https://super-preloader.netlify.com/mydata.jsondetailUrl: https://machsix.github.io/Super-preloader/mydata_detail.json',5),l=[i];function n(s,h,d,c,p,u){return t(),a("div",null,l)}const b=e(o,[["render",n]]);export{_ as __pageData,b as default}; diff --git a/assets/cn_database.md.0MAp0LYl.lean.js b/assets/cn_database.md.0MAp0LYl.lean.js new file mode 100644 index 000000000..6c69dde18 --- /dev/null +++ b/assets/cn_database.md.0MAp0LYl.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a1 as r}from"./chunks/framework.qh4ipt1c.js";const _=JSON.parse('{"title":"规则数据库","description":"","frontmatter":{},"headers":[],"relativePath":"cn/database.md","filePath":"cn/database.md","lastUpdated":1715146018000}'),o={name:"cn/database.md"},i=r("",5),l=[i];function n(s,h,d,c,p,u){return t(),a("div",null,l)}const b=e(o,[["render",n]]);export{_ as __pageData,b as default}; diff --git a/assets/cn_develop.md.BfMaFYH0.js b/assets/cn_develop.md.BfMaFYH0.js new file mode 100644 index 000000000..f0eeaa23b --- /dev/null +++ b/assets/cn_develop.md.BfMaFYH0.js @@ -0,0 +1 @@ +import{_ as e,c as o,o as r,a1 as a}from"./chunks/framework.qh4ipt1c.js";const m=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/develop.md","filePath":"cn/develop.md","lastUpdated":1715146018000}'),t={name:"cn/develop.md"},c=a('简介 开发主要在Github展开。 参加开发前请先完成以下步骤安装node js, yarnfork it!使用yarn安装相关依赖(主要是代码格式化以及 lint)。请不要使用npm由于npm无法正确解析vuepress的依赖完整修改使用yarn test检查代码格式及脚本的正确性提交 PR,PR 前请使用git rebase将 commit 合并,一个英文指南脚本开发 你可以对任何文件进行合理修改PR 请使用fix, fea, feature 或core的前缀当前需求主要列在issue和project中。目前的主要需求包括:+ 固化Super_preloaderPlus_one_New.user.js+ 将脚本分拆为函数,同时将规则从脚本中提取到mydata.json+ 使用 ES8 重写Super_preloaderPlus_one_ES8.user.jsBeautify UI and use HTML template (maybe mustache-loader, vue is too big for such a tiny script)规则的添加及修复 你可以对dist/mydata.json或Super_preloaderPlus_one_New.user.js进行合理修改PR 请使用rule的前缀请先学习JSON 格式,然后学习Xpath 选择器并尝试使用浏览器的开发者工具提取 XPath。之后你就可以阅读站点规则学习规则的格式然后编写规则了 😄在可能的情况下请优先对dist/mydata.json进行修改。',13),l=[c];function s(d,p,i,n,u,h){return r(),o("div",null,l)}const f=e(t,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/cn_develop.md.BfMaFYH0.lean.js b/assets/cn_develop.md.BfMaFYH0.lean.js new file mode 100644 index 000000000..6122700cb --- /dev/null +++ b/assets/cn_develop.md.BfMaFYH0.lean.js @@ -0,0 +1 @@ +import{_ as e,c as o,o as r,a1 as a}from"./chunks/framework.qh4ipt1c.js";const m=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/develop.md","filePath":"cn/develop.md","lastUpdated":1715146018000}'),t={name:"cn/develop.md"},c=a("",13),l=[c];function s(d,p,i,n,u,h){return r(),o("div",null,l)}const f=e(t,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/cn_example.md.C1LVQ_ed.js b/assets/cn_example.md.C1LVQ_ed.js new file mode 100644 index 000000000..de789cc3c --- /dev/null +++ b/assets/cn_example.md.C1LVQ_ed.js @@ -0,0 +1 @@ +import{_ as a,a as e,b as t,c as o}from"./chunks/hhmm.apdfnDZY.js";import{_ as r,c as i,o as h,a1 as l}from"./chunks/framework.qh4ipt1c.js";const g=JSON.parse('{"title":"例子","description":"","frontmatter":{},"headers":[],"relativePath":"cn/example.md","filePath":"cn/example.md","lastUpdated":1715146018000}'),s={name:"cn/example.md"},c=l('例子 搜索引擎 Google: Baidu 漫画 XKCD: hhmm: ',11),d=[c];function n(m,_,p,u,b,f){return h(),i("div",null,d)}const k=r(s,[["render",n]]);export{g as __pageData,k as default}; diff --git a/assets/cn_example.md.C1LVQ_ed.lean.js b/assets/cn_example.md.C1LVQ_ed.lean.js new file mode 100644 index 000000000..debb5ca25 --- /dev/null +++ b/assets/cn_example.md.C1LVQ_ed.lean.js @@ -0,0 +1 @@ +import{_ as a,a as e,b as t,c as o}from"./chunks/hhmm.apdfnDZY.js";import{_ as r,c as i,o as h,a1 as l}from"./chunks/framework.qh4ipt1c.js";const g=JSON.parse('{"title":"例子","description":"","frontmatter":{},"headers":[],"relativePath":"cn/example.md","filePath":"cn/example.md","lastUpdated":1715146018000}'),s={name:"cn/example.md"},c=l("",11),d=[c];function n(m,_,p,u,b,f){return h(),i("div",null,d)}const k=r(s,[["render",n]]);export{g as __pageData,k as default}; diff --git a/assets/cn_faq.md.DKPUHfL4.js b/assets/cn_faq.md.DKPUHfL4.js new file mode 100644 index 000000000..89cf87951 --- /dev/null +++ b/assets/cn_faq.md.DKPUHfL4.js @@ -0,0 +1,8 @@ +import{_ as a,c as e,o as s,a1 as n}from"./chunks/framework.qh4ipt1c.js";const f=JSON.parse('{"title":"Faq","description":"","frontmatter":{},"headers":[],"relativePath":"cn/faq.md","filePath":"cn/faq.md","lastUpdated":1715146018000}'),t={name:"cn/faq.md"},o=n(`Faq How to repquest rule? To request rule, you should follow the following format + Title: [NSFW]Rule for www.example.com + Content: + Link: www.example.com/a.html + NSFW: yes or no + Screenshot: + xxx + Rule: (If you create one but fail, you'd better provide it to make life easier for me)I won’t spend time on writing rules for those who don’t obey the rule.`,5),p=[o];function l(r,i,c,d,u,h){return s(),e("div",null,p)}const m=a(t,[["render",l]]);export{f as __pageData,m as default}; diff --git a/assets/cn_faq.md.DKPUHfL4.lean.js b/assets/cn_faq.md.DKPUHfL4.lean.js new file mode 100644 index 000000000..98288adae --- /dev/null +++ b/assets/cn_faq.md.DKPUHfL4.lean.js @@ -0,0 +1 @@ +import{_ as a,c as e,o as s,a1 as n}from"./chunks/framework.qh4ipt1c.js";const f=JSON.parse('{"title":"Faq","description":"","frontmatter":{},"headers":[],"relativePath":"cn/faq.md","filePath":"cn/faq.md","lastUpdated":1715146018000}'),t={name:"cn/faq.md"},o=n("",5),p=[o];function l(r,i,c,d,u,h){return s(),e("div",null,p)}const m=a(t,[["render",l]]);export{f as __pageData,m as default}; diff --git a/assets/cn_index.md.DiJrdMqx.js b/assets/cn_index.md.DiJrdMqx.js new file mode 100644 index 000000000..59970510f --- /dev/null +++ b/assets/cn_index.md.DiJrdMqx.js @@ -0,0 +1 @@ +import{_ as t}from"./chunks/logo.BLgnOXGY.js";import{c as a,l as e,a as r,m as s,a1 as o,o as i,g as l}from"./chunks/framework.qh4ipt1c.js";const n=e("p",{align:"center",class:"logo-img"},[e("img",{src:t,alt:"logo",width:"100"})],-1),_=e("h1",{align:"center",class:"logo-text"},"Super-preloader",-1),h=e("br",null,null,-1),p={class:"center"},d=e("a",{href:"https://greasyfork.org/en/scripts/33522-super-preloaderplus-one-new",target:"_blank"},"Greasy Fork",-1),c=e("a",{href:"https://github.com/machsix/Super-preloader/raw/master/dist/Super_preloaderPlus_one_New.user.js",target:"_blank"},"Github",-1),u=["href"],f=o('简介 自动翻页脚本,由ywzhaiqi/Super_preloaderPlus修改而来。在此首先对作者swdyh, ywzhaiqi和NLF致以谢意。swdyh 仍在频繁的更新规则以及开发扩展AutoPagerize。相比AutoPagerize, 该脚本的主要优势在于规则的定义和 DOM 的处理更加灵活。你不仅可以使用xpath selector定义规则,还可以直接使用JavaScript提取元素、修改页面(比如去广告DocumentFilter、增加新功能)等。另一方面,鉴于 swdyh 维护的规则主要针对日文用户,我也希望该脚本及相关规则能惠及中文、英文用户。',4),P=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/index.md","filePath":"cn/index.md","lastUpdated":1715146018000}'),g={name:"cn/index.md"},x=Object.assign(g,{setup(m){return(b,k)=>(i(),a("div",null,[n,_,h,e("div",p,[r("从"),d,r(", "),c,r(" 或 "),e("a",{href:s(l)("/Super_preloaderPlus_one_New.user.js"),target:"_blank"},"Dev version",8,u),r("安装")]),f]))}});export{P as __pageData,x as default}; diff --git a/assets/cn_index.md.DiJrdMqx.lean.js b/assets/cn_index.md.DiJrdMqx.lean.js new file mode 100644 index 000000000..03d885204 --- /dev/null +++ b/assets/cn_index.md.DiJrdMqx.lean.js @@ -0,0 +1 @@ +import{_ as t}from"./chunks/logo.BLgnOXGY.js";import{c as a,l as e,a as r,m as s,a1 as o,o as i,g as l}from"./chunks/framework.qh4ipt1c.js";const n=e("p",{align:"center",class:"logo-img"},[e("img",{src:t,alt:"logo",width:"100"})],-1),_=e("h1",{align:"center",class:"logo-text"},"Super-preloader",-1),h=e("br",null,null,-1),p={class:"center"},d=e("a",{href:"https://greasyfork.org/en/scripts/33522-super-preloaderplus-one-new",target:"_blank"},"Greasy Fork",-1),c=e("a",{href:"https://github.com/machsix/Super-preloader/raw/master/dist/Super_preloaderPlus_one_New.user.js",target:"_blank"},"Github",-1),u=["href"],f=o("",4),P=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/index.md","filePath":"cn/index.md","lastUpdated":1715146018000}'),g={name:"cn/index.md"},x=Object.assign(g,{setup(m){return(b,k)=>(i(),a("div",null,[n,_,h,e("div",p,[r("从"),d,r(", "),c,r(" 或 "),e("a",{href:s(l)("/Super_preloaderPlus_one_New.user.js"),target:"_blank"},"Dev version",8,u),r("安装")]),f]))}});export{P as __pageData,x as default}; diff --git a/assets/cn_siterule.md.D7WIuG0H.js b/assets/cn_siterule.md.D7WIuG0H.js new file mode 100644 index 000000000..81991cf6e --- /dev/null +++ b/assets/cn_siterule.md.D7WIuG0H.js @@ -0,0 +1,24 @@ +import{_ as o,D as a,c as r,l,a as e,I as s,a1 as i,o as h}from"./chunks/framework.qh4ipt1c.js";const ks=JSON.parse('{"title":"站点规则","description":"","frontmatter":{"sidebarDepth":3},"headers":[],"relativePath":"cn/siterule.md","filePath":"cn/siterule.md","lastUpdated":1715146018000}'),d={name:"cn/siterule.md"},c=i('站点规则 站点规则可以是JavaScript object stored in file https://github.com/machsix/Super-preloader/blob/master/src/rules/jsSiteRule.js. You need to submit pull request through GithubJSON data 存储于https://github.com/machsix/Super-preloader/blob/master/dist/mydata.json的规则. 你可以自行添加到设置中的自定义站点规则我们更倾向于JSON data因为JSON可以实现热更新. 🌰 在文末.规则的基本构成 name ',6),u=l("strong",null,"type",-1),p=l("code",null,"String",-1),_=l("li",null,[l("strong",null,"description"),e(": 站点名称")],-1),k=l("h3",{id:"url",tabindex:"-1"},[e("url "),l("a",{class:"header-anchor",href:"#url","aria-label":'Permalink to "url"'},"")],-1),g=l("strong",null,"type",-1),E=l("code",null,"XPath String",-1),m=l("code",null,"XPath",-1),f=l("li",null,[l("strong",null,"description"),e(": 匹配站点的正则表达式")],-1),y={id:"exampleurl",tabindex:"-1"},b=l("a",{class:"header-anchor",href:"#exampleurl","aria-label":'Permalink to "exampleUrl "'},"",-1),F=l("strong",null,"type",-1),x=l("code",null,"String",-1),S=l("li",null,[l("strong",null,"description"),e(": 地址范例")],-1),v=l("h3",{id:"enable",tabindex:"-1"},[e("enable "),l("a",{class:"header-anchor",href:"#enable","aria-label":'Permalink to "enable"'},"")],-1),C=l("strong",null,"type",-1),P=l("code",null,"Boolean",-1),A=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"true")],-1),D=l("li",null,[l("strong",null,"description"),e(": 规则开关")],-1),T=l("h3",{id:"nextlink",tabindex:"-1"},[e("nextLink "),l("a",{class:"header-anchor",href:"#nextlink","aria-label":'Permalink to "nextLink"'},"")],-1),B=l("p",null,[e("脚本依据"),l("code",null,"nextLink"),e("寻找"),l("code",null,"下一页"),e("的 URL,我们提供了多种方式:")],-1),j=l("p",null,[l("a",{href:"https://devhints.io/xpath",target:"_blank",rel:"noreferrer"},"XPath selector"),e(":拥有"),l("code",null,"href"),e("属性并指向下一页的元素 或 内容为下一页的元素")],-1),q=l("strong",null,"type",-1),N=l("code",null,"XPath String",-1),O=l("code",null,"XPath",-1),I=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,'//div[@id="nav"]/a'),e(", "),l("code",null,'//div[@id="nav"]/a/@href'),e(",两者等效")],-1),J=l("p",null,[l("a",{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors",target:"_blank",rel:"noreferrer"},"CSS selector"),l("br")],-1),R=l("strong",null,"type",-1),w=l("code",null,"String",-1),V=l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"css;${CSS selector}")],-1),L=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,"css;div#nav>a")],-1),X=l("p",null,[l("a",{href:"./.html"},'"auto;"'),e("脚本会自动寻找所有"),l("code",null,"text()"),e("为“下一页”, “next page”等预定义的下一页文字且含有"),l("code",null,"href"),e("属性的"),l("code",null,"a"),e("的元素")],-1),W=l("strong",null,"type",-1),M=l("code",null,"String",-1),U=l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"auto;"),e(" 无选项")],-1),z=l("p",null,[l("a",{href:"./.html"},"function"),e("返回值为下一页链接的"),l("code",null,"JS"),e("函数")],-1),H=l("strong",null,"type",-1),$=l("code",null,"JS function",-1),G=l("li",null,[l("strong",null,"content"),e(":")],-1),Y=i(`jsfunction(currentDocument, currentWindow, currentPageURL) { + // **** your function is here **** + return urlOfNextPage +}`,1),K=l("li",null,[l("p",null,[l("a",{href:"./.html"},"Array"),e("脚本会遍历所有元素并使用 "),l("span",{style:{color:"blue","font-weight":"bold"}},"以上方法"),e(" 直至找到下一页链接地址")])],-1),Q=l("a",{href:"./.html"},"Object",-1),Z=l("code",null,"hrefInc",-1),ll={id:"prevlink",tabindex:"-1"},el=l("a",{class:"header-anchor",href:"#prevlink","aria-label":'Permalink to "prevLink "'},"",-1),sl=l("p",null,[e("同"),l("a",{href:"#nextlink"},"nextLink"),e(", 然而基本没什么时候需要😂")],-1),nl=l("h3",{id:"pageelement",tabindex:"-1"},[e("pageElement "),l("a",{class:"header-anchor",href:"#pageelement","aria-label":'Permalink to "pageElement"'},"")],-1),tl=l("p",null,[e("脚本根据"),l("code",null,"pageElement"),e("的定义查找自动翻页时拼接的元素。举个🌰,对于搜索引擎,"),l("code",null,"pageElement"),e("应为搜索的结果。 我们同样提供了以下方式:")],-1),il=l("p",null,[l("a",{href:"https://devhints.io/xpath",target:"_blank",rel:"noreferrer"},"XPath selector"),e(":拼接元素的"),l("code",null,"XPath selector")],-1),al=l("strong",null,"type",-1),ol=l("code",null,"XPath String",-1),rl=l("code",null,"XPath",-1),hl=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,'//div[@id="content]')],-1),dl=l("p",null,[l("a",{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors",target:"_blank",rel:"noreferrer"},"CSS selector"),l("br")],-1),cl=l("strong",null,"type",-1),ul=l("code",null,"String",-1),pl=l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"css;${CSS selector}")],-1),_l=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,"css;div#content")],-1),kl=l("p",null,[l("a",{href:"./.html"},"function"),e("返回拼接元素的"),l("a",{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection",target:"_blank",rel:"noreferrer"},"HTMLCollection"),e("的函数。 一个🌰是"),l("code",null,"WordPress"),e("的规则, 通过"),l("code",null,"JS"),e("函数我们可以判断一个页面是否是 post,如果不是就返回"),l("code",null,"null"),e("跳出脚本逻辑,如果是就返回 post 的内容。再一个🌰是某些漫画网站,我们可以使用"),l("code",null,"pageElement"),e("直接计算下一张图片的地址,从而避免加载无用的内容。")],-1),gl=l("strong",null,"type",-1),El=l("code",null,"JS function",-1),ml=l("li",null,[l("strong",null,"content"),e(":")],-1),fl=i(`jsfunction(currentDocument, currentWindow, currentPageURL) { + // **** your function is here **** + return HTMLCollection +}`,1),yl=l("h2",{id:"规则的增强功能",tabindex:"-1"},[e("规则的增强功能 "),l("a",{class:"header-anchor",href:"#规则的增强功能","aria-label":'Permalink to "规则的增强功能"'},"")],-1),bl=l("code",null,"key",-1),Fl=l("code",null,"autopager",-1),xl=l("code",null,"Object",-1),Sl=l("code",null,"autopager",-1),vl=l("code",null,"key",-1),Cl=l("code",null,"key",-1),Pl=l("h3",{id:"useiframe",tabindex:"-1"},[e("useiframe "),l("a",{class:"header-anchor",href:"#useiframe","aria-label":'Permalink to "useiframe"'},"")],-1),Al=l("strong",null,"type",-1),Dl=l("code",null,"Boolean",-1),Tl=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),Bl=l("li",null,[l("strong",null,"description"),e(": 使用 iframe 读取内容而不使用"),l("a",{href:"https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest",target:"_blank",rel:"noreferrer"},"XHR")],-1),jl=l("h3",{id:"iloaded",tabindex:"-1"},[e("iloaded "),l("a",{class:"header-anchor",href:"#iloaded","aria-label":'Permalink to "iloaded"'},"")],-1),ql=l("strong",null,"type",-1),Nl=l("code",null,"Boolean",-1),Ol=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),Il=l("li",null,[l("strong",null,"description"),e(": 是否在 iframe 完全 load 后操作..否则在 DOM 完成后操作")],-1),Jl=l("h3",{id:"itimeout",tabindex:"-1"},[e("itimeout "),l("a",{class:"header-anchor",href:"#itimeout","aria-label":'Permalink to "itimeout"'},"")],-1),Rl=l("strong",null,"type",-1),wl=l("code",null,"Number",-1),Vl=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"0")],-1),Ll=l("li",null,[l("strong",null,"description"),e(": "),l("code",null,"iloaded"),e("为"),l("code",null,"false"),e("时的延迟,单位为毫秒")],-1),Xl=l("h3",{id:"newiframe",tabindex:"-1"},[e("newIframe "),l("a",{class:"header-anchor",href:"#newiframe","aria-label":'Permalink to "newIframe"'},"")],-1),Wl=l("strong",null,"type",-1),Ml=l("code",null,"Boolean",-1),Ul=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),zl=l("li",null,[l("strong",null,"description"),e(": 当翻当前页面+2 时是否新建一个"),l("code",null,"iframe"),e(",在部分情况下有奇效")],-1),Hl=l("h3",{id:"reload",tabindex:"-1"},[e("reload "),l("a",{class:"header-anchor",href:"#reload","aria-label":'Permalink to "reload"'},"")],-1),$l=l("strong",null,"type",-1),Gl=l("code",null,"Boolean",-1),Yl=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),Kl=l("li",null,[l("strong",null,"description"),e(": 强制重载"),l("code",null,"iframe"),e(",在部分情况下有奇效")],-1),Ql=l("h3",{id:"force-enable",tabindex:"-1"},[e("force_enable "),l("a",{class:"header-anchor",href:"#force-enable","aria-label":'Permalink to "force_enable"'},"")],-1),Zl=l("strong",null,"type",-1),le=l("code",null,"Boolean",-1),ee=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),se=l("li",null,[l("strong",null,"description"),e(": 如果实在难以找出"),l("a",{href:"#pageelement"},"pageElement"),e(",开启该选项会使整个页面被拼接上去")],-1),ne=l("h3",{id:"headers",tabindex:"-1"},[e("headers "),l("a",{class:"header-anchor",href:"#headers","aria-label":'Permalink to "headers"'},"")],-1),te=l("strong",null,"type",-1),ie=l("code",null,"Object",-1),ae=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"{ Referer: <本页链接> }")],-1),oe=l("li",null,[l("strong",null,"description"),e(": 自定义请求下一页的 headers")],-1),re=l("h3",{id:"remain",tabindex:"-1"},[e("remain "),l("a",{class:"header-anchor",href:"#remain","aria-label":'Permalink to "remain"'},"")],-1),he=l("strong",null,"type",-1),de=l("code",null,"Number",-1),ce=i("default: 1 总是预翻一页description: 脚本会根据当前页面所剩余的高度决定是否翻页,当剩余高度 <= 页面高度 x remain 时开始翻页",2),ue=l("h3",{id:"maxpage",tabindex:"-1"},[e("maxpage "),l("a",{class:"header-anchor",href:"#maxpage","aria-label":'Permalink to "maxpage"'},"")],-1),pe=l("strong",null,"type",-1),_e=l("code",null,"Number",-1),ke=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"99")],-1),ge=l("li",null,[l("strong",null,"description"),e(": 最多翻页次数")],-1),Ee=i(`mutationObserver iframe 监听选项,用来控制主页面和 iframe 之间的通讯,一个例子js{ + timeout: 1000, + observers: { + attributes: "//div[@class='x']", // the node to monitor change of attributes + addedNodes: "//div[@class='x']", // the node to monitor MutationRecord.addedNodes + removedNodes: "//div[@class='x']" // the node to monitor MutationRecord.removedNodes + } +}timeout:`,4),me=l("strong",null,"type",-1),fe=l("code",null,"Int",-1),ye=l("li",null,[l("strong",null,"default"),e(": null")],-1),be=l("li",null,[l("strong",null,"description"),e(": 延迟通讯时间")],-1),Fe=l("p",null,"observer:",-1),xe=l("strong",null,"type",-1),Se=l("code",null,"Array",-1),ve=l("li",null,[l("strong",null,"default"),e(": null")],-1),Ce=l("li",null,[l("strong",null,"description"),e(": mutationObserver 监控的 element 的 selector")],-1),Pe=l("h3",{id:"ipages",tabindex:"-1"},[e("ipages "),l("a",{class:"header-anchor",href:"#ipages","aria-label":'Permalink to "ipages"'},"")],-1),Ae=l("strong",null,"type",-1),De=l("code",null,"Array",-1),Te=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"[false,2]")],-1),Be=l("li",null,[l("strong",null,"description"),e(": 立即翻页,第一项是控制是否在脚本加载的时候立即翻第二项(必须小于 maxpage)的页数,比如"),l("code",null,"[true,3]"),e(".就是说 JS 加载后.立即翻 3 页。对于图站可以有😂的体验")],-1),je=l("h3",{id:"separator",tabindex:"-1"},[e("separator "),l("a",{class:"header-anchor",href:"#separator","aria-label":'Permalink to "separator"'},"")],-1),qe=l("strong",null,"type",-1),Ne=l("code",null,"Boolean",-1),Oe=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"true")],-1),Ie=l("li",null,[l("strong",null,"description"),e(": 是否显示翻页导航栏")],-1),Je=l("h3",{id:"sepdivdom",tabindex:"-1"},[e("sepdivDom "),l("a",{class:"header-anchor",href:"#sepdivdom","aria-label":'Permalink to "sepdivDom"'},"")],-1),Re=l("strong",null,"type",-1),we=l("code",null,"JS function",-1),Ve=l("li",null,[l("strong",null,"description"),e(": 对于部分页面,脚本自动添加的导航栏可能造成页面格式错乱。"),l("code",null,"sepdivDom"),e("定义了一个函数来生成合适的导航栏,该导航栏会被插入在最后一个"),l("a",{href:"#pageelement"},"pageElement"),e("之后。 一个例子是"),l("code",null,"小木虫-帖子")],-1),Le=l("li",null,[l("strong",null,"example")],-1),Xe=i(`jsfunction(currentDocument, sepdiv) { + // currentDocument: 读取的下一页的DOM + // sepdiv: 脚本生成的导航栏,tag为div + const td = doc.createElement("td"); + td.appendChild(sepdiv); + const tr = doc.createElement("tr"); + td.setAttribute("colspan", 2); + tr.appendChild(td); + const tbody = doc.createElement("tbody"); + return tbody; +},startFilter `,2),We=l("strong",null,"type",-1),Me=l("code",null,"JS function",-1),Ue=l("li",null,[l("strong",null,"description"),e(": 一个作用于首页(i.e. 当前页面)的 js 函数,用于修正页面。接收"),l("code",null,"currentDocument"),e(", "),l("code",null,"currentWindow"),e("两个参数。 详情请查看"),l("a",{href:"#documentfilter"},"documentFilter (1)")],-1),ze=l("h3",{id:"documentfilter",tabindex:"-1"},[e("documentFilter "),l("a",{class:"header-anchor",href:"#documentfilter","aria-label":'Permalink to "documentFilter"'},"")],-1),He=l("a",{href:"./.html"},"JS function",-1),$e=l("ul",null,[l("li",null,[l("strong",null,"description"),e(": 一个作用于预读内容整体的 js 函数,执行于预读内容被插入到当前页面前。可以用来修正预读内容(比如 csdn)、去除广告(比如很多 nsfw)、根据 XHR 结果生成页面内容而避免使用 iframe(比如 bl-novel)甚至生成新的内容(比如 m-team)。 理论上你可以用 js 实现对 DOM 静态内容的修改")]),l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"function (currentDocument, nextPageLink) {return newDocument}")])],-1),Ge=l("li",null,[l("a",{href:"./.html"},'"startFilter"'),l("ul",null,[l("li",null,[l("strong",null,"description"),e(": 重复使用"),l("a",{href:"#startfilter"},"startFilter")])])],-1),Ye=l("h3",{id:"scriptfilter",tabindex:"-1"},[e("scriptFilter "),l("a",{class:"header-anchor",href:"#scriptfilter","aria-label":'Permalink to "scriptFilter"'},"")],-1),Ke=l("strong",null,"type",-1),Qe=l("li",null,[l("strong",null,"description"),e(": 在将预读内容插入到当前页面之前,脚本默认会移除所有的"),l("code",null," + + + + + + + + + Skip to content Super-preloaderMain Navigation主页简体中文English简体中文EnglishAppearanceMenuReturn to topOn this page兼容性 浏览器及脚本管理器 + Firefox + Violentmonkey Chrome/Microsoft Edge Dev + Tampermonkey+ Waterfox + Greasemonkey 4Firefox > ESRChrome > 45 , Edge Dev ChannelLatestScript is tested under:Firefox latest + Violentmonkey (Recommended combination)Microsoft Edge Dev + TampermonkeyWaterfox 56.3 + Greasemonkey 4.9Chrome 48 + TampermonkeyKnown issue:Firefox < 62 + Tampermonkey is incompatible with webpack or core-js. I don't really know where the 🐛 is. I have submitted an issue to Tampermonkey https://github.com/Tampermonkey/tampermonkey/issues/834. Unless he fixes it, I can do nothing.漫画网站 WebsiteChromeFirefox天极动漫频道新闻 yesky✅✅动漫之家 dmzj✅❎看漫画 manhuagui✅ X-Header❎CC 漫画网 tuku✅✅SF 在线漫画✅❎哦漫画 omanhua✅❎汗汗/虎虎漫画✅✅99 漫画✅✅酷酷动漫 kukudm✅✅天使漫画网 tsdm✅✅ + + + +
: plain text + // : Image + // : Audio and video + // : PDF (Chrome) + // body > #outerContainer:first-child + #printContainer:last-child: PDF (Firefox) + document.querySelector('body > pre:only-child, body > img:only-child, body > video:only-child, body > embed:only-child, body > #outerContainer:first-child + #printContainer:last-child')) { + return; + } + if (window.name === 'mynovelreader-iframe') { + return; + } + function CheckIframe() { + if (window.name === 'superpreloader-iframe') { + return true; + } else { + return false; + } + } + + // how to trigger lazy_load + // https://wiki.greasespot.net/Generate_Click_Events + if (CheckIframe()) { + // 搜狗,iframe里面怎么不加载js啊? + // 去掉了原版的另一种方法,因为新版本 chrome 已经支持。旧版本 chrome iframe里面 无法访问window.parent,返回undefined + var domLoaded = function domLoaded() { + //window.scroll(window.scrollX, 99999); + var mutationObserver = window.frameElement ? JSON.parse(window.frameElement.getAttribute('mutationObserver')) : null; + if (!mutationObserver) { + window.parent.postMessage('superpreloader-iframe:DOMLoaded', '*'); + } else { + var observers = mutationObserver.observers; + + /**@type {Promise} */ + var p = null; + /**@type {Array} */ + var parr = []; + if (observers) { + ['attributes', 'addedNodes', 'removedNodes'].forEach(function (key) { + var el = getAllElements(observers[key]); + if (el.length > 0) { + if (mutationObserver.relatedObj) { + //el.forEach((x) => { + // p.push(elementReady(x, key)); + //}); + parr.push(elementReady(el[el.length - 1], key)); + el[0].scrollIntoView(); + el[el.length - 1].scrollIntoView(); + } else { + parr.push(elementReady(el[el.length - 1], key)); + } + } + }); + } + if (p) { + p = Promise.all(parr); + } else { + p = Promise.resolve(undefined); + } + var timeout = mutationObserver.timeout && 0; + setTimeout(function () { + p.then(function (values) { + if (values) { + values.forEach(function (_ref) { + _ref.element; + _ref.type; + _ref.mutationList; + var observer = _ref.observer; + observer.disconnect(); + }); + } + //window.scrollTo(0, scrollLocation); + window.parent.postMessage('superpreloader-iframe:DOMLoaded', '*'); + }); + }, timeout); + } + }; + //@ts-ignore + if (window.opera) { + document.addEventListener('DOMContentLoaded', domLoaded, false); + } else { + domLoaded(); + } + return; + } + + // 在以下网站上允许在非顶层窗口上加载JS..比如猫扑之类的框架集网页. + var DIExclude = [['猫扑帖子', true, /^https?:\/\/dzh\.mop\.com\/[a-z]{3,6}\/\d{8}\/.*\.shtml$/i], ['铁血社区', true, /^https?:\/\/bbs\.tiexue\.net\/.*\.html$/i], ['铁血社区-2', true, /^https?:\/\/bbs\.qichelian\.com\/bbsqcl\.php\?fid/i], + // 像 http://so.baiduyun.me/ 内嵌的百度、Google 框架 + ['百度网盘搜索引擎-百度', true, /^https?:\/\/www\.baidu\.com\/baidu/i], ['百度网盘搜索引擎-Google', true, /^https?:\/\/74\.125\.128\.147\/custom/i]]; + + // 页面不刷新的站点 + var HashchangeSites = [{ + url: /^https?:\/\/(www|encrypted)\.google(stable)?\..{2,9}\/(webhp|#|$|\?)/, + timer: 2000, + mutationSelector: '#main' + }, + // 运营商可能会在 #wd= 前面添加 ?tn=07084049_pg + { + url: /^https?:\/\/www\.baidu\.com\/($|#wd=)/, + timer: 1000, + mutationSelector: '#wrapper_wrapper' + }, { + url: /^https?:\/\/www\.newsmth\.net/, + timer: 1000 + }]; + + // ///////// ----- End of Rules obtained from online json files -------/////////// + + // 分页导航的6个图标以及颜色设置: + var sep_icons = { + top: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNrclE0rRGEUx8c1GUpRJIVIZGdhZCVr38GGhaI0ZXwCkliglChZEcvJxhdgYWOjLEUpm/EyiLzze+o8dTzdO3PljoVTv7rPc8/5d+6555xYrEhWop6boda5+6l9wjWcWpF+WIbqCJJ9hFRcDr3QAIkIhKugz5PDfkSixkphz5aiAnqgE8rgWRxGoSOPyBkswQuUwyscw4HrmFCZL8Kt/JAg7mEFPEmo4FdPwk0BUcsdzIap0TQ8qMAPuICcEjLnd+VjSjcfJNgIc/DkZGSymYGsnK9EZMrxe4MFaNGiZjC2fT5zQ3p7QDK1dR2GSljziclAvRUe8nHYVA4jjvC43NfAuk/smB2QNqcsWxKcLbAKTFnS0hWD6n27Fd6FLqiDI5iQmQ9jpiVT0sNJ6aYd7dAE3QHBbinSAX5JWWaxuLo8F35jh/bBK9Y+/r/Cl6pLcnna8NvuDGMnslpbZRpXZYT/3r4EGACZL3ZL2afNFAAAAABJRU5ErkJggg==', + bottom: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXFJREFUeNrM1c8rBGEcx/FdtCEkLqYtpdwkKSUHUhxwITdK+Z3yM2cOLnJ39Cc44SgHScmJwlFxsIdlCScO6/2t76Onp52dXTtbnno1M8+Pz84+zzMzkcg/KA3oRTzM0A4cI4VTdIUVPIM3pPGO5aABJTkGx1BqjYmFFZxW7nnBwXmXogWX6bEGc2jEIU7+kNWDUSSwZyqndSvJ3N1g2Bm0oLtB2j+w7rQP4MpqXzRT0YRaPW/BthMedYLs60HsoE2vq9BsPwAJa8XFLUa0fUrvROo/saT1Q9adGimdlt8yj6TT6Q6d2vaida9YRbtP6EqmBZC5fHA6X+AAz1bwEc6cfk9+oaZM4NoZJL70+J2hTaZtNpet041zK8yP/Mgl+rOF1emr0UM1xnAfEPyISd0Jno6vtx+QuM6PZ22lpO7dbEV2Siv6rPeIjNs1HdYC7ixfG+YBqdTVDqPIv6iIWvO7iXGUFxAqi72PraJ9IH8EGACQcYjYRd5GHwAAAABJRU5ErkJggg==', + pre: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAASlJREFUeNpiYBjOoBiIrwJxFRAzUsvQViD+CMT/gfgTEPdRy9BPUENh+AsQ91JiaAuSS9HxZ3INb8Hi0v+UurwF6qL/ROBvQNxDrKFfkTT+A+JnQPwBKfJA/L9Ian7ic7kMEHcC8Q80F3UAcRsQv4by30INaUJT9weaWhSQDRUB4uVYvLkYiAWAOBopvEFBlArEPEA8G4ue9UAsATM4EYuCJUgKMtAMLoSKCwPxXCx6c1igClTQgmUZVPNrHMEGy3mgYCkCYiYgTkCSV4UZvA2IjYBYDIgvQbPvOyJTECid5wHxbyA2BuL3QLwRWYEsEJvg0IweFEU41IEMlgcxWJAEH0MxJeAsjMFEq6Jw+Br8BimVfMCTDEkG7EBcA8T3oWUJx4DVYwABBgCannnSzbgwIQAAAABJRU5ErkJggg==', + next: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT1JREFUeNrc1b1KA0EYheEl/iARFFEkKl6D0UK8CrEVrCwEexFCtBIlRWIjsfEiLL0FKzs7QUWxM2piFMUkvhPOwLAs2TGuCn7wkNll5jC7+w0Jgv9avdjAObbQn1TwCu7QwhWW4xakPIOHMKzxGCaSCm6ioXHLZ0Hqpz7KrwRPIvvNvBlM2zYyNY8cMjhDHo9fCBzErnIqKNjgRSxpvIABbOLes2MKWHfuXdhXcR2avKrJ4zGhI9gLhQbq9XaZgGO1kutIOzIHpKp7NawhjYOINSeY6lFwHacw17P6NTWHd4xqnNbcS83LObtsaCPbEW+gXUW8ODswC27xoOsn3ODDmfOGss9XLuE54jGjvPqGuuG1mFDzZIfdNHynnde7DbW1r5DwTstJHP2iE55YqD36ebXZDvr+7L/sU4ABAIpVZWnoA5GkAAAAAElFTkSuQmCC', + next_gray: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtxJREFUeNrclc9L2mEcx7/6NbVZqRVj7pIOlIUuZ1HMgv0BDcqT7JrskH13ELPBF7eTvz10HznWQBlBRIfBXIfBLmqXscvYZWPKrMNIU9Apmrr34/w6i0ovMZjw+H0+z/N8Xt+Pn/fn80hR/+WHYRhBIpFwRKPRz/F4/KnD4RB28xH0Ah4cHHyoUCjsIpFIIZPJHkml0m9Yfn2ZD78XcL1eH6rValIMCmMUtqKbD7/HbNQxaq15oxcH/lXpcmXgtnh2u/2mXC6/DqE+sSxLlUqlniE0TVPBYJAqFot6+GV9Pt+PJthms80sLS2xEonkhlgs/jgwMOBcXV3N5fP5rlCcp9bX1yWLi4uecrk8U6lUshDY3wRbLJYFGKZsNksq4N78/LwY9hOn05k5Ojqi+PzTGePxeFwZUl6vd8hkMvkPDg6sZJ2M5eXlr1wqUu2kA5JOpy2IAO+oO9fW1n5mMpk2nDjmcjkKNU25XC652Wx2pVIp65mXJ2nyjUPpqakpNZxuA8Y5T87OzsobjcYHpVKpGhsbe1CtVkXYqxQKhTdqtfqL1Wr1JpPJxxyU5Lq/vz8aCoX8TTDatYiFhF6vxx5tAJwm8OPj48m5ubmKSqUaAWwSa9eQw6JGo/luNBoNh4eHbAe0JhAINsLh8LNAIJCiudhxB+Qh2ludTifDAQLvI3AIch+Rkl8jJlrhCbOqgfoLmDepOF/BfGNra2sFFZFtvqgzMbFYjAiyp9Vqh4VC4cTJyYmQ90epIQJtHRO1bA5aRhAvdnZ2GI/H87cEz5YPgeOS2RsfHx9B7u+gOi68yQAtYX9zd3eXgZCna/s8By5ypGUUzhOISHgO9BfWXwG6chZ6IbiVc6LwnsFgGIVAepLzjk4rYW1ze3ubcbvd53fjZV2FaqGQ63fT09PDMO9i9BEoon0J9Rm/339xm3dr2f39fVLX7wFvoMVvoYWfRyIRFndD/Z/8nf0WYAA8EC1Z/ZNm4gAAAABJRU5ErkJggg==', + pre_gray: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAslJREFUeNrclTtMWmEUxz/uvTzlIUhpNMR0aGNjrNHSmHTqRJyadujQDbSGRwJUaYCmDizqUEw6ODVNGgbpYCfSpFINCQzFR9oyMXRsXFCsAXkIKNL/R7gGWxOsSdPEk5zc3O+e87vn+59zv0vIpbSJiQmyubn5LBKJpNbX11+4XC5Buxy2XYDNZiMOh2OW4ziPTCbTi8XikeHh4SsSieQTXnIxsN1uJ1ardVYgEDgPDw+V9Xqd1Go1Mcuyg7AuuVy+sra29ndgVEnGx8dnhEKhs1qtKgE/eXZ8fCzC+q3+/n6tSqVaSSQS5wM7nU5iMplmsF1XpVI5BeXt6OhIBFkGAe9SKpV/wNmzKjWbzRT6tFwuK86CUqPrkIVWPjQwMKBWKBSn4Ozv0LGxsRmRSDSFSjua0Do8TRWAS+B5+B68g/IhixCNvQPN1WjuieZsS/f1aNQ0wzBuaCqlUCQRtVr9Es1K4kVDWJNhrQjAIiqMlkqle804FnkjBoOhEzv4vrGxkW2ALRaLFrq+QoAV2nE8tLe3dzEYDE5vb2939vX1PcBkiKVSaQ1jForFYq+NRqMum83ebsYzmJq7sGu4xhkKxsDfB/AxnO860ev1oeXlZU8gEMgmk0kFqmw8o9dUKiWfn58vhMPh54h7S+OpQXNSLBYfejyeR1yzw9dbRon09PS8W11dnfL5fJl8Pk+0Wi3hk5vyCNBY4vV6f0Im9+joKJNOp818o8G70ah4aWnpIzSKYCa/dXd3B+PxuHNycjKzs7NzAms1+qFQy+VydDRz0WjUpdPp3tB8TFM0FAqFGxXPzc19plJrNJqraMoXt9tNt3Suc+Tg4ICeJfmFhQVLoVAwoKG7fr//B8cHAL6Fy9ZFDinaG/r5w77ya8y/OhEvKRhjtIup2YMTeBb3mXY53HnAmNkP+/v7NzHTTwAO4f79f/ud/RJgAOLcRNZqLojMAAAAAElFTkSuQmCC', + text_span_style: 'color:#595959!important;' + }; + + // 悬浮窗的状态颜色. + var FWKG_color = { + loading: '#8B00E8', + // 读取中状态 + prefetcher: '#5564AF', + // 预读状态 + autopager: '#038B00', + // 翻页状态 + Apause: '#B7B700', + // 翻页状态(暂停). + Astop: '#A00000', + // 翻页状态(停止)(翻页完成,或者被异常停止.)(无法再开启) + dot: '#00FF05' // 读取完后,会显示一个小点,那么小点的颜色. + }; + + // 上一页关键字 + var prePageKey = ['上一页', '上一頁', '上1页', '上1頁', '上页', '上頁', '翻上頁', '翻上页', '上一张', '上一張', '上一幅', '上一章', '上一节', '上一節', '上一篇', '前一页', '前一頁', '后退', '後退', '上篇', 'previous', 'previous Page', '前へ', '前のページ']; + + // 下一页关键字 + var nextPageKey = ['下一页', '下一頁', '下1页', '下1頁', '下页', '下页 ›', '下頁', '翻页', '翻頁', '翻下頁', '翻下页', '下一张', '下一張', '下一幅', '下一章', '下一节', '下一節', '下一篇', '前进', '下篇', '后页', '往后', 'Next', 'Next Page', '次へ', '次のページ', '次のページ »', '下一页 →', '下一頁 →', '下1页 →', '下1頁 →', '下页 →', '下頁 →', '翻页 →', '翻頁 →', '翻下頁 →', '翻下页 →', '下一张 →', '下一張 →', '下一幅 →', '下一章 →', '下一节 →', '下一節 →', '下一篇 →', '前进 →', '下篇 →', '后页 →', '往后 →', 'Next →', 'Next Page →', '次へ →', '次のページ →', '下一页 »', '下一頁 »', '下1页 »', '下1頁 »', '下页 »', '下頁 »', '翻页 »', '翻頁 »', '翻下頁 »', '翻下页 »', '下一张 »', '下一張 »', '下一幅 »', '下一章 »', '下一节 »', '下一節 »', '下一篇 »', '前进 »', '下篇 »', '后页 »', '往后 »', 'Next »', 'Next Page »', '次へ »', '后一页', '後一頁', '下一页 ›', '下一頁 ›', '下1页 ›', '下1頁 ›', '下頁 ›', '翻页 ›', '翻頁 ›', '翻下頁 ›', '翻下页 ›', '下一张 ›', '下一張 ›', '下一幅 ›', '下一章 ›', '下一节 ›', '下一節 ›', '下一篇 ›', '前进 ›', '下篇 ›', '后页 ›', '往后 ›', 'Next ›', 'Next >', 'Next Page ›', '次へ ›', '次のページ ›', '»', '→', '早期文章→']; + // THX to https://greasyfork.org/en/forum/discussion/39361/x + // 出在自动翻页信息附加显示真实相对页面信息,一般能智能识别出来。如果还有站点不能识别,可以把地址的特征字符串加到下面 + // 最好不要乱加,一些不规律的站点显示出来的数字也没有意义 + var REALPAGE_SITE_PATTERN = ['search?', 'search_', 'forum', 'thread']; + + // ------------------------下面的不要管他----------------- + /// //////////////////////////////////////////////////////////////// + // eslint-disable-next-line prettier/prettier + Promise.all([loadSettings(), getServerIp(location.hostname)]).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + values = _ref3[0], + serverIp = _ref3[1]; + var jsonRule = values.jsonRule; + var prefs = values.prefs, + SITEINFO_D = values.SITEINFO_D, + autoMatch = values.autoMatch; + values.version; + var blackList = values.blackList; + if (prefs.debug) { + logger.setLevel('debug'); + } else { + logger.setLevel(5); + } + logger.debug("[Super-preloader]", 'Script Manager: ', JSON.stringify({ + name: SCRIPT_MANAGER.name, + version: SCRIPT_MANAGER.version || 'unknown' + })); + logger.debug("[Super-preloader]", 'Browser: ', JSON.stringify(BROWSER)); + logger.debug("[Super-preloader]", `Server ip: ', ${serverIp}`); + var setup = function setup() { + var d = document; + + /** + * + * @param {string} s s + * @returns {HTMLInputElement} elem + */ + var $ = function $(s) { + // @ts-ignore + return d.getElementById('sp-prefs-' + s); + }; + if ($('setup')) return; + var styleNode = addStyle(spcss['sp-prefs-setup']); + if (prefs.customCSS.length > 0) { + addStyle(prefs.customCSS); + } + var div = d.createElement('div'); + div.id = 'sp-prefs-setup'; + div.style.position = 'fixed'; + if (prefs.FW_position !== 2) { + div.style.right = '38px'; + div.style.top = '20px'; + } else { + div.style.right = `${prefs.FW_offset[1]}px`; + div.style.top = `${prefs.FW_offset[0]}px`; + } + var nextUpdateDate = prefs.disableBuiltinSubscriptionRules ? 'N/A' : jsonRuleLoader.expire.toDateString(); + div.innerHTML = template['sp-prefs']({ + prefs, + scriptInfo, + nextUpdateDate: nextUpdateDate + }); + d.body.appendChild(div); + var close = function close() { + if (styleNode) { + styleNode.parentNode.removeChild(styleNode); + } + var div = $('setup'); + div.parentNode.removeChild(div); + }; + var on = function on(node, e, f) { + node.addEventListener(e, f, false); + }; + on($('ok'), 'click', function () { + Object.keys(factorySettings.prefs).forEach(function (key) { + var el = $(key); + if (el !== null) { + prefs[key] = getProperty(el); + } + }); + if (prefs.debug) { + logger.setLevel('debug'); + } else { + logger.setLevel(5); + } + autoMatch.keyMatch = !$('autoMatchKeyMatch').checked; + SITEINFO_D.useiframe = !!$('SITEINFO_D-useiframe').checked; + SITEINFO_D.autopager.enable = !!$('SITEINFO_D-a_enable').checked; + SITEINFO_D.autopager.force_enable = !!$('SITEINFO_D-a_force_enable').checked; + autoMatch.useiframe = SITEINFO_D.useiframe; + saveSettings({ + prefs, + SITEINFO_D, + autoMatch + }).then(function () { + SP.loadSetting(); + close(); + location.reload(); + }); + }); + on($('reset'), 'click', function () { + $('setup').innerHTML = template.spinner.reset; + addStyle(spcss['sp-prefs-spinner']); + resetSettings().then(function () { + location.reload(); + }); + }); + if (prefs.disableBuiltinSubscriptionRules) { + $('updaterule').setAttribute('disabled', ''); + } + on($('updaterule'), 'click', function () { + if (prefs.disableBuiltinSubscriptionRules) return; + $('setup').innerHTML = template.spinner.update; + addStyle(spcss['sp-prefs-spinner']); + jsonRuleLoader.updateRule(true).then(function () { + jsonRule = jsonRuleLoader.getRule(); + SP.loadSetting(); + close(); + location.reload(); + }); + }); + on($('cancel'), 'click', close); + $('debug').checked = logger.getLevel() === logger.levels.DEBUG; + $('ChineseUI').checked = prefs.ChineseUI; + $('floatWindow').checked = prefs.floatWindow; + $('enableHistory').checked = prefs.enableHistory; + // $('forceTargetWindow').checked = prefs.forceTargetWindow; + $('dblclick_pause').checked = prefs.dblclick_pause; + $('SITEINFO_D-useiframe').checked = SITEINFO_D.useiframe; + $('SITEINFO_D-a_enable').checked = SITEINFO_D.autopager.enable; + $('arrowKeyPage').checked = prefs.arrowKeyPage; + $('SITEINFO_D-a_force_enable').checked = SITEINFO_D.autopager.force_enable; + $('excludes').value = prefs.excludes; + $('custom_siteinfo').value = prefs.custom_siteinfo; + $('customCSS').value = prefs.customCSS; + $('disableBuiltinRules').checked = prefs.disableBuiltinRules; + $('disableBuiltinSubscriptionRules').checked = prefs.disableBuiltinSubscriptionRules; + $('autoMatchKeyMatch').checked = !autoMatch.keyMatch; + }; + + // main functions + var SP = { + spinit: function spinit() { + if (document.body.getAttribute('name') === 'MyNovelReader') { + return; + } + this.loadSetting(); + if (userLang === 'zh_CN') { + GM.registerMenuCommand('Super_preloaderPlus_one_New 设置', setup); + } else { + GM.registerMenuCommand('Super_preloaderPlus_one_New Settings', setup); + } + + // 查找是否是页面不刷新的站点 + var locationHref = location.href; + var hashSite = _find(HashchangeSites, function (x) { + return toRE(x.url).test(locationHref); + }); + if (hashSite) { + isHashchangeSite = true; + hashchangeTimer = hashSite.timer; + logger.debug("[Super-preloader]", 'This site does not refresh the page.', hashSite); + var p1 = new Promise(function (resolve, reject) { + setTimeout(resolve, hashchangeTimer); + }); + p1.then(function (values) { + init(window, document); + }); + } else { + init(window, document); + } + // 分辨率 高度 > 宽度 的是手机 + if (window.screen.height > window.screen.width) { + addStyle('div.sp-separator { min-width:auto !important; }'); + } + }, + loadSetting: function loadSetting() { + var a_enable = SITEINFO_D.autopager.enable; + if (a_enable !== undefined) { + SITEINFO_D.autopager.enable = a_enable; + } + var loadDblclickPause = function loadDblclickPause(reload) { + var dblclickPause = prefs.dblclick_pause; + if (dblclickPause) { + prefs.mouseA = false; + prefs.Pbutton = [0, 0, 0]; + } + if (reload) location.reload(); + }; + var loadCustomSiteInfo = function loadCustomSiteInfo() { + var userRules; + try { + // eslint-disable-next-line no-new-func + userRules = new Function('', 'return ' + prefs.custom_siteinfo)(); + } catch (e) { + logger.error("[Super-preloader]", 'Custom site rule error:', prefs.custom_siteinfo); + } + if (_isArray(userRules)) { + SSRules = SSRules.concat(userRules); + } + }; + loadDblclickPause(); + loadCustomSiteInfo(); + } + }; + SP.spinit(); + /** + * + * @param {Window} window window + * @param {Document} document document + * @returns {void} + */ + function init(window, document) { + var startTime = new Date(); + // eslint-disable-next-line valid-jsdoc + /**@type {(...rest:any[])=>void} */ + var nullFn = function nullFn() {}; // 空函数. + var url = document.location.href.replace(/#.*$/, ''); // url 去掉hash + var cplink = url; // 翻上来的最近的页面的url; + document.domain; // 取得域名. + var domain_port = url.match(/https?:\/\/([^\/]+)/)[1]; // 端口和域名,用来验证是否跨域. + + // 新加的,以示区别 + var remove = []; // 需要移除的事件 + + // 悬浮窗 + var floatWO = { + updateColor: nullFn, + loadedIcon: nullFn, + CmodeIcon: nullFn + }; + /** + * + * @param {IRuntimeRule} SSS a rule + * @returns {void} + */ + function floatWindow(SSS) { + // inject css + addStyle(spcss['sp-fw']); + + // create container + var div = document.createElement('div'); + div.id = 'sp-fw-container'; + div.innerHTML = template.floatWindow(); + document.body.appendChild(div); + + // helper function to get element + /** + * + * @param {string} id id + * @returns {HTMLInputElement} return + * */ + function $(id) { + //@ts-ignore + return document.getElementById(id); + } + var rect = $('sp-fw-rect'); // 悬浮窗的小正方形,用颜色描述当前的状态. + var spanel = $('sp-fw-content'); // 设置面板. + + // 设置面板显隐 + var spanelc = { + show: function show() { + spanel.style.display = 'block'; + }, + hide: function hide() { + spanel.style.display = 'none'; + } + }; + spanelc.hide(); + var rectt1, rectt2; + rect.addEventListener('mouseover', function (e) { + rectt1 = setTimeout(spanelc.show, 100); + }, false); + rect.addEventListener('mouseleave', function (e) { + clearTimeout(rectt1); + }, false); + div.addEventListener('mouseover', function (e) { + clearTimeout(rectt2); + }, false); + div.addEventListener('mouseleave', function (e) { + // Firefox bug + // https://stackoverflow.com/questions/46831247/select-triggers-mouseleave-event-on-parent-element-in-mozilla-firefox + if (e.relatedTarget === null) return; + rectt2 = setTimeout(spanelc.hide, 288); + }, false); + var dot = $('sp-fw-dot'); // 载入完成后,显示的小点 + dot.style.backgroundColor = FWKG_color.dot; + var cur_mode = $('sp-fw-cur-mode'); // 当载入状态时,用来描述当前是翻页模式,还是预读模式. + cur_mode.style.backgroundColor = SSS.a_enable ? FWKG_color.autopager : FWKG_color.prefetcher; + var a_enable = $('sp-fw-a_enable'); // 启用翻页模式 + var autopager_field = $('sp-fw-autopager-field'); // 翻页设置区域 + + // 预读设置 + var useiframe = $('sp-fw-useiframe'); + var viewcontent = $('sp-fw-viewcontent'); + + // 翻页设置 + var a_useiframe = $('sp-fw-a_useiframe'); + var a_iloaded = $('sp-fw-a_iloaded'); + var a_itimeout = $('sp-fw-a_itimeout'); + var a_manualA = $('sp-fw-a_manualA'); + var a_remain = $('sp-fw-a_remain'); + var a_maxpage = $('sp-fw-a_maxpage'); + var a_separator = $('sp-fw-a_separator'); + var a_ipages_0 = $('sp-fw-a_ipages_0'); + var a_ipages_1 = $('sp-fw-a_ipages_1'); + var a_force = $('sp-fw-a_force'); + + // newIframe 输入框的点击 + var a_newIframe = $('sp-fw-a_newIframe'); + a_newIframe.addEventListener('click', function () { + a_useiframe.checked = a_newIframe.checked; + }, false); + var a_starti = $('sp-fw-a_starti'); // 开始立即翻页 + a_starti.addEventListener('click', function (e) { + //@ts-ignore + if (e.currentTarget.disabled) return; + var value = parseInt(a_ipages_1.value); + if (isNaN(value) || value < 0) { + value = SSS.a_ipages[1]; + //@ts-ignore + a_ipages_1.value = value; + } + autoPO.startipages(value); + }, false); + + // 总开关 + var enable = $('sp-fw-enable'); + $('sp-fw-setup').addEventListener('click', setup, false); + + // 保存设置按钮. + var savebutton = $('sp-fw-savebutton'); + savebutton.addEventListener('click', function (e) { + var value = { + Rurl: SSS.Rurl, + useiframe: getProperty(useiframe), + viewcontent: getProperty(viewcontent), + enable: getProperty(enable) + }; + if (SSS.a_enable !== undefined) { + /** @type {(s:HTMLElement)=>number} */ + //@ts-ignore + var getPropertyNumber = getProperty; + value.a_enable = getProperty(a_enable) === 'autopager'; + value.a_useiframe = getProperty(a_useiframe); + value.a_newIframe = getProperty(a_newIframe); + value.a_iloaded = getProperty(a_iloaded); + value.a_manualA = getProperty(a_manualA); + value.a_force = getProperty(a_force); + var t_a_itimeout = getPropertyNumber(a_itimeout); + value.a_itimeout = isNaN(t_a_itimeout) ? SSS.a_itimeout : t_a_itimeout >= 0 ? t_a_itimeout : 0; + var t_a_remain = getPropertyNumber(a_remain); + value.a_remain = isNaN(t_a_remain) ? SSS.a_remain : Number(t_a_remain); + var t_a_maxpage = getPropertyNumber(a_maxpage); + value.a_maxpage = isNaN(t_a_maxpage) ? SSS.a_maxpage : t_a_maxpage >= 1 ? t_a_maxpage : 1; + var t_a_ipages_1 = getPropertyNumber(a_ipages_1); + value.a_ipages = [getProperty(a_ipages_0), isNaN(t_a_ipages_1) ? SSS.a_ipages[1] : t_a_ipages_1 >= 0 ? t_a_ipages_1 : 1]; + value.a_separator = getProperty(a_separator); + } + saveLocalSetting(value); + if (e.shiftKey ? !prefs.FW_RAS : prefs.FW_RAS) { + // 按住shift键,执行反向操作. + setTimeout(function () { + location.reload(); + }, 1); + } + }, false); + + // 载入翻页设置. + if (SSS.a_enable === undefined) { + // 未定义翻页功能. + a_enable.disabled = true; + autopager_field.style.display = 'none'; + } else { + setProperty(a_enable, SSS.a_enable ? 'autopager' : 'preloader'); + setProperty(a_useiframe, SSS.a_useiframe); + setProperty(a_newIframe, SSS.a_newIframe); + setProperty(a_iloaded, SSS.a_iloaded); + setProperty(a_itimeout, SSS.a_itimeout); + setProperty(a_manualA, SSS.a_manualA); + setProperty(a_force, SSS.a_force); + setProperty(a_remain, SSS.a_remain); + setProperty(a_maxpage, SSS.a_maxpage); + setProperty(a_separator, SSS.a_separator); + setProperty(a_ipages_0, SSS.a_ipages[0]); + setProperty(a_ipages_1, SSS.a_ipages[1]); + } + if (!SSS.a_enable) { + // 当前不是翻页模式,禁用立即翻页按钮. + a_starti.disabled = true; + } + if (!SSS.hasRule) { + // 如果没有高级规则,那么此项不允许操作. + a_force.disabled = true; + } + + // 载入预读设置. + setProperty(useiframe, SSS.useiframe); + setProperty(viewcontent, SSS.viewcontent); + + // 总开关 + setProperty(enable, SSS.enable); + var FWKG_state = { + loading: '读取中状态', + prefetcher: '预读状态', + autopager: '翻页状态', + Apause: '翻页状态(暂停)', + Astop: '翻页状态(停止)(翻页完成,或者被异常停止)(无法再开启)', + dot: '读取完后' + }; + if (userLang !== 'zh_CN') { + FWKG_state.loading = 'Loading'; + FWKG_state.prefetcher = 'Prefetching'; + FWKG_state.autopager = 'Autopagger (Running)'; + FWKG_state.Apause = 'Autopagger (Pause)'; + FWKG_state.Astop = 'Autopagger (Stop)'; + FWKG_state.dot = 'Finish loading'; + } + floatWO = { + updateColor: function updateColor(state) { + rect.style.backgroundColor = FWKG_color[state]; + rect.setAttribute('title', FWKG_state[state]); + }, + loadedIcon: function loadedIcon(command) { + dot.style.display = command == 'show' ? 'block' : 'none'; + }, + CmodeIcon: function CmodeIcon(command) { + cur_mode.style.display = command == 'show' ? 'block' : 'none'; + } + }; + var vertical = parseInt(prefs.FW_offset[0] + '', 10); + var horiz = parseInt(prefs.FW_offset[1] + '', 10); + var FW_position = prefs.FW_position; + + // 非opera用fixed定位. + div.style.position = 'fixed'; + switch (FW_position) { + case 1: + div.style.top = vertical + 'px'; + div.style.left = horiz + 'px'; + break; + case 2: + div.style.top = vertical + 'px'; + div.style.right = horiz + 'px'; + break; + case 3: + div.style.bottom = vertical + 'px'; + div.style.right = horiz + 'px'; + break; + case 4: + div.style.bottom = vertical + 'px'; + div.style.left = horiz + 'px'; + break; + } + } + function sp_transition(start, end) { + //@ts-ignore + var TweenF = sp_transition.TweenF; + if (!TweenF) { + TweenF = Tween[TweenM[prefs.s_method]]; + TweenF = TweenF[TweenEase[prefs.s_ease]] || TweenF; + //@ts-ignore + sp_transition.TweenF = TweenF; + } + var frameSpeed = 1000 / prefs.s_FPS; + var t = 0; // 次数,开始 + var b = start; // 开始 + var c = end - start; // 结束 + var d = Math.ceil(prefs.s_duration / frameSpeed); // 次数,结束 + + var x = window.scrollX; + function transition() { + var y = Math.ceil(TweenF(t, b, c, d)); + window.scroll(x, y); + if (t < d) { + t++; + setTimeout(transition, frameSpeed); + } + } + transition(); + } + function sepHandler(e) { + e.stopPropagation(); + var div = e.currentTarget; + var target = e.target; + function getRelativeDiv(which) { + var id = div.id; + id = id.replace(/(sp-separator-)(.+)/, function (a, b, c) { + return b + String(Number(c) + (which == 'pre' ? -1 : 1)); + }); + return id ? document.getElementById(id) : null; + } + function scrollIt(a, b) { + // a=a!==undefined? a : window.scrollY; + if (prefs.sepT) { + sp_transition(a, b); + } else { + window.scroll(window.scrollX, b); + } + } + var o_scrollY, divS; + switch (target.className) { + case 'sp-sp-gotop': + scrollIt(window.scrollY, 0); + break; + case 'sp-sp-gopre': + { + var prediv = getRelativeDiv('pre'); + if (!prediv) return; + o_scrollY = window.scrollY; + var preDS = prediv.getBoundingClientRect().top; + if (prefs.sepP) { + divS = div.getBoundingClientRect().top; + preDS = o_scrollY - (divS - preDS); + } else { + preDS += o_scrollY - 6; + } + scrollIt(o_scrollY, preDS); + break; + } + case 'sp-sp-gonext': + { + var nextdiv = getRelativeDiv('next'); + if (!nextdiv) return; + o_scrollY = window.scrollY; + var nextDS = nextdiv.getBoundingClientRect().top; + if (prefs.sepP) { + divS = div.getBoundingClientRect().top; + nextDS = o_scrollY + (-divS + nextDS); + } else { + nextDS += o_scrollY - 6; + } + scrollIt(o_scrollY, nextDS); + break; + } + case 'sp-sp-gobottom': + scrollIt(window.scrollY, Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)); + break; + } + } + + // autopager + var autoPO = { + /**@type {(value?:number)=>void} f*/ + startipages: nullFn + }; + var hashchangeAdded = false; + /** + * @param {IRuntimeRule} SSS a rule + * @param {*} floatWO float window object + * @returns {void} + */ + function autopager(SSS, floatWO) { + // return; + // 更新悬浮窗的颜色. + floatWO.updateColor('autopager'); + + // 获取插入位置节点. + var insertPoint; + var pageElement; + var insertMode; + if (SSS.a_HT_insert) { + insertPoint = getElement(SSS.a_HT_insert[0]); + insertMode = SSS.a_HT_insert[1]; + } else { + pageElement = getAllElements(SSS.a_pageElement, document, document, null, cplink); + if (pageElement.length > 0) { + var pELast = pageElement[pageElement.length - 1]; + insertPoint = pELast.nextSibling ? pELast.nextSibling : pELast.parentNode.appendChild(document.createTextNode(' ')); + } + insertMode = -1; + } + if (insertPoint) { + logger.debug("[Super-preloader]", 'Verify that the insertion position node can be found: success', insertPoint); + } else { + logger.error("[Super-preloader]", 'Verify that the insertion position node can be found: failed. JS execution stopped', SSS.a_HT_insert ? SSS.a_HT_insert[0] : ''); + floatWO.updateColor('Astop'); + return; + } + if (window.navigator.language != 'en') { + logger.debug("[Super-preloader]", 'Language: ', window.navigator.language); + } + if (pageElement === undefined) { + pageElement = getAllElements(SSS.a_pageElement); + } + if (pageElement.length > 0) { + logger.debug("[Super-preloader]", 'Verify that the main element can be found: success', pageElement); + } else { + logger.error("[Super-preloader]", 'Verify that the main element can be found: failure', SSS.a_pageElement); + floatWO.updateColor('Astop'); + return; + } + if (SSS.a_stylish) { + // 插入自定义样式 + addStyle(SSS.a_stylish, 'Super_preloader-style'); + } + + /** @type {Node} */ + var insertPointP; + if (insertMode != 2) { + insertPointP = insertPoint.parentNode; + } + var addIntoDoc; + if (insertMode == -1 || insertMode == 1) { + addIntoDoc = function addIntoDoc(obj) { + return insertPointP.insertBefore(obj, insertPoint); + }; + } else if (insertMode == 2) { + addIntoDoc = function addIntoDoc(obj) { + return insertPoint.appendChild(obj); + }; + } else if (insertMode == 0) { + addIntoDoc = function addIntoDoc(obj) { + return insertPointP.insertBefore(obj, insertPoint.nextSibling); + }; + } + + /** @type {HTMLDocument} */ + var doc, win; + function XHRLoaded(res) { + var str = res.data; + doc = win = createDocumentByString(str); + if (!doc) { + logger.error("[Super-preloader]", 'Document object creation failed'); + removeL(); + return; + } + floatWO.updateColor('autopager'); + floatWO.CmodeIcon('hide'); + floatWO.loadedIcon('show'); + working = false; + scroll(); + } + function XHRNotLoaded(res) { + logger.error("[Super-preloader]", 'XHR is failed to be loaded'); + logger.error("[Super-preloader]", res); + removeL(); + } + function removeL(isRemoveAddPage) { + logger.debug("[Super-preloader]", 'Remove various event listeners'); + floatWO.updateColor('Astop'); + var _remove = remove; + for (var i = 0, ii = _remove.length; i < ii; i++) { + _remove[i](); + } + if (isRemoveAddPage) { + var separator = document.querySelector('.sp-separator'); + if (separator) { + var insertBefore = insertPoint; + if (insertMode == 2) { + var l = insertPoint.children.length; + if (l > 0) { + insertBefore = insertPoint.children[l - 1]; + } + } + var range = document.createRange(); + range.setStartBefore(separator); + range.setEndBefore(insertBefore); + range.deleteContents(); + range.detach(); + if (insertMode == 2) { + // 还需要额外移除? + insertPoint.removeChild(insertBefore); + } + } + var style = document.getElementById('Super_preloader-style'); + if (style) { + style.parentNode.removeChild(style); + } + } + } + if (isHashchangeSite && !hashchangeAdded) { + window.addEventListener('hashchange', onhashChange, false); + hashchangeAdded = true; + logger.debug("[Super-preloader]", 'Successfully added hashchange event'); + } + function onhashChange(event) { + logger.debug("[Super-preloader]", 'hashchange event triggered'); + removeL(true); + setTimeout(function () { + nextlinkElem = getElement(SSS.nextLink || 'auto;'); + nextlink = elemToHref(nextlinkElem); + // preLink = getElement(SSS.preLink || 'auto;'); + autopager(SSS, floatWO); + }, hashchangeTimer); + } + + /** @type {HTMLIFrameElement} */ + var iframe; + var messageR; + + /** + * Event handler of iframe loaded + * @param {IFrameLoadedEvent} event Iframe loaded event + * @returns {void} + */ + function iframeLoaded(event) { + var iframe = event.currentTarget; + var body = iframe.contentDocument.body; + if (body && body.firstChild) { + setTimeout(function () { + doc = iframe.contentDocument; + removeScripts(doc, SSS.a_scriptFilter); + win = iframe.contentWindow || doc; + floatWO.updateColor('autopager'); + floatWO.CmodeIcon('hide'); + floatWO.loadedIcon('show'); + working = false; + scroll(); + }, SSS.a_itimeout); + } + } + + /** + * Load next page in iframe + * @param {string} link Link of the next page + * @returns {void} + */ + function iframeRequest(link) { + messageR = false; + if (SSS.a_newIframe || !iframe) { + var insertLoc = null; + var i = document.createElement('iframe'); + iframe = i; + i.name = 'superpreloader-iframe'; + i.width = '100%'; + i.height = '0'; + i.frameBorder = '0'; + i.style.cssText = '\ margin:0!important;\ padding:0!important;\ visibility:hidden!important;\ '; - if (SSS.a_sandbox != false) { - //sandbox is readonly property - //i.sandbox = SSS.a_sandbox; - i.setAttribute('sandbox', ''); - } - i.src = link; - if (SSS.a_mutationObserver) { - i.setAttribute('mutationObserver', JSON.stringify(SSS.a_mutationObserver)); - if (SSS.a_mutationObserver.relatedObj) { - insertLoc = getAllElements(SSS.a_mutationObserver.relatedObj); - if (insertLoc.length > 0) { - insertLoc = insertLoc[0]; - } else { - insertLoc = null; - } - } - } - if (SSS.a_iloaded) { - i.addEventListener('load', iframeLoaded, false); - remove.push(function () { - i.removeEventListener('load', iframeLoaded, false); - }); - } else { - var messagehandler = function messagehandler(e) { - if (!messageR && e.data == 'superpreloader-iframe:DOMLoaded') { - messageR = true; - iframeLoaded.call(i, { - currentTarget: i - }); - if (SSS.a_newIframe) { - window.removeEventListener('message', messagehandler, false); - } - } - }; - window.addEventListener('message', messagehandler, false); - remove.push(function () { - window.removeEventListener('message', messagehandler, false); - }); - } - if (insertLoc) { - insertLoc.parentNode.insertBefore(i, insertLoc); - } else { - document.body.appendChild(i); - } - } else { - iframe.src = link; - iframe.contentDocument.location.replace(link); - if (SSS.a_reload) { - iframe.contentWindow.location.reload(); - } - } - } - - /** - * Send XHR request to obtain next page content - * @param {string} link Link of next page - * @returns {void} - */ - function XHRrequest(link) { - var reqConf = { - headers: SSS.a_headers ? SSS.a_headers : { - Referer: cplink - } - }; - got.get(link, reqConf).then( - /** - * Handling of XHR request - * @param {ResponseObject} res Response of got - * @returns {void} - */ - function (res) { - if (res.finalUrl === cplink) { - logger.debug("[Super-preloader]", 'Same final address'); - XHRNotLoaded(res); - } else { - XHRLoaded(res); - logger.debug("[Super-preloader]", 'XHRrequest complete'); - } - }).catch( - /** - * Error handling of XHR request - * @param {ResponseObject} res Response of got - * @returns {void} - */ - function (res) { - XHRNotLoaded(res); - }); - } - var working; - function doRequest() { - working = true; - floatWO.updateColor('loading'); - floatWO.CmodeIcon('show'); - logger.debug("[Super-preloader]", 'Get next page', SSS.a_useiframe ? '(iframe method)' : '(XHR method)', nextlink); - pagedLinks.push(nextlink); - if (SSS.a_useiframe) { - iframeRequest(nextlink); - } else { - if (/(?:http|\/).*/.test(nextlink)) { - // request next page by XHR - XHRrequest(nextlink); - } else { - logger.error("[Super-preloader]", 'Lazyload or Invalid nextLinkElem', nextlinkElem); - } - } - } - var _SSS$a_ipages = _slicedToArray(SSS.a_ipages, 2), - _SSS$a_ipages$ = _SSS$a_ipages[0], - ipagesmode = _SSS$a_ipages$ === void 0 ? false : _SSS$a_ipages$, - _SSS$a_ipages$2 = _SSS$a_ipages[1], - ipagesnumber = _SSS$a_ipages$2 === void 0 ? 2 : _SSS$a_ipages$2; - if (ipagesmode && ipagesnumber === 0) { - ipagesnumber = Number.MAX_SAFE_INTEGER; - } - var scrollDo = nullFn; - var afterInsertDo = nullFn; - if (prefs.Aplus) { - afterInsertDo = doRequest; - doRequest(); - } else { - scrollDo = doRequest; - if (ipagesmode) doRequest(); - } - var manualDiv; - function manualAdiv() { - if (!manualDiv) { - addStyle(spcss['sp-separator']); - var spage = /*#__PURE__*/function () { - var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(el) { - var value; - return _regeneratorRuntime.wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - if (!doc) { - _context.next = 7; - break; - } - value = Number(el.value); - if (isNaN(value) || value < 1) { - el.value = value = 1; - } - ipagesmode = true; - ipagesnumber = value + paged; - _context.next = 7; - return insertedIntoDoc(); - case 7: - case "end": - return _context.stop(); - } - }, _callee); - })); - return function spage(_x) { - return _ref4.apply(this, arguments); - }; - }(); - var div = createDOM('div', { - attr: { - id: 'sp-sp-manualdiv', - class: 'sp-separator' - }, - children: [createDOM('span', { - attr: { - class: 'sp-md-span' - }, - innerHTML: userLang === 'zh_CN' ? '下' : 'Next' - }), createDOM('input', { - attr: { - type: 'number', - value: 1, - min: 1, - title: userLang === 'zh_CN' ? '输入你想要拼接的页数(必须>=1),然后按回车.' : 'Type number of pageringzing and press enter', - id: 'sp-sp-md-number' - }, - eventListener: [{ - type: 'keyup', - listener: function listener(e) { - if (e.keyCode == 13) { - // 回车 - spage(e.target); - } - } - }] - }), createDOM('span', { - attr: { - class: 'sp-md-span' - }, - innerHTML: userLang === 'zh_CN' ? '页' : 'page' - }), createDOM('img', { - attr: { - id: 'sp-sp-md-imgnext', - src: _sep_icons.next - } - }), createDOM('div', { - attr: { - class: 'sp-someinfo', - id: 'sp-separator-hover' - }, - children: [createDOM('a', { - attr: { - href: 'https://github.com/machsix/Super-preloader', - target: '_blank' - }, - innerHTML: 'Powered by Super-preloader' - })] - })] - }); - manualDiv = div; - document.body.appendChild(div); - div.addEventListener('click', function (e) { - //@ts-ignore - if (e.target.id === 'sp-sp-md-number') return; - spage(document.getElementById('sp-sp-md-number')).then(function () { - manualDiv.remove(); - }); - }, false); - } - addIntoDoc(manualDiv); - //manualDiv.style.display = "block"; - } - function beforeInsertIntoDoc() { - return _beforeInsertIntoDoc.apply(this, arguments); - } - function _beforeInsertIntoDoc() { - _beforeInsertIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() { - return _regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) switch (_context3.prev = _context3.next) { - case 0: - working = true; - if (!(SSS.a_manualA && !ipagesmode)) { - _context3.next = 6; - break; - } - // 显示手动翻页触发条. - logger.debug("[Super-preloader]", 'Manual stitching'); - manualAdiv(); - _context3.next = 9; - break; - case 6: - // 直接拼接. - logger.debug("[Super-preloader]", 'Direct stitching'); - _context3.next = 9; - return insertedIntoDoc(); - case 9: - case "end": - return _context3.stop(); - } - }, _callee3); - })); - return _beforeInsertIntoDoc.apply(this, arguments); - } - var sepStyle; - //looks like goNextImg is useless here. - //const goNextImg = [false]; - var sNumber = prefs.sepStartN; - var _sep_icons = sep_icons; - var curNumber = sNumber; - function createSep(lastUrl, currentUrl, nextUrl) { - var div = document.createElement('div'); - if (SSS.a_separator) { - if (!sepStyle) { - sepStyle = addStyle(spcss['sp-separator']); - if (prefs.customCSS.length > 0) addStyle(prefs.customCSS); - } - div.className = 'sp-separator'; - div.id = 'sp-separator-' + curNumber; - div.addEventListener('click', sepHandler, false); - var pageStr = ''; - if (userLang === 'zh_CN') { - pageStr = '第 ' + curNumber + ' 页' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); - } else { - pageStr = 'Page ' + curNumber + '' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); - } - div.appendChild(createDOM('a', { - attr: { - class: 'sp-sp-nextlink', - target: '_blank', - href: currentUrl, - title: currentUrl - }, - innerHTML: pageStr - })); - div.appendChild(createDOM('img', { - attr: { - src: _sep_icons.top, - class: 'sp-sp-gotop', - alt: userLang === 'zh_CN' ? '去到顶部' : 'To Top', - title: userLang === 'zh_CN' ? '去到顶部' : 'To Top' - } - })); - div.appendChild(createDOM('img', { - attr: { - src: curNumber == sNumber ? _sep_icons.pre_gray : _sep_icons.pre, - class: 'sp-sp-gopre', - title: userLang === 'zh_CN' ? '上滚一页' : 'Scroll up a page' - } - })); - var i_next = createDOM('img', { - attr: { - src: _sep_icons.next_gray, - class: 'sp-sp-gonext', - title: userLang === 'zh_CN' ? '下滚一页' : 'Scroll down a page' - } - }); - - //if (goNextImg.length == 2) { - // goNextImg.shift(); - //} - //goNextImg.push(i_next); - div.appendChild(i_next); - div.appendChild(createDOM('img', { - attr: { - src: _sep_icons.bottom, - class: 'sp-sp-gobottom', - alt: userLang === 'zh_CN' ? '去到底部' : 'To Bottom', - title: userLang === 'zh_CN' ? '去到底部' : 'To Bottom' - } - })); - div.appendChild(createDOM('div', { - attr: { - class: 'sp-someinfo', - id: 'sp-separator-hover' - }, - children: [createDOM('a', { - attr: { - href: 'https://github.com/machsix/Super-preloader', - target: '_blank' - }, - innerHTML: 'Powered by Super-preloader' - })] - })); - curNumber += 1; - } else { - div.style.cssText = '\ + if (SSS.a_sandbox != false) { + //sandbox is readonly property + //i.sandbox = SSS.a_sandbox; + i.setAttribute('sandbox', ''); + } + i.src = link; + if (SSS.a_mutationObserver) { + i.setAttribute('mutationObserver', JSON.stringify(SSS.a_mutationObserver)); + if (SSS.a_mutationObserver.relatedObj) { + insertLoc = getAllElements(SSS.a_mutationObserver.relatedObj); + if (insertLoc.length > 0) { + insertLoc = insertLoc[0]; + } else { + insertLoc = null; + } + } + } + if (SSS.a_iloaded) { + i.addEventListener('load', iframeLoaded, false); + remove.push(function () { + i.removeEventListener('load', iframeLoaded, false); + }); + } else { + var messagehandler = function messagehandler(e) { + if (!messageR && e.data == 'superpreloader-iframe:DOMLoaded') { + messageR = true; + iframeLoaded.call(i, { + currentTarget: i + }); + if (SSS.a_newIframe) { + window.removeEventListener('message', messagehandler, false); + } + } + }; + window.addEventListener('message', messagehandler, false); + remove.push(function () { + window.removeEventListener('message', messagehandler, false); + }); + } + if (insertLoc) { + insertLoc.parentNode.insertBefore(i, insertLoc); + } else { + document.body.appendChild(i); + } + } else { + iframe.src = link; + iframe.contentDocument.location.replace(link); + if (SSS.a_reload) { + iframe.contentWindow.location.reload(); + } + } + } + + /** + * Send XHR request to obtain next page content + * @param {string} link Link of next page + * @returns {void} + */ + function XHRrequest(link) { + var reqConf = { + headers: SSS.a_headers ? SSS.a_headers : { + Referer: cplink + } + }; + got.get(link, reqConf).then( + /** + * Handling of XHR request + * @param {ResponseObject} res Response of got + * @returns {void} + */ + function (res) { + if (res.finalUrl === cplink) { + logger.debug("[Super-preloader]", 'Same final address'); + XHRNotLoaded(res); + } else { + XHRLoaded(res); + logger.debug("[Super-preloader]", 'XHRrequest complete'); + } + }).catch( + /** + * Error handling of XHR request + * @param {ResponseObject} res Response of got + * @returns {void} + */ + function (res) { + XHRNotLoaded(res); + }); + } + var working; + function doRequest() { + working = true; + floatWO.updateColor('loading'); + floatWO.CmodeIcon('show'); + logger.debug("[Super-preloader]", 'Get next page', SSS.a_useiframe ? '(iframe method)' : '(XHR method)', nextlink); + pagedLinks.push(nextlink); + if (SSS.a_useiframe) { + iframeRequest(nextlink); + } else { + if (/(?:http|\/).*/.test(nextlink)) { + // request next page by XHR + XHRrequest(nextlink); + } else { + logger.error("[Super-preloader]", 'Lazyload or Invalid nextLinkElem', nextlinkElem); + } + } + } + var _SSS$a_ipages = _slicedToArray(SSS.a_ipages, 2), + _SSS$a_ipages$ = _SSS$a_ipages[0], + ipagesmode = _SSS$a_ipages$ === void 0 ? false : _SSS$a_ipages$, + _SSS$a_ipages$2 = _SSS$a_ipages[1], + ipagesnumber = _SSS$a_ipages$2 === void 0 ? 2 : _SSS$a_ipages$2; + if (ipagesmode && ipagesnumber === 0) { + ipagesnumber = Number.MAX_SAFE_INTEGER; + } + var scrollDo = nullFn; + var afterInsertDo = nullFn; + if (prefs.Aplus) { + afterInsertDo = doRequest; + doRequest(); + } else { + scrollDo = doRequest; + if (ipagesmode) doRequest(); + } + var manualDiv; + function manualAdiv() { + if (!manualDiv) { + addStyle(spcss['sp-separator']); + var spage = /*#__PURE__*/function () { + var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(el) { + var value; + return _regeneratorRuntime.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + if (!doc) { + _context.next = 7; + break; + } + value = Number(el.value); + if (isNaN(value) || value < 1) { + el.value = value = 1; + } + ipagesmode = true; + ipagesnumber = value + paged; + _context.next = 7; + return insertedIntoDoc(); + case 7: + case "end": + return _context.stop(); + } + }, _callee); + })); + return function spage(_x) { + return _ref4.apply(this, arguments); + }; + }(); + var div = createDOM('div', { + attr: { + id: 'sp-sp-manualdiv', + class: 'sp-separator' + }, + children: [createDOM('span', { + attr: { + class: 'sp-md-span' + }, + innerHTML: userLang === 'zh_CN' ? '下' : 'Next' + }), createDOM('input', { + attr: { + type: 'number', + value: 1, + min: 1, + title: userLang === 'zh_CN' ? '输入你想要拼接的页数(必须>=1),然后按回车.' : 'Type number of pageringzing and press enter', + id: 'sp-sp-md-number' + }, + eventListener: [{ + type: 'keyup', + listener: function listener(e) { + if (e.keyCode == 13) { + // 回车 + spage(e.target); + } + } + }] + }), createDOM('span', { + attr: { + class: 'sp-md-span' + }, + innerHTML: userLang === 'zh_CN' ? '页' : 'page' + }), createDOM('img', { + attr: { + id: 'sp-sp-md-imgnext', + src: _sep_icons.next + } + }), createDOM('div', { + attr: { + class: 'sp-someinfo', + id: 'sp-separator-hover' + }, + children: [createDOM('a', { + attr: { + href: 'https://github.com/machsix/Super-preloader', + target: '_blank' + }, + innerHTML: 'Powered by Super-preloader' + })] + })] + }); + manualDiv = div; + document.body.appendChild(div); + div.addEventListener('click', function (e) { + //@ts-ignore + if (e.target.id === 'sp-sp-md-number') return; + spage(document.getElementById('sp-sp-md-number')).then(function () { + manualDiv.remove(); + }); + }, false); + } + addIntoDoc(manualDiv); + //manualDiv.style.display = "block"; + } + function beforeInsertIntoDoc() { + return _beforeInsertIntoDoc.apply(this, arguments); + } + function _beforeInsertIntoDoc() { + _beforeInsertIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() { + return _regeneratorRuntime.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + working = true; + if (!(SSS.a_manualA && !ipagesmode)) { + _context3.next = 6; + break; + } + // 显示手动翻页触发条. + logger.debug("[Super-preloader]", 'Manual stitching'); + manualAdiv(); + _context3.next = 9; + break; + case 6: + // 直接拼接. + logger.debug("[Super-preloader]", 'Direct stitching'); + _context3.next = 9; + return insertedIntoDoc(); + case 9: + case "end": + return _context3.stop(); + } + }, _callee3); + })); + return _beforeInsertIntoDoc.apply(this, arguments); + } + var sepStyle; + //looks like goNextImg is useless here. + //const goNextImg = [false]; + var sNumber = prefs.sepStartN; + var _sep_icons = sep_icons; + var curNumber = sNumber; + function createSep(lastUrl, currentUrl, nextUrl) { + var div = document.createElement('div'); + if (SSS.a_separator) { + if (!sepStyle) { + sepStyle = addStyle(spcss['sp-separator']); + if (prefs.customCSS.length > 0) addStyle(prefs.customCSS); + } + div.className = 'sp-separator'; + div.id = 'sp-separator-' + curNumber; + div.addEventListener('click', sepHandler, false); + var pageStr = ''; + if (userLang === 'zh_CN') { + pageStr = '第 ' + curNumber + ' 页' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); + } else { + pageStr = 'Page ' + curNumber + '' + (SSS.a_separatorReal ? getRalativePageStr(lastUrl, currentUrl, nextUrl) : ''); + } + div.appendChild(createDOM('a', { + attr: { + class: 'sp-sp-nextlink', + target: '_blank', + href: currentUrl, + title: currentUrl + }, + innerHTML: pageStr + })); + div.appendChild(createDOM('img', { + attr: { + src: _sep_icons.top, + class: 'sp-sp-gotop', + alt: userLang === 'zh_CN' ? '去到顶部' : 'To Top', + title: userLang === 'zh_CN' ? '去到顶部' : 'To Top' + } + })); + div.appendChild(createDOM('img', { + attr: { + src: curNumber == sNumber ? _sep_icons.pre_gray : _sep_icons.pre, + class: 'sp-sp-gopre', + title: userLang === 'zh_CN' ? '上滚一页' : 'Scroll up a page' + } + })); + var i_next = createDOM('img', { + attr: { + src: _sep_icons.next_gray, + class: 'sp-sp-gonext', + title: userLang === 'zh_CN' ? '下滚一页' : 'Scroll down a page' + } + }); + + //if (goNextImg.length == 2) { + // goNextImg.shift(); + //} + //goNextImg.push(i_next); + div.appendChild(i_next); + div.appendChild(createDOM('img', { + attr: { + src: _sep_icons.bottom, + class: 'sp-sp-gobottom', + alt: userLang === 'zh_CN' ? '去到底部' : 'To Bottom', + title: userLang === 'zh_CN' ? '去到底部' : 'To Bottom' + } + })); + div.appendChild(createDOM('div', { + attr: { + class: 'sp-someinfo', + id: 'sp-separator-hover' + }, + children: [createDOM('a', { + attr: { + href: 'https://github.com/machsix/Super-preloader', + target: '_blank' + }, + innerHTML: 'Powered by Super-preloader' + })] + })); + curNumber += 1; + } else { + div.style.cssText = '\ height:0!important;\ width:0!important;\ margin:0!important;\ @@ -11249,415 +10777,415 @@ display:block!important;\ visibility:hidden!important;\ '; - } - return div; - } - var paged = 0; - function insertedIntoDoc() { - return _insertedIntoDoc.apply(this, arguments); - } // 返回,剩余高度是总高度的比值. - function _insertedIntoDoc() { - _insertedIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() { - var docTitle, fragment, pageElements, ii, lastUrl, nl, i, pe_x, pe_x_nn, nodes, nodes_x, imgs, arr, sepdiv, toInsert, insertParent, colNodes, _ncol, trs, _ncol2, oldE, oldE_lt, newE, newE_lt, oldE_x, newE_x, ev, delayiframe; - return _regeneratorRuntime.wrap(function _callee4$(_context4) { - while (1) switch (_context4.prev = _context4.next) { - case 0: - if (doc) { - _context4.next = 3; - break; - } - logger.error("[Super-preloader]", 'No document'); - return _context4.abrupt("return"); - case 3: - if (!SSS.a_documentFilter) { - _context4.next = 13; - break; - } - _context4.prev = 4; - _context4.next = 7; - return SSS.a_documentFilter(doc, typeof nextlink === 'string' && nextlink); - case 7: - logger.debug("[Super-preloader]", 'Successfully executeed documentFilter'); - _context4.next = 13; - break; - case 10: - _context4.prev = 10; - _context4.t0 = _context4["catch"](4); - logger.error("[Super-preloader]", 'Error executing documentFilter', _context4.t0, SSS.a_documentFilter.toString()); - case 13: - docTitle = getElementByCSS('title', doc).textContent; - fragment = document.createDocumentFragment(); - pageElements = getAllElements(SSS.a_pageElement, undefined, doc, win, typeof nextlink === 'string' && nextlink); - ii = pageElements.length; - if (!(ii <= 0)) { - _context4.next = 23; - break; - } - logger.error("[Super-preloader]", 'Failed to get the main content of the next page', SSS.a_pageElement); - removeL(); - return _context4.abrupt("return"); - case 23: - logger.debug("[Super-preloader]", 'Successfully got the main content of the next page', pageElements); - case 24: - // 提前查找下一页链接,后面再赋值 - lastUrl = cplink; - cplink = String(nextlink); - /** @type {HTMLElement | String} */ - nl = getElement(SSS.nextLink, undefined, doc, win); - if (nl) { - if (nl === nextlinkElem) { - nextlinkElem = null; - } else { - nextlinkElem = nl; - } - } else { - nextlinkElem = null; - } - nextlink = elemToHref(nextlinkElem); - // 有部分下一页的信息是在script中(比如新加的csdn的规则),因此先查找下一页信息,再执行 removeScripts - removeScripts(doc, SSS.a_scriptFilter); - i = 0; - case 31: - if (!(i < ii)) { - _context4.next = 40; - break; - } - pe_x = pageElements[i]; - pe_x_nn = pe_x.nodeName; - if (!(pe_x_nn == 'BODY' || pe_x_nn == 'HTML' || pe_x_nn == 'SCRIPT')) { - _context4.next = 36; - break; - } - return _context4.abrupt("continue", 37); - case 36: - fragment.appendChild(pe_x); - case 37: - i++; - _context4.next = 31; - break; - case 40: - if (SSS.filter && typeof SSS.filter === 'string') { - // 功能未完善. - nodes = []; - try { - nodes = getAllElements(SSS.filter, fragment); - } catch (e) {} - for (i = nodes.length - 1; i >= 0; i--) { - nodes_x = nodes[i]; - nodes_x.parentNode.removeChild(nodes_x); - } - } - - // lazyImgSrc - if (SSS.lazyImgSrc) { - handleLazyImgSrc(SSS.lazyImgSrc, fragment); - } - //@ts-ignore - if (!window.opera && SSS.a_useiframe && !SSS.a_iloaded) { - imgs = getAllElements('css;img[src]', fragment); // 收集所有图片 - } - - // 处理下一页内容部分链接是否新标签页打开 - if (prefs.forceTargetWindow) { - arr = Array.prototype.slice.call(fragment.querySelectorAll('a[href]:not([href^="mailto:"]):not([href^="javascript:"]):not([href^="#"])')); - arr.forEach(function (elem) { - elem.setAttribute('target', '_blank'); - if (elem.getAttribute('onclick') == 'atarget(this)') { - // 卡饭论坛的控制是否在新标签页打开 - elem.removeAttribute('onclick'); - } - }); - } - - /** @type {HTMLElement} */ - sepdiv = createSep(lastUrl, cplink, nextlink); - toInsert = sepdiv; - if (SSS.a_sepdivDom !== undefined && typeof SSS.a_sepdivDom === 'function') { - toInsert = SSS.a_sepdivDom(doc, sepdiv); - } else if (pageElements[0] && pageElements[0].tagName === 'TR' && pageElements[pageElements.length - 1].tagName === 'TR') { - insertParent = insertPoint.parentNode; - colNodes = getAllElements('child::tr[1]/child::*[self::td or self::th]', insertParent); - if (colNodes.length == 0) { - colNodes = getAllElements('child::*[self::td or self::th]', pageElements[0]); - } - _ncol = [].reduce.call(colNodes, function (acc, cur) { - return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); - }, 0); - toInsert = createDOM('tr', { - children: [createDOM('td', { - attr: { - colspan: _ncol - }, - children: [sepdiv] - })] - }); - } else if (pageElements[0] && pageElements[0].tagName === 'TBODY' && pageElements[pageElements.length - 1].tagName === 'TBODY') { - // https://bbs.kafan.cn/forum-8-1.html - trs = pageElements[pageElements.length - 1].getElementsByTagName('tr'); - if (trs) { - _ncol2 = [].reduce.call(trs[trs.length - 1].children, function (acc, cur) { - return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); - }, 0); - toInsert = createDOM('tbody', { - children: [createDOM('tr', { - children: [createDOM('td', { - attr: { - colspan: _ncol2 - }, - children: [sepdiv] - })] - })] - }); - } else { - logger.warn("[Super-preloader]", 'No trs found'); - } - } - fragment.insertBefore(toInsert, fragment.firstChild); - addIntoDoc(fragment); - - // filter - if (SSS.filter && typeof SSS.filter === 'function') { - try { - SSS.filter(pageElements); - logger.debug("[Super-preloader]", 'Execution of filter(pages) succeeded'); - } catch (e) { - logger.error("[Super-preloader]", 'Error executing filter(pages)', e, SSS.filter.toString()); - } - } - if (imgs) { - // 非opera,在iframeDOM取出数据时需要重载图片. - setTimeout(function () { - var _imgs = imgs; - var i, ii, img; - for (i = 0, ii = _imgs.length; i < ii; i++) { - img = _imgs[i]; - var src = img.src; - img.src = src; - } - }, 99); - } - if (SSS.a_replaceE) { - oldE = getAllElements(SSS.a_replaceE); - oldE_lt = oldE.length; - if (oldE_lt > 0) { - newE = getAllElements(SSS.a_replaceE, undefined, doc, win); - newE_lt = newE.length; - if (newE_lt == oldE_lt) { - // 替换 - - for (i = 0; i < newE_lt; i++) { - oldE_x = oldE[i]; - newE_x = newE[i]; - newE_x = doc.importNode(newE_x, true); - oldE_x.parentNode.replaceChild(newE_x, oldE_x); - } - } - } - } - paged += 1; - if (ipagesmode && paged >= ipagesnumber) { - ipagesmode = false; - } - floatWO.loadedIcon('hide'); - if (manualDiv) { - manualDiv.style.display = 'none'; - } - //if (goNextImg[0]) goNextImg[0].src = _sep_icons.next; - ev = document.createEvent('Event'); - ev.initEvent('Super_preloaderPageLoaded', true, false); - document.dispatchEvent(ev); - if (prefs.enableHistory) { - try { - window.history.pushState(null, docTitle, cplink); - } catch (e) {} - } - if (!(paged >= SSS.a_maxpage)) { - _context4.next = 66; - break; - } - logger.debug("[Super-preloader]", `Reached the set maximum number of page turns ${SSS.a_maxpage}`); - notice('Status:' + 'Reached the set maximum number of page turns:' + SSS.a_maxpage + ''); - removeL(); - return _context4.abrupt("return"); - case 66: - delayiframe = function delayiframe(fn) { - setTimeout(fn, 199); - }; - if (nextlink && !pagedLinks.includes(nextlink)) { - // debug('Found the next page link:', nextlink); - doc = win = null; - if (ipagesmode) { - if (SSS.a_useiframe) { - // 延时点,firefox,太急会卡-_-! - delayiframe(doRequest); - } else { - doRequest(); - } - } else { - working = false; - if (SSS.a_useiframe) { - delayiframe(afterInsertDo); - } else { - afterInsertDo(); - } - } - } else { - logger.error("[Super-preloader]", 'No next page link found.', SSS.nextLink); - removeL(); - } - case 68: - case "end": - return _context4.stop(); - } - }, _callee4, null, [[4, 10]]); - })); - return _insertedIntoDoc.apply(this, arguments); - } - var relatedObj_0, relatedObj_1; - if (SSS.a_relatedObj) { - if (_isArray(SSS.a_relatedObj)) { - relatedObj_0 = SSS.a_relatedObj[0]; - relatedObj_1 = SSS.a_relatedObj[1]; - } else { - relatedObj_0 = SSS.a_pageElement; - relatedObj_1 = 'bottom'; - } - } - function getRemain() { - var _cplink = cplink || undefined; - var scrolly = window.scrollY; - var windowHeight = window.innerHeight; - document.body.clientHeight; - var obj = getLastVisibleElement(relatedObj_0, _cplink); - var scrollH = obj && obj.nodeType == 1 ? obj.getBoundingClientRect()[relatedObj_1] + scrolly : Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); - var exElementHeight = 0; - if (SSS.a_excludeElement != undefined) { - var exElementNode = getLastVisibleElement(SSS.a_excludeElement, _cplink); - if (exElementNode !== null) { - exElementHeight = exElementNode.offsetHeight; - } - } - return (scrollH - scrolly - windowHeight - exElementHeight) / windowHeight; // 剩余高度于页面总高度的比例. - } - var pause = false; - if (prefs.pauseA) { - var Sbutton = ['target', 'shiftKey', 'ctrlKey', 'altKey']; - var ltype = prefs.mouseA ? 'mousedown' : 'dblclick'; - var button_1 = Sbutton[prefs.Pbutton[0]]; - var button_2 = Sbutton[prefs.Pbutton[1]]; - var button_3 = Sbutton[prefs.Pbutton[2]]; - var pauseIt = function pauseIt() { - pause = !pause; - if (prefs.stop_ipage) ipagesmode = false; - if (pause) { - floatWO.updateColor('Apause'); - if (userLang === 'zh_CN') { - notice('状态:' + '自动翻页 暂停.', prefs.disappearDelay); - } else { - notice('Status:' + 'Autopagger Pause.', prefs.disappearDelay); - } - } else { - floatWO.updateColor('autopager'); - floatWO.CmodeIcon('hide'); - if (userLang === 'zh_CN') { - notice('状态:' + '自动翻页 启用.'); - } else { - notice('Status:' + 'Autopagger Enable.'); - } - } - scroll(); - }; - var Sctimeout; - var clearPause = function clearPause() { - clearTimeout(Sctimeout); - document.removeEventListener('mouseup', clearPause, false); - }; - var pausehandler = function pausehandler(e) { - if (!SSS.a_manualA || ipagesmode) { - if (e[button_1] && e[button_2] && e[button_3]) { - if (e.type == 'mousedown') { - document.addEventListener('mouseup', clearPause, false); - Sctimeout = setTimeout(pauseIt, prefs.Atimeout); - } else { - pauseIt(); - } - } - } - }; - document.addEventListener(ltype, pausehandler, false); - remove.push(function () { - document.removeEventListener(ltype, pausehandler, false); - }); - } - function scroll() { - if (!pause && !working && (getRemain() <= SSS.a_remain || ipagesmode)) { - if (doc) { - // 有的话,就插入到文档. - beforeInsertIntoDoc(); - } else { - // 否则就请求文档. - scrollDo(); - } - } - } - var timeout; - function timeoutfn() { - clearTimeout(timeout); - timeout = setTimeout(scroll, 100); - } - window.addEventListener('scroll', timeoutfn, false); - remove.push(function () { - window.removeEventListener('scroll', timeoutfn, false); - }); - autoPO = { - startipages: function () { - var _startipages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) { - return _regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - if (!(value > 0)) { - _context2.next = 8; - break; - } - ipagesmode = true; - ipagesnumber = value + paged; - notice('Status:' + 'Current number of pages turned: ' + paged + ',' + 'Continue to turn page ' + ipagesnumber + ''); - if (!SSS.a_manualA) { - _context2.next = 7; - break; - } - _context2.next = 7; - return insertedIntoDoc(); - case 7: - scroll(); - case 8: - case "end": - return _context2.stop(); - } - }, _callee2); - })); - function startipages(_x2) { - return _startipages.apply(this, arguments); - } - return startipages; - }() - }; - } - - /** - * prefetcher - * @param {IRuntimeRule} SSS a rule - * @param {*} floatWO float window object - * @returns {void} - */ - function prefetcher(SSS, floatWO) { - function cContainer() { - var div = document.createElement('div'); - /** @type {HTMLElement} */ - //@ts-ignore - var div2 = div.cloneNode(false); - var hr = document.createElement('hr'); - div.style.cssText = '\ + } + return div; + } + var paged = 0; + function insertedIntoDoc() { + return _insertedIntoDoc.apply(this, arguments); + } // 返回,剩余高度是总高度的比值. + function _insertedIntoDoc() { + _insertedIntoDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() { + var docTitle, fragment, pageElements, ii, lastUrl, nl, i, pe_x, pe_x_nn, nodes, nodes_x, imgs, arr, sepdiv, toInsert, insertParent, colNodes, _ncol, trs, _ncol2, oldE, oldE_lt, newE, newE_lt, oldE_x, newE_x, ev, delayiframe; + return _regeneratorRuntime.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (doc) { + _context4.next = 3; + break; + } + logger.error("[Super-preloader]", 'No document'); + return _context4.abrupt("return"); + case 3: + if (!SSS.a_documentFilter) { + _context4.next = 13; + break; + } + _context4.prev = 4; + _context4.next = 7; + return SSS.a_documentFilter(doc, typeof nextlink === 'string' && nextlink); + case 7: + logger.debug("[Super-preloader]", 'Successfully executeed documentFilter'); + _context4.next = 13; + break; + case 10: + _context4.prev = 10; + _context4.t0 = _context4["catch"](4); + logger.error("[Super-preloader]", 'Error executing documentFilter', _context4.t0, SSS.a_documentFilter.toString()); + case 13: + docTitle = getElementByCSS('title', doc).textContent; + fragment = document.createDocumentFragment(); + pageElements = getAllElements(SSS.a_pageElement, undefined, doc, win, typeof nextlink === 'string' && nextlink); + ii = pageElements.length; + if (!(ii <= 0)) { + _context4.next = 23; + break; + } + logger.error("[Super-preloader]", 'Failed to get the main content of the next page', SSS.a_pageElement); + removeL(); + return _context4.abrupt("return"); + case 23: + logger.debug("[Super-preloader]", 'Successfully got the main content of the next page', pageElements); + case 24: + // 提前查找下一页链接,后面再赋值 + lastUrl = cplink; + cplink = String(nextlink); + /** @type {HTMLElement | String} */ + nl = getElement(SSS.nextLink, undefined, doc, win); + if (nl) { + if (nl === nextlinkElem) { + nextlinkElem = null; + } else { + nextlinkElem = nl; + } + } else { + nextlinkElem = null; + } + nextlink = elemToHref(nextlinkElem); + // 有部分下一页的信息是在script中(比如新加的csdn的规则),因此先查找下一页信息,再执行 removeScripts + removeScripts(doc, SSS.a_scriptFilter); + i = 0; + case 31: + if (!(i < ii)) { + _context4.next = 40; + break; + } + pe_x = pageElements[i]; + pe_x_nn = pe_x.nodeName; + if (!(pe_x_nn == 'BODY' || pe_x_nn == 'HTML' || pe_x_nn == 'SCRIPT')) { + _context4.next = 36; + break; + } + return _context4.abrupt("continue", 37); + case 36: + fragment.appendChild(pe_x); + case 37: + i++; + _context4.next = 31; + break; + case 40: + if (SSS.filter && typeof SSS.filter === 'string') { + // 功能未完善. + nodes = []; + try { + nodes = getAllElements(SSS.filter, fragment); + } catch (e) {} + for (i = nodes.length - 1; i >= 0; i--) { + nodes_x = nodes[i]; + nodes_x.parentNode.removeChild(nodes_x); + } + } + + // lazyImgSrc + if (SSS.lazyImgSrc) { + handleLazyImgSrc(SSS.lazyImgSrc, fragment); + } + //@ts-ignore + if (!window.opera && SSS.a_useiframe && !SSS.a_iloaded) { + imgs = getAllElements('css;img[src]', fragment); // 收集所有图片 + } + + // 处理下一页内容部分链接是否新标签页打开 + if (prefs.forceTargetWindow) { + arr = Array.prototype.slice.call(fragment.querySelectorAll('a[href]:not([href^="mailto:"]):not([href^="javascript:"]):not([href^="#"])')); + arr.forEach(function (elem) { + elem.setAttribute('target', '_blank'); + if (elem.getAttribute('onclick') == 'atarget(this)') { + // 卡饭论坛的控制是否在新标签页打开 + elem.removeAttribute('onclick'); + } + }); + } + + /** @type {HTMLElement} */ + sepdiv = createSep(lastUrl, cplink, nextlink); + toInsert = sepdiv; + if (SSS.a_sepdivDom !== undefined && typeof SSS.a_sepdivDom === 'function') { + toInsert = SSS.a_sepdivDom(doc, sepdiv); + } else if (pageElements[0] && pageElements[0].tagName === 'TR' && pageElements[pageElements.length - 1].tagName === 'TR') { + insertParent = insertPoint.parentNode; + colNodes = getAllElements('child::tr[1]/child::*[self::td or self::th]', insertParent); + if (colNodes.length == 0) { + colNodes = getAllElements('child::*[self::td or self::th]', pageElements[0]); + } + _ncol = [].reduce.call(colNodes, function (acc, cur) { + return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); + }, 0); + toInsert = createDOM('tr', { + children: [createDOM('td', { + attr: { + colspan: _ncol + }, + children: [sepdiv] + })] + }); + } else if (pageElements[0] && pageElements[0].tagName === 'TBODY' && pageElements[pageElements.length - 1].tagName === 'TBODY') { + // https://bbs.kafan.cn/forum-8-1.html + trs = pageElements[pageElements.length - 1].getElementsByTagName('tr'); + if (trs) { + _ncol2 = [].reduce.call(trs[trs.length - 1].children, function (acc, cur) { + return acc + (parseInt(cur.getAttribute('colspan'), 10) || 1); + }, 0); + toInsert = createDOM('tbody', { + children: [createDOM('tr', { + children: [createDOM('td', { + attr: { + colspan: _ncol2 + }, + children: [sepdiv] + })] + })] + }); + } else { + logger.warn("[Super-preloader]", 'No trs found'); + } + } + fragment.insertBefore(toInsert, fragment.firstChild); + addIntoDoc(fragment); + + // filter + if (SSS.filter && typeof SSS.filter === 'function') { + try { + SSS.filter(pageElements); + logger.debug("[Super-preloader]", 'Execution of filter(pages) succeeded'); + } catch (e) { + logger.error("[Super-preloader]", 'Error executing filter(pages)', e, SSS.filter.toString()); + } + } + if (imgs) { + // 非opera,在iframeDOM取出数据时需要重载图片. + setTimeout(function () { + var _imgs = imgs; + var i, ii, img; + for (i = 0, ii = _imgs.length; i < ii; i++) { + img = _imgs[i]; + var src = img.src; + img.src = src; + } + }, 99); + } + if (SSS.a_replaceE) { + oldE = getAllElements(SSS.a_replaceE); + oldE_lt = oldE.length; + if (oldE_lt > 0) { + newE = getAllElements(SSS.a_replaceE, undefined, doc, win); + newE_lt = newE.length; + if (newE_lt == oldE_lt) { + // 替换 + + for (i = 0; i < newE_lt; i++) { + oldE_x = oldE[i]; + newE_x = newE[i]; + newE_x = doc.importNode(newE_x, true); + oldE_x.parentNode.replaceChild(newE_x, oldE_x); + } + } + } + } + paged += 1; + if (ipagesmode && paged >= ipagesnumber) { + ipagesmode = false; + } + floatWO.loadedIcon('hide'); + if (manualDiv) { + manualDiv.style.display = 'none'; + } + //if (goNextImg[0]) goNextImg[0].src = _sep_icons.next; + ev = document.createEvent('Event'); + ev.initEvent('Super_preloaderPageLoaded', true, false); + document.dispatchEvent(ev); + if (prefs.enableHistory) { + try { + window.history.pushState(null, docTitle, cplink); + } catch (e) {} + } + if (!(paged >= SSS.a_maxpage)) { + _context4.next = 66; + break; + } + logger.debug("[Super-preloader]", `Reached the set maximum number of page turns ${SSS.a_maxpage}`); + notice('Status:' + 'Reached the set maximum number of page turns:' + SSS.a_maxpage + ''); + removeL(); + return _context4.abrupt("return"); + case 66: + delayiframe = function delayiframe(fn) { + setTimeout(fn, 199); + }; + if (nextlink && !pagedLinks.includes(nextlink)) { + // debug('Found the next page link:', nextlink); + doc = win = null; + if (ipagesmode) { + if (SSS.a_useiframe) { + // 延时点,firefox,太急会卡-_-! + delayiframe(doRequest); + } else { + doRequest(); + } + } else { + working = false; + if (SSS.a_useiframe) { + delayiframe(afterInsertDo); + } else { + afterInsertDo(); + } + } + } else { + logger.error("[Super-preloader]", 'No next page link found.', SSS.nextLink); + removeL(); + } + case 68: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[4, 10]]); + })); + return _insertedIntoDoc.apply(this, arguments); + } + var relatedObj_0, relatedObj_1; + if (SSS.a_relatedObj) { + if (_isArray(SSS.a_relatedObj)) { + relatedObj_0 = SSS.a_relatedObj[0]; + relatedObj_1 = SSS.a_relatedObj[1]; + } else { + relatedObj_0 = SSS.a_pageElement; + relatedObj_1 = 'bottom'; + } + } + function getRemain() { + var _cplink = cplink || undefined; + var scrolly = window.scrollY; + var windowHeight = window.innerHeight; + document.body.clientHeight; + var obj = getLastVisibleElement(relatedObj_0, _cplink); + var scrollH = obj && obj.nodeType == 1 ? obj.getBoundingClientRect()[relatedObj_1] + scrolly : Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); + var exElementHeight = 0; + if (SSS.a_excludeElement != undefined) { + var exElementNode = getLastVisibleElement(SSS.a_excludeElement, _cplink); + if (exElementNode !== null) { + exElementHeight = exElementNode.offsetHeight; + } + } + return (scrollH - scrolly - windowHeight - exElementHeight) / windowHeight; // 剩余高度于页面总高度的比例. + } + var pause = false; + if (prefs.pauseA) { + var Sbutton = ['target', 'shiftKey', 'ctrlKey', 'altKey']; + var ltype = prefs.mouseA ? 'mousedown' : 'dblclick'; + var button_1 = Sbutton[prefs.Pbutton[0]]; + var button_2 = Sbutton[prefs.Pbutton[1]]; + var button_3 = Sbutton[prefs.Pbutton[2]]; + var pauseIt = function pauseIt() { + pause = !pause; + if (prefs.stop_ipage) ipagesmode = false; + if (pause) { + floatWO.updateColor('Apause'); + if (userLang === 'zh_CN') { + notice('状态:' + '自动翻页 暂停.', prefs.disappearDelay); + } else { + notice('Status:' + 'Autopagger Pause.', prefs.disappearDelay); + } + } else { + floatWO.updateColor('autopager'); + floatWO.CmodeIcon('hide'); + if (userLang === 'zh_CN') { + notice('状态:' + '自动翻页 启用.'); + } else { + notice('Status:' + 'Autopagger Enable.'); + } + } + scroll(); + }; + var Sctimeout; + var clearPause = function clearPause() { + clearTimeout(Sctimeout); + document.removeEventListener('mouseup', clearPause, false); + }; + var pausehandler = function pausehandler(e) { + if (!SSS.a_manualA || ipagesmode) { + if (e[button_1] && e[button_2] && e[button_3]) { + if (e.type == 'mousedown') { + document.addEventListener('mouseup', clearPause, false); + Sctimeout = setTimeout(pauseIt, prefs.Atimeout); + } else { + pauseIt(); + } + } + } + }; + document.addEventListener(ltype, pausehandler, false); + remove.push(function () { + document.removeEventListener(ltype, pausehandler, false); + }); + } + function scroll() { + if (!pause && !working && (getRemain() <= SSS.a_remain || ipagesmode)) { + if (doc) { + // 有的话,就插入到文档. + beforeInsertIntoDoc(); + } else { + // 否则就请求文档. + scrollDo(); + } + } + } + var timeout; + function timeoutfn() { + clearTimeout(timeout); + timeout = setTimeout(scroll, 100); + } + window.addEventListener('scroll', timeoutfn, false); + remove.push(function () { + window.removeEventListener('scroll', timeoutfn, false); + }); + autoPO = { + startipages: function () { + var _startipages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) { + return _regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(value > 0)) { + _context2.next = 8; + break; + } + ipagesmode = true; + ipagesnumber = value + paged; + notice('Status:' + 'Current number of pages turned: ' + paged + ',' + 'Continue to turn page ' + ipagesnumber + ''); + if (!SSS.a_manualA) { + _context2.next = 7; + break; + } + _context2.next = 7; + return insertedIntoDoc(); + case 7: + scroll(); + case 8: + case "end": + return _context2.stop(); + } + }, _callee2); + })); + function startipages(_x2) { + return _startipages.apply(this, arguments); + } + return startipages; + }() + }; + } + + /** + * prefetcher + * @param {IRuntimeRule} SSS a rule + * @param {*} floatWO float window object + * @returns {void} + */ + function prefetcher(SSS, floatWO) { + function cContainer() { + var div = document.createElement('div'); + /** @type {HTMLElement} */ + //@ts-ignore + var div2 = div.cloneNode(false); + var hr = document.createElement('hr'); + div.style.cssText = '\ margin:3px!important;\ padding:5px!important;\ border-radius:8px!important;\ @@ -11668,8 +11196,8 @@ float:none!important;\ display:none!important;\ '; - div.title = 'Prefetched content'; - div2.style.cssText = '\ + div.title = 'Prefetched content'; + div2.style.cssText = '\ text-align:left!important;\ color:red!important;\ font-size:13px!important;\ @@ -11677,1163 +11205,1163 @@ display:block!important;\ position:static!important;\ '; - hr.style.cssText = '\ + hr.style.cssText = '\ display:block!important;\ border:1px inset #000!important;\ '; - div.appendChild(div2); - div.appendChild(hr); - document.body.appendChild(div); - return { - div: div, - div2: div2 - }; - } - floatWO.updateColor('prefetcher'); - floatWO.updateColor('loading'); - floatWO.CmodeIcon('show'); - if (SSS.useiframe) { - var iframe = document.createElement('iframe'); - iframe.name = 'superpreloader-iframe'; - iframe.src = String(nextlink); - iframe.width = '100%'; - iframe.height = '0'; - iframe.frameBorder = '0'; - iframe.style.cssText = '\ + div.appendChild(div2); + div.appendChild(hr); + document.body.appendChild(div); + return { + div: div, + div2: div2 + }; + } + floatWO.updateColor('prefetcher'); + floatWO.updateColor('loading'); + floatWO.CmodeIcon('show'); + if (SSS.useiframe) { + var iframe = document.createElement('iframe'); + iframe.name = 'superpreloader-iframe'; + iframe.src = String(nextlink); + iframe.width = '100%'; + iframe.height = '0'; + iframe.frameBorder = '0'; + iframe.style.cssText = '\ margin:0!important;\ padding:0!important;\ '; - iframe.addEventListener('load', function (e) { - //@ts-ignore - var body = e.currentTarget.contentDocument.body; - if (body && body.firstChild) { - floatWO.updateColor('prefetcher'); - floatWO.CmodeIcon('hide'); - floatWO.loadedIcon('show'); - //@ts-ignore - e.currentTarget.removeEventListener('load', arguments.callee, false); - if (SSS.lazyImgSrc) { - handleLazyImgSrc(SSS.lazyImgSrc, body); - } - } - }, false); - if (SSS.viewcontent) { - var container = cContainer(); - container.div.style.display = 'block'; - container.div2.innerHTML = 'iframe full prefetch: ' + '' + 'Prefetch URL: ' + '' + nextlink + ''; - iframe.height = '300px'; - container.div.appendChild(iframe); - } else { - document.body.appendChild(iframe); - } - } else { - var reqConf = { - headers: SSS.a_headers ? SSS.a_headers : { - Referer: cplink - } - }; - got.get(nextlink, reqConf).then(function (res) { - var doc = createDocumentByString(res.data); - if (!doc) { - logger.error("[Super-preloader]", 'Document object creation failed!'); - return; - } - if (SSS.lazyImgSrc) { - handleLazyImgSrc(SSS.lazyImgSrc, doc); - } - var images = doc.images; - var isl = images.length; - var img; - var iarray = []; - var i; - var existSRC = {}; - var isrc; - for (i = isl - 1; i >= 0; i--) { - isrc = images[i].getAttribute('src'); - if (!isrc || existSRC[isrc]) { - continue; - } else { - existSRC[isrc] = true; - } - img = document.createElement('img'); - img.src = isrc; - iarray.push(img); - } - var container = cContainer(); - var div = container.div; - i = iarray.length; - container.div2.innerHTML = 'Number of prefetched pictures: ' + '' + i + '' + '' + 'Prefetch URL:' + '' + nextlink + ''; - logger.info("[Super-preloader]", 'Number of prefetched pictures: ' + i + 'Prefetch URL: ' + nextlink); - for (i -= 1; i >= 0; i--) { - div.appendChild(iarray[i]); - } - if (SSS.viewcontent) { - container.div.style.display = 'block'; - } - floatWO.updateColor('prefetcher'); - floatWO.loadedIcon('show'); - floatWO.CmodeIcon('hide'); - }); - } - } - - // 执行开始../////////////////// - - // 分析黑名单 - var blackList_re = new RegExp(blackList.map(function (x) { - if (x.substring(0, 3).toLowerCase() == 're:') { - return x.substring(4); - } else { - return wildcardToRegExpStr(x); - } - }).join('|')); - if (blackList_re.test(url)) { - logger.debug("[Super-preloader]", 'Matched blacklist, JS execution stopped'); - return; - } - - // 是否在frame上加载.. - if (prefs.DisableI && window.self != window.parent) { - var isReturn = !_find(DIExclude, function (x) { - //@ts-ignore - return x[1] && x[2].test(url); - }); - if (isReturn) { - logger.debug("[Super-preloader]", `The page with url:${url} is not a top-level window, JS execution stopped`); - return; - } - } - logger.debug("[Super-preloader]", `Page url is: ${url}, JS loaded successfully`); - - // 第一阶段..分析高级模式.. - if (prefs.disableBuiltinRules) { - logger.warn("[Super-preloader]", 'Builtin js rules are disabled'); - } else { - SSRules = SSRules.concat(jsSiteRule); - } - if (prefs.disableBuiltinSubscriptionRules) { - logger.warn("[Super-preloader]", 'Remote json rules are disabled'); - } else { - SSRules = SSRules.concat(jsonRule); - } - if (!prefs.disableBuiltinRules) { - SSRules = SSRules.concat(jsGeneralRule); - } - if (!prefs.numOfRule || prefs.numOfRule != SSRules.length) { - prefs.numOfRule = SSRules.length; - GM.setValue('prefs', prefs); - } - - // 重要的变量两枚. - /** @type {Array} */ - var pagedLinks = [document.location.href]; - /** @type {HTMLElement|string} */ - var nextlinkElem; - /** @type {string} */ - var nextlink; - /** @type {HTMLElement|string} */ - var prelink; - - //= ============== - - /**@type {IRuntimeRule} */ - var SSS = {}; - var findCurSiteInfo = /*#__PURE__*/function () { - var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() { - var SIIAD, Rurl, ii, _loop, _ret, i, FA; - return _regeneratorRuntime.wrap(function _callee5$(_context6) { - while (1) switch (_context6.prev = _context6.next) { - case 0: - SIIAD = SITEINFO_D.autopager; - ii = SSRules.length; - if (userLang === 'zh_CN') { - logger.debug("[Super-preloader]", `高级规则数目:${ii}`); - logger.debug("[Super-preloader]", `Number of rules > ${ii - jsonRule.length} from other sources, such as: wedata.net`); - } else { - logger.debug("[Super-preloader]", `Number of advanced rules:${ii}`); - } - _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() { - var SII, SIIA, documentFilter, pageElement; - return _regeneratorRuntime.wrap(function _loop$(_context5) { - while (1) switch (_context5.prev = _context5.next) { - case 0: - SII = SSRules[i]; - if (!(SII.autopager && SII.autopager.ip)) { - _context5.next = 4; - break; - } - if (!(SII.autopager.ip.indexOf(serverIp) < 0)) { - _context5.next = 4; - break; - } - return _context5.abrupt("return", 0); - case 4: - Rurl = toRE(SII.url); - if (!Rurl.test(url)) { - _context5.next = 75; - break; - } - if (userLang === 'zh_CN') { - logger.debug("[Super-preloader]", 'Find current site rules:', SII); - logger.debug("[Super-preloader]", `规则ID: ${i + 1}`); - } else { - logger.debug("[Super-preloader]", 'Find rule for this website:', SII); - logger.debug("[Super-preloader]", `Rule ID: ${i + 1}`); - } - - // 运行规则的 startFilter - if (!(SII.autopager && SII.autopager.startFilter)) { - _context5.next = 17; - break; - } - _context5.prev = 8; - _context5.next = 11; - return SII.autopager.startFilter(document, window); - case 11: - logger.debug("[Super-preloader]", 'startFilter executed successfully'); - _context5.next = 17; - break; - case 14: - _context5.prev = 14; - _context5.t0 = _context5["catch"](8); - logger.error("[Super-preloader]", 'Error executing startFilter', _context5.t0); - case 17: - if (!(SII.nextLink === 'null;')) { - _context5.next = 21; - break; - } - logger.debug("[Super-preloader]", 'Find the rule for a site without nextpage', SII); - SSS.hasRule = false; - return _context5.abrupt("return", 1); - case 21: - nextlinkElem = getElement(SII.nextLink || 'auto;'); - if (nextlinkElem) { - _context5.next = 25; - break; - } - logger.warn("[Super-preloader]", 'Could not find the next page link, continue searching for other rules, skiping rule:', SII); - return _context5.abrupt("return", 0); - case 25: - // extract next page link from an a link - nextlink = getFullHref(nextlinkElem); - if (!(nextlink === document.location.href)) { - _context5.next = 29; - break; - } - nextlinkElem = null; - return _context5.abrupt("return", 0); - case 29: - if (SII.preLink && SII.preLink != 'auto;') { - // 如果设定了具体的preLink - prelink = getElement(SII.preLink); - } else { - if (prefs.autoGetPreLink) { - prelink = getElement('auto;'); - } - } - SSS = {}; - SSS.Rurl = String(Rurl); - SSS.nextLink = SII.nextLink || 'auto;'; - SSS.viewcontent = SII.viewcontent; - SSS.enable = SII.enable === undefined ? SITEINFO_D.enable : SII.enable; - SSS.useiframe = SII.useiframe === undefined ? SITEINFO_D.useiframe : SII.useiframe; - if (SII.pageElement) { - // 如果是Oautopager的规则.. - if (typeof SII.autopager !== 'object') SII.autopager = {}; - SII.autopager.pageElement = SII.pageElement; - if (!SII.autopager.useiframe) SII.autopager.useiframe = SII.useiframe; - if (SII.preLink) SII.autopager.preLink = SII.preLink; - if (SII.insertBefore) SII.autopager.HT_insert = [SII.insertBefore, 1]; - } - - // 自动翻页设置. - SIIA = SII.autopager; - if (!SIIA) { - _context5.next = 68; - break; - } - SSS.a_pageElement = SIIA.pageElement; - if (SSS.a_pageElement) { - _context5.next = 42; - break; - } - return _context5.abrupt("return", 1); - case 42: - SSS.a_manualA = SIIA.manualA === undefined ? SIIAD.manualA : SIIA.manualA; - SSS.a_enable = SIIA.enable === undefined ? SIIAD.enable : SIIA.enable; - SSS.a_useiframe = SIIA.useiframe === undefined ? SIIAD.useiframe : SIIA.useiframe; - SSS.a_mutationObserver = SSS.a_useiframe ? SIIA.mutationObserver === undefined ? null : SIIA.mutationObserver : null; - SSS.a_newIframe = SIIA.newIframe === undefined ? SIIAD.newIframe : SIIA.newIframe; - SSS.a_iloaded = SIIA.iloaded === undefined ? SIIAD.iloaded : SIIA.iloaded; - SSS.a_itimeout = SIIA.itimeout === undefined ? SIIAD.itimeout : SIIA.itimeout; - SSS.a_remain = SIIA.remain === undefined ? SIIAD.remain : SIIA.remain; - SSS.a_maxpage = SIIA.maxpage === undefined ? SIIAD.maxpage : SIIA.maxpage; - SSS.a_separator = SIIA.separator === undefined ? SIIAD.separator : SIIA.separator; - SSS.a_sepdivDom = SIIA.sepdivDom === undefined ? undefined : SIIA.sepdivDom; - SSS.a_separatorReal = SIIA.separatorReal === undefined ? SIIAD.separatorReal : SIIA.separatorReal; - SSS.a_replaceE = SIIA.replaceE; - SSS.a_HT_insert = SIIA.HT_insert; - SSS.a_relatedObj = SIIA.relatedObj === undefined ? SIIAD.relatedObj : SIIA.relatedObj; - SSS.a_ipages = SIIA.ipages === undefined ? SIIAD.ipages : SIIA.ipages; - - // new - SSS.filter = SII.filter || SIIA.filter; // 新增了函数的形式,原来的功能是移除 pageElement - documentFilter = SII.documentFilter || SIIA.documentFilter; - if (documentFilter === 'startFilter') { - SSS.a_documentFilter = function (doc) { - return SII.autopager.startFilter(doc); - }; - } else if (typeof documentFilter === 'function') { - SSS.a_documentFilter = documentFilter; - } else { - SSS.a_documentFilter = undefined; - } - SSS.a_scriptFilter = SIIA.scriptFilter === undefined ? '' : SIIA.scriptFilter; - SSS.a_stylish = SII.stylish || SIIA.stylish; - SSS.lazyImgSrc = SIIA.lazyImgSrc; - SSS.a_headers = SIIA.headers === undefined ? undefined : SIIA.headers; // custom header for XHRLoaded - SSS.a_reload = SIIA.reload === undefined ? SIIAD.reload : SIIA.reload; // force reload iframe - SSS.a_sandbox = SIIA.sandbox === undefined ? SIIAD.sandbox : SIIA.sandbox; - - // 在翻页的时候会有一些其他元素占据了页面的高度,导致翻页不精准。 - // 比如正文下面的推荐文章列表(占据超过整个页面10%就很难受) - SSS.a_excludeElement = SIIA.excludeElement; - case 68: - // 检验是否存在内容 - pageElement = getElement(SSS.a_pageElement); - if (!(!pageElement || Array.isArray(pageElement) && pageElement.length === 0)) { - _context5.next = 73; - break; - } - nextlinkElem = null; - logger.error("[Super-preloader]", 'Could not find content, skiping rule:', SII, 'Continue to search for other rules.'); - return _context5.abrupt("return", 0); - case 73: - SSS.hasRule = true; - return _context5.abrupt("return", 1); - case 75: - case "end": - return _context5.stop(); - } - }, _loop, null, [[8, 14]]); - }); - i = 0; - case 5: - if (!(i < ii)) { - _context6.next = 15; - break; - } - return _context6.delegateYield(_loop(), "t0", 7); - case 7: - _ret = _context6.t0; - if (!(_ret === 0)) { - _context6.next = 10; - break; - } - return _context6.abrupt("continue", 12); - case 10: - if (!(_ret === 1)) { - _context6.next = 12; - break; - } - return _context6.abrupt("break", 15); - case 12: - i++; - _context6.next = 5; - break; - case 15: - if (!SSS.hasRule) { - // 自动搜索. - if (!autoMatch.keyMatch) { - logger.warn("[Super-preloader]", 'Auto match is disabled'); - } else { - logger.warn("[Super-preloader]", 'No rules are found. Auto match starts'); - nextlinkElem = autoGetLink(); - if (nextlinkElem) { - // 强制模式. - FA = autoMatch.FA; - SSS.Rurl = window.localStorage ? 'am:' + (url.match(/^https?:\/\/[^:]*\//i) || [])[0] : 'am:automatch'; - SSS.enable = true; - SSS.nextLink = 'auto;'; - SSS.viewcontent = autoMatch.viewcontent; - SSS.useiframe = autoMatch.useiframe || SITEINFO_D.autopager.useiframe; - SSS.a_force = true; - SSS.a_manualA = FA.manualA; - SSS.a_enable = FA.enable || SITEINFO_D.autopager.force_enable; // Force join is enabled when this becomes true - SSS.a_useiframe = FA.useiframe || SITEINFO_D.useiframe; - SSS.a_iloaded = FA.iloaded; - SSS.a_itimeout = FA.itimeout; - SSS.a_remain = FA.remain; - SSS.a_maxpage = FA.maxpage; - SSS.a_separator = FA.separator; - SSS.a_ipages = FA.ipages; - } - } - } - - // 如果规则没 lazyImgSrc,设置默认值 - if (!SSS.lazyImgSrc) { - SSS.lazyImgSrc = prefs.lazyImgSrc; - } - logger.debug("[Super-preloader]", `Total time spent on searching for advanced rules and automatic matching: ${new Date().getTime() - startTime.getTime()}ms`); - case 18: - case "end": - return _context6.stop(); - } - }, _callee5); - })); - return function findCurSiteInfo() { - return _ref5.apply(this, arguments); - }; - }(); - findCurSiteInfo().then(function () { - // 上下页都没有找到啊 - if (!nextlinkElem && !prelink) { - logger.warn("[Super-preloader]", `No related links found, JS execution stopped. Total time spent: ${new Date().getTime() - startTime.getTime()}ms`); - return; - } else if (!nextlink) { - logger.error("[Super-preloader]", 'The link to the next page does not exist, JS cannot continue.'); - logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); - return; - } else { - logger.debug("[Super-preloader]", 'Previous link element:', prelink); - logger.debug("[Super-preloader]", 'Next link element:', nextlinkElem); - nextlink = elemToHref(nextlinkElem); - logger.debug("[Super-preloader]", 'Next link:', nextlink); - //@ts-ignore - prelink = prelink ? prelink.href || prelink : undefined; - } - var keyBinding = { - go: function go() { - if (typeof nextlink === 'string') window.location.href = nextlink; - }, - back: function back() { - //fixme - if (!prelink) getElement('auto;'); - if (typeof prelink === 'string') window.location.href = prelink; - }, - register: function register( /**@type {IPrefs} */prefs) { - var _this = this; - if (prefs.arrowKeyPage) { - logger.debug("[Super-preloader]", 'Adding left and right arrow keys to autopager listener.'); - document.addEventListener('keyup', function (e) { - //@ts-ignore - var tarNN = e.target.nodeName; - if (tarNN != 'BODY' && tarNN != 'HTML') return; - - // check is a combo pressed - if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) { - return; - } - switch (e.keyCode) { - case 37: - _this.back(); - break; - case 39: - _this.go(); - break; - } - }, false); - - // 监听下一页事件. - logger.debug("[Super-preloader]", '添加鼠标手势翻页监听'); - document.addEventListener('superPreloader.go', function () { - _this.go(); - }, false); - - // 监听下一页事件. - document.addEventListener('superPreloader.back', function () { - _this.back(); - }, false); - } - } - }; - keyBinding.register(prefs); - loadLocalSetting(SSS); - if (!SSS.enable) { - logger.warn("[Super-preloader]", 'This rule is disabled, script execution is stopped'); - logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); - return; - } - if (!SSS.hasRule) { - SSS.a_force = true; - } - if (SSS.a_force) { - SSS.a_pageElement = '//body/*'; - SSS.a_HT_insert = undefined; - SSS.a_relatedObj = undefined; - } - if (prefs.floatWindow) { - logger.debug("[Super-preloader]", 'Creating a floating window'); - floatWindow(SSS); - var floatWindowWidth = getFloatWindowWith(); - displace(document.getElementById('sp-fw-container'), { - handle: document.getElementById('sp-fw-rect'), - customMove: function customMove(el, x, y) { - delete el.style.left; - delete el.style.bottom; - var right = document.body.clientWidth - floatWindowWidth - x; - if (right < 0) { - right = 0; - } else if (right > window.innerWidth - floatWindowWidth) { - right = window.innerWidth - floatWindowWidth; - } - var top = y; - if (top > window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight) { - top = window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight; - } else if (top < 0) { - top = 0; - } - el.style.right = `${right}px`; - el.style.top = `${top}px`; - }, - onMouseUp: function onMouseUp(el) { - prefs.FW_offset[0] = parseInt(el.style.top.replace('px', ''), 10); - prefs.FW_offset[1] = parseInt(el.style.right.replace('px', ''), 10); - prefs.FW_position = 2; - GM.setValue('prefs', prefs); - } - }); - document.getElementById('sp-fw-container').style.position = 'fixed'; - } - logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); - - // 预读或者翻页. - if (SSS.a_enable) { - logger.debug("[Super-preloader]", 'Initializing, autopager mode.'); - autopager(SSS, floatWO); - } else { - logger.debug("[Super-preloader]", 'Initializing, prefetch mode.'); - prefetcher(SSS, floatWO); - } - }); - - // 获取单个元素,混合 - /** - * - * @param {string|Function|Array|IHrefIncObject} selector selector - * @param {HTMLElement|Document=} contextNode element - * @param {Document=} doc document - * @param {Window=} win window - * @returns {HTMLElement} element - */ - function getElement(selector, contextNode, doc, win) { - var _cplink = cplink; - var ret; - if (!selector) return ret; - doc = doc || document; - win = win || window; - contextNode = contextNode || doc; - if (typeof selector === 'string') { - if (selector.search(/^css;/i) === 0) { - ret = getElementByCSS(selector.slice(4), contextNode); - } else if (selector.toLowerCase() == 'auto;') { - ret = autoGetLink(doc); - } else { - ret = getElementByXpath(selector, contextNode, doc); - } - } else if (typeof selector === 'function') { - ret = selector(doc, win, _cplink); - } else if (selector instanceof Array) { - for (var i = 0, l = selector.length; i < l; i++) { - ret = getElement(selector[i], contextNode, doc, win); - if (ret) { - break; - } - } - } else { - ret = hrefInc(selector, doc, win, _cplink); - } - return ret; - } - var docChecked; - /** - * - * @param {Document=} doc document - * @param {Window=} win window - * @returns {HTMLElement} a - */ - function autoGetLink(doc, win) { - if (!autoMatch.keyMatch) return; - //@ts-ignore - if (!parseKWRE.done) { - parseKWRE(); - //@ts-ignore - parseKWRE.done = true; - } - var startTime = new Date(); - doc = doc || document; - if (doc == document) { - // 当前文档,只检查一次. - if (docChecked) { - // @ts-ignore - return nextlink; - } - docChecked = true; - } - var _prePageKey = prePageKey; - var _nextPageKey = nextPageKey; - var _nPKL = nextPageKey.length; - var _pPKL = prePageKey.length; - var _getFullHref = getFullHref; - var _getAllElementsByXpath = getAllElementsByXpath; - var _Number = Number; - var _domain_port = domain_port; - var alllinks = doc.links; - var alllinksl = alllinks.length; - var curLHref = cplink; - var _nextlink; - var _prelink; - //@ts-ignore - if (!autoGetLink.checked) { - // 第一次检查 - _nextlink = nextlink; - _prelink = prelink; - } else { - _prelink = true; - } - var DCEnable = autoMatch.digitalCheck; - var DCRE = /^\s*\D{0,1}(\d+)\D{0,1}\s*$/; - var i, a, atext, numtext; - var aP; - var initSD; - var searchD = 1; - var preS1; - var preS2; - var searchedD; - var pSNText; - var preSS; - var nodeType; - var nextS1, nextS2, nSNText, nextSS; - var aimgs, j, jj, aimg_x, xbreak, k, keytext; - function finalCheck(a, type) { - var ahref = a.getAttribute('href'); // 在chrome上当是非当前页面文档对象的时候直接用a.href访问,不返回href - if (ahref == '#') { - return null; - } - ahref = _getFullHref(ahref); // 从相对路径获取完全的href; - - // 3个条件:http协议链接,非跳到当前页面的链接,非跨域 - if (/^https?:/i.test(ahref) && ahref.replace(/#.*$/, '') != curLHref && ahref.match(/https?:\/\/([^\/]+)/)[1] == _domain_port) { - logger.debug("[Super-preloader]", type == 'pre' ? 'previous' : 'next' + 'match:', atext); - return a; // 返回对象A - // return ahref; - } - } - logger.debug("[Super-preloader]", `Number of full document links:${alllinksl}`); - for (i = 0; i < alllinksl; i++) { - if (_nextlink && _prelink) break; - a = alllinks[i]; - if (!a) continue; // undefined跳过 - // links集合返回的本来就是包含href的a元素..所以不用检测 - // if(!a.hasAttribute("href"))continue; - atext = a.textContent; - if (atext) { - if (DCEnable) { - numtext = atext.match(DCRE); - if (numtext) { - // 是不是纯数字 - // debug(numtext); - numtext = numtext[1]; - aP = a; - initSD = 0; - if (!_nextlink) { - preS1 = a.previousSibling; - preS2 = a.previousElementSibling; - while (!(preS1 || preS2) && initSD < searchD) { - aP = aP.parentNode; - if (aP) { - preS1 = aP.previousSibling; - //@ts-ignore - preS2 = aP.previousElementSibling; - } - initSD++; - } - searchedD = initSD > 0; - if (preS1 || preS2) { - pSNText = preS1 ? preS1.textContent.match(DCRE) : ''; - if (pSNText) { - preSS = preS1; - } else { - pSNText = preS2 ? preS2.textContent.match(DCRE) : ''; - preSS = preS2; - } - if (pSNText) { - pSNText = pSNText[1]; - if (_Number(pSNText) == _Number(numtext) - 1) { - nodeType = preSS.nodeType; - if (nodeType == 3 || nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', preSS, doc).length === 0 : !preSS.hasAttribute('href') || _getFullHref(preSS.getAttribute('href')) == curLHref)) { - _nextlink = finalCheck(a, 'next'); - } - continue; - } - } - } - } - if (!_prelink) { - nextS1 = a.nextSibling; - nextS2 = a.nextElementSibling; - while (!(nextS1 || nextS2) && initSD < searchD) { - aP = aP.parentNode; - if (aP) { - nextS1 = a.nextSibling; - nextS2 = a.nextElementSibling; - } - initSD++; - } - searchedD = initSD > 0; - if (nextS1 || nextS2) { - nSNText = nextS1 ? nextS1.textContent.match(DCRE) : ''; - if (nSNText) { - nextSS = nextS1; - } else { - nSNText = nextS2 ? nextS2.textContent.match(DCRE) : ''; - nextSS = nextS2; - } - if (nSNText) { - nSNText = nSNText[1]; - if (_Number(nSNText) == _Number(numtext) + 1) { - nodeType = nextSS.nodeType; - if (nodeType == 3 || - // @ts-ignore - nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', nextSS, doc).length === 0 : !nextSS.hasAttribute('href') || _getFullHref(nextSS.getAttribute('href')) == curLHref)) { - _prelink = finalCheck(a, 'pre'); - } - } - } - } - } - continue; - } - } - } else { - atext = a.title; - } - if (!atext) { - aimgs = a.getElementsByTagName('img'); - for (j = 0, jj = aimgs.length; j < jj; j++) { - aimg_x = aimgs[j]; - atext = aimg_x.alt || aimg_x.title; - if (atext) break; - } - } - if (!atext) continue; - if (!_nextlink) { - xbreak = false; - for (k = 0; k < _nPKL; k++) { - keytext = _nextPageKey[k]; - //@ts-ignore - if (!keytext.test(atext)) continue; - _nextlink = finalCheck(a, 'next'); - xbreak = true; - break; - } - if (xbreak || _nextlink) continue; - } - if (!_prelink) { - for (k = 0; k < _pPKL; k++) { - keytext = _prePageKey[k]; - //@ts-ignore - if (!keytext.test(atext)) continue; - _prelink = finalCheck(a, 'pre'); - break; - } - } - } - logger.debug("[Super-preloader]", `Time to search ${i} links:${new Date().getTime() - startTime.getTime()}ms`); - //@ts-ignore - if (!autoGetLink.checked) { - // 只在第一次检测的时候,抛出上一页链接. - prelink = _prelink; - //@ts-ignore - autoGetLink.checked = true; - } - return _nextlink; - } - function parseKWRE() { - function modifyPageKey(name, pageKey, pageKeyLength) { - function strMTE(str) { - return str.replace(/\\/g, '\\\\').replace(/\+/g, '\\+').replace(/\./g, '\\.').replace(/\?/g, '\\?').replace(/\{/g, '\\{').replace(/\}/g, '\\}').replace(/\[/g, '\\[').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/\$/g, '\\$').replace(/\*/g, '\\*').replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/\|/g, '\\|').replace(/\//g, '\\/'); - } - var pfwordl = autoMatch.pfwordl; - var sfwordl = autoMatch.sfwordl; - var RE_enable_a = pfwordl[name].enable; - var RE_maxPrefix = pfwordl[name].maxPrefix; - var RE_character_a = pfwordl[name].character; - var RE_enable_b = sfwordl[name].enable; - var RE_maxSubfix = sfwordl[name].maxSubfix; - var RE_character_b = sfwordl[name].character; - var plwords, slwords, rep; - plwords = RE_maxPrefix > 0 ? '[' + (RE_enable_a ? strMTE(RE_character_a.join('')) : '.') + ']{0,' + RE_maxPrefix + '}' : ''; - plwords = '^\\s*' + plwords; - slwords = RE_maxSubfix > 0 ? '[' + (RE_enable_b ? strMTE(RE_character_b.join('')) : '.') + ']{0,' + RE_maxSubfix + '}' : ''; - slwords = slwords + '\\s*$'; - rep = autoMatch.cases ? '' : 'i'; - for (var i = 0; i < pageKeyLength; i++) { - pageKey[i] = new RegExp(plwords + strMTE(pageKey[i]) + slwords, rep); - } - return pageKey; - } - - // 转成正则. - prePageKey = modifyPageKey('previous', prePageKey, prePageKey.length); - nextPageKey = modifyPageKey('next', nextPageKey, nextPageKey.length); - } - } - - // By lastDream2013 略加修改,原版只能用于 Firefox - function getRalativePageStr(lastUrl, currentUrl, nextUrl) { - var getRalativePageNumArray = function getRalativePageNumArray(lasturl, url) { - if (!lasturl || !url) { - return [0, 0]; - } - var lasturlarray = lasturl.split(/-|\.|\&|\/|=|#|\?/); - var urlarray = url.split(/-|\.|\&|\/|=|#|\?/); - var url_info; - var lasturl_info; - // 一些 url_info 为 p1,p2,p3 之类的 - var handleInfo = function handleInfo(s) { - if (s) { - return s.replace(/^p/, ''); - } - return s; - }; - while (urlarray.length !== 0) { - url_info = handleInfo(urlarray.pop()); - lasturl_info = handleInfo(lasturlarray.pop()); - if (url_info != lasturl_info) { - if (/[0-9]+/.test(url_info) && (url_info == '2' || /[0-9]+/.test(lasturl_info))) { - return [parseInt(lasturl_info) || 1, parseInt(url_info)]; - } - } - } - return [0, 0]; - }; - var relativeOff; - - // 论坛和搜索引擎网页显示实际页面信息 - var relativePageNumarray = []; - if (nextUrl) { - relativePageNumarray = getRalativePageNumArray(currentUrl, nextUrl); - } else { - relativePageNumarray = getRalativePageNumArray(lastUrl, currentUrl); - relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; // 用的上一页的相对信息比较的,要补充差值…… - relativePageNumarray[1] = relativePageNumarray[1] + relativeOff; - relativePageNumarray[0] = relativePageNumarray[0] + relativeOff; - } - - // console.log('[获取实际页数] ', '要比较的3个页数:',arguments, ',得到的差值:', relativePageNumarray); - if (isNaN(relativePageNumarray[0]) || isNaN(relativePageNumarray[1])) { - return ''; - } - var realPageSiteMatch = false; - relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; - // 上一页与下一页差值为1,并最大数值不超过10000(一般论坛也不会超过这么多页……) - if (relativeOff === 1 && relativePageNumarray[1] < 10000) { - realPageSiteMatch = true; - } - - // 上一页与下一页差值不为1,但上一页与下一页差值能被上一页与下一面所整除的,有规律的页面 - if (!realPageSiteMatch && relativeOff !== 1) { - if (relativePageNumarray[1] % relativeOff === 0 && relativePageNumarray[0] % relativeOff === 0) { - realPageSiteMatch = true; - } - } - if (!realPageSiteMatch) { - // 不满足以上条件,再根据地址特征来匹配 - var sitePattern; - for (var i = 0, length = REALPAGE_SITE_PATTERN.length; i < length; i++) { - sitePattern = REALPAGE_SITE_PATTERN[i]; - if (currentUrl.toLocaleLowerCase().indexOf(sitePattern) >= 0) { - realPageSiteMatch = true; - break; - } - } - } - var relativePageStr; - if (realPageSiteMatch) { - // 如果匹配就显示实际网页信息 - if (userLang === 'zh_CN') { - if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { - // 一般是搜索引擎的第xx - xx项…… - relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' 项 ]'; - } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { - // 一般的翻页数,差值应该是1 - relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' 页 ]'; - } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { - // 找不到的话…… - relativePageStr = ' [ 实际网页结束 ]'; - } - } else { - if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { - // 一般是搜索引擎的第xx - xx项…… - relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' ]'; - } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { - // 一般的翻页数,差值应该是1 - relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' ]'; - } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { - // 找不到的话…… - relativePageStr = ' [ Actual elements ends ]'; - } - } - } else { - relativePageStr = ''; - } - return relativePageStr || ''; - } - }).catch(function (err) { - console.log(err); - }); - - // ------------------------下面的不要管他----------------- - /// //////////////////////////////////////////////////////////////// - - // 变量 - var isHashchangeSite = false; - var hashchangeTimer = 0; - - // ==================== libs ============================== - /** - * - * @param {IHrefIncObject} obj obj - * @param {Document=} doc document - * @param {Window=} win window - * @param {string=} cplink cplink - * @returns {string} next link - * @description 地址栏递增处理函数 - */ - function hrefInc(obj, doc, win, cplink) { - var _cplink = cplink; - function getHref(href) { - var mFails = obj.mFails; - if (!mFails) return href; - var str; - if (typeof mFails === 'string') { - str = mFails; - } else { - var array = []; - for (var i = 0, ii = mFails.length; i < ii; i++) { - var fx = mFails[i]; - if (!fx) continue; - if (typeof fx !== 'string' || fx.indexOf('re;') === 0) { - var fxre = typeof fx === 'string' ? toRE(fx.slice(3)) : fx; - var mValue = href.match(fxre); - if (!mValue) return href; - array.push(mValue); - } else { - array.push(fx); - } - } - str = array.join(''); - } - return str; - } - var sa = obj.startAfter; - var index; - if (typeof sa === 'string') { - if (sa[0] == '#') { - _cplink = doc.location.href; - } - index = _cplink.indexOf(sa); - if (index == -1) { - _cplink = getHref(_cplink); - index = _cplink.indexOf(sa); - if (index == -1) return; - } - } else { - var tsa = _cplink.match(sa); - if (!tsa) { - _cplink = getHref(_cplink); - sa = (_cplink.match(sa) || [])[0]; - if (!sa) return; - index = _cplink.indexOf(sa); - if (index == -1) return; - } else { - sa = tsa[0]; - index = _cplink.indexOf(sa); - } - } - index += sa.length; - var max = obj.max === undefined ? 9999 : obj.max; - var min = obj.min === undefined ? 1 : obj.min; - var aStr = _cplink.slice(0, index); - var bStr = _cplink.slice(index); - var nbStr = bStr.replace(/^(\d+)(.*)$/, function (a, b, c) { - b = Number(b) + obj.inc; - if (b >= max || b < min) return a; - return b + c; - }); - if (nbStr !== bStr) { - var ilresult; - try { - ilresult = obj.isLast(doc, unsafeWindow, _cplink); - } catch (e) {} - if (ilresult) return; - return aStr + nbStr; - } - } - - // ==================== functions ============================== - function handleLazyImgSrc(rule, doc) { - var imgAttrs = rule.split('|'); - imgAttrs.forEach(function (attr) { - attr = attr.trim(); - [].forEach.call(doc.querySelectorAll('img[' + attr + ']'), function (img) { - var newSrc = img.getAttribute(attr); - if (newSrc && newSrc != img.src) { - img.setAttribute('src', newSrc); - img.removeAttribute(attr); - } - }); - }); - } - - /** - * - * @param {HTMLDocument} doc Document Fragment - * @param {String} scriptFilter Regex string - * @description Remove scripts node from doc - * @returns {void} - */ - function removeScripts(doc, scriptFilter) { - var scripts = getAllElements('css;script', doc); - var regFilter; - if (scriptFilter) { - regFilter = toRE(scriptFilter); - } - /** @type {HTMLScriptElement} */ - var scripts_x; - for (var i = scripts.length - 1; i >= 0; i--) { - //@ts-ignore - scripts_x = scripts[i]; - var iremove = false; - if (regFilter) { - if (scripts_x.hasOwnProperty('src')) { - if (!regFilter.test(scripts_x.src)) { - iremove = true; - } - } - if (scripts_x.text) { - if (!regFilter.test(scripts_x.text)) { - iremove = true; - } - } - if (iremove) { - scripts_x.parentNode.removeChild(scripts_x); - } - } else { - scripts_x.parentNode.removeChild(scripts_x); - } - } - } - - /** - * - * @param {string} str str - * @returns {HTMLDocument} document - */ - function createDocumentByString(str) { - // string转为DOM - if (!str) { - logger.error("[Super-preloader]", 'No string found to be converted to DOM'); - return; - } - if (document.documentElement.nodeName != 'HTML') { - return new DOMParser().parseFromString(str, 'application/xhtml+xml'); - } - /**@type {HTMLDocument} */ - var doc; - try { - // firefox and chrome 30+,Opera 12 会报错 - doc = new DOMParser().parseFromString(str, 'text/html'); - } catch (ex) {} - if (doc) { - return doc; - } - if (document.implementation.createHTMLDocument) { - doc = document.implementation.createHTMLDocument('superPreloader'); - } else { - try { - //@ts-ignore - doc = document.cloneNode(false); - doc.appendChild(doc.importNode(document.documentElement, false)); - doc.documentElement.appendChild(doc.createElement('head')); - doc.documentElement.appendChild(doc.createElement('body')); - } catch (e) {} - } - if (!doc) return; - var range = document.createRange(); - range.selectNodeContents(document.body); - var fragment = range.createContextualFragment(str); - doc.body.appendChild(fragment); - var headChildNames = { - TITLE: true, - META: true, - LINK: true, - STYLE: true, - BASE: true - }; - var child; - var body = doc.body; - var bchilds = body.childNodes; - for (var i = bchilds.length - 1; i >= 0; i--) { - // 移除head的子元素 - child = bchilds[i]; - if (headChildNames[child.nodeName]) body.removeChild(child); - } - return doc; - } - - /** - * - * @param {string|HTMLElement} href href - * @returns {string} href - * @description 从相对路径的a.href获取完全的href值. - */ - function getFullHref(href) { - // getAttribute may give relative url but href always give full url - if (typeof href !== 'string') href = href.getAttribute('href'); - - /** @type {HTMLAnchorElement} */ - // @ts-ignore - var a = getFullHref.a; - if (!a) { - //@ts-ignore - getFullHref.a = a = document.createElement('a'); - } - a.href = href; - return a.href; - } - function getFloatWindowWith() { - var el = document.getElementById('sp-fw-container'); - /** @type {HTMLElement} */ - //@ts-ignore - var elc = el.cloneNode(true); - elc.id = `${el.id}`; - elc.style.visibility = 'hidden'; - //@ts-ignore - elc.querySelector('#sp-fw-content').style.display = 'block'; - document.body.appendChild(elc); - //@ts-ignore - var width = elc.querySelector('#sp-fw-content').offsetWidth; - elc.remove(); - return width; - } - - /** - * Get next page link from an element - * @param {string | HTMLElement} elem nextlink element - * @returns {String} link of next page - */ - function elemToHref(elem) { - if (!elem) return undefined; - if (typeof elem === 'string' || elem.hasAttribute('href')) { - return getFullHref(elem); - } else { - // eslint-disable-next-line no-script-url - return 'javascript:void(0);'; // pseudo href - } - } - })(); - -})(); + iframe.addEventListener('load', function (e) { + //@ts-ignore + var body = e.currentTarget.contentDocument.body; + if (body && body.firstChild) { + floatWO.updateColor('prefetcher'); + floatWO.CmodeIcon('hide'); + floatWO.loadedIcon('show'); + //@ts-ignore + e.currentTarget.removeEventListener('load', arguments.callee, false); + if (SSS.lazyImgSrc) { + handleLazyImgSrc(SSS.lazyImgSrc, body); + } + } + }, false); + if (SSS.viewcontent) { + var container = cContainer(); + container.div.style.display = 'block'; + container.div2.innerHTML = 'iframe full prefetch: ' + '' + 'Prefetch URL: ' + '' + nextlink + ''; + iframe.height = '300px'; + container.div.appendChild(iframe); + } else { + document.body.appendChild(iframe); + } + } else { + var reqConf = { + headers: SSS.a_headers ? SSS.a_headers : { + Referer: cplink + } + }; + got.get(nextlink, reqConf).then(function (res) { + var doc = createDocumentByString(res.data); + if (!doc) { + logger.error("[Super-preloader]", 'Document object creation failed!'); + return; + } + if (SSS.lazyImgSrc) { + handleLazyImgSrc(SSS.lazyImgSrc, doc); + } + var images = doc.images; + var isl = images.length; + var img; + var iarray = []; + var i; + var existSRC = {}; + var isrc; + for (i = isl - 1; i >= 0; i--) { + isrc = images[i].getAttribute('src'); + if (!isrc || existSRC[isrc]) { + continue; + } else { + existSRC[isrc] = true; + } + img = document.createElement('img'); + img.src = isrc; + iarray.push(img); + } + var container = cContainer(); + var div = container.div; + i = iarray.length; + container.div2.innerHTML = 'Number of prefetched pictures: ' + '' + i + '' + '' + 'Prefetch URL:' + '' + nextlink + ''; + logger.info("[Super-preloader]", 'Number of prefetched pictures: ' + i + 'Prefetch URL: ' + nextlink); + for (i -= 1; i >= 0; i--) { + div.appendChild(iarray[i]); + } + if (SSS.viewcontent) { + container.div.style.display = 'block'; + } + floatWO.updateColor('prefetcher'); + floatWO.loadedIcon('show'); + floatWO.CmodeIcon('hide'); + }); + } + } + + // 执行开始../////////////////// + + // 分析黑名单 + var blackList_re = new RegExp(blackList.map(function (x) { + if (x.substring(0, 3).toLowerCase() == 're:') { + return x.substring(4); + } else { + return wildcardToRegExpStr(x); + } + }).join('|')); + if (blackList_re.test(url)) { + logger.debug("[Super-preloader]", 'Matched blacklist, JS execution stopped'); + return; + } + + // 是否在frame上加载.. + if (prefs.DisableI && window.self != window.parent) { + var isReturn = !_find(DIExclude, function (x) { + //@ts-ignore + return x[1] && x[2].test(url); + }); + if (isReturn) { + logger.debug("[Super-preloader]", `The page with url:${url} is not a top-level window, JS execution stopped`); + return; + } + } + logger.debug("[Super-preloader]", `Page url is: ${url}, JS loaded successfully`); + + // 第一阶段..分析高级模式.. + if (prefs.disableBuiltinRules) { + logger.warn("[Super-preloader]", 'Builtin js rules are disabled'); + } else { + SSRules = SSRules.concat(jsSiteRule); + } + if (prefs.disableBuiltinSubscriptionRules) { + logger.warn("[Super-preloader]", 'Remote json rules are disabled'); + } else { + SSRules = SSRules.concat(jsonRule); + } + if (!prefs.disableBuiltinRules) { + SSRules = SSRules.concat(jsGeneralRule); + } + if (!prefs.numOfRule || prefs.numOfRule != SSRules.length) { + prefs.numOfRule = SSRules.length; + GM.setValue('prefs', prefs); + } + + // 重要的变量两枚. + /** @type {Array} */ + var pagedLinks = [document.location.href]; + /** @type {HTMLElement|string} */ + var nextlinkElem; + /** @type {string} */ + var nextlink; + /** @type {HTMLElement|string} */ + var prelink; + + //= ============== + + /**@type {IRuntimeRule} */ + var SSS = {}; + var findCurSiteInfo = /*#__PURE__*/function () { + var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() { + var SIIAD, Rurl, ii, _loop, _ret, i, FA; + return _regeneratorRuntime.wrap(function _callee5$(_context6) { + while (1) switch (_context6.prev = _context6.next) { + case 0: + SIIAD = SITEINFO_D.autopager; + ii = SSRules.length; + if (userLang === 'zh_CN') { + logger.debug("[Super-preloader]", `高级规则数目:${ii}`); + logger.debug("[Super-preloader]", `Number of rules > ${ii - jsonRule.length} from other sources, such as: wedata.net`); + } else { + logger.debug("[Super-preloader]", `Number of advanced rules:${ii}`); + } + _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() { + var SII, SIIA, documentFilter, pageElement; + return _regeneratorRuntime.wrap(function _loop$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + SII = SSRules[i]; + if (!(SII.autopager && SII.autopager.ip)) { + _context5.next = 4; + break; + } + if (!(SII.autopager.ip.indexOf(serverIp) < 0)) { + _context5.next = 4; + break; + } + return _context5.abrupt("return", 0); + case 4: + Rurl = toRE(SII.url); + if (!Rurl.test(url)) { + _context5.next = 75; + break; + } + if (userLang === 'zh_CN') { + logger.debug("[Super-preloader]", 'Find current site rules:', SII); + logger.debug("[Super-preloader]", `规则ID: ${i + 1}`); + } else { + logger.debug("[Super-preloader]", 'Find rule for this website:', SII); + logger.debug("[Super-preloader]", `Rule ID: ${i + 1}`); + } + + // 运行规则的 startFilter + if (!(SII.autopager && SII.autopager.startFilter)) { + _context5.next = 17; + break; + } + _context5.prev = 8; + _context5.next = 11; + return SII.autopager.startFilter(document, window); + case 11: + logger.debug("[Super-preloader]", 'startFilter executed successfully'); + _context5.next = 17; + break; + case 14: + _context5.prev = 14; + _context5.t0 = _context5["catch"](8); + logger.error("[Super-preloader]", 'Error executing startFilter', _context5.t0); + case 17: + if (!(SII.nextLink === 'null;')) { + _context5.next = 21; + break; + } + logger.debug("[Super-preloader]", 'Find the rule for a site without nextpage', SII); + SSS.hasRule = false; + return _context5.abrupt("return", 1); + case 21: + nextlinkElem = getElement(SII.nextLink || 'auto;'); + if (nextlinkElem) { + _context5.next = 25; + break; + } + logger.warn("[Super-preloader]", 'Could not find the next page link, continue searching for other rules, skiping rule:', SII); + return _context5.abrupt("return", 0); + case 25: + // extract next page link from an a link + nextlink = getFullHref(nextlinkElem); + if (!(nextlink === document.location.href)) { + _context5.next = 29; + break; + } + nextlinkElem = null; + return _context5.abrupt("return", 0); + case 29: + if (SII.preLink && SII.preLink != 'auto;') { + // 如果设定了具体的preLink + prelink = getElement(SII.preLink); + } else { + if (prefs.autoGetPreLink) { + prelink = getElement('auto;'); + } + } + SSS = {}; + SSS.Rurl = String(Rurl); + SSS.nextLink = SII.nextLink || 'auto;'; + SSS.viewcontent = SII.viewcontent; + SSS.enable = SII.enable === undefined ? SITEINFO_D.enable : SII.enable; + SSS.useiframe = SII.useiframe === undefined ? SITEINFO_D.useiframe : SII.useiframe; + if (SII.pageElement) { + // 如果是Oautopager的规则.. + if (typeof SII.autopager !== 'object') SII.autopager = {}; + SII.autopager.pageElement = SII.pageElement; + if (!SII.autopager.useiframe) SII.autopager.useiframe = SII.useiframe; + if (SII.preLink) SII.autopager.preLink = SII.preLink; + if (SII.insertBefore) SII.autopager.HT_insert = [SII.insertBefore, 1]; + } + + // 自动翻页设置. + SIIA = SII.autopager; + if (!SIIA) { + _context5.next = 68; + break; + } + SSS.a_pageElement = SIIA.pageElement; + if (SSS.a_pageElement) { + _context5.next = 42; + break; + } + return _context5.abrupt("return", 1); + case 42: + SSS.a_manualA = SIIA.manualA === undefined ? SIIAD.manualA : SIIA.manualA; + SSS.a_enable = SIIA.enable === undefined ? SIIAD.enable : SIIA.enable; + SSS.a_useiframe = SIIA.useiframe === undefined ? SIIAD.useiframe : SIIA.useiframe; + SSS.a_mutationObserver = SSS.a_useiframe ? SIIA.mutationObserver === undefined ? null : SIIA.mutationObserver : null; + SSS.a_newIframe = SIIA.newIframe === undefined ? SIIAD.newIframe : SIIA.newIframe; + SSS.a_iloaded = SIIA.iloaded === undefined ? SIIAD.iloaded : SIIA.iloaded; + SSS.a_itimeout = SIIA.itimeout === undefined ? SIIAD.itimeout : SIIA.itimeout; + SSS.a_remain = SIIA.remain === undefined ? SIIAD.remain : SIIA.remain; + SSS.a_maxpage = SIIA.maxpage === undefined ? SIIAD.maxpage : SIIA.maxpage; + SSS.a_separator = SIIA.separator === undefined ? SIIAD.separator : SIIA.separator; + SSS.a_sepdivDom = SIIA.sepdivDom === undefined ? undefined : SIIA.sepdivDom; + SSS.a_separatorReal = SIIA.separatorReal === undefined ? SIIAD.separatorReal : SIIA.separatorReal; + SSS.a_replaceE = SIIA.replaceE; + SSS.a_HT_insert = SIIA.HT_insert; + SSS.a_relatedObj = SIIA.relatedObj === undefined ? SIIAD.relatedObj : SIIA.relatedObj; + SSS.a_ipages = SIIA.ipages === undefined ? SIIAD.ipages : SIIA.ipages; + + // new + SSS.filter = SII.filter || SIIA.filter; // 新增了函数的形式,原来的功能是移除 pageElement + documentFilter = SII.documentFilter || SIIA.documentFilter; + if (documentFilter === 'startFilter') { + SSS.a_documentFilter = function (doc) { + return SII.autopager.startFilter(doc); + }; + } else if (typeof documentFilter === 'function') { + SSS.a_documentFilter = documentFilter; + } else { + SSS.a_documentFilter = undefined; + } + SSS.a_scriptFilter = SIIA.scriptFilter === undefined ? '' : SIIA.scriptFilter; + SSS.a_stylish = SII.stylish || SIIA.stylish; + SSS.lazyImgSrc = SIIA.lazyImgSrc; + SSS.a_headers = SIIA.headers === undefined ? undefined : SIIA.headers; // custom header for XHRLoaded + SSS.a_reload = SIIA.reload === undefined ? SIIAD.reload : SIIA.reload; // force reload iframe + SSS.a_sandbox = SIIA.sandbox === undefined ? SIIAD.sandbox : SIIA.sandbox; + + // 在翻页的时候会有一些其他元素占据了页面的高度,导致翻页不精准。 + // 比如正文下面的推荐文章列表(占据超过整个页面10%就很难受) + SSS.a_excludeElement = SIIA.excludeElement; + case 68: + // 检验是否存在内容 + pageElement = getElement(SSS.a_pageElement); + if (!(!pageElement || Array.isArray(pageElement) && pageElement.length === 0)) { + _context5.next = 73; + break; + } + nextlinkElem = null; + logger.error("[Super-preloader]", 'Could not find content, skiping rule:', SII, 'Continue to search for other rules.'); + return _context5.abrupt("return", 0); + case 73: + SSS.hasRule = true; + return _context5.abrupt("return", 1); + case 75: + case "end": + return _context5.stop(); + } + }, _loop, null, [[8, 14]]); + }); + i = 0; + case 5: + if (!(i < ii)) { + _context6.next = 15; + break; + } + return _context6.delegateYield(_loop(), "t0", 7); + case 7: + _ret = _context6.t0; + if (!(_ret === 0)) { + _context6.next = 10; + break; + } + return _context6.abrupt("continue", 12); + case 10: + if (!(_ret === 1)) { + _context6.next = 12; + break; + } + return _context6.abrupt("break", 15); + case 12: + i++; + _context6.next = 5; + break; + case 15: + if (!SSS.hasRule) { + // 自动搜索. + if (!autoMatch.keyMatch) { + logger.warn("[Super-preloader]", 'Auto match is disabled'); + } else { + logger.warn("[Super-preloader]", 'No rules are found. Auto match starts'); + nextlinkElem = autoGetLink(); + if (nextlinkElem) { + // 强制模式. + FA = autoMatch.FA; + SSS.Rurl = window.localStorage ? 'am:' + (url.match(/^https?:\/\/[^:]*\//i) || [])[0] : 'am:automatch'; + SSS.enable = true; + SSS.nextLink = 'auto;'; + SSS.viewcontent = autoMatch.viewcontent; + SSS.useiframe = autoMatch.useiframe || SITEINFO_D.autopager.useiframe; + SSS.a_force = true; + SSS.a_manualA = FA.manualA; + SSS.a_enable = FA.enable || SITEINFO_D.autopager.force_enable; // Force join is enabled when this becomes true + SSS.a_useiframe = FA.useiframe || SITEINFO_D.useiframe; + SSS.a_iloaded = FA.iloaded; + SSS.a_itimeout = FA.itimeout; + SSS.a_remain = FA.remain; + SSS.a_maxpage = FA.maxpage; + SSS.a_separator = FA.separator; + SSS.a_ipages = FA.ipages; + } + } + } + + // 如果规则没 lazyImgSrc,设置默认值 + if (!SSS.lazyImgSrc) { + SSS.lazyImgSrc = prefs.lazyImgSrc; + } + logger.debug("[Super-preloader]", `Total time spent on searching for advanced rules and automatic matching: ${new Date().getTime() - startTime.getTime()}ms`); + case 18: + case "end": + return _context6.stop(); + } + }, _callee5); + })); + return function findCurSiteInfo() { + return _ref5.apply(this, arguments); + }; + }(); + findCurSiteInfo().then(function () { + // 上下页都没有找到啊 + if (!nextlinkElem && !prelink) { + logger.warn("[Super-preloader]", `No related links found, JS execution stopped. Total time spent: ${new Date().getTime() - startTime.getTime()}ms`); + return; + } else if (!nextlink) { + logger.error("[Super-preloader]", 'The link to the next page does not exist, JS cannot continue.'); + logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); + return; + } else { + logger.debug("[Super-preloader]", 'Previous link element:', prelink); + logger.debug("[Super-preloader]", 'Next link element:', nextlinkElem); + nextlink = elemToHref(nextlinkElem); + logger.debug("[Super-preloader]", 'Next link:', nextlink); + //@ts-ignore + prelink = prelink ? prelink.href || prelink : undefined; + } + var keyBinding = { + go: function go() { + if (typeof nextlink === 'string') window.location.href = nextlink; + }, + back: function back() { + //fixme + if (!prelink) getElement('auto;'); + if (typeof prelink === 'string') window.location.href = prelink; + }, + register: function register( /**@type {IPrefs} */prefs) { + var _this = this; + if (prefs.arrowKeyPage) { + logger.debug("[Super-preloader]", 'Adding left and right arrow keys to autopager listener.'); + document.addEventListener('keyup', function (e) { + //@ts-ignore + var tarNN = e.target.nodeName; + if (tarNN != 'BODY' && tarNN != 'HTML') return; + + // check is a combo pressed + if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) { + return; + } + switch (e.keyCode) { + case 37: + _this.back(); + break; + case 39: + _this.go(); + break; + } + }, false); + + // 监听下一页事件. + logger.debug("[Super-preloader]", '添加鼠标手势翻页监听'); + document.addEventListener('superPreloader.go', function () { + _this.go(); + }, false); + + // 监听下一页事件. + document.addEventListener('superPreloader.back', function () { + _this.back(); + }, false); + } + } + }; + keyBinding.register(prefs); + loadLocalSetting(SSS); + if (!SSS.enable) { + logger.warn("[Super-preloader]", 'This rule is disabled, script execution is stopped'); + logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); + return; + } + if (!SSS.hasRule) { + SSS.a_force = true; + } + if (SSS.a_force) { + SSS.a_pageElement = '//body/*'; + SSS.a_HT_insert = undefined; + SSS.a_relatedObj = undefined; + } + if (prefs.floatWindow) { + logger.debug("[Super-preloader]", 'Creating a floating window'); + floatWindow(SSS); + var floatWindowWidth = getFloatWindowWith(); + displace(document.getElementById('sp-fw-container'), { + handle: document.getElementById('sp-fw-rect'), + customMove: function customMove(el, x, y) { + delete el.style.left; + delete el.style.bottom; + var right = document.body.clientWidth - floatWindowWidth - x; + if (right < 0) { + right = 0; + } else if (right > window.innerWidth - floatWindowWidth) { + right = window.innerWidth - floatWindowWidth; + } + var top = y; + if (top > window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight) { + top = window.innerHeight - document.getElementById('sp-fw-rect').scrollHeight; + } else if (top < 0) { + top = 0; + } + el.style.right = `${right}px`; + el.style.top = `${top}px`; + }, + onMouseUp: function onMouseUp(el) { + prefs.FW_offset[0] = parseInt(el.style.top.replace('px', ''), 10); + prefs.FW_offset[1] = parseInt(el.style.right.replace('px', ''), 10); + prefs.FW_position = 2; + GM.setValue('prefs', prefs); + } + }); + document.getElementById('sp-fw-container').style.position = 'fixed'; + } + logger.debug("[Super-preloader]", `Total time spent:${new Date().getTime() - startTime.getTime()}ms`); + + // 预读或者翻页. + if (SSS.a_enable) { + logger.debug("[Super-preloader]", 'Initializing, autopager mode.'); + autopager(SSS, floatWO); + } else { + logger.debug("[Super-preloader]", 'Initializing, prefetch mode.'); + prefetcher(SSS, floatWO); + } + }); + + // 获取单个元素,混合 + /** + * + * @param {string|Function|Array|IHrefIncObject} selector selector + * @param {HTMLElement|Document=} contextNode element + * @param {Document=} doc document + * @param {Window=} win window + * @returns {HTMLElement} element + */ + function getElement(selector, contextNode, doc, win) { + var _cplink = cplink; + var ret; + if (!selector) return ret; + doc = doc || document; + win = win || window; + contextNode = contextNode || doc; + if (typeof selector === 'string') { + if (selector.search(/^css;/i) === 0) { + ret = getElementByCSS(selector.slice(4), contextNode); + } else if (selector.toLowerCase() == 'auto;') { + ret = autoGetLink(doc); + } else { + ret = getElementByXpath(selector, contextNode, doc); + } + } else if (typeof selector === 'function') { + ret = selector(doc, win, _cplink); + } else if (selector instanceof Array) { + for (var i = 0, l = selector.length; i < l; i++) { + ret = getElement(selector[i], contextNode, doc, win); + if (ret) { + break; + } + } + } else { + ret = hrefInc(selector, doc, win, _cplink); + } + return ret; + } + var docChecked; + /** + * + * @param {Document=} doc document + * @param {Window=} win window + * @returns {HTMLElement} a + */ + function autoGetLink(doc, win) { + if (!autoMatch.keyMatch) return; + //@ts-ignore + if (!parseKWRE.done) { + parseKWRE(); + //@ts-ignore + parseKWRE.done = true; + } + var startTime = new Date(); + doc = doc || document; + if (doc == document) { + // 当前文档,只检查一次. + if (docChecked) { + // @ts-ignore + return nextlink; + } + docChecked = true; + } + var _prePageKey = prePageKey; + var _nextPageKey = nextPageKey; + var _nPKL = nextPageKey.length; + var _pPKL = prePageKey.length; + var _getFullHref = getFullHref; + var _getAllElementsByXpath = getAllElementsByXpath; + var _Number = Number; + var _domain_port = domain_port; + var alllinks = doc.links; + var alllinksl = alllinks.length; + var curLHref = cplink; + var _nextlink; + var _prelink; + //@ts-ignore + if (!autoGetLink.checked) { + // 第一次检查 + _nextlink = nextlink; + _prelink = prelink; + } else { + _prelink = true; + } + var DCEnable = autoMatch.digitalCheck; + var DCRE = /^\s*\D{0,1}(\d+)\D{0,1}\s*$/; + var i, a, atext, numtext; + var aP; + var initSD; + var searchD = 1; + var preS1; + var preS2; + var searchedD; + var pSNText; + var preSS; + var nodeType; + var nextS1, nextS2, nSNText, nextSS; + var aimgs, j, jj, aimg_x, xbreak, k, keytext; + function finalCheck(a, type) { + var ahref = a.getAttribute('href'); // 在chrome上当是非当前页面文档对象的时候直接用a.href访问,不返回href + if (ahref == '#') { + return null; + } + ahref = _getFullHref(ahref); // 从相对路径获取完全的href; + + // 3个条件:http协议链接,非跳到当前页面的链接,非跨域 + if (/^https?:/i.test(ahref) && ahref.replace(/#.*$/, '') != curLHref && ahref.match(/https?:\/\/([^\/]+)/)[1] == _domain_port) { + logger.debug("[Super-preloader]", type == 'pre' ? 'previous' : 'next' + 'match:', atext); + return a; // 返回对象A + // return ahref; + } + } + logger.debug("[Super-preloader]", `Number of full document links:${alllinksl}`); + for (i = 0; i < alllinksl; i++) { + if (_nextlink && _prelink) break; + a = alllinks[i]; + if (!a) continue; // undefined跳过 + // links集合返回的本来就是包含href的a元素..所以不用检测 + // if(!a.hasAttribute("href"))continue; + atext = a.textContent; + if (atext) { + if (DCEnable) { + numtext = atext.match(DCRE); + if (numtext) { + // 是不是纯数字 + // debug(numtext); + numtext = numtext[1]; + aP = a; + initSD = 0; + if (!_nextlink) { + preS1 = a.previousSibling; + preS2 = a.previousElementSibling; + while (!(preS1 || preS2) && initSD < searchD) { + aP = aP.parentNode; + if (aP) { + preS1 = aP.previousSibling; + //@ts-ignore + preS2 = aP.previousElementSibling; + } + initSD++; + } + searchedD = initSD > 0; + if (preS1 || preS2) { + pSNText = preS1 ? preS1.textContent.match(DCRE) : ''; + if (pSNText) { + preSS = preS1; + } else { + pSNText = preS2 ? preS2.textContent.match(DCRE) : ''; + preSS = preS2; + } + if (pSNText) { + pSNText = pSNText[1]; + if (_Number(pSNText) == _Number(numtext) - 1) { + nodeType = preSS.nodeType; + if (nodeType == 3 || nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', preSS, doc).length === 0 : !preSS.hasAttribute('href') || _getFullHref(preSS.getAttribute('href')) == curLHref)) { + _nextlink = finalCheck(a, 'next'); + } + continue; + } + } + } + } + if (!_prelink) { + nextS1 = a.nextSibling; + nextS2 = a.nextElementSibling; + while (!(nextS1 || nextS2) && initSD < searchD) { + aP = aP.parentNode; + if (aP) { + nextS1 = a.nextSibling; + nextS2 = a.nextElementSibling; + } + initSD++; + } + searchedD = initSD > 0; + if (nextS1 || nextS2) { + nSNText = nextS1 ? nextS1.textContent.match(DCRE) : ''; + if (nSNText) { + nextSS = nextS1; + } else { + nSNText = nextS2 ? nextS2.textContent.match(DCRE) : ''; + nextSS = nextS2; + } + if (nSNText) { + nSNText = nSNText[1]; + if (_Number(nSNText) == _Number(numtext) + 1) { + nodeType = nextSS.nodeType; + if (nodeType == 3 || + // @ts-ignore + nodeType == 1 && (searchedD ? _getAllElementsByXpath('./descendant-or-self::a[@href]', nextSS, doc).length === 0 : !nextSS.hasAttribute('href') || _getFullHref(nextSS.getAttribute('href')) == curLHref)) { + _prelink = finalCheck(a, 'pre'); + } + } + } + } + } + continue; + } + } + } else { + atext = a.title; + } + if (!atext) { + aimgs = a.getElementsByTagName('img'); + for (j = 0, jj = aimgs.length; j < jj; j++) { + aimg_x = aimgs[j]; + atext = aimg_x.alt || aimg_x.title; + if (atext) break; + } + } + if (!atext) continue; + if (!_nextlink) { + xbreak = false; + for (k = 0; k < _nPKL; k++) { + keytext = _nextPageKey[k]; + //@ts-ignore + if (!keytext.test(atext)) continue; + _nextlink = finalCheck(a, 'next'); + xbreak = true; + break; + } + if (xbreak || _nextlink) continue; + } + if (!_prelink) { + for (k = 0; k < _pPKL; k++) { + keytext = _prePageKey[k]; + //@ts-ignore + if (!keytext.test(atext)) continue; + _prelink = finalCheck(a, 'pre'); + break; + } + } + } + logger.debug("[Super-preloader]", `Time to search ${i} links:${new Date().getTime() - startTime.getTime()}ms`); + //@ts-ignore + if (!autoGetLink.checked) { + // 只在第一次检测的时候,抛出上一页链接. + prelink = _prelink; + //@ts-ignore + autoGetLink.checked = true; + } + return _nextlink; + } + function parseKWRE() { + function modifyPageKey(name, pageKey, pageKeyLength) { + function strMTE(str) { + return str.replace(/\\/g, '\\\\').replace(/\+/g, '\\+').replace(/\./g, '\\.').replace(/\?/g, '\\?').replace(/\{/g, '\\{').replace(/\}/g, '\\}').replace(/\[/g, '\\[').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/\$/g, '\\$').replace(/\*/g, '\\*').replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/\|/g, '\\|').replace(/\//g, '\\/'); + } + var pfwordl = autoMatch.pfwordl; + var sfwordl = autoMatch.sfwordl; + var RE_enable_a = pfwordl[name].enable; + var RE_maxPrefix = pfwordl[name].maxPrefix; + var RE_character_a = pfwordl[name].character; + var RE_enable_b = sfwordl[name].enable; + var RE_maxSubfix = sfwordl[name].maxSubfix; + var RE_character_b = sfwordl[name].character; + var plwords, slwords, rep; + plwords = RE_maxPrefix > 0 ? '[' + (RE_enable_a ? strMTE(RE_character_a.join('')) : '.') + ']{0,' + RE_maxPrefix + '}' : ''; + plwords = '^\\s*' + plwords; + slwords = RE_maxSubfix > 0 ? '[' + (RE_enable_b ? strMTE(RE_character_b.join('')) : '.') + ']{0,' + RE_maxSubfix + '}' : ''; + slwords = slwords + '\\s*$'; + rep = autoMatch.cases ? '' : 'i'; + for (var i = 0; i < pageKeyLength; i++) { + pageKey[i] = new RegExp(plwords + strMTE(pageKey[i]) + slwords, rep); + } + return pageKey; + } + + // 转成正则. + prePageKey = modifyPageKey('previous', prePageKey, prePageKey.length); + nextPageKey = modifyPageKey('next', nextPageKey, nextPageKey.length); + } + } + + // By lastDream2013 略加修改,原版只能用于 Firefox + function getRalativePageStr(lastUrl, currentUrl, nextUrl) { + var getRalativePageNumArray = function getRalativePageNumArray(lasturl, url) { + if (!lasturl || !url) { + return [0, 0]; + } + var lasturlarray = lasturl.split(/-|\.|\&|\/|=|#|\?/); + var urlarray = url.split(/-|\.|\&|\/|=|#|\?/); + var url_info; + var lasturl_info; + // 一些 url_info 为 p1,p2,p3 之类的 + var handleInfo = function handleInfo(s) { + if (s) { + return s.replace(/^p/, ''); + } + return s; + }; + while (urlarray.length !== 0) { + url_info = handleInfo(urlarray.pop()); + lasturl_info = handleInfo(lasturlarray.pop()); + if (url_info != lasturl_info) { + if (/[0-9]+/.test(url_info) && (url_info == '2' || /[0-9]+/.test(lasturl_info))) { + return [parseInt(lasturl_info) || 1, parseInt(url_info)]; + } + } + } + return [0, 0]; + }; + var relativeOff; + + // 论坛和搜索引擎网页显示实际页面信息 + var relativePageNumarray = []; + if (nextUrl) { + relativePageNumarray = getRalativePageNumArray(currentUrl, nextUrl); + } else { + relativePageNumarray = getRalativePageNumArray(lastUrl, currentUrl); + relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; // 用的上一页的相对信息比较的,要补充差值…… + relativePageNumarray[1] = relativePageNumarray[1] + relativeOff; + relativePageNumarray[0] = relativePageNumarray[0] + relativeOff; + } + + // console.log('[获取实际页数] ', '要比较的3个页数:',arguments, ',得到的差值:', relativePageNumarray); + if (isNaN(relativePageNumarray[0]) || isNaN(relativePageNumarray[1])) { + return ''; + } + var realPageSiteMatch = false; + relativeOff = relativePageNumarray[1] - relativePageNumarray[0]; + // 上一页与下一页差值为1,并最大数值不超过10000(一般论坛也不会超过这么多页……) + if (relativeOff === 1 && relativePageNumarray[1] < 10000) { + realPageSiteMatch = true; + } + + // 上一页与下一页差值不为1,但上一页与下一页差值能被上一页与下一面所整除的,有规律的页面 + if (!realPageSiteMatch && relativeOff !== 1) { + if (relativePageNumarray[1] % relativeOff === 0 && relativePageNumarray[0] % relativeOff === 0) { + realPageSiteMatch = true; + } + } + if (!realPageSiteMatch) { + // 不满足以上条件,再根据地址特征来匹配 + var sitePattern; + for (var i = 0, length = REALPAGE_SITE_PATTERN.length; i < length; i++) { + sitePattern = REALPAGE_SITE_PATTERN[i]; + if (currentUrl.toLocaleLowerCase().indexOf(sitePattern) >= 0) { + realPageSiteMatch = true; + break; + } + } + } + var relativePageStr; + if (realPageSiteMatch) { + // 如果匹配就显示实际网页信息 + if (userLang === 'zh_CN') { + if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { + // 一般是搜索引擎的第xx - xx项…… + relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' 项 ]'; + } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { + // 一般的翻页数,差值应该是1 + relativePageStr = ' [ 实际:第 ' + relativePageNumarray[0] + ' 页 ]'; + } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { + // 找不到的话…… + relativePageStr = ' [ 实际网页结束 ]'; + } + } else { + if (relativePageNumarray[1] - relativePageNumarray[0] > 1) { + // 一般是搜索引擎的第xx - xx项…… + relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' - ' + relativePageNumarray[1] + ' ]'; + } else if (relativePageNumarray[1] - relativePageNumarray[0] === 1) { + // 一般的翻页数,差值应该是1 + relativePageStr = ' [ Actual elements/pages: ' + relativePageNumarray[0] + ' ]'; + } else if ((relativePageNumarray[0] === 0 && relativePageNumarray[1]) === 0) { + // 找不到的话…… + relativePageStr = ' [ Actual elements ends ]'; + } + } + } else { + relativePageStr = ''; + } + return relativePageStr || ''; + } + }).catch(function (err) { + console.log(err); + }); + + // ------------------------下面的不要管他----------------- + /// //////////////////////////////////////////////////////////////// + + // 变量 + var isHashchangeSite = false; + var hashchangeTimer = 0; + + // ==================== libs ============================== + /** + * + * @param {IHrefIncObject} obj obj + * @param {Document=} doc document + * @param {Window=} win window + * @param {string=} cplink cplink + * @returns {string} next link + * @description 地址栏递增处理函数 + */ + function hrefInc(obj, doc, win, cplink) { + var _cplink = cplink; + function getHref(href) { + var mFails = obj.mFails; + if (!mFails) return href; + var str; + if (typeof mFails === 'string') { + str = mFails; + } else { + var array = []; + for (var i = 0, ii = mFails.length; i < ii; i++) { + var fx = mFails[i]; + if (!fx) continue; + if (typeof fx !== 'string' || fx.indexOf('re;') === 0) { + var fxre = typeof fx === 'string' ? toRE(fx.slice(3)) : fx; + var mValue = href.match(fxre); + if (!mValue) return href; + array.push(mValue); + } else { + array.push(fx); + } + } + str = array.join(''); + } + return str; + } + var sa = obj.startAfter; + var index; + if (typeof sa === 'string') { + if (sa[0] == '#') { + _cplink = doc.location.href; + } + index = _cplink.indexOf(sa); + if (index == -1) { + _cplink = getHref(_cplink); + index = _cplink.indexOf(sa); + if (index == -1) return; + } + } else { + var tsa = _cplink.match(sa); + if (!tsa) { + _cplink = getHref(_cplink); + sa = (_cplink.match(sa) || [])[0]; + if (!sa) return; + index = _cplink.indexOf(sa); + if (index == -1) return; + } else { + sa = tsa[0]; + index = _cplink.indexOf(sa); + } + } + index += sa.length; + var max = obj.max === undefined ? 9999 : obj.max; + var min = obj.min === undefined ? 1 : obj.min; + var aStr = _cplink.slice(0, index); + var bStr = _cplink.slice(index); + var nbStr = bStr.replace(/^(\d+)(.*)$/, function (a, b, c) { + b = Number(b) + obj.inc; + if (b >= max || b < min) return a; + return b + c; + }); + if (nbStr !== bStr) { + var ilresult; + try { + ilresult = obj.isLast(doc, unsafeWindow, _cplink); + } catch (e) {} + if (ilresult) return; + return aStr + nbStr; + } + } + + // ==================== functions ============================== + function handleLazyImgSrc(rule, doc) { + var imgAttrs = rule.split('|'); + imgAttrs.forEach(function (attr) { + attr = attr.trim(); + [].forEach.call(doc.querySelectorAll('img[' + attr + ']'), function (img) { + var newSrc = img.getAttribute(attr); + if (newSrc && newSrc != img.src) { + img.setAttribute('src', newSrc); + img.removeAttribute(attr); + } + }); + }); + } + + /** + * + * @param {HTMLDocument} doc Document Fragment + * @param {String} scriptFilter Regex string + * @description Remove scripts node from doc + * @returns {void} + */ + function removeScripts(doc, scriptFilter) { + var scripts = getAllElements('css;script', doc); + var regFilter; + if (scriptFilter) { + regFilter = toRE(scriptFilter); + } + /** @type {HTMLScriptElement} */ + var scripts_x; + for (var i = scripts.length - 1; i >= 0; i--) { + //@ts-ignore + scripts_x = scripts[i]; + var iremove = false; + if (regFilter) { + if (scripts_x.hasOwnProperty('src')) { + if (!regFilter.test(scripts_x.src)) { + iremove = true; + } + } + if (scripts_x.text) { + if (!regFilter.test(scripts_x.text)) { + iremove = true; + } + } + if (iremove) { + scripts_x.parentNode.removeChild(scripts_x); + } + } else { + scripts_x.parentNode.removeChild(scripts_x); + } + } + } + + /** + * + * @param {string} str str + * @returns {HTMLDocument} document + */ + function createDocumentByString(str) { + // string转为DOM + if (!str) { + logger.error("[Super-preloader]", 'No string found to be converted to DOM'); + return; + } + if (document.documentElement.nodeName != 'HTML') { + return new DOMParser().parseFromString(str, 'application/xhtml+xml'); + } + /**@type {HTMLDocument} */ + var doc; + try { + // firefox and chrome 30+,Opera 12 会报错 + doc = new DOMParser().parseFromString(str, 'text/html'); + } catch (ex) {} + if (doc) { + return doc; + } + if (document.implementation.createHTMLDocument) { + doc = document.implementation.createHTMLDocument('superPreloader'); + } else { + try { + //@ts-ignore + doc = document.cloneNode(false); + doc.appendChild(doc.importNode(document.documentElement, false)); + doc.documentElement.appendChild(doc.createElement('head')); + doc.documentElement.appendChild(doc.createElement('body')); + } catch (e) {} + } + if (!doc) return; + var range = document.createRange(); + range.selectNodeContents(document.body); + var fragment = range.createContextualFragment(str); + doc.body.appendChild(fragment); + var headChildNames = { + TITLE: true, + META: true, + LINK: true, + STYLE: true, + BASE: true + }; + var child; + var body = doc.body; + var bchilds = body.childNodes; + for (var i = bchilds.length - 1; i >= 0; i--) { + // 移除head的子元素 + child = bchilds[i]; + if (headChildNames[child.nodeName]) body.removeChild(child); + } + return doc; + } + + /** + * + * @param {string|HTMLElement} href href + * @returns {string} href + * @description 从相对路径的a.href获取完全的href值. + */ + function getFullHref(href) { + // getAttribute may give relative url but href always give full url + if (typeof href !== 'string') href = href.getAttribute('href'); + + /** @type {HTMLAnchorElement} */ + // @ts-ignore + var a = getFullHref.a; + if (!a) { + //@ts-ignore + getFullHref.a = a = document.createElement('a'); + } + a.href = href; + return a.href; + } + function getFloatWindowWith() { + var el = document.getElementById('sp-fw-container'); + /** @type {HTMLElement} */ + //@ts-ignore + var elc = el.cloneNode(true); + elc.id = `${el.id}`; + elc.style.visibility = 'hidden'; + //@ts-ignore + elc.querySelector('#sp-fw-content').style.display = 'block'; + document.body.appendChild(elc); + //@ts-ignore + var width = elc.querySelector('#sp-fw-content').offsetWidth; + elc.remove(); + return width; + } + + /** + * Get next page link from an element + * @param {string | HTMLElement} elem nextlink element + * @returns {String} link of next page + */ + function elemToHref(elem) { + if (!elem) return undefined; + if (typeof elem === 'string' || elem.hasAttribute('href')) { + return getFullHref(elem); + } else { + // eslint-disable-next-line no-script-url + return 'javascript:void(0);'; // pseudo href + } + } + })(); + +})(_asyncToGenerator, _slicedToArray, _regeneratorRuntime, _defineProperty$1); diff --git a/assets/app.1gO23e7I.js b/assets/app.1gO23e7I.js new file mode 100644 index 000000000..555572cfc --- /dev/null +++ b/assets/app.1gO23e7I.js @@ -0,0 +1 @@ +import{R as i}from"./chunks/theme.Bw3nEMJ8.js";import{U as o,a2 as u,a3 as c,a4 as l,a5 as f,a6 as d,a7 as m,a8 as h,a9 as g,aa as A,ab as y,d as P,u as v,k as w,y as C,ac as R,ad as b,ae as E,af as S}from"./chunks/framework.qh4ipt1c.js";function p(e){if(e.extends){const a=p(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=p(i),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return w(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),b(),E(),s.setup&&s.setup(),()=>S(s.Layout)}});async function D(){globalThis.__VITEPRESS__=!0;const e=j(),a=_();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function _(){return g(T)}function j(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&D().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{D as createApp}; diff --git a/assets/baidu.BzHzvwzy.png b/assets/baidu.BzHzvwzy.png new file mode 100644 index 000000000..819acced1 Binary files /dev/null and b/assets/baidu.BzHzvwzy.png differ diff --git a/assets/chunks/framework.qh4ipt1c.js b/assets/chunks/framework.qh4ipt1c.js new file mode 100644 index 000000000..f6bf13a82 --- /dev/null +++ b/assets/chunks/framework.qh4ipt1c.js @@ -0,0 +1,17 @@ +/** +* @vue/shared v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function us(e,t){const n=new Set(e.split(","));return t?s=>n.has(s.toLowerCase()):s=>n.has(s)}const te={},gt=[],xe=()=>{},oo=()=>!1,Dt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ds=e=>e.startsWith("onUpdate:"),re=Object.assign,hs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lo=Object.prototype.hasOwnProperty,Y=(e,t)=>lo.call(e,t),U=Array.isArray,mt=e=>mn(e)==="[object Map]",Ir=e=>mn(e)==="[object Set]",k=e=>typeof e=="function",se=e=>typeof e=="string",ft=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",Lr=e=>(Z(e)||k(e))&&k(e.then)&&k(e.catch),Mr=Object.prototype.toString,mn=e=>Mr.call(e),co=e=>mn(e).slice(8,-1),Nr=e=>mn(e)==="[object Object]",ps=e=>se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,_t=us(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),_n=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ao=/-(\w)/g,Pe=_n(e=>e.replace(ao,(t,n)=>n?n.toUpperCase():"")),fo=/\B([A-Z])/g,ut=_n(e=>e.replace(fo,"-$1").toLowerCase()),yn=_n(e=>e.charAt(0).toUpperCase()+e.slice(1)),nn=_n(e=>e?`on${yn(e)}`:""),Je=(e,t)=>!Object.is(e,t),Fn=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},uo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ho=e=>{const t=se(e)?Number(e):NaN;return isNaN(t)?e:t};let Ds;const Fr=()=>Ds||(Ds=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function gs(e){if(U(e)){const t={};for(let n=0;n{if(n){const s=n.split(go);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ms(e){let t="";if(se(e))t=e;else if(U(e))for(let n=0;nse(e)?e:e==null?"":U(e)||Z(e)&&(e.toString===Mr||!k(e.toString))?JSON.stringify(e,$r,2):String(e),$r=(e,t)=>t&&t.__v_isRef?$r(e,t.value):mt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[Hn(s,i)+" =>"]=r,n),{})}:Ir(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Hn(n))}:ft(t)?Hn(t):Z(t)&&!U(t)&&!Nr(t)?String(t):t,Hn=(e,t="")=>{var n;return ft(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let we;class vo{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=we,!t&&we&&(this.index=(we.scopes||(we.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=we;try{return we=this,t()}finally{we=n}}}on(){we=this}off(){we=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),et()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=ze,n=lt;try{return ze=!0,lt=this,this._runnings++,Vs(this),this.fn()}finally{Us(this),this._runnings--,lt=n,ze=t}}stop(){this.active&&(Vs(this),Us(this),this.onStop&&this.onStop(),this.active=!1)}}function Co(e){return e.value}function Vs(e){e._trackId++,e._depsLength=0}function Us(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},cn=new WeakMap,ct=Symbol(""),ts=Symbol("");function be(e,t,n){if(ze&<){let s=cn.get(e);s||cn.set(e,s=new Map);let r=s.get(n);r||s.set(n,r=Kr(()=>s.delete(n))),Ur(lt,r)}}function $e(e,t,n,s,r,i){const o=cn.get(e);if(!o)return;let l=[];if(t==="clear")l=[...o.values()];else if(n==="length"&&U(e)){const c=Number(s);o.forEach((f,d)=>{(d==="length"||!ft(d)&&d>=c)&&l.push(f)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":U(e)?ps(n)&&l.push(o.get("length")):(l.push(o.get(ct)),mt(e)&&l.push(o.get(ts)));break;case"delete":U(e)||(l.push(o.get(ct)),mt(e)&&l.push(o.get(ts)));break;case"set":mt(e)&&l.push(o.get(ct));break}ys();for(const c of l)c&&Br(c,4);bs()}function xo(e,t){const n=cn.get(e);return n&&n.get(t)}const So=us("__proto__,__v_isRef,__isVue"),kr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ft)),Bs=To();function To(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=J(this);for(let i=0,o=this.length;i{e[t]=function(...n){Ze(),ys();const s=J(this)[t].apply(this,n);return bs(),et(),s}}),e}function Ao(e){ft(e)||(e=String(e));const t=J(this);return be(t,"has",e),t.hasOwnProperty(e)}class Wr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Vo:Xr:i?zr:Gr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=U(t);if(!r){if(o&&Y(Bs,n))return Reflect.get(Bs,n,s);if(n==="hasOwnProperty")return Ao}const l=Reflect.get(t,n,s);return(ft(n)?kr.has(n):So(n))||(r||be(t,"get",n),i)?l:he(l)?o&&ps(n)?l:l.value:Z(l)?r?wn(l):vn(l):l}}class qr extends Wr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const c=Nt(i);if(!an(s)&&!Nt(s)&&(i=J(i),s=J(s)),!U(t)&&he(i)&&!he(s))return c?!1:(i.value=s,!0)}const o=U(t)&&ps(n)?Number(n)e,bn=e=>Reflect.getPrototypeOf(e);function Kt(e,t,n=!1,s=!1){e=e.__v_raw;const r=J(e),i=J(t);n||(Je(t,i)&&be(r,"get",t),be(r,"get",i));const{has:o}=bn(r),l=s?vs:n?Cs:Pt;if(o.call(r,t))return l(e.get(t));if(o.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function kt(e,t=!1){const n=this.__v_raw,s=J(n),r=J(e);return t||(Je(e,r)&&be(s,"has",e),be(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function Wt(e,t=!1){return e=e.__v_raw,!t&&be(J(e),"iterate",ct),Reflect.get(e,"size",e)}function Ks(e){e=J(e);const t=J(this);return bn(t).has.call(t,e)||(t.add(e),$e(t,"add",e,e)),this}function ks(e,t){t=J(t);const n=J(this),{has:s,get:r}=bn(n);let i=s.call(n,e);i||(e=J(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?Je(t,o)&&$e(n,"set",e,t):$e(n,"add",e,t),this}function Ws(e){const t=J(this),{has:n,get:s}=bn(t);let r=n.call(t,e);r||(e=J(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&$e(t,"delete",e,void 0),i}function qs(){const e=J(this),t=e.size!==0,n=e.clear();return t&&$e(e,"clear",void 0,void 0),n}function qt(e,t){return function(s,r){const i=this,o=i.__v_raw,l=J(o),c=t?vs:e?Cs:Pt;return!e&&be(l,"iterate",ct),o.forEach((f,d)=>s.call(r,c(f),c(d),i))}}function Gt(e,t,n){return function(...s){const r=this.__v_raw,i=J(r),o=mt(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,f=r[e](...s),d=n?vs:t?Cs:Pt;return!t&&be(i,"iterate",c?ts:ct),{next(){const{value:h,done:b}=f.next();return b?{value:h,done:b}:{value:l?[d(h[0]),d(h[1])]:d(h),done:b}},[Symbol.iterator](){return this}}}}function Ve(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Mo(){const e={get(i){return Kt(this,i)},get size(){return Wt(this)},has:kt,add:Ks,set:ks,delete:Ws,clear:qs,forEach:qt(!1,!1)},t={get(i){return Kt(this,i,!1,!0)},get size(){return Wt(this)},has:kt,add:Ks,set:ks,delete:Ws,clear:qs,forEach:qt(!1,!0)},n={get(i){return Kt(this,i,!0)},get size(){return Wt(this,!0)},has(i){return kt.call(this,i,!0)},add:Ve("add"),set:Ve("set"),delete:Ve("delete"),clear:Ve("clear"),forEach:qt(!0,!1)},s={get(i){return Kt(this,i,!0,!0)},get size(){return Wt(this,!0)},has(i){return kt.call(this,i,!0)},add:Ve("add"),set:Ve("set"),delete:Ve("delete"),clear:Ve("clear"),forEach:qt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Gt(i,!1,!1),n[i]=Gt(i,!0,!1),t[i]=Gt(i,!1,!0),s[i]=Gt(i,!0,!0)}),[e,n,t,s]}const[No,Po,Fo,Ho]=Mo();function ws(e,t){const n=t?e?Ho:Fo:e?Po:No;return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Y(n,r)&&r in s?n:s,r,i)}const $o={get:ws(!1,!1)},jo={get:ws(!1,!0)},Do={get:ws(!0,!1)};const Gr=new WeakMap,zr=new WeakMap,Xr=new WeakMap,Vo=new WeakMap;function Uo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return e.__v_skip||!Object.isExtensible(e)?0:Uo(co(e))}function vn(e){return Nt(e)?e:Es(e,!1,Oo,$o,Gr)}function Ko(e){return Es(e,!1,Lo,jo,zr)}function wn(e){return Es(e,!0,Io,Do,Xr)}function Es(e,t,n,s,r){if(!Z(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=Bo(e);if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function At(e){return Nt(e)?At(e.__v_raw):!!(e&&e.__v_isReactive)}function Nt(e){return!!(e&&e.__v_isReadonly)}function an(e){return!!(e&&e.__v_isShallow)}function Yr(e){return e?!!e.__v_raw:!1}function J(e){const t=e&&e.__v_raw;return t?J(t):e}function sn(e){return Object.isExtensible(e)&&Pr(e,"__v_skip",!0),e}const Pt=e=>Z(e)?vn(e):e,Cs=e=>Z(e)?wn(e):e;class Jr{constructor(t,n,s,r){this.getter=t,this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new _s(()=>t(this._value),()=>Rt(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=J(this);return(!t._cacheable||t.effect.dirty)&&Je(t._value,t._value=t.effect.run())&&Rt(t,4),xs(t),t.effect._dirtyLevel>=2&&Rt(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function ko(e,t,n=!1){let s,r;const i=k(e);return i?(s=e,r=xe):(s=e.get,r=e.set),new Jr(s,r,i||!r,n)}function xs(e){var t;ze&<&&(e=J(e),Ur(lt,(t=e.dep)!=null?t:e.dep=Kr(()=>e.dep=void 0,e instanceof Jr?e:void 0)))}function Rt(e,t=4,n){e=J(e);const s=e.dep;s&&Br(s,t)}function he(e){return!!(e&&e.__v_isRef===!0)}function ae(e){return Zr(e,!1)}function Qr(e){return Zr(e,!0)}function Zr(e,t){return he(e)?e:new Wo(e,t)}class Wo{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:J(t),this._value=n?t:Pt(t)}get value(){return xs(this),this._value}set value(t){const n=this.__v_isShallow||an(t)||Nt(t);t=n?t:J(t),Je(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Pt(t),Rt(this,4))}}function ei(e){return he(e)?e.value:e}const qo={get:(e,t,n)=>ei(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return he(r)&&!he(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function ti(e){return At(e)?e:new Proxy(e,qo)}class Go{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:s}=t(()=>xs(this),()=>Rt(this));this._get=n,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}function zo(e){return new Go(e)}class Xo{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return xo(J(this._object),this._key)}}class Yo{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Jo(e,t,n){return he(e)?e:k(e)?new Yo(e):Z(e)&&arguments.length>1?Qo(e,t,n):ae(e)}function Qo(e,t,n){const s=e[t];return he(s)?s:new Xo(e,t,n)}/** +* @vue/runtime-core v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Xe(e,t,n,s){try{return s?e(...s):e()}catch(r){En(r,t,n)}}function Se(e,t,n,s){if(k(e)){const r=Xe(e,t,n,s);return r&&Lr(r)&&r.catch(i=>{En(i,t,n)}),r}if(U(e)){const r=[];for(let i=0;i>>1,r=ue[s],i=Ht(r);iMe&&ue.splice(t,1)}function nl(e){U(e)?yt.push(...e):(!ke||!ke.includes(e,e.allowRecurse?it+1:it))&&yt.push(e),si()}function Gs(e,t,n=Ft?Me+1:0){for(;nHt(n)-Ht(s));if(yt.length=0,ke){ke.push(...t);return}for(ke=t,it=0;ite.id==null?1/0:e.id,sl=(e,t)=>{const n=Ht(e)-Ht(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ri(e){ns=!1,Ft=!0,ue.sort(sl);try{for(Me=0;Mese(S)?S.trim():S)),h&&(r=n.map(uo))}let l,c=s[l=nn(t)]||s[l=nn(Pe(t))];!c&&i&&(c=s[l=nn(ut(t))]),c&&Se(c,e,6,r);const f=s[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Se(f,e,6,r)}}function ii(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!k(e)){const c=f=>{const d=ii(f,t,!0);d&&(l=!0,re(o,d))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(Z(e)&&s.set(e,null),null):(U(i)?i.forEach(c=>o[c]=null):re(o,i),Z(e)&&s.set(e,o),o)}function xn(e,t){return!e||!Dt(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,ut(t))||Y(e,t))}let de=null,Sn=null;function un(e){const t=de;return de=e,Sn=e&&e.type.__scopeId||null,t}function Pa(e){Sn=e}function Fa(){Sn=null}function il(e,t=de,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&ir(-1);const i=un(t);let o;try{o=e(...r)}finally{un(i),s._d&&ir(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function $n(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:f,renderCache:d,props:h,data:b,setupState:S,ctx:M,inheritAttrs:N}=e,B=un(e);let q,G;try{if(n.shapeFlag&4){const m=r||s,L=m;q=Ae(f.call(L,m,d,h,S,b,M)),G=l}else{const m=t;q=Ae(m.length>1?m(h,{attrs:l,slots:o,emit:c}):m(h,null)),G=t.props?l:ol(l)}}catch(m){Mt.length=0,En(m,e,1),q=fe(ye)}let g=q;if(G&&N!==!1){const m=Object.keys(G),{shapeFlag:L}=g;m.length&&L&7&&(i&&m.some(ds)&&(G=ll(G,i)),g=Qe(g,G,!1,!0))}return n.dirs&&(g=Qe(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&(g.transition=n.transition),q=g,un(B),q}const ol=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dt(n))&&((t||(t={}))[n]=e[n]);return t},ll=(e,t)=>{const n={};for(const s in e)(!ds(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function cl(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,f=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?zs(s,o,f):!!o;if(c&8){const d=t.dynamicProps;for(let h=0;he.__isSuspense;function ci(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):nl(e)}const ul=Symbol.for("v-scx"),dl=()=>vt(ul);function ai(e,t){return Tn(e,null,t)}function ja(e,t){return Tn(e,null,{flush:"post"})}const zt={};function Ne(e,t,n){return Tn(e,t,n)}function Tn(e,t,{immediate:n,deep:s,flush:r,once:i,onTrack:o,onTrigger:l}=te){if(t&&i){const O=t;t=(...D)=>{O(...D),L()}}const c=ce,f=O=>s===!0?O:pt(O,s===!1?1:void 0);let d,h=!1,b=!1;if(he(e)?(d=()=>e.value,h=an(e)):At(e)?(d=()=>f(e),h=!0):U(e)?(b=!0,h=e.some(O=>At(O)||an(O)),d=()=>e.map(O=>{if(he(O))return O.value;if(At(O))return f(O);if(k(O))return Xe(O,c,2)})):k(e)?t?d=()=>Xe(e,c,2):d=()=>(S&&S(),Se(e,c,3,[M])):d=xe,t&&s){const O=d;d=()=>pt(O())}let S,M=O=>{S=g.onStop=()=>{Xe(O,c,4),S=g.onStop=void 0}},N;if(Ln)if(M=xe,t?n&&Se(t,c,3,[d(),b?[]:void 0,M]):d(),r==="sync"){const O=dl();N=O.__watcherHandles||(O.__watcherHandles=[])}else return xe;let B=b?new Array(e.length).fill(zt):zt;const q=()=>{if(!(!g.active||!g.dirty))if(t){const O=g.run();(s||h||(b?O.some((D,A)=>Je(D,B[A])):Je(O,B)))&&(S&&S(),Se(t,c,3,[O,B===zt?void 0:b&&B[0]===zt?[]:B,M]),B=O)}else g.run()};q.allowRecurse=!!t;let G;r==="sync"?G=q:r==="post"?G=()=>me(q,c&&c.suspense):(q.pre=!0,c&&(q.id=c.uid),G=()=>Ts(q));const g=new _s(d,xe,G),m=jr(),L=()=>{g.stop(),m&&hs(m.effects,g)};return t?n?q():B=g.run():r==="post"?me(g.run.bind(g),c&&c.suspense):g.run(),N&&N.push(L),L}function hl(e,t,n){const s=this.proxy,r=se(e)?e.includes(".")?fi(s,e):()=>s[e]:e.bind(s,s);let i;k(t)?i=t:(i=t.handler,n=t);const o=Vt(this),l=Tn(r,i.bind(s),n);return o(),l}function fi(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{pt(s,t,n)});else if(Nr(e))for(const s in e)pt(e[s],t,n);return e}function Le(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o{e.isMounted=!0}),mi(()=>{e.isUnmounting=!0}),e}const Ee=[Function,Array],ui={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ee,onEnter:Ee,onAfterEnter:Ee,onEnterCancelled:Ee,onBeforeLeave:Ee,onLeave:Ee,onAfterLeave:Ee,onLeaveCancelled:Ee,onBeforeAppear:Ee,onAppear:Ee,onAfterAppear:Ee,onAppearCancelled:Ee},gl={name:"BaseTransition",props:ui,setup(e,{slots:t}){const n=In(),s=pl();return()=>{const r=t.default&&hi(t.default(),!0);if(!r||!r.length)return;let i=r[0];if(r.length>1){for(const b of r)if(b.type!==ye){i=b;break}}const o=J(e),{mode:l}=o;if(s.isLeaving)return jn(i);const c=Ys(i);if(!c)return jn(i);const f=ss(c,o,s,n);rs(c,f);const d=n.subTree,h=d&&Ys(d);if(h&&h.type!==ye&&!ot(c,h)){const b=ss(h,o,s,n);if(rs(h,b),l==="out-in"&&c.type!==ye)return s.isLeaving=!0,b.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},jn(i);l==="in-out"&&c.type!==ye&&(b.delayLeave=(S,M,N)=>{const B=di(s,h);B[String(h.key)]=h,S[We]=()=>{M(),S[We]=void 0,delete f.delayedLeave},f.delayedLeave=N})}return i}}},ml=gl;function di(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function ss(e,t,n,s){const{appear:r,mode:i,persisted:o=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:f,onEnterCancelled:d,onBeforeLeave:h,onLeave:b,onAfterLeave:S,onLeaveCancelled:M,onBeforeAppear:N,onAppear:B,onAfterAppear:q,onAppearCancelled:G}=t,g=String(e.key),m=di(n,e),L=(A,j)=>{A&&Se(A,s,9,j)},O=(A,j)=>{const w=j[1];L(A,j),U(A)?A.every(V=>V.length<=1)&&w():A.length<=1&&w()},D={mode:i,persisted:o,beforeEnter(A){let j=l;if(!n.isMounted)if(r)j=N||l;else return;A[We]&&A[We](!0);const w=m[g];w&&ot(e,w)&&w.el[We]&&w.el[We](),L(j,[A])},enter(A){let j=c,w=f,V=d;if(!n.isMounted)if(r)j=B||c,w=q||f,V=G||d;else return;let x=!1;const W=A[Xt]=ie=>{x||(x=!0,ie?L(V,[A]):L(w,[A]),D.delayedLeave&&D.delayedLeave(),A[Xt]=void 0)};j?O(j,[A,W]):W()},leave(A,j){const w=String(e.key);if(A[Xt]&&A[Xt](!0),n.isUnmounting)return j();L(h,[A]);let V=!1;const x=A[We]=W=>{V||(V=!0,j(),W?L(M,[A]):L(S,[A]),A[We]=void 0,m[w]===e&&delete m[w])};m[w]=e,b?O(b,[A,x]):x()},clone(A){return ss(A,t,n,s)}};return D}function jn(e){if(An(e))return e=Qe(e),e.children=null,e}function Ys(e){if(!An(e))return e;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&k(n.default))return n.default()}}function rs(e,t){e.shapeFlag&6&&e.component?rs(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function hi(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader,An=e=>e.type.__isKeepAlive;function _l(e,t){gi(e,"a",t)}function yl(e,t){gi(e,"da",t)}function gi(e,t,n=ce){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Rn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)An(r.parent.vnode)&&bl(s,t,n,r),r=r.parent}}function bl(e,t,n,s){const r=Rn(t,e,s,!0);On(()=>{hs(s[t],r)},n)}function Rn(e,t,n=ce,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Ze();const l=Vt(n),c=Se(t,n,e,o);return l(),et(),c});return s?r.unshift(i):r.push(i),i}}const De=e=>(t,n=ce)=>(!Ln||e==="sp")&&Rn(e,(...s)=>t(...s),n),vl=De("bm"),Ct=De("m"),wl=De("bu"),El=De("u"),mi=De("bum"),On=De("um"),Cl=De("sp"),xl=De("rtg"),Sl=De("rtc");function Tl(e,t=ce){Rn("ec",e,t)}function Da(e,t,n,s){let r;const i=n&&n[s];if(U(e)||se(e)){r=new Array(e.length);for(let o=0,l=e.length;ot(o,l,void 0,i&&i[l]));else{const o=Object.keys(e);r=new Array(o.length);for(let l=0,c=o.length;lpn(t)?!(t.type===ye||t.type===_e&&!_i(t.children)):!0)?e:null}function Ua(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:nn(s)]=e[s];return n}const is=e=>e?$i(e)?Ls(e)||e.proxy:is(e.parent):null,Ot=re(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>is(e.parent),$root:e=>is(e.root),$emit:e=>e.emit,$options:e=>Rs(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Ts(e.update)}),$nextTick:e=>e.n||(e.n=Cn.bind(e.proxy)),$watch:e=>hl.bind(e)}),Dn=(e,t)=>e!==te&&!e.__isScriptSetup&&Y(e,t),Al={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let f;if(t[0]!=="$"){const S=o[t];if(S!==void 0)switch(S){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Dn(s,t))return o[t]=1,s[t];if(r!==te&&Y(r,t))return o[t]=2,r[t];if((f=e.propsOptions[0])&&Y(f,t))return o[t]=3,i[t];if(n!==te&&Y(n,t))return o[t]=4,n[t];os&&(o[t]=0)}}const d=Ot[t];let h,b;if(d)return t==="$attrs"&&be(e.attrs,"get",""),d(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==te&&Y(n,t))return o[t]=4,n[t];if(b=c.config.globalProperties,Y(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Dn(r,t)?(r[t]=n,!0):s!==te&&Y(s,t)?(s[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==te&&Y(e,o)||Dn(t,o)||(l=i[0])&&Y(l,o)||Y(s,o)||Y(Ot,o)||Y(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ba(){return Rl().slots}function Rl(){const e=In();return e.setupContext||(e.setupContext=Di(e))}function Js(e){return U(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let os=!0;function Ol(e){const t=Rs(e),n=e.proxy,s=e.ctx;os=!1,t.beforeCreate&&Qs(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:f,created:d,beforeMount:h,mounted:b,beforeUpdate:S,updated:M,activated:N,deactivated:B,beforeDestroy:q,beforeUnmount:G,destroyed:g,unmounted:m,render:L,renderTracked:O,renderTriggered:D,errorCaptured:A,serverPrefetch:j,expose:w,inheritAttrs:V,components:x,directives:W,filters:ie}=t;if(f&&Il(f,s,null),o)for(const X in o){const F=o[X];k(F)&&(s[X]=F.bind(n))}if(r){const X=r.call(n,n);Z(X)&&(e.data=vn(X))}if(os=!0,i)for(const X in i){const F=i[X],Fe=k(F)?F.bind(n,n):k(F.get)?F.get.bind(n,n):xe,Ut=!k(F)&&k(F.set)?F.set.bind(n):xe,tt=ne({get:Fe,set:Ut});Object.defineProperty(s,X,{enumerable:!0,configurable:!0,get:()=>tt.value,set:Oe=>tt.value=Oe})}if(l)for(const X in l)yi(l[X],s,n,X);if(c){const X=k(c)?c.call(n):c;Reflect.ownKeys(X).forEach(F=>{Hl(F,X[F])})}d&&Qs(d,e,"c");function H(X,F){U(F)?F.forEach(Fe=>X(Fe.bind(n))):F&&X(F.bind(n))}if(H(vl,h),H(Ct,b),H(wl,S),H(El,M),H(_l,N),H(yl,B),H(Tl,A),H(Sl,O),H(xl,D),H(mi,G),H(On,m),H(Cl,j),U(w))if(w.length){const X=e.exposed||(e.exposed={});w.forEach(F=>{Object.defineProperty(X,F,{get:()=>n[F],set:Fe=>n[F]=Fe})})}else e.exposed||(e.exposed={});L&&e.render===xe&&(e.render=L),V!=null&&(e.inheritAttrs=V),x&&(e.components=x),W&&(e.directives=W)}function Il(e,t,n=xe){U(e)&&(e=ls(e));for(const s in e){const r=e[s];let i;Z(r)?"default"in r?i=vt(r.from||s,r.default,!0):i=vt(r.from||s):i=vt(r),he(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Qs(e,t,n){Se(U(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function yi(e,t,n,s){const r=s.includes(".")?fi(n,s):()=>n[s];if(se(e)){const i=t[e];k(i)&&Ne(r,i)}else if(k(e))Ne(r,e.bind(n));else if(Z(e))if(U(e))e.forEach(i=>yi(i,t,n,s));else{const i=k(e.handler)?e.handler.bind(n):t[e.handler];k(i)&&Ne(r,i,e)}}function Rs(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(f=>dn(c,f,o,!0)),dn(c,t,o)),Z(t)&&i.set(t,c),c}function dn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&dn(e,i,n,!0),r&&r.forEach(o=>dn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=Ll[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const Ll={data:Zs,props:er,emits:er,methods:Tt,computed:Tt,beforeCreate:pe,created:pe,beforeMount:pe,mounted:pe,beforeUpdate:pe,updated:pe,beforeDestroy:pe,beforeUnmount:pe,destroyed:pe,unmounted:pe,activated:pe,deactivated:pe,errorCaptured:pe,serverPrefetch:pe,components:Tt,directives:Tt,watch:Nl,provide:Zs,inject:Ml};function Zs(e,t){return t?e?function(){return re(k(e)?e.call(this,this):e,k(t)?t.call(this,this):t)}:t:e}function Ml(e,t){return Tt(ls(e),ls(t))}function ls(e){if(U(e)){const t={};for(let n=0;n1)return n&&k(t)?t.call(s&&s.proxy):t}}const vi={},wi=()=>Object.create(vi),Ei=e=>Object.getPrototypeOf(e)===vi;function $l(e,t,n,s=!1){const r={},i=wi();e.propsDefaults=Object.create(null),Ci(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:Ko(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function jl(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=J(r),[c]=e.propsOptions;let f=!1;if((s||o>0)&&!(o&16)){if(o&8){const d=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[b,S]=xi(h,t,!0);re(o,b),S&&l.push(...S)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!c)return Z(e)&&s.set(e,gt),gt;if(U(i))for(let d=0;d-1,S[1]=N<0||M-1||Y(S,"default"))&&l.push(h)}}}const f=[o,l];return Z(e)&&s.set(e,f),f}function tr(e){return e[0]!=="$"&&!_t(e)}function nr(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function sr(e,t){return nr(e)===nr(t)}function rr(e,t){return U(t)?t.findIndex(n=>sr(n,e)):k(t)&&sr(t,e)?0:-1}const Si=e=>e[0]==="_"||e==="$stable",Os=e=>U(e)?e.map(Ae):[Ae(e)],Dl=(e,t,n)=>{if(t._n)return t;const s=il((...r)=>Os(t(...r)),n);return s._c=!1,s},Ti=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Si(r))continue;const i=e[r];if(k(i))t[r]=Dl(r,i,s);else if(i!=null){const o=Os(i);t[r]=()=>o}}},Ai=(e,t)=>{const n=Os(t);e.slots.default=()=>n},Vl=(e,t)=>{const n=e.slots=wi();if(e.vnode.shapeFlag&32){const s=t._;s?(re(n,t),Pr(n,"_",s,!0)):Ti(t,n)}else t&&Ai(e,t)},Ul=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=te;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(re(r,t),!n&&l===1&&delete r._):(i=!t.$stable,Ti(t,r)),o=t}else t&&(Ai(e,t),o={default:1});if(i)for(const l in r)!Si(l)&&o[l]==null&&delete r[l]};function hn(e,t,n,s,r=!1){if(U(e)){e.forEach((b,S)=>hn(b,t&&(U(t)?t[S]:t),n,s,r));return}if(bt(s)&&!r)return;const i=s.shapeFlag&4?Ls(s.component)||s.component.proxy:s.el,o=r?null:i,{i:l,r:c}=e,f=t&&t.r,d=l.refs===te?l.refs={}:l.refs,h=l.setupState;if(f!=null&&f!==c&&(se(f)?(d[f]=null,Y(h,f)&&(h[f]=null)):he(f)&&(f.value=null)),k(c))Xe(c,l,12,[o,d]);else{const b=se(c),S=he(c);if(b||S){const M=()=>{if(e.f){const N=b?Y(h,c)?h[c]:d[c]:c.value;r?U(N)&&hs(N,i):U(N)?N.includes(i)||N.push(i):b?(d[c]=[i],Y(h,c)&&(h[c]=d[c])):(c.value=[i],e.k&&(d[e.k]=c.value))}else b?(d[c]=o,Y(h,c)&&(h[c]=o)):S&&(c.value=o,e.k&&(d[e.k]=o))};o?(M.id=-1,me(M,n)):M()}}}let Ue=!1;const Bl=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Kl=e=>e.namespaceURI.includes("MathML"),Yt=e=>{if(Bl(e))return"svg";if(Kl(e))return"mathml"},Jt=e=>e.nodeType===8;function kl(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:c,createComment:f}}=e,d=(g,m)=>{if(!m.hasChildNodes()){n(null,g,m),fn(),m._vnode=g;return}Ue=!1,h(m.firstChild,g,null,null,null),fn(),m._vnode=g,Ue&&console.error("Hydration completed but contains mismatches.")},h=(g,m,L,O,D,A=!1)=>{A=A||!!m.dynamicChildren;const j=Jt(g)&&g.data==="[",w=()=>N(g,m,L,O,D,j),{type:V,ref:x,shapeFlag:W,patchFlag:ie}=m;let le=g.nodeType;m.el=g,ie===-2&&(A=!1,m.dynamicChildren=null);let H=null;switch(V){case wt:le!==3?m.children===""?(c(m.el=r(""),o(g),g),H=g):H=w():(g.data!==m.children&&(Ue=!0,g.data=m.children),H=i(g));break;case ye:G(g)?(H=i(g),q(m.el=g.content.firstChild,g,L)):le!==8||j?H=w():H=i(g);break;case Lt:if(j&&(g=i(g),le=g.nodeType),le===1||le===3){H=g;const X=!m.children.length;for(let F=0;F{A=A||!!m.dynamicChildren;const{type:j,props:w,patchFlag:V,shapeFlag:x,dirs:W,transition:ie}=m,le=j==="input"||j==="option";if(le||V!==-1){W&&Le(m,null,L,"created");let H=!1;if(G(g)){H=Ri(O,ie)&&L&&L.vnode.props&&L.vnode.props.appear;const F=g.content.firstChild;H&&ie.beforeEnter(F),q(F,g,L),m.el=g=F}if(x&16&&!(w&&(w.innerHTML||w.textContent))){let F=S(g.firstChild,m,g,L,O,D,A);for(;F;){Ue=!0;const Fe=F;F=F.nextSibling,l(Fe)}}else x&8&&g.textContent!==m.children&&(Ue=!0,g.textContent=m.children);if(w)if(le||!A||V&48)for(const F in w)(le&&(F.endsWith("value")||F==="indeterminate")||Dt(F)&&!_t(F)||F[0]===".")&&s(g,F,null,w[F],void 0,void 0,L);else w.onClick&&s(g,"onClick",null,w.onClick,void 0,void 0,L);let X;(X=w&&w.onVnodeBeforeMount)&&Ce(X,L,m),W&&Le(m,null,L,"beforeMount"),((X=w&&w.onVnodeMounted)||W||H)&&ci(()=>{X&&Ce(X,L,m),H&&ie.enter(g),W&&Le(m,null,L,"mounted")},O)}return g.nextSibling},S=(g,m,L,O,D,A,j)=>{j=j||!!m.dynamicChildren;const w=m.children,V=w.length;for(let x=0;x{const{slotScopeIds:j}=m;j&&(D=D?D.concat(j):j);const w=o(g),V=S(i(g),m,w,L,O,D,A);return V&&Jt(V)&&V.data==="]"?i(m.anchor=V):(Ue=!0,c(m.anchor=f("]"),w,V),V)},N=(g,m,L,O,D,A)=>{if(Ue=!0,m.el=null,A){const V=B(g);for(;;){const x=i(g);if(x&&x!==V)l(x);else break}}const j=i(g),w=o(g);return l(g),n(null,m,w,j,L,O,Yt(w),D),j},B=(g,m="[",L="]")=>{let O=0;for(;g;)if(g=i(g),g&&Jt(g)&&(g.data===m&&O++,g.data===L)){if(O===0)return i(g);O--}return g},q=(g,m,L)=>{const O=m.parentNode;O&&O.replaceChild(g,m);let D=L;for(;D;)D.vnode.el===m&&(D.vnode.el=D.subTree.el=g),D=D.parent},G=g=>g.nodeType===1&&g.tagName.toLowerCase()==="template";return[d,h]}const me=ci;function Wl(e){return ql(e,kl)}function ql(e,t){const n=Fr();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:f,setElementText:d,parentNode:h,nextSibling:b,setScopeId:S=xe,insertStaticContent:M}=e,N=(a,u,p,_=null,y=null,C=null,R=void 0,E=null,T=!!u.dynamicChildren)=>{if(a===u)return;a&&!ot(a,u)&&(_=Bt(a),Oe(a,y,C,!0),a=null),u.patchFlag===-2&&(T=!1,u.dynamicChildren=null);const{type:v,ref:I,shapeFlag:$}=u;switch(v){case wt:B(a,u,p,_);break;case ye:q(a,u,p,_);break;case Lt:a==null&&G(u,p,_,R);break;case _e:x(a,u,p,_,y,C,R,E,T);break;default:$&1?L(a,u,p,_,y,C,R,E,T):$&6?W(a,u,p,_,y,C,R,E,T):($&64||$&128)&&v.process(a,u,p,_,y,C,R,E,T,dt)}I!=null&&y&&hn(I,a&&a.ref,C,u||a,!u)},B=(a,u,p,_)=>{if(a==null)s(u.el=l(u.children),p,_);else{const y=u.el=a.el;u.children!==a.children&&f(y,u.children)}},q=(a,u,p,_)=>{a==null?s(u.el=c(u.children||""),p,_):u.el=a.el},G=(a,u,p,_)=>{[a.el,a.anchor]=M(a.children,u,p,_,a.el,a.anchor)},g=({el:a,anchor:u},p,_)=>{let y;for(;a&&a!==u;)y=b(a),s(a,p,_),a=y;s(u,p,_)},m=({el:a,anchor:u})=>{let p;for(;a&&a!==u;)p=b(a),r(a),a=p;r(u)},L=(a,u,p,_,y,C,R,E,T)=>{u.type==="svg"?R="svg":u.type==="math"&&(R="mathml"),a==null?O(u,p,_,y,C,R,E,T):j(a,u,y,C,R,E,T)},O=(a,u,p,_,y,C,R,E)=>{let T,v;const{props:I,shapeFlag:$,transition:P,dirs:K}=a;if(T=a.el=o(a.type,C,I&&I.is,I),$&8?d(T,a.children):$&16&&A(a.children,T,null,_,y,Vn(a,C),R,E),K&&Le(a,null,_,"created"),D(T,a,a.scopeId,R,_),I){for(const Q in I)Q!=="value"&&!_t(Q)&&i(T,Q,null,I[Q],C,a.children,_,y,He);"value"in I&&i(T,"value",null,I.value,C),(v=I.onVnodeBeforeMount)&&Ce(v,_,a)}K&&Le(a,null,_,"beforeMount");const z=Ri(y,P);z&&P.beforeEnter(T),s(T,u,p),((v=I&&I.onVnodeMounted)||z||K)&&me(()=>{v&&Ce(v,_,a),z&&P.enter(T),K&&Le(a,null,_,"mounted")},y)},D=(a,u,p,_,y)=>{if(p&&S(a,p),_)for(let C=0;C<_.length;C++)S(a,_[C]);if(y){let C=y.subTree;if(u===C){const R=y.vnode;D(a,R,R.scopeId,R.slotScopeIds,y.parent)}}},A=(a,u,p,_,y,C,R,E,T=0)=>{for(let v=T;v{const E=u.el=a.el;let{patchFlag:T,dynamicChildren:v,dirs:I}=u;T|=a.patchFlag&16;const $=a.props||te,P=u.props||te;let K;if(p&&nt(p,!1),(K=P.onVnodeBeforeUpdate)&&Ce(K,p,u,a),I&&Le(u,a,p,"beforeUpdate"),p&&nt(p,!0),v?w(a.dynamicChildren,v,E,p,_,Vn(u,y),C):R||F(a,u,E,null,p,_,Vn(u,y),C,!1),T>0){if(T&16)V(E,u,$,P,p,_,y);else if(T&2&&$.class!==P.class&&i(E,"class",null,P.class,y),T&4&&i(E,"style",$.style,P.style,y),T&8){const z=u.dynamicProps;for(let Q=0;Q{K&&Ce(K,p,u,a),I&&Le(u,a,p,"updated")},_)},w=(a,u,p,_,y,C,R)=>{for(let E=0;E{if(p!==_){if(p!==te)for(const E in p)!_t(E)&&!(E in _)&&i(a,E,p[E],null,R,u.children,y,C,He);for(const E in _){if(_t(E))continue;const T=_[E],v=p[E];T!==v&&E!=="value"&&i(a,E,v,T,R,u.children,y,C,He)}"value"in _&&i(a,"value",p.value,_.value,R)}},x=(a,u,p,_,y,C,R,E,T)=>{const v=u.el=a?a.el:l(""),I=u.anchor=a?a.anchor:l("");let{patchFlag:$,dynamicChildren:P,slotScopeIds:K}=u;K&&(E=E?E.concat(K):K),a==null?(s(v,p,_),s(I,p,_),A(u.children||[],p,I,y,C,R,E,T)):$>0&&$&64&&P&&a.dynamicChildren?(w(a.dynamicChildren,P,p,y,C,R,E),(u.key!=null||y&&u===y.subTree)&&Oi(a,u,!0)):F(a,u,p,I,y,C,R,E,T)},W=(a,u,p,_,y,C,R,E,T)=>{u.slotScopeIds=E,a==null?u.shapeFlag&512?y.ctx.activate(u,p,_,R,T):ie(u,p,_,y,C,R,T):le(a,u,T)},ie=(a,u,p,_,y,C,R)=>{const E=a.component=tc(a,_,y);if(An(a)&&(E.ctx.renderer=dt),nc(E),E.asyncDep){if(y&&y.registerDep(E,H),!a.el){const T=E.subTree=fe(ye);q(null,T,u,p)}}else H(E,a,u,p,y,C,R)},le=(a,u,p)=>{const _=u.component=a.component;if(cl(a,u,p))if(_.asyncDep&&!_.asyncResolved){X(_,u,p);return}else _.next=u,tl(_.update),_.effect.dirty=!0,_.update();else u.el=a.el,_.vnode=u},H=(a,u,p,_,y,C,R)=>{const E=()=>{if(a.isMounted){let{next:I,bu:$,u:P,parent:K,vnode:z}=a;{const ht=Ii(a);if(ht){I&&(I.el=z.el,X(a,I,R)),ht.asyncDep.then(()=>{a.isUnmounted||E()});return}}let Q=I,ee;nt(a,!1),I?(I.el=z.el,X(a,I,R)):I=z,$&&Fn($),(ee=I.props&&I.props.onVnodeBeforeUpdate)&&Ce(ee,K,I,z),nt(a,!0);const oe=$n(a),Te=a.subTree;a.subTree=oe,N(Te,oe,h(Te.el),Bt(Te),a,y,C),I.el=oe.el,Q===null&&al(a,oe.el),P&&me(P,y),(ee=I.props&&I.props.onVnodeUpdated)&&me(()=>Ce(ee,K,I,z),y)}else{let I;const{el:$,props:P}=u,{bm:K,m:z,parent:Q}=a,ee=bt(u);if(nt(a,!1),K&&Fn(K),!ee&&(I=P&&P.onVnodeBeforeMount)&&Ce(I,Q,u),nt(a,!0),$&&Pn){const oe=()=>{a.subTree=$n(a),Pn($,a.subTree,a,y,null)};ee?u.type.__asyncLoader().then(()=>!a.isUnmounted&&oe()):oe()}else{const oe=a.subTree=$n(a);N(null,oe,p,_,a,y,C),u.el=oe.el}if(z&&me(z,y),!ee&&(I=P&&P.onVnodeMounted)){const oe=u;me(()=>Ce(I,Q,oe),y)}(u.shapeFlag&256||Q&&bt(Q.vnode)&&Q.vnode.shapeFlag&256)&&a.a&&me(a.a,y),a.isMounted=!0,u=p=_=null}},T=a.effect=new _s(E,xe,()=>Ts(v),a.scope),v=a.update=()=>{T.dirty&&T.run()};v.id=a.uid,nt(a,!0),v()},X=(a,u,p)=>{u.component=a;const _=a.vnode.props;a.vnode=u,a.next=null,jl(a,u.props,_,p),Ul(a,u.children,p),Ze(),Gs(a),et()},F=(a,u,p,_,y,C,R,E,T=!1)=>{const v=a&&a.children,I=a?a.shapeFlag:0,$=u.children,{patchFlag:P,shapeFlag:K}=u;if(P>0){if(P&128){Ut(v,$,p,_,y,C,R,E,T);return}else if(P&256){Fe(v,$,p,_,y,C,R,E,T);return}}K&8?(I&16&&He(v,y,C),$!==v&&d(p,$)):I&16?K&16?Ut(v,$,p,_,y,C,R,E,T):He(v,y,C,!0):(I&8&&d(p,""),K&16&&A($,p,_,y,C,R,E,T))},Fe=(a,u,p,_,y,C,R,E,T)=>{a=a||gt,u=u||gt;const v=a.length,I=u.length,$=Math.min(v,I);let P;for(P=0;P<$;P++){const K=u[P]=T?qe(u[P]):Ae(u[P]);N(a[P],K,p,null,y,C,R,E,T)}v>I?He(a,y,C,!0,!1,$):A(u,p,_,y,C,R,E,T,$)},Ut=(a,u,p,_,y,C,R,E,T)=>{let v=0;const I=u.length;let $=a.length-1,P=I-1;for(;v<=$&&v<=P;){const K=a[v],z=u[v]=T?qe(u[v]):Ae(u[v]);if(ot(K,z))N(K,z,p,null,y,C,R,E,T);else break;v++}for(;v<=$&&v<=P;){const K=a[$],z=u[P]=T?qe(u[P]):Ae(u[P]);if(ot(K,z))N(K,z,p,null,y,C,R,E,T);else break;$--,P--}if(v>$){if(v<=P){const K=P+1,z=KP)for(;v<=$;)Oe(a[v],y,C,!0),v++;else{const K=v,z=v,Q=new Map;for(v=z;v<=P;v++){const ve=u[v]=T?qe(u[v]):Ae(u[v]);ve.key!=null&&Q.set(ve.key,v)}let ee,oe=0;const Te=P-z+1;let ht=!1,Hs=0;const xt=new Array(Te);for(v=0;v=Te){Oe(ve,y,C,!0);continue}let Ie;if(ve.key!=null)Ie=Q.get(ve.key);else for(ee=z;ee<=P;ee++)if(xt[ee-z]===0&&ot(ve,u[ee])){Ie=ee;break}Ie===void 0?Oe(ve,y,C,!0):(xt[Ie-z]=v+1,Ie>=Hs?Hs=Ie:ht=!0,N(ve,u[Ie],p,null,y,C,R,E,T),oe++)}const $s=ht?Gl(xt):gt;for(ee=$s.length-1,v=Te-1;v>=0;v--){const ve=z+v,Ie=u[ve],js=ve+1{const{el:C,type:R,transition:E,children:T,shapeFlag:v}=a;if(v&6){tt(a.component.subTree,u,p,_);return}if(v&128){a.suspense.move(u,p,_);return}if(v&64){R.move(a,u,p,dt);return}if(R===_e){s(C,u,p);for(let $=0;$E.enter(C),y);else{const{leave:$,delayLeave:P,afterLeave:K}=E,z=()=>s(C,u,p),Q=()=>{$(C,()=>{z(),K&&K()})};P?P(C,z,Q):Q()}else s(C,u,p)},Oe=(a,u,p,_=!1,y=!1)=>{const{type:C,props:R,ref:E,children:T,dynamicChildren:v,shapeFlag:I,patchFlag:$,dirs:P}=a;if(E!=null&&hn(E,null,p,a,!0),I&256){u.ctx.deactivate(a);return}const K=I&1&&P,z=!bt(a);let Q;if(z&&(Q=R&&R.onVnodeBeforeUnmount)&&Ce(Q,u,a),I&6)io(a.component,p,_);else{if(I&128){a.suspense.unmount(p,_);return}K&&Le(a,null,u,"beforeUnmount"),I&64?a.type.remove(a,u,p,y,dt,_):v&&(C!==_e||$>0&&$&64)?He(v,u,p,!1,!0):(C===_e&&$&384||!y&&I&16)&&He(T,u,p),_&&Ps(a)}(z&&(Q=R&&R.onVnodeUnmounted)||K)&&me(()=>{Q&&Ce(Q,u,a),K&&Le(a,null,u,"unmounted")},p)},Ps=a=>{const{type:u,el:p,anchor:_,transition:y}=a;if(u===_e){ro(p,_);return}if(u===Lt){m(a);return}const C=()=>{r(p),y&&!y.persisted&&y.afterLeave&&y.afterLeave()};if(a.shapeFlag&1&&y&&!y.persisted){const{leave:R,delayLeave:E}=y,T=()=>R(p,C);E?E(a.el,C,T):T()}else C()},ro=(a,u)=>{let p;for(;a!==u;)p=b(a),r(a),a=p;r(u)},io=(a,u,p)=>{const{bum:_,scope:y,update:C,subTree:R,um:E}=a;_&&Fn(_),y.stop(),C&&(C.active=!1,Oe(R,a,u,p)),E&&me(E,u),me(()=>{a.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&a.asyncDep&&!a.asyncResolved&&a.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},He=(a,u,p,_=!1,y=!1,C=0)=>{for(let R=C;Ra.shapeFlag&6?Bt(a.component.subTree):a.shapeFlag&128?a.suspense.next():b(a.anchor||a.el);let Mn=!1;const Fs=(a,u,p)=>{a==null?u._vnode&&Oe(u._vnode,null,null,!0):N(u._vnode||null,a,u,null,null,null,p),Mn||(Mn=!0,Gs(),fn(),Mn=!1),u._vnode=a},dt={p:N,um:Oe,m:tt,r:Ps,mt:ie,mc:A,pc:F,pbc:w,n:Bt,o:e};let Nn,Pn;return t&&([Nn,Pn]=t(dt)),{render:Fs,hydrate:Nn,createApp:Fl(Fs,Nn)}}function Vn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Ri(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oi(e,t,n=!1){const s=e.children,r=t.children;if(U(s)&&U(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function Ii(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ii(t)}const zl=e=>e.__isTeleport,_e=Symbol.for("v-fgt"),wt=Symbol.for("v-txt"),ye=Symbol.for("v-cmt"),Lt=Symbol.for("v-stc"),Mt=[];let Re=null;function Li(e=!1){Mt.push(Re=e?null:[])}function Xl(){Mt.pop(),Re=Mt[Mt.length-1]||null}let $t=1;function ir(e){$t+=e}function Mi(e){return e.dynamicChildren=$t>0?Re||gt:null,Xl(),$t>0&&Re&&Re.push(e),e}function Ka(e,t,n,s,r,i){return Mi(Fi(e,t,n,s,r,i,!0))}function Ni(e,t,n,s,r){return Mi(fe(e,t,n,s,r,!0))}function pn(e){return e?e.__v_isVNode===!0:!1}function ot(e,t){return e.type===t.type&&e.key===t.key}const Pi=({key:e})=>e??null,rn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?se(e)||he(e)||k(e)?{i:de,r:e,k:t,f:!!n}:e:null);function Fi(e,t=null,n=null,s=0,r=null,i=e===_e?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pi(t),ref:t&&rn(t),scopeId:Sn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:de};return l?(Is(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=se(n)?8:16),$t>0&&!o&&Re&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Re.push(c),c}const fe=Yl;function Yl(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===oi)&&(e=ye),pn(e)){const l=Qe(e,t,!0);return n&&Is(l,n),$t>0&&!i&&Re&&(l.shapeFlag&6?Re[Re.indexOf(e)]=l:Re.push(l)),l.patchFlag|=-2,l}if(oc(e)&&(e=e.__vccOpts),t){t=Jl(t);let{class:l,style:c}=t;l&&!se(l)&&(t.class=ms(l)),Z(c)&&(Yr(c)&&!U(c)&&(c=re({},c)),t.style=gs(c))}const o=se(e)?1:fl(e)?128:zl(e)?64:Z(e)?4:k(e)?2:0;return Fi(e,t,n,s,r,o,i,!0)}function Jl(e){return e?Yr(e)||Ei(e)?re({},e):e:null}function Qe(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,f=t?Ql(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Pi(f),ref:t&&t.ref?n&&i?U(i)?i.concat(rn(t)):[i,rn(t)]:rn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==_e?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Qe(e.ssContent),ssFallback:e.ssFallback&&Qe(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&(d.transition=c.clone(d)),d}function Hi(e=" ",t=0){return fe(wt,null,e,t)}function ka(e,t){const n=fe(Lt,null,e);return n.staticCount=t,n}function Wa(e="",t=!1){return t?(Li(),Ni(ye,null,e)):fe(ye,null,e)}function Ae(e){return e==null||typeof e=="boolean"?fe(ye):U(e)?fe(_e,null,e.slice()):typeof e=="object"?qe(e):fe(wt,null,String(e))}function qe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Qe(e)}function Is(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(U(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Is(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Ei(t)?t._ctx=de:r===3&&de&&(de.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else k(t)?(t={default:t,_ctx:de},n=32):(t=String(t),s&64?(n=16,t=[Hi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ql(...e){const t={};for(let n=0;nce||de;let gn,as;{const e=Fr(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};gn=t("__VUE_INSTANCE_SETTERS__",n=>ce=n),as=t("__VUE_SSR_SETTERS__",n=>Ln=n)}const Vt=e=>{const t=ce;return gn(e),e.scope.on(),()=>{e.scope.off(),gn(t)}},or=()=>{ce&&ce.scope.off(),gn(null)};function $i(e){return e.vnode.shapeFlag&4}let Ln=!1;function nc(e,t=!1){t&&as(t);const{props:n,children:s}=e.vnode,r=$i(e);$l(e,n,r,t),Vl(e,s);const i=r?sc(e,t):void 0;return t&&as(!1),i}function sc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Al);const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?Di(e):null,i=Vt(e);Ze();const o=Xe(s,e,0,[e.props,r]);if(et(),i(),Lr(o)){if(o.then(or,or),t)return o.then(l=>{lr(e,l,t)}).catch(l=>{En(l,e,0)});e.asyncDep=o}else lr(e,o,t)}else ji(e,t)}function lr(e,t,n){k(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Z(t)&&(e.setupState=ti(t)),ji(e,n)}let cr;function ji(e,t,n){const s=e.type;if(!e.render){if(!t&&cr&&!s.render){const r=s.template||Rs(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,f=re(re({isCustomElement:i,delimiters:l},o),c);s.render=cr(r,f)}}e.render=s.render||xe}{const r=Vt(e);Ze();try{Ol(e)}finally{et(),r()}}}const rc={get(e,t){return be(e,"get",""),e[t]}};function Di(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,rc),slots:e.slots,emit:e.emit,expose:t}}function Ls(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ti(sn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ot)return Ot[n](e)},has(t,n){return n in t||n in Ot}}))}function ic(e,t=!0){return k(e)?e.displayName||e.name:e.name||t&&e.__name}function oc(e){return k(e)&&"__vccOpts"in e}const ne=(e,t)=>ko(e,t,Ln);function fs(e,t,n){const s=arguments.length;return s===2?Z(t)&&!U(t)?pn(t)?fe(e,null,[t]):fe(e,t):fe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&pn(n)&&(n=[n]),fe(e,t,n))}const lc="3.4.26";/** +* @vue/runtime-dom v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const cc="http://www.w3.org/2000/svg",ac="http://www.w3.org/1998/Math/MathML",Ge=typeof document<"u"?document:null,ar=Ge&&Ge.createElement("template"),fc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ge.createElementNS(cc,e):t==="mathml"?Ge.createElementNS(ac,e):Ge.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ge.createTextNode(e),createComment:e=>Ge.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ge.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{ar.innerHTML=s==="svg"?`${e}`:s==="mathml"?`${e}`:e;const l=ar.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Be="transition",St="animation",jt=Symbol("_vtc"),Vi=(e,{slots:t})=>fs(ml,uc(e),t);Vi.displayName="Transition";const Ui={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Vi.props=re({},ui,Ui);const st=(e,t=[])=>{U(e)?e.forEach(n=>n(...t)):e&&e(...t)},fr=e=>e?U(e)?e.some(t=>t.length>1):e.length>1:!1;function uc(e){const t={};for(const x in e)x in Ui||(t[x]=e[x]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:f=o,appearToClass:d=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:S=`${n}-leave-to`}=e,M=dc(r),N=M&&M[0],B=M&&M[1],{onBeforeEnter:q,onEnter:G,onEnterCancelled:g,onLeave:m,onLeaveCancelled:L,onBeforeAppear:O=q,onAppear:D=G,onAppearCancelled:A=g}=t,j=(x,W,ie)=>{rt(x,W?d:l),rt(x,W?f:o),ie&&ie()},w=(x,W)=>{x._isLeaving=!1,rt(x,h),rt(x,S),rt(x,b),W&&W()},V=x=>(W,ie)=>{const le=x?D:G,H=()=>j(W,x,ie);st(le,[W,H]),ur(()=>{rt(W,x?c:i),Ke(W,x?d:l),fr(le)||dr(W,s,N,H)})};return re(t,{onBeforeEnter(x){st(q,[x]),Ke(x,i),Ke(x,o)},onBeforeAppear(x){st(O,[x]),Ke(x,c),Ke(x,f)},onEnter:V(!1),onAppear:V(!0),onLeave(x,W){x._isLeaving=!0;const ie=()=>w(x,W);Ke(x,h),Ke(x,b),gc(),ur(()=>{x._isLeaving&&(rt(x,h),Ke(x,S),fr(m)||dr(x,s,B,ie))}),st(m,[x,ie])},onEnterCancelled(x){j(x,!1),st(g,[x])},onAppearCancelled(x){j(x,!0),st(A,[x])},onLeaveCancelled(x){w(x),st(L,[x])}})}function dc(e){if(e==null)return null;if(Z(e))return[Un(e.enter),Un(e.leave)];{const t=Un(e);return[t,t]}}function Un(e){return ho(e)}function Ke(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[jt]||(e[jt]=new Set)).add(t)}function rt(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[jt];n&&(n.delete(t),n.size||(e[jt]=void 0))}function ur(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let hc=0;function dr(e,t,n,s){const r=e._endId=++hc,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=pc(e,t);if(!o)return s();const f=o+"end";let d=0;const h=()=>{e.removeEventListener(f,b),i()},b=S=>{S.target===e&&++d>=c&&h()};setTimeout(()=>{d(n[M]||"").split(", "),r=s(`${Be}Delay`),i=s(`${Be}Duration`),o=hr(r,i),l=s(`${St}Delay`),c=s(`${St}Duration`),f=hr(l,c);let d=null,h=0,b=0;t===Be?o>0&&(d=Be,h=o,b=i.length):t===St?f>0&&(d=St,h=f,b=c.length):(h=Math.max(o,f),d=h>0?o>f?Be:St:null,b=d?d===Be?i.length:c.length:0);const S=d===Be&&/\b(transform|all)(,|$)/.test(s(`${Be}Property`).toString());return{type:d,timeout:h,propCount:b,hasTransform:S}}function hr(e,t){for(;e.lengthpr(n)+pr(e[s])))}function pr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gc(){return document.body.offsetHeight}function mc(e,t,n){const s=e[jt];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const gr=Symbol("_vod"),_c=Symbol("_vsh"),yc=Symbol(""),bc=/(^|;)\s*display\s*:/;function vc(e,t,n){const s=e.style,r=se(n);let i=!1;if(n&&!r){if(t)if(se(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&on(s,l,"")}else for(const o in t)n[o]==null&&on(s,o,"");for(const o in n)o==="display"&&(i=!0),on(s,o,n[o])}else if(r){if(t!==n){const o=s[yc];o&&(n+=";"+o),s.cssText=n,i=bc.test(n)}}else t&&e.removeAttribute("style");gr in e&&(e[gr]=i?s.display:"",e[_c]&&(s.display="none"))}const mr=/\s*!important$/;function on(e,t,n){if(U(n))n.forEach(s=>on(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=wc(e,t);mr.test(n)?e.setProperty(ut(s),n.replace(mr,""),"important"):e[s]=n}}const _r=["Webkit","Moz","ms"],Bn={};function wc(e,t){const n=Bn[t];if(n)return n;let s=Pe(t);if(s!=="filter"&&s in e)return Bn[t]=s;s=yn(s);for(let r=0;r<_r.length;r++){const i=_r[r]+s;if(i in e)return Bn[t]=i}return t}const yr="http://www.w3.org/1999/xlink";function Ec(e,t,n,s,r){if(s&&t.startsWith("xlink:"))n==null?e.removeAttributeNS(yr,t.slice(6,t.length)):e.setAttributeNS(yr,t,n);else{const i=bo(t);n==null||i&&!Hr(n)?e.removeAttribute(t):e.setAttribute(t,i?"":n)}}function Cc(e,t,n,s,r,i,o){if(t==="innerHTML"||t==="textContent"){s&&o(s,r,i),e[t]=n??"";return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const f=l==="OPTION"?e.getAttribute("value")||"":e.value,d=n??"";(f!==d||!("_value"in e))&&(e.value=d),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Hr(n):n==null&&f==="string"?(n="",c=!0):f==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(t)}function xc(e,t,n,s){e.addEventListener(t,n,s)}function Sc(e,t,n,s){e.removeEventListener(t,n,s)}const br=Symbol("_vei");function Tc(e,t,n,s,r=null){const i=e[br]||(e[br]={}),o=i[t];if(s&&o)o.value=s;else{const[l,c]=Ac(t);if(s){const f=i[t]=Ic(s,r);xc(e,l,f,c)}else o&&(Sc(e,l,o,c),i[t]=void 0)}}const vr=/(?:Once|Passive|Capture)$/;function Ac(e){let t;if(vr.test(e)){t={};let s;for(;s=e.match(vr);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ut(e.slice(2)),t]}let Kn=0;const Rc=Promise.resolve(),Oc=()=>Kn||(Rc.then(()=>Kn=0),Kn=Date.now());function Ic(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Se(Lc(s,n.value),t,5,[s])};return n.value=e,n.attached=Oc(),n}function Lc(e,t){if(U(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const wr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Mc=(e,t,n,s,r,i,o,l,c)=>{const f=r==="svg";t==="class"?mc(e,s,f):t==="style"?vc(e,n,s):Dt(t)?ds(t)||Tc(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Nc(e,t,s,f))?Cc(e,t,s,i,o,l,c):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ec(e,t,s,f))};function Nc(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&wr(t)&&k(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return wr(t)&&se(n)?!1:t in e}const Pc=["ctrl","shift","alt","meta"],Fc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Pc.some(n=>e[`${n}Key`]&&!t.includes(n))},qa=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=r=>{if(!("key"in r))return;const i=ut(r.key);if(t.some(o=>o===i||Hc[o]===i))return e(r)})},$c=re({patchProp:Mc},fc);let kn,Er=!1;function jc(){return kn=Er?kn:Wl($c),Er=!0,kn}const za=(...e)=>{const t=jc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Vc(s);if(r)return n(r,!0,Dc(r))},t};function Dc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vc(e){return se(e)?document.querySelector(e):e}const Xa=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Uc=window.__VP_SITE_DATA__;function Ms(e){return jr()?(Eo(e),!0):!1}function Ye(e){return typeof e=="function"?e():ei(e)}const Bi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Bc=Object.prototype.toString,Kc=e=>Bc.call(e)==="[object Object]",Ki=()=>{},Cr=kc();function kc(){var e,t;return Bi&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Wc(e,t){function n(...s){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(r).catch(i)})}return n}const ki=e=>e();function qc(e=ki){const t=ae(!0);function n(){t.value=!1}function s(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:wn(t),pause:n,resume:s,eventFilter:r}}function Gc(e){return e||In()}function Wi(...e){if(e.length!==1)return Jo(...e);const t=e[0];return typeof t=="function"?wn(zo(()=>({get:t,set:Ki}))):ae(t)}function zc(e,t,n={}){const{eventFilter:s=ki,...r}=n;return Ne(e,Wc(s,t),r)}function Xc(e,t,n={}){const{eventFilter:s,...r}=n,{eventFilter:i,pause:o,resume:l,isActive:c}=qc(s);return{stop:zc(e,t,{...r,eventFilter:i}),pause:o,resume:l,isActive:c}}function Ns(e,t=!0,n){Gc()?Ct(e,n):t?e():Cn(e)}function qi(e){var t;const n=Ye(e);return(t=n==null?void 0:n.$el)!=null?t:n}const je=Bi?window:void 0;function Et(...e){let t,n,s,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,s,r]=e,t=je):[t,n,s,r]=e,!t)return Ki;Array.isArray(n)||(n=[n]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,h,b,S)=>(d.addEventListener(h,b,S),()=>d.removeEventListener(h,b,S)),c=Ne(()=>[qi(t),Ye(r)],([d,h])=>{if(o(),!d)return;const b=Kc(h)?{...h}:h;i.push(...n.flatMap(S=>s.map(M=>l(d,S,M,b))))},{immediate:!0,flush:"post"}),f=()=>{c(),o()};return Ms(f),f}function Yc(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ya(...e){let t,n,s={};e.length===3?(t=e[0],n=e[1],s=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],s=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=je,eventName:i="keydown",passive:o=!1,dedupe:l=!1}=s,c=Yc(t);return Et(r,i,d=>{d.repeat&&Ye(l)||c(d)&&n(d)},o)}function Jc(){const e=ae(!1),t=In();return t&&Ct(()=>{e.value=!0},t),e}function Qc(e){const t=Jc();return ne(()=>(t.value,!!e()))}function Gi(e,t={}){const{window:n=je}=t,s=Qc(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=ae(!1),o=f=>{i.value=f.matches},l=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",o):r.removeListener(o))},c=ai(()=>{s.value&&(l(),r=n.matchMedia(Ye(e)),"addEventListener"in r?r.addEventListener("change",o):r.addListener(o),i.value=r.matches)});return Ms(()=>{c(),l(),r=void 0}),i}const Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zt="__vueuse_ssr_handlers__",Zc=ea();function ea(){return Zt in Qt||(Qt[Zt]=Qt[Zt]||{}),Qt[Zt]}function zi(e,t){return Zc[e]||t}function ta(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const na={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},xr="vueuse-storage";function sa(e,t,n,s={}){var r;const{flush:i="pre",deep:o=!0,listenToStorageChanges:l=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:d,window:h=je,eventFilter:b,onError:S=w=>{console.error(w)},initOnMounted:M}=s,N=(d?Qr:ae)(typeof t=="function"?t():t);if(!n)try{n=zi("getDefaultStorage",()=>{var w;return(w=je)==null?void 0:w.localStorage})()}catch(w){S(w)}if(!n)return N;const B=Ye(t),q=ta(B),G=(r=s.serializer)!=null?r:na[q],{pause:g,resume:m}=Xc(N,()=>O(N.value),{flush:i,deep:o,eventFilter:b});h&&l&&Ns(()=>{Et(h,"storage",A),Et(h,xr,j),M&&A()}),M||A();function L(w,V){h&&h.dispatchEvent(new CustomEvent(xr,{detail:{key:e,oldValue:w,newValue:V,storageArea:n}}))}function O(w){try{const V=n.getItem(e);if(w==null)L(V,null),n.removeItem(e);else{const x=G.write(w);V!==x&&(n.setItem(e,x),L(V,x))}}catch(V){S(V)}}function D(w){const V=w?w.newValue:n.getItem(e);if(V==null)return c&&B!=null&&n.setItem(e,G.write(B)),B;if(!w&&f){const x=G.read(V);return typeof f=="function"?f(x,B):q==="object"&&!Array.isArray(x)?{...B,...x}:x}else return typeof V!="string"?V:G.read(V)}function A(w){if(!(w&&w.storageArea!==n)){if(w&&w.key==null){N.value=B;return}if(!(w&&w.key!==e)){g();try{(w==null?void 0:w.newValue)!==G.write(N.value)&&(N.value=D(w))}catch(V){S(V)}finally{w?Cn(m):m()}}}}function j(w){A(w.detail)}return N}function Xi(e){return Gi("(prefers-color-scheme: dark)",e)}function ra(e={}){const{selector:t="html",attribute:n="class",initialValue:s="auto",window:r=je,storage:i,storageKey:o="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:c,emitAuto:f,disableTransition:d=!0}=e,h={auto:"",light:"light",dark:"dark",...e.modes||{}},b=Xi({window:r}),S=ne(()=>b.value?"dark":"light"),M=c||(o==null?Wi(s):sa(o,s,i,{window:r,listenToStorageChanges:l})),N=ne(()=>M.value==="auto"?S.value:M.value),B=zi("updateHTMLAttrs",(m,L,O)=>{const D=typeof m=="string"?r==null?void 0:r.document.querySelector(m):qi(m);if(!D)return;let A;if(d&&(A=r.document.createElement("style"),A.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),r.document.head.appendChild(A)),L==="class"){const j=O.split(/\s/g);Object.values(h).flatMap(w=>(w||"").split(/\s/g)).filter(Boolean).forEach(w=>{j.includes(w)?D.classList.add(w):D.classList.remove(w)})}else D.setAttribute(L,O);d&&(r.getComputedStyle(A).opacity,document.head.removeChild(A))});function q(m){var L;B(t,n,(L=h[m])!=null?L:m)}function G(m){e.onChanged?e.onChanged(m,q):q(m)}Ne(N,G,{flush:"post",immediate:!0}),Ns(()=>G(N.value));const g=ne({get(){return f?M.value:N.value},set(m){M.value=m}});try{return Object.assign(g,{store:M,system:S,state:N})}catch{return g}}function ia(e={}){const{valueDark:t="dark",valueLight:n="",window:s=je}=e,r=ra({...e,onChanged:(l,c)=>{var f;e.onChanged?(f=e.onChanged)==null||f.call(e,l==="dark",c,l):c(l)},modes:{dark:t,light:n}}),i=ne(()=>r.system?r.system.value:Xi({window:s}).value?"dark":"light");return ne({get(){return r.value==="dark"},set(l){const c=l?"dark":"light";i.value===c?r.value="auto":r.value=c}})}function Wn(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Yi(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.preventDefault(),!1)}const en=new WeakMap;function Ja(e,t=!1){const n=ae(t);let s=null;Ne(Wi(e),o=>{const l=Wn(Ye(o));if(l){const c=l;en.get(c)||en.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const r=()=>{const o=Wn(Ye(e));!o||n.value||(Cr&&(s=Et(o,"touchmove",l=>{oa(l)},{passive:!1})),o.style.overflow="hidden",n.value=!0)},i=()=>{var o;const l=Wn(Ye(e));!l||!n.value||(Cr&&(s==null||s()),l.style.overflow=(o=en.get(l))!=null?o:"",en.delete(l),n.value=!1)};return Ms(i),ne({get(){return n.value},set(o){o?r():i()}})}function Qa(e={}){const{window:t=je,behavior:n="auto"}=e;if(!t)return{x:ae(0),y:ae(0)};const s=ae(t.scrollX),r=ae(t.scrollY),i=ne({get(){return s.value},set(l){scrollTo({left:l,behavior:n})}}),o=ne({get(){return r.value},set(l){scrollTo({top:l,behavior:n})}});return Et(t,"scroll",()=>{s.value=t.scrollX,r.value=t.scrollY},{capture:!1,passive:!0}),{x:i,y:o}}function Za(e={}){const{window:t=je,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:s=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0}=e,o=ae(n),l=ae(s),c=()=>{t&&(i?(o.value=t.innerWidth,l.value=t.innerHeight):(o.value=t.document.documentElement.clientWidth,l.value=t.document.documentElement.clientHeight))};if(c(),Ns(c),Et("resize",c,{passive:!0}),r){const f=Gi("(orientation: portrait)");Ne(f,()=>c())}return{width:o,height:l}}var qn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},Gn={};const Ji=/^(?:[a-z]+:|\/\/)/i,la="vitepress-theme-appearance",ca=/#.*$/,aa=/[?#].*$/,fa=/(?:(^|\/)index)?\.(?:md|html)$/,ge=typeof document<"u",Qi={relativePath:"",filePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{sidebar:!1,layout:"page"},lastUpdated:0,isNotFound:!0};function ua(e,t,n=!1){if(t===void 0)return!1;if(e=Sr(`/${e}`),n)return new RegExp(t).test(e);if(Sr(t)!==e)return!1;const s=t.match(ca);return s?(ge?location.hash:"")===s[0]:!0}function Sr(e){return decodeURI(e).replace(aa,"").replace(fa,"$1")}function da(e){return Ji.test(e)}function ha(e,t){var s,r,i,o,l,c,f;const n=Object.keys(e.locales).find(d=>d!=="root"&&!da(d)&&ua(t,`/${d}/`,!0))||"root";return Object.assign({},e,{localeIndex:n,lang:((s=e.locales[n])==null?void 0:s.lang)??e.lang,dir:((r=e.locales[n])==null?void 0:r.dir)??e.dir,title:((i=e.locales[n])==null?void 0:i.title)??e.title,titleTemplate:((o=e.locales[n])==null?void 0:o.titleTemplate)??e.titleTemplate,description:((l=e.locales[n])==null?void 0:l.description)??e.description,head:eo(e.head,((c=e.locales[n])==null?void 0:c.head)??[]),themeConfig:{...e.themeConfig,...(f=e.locales[n])==null?void 0:f.themeConfig}})}function Zi(e,t){const n=t.title||e.title,s=t.titleTemplate??e.titleTemplate;if(typeof s=="string"&&s.includes(":title"))return s.replace(/:title/g,n);const r=pa(e.title,s);return n===r.slice(3)?n:`${n}${r}`}function pa(e,t){return t===!1?"":t===!0||t===void 0?` | ${e}`:e===t?"":` | ${t}`}function ga(e,t){const[n,s]=t;if(n!=="meta")return!1;const r=Object.entries(s)[0];return r==null?!1:e.some(([i,o])=>i===n&&o[r[0]]===r[1])}function eo(e,t){return[...e.filter(n=>!ga(t,n)),...t]}const ma=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g,_a=/^[a-z]:/i;function Tr(e){const t=_a.exec(e),n=t?t[0]:"";return n+e.slice(n.length).replace(ma,"_").replace(/(^|\/)_+(?=[^/]*$)/,"$1")}const zn=new Set;function ya(e){if(zn.size===0){const n=typeof process=="object"&&(Gn==null?void 0:Gn.VITE_EXTRA_EXTENSIONS)||(qn==null?void 0:qn.VITE_EXTRA_EXTENSIONS)||"";("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip"+(n&&typeof n=="string"?","+n:"")).split(",").forEach(s=>zn.add(s))}const t=e.split(".").pop();return t==null||!zn.has(t.toLowerCase())}const ba=Symbol(),at=Qr(Uc);function ef(e){const t=ne(()=>ha(at.value,e.data.relativePath)),n=t.value.appearance,s=n==="force-dark"?ae(!0):n?ia({storageKey:la,initialValue:()=>typeof n=="string"?n:"auto",...typeof n=="object"?n:{}}):ae(!1),r=ae(ge?location.hash:"");return ge&&window.addEventListener("hashchange",()=>{r.value=location.hash}),Ne(()=>e.data,()=>{r.value=ge?location.hash:""}),{site:t,theme:ne(()=>t.value.themeConfig),page:ne(()=>e.data),frontmatter:ne(()=>e.data.frontmatter),params:ne(()=>e.data.params),lang:ne(()=>t.value.lang),dir:ne(()=>e.data.frontmatter.dir||t.value.dir),localeIndex:ne(()=>t.value.localeIndex||"root"),title:ne(()=>Zi(t.value,e.data)),description:ne(()=>e.data.description||t.value.description),isDark:s,hash:ne(()=>r.value)}}function va(){const e=vt(ba);if(!e)throw new Error("vitepress data not properly injected in app");return e}function wa(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function Ar(e){return Ji.test(e)||!e.startsWith("/")?e:wa(at.value.base,e)}function Ea(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t=t.replace(/\/$/,"/index"),ge){const n="/";t=Tr(t.slice(n.length).replace(/\//g,"_")||"index")+".md";let s=__VP_HASH_MAP__[t.toLowerCase()];if(s||(t=t.endsWith("_index.md")?t.slice(0,-9)+".md":t.slice(0,-3)+"_index.md",s=__VP_HASH_MAP__[t.toLowerCase()]),!s)return null;t=`${n}assets/${t}.${s}.js`}else t=`./${Tr(t.slice(1).replace(/\//g,"_"))}.md.js`;return t}let ln=[];function tf(e){ln.push(e),On(()=>{ln=ln.filter(t=>t!==e)})}function Ca(){let e=at.value.scrollOffset,t=0,n=24;if(typeof e=="object"&&"padding"in e&&(n=e.padding,e=e.selector),typeof e=="number")t=e;else if(typeof e=="string")t=Rr(e,n);else if(Array.isArray(e))for(const s of e){const r=Rr(s,n);if(r){t=r;break}}return t}function Rr(e,t){const n=document.querySelector(e);if(!n)return 0;const s=n.getBoundingClientRect().bottom;return s<0?0:s+t}const xa=Symbol(),to="http://a.com",Sa=()=>({path:"/",component:null,data:Qi});function nf(e,t){const n=vn(Sa()),s={route:n,go:r};async function r(l=ge?location.href:"/"){var c,f;l=Xn(l),await((c=s.onBeforeRouteChange)==null?void 0:c.call(s,l))!==!1&&(ge&&l!==Xn(location.href)&&(history.replaceState({scrollPosition:window.scrollY},""),history.pushState({},"",l)),await o(l),await((f=s.onAfterRouteChanged)==null?void 0:f.call(s,l)))}let i=null;async function o(l,c=0,f=!1){var b;if(await((b=s.onBeforePageLoad)==null?void 0:b.call(s,l))===!1)return;const d=new URL(l,to),h=i=d.pathname;try{let S=await e(h);if(!S)throw new Error(`Page not found: ${h}`);if(i===h){i=null;const{default:M,__pageData:N}=S;if(!M)throw new Error(`Invalid route component: ${M}`);n.path=ge?h:Ar(h),n.component=sn(M),n.data=sn(N),ge&&Cn(()=>{let B=at.value.base+N.relativePath.replace(/(?:(^|\/)index)?\.md$/,"$1");if(!at.value.cleanUrls&&!B.endsWith("/")&&(B+=".html"),B!==d.pathname&&(d.pathname=B,l=B+d.search+d.hash,history.replaceState({},"",l)),d.hash&&!c){let q=null;try{q=document.getElementById(decodeURIComponent(d.hash).slice(1))}catch(G){console.warn(G)}if(q){Or(q,d.hash);return}}window.scrollTo(0,c)})}}catch(S){if(!/fetch|Page not found/.test(S.message)&&!/^\/404(\.html|\/)?$/.test(l)&&console.error(S),!f)try{const M=await fetch(at.value.base+"hashmap.json");window.__VP_HASH_MAP__=await M.json(),await o(l,c,!0);return}catch{}i===h&&(i=null,n.path=ge?h:Ar(h),n.component=t?sn(t):null,n.data=Qi)}}return ge&&(history.state===null&&history.replaceState({},""),window.addEventListener("click",l=>{if(l.target.closest("button"))return;const f=l.target.closest("a");if(f&&!f.closest(".vp-raw")&&(f instanceof SVGElement||!f.download)){const{target:d}=f,{href:h,origin:b,pathname:S,hash:M,search:N}=new URL(f.href instanceof SVGAnimatedString?f.href.animVal:f.href,f.baseURI),B=new URL(location.href);!l.ctrlKey&&!l.shiftKey&&!l.altKey&&!l.metaKey&&!d&&b===B.origin&&ya(S)&&(l.preventDefault(),S===B.pathname&&N===B.search?(M!==B.hash&&(history.pushState({},"",h),window.dispatchEvent(new HashChangeEvent("hashchange",{oldURL:B.href,newURL:h}))),M?Or(f,M,f.classList.contains("header-anchor")):window.scrollTo(0,0)):r(h))}},{capture:!0}),window.addEventListener("popstate",async l=>{var c;l.state!==null&&(await o(Xn(location.href),l.state&&l.state.scrollPosition||0),(c=s.onAfterRouteChanged)==null||c.call(s,location.href))}),window.addEventListener("hashchange",l=>{l.preventDefault()})),s}function Ta(){const e=vt(xa);if(!e)throw new Error("useRouter() is called without provider.");return e}function no(){return Ta().route}function Or(e,t,n=!1){let s=null;try{s=e.classList.contains("header-anchor")?e:document.getElementById(decodeURIComponent(t).slice(1))}catch(r){console.warn(r)}if(s){let r=function(){!n||Math.abs(o-window.scrollY)>window.innerHeight?window.scrollTo(0,o):window.scrollTo({left:0,top:o,behavior:"smooth"})};const i=parseInt(window.getComputedStyle(s).paddingTop,10),o=window.scrollY+s.getBoundingClientRect().top-Ca()+i;requestAnimationFrame(r)}}function Xn(e){const t=new URL(e,to);return t.pathname=t.pathname.replace(/(^|\/)index(\.html)?$/,"$1"),at.value.cleanUrls?t.pathname=t.pathname.replace(/\.html$/,""):!t.pathname.endsWith("/")&&!t.pathname.endsWith(".html")&&(t.pathname+=".html"),t.pathname+t.search+t.hash}const Yn=()=>ln.forEach(e=>e()),sf=pi({name:"VitePressContent",props:{as:{type:[Object,String],default:"div"}},setup(e){const t=no(),{site:n}=va();return()=>fs(e.as,n.value.contentProps??{style:{position:"relative"}},[t.component?fs(t.component,{onVnodeMounted:Yn,onVnodeUpdated:Yn,onVnodeUnmounted:Yn}):"404 Page Not Found"])}}),rf=pi({setup(e,{slots:t}){const n=ae(!1);return Ct(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}});function of(){ge&&window.addEventListener("click",e=>{var n;const t=e.target;if(t.matches(".vp-code-group input")){const s=(n=t.parentElement)==null?void 0:n.parentElement;if(!s)return;const r=Array.from(s.querySelectorAll("input")).indexOf(t);if(r<0)return;const i=s.querySelector(".blocks");if(!i)return;const o=Array.from(i.children).find(f=>f.classList.contains("active"));if(!o)return;const l=i.children[r];if(!l||o===l)return;o.classList.remove("active"),l.classList.add("active");const c=s==null?void 0:s.querySelector(`label[for="${t.id}"]`);c==null||c.scrollIntoView({block:"nearest"})}})}function lf(){if(ge){const e=new WeakMap;window.addEventListener("click",t=>{var s;const n=t.target;if(n.matches('div[class*="language-"] > button.copy')){const r=n.parentElement,i=(s=n.nextElementSibling)==null?void 0:s.nextElementSibling;if(!r||!i)return;const o=/language-(shellscript|shell|bash|sh|zsh)/.test(r.className),l=[".vp-copy-ignore",".diff.remove"],c=i.cloneNode(!0);c.querySelectorAll(l.join(",")).forEach(d=>d.remove());let f=c.textContent||"";o&&(f=f.replace(/^ *(\$|>) /gm,"").trim()),Aa(f).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const d=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,d)})}})}}async function Aa(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection(),r=s?s.rangeCount>0&&s.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),r&&(s.removeAllRanges(),s.addRange(r)),n&&n.focus()}}function cf(e,t){let n=!0,s=[];const r=i=>{if(n){n=!1,i.forEach(l=>{const c=Jn(l);for(const f of document.head.children)if(f.isEqualNode(c)){s.push(f);return}});return}const o=i.map(Jn);s.forEach((l,c)=>{const f=o.findIndex(d=>d==null?void 0:d.isEqualNode(l??null));f!==-1?delete o[f]:(l==null||l.remove(),delete s[c])}),o.forEach(l=>l&&document.head.appendChild(l)),s=[...s,...o].filter(Boolean)};ai(()=>{const i=e.data,o=t.value,l=i&&i.description,c=i&&i.frontmatter.head||[],f=Zi(o,i);f!==document.title&&(document.title=f);const d=l||o.description;let h=document.querySelector("meta[name=description]");h?h.getAttribute("content")!==d&&h.setAttribute("content",d):Jn(["meta",{name:"description",content:d}]),r(eo(o.head,Oa(c)))})}function Jn([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),e==="script"&&!t.async&&(s.async=!1),s}function Ra(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function Oa(e){return e.filter(t=>!Ra(t))}const Qn=new Set,so=()=>document.createElement("link"),Ia=e=>{const t=so();t.rel="prefetch",t.href=e,document.head.appendChild(t)},La=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let tn;const Ma=ge&&(tn=so())&&tn.relList&&tn.relList.supports&&tn.relList.supports("prefetch")?Ia:La;function af(){if(!ge||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(i=>{i.forEach(o=>{if(o.isIntersecting){const l=o.target;n.unobserve(l);const{pathname:c}=l;if(!Qn.has(c)){Qn.add(c);const f=Ea(c);f&&Ma(f)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(i=>{const{hostname:o,pathname:l}=new URL(i.href instanceof SVGAnimatedString?i.href.animVal:i.href,i.baseURI),c=l.match(/\.\w+$/);c&&c[0]!==".html"||i.target!=="_blank"&&o===location.hostname&&(l!==location.pathname?n.observe(i):Qn.add(l))})})};Ct(s);const r=no();Ne(()=>r.path,s),On(()=>{n&&n.disconnect()})}export{qa as $,ja as A,El as B,Ca as C,Ha as D,Da as E,_e as F,Qr as G,tf as H,fe as I,$a as J,Ji as K,no as L,Ql as M,vt as N,Za as O,gs as P,Ya as Q,Cn as R,Qa as S,Vi as T,ge as U,wn as V,Ja as W,Hl as X,Ga as Y,Ua as Z,Xa as _,Hi as a,Ba as a0,ka as a1,cf as a2,xa as a3,ef as a4,ba as a5,sf as a6,rf as a7,at as a8,za as a9,nf as aa,Ea as ab,af as ac,lf as ad,of as ae,fs as af,Ni as b,Ka as c,pi as d,Wa as e,ya as f,Ar as g,ne as h,da as i,ae as j,Ct as k,Fi as l,ei as m,ms as n,Li as o,Pa as p,Fa as q,Va as r,ua as s,Na as t,va as u,Gi as v,il as w,Ne as x,ai as y,On as z}; diff --git a/assets/chunks/hhmm.apdfnDZY.js b/assets/chunks/hhmm.apdfnDZY.js new file mode 100644 index 000000000..ee86675b6 --- /dev/null +++ b/assets/chunks/hhmm.apdfnDZY.js @@ -0,0 +1 @@ +const s="/assets/google.AkcAA5qz.png",t="/assets/baidu.BzHzvwzy.png",o="/assets/xkcd.De4VfqBi.png",a="/assets/hhmm.CWWLJcVP.png";export{s as _,t as a,o as b,a as c}; diff --git a/assets/chunks/logo.BLgnOXGY.js b/assets/chunks/logo.BLgnOXGY.js new file mode 100644 index 000000000..f2ef2cd3e --- /dev/null +++ b/assets/chunks/logo.BLgnOXGY.js @@ -0,0 +1 @@ +const s="/assets/logo.Bu5BlKbI.png";export{s as _}; diff --git a/assets/chunks/theme.Bw3nEMJ8.js b/assets/chunks/theme.Bw3nEMJ8.js new file mode 100644 index 000000000..cae9ee1a5 --- /dev/null +++ b/assets/chunks/theme.Bw3nEMJ8.js @@ -0,0 +1 @@ +import{d as _,o as a,c as u,r as l,n as T,a as D,t as w,b as k,w as d,T as de,e as h,_ as b,u as Oe,i as je,f as Ue,g as ve,h as $,j as I,k as W,l as v,m as i,p as C,q as H,s as q,v as ie,x as G,y as Z,z as pe,A as ge,B as Ge,C as ze,D as z,F as M,E,G as ye,H as x,I as m,J as R,K as Pe,L as ee,M as Y,N as te,O as qe,P as Le,Q as We,R as Ke,S as Ve,U as oe,V as Re,W as Se,X as we,Y as Je,Z as Ye,$ as Qe,a0 as Xe}from"./framework.qh4ipt1c.js";const Ze=_({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(o){return(e,t)=>(a(),u("span",{class:T(["VPBadge",e.type])},[l(e.$slots,"default",{},()=>[D(w(e.text),1)])],2))}}),xe={key:0,class:"VPBackdrop"},et=_({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(o){return(e,t)=>(a(),k(de,{name:"fade"},{default:d(()=>[e.show?(a(),u("div",xe)):h("",!0)]),_:1}))}}),tt=b(et,[["__scopeId","data-v-37f86bc0"]]),L=Oe;function ot(o,e){let t,s=!1;return()=>{t&&clearTimeout(t),s?t=setTimeout(o,e):(o(),(s=!0)&&setTimeout(()=>s=!1,e))}}function le(o){return/^\//.test(o)?o:`/${o}`}function fe(o){const{pathname:e,search:t,hash:s,protocol:n}=new URL(o,"http://a.com");if(je(o)||o.startsWith("#")||!n.startsWith("http")||!Ue(e))return o;const{site:r}=L(),c=e.endsWith("/")||e.endsWith(".html")?o:o.replace(/(?:(^\.+)\/)?.*$/,`$1${e.replace(/(\.md)?$/,r.value.cleanUrls?"":".html")}${t}${s}`);return ve(c)}function J({removeCurrent:o=!0,correspondingLink:e=!1}={}){const{site:t,localeIndex:s,page:n,theme:r,hash:c}=L(),f=$(()=>{var P,g;return{index:s.value,label:(P=t.value.locales[s.value])==null?void 0:P.label,link:((g=t.value.locales[s.value])==null?void 0:g.link)||(s.value==="root"?"/":`/${s.value}/`)}});return{localeLinks:$(()=>Object.entries(t.value.locales).flatMap(([P,g])=>o&&f.value.label===g.label?[]:{index:P,text:g.label,link:st(g.link||(P==="root"?"/":`/${P}/`),r.value.i18nRouting!==!1&&e,n.value.relativePath.slice(f.value.link.length-1),!t.value.cleanUrls)+c.value})),currentLang:f}}function st(o,e,t,s){return e?o.replace(/\/$/,"")+le(t.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,s?".html":"")):o}const nt=o=>(C("data-v-9fc9f9e4"),o=o(),H(),o),at={class:"NotFound"},rt={class:"code"},it={class:"title"},lt=nt(()=>v("div",{class:"divider"},null,-1)),ct={class:"quote"},ut={class:"action"},dt=["href","aria-label"],vt=_({__name:"NotFound",setup(o){const{site:e}=L(),{localeLinks:t}=J({removeCurrent:!1}),s=I({link:"/",index:"root"});W(()=>{const r=window.location.pathname.replace(e.value.base,"").replace(/(^.*?\/).*$/,"/$1");t.value.length&&(s.value=t.value.find(({link:c})=>c.startsWith(r))||t.value[0])});const n=$(()=>{var r,c,f,p;return{code:404,title:"PAGE NOT FOUND",quote:"But if you don't change your direction, and if you keep looking, you may end up where you are heading.",linkLabel:"go to home",linkText:"Take me home",...s.value.index==="root"?(r=e.value.themeConfig)==null?void 0:r.notFound:(p=(f=(c=e.value.locales)==null?void 0:c[s.value.index])==null?void 0:f.themeConfig)==null?void 0:p.notFound}});return(r,c)=>(a(),u("div",at,[v("p",rt,w(n.value.code),1),v("h1",it,w(n.value.title),1),lt,v("blockquote",ct,w(n.value.quote),1),v("div",ut,[v("a",{class:"link",href:i(ve)(s.value.link),"aria-label":n.value.linkLabel},w(n.value.linkText),9,dt)])]))}}),pt=b(vt,[["__scopeId","data-v-9fc9f9e4"]]);function Ie(o,e){if(Array.isArray(o))return Q(o);if(o==null)return[];e=le(e);const t=Object.keys(o).sort((n,r)=>r.split("/").length-n.split("/").length).find(n=>e.startsWith(le(n))),s=t?o[t]:[];return Array.isArray(s)?Q(s):Q(s.items,s.base)}function ft(o){const e=[];let t=0;for(const s in o){const n=o[s];if(n.items){t=e.push(n);continue}e[t]||e.push({items:[]}),e[t].items.push(n)}return e}function ht(o){const e=[];function t(s){for(const n of s)n.text&&n.link&&e.push({text:n.text,link:n.link,docFooterText:n.docFooterText}),n.items&&t(n.items)}return t(o),e}function ce(o,e){return Array.isArray(e)?e.some(t=>ce(o,t)):q(o,e.link)?!0:e.items?ce(o,e.items):!1}function Q(o,e){return[...o].map(t=>{const s={...t},n=s.base||e;return n&&s.link&&(s.link=n+s.link),s.items&&(s.items=Q(s.items,n)),s})}function O(){const{frontmatter:o,page:e,theme:t}=L(),s=ie("(min-width: 960px)"),n=I(!1),r=$(()=>{const A=t.value.sidebar,S=e.value.relativePath;return A?Ie(A,S):[]}),c=I(r.value);G(r,(A,S)=>{JSON.stringify(A)!==JSON.stringify(S)&&(c.value=r.value)});const f=$(()=>o.value.sidebar!==!1&&c.value.length>0&&o.value.layout!=="home"),p=$(()=>P?o.value.aside==null?t.value.aside==="left":o.value.aside==="left":!1),P=$(()=>o.value.layout==="home"?!1:o.value.aside!=null?!!o.value.aside:t.value.aside!==!1),g=$(()=>f.value&&s.value),y=$(()=>f.value?ft(c.value):[]);function V(){n.value=!0}function N(){n.value=!1}function B(){n.value?N():V()}return{isOpen:n,sidebar:c,sidebarGroups:y,hasSidebar:f,hasAside:P,leftAside:p,isSidebarEnabled:g,open:V,close:N,toggle:B}}function _t(o,e){let t;Z(()=>{t=o.value?document.activeElement:void 0}),W(()=>{window.addEventListener("keyup",s)}),pe(()=>{window.removeEventListener("keyup",s)});function s(n){n.key==="Escape"&&o.value&&(e(),t==null||t.focus())}}function mt(o){const{page:e,hash:t}=L(),s=I(!1),n=$(()=>o.value.collapsed!=null),r=$(()=>!!o.value.link),c=I(!1),f=()=>{c.value=q(e.value.relativePath,o.value.link)};G([e,o,t],f),W(f);const p=$(()=>c.value?!0:o.value.items?ce(e.value.relativePath,o.value.items):!1),P=$(()=>!!(o.value.items&&o.value.items.length));Z(()=>{s.value=!!(n.value&&o.value.collapsed)}),ge(()=>{(c.value||p.value)&&(s.value=!1)});function g(){n.value&&(s.value=!s.value)}return{collapsed:s,collapsible:n,isLink:r,isActiveLink:c,hasActiveLink:p,hasChildren:P,toggle:g}}function kt(){const{hasSidebar:o}=O(),e=ie("(min-width: 960px)"),t=ie("(min-width: 1280px)");return{isAsideEnabled:$(()=>!t.value&&!e.value?!1:o.value?t.value:e.value)}}const ue=[];function Te(o){return typeof o.outline=="object"&&!Array.isArray(o.outline)&&o.outline.label||o.outlineTitle||"On this page"}function he(o){const e=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(t=>t.id&&t.hasChildNodes()).map(t=>{const s=Number(t.tagName[1]);return{element:t,title:bt(t),link:"#"+t.id,level:s}});return $t(e,o)}function bt(o){let e="";for(const t of o.childNodes)if(t.nodeType===1){if(t.classList.contains("VPBadge")||t.classList.contains("header-anchor")||t.classList.contains("ignore-header"))continue;e+=t.textContent}else t.nodeType===3&&(e+=t.textContent);return e.trim()}function $t(o,e){if(e===!1)return[];const t=(typeof e=="object"&&!Array.isArray(e)?e.level:e)||2,[s,n]=typeof t=="number"?[t,t]:t==="deep"?[2,6]:t;o=o.filter(c=>c.level>=s&&c.level<=n),ue.length=0;for(const{element:c,link:f}of o)ue.push({element:c,link:f});const r=[];e:for(let c=0;c=0;p--){const P=o[p];if(P.level{requestAnimationFrame(r),window.addEventListener("scroll",s)}),Ge(()=>{c(location.hash)}),pe(()=>{window.removeEventListener("scroll",s)});function r(){if(!t.value)return;const f=window.scrollY,p=window.innerHeight,P=document.body.offsetHeight,g=Math.abs(f+p-P)<1,y=ue.map(({element:N,link:B})=>({link:B,top:yt(N)})).filter(({top:N})=>!Number.isNaN(N)).sort((N,B)=>N.top-B.top);if(!y.length){c(null);return}if(f<1){c(null);return}if(g){c(y[y.length-1].link);return}let V=null;for(const{link:N,top:B}of y){if(B>f+ze()+4)break;V=N}c(V)}function c(f){n&&n.classList.remove("active"),f==null?n=null:n=o.value.querySelector(`a[href="${decodeURIComponent(f)}"]`);const p=n;p?(p.classList.add("active"),e.value.style.top=p.offsetTop+39+"px",e.value.style.opacity="1"):(e.value.style.top="33px",e.value.style.opacity="0")}}function yt(o){let e=0;for(;o!==document.body;){if(o===null)return NaN;e+=o.offsetTop,o=o.offsetParent}return e}const Pt=["href","title"],Lt=_({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(o){function e({target:t}){const s=t.href.split("#")[1],n=document.getElementById(decodeURIComponent(s));n==null||n.focus({preventScroll:!0})}return(t,s)=>{const n=z("VPDocOutlineItem",!0);return a(),u("ul",{class:T(["VPDocOutlineItem",t.root?"root":"nested"])},[(a(!0),u(M,null,E(t.headers,({children:r,link:c,title:f})=>(a(),u("li",null,[v("a",{class:"outline-link",href:c,onClick:e,title:f},w(f),9,Pt),r!=null&&r.length?(a(),k(n,{key:0,headers:r},null,8,["headers"])):h("",!0)]))),256))],2)}}}),Ne=b(Lt,[["__scopeId","data-v-e6fbb44e"]]),Vt={class:"content"},St={"aria-level":"2",class:"outline-title",id:"doc-outline-aria-label",role:"heading"},wt=_({__name:"VPDocAsideOutline",setup(o){const{frontmatter:e,theme:t}=L(),s=ye([]);x(()=>{s.value=he(e.value.outline??t.value.outline)});const n=I(),r=I();return gt(n,r),(c,f)=>(a(),u("nav",{"aria-labelledby":"doc-outline-aria-label",class:T(["VPDocAsideOutline",{"has-outline":s.value.length>0}]),ref_key:"container",ref:n,role:"navigation"},[v("div",Vt,[v("div",{class:"outline-marker",ref_key:"marker",ref:r},null,512),v("div",St,w(i(Te)(i(t))),1),m(Ne,{headers:s.value,root:!0},null,8,["headers"])])],2))}}),It=b(wt,[["__scopeId","data-v-03d5e4c2"]]),Tt={class:"VPDocAsideCarbonAds"},Nt=_({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(o){const e=()=>null;return(t,s)=>(a(),u("div",Tt,[m(i(e),{"carbon-ads":t.carbonAds},null,8,["carbon-ads"])]))}}),Mt=o=>(C("data-v-5aeca5f1"),o=o(),H(),o),Bt={class:"VPDocAside"},At=Mt(()=>v("div",{class:"spacer"},null,-1)),Ct=_({__name:"VPDocAside",setup(o){const{theme:e}=L();return(t,s)=>(a(),u("div",Bt,[l(t.$slots,"aside-top",{},void 0,!0),l(t.$slots,"aside-outline-before",{},void 0,!0),m(It),l(t.$slots,"aside-outline-after",{},void 0,!0),At,l(t.$slots,"aside-ads-before",{},void 0,!0),i(e).carbonAds?(a(),k(Nt,{key:0,"carbon-ads":i(e).carbonAds},null,8,["carbon-ads"])):h("",!0),l(t.$slots,"aside-ads-after",{},void 0,!0),l(t.$slots,"aside-bottom",{},void 0,!0)]))}}),Ht=b(Ct,[["__scopeId","data-v-5aeca5f1"]]);function Et(){const{theme:o,page:e}=L();return $(()=>{const{text:t="Edit this page",pattern:s=""}=o.value.editLink||{};let n;return typeof s=="function"?n=s(e.value):n=s.replace(/:path/g,e.value.filePath),{url:n,text:t}})}function Ft(){const{page:o,theme:e,frontmatter:t}=L();return $(()=>{var P,g,y,V,N,B,A,S;const s=Ie(e.value.sidebar,o.value.relativePath),n=ht(s),r=Dt(n,j=>j.link.replace(/[?#].*$/,"")),c=r.findIndex(j=>q(o.value.relativePath,j.link)),f=((P=e.value.docFooter)==null?void 0:P.prev)===!1&&!t.value.prev||t.value.prev===!1,p=((g=e.value.docFooter)==null?void 0:g.next)===!1&&!t.value.next||t.value.next===!1;return{prev:f?void 0:{text:(typeof t.value.prev=="string"?t.value.prev:typeof t.value.prev=="object"?t.value.prev.text:void 0)??((y=r[c-1])==null?void 0:y.docFooterText)??((V=r[c-1])==null?void 0:V.text),link:(typeof t.value.prev=="object"?t.value.prev.link:void 0)??((N=r[c-1])==null?void 0:N.link)},next:p?void 0:{text:(typeof t.value.next=="string"?t.value.next:typeof t.value.next=="object"?t.value.next.text:void 0)??((B=r[c+1])==null?void 0:B.docFooterText)??((A=r[c+1])==null?void 0:A.text),link:(typeof t.value.next=="object"?t.value.next.link:void 0)??((S=r[c+1])==null?void 0:S.link)}}})}function Dt(o,e){const t=new Set;return o.filter(s=>{const n=e(s);return t.has(n)?!1:t.add(n)})}const F=_({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(o){const e=o,t=$(()=>e.tag??(e.href?"a":"span")),s=$(()=>e.href&&Pe.test(e.href));return(n,r)=>(a(),k(R(t.value),{class:T(["VPLink",{link:n.href,"vp-external-link-icon":s.value,"no-icon":n.noIcon}]),href:n.href?i(fe)(n.href):void 0,target:n.target??(s.value?"_blank":void 0),rel:n.rel??(s.value?"noreferrer":void 0)},{default:d(()=>[l(n.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),Ot={class:"VPLastUpdated"},jt=["datetime"],Ut=_({__name:"VPDocFooterLastUpdated",setup(o){const{theme:e,page:t,frontmatter:s,lang:n}=L(),r=$(()=>new Date(s.value.lastUpdated??t.value.lastUpdated)),c=$(()=>r.value.toISOString()),f=I("");return W(()=>{Z(()=>{var p,P,g;f.value=new Intl.DateTimeFormat((P=(p=e.value.lastUpdated)==null?void 0:p.formatOptions)!=null&&P.forceLocale?n.value:void 0,((g=e.value.lastUpdated)==null?void 0:g.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(r.value)})}),(p,P)=>{var g;return a(),u("p",Ot,[D(w(((g=i(e).lastUpdated)==null?void 0:g.text)||i(e).lastUpdatedText||"Last updated")+": ",1),v("time",{datetime:c.value},w(f.value),9,jt)])}}}),Gt=b(Ut,[["__scopeId","data-v-1997c18c"]]),Me=o=>(C("data-v-021f7413"),o=o(),H(),o),zt={key:0,class:"VPDocFooter"},qt={key:0,class:"edit-info"},Wt={key:0,class:"edit-link"},Kt=Me(()=>v("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),Rt={key:1,class:"last-updated"},Jt={key:1,class:"prev-next","aria-labelledby":"doc-footer-aria-label"},Yt=Me(()=>v("span",{class:"visually-hidden",id:"doc-footer-aria-label"},"Pager",-1)),Qt={class:"pager"},Xt=["innerHTML"],Zt=["innerHTML"],xt={class:"pager"},eo=["innerHTML"],to=["innerHTML"],oo=_({__name:"VPDocFooter",setup(o){const{theme:e,page:t,frontmatter:s}=L(),n=Et(),r=Ft(),c=$(()=>e.value.editLink&&s.value.editLink!==!1),f=$(()=>t.value.lastUpdated&&s.value.lastUpdated!==!1),p=$(()=>c.value||f.value||r.value.prev||r.value.next);return(P,g)=>{var y,V,N,B;return p.value?(a(),u("footer",zt,[l(P.$slots,"doc-footer-before",{},void 0,!0),c.value||f.value?(a(),u("div",qt,[c.value?(a(),u("div",Wt,[m(F,{class:"edit-link-button",href:i(n).url,"no-icon":!0},{default:d(()=>[Kt,D(" "+w(i(n).text),1)]),_:1},8,["href"])])):h("",!0),f.value?(a(),u("div",Rt,[m(Gt)])):h("",!0)])):h("",!0),(y=i(r).prev)!=null&&y.link||(V=i(r).next)!=null&&V.link?(a(),u("nav",Jt,[Yt,v("div",Qt,[(N=i(r).prev)!=null&&N.link?(a(),k(F,{key:0,class:"pager-link prev",href:i(r).prev.link},{default:d(()=>{var A;return[v("span",{class:"desc",innerHTML:((A=i(e).docFooter)==null?void 0:A.prev)||"Previous page"},null,8,Xt),v("span",{class:"title",innerHTML:i(r).prev.text},null,8,Zt)]}),_:1},8,["href"])):h("",!0)]),v("div",xt,[(B=i(r).next)!=null&&B.link?(a(),k(F,{key:0,class:"pager-link next",href:i(r).next.link},{default:d(()=>{var A;return[v("span",{class:"desc",innerHTML:((A=i(e).docFooter)==null?void 0:A.next)||"Next page"},null,8,eo),v("span",{class:"title",innerHTML:i(r).next.text},null,8,to)]}),_:1},8,["href"])):h("",!0)])])):h("",!0)])):h("",!0)}}}),so=b(oo,[["__scopeId","data-v-021f7413"]]),no=o=>(C("data-v-1a27caea"),o=o(),H(),o),ao={class:"container"},ro=no(()=>v("div",{class:"aside-curtain"},null,-1)),io={class:"aside-container"},lo={class:"aside-content"},co={class:"content"},uo={class:"content-container"},vo={class:"main"},po=_({__name:"VPDoc",setup(o){const{theme:e}=L(),t=ee(),{hasSidebar:s,hasAside:n,leftAside:r}=O(),c=$(()=>t.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(f,p)=>{const P=z("Content");return a(),u("div",{class:T(["VPDoc",{"has-sidebar":i(s),"has-aside":i(n)}])},[l(f.$slots,"doc-top",{},void 0,!0),v("div",ao,[i(n)?(a(),u("div",{key:0,class:T(["aside",{"left-aside":i(r)}])},[ro,v("div",io,[v("div",lo,[m(Ht,null,{"aside-top":d(()=>[l(f.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":d(()=>[l(f.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":d(()=>[l(f.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":d(()=>[l(f.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":d(()=>[l(f.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":d(()=>[l(f.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):h("",!0),v("div",co,[v("div",uo,[l(f.$slots,"doc-before",{},void 0,!0),v("main",vo,[m(P,{class:T(["vp-doc",[c.value,i(e).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),m(so,null,{"doc-footer-before":d(()=>[l(f.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),l(f.$slots,"doc-after",{},void 0,!0)])])]),l(f.$slots,"doc-bottom",{},void 0,!0)],2)}}}),fo=b(po,[["__scopeId","data-v-1a27caea"]]),ho=_({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(o){const e=o,t=$(()=>e.href&&Pe.test(e.href)),s=$(()=>e.tag||e.href?"a":"button");return(n,r)=>(a(),k(R(s.value),{class:T(["VPButton",[n.size,n.theme]]),href:n.href?i(fe)(n.href):void 0,target:e.target??(t.value?"_blank":void 0),rel:e.rel??(t.value?"noreferrer":void 0)},{default:d(()=>[D(w(n.text),1)]),_:1},8,["class","href","target","rel"]))}}),_o=b(ho,[["__scopeId","data-v-987327ba"]]),mo=["src","alt"],ko=_({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(o){return(e,t)=>{const s=z("VPImage",!0);return e.image?(a(),u(M,{key:0},[typeof e.image=="string"||"src"in e.image?(a(),u("img",Y({key:0,class:"VPImage"},typeof e.image=="string"?e.$attrs:{...e.image,...e.$attrs},{src:i(ve)(typeof e.image=="string"?e.image:e.image.src),alt:e.alt??(typeof e.image=="string"?"":e.image.alt||"")}),null,16,mo)):(a(),u(M,{key:1},[m(s,Y({class:"dark",image:e.image.dark,alt:e.image.alt},e.$attrs),null,16,["image","alt"]),m(s,Y({class:"light",image:e.image.light,alt:e.image.alt},e.$attrs),null,16,["image","alt"])],64))],64)):h("",!0)}}}),X=b(ko,[["__scopeId","data-v-1d8fed93"]]),bo=o=>(C("data-v-b22db234"),o=o(),H(),o),$o={class:"container"},go={class:"main"},yo={key:0,class:"name"},Po=["innerHTML"],Lo=["innerHTML"],Vo=["innerHTML"],So={key:0,class:"actions"},wo={key:0,class:"image"},Io={class:"image-container"},To=bo(()=>v("div",{class:"image-bg"},null,-1)),No=_({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(o){const e=te("hero-image-slot-exists");return(t,s)=>(a(),u("div",{class:T(["VPHero",{"has-image":t.image||i(e)}])},[v("div",$o,[v("div",go,[l(t.$slots,"home-hero-info-before",{},void 0,!0),l(t.$slots,"home-hero-info",{},()=>[t.name?(a(),u("h1",yo,[v("span",{innerHTML:t.name,class:"clip"},null,8,Po)])):h("",!0),t.text?(a(),u("p",{key:1,innerHTML:t.text,class:"text"},null,8,Lo)):h("",!0),t.tagline?(a(),u("p",{key:2,innerHTML:t.tagline,class:"tagline"},null,8,Vo)):h("",!0)],!0),l(t.$slots,"home-hero-info-after",{},void 0,!0),t.actions?(a(),u("div",So,[(a(!0),u(M,null,E(t.actions,n=>(a(),u("div",{key:n.link,class:"action"},[m(_o,{tag:"a",size:"medium",theme:n.theme,text:n.text,href:n.link,target:n.target,rel:n.rel},null,8,["theme","text","href","target","rel"])]))),128))])):h("",!0),l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),t.image||i(e)?(a(),u("div",wo,[v("div",Io,[To,l(t.$slots,"home-hero-image",{},()=>[t.image?(a(),k(X,{key:0,class:"image-src",image:t.image},null,8,["image"])):h("",!0)],!0)])])):h("",!0)])],2))}}),Mo=b(No,[["__scopeId","data-v-b22db234"]]),Bo=_({__name:"VPHomeHero",setup(o){const{frontmatter:e}=L();return(t,s)=>i(e).hero?(a(),k(Mo,{key:0,class:"VPHomeHero",name:i(e).hero.name,text:i(e).hero.text,tagline:i(e).hero.tagline,image:i(e).hero.image,actions:i(e).hero.actions},{"home-hero-info-before":d(()=>[l(t.$slots,"home-hero-info-before")]),"home-hero-info":d(()=>[l(t.$slots,"home-hero-info")]),"home-hero-info-after":d(()=>[l(t.$slots,"home-hero-info-after")]),"home-hero-actions-after":d(()=>[l(t.$slots,"home-hero-actions-after")]),"home-hero-image":d(()=>[l(t.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):h("",!0)}}),Ao=o=>(C("data-v-5e09925b"),o=o(),H(),o),Co={class:"box"},Ho={key:0,class:"icon"},Eo=["innerHTML"],Fo=["innerHTML"],Do=["innerHTML"],Oo={key:4,class:"link-text"},jo={class:"link-text-value"},Uo=Ao(()=>v("span",{class:"vpi-arrow-right link-text-icon"},null,-1)),Go=_({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(o){return(e,t)=>(a(),k(F,{class:"VPFeature",href:e.link,rel:e.rel,target:e.target,"no-icon":!0,tag:e.link?"a":"div"},{default:d(()=>[v("article",Co,[typeof e.icon=="object"&&e.icon.wrap?(a(),u("div",Ho,[m(X,{image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])])):typeof e.icon=="object"?(a(),k(X,{key:1,image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])):e.icon?(a(),u("div",{key:2,class:"icon",innerHTML:e.icon},null,8,Eo)):h("",!0),v("h2",{class:"title",innerHTML:e.title},null,8,Fo),e.details?(a(),u("p",{key:3,class:"details",innerHTML:e.details},null,8,Do)):h("",!0),e.linkText?(a(),u("div",Oo,[v("p",jo,[D(w(e.linkText)+" ",1),Uo])])):h("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),zo=b(Go,[["__scopeId","data-v-5e09925b"]]),qo={key:0,class:"VPFeatures"},Wo={class:"container"},Ko={class:"items"},Ro=_({__name:"VPFeatures",props:{features:{}},setup(o){const e=o,t=$(()=>{const s=e.features.length;if(s){if(s===2)return"grid-2";if(s===3)return"grid-3";if(s%3===0)return"grid-6";if(s>3)return"grid-4"}else return});return(s,n)=>s.features?(a(),u("div",qo,[v("div",Wo,[v("div",Ko,[(a(!0),u(M,null,E(s.features,r=>(a(),u("div",{key:r.title,class:T(["item",[t.value]])},[m(zo,{icon:r.icon,title:r.title,details:r.details,link:r.link,"link-text":r.linkText,rel:r.rel,target:r.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):h("",!0)}}),Jo=b(Ro,[["__scopeId","data-v-409657de"]]),Yo=_({__name:"VPHomeFeatures",setup(o){const{frontmatter:e}=L();return(t,s)=>i(e).features?(a(),k(Jo,{key:0,class:"VPHomeFeatures",features:i(e).features},null,8,["features"])):h("",!0)}}),Qo=_({__name:"VPHomeContent",setup(o){const{width:e}=qe({includeScrollbar:!1});return(t,s)=>(a(),u("div",{class:"vp-doc container",style:Le(i(e)?{"--vp-offset":`calc(50% - ${i(e)/2}px)`}:{})},[l(t.$slots,"default",{},void 0,!0)],4))}}),Xo=b(Qo,[["__scopeId","data-v-7256f64e"]]),Zo={class:"VPHome"},xo=_({__name:"VPHome",setup(o){const{frontmatter:e}=L();return(t,s)=>{const n=z("Content");return a(),u("div",Zo,[l(t.$slots,"home-hero-before",{},void 0,!0),m(Bo,null,{"home-hero-info-before":d(()=>[l(t.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":d(()=>[l(t.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":d(()=>[l(t.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":d(()=>[l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":d(()=>[l(t.$slots,"home-hero-image",{},void 0,!0)]),_:3}),l(t.$slots,"home-hero-after",{},void 0,!0),l(t.$slots,"home-features-before",{},void 0,!0),m(Yo),l(t.$slots,"home-features-after",{},void 0,!0),i(e).markdownStyles!==!1?(a(),k(Xo,{key:0},{default:d(()=>[m(n)]),_:1})):(a(),k(n,{key:1}))])}}}),es=b(xo,[["__scopeId","data-v-9b112d22"]]),ts={},os={class:"VPPage"};function ss(o,e){const t=z("Content");return a(),u("div",os,[l(o.$slots,"page-top"),m(t),l(o.$slots,"page-bottom")])}const ns=b(ts,[["render",ss]]),as=_({__name:"VPContent",setup(o){const{page:e,frontmatter:t}=L(),{hasSidebar:s}=O();return(n,r)=>(a(),u("div",{class:T(["VPContent",{"has-sidebar":i(s),"is-home":i(t).layout==="home"}]),id:"VPContent"},[i(e).isNotFound?l(n.$slots,"not-found",{key:0},()=>[m(pt)],!0):i(t).layout==="page"?(a(),k(ns,{key:1},{"page-top":d(()=>[l(n.$slots,"page-top",{},void 0,!0)]),"page-bottom":d(()=>[l(n.$slots,"page-bottom",{},void 0,!0)]),_:3})):i(t).layout==="home"?(a(),k(es,{key:2},{"home-hero-before":d(()=>[l(n.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":d(()=>[l(n.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":d(()=>[l(n.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":d(()=>[l(n.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":d(()=>[l(n.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":d(()=>[l(n.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":d(()=>[l(n.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":d(()=>[l(n.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":d(()=>[l(n.$slots,"home-features-after",{},void 0,!0)]),_:3})):i(t).layout&&i(t).layout!=="doc"?(a(),k(R(i(t).layout),{key:3})):(a(),k(fo,{key:4},{"doc-top":d(()=>[l(n.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":d(()=>[l(n.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":d(()=>[l(n.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":d(()=>[l(n.$slots,"doc-before",{},void 0,!0)]),"doc-after":d(()=>[l(n.$slots,"doc-after",{},void 0,!0)]),"aside-top":d(()=>[l(n.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":d(()=>[l(n.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":d(()=>[l(n.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":d(()=>[l(n.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":d(()=>[l(n.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":d(()=>[l(n.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),rs=b(as,[["__scopeId","data-v-d775bacf"]]),is={class:"container"},ls=["innerHTML"],cs=["innerHTML"],us=_({__name:"VPFooter",setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:s}=O();return(n,r)=>i(e).footer&&i(t).footer!==!1?(a(),u("footer",{key:0,class:T(["VPFooter",{"has-sidebar":i(s)}])},[v("div",is,[i(e).footer.message?(a(),u("p",{key:0,class:"message",innerHTML:i(e).footer.message},null,8,ls)):h("",!0),i(e).footer.copyright?(a(),u("p",{key:1,class:"copyright",innerHTML:i(e).footer.copyright},null,8,cs)):h("",!0)])],2)):h("",!0)}}),ds=b(us,[["__scopeId","data-v-d072bf94"]]);function vs(){const{theme:o,frontmatter:e}=L(),t=ye([]),s=$(()=>t.value.length>0);return x(()=>{t.value=he(e.value.outline??o.value.outline)}),{headers:t,hasLocalNav:s}}const ps=o=>(C("data-v-cfdfe32f"),o=o(),H(),o),fs={class:"menu-text"},hs=ps(()=>v("span",{class:"vpi-chevron-right icon"},null,-1)),_s={class:"header"},ms={class:"outline"},ks=_({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(o){const e=o,{theme:t}=L(),s=I(!1),n=I(0),r=I(),c=I();function f(y){var V;(V=r.value)!=null&&V.contains(y.target)||(s.value=!1)}G(s,y=>{if(y){document.addEventListener("click",f);return}document.removeEventListener("click",f)}),We("Escape",()=>{s.value=!1}),x(()=>{s.value=!1});function p(){s.value=!s.value,n.value=window.innerHeight+Math.min(window.scrollY-e.navHeight,0)}function P(y){y.target.classList.contains("outline-link")&&(c.value&&(c.value.style.transition="none"),Ke(()=>{s.value=!1}))}function g(){s.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(y,V)=>(a(),u("div",{class:"VPLocalNavOutlineDropdown",style:Le({"--vp-vh":n.value+"px"}),ref_key:"main",ref:r},[y.headers.length>0?(a(),u("button",{key:0,onClick:p,class:T({open:s.value})},[v("span",fs,w(i(Te)(i(t))),1),hs],2)):(a(),u("button",{key:1,onClick:g},w(i(t).returnToTopLabel||"Return to top"),1)),m(de,{name:"flyout"},{default:d(()=>[s.value?(a(),u("div",{key:0,ref_key:"items",ref:c,class:"items",onClick:P},[v("div",_s,[v("a",{class:"top-link",href:"#",onClick:g},w(i(t).returnToTopLabel||"Return to top"),1)]),v("div",ms,[m(Ne,{headers:y.headers},null,8,["headers"])])],512)):h("",!0)]),_:1})],4))}}),bs=b(ks,[["__scopeId","data-v-cfdfe32f"]]),$s=o=>(C("data-v-75cda52d"),o=o(),H(),o),gs={class:"container"},ys=["aria-expanded"],Ps=$s(()=>v("span",{class:"vpi-align-left menu-icon"},null,-1)),Ls={class:"menu-text"},Vs=_({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:s}=O(),{headers:n}=vs(),{y:r}=Ve(),c=I(0);W(()=>{c.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))}),x(()=>{n.value=he(t.value.outline??e.value.outline)});const f=$(()=>n.value.length===0),p=$(()=>f.value&&!s.value),P=$(()=>({VPLocalNav:!0,"has-sidebar":s.value,empty:f.value,fixed:p.value}));return(g,y)=>i(t).layout!=="home"&&(!p.value||i(r)>=c.value)?(a(),u("div",{key:0,class:T(P.value)},[v("div",gs,[i(s)?(a(),u("button",{key:0,class:"menu","aria-expanded":g.open,"aria-controls":"VPSidebarNav",onClick:y[0]||(y[0]=V=>g.$emit("open-menu"))},[Ps,v("span",Ls,w(i(e).sidebarMenuLabel||"Menu"),1)],8,ys)):h("",!0),m(bs,{headers:i(n),navHeight:c.value},null,8,["headers","navHeight"])])],2)):h("",!0)}}),Ss=b(Vs,[["__scopeId","data-v-75cda52d"]]);function ws(){const o=I(!1);function e(){o.value=!0,window.addEventListener("resize",n)}function t(){o.value=!1,window.removeEventListener("resize",n)}function s(){o.value?t():e()}function n(){window.outerWidth>=768&&t()}const r=ee();return G(()=>r.path,t),{isScreenOpen:o,openScreen:e,closeScreen:t,toggleScreen:s}}const Is={},Ts={class:"VPSwitch",type:"button",role:"switch"},Ns={class:"check"},Ms={key:0,class:"icon"};function Bs(o,e){return a(),u("button",Ts,[v("span",Ns,[o.$slots.default?(a(),u("span",Ms,[l(o.$slots,"default",{},void 0,!0)])):h("",!0)])])}const As=b(Is,[["render",Bs],["__scopeId","data-v-60849eec"]]),Be=o=>(C("data-v-b9bf3ea7"),o=o(),H(),o),Cs=Be(()=>v("span",{class:"vpi-sun sun"},null,-1)),Hs=Be(()=>v("span",{class:"vpi-moon moon"},null,-1)),Es=_({__name:"VPSwitchAppearance",setup(o){const{isDark:e,theme:t}=L(),s=te("toggle-appearance",()=>{e.value=!e.value}),n=$(()=>e.value?t.value.lightModeSwitchTitle||"Switch to light theme":t.value.darkModeSwitchTitle||"Switch to dark theme");return(r,c)=>(a(),k(As,{title:n.value,class:"VPSwitchAppearance","aria-checked":i(e),onClick:i(s)},{default:d(()=>[Cs,Hs]),_:1},8,["title","aria-checked","onClick"]))}}),_e=b(Es,[["__scopeId","data-v-b9bf3ea7"]]),Fs={key:0,class:"VPNavBarAppearance"},Ds=_({__name:"VPNavBarAppearance",setup(o){const{site:e}=L();return(t,s)=>i(e).appearance&&i(e).appearance!=="force-dark"?(a(),u("div",Fs,[m(_e)])):h("",!0)}}),Os=b(Ds,[["__scopeId","data-v-de0ca626"]]),me=I();let Ae=!1,re=0;function js(o){const e=I(!1);if(oe){!Ae&&Us(),re++;const t=G(me,s=>{var n,r,c;s===o.el.value||(n=o.el.value)!=null&&n.contains(s)?(e.value=!0,(r=o.onFocus)==null||r.call(o)):(e.value=!1,(c=o.onBlur)==null||c.call(o))});pe(()=>{t(),re--,re||Gs()})}return Re(e)}function Us(){document.addEventListener("focusin",Ce),Ae=!0,me.value=document.activeElement}function Gs(){document.removeEventListener("focusin",Ce)}function Ce(){me.value=document.activeElement}const zs={class:"VPMenuLink"},qs=_({__name:"VPMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,s)=>(a(),u("div",zs,[m(F,{class:T({active:i(q)(i(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel},{default:d(()=>[D(w(t.item.text),1)]),_:1},8,["class","href","target","rel"])]))}}),se=b(qs,[["__scopeId","data-v-31327df9"]]),Ws={class:"VPMenuGroup"},Ks={key:0,class:"title"},Rs=_({__name:"VPMenuGroup",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),u("div",Ws,[e.text?(a(),u("p",Ks,w(e.text),1)):h("",!0),(a(!0),u(M,null,E(e.items,s=>(a(),u(M,null,["link"in s?(a(),k(se,{key:0,item:s},null,8,["item"])):h("",!0)],64))),256))]))}}),Js=b(Rs,[["__scopeId","data-v-4f28a81b"]]),Ys={class:"VPMenu"},Qs={key:0,class:"items"},Xs=_({__name:"VPMenu",props:{items:{}},setup(o){return(e,t)=>(a(),u("div",Ys,[e.items?(a(),u("div",Qs,[(a(!0),u(M,null,E(e.items,s=>(a(),u(M,{key:s.text},["link"in s?(a(),k(se,{key:0,item:s},null,8,["item"])):(a(),k(Js,{key:1,text:s.text,items:s.items},null,8,["text","items"]))],64))),128))])):h("",!0),l(e.$slots,"default",{},void 0,!0)]))}}),Zs=b(Xs,[["__scopeId","data-v-dde3ef49"]]),xs=o=>(C("data-v-a7c773c9"),o=o(),H(),o),en=["aria-expanded","aria-label"],tn={key:0,class:"text"},on=["innerHTML"],sn=xs(()=>v("span",{class:"vpi-chevron-down text-icon"},null,-1)),nn={key:1,class:"vpi-more-horizontal icon"},an={class:"menu"},rn=_({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(o){const e=I(!1),t=I();js({el:t,onBlur:s});function s(){e.value=!1}return(n,r)=>(a(),u("div",{class:"VPFlyout",ref_key:"el",ref:t,onMouseenter:r[1]||(r[1]=c=>e.value=!0),onMouseleave:r[2]||(r[2]=c=>e.value=!1)},[v("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":e.value,"aria-label":n.label,onClick:r[0]||(r[0]=c=>e.value=!e.value)},[n.button||n.icon?(a(),u("span",tn,[n.icon?(a(),u("span",{key:0,class:T([n.icon,"option-icon"])},null,2)):h("",!0),n.button?(a(),u("span",{key:1,innerHTML:n.button},null,8,on)):h("",!0),sn])):(a(),u("span",nn))],8,en),v("div",an,[m(Zs,{items:n.items},{default:d(()=>[l(n.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),ke=b(rn,[["__scopeId","data-v-a7c773c9"]]),ln=["href","aria-label","innerHTML"],cn=_({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(o){const e=o,t=$(()=>typeof e.icon=="object"?e.icon.svg:``);return(s,n)=>(a(),u("a",{class:"VPSocialLink no-icon",href:s.link,"aria-label":s.ariaLabel??(typeof s.icon=="string"?s.icon:""),target:"_blank",rel:"noopener",innerHTML:t.value},null,8,ln))}}),un=b(cn,[["__scopeId","data-v-dad2dcb9"]]),dn={class:"VPSocialLinks"},vn=_({__name:"VPSocialLinks",props:{links:{}},setup(o){return(e,t)=>(a(),u("div",dn,[(a(!0),u(M,null,E(e.links,({link:s,icon:n,ariaLabel:r})=>(a(),k(un,{key:s,icon:n,link:s,ariaLabel:r},null,8,["icon","link","ariaLabel"]))),128))]))}}),be=b(vn,[["__scopeId","data-v-1d3b9c74"]]),pn={key:0,class:"group translations"},fn={class:"trans-title"},hn={key:1,class:"group"},_n={class:"item appearance"},mn={class:"label"},kn={class:"appearance-action"},bn={key:2,class:"group"},$n={class:"item social-links"},gn=_({__name:"VPNavBarExtra",setup(o){const{site:e,theme:t}=L(),{localeLinks:s,currentLang:n}=J({correspondingLink:!0}),r=$(()=>s.value.length&&n.value.label||e.value.appearance||t.value.socialLinks);return(c,f)=>r.value?(a(),k(ke,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:d(()=>[i(s).length&&i(n).label?(a(),u("div",pn,[v("p",fn,w(i(n).label),1),(a(!0),u(M,null,E(i(s),p=>(a(),k(se,{key:p.link,item:p},null,8,["item"]))),128))])):h("",!0),i(e).appearance&&i(e).appearance!=="force-dark"?(a(),u("div",hn,[v("div",_n,[v("p",mn,w(i(t).darkModeSwitchLabel||"Appearance"),1),v("div",kn,[m(_e)])])])):h("",!0),i(t).socialLinks?(a(),u("div",bn,[v("div",$n,[m(be,{class:"social-links-list",links:i(t).socialLinks},null,8,["links"])])])):h("",!0)]),_:1})):h("",!0)}}),yn=b(gn,[["__scopeId","data-v-bbc6fded"]]),Pn=o=>(C("data-v-371faaaa"),o=o(),H(),o),Ln=["aria-expanded"],Vn=Pn(()=>v("span",{class:"container"},[v("span",{class:"top"}),v("span",{class:"middle"}),v("span",{class:"bottom"})],-1)),Sn=[Vn],wn=_({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(o){return(e,t)=>(a(),u("button",{type:"button",class:T(["VPNavBarHamburger",{active:e.active}]),"aria-label":"mobile navigation","aria-expanded":e.active,"aria-controls":"VPNavScreen",onClick:t[0]||(t[0]=s=>e.$emit("click"))},Sn,10,Ln))}}),In=b(wn,[["__scopeId","data-v-371faaaa"]]),Tn=["innerHTML"],Nn=_({__name:"VPNavBarMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,s)=>(a(),k(F,{class:T({VPNavBarMenuLink:!0,active:i(q)(i(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,noIcon:t.item.noIcon,target:t.item.target,rel:t.item.rel,tabindex:"0"},{default:d(()=>[v("span",{innerHTML:t.item.text},null,8,Tn)]),_:1},8,["class","href","noIcon","target","rel"]))}}),Mn=b(Nn,[["__scopeId","data-v-2517eabb"]]),Bn=_({__name:"VPNavBarMenuGroup",props:{item:{}},setup(o){const e=o,{page:t}=L(),s=r=>"link"in r?q(t.value.relativePath,r.link,!!e.item.activeMatch):r.items.some(s),n=$(()=>s(e.item));return(r,c)=>(a(),k(ke,{class:T({VPNavBarMenuGroup:!0,active:i(q)(i(t).relativePath,r.item.activeMatch,!!r.item.activeMatch)||n.value}),button:r.item.text,items:r.item.items},null,8,["class","button","items"]))}}),An=o=>(C("data-v-d955c7d8"),o=o(),H(),o),Cn={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},Hn=An(()=>v("span",{id:"main-nav-aria-label",class:"visually-hidden"},"Main Navigation",-1)),En=_({__name:"VPNavBarMenu",setup(o){const{theme:e}=L();return(t,s)=>i(e).nav?(a(),u("nav",Cn,[Hn,(a(!0),u(M,null,E(i(e).nav,n=>(a(),u(M,{key:n.text},["link"in n?(a(),k(Mn,{key:0,item:n},null,8,["item"])):(a(),k(Bn,{key:1,item:n},null,8,["item"]))],64))),128))])):h("",!0)}}),Fn=b(En,[["__scopeId","data-v-d955c7d8"]]);function Dn(o){const{localeIndex:e,theme:t}=L();function s(n){var B,A,S;const r=n.split("."),c=(B=t.value.search)==null?void 0:B.options,f=c&&typeof c=="object",p=f&&((S=(A=c.locales)==null?void 0:A[e.value])==null?void 0:S.translations)||null,P=f&&c.translations||null;let g=p,y=P,V=o;const N=r.pop();for(const j of r){let U=null;const K=V==null?void 0:V[j];K&&(U=V=K);const ne=y==null?void 0:y[j];ne&&(U=y=ne);const ae=g==null?void 0:g[j];ae&&(U=g=ae),K||(V=U),ne||(y=U),ae||(g=U)}return(g==null?void 0:g[N])??(y==null?void 0:y[N])??(V==null?void 0:V[N])??""}return s}const On=["aria-label"],jn={class:"DocSearch-Button-Container"},Un=v("span",{class:"vp-icon DocSearch-Search-Icon"},null,-1),Gn={class:"DocSearch-Button-Placeholder"},zn=v("span",{class:"DocSearch-Button-Keys"},[v("kbd",{class:"DocSearch-Button-Key"}),v("kbd",{class:"DocSearch-Button-Key"},"K")],-1),$e=_({__name:"VPNavBarSearchButton",setup(o){const t=Dn({button:{buttonText:"Search",buttonAriaLabel:"Search"}});return(s,n)=>(a(),u("button",{type:"button",class:"DocSearch DocSearch-Button","aria-label":i(t)("button.buttonAriaLabel")},[v("span",jn,[Un,v("span",Gn,w(i(t)("button.buttonText")),1)]),zn],8,On))}}),qn={class:"VPNavBarSearch"},Wn={id:"local-search"},Kn={key:1,id:"docsearch"},Rn=_({__name:"VPNavBarSearch",setup(o){const e=()=>null,t=()=>null,{theme:s}=L(),n=I(!1),r=I(!1);W(()=>{});function c(){n.value||(n.value=!0,setTimeout(f,16))}function f(){const g=new Event("keydown");g.key="k",g.metaKey=!0,window.dispatchEvent(g),setTimeout(()=>{document.querySelector(".DocSearch-Modal")||f()},16)}const p=I(!1),P="";return(g,y)=>{var V;return a(),u("div",qn,[i(P)==="local"?(a(),u(M,{key:0},[p.value?(a(),k(i(e),{key:0,onClose:y[0]||(y[0]=N=>p.value=!1)})):h("",!0),v("div",Wn,[m($e,{onClick:y[1]||(y[1]=N=>p.value=!0)})])],64)):i(P)==="algolia"?(a(),u(M,{key:1},[n.value?(a(),k(i(t),{key:0,algolia:((V=i(s).search)==null?void 0:V.options)??i(s).algolia,onVnodeBeforeMount:y[2]||(y[2]=N=>r.value=!0)},null,8,["algolia"])):h("",!0),r.value?h("",!0):(a(),u("div",Kn,[m($e,{onClick:c})]))],64)):h("",!0)])}}}),Jn=_({__name:"VPNavBarSocialLinks",setup(o){const{theme:e}=L();return(t,s)=>i(e).socialLinks?(a(),k(be,{key:0,class:"VPNavBarSocialLinks",links:i(e).socialLinks},null,8,["links"])):h("",!0)}}),Yn=b(Jn,[["__scopeId","data-v-4c68144d"]]),Qn=["href","rel","target"],Xn={key:1},Zn={key:2},xn=_({__name:"VPNavBarTitle",setup(o){const{site:e,theme:t}=L(),{hasSidebar:s}=O(),{currentLang:n}=J(),r=$(()=>{var p;return typeof t.value.logoLink=="string"?t.value.logoLink:(p=t.value.logoLink)==null?void 0:p.link}),c=$(()=>{var p;return typeof t.value.logoLink=="string"||(p=t.value.logoLink)==null?void 0:p.rel}),f=$(()=>{var p;return typeof t.value.logoLink=="string"||(p=t.value.logoLink)==null?void 0:p.target});return(p,P)=>(a(),u("div",{class:T(["VPNavBarTitle",{"has-sidebar":i(s)}])},[v("a",{class:"title",href:r.value??i(fe)(i(n).link),rel:c.value,target:f.value},[l(p.$slots,"nav-bar-title-before",{},void 0,!0),i(t).logo?(a(),k(X,{key:0,class:"logo",image:i(t).logo},null,8,["image"])):h("",!0),i(t).siteTitle?(a(),u("span",Xn,w(i(t).siteTitle),1)):i(t).siteTitle===void 0?(a(),u("span",Zn,w(i(e).title),1)):h("",!0),l(p.$slots,"nav-bar-title-after",{},void 0,!0)],8,Qn)],2))}}),ea=b(xn,[["__scopeId","data-v-0f24fcb7"]]),ta={class:"items"},oa={class:"title"},sa=_({__name:"VPNavBarTranslations",setup(o){const{theme:e}=L(),{localeLinks:t,currentLang:s}=J({correspondingLink:!0});return(n,r)=>i(t).length&&i(s).label?(a(),k(ke,{key:0,class:"VPNavBarTranslations",icon:"vpi-languages",label:i(e).langMenuLabel||"Change language"},{default:d(()=>[v("div",ta,[v("p",oa,w(i(s).label),1),(a(!0),u(M,null,E(i(t),c=>(a(),k(se,{key:c.link,item:c},null,8,["item"]))),128))])]),_:1},8,["label"])):h("",!0)}}),na=b(sa,[["__scopeId","data-v-d5f2cf0c"]]),aa=o=>(C("data-v-1607ff38"),o=o(),H(),o),ra={class:"wrapper"},ia={class:"container"},la={class:"title"},ca={class:"content"},ua={class:"content-body"},da=aa(()=>v("div",{class:"divider"},[v("div",{class:"divider-line"})],-1)),va=_({__name:"VPNavBar",props:{isScreenOpen:{type:Boolean}},emits:["toggle-screen"],setup(o){const{y:e}=Ve(),{hasSidebar:t}=O(),{frontmatter:s}=L(),n=I({});return ge(()=>{n.value={"has-sidebar":t.value,home:s.value.layout==="home",top:e.value===0}}),(r,c)=>(a(),u("div",{class:T(["VPNavBar",n.value])},[v("div",ra,[v("div",ia,[v("div",la,[m(ea,null,{"nav-bar-title-before":d(()=>[l(r.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":d(()=>[l(r.$slots,"nav-bar-title-after",{},void 0,!0)]),_:3})]),v("div",ca,[v("div",ua,[l(r.$slots,"nav-bar-content-before",{},void 0,!0),m(Rn,{class:"search"}),m(Fn,{class:"menu"}),m(na,{class:"translations"}),m(Os,{class:"appearance"}),m(Yn,{class:"social-links"}),m(yn,{class:"extra"}),l(r.$slots,"nav-bar-content-after",{},void 0,!0),m(In,{class:"hamburger",active:r.isScreenOpen,onClick:c[0]||(c[0]=f=>r.$emit("toggle-screen"))},null,8,["active"])])])])]),da],2))}}),pa=b(va,[["__scopeId","data-v-1607ff38"]]),fa={key:0,class:"VPNavScreenAppearance"},ha={class:"text"},_a=_({__name:"VPNavScreenAppearance",setup(o){const{site:e,theme:t}=L();return(s,n)=>i(e).appearance&&i(e).appearance!=="force-dark"?(a(),u("div",fa,[v("p",ha,w(i(t).darkModeSwitchLabel||"Appearance"),1),m(_e)])):h("",!0)}}),ma=b(_a,[["__scopeId","data-v-549ff98c"]]),ka=_({__name:"VPNavScreenMenuLink",props:{item:{}},setup(o){const e=te("close-screen");return(t,s)=>(a(),k(F,{class:"VPNavScreenMenuLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:i(e),innerHTML:t.item.text},null,8,["href","target","rel","onClick","innerHTML"]))}}),ba=b(ka,[["__scopeId","data-v-627cba65"]]),$a=_({__name:"VPNavScreenMenuGroupLink",props:{item:{}},setup(o){const e=te("close-screen");return(t,s)=>(a(),k(F,{class:"VPNavScreenMenuGroupLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:i(e)},{default:d(()=>[D(w(t.item.text),1)]),_:1},8,["href","target","rel","onClick"]))}}),He=b($a,[["__scopeId","data-v-cdb653dc"]]),ga={class:"VPNavScreenMenuGroupSection"},ya={key:0,class:"title"},Pa=_({__name:"VPNavScreenMenuGroupSection",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),u("div",ga,[e.text?(a(),u("p",ya,w(e.text),1)):h("",!0),(a(!0),u(M,null,E(e.items,s=>(a(),k(He,{key:s.text,item:s},null,8,["item"]))),128))]))}}),La=b(Pa,[["__scopeId","data-v-0f2d410a"]]),Va=o=>(C("data-v-17f9732b"),o=o(),H(),o),Sa=["aria-controls","aria-expanded"],wa=["innerHTML"],Ia=Va(()=>v("span",{class:"vpi-plus button-icon"},null,-1)),Ta=["id"],Na={key:1,class:"group"},Ma=_({__name:"VPNavScreenMenuGroup",props:{text:{},items:{}},setup(o){const e=o,t=I(!1),s=$(()=>`NavScreenGroup-${e.text.replace(" ","-").toLowerCase()}`);function n(){t.value=!t.value}return(r,c)=>(a(),u("div",{class:T(["VPNavScreenMenuGroup",{open:t.value}])},[v("button",{class:"button","aria-controls":s.value,"aria-expanded":t.value,onClick:n},[v("span",{class:"button-text",innerHTML:r.text},null,8,wa),Ia],8,Sa),v("div",{id:s.value,class:"items"},[(a(!0),u(M,null,E(r.items,f=>(a(),u(M,{key:f.text},["link"in f?(a(),u("div",{key:f.text,class:"item"},[m(He,{item:f},null,8,["item"])])):(a(),u("div",Na,[m(La,{text:f.text,items:f.items},null,8,["text","items"])]))],64))),128))],8,Ta)],2))}}),Ba=b(Ma,[["__scopeId","data-v-17f9732b"]]),Aa={key:0,class:"VPNavScreenMenu"},Ca=_({__name:"VPNavScreenMenu",setup(o){const{theme:e}=L();return(t,s)=>i(e).nav?(a(),u("nav",Aa,[(a(!0),u(M,null,E(i(e).nav,n=>(a(),u(M,{key:n.text},["link"in n?(a(),k(ba,{key:0,item:n},null,8,["item"])):(a(),k(Ba,{key:1,text:n.text||"",items:n.items},null,8,["text","items"]))],64))),128))])):h("",!0)}}),Ha=_({__name:"VPNavScreenSocialLinks",setup(o){const{theme:e}=L();return(t,s)=>i(e).socialLinks?(a(),k(be,{key:0,class:"VPNavScreenSocialLinks",links:i(e).socialLinks},null,8,["links"])):h("",!0)}}),Ee=o=>(C("data-v-f3b904c4"),o=o(),H(),o),Ea=Ee(()=>v("span",{class:"vpi-languages icon lang"},null,-1)),Fa=Ee(()=>v("span",{class:"vpi-chevron-down icon chevron"},null,-1)),Da={class:"list"},Oa=_({__name:"VPNavScreenTranslations",setup(o){const{localeLinks:e,currentLang:t}=J({correspondingLink:!0}),s=I(!1);function n(){s.value=!s.value}return(r,c)=>i(e).length&&i(t).label?(a(),u("div",{key:0,class:T(["VPNavScreenTranslations",{open:s.value}])},[v("button",{class:"title",onClick:n},[Ea,D(" "+w(i(t).label)+" ",1),Fa]),v("ul",Da,[(a(!0),u(M,null,E(i(e),f=>(a(),u("li",{key:f.link,class:"item"},[m(F,{class:"link",href:f.link},{default:d(()=>[D(w(f.text),1)]),_:2},1032,["href"])]))),128))])],2)):h("",!0)}}),ja=b(Oa,[["__scopeId","data-v-f3b904c4"]]),Ua={class:"container"},Ga=_({__name:"VPNavScreen",props:{open:{type:Boolean}},setup(o){const e=I(null),t=Se(oe?document.body:null);return(s,n)=>(a(),k(de,{name:"fade",onEnter:n[0]||(n[0]=r=>t.value=!0),onAfterLeave:n[1]||(n[1]=r=>t.value=!1)},{default:d(()=>[s.open?(a(),u("div",{key:0,class:"VPNavScreen",ref_key:"screen",ref:e,id:"VPNavScreen"},[v("div",Ua,[l(s.$slots,"nav-screen-content-before",{},void 0,!0),m(Ca,{class:"menu"}),m(ja,{class:"translations"}),m(ma,{class:"appearance"}),m(Ha,{class:"social-links"}),l(s.$slots,"nav-screen-content-after",{},void 0,!0)])],512)):h("",!0)]),_:3}))}}),za=b(Ga,[["__scopeId","data-v-ae2b2cde"]]),qa={key:0,class:"VPNav"},Wa=_({__name:"VPNav",setup(o){const{isScreenOpen:e,closeScreen:t,toggleScreen:s}=ws(),{frontmatter:n}=L(),r=$(()=>n.value.navbar!==!1);return we("close-screen",t),Z(()=>{oe&&document.documentElement.classList.toggle("hide-nav",!r.value)}),(c,f)=>r.value?(a(),u("header",qa,[m(pa,{"is-screen-open":i(e),onToggleScreen:i(s)},{"nav-bar-title-before":d(()=>[l(c.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":d(()=>[l(c.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":d(()=>[l(c.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":d(()=>[l(c.$slots,"nav-bar-content-after",{},void 0,!0)]),_:3},8,["is-screen-open","onToggleScreen"]),m(za,{open:i(e)},{"nav-screen-content-before":d(()=>[l(c.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":d(()=>[l(c.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3},8,["open"])])):h("",!0)}}),Ka=b(Wa,[["__scopeId","data-v-1930908d"]]),Fe=o=>(C("data-v-bbf5bb9d"),o=o(),H(),o),Ra=["role","tabindex"],Ja=Fe(()=>v("div",{class:"indicator"},null,-1)),Ya=Fe(()=>v("span",{class:"vpi-chevron-right caret-icon"},null,-1)),Qa=[Ya],Xa={key:1,class:"items"},Za=_({__name:"VPSidebarItem",props:{item:{},depth:{}},setup(o){const e=o,{collapsed:t,collapsible:s,isLink:n,isActiveLink:r,hasActiveLink:c,hasChildren:f,toggle:p}=mt($(()=>e.item)),P=$(()=>f.value?"section":"div"),g=$(()=>n.value?"a":"div"),y=$(()=>f.value?e.depth+2===7?"p":`h${e.depth+2}`:"p"),V=$(()=>n.value?void 0:"button"),N=$(()=>[[`level-${e.depth}`],{collapsible:s.value},{collapsed:t.value},{"is-link":n.value},{"is-active":r.value},{"has-active":c.value}]);function B(S){"key"in S&&S.key!=="Enter"||!e.item.link&&p()}function A(){e.item.link&&p()}return(S,j)=>{const U=z("VPSidebarItem",!0);return a(),k(R(P.value),{class:T(["VPSidebarItem",N.value])},{default:d(()=>[S.item.text?(a(),u("div",Y({key:0,class:"item",role:V.value},Ye(S.item.items?{click:B,keydown:B}:{},!0),{tabindex:S.item.items&&0}),[Ja,S.item.link?(a(),k(F,{key:0,tag:g.value,class:"link",href:S.item.link,rel:S.item.rel,target:S.item.target},{default:d(()=>[(a(),k(R(y.value),{class:"text",innerHTML:S.item.text},null,8,["innerHTML"]))]),_:1},8,["tag","href","rel","target"])):(a(),k(R(y.value),{key:1,class:"text",innerHTML:S.item.text},null,8,["innerHTML"])),S.item.collapsed!=null&&S.item.items&&S.item.items.length?(a(),u("div",{key:2,class:"caret",role:"button","aria-label":"toggle section",onClick:A,onKeydown:Je(A,["enter"]),tabindex:"0"},Qa,32)):h("",!0)],16,Ra)):h("",!0),S.item.items&&S.item.items.length?(a(),u("div",Xa,[S.depth<5?(a(!0),u(M,{key:0},E(S.item.items,K=>(a(),k(U,{key:K.text,item:K,depth:S.depth+1},null,8,["item","depth"]))),128)):h("",!0)])):h("",!0)]),_:1},8,["class"])}}}),xa=b(Za,[["__scopeId","data-v-bbf5bb9d"]]),De=o=>(C("data-v-5a2494f1"),o=o(),H(),o),er=De(()=>v("div",{class:"curtain"},null,-1)),tr={class:"nav",id:"VPSidebarNav","aria-labelledby":"sidebar-aria-label",tabindex:"-1"},or=De(()=>v("span",{class:"visually-hidden",id:"sidebar-aria-label"}," Sidebar Navigation ",-1)),sr=_({__name:"VPSidebar",props:{open:{type:Boolean}},setup(o){const{sidebarGroups:e,hasSidebar:t}=O(),s=o,n=I(null),r=Se(oe?document.body:null);return G([s,n],()=>{var c;s.open?(r.value=!0,(c=n.value)==null||c.focus()):r.value=!1},{immediate:!0,flush:"post"}),(c,f)=>i(t)?(a(),u("aside",{key:0,class:T(["VPSidebar",{open:c.open}]),ref_key:"navEl",ref:n,onClick:f[0]||(f[0]=Qe(()=>{},["stop"]))},[er,v("nav",tr,[or,l(c.$slots,"sidebar-nav-before",{},void 0,!0),(a(!0),u(M,null,E(i(e),p=>(a(),u("div",{key:p.text,class:"group"},[m(xa,{item:p,depth:0},null,8,["item"])]))),128)),l(c.$slots,"sidebar-nav-after",{},void 0,!0)])],2)):h("",!0)}}),nr=b(sr,[["__scopeId","data-v-5a2494f1"]]),ar=_({__name:"VPSkipLink",setup(o){const e=ee(),t=I();G(()=>e.path,()=>t.value.focus());function s({target:n}){const r=document.getElementById(decodeURIComponent(n.hash).slice(1));if(r){const c=()=>{r.removeAttribute("tabindex"),r.removeEventListener("blur",c)};r.setAttribute("tabindex","-1"),r.addEventListener("blur",c),r.focus(),window.scrollTo(0,0)}}return(n,r)=>(a(),u(M,null,[v("span",{ref_key:"backToTop",ref:t,tabindex:"-1"},null,512),v("a",{href:"#VPContent",class:"VPSkipLink visually-hidden",onClick:s}," Skip to content ")],64))}}),rr=b(ar,[["__scopeId","data-v-5fca3eed"]]),ir=_({__name:"Layout",setup(o){const{isOpen:e,open:t,close:s}=O(),n=ee();G(()=>n.path,s),_t(e,s);const{frontmatter:r}=L(),c=Xe(),f=$(()=>!!c["home-hero-image"]);return we("hero-image-slot-exists",f),(p,P)=>{const g=z("Content");return i(r).layout!==!1?(a(),u("div",{key:0,class:T(["Layout",i(r).pageClass])},[l(p.$slots,"layout-top",{},void 0,!0),m(rr),m(tt,{class:"backdrop",show:i(e),onClick:i(s)},null,8,["show","onClick"]),m(Ka,null,{"nav-bar-title-before":d(()=>[l(p.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":d(()=>[l(p.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":d(()=>[l(p.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":d(()=>[l(p.$slots,"nav-bar-content-after",{},void 0,!0)]),"nav-screen-content-before":d(()=>[l(p.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":d(()=>[l(p.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3}),m(Ss,{open:i(e),onOpenMenu:i(t)},null,8,["open","onOpenMenu"]),m(nr,{open:i(e)},{"sidebar-nav-before":d(()=>[l(p.$slots,"sidebar-nav-before",{},void 0,!0)]),"sidebar-nav-after":d(()=>[l(p.$slots,"sidebar-nav-after",{},void 0,!0)]),_:3},8,["open"]),m(rs,null,{"page-top":d(()=>[l(p.$slots,"page-top",{},void 0,!0)]),"page-bottom":d(()=>[l(p.$slots,"page-bottom",{},void 0,!0)]),"not-found":d(()=>[l(p.$slots,"not-found",{},void 0,!0)]),"home-hero-before":d(()=>[l(p.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":d(()=>[l(p.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":d(()=>[l(p.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":d(()=>[l(p.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":d(()=>[l(p.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":d(()=>[l(p.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":d(()=>[l(p.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":d(()=>[l(p.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":d(()=>[l(p.$slots,"home-features-after",{},void 0,!0)]),"doc-footer-before":d(()=>[l(p.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":d(()=>[l(p.$slots,"doc-before",{},void 0,!0)]),"doc-after":d(()=>[l(p.$slots,"doc-after",{},void 0,!0)]),"doc-top":d(()=>[l(p.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":d(()=>[l(p.$slots,"doc-bottom",{},void 0,!0)]),"aside-top":d(()=>[l(p.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":d(()=>[l(p.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":d(()=>[l(p.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":d(()=>[l(p.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":d(()=>[l(p.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":d(()=>[l(p.$slots,"aside-ads-after",{},void 0,!0)]),_:3}),m(ds),l(p.$slots,"layout-bottom",{},void 0,!0)],2)):(a(),k(g,{key:1}))}}}),lr=b(ir,[["__scopeId","data-v-435f49ed"]]),cr={Layout:lr,enhanceApp:({app:o})=>{o.component("Badge",Ze)}},ur={props:{js:{type:Boolean,default:!0},json:{type:Boolean,default:!0},opt:{type:Boolean,default:!1}}};function dr(o,e,t,s,n,r){const c=z("Badge");return a(),u("span",null,[t.js?(a(),k(c,{key:0,text:"JS",type:"tip"})):h("",!0),t.json?(a(),k(c,{key:1,text:"JSON",type:"warning"})):h("",!0),t.opt?(a(),k(c,{key:2,text:"Optional",type:"danger"})):h("",!0)])}const vr=b(ur,[["render",dr]]),fr={extends:cr,enhanceApp({app:o,router:e,siteData:t}){o.component("Jbadge",vr)}};export{fr as R}; diff --git a/assets/cn_compatibility.md.DFXspByW.js b/assets/cn_compatibility.md.DFXspByW.js new file mode 100644 index 000000000..a803fc242 --- /dev/null +++ b/assets/cn_compatibility.md.DFXspByW.js @@ -0,0 +1 @@ +import{_ as t,c as e,o as r,a1 as o}from"./chunks/framework.qh4ipt1c.js";const b=JSON.parse('{"title":"兼容性","description":"","frontmatter":{},"headers":[],"relativePath":"cn/compatibility.md","filePath":"cn/compatibility.md","lastUpdated":1715146018000}'),a={name:"cn/compatibility.md"},d=o('兼容性 浏览器及脚本管理器 + Firefox + Violentmonkey Chrome/Microsoft Edge Dev + Tampermonkey+ Waterfox + Greasemonkey 4Firefox > ESRChrome > 45 , Edge Dev ChannelLatestScript is tested under:Firefox latest + Violentmonkey (Recommended combination)Microsoft Edge Dev + TampermonkeyWaterfox 56.3 + Greasemonkey 4.9Chrome 48 + TampermonkeyKnown issue:Firefox < 62 + Tampermonkey is incompatible with webpack or core-js. I don't really know where the 🐛 is. I have submitted an issue to Tampermonkey https://github.com/Tampermonkey/tampermonkey/issues/834. Unless he fixes it, I can do nothing.漫画网站 WebsiteChromeFirefox天极动漫频道新闻 yesky✅✅动漫之家 dmzj✅❎看漫画 manhuagui✅ X-Header❎CC 漫画网 tuku✅✅SF 在线漫画✅❎哦漫画 omanhua✅❎汗汗/虎虎漫画✅✅99 漫画✅✅酷酷动漫 kukudm✅✅天使漫画网 tsdm✅✅',6),i=[d];function n(s,h,l,m,p,c){return r(),e("div",null,i)}const u=t(a,[["render",n]]);export{b as __pageData,u as default}; diff --git a/assets/cn_compatibility.md.DFXspByW.lean.js b/assets/cn_compatibility.md.DFXspByW.lean.js new file mode 100644 index 000000000..63fc55377 --- /dev/null +++ b/assets/cn_compatibility.md.DFXspByW.lean.js @@ -0,0 +1 @@ +import{_ as t,c as e,o as r,a1 as o}from"./chunks/framework.qh4ipt1c.js";const b=JSON.parse('{"title":"兼容性","description":"","frontmatter":{},"headers":[],"relativePath":"cn/compatibility.md","filePath":"cn/compatibility.md","lastUpdated":1715146018000}'),a={name:"cn/compatibility.md"},d=o("",6),i=[d];function n(s,h,l,m,p,c){return r(),e("div",null,i)}const u=t(a,[["render",n]]);export{b as __pageData,u as default}; diff --git a/assets/cn_database.md.0MAp0LYl.js b/assets/cn_database.md.0MAp0LYl.js new file mode 100644 index 000000000..9bb006d9c --- /dev/null +++ b/assets/cn_database.md.0MAp0LYl.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a1 as r}from"./chunks/framework.qh4ipt1c.js";const _=JSON.parse('{"title":"规则数据库","description":"","frontmatter":{},"headers":[],"relativePath":"cn/database.md","filePath":"cn/database.md","lastUpdated":1715146018000}'),o={name:"cn/database.md"},i=r('规则数据库 Wedata.net url: http://wedata.net/databases/AutoPagerize/items.jsonalternativeUrl: https://super-preloader.netlify.com/wedata.jsondetailUrl http://wedata.net/databases/AutoPagerize.jsoniBonus: How to login with openID account?Create a yahoo account and enter https://me.yahoo.com to the URL for openID login, then the website will redirect you to yahoo loginmachsix.github.io url: https://machsix.github.io/Super-preloader/mydata.jsonalternativeUrl: https://super-preloader.netlify.com/mydata.jsondetailUrl: https://machsix.github.io/Super-preloader/mydata_detail.json',5),l=[i];function n(s,h,d,c,p,u){return t(),a("div",null,l)}const b=e(o,[["render",n]]);export{_ as __pageData,b as default}; diff --git a/assets/cn_database.md.0MAp0LYl.lean.js b/assets/cn_database.md.0MAp0LYl.lean.js new file mode 100644 index 000000000..6c69dde18 --- /dev/null +++ b/assets/cn_database.md.0MAp0LYl.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a1 as r}from"./chunks/framework.qh4ipt1c.js";const _=JSON.parse('{"title":"规则数据库","description":"","frontmatter":{},"headers":[],"relativePath":"cn/database.md","filePath":"cn/database.md","lastUpdated":1715146018000}'),o={name:"cn/database.md"},i=r("",5),l=[i];function n(s,h,d,c,p,u){return t(),a("div",null,l)}const b=e(o,[["render",n]]);export{_ as __pageData,b as default}; diff --git a/assets/cn_develop.md.BfMaFYH0.js b/assets/cn_develop.md.BfMaFYH0.js new file mode 100644 index 000000000..f0eeaa23b --- /dev/null +++ b/assets/cn_develop.md.BfMaFYH0.js @@ -0,0 +1 @@ +import{_ as e,c as o,o as r,a1 as a}from"./chunks/framework.qh4ipt1c.js";const m=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/develop.md","filePath":"cn/develop.md","lastUpdated":1715146018000}'),t={name:"cn/develop.md"},c=a('简介 开发主要在Github展开。 参加开发前请先完成以下步骤安装node js, yarnfork it!使用yarn安装相关依赖(主要是代码格式化以及 lint)。请不要使用npm由于npm无法正确解析vuepress的依赖完整修改使用yarn test检查代码格式及脚本的正确性提交 PR,PR 前请使用git rebase将 commit 合并,一个英文指南脚本开发 你可以对任何文件进行合理修改PR 请使用fix, fea, feature 或core的前缀当前需求主要列在issue和project中。目前的主要需求包括:+ 固化Super_preloaderPlus_one_New.user.js+ 将脚本分拆为函数,同时将规则从脚本中提取到mydata.json+ 使用 ES8 重写Super_preloaderPlus_one_ES8.user.jsBeautify UI and use HTML template (maybe mustache-loader, vue is too big for such a tiny script)规则的添加及修复 你可以对dist/mydata.json或Super_preloaderPlus_one_New.user.js进行合理修改PR 请使用rule的前缀请先学习JSON 格式,然后学习Xpath 选择器并尝试使用浏览器的开发者工具提取 XPath。之后你就可以阅读站点规则学习规则的格式然后编写规则了 😄在可能的情况下请优先对dist/mydata.json进行修改。',13),l=[c];function s(d,p,i,n,u,h){return r(),o("div",null,l)}const f=e(t,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/cn_develop.md.BfMaFYH0.lean.js b/assets/cn_develop.md.BfMaFYH0.lean.js new file mode 100644 index 000000000..6122700cb --- /dev/null +++ b/assets/cn_develop.md.BfMaFYH0.lean.js @@ -0,0 +1 @@ +import{_ as e,c as o,o as r,a1 as a}from"./chunks/framework.qh4ipt1c.js";const m=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/develop.md","filePath":"cn/develop.md","lastUpdated":1715146018000}'),t={name:"cn/develop.md"},c=a("",13),l=[c];function s(d,p,i,n,u,h){return r(),o("div",null,l)}const f=e(t,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/cn_example.md.C1LVQ_ed.js b/assets/cn_example.md.C1LVQ_ed.js new file mode 100644 index 000000000..de789cc3c --- /dev/null +++ b/assets/cn_example.md.C1LVQ_ed.js @@ -0,0 +1 @@ +import{_ as a,a as e,b as t,c as o}from"./chunks/hhmm.apdfnDZY.js";import{_ as r,c as i,o as h,a1 as l}from"./chunks/framework.qh4ipt1c.js";const g=JSON.parse('{"title":"例子","description":"","frontmatter":{},"headers":[],"relativePath":"cn/example.md","filePath":"cn/example.md","lastUpdated":1715146018000}'),s={name:"cn/example.md"},c=l('例子 搜索引擎 Google: Baidu 漫画 XKCD: hhmm: ',11),d=[c];function n(m,_,p,u,b,f){return h(),i("div",null,d)}const k=r(s,[["render",n]]);export{g as __pageData,k as default}; diff --git a/assets/cn_example.md.C1LVQ_ed.lean.js b/assets/cn_example.md.C1LVQ_ed.lean.js new file mode 100644 index 000000000..debb5ca25 --- /dev/null +++ b/assets/cn_example.md.C1LVQ_ed.lean.js @@ -0,0 +1 @@ +import{_ as a,a as e,b as t,c as o}from"./chunks/hhmm.apdfnDZY.js";import{_ as r,c as i,o as h,a1 as l}from"./chunks/framework.qh4ipt1c.js";const g=JSON.parse('{"title":"例子","description":"","frontmatter":{},"headers":[],"relativePath":"cn/example.md","filePath":"cn/example.md","lastUpdated":1715146018000}'),s={name:"cn/example.md"},c=l("",11),d=[c];function n(m,_,p,u,b,f){return h(),i("div",null,d)}const k=r(s,[["render",n]]);export{g as __pageData,k as default}; diff --git a/assets/cn_faq.md.DKPUHfL4.js b/assets/cn_faq.md.DKPUHfL4.js new file mode 100644 index 000000000..89cf87951 --- /dev/null +++ b/assets/cn_faq.md.DKPUHfL4.js @@ -0,0 +1,8 @@ +import{_ as a,c as e,o as s,a1 as n}from"./chunks/framework.qh4ipt1c.js";const f=JSON.parse('{"title":"Faq","description":"","frontmatter":{},"headers":[],"relativePath":"cn/faq.md","filePath":"cn/faq.md","lastUpdated":1715146018000}'),t={name:"cn/faq.md"},o=n(`Faq How to repquest rule? To request rule, you should follow the following format + Title: [NSFW]Rule for www.example.com + Content: + Link: www.example.com/a.html + NSFW: yes or no + Screenshot: + xxx + Rule: (If you create one but fail, you'd better provide it to make life easier for me)I won’t spend time on writing rules for those who don’t obey the rule.`,5),p=[o];function l(r,i,c,d,u,h){return s(),e("div",null,p)}const m=a(t,[["render",l]]);export{f as __pageData,m as default}; diff --git a/assets/cn_faq.md.DKPUHfL4.lean.js b/assets/cn_faq.md.DKPUHfL4.lean.js new file mode 100644 index 000000000..98288adae --- /dev/null +++ b/assets/cn_faq.md.DKPUHfL4.lean.js @@ -0,0 +1 @@ +import{_ as a,c as e,o as s,a1 as n}from"./chunks/framework.qh4ipt1c.js";const f=JSON.parse('{"title":"Faq","description":"","frontmatter":{},"headers":[],"relativePath":"cn/faq.md","filePath":"cn/faq.md","lastUpdated":1715146018000}'),t={name:"cn/faq.md"},o=n("",5),p=[o];function l(r,i,c,d,u,h){return s(),e("div",null,p)}const m=a(t,[["render",l]]);export{f as __pageData,m as default}; diff --git a/assets/cn_index.md.DiJrdMqx.js b/assets/cn_index.md.DiJrdMqx.js new file mode 100644 index 000000000..59970510f --- /dev/null +++ b/assets/cn_index.md.DiJrdMqx.js @@ -0,0 +1 @@ +import{_ as t}from"./chunks/logo.BLgnOXGY.js";import{c as a,l as e,a as r,m as s,a1 as o,o as i,g as l}from"./chunks/framework.qh4ipt1c.js";const n=e("p",{align:"center",class:"logo-img"},[e("img",{src:t,alt:"logo",width:"100"})],-1),_=e("h1",{align:"center",class:"logo-text"},"Super-preloader",-1),h=e("br",null,null,-1),p={class:"center"},d=e("a",{href:"https://greasyfork.org/en/scripts/33522-super-preloaderplus-one-new",target:"_blank"},"Greasy Fork",-1),c=e("a",{href:"https://github.com/machsix/Super-preloader/raw/master/dist/Super_preloaderPlus_one_New.user.js",target:"_blank"},"Github",-1),u=["href"],f=o('简介 自动翻页脚本,由ywzhaiqi/Super_preloaderPlus修改而来。在此首先对作者swdyh, ywzhaiqi和NLF致以谢意。swdyh 仍在频繁的更新规则以及开发扩展AutoPagerize。相比AutoPagerize, 该脚本的主要优势在于规则的定义和 DOM 的处理更加灵活。你不仅可以使用xpath selector定义规则,还可以直接使用JavaScript提取元素、修改页面(比如去广告DocumentFilter、增加新功能)等。另一方面,鉴于 swdyh 维护的规则主要针对日文用户,我也希望该脚本及相关规则能惠及中文、英文用户。',4),P=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/index.md","filePath":"cn/index.md","lastUpdated":1715146018000}'),g={name:"cn/index.md"},x=Object.assign(g,{setup(m){return(b,k)=>(i(),a("div",null,[n,_,h,e("div",p,[r("从"),d,r(", "),c,r(" 或 "),e("a",{href:s(l)("/Super_preloaderPlus_one_New.user.js"),target:"_blank"},"Dev version",8,u),r("安装")]),f]))}});export{P as __pageData,x as default}; diff --git a/assets/cn_index.md.DiJrdMqx.lean.js b/assets/cn_index.md.DiJrdMqx.lean.js new file mode 100644 index 000000000..03d885204 --- /dev/null +++ b/assets/cn_index.md.DiJrdMqx.lean.js @@ -0,0 +1 @@ +import{_ as t}from"./chunks/logo.BLgnOXGY.js";import{c as a,l as e,a as r,m as s,a1 as o,o as i,g as l}from"./chunks/framework.qh4ipt1c.js";const n=e("p",{align:"center",class:"logo-img"},[e("img",{src:t,alt:"logo",width:"100"})],-1),_=e("h1",{align:"center",class:"logo-text"},"Super-preloader",-1),h=e("br",null,null,-1),p={class:"center"},d=e("a",{href:"https://greasyfork.org/en/scripts/33522-super-preloaderplus-one-new",target:"_blank"},"Greasy Fork",-1),c=e("a",{href:"https://github.com/machsix/Super-preloader/raw/master/dist/Super_preloaderPlus_one_New.user.js",target:"_blank"},"Github",-1),u=["href"],f=o("",4),P=JSON.parse('{"title":"简介","description":"","frontmatter":{},"headers":[],"relativePath":"cn/index.md","filePath":"cn/index.md","lastUpdated":1715146018000}'),g={name:"cn/index.md"},x=Object.assign(g,{setup(m){return(b,k)=>(i(),a("div",null,[n,_,h,e("div",p,[r("从"),d,r(", "),c,r(" 或 "),e("a",{href:s(l)("/Super_preloaderPlus_one_New.user.js"),target:"_blank"},"Dev version",8,u),r("安装")]),f]))}});export{P as __pageData,x as default}; diff --git a/assets/cn_siterule.md.D7WIuG0H.js b/assets/cn_siterule.md.D7WIuG0H.js new file mode 100644 index 000000000..81991cf6e --- /dev/null +++ b/assets/cn_siterule.md.D7WIuG0H.js @@ -0,0 +1,24 @@ +import{_ as o,D as a,c as r,l,a as e,I as s,a1 as i,o as h}from"./chunks/framework.qh4ipt1c.js";const ks=JSON.parse('{"title":"站点规则","description":"","frontmatter":{"sidebarDepth":3},"headers":[],"relativePath":"cn/siterule.md","filePath":"cn/siterule.md","lastUpdated":1715146018000}'),d={name:"cn/siterule.md"},c=i('站点规则 站点规则可以是JavaScript object stored in file https://github.com/machsix/Super-preloader/blob/master/src/rules/jsSiteRule.js. You need to submit pull request through GithubJSON data 存储于https://github.com/machsix/Super-preloader/blob/master/dist/mydata.json的规则. 你可以自行添加到设置中的自定义站点规则我们更倾向于JSON data因为JSON可以实现热更新. 🌰 在文末.规则的基本构成 name ',6),u=l("strong",null,"type",-1),p=l("code",null,"String",-1),_=l("li",null,[l("strong",null,"description"),e(": 站点名称")],-1),k=l("h3",{id:"url",tabindex:"-1"},[e("url "),l("a",{class:"header-anchor",href:"#url","aria-label":'Permalink to "url"'},"")],-1),g=l("strong",null,"type",-1),E=l("code",null,"XPath String",-1),m=l("code",null,"XPath",-1),f=l("li",null,[l("strong",null,"description"),e(": 匹配站点的正则表达式")],-1),y={id:"exampleurl",tabindex:"-1"},b=l("a",{class:"header-anchor",href:"#exampleurl","aria-label":'Permalink to "exampleUrl "'},"",-1),F=l("strong",null,"type",-1),x=l("code",null,"String",-1),S=l("li",null,[l("strong",null,"description"),e(": 地址范例")],-1),v=l("h3",{id:"enable",tabindex:"-1"},[e("enable "),l("a",{class:"header-anchor",href:"#enable","aria-label":'Permalink to "enable"'},"")],-1),C=l("strong",null,"type",-1),P=l("code",null,"Boolean",-1),A=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"true")],-1),D=l("li",null,[l("strong",null,"description"),e(": 规则开关")],-1),T=l("h3",{id:"nextlink",tabindex:"-1"},[e("nextLink "),l("a",{class:"header-anchor",href:"#nextlink","aria-label":'Permalink to "nextLink"'},"")],-1),B=l("p",null,[e("脚本依据"),l("code",null,"nextLink"),e("寻找"),l("code",null,"下一页"),e("的 URL,我们提供了多种方式:")],-1),j=l("p",null,[l("a",{href:"https://devhints.io/xpath",target:"_blank",rel:"noreferrer"},"XPath selector"),e(":拥有"),l("code",null,"href"),e("属性并指向下一页的元素 或 内容为下一页的元素")],-1),q=l("strong",null,"type",-1),N=l("code",null,"XPath String",-1),O=l("code",null,"XPath",-1),I=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,'//div[@id="nav"]/a'),e(", "),l("code",null,'//div[@id="nav"]/a/@href'),e(",两者等效")],-1),J=l("p",null,[l("a",{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors",target:"_blank",rel:"noreferrer"},"CSS selector"),l("br")],-1),R=l("strong",null,"type",-1),w=l("code",null,"String",-1),V=l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"css;${CSS selector}")],-1),L=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,"css;div#nav>a")],-1),X=l("p",null,[l("a",{href:"./.html"},'"auto;"'),e("脚本会自动寻找所有"),l("code",null,"text()"),e("为“下一页”, “next page”等预定义的下一页文字且含有"),l("code",null,"href"),e("属性的"),l("code",null,"a"),e("的元素")],-1),W=l("strong",null,"type",-1),M=l("code",null,"String",-1),U=l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"auto;"),e(" 无选项")],-1),z=l("p",null,[l("a",{href:"./.html"},"function"),e("返回值为下一页链接的"),l("code",null,"JS"),e("函数")],-1),H=l("strong",null,"type",-1),$=l("code",null,"JS function",-1),G=l("li",null,[l("strong",null,"content"),e(":")],-1),Y=i(`jsfunction(currentDocument, currentWindow, currentPageURL) { + // **** your function is here **** + return urlOfNextPage +}`,1),K=l("li",null,[l("p",null,[l("a",{href:"./.html"},"Array"),e("脚本会遍历所有元素并使用 "),l("span",{style:{color:"blue","font-weight":"bold"}},"以上方法"),e(" 直至找到下一页链接地址")])],-1),Q=l("a",{href:"./.html"},"Object",-1),Z=l("code",null,"hrefInc",-1),ll={id:"prevlink",tabindex:"-1"},el=l("a",{class:"header-anchor",href:"#prevlink","aria-label":'Permalink to "prevLink "'},"",-1),sl=l("p",null,[e("同"),l("a",{href:"#nextlink"},"nextLink"),e(", 然而基本没什么时候需要😂")],-1),nl=l("h3",{id:"pageelement",tabindex:"-1"},[e("pageElement "),l("a",{class:"header-anchor",href:"#pageelement","aria-label":'Permalink to "pageElement"'},"")],-1),tl=l("p",null,[e("脚本根据"),l("code",null,"pageElement"),e("的定义查找自动翻页时拼接的元素。举个🌰,对于搜索引擎,"),l("code",null,"pageElement"),e("应为搜索的结果。 我们同样提供了以下方式:")],-1),il=l("p",null,[l("a",{href:"https://devhints.io/xpath",target:"_blank",rel:"noreferrer"},"XPath selector"),e(":拼接元素的"),l("code",null,"XPath selector")],-1),al=l("strong",null,"type",-1),ol=l("code",null,"XPath String",-1),rl=l("code",null,"XPath",-1),hl=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,'//div[@id="content]')],-1),dl=l("p",null,[l("a",{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors",target:"_blank",rel:"noreferrer"},"CSS selector"),l("br")],-1),cl=l("strong",null,"type",-1),ul=l("code",null,"String",-1),pl=l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"css;${CSS selector}")],-1),_l=l("li",null,[l("strong",null,"example"),e(": "),l("code",null,"css;div#content")],-1),kl=l("p",null,[l("a",{href:"./.html"},"function"),e("返回拼接元素的"),l("a",{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection",target:"_blank",rel:"noreferrer"},"HTMLCollection"),e("的函数。 一个🌰是"),l("code",null,"WordPress"),e("的规则, 通过"),l("code",null,"JS"),e("函数我们可以判断一个页面是否是 post,如果不是就返回"),l("code",null,"null"),e("跳出脚本逻辑,如果是就返回 post 的内容。再一个🌰是某些漫画网站,我们可以使用"),l("code",null,"pageElement"),e("直接计算下一张图片的地址,从而避免加载无用的内容。")],-1),gl=l("strong",null,"type",-1),El=l("code",null,"JS function",-1),ml=l("li",null,[l("strong",null,"content"),e(":")],-1),fl=i(`jsfunction(currentDocument, currentWindow, currentPageURL) { + // **** your function is here **** + return HTMLCollection +}`,1),yl=l("h2",{id:"规则的增强功能",tabindex:"-1"},[e("规则的增强功能 "),l("a",{class:"header-anchor",href:"#规则的增强功能","aria-label":'Permalink to "规则的增强功能"'},"")],-1),bl=l("code",null,"key",-1),Fl=l("code",null,"autopager",-1),xl=l("code",null,"Object",-1),Sl=l("code",null,"autopager",-1),vl=l("code",null,"key",-1),Cl=l("code",null,"key",-1),Pl=l("h3",{id:"useiframe",tabindex:"-1"},[e("useiframe "),l("a",{class:"header-anchor",href:"#useiframe","aria-label":'Permalink to "useiframe"'},"")],-1),Al=l("strong",null,"type",-1),Dl=l("code",null,"Boolean",-1),Tl=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),Bl=l("li",null,[l("strong",null,"description"),e(": 使用 iframe 读取内容而不使用"),l("a",{href:"https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest",target:"_blank",rel:"noreferrer"},"XHR")],-1),jl=l("h3",{id:"iloaded",tabindex:"-1"},[e("iloaded "),l("a",{class:"header-anchor",href:"#iloaded","aria-label":'Permalink to "iloaded"'},"")],-1),ql=l("strong",null,"type",-1),Nl=l("code",null,"Boolean",-1),Ol=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),Il=l("li",null,[l("strong",null,"description"),e(": 是否在 iframe 完全 load 后操作..否则在 DOM 完成后操作")],-1),Jl=l("h3",{id:"itimeout",tabindex:"-1"},[e("itimeout "),l("a",{class:"header-anchor",href:"#itimeout","aria-label":'Permalink to "itimeout"'},"")],-1),Rl=l("strong",null,"type",-1),wl=l("code",null,"Number",-1),Vl=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"0")],-1),Ll=l("li",null,[l("strong",null,"description"),e(": "),l("code",null,"iloaded"),e("为"),l("code",null,"false"),e("时的延迟,单位为毫秒")],-1),Xl=l("h3",{id:"newiframe",tabindex:"-1"},[e("newIframe "),l("a",{class:"header-anchor",href:"#newiframe","aria-label":'Permalink to "newIframe"'},"")],-1),Wl=l("strong",null,"type",-1),Ml=l("code",null,"Boolean",-1),Ul=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),zl=l("li",null,[l("strong",null,"description"),e(": 当翻当前页面+2 时是否新建一个"),l("code",null,"iframe"),e(",在部分情况下有奇效")],-1),Hl=l("h3",{id:"reload",tabindex:"-1"},[e("reload "),l("a",{class:"header-anchor",href:"#reload","aria-label":'Permalink to "reload"'},"")],-1),$l=l("strong",null,"type",-1),Gl=l("code",null,"Boolean",-1),Yl=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),Kl=l("li",null,[l("strong",null,"description"),e(": 强制重载"),l("code",null,"iframe"),e(",在部分情况下有奇效")],-1),Ql=l("h3",{id:"force-enable",tabindex:"-1"},[e("force_enable "),l("a",{class:"header-anchor",href:"#force-enable","aria-label":'Permalink to "force_enable"'},"")],-1),Zl=l("strong",null,"type",-1),le=l("code",null,"Boolean",-1),ee=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"false")],-1),se=l("li",null,[l("strong",null,"description"),e(": 如果实在难以找出"),l("a",{href:"#pageelement"},"pageElement"),e(",开启该选项会使整个页面被拼接上去")],-1),ne=l("h3",{id:"headers",tabindex:"-1"},[e("headers "),l("a",{class:"header-anchor",href:"#headers","aria-label":'Permalink to "headers"'},"")],-1),te=l("strong",null,"type",-1),ie=l("code",null,"Object",-1),ae=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"{ Referer: <本页链接> }")],-1),oe=l("li",null,[l("strong",null,"description"),e(": 自定义请求下一页的 headers")],-1),re=l("h3",{id:"remain",tabindex:"-1"},[e("remain "),l("a",{class:"header-anchor",href:"#remain","aria-label":'Permalink to "remain"'},"")],-1),he=l("strong",null,"type",-1),de=l("code",null,"Number",-1),ce=i("default: 1 总是预翻一页description: 脚本会根据当前页面所剩余的高度决定是否翻页,当剩余高度 <= 页面高度 x remain 时开始翻页",2),ue=l("h3",{id:"maxpage",tabindex:"-1"},[e("maxpage "),l("a",{class:"header-anchor",href:"#maxpage","aria-label":'Permalink to "maxpage"'},"")],-1),pe=l("strong",null,"type",-1),_e=l("code",null,"Number",-1),ke=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"99")],-1),ge=l("li",null,[l("strong",null,"description"),e(": 最多翻页次数")],-1),Ee=i(`mutationObserver iframe 监听选项,用来控制主页面和 iframe 之间的通讯,一个例子js{ + timeout: 1000, + observers: { + attributes: "//div[@class='x']", // the node to monitor change of attributes + addedNodes: "//div[@class='x']", // the node to monitor MutationRecord.addedNodes + removedNodes: "//div[@class='x']" // the node to monitor MutationRecord.removedNodes + } +}timeout:`,4),me=l("strong",null,"type",-1),fe=l("code",null,"Int",-1),ye=l("li",null,[l("strong",null,"default"),e(": null")],-1),be=l("li",null,[l("strong",null,"description"),e(": 延迟通讯时间")],-1),Fe=l("p",null,"observer:",-1),xe=l("strong",null,"type",-1),Se=l("code",null,"Array",-1),ve=l("li",null,[l("strong",null,"default"),e(": null")],-1),Ce=l("li",null,[l("strong",null,"description"),e(": mutationObserver 监控的 element 的 selector")],-1),Pe=l("h3",{id:"ipages",tabindex:"-1"},[e("ipages "),l("a",{class:"header-anchor",href:"#ipages","aria-label":'Permalink to "ipages"'},"")],-1),Ae=l("strong",null,"type",-1),De=l("code",null,"Array",-1),Te=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"[false,2]")],-1),Be=l("li",null,[l("strong",null,"description"),e(": 立即翻页,第一项是控制是否在脚本加载的时候立即翻第二项(必须小于 maxpage)的页数,比如"),l("code",null,"[true,3]"),e(".就是说 JS 加载后.立即翻 3 页。对于图站可以有😂的体验")],-1),je=l("h3",{id:"separator",tabindex:"-1"},[e("separator "),l("a",{class:"header-anchor",href:"#separator","aria-label":'Permalink to "separator"'},"")],-1),qe=l("strong",null,"type",-1),Ne=l("code",null,"Boolean",-1),Oe=l("li",null,[l("strong",null,"default"),e(": "),l("code",null,"true")],-1),Ie=l("li",null,[l("strong",null,"description"),e(": 是否显示翻页导航栏")],-1),Je=l("h3",{id:"sepdivdom",tabindex:"-1"},[e("sepdivDom "),l("a",{class:"header-anchor",href:"#sepdivdom","aria-label":'Permalink to "sepdivDom"'},"")],-1),Re=l("strong",null,"type",-1),we=l("code",null,"JS function",-1),Ve=l("li",null,[l("strong",null,"description"),e(": 对于部分页面,脚本自动添加的导航栏可能造成页面格式错乱。"),l("code",null,"sepdivDom"),e("定义了一个函数来生成合适的导航栏,该导航栏会被插入在最后一个"),l("a",{href:"#pageelement"},"pageElement"),e("之后。 一个例子是"),l("code",null,"小木虫-帖子")],-1),Le=l("li",null,[l("strong",null,"example")],-1),Xe=i(`jsfunction(currentDocument, sepdiv) { + // currentDocument: 读取的下一页的DOM + // sepdiv: 脚本生成的导航栏,tag为div + const td = doc.createElement("td"); + td.appendChild(sepdiv); + const tr = doc.createElement("tr"); + td.setAttribute("colspan", 2); + tr.appendChild(td); + const tbody = doc.createElement("tbody"); + return tbody; +},startFilter `,2),We=l("strong",null,"type",-1),Me=l("code",null,"JS function",-1),Ue=l("li",null,[l("strong",null,"description"),e(": 一个作用于首页(i.e. 当前页面)的 js 函数,用于修正页面。接收"),l("code",null,"currentDocument"),e(", "),l("code",null,"currentWindow"),e("两个参数。 详情请查看"),l("a",{href:"#documentfilter"},"documentFilter (1)")],-1),ze=l("h3",{id:"documentfilter",tabindex:"-1"},[e("documentFilter "),l("a",{class:"header-anchor",href:"#documentfilter","aria-label":'Permalink to "documentFilter"'},"")],-1),He=l("a",{href:"./.html"},"JS function",-1),$e=l("ul",null,[l("li",null,[l("strong",null,"description"),e(": 一个作用于预读内容整体的 js 函数,执行于预读内容被插入到当前页面前。可以用来修正预读内容(比如 csdn)、去除广告(比如很多 nsfw)、根据 XHR 结果生成页面内容而避免使用 iframe(比如 bl-novel)甚至生成新的内容(比如 m-team)。 理论上你可以用 js 实现对 DOM 静态内容的修改")]),l("li",null,[l("strong",null,"content"),e(": "),l("code",null,"function (currentDocument, nextPageLink) {return newDocument}")])],-1),Ge=l("li",null,[l("a",{href:"./.html"},'"startFilter"'),l("ul",null,[l("li",null,[l("strong",null,"description"),e(": 重复使用"),l("a",{href:"#startfilter"},"startFilter")])])],-1),Ye=l("h3",{id:"scriptfilter",tabindex:"-1"},[e("scriptFilter "),l("a",{class:"header-anchor",href:"#scriptfilter","aria-label":'Permalink to "scriptFilter"'},"")],-1),Ke=l("strong",null,"type",-1),Qe=l("li",null,[l("strong",null,"description"),e(": 在将预读内容插入到当前页面之前,脚本默认会移除所有的"),l("code",null," + + + + + + + + + Skip to content Super-preloaderMain Navigation主页简体中文English简体中文EnglishAppearanceMenuReturn to topOn this page兼容性 浏览器及脚本管理器 + Firefox + Violentmonkey Chrome/Microsoft Edge Dev + Tampermonkey+ Waterfox + Greasemonkey 4Firefox > ESRChrome > 45 , Edge Dev ChannelLatestScript is tested under:Firefox latest + Violentmonkey (Recommended combination)Microsoft Edge Dev + TampermonkeyWaterfox 56.3 + Greasemonkey 4.9Chrome 48 + TampermonkeyKnown issue:Firefox < 62 + Tampermonkey is incompatible with webpack or core-js. I don't really know where the 🐛 is. I have submitted an issue to Tampermonkey https://github.com/Tampermonkey/tampermonkey/issues/834. Unless he fixes it, I can do nothing.漫画网站 WebsiteChromeFirefox天极动漫频道新闻 yesky✅✅动漫之家 dmzj✅❎看漫画 manhuagui✅ X-Header❎CC 漫画网 tuku✅✅SF 在线漫画✅❎哦漫画 omanhua✅❎汗汗/虎虎漫画✅✅99 漫画✅✅酷酷动漫 kukudm✅✅天使漫画网 tsdm✅✅ + + + +
Script is tested under:
Known issue:
开发主要在Github展开。 参加开发前请先完成以下步骤
node js
yarn
npm
vuepress
yarn test
git rebase
你可以对任何文件进行合理修改
PR 请使用fix, fea, feature 或core的前缀
fix
fea
feature
core
当前需求主要列在issue和project中。
目前的主要需求包括:
+ 固化Super_preloaderPlus_one_New.user.js
Super_preloaderPlus_one_New.user.js
+ 将脚本分拆为函数,同时将规则从脚本中提取到mydata.json
mydata.json
+ 使用 ES8 重写Super_preloaderPlus_one_ES8.user.js
Super_preloaderPlus_one_ES8.user.js
vue
你可以对dist/mydata.json或Super_preloaderPlus_one_New.user.js进行合理修改
dist/mydata.json
PR 请使用rule的前缀
rule
请先学习JSON 格式,然后学习Xpath 选择器并尝试使用浏览器的开发者工具提取 XPath。
之后你就可以阅读站点规则学习规则的格式然后编写规则了 😄
在可能的情况下请优先对dist/mydata.json进行修改。
To request rule, you should follow the following format
+ Title: [NSFW]Rule for www.example.com + Content: + Link: www.example.com/a.html + NSFW: yes or no + Screenshot: + xxx + Rule: (If you create one but fail, you'd better provide it to make life easier for me)
I won’t spend time on writing rules for those who don’t obey the rule.
自动翻页脚本,由ywzhaiqi/Super_preloaderPlus修改而来。在此首先对作者swdyh, ywzhaiqi和NLF致以谢意。swdyh 仍在频繁的更新规则以及开发扩展AutoPagerize。
相比AutoPagerize, 该脚本的主要优势在于规则的定义和 DOM 的处理更加灵活。你不仅可以使用xpath selector定义规则,还可以直接使用JavaScript提取元素、修改页面(比如去广告DocumentFilter、增加新功能)等。另一方面,鉴于 swdyh 维护的规则主要针对日文用户,我也希望该脚本及相关规则能惠及中文、英文用户。
站点规则可以是
设置
自定义站点规则
我们更倾向于JSON data因为JSON可以实现热更新. 🌰 在文末.
function(currentDocument, currentWindow, currentPageURL) { + // **** your function is here **** + return urlOfNextPage +}
function(currentDocument, currentWindow, currentPageURL) { + // **** your function is here **** + return HTMLCollection +}
1
当剩余高度
页面高度
remain
iframe 监听选项,用来控制主页面和 iframe 之间的通讯,一个例子
{ + timeout: 1000, + observers: { + attributes: "//div[@class='x']", // the node to monitor change of attributes + addedNodes: "//div[@class='x']", // the node to monitor MutationRecord.addedNodes + removedNodes: "//div[@class='x']" // the node to monitor MutationRecord.removedNodes + } +}
timeout:
function(currentDocument, sepdiv) { + // currentDocument: 读取的下一页的DOM + // sepdiv: 脚本生成的导航栏,tag为div + const td = doc.createElement("td"); + td.appendChild(sepdiv); + const tr = doc.createElement("tr"); + td.setAttribute("colspan", 2); + tr.appendChild(td); + const tbody = doc.createElement("tbody"); + return tbody; +},
简体中文