2024-07-01 14:16:35 +08:00
|
|
|
!function (e) { function t(o) { if (n[o]) return n[o].exports; var l = n[o] = { i: o, l: !1, exports: {} }; return e[o].call(l.exports, l, l.exports, t), l.l = !0, l.exports } var n = {}; t.m = e, t.c = n, t.d = function (e, n, o) { t.o(e, n) || Object.defineProperty(e, n, { configurable: !1, enumerable: !0, get: o }) }, t.n = function (e) { var n = e && e.__esModule ? function () { return e.default } : function () { return e }; return t.d(n, "a", n), n }, t.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, t.p = "", t(t.s = 0) }([function (e, t, n) { (function (o) { var l, r, i; !function (n, o) { r = [], l = o(n), void 0 !== (i = "function" == typeof l ? l.apply(t, r) : l) && (e.exports = i) }(void 0 !== o ? o : this.window || this.global, function (e) { "use strict"; function t() { for (var e = {}, t = 0; t < arguments.length; t++) { var n = arguments[t]; for (var o in n) m.call(n, o) && (e[o] = n[o]) } return e } function o(e, t, n) { t || (t = 250); var o, l; return function () { var r = n || this, i = +new Date, s = arguments; o && i < o + t ? (clearTimeout(l), l = setTimeout(function () { o = i, e.apply(r, s) }, t)) : (o = i, e.apply(r, s)) } } var l, r, i = n(2), s = {}, c = {}, a = n(3), u = n(4); if ("undefined" != typeof window) { var d, f = !!e.document.querySelector && !!e.addEventListener, m = Object.prototype.hasOwnProperty; return c.destroy = function () { if (!s.skipRendering) try { document.querySelector(s.tocSelector).innerHTML = "" } catch (e) { console.warn("Element not found: " + s.tocSelector) } s.scrollContainer && document.querySelector(s.scrollContainer) ? (document.querySelector(s.scrollContainer).removeEventListener("scroll", this._scrollListener, !1), document.querySelector(s.scrollContainer).removeEventListener("resize", this._scrollListener, !1), l && document.querySelector(s.scrollContainer).removeEventListener("click", this._clickListener, !1)) : (document.removeEventListener("scroll", this._scrollListener, !1), document.removeEventListener("resize", this._scrollListener, !1), l && document.removeEventListener("click", this._clickListener, !1)) }, c.init = function (e) { if (f && (s = t(i, e || {}), this.options = s, this.state = {}, s.scrollSmooth && (s.duration = s.scrollSmoothDuration, s.offset = s.scrollSmoothOffset, c.scrollSmooth = n(5).initSmoothScrolling(s)), l = a(s), r = u(s), this._buildHtml = l, this._parseContent = r, c.destroy(), null !== (d = r.selectHeadings(s.contentSelector, s.headingSelector)))) { var m = r.nestHeadingsArray(d), h = m.nest; s.skipRendering || l.render(s.tocSelector, h), this._scrollListener = o(function (e) { l.updateToc(d); var t = e && e.target && e.target.scrollingElement && 0 === e.target.scrollingElement.scrollTop; (e && (0 === e.eventPhase || null === e.currentTarget) || t) && (l.updateToc(d), s.scrollEndCallback && s.scrollEndCallback(e)) }, s.throttleTimeout), this._scrollListener(), s.scrollContainer && document.querySelector(s.scrollContainer) ? (document.querySelector(s.scrollContainer).addEventListener("scroll", this._scrollListener, !1), document.querySelector(s.scrollContainer).addEventListener("resize", this._scrollListener, !1)) : (document.addEventListener("scroll", this._scrollListener, !1), document.addEventListener("resize", this._scrollListener, !1)); var p = null; return this._clickListener = o(function (e) { s.scrollSmooth && l.disableTocAnimation(e), l.updateToc(d), p && clearTimeout(p), p = setTimeout(function () { l.enableTocAnimation() }, s.scrollSmoothDuration) }, s.throttleTimeout), s.scrollContainer && document.querySelector(s.scrollContainer) ? document.querySelector(s.scrollContainer).addEventListener("click", this._clickListener, !1) : document.addEventListener("click", this._clickListener, !1), this } }, c.refresh = function (e) { c.destroy(), c.init(e || this.options) }, e.tocbot = c, c } }) }).call(t, n(1)) }, function (e, t) { var n; n = function () { return this }(); try { n = n || Function("return this")() || (0, eval)("this") } catch (e) { "object" == typeof window && (n = window) } e.exp
|