/* Scoped to: history-template-header */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="history-template-header"]');
  componentRoots.forEach(function(componentRoot) {
    // Helper to query within component, with fallback to document for sibling elements
    var $ = function(sel) { 
      return componentRoot.querySelector(sel) || document.querySelector('[data-component-slug="history-template-header"] ~ ' + sel) || document.querySelector(sel);
    };
    var $$ = function(sel) { 
      var results = componentRoot.querySelectorAll(sel);
      return results.length ? results : document.querySelectorAll(sel);
    };
    // Original component JS runs in this scope
    (function () { const toggleBtn = document.getElementById("menuToggleBtn"); const mobileMenu = document.getElementById("mobileMenu"); toggleBtn?.addEventListener("click", () => { mobileMenu.classList.toggle("max-h-0"); mobileMenu.classList.toggle("max-h-[520px]"); }); document.querySelectorAll(".mobile-link").forEach((link) => { link.addEventListener("click", () => { mobileMenu.classList.add("max-h-0"); mobileMenu.classList.remove("max-h-[520px]"); }); }); const currentPath = window.location.pathname.replace(/\/$/, "").split("/").pop(); document.querySelectorAll(".nav-link, .mobile-link").forEach((link) => { const href = link.getAttribute("href")?.replace(/\/$/, ""); if (href === currentPath || (href === "home" && currentPath === "")) { link.classList.add("active"); } }); })();
  });
})();