// Populate the sidebar
//
// This is a script, and not included directly in the page, to control the total size of the book.
// The TOC contains an entry for each page, so if each page includes a copy of the TOC,
// the total size of the page becomes O(n**2).
class MDBookSidebarScrollbox extends HTMLElement {
    constructor() {
        super();
    }
    connectedCallback() {
        this.innerHTML = '<ol class="chapter"><li class="chapter-item expanded affix "><a href="home.html">Fatdog64 64-bit GNU/Linux Operating System</a></li><li class="chapter-item expanded affix "><a href="faq.html">Frequently Asked Questions</a></li><li class="chapter-item expanded affix "><a href="faq_file_list.html">List of FAQ Files</a></li><li class="chapter-item expanded "><a href="Debian.html"><strong aria-hidden="true">1.</strong> Foreign software packages (Debian/Ubuntu/Slack/...)</a></li><li class="chapter-item expanded "><a href="Networking.html"><strong aria-hidden="true">2.</strong> Networking</a></li><li class="chapter-item expanded "><a href="bluetooth-audio.html"><strong aria-hidden="true">3.</strong> How to listen to music using Bluetooth speakers or headphones</a></li><li class="chapter-item expanded "><a href="bluetooth.html"><strong aria-hidden="true">4.</strong> Bluetooth known issues</a></li><li class="chapter-item expanded "><a href="bluray.html"><strong aria-hidden="true">5.</strong> BluRay support</a></li><li class="chapter-item expanded "><a href="boot-keyboard-problem.html"><strong aria-hidden="true">6.</strong> My keyboard does not work at boot time</a></li><li class="chapter-item expanded "><a href="boot-options.html"><strong aria-hidden="true">7.</strong> Kernel Command Line Parameters (aka Boot Options)</a></li><li class="chapter-item expanded "><a href="brightness.html"><strong aria-hidden="true">8.</strong> Screen Brightness controls not working</a></li><li class="chapter-item expanded "><a href="broadcom.html"><strong aria-hidden="true">9.</strong> Broadcom wireless</a></li><li class="chapter-item expanded "><a href="bugs.html"><strong aria-hidden="true">10.</strong> Think you&#39;ve found a bug?</a></li><li class="chapter-item expanded "><a href="chrome.html"><strong aria-hidden="true">11.</strong> Video Noise with Google Chrome full screen</a></li><li class="chapter-item expanded "><a href="clean-desktop.html"><strong aria-hidden="true">12.</strong> Adding application icons to desktop</a></li><li class="chapter-item expanded "><a href="cpu-mitigations.html"><strong aria-hidden="true">13.</strong> Slowness after updating Fatdog</a></li><li class="chapter-item expanded "><a href="defaults.html"><strong aria-hidden="true">14.</strong> How to change programs used as default?</a></li><li class="chapter-item expanded "><a href="desktop-icon-themes.html"><strong aria-hidden="true">15.</strong> Changing desktop icon themes</a></li><li class="chapter-item expanded "><a href="disable-gpe.html"><strong aria-hidden="true">16.</strong> Kernel thread (kworker) eats 100% of my CPU or my Mac is running super hot while doing nothing</a></li><li class="chapter-item expanded "><a href="enlarge-savefile.html"><strong aria-hidden="true">17.</strong> How to enlarge my savefile?</a></li><li class="chapter-item expanded "><a href="fd-packages.html"><strong aria-hidden="true">18.</strong> Additional software packages</a></li><li class="chapter-item expanded "><a href="filesystem.html"><strong aria-hidden="true">19.</strong> Filesystem structure</a></li><li class="chapter-item expanded "><a href="firefox-spot.html"><strong aria-hidden="true">20.</strong> Browser runs as restricted user</a></li><li class="chapter-item expanded "><a href="firewall.html"><strong aria-hidden="true">21.</strong> Firewall setup</a></li><li class="chapter-item expanded "><a href="firmware.html"><strong aria-hidden="true">22.</strong> How to find firmware for your devices</a></li><li class="chapter-item expanded "><a href="flash_player.html"><strong aria-hidden="true">23.</strong> Fatdog64-900 does not include the Flash Player</a></li><li class="chapter-item expanded "><a href="full-install.html"><strong aria-hidden="true">24.</strong> Fatdog64 full-install guide</a></li><li class="chapter-item expanded "><a href="get-refind.html"><strong aria-hidden="true">25.</strong> Where to get rEFInd boot loader</a></li><li class="chapter-item expanded "><a href="harddrive.html"><strong aria-hidden="true">26.</strong> Installation options</a></li><li class="chapter-item expanded "><a href="huge-initrd.html"><strong aria-hidden="true">27.</strong> Humongous initrd</a></li><li class="chapter-item expanded "><a href="index.html"><strong aria-hidden="true">28.</strong> Frequently Asked Questions</a></li><li class="chapter-item expanded "><a href="initrd.html"><strong aria-hidden="true">29.</strong> Replacing a kernel module in initrd</a></li><li class="chapter-item expanded "><a href="intel-graphics.html"><strong aria-hidden="true">30.</strong> Intel graphics known issues</a></li><li class="chapter-item expanded "><a href="iso-builder.html"><strong aria-hidden="true">31.</strong> Fatdog64 ISO Builder</a></li><li class="chapter-item expanded "><a href="kernel-build.html"><strong aria-hidden="true">32.</strong> How to build a kernel for Fatdog</a></li><li class="chapter-item expanded "><a href="kernel-module.html"><strong aria-hidden="true">33.</strong> How to compile kernel module for Fatdog64</a></li><li class="chapter-item expanded "><a href="kernel.html"><strong aria-hidden="true">34.</strong> How to use a different kernel</a></li><li class="chapter-item expanded "><a href="keys.html"><strong aria-hidden="true">35.</strong> Basic keyboard shortcuts</a></li><li class="chapter-item expanded "><a href="libinput.4.html"><strong aria-hidden="true">36.</strong> libinput.4.md</a></li><li class="chapter-item expanded "><a href="links.html"><strong aria-hidden="true">37.</strong> Resources and additional information</a></li><li class="chapter-item expanded "><a href="login.html"><strong aria-hidden="true">38.</strong> Why am I logged in as root?</a></li><li class="chapter-item expanded "><a href="misc.html"><strong aria-hidden="true">39.</strong> Miscellaneous known issues</a></li><li class="chapter-item expanded "><a href="mtrack.html"><strong aria-hidden="true">40.</strong> mtrack - Xorg multitouch trackpad driver</a></li><li class="chapter-item expanded "><a href="netflix.html"><strong aria-hidden="true">41.</strong> Netflix</a></li><li class="chapter-item expanded "><a href="no-savefile.html"><strong aria-hidden="true">42.</strong> Why does Fatdog not use my savefile?</a></li><li class="chapter-item expanded "><a href="nouveau.html"><strong aria-hidden="true">43.</strong> Crashing, tearing or freezing with Nouveau</a></li><li class="chapter-item expanded "><a href="optimus.html"><strong aria-hidden="true">44.</strong> NVIDIA Optimus</a></li><li class="chapter-item expanded "><a href="p4p-index.html"><strong aria-hidden="true">45.</strong> Primer for Puppy Linux users</a></li><li class="chapter-item expanded "><a href="panel-icons.html"><strong aria-hidden="true">46.</strong> Panel icons</a></li><li class="chapter-item expanded "><a href="pet-package.html"><strong aria-hidden="true">47.</strong> How to make packages for Fatdog64</a></li><li class="chapter-item expanded "><a href="printing.html"><strong aria-hidden="true">48.</strong> Printing and printers</a></li><li class="chapter-item expanded "><a href="radeon.html"><strong aria-hidden="true">49.</strong> Bad 2D performance, tearing or freezing with Radeon</a></li><li class="chapter-item expanded "><a href="sandbox.html"><strong aria-hidden="true">50.</strong> Fatdog64 Sandbox Environment</a></li><li class="chapter-item expanded "><a href="screen.html"><strong aria-hidden="true">51.</strong> Display problems</a></li><li class="chapter-item expanded "><a href="secure-boot.html"><strong aria-hidden="true">52.</strong> Booting with Secure-Boot</a></li><li class="chapter-item expanded "><a href="sfs-package.html"><strong aria-hidden="true">53.</strong> How to make SFS packages for Fatdog64</a></li><li class="chapter-item expanded "><a href="sharing.html"><strong aria-hidden="true">54.</strong> File sharing</a></li><li class="chapter-item expanded "><a href="smb-browser.html"><strong aria-hidden="true">55.</strong> SMB Browser Help</a></li><li class="chapter-item expanded "><a href="sound.html"><strong aria-hidden="true">56.</strong> Sound problems?</a></li><li class="chapter-item expanded "><a href="spot.html"><strong aria-hidden="true">57.</strong> Spot&#39;s home directory moved (Fatdog64 720 onwards)</a></li><li class="chapter-item expanded "><a href="suspend.html"><strong aria-hidden="true">58.</strong> How to suspend and hibernate</a></li><li class="chapter-item expanded "><a href="synaptics.4.html"><strong aria-hidden="true">59.</strong> synaptics.4.md</a></li><li class="chapter-item expanded "><a href="temp-boot-kernel.html"><strong aria-hidden="true">60.</strong> How to temporarily boot with a different kernel</a></li><li class="chapter-item expanded "><a href="touchpad.html"><strong aria-hidden="true">61.</strong> Touchpad problems?</a></li><li class="chapter-item expanded "><a href="uefi-flashdrive.html"><strong aria-hidden="true">62.</strong> Installing Fatdog64 on a flash drive for UEFI and BIOS booting</a></li><li class="chapter-item expanded "><a href="uefi-flashdrive2.html"><strong aria-hidden="true">63.</strong> Alternative Flash-drive Installation Method for UEFI Boot</a></li><li class="chapter-item expanded "><a href="uefi-harddrive.html"><strong aria-hidden="true">64.</strong> Hard drive (frugal) installation of Fatdog64 on a computer with UEFI and secure boot</a></li><li class="chapter-item expanded "><a href="uefi-lick.html"><strong aria-hidden="true">65.</strong> LICK installer</a></li><li class="chapter-item expanded "><a href="uml.html"><strong aria-hidden="true">66.</strong> Fatdog64 User Mode Linux (UML) Environment</a></li><li class="chapter-item expanded "><a href="updates.html"><strong aria-hidden="true">67.</strong> Updating browsers</a></li><li class="chapter-item expanded "><a href="urxvt.html"><strong aria-hidden="true">68.</strong> urxvt (rxvt-unicode) tips</a></li><li class="chapter-item expanded "><a href="usb-boot.html"><strong aria-hidden="true">69.</strong> Bootable USB Installation</a></li><li class="chapter-item expanded "><a href="winbindd.html"><strong aria-hidden="true">70.</strong> NetBIOS name resolution</a></li></ol>';
        // Set the current, active page, and reveal it if it's hidden
        let current_page = document.location.href.toString();
        if (current_page.endsWith("/")) {
            current_page += "index.html";
        }
        var links = Array.prototype.slice.call(this.querySelectorAll("a"));
        var l = links.length;
        for (var i = 0; i < l; ++i) {
            var link = links[i];
            var href = link.getAttribute("href");
            if (href && !href.startsWith("#") && !/^(?:[a-z+]+:)?\/\//.test(href)) {
                link.href = path_to_root + href;
            }
            // The "index" page is supposed to alias the first chapter in the book.
            if (link.href === current_page || (i === 0 && path_to_root === "" && current_page.endsWith("/index.html"))) {
                link.classList.add("active");
                var parent = link.parentElement;
                if (parent && parent.classList.contains("chapter-item")) {
                    parent.classList.add("expanded");
                }
                while (parent) {
                    if (parent.tagName === "LI" && parent.previousElementSibling) {
                        if (parent.previousElementSibling.classList.contains("chapter-item")) {
                            parent.previousElementSibling.classList.add("expanded");
                        }
                    }
                    parent = parent.parentElement;
                }
            }
        }
        // Track and set sidebar scroll position
        this.addEventListener('click', function(e) {
            if (e.target.tagName === 'A') {
                sessionStorage.setItem('sidebar-scroll', this.scrollTop);
            }
        }, { passive: true });
        var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
        sessionStorage.removeItem('sidebar-scroll');
        if (sidebarScrollTop) {
            // preserve sidebar scroll position when navigating via links within sidebar
            this.scrollTop = sidebarScrollTop;
        } else {
            // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
            var activeSection = document.querySelector('#sidebar .active');
            if (activeSection) {
                activeSection.scrollIntoView({ block: 'center' });
            }
        }
        // Toggle buttons
        var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle');
        function toggleSection(ev) {
            ev.currentTarget.parentElement.classList.toggle('expanded');
        }
        Array.from(sidebarAnchorToggles).forEach(function (el) {
            el.addEventListener('click', toggleSection);
        });
    }
}
window.customElements.define("mdbook-sidebar-scrollbox", MDBookSidebarScrollbox);
