{ "version": 3, "sources": ["../../../node_modules/govuk-frontend/src/govuk/common/index.mjs", "../../../node_modules/govuk-frontend/src/govuk/errors/index.mjs", "../../../node_modules/govuk-frontend/src/govuk/component.mjs", "../../../node_modules/govuk-frontend/src/govuk/common/configuration.mjs", "../../../node_modules/govuk-frontend/src/govuk/i18n.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/accordion/accordion.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/button/button.mjs", "../../../node_modules/govuk-frontend/src/govuk/common/closest-attribute-value.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/character-count/character-count.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/checkboxes/checkboxes.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/error-summary/error-summary.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/exit-this-page/exit-this-page.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/file-upload/file-upload.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/header/header.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/notification-banner/notification-banner.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/password-input/password-input.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/radios/radios.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/service-navigation/service-navigation.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/skip-link/skip-link.mjs", "../../../node_modules/govuk-frontend/src/govuk/components/tabs/tabs.mjs", "../../../node_modules/govuk-frontend/src/govuk/init.mjs", "../../javascript/application.js"], "sourcesContent": ["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get hash fragment from URL\n *\n * Extract the hash fragment (everything after the hash) from a URL,\n * but not including the hash symbol\n *\n * @private\n * @param {string} url - URL\n * @returns {string | undefined} Fragment from URL, without the hash\n */\nexport function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined\n }\n\n return url.split('#').pop()\n}\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-frontend-breakpoint-${name}`\n\n // Get value from `` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `
` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial