1import{p as r}from"./helpers.CgdXwOqr.bundle.js";import"./properties.CqifW_FM.bundle.js";import"./environments.D5Xaw-5B.bundle.js";const s={MEGA_MENU:".complement-mega-menu",MEGA_MENU_BTN:"#HeaderMenu-shop a"};class M{init(){this.startProductEvents(),this.addMegaMenuHandlers(),this.fixPromoBars()}fixPromoBars(){const e=document.querySelector(".event-bar"),t=document.querySelector(".section-additional-bar"),n=document.querySelector(".section-timer-event"),i=document.querySelector(".section-header");e&&i.classList.add("event-bar-space"),e&&t&&t.classList.add("event-bar-space"),n&&t&&t.classList.add("timer-event-space")}startProductEvents(){r()==="product"&&this.startMegaMenuEvents()}startMegaMenuEvents(){const e=document.querySelector(s.MEGA_MENU);e&&window.addEventListener("scroll",()=>this.changeMenuPosition(e,{minHeight:90}))}changeMenuPosition(e,t={minHeight:0}){const{minHeight:n}=t;window.scrollY>n?e.classList.add("active"):e.classList.remove("active")}addMegaMenuHandlers(){const e=document.querySelector(s.MEGA_MENU_BTN),t=document.querySelector(s.MEGA_MENU);e&&(e.addEventListener("click",this.onClick.bind(this)),e.addEventListener("mouseover",this.showMegaMenu.bind(this)),t.addEventListener("mouseover",()=>t.setAttribute("data-mouse-entered",!0)),t.addEventListener("mouseleave",this.hideMegaMenu.bind(this)))}showMegaMenu(){const e=document.querySelector(s.MEGA_MENU),t=document.querySelector(s.MEGA_MENU_BTN);e&&(e.classList.add("is-shown"),e.setAttribute("aria-hidden",!1),t.setAttribute("aria-expanded",!0),document.addEventListener("keydown",n=>{n.key==="Escape"&&this.hideMegaMenu(n,!0)}))}hideMegaMenu(e,t=!1){const n=document.querySelector(s.MEGA_MENU),i=document.querySelector(s.MEGA_MENU_BTN);if(!n)return;(n.getAttribute("data-mouse-entered")==="true"&&!t||t===!0)&&(n.setAttribute("data-mouse-entered",!1),n.classList.remove("is-shown"),n.setAttribute("aria-hidden",!0),i.setAttribute("aria-expanded",!1))}onClick(e){e.preventDefault();const t=document.querySelector(s.MEGA_MENU);if(!t)return;t.classList.contains("is-shown")?this.hideMegaMenu(e,!0):this.showMegaMenu()}}export{M as H};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.