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mC,GAAQG,EAAMH,EAAOF,GAEvBT,aAAaY,GACbA,EAAaX,YAAW,WACtBU,EAAOG,EACPN,EAAGS,MAAMJ,EAASG,EACpB,GAAGP,KAEHE,EAAOG,EACPN,EAAGS,MAAMJ,EAASG,GAEtB,CACF,CAaA,SAASlC,EAAelN,GACtB,IACE,OAAOA,EAAQC,YAAcK,SAASmE,cAAczE,EAAQkG,YAC9D,CAAE,MAAOS,GAEP,OADA2C,QAAQC,KAAK,0BAA4BvJ,EAAQkG,aAC1C,IACT,CACF,CCrPA,MAGA,EAHe,CAAE8G,QAAO,OAAM,UAAS,E","sources":["webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/src/js/build-html.js","webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/src/js/default-options.js","webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/src/js/parse-content.js","webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/src/js/scroll-smooth/index.js","webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/src/js/update-toc-scroll.js","webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/src/js/index-esm.js","webpack://sakurairo-scripts/./node_modules/.pnpm/tocbot@4.29.0/node_modules/tocbot/index.js"],"sourcesContent":["/* eslint no-var: off */\n\n/**\n * This file is responsible for building the DOM and updating DOM state.\n *\n * @author Tim Scanlin\n */\n\nexport default function (options) {\n var forEach = [].forEach\n var some = [].some\n // if (typeof window === 'undefined') return\n var body = typeof window !== 'undefined' && document.body\n var tocElement\n var currentlyHighlighting = true\n var SPACE_CHAR = ' '\n\n /**\n * Create link and list elements.\n * @param {Object} d\n * @param {HTMLElement} container\n * @return {HTMLElement}\n */\n function createEl (d, container) {\n var link = container.appendChild(createLink(d))\n if (d.children.length) {\n var list = createList(d.isCollapsed)\n d.children.forEach(function (child) {\n createEl(child, list)\n })\n link.appendChild(list)\n }\n }\n\n /**\n * Render nested heading array data into a given element.\n * @param {HTMLElement} parent Optional. If provided updates the {@see tocElement} to match.\n * @param {Array} data\n * @return {HTMLElement}\n */\n function render (parent, data) {\n var collapsed = false\n var container = createList(collapsed)\n\n data.forEach(function (d) {\n createEl(d, container)\n })\n\n // Return if no TOC element is provided or known.\n tocElement = parent || tocElement\n if (tocElement === null) {\n return\n }\n\n // Remove existing child if it exists.\n if (tocElement.firstChild) {\n tocElement.removeChild(tocElement.firstChild)\n }\n\n // Just return the parent and don't append the list if no links are found.\n if (data.length === 0) {\n return tocElement\n }\n\n // Append the Elements that have been created\n return tocElement.appendChild(container)\n }\n\n /**\n * Create link element.\n * @param {Object} data\n * @return {HTMLElement}\n */\n function createLink (data) {\n var item = document.createElement('li')\n var a = document.createElement('a')\n if (options.listItemClass) {\n item.setAttribute('class', options.listItemClass)\n }\n\n if (options.onClick) {\n a.onclick = options.onClick\n }\n\n if (options.includeTitleTags) {\n a.setAttribute('title', data.textContent)\n }\n\n if (options.includeHtml && data.childNodes.length) {\n forEach.call(data.childNodes, function (node) {\n a.appendChild(node.cloneNode(true))\n })\n } else {\n // Default behavior. Set to textContent to keep tests happy.\n a.textContent = data.textContent\n }\n a.setAttribute('href', options.basePath + '#' + data.id)\n a.setAttribute('class', options.linkClass +\n SPACE_CHAR + 'node-name--' + data.nodeName +\n SPACE_CHAR + options.extraLinkClasses)\n item.appendChild(a)\n return item\n }\n\n /**\n * Create list element.\n * @param {Boolean} isCollapsed\n * @return {HTMLElement}\n */\n function createList (isCollapsed) {\n var listElement = (options.orderedList) ? 'ol' : 'ul'\n var list = document.createElement(listElement)\n var classes = options.listClass + SPACE_CHAR + options.extraListClasses\n if (isCollapsed) {\n // No plus/equals here fixes compilation issue.\n classes = classes + SPACE_CHAR + options.collapsibleClass\n classes = classes + SPACE_CHAR + options.isCollapsedClass\n }\n list.setAttribute('class', classes)\n return list\n }\n\n /**\n * Update fixed sidebar class.\n * @return {HTMLElement}\n */\n function updateFixedSidebarClass () {\n if (options.scrollContainer && document.querySelector(options.scrollContainer)) {\n var top\n top = document.querySelector(options.scrollContainer).scrollTop\n } else {\n top = document.documentElement.scrollTop || body.scrollTop\n }\n var posFixedEl = document.querySelector(options.positionFixedSelector)\n\n if (options.fixedSidebarOffset === 'auto') {\n options.fixedSidebarOffset = tocElement.offsetTop\n }\n\n if (top > options.fixedSidebarOffset) {\n if (posFixedEl.className.indexOf(options.positionFixedClass) === -1) {\n posFixedEl.className += SPACE_CHAR + options.positionFixedClass\n }\n } else {\n posFixedEl.className = posFixedEl.className.replace(SPACE_CHAR + options.positionFixedClass, '')\n }\n }\n\n /**\n * Get top position of heading\n * @param {HTMLElement} obj\n * @return {int} position\n */\n function getHeadingTopPos (obj) {\n var position = 0\n if (obj !== null) {\n position = obj.offsetTop\n if (options.hasInnerContainers) { position += getHeadingTopPos(obj.offsetParent) }\n }\n return position\n }\n\n /**\n * Update className only when changed.\n * @param {HTMLElement} obj\n * @param {string} className\n * @return {HTMLElement} obj\n */\n function updateClassname (obj, className) {\n if (obj && obj.className !== className) {\n obj.className = className\n }\n return obj\n }\n\n /**\n * Update TOC highlighting and collapsed groupings.\n */\n function updateToc (headingsArray) {\n // If a fixed content container was set\n if (options.scrollContainer && document.querySelector(options.scrollContainer)) {\n var top\n top = document.querySelector(options.scrollContainer).scrollTop\n } else {\n top = document.documentElement.scrollTop || body.scrollTop\n }\n\n // Add fixed class at offset\n if (options.positionFixedSelector) {\n updateFixedSidebarClass()\n }\n\n // Get the top most heading currently visible on the page so we know what to highlight.\n var headings = headingsArray\n var topHeader\n // Using some instead of each so that we can escape early.\n if (currentlyHighlighting &&\n tocElement !== null &&\n headings.length > 0) {\n some.call(headings, function (heading, i) {\n if (getHeadingTopPos(heading) > top + options.headingsOffset + 10) {\n // Don't allow negative index value.\n var index = (i === 0) ? i : i - 1\n topHeader = headings[index]\n return true\n } else if (i === headings.length - 1) {\n // This allows scrolling for the last heading on the page.\n topHeader = headings[headings.length - 1]\n return true\n }\n })\n\n var oldActiveTocLink = tocElement.querySelector('.' + options.activeLinkClass)\n var activeTocLink = tocElement\n .querySelector('.' + options.linkClass +\n '.node-name--' + topHeader.nodeName +\n '[href=\"' + options.basePath + '#' + topHeader.id.replace(/([ #;&,.+*~':\"!^$[\\]()=>|/\\\\@])/g, '\\\\$1') + '\"]')\n // Performance improvement to only change the classes\n // for the toc if a new link should be highlighted.\n if (oldActiveTocLink === activeTocLink) {\n return\n }\n\n // Remove the active class from the other tocLinks.\n var tocLinks = tocElement\n .querySelectorAll('.' + options.linkClass)\n forEach.call(tocLinks, function (tocLink) {\n updateClassname(tocLink, tocLink.className.replace(SPACE_CHAR + options.activeLinkClass, ''))\n })\n var tocLis = tocElement\n .querySelectorAll('.' + options.listItemClass)\n forEach.call(tocLis, function (tocLi) {\n updateClassname(tocLi, tocLi.className.replace(SPACE_CHAR + options.activeListItemClass, ''))\n })\n\n // Add the active class to the active tocLink.\n if (activeTocLink && activeTocLink.className.indexOf(options.activeLinkClass) === -1) {\n activeTocLink.className += SPACE_CHAR + options.activeLinkClass\n }\n var li = activeTocLink && activeTocLink.parentNode\n if (li && li.className.indexOf(options.activeListItemClass) === -1) {\n li.className += SPACE_CHAR + options.activeListItemClass\n }\n\n var tocLists = tocElement\n .querySelectorAll('.' + options.listClass + '.' + options.collapsibleClass)\n\n // Collapse the other collapsible lists.\n forEach.call(tocLists, function (list) {\n if (list.className.indexOf(options.isCollapsedClass) === -1) {\n list.className += SPACE_CHAR + options.isCollapsedClass\n }\n })\n\n // Expand the active link's collapsible list and its sibling if applicable.\n if (activeTocLink && activeTocLink.nextSibling && activeTocLink.nextSibling.className.indexOf(options.isCollapsedClass) !== -1) {\n updateClassname(activeTocLink.nextSibling, activeTocLink.nextSibling.className.replace(SPACE_CHAR + options.isCollapsedClass, ''))\n }\n removeCollapsedFromParents(activeTocLink && activeTocLink.parentNode.parentNode)\n }\n }\n\n /**\n * Remove collapsed class from parent elements.\n * @param {HTMLElement} element\n * @return {HTMLElement}\n */\n function removeCollapsedFromParents (element) {\n if (element && element.className.indexOf(options.collapsibleClass) !== -1 && element.className.indexOf(options.isCollapsedClass) !== -1) {\n updateClassname(element, element.className.replace(SPACE_CHAR + options.isCollapsedClass, ''))\n return removeCollapsedFromParents(element.parentNode.parentNode)\n }\n return element\n }\n\n /**\n * Disable TOC Animation when a link is clicked.\n * @param {Event} event\n */\n function disableTocAnimation (event) {\n var target = event.target || event.srcElement\n if (typeof target.className !== 'string' || target.className.indexOf(options.linkClass) === -1) {\n return\n }\n // Bind to tocLink clicks to temporarily disable highlighting\n // while smoothScroll is animating.\n currentlyHighlighting = false\n }\n\n /**\n * Enable TOC Animation.\n */\n function enableTocAnimation () {\n currentlyHighlighting = true\n }\n\n return {\n enableTocAnimation,\n disableTocAnimation,\n render,\n updateToc\n }\n}\n","export default {\n // Where to render the table of contents.\n tocSelector: '.js-toc',\n // Where to grab the headings to build the table of contents.\n contentSelector: '.js-toc-content',\n // Which headings to grab inside of the contentSelector element.\n headingSelector: 'h1, h2, h3',\n // Headings that match the ignoreSelector will be skipped.\n ignoreSelector: '.js-toc-ignore',\n // For headings inside relative or absolute positioned containers within content\n hasInnerContainers: false,\n // Main class to add to links.\n linkClass: 'toc-link',\n // Extra classes to add to links.\n extraLinkClasses: '',\n // Class to add to active links,\n // the link corresponding to the top most heading on the page.\n activeLinkClass: 'is-active-link',\n // Main class to add to lists.\n listClass: 'toc-list',\n // Extra classes to add to lists.\n extraListClasses: '',\n // Class that gets added when a list should be collapsed.\n isCollapsedClass: 'is-collapsed',\n // Class that gets added when a list should be able\n // to be collapsed but isn't necessarily collapsed.\n collapsibleClass: 'is-collapsible',\n // Class to add to list items.\n listItemClass: 'toc-list-item',\n // Class to add to active list items.\n activeListItemClass: 'is-active-li',\n // How many heading levels should not be collapsed.\n // For example, number 6 will show everything since\n // there are only 6 heading levels and number 0 will collapse them all.\n // The sections that are hidden will open\n // and close as you scroll to headings within them.\n collapseDepth: 0,\n // Smooth scrolling enabled.\n scrollSmooth: true,\n // Smooth scroll duration.\n scrollSmoothDuration: 420,\n // Smooth scroll offset.\n scrollSmoothOffset: 0,\n // Callback for scroll end.\n scrollEndCallback: function (e) {},\n // Headings offset between the headings and the top of the document (this is meant for minor adjustments).\n headingsOffset: 1,\n // Timeout between events firing to make sure it's\n // not too rapid (for performance reasons).\n throttleTimeout: 50,\n // Element to add the positionFixedClass to.\n positionFixedSelector: null,\n // Fixed position class to add to make sidebar fixed after scrolling\n // down past the fixedSidebarOffset.\n positionFixedClass: 'is-position-fixed',\n // fixedSidebarOffset can be any number but by default is set\n // to auto which sets the fixedSidebarOffset to the sidebar\n // element's offsetTop from the top of the document on init.\n fixedSidebarOffset: 'auto',\n // includeHtml can be set to true to include the HTML markup from the\n // heading node instead of just including the innerText.\n includeHtml: false,\n // includeTitleTags automatically sets the html title tag of the link\n // to match the title. This can be useful for SEO purposes or\n // when truncating titles.\n includeTitleTags: false,\n // onclick function to apply to all links in toc. will be called with\n // the event as the first parameter, and this can be used to stop,\n // propagation, prevent default or perform action\n onClick: function (e) {},\n // orderedList can be set to false to generate unordered lists (ul)\n // instead of ordered lists (ol)\n orderedList: true,\n // If there is a fixed article scroll container, set to calculate titles' offset\n scrollContainer: null,\n // prevent ToC DOM rendering if it's already rendered by an external system\n skipRendering: false,\n // Optional callback to change heading labels.\n // For example it can be used to cut down and put ellipses on multiline headings you deem too long.\n // Called each time a heading is parsed. Expects a string and returns the modified label to display.\n // Additionally, the attribute `data-heading-label` may be used on a heading to specify\n // a shorter string to be used in the TOC.\n // function (string) => string\n headingLabelCallback: false,\n // ignore headings that are hidden in DOM\n ignoreHiddenElements: false,\n // Optional callback to modify properties of parsed headings.\n // The heading element is passed in node parameter and information parsed by default parser is provided in obj parameter.\n // Function has to return the same or modified obj.\n // The heading will be excluded from TOC if nothing is returned.\n // function (object, HTMLElement) => object | void\n headingObjectCallback: null,\n // Set the base path, useful if you use a `base` tag in `head`.\n basePath: '',\n // Only takes affect when `tocSelector` is scrolling,\n // keep the toc scroll position in sync with the content.\n disableTocScrollSync: false,\n // Offset for the toc scroll (top) position when scrolling the page.\n // Only effective if `disableTocScrollSync` is false.\n tocScrollOffset: 0\n}\n","/* eslint no-var: off */\n/**\n * This file is responsible for parsing the content from the DOM and making\n * sure data is nested properly.\n *\n * @author Tim Scanlin\n */\n\nexport default function parseContent (options) {\n var reduce = [].reduce\n\n /**\n * Get the last item in an array and return a reference to it.\n * @param {Array} array\n * @return {Object}\n */\n function getLastItem (array) {\n return array[array.length - 1]\n }\n\n /**\n * Get heading level for a heading dom node.\n * @param {HTMLElement} heading\n * @return {Number}\n */\n function getHeadingLevel (heading) {\n return +heading.nodeName.toUpperCase().replace('H', '')\n }\n\n /**\n * Determine whether the object is an HTML Element.\n * Also works inside iframes. HTML Elements might be created by the parent document.\n * @param {Object} maybeElement\n * @return {Number}\n */\n function isHTMLElement (maybeElement) {\n try {\n return (\n maybeElement instanceof window.HTMLElement ||\n maybeElement instanceof window.parent.HTMLElement\n )\n } catch (e) {\n return maybeElement instanceof window.HTMLElement\n }\n }\n\n /**\n * Get important properties from a heading element and store in a plain object.\n * @param {HTMLElement} heading\n * @return {Object}\n */\n function getHeadingObject (heading) {\n // each node is processed twice by this method because nestHeadingsArray() and addNode() calls it\n // first time heading is real DOM node element, second time it is obj\n // that is causing problem so I am processing only original DOM node\n if (!isHTMLElement(heading)) return heading\n\n if (options.ignoreHiddenElements && (!heading.offsetHeight || !heading.offsetParent)) {\n return null\n }\n\n const headingLabel = heading.getAttribute('data-heading-label') ||\n (options.headingLabelCallback ? String(options.headingLabelCallback(heading.innerText)) : (heading.innerText || heading.textContent).trim())\n var obj = {\n id: heading.id,\n children: [],\n nodeName: heading.nodeName,\n headingLevel: getHeadingLevel(heading),\n textContent: headingLabel\n }\n\n if (options.includeHtml) {\n obj.childNodes = heading.childNodes\n }\n\n if (options.headingObjectCallback) {\n return options.headingObjectCallback(obj, heading)\n }\n\n return obj\n }\n\n /**\n * Add a node to the nested array.\n * @param {Object} node\n * @param {Array} nest\n * @return {Array}\n */\n function addNode (node, nest) {\n var obj = getHeadingObject(node)\n var level = obj.headingLevel\n var array = nest\n var lastItem = getLastItem(array)\n var lastItemLevel = lastItem\n ? lastItem.headingLevel\n : 0\n var counter = level - lastItemLevel\n\n while (counter > 0) {\n lastItem = getLastItem(array)\n // Handle case where there are multiple h5+ in a row.\n if (lastItem && level === lastItem.headingLevel) {\n break\n } else if (lastItem && lastItem.children !== undefined) {\n array = lastItem.children\n }\n counter--\n }\n\n if (level >= options.collapseDepth) {\n obj.isCollapsed = true\n }\n\n array.push(obj)\n return array\n }\n\n /**\n * Select headings in content area, exclude any selector in options.ignoreSelector\n * @param {HTMLElement} contentElement\n * @param {Array} headingSelector\n * @return {Array}\n */\n function selectHeadings (contentElement, headingSelector) {\n var selectors = headingSelector\n if (options.ignoreSelector) {\n selectors = headingSelector.split(',')\n .map(function mapSelectors (selector) {\n return selector.trim() + ':not(' + options.ignoreSelector + ')'\n })\n }\n try {\n return contentElement.querySelectorAll(selectors)\n } catch (e) {\n console.warn('Headers not found with selector: ' + selectors); // eslint-disable-line\n return null\n }\n }\n\n /**\n * Nest headings array into nested arrays with 'children' property.\n * @param {Array} headingsArray\n * @return {Object}\n */\n function nestHeadingsArray (headingsArray) {\n return reduce.call(headingsArray, function reducer (prev, curr) {\n var currentHeading = getHeadingObject(curr)\n if (currentHeading) {\n addNode(currentHeading, prev.nest)\n }\n return prev\n }, {\n nest: []\n })\n }\n\n return {\n nestHeadingsArray,\n selectHeadings\n }\n}\n","/* eslint no-var: off */\n/* globals location, requestAnimationFrame */\n\nexport default function initSmoothScrolling (options) {\n // if (isCssSmoothSCrollSupported()) { return }\n\n var duration = options.duration\n var offset = options.offset\n if (typeof window === 'undefined' || typeof location === 'undefined') return\n\n var pageUrl = location.hash\n ? stripHash(location.href)\n : location.href\n\n delegatedLinkHijacking()\n\n function delegatedLinkHijacking () {\n document.body.addEventListener('click', onClick, false)\n\n function onClick (e) {\n if (\n !isInPageLink(e.target) ||\n e.target.className.indexOf('no-smooth-scroll') > -1 ||\n (e.target.href.charAt(e.target.href.length - 2) === '#' &&\n e.target.href.charAt(e.target.href.length - 1) === '!') ||\n e.target.className.indexOf(options.linkClass) === -1) {\n return\n }\n\n // Don't prevent default or hash doesn't change.\n // e.preventDefault()\n\n jump(e.target.hash, {\n duration,\n offset,\n callback: function () {\n setFocus(e.target.hash)\n }\n })\n }\n }\n\n function isInPageLink (n) {\n return n.tagName.toLowerCase() === 'a' &&\n (n.hash.length > 0 || n.href.charAt(n.href.length - 1) === '#') &&\n (stripHash(n.href) === pageUrl || stripHash(n.href) + '#' === pageUrl)\n }\n\n function stripHash (url) {\n return url.slice(0, url.lastIndexOf('#'))\n }\n\n // function isCssSmoothSCrollSupported () {\n // return 'scrollBehavior' in document.documentElement.style\n // }\n\n // Adapted from:\n // https://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/\n function setFocus (hash) {\n var element = document.getElementById(hash.substring(1))\n\n if (element) {\n if (!/^(?:a|select|input|button|textarea)$/i.test(element.tagName)) {\n element.tabIndex = -1\n }\n\n element.focus()\n }\n }\n}\n\nfunction jump (target, options) {\n var start = window.pageYOffset\n var opt = {\n duration: options.duration,\n offset: options.offset || 0,\n callback: options.callback,\n easing: options.easing || easeInOutQuad\n }\n // This makes ids that start with a number work: ('[id=\"' + decodeURI(target).split('#').join('') + '\"]')\n // DecodeURI for nonASCII hashes, they was encoded, but id was not encoded, it lead to not finding the tgt element by id.\n // And this is for IE: document.body.scrollTop\n // Handle decoded and non-decoded URIs since sometimes URLs automatically transform them (support for internation chars).\n var tgt = document.querySelector('[id=\"' + decodeURI(target).split('#').join('') + '\"]') ||\n document.querySelector('[id=\"' + (target).split('#').join('') + '\"]')\n var distance = typeof target === 'string'\n ? opt.offset + (\n target\n ? (tgt && tgt.getBoundingClientRect().top) || 0 // handle non-existent links better.\n : -(document.documentElement.scrollTop || document.body.scrollTop))\n : target\n var duration = typeof opt.duration === 'function'\n ? opt.duration(distance)\n : opt.duration\n var timeStart\n var timeElapsed\n\n requestAnimationFrame(function (time) { timeStart = time; loop(time) })\n function loop (time) {\n timeElapsed = time - timeStart\n\n window.scrollTo(0, opt.easing(timeElapsed, start, distance, duration))\n\n if (timeElapsed < duration) { requestAnimationFrame(loop) } else { end() }\n }\n\n function end () {\n window.scrollTo(0, start + distance)\n\n if (typeof opt.callback === 'function') { opt.callback() }\n }\n\n // Robert Penner's easeInOutQuad - http://robertpenner.com/easing/\n function easeInOutQuad (t, b, c, d) {\n t /= d / 2\n if (t < 1) return c / 2 * t * t + b\n t--\n return -c / 2 * (t * (t - 2) - 1) + b\n }\n}\n","/* eslint no-var: off */\n\nconst SCROLL_LEEWAY = 30\nexport default function updateTocScroll (options) {\n var toc = options.tocElement || document.querySelector(options.tocSelector)\n if (toc && toc.scrollHeight > toc.clientHeight) {\n var activeItem = toc.querySelector('.' + options.activeListItemClass)\n if (activeItem) {\n // Determine container top and bottom\n var cTop = toc.scrollTop\n var cBottom = cTop + toc.clientHeight\n\n // Determine element top and bottom\n var eTop = activeItem.offsetTop\n var eBottom = eTop + activeItem.clientHeight\n\n // Check if out of view\n // Above scroll view\n if (eTop < cTop + options.tocScrollOffset) {\n toc.scrollTop -= (cTop - eTop) + options.tocScrollOffset\n // Below scroll view\n } else if (eBottom > cBottom - options.tocScrollOffset - SCROLL_LEEWAY) {\n toc.scrollTop += (eBottom - cBottom) + options.tocScrollOffset + (2 * SCROLL_LEEWAY)\n }\n }\n }\n}\n","/* eslint no-var: off */\n/**\n * Tocbot\n * Tocbot creates a table of contents based on HTML headings on a page,\n * this allows users to easily jump to different sections of the document.\n * Tocbot was inspired by tocify (http://gregfranko.com/jquery.tocify.js/).\n * The main differences are that it works natively without any need for jquery or jquery UI).\n *\n * @author Tim Scanlin\n */\n\nimport BuildHtml from './build-html.js'\nimport defaultOptions from './default-options.js'\nimport ParseContent from './parse-content.js'\nimport initSmoothScrolling from './scroll-smooth/index.js'\nimport updateTocScroll from './update-toc-scroll.js'\n\n// For testing purposes.\nexport let _options = {} // Object to store current options.\nexport let _buildHtml\nexport let _parseContent\nexport let _headingsArray\nexport let _scrollListener\n\nlet clickListener\n\n/**\n * Initialize tocbot.\n * @param {object} customOptions\n */\nexport function init (customOptions) {\n // Merge defaults with user options.\n // Set to options variable at the top.\n _options = extend(defaultOptions, customOptions || {})\n\n // Init smooth scroll if enabled (default).\n if (_options.scrollSmooth) {\n _options.duration = _options.scrollSmoothDuration\n _options.offset = _options.scrollSmoothOffset\n\n initSmoothScrolling(_options)\n }\n\n // Pass options to these modules.\n _buildHtml = BuildHtml(_options)\n _parseContent = ParseContent(_options)\n\n // Destroy it if it exists first.\n destroy()\n\n const contentElement = getContentElement(_options)\n if (contentElement === null) {\n return\n }\n\n const tocElement = getTocElement(_options)\n if (tocElement === null) {\n return\n }\n\n // Get headings array.\n _headingsArray = _parseContent.selectHeadings(\n contentElement,\n _options.headingSelector\n )\n\n // Return if no headings are found.\n if (_headingsArray === null) {\n return\n }\n\n // Build nested headings array.\n const nestedHeadingsObj = _parseContent.nestHeadingsArray(_headingsArray)\n const nestedHeadings = nestedHeadingsObj.nest\n\n // Render.\n if (!_options.skipRendering) {\n _buildHtml.render(tocElement, nestedHeadings)\n } else {\n // No need to attach listeners if skipRendering is true, this was causing errors.\n return this\n }\n\n // Update Sidebar and bind listeners.\n _scrollListener = throttle(function (e) {\n _buildHtml.updateToc(_headingsArray)\n !_options.disableTocScrollSync && updateTocScroll(_options)\n const isTop =\n e &&\n e.target &&\n e.target.scrollingElement &&\n e.target.scrollingElement.scrollTop === 0\n if ((e && (e.eventPhase === 0 || e.currentTarget === null)) || isTop) {\n _buildHtml.updateToc(_headingsArray)\n if (_options.scrollEndCallback) {\n _options.scrollEndCallback(e)\n }\n }\n }, _options.throttleTimeout)\n _scrollListener()\n if (\n _options.scrollContainer &&\n document.querySelector(_options.scrollContainer)\n ) {\n document\n .querySelector(_options.scrollContainer)\n .addEventListener('scroll', _scrollListener, false)\n document\n .querySelector(_options.scrollContainer)\n .addEventListener('resize', _scrollListener, false)\n } else {\n document.addEventListener('scroll', _scrollListener, false)\n document.addEventListener('resize', _scrollListener, false)\n }\n\n // Bind click listeners to disable animation.\n let timeout = null\n clickListener = throttle(function (event) {\n if (_options.scrollSmooth) {\n _buildHtml.disableTocAnimation(event)\n }\n _buildHtml.updateToc(_headingsArray)\n // Timeout to re-enable the animation.\n timeout && clearTimeout(timeout)\n timeout = setTimeout(function () {\n _buildHtml.enableTocAnimation()\n }, _options.scrollSmoothDuration)\n }, _options.throttleTimeout)\n\n if (\n _options.scrollContainer &&\n document.querySelector(_options.scrollContainer)\n ) {\n document\n .querySelector(_options.scrollContainer)\n .addEventListener('click', clickListener, false)\n } else {\n document.addEventListener('click', clickListener, false)\n }\n}\n\n/**\n * Destroy tocbot.\n */\nexport function destroy () {\n const tocElement = getTocElement(_options)\n if (tocElement === null) {\n return\n }\n\n if (!_options.skipRendering) {\n // Clear HTML.\n if (tocElement) {\n tocElement.innerHTML = ''\n }\n }\n\n // Remove event listeners.\n if (\n _options.scrollContainer &&\n document.querySelector(_options.scrollContainer)\n ) {\n document\n .querySelector(_options.scrollContainer)\n .removeEventListener('scroll', _scrollListener, false)\n document\n .querySelector(_options.scrollContainer)\n .removeEventListener('resize', _scrollListener, false)\n if (_buildHtml) {\n document\n .querySelector(_options.scrollContainer)\n .removeEventListener('click', clickListener, false)\n }\n } else {\n document.removeEventListener('scroll', _scrollListener, false)\n document.removeEventListener('resize', _scrollListener, false)\n if (_buildHtml) {\n document.removeEventListener('click', clickListener, false)\n }\n }\n}\n\n/**\n * Refresh tocbot.\n */\nexport function refresh (customOptions) {\n destroy()\n init(customOptions || _options)\n}\n\n// From: https://github.com/Raynos/xtend\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nfunction extend () {\n const target = {}\n for (let i = 0; i < arguments.length; i++) {\n const source = arguments[i]\n for (const key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n return target\n}\n\n// From: https://remysharp.com/2010/07/21/throttling-function-calls\nfunction throttle (fn, threshold, scope) {\n threshold || (threshold = 250)\n let last\n let deferTimer\n return function () {\n const context = scope || this\n const now = +new Date()\n const args = arguments\n if (last && now < last + threshold) {\n // hold on to it\n clearTimeout(deferTimer)\n deferTimer = setTimeout(function () {\n last = now\n fn.apply(context, args)\n }, threshold)\n } else {\n last = now\n fn.apply(context, args)\n }\n }\n}\n\nfunction getContentElement (options) {\n try {\n return (\n options.contentElement || document.querySelector(options.contentSelector)\n )\n } catch (e) {\n console.warn('Contents element not found: ' + options.contentSelector) // eslint-disable-line\n return null\n }\n}\n\nfunction getTocElement (options) {\n try {\n return options.tocElement || document.querySelector(options.tocSelector)\n } catch (e) {\n console.warn('TOC element not found: ' + options.tocSelector) // eslint-disable-line\n return null\n }\n}\n","import { destroy, init, refresh } from './src/js/index-esm.js'\nconst tocbot = { destroy, init, refresh }\n\nexport { destroy, init, refresh }\nexport default tocbot\n"],"names":["options","tocElement","forEach","some","body","window","document","currentlyHighlighting","SPACE_CHAR","createEl","d","container","link","appendChild","data","item","createElement","a","listItemClass","setAttribute","onClick","onclick","includeTitleTags","textContent","includeHtml","childNodes","length","call","node","cloneNode","basePath","id","linkClass","nodeName","extraLinkClasses","createLink","children","list","createList","isCollapsed","child","listElement","classes","listClass","extraListClasses","collapsibleClass","isCollapsedClass","getHeadingTopPos","obj","position","offsetTop","hasInnerContainers","offsetParent","updateClassname","className","removeCollapsedFromParents","element","indexOf","replace","parentNode","enableTocAnimation","disableTocAnimation","event","target","srcElement","render","parent","firstChild","removeChild","updateToc","headingsArray","top","scrollContainer","querySelector","scrollTop","documentElement","positionFixedSelector","posFixedEl","fixedSidebarOffset","positionFixedClass","updateFixedSidebarClass","topHeader","headings","heading","i","headingsOffset","oldActiveTocLink","activeLinkClass","activeTocLink","tocLinks","querySelectorAll","tocLink","tocLis","tocLi","activeListItemClass","li","tocLists","nextSibling","tocSelector","contentSelector","headingSelector","ignoreSelector","collapseDepth","scrollSmooth","scrollSmoothDuration","scrollSmoothOffset","scrollEndCallback","e","throttleTimeout","orderedList","skipRendering","headingLabelCallback","ignoreHiddenElements","headingObjectCallback","disableTocScrollSync","tocScrollOffset","parseContent","reduce","getLastItem","array","getHeadingLevel","toUpperCase","getHeadingObject","maybeElement","HTMLElement","isHTMLElement","offsetHeight","headingLabel","getAttribute","String","innerText","trim","headingLevel","nestHeadingsArray","prev","curr","currentHeading","nest","level","lastItem","counter","undefined","push","addNode","selectHeadings","contentElement","selectors","split","map","selector","console","warn","initSmoothScrolling","duration","offset","location","pageUrl","hash","stripHash","href","addEventListener","n","tagName","toLowerCase","charAt","timeStart","timeElapsed","start","pageYOffset","opt","callback","easing","easeInOutQuad","tgt","decodeURI","join","distance","getBoundingClientRect","loop","time","scrollTo","requestAnimationFrame","end","t","b","c","jump","getElementById","substring","test","tabIndex","focus","url","slice","lastIndexOf","SCROLL_LEEWAY","_buildHtml","_parseContent","_headingsArray","_scrollListener","clickListener","_options","init","customOptions","arguments","source","key","extend","destroy","getContentElement","getTocElement","nestedHeadings","this","throttle","toc","scrollHeight","clientHeight","activeItem","cTop","cBottom","eTop","eBottom","updateTocScroll","isTop","scrollingElement","eventPhase","currentTarget","timeout","clearTimeout","setTimeout","innerHTML","removeEventListener","refresh","Object","prototype","hasOwnProperty","fn","threshold","scope","last","deferTimer","context","now","Date","args","apply"],"sourceRoot":""}
|