{"version":3,"sources":["webpack://frontendplaceholder/./Src/Scripts/components/ensemble-header.js"],"names":["Swiper","use","Navigation","constructor","elm","swiper","querySelectorAll","forEach","x","addEventListener","querySelector","classList","remove","add","slidesPerView","spaceBetween","watchSlidesVisibility","watchOverflow","navigation","nextEl","prevEl","active","slide","parentNode","parent","index","Array","prototype","indexOf","call","children","slideTo","Math","max","initSwiper"],"mappings":"wMAAA,M,wbAAA,U,+HACAA,UAAOC,IAAI,CAACC,e,UAEG,MACXC,YAAYC,GACR,IAAIC,EAEJD,EAAIE,iBAAiB,qCAAqCC,SAAQC,GAAKA,EAAEC,iBAAiB,SAAS,KAAM,MACrG,UAAAL,EAAIM,cAAc,sDAAlB,SAAkEC,UAAUC,OAAO,aACnFJ,EAAEG,UAAUE,IAAI,kBAGD,MACf,IAAKR,EAAQ,CACTA,EAAS,IAAIL,UAAOI,EAAK,CACrBU,cAAe,OACfC,aAAc,GACdC,uBAAuB,EACvBC,eAAe,EACfC,WAAY,CACRC,OAAQ,sBACRC,OAAQ,yBAIhB,MAAMC,EAASjB,EAAIM,cAAc,+CACjC,GAAIW,EAAQ,CACR,MAAMC,EAAQD,EAAOE,WACfC,EAASF,EAAMC,WACfE,EAAQC,MAAMC,UAAUC,QAAQC,KAAKL,EAAOM,SAAUR,GAAS,EACrEjB,EAAO0B,QAAQC,KAAKC,IAAI,EAAGR,GAAQ,GAAG,MAKlDS","file":"7636.84055a91a99f41674cac.js","sourcesContent":["import Swiper, { Navigation } from 'swiper';\nSwiper.use([Navigation]);\n\nexport default class EnsembleHeader {\n constructor(elm) {\n let swiper;\n\n elm.querySelectorAll('.ensemble-header__subheader__link').forEach(x => x.addEventListener('click', () => {\n elm.querySelector('.ensemble-header__subheader__link.semi-bold')?.classList.remove('semi-bold');\n x.classList.add('semi-bold');\n }));\n\n const initSwiper = () => {\n if (!swiper) {\n swiper = new Swiper(elm, {\n slidesPerView: 'auto',\n spaceBetween: 15,\n watchSlidesVisibility: true,\n watchOverflow: true,\n navigation: {\n nextEl: '.swiper-button-next',\n prevEl: '.swiper-button-prev',\n },\n });\n\n const active = elm.querySelector('.ensemble-header__subheader__link.semi-bold');\n if (active) {\n const slide = active.parentNode;\n const parent = slide.parentNode;\n const index = Array.prototype.indexOf.call(parent.children, slide) - 1;\n swiper.slideTo(Math.max(0, index), 0, false);\n }\n }\n };\n\n initSwiper();\n }\n}\n"],"sourceRoot":""}