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M+J,kBACN/K,EAAOgL,SAAWhL,EAAOgL,QAIrBhL,EAAOgL,QAAS,CAGlB,MAAMC,EAAUtC,EAAQ/I,cAAc,aAGtCsH,YAAW,IAAM+D,EAAQ9K,SAAS,IACpC,IACA,IAOJ,CACE,CAACuK,EAAgBF,EAAeI,GAChC,CAACD,EAAkBF,EAAiBI,IACpClM,SAAQ,EAAEgK,EAAS3I,EAAQkL,MACtBvC,GAGLA,EAAQlO,iBAAiB,WAAYuG,IACjB,WAAdA,EAAM+I,MACR/I,EAAMU,iBACNV,EAAM+J,kBACN/K,EAAOgL,SAAU,EACjBE,EAAY/K,QACd,GACA,IAKJ,CACE,CAACqK,EAAeI,GAChB,CAACH,EAAiBI,IAClBlM,SAAQ,EAAEqB,EAAQkL,MAClBlL,EAAOvF,iBAAiB,UAAWuG,IAC5BA,EAAMa,cAAcmJ,SACvBE,EAAY/K,OACd,GACA,GAEN,IAyI4B,aAAxB5F,SAASC,WACX8L,IAEAzI,OAAOpD,iBAAiB,OAAQ6L,E","sources":["webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/mixin.js","webpack://pydata_sphinx_theme/./node_modules/compare-versions/lib/esm/index.js","webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js"],"sourcesContent":["/* define several functions to replace jQuery methods\n * inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/\n */\n\n/**\n * Execute a method if DOM has finished loading\n *\n * @param {function} callback the method to execute\n */\nexport function documentReady(callback) {\n if (document.readyState != \"loading\") callback();\n else document.addEventListener(\"DOMContentLoaded\", callback);\n}\n","/**\n * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.\n * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.\n * @param v1 - First version to compare\n * @param v2 - Second version to compare\n * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).\n */\nexport const compareVersions = (v1, v2) => {\n // validate input and split into segments\n const n1 = validateAndParse(v1);\n const n2 = validateAndParse(v2);\n // pop off the patch\n const p1 = n1.pop();\n const p2 = n2.pop();\n // validate numbers\n const r = compareSegments(n1, n2);\n if (r !== 0)\n return r;\n // validate pre-release\n if (p1 && p2) {\n return compareSegments(p1.split('.'), p2.split('.'));\n }\n else if (p1 || p2) {\n return p1 ? -1 : 1;\n }\n return 0;\n};\n/**\n * Validate [semver](https://semver.org/) version strings.\n *\n * @param version Version number to validate\n * @returns `true` if the version number is a valid semver version number, `false` otherwise.\n *\n * @example\n * ```\n * validate('1.0.0-rc.1'); // return true\n * validate('1.0-rc.1'); // return false\n * validate('foo'); // return false\n * ```\n */\nexport const validate = (version) => typeof version === 'string' && /^[v\\d]/.test(version) && semver.test(version);\n/**\n * Compare [semver](https://semver.org/) version strings using the specified operator.\n *\n * @param v1 First version to compare\n * @param v2 Second version to compare\n * @param operator Allowed arithmetic operator to use\n * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.\n *\n * @example\n * ```\n * compare('10.1.8', '10.0.4', '>'); // return true\n * compare('10.0.1', '10.0.1', '='); // return true\n * compare('10.1.1', '10.2.2', '<'); // return true\n * compare('10.1.1', '10.2.2', '<='); // return true\n * compare('10.1.1', '10.2.2', '>='); // return false\n * ```\n */\nexport const compare = (v1, v2, operator) => {\n // validate input operator\n assertValidOperator(operator);\n // since result of compareVersions can only be -1 or 0 or 1\n // a simple map can be used to replace switch\n const res = compareVersions(v1, v2);\n return operatorResMap[operator].includes(res);\n};\n/**\n * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.\n *\n * @param version Version number to match\n * @param range Range pattern for version\n * @returns `true` if the version number is within the range, `false` otherwise.\n *\n * @example\n * ```\n * satisfies('1.1.0', '^1.0.0'); // return true\n * satisfies('1.1.0', '~1.0.0'); // return false\n * ```\n */\nexport const satisfies = (version, range) => {\n // if no range operator then \"=\"\n const m = range.match(/^([<>=~^]+)/);\n const op = m ? m[1] : '=';\n // if gt/lt/eq then operator compare\n if (op !== '^' && op !== '~')\n return compare(version, range, op);\n // else range of either \"~\" or \"^\" is assumed\n const [v1, v2, v3, , vp] = validateAndParse(version);\n const [r1, r2, r3, , rp] = validateAndParse(range);\n const v = [v1, v2, v3];\n const r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x'];\n // validate pre-release\n if (rp) {\n if (!vp)\n return false;\n if (compareSegments(v, r) !== 0)\n return false;\n if (compareSegments(vp.split('.'), rp.split('.')) === -1)\n return false;\n }\n // first non-zero number\n const nonZero = r.findIndex((v) => v !== '0') + 1;\n // pointer to where segments can be >=\n const i = op === '~' ? 2 : nonZero > 1 ? nonZero : 1;\n // before pointer must be equal\n if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0)\n return false;\n // after pointer must be >=\n if (compareSegments(v.slice(i), r.slice(i)) === -1)\n return false;\n return true;\n};\nconst semver = /^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\-]+(?:\\.[\\da-z\\-]+)*))?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\nconst validateAndParse = (version) => {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n const match = version.match(semver);\n if (!match) {\n throw new Error(`Invalid argument not valid semver ('${version}' received)`);\n }\n match.shift();\n return match;\n};\nconst isWildcard = (s) => s === '*' || s === 'x' || s === 'X';\nconst tryParse = (v) => {\n const n = parseInt(v, 10);\n return isNaN(n) ? v : n;\n};\nconst forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];\nconst compareStrings = (a, b) => {\n if (isWildcard(a) || isWildcard(b))\n return 0;\n const [ap, bp] = forceType(tryParse(a), tryParse(b));\n if (ap > bp)\n return 1;\n if (ap < bp)\n return -1;\n return 0;\n};\nconst compareSegments = (a, b) => {\n for (let i = 0; i < Math.max(a.length, b.length); i++) {\n const r = compareStrings(a[i] || '0', b[i] || '0');\n if (r !== 0)\n return r;\n }\n return 0;\n};\nconst operatorResMap = {\n '>': [1],\n '>=': [0, 1],\n '=': [0],\n '<=': [-1, 0],\n '<': [-1],\n};\nconst allowedOperators = Object.keys(operatorResMap);\nconst assertValidOperator = (op) => {\n if (typeof op !== 'string') {\n throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new Error(`Invalid operator, expected one of ${allowedOperators.join('|')}`);\n }\n};\n//# sourceMappingURL=index.js.map","// Define the custom behavior of the page\nimport { documentReady } from \"./mixin\";\nimport { compare, validate } from \"compare-versions\";\n\nimport \"../styles/pydata-sphinx-theme.scss\";\n\n/*******************************************************************************\n * Theme interaction\n */\n\nvar prefersDark = window.matchMedia(\"(prefers-color-scheme: dark)\");\n\n/**\n * set the the body theme to the one specified by the user browser\n *\n * @param {event} e\n */\nfunction autoTheme(e) {\n document.documentElement.dataset.theme = prefersDark.matches\n ? \"dark\"\n : \"light\";\n}\n\n/**\n * Set the theme using the specified mode.\n * It can be one of [\"auto\", \"dark\", \"light\"]\n *\n * @param {str} mode\n */\nfunction setTheme(mode) {\n if (mode !== \"light\" && mode !== \"dark\" && mode !== \"auto\") {\n console.error(`Got invalid theme mode: ${mode}. Resetting to auto.`);\n mode = \"auto\";\n }\n\n // get the theme\n var colorScheme = prefersDark.matches ? \"dark\" : \"light\";\n document.documentElement.dataset.mode = mode;\n var theme = mode == \"auto\" ? colorScheme : mode;\n document.documentElement.dataset.theme = theme;\n // TODO: remove this line after Bootstrap upgrade\n // v5.3 has a colors mode: https://getbootstrap.com/docs/5.3/customize/color-modes/\n document.querySelectorAll(\".dropdown-menu\").forEach((el) => {\n if (theme === \"dark\") {\n el.classList.add(\"dropdown-menu-dark\");\n } else {\n el.classList.remove(\"dropdown-menu-dark\");\n }\n });\n\n // save mode and theme\n localStorage.setItem(\"mode\", mode);\n localStorage.setItem(\"theme\", theme);\n console.log(`[PST]: Changed to ${mode} mode using the ${theme} theme.`);\n\n // add a listener if set on auto\n prefersDark.onchange = mode == \"auto\" ? autoTheme : \"\";\n}\n\n/**\n * Change the theme option order so that clicking on the btn is always a change\n * from \"auto\"\n */\nfunction cycleMode() {\n const defaultMode = document.documentElement.dataset.defaultMode || \"auto\";\n const currentMode = localStorage.getItem(\"mode\") || defaultMode;\n\n var loopArray = (arr, current) => {\n var nextPosition = arr.indexOf(current) + 1;\n if (nextPosition === arr.length) {\n nextPosition = 0;\n }\n return arr[nextPosition];\n };\n\n // make sure the next theme after auto is always a change\n var modeList = prefersDark.matches\n ? [\"auto\", \"light\", \"dark\"]\n : [\"auto\", \"dark\", \"light\"];\n var newMode = loopArray(modeList, currentMode);\n setTheme(newMode);\n}\n\n/**\n * add the theme listener on the btns of the navbar\n */\nfunction addModeListener() {\n // the theme was set a first time using the initial mini-script\n // running setMode will ensure the use of the dark mode if auto is selected\n setTheme(document.documentElement.dataset.mode);\n\n // Attach event handlers for toggling themes colors\n document.querySelectorAll(\".theme-switch-button\").forEach((el) => {\n el.addEventListener(\"click\", cycleMode);\n });\n}\n\n/*******************************************************************************\n * TOC interactivity\n */\n\n/**\n * TOC sidebar - add \"active\" class to parent list\n *\n * Bootstrap's scrollspy adds the active class to the link,\n * but for the automatic collapsing we need this on the parent list item.\n *\n * The event is triggered on \"window\" (and not the nav item as documented),\n * see https://github.com/twbs/bootstrap/issues/20086\n */\nfunction addTOCInteractivity() {\n window.addEventListener(\"activate.bs.scrollspy\", function () {\n const navLinks = document.querySelectorAll(\".bd-toc-nav a\");\n\n navLinks.forEach((navLink) => {\n navLink.parentElement.classList.remove(\"active\");\n });\n\n const activeNavLinks = document.querySelectorAll(\".bd-toc-nav a.active\");\n activeNavLinks.forEach((navLink) => {\n navLink.parentElement.classList.add(\"active\");\n });\n });\n}\n\n/*******************************************************************************\n * Scroll\n */\n\n/**\n * Navigation sidebar scrolling to active page\n */\nfunction scrollToActive() {\n // If the docs nav doesn't exist, do nothing (e.g., on search page)\n if (!document.querySelector(\".bd-docs-nav\")) {\n return;\n }\n\n var sidebar = document.querySelector(\"div.bd-sidebar\");\n\n // Remember the sidebar scroll position between page loads\n // Inspired on source of revealjs.com\n let storedScrollTop = parseInt(\n sessionStorage.getItem(\"sidebar-scroll-top\"),\n 10,\n );\n\n if (!isNaN(storedScrollTop)) {\n // If we've got a saved scroll position, just use that\n sidebar.scrollTop = storedScrollTop;\n console.log(\"[PST]: Scrolled sidebar using stored browser position...\");\n } else {\n // Otherwise, calculate a position to scroll to based on the lowest `active` link\n var sidebarNav = document.querySelector(\".bd-docs-nav\");\n var active_pages = sidebarNav.querySelectorAll(\".active\");\n if (active_pages.length > 0) {\n // Use the last active page as the offset since it's the page we're on\n var latest_active = active_pages[active_pages.length - 1];\n var offset =\n latest_active.getBoundingClientRect().y -\n sidebar.getBoundingClientRect().y;\n // Only scroll the navbar if the active link is lower than 50% of the page\n if (latest_active.getBoundingClientRect().y > window.innerHeight * 0.5) {\n let buffer = 0.25; // Buffer so we have some space above the scrolled item\n sidebar.scrollTop = offset - sidebar.clientHeight * buffer;\n console.log(\"[PST]: Scrolled sidebar using last active link...\");\n }\n }\n }\n\n // Store the sidebar scroll position\n window.addEventListener(\"beforeunload\", () => {\n sessionStorage.setItem(\"sidebar-scroll-top\", sidebar.scrollTop);\n });\n}\n\n/*******************************************************************************\n * Search\n */\n\n/**\n * Find any search forms on the page and return their input element\n */\nvar findSearchInput = () => {\n let forms = document.querySelectorAll(\"form.bd-search\");\n if (!forms.length) {\n // no search form found\n return;\n } else {\n var form;\n if (forms.length == 1) {\n // there is exactly one search form (persistent or hidden)\n form = forms[0];\n } else {\n // must be at least one persistent form, use the first persistent one\n form = document.querySelector(\n \"div:not(.search-button__search-container) > form.bd-search\",\n );\n }\n return form.querySelector(\"input\");\n }\n};\n\n/**\n * Activate the search field on the page.\n * - If there is a search field already visible it will be activated.\n * - If not, then a search field will pop up.\n */\nvar toggleSearchField = () => {\n // Find the search input to highlight\n let input = findSearchInput();\n\n // if the input field is the hidden one (the one associated with the\n // search button) then toggle the button state (to show/hide the field)\n let searchPopupWrapper = document.querySelector(\".search-button__wrapper\");\n let hiddenInput = searchPopupWrapper.querySelector(\"input\");\n if (input === hiddenInput) {\n searchPopupWrapper.classList.toggle(\"show\");\n }\n // when toggling off the search field, remove its focus\n if (document.activeElement === input) {\n input.blur();\n } else {\n input.focus();\n input.select();\n input.scrollIntoView({ block: \"center\" });\n }\n};\n\n/**\n * Add an event listener for toggleSearchField() for Ctrl/Cmd + K\n */\nvar addEventListenerForSearchKeyboard = () => {\n window.addEventListener(\n \"keydown\",\n (event) => {\n let input = findSearchInput();\n // toggle on Ctrl+k or ⌘+k\n if (\n // Ignore if shift or alt are pressed\n !event.shiftKey &&\n !event.altKey &&\n // On Mac use ⌘, all other OS use Ctrl\n (useCommandKey\n ? event.metaKey && !event.ctrlKey\n : !event.metaKey && event.ctrlKey) &&\n // Case-insensitive so the shortcut still works with caps lock\n /^k$/i.test(event.key)\n ) {\n event.preventDefault();\n toggleSearchField();\n }\n // also allow Escape key to hide (but not show) the dynamic search field\n else if (document.activeElement === input && /Escape/i.test(event.key)) {\n toggleSearchField();\n }\n },\n true,\n );\n};\n\n/**\n * If the user is on a Mac, use command (⌘) instead of control (ctrl) key\n *\n * Note: `navigator.platform` is deprecated; however MDN still recommends using\n * it for the one specific use case of detecting whether a keyboard shortcut\n * should use control or command:\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform#examples\n */\nvar useCommandKey =\n navigator.platform.indexOf(\"Mac\") === 0 || navigator.platform === \"iPhone\";\n\n/**\n * Change the search hint to `meta key` if we are a Mac\n */\n\nvar changeSearchShortcutKey = () => {\n let shortcuts = document.querySelectorAll(\".search-button__kbd-shortcut\");\n if (useCommandKey) {\n shortcuts.forEach(\n (f) => (f.querySelector(\"kbd.kbd-shortcut__modifier\").innerText = \"⌘\"),\n );\n }\n};\n\n/**\n * Activate callbacks for search button popup\n */\nvar setupSearchButtons = () => {\n changeSearchShortcutKey();\n addEventListenerForSearchKeyboard();\n\n // Add the search button trigger event callback\n document.querySelectorAll(\".search-button__button\").forEach((btn) => {\n btn.onclick = toggleSearchField;\n });\n\n // Add the search button overlay event callback\n let overlay = document.querySelector(\".search-button__overlay\");\n if (overlay) {\n overlay.onclick = toggleSearchField;\n }\n};\n\n/*******************************************************************************\n * Version Switcher\n * Note that this depends on two variables existing that are defined in\n * and `html-page-context` hook:\n *\n * - DOCUMENTATION_OPTIONS.pagename\n * - DOCUMENTATION_OPTIONS.theme_switcher_url\n */\n\n/**\n * path component of URL\n */\nvar getCurrentUrlPath = () => {\n if (DOCUMENTATION_OPTIONS.BUILDER == \"dirhtml\") {\n return DOCUMENTATION_OPTIONS.pagename == \"index\"\n ? `/`\n : `${DOCUMENTATION_OPTIONS.pagename}/`;\n }\n return `${DOCUMENTATION_OPTIONS.pagename}.html`;\n};\n\n/**\n * Allow user to dismiss the warning banner about the docs version being dev / old.\n * We store the dismissal date and version, to give us flexibility about making the\n * dismissal last for longer than one browser session, if we decide to do that.\n *\n * @param {event} event the event that trigger the check\n */\nasync function DismissBannerAndStorePref(event) {\n const banner = document.querySelector(\"#bd-header-version-warning\");\n banner.remove();\n const version = DOCUMENTATION_OPTIONS.VERSION;\n const now = new Date();\n const banner_pref = JSON.parse(\n localStorage.getItem(\"pst_banner_pref\") || \"{}\",\n );\n console.debug(\n `[PST] Dismissing the version warning banner on ${version} starting ${now}.`,\n );\n banner_pref[version] = now;\n localStorage.setItem(\"pst_banner_pref\", JSON.stringify(banner_pref));\n}\n\n/**\n * Check if corresponding page path exists in other version of docs\n * and, if so, go there instead of the homepage of the other docs version\n *\n * @param {event} event the event that trigger the check\n */\nasync function checkPageExistsAndRedirect(event) {\n // ensure we don't follow the initial link\n event.preventDefault();\n const currentFilePath = getCurrentUrlPath();\n let tryUrl = event.currentTarget.getAttribute(\"href\");\n let otherDocsHomepage = tryUrl.replace(currentFilePath, \"\");\n try {\n let head = await fetch(tryUrl, { method: \"HEAD\" });\n if (head.ok) {\n location.href = tryUrl; // the page exists, go there\n } else {\n location.href = otherDocsHomepage;\n }\n } catch (err) {\n // something went wrong, probably CORS restriction, fallback to other docs homepage\n location.href = otherDocsHomepage;\n }\n}\n\n/**\n * Load and parse the version switcher JSON file from an absolute or relative URL.\n *\n * @param {string} url The URL to load version switcher entries from.\n */\nasync function fetchVersionSwitcherJSON(url) {\n // first check if it's a valid URL\n try {\n var result = new URL(url);\n } catch (err) {\n if (err instanceof TypeError) {\n if (!window.location.origin) {\n // window.location.origin is null for local static sites\n // (ie. window.location.protocol == 'file:')\n //\n // TODO: Fix this to return the static version switcher by working out\n // how to get the correct path to the switcher JSON file on local static builds\n return null;\n }\n // assume we got a relative path, and fix accordingly. But first, we need to\n // use `fetch()` to follow redirects so we get the correct final base URL\n const origin = await fetch(window.location.origin, { method: \"HEAD\" });\n result = new URL(url, origin.url);\n } else {\n // something unexpected happened\n throw err;\n }\n }\n // load and return the JSON\n const response = await fetch(result);\n const data = await response.json();\n return data;\n}\n\n// Populate the version switcher from the JSON data\nfunction populateVersionSwitcher(data, versionSwitcherBtns) {\n const currentFilePath = getCurrentUrlPath();\n versionSwitcherBtns.forEach((btn) => {\n // Set empty strings by default so that these attributes exist and can be used in CSS selectors\n btn.dataset[\"activeVersionName\"] = \"\";\n btn.dataset[\"activeVersion\"] = \"\";\n });\n // in case there are multiple entries with the same version string, this helps us\n // decide which entry's `name` to put on the button itself. Without this, it would\n // always be the *last* version-matching entry; now it will be either the\n // version-matching entry that is also marked as `\"preferred\": true`, or if that\n // doesn't exist: the *first* version-matching entry.\n data = data.map((entry) => {\n // does this entry match the version that we're currently building/viewing?\n entry.match =\n entry.version == DOCUMENTATION_OPTIONS.theme_switcher_version_match;\n entry.preferred = entry.preferred || false;\n // if no custom name specified (e.g., \"latest\"), use version string\n if (!(\"name\" in entry)) {\n entry.name = entry.version;\n }\n return entry;\n });\n const hasMatchingPreferredEntry = data\n .map((entry) => entry.preferred && entry.match)\n .some(Boolean);\n var foundMatch = false;\n // create links to the corresponding page in the other docs versions\n data.forEach((entry) => {\n // create the node\n const anchor = document.createElement(\"a\");\n anchor.setAttribute(\n \"class\",\n \"dropdown-item list-group-item list-group-item-action py-1\",\n );\n anchor.setAttribute(\"href\", `${entry.url}${currentFilePath}`);\n anchor.setAttribute(\"role\", \"option\");\n const span = document.createElement(\"span\");\n span.textContent = `${entry.name}`;\n anchor.appendChild(span);\n // Add dataset values for the version and name in case people want\n // to apply CSS styling based on this information.\n anchor.dataset[\"versionName\"] = entry.name;\n anchor.dataset[\"version\"] = entry.version;\n // replace dropdown button text with the preferred display name of the\n // currently-viewed version, rather than using sphinx's {{ version }} variable.\n // also highlight the dropdown entry for the currently-viewed version's entry\n let matchesAndIsPreferred = hasMatchingPreferredEntry && entry.preferred;\n let matchesAndIsFirst =\n !hasMatchingPreferredEntry && !foundMatch && entry.match;\n if (matchesAndIsPreferred || matchesAndIsFirst) {\n anchor.classList.add(\"active\");\n versionSwitcherBtns.forEach((btn) => {\n btn.innerText = entry.name;\n btn.dataset[\"activeVersionName\"] = entry.name;\n btn.dataset[\"activeVersion\"] = entry.version;\n });\n foundMatch = true;\n }\n // There may be multiple version-switcher elements, e.g. one\n // in a slide-over panel displayed on smaller screens.\n document.querySelectorAll(\".version-switcher__menu\").forEach((menu) => {\n // we need to clone the node for each menu, but onclick attributes are not\n // preserved by `.cloneNode()` so we add onclick here after cloning.\n let node = anchor.cloneNode(true);\n node.onclick = checkPageExistsAndRedirect;\n // on click, AJAX calls will check if the linked page exists before\n // trying to redirect, and if not, will redirect to the homepage\n // for that version of the docs.\n menu.append(node);\n });\n });\n}\n\n/*******************************************************************************\n * Warning banner when viewing non-stable version of the docs.\n */\n\n/**\n * Show a warning banner when viewing a non-stable version of the docs.\n *\n * adapted 2023-06 from https://mne.tools/versionwarning.js, which was\n * originally adapted 2020-05 from https://scikit-learn.org/versionwarning.js\n *\n * @param {Array} data The version data used to populate the switcher menu.\n */\nfunction showVersionWarningBanner(data) {\n var version = DOCUMENTATION_OPTIONS.VERSION;\n // figure out what latest stable version is\n var preferredEntries = data.filter((entry) => entry.preferred);\n if (preferredEntries.length !== 1) {\n const howMany = preferredEntries.length == 0 ? \"No\" : \"Multiple\";\n console.log(\n `[PST] ${howMany} versions marked \"preferred\" found in versions JSON, ignoring.`,\n );\n return;\n }\n const preferredVersion = preferredEntries[0].version;\n const preferredURL = preferredEntries[0].url;\n // if already on preferred version, nothing to do\n const versionsAreComparable = validate(version) && validate(preferredVersion);\n if (versionsAreComparable && compare(version, preferredVersion, \"=\")) {\n console.log(\n \"This is the prefered version of the docs, not showing the warning banner.\",\n );\n return;\n }\n // check if banner has been dismissed recently\n const dismiss_date_str = JSON.parse(\n localStorage.getItem(\"pst_banner_pref\") || \"{}\",\n )[version];\n if (dismiss_date_str != null) {\n const dismiss_date = new Date(dismiss_date_str);\n const now = new Date();\n const milliseconds_in_a_day = 24 * 60 * 60 * 1000;\n const days_passed = (now - dismiss_date) / milliseconds_in_a_day;\n const timeout_in_days = 14;\n if (days_passed < timeout_in_days) {\n console.info(\n `[PST] Suppressing version warning banner; was dismissed ${Math.floor(days_passed)} day(s) ago`,\n );\n return;\n }\n }\n\n // now construct the warning banner\n const banner = document.querySelector(\"#bd-header-version-warning\");\n const middle = document.createElement(\"div\");\n const inner = document.createElement(\"div\");\n const bold = document.createElement(\"strong\");\n const button = document.createElement(\"a\");\n const close_btn = document.createElement(\"a\");\n // these classes exist since pydata-sphinx-theme v0.10.0\n // the init class is used for animation\n middle.classList = \"bd-header-announcement__content ms-auto me-auto\";\n inner.classList = \"sidebar-message\";\n button.classList =\n \"btn text-wrap font-weight-bold ms-3 my-1 align-baseline pst-button-link-to-stable-version\";\n button.href = `${preferredURL}${getCurrentUrlPath()}`;\n button.innerText = \"Switch to stable version\";\n button.onclick = checkPageExistsAndRedirect;\n close_btn.classList = \"ms-3 my-1 align-baseline\";\n const close_x = document.createElement(\"i\");\n close_btn.append(close_x);\n close_x.classList = \"fa-solid fa-xmark\";\n close_btn.onclick = DismissBannerAndStorePref;\n // add the version-dependent text\n inner.innerText = \"This is documentation for \";\n const isDev =\n version.includes(\"dev\") ||\n version.includes(\"rc\") ||\n version.includes(\"pre\");\n const newerThanPreferred =\n versionsAreComparable && compare(version, preferredVersion, \">\");\n if (isDev || newerThanPreferred) {\n bold.innerText = \"an unstable development version\";\n } else if (versionsAreComparable && compare(version, preferredVersion, \"<\")) {\n bold.innerText = `an old version (${version})`;\n } else if (!version) {\n bold.innerText = \"an unknown version\"; // e.g., an empty string\n } else {\n bold.innerText = `version ${version}`;\n }\n banner.appendChild(middle);\n banner.append(close_btn);\n middle.appendChild(inner);\n inner.appendChild(bold);\n inner.appendChild(document.createTextNode(\".\"));\n inner.appendChild(button);\n banner.classList.remove(\"d-none\");\n}\n\n/*******************************************************************************\n * MutationObserver to move the ReadTheDocs button\n */\n\n/**\n * intercept the RTD flyout and place it in the rtd-footer-container if existing\n * if not it stays where on top of the page\n */\nfunction initRTDObserver() {\n const mutatedCallback = (mutationList, observer) => {\n mutationList.forEach((mutation) => {\n // Check whether the mutation is for RTD, which will have a specific structure\n if (mutation.addedNodes.length === 0) {\n return;\n }\n if (mutation.addedNodes[0].data === undefined) {\n return;\n }\n if (mutation.addedNodes[0].data.search(\"Inserted RTD Footer\") != -1) {\n mutation.addedNodes.forEach((node) => {\n document.getElementById(\"rtd-footer-container\").append(node);\n });\n }\n });\n };\n\n const observer = new MutationObserver(mutatedCallback);\n const config = { childList: true };\n observer.observe(document.body, config);\n}\n\nasync function fetchAndUseVersions() {\n // fetch the JSON version data (only once), then use it to populate the version\n // switcher and maybe show the version warning bar\n var versionSwitcherBtns = document.querySelectorAll(\n \".version-switcher__button\",\n );\n const hasSwitcherMenu = versionSwitcherBtns.length > 0;\n const hasVersionsJSON = DOCUMENTATION_OPTIONS.hasOwnProperty(\n \"theme_switcher_json_url\",\n );\n const wantsWarningBanner = DOCUMENTATION_OPTIONS.show_version_warning_banner;\n\n if (hasVersionsJSON && (hasSwitcherMenu || wantsWarningBanner)) {\n const data = await fetchVersionSwitcherJSON(\n DOCUMENTATION_OPTIONS.theme_switcher_json_url,\n );\n // TODO: remove the `if(data)` once the `return null` is fixed within fetchVersionSwitcherJSON.\n // We don't really want the switcher and warning bar to silently not work.\n if (data) {\n populateVersionSwitcher(data, versionSwitcherBtns);\n if (wantsWarningBanner) {\n showVersionWarningBanner(data);\n }\n }\n }\n}\n\n/*******************************************************************************\n * Add keyboard functionality to mobile sidebars.\n *\n * Wire up the hamburger-style buttons using the click event which (on buttons)\n * handles both mouse clicks and the space and enter keys.\n */\nfunction setupMobileSidebarKeyboardHandlers() {\n // These are hidden checkboxes at the top of the page whose :checked property\n // allows the mobile sidebars to be hidden or revealed via CSS.\n const primaryToggle = document.getElementById(\"pst-primary-sidebar-checkbox\");\n const secondaryToggle = document.getElementById(\n \"pst-secondary-sidebar-checkbox\",\n );\n const primarySidebar = document.querySelector(\".bd-sidebar-primary\");\n const secondarySidebar = document.querySelector(\".bd-sidebar-secondary\");\n\n // Toggle buttons -\n //\n // These are the hamburger-style buttons in the header nav bar. When the user\n // clicks, the button transmits the click to the hidden checkboxes used by the\n // CSS to control whether the sidebar is open or closed.\n const primaryClickTransmitter = document.querySelector(\".primary-toggle\");\n const secondaryClickTransmitter = document.querySelector(\".secondary-toggle\");\n [\n [primaryClickTransmitter, primaryToggle, primarySidebar],\n [secondaryClickTransmitter, secondaryToggle, secondarySidebar],\n ].forEach(([clickTransmitter, toggle, sidebar]) => {\n if (!clickTransmitter) {\n return;\n }\n clickTransmitter.addEventListener(\"click\", (event) => {\n event.preventDefault();\n event.stopPropagation();\n toggle.checked = !toggle.checked;\n\n // If we are opening the sidebar, move focus to the first focusable item\n // in the sidebar\n if (toggle.checked) {\n // Note: this selector is not exhaustive, and we may need to update it\n // in the future\n const tabStop = sidebar.querySelector(\"a, button\");\n // use setTimeout because you cannot move focus synchronously during a\n // click in the handler for the click event\n setTimeout(() => tabStop.focus(), 100);\n }\n });\n });\n\n // Escape key -\n //\n // When sidebar is open, user should be able to press escape key to close the\n // sidebar.\n [\n [primarySidebar, primaryToggle, primaryClickTransmitter],\n [secondarySidebar, secondaryToggle, secondaryClickTransmitter],\n ].forEach(([sidebar, toggle, transmitter]) => {\n if (!sidebar) {\n return;\n }\n sidebar.addEventListener(\"keydown\", (event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n toggle.checked = false;\n transmitter.focus();\n }\n });\n });\n\n // When the