/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "../../../node_modules/js-cookie/dist/js.cookie.mjs":
/*!**********************************************************!*\
  !*** ../../../node_modules/js-cookie/dist/js.cookie.mjs ***!
  \**********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ api)\n/* harmony export */ });\n/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n    for (var key in source) {\n      target[key] = source[key];\n    }\n  }\n  return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n  read: function (value) {\n    if (value[0] === '\"') {\n      value = value.slice(1, -1);\n    }\n    return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n  },\n  write: function (value) {\n    return encodeURIComponent(value).replace(\n      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n      decodeURIComponent\n    )\n  }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n  function set (name, value, attributes) {\n    if (typeof document === 'undefined') {\n      return\n    }\n\n    attributes = assign({}, defaultAttributes, attributes);\n\n    if (typeof attributes.expires === 'number') {\n      attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n    }\n    if (attributes.expires) {\n      attributes.expires = attributes.expires.toUTCString();\n    }\n\n    name = encodeURIComponent(name)\n      .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n      .replace(/[()]/g, escape);\n\n    var stringifiedAttributes = '';\n    for (var attributeName in attributes) {\n      if (!attributes[attributeName]) {\n        continue\n      }\n\n      stringifiedAttributes += '; ' + attributeName;\n\n      if (attributes[attributeName] === true) {\n        continue\n      }\n\n      // Considers RFC 6265 section 5.2:\n      // ...\n      // 3.  If the remaining unparsed-attributes contains a %x3B (\";\")\n      //     character:\n      // Consume the characters of the unparsed-attributes up to,\n      // not including, the first %x3B (\";\") character.\n      // ...\n      stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n    }\n\n    return (document.cookie =\n      name + '=' + converter.write(value, name) + stringifiedAttributes)\n  }\n\n  function get (name) {\n    if (typeof document === 'undefined' || (arguments.length && !name)) {\n      return\n    }\n\n    // To prevent the for loop in the first place assign an empty array\n    // in case there are no cookies at all.\n    var cookies = document.cookie ? document.cookie.split('; ') : [];\n    var jar = {};\n    for (var i = 0; i < cookies.length; i++) {\n      var parts = cookies[i].split('=');\n      var value = parts.slice(1).join('=');\n\n      try {\n        var found = decodeURIComponent(parts[0]);\n        jar[found] = converter.read(value, found);\n\n        if (name === found) {\n          break\n        }\n      } catch (e) {}\n    }\n\n    return name ? jar[name] : jar\n  }\n\n  return Object.create(\n    {\n      set,\n      get,\n      remove: function (name, attributes) {\n        set(\n          name,\n          '',\n          assign({}, attributes, {\n            expires: -1\n          })\n        );\n      },\n      withAttributes: function (attributes) {\n        return init(this.converter, assign({}, this.attributes, attributes))\n      },\n      withConverter: function (converter) {\n        return init(assign({}, this.converter, converter), this.attributes)\n      }\n    },\n    {\n      attributes: { value: Object.freeze(defaultAttributes) },\n      converter: { value: Object.freeze(converter) }\n    }\n  )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\n\n\n\n//# sourceURL=webpack://cutheme-twig/../../../node_modules/js-cookie/dist/js.cookie.mjs?\n}");

/***/ }),

/***/ "./src/cutheme-scripts.js":
/*!********************************!*\
  !*** ./src/cutheme-scripts.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scripts_nav_priorityPlus_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scripts/nav/priorityPlus.js */ \"./src/scripts/nav/priorityPlus.js\");\n/* harmony import */ var _scripts_nav_navToggles_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scripts/nav/navToggles.js */ \"./src/scripts/nav/navToggles.js\");\n/* harmony import */ var _scripts_nav_navToggles_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_scripts_nav_navToggles_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _scripts_nav_scrollingNav_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scripts/nav/scrollingNav.js */ \"./src/scripts/nav/scrollingNav.js\");\n/* harmony import */ var _scripts_nav_scrollingNav_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_scripts_nav_scrollingNav_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _scripts_nav_topNavSearch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scripts/nav/topNavSearch.js */ \"./src/scripts/nav/topNavSearch.js\");\n/* harmony import */ var _scripts_nav_topNavSearch_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_scripts_nav_topNavSearch_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _scripts_nav_titleLength_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scripts/nav/titleLength.js */ \"./src/scripts/nav/titleLength.js\");\n/* harmony import */ var _scripts_nav_titleLength_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_scripts_nav_titleLength_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _scripts_accordion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scripts/accordion */ \"./src/scripts/accordion.js\");\n/* harmony import */ var _scripts_accordion__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_scripts_accordion__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _scripts_alphaList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./scripts/alphaList */ \"./src/scripts/alphaList.js\");\n/* harmony import */ var _scripts_image_slider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./scripts/image-slider */ \"./src/scripts/image-slider.js\");\n/* harmony import */ var _scripts_image_slider__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_scripts_image_slider__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _scripts_filter_loadmore__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./scripts/filter-loadmore */ \"./src/scripts/filter-loadmore.js\");\n/* harmony import */ var _scripts_videoControls__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./scripts/videoControls */ \"./src/scripts/videoControls.js\");\n/* harmony import */ var _scripts_videoControls__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_scripts_videoControls__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _scripts_signup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scripts/signup */ \"./src/scripts/signup.js\");\n/* harmony import */ var _scripts_signup__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_scripts_signup__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _scripts_googleMaps__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scripts/googleMaps */ \"./src/scripts/googleMaps.js\");\n/* harmony import */ var _scripts_googleMaps__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_scripts_googleMaps__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _scripts_cookieConsent_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./scripts/cookieConsent.js */ \"./src/scripts/cookieConsent.js\");\n/* harmony import */ var _scripts_chatbot_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./scripts/chatbot.js */ \"./src/scripts/chatbot.js\");\n/* harmony import */ var _scripts_chatbot_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_scripts_chatbot_js__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _scripts_calendar___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./scripts/calendar/ */ \"./src/scripts/calendar/index.js\");\n// TopBar\n\n\n\n\n\n\n// Frontend Functionality\n\n\n\n\n\n\n\n\n// Cookie Notifications\n\n\n// Chatbot\n\n\n// Calendar\n\n\n//# sourceURL=webpack://cutheme-twig/./src/cutheme-scripts.js?\n}");

/***/ }),

/***/ "./src/scripts/accordion.js":
/*!**********************************!*\
  !*** ./src/scripts/accordion.js ***!
  \**********************************/
/***/ (() => {

eval("{document.addEventListener('DOMContentLoaded', () => {\n  /**\n   * Toggles the visibility of a single accordion's content and updates its icon and aria attributes.\n   * @param {HTMLElement} button - The accordion button element that was clicked.\n   */\n  const toggleAccordion = button => {\n    if (!button) {\n      throw new Error(`Accordion button element is undefined`);\n    }\n    const icon = button.querySelector('.accordion__icon');\n    const accordion = button.closest('.accordion');\n    if (!accordion) {\n      throw new Error(`No parent .accordion element found for the button.`);\n    }\n    const content = accordion.querySelector('.accordion__content');\n    if (!content) {\n      throw new Error(`No .accordion__content element found within the accordion.`);\n    }\n    const isHidden = content.hidden;\n    button.setAttribute('aria-expanded', String(isHidden));\n    content.hidden = !isHidden;\n    if (icon) {\n      icon.classList.toggle('rotate-90', isHidden);\n      icon.classList.toggle('rotate-0', !isHidden);\n    }\n  };\n\n  /**\n   * Handles click events on the document body, delegating to the toggleAccordion function\n   * if an accordion button or its child is the target.\n   * @param {Event} event - The click event object.\n   */\n  const handleAccordionClick = event => {\n    const accordionButton = event.target.closest('.accordion__button');\n    if (accordionButton) {\n      try {\n        toggleAccordion(accordionButton);\n      } catch (error) {\n        throw new Error('Error toggling accordion:', error);\n      }\n    }\n  };\n\n  // Use event delegation for all accordion buttons, including those added dynamically.\n  document.body.addEventListener('click', handleAccordionClick);\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/accordion.js?\n}");

/***/ }),

/***/ "./src/scripts/alphaList.js":
/*!**********************************!*\
  !*** ./src/scripts/alphaList.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * Filters the list items and section headers based on the input query.\n * @param {string} query - The search term to filter list items.\n */\nfunction filterList(query) {\n  const listItems = document.querySelectorAll('.cu-filter-alpha-item');\n  if (!listItems || listItems.length === 0) {\n    throw new Error(`No list items with class \"cu-filter-alpha-item\" found`);\n  }\n  const searchTerm = query.toLowerCase();\n\n  // Show or hide each list item based on the search term\n  listItems.forEach(item => {\n    const itemName = item.textContent.toLowerCase();\n    item.style.display = itemName.includes(searchTerm) ? 'list-item' : 'none';\n  });\n\n  // Show or hide section headers based on visibility of items within their UL\n  const sectionHeaders = document.querySelectorAll('.cu-filter-alpha-title');\n  if (!sectionHeaders || sectionHeaders.length === 0) {\n    throw new Error(`No section headers with class \"cu-filter-alpha-title\" found`);\n  }\n  sectionHeaders.forEach(header => {\n    const ulElement = header.nextElementSibling; // The UL associated with this header\n    const visibleItems = ulElement.querySelectorAll('.cu-filter-alpha-item:not([style*=\"display: none\"])');\n\n    // Hide header if no visible items in the corresponding UL, otherwise show it\n    header.style.display = visibleItems.length > 0 ? 'block' : 'none';\n  });\n}\n\n/**\n * Sets up the event listener for the filter input field on DOMContentLoaded.\n */\ndocument.addEventListener('DOMContentLoaded', function () {\n  const filterInput = document.querySelector('.cu-filter-results');\n  if (filterInput) {\n    /**\n     * Input event handler for the filter input field.\n     * @param {Event} event - The input event object.\n     */\n    function handleInput(event) {\n      filterList(event.target.value);\n    }\n    filterInput.addEventListener('input', handleInput, {\n      passive: true\n    });\n  }\n});\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (filterList);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/alphaList.js?\n}");

/***/ }),

/***/ "./src/scripts/calendar/Calendar.js":
/*!******************************************!*\
  !*** ./src/scripts/calendar/Calendar.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* global siteUrl */\n\n/**\n * Represents a Calendar component that dynamically generates and manages\n * a calendar grid. It provides functionality to navigate between months\n * and highlights the current day.\n */\nclass Calendar {\n  constructor(calendarElement) {\n    // The active class of dates\n    this.activeDateClasses = ['bg-cu-red', 'text-white'];\n    this.calendarElement = calendarElement;\n    this.elementSetup();\n    this.dateSetup();\n    this.init();\n  }\n\n  /**\n   * Sets up the calendar by initializing DOM elements.\n   *\n   * @property {HTMLElement} eventsListing    - The listing element of the events.\n   * @property {HTMLElement} calendarGrid     - The grid element of the calendar.\n   * @property {HTMLElement} prevMonthButton  - The button to navigate to the previous month.\n   * @property {HTMLElement} nextMonthButton  - The button to navigate to the next month.\n   * @property {HTMLElement} monthYearElement - The element displaying the current month and year.\n   * @property {HTMLElement} dateElement      - The elements displaying the dates.\n   * @property {HTMLElement} clearButton      - The element displaying the clear button.\n   * @property {HTMLElement} viewTodayButton  - The element displaying the view today button.\n   * @property {HTMLElement} pages            - The element displaying the pages in the bottom.\n   */\n  elementSetup() {\n    const requiredSelectors = {\n      eventsListing: '.cu-calendar__listing',\n      calendarGrid: '.calendar-grid',\n      prevMonthButton: '.prev-month',\n      nextMonthButton: '.next-month',\n      monthYearElement: '.current-month-year'\n    };\n    for (const [key, selector] of Object.entries(requiredSelectors)) {\n      const element = this.calendarElement.querySelector(selector);\n      if (!element) {\n        throw new Error(`Calendar component is missing required element: ${selector}`);\n      }\n      this[key] = element;\n    }\n    this.dateElements = this.calendarGrid && this.calendarGrid.getElementsByClassName('cu-dates');\n    this.clearButton = this.calendarElement.querySelector('.cu-calendar__clear');\n    this.viewTodayButton = this.calendarElement.querySelector('.cu-calendar__today');\n    this.pages = this.calendarElement.getElementsByClassName('cu-calendar__page');\n    this.loadMoreSpinner = this.calendarElement?.querySelector('.load-more-spinner') || null;\n    this.activeFilters = null;\n  }\n\n  /**\n   * Sets the active filters for the calendar and updates the events listing if filters are provided.\n   *\n   * @param {Object} activeFilters - The filters to be applied to the calendar.\n   */\n  setFilters(activeFilters) {\n    this.activeFilters = activeFilters;\n    if (this.activeFilters) {\n      this.updateEventsListing();\n    }\n  }\n\n  /**\n   * Initializes the date-related properties for the calendar.\n   *\n   *\n   * Properties initialized:\n   * - `this.date`: The current date object.\n   * - `this.currentDateNumeric`: The current date stamp (YYYYMMDD).\n   * - `this.Year`: The year displayed on the calendar.\n   * - `this.Month`: The month displayed on the calendar (0-11).\n   * - `this.Date`: The day of the month displayed on the calendar.\n   * - `this.MonthName`: The name of the month displayed on the calendar.\n   * - `this.dateRange`: An array to store a range of dates.\n   * - `this.sortedDateRange`: An array to store a range of dates in order.\n   * - `this._dataLoading`: An indicator for data loading status.\n   * - `this.paged`: The current page number for pagination.\n   */\n  dateSetup() {\n    // Current Dates\n    this.date = new Date();\n    this.currentDateNumeric = Number(`${this.date.getFullYear()}${String(this.date.getMonth() + 1).padStart(2, '0')}${String(this.date.getDate()).padStart(2, '0')}`);\n    // Date on the calendar\n    this.Year = this.date.getFullYear();\n    this.Month = this.date.getMonth();\n    this.Date = this.date.getDate();\n    this.MonthName = this.getMonthName(this.Month);\n    // Date Range\n    this.dateRange = [];\n    this.sortedDateRange = [];\n    // Data Loading\n    this._dataLoading = false;\n    // Pagination\n    this.paged = 1;\n  }\n\n  /**\n   * Initializes the calendar by creating the calendar grid for the specified year and month,\n   * and setting up event listeners for date clicks, previous month button, and next month button.\n   *\n   * @return {void}\n   */\n  init() {\n    this.createCalendarGrid(this.Year, this.Month);\n    this.setMonthYear();\n    this.onDatesClick();\n    this.onDatesKeyboardEnter();\n    this.onPrevMonthButtonclick();\n    this.onNextMonthButtonclick();\n    this.onClearButtonClick();\n    this.onViewTodayButtonClick();\n    this.onPagesClick();\n  }\n\n  /**\n   * Resets the calendar to its initial state\n   */\n  reset() {\n    this.dateSetup();\n    this.updateClearbutton();\n    this.createCalendarGrid(this.Year, this.Month);\n    this.setMonthYear();\n    this.onDatesClick();\n    this.onDatesKeyboardEnter();\n    this.updateEventsListing();\n  }\n  onDatesClick() {\n    if (!this.dateElements) {\n      return;\n    }\n    Array.from(this.dateElements).forEach(dateElement => {\n      dateElement.addEventListener('click', event => {\n        // Prevents the default action (e.g., form submission or link navigation).\n        event.preventDefault();\n        this.onDatesClickHandler(dateElement);\n      });\n    });\n  }\n  onDatesKeyboardEnter() {\n    if (!this.dateElements) {\n      return;\n    }\n    Array.from(this.dateElements).forEach(dateElement => {\n      dateElement.addEventListener('keydown', event => {\n        if (event.keyCode === 13) {\n          event.preventDefault();\n          this.onDatesClickHandler(dateElement);\n        }\n      });\n    });\n  }\n  onPrevMonthButtonclick() {\n    if (!this.prevMonthButton) {\n      return;\n    }\n    this.prevMonthButton.addEventListener('click', event => {\n      event.preventDefault();\n      this.getPreviousMonth();\n    });\n  }\n  onNextMonthButtonclick() {\n    if (!this.nextMonthButton) {\n      return;\n    }\n    this.nextMonthButton.addEventListener('click', event => {\n      event.preventDefault();\n      this.getNextMonth();\n    });\n  }\n  onClearButtonClick() {\n    if (!this.clearButton) {\n      return;\n    }\n    this.clearButton.addEventListener('click', event => {\n      event.preventDefault();\n      this.reset();\n    });\n  }\n  onViewTodayButtonClick() {\n    if (!this.viewTodayButton) {\n      return;\n    }\n    this.viewTodayButton.addEventListener('click', event => {\n      event.preventDefault();\n      this.dateSetup();\n      this.dateRange = [this.getDateNumeric()];\n      this.sortedDateRange = [this.getDateNumeric()];\n      this.createCalendarGrid(this.Year, this.Month);\n      this.setMonthYear();\n      this.onDatesClick();\n      this.updateEventsListing();\n      this.updateClearbutton();\n      this.highlightSelectedDateRange(this.dateRange);\n    });\n  }\n  onPagesClick() {\n    if (!this.pages) {\n      return;\n    }\n    Array.from(this.pages).forEach(page => {\n      page.addEventListener('click', event => {\n        event.preventDefault();\n        this.onPagesClickHandler(page);\n      });\n    });\n  }\n\n  /**\n   * Handles the click event on a date element, allowing users to select or deselect dates\n   * and manage a date range. Updates the UI to reflect the selected dates and highlights\n   * the range if more than one date is selected.\n   *\n   * @param {HTMLElement} dateElement - The DOM element representing the clicked date.\n   */\n  onDatesClickHandler(dateElement) {\n    const selectedDate = dateElement.getAttribute('date');\n    if (!selectedDate) {\n      return;\n    }\n\n    // Pagination\n    this.paged = 1;\n\n    // Check if the selected date already exists in the date range\n    const dateIndex = this.dateRange.indexOf(selectedDate);\n    if (dateIndex !== -1) {\n      this.dateRange.splice(dateIndex, 1);\n    } else {\n      this.dateRange.push(selectedDate);\n\n      // If more than 2 dates are selected, remove the oldest date\n      if (this.dateRange.length) {\n        if (this.dateRange.length > 2) {\n          this.dateRange.shift();\n        }\n      }\n    }\n\n    // Update the clear button visibility based on the date range\n    this.updateClearbutton();\n\n    // Store the date range separately for sorting to preserve the original order\n    this.sortedDateRange = [...this.dateRange];\n\n    // Sort the date range in ascending order\n    this.sortedDateRange.sort((a, b) => a - b);\n\n    // Add active class to the selected dates range\n    this.highlightSelectedDateRange(this.sortedDateRange);\n    this.updateEventsListing();\n  }\n\n  /**\n   * Updates the events listing by fetching data from an API based on the selected date range.\n   * If the `eventsListingInnerContent` element is null, the function exits early.\n   *\n   * The function formats the start and end dates from `this.sortedDateRange` and constructs\n   * an API URL to fetch events. It then makes a fetch request to retrieve the events data,\n   * updates the inner HTML of `eventsListingInnerContent` with the fetched data, and handles\n   * any errors that occur during the fetch process.\n   *\n   * @return {void}\n   */\n  updateEventsListing() {\n    if (this.eventsListing === null) {\n      return;\n    }\n\n    // Call API\n    const formatDate = dateString => {\n      return `${dateString.slice(0, 4)}-${dateString.slice(4, 6)}-${dateString.slice(6)}`;\n    };\n    let upcoming = '',\n      targetedDate = '',\n      formattedStartDate = '',\n      formattedEndDate = '';\n    if (this.sortedDateRange.length === 0) {\n      // If no date is selected, fetch upcoming events\n      upcoming = '&upcoming=true';\n    } else if (this.sortedDateRange.length === 1) {\n      // If there is only one date selected, use targetedDate\n      targetedDate = `&targetedDate=${formatDate(this.sortedDateRange[0])}`;\n    } else {\n      formattedStartDate = this.sortedDateRange[0] ? `&start_date=${formatDate(this.sortedDateRange[0])}` : '';\n      formattedEndDate = this.sortedDateRange[1] ? `&end_date=${formatDate(this.sortedDateRange[1])}` : '';\n    }\n    const paged = this.paged ? `&paged=${this.paged}` : '';\n\n    // Get the filter params from the filter element\n    let filterParams = '';\n    if (this.activeFilters?.filterBy) {\n      Object.entries(this.activeFilters.filterBy).forEach(([key, values]) => {\n        if (Array.isArray(values) && values.length) {\n          const queryParam = `&${key}=${values.join(',')}`;\n          filterParams += queryParam;\n        }\n      });\n    }\n    const apiFetchEvents = `${siteUrl}/wp-json/cutheme/v1/cu-calendar/compiled?posts_per_page=6${upcoming}${targetedDate}${formattedStartDate}${formattedEndDate}${paged}${filterParams}`;\n    this.dataLoading = true;\n    clearTimeout(this.updateEventsListingTimeout);\n    this.updateEventsListingTimeout = setTimeout(() => {\n      fetch(apiFetchEvents).then(response => response.json()).then(data => {\n        if (data && data.length) {\n          this.eventsListing.innerHTML = data;\n\n          // Reinitialize the date elements after the grid is created\n          this.pages = this.calendarElement.getElementsByClassName('cu-calendar__page');\n\n          // Call events pages click\n          this.onPagesClick();\n        }\n      }).catch(error => {\n        // eslint-disable-next-line no-console\n        console.error('Error fetching events:', error);\n        this.eventsListing.innerHTML = '<p>Error loading events. Please try again later.</p>';\n      }).finally(() => {\n        this.dataLoading = false;\n      });\n    }, 100);\n  }\n  onPagesClickHandler(page) {\n    const pageNumber = page.getAttribute('data-page');\n    if (!pageNumber) {\n      throw new Error(`Page number is not defined`);\n    }\n    this.paged = pageNumber;\n    this.updateEventsListing();\n  }\n\n  /**\n   * Highlights the selected date range by adding or removing active classes\n   * to the corresponding date elements.\n   *\n   * @param {Array<string>} range - An array of strings representing the selected date range.\n   */\n  highlightSelectedDateRange(range) {\n    if (!range) {\n      return;\n    }\n    Array.from(this.dateElements).forEach(dateItem => {\n      const date = dateItem.getAttribute('date');\n      if (!date) {\n        return;\n      }\n      const button = dateItem.closest('button');\n      if (!button) {\n        return;\n      }\n\n      // Remove all active classes first\n      button.classList.remove(...this.activeDateClasses);\n\n      // Check if the date is within the selected range\n      const isInRange = range[1] ? date >= range[0] && date <= range[1] : date === range[0];\n\n      // Add active class to selected dates\n      if (isInRange) {\n        button.classList.add(...this.activeDateClasses);\n      }\n    });\n  }\n\n  /**\n   * Updates the visibility of the clear button based on the date range.\n   * If the `dateRange` array is empty, the clear button will be hidden.\n   * Otherwise, it will be shown.\n   *\n   * @return {void}\n   */\n  updateClearbutton() {\n    if (!this.clearButton) {\n      return;\n    }\n    this.clearButton.classList.toggle('!hidden', this.dateRange.length === 0);\n  }\n\n  /**\n   * Updates the text content of the monthYearElement with the current month name and year.\n   * Combines the MonthName and Year properties to display the date in \"Month Year\" format.\n   */\n  setMonthYear() {\n    this.monthYearElement.textContent = `${this.MonthName} ${this.Year}`;\n  }\n\n  /**\n   * Updates the calendar to display the previous month.\n   * If the current month is January (index 0), it wraps around to December (index 11)\n   * and decrements the year. Otherwise, it simply decrements the month.\n   * After updating the month and year, it regenerates the calendar grid.\n   */\n  getPreviousMonth() {\n    if (this.Month === 0) {\n      this.Month = 11;\n      this.Year--;\n    } else {\n      this.Month--;\n    }\n    this.updateCalendarGrid();\n  }\n\n  /**\n   * Advances the calendar to the next month.\n   * If the current month is December (11), it resets to January (0)\n   * and increments the year. Otherwise, it simply increments the month.\n   * After updating the month and year, it regenerates the calendar grid.\n   */\n  getNextMonth() {\n    if (this.Month === 11) {\n      this.Month = 0;\n      this.Year++;\n    } else {\n      this.Month++;\n    }\n    this.updateCalendarGrid();\n  }\n\n  /**\n   * Updates the calendar grid by regenerating the calendar for the current year and month.\n   * It also updates the displayed month name, sets the month and year in the UI,\n   * and attaches event handlers for date click and hover interactions.\n   */\n  updateCalendarGrid() {\n    this.createCalendarGrid(this.Year, this.Month);\n\n    // Add active class to the selected dates range\n    this.highlightSelectedDateRange(this.dateRange);\n\n    // Update the month name and year in the UI\n    this.MonthName = this.getMonthName(this.Month);\n\n    // Set the month and year in the UI\n    this.setMonthYear();\n\n    // Add event listeners for dates\n    this.onDatesClick();\n  }\n\n  /**\n   * Generates and populates a calendar grid for a given year and month.\n   * This method clears the existing calendar grid and dynamically creates\n   * calendar cells for each day of the specified month. It applies appropriate\n   * styles and classes to indicate the current day, past dates, and hover states.\n   *\n   * @param {number} year  - The year for which the calendar grid is to be created.\n   * @param {number} month - The month (0-indexed, where 0 = January, 11 = December) for which the calendar grid is to be created.\n   */\n  createCalendarGrid(year, month) {\n    if (!this.calendarGrid) {\n      return;\n    }\n    this.calendarGrid.innerHTML = '';\n    const firstDayOfMonth = new Date(year, month, 1).getDay();\n    const lastDateOfMonth = new Date(year, month + 1, 0).getDate();\n    const colStartClasses = ['', 'col-start-2', 'col-start-3', 'col-start-4', 'col-start-5', 'col-start-6', 'col-start-7'];\n    for (let date = 1; date <= lastDateOfMonth; date++) {\n      const dateNumeric = Number(this.getDateNumeric(date));\n      const isPastDate = dateNumeric < this.currentDateNumeric;\n      let dateWrapperClasses = 'bg-white py-2';\n\n      // Add col-start classes for the first day of the month\n      if (date === 1) {\n        dateWrapperClasses += ' ' + colStartClasses[firstDayOfMonth];\n      }\n      let dateClasses = `mx-auto flex h-8 w-8 items-center justify-center rounded-full`;\n      if (date === this.currentDate) {\n        dateClasses += ' text-white bg-cu-red';\n      } else {\n        dateClasses += ' text-cu-black-900';\n      }\n\n      // Disable past date\n      if (isPastDate) {\n        dateClasses += ' disabled:bg-cu-black-50 disabled:text-cu-black-900 cursor-not-allowed';\n      } else {\n        dateClasses += ' cu-dates cursor-pointer hover:bg-cu-red hover:text-white';\n      }\n\n      // Highlight the current date\n      if (dateNumeric === this.currentDateNumeric) {\n        dateClasses += ' text-cu-red';\n      }\n      let timeClass = '';\n      if (!isPastDate) {\n        timeClass += 'cu-dates';\n      }\n      const dateElement = `<div class=\"${dateWrapperClasses}\">\n                                    <button type=\"button\" ${isPastDate ? 'disabled' : ''} class=\"${dateClasses}\" date=\"${dateNumeric}\">\n                                    <time class=\"${timeClass}\">${date}</time>\n                                    </button>\n                                </div>`;\n      this.calendarGrid.insertAdjacentHTML('beforeend', dateElement);\n    }\n\n    // Reinitialize the date elements after the grid is created\n    this.dateElements = this.calendarGrid.getElementsByClassName('cu-dates');\n  }\n  get dataLoading() {\n    return this._dataLoading;\n  }\n\n  // Setter for dataLoading\n  set dataLoading(value) {\n    this._dataLoading = value;\n    this.eventsListing.classList.toggle('hidden', value);\n    if (this.loadMoreSpinner) {\n      this.loadMoreSpinner.classList.toggle('hidden', !value);\n      this.loadMoreSpinner.classList.toggle('flex', value);\n    }\n    Array.from(this.dateElements).forEach(dateElement => {\n      dateElement.style.cursor = value ? 'wait' : '';\n      dateElement.style.opacity = value ? '0.5' : '1';\n    });\n    Array.from(this.pages).forEach(page => {\n      page.style.cursor = value ? 'wait' : '';\n      page.style.opacity = value ? '0.5' : '1';\n    });\n  }\n\n  /**\n   * Generates a numeric representation of a date in the format YYYYMMDD.\n   *\n   * @param {number} [date=this.Date] - The day of the month to include in the numeric date.\n   * @return {string}                 - A string representing the date in the format YYYYMMDD.\n   */\n  getDateNumeric(date = this.Date) {\n    return `${this.Year}${String(this.Month + 1).padStart(2, '0')}${String(date).padStart(2, '0')}`;\n  }\n\n  /**\n   * Returns the name of the month corresponding to the given month index.\n   *\n   * @param {number} monthIndex - The index of the month (0 for January, 1 for February, ..., 11 for December).\n   * @return {string}           - The name of the month.\n   */\n  getMonthName(monthIndex) {\n    const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n    return months[monthIndex] || '';\n  }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Calendar);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/calendar/Calendar.js?\n}");

/***/ }),

/***/ "./src/scripts/calendar/index.js":
/*!***************************************!*\
  !*** ./src/scripts/calendar/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../filter */ \"./src/scripts/filter/index.js\");\n/* harmony import */ var _Calendar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Calendar.js */ \"./src/scripts/calendar/Calendar.js\");\n\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  /**\n   * Array of all calendar containers on the page.\n   * @type {Element[]}\n   */\n  const calendarContainers = document.querySelectorAll('.cu-calendar__container');\n  if (!calendarContainers) {\n    return;\n  }\n  calendarContainers.forEach(calendarContainer => {\n    /**\n     * Calendar element within the container.\n     * @type {Element|null}\n     */\n    const calendarElement = calendarContainer.querySelector('.cu-calendar');\n    if (!calendarElement) {\n      throw new Error('calendar element is not found');\n    }\n    if (calendarElement) {\n      try {\n        /**\n         * Instance of the Calendar class for this element.\n         * @type {Calendar}\n         */\n        const calendarInstance = new _Calendar_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](calendarElement);\n\n        /**\n         * Filter element for the calendar.\n         * @type {Element|null}\n         */\n        const filterElement = document.querySelector('.cu-filter');\n        if (!filterElement) {\n          throw new Error('Filter element not found with class .cu-filter');\n        }\n        try {\n          new _filter__WEBPACK_IMPORTED_MODULE_0__[\"default\"](filterElement);\n\n          /**\n           * Handles filter change events and updates the calendar instance.\n           * @param {CustomEvent} event - The filterChange event object.\n           */\n          filterElement.addEventListener('filterChange', event => {\n            const activeFilters = event.detail;\n            calendarInstance.setFilters(activeFilters);\n          });\n        } catch (error) {\n          throw new Error('Error initializing filter:', error);\n        }\n      } catch (error) {\n        throw new Error('Error initializing calendar:', error);\n      }\n    }\n  });\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/calendar/index.js?\n}");

/***/ }),

/***/ "./src/scripts/chatbot.js":
/*!********************************!*\
  !*** ./src/scripts/chatbot.js ***!
  \********************************/
/***/ (() => {

eval("{document.addEventListener('DOMContentLoaded', function () {\n  const toggleBtn = document.getElementById('cutheme-chat-button');\n  // Check if all required elements exist\n  if (!toggleBtn) {\n    return;\n  }\n\n  /**\n   * Chat panel element.\n   * @type {HTMLElement|null}\n   */\n  const chatPanel = document.getElementById('cutheme-chat-panel');\n  if (!chatPanel) {\n    throw new Error(`Chat panel element is undefined`);\n  }\n  /**\n   * Button to close the chat panel.\n   * @type {HTMLElement|null}\n   */\n  const closeBtn = document.getElementById('cutheme-chat-panel-close');\n  if (!closeBtn) {\n    throw new Error(`Chat close button element is undefined`);\n  }\n  if (toggleBtn && chatPanel && closeBtn) {\n    function toggleChatPanel(isOpen) {\n      chatPanel.classList.toggle('open', isOpen);\n    }\n    const openChatPanel = function () {\n      toggleChatPanel(true);\n    };\n    const closeChatPanel = function () {\n      toggleChatPanel(false);\n    };\n    toggleBtn.addEventListener('click', openChatPanel, {\n      passive: true\n    });\n    closeBtn.addEventListener('click', closeChatPanel, {\n      passive: true\n    });\n    const observer = new MutationObserver(mutationsList => {\n      let shouldDisconnect = false;\n      for (const mutation of mutationsList) {\n        mutation.removedNodes.forEach(removedNode => {\n          if (removedNode === toggleBtn) {\n            toggleBtn.removeEventListener('click', openChatPanel);\n            shouldDisconnect = true;\n          }\n          if (removedNode === closeBtn) {\n            closeBtn.removeEventListener('click', closeChatPanel);\n            shouldDisconnect = true;\n          }\n        });\n      }\n      if (shouldDisconnect) {\n        observer.disconnect();\n      }\n    });\n    if (toggleBtn.parentNode) {\n      observer.observe(toggleBtn.parentNode, {\n        childList: true\n      });\n    }\n    if (closeBtn.parentNode) {\n      observer.observe(closeBtn.parentNode, {\n        childList: true\n      });\n    }\n  }\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/chatbot.js?\n}");

/***/ }),

/***/ "./src/scripts/cookieConsent.js":
/*!**************************************!*\
  !*** ./src/scripts/cookieConsent.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-cookie */ \"../../../node_modules/js-cookie/dist/js.cookie.mjs\");\n\n\n/**\n * Shows or hides the cookie notice on DOMContentLoaded based on consent.\n */\nwindow.addEventListener('DOMContentLoaded', function () {\n  const cookieNotice = document.querySelector('.cu-cookie-notice');\n  const okButtonEl = document.querySelector('.cu-cookie-button button');\n\n  /**\n   * Hides the cookie notice and sets the cookie consent value.\n   */\n  function hideCookieNotice() {\n    js_cookie__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set('cookieConsent', 'true', {\n      expires: 365,\n      domain: window.location.hostname,\n      path: '/',\n      secure: true,\n      sameSite: 'Strict'\n    });\n    if (cookieNotice) {\n      cookieNotice.style.display = 'none';\n    }\n  }\n  if (okButtonEl) {\n    okButtonEl.addEventListener('click', hideCookieNotice, {\n      passive: true\n    });\n  }\n  if (js_cookie__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('cookieConsent') === 'true') {\n    hideCookieNotice();\n  } else if (cookieNotice) {\n    cookieNotice.style.display = 'block';\n  }\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/cookieConsent.js?\n}");

/***/ }),

/***/ "./src/scripts/filter-loadmore.js":
/*!****************************************!*\
  !*** ./src/scripts/filter-loadmore.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ \"./src/scripts/filter/index.js\");\n/* global siteUrl */\n\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  /**\n   * Array of all card sections on the page.\n   * @type {Element[]}\n   */\n  const sections = document.querySelectorAll('.cu-section--cards');\n  if (!sections) {\n    return;\n  }\n  sections.forEach(section => {\n    /**\n     * Filter element within the section.\n     * @type {Element|null}\n     */\n    const filterElement = section.querySelector('.cu-filter');\n\n    /**\n     * Load More button element.\n     * @type {Element|null}\n     */\n    const button = section.querySelector('.loadMore');\n\n    /**\n     * Object holding currently active filters.\n     * @type {Object}\n     */\n    let activeFilters = {};\n\n    // References to 'Load More' text, spinner, and 'No more posts' text\n    /**\n     * Load More button text element.\n     * @type {Element|null}\n     */\n    const loadMoreText = button?.querySelector('.load-more-button'),\n      /**\n       * Spinner element for loading indication.\n       * @type {Element|null}\n       */\n      spinner = button?.querySelector('.load-more-spinner'),\n      /**\n       * No more posts text element.\n       * @type {Element|null}\n       */\n      noMorePostsText = button?.querySelector('.no-more-posts'),\n      /**\n       * Loader element for the section.\n       * @type {Element|null}\n       */\n      containerLoader = section?.querySelector('.cu-loading'),\n      /**\n       * View More button element.\n       * @type {Element|null}\n       */\n      viewMoreButton = section?.querySelector('.cu-view-more'),\n      /**\n       * No posts container element.\n       * @type {Element|null}\n       */\n      noPostContainer = section?.querySelector('.cu-no-posts');\n    if (filterElement) {\n      /**\n       * Initializes the filter functionality for the filter element.\n       */\n      new _filter__WEBPACK_IMPORTED_MODULE_0__[\"default\"](filterElement);\n\n      /**\n       * Handles filter change events and updates the section accordingly.\n       * @param {CustomEvent} event - The filterChange event object.\n       */\n      filterElement.addEventListener('filterChange', async event => {\n        activeFilters = event.detail;\n        containerLoader?.classList.remove('hidden');\n        button?.classList.add('!hidden');\n        viewMoreButton?.classList.add('!hidden');\n        noPostContainer?.classList.add('hidden');\n        section.setAttribute('data-page', String(1));\n        await apiCallback().then(hasMorePosts => {\n          containerLoader?.classList.add('hidden');\n          button?.classList.remove('!hidden');\n          viewMoreButton?.classList.remove('!hidden');\n          if (hasMorePosts) {\n            section.setAttribute('data-page', String(2));\n          }\n        });\n      });\n    }\n\n    /**\n     * Retrieves the load more button element within the specified section.\n     * This element is selected based on the CSS class `.loadMore`.\n     *\n     * @type {Element|null}\n     */\n\n    if (button) {\n      button.addEventListener('click', async event => {\n        // Prevents the default action (e.g., form submission or link navigation).\n        event.preventDefault();\n        const nextPage = Number(section.getAttribute('data-page')) || 1;\n        loadMoreText?.classList.add('hidden');\n        spinner?.classList.remove('hidden');\n        await apiCallback().then(hasMorePosts => {\n          if (hasMorePosts) {\n            section.setAttribute('data-page', String(nextPage + 1));\n          }\n          spinner?.classList.add('hidden');\n        });\n      });\n    }\n\n    /**\n     * Fetches data from external API directly\n     * @param {string}          externalApiUrl - The external API URL\n     * @param {URLSearchParams} params         - Query parameters\n     * @return {Promise<Object>} API response data\n     */\n    const fetchExternalApiData = async (externalApiUrl, params) => {\n      try {\n        const fullExternalUrl = `${externalApiUrl}?${params.toString()}`;\n        const response = await fetch(fullExternalUrl, {\n          method: 'GET',\n          headers: {\n            'Content-Type': 'application/json'\n          }\n        });\n        if (!response.ok) {\n          throw new Error(`External API request failed: ${response.status}`);\n        }\n        return await response.json();\n      } catch (error) {\n        // eslint-disable-next-line no-console\n        console.error('External API Error:', error);\n        throw error;\n      }\n    };\n\n    /**\n     * Compiles template with data using internal compilation endpoint\n     * @param {Object} data       - Data to compile\n     * @param {Object} attributes - Block attributes\n     * @param {string} type       - Content type\n     * @param {string} blockType  - Block type\n     * @return {Promise<Object>} Compiled response\n     */\n    const compileTemplate = async (data, attributes, type, blockType) => {\n      try {\n        const compilationUrl = `${siteUrl}/wp-json/cutheme/v1/loadmore/compile-template`;\n        const compilationParams = new URLSearchParams({\n          type,\n          blockType,\n          block_attributes: JSON.stringify(attributes)\n        });\n        const response = await fetch(`${compilationUrl}?${compilationParams.toString()}`, {\n          method: 'POST',\n          headers: {\n            'Content-Type': 'application/json'\n          },\n          body: JSON.stringify(data),\n          credentials: 'omit'\n        });\n        if (!response.ok) {\n          throw new Error(`Template compilation failed: ${response.status}`);\n        }\n        return await response.json();\n      } catch (error) {\n        // eslint-disable-next-line no-console\n        console.error('Template Compilation Error:', error);\n        throw error;\n      }\n    };\n\n    /**\n     * Asynchronous function to handle the \"Load More\" and \"Filtering\" functionality for fetching and displaying posts.\n     *\n     * @async\n     * @function apiCallback\n     * @return {Promise<boolean>} A promise that resolves to a boolean indicating whether more posts are available to load.\n     *\n     * @throws {Error} Logs an error to the console if the fetch request fails.\n     */\n    const apiCallback = async () => {\n      // Get things from the section we need for JS to work\n      const nextPage = Number(section.getAttribute('data-page')) || 1;\n\n      // Get data attributes from section\n      const attributes = section.getAttribute('data-attributes') ? JSON.parse(section.getAttribute('data-attributes')) : {},\n        numberOfPosts = attributes.numberOfPosts,\n        type = attributes.contentType,\n        blockType = attributes.blockType,\n        order = attributes.order,\n        order_by = attributes.orderBy,\n        meta_key = attributes.metaField,\n        meta_query = attributes.meta_query || [],\n        external_api = attributes.external_api || null,\n        block_attributes = {\n          showImages: attributes.showImages,\n          showDates: attributes.showDates,\n          showExcerpts: attributes.showExcerpts,\n          metaField: attributes.metaField,\n          showJobTitle: attributes.showJobTitle,\n          showEmail: attributes.showEmail,\n          showPhone: attributes.showPhone,\n          buttonText: attributes.buttonText,\n          showHours: attributes.showHours,\n          orderBy: attributes.orderBy\n        };\n\n      // Get the filter params from the filter element\n      const tax_query = [];\n\n      // First, add all from attributes.tax_query\n      if (attributes.tax_query) {\n        if (Array.isArray(attributes.tax_query)) {\n          attributes.tax_query.forEach(queryItem => {\n            const {\n              taxonomy,\n              terms\n            } = queryItem;\n            if (Array.isArray(terms) && terms.length) {\n              tax_query.push({\n                taxonomy,\n                terms\n              });\n            }\n          });\n        } else {\n          tax_query.push(attributes.tax_query);\n        }\n      }\n\n      // Then, process activeFilters and override/replace any existing taxonomies\n      if (activeFilters?.filterBy) {\n        Object.entries(activeFilters.filterBy).forEach(([taxonomy, terms]) => {\n          if (Array.isArray(terms) && terms.length) {\n            // Check if this taxonomy already exists in tax_query\n            const existingIndex = tax_query.findIndex(item => item.taxonomy === taxonomy);\n            if (existingIndex !== -1) {\n              // Replace existing terms for this taxonomy\n              tax_query[existingIndex].terms = terms;\n            } else {\n              // Add new taxonomy and terms\n              tax_query.push({\n                taxonomy,\n                terms\n              });\n            }\n          }\n        });\n      }\n\n      // Construct the URL to fetch - only add parameters if they have values\n      const params = new URLSearchParams();\n      params.append('page', nextPage);\n      if (type) params.append('type', type);\n      if (numberOfPosts) params.append('posts_per_page', numberOfPosts);\n      if (order) params.append('order', order);\n      if (order_by) params.append('order_by', order_by);\n      if (meta_key) params.append('meta_key', meta_key);\n      if (blockType) params.append('blockType', blockType);\n      if (tax_query.length > 0) params.append('tax_query', JSON.stringify(tax_query));\n      if (meta_query) params.append('meta_query', JSON.stringify(meta_query));\n      if (external_api) params.append('external_api', external_api);\n      if (block_attributes) params.append('block_attributes', JSON.stringify(block_attributes));\n      noMorePostsText?.classList.add('hidden');\n      const container = section.querySelector('.cu-stackedlist--posts') || section.querySelector('.cu-column');\n      if (nextPage === 1 && container) {\n        container.innerHTML = '';\n      }\n      try {\n        let responseData;\n\n        // Check if we need to use external API or internal API\n        if (external_api) {\n          // Option 1: Direct external API call + compilation\n          const externalData = await fetchExternalApiData(external_api, params);\n          responseData = await compileTemplate(externalData, block_attributes, type, blockType);\n        } else {\n          // Use existing internal compiled endpoint\n          const internalAPI = '/wp-json/cutheme/v1/loadmore/compiled/';\n          params.append('block_attributes', JSON.stringify(block_attributes));\n          const internalAPILoadMore = `${siteUrl}${internalAPI}?${params.toString()}`;\n          const response = await fetch(internalAPILoadMore, {\n            credentials: 'omit'\n          });\n          if (!response.ok) {\n            throw new Error(`Internal API request failed: ${response.status}`);\n          }\n          responseData = await response.json();\n        }\n\n        // Add validation for responseData\n        if (!responseData || typeof responseData !== 'object') {\n          throw new Error('Invalid response data received');\n        }\n        const html = typeof responseData.html === 'string' ? responseData.html.trim() : responseData.html;\n        if (!html) {\n          // eslint-disable-next-line no-console\n          console.error('Error: An error occurred.');\n          if (noPostContainer) {\n            noPostContainer.classList.remove('hidden');\n          }\n        } else {\n          if (noPostContainer) {\n            noPostContainer.classList.add('hidden');\n          }\n          if (nextPage === 1 && container) {\n            // Clear the container and set new content\n            container.innerHTML = html;\n          } else {\n            const tempDiv = document.createElement('div');\n            tempDiv.innerHTML = html;\n\n            // Add the opacity-0 and transition classes to the new content\n            Array.from(tempDiv.children).forEach(child => {\n              child.classList.add('opacity-0', 'transition', 'duration-1000', 'ease-in-out');\n            });\n\n            // Append the new content to the container\n            const children = Array.from(tempDiv.children);\n            if (children.length > 0) {\n              container.append(...children);\n            }\n          }\n          if (container) {\n            // After a short delay, add the opacity-100 class to create a fade-in effect\n            setTimeout(() => {\n              Array.from(container.children).forEach(child => {\n                child.classList.remove('opacity-0');\n                child.classList.add('opacity-100');\n              });\n            }, 10); // A short delay ensures the elements are in the DOM before the transition starts\n          }\n        }\n\n        // No more posts to load\n        if (!responseData.hasMore) {\n          button?.classList.add('cu-button--hide');\n        } else {\n          // Show 'Load More' and hide spinner using Tailwind classes\n          loadMoreText?.classList.remove('hidden');\n          button?.classList.remove('cu-button--hide');\n          button?.removeAttribute('disabled');\n        }\n        return responseData.hasMore;\n      } catch (error) {\n        // eslint-disable-next-line no-console\n        console.error('API Callback Error:', error);\n\n        // Show user-friendly error message\n        if (noPostContainer) {\n          noPostContainer.classList.remove('hidden');\n          noPostContainer.innerHTML = '<p>Unable to load content. Please try again later.</p>';\n        }\n\n        // Reset UI state\n        spinner?.classList.add('hidden');\n        loadMoreText?.classList.remove('hidden');\n        return false;\n      }\n    };\n  });\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/filter-loadmore.js?\n}");

/***/ }),

/***/ "./src/scripts/filter/dropdown.js":
/*!****************************************!*\
  !*** ./src/scripts/filter/dropdown.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * Dropdown class for managing filter dropdown menus.\n * Provides click handling and menu alignment for dropdowns.\n *\n * @class\n */\nclass Dropdown {\n  /**\n   * Creates a Dropdown instance.\n   * @param {HTMLElement} filterElement - The parent filter element containing dropdowns.\n   */\n  constructor(filterElement) {\n    this.parentElement = filterElement;\n\n    /**\n     * Array of all dropdown elements.\n     * @type {Element[]}\n     */\n    this.dropdowns = this.parentElement.querySelectorAll('.cu-filter__dropdown');\n    if (!this.dropdowns) {\n      throw new Error(`Dropdown elements are undefined`);\n    }\n    this.dropdownsClick();\n  }\n\n  /**\n   * Sets up click handlers for all dropdowns.\n   */\n  dropdownsClick() {\n    if (!this.dropdowns) {\n      return;\n    }\n    this.dropdowns.forEach(dropdown => {\n      if (!dropdown) {\n        throw new Error('Dropdown element is null or undefined');\n      }\n      this.dropdownsClickHandler(dropdown);\n    });\n  }\n\n  /**\n   * Handles the click events for a dropdown element, enabling toggle functionality\n   * for the dropdown menu and ensuring proper behavior when clicking outside the dropdown.\n   *\n   * @param {HTMLElement} dropdown - The dropdown element to attach click handlers to.\n   */\n  dropdownsClickHandler(dropdown) {\n    const toggleButton = dropdown.querySelector('.cu-filter__dropdown-toggle');\n    const buttonArrow = dropdown.querySelector('.cu-filter__dropdown-arrow');\n    const menu = dropdown.querySelector('.cu-filter__dropdown-menu');\n    if (!toggleButton || !buttonArrow || !menu) {\n      throw new Error('Toggle button, button arrow, menu is missing');\n    }\n    if (toggleButton && menu) {\n      // Show/hide the menu when clicking the toggle button\n      toggleButton.addEventListener('click', event => {\n        // Prevents the default action (e.g., navigation or form submission) of the toggle button,\n        // allowing the dropdown menu's visibility toggle to function correctly.\n        event.preventDefault();\n        // Prevents the event from bubbling up to the document click listener,\n        // so the dropdown does not immediately close after opening.\n        event.stopPropagation();\n\n        // Toggle the menu visibility\n        const isHidden = menu.classList.contains('hidden');\n        if (!isHidden) {\n          this.closeAllDropdowns();\n          return;\n        }\n\n        // Close all other dropdowns\n        this.closeAllDropdowns();\n        menu.classList.toggle('hidden', !isHidden);\n        if (isHidden) {\n          this.alignDropdowns(menu);\n        } else {\n          menu.style.left = '';\n          menu.style.right = '';\n        }\n        if (buttonArrow) {\n          buttonArrow.classList.toggle('rotate-180', isHidden);\n        }\n\n        // Update the aria-expanded attribute to indicate whether the menu is open or closed\n        const ariaExpanded = toggleButton.attributes.getNamedItem('aria-expanded');\n        if (ariaExpanded) {\n          ariaExpanded.value = isHidden.toString();\n        }\n\n        // Update the aria-haspopup attribute to indicate whether the menu is open or closed\n        const popupOpen = toggleButton.attributes.getNamedItem('aria-haspopup');\n        if (popupOpen) {\n          popupOpen.value = isHidden.toString();\n        }\n      });\n\n      // Hide the menu when clicking outside of the dropdown\n      document.addEventListener('click', event => {\n        if (!dropdown.contains(event.target)) {\n          menu.classList.add('hidden');\n          if (buttonArrow) {\n            buttonArrow.classList.remove('rotate-180');\n          }\n        }\n      });\n\n      // Prevent click events from propagating to the document when clicking inside the menu\n      menu.addEventListener('click', event => {\n        // Prevents the event from bubbling up to parent elements,\n        // ensuring that clicks inside the dropdown menu do not trigger\n        // global click listeners or interfere with other components.\n        event.stopPropagation();\n      });\n    }\n  }\n\n  /**\n   * Adjusts the alignment of a dropdown menu to ensure it stays within the viewport boundaries.\n   *\n   * This method checks the position of the dropdown menu relative to the viewport and adjusts\n   * its `left` and `right` styles to prevent it from overflowing beyond the edges of the container.\n   *\n   * @param {HTMLElement} menu - The HTML element representing the dropdown menu to be aligned.\n   */\n  alignDropdowns(menu) {\n    const {\n      right,\n      left\n    } = menu.getBoundingClientRect();\n    const viewportWidth = this.parentElement.offsetWidth;\n\n    // Adjust alignment if the dropdown touches the right edge\n    if (right > viewportWidth) {\n      Object.assign(menu.style, {\n        right: '-16px',\n        left: 'auto'\n      });\n    }\n\n    // Adjust alignment if the dropdown touches the left edge\n    if (left < 0) {\n      Object.assign(menu.style, {\n        left: '-16px',\n        right: 'auto'\n      });\n    }\n  }\n\n  /**\n   * Closes all dropdown menus within the component by iterating through the list of dropdown elements.\n   *\n   * - Hides the dropdown menu by adding the `hidden` class to its element.\n   * - Resets the dropdown arrow button by removing the `rotate-180` class.\n   *\n   * This method ensures that all dropdowns are in their closed state.\n   */\n  closeAllDropdowns() {\n    if (!this.dropdowns) {\n      return;\n    }\n    this.dropdowns.forEach(dropdown => {\n      const menu = dropdown.querySelector('.cu-filter__dropdown-menu');\n      const buttonArrow = dropdown.querySelector('.cu-filter__dropdown-arrow');\n      if (menu) {\n        menu.classList.add('hidden');\n      }\n      if (buttonArrow) {\n        buttonArrow.classList.remove('rotate-180');\n      }\n    });\n  }\n\n  /**\n   * Cleans up resources and performs necessary teardown operations for the filter panel.\n   * Specifically, it ensures that all dropdowns associated with the filter panel are closed.\n   */\n  destroy() {\n    this.closeAllDropdowns();\n  }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Dropdown);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/filter/dropdown.js?\n}");

/***/ }),

/***/ "./src/scripts/filter/index.js":
/*!*************************************!*\
  !*** ./src/scripts/filter/index.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdown */ \"./src/scripts/filter/dropdown.js\");\n\n\n/**\n * Filter class for managing sorting and filtering UI and state.\n * Extends Dropdown for dropdown menu support.\n *\n * @class\n * @augments Dropdown\n */\nclass Filter extends _dropdown__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n  /**\n   * Object holding currently active filter items.\n   * @type {{sortBy: string, filterBy: Object}}\n   */\n  _activeFilterItems = {\n    sortBy: '',\n    filterBy: {}\n  };\n\n  /**\n   * Creates a Filter instance.\n   * @param {HTMLElement} filterElement - The filter element to manage.\n   */\n  constructor(filterElement) {\n    super(filterElement);\n\n    /**\n     * The filter element managed by this instance.\n     * @type {HTMLElement}\n     */\n    this.filter = filterElement;\n\n    /**\n     * Array of sorting items.\n     * @type {Element[]}\n     */\n    this.sortingItems = this.filter.querySelectorAll('.cu-filter__sorting-item');\n\n    /**\n     * Array of filtering items.\n     * @type {Element[]}\n     */\n    this.filteringItems = this.filter.querySelectorAll('.cu-filter__filtering-item');\n\n    /**\n     * Active filter panel element.\n     * @type {Element|null}\n     */\n    this.activeFilterPanel = this.filter.querySelector('.cu-filter__active-filter-panel');\n    /**\n     * Array of active filter remove buttons.\n     * @type {Element[]}\n     */\n    this.activeFilterRemoveBtns = this.filter.querySelectorAll('.cu-filter__active-filter-remove');\n\n    /**\n     * Array of dropdown toggle elements.\n     * @type {Element[]}\n     */\n    this.dropdownItems = this.filter.querySelectorAll('.cu-filter__dropdown-toggle');\n    this.init();\n  }\n\n  /**\n   * Initializes the filter by setting up event handlers and loading state.\n   */\n  init() {\n    this.activeSortItemLoad();\n    this.sortItemClick();\n    this.setActiveFilterItems();\n    this.activeFilterItemLoad();\n    this.filterItemClick();\n    this.activeFilterRemoveBtnsClick();\n  }\n\n  /**\n   * Emits a custom event named 'filterChange' with the currently active filter items as its detail.\n   * If the filter element is not defined, logs an error to the console and exits the function.\n   *\n   * @throws {Error} Logs an error to the console if the filter element is not defined.\n   */\n  emitActiveFilterChange() {\n    if (!this.filter) {\n      // eslint-disable-next-line no-console\n      console.error('Filter element is not defined.');\n      return;\n    }\n    const event = new CustomEvent('filterChange', {\n      detail: this._activeFilterItems\n    });\n    this.filter.dispatchEvent(event);\n  }\n\n  /**\n   * Updates the active filter items based on the dropdown elements.\n   *\n   * This method iterates through the `dropdownItems` collection and determines\n   * the type of filter for each dropdown using the `data-filter-type` attribute.\n   * If the filter type is 'sort', it resets the `sortBy` property of `_activeFilterItems` to an empty string.\n   * For other filter types, it resets the corresponding property in `_activeFilterItems` to an empty array.\n   *\n   * If `dropdownItems` is not defined, the method exits early without making any changes.\n   */\n  setActiveFilterItems() {\n    if (!this.dropdownItems) {\n      return;\n    }\n    this.dropdownItems.forEach(dropdown => {\n      const filterType = dropdown.getAttribute('data-filter-type');\n      if (filterType) {\n        this._activeFilterItems.filterBy[filterType] = [];\n      }\n    });\n  }\n\n  /**\n   * Load the active filter items when there is already a selected filter item.\n   */\n  activeFilterItemLoad() {\n    if (!this.filteringItems) {\n      return;\n    }\n    this.filteringItems.forEach(item => {\n      this.filterItemClickHandler(item);\n    });\n  }\n\n  /**\n   * Load the active sort item when there is already a selected sort item.\n   */\n  activeSortItemLoad() {\n    if (!this.sortingItems) {\n      return;\n    }\n    this.sortingItems.forEach(item => {\n      const isSelected = item.getAttribute('data-selected');\n      if (isSelected === 'true') {\n        this._activeFilterItems.sortBy = item.getAttribute('data-sort') || '';\n      }\n    });\n  }\n  sortItemClick() {\n    if (!this.sortingItems) {\n      return;\n    }\n    this.sortingItems.forEach(item => {\n      item.addEventListener('click', event => {\n        event.stopPropagation();\n        const target = event.currentTarget;\n        this.sortItemClickHandler(target);\n      });\n    });\n  }\n  filterItemClick() {\n    if (!this.filteringItems) {\n      return;\n    }\n    this.filteringItems.forEach(item => {\n      item.addEventListener('click', event => {\n        // Prevents the event from bubbling up to parent elements,\n        // ensuring that clicks on filter items do not interfere with other components.\n        event.stopPropagation();\n        const target = event.target;\n        this.filterItemClickHandler(target);\n        this.emitActiveFilterChange();\n      });\n    });\n  }\n  activeFilterRemoveBtnsClick() {\n    if (!this.activeFilterRemoveBtns) {\n      return;\n    }\n    this.activeFilterRemoveBtns.forEach(item => {\n      item.addEventListener('click', event => {\n        event.stopPropagation();\n        const target = event.currentTarget;\n        const value = target.getAttribute('data-label');\n        if (!value) {\n          return;\n        }\n        const filterType = target.getAttribute('data-filter-type');\n        if (filterType && this._activeFilterItems.filterBy[filterType]) {\n          this._activeFilterItems.filterBy[filterType] = this._activeFilterItems.filterBy[filterType].filter(filteredItem => filteredItem !== value);\n        }\n        this.unselectFilterItem(value);\n        this.removeFromActiveFilterPanel(value);\n\n        // Close all dropdowns\n        super.closeAllDropdowns();\n        this.emitActiveFilterChange();\n      });\n    });\n  }\n\n  /**\n   * Handles the click event for a sort item in the filter panel.\n   *\n   * This method performs the following actions:\n   * 1. Unselects any previously selected sort item.\n   * 2. Retrieves the sort value from the clicked item's `data-sort` attribute.\n   * 3. Marks the clicked item as selected by setting its `data-selected` attribute\n   *    to \"true\" and adding a CSS class for visual indication.\n   * 4. Updates the active filter's `sortBy` property with the retrieved value.\n   * 5. Closes all dropdown menus in the filter panel.\n   *\n   * @param {HTMLElement} item - The HTML input element representing the clicked sort item.\n   */\n  sortItemClickHandler(item) {\n    this.unselectSortItem();\n    const value = item.getAttribute('data-sort');\n    item.setAttribute('data-selected', 'true');\n    item.classList.add('bg-gray-100');\n    this._activeFilterItems.sortBy = value || '';\n    this.closeAllDropdowns();\n  }\n\n  /**\n   * Unselects all sorting items by updating their attributes and classes.\n   *\n   * This method iterates through the `sortingItems` array and performs the following actions\n   * for each item:\n   * - Sets the `data-selected` attribute to `'false'`.\n   * - Removes the `bg-gray-100` CSS class.\n   *\n   * If `sortingItems` is not defined, the method exits early without performing any actions.\n   */\n  unselectSortItem() {\n    if (!this.sortingItems) {\n      return;\n    }\n    this.sortingItems.forEach(item => {\n      if (item) {\n        item.setAttribute('data-selected', 'false');\n        item.classList.remove('bg-gray-100');\n      }\n    });\n  }\n\n  /**\n   * Handles the click event for a filter item in the filter panel.\n   * Toggles the selection state of the clicked item and updates the active filter items accordingly.\n   *\n   * @param {HTMLElement} item - The HTML element representing the filter item that was clicked.\n   *                           It is expected to have a `data-label` attribute containing its value.\n   *\n   *                           Behavior:\n   *                           - If the item is already selected:\n   *                           - Removes the item's value from the `_activeFilterItems` array.\n   *                           - If the item is not selected:\n   *                           - Adds the item's value to the `_activeFilterItems` array.\n   */\n  filterItemClickHandler(item) {\n    const label = item.getAttribute('data-label');\n    const value = item.getAttribute('value');\n    const filterType = item.getAttribute('data-filter-type');\n    if (label && value && filterType) {\n      if (!item.checked) {\n        const index = this._activeFilterItems.filterBy[filterType]?.indexOf(value);\n        if (index !== undefined && index > -1) {\n          this._activeFilterItems.filterBy[filterType].splice(index, 1);\n        }\n        this.removeFromActiveFilterPanel(value);\n      } else {\n        this._activeFilterItems.filterBy[filterType].push(value);\n        this.addToActiveFilterPanel(label, value, filterType);\n      }\n    }\n  }\n\n  /**\n   * Adds a filter item to the active filter panel and attaches an event listener\n   * to the remove button of the newly added filter item.\n   *\n   * @param {string} item       - The label of the filter item to be added.\n   * @param {string} value      - The value of the filter item to be added.\n   * @param {string} filterType - The type/category of the filter item.\n   * @return {void} This function does not return a value.\n   */\n  addToActiveFilterPanel(item, value, filterType) {\n    if (!this.activeFilterPanel || !item || !filterType || !value) {\n      return;\n    }\n    const filterItem = `<div class=\"flex items-center gap-0.5 pl-3 pe-2 py-1 border rounded-lg border-cu-black-100\">\n            <span>${item}</span>\n            <button\n              type=\"button\"\n              class=\"cu-filter__active-filter-remove flex flex-shrink-0 w-4 h-4 p-1 ml-1 rounded-full text-cu-black-400 hover:bg-cu-red hover:text-white\"\n              data-label=\"${value}\"\n              data-filter-type=\"${filterType}\"\n            >\n              <span class=\"sr-only\">Remove filter for ${item}</span>\n              <svg class=\"w-2 h-2\" stroke=\"currentColor\" fill=\"none\" viewBox=\"0 0 8 8\">\n                <path strokeLinecap=\"round\" strokeWidth=\"1.5\" d=\"M1 1l6 6m0-6L1 7\"></path>\n              </svg>\n            </button>\n          </div>`;\n    this.activeFilterPanel.insertAdjacentHTML('beforeend', filterItem);\n\n    // Add event listener to the newly added remove button\n    this.activeFilterRemoveBtns = this.filter.querySelectorAll('.cu-filter__active-filter-remove');\n    this.activeFilterRemoveBtnsClick();\n  }\n\n  /**\n   * Removes an item from the active filter panel if it exists.\n   *\n   * @param {string} item - The label of the item to be removed from the active filter panel.\n   *                      If the item is not provided or the active filter panel is not set,\n   *                      the method will return without performing any action.\n   *\n   *                      This method searches for an element within the active filter panel that matches\n   *                      the provided `item` label using a `data-label` attribute. If such an element is found,\n   *                      it removes the element's parent from the DOM.\n   */\n  removeFromActiveFilterPanel(item) {\n    if (!this.activeFilterPanel || !item) {\n      return;\n    }\n    const filterItem = this.activeFilterPanel.querySelector(`[data-label=\"${item}\"]`);\n    if (filterItem) {\n      filterItem.parentElement?.remove();\n      const label = filterItem.getAttribute('data-label');\n      if (!label) {\n        return;\n      }\n      this.unselectFilterItem(label);\n    }\n  }\n\n  /**\n   * Retrieves the currently active filter items.\n   *\n   * @return {{ sortBy: string, filterBy: Record<string, string[]> }} The currently active filter items.\n   */\n  get activeFilterItems() {\n    return this._activeFilterItems;\n  }\n\n  /**\n   * Unselects a dropdown item by its label.\n   *\n   * This method iterates through the dropdown menu items and finds the checkbox\n   * input element that matches the provided label. If a matching checkbox is found,\n   * it is unchecked.\n   *\n   * @param {string} item - The label of the dropdown item to unselect. If the label is not provided\n   *                      or is falsy, the method will return without performing any action.\n   */\n  unselectFilterItem(item) {\n    if (!item) {\n      return;\n    }\n    this.filteringItems.forEach(dropdownItem => {\n      if (dropdownItem && dropdownItem.value === item) {\n        dropdownItem.checked = false;\n      }\n    });\n  }\n\n  /**\n   * Removes the checked dropdown items and remove the active filter panel.\n   */\n  unselectAllFilterMenuItems() {\n    if (!this.filteringItems) {\n      return;\n    }\n    this.filteringItems.forEach(item => {\n      const input = item.querySelector('input[type=\"checkbox\"]');\n      if (input) {\n        const value = input.getAttribute('data-label');\n        input.checked = false;\n        if (value) {\n          this.removeFromActiveFilterPanel(value);\n        }\n      }\n    });\n    this._activeFilterItems.filterBy = {};\n    this._activeFilterItems.sortBy = '';\n  }\n\n  /**\n   * Cleans up resources and performs necessary teardown operations for the filter panel.\n   * Specifically, it ensures that all dropdowns associated with the filter panel are closed.\n   */\n  destroy() {\n    this.unselectAllFilterMenuItems();\n  }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Filter);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/filter/index.js?\n}");

/***/ }),

/***/ "./src/scripts/googleMaps.js":
/*!***********************************!*\
  !*** ./src/scripts/googleMaps.js ***!
  \***********************************/
/***/ (() => {

eval("{/* global google */\n/**\n * Initializes Google Maps for all elements with the class 'cu-google-map'.\n * Checks for API availability, parses coordinates, and adds markers.\n * @global\n */\nwindow.initMap = function () {\n  // Check if Google Maps API has loaded\n  if (typeof google === 'undefined' || !google.maps || !google.maps.marker || !google.maps.marker.AdvancedMarkerElement) {\n    return;\n  }\n\n  /**\n   * Array of all map elements.\n   * @type {Element[]}\n   */\n  const mapElements = document.getElementsByClassName('cu-google-map');\n  // Check if there are any map elements. If not, return early\n  if (!mapElements.length) {\n    return;\n  }\n  Array.from(mapElements).forEach(mapElement => {\n    /**\n     * ID of the map element.\n     * @type {string}\n     */\n    const mapId = mapElement.id;\n    /**\n     * Raw coordinates from data attribute.\n     * @type {Object}\n     */\n    const rawCoordinates = JSON.parse(mapElement.dataset.coordinates || '{}');\n    /**\n     * Coordinates for the map marker.\n     * @type {{lat: number, lng: number}}\n     */\n    const coordinates = {\n      lat: parseFloat(rawCoordinates.lat),\n      lng: parseFloat(rawCoordinates.lng)\n    };\n    if (isNaN(coordinates.lat) || isNaN(coordinates.lng)) {\n      // Fallback to default coordinates if parsing fails\n      coordinates.lat = 45.3850225;\n      coordinates.lng = -75.6946679;\n    }\n\n    /**\n     * Address for the marker title.\n     * @type {string}\n     */\n    const address = mapElement.dataset.address || 'Carleton University, 1125 Colonel By Dr, Ottawa, ON K1S 5B6';\n\n    // Initialize the map\n    const map = new google.maps.Map(mapElement, {\n      zoom: 15,\n      center: coordinates,\n      mapId\n    });\n\n    // Add a marker using AdvancedMarkerElement\n    new google.maps.marker.AdvancedMarkerElement({\n      position: coordinates,\n      map,\n      title: address\n    });\n  });\n};\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/googleMaps.js?\n}");

/***/ }),

/***/ "./src/scripts/image-slider.js":
/*!*************************************!*\
  !*** ./src/scripts/image-slider.js ***!
  \*************************************/
/***/ (() => {

eval("{document.addEventListener('DOMContentLoaded', () => {\n  /**\n   * Main slider element.\n   * @type {Element|null}\n   */\n  const slider = document.querySelector('.cu-slider');\n  if (slider === null) {\n    return;\n  }\n\n  /**\n   * Array of all slide items.\n   * @type {Element[]}\n   */\n  const slides = slider.querySelectorAll('.cu-slider--item');\n  if (slider === null || slides === null) {\n    return;\n  }\n\n  /**\n   * Previous arrow element.\n   * @type {Element|null}\n   */\n  const previousArrow = slider.querySelector('.cu-slider--arrow-prev');\n  /**\n   * Next arrow element.\n   * @type {Element|null}\n   */\n  const nextArrow = slider.querySelector('.cu-slider--arrow-next');\n  if (previousArrow === null || nextArrow === null) {\n    throw new Error('Slider navigation arrows not found');\n  }\n\n  /**\n   * Current slide index.\n   * @type {number}\n   */\n  let currentIndex = 0;\n  /**\n   * Total number of slides.\n   * @type {number}\n   */\n  const totalSlides = slides.length;\n\n  /**\n   * Slides per view for desktop.\n   * @type {number}\n   */\n  const slidesPerViewDesktop = Number(slider.getAttribute('data-slides-desktop')) || 4;\n  /**\n   * Slides per view for tablet.\n   * @type {number}\n   */\n  const slidesPerViewTablet = Number(slider.getAttribute('data-slides-tablet')) || slidesPerViewDesktop;\n  /**\n   * Slides per view for mobile.\n   * @type {number}\n   */\n  const slidesPerViewMobile = Number(slider.getAttribute('data-slides-mobile')) || slidesPerViewTablet;\n\n  /**\n   * Current slides per view value.\n   * @type {number}\n   */\n  let slidesPerView = slidesPerViewDesktop;\n\n  /**\n   * Updates slidesPerView based on screen size.\n   */\n  const updatePerView = () => {\n    if (window.innerWidth < 768) {\n      slidesPerView = slidesPerViewMobile;\n    } else if (window.innerWidth < 1024) {\n      slidesPerView = slidesPerViewTablet;\n    } else {\n      slidesPerView = slidesPerViewDesktop;\n    }\n  };\n\n  /**\n   * Checks if total slides are less than or equal to slidesPerView and disables arrows if so.\n   * @param {number} width   - The screen width to check against.\n   * @param {string} message - Warning message to display.\n   * @return {boolean} True if arrows are disabled, false otherwise.\n   */\n  const checkTotalSlides = (width, message) => {\n    if (window.innerWidth > width && totalSlides <= slidesPerView) {\n      sliderWrap.style.justifyContent = 'center';\n      previousArrow.setAttribute('disabled', 'disabled');\n      nextArrow.setAttribute('disabled', 'disabled');\n      /* eslint-disable no-console */\n      console.warn(message);\n      /* eslint-enable no-console */\n      return true;\n    }\n    return false;\n  };\n\n  /**\n   * Slider wrapper element.\n   * @type {Element|null}\n   */\n  const sliderWrap = slider.querySelector('.cu-slider--wrap');\n  if (sliderWrap === null) {\n    throw new Error('Slider wrapper not found');\n  }\n  /**\n   * Adjusts the width of each slide dynamically based on container size and slidesPerView.\n   */\n  const adjustSlidesWidth = () => {\n    updatePerView();\n    const containerWidth = slider.offsetWidth;\n    const slideWidth = containerWidth / slidesPerView;\n    slides.forEach(slide => {\n      const slideElement = slide;\n      slideElement.style.flex = `0 0 ${slideWidth}px`;\n      slideElement.style.maxWidth = `${slideWidth}px`;\n    });\n    if (checkTotalSlides(1024, `Number of images in the slider is less than ${slidesPerViewDesktop} for desktop view`) || checkTotalSlides(768, `Number of images in the slider is less than ${slidesPerViewTablet} for tablet view`) || checkTotalSlides(0, `Number of images in the slider is less than ${slidesPerViewMobile} for mobile view`)) {\n      return;\n    }\n\n    // Remove any existing styles\n    sliderWrap.style.justifyContent = 'flex-start';\n    previousArrow.removeAttribute('disabled');\n    nextArrow.removeAttribute('disabled');\n\n    // Add event listeners for navigation\n    previousArrow.addEventListener('click', previousSlide);\n    nextArrow.addEventListener('click', nextSlide);\n    sliderWrap.style.transition = 'transform 0.5s ease';\n    sliderWrap.style.transform = `translateX(0%)`;\n  };\n  const nextSlide = () => {\n    const nextSlideIndex = (currentIndex + 1) % totalSlides;\n    const firstSlide = sliderWrap.firstElementChild;\n    sliderWrap.append(firstSlide);\n    if (currentIndex !== 0) {\n      currentIndex = nextSlideIndex - 1;\n    }\n    sliderWrap.style.transition = 'none';\n    sliderWrap.style.transform = `translateX(-${currentIndex * (100 / slidesPerView)}%)`;\n    setTimeout(() => {\n      sliderWrap.style.transition = 'transform 0.5s ease';\n      sliderWrap.style.transform = `translateX(-${currentIndex + 1 * (100 / slidesPerView)}%)`;\n    }, 50);\n  };\n  const previousSlide = () => {\n    const prevSlideIndex = (currentIndex + totalSlides) % totalSlides;\n    const lastSlide = sliderWrap.lastElementChild;\n    sliderWrap.prepend(lastSlide);\n    currentIndex = prevSlideIndex;\n    sliderWrap.style.transition = 'none';\n    sliderWrap.style.transform = `translateX(-${currentIndex + 1 * (100 / slidesPerView)}%)`;\n    setTimeout(() => {\n      sliderWrap.style.transition = 'transform 0.5s ease';\n      sliderWrap.style.transform = `translateX(-${currentIndex * (100 / slidesPerView)}%)`;\n    }, 50);\n  };\n\n  // Initialize the slider\n  const initializeSlider = () => {\n    // Adjust slides on load and resize\n    adjustSlidesWidth();\n  };\n  window.addEventListener('resize', adjustSlidesWidth);\n\n  // Run the slider\n  initializeSlider();\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/image-slider.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/navToggles.js":
/*!***************************************!*\
  !*** ./src/scripts/nav/navToggles.js ***!
  \***************************************/
/***/ (() => {

eval("{/**\n * CSS class for rotating navigation arrow.\n * @type {string}\n */\nconst navArrowRotateClass = 'after:!rotate-[225deg]';\n/**\n * CSS class for active navigation arrow background.\n * @type {string}\n */\nconst navArrowActiveClass = 'bg-cu-black-50/35';\n/**\n * Selector for parent menu items.\n * @type {string}\n */\nconst parentMenuItemsSelector = '.cu-nav__parent-item';\n/**\n * Selector for inner submenu toggles.\n * @type {string}\n */\nconst innerSubMenuTogglesSelector = '.cu-nav__inner-submenu-toggle';\n\n/**\n * Checks if an element is overflowing outside the body.\n * @param {Element} element - The element to check.\n * @return {boolean} True if overflowing, false otherwise.\n */\nconst isElementOverflowing = element => {\n  const rect = element.getBoundingClientRect();\n  const bodyRect = document.body.getBoundingClientRect();\n\n  // Check if any part of the element is outside the body\n  const isOverflowing = rect.left < bodyRect.left || rect.right > bodyRect.right;\n  return isOverflowing;\n};\n\n/**\n * Closes all sub menu items and resets their state.\n */\nconst closeAllSubmenus = () => {\n  const parentMenuItems = document.querySelectorAll(parentMenuItemsSelector);\n  if (parentMenuItems) {\n    parentMenuItems.forEach(menuItem => {\n      const submenuParent = menuItem.parentElement;\n      if (submenuParent) {\n        const submenu = submenuParent.nextElementSibling;\n        if (submenu) {\n          submenu.style.display = 'none';\n          submenu.style.removeProperty('left');\n          submenu.style.removeProperty('right');\n          submenuParent.setAttribute('aria-expanded', 'false');\n          menuItem.classList.remove(navArrowRotateClass);\n        }\n      }\n    });\n  }\n  // Close all inner submenus\n  closeInnerSubMenus();\n};\n\n/**\n * Closes all inner submenus and resets their state.\n */\nconst closeInnerSubMenus = () => {\n  const innerSubMenuToggles = document.querySelectorAll(innerSubMenuTogglesSelector);\n  if (innerSubMenuToggles) {\n    innerSubMenuToggles.forEach(toggle => {\n      toggle.classList.remove(navArrowRotateClass);\n      toggle.classList.remove(navArrowActiveClass);\n    });\n  }\n  const innerSubmenus = document.querySelectorAll('.cu-nav__inner-submenu');\n  if (innerSubmenus) {\n    innerSubmenus.forEach(submenu => {\n      if (submenu) {\n        submenu.classList.add('hidden');\n      }\n    });\n  }\n};\nconst handleMenuItemClick = menuItem => {\n  const menuItemParent = menuItem.parentElement;\n  if (menuItemParent) {\n    const submenu = menuItemParent.nextElementSibling;\n    const isExpanded = menuItem.getAttribute('aria-expanded') === 'true';\n    const arrow = menuItem.querySelector(innerSubMenuTogglesSelector);\n    if (submenu) {\n      if (isExpanded) {\n        submenu.style.display = 'none';\n        submenu.style.removeProperty('left');\n        submenu.style.removeProperty('right');\n        menuItem.classList.remove(navArrowRotateClass);\n        menuItemParent.setAttribute('aria-expanded', 'false');\n        if (arrow) {\n          arrow.classList.remove(navArrowRotateClass);\n        }\n      } else {\n        closeAllSubmenus();\n        submenu.style.display = 'block';\n        if (arrow) {\n          arrow.classList.add(navArrowRotateClass);\n        }\n        if (isElementOverflowing(submenu)) {\n          submenu.style.left = 'unset';\n          submenu.style.right = '0';\n        }\n        menuItem.classList.add(navArrowRotateClass);\n        menuItemParent.setAttribute('aria-expanded', 'true');\n      }\n    }\n  } else {\n    throw new Error(`Menu item not found`);\n  }\n};\nconst handleInnerSubNavClick = arrow => {\n  const parentElement = arrow.parentElement;\n  const menuItemSelector = parentElement?.dataset?.menuItem;\n  if (menuItemSelector) {\n    const menuItem = parentElement.nextElementSibling;\n    if (menuItem) {\n      if (menuItem.classList.contains('hidden')) {\n        parentElement.setAttribute('aria-expanded', 'true');\n        menuItem.classList.remove('hidden');\n        arrow.classList.add(navArrowRotateClass);\n        arrow.classList.add(navArrowActiveClass);\n      } else {\n        parentElement.setAttribute('aria-expanded', 'false');\n        menuItem.classList.add('hidden');\n        arrow.classList.remove(navArrowRotateClass);\n        arrow.classList.remove(navArrowActiveClass);\n      }\n    }\n  }\n};\nconst setupMenuToggle = () => {\n  const parentMenuItems = document.querySelectorAll(parentMenuItemsSelector);\n  if (!parentMenuItems || parentMenuItems.length === 0) {\n    return;\n  }\n  parentMenuItems.forEach(menuItem => {\n    menuItem.addEventListener('click', event => {\n      // Prevents the default action (e.g., link navigation).\n      event.preventDefault();\n      const target = event.target;\n      if (target) {\n        handleMenuItemClick(target);\n      }\n    });\n  });\n  const innerSubMenuToggles = document.querySelectorAll(innerSubMenuTogglesSelector);\n  if (innerSubMenuToggles) {\n    innerSubMenuToggles.forEach(toggle => {\n      toggle.addEventListener('click', event => {\n        event.preventDefault();\n        const target = event.target;\n        if (target) {\n          handleInnerSubNavClick(target);\n        }\n      });\n    });\n  }\n  document.addEventListener('click', event => {\n    const target = event.target;\n    if (target) {\n      const parentElement = target.parentElement;\n      if (parentElement?.classList.contains('cu-nav__parent-item')) {\n        handleMenuItemClick(parentElement);\n      } else if (!target.matches(parentMenuItemsSelector) && !target.matches(innerSubMenuTogglesSelector)) {\n        closeAllSubmenus();\n      }\n    }\n  });\n};\n(function () {\n  setupMenuToggle();\n})();\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/navToggles.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priority-plus/events/createEvent.js":
/*!*************************************************************!*\
  !*** ./src/scripts/nav/priority-plus/events/createEvent.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   Events: () => (/* binding */ Events),\n/* harmony export */   createHideOverflowEvent: () => (/* binding */ createHideOverflowEvent),\n/* harmony export */   createItemsChangedEvent: () => (/* binding */ createItemsChangedEvent),\n/* harmony export */   createShowOverflowEvent: () => (/* binding */ createShowOverflowEvent),\n/* harmony export */   createToggleClickedEvent: () => (/* binding */ createToggleClickedEvent),\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* eslint-disable */\n// @ts-nocheck\n\nconst Events = {\n  ShowOverflow: 'showOverflow',\n  HideOverflow: 'hideOverflow',\n  ItemsChanged: 'itemsChanged',\n  ToggleClicked: 'toggleClicked'\n};\nfunction createEvent(name, payload = {}) {\n  return new CustomEvent(name, {\n    detail: payload\n  });\n}\nfunction createShowOverflowEvent() {\n  return createEvent(Events.ShowOverflow);\n}\nfunction createHideOverflowEvent() {\n  return createEvent(Events.HideOverflow);\n}\nfunction createItemsChangedEvent({\n  overflowCount\n}) {\n  return createEvent(Events.ItemsChanged, {\n    overflowCount\n  });\n}\nfunction createToggleClickedEvent({\n  original\n}) {\n  return createEvent(Events.ToggleClicked, {\n    original\n  });\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createEvent);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priority-plus/events/createEvent.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priority-plus/events/eventHandler.js":
/*!**************************************************************!*\
  !*** ./src/scripts/nav/priority-plus/events/eventHandler.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _createEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createEvent */ \"./src/scripts/nav/priority-plus/events/createEvent.js\");\n/* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eventTarget */ \"./src/scripts/nav/priority-plus/events/eventTarget.js\");\n/* eslint-disable */\n// @ts-nocheck\n\n\n\nfunction createEventHandler() {\n  const state = {\n    eventReady: false\n  };\n  const eventChannel = (0,_eventTarget__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n  const eventListeners = new Map();\n\n  /**\n   * Registers an an event listener for the instance.\n   * By default the callback will only be run after the first-load.\n   * However this can be overridden by setting 'afterReady' to 'false'.\n   */\n  function on(eventType, cb, afterReady = true) {\n    function wrappedCallback(event) {\n      if (!afterReady || state.eventReady) cb(event);\n    }\n\n    // Store it so we can remove it later\n    eventListeners.set(cb, {\n      eventType,\n      wrappedCallback\n    });\n    eventChannel.addEventListener(eventType, wrappedCallback);\n    return this;\n  }\n\n  /**\n   * Removes an event listener.\n   */\n  function off(eventType, cb) {\n    const {\n      wrappedCallback\n    } = eventListeners.get(cb);\n    eventChannel.removeEventListener(eventType, wrappedCallback);\n    return this;\n  }\n\n  /**\n   * Dispatch an event.\n   */\n  function trigger(event) {\n    eventChannel.dispatchEvent(event);\n  }\n\n  /**\n   * Set if we're ready to fire event callbacks.\n   */\n  function setEventReady(ready = true) {\n    state.eventReady = ready;\n  }\n  return {\n    off,\n    on,\n    setEventReady,\n    trigger\n  };\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createEventHandler);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priority-plus/events/eventHandler.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priority-plus/events/eventTarget.js":
/*!*************************************************************!*\
  !*** ./src/scripts/nav/priority-plus/events/eventTarget.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* eslint-disable */\n// @ts-nocheck\n\nfunction eventTarget() {\n  const {\n    port1\n  } = new MessageChannel();\n  return {\n    addEventListener: port1.addEventListener.bind(port1),\n    dispatchEvent: port1.dispatchEvent.bind(port1),\n    removeEventListener: port1.removeEventListener.bind(port1)\n  };\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (eventTarget);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priority-plus/events/eventTarget.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priority-plus/priorityPlus.js":
/*!*******************************************************!*\
  !*** ./src/scripts/nav/priority-plus/priorityPlus.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _events_createEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/createEvent */ \"./src/scripts/nav/priority-plus/events/createEvent.js\");\n/* harmony import */ var _events_eventHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events/eventHandler */ \"./src/scripts/nav/priority-plus/events/eventHandler.js\");\n/* harmony import */ var _utils_createMirror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/createMirror */ \"./src/scripts/nav/priority-plus/utils/createMirror.js\");\n/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./validation */ \"./src/scripts/nav/priority-plus/validation.js\");\n/* eslint-disable */\n// @ts-nocheck\n\n\n\n\n\nconst El = {\n  Container: 'container',\n  Main: 'main',\n  PrimaryNavWrapper: 'primary-nav-wrapper',\n  PrimaryNav: 'primary-nav',\n  OverflowNav: 'overflow-nav',\n  ToggleBtn: 'toggle-btn',\n  NavItems: 'nav-item'\n};\nconst StateModifiers = {\n  ButtonVisible: 'is-showing-toggle',\n  OverflowVisible: 'is-showing-overflow',\n  PrimaryHidden: 'is-hiding-primary'\n};\nconst defaultOptions = {\n  classNames: {\n    [El.Container]: ['p-plus-container'],\n    [El.Main]: ['p-plus'],\n    [El.PrimaryNavWrapper]: ['p-plus__primary-wrapper'],\n    [El.PrimaryNav]: ['p-plus__primary'],\n    [El.OverflowNav]: ['p-plus__overflow'],\n    [El.ToggleBtn]: ['p-plus__toggle-btn'],\n    [El.NavItems]: ['p-plus__primary-nav-item']\n  },\n  collapseAtCount: -1,\n  openOnToggle: true,\n  defaultOverflowVisible: false\n};\nfunction priorityPlus(targetElem, userOptions = {}) {\n  /**\n   * @todo: We shouldn't have to cast this as Options, however DeepPartial creates\n   * breaks the type of innerToggleTemplate (?).\n   */\n  const options = {\n    ...defaultOptions,\n    ...userOptions,\n    classNames: {\n      ...defaultOptions.classNames,\n      ...userOptions.classNames\n    }\n  };\n  const {\n    classNames\n  } = options;\n\n  /**\n   * The instance's event emitter.\n   */\n  const eventHandler = (0,_events_eventHandler__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n\n  /**\n   * 'Instance' state variables and misc references.\n   * Force a cast as we know we will initialize these.\n   */\n  const inst = {\n    eventListeners: new Map(),\n    itemMap: new WeakMap()\n  };\n\n  /**\n   * References to DOM elements so we can easily retrieve them.\n   * Force a cast as we know we will initialize these.\n   */\n  const el = {\n    clone: {},\n    primary: {}\n  };\n\n  /**\n   * Gets an element's 'mirror' Map for the clone/primary navigation - e.g.\n   * if you pass a clone Map, you get the original Map and vice-versa.\n   */\n  const getElemMirror = (0,_utils_createMirror__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n\n  /**\n   * Generates classes based on an element name.\n   */\n  function cn(key) {\n    return classNames[key].join(' ');\n  }\n\n  /**\n   * Generates data-attributes based on an element name. These are used to query\n   * the generated DOM and populate the 'el' object.\n   */\n  function dv(key) {\n    return `data-${key}`;\n  }\n\n  /**\n   * Enhance a menu list-item with classes/attributes.\n   */\n  function enhanceNavItem(Nav) {\n    const navItems = Array.from(Nav.children);\n    navItems.forEach(item => {\n      item.classList.add(...classNames[El.NavItems]);\n      item.setAttribute(dv(El.NavItems), '');\n    });\n  }\n\n  /**\n   * Replaces the navigation with the two clones and populates the 'el' object.\n   */\n  function setupEl() {\n    const {\n      itemMap\n    } = inst;\n    const target = targetElem;\n    const original = target.querySelector(`[${dv(El.Container)}]`);\n    const container = original;\n    target.classList.add('p-plus-initialized');\n\n    // Setup the wrapper and clone/enhance the original menu.\n    el.primary[El.PrimaryNavWrapper] = original.querySelector(`[${dv(El.PrimaryNavWrapper)}]`);\n\n    // Establish references. By this point the menu is fully built.\n    el.primary[El.Main] = original.querySelector(`[${dv(El.Main)}]`);\n    el.primary[El.PrimaryNav] = original.querySelector(`[${dv(El.PrimaryNav)}]`);\n    el.primary[El.NavItems] = el.primary[El.PrimaryNav].children;\n    el.primary[El.OverflowNav] = original.querySelector(`[${dv(El.OverflowNav)}]`);\n    el.primary[El.OverflowNavItems] = el.primary[El.OverflowNav].children;\n    el.primary[El.ToggleBtn] = original.querySelector(`[${dv(El.ToggleBtn)}]`);\n    enhanceNavItem(el.primary[El.PrimaryNav]);\n    enhanceNavItem(el.primary[El.OverflowNav]);\n    const cloned = original.querySelector(`[${dv(El.Main)}]`)?.cloneNode(true);\n    el.clone[El.Main] = cloned;\n    el.clone[El.NavItems] = Array.from(cloned.querySelectorAll(`[${dv(El.NavItems)}]`));\n    el.clone[El.ToggleBtn] = cloned.querySelector(`[${dv(El.ToggleBtn)}]`);\n    el.clone[El.Main].setAttribute('aria-hidden', 'true');\n    el.clone[El.Main].setAttribute('data-clone', 'true');\n    el.clone[El.Main].classList.add(`${classNames[El.Main][0]}--clone`);\n    el.clone[El.Main].classList.add(`${classNames[El.Main][0]}--${StateModifiers.ButtonVisible}`);\n    container.append(el.clone[El.Main]);\n  }\n\n  /**\n   * Sets the toggle button visibility.\n   */\n  function updateBtnDisplay(show = true) {\n    el.primary[El.Main].classList[show ? 'add' : 'remove'](`${classNames[El.Main][0]}--${StateModifiers.ButtonVisible}`);\n  }\n\n  /**\n   * Run every time a nav item intersects with the parent container.\n   * We use this opportunity to check which type of nav the items belong to.\n   */\n  function onIntersect({\n    target,\n    intersectionRatio\n  }) {\n    inst.itemMap.set(target, intersectionRatio < 0.99 && El.PrimaryNav);\n    const primaryNavItem = getElemMirror(el.clone[El.NavItems], el.primary[El.NavItems]).get(target);\n    const targetMenuItemName = target.querySelector('span').getAttribute('data-menu-item');\n    let overflowNavNewItem = Array.from(el.primary[El.OverflowNavItems]).find(element => {\n      return targetMenuItemName === element.querySelector('span').getAttribute('data-menu-item');\n    });\n    if (intersectionRatio < 0.99) {\n      overflowNavNewItem?.classList.remove(`${classNames[El.NavItems][0]}--hidden`);\n      primaryNavItem?.classList.add(`${classNames[El.NavItems][0]}--hidden`);\n    } else {\n      overflowNavNewItem?.classList.add(`${classNames[El.NavItems][0]}--hidden`);\n      primaryNavItem?.classList.remove(`${classNames[El.NavItems][0]}--hidden`);\n    }\n  }\n  function countVisibleChildren(navElement) {\n    return Array.from(navElement.children).filter(child => !child.classList.contains(`${classNames[El.NavItems][0]}--hidden`)).length;\n  }\n\n  /**\n   * Updates the navigation items by toggling their visibility based on the collapseAtCount.\n   */\n  function updateNav() {\n    const {\n      collapseAtCount\n    } = options;\n    const primaryNavItems = Array.from(el.primary[El.NavItems]);\n    const overflowNavItems = Array.from(el.primary[El.OverflowNavItems]);\n    primaryNavItems.forEach((item, index) => {\n      if (index < collapseAtCount) {\n        item.classList.toggle('hidden', collapseAtCount > countVisibleChildren(el.primary[El.PrimaryNav]));\n      }\n    });\n    overflowNavItems.forEach((item, index) => {\n      if (index < collapseAtCount) {\n        const shouldShow = collapseAtCount > countVisibleChildren(el.primary[El.PrimaryNav]);\n        item.classList.toggle('hidden', !shouldShow);\n        item.classList.toggle(`${classNames[El.NavItems][0]}--hidden`, !shouldShow);\n      }\n    });\n  }\n\n  /**\n   * The IO callback, which collects intersection events.\n   */\n  function intersectionCallback(events) {\n    // Update the designation\n    events.forEach(onIntersect);\n    updateNav();\n    eventHandler.trigger((0,_events_createEvent__WEBPACK_IMPORTED_MODULE_0__.createItemsChangedEvent)({\n      overflowCount: countVisibleChildren(el.primary[El.OverflowNav])\n    }));\n\n    /**\n     * Once this callback is run, we can be confident that we are ready to pass on\n     * events to users. If we do so beforehand, internal initialisation events (e.g.\n     * the first itemsChanged and showOverflow events) will be sent to user-defined\n     * listeners.\n     */\n    eventHandler.setEventReady(true);\n  }\n\n  /**\n   * Sets the visibility of the overflow navigation.\n   */\n  function setOverflowNavOpen(open = true) {\n    const openClass = `${classNames[El.Main][0]}--${StateModifiers.OverflowVisible}`;\n    el.primary[El.Main].classList[open ? 'add' : 'remove'](openClass);\n    el.primary[El.OverflowNav].setAttribute('aria-hidden', open ? 'false' : 'true');\n    el.primary[El.OverflowNav].classList[open ? 'add' : 'remove']('!block');\n    el.primary[El.ToggleBtn].classList[open ? 'add' : 'remove']('after:!rotate-[225deg]');\n    el.primary[El.ToggleBtn].setAttribute('aria-expanded', open ? 'true' : 'false');\n    eventHandler.trigger(open ? (0,_events_createEvent__WEBPACK_IMPORTED_MODULE_0__.createShowOverflowEvent)() : (0,_events_createEvent__WEBPACK_IMPORTED_MODULE_0__.createHideOverflowEvent)());\n\n    // Add class to body to prevent scrolling for small screens\n    document.body.classList[open ? 'add' : 'remove']('no-scroll');\n    return this;\n  }\n\n  /**\n   * Toggles the visibility of the overflow navigation.\n   */\n  function toggleOverflowNav() {\n    const openClass = `${classNames[El.Main][0]}--${StateModifiers.OverflowVisible}`;\n    setOverflowNavOpen(!el.primary[El.Main].classList.contains(openClass));\n    return this;\n  }\n\n  /**\n   * Sets the visibility of the primary navigation (we hide the primary nav\n   * when all the navigation items are hidden in the overflow nav).\n   */\n  function setPrimaryHidden(hidden = true) {\n    const hiddenClass = `${classNames[El.Main][0]}--${StateModifiers.PrimaryHidden}`;\n    el.primary[El.Main].classList[hidden ? 'add' : 'remove'](hiddenClass);\n    el.primary[El.PrimaryNav].setAttribute('aria-hidden', String(hidden));\n  }\n\n  /**\n   * Handle the overflow-nav toggle btn click.\n   */\n  function onToggleClick(e) {\n    e.preventDefault();\n    eventHandler.trigger((0,_events_createEvent__WEBPACK_IMPORTED_MODULE_0__.createToggleClickedEvent)({\n      original: e\n    }));\n  }\n\n  /**\n   * Set the Browse dropdown style for small screen\n   */\n  function updateOverflowNavClass() {\n    const visiblePrimaryItem = Array.from(el.primary[El.NavItems]).filter(child => !child.classList.contains(`${classNames[El.NavItems][0]}--hidden`) && !child.classList.contains(`hidden`)).length;\n    el.primary[El.OverflowNav].classList[visiblePrimaryItem ? 'remove' : 'add']('p-plus_left');\n  }\n\n  /**\n   * Callback for when either nav is updated.\n   */\n  function onItemsChanged({\n    detail: {\n      overflowCount\n    } = {}\n  }) {\n    updateBtnDisplay(overflowCount > 0);\n    if (overflowCount === 0) {\n      setOverflowNavOpen(false);\n    }\n    updateOverflowNavClass();\n    setPrimaryHidden(overflowCount === el.clone[El.NavItems].length);\n  }\n\n  /**\n   * Retrieves an index of the primary nav elements.\n   */\n  function getNavElements() {\n    // Clone it to avoid users changing the el references,\n    // e.g. inst.getNavElements()['toggle-btn'] = null;\n    return {\n      ...el.primary\n    };\n  }\n\n  /**\n   * Close the overflow menu on outside click.\n   */\n  function autoCloseOverflowNav(e) {\n    const target = event.target;\n\n    // Check if the click was outside the menu and the toggle button\n    if (target && el.primary[El.OverflowNav].getAttribute('aria-hidden') === 'false' && !el.primary[El.OverflowNav].contains(target) && !el.primary[El.ToggleBtn].contains(target)) {\n      setOverflowNavOpen(false);\n    }\n  }\n\n  /**\n   * Establishes initial event listeners.\n   */\n  function bindListeners() {\n    inst.observer = new IntersectionObserver(intersectionCallback, {\n      root: el.clone[El.Main],\n      rootMargin: '0px 0px 0px 0px',\n      threshold: [0.99]\n    });\n    el.clone[El.NavItems].forEach(elem => inst.observer.observe(elem));\n    el.primary[El.ToggleBtn].addEventListener('click', onToggleClick);\n    eventHandler.on(_events_createEvent__WEBPACK_IMPORTED_MODULE_0__.Events.ItemsChanged, onItemsChanged, false);\n    document.addEventListener('click', autoCloseOverflowNav);\n    if (options.openOnToggle) {\n      eventHandler.on(_events_createEvent__WEBPACK_IMPORTED_MODULE_0__.Events.ToggleClicked, toggleOverflowNav, false);\n    }\n  }\n\n  /**\n   * Remove listeners and attempt to reset the DOM.\n   */\n  function destroy() {\n    if (inst.observer) inst.observer.disconnect();\n    el.primary[El.ToggleBtn].removeEventListener('click', onToggleClick);\n\n    // Unhook instance based event listeners\n    Array.from(inst.eventListeners.entries()).forEach(([cb, {\n      eventType\n    }]) => {\n      eventHandler.off(eventType, cb);\n    });\n\n    // Attempt to reset the DOM back to how it was\n    const parent = el[El.Container].parentNode;\n    parent.replaceChild(targetElem, el[El.Container]);\n  }\n  ;\n  (function init() {\n    if (targetElem.classList.contains('p-plus-initialized')) return;\n    (0,_validation__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(targetElem, userOptions, defaultOptions);\n    setupEl();\n    bindListeners();\n    if (options.defaultOverflowVisible) setOverflowNavOpen(true);\n  })();\n  return {\n    destroy,\n    getNavElements,\n    off: eventHandler.off,\n    on: eventHandler.on,\n    setOverflowNavOpen,\n    toggleOverflowNav\n  };\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (priorityPlus);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priority-plus/priorityPlus.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priority-plus/utils/createMirror.js":
/*!*************************************************************!*\
  !*** ./src/scripts/nav/priority-plus/utils/createMirror.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* eslint-disable */\n// @ts-nocheck\n\nfunction createMirror() {\n  const cache = new WeakMap();\n\n  /**\n   * Retrieves a Map of 'mirrored' elements, collected by index, e.g.\n   * the comparable element in a different array that shares the same index.\n   */\n  return function getMirror(keyArr, valueArr) {\n    if (!cache.get(keyArr)) {\n      cache.set(keyArr, new Map(Array.from(keyArr).reduce((acc, item, i) => acc.concat([[item, valueArr[i]]]), [])));\n    }\n    return cache.get(keyArr);\n  };\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createMirror);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priority-plus/utils/createMirror.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priority-plus/validation.js":
/*!*****************************************************!*\
  !*** ./src/scripts/nav/priority-plus/validation.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   throwValidation: () => (/* binding */ throwValidation),\n/* harmony export */   validateAndThrow: () => (/* binding */ validateAndThrow),\n/* harmony export */   validateInput: () => (/* binding */ validateInput),\n/* harmony export */   validateOptions: () => (/* binding */ validateOptions),\n/* harmony export */   validateTarget: () => (/* binding */ validateTarget)\n/* harmony export */ });\n/* eslint-disable */\n// @ts-nocheck\n\n/**\n * Joins an array of error messages into one message.\n */\nfunction throwValidation(errors) {\n  if (errors && errors.length) throw new Error(`\\n- ${errors.join('\\n- ')}`);\n}\n\n/**\n * Confirms the target DOM element is of the required type.\n */\nfunction validateTarget(targetElem) {\n  return [!(targetElem instanceof Element) && 'Target must be an HTMLElement.', (!targetElem.children || !targetElem.children.length) && 'Target must be the direct parent of the individual nav items.'].filter(Boolean);\n}\n\n/**\n * Confirms that the top-level options keys are valid. Does not check type.\n */\nfunction validateOptions(userOptions, defaultOptions) {\n  return Object.keys(userOptions).map(key => typeof defaultOptions[key] === 'undefined' ? `Unrecognised option: ${key}` : undefined).filter(Boolean);\n}\n\n/**\n * Collects validation messages into one array.\n */\nfunction validateInput(targetElem, userOptions, defaultOptions) {\n  return [...validateTarget(targetElem), ...validateOptions(userOptions, defaultOptions)];\n}\n\n/**\n * Throws an error if any error messages are returned from validation.\n */\nfunction validateAndThrow(targetElem, userOptions, defaultOptions) {\n  throwValidation(validateInput(targetElem, userOptions, defaultOptions));\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validateAndThrow);\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priority-plus/validation.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/priorityPlus.js":
/*!*****************************************!*\
  !*** ./src/scripts/nav/priorityPlus.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _priority_plus_priorityPlus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./priority-plus/priorityPlus */ \"./src/scripts/nav/priority-plus/priorityPlus.js\");\n\n\n/**\n * Initializes the navigation menu with priority plus functionality.\n * Collapses menu items if there are more than two.\n */\nconst menuPriority = () => {\n  // Initialize the navigation\n  const navElement = document.querySelector('.cu-nav__menu');\n\n  // If there's no navigation element, we don't need to run the rest of the script\n  if (navElement) {\n    const navMenu = navElement.querySelector('.p-plus__primary');\n\n    // If there's no nav menu or only one item in the nav menu, we don't need to run the rest of the script\n    if (navMenu && navMenu.children.length < 2) {\n      return;\n    }\n    (0,_priority_plus_priorityPlus__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(navElement, {\n      collapseAtCount: 2\n    });\n  }\n};\n\n// Run menuPriority on load\nmenuPriority();\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/priorityPlus.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/scrollingNav.js":
/*!*****************************************!*\
  !*** ./src/scripts/nav/scrollingNav.js ***!
  \*****************************************/
/***/ (() => {

eval("{/**\n * Initializes the scrolling navigation behavior for the header.\n * Adjusts the header's position based on scroll direction and screen width.\n */\nconst scrollingNav = () => {\n  /**\n   * The main header element.\n   * @type {HTMLElement | null}\n   */\n  const header = document.querySelector('.cu-header');\n  if (header) {\n    const navTop = document.querySelector('.cu-nav--top');\n    const navBottom = document.querySelector('.cu-nav--bottom');\n    const headerOffset = header.offsetHeight;\n\n    /**\n     * Tracks the last scroll position to determine scroll direction.\n     * @type {number}\n     */\n    let lastScrollTop = 0;\n    window.addEventListener('scroll', () => {\n      const windowWidth = window.innerWidth;\n      const newScrollTop = window.scrollY;\n      const raised = newScrollTop > lastScrollTop && newScrollTop > headerOffset;\n      const wpadminbar = document.getElementById('wpadminbar') || null;\n\n      /**\n       * The height of the top navigation bar, adjusted for other elements.\n       * @type {number | undefined}\n       */\n      let navTopHeight;\n      if (navTop) {\n        navTopHeight = navTop.offsetHeight;\n        if (wpadminbar) {\n          navTopHeight -= wpadminbar.offsetHeight;\n        }\n\n        /**\n         * The aside navigation element, used for small screens.\n         * @type {HTMLElement | null}\n         */\n        const navAside = document.querySelector('.cu-nav__aside');\n        if (windowWidth <= 640 && navAside) {\n          navTopHeight -= navAside.offsetHeight;\n        }\n        header.style.top = raised && windowWidth <= 640 ? `-${navTopHeight}px` : `${wpadminbar ? wpadminbar.offsetHeight : 0}px`;\n      }\n      if (navBottom) {\n        const navTopBar = document.querySelector('.cu-nav__top');\n        navTopHeight = navTopBar.offsetHeight;\n        if (wpadminbar) {\n          navTopHeight -= wpadminbar.offsetHeight;\n        }\n        header.style.top = raised ? `-${navTopHeight}px` : `${wpadminbar ? wpadminbar.offsetHeight : 0}px`;\n      }\n      lastScrollTop = newScrollTop;\n    });\n  }\n};\n\n/**\n * Initializes the scrolling navigation and adjusts the header position\n * if the page loads with an anchor link.\n */\ndocument.addEventListener('DOMContentLoaded', () => {\n  scrollingNav();\n  const header = document.querySelector('.cu-header');\n  const navTop = document.querySelector('.cu-nav--top');\n  const navBottom = document.querySelector('.cu-nav--bottom');\n  const wpadminbar = document.getElementById('wpadminbar') || null;\n  const windowWidth = window.innerWidth;\n  if (window.location.hash && header) {\n    /**\n     * The height of the top navigation bar, adjusted for other elements.\n     * @type {number}\n     */\n    let navTopHeight = 0;\n    if (navTop) {\n      navTopHeight = navTop.offsetHeight;\n      if (wpadminbar) navTopHeight -= wpadminbar.offsetHeight;\n      const navAside = document.querySelector('.cu-nav__aside');\n      if (windowWidth <= 640 && navAside) navTopHeight -= navAside.offsetHeight;\n      header.style.top = windowWidth <= 640 ? `-${navTopHeight}px` : `${wpadminbar ? wpadminbar.offsetHeight : 0}px`;\n    }\n    if (navBottom) {\n      const navTopBar = document.querySelector('.cu-nav__top');\n      navTopHeight = navTopBar.offsetHeight;\n      if (wpadminbar) navTopHeight -= wpadminbar.offsetHeight;\n      header.style.top = `-${navTopHeight}px`;\n    }\n  }\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/scrollingNav.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/titleLength.js":
/*!****************************************!*\
  !*** ./src/scripts/nav/titleLength.js ***!
  \****************************************/
/***/ (() => {

eval("{document.addEventListener('DOMContentLoaded', function () {\n  /**\n   * Site title element.\n   * @type {HTMLElement|null}\n   */\n  const siteTitle = document.getElementById('site-title');\n  if (!siteTitle) {\n    return;\n  }\n  /**\n   * Text content of the site title.\n   * @type {string}\n   */\n  const siteTitleText = siteTitle ? siteTitle.querySelector('a').innerText : '';\n  if (siteTitleText && siteTitleText.length > 25) {\n    // Create a temporary container to measure the text wrapping\n    const tempContainer = document.createElement('div');\n    tempContainer.style.position = 'absolute';\n    tempContainer.style.visibility = 'hidden';\n    tempContainer.style.whiteSpace = 'normal';\n    tempContainer.style.display = 'inline-block';\n\n    // Get the computed styles of the siteTitle element\n    const computedStyles = window.getComputedStyle(siteTitle);\n    tempContainer.style.fontSize = computedStyles.fontSize;\n    tempContainer.style.fontFamily = computedStyles.fontFamily;\n    tempContainer.style.lineHeight = computedStyles.lineHeight;\n    tempContainer.style.padding = computedStyles.padding;\n    tempContainer.style.border = computedStyles.border;\n    tempContainer.style.maxWidth = 'none';\n\n    // Set the inner text\n    tempContainer.innerText = siteTitleText;\n    document.body.appendChild(tempContainer);\n\n    // Initial width guess\n    let requiredWidth = tempContainer.offsetWidth / 1.8;\n    tempContainer.style.width = requiredWidth + 'px';\n\n    // Check if the height of the container fits within two lines\n    const lineHeight = parseFloat(computedStyles.lineHeight);\n    const maxHeight = lineHeight * 2;\n    while (tempContainer.offsetHeight > maxHeight) {\n      requiredWidth += 1;\n      tempContainer.style.width = requiredWidth + 'px';\n    }\n\n    // Apply the width as an inline style\n    siteTitle.style.maxWidth = requiredWidth + 'px';\n\n    // Remove the temporary container\n    document.body.removeChild(tempContainer);\n  }\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/titleLength.js?\n}");

/***/ }),

/***/ "./src/scripts/nav/topNavSearch.js":
/*!*****************************************!*\
  !*** ./src/scripts/nav/topNavSearch.js ***!
  \*****************************************/
/***/ (() => {

eval("{/**\n * Array of site search button elements.\n * @type {Element[]}\n */\nconst siteSearchButtons = document.getElementsByClassName('site-search');\nif (siteSearchButtons && siteSearchButtons.length) {\n  // Iterate over the NodeList with Array's forEach method\n  Array.from(siteSearchButtons).forEach(button => button.addEventListener('click', openModal));\n}\n\n/**\n * Search overlay element.\n * @type {HTMLElement|null}\n */\nconst searchOverlay = document.getElementById('search-overlay');\n\n/**\n * Opens the search modal overlay and focuses the input.\n */\nfunction openModal() {\n  if (searchOverlay) {\n    searchOverlay.style.display = 'flex';\n  }\n  document.addEventListener('keydown', closeOnEscape);\n  const searchInput = document.getElementById('searchform__input');\n  if (searchInput) {\n    searchInput.focus();\n  } else {\n    throw new Error(`Search input element with id \"searchform__input\" not found`);\n  }\n}\n\n/**\n * Closes the search modal overlay when Escape is pressed.\n * @param {KeyboardEvent} event - The keyboard event object.\n */\nfunction closeOnEscape(event) {\n  if (event.key === 'Escape') {\n    closeModal();\n  }\n}\n\n/**\n * Closes the search modal overlay and resets the input.\n */\nfunction closeModal() {\n  if (searchOverlay) {\n    searchOverlay.style.display = 'none';\n  }\n  document.removeEventListener('keydown', closeOnEscape);\n  const searchInput = document.getElementById('searchform__input');\n  if (searchInput) {\n    searchInput.value = '';\n    searchInput.blur();\n  }\n}\nif (searchOverlay) {\n  searchOverlay.addEventListener('click', event => {\n    if (event.target === searchOverlay) {\n      closeModal();\n    }\n  });\n}\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/nav/topNavSearch.js?\n}");

/***/ }),

/***/ "./src/scripts/signup.js":
/*!*******************************!*\
  !*** ./src/scripts/signup.js ***!
  \*******************************/
/***/ (() => {

eval("{/**\n * Signup form element.\n * @type {HTMLElement|null}\n */\nconst signupFormElement = document.getElementById('signup_form');\nif (signupFormElement) {\n  /**\n   * Handles the signup form submission, sends data via fetch, and updates UI based on response.\n   * @param {Event} event - The submit event object.\n   */\n  signupFormElement.addEventListener('submit', function (event) {\n    // Prevents the default form submission\n    event.preventDefault();\n\n    // Get form data\n    const formData = new FormData(event.target);\n\n    // Convert form data to a plain object\n    const formObject = {};\n    formData.forEach((value, key) => {\n      formObject[key] = value;\n    });\n\n    // Add data attribute value to the formObject\n    const submitButton = event.target.querySelector('button[type=\"submit\"]');\n    const customAttributeValue = submitButton.getAttribute('data-blog');\n    formObject.blog_id = customAttributeValue;\n\n    // Fetch API to submit the form data\n    fetch('/wp-json/cutheme/v1/signup', {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify(formObject)\n    }).then(response => {\n      if (response.ok) {\n        const signupForm = document?.getElementById('signup_form');\n        signupForm.classList.add('hidden');\n        const signupThanks = document?.getElementById('response_success');\n        signupThanks.classList.remove('hidden');\n      } else {\n        const signupForm = document?.getElementById('signup_form');\n        signupForm.classList.add('hidden');\n        const signupThanks = document?.getElementById('response_error');\n        signupThanks.classList.remove('hidden');\n      }\n      return response.json();\n    }).catch(() => {\n      const signupForm = document.getElementById('signup_form');\n      signupForm.classList.add('hidden');\n      const signupThanks = document.getElementById('response_message');\n      signupThanks.innerHTML = 'Error - Please contact site administrator';\n      signupThanks.classList.remove('hidden');\n    });\n  });\n}\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/signup.js?\n}");

/***/ }),

/***/ "./src/scripts/videoControls.js":
/*!**************************************!*\
  !*** ./src/scripts/videoControls.js ***!
  \**************************************/
/***/ (() => {

eval("{document.addEventListener('DOMContentLoaded', function () {\n  /**\n   * Array of all video elements with class 'cu-video'.\n   * @type {Array}\n   */\n  const videos = Array.from(document.getElementsByClassName('cu-video'));\n  if (!videos.length) {\n    return;\n  }\n  videos.forEach(video => {\n    video.load();\n\n    /**\n     * Parent section of the video element.\n     * @type {Element|null}\n     */\n    const parentSection = video.closest('section');\n\n    /**\n     * Play/pause button element for the video.\n     * @type {Element|null}\n     */\n    const playPauseButton = parentSection?.getElementsByClassName('cu-video-controls')[0];\n    if (!playPauseButton) {\n      throw new Error('Play/Pause button not found');\n    }\n\n    /**\n     * Updates the button state to reflect play or pause.\n     * @param {boolean} isPlaying - Whether the video is playing.\n     */\n    const toggleButtonState = isPlaying => {\n      playPauseButton.setAttribute('aria-label', isPlaying ? 'Pause video' : 'Play video');\n      playPauseButton.setAttribute('title', isPlaying ? 'Pause video' : 'Play video');\n    };\n\n    /**\n     * Handles play/pause toggle for the video.\n     */\n    const handlePlay = () => {\n      if (video.paused) {\n        video.play();\n        toggleButtonState(true);\n      } else {\n        video.pause();\n        toggleButtonState(false);\n      }\n    };\n    playPauseButton.addEventListener('click', handlePlay);\n  });\n});\n\n//# sourceURL=webpack://cutheme-twig/./src/scripts/videoControls.js?\n}");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./src/cutheme-scripts.js");
/******/ 	
/******/ })()
;