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IAElB,OAAO,qBAAuB,GAG9B,OAAO,mBAAmB,KAAK,CAC7B,OACA,MAAO,IACL,IAEE,EAAgB,EAGhB,MAAM,EAAqB,EACxB,KAAI,GAAgB,EAAa,wBACjC,QAAO,GAAW,UAGf,QAAQ,IAAI,GAGlB,IACA,GACF,CAAE,MAAO,GAEP,IACA,GACF,IAEF,IAzTN,WAEE,EAAc,SAAQ,IAEpB,EAAa,QAAO,KAElB,GAA4B,GAC5B,IAIJ,SAAS,iBAAiB,UAAW,IAC/B,EAAE,OAAO,QAAQ,+CACnB,GACF,IAIF,SAAS,iBAAiB,SAAU,IAClC,GAAI,EAAE,OAAO,QAAQ,gFACjB,EAAE,OAAO,QAAQ,+EAAgF,CAEnG,MAAM,EAAc,SAAS,cAAc,2DAEvC,IACF,EAAY,QAEZ,YAAW,IAAM,KAAuB,KAE5C,KAIF,SAAS,iBAAiB,SAAU,KACnB,EAAE,OAAO,QAAQ,2DAA6D,EAAE,OAChF,EAAE,OAAO,QAAQ,6DAI9B,YAAW,IAAM,KAAuB,IAC1C,IAIF,MAAM,EAAkC,oBAAV,MAAwB,MAAM,SAAW,SAAS,EAAM,GACpF,IAAI,EACJ,OAAO,YAA6B,GAKlC,aAAa,GACb,EAAU,YALI,KACZ,aAAa,GACb,KAAQ,EAAK,GAGa,EAC9B,CACF,EAEA,OAAO,iBAAiB,SAAU,GAAe,KAC/C,IACA,GAAyB,GACxB,KACL,CAqRE,GACA,IAGA,YAAW,IAAM,KAA2B,KAG5C,YAAW,IAAM,KAAuB,KAExC,GAAgB,EAClB,CAG4B,YAAxB,SAAS,WACX,SAAS,iBAAiB,mBAAoB,GAE9C,GAIH,CAxiBD","file":"/gh/calhow/Imperial-Corporate-Events@master/filters.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/calhow/Imperial-Corporate-Events@master/filters.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// FINSWEET ATTRIBUTES V2 FILTER - SIMPLIFIED VERSION\n\n// Initialize immediately without waiting for fsAttributes\n(function() {\n  'use strict';\n\n  // State management\n  let activeFilters = {};\n  let isInitialized = false;\n  let listInstances = [];\n  let isUnderlineAnimating = false;\n  let pendingUnderlineUpdate = false;\n\n\n        \n  // Get active filters from Finsweet's reactive state\n  function getActiveFilters() {\n    const filters = {};\n    \n    // Extract filters from all list instances\n    listInstances.forEach(listInstance => {\n      const finsweetFilters = listInstance.filters.value;\n      \n      // Process each filter group\n      finsweetFilters.groups.forEach(group => {\n        group.conditions.forEach(condition => {\n          // Only include conditions that the user has interacted with\n          if (!condition.interacted) return;\n          \n          const categoryLower = condition.fieldKey.toLowerCase();\n          const values = Array.isArray(condition.value) ? condition.value : [condition.value];\n          \n          values.forEach(value => {\n            if (value && value !== 'Radio' && value !== 'on' && value !== '') {\n              if (!filters[categoryLower]) {\n                filters[categoryLower] = [];\n              }\n              \n              filters[categoryLower].push({\n                originalValue: value,\n                displayValue: categoryLower === \"months\" ? value.replace(/\\s+\\d{4}$/, \"\").trim() : value,\n              });\n            }\n          });\n        });\n      });\n    });\n    \n    return filters;\n  }\n\n  // Update active filter display\n  function updateActiveFiltersDisplay() {\n    activeFilters = getActiveFilters();\n    \n    const displayElements = document.querySelectorAll(\"[data-active-filters]\");\n    displayElements.forEach(element => {\n      const filterGroup = element.getAttribute(\"data-active-filters\").toLowerCase();\n      const filterValues = activeFilters[filterGroup] || [];\n\n      const activeFiltersText = filterValues.map(item => item.displayValue).join(\", \");\n\n      const defaultText = {\n        area: \"Anywhere\",\n        months: \"Anytime\", \n        category: \"Anything\",\n      };\n\n      const displayText = activeFiltersText || defaultText[filterGroup] || \"\";\n      element.textContent = displayText;\n      element.classList.toggle(\"is-active\", filterValues.length > 0);\n    });\n\n    // Update clear buttons\n    const clearButtons = document.querySelectorAll(\"[data-filter-clear]\");\n    clearButtons.forEach(button => {\n      const filterGroup = button.getAttribute(\"data-filter-clear\").toLowerCase();\n      const hasActiveFilters = activeFilters[filterGroup] && activeFilters[filterGroup].length > 0;\n      \n      button.style.display = hasActiveFilters ? \"flex\" : \"none\";\n    });\n\n    // Update clear all button\n    const clearAllButton = document.querySelector('[data-filter-clear-all=\"true\"]');\n    if (clearAllButton) {\n      const hasAnyActiveFilters = [\"area\", \"months\", \"category\", \"theme\"].some(\n        group => activeFilters[group] && activeFilters[group].length > 0\n      );\n      clearAllButton.classList.toggle(\"is-active\", hasAnyActiveFilters);\n    }\n\n    // Update mobile clear wrap\n    const mobileClearWrap = document.querySelector('[data-filter-mobile-clear-wrap]');\n    if (mobileClearWrap) {\n      const hasAnyActiveFilters = [\"area\", \"months\", \"category\"].some(\n        group => activeFilters[group] && activeFilters[group].length > 0\n      );\n      const isMobile = window.innerWidth <= 991;\n      const isFilterModalOpen = window.modalStates && window.modalStates['filter'];\n      mobileClearWrap.style.display = (hasAnyActiveFilters && isMobile && !isFilterModalOpen) ? \"flex\" : \"none\";\n    }\n  }\n\n  // Update underline position for theme tabs\n  function updateUnderlinePosition() {\n    // If already animating, queue an update to run after current animation completes\n    if (isUnderlineAnimating) {\n      pendingUnderlineUpdate = true;\n      return;\n    }\n    \n    // Clear any pending flag since we're running now\n    pendingUnderlineUpdate = false;\n    \n    // Use requestAnimationFrame to ensure layout is complete\n    requestAnimationFrame(() => {\n      let checkedRadio = document.querySelector(\".form_theme-radio_wrap input:checked\");\n      const fillElement = document.querySelector(\".form_theme_underline_fill\");\n      \n      // Fallback to first radio if none is checked\n      if (!checkedRadio) {\n        const firstRadioWrap = document.querySelector(\".form_theme-radio_wrap:first-child\");\n        if (firstRadioWrap) {\n          checkedRadio = firstRadioWrap.querySelector('input[type=\"radio\"]');\n        }\n      }\n      \n      if (!checkedRadio || !fillElement) {\n        return;\n      }\n      \n      // Find the radio wrapper and underline element within it\n      const radioWrap = checkedRadio.closest('.form_theme-radio_wrap');\n      const targetUnderline = radioWrap.querySelector('.form_theme-tab_underline');\n      \n      if (!targetUnderline) {\n        return;\n      }\n      \n      // Force a reflow to ensure accurate measurements\n      radioWrap.offsetHeight;\n      \n      // Get the width of the radio wrapper\n      const radioWrapRect = radioWrap.getBoundingClientRect();\n      const radioWrapWidth = radioWrapRect.width;\n      \n      // Ensure we have a valid width before proceeding\n      if (radioWrapWidth <= 0) {\n        setTimeout(() => updateUnderlinePosition(), 50);\n        return;\n      }\n      \n      // Use GSAP Flip for smooth animation if available\n      if (typeof gsap !== 'undefined' && gsap.registerPlugin && typeof Flip !== 'undefined') {\n        // Mark as animating\n        isUnderlineAnimating = true;\n        \n        // Kill any existing animations on fillElement to prevent conflicts\n        gsap.killTweensOf(fillElement);\n        \n        // Record the current state\n        const state = Flip.getState(fillElement);\n        \n        // Make DOM changes - move element AND set target width\n        targetUnderline.appendChild(fillElement);\n        fillElement.style.width = `${radioWrapWidth}px`;\n        \n        // Use Flip to animate from previous state to current state\n        Flip.from(state, {\n          duration: window.innerWidth >= 992 ? 0.4 : 0.3,\n          ease: \"power1.out\",\n          absolute: true,\n          onComplete: () => {\n            isUnderlineAnimating = false;\n            \n            // If an update was queued during this animation, run it now\n            if (pendingUnderlineUpdate) {\n              pendingUnderlineUpdate = false;\n              setTimeout(() => updateUnderlinePosition(), 0);\n            }\n          }\n        });\n      } else if (typeof gsap !== 'undefined') {\n        // Fallback GSAP animation without Flip\n        gsap.set(fillElement, { clearProps: \"all\" });\n        targetUnderline.appendChild(fillElement);\n        fillElement.style.width = `${radioWrapWidth}px`;\n      } else {\n        // Fallback without GSAP\n        fillElement.style.transform = '';\n        fillElement.style.transition = 'width 0.3s ease';\n        targetUnderline.appendChild(fillElement);\n        fillElement.style.width = `${radioWrapWidth}px`;\n      }\n    });\n  }\n\n  // Setup reactive listeners using Finsweet's system\n  function setupEventListeners() {\n    // Setup reactive watching for filter changes\n    listInstances.forEach(listInstance => {\n      // Watch for filter changes and update display\n      listInstance.effect(() => {\n        // This runs whenever filters change\n        updateActiveFiltersDisplay();\n      });\n    });\n\n    // Theme radio changes for underline\n    document.addEventListener('change', (e) => {\n      if (e.target.matches('.form_theme-radio_wrap input[type=\"radio\"]')) {\n        updateUnderlinePosition();\n      }\n    });\n\n    // External clear all buttons\n    document.addEventListener('click', (e) => {\n      if (e.target.matches('[data-filter-empty-clear-all=\"true\"], [data-filter-mobile-clear-all=\"true\"]') || \n          e.target.closest('[data-filter-empty-clear-all=\"true\"], [data-filter-mobile-clear-all=\"true\"]')) {\n        \n        const clearButton = document.querySelector('[fs-list-element=\"clear\"][data-filter-clear-all=\"true\"]');\n        \n        if (clearButton) {\n          clearButton.click();\n          // Navigate to active tab after filters are cleared\n          setTimeout(() => navigateToActiveTab(), 100);\n        }\n      }\n    });\n\n    // Direct clear all button clicks\n    document.addEventListener('click', (e) => {\n      const target = e.target.matches('[fs-list-element=\"clear\"][data-filter-clear-all=\"true\"]') ? e.target : \n                     e.target.closest('[fs-list-element=\"clear\"][data-filter-clear-all=\"true\"]');\n      \n      if (target) {\n        // Navigate to active tab after filters are cleared\n        setTimeout(() => navigateToActiveTab(), 100);\n      }\n    });\n\n    // Resize handler\n    const resizeDebounce = typeof Utils !== 'undefined' ? Utils.debounce : function(func, wait) {\n      let timeout;\n      return function executedFunction(...args) {\n        const later = () => {\n          clearTimeout(timeout);\n          func(...args);\n        };\n        clearTimeout(timeout);\n        timeout = setTimeout(later, wait);\n      };\n    };\n    \n    window.addEventListener('resize', resizeDebounce(() => {\n      updateActiveFiltersDisplay();\n      updateUnderlinePosition();\n    }, 100));\n  }\n\n  // Initialize filter row activation\n  function setupFilterRows() {\n    document.addEventListener('click', (e) => {\n      const element = e.target.closest('[data-filter-row], [data-filter-button]');\n      if (!element) return;\n\n      const targetAttribute = element.getAttribute('data-filter-row') || element.getAttribute('data-filter-button');\n      if (targetAttribute) {\n        const activeRow = document.querySelector('[data-filter-row].is-active');\n        if (activeRow) activeRow.classList.remove('is-active');\n\n        const targetRow = document.querySelector(`[data-filter-row=\"${targetAttribute}\"]`);\n        if (targetRow) targetRow.classList.add('is-active');\n      }\n    });\n  }\n\n  // Updates swiper container classes based on nav button states to control their visibility\n  function updateSwiperClasses() {\n    const swiperContainer = document.querySelector(\".form_theme-tab_wrap\");\n    const nextButton = document.querySelector(\n      '[data-swiper-btn-filter=\"next\"]'\n    );\n    const prevButton = document.querySelector(\n      '[data-swiper-btn-filter=\"prev\"]'\n    );\n\n    if (!swiperContainer || !nextButton || !prevButton) return;\n\n    swiperContainer.classList.remove(\"is-next\", \"is-both\", \"is-prev\");\n\n    const isNextDisabled = nextButton.classList.contains(\n      \"theme_btn_wrap_disabled\"\n    );\n    const isPrevDisabled = prevButton.classList.contains(\n      \"theme_btn_wrap_disabled\"\n    );\n\n    if (!isNextDisabled && !isPrevDisabled) {\n      swiperContainer.classList.add(\"is-both\");\n    } else if (isNextDisabled && !isPrevDisabled) {\n      swiperContainer.classList.add(\"is-prev\");\n    } else if (isPrevDisabled && !isNextDisabled) {\n      swiperContainer.classList.add(\"is-next\");\n    }\n  }\n\n  // Store swiper instance globally for navigation\n  let themeSwiperInstance = null;\n\n  // Navigate to the active theme tab (responsive: Swiper for desktop, scroll for mobile)\n  function navigateToActiveTab() {\n    // Find the active theme tab (checked radio button)\n    let checkedRadio = document.querySelector('.form_theme-radio_wrap input:checked');\n    \n    // Fallback: If no radio is checked, check the first one (All experiences)\n    if (!checkedRadio) {\n      const firstRadioWrap = document.querySelector('.form_theme-radio_wrap:first-child');\n      if (firstRadioWrap) {\n        const firstRadio = firstRadioWrap.querySelector('input[type=\"radio\"]');\n        if (firstRadio) {\n          firstRadio.checked = true;\n          checkedRadio = firstRadio;\n        }\n      }\n      \n      if (!checkedRadio) {\n        return;\n      }\n    }\n\n    const radioWrap = checkedRadio.closest('.form_theme-radio_wrap');\n    const isMobile = window.innerWidth <= 992;\n\n    if (isMobile) {\n      // Mobile: Use scroll positioning to center the active tab\n      const scrollContainer = document.querySelector('.form_theme-tab_list');\n      \n      if (!scrollContainer) {\n        return;\n      }\n\n      // Get container and tab measurements\n      const containerWidth = scrollContainer.clientWidth;\n      const containerScrollWidth = scrollContainer.scrollWidth;\n      const tabLeft = radioWrap.offsetLeft;\n      const tabWidth = radioWrap.offsetWidth;\n      \n      // Calculate scroll position to center the tab\n      const centerPosition = tabLeft + (tabWidth / 2) - (containerWidth / 2);\n      const maxScrollPosition = containerScrollWidth - containerWidth;\n      const scrollPosition = Math.max(0, Math.min(centerPosition, maxScrollPosition));\n      \n      // Use smooth scroll to center the active tab\n      scrollContainer.scrollTo({\n        left: scrollPosition,\n        behavior: 'smooth'\n      });\n      \n    } else {\n      // Desktop: Use Swiper navigation\n      if (!themeSwiperInstance) {\n        return;\n      }\n\n      // Find the slide index of the active tab\n      const allSlides = document.querySelectorAll('.form_theme-tab_item');\n      let activeSlideIndex = -1;\n\n      allSlides.forEach((slide, index) => {\n        if (slide.contains(radioWrap)) {\n          activeSlideIndex = index;\n        }\n      });\n\n      if (activeSlideIndex >= 0) {\n        // Calculate target slide index with offset for better visibility\n        let targetSlideIndex;\n        \n        if (activeSlideIndex === 0) {\n          // If it's the first slide, stay at first slide\n          targetSlideIndex = 0;\n        } else if (activeSlideIndex === allSlides.length - 1) {\n          // If it's the last slide, stay at last slide\n          targetSlideIndex = activeSlideIndex;\n        } else {\n          // Navigate to the slide before the active one for better visibility\n          targetSlideIndex = activeSlideIndex - 1;\n        }\n        \n        // Use slideTo to navigate to the calculated target slide\n        themeSwiperInstance.slideTo(targetSlideIndex, 300, false);\n      }\n    }\n  }\n\n  // Initialize swiper for theme filters using UniversalSwiperManager\n  function setupSwiper() {\n    if (typeof Swiper === 'undefined' || !window.UniversalSwiperManager) return;\n\n    const swiperContainer = document.querySelector(\".form_theme-tab_wrap\");\n    if (!swiperContainer) return;\n\n    // Create swiper manager instance for theme filters\n    const themeSwiperManager = window.UniversalSwiperManager.createManager({\n      name: 'theme-filters',\n      desktopBreakpoint: 991,\n      buttonWrapperSelector: 'data-swiper-combo',\n      swiperConfigs: [{\n        selector: '.form_theme-tab_wrap',\n        comboClass: 'theme-filter',\n        wrapperClass: \"form_theme-tab_list\",\n        slideClass: \"form_theme-tab_item\",\n        navigation: {\n          nextEl: '[data-swiper-btn-filter=\"next\"]',\n          prevEl: '[data-swiper-btn-filter=\"prev\"]',\n          disabledClass: \"theme_btn_wrap_disabled\",\n        },\n        slidesPerView: \"auto\",\n        slidesPerGroup: 1,\n        watchSlidesProgress: true,\n        resistanceRatio: 0.85,\n        freeMode: true,\n        watchOverflow: true,\n        on: {\n          init: function() {\n            // Store the swiper instance globally\n            themeSwiperInstance = this;\n            updateSwiperClasses.call(this);\n            // Update underline position after Swiper is fully initialized\n            setTimeout(() => updateUnderlinePosition(), 100);\n          },\n          navigationNext: updateSwiperClasses,\n          navigationPrev: updateSwiperClasses,\n          transitionEnd: updateSwiperClasses,\n          reachBeginning: updateSwiperClasses,\n          reachEnd: updateSwiperClasses,\n        }\n      }],\n      initializeSwiper: (config) => {\n        return new Swiper(config.selector, config);\n      }\n    });\n\n    // Initialize the manager\n    themeSwiperManager.setupResizeListener();\n  }\n\n  // Add this function to inject empty facet styles after Finsweet initialization\n  function injectEmptyFacetStyles() {\n    // Check if styles already exist\n    const existingStyles = document.querySelector('[data-empty-facet-styles=\"true\"]');\n    if (existingStyles) {\n      return;\n    }\n    \n    const styles = `\n      .is-list-emptyfacet, .is-list-emptyfacet * {\n        pointer-events: none !important;\n        cursor: default !important;\n      }\n\n      .form_checkbox_row.is-active {\n        cursor: default !important;\t\n      }\n\n      .form_filters_item.is-list-emptyfacet, .form_theme-tab_item.is-list-emptyfacet {\n        transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);  \n        opacity: 0.3;\n        filter: grayscale(1);\n      }\n    `;\n\n    // Create and inject the style element\n    const styleElement = document.createElement('style');\n    styleElement.setAttribute('data-empty-facet-styles', 'true');\n    styleElement.textContent = styles;\n    document.head.appendChild(styleElement);\n  }\n\n  // Detect when Finsweet has finished initialization\n  function waitForFinsweetInitialization() {\n    return new Promise((resolve) => {\n      // Initialize FinsweetAttributes if not already present\n      window.FinsweetAttributes ||= [];\n      \n      // Push a callback to run when list attribute is loaded\n      window.FinsweetAttributes.push([\n        'list',\n        async (finsweetListInstances) => {\n          try {\n            // Store list instances for reactive watching\n            listInstances = finsweetListInstances;\n            \n            // Wait for all list instances to finish loading paginated items\n            const paginationPromises = listInstances\n              .map(listInstance => listInstance.loadingPaginatedItems)\n              .filter(promise => promise); // Filter out undefined promises\n            \n            // Wait for all pagination promises to resolve\n            await Promise.all(paginationPromises);\n            \n            // Inject empty facet styles once everything is ready\n            injectEmptyFacetStyles();\n            resolve();\n          } catch (error) {\n            // Inject styles anyway to prevent blocking\n            injectEmptyFacetStyles();\n            resolve();\n          }\n        },\n      ]);\n    });\n  }\n\n  // Initialize everything\n  async function init() {\n    if (isInitialized) return;\n        \n    // Check for required elements\n    const listElement = document.querySelector('[fs-list-element=\"list\"]');\n    const filtersElement = document.querySelector('[fs-list-element=\"filters\"]');\n    \n    if (!listElement || !filtersElement) {\n      return;\n    }\n    \n    // Setup immediate visual elements (no dependency on Finsweet)\n    setupFilterRows();\n    setupSwiper();\n    \n    // Wait for Finsweet initialization, then setup reactive functionality\n    await waitForFinsweetInitialization();\n    \n    // Setup reactive functionality AFTER Finsweet is ready\n    setupEventListeners();\n    updateActiveFiltersDisplay();\n    \n    // Set initial underline position AFTER everything is ready\n    setTimeout(() => updateUnderlinePosition(), 100);\n    \n    // Navigate swiper to active tab if one is set via URL parameters\n    setTimeout(() => navigateToActiveTab(), 150);\n    \n    isInitialized = true;\n  }\n\n  // Initialize when DOM is ready\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', init);\n  } else {\n    init();\n  }\n\n\n})();\n"]}