{"version":3,"file":"header.bundle.mjs","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/govuk-frontend-component.mjs","../../../../src/govuk/components/header/header.mjs"],"sourcesContent":["import { normaliseString } from './normalise-string.mjs'\n\n/**\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 * Config merging function\n *\n * Takes any number of objects and combines them together, with\n * greatest priority on the LAST item passed in.\n *\n * @internal\n * @param {...{ [key: string]: unknown }} configObjects - Config objects to merge\n * @returns {{ [key: string]: unknown }} A merged config object\n */\nexport function mergeConfigs(...configObjects) {\n  // Start with an empty object as our base\n  /** @type {{ [key: string]: unknown }} */\n  const formattedConfigObject = {}\n\n  // Loop through each of the passed objects\n  for (const configObject of configObjects) {\n    for (const key of Object.keys(configObject)) {\n      const option = formattedConfigObject[key]\n      const override = configObject[key]\n\n      // Push their keys one-by-one into formattedConfigObject. Any duplicate\n      // keys with object values will be merged, otherwise the new value will\n      // override the existing value.\n      if (isObject(option) && isObject(override)) {\n        // @ts-expect-error Index signature for type 'string' is missing\n        formattedConfigObject[key] = mergeConfigs(option, override)\n      } else {\n        // Apply override\n        formattedConfigObject[key] = override\n      }\n    }\n  }\n\n  return formattedConfigObject\n}\n\n/**\n * Extracts keys starting with a particular namespace from dataset ('data-*')\n * object, removing the namespace in the process, normalising all values\n *\n * @internal\n * @param {{ schema: Schema }} Component - Component class\n * @param {DOMStringMap} dataset - The object to extract key-value pairs from\n * @param {string} namespace - The namespace to filter keys with\n * @returns {ObjectNested | undefined} Nested object with dot-separated key namespace removed\n */\nexport function extractConfigByNamespace(Component, dataset, namespace) {\n  const property = Component.schema.properties[namespace]\n\n  // Only extract configs for object schema properties\n  if (property?.type !== 'object') {\n    return\n  }\n\n  // Add default empty config\n  const newObject = {\n    [namespace]: /** @type {ObjectNested} */ ({})\n  }\n\n  for (const [key, value] of Object.entries(dataset)) {\n    /** @type {ObjectNested | ObjectNested[NestedKey]} */\n    let current = newObject\n\n    // Split the key into parts, using . as our namespace separator\n    const keyParts = key.split('.')\n\n    /**\n     * Create new level per part\n     *\n     * e.g. 'i18n.textareaDescription.other' becomes\n     * `{ i18n: { textareaDescription: { other } } }`\n     */\n    for (const [index, name] of keyParts.entries()) {\n      if (typeof current === 'object') {\n        // Drop down to nested object until the last part\n        if (index < keyParts.length - 1) {\n          // New nested object (optionally) replaces existing value\n          if (!isObject(current[name])) {\n            current[name] = {}\n          }\n\n          // Drop down into new or existing nested object\n          current = current[name]\n        } else if (key !== namespace) {\n          // Normalised value (optionally) replaces existing value\n          current[name] = normaliseString(value)\n        }\n      }\n    }\n  }\n\n  return newObject[namespace]\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 `<html>` 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 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 * @internal\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` 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 * Validate component config by schema\n *\n * Follows limited examples in JSON schema for wider support in future\n *\n * {@link https://ajv.js.org/json-schema.html#compound-keywords}\n * {@link https://ajv.js.org/packages/ajv-errors.html#single-message}\n *\n * @internal\n * @param {Schema} schema - Config schema\n * @param {{ [key: string]: unknown }} config - Component config\n * @returns {string[]} List of validation errors\n */\nexport function validateConfig(schema, config) {\n  const validationErrors = []\n\n  // Check errors for each schema\n  for (const [name, conditions] of Object.entries(schema)) {\n    const errors = []\n\n    // Check errors for each schema condition\n    if (Array.isArray(conditions)) {\n      for (const { required, errorMessage } of conditions) {\n        if (!required.every((key) => !!config[key])) {\n          errors.push(errorMessage) // Missing config key value\n        }\n      }\n\n      // Check one condition passes or add errors\n      if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n        validationErrors.push(...errors)\n      }\n    }\n  }\n\n  return validationErrors\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 * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an object\n */\nfunction isObject(option) {\n  return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Schema for component config\n *\n * @typedef {object} Schema\n * @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties\n * @property {SchemaCondition[]} [anyOf] - List of schema conditions\n */\n\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n\n/**\n * Schema condition for component config\n *\n * @typedef {object} SchemaCondition\n * @property {string[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n\n/**\n * @internal\n * @typedef {keyof ObjectNested} NestedKey\n * @typedef {{ [key: string]: string | boolean | number | ObjectNested | undefined }} ObjectNested\n */\n","/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n *   // Setting an explicit name is important as extending the class will not\n *   // set a new `name` on the subclass. The `name` property is important\n *   // to ensure intelligible error names even if the class name gets\n *   // mangled by a minifier\n *   name = \"MissingRootError\"\n * }\n * ```\n * @abstract\n */\nexport class GOVUKFrontendError extends Error {\n  name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n  name = 'SupportError'\n\n  /**\n   * Checks if GOV.UK Frontend is supported on this page\n   *\n   * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n   */\n  constructor($scope = document.body) {\n    const supportMessage =\n      'noModule' in HTMLScriptElement.prototype\n        ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n        : 'GOV.UK Frontend is not supported in this browser'\n\n    super(\n      $scope\n        ? supportMessage\n        : 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n    )\n  }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n  name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n  name = 'ElementError'\n\n  /**\n   * @internal\n   * @overload\n   * @param {string} message - Element error message\n   */\n\n  /**\n   * @internal\n   * @overload\n   * @param {ElementErrorOptions} options - Element error options\n   */\n\n  /**\n   * @internal\n   * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n   */\n  constructor(messageOrOptions) {\n    let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n    // Build message from options\n    if (typeof messageOrOptions === 'object') {\n      const { componentName, identifier, element, expectedType } =\n        messageOrOptions\n\n      // Add prefix and identifier\n      message = `${componentName}: ${identifier}`\n\n      // Append reason\n      message += element\n        ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n        : ' not found'\n    }\n\n    super(message)\n  }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {string} componentName - The name of the component throwing the error\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {Element | null} [element] - The element in error\n * @property {string} [expectedType] - The type that was expected for the identifier\n */\n","import { isSupported } from './common/index.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @internal\n * @abstract\n */\nexport class GOVUKFrontendComponent {\n  /**\n   * Constructs a new component, validating that GOV.UK Frontend is supported\n   *\n   * @internal\n   */\n  constructor() {\n    this.checkSupport()\n  }\n\n  /**\n   * Validates whether GOV.UK Frontend is supported\n   *\n   * @private\n   * @throws {SupportError} when GOV.UK Frontend is not supported\n   */\n  checkSupport() {\n    if (!isSupported()) {\n      throw new SupportError()\n    }\n  }\n}\n","import { getBreakpoint } from '../../common/index.mjs'\nimport { ElementError } from '../../errors/index.mjs'\nimport { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'\n\n/**\n * Header component\n *\n * @preserve\n */\nexport class Header extends GOVUKFrontendComponent {\n  /** @private */\n  $module\n\n  /** @private */\n  /** @type {HTMLElement | undefined} */\n  $menuButton\n\n  /** @private */\n  /** @type {HTMLElement | undefined} */\n  $menu\n\n  /** @private */\n  /** @type {HTMLElement | undefined} */\n  $dropdownToggle\n\n  /** @private */\n  /** @type {HTMLElement | undefined} */\n  $header\n\n  /** @private */\n  /** @type {HTMLDialogElement | undefined} */\n  $profileDialog\n\n  /**\n   * Save the opened/closed state for the nav in memory so that we can\n   * accurately maintain state when the screen is changed from small to big and\n   * back to small\n   *\n   * @private\n   */\n  menuIsOpen = false\n\n  /**\n   * A global const for storing a matchMedia instance which we'll use to detect\n   * when a screen size change happens. We rely on it being null if the feature\n   * isn't available to initially apply hidden attributes\n   *\n   * @private\n   * @type {MediaQueryList | null}\n   */\n  mql = null\n\n  /**\n   * Apply a matchMedia for desktop which will trigger a state sync if the\n   * browser viewport moves between states.\n   *\n   * @param {Element | null} $module - HTML element to use for header\n   */\n  constructor($module) {\n    super()\n\n    if (!$module) {\n      throw new ElementError({\n        componentName: 'Header',\n        element: $module,\n        identifier: 'Root element (`$module`)'\n      })\n    }\n\n    const dropdownItems = $module.querySelectorAll('.idsk-dropdown__wrapper')\n    dropdownItems.forEach((dropdownItem) => new Dropdown(dropdownItem))\n\n    /*\n    const langDropdown = $module.querySelector('.idsk-dropdown__wrapper')\n    if (langDropdown) {\n      new Dropdown(langDropdown) // eslint-disable-line no-new\n    }\n\n    const myDropdown = $module.querySelector('.jano')\n    if (myDropdown) {\n      new Dropdown(myDropdown) // eslint-disable-line no-new\n    }\n\n    const myDropdown2 = $module.querySelector('.jano2')\n    if (myDropdown2) {\n      new Dropdown(myDropdown2) // eslint-disable-line no-new\n    }\n      */\n\n    this.$module = $module\n    const $menuButton = $module.querySelector('.govuk-js-header-toggle')\n\n    const header = document.querySelector('.govuk-header')\n    if (header instanceof HTMLElement) {\n      this.$header = header\n    }\n\n    // Headers don't necessarily have a navigation. When they don't, the menu\n    // toggle won't be rendered by our macro (or may be omitted when writing\n    // plain HTML)\n    if (!$menuButton) {\n      return this\n    }\n\n    const menuId = $menuButton.getAttribute('aria-controls')\n    if (!menuId) {\n      throw new ElementError({\n        componentName: 'Header',\n        identifier:\n          'Navigation button (`<button class=\"govuk-js-header-toggle\">`) attribute (`aria-controls`)'\n      })\n    }\n\n    const websitesNavBody = $module.querySelector(\n      '.idsk-secondary-navigation__body'\n    )\n    const websitesNavBtn = $module.querySelector(\n      '.idsk-secondary-navigation__heading-button'\n    )\n\n    if (\n      websitesNavBody instanceof HTMLElement &&\n      websitesNavBtn instanceof HTMLElement\n    ) {\n      websitesNavBtn.addEventListener('click', (event) => {\n        event.preventDefault()\n        const menuIsOpen = !(websitesNavBtn.ariaExpanded === 'true')\n        const iconClassList =\n          websitesNavBtn.querySelector('.material-icons')?.classList\n        if (menuIsOpen) {\n          websitesNavBody.classList.remove('hidden')\n          iconClassList?.add('rotate180')\n          websitesNavBtn.ariaExpanded = 'true'\n        } else {\n          websitesNavBody.classList.add('hidden')\n          iconClassList?.remove('rotate180')\n          websitesNavBtn.ariaExpanded = 'false'\n        }\n      })\n    }\n\n    const menu = document.querySelector(`#${menuId}`)\n    if (menu instanceof HTMLElement) {\n      this.$menu = menu\n    }\n    if ($menuButton instanceof HTMLElement) {\n      this.$menuButton = $menuButton\n      this.$menuButton.addEventListener('click', () => {\n        this.handleMenuButtonClick()\n      })\n    }\n\n    this.setupResponsiveChecks()\n\n    // Get dropdown menu and toggle. Then function for show or hide dropdown\n    // TODO: vyhodit a nahradit ComboBoxom\n    const dropdownToggle = $module.querySelector('.dropdown-toggle')\n    if (dropdownToggle instanceof HTMLElement) {\n      this.$dropdownToggle = dropdownToggle\n      this.openCloseDropdownMenu()\n    }\n\n    const profileDialog = document.getElementById('navigationProfileDialog')\n    if (profileDialog instanceof HTMLDialogElement) {\n      this.$profileDialog = profileDialog\n    }\n    const profileButton = $module.querySelector('.govuk-header__profile_button')\n    const profileCloseButton = $module.querySelector(\n      '.govuk-header__profile_close_button'\n    )\n    if (profileDialog instanceof HTMLDialogElement && this.$profileDialog) {\n      profileButton?.addEventListener('click', () => {\n        if (profileDialog.open) {\n          this.$profileDialog?.close()\n        } else {\n          this.$profileDialog?.showModal()\n        }\n      })\n      profileCloseButton?.addEventListener('click', () => profileDialog.close())\n      profileDialog.addEventListener('click', (event) => {\n        if (event.target === this.$profileDialog) {\n          this.$profileDialog.close()\n        }\n      })\n    }\n\n    // document.getElementById(\"govuk-header__profile\")\n    /*\n    const headerProfileCard = $module.querySelector('.govuk-header__profile')\n    if (headerProfileCard instanceof HTMLElement) {\n      this.$headerProfileCard = headerProfileCard\n    }\n    const profileButton = $module.querySelector('.govuk-header__profile_button')\n    if (this.$headerProfileCard && profileButton) {\n      profileButton.addEventListener(\n        'click',\n        () => {\n          const el = document.getElementById(\"navigationProfileDialog\");\n          if (el instanceof HTMLDialogElement) {\n            if (el.open) {\n              el.close()\n            } else {\n              el.show()\n            }\n          }\n        },\n        true\n      )\n      // document.addEventListener('click', (event) => {\n      //   if (this.mql == null || !this.mql.matches) {\n      //     return\n      //   }\n      //   if (\n      //     this.$headerProfileCard &&\n      //     event.target instanceof Node &&\n      //     !this.$headerProfileCard.contains(event.target) &&\n      //     !profileButton.contains(event.target)\n      //   ) {\n      //     this.$headerProfileCard.classList.add('hidden')\n      //   }\n      // })\n    }\n      */\n  }\n\n  /**\n   * Setup viewport resize check\n   *\n   * @private\n   */\n  setupResponsiveChecks() {\n    const breakpoint = getBreakpoint('desktop')\n\n    if (!breakpoint.value) {\n      throw new ElementError({\n        componentName: 'Header',\n        identifier: `CSS custom property (\\`${breakpoint.property}\\`) on pseudo-class \\`:root\\``\n      })\n    }\n\n    // Media query list for GOV.UK Frontend desktop breakpoint\n    this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`)\n\n    // MediaQueryList.addEventListener isn't supported by Safari < 14 so we need\n    // to be able to fall back to the deprecated MediaQueryList.addListener\n    if ('addEventListener' in this.mql) {\n      this.mql.addEventListener('change', () => this.checkMode())\n    } else {\n      // @ts-expect-error Property 'addListener' does not exist\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n      this.mql.addListener(() => this.checkMode())\n    }\n\n    this.checkMode()\n  }\n\n  /**\n   * Sync menu state\n   *\n   * Uses the global variable menuIsOpen to correctly set the accessible and\n   * visual states of the menu and the menu button.\n   * Additionally will force the menu to be visible and the menu button to be\n   * hidden if the matchMedia is triggered to desktop.\n   *\n   * @private\n   */\n  checkMode() {\n    if (this.mql == null || !this.$header) {\n      return\n    }\n\n    if (this.mql.matches) {\n      // desktop mode\n      this.$menu?.removeAttribute('hidden')\n      this.$menuButton?.setAttribute('hidden', '')\n      this.$header // hide logo\n        .querySelector('.govuk-header__link--homepage')\n        ?.removeAttribute('hidden')\n      this.$header\n        .querySelector('.idsk-searchbar__wrapper')\n        ?.classList.remove('hide')\n    } else {\n      // mobile\n      if (this.$profileDialog) {\n        this.$profileDialog.close()\n      }\n      this.$menuButton?.removeAttribute('hidden')\n      this.$menuButton?.setAttribute(\n        'aria-expanded',\n        this.menuIsOpen.toString()\n      )\n\n      this.$menu?.removeAttribute('hidden')\n      if (this.$menuButton) {\n        this.$menuButton.textContent = this.menuIsOpen ? 'Zavrieť' : 'Menu'\n        this.createMaterialIcon(\n          this.menuIsOpen ? 'close' : 'menu',\n          this.$menuButton\n        )\n      }\n\n      if (this.menuIsOpen) {\n        this.$menu?.removeAttribute('hidden')\n        // this.$header.style.background = '#fafafa'\n        this.$header // show actionPanel\n          .querySelector('.govuk-header__actionPanel.mobile')\n          ?.classList.remove('mobile-hidden')\n        this.$header // hide hide logo\n          .querySelector('.govuk-header__link--homepage')\n          ?.setAttribute('hidden', '')\n        console.log(this.$header.querySelector('.idsk-searchbar__wrapper'))\n        this.$header\n          .querySelector('.idsk-searchbar__wrapper')\n          ?.classList.remove('hide')\n      } else {\n        this.$menu?.setAttribute('hidden', '')\n        // this.$header.style.background = '#fff'\n        this.$header // hide action panel\n          .querySelector('.govuk-header__actionPanel.mobile')\n          ?.classList.add('mobile-hidden')\n        this.$header // show logo\n          .querySelector('.govuk-header__link--homepage')\n          ?.removeAttribute('hidden')\n        this.$header\n          .querySelector('.idsk-searchbar__wrapper')\n          ?.classList.add('hide')\n      }\n    }\n  }\n\n  /**\n   * Handle menu button click\n   *\n   * When the menu button is clicked, change the visibility of the menu and then\n   * sync the accessibility state and menu button state\n   *\n   * @private\n   */\n  handleMenuButtonClick() {\n    this.menuIsOpen = !this.menuIsOpen\n    this.checkMode()\n  }\n\n  /**\n   * Toggle dropdown menu\n   */\n  openCloseDropdownMenu() {\n    if (!this.$dropdownToggle) {\n      return\n    }\n\n    this.$dropdownToggle.addEventListener('click', (event) => {\n      if (this.$dropdownToggle) {\n        event.preventDefault()\n        this.$dropdownToggle.classList.toggle('open')\n      }\n    })\n\n    this.clickOutsideClose(this.$dropdownToggle, 'open')\n  }\n\n  /**\n   * Create and add material icon to parent element\n   *\n   * @param {string} iconName - icon name for create\n   * @param {HTMLElement} parentElem - element to which the icon will be added\n   */\n  createMaterialIcon(iconName, parentElem) {\n    const spanIcon = document.createElement('span')\n    spanIcon.className = 'material-icons'\n    spanIcon.textContent = iconName.toString()\n    spanIcon.ariaHidden = 'true'\n    parentElem.appendChild(spanIcon)\n  }\n\n  /**\n   * Function for click outside and close some elem\n   *\n   * @param {HTMLElement} openedElem - element which need to remove open className\n   * @param {string} className - name of className to remove and close some opened element\n   */\n  clickOutsideClose(openedElem, className) {\n    document.addEventListener('click', (event) => {\n      if (event.target instanceof Node && !openedElem.contains(event.target)) {\n        openedElem.classList.remove(className.toString())\n      }\n    })\n  }\n\n  /**\n   * Name for the component used when initialising using data-module attributes.\n   */\n  static moduleName = 'govuk-header'\n}\n\n/**\n * JavaScript enhancements for the Dropdown component\n *\n * @preserve\n */\nclass Dropdown {\n  /** @private */\n  $module\n\n  /** @private */\n  button\n\n  /** @private */\n  options\n\n  /** @private */\n  isOpen = false\n\n  /**\n   * @param {Element | null} $module - HTML element to use for dropdown\n   */\n  constructor($module) {\n    if (!($module instanceof HTMLElement)) {\n      throw new ElementError({\n        componentName: 'Dropdown',\n        element: $module,\n        identifier: 'Root element (`$module`)'\n      })\n    }\n\n    this.$module = $module\n    const buttonElement = this.$module.querySelector('.idsk-dropdown')\n    const optionsElement = this.$module.querySelector('.idsk-dropdown__options')\n    this.button = buttonElement\n    this.options = optionsElement\n\n    if (!buttonElement) {\n      throw new ElementError({\n        componentName: 'Dropdown button',\n        element: buttonElement,\n        identifier: 'Button dropdown trigger'\n      })\n    }\n\n    if (!optionsElement) {\n      throw new ElementError({\n        componentName: 'Dropdown options',\n        element: optionsElement,\n        identifier: 'Dropdown options block'\n      })\n    }\n\n    this.button?.addEventListener('click', (event) => this.handleClick(event))\n    document.addEventListener('click', (event) => {\n      if (\n        event.target instanceof Node &&\n        !this.$module.contains(event.target) &&\n        this.isOpen\n      ) {\n        this.handleClick(event)\n      }\n    })\n  }\n\n  /**\n   * Trigger a click event\n   *\n   * @param {Event} event - click event\n   * @private\n   */\n  handleClick(event) {\n    if (!this.button) {\n      return\n    }\n\n    event.preventDefault()\n\n    this.isOpen = !this.isOpen\n    const label = this.$module.dataset.pseudolabel ?? ''\n\n    if (this.isOpen) {\n      this.$module.classList.add('open')\n      this.button\n        .querySelector('svg')\n        ?.classList.add('idsk-dropdown__icon--opened')\n      this.button.ariaLabel = `Zavrieť ${label}`\n      this.options?.classList.add('idsk-dropdown--opened')\n      // this.$module.querySelector('.material-icons')?.classList.add('rotate180')\n    } else {\n      this.$module.classList.remove('open')\n      this.button\n        .querySelector('svg')\n        ?.classList.remove('idsk-dropdown__icon--opened')\n      this.button.ariaLabel = `Rozbaliť ${label}`\n      this.options?.classList.remove('idsk-dropdown--opened')\n    }\n\n    this.button.ariaExpanded = this.isOpen.toString()\n  }\n}\n"],"names":["getBreakpoint","name","property","value","window","getComputedStyle","document","documentElement","getPropertyValue","undefined","isSupported","$scope","body","classList","contains","GOVUKFrontendError","Error","constructor","args","SupportError","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","message","componentName","identifier","element","expectedType","GOVUKFrontendComponent","checkSupport","Header","$module","$menuButton","$menu","$dropdownToggle","$header","$profileDialog","menuIsOpen","mql","dropdownItems","querySelectorAll","forEach","dropdownItem","Dropdown","querySelector","header","HTMLElement","menuId","getAttribute","websitesNavBody","websitesNavBtn","addEventListener","event","_websitesNavBtn$query","preventDefault","ariaExpanded","iconClassList","remove","add","menu","handleMenuButtonClick","setupResponsiveChecks","dropdownToggle","openCloseDropdownMenu","profileDialog","getElementById","HTMLDialogElement","profileButton","profileCloseButton","open","_this$$profileDialog","close","_this$$profileDialog2","showModal","target","breakpoint","matchMedia","checkMode","addListener","matches","_this$$menu","_this$$menuButton","_this$$header$querySe","_this$$header$querySe2","removeAttribute","setAttribute","_this$$menuButton2","_this$$menuButton3","_this$$menu2","toString","textContent","createMaterialIcon","_this$$menu3","_this$$header$querySe3","_this$$header$querySe4","_this$$header$querySe5","console","log","_this$$menu4","_this$$header$querySe6","_this$$header$querySe7","_this$$header$querySe8","toggle","clickOutsideClose","iconName","parentElem","spanIcon","createElement","className","ariaHidden","appendChild","openedElem","Node","moduleName","_this$button","button","options","isOpen","buttonElement","optionsElement","handleClick","_this$$module$dataset","label","dataset","pseudolabel","_this$button$querySel","_this$options","ariaLabel","_this$button$querySel2","_this$options2"],"mappings":"AAkIO,SAASA,aAAaA,CAACC,IAAI,EAAE;AAClC,EAAA,MAAMC,QAAQ,GAAI,CAA8BD,4BAAAA,EAAAA,IAAK,CAAC,CAAA,CAAA;AAGtD,EAAA,MAAME,KAAK,GAAGC,MAAM,CACjBC,gBAAgB,CAACC,QAAQ,CAACC,eAAe,CAAC,CAC1CC,gBAAgB,CAACN,QAAQ,CAAC,CAAA;EAE7B,OAAO;IACLA,QAAQ;IACRC,KAA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