{"version":3,"file":"index-B6cDyY2l.js","sources":["../../../../Client/src/modules/website/embla/embla-dot-button.ts","../../../../Client/src/modules/website/embla/embla-tween-opacity.ts","../../../../Client/src/modules/website/embla/embla-arrow-buttons.ts"],"sourcesContent":["import type { EmblaCarouselType } from 'embla-carousel'\r\n\r\nexport const addDotBtnsAndClickHandlers = (\r\n emblaApi: EmblaCarouselType,\r\n dotsNode: HTMLElement,\r\n): (() => void) => {\r\n let dotNodes: HTMLElement[] = []\r\n\r\n const addDotBtnsWithClickHandlers = (): void => {\r\n dotsNode.innerHTML = emblaApi\r\n .scrollSnapList()\r\n .map(\r\n () =>\r\n ``,\r\n )\r\n .join('')\r\n\r\n const scrollTo = (index: number): void => {\r\n emblaApi.scrollTo(index)\r\n }\r\n\r\n dotNodes = Array.from(dotsNode.querySelectorAll('.embla__dot'))\r\n dotNodes.forEach((dotNode, index) => {\r\n dotNode.addEventListener('click', () => scrollTo(index), false)\r\n })\r\n }\r\n\r\n const activeClass = ['w-6', 'h-2', 'bg-primary']\r\n const inActiveClass = ['size-2', 'bg-lightGrey']\r\n\r\n const toggleDotBtnsActive = (): void => {\r\n const previous = emblaApi.previousScrollSnap()\r\n const selected = emblaApi.selectedScrollSnap()\r\n\r\n const previousDotNode = dotNodes[previous]\r\n\r\n if (!previousDotNode) return\r\n\r\n dotNodes[previous].classList.remove('embla__dot--selected')\r\n dotNodes[previous].classList.remove(...activeClass)\r\n dotNodes[previous].classList.add(...inActiveClass)\r\n dotNodes[selected].classList.remove(...inActiveClass)\r\n dotNodes[selected].classList.add('embla__dot--selected')\r\n dotNodes[selected].classList.add(...activeClass)\r\n }\r\n\r\n emblaApi\r\n .on('init', addDotBtnsWithClickHandlers)\r\n .on('reInit', addDotBtnsWithClickHandlers)\r\n .on('init', toggleDotBtnsActive)\r\n .on('reInit', toggleDotBtnsActive)\r\n .on('select', toggleDotBtnsActive)\r\n\r\n return (): void => {\r\n dotsNode.innerHTML = ''\r\n }\r\n}\r\n","import type { EmblaCarouselType } from 'embla-carousel'\r\n\r\nconst tweenOpacity = (emblaApi: EmblaCarouselType): void => {\r\n const slideNodes = emblaApi.slideNodes()\r\n const selectedIndex = emblaApi.selectedScrollSnap()\r\n\r\n slideNodes.forEach((slide, index) => {\r\n const setOpacity = index === selectedIndex ? 1 : 0.15\r\n slide.style.transition = 'opacity 0.4s ease'\r\n slide.style.opacity = setOpacity.toString()\r\n })\r\n}\r\n\r\nexport const setupTweenOpacity = (emblaApi: EmblaCarouselType) => {\r\n const slideNodes = emblaApi.slideNodes()\r\n\r\n tweenOpacity(emblaApi)\r\n\r\n emblaApi\r\n .on('reInit', tweenOpacity)\r\n .on('scroll', () => tweenOpacity(emblaApi))\r\n .on('select', () => tweenOpacity(emblaApi))\r\n\r\n return () => {\r\n slideNodes.forEach((slide) => slide.removeAttribute('style'))\r\n }\r\n}\r\n","import type { EmblaCarouselType } from 'embla-carousel'\r\n\r\nconst addTogglePrevNextBtnsActive = (\r\n emblaApi: EmblaCarouselType,\r\n prevBtn: HTMLElement,\r\n nextBtn: HTMLElement,\r\n) => {\r\n const togglePrevNextBtnsState = () => {\r\n if (emblaApi.canScrollPrev()) prevBtn.removeAttribute('disabled')\r\n else prevBtn.setAttribute('disabled', 'disabled')\r\n\r\n if (emblaApi.canScrollNext()) nextBtn.removeAttribute('disabled')\r\n else nextBtn.setAttribute('disabled', 'disabled')\r\n }\r\n\r\n emblaApi\r\n .on('select', togglePrevNextBtnsState)\r\n .on('init', togglePrevNextBtnsState)\r\n .on('reInit', togglePrevNextBtnsState)\r\n\r\n return () => {\r\n prevBtn.removeAttribute('disabled')\r\n nextBtn.removeAttribute('disabled')\r\n }\r\n}\r\n\r\nexport const addPrevNextBtnsClickHandlers = (\r\n emblaApi: EmblaCarouselType,\r\n prevBtn: HTMLElement,\r\n nextBtn: HTMLElement,\r\n) => {\r\n const scrollPrev = () => {\r\n emblaApi.scrollPrev()\r\n }\r\n const scrollNext = () => {\r\n emblaApi.scrollNext()\r\n }\r\n prevBtn.addEventListener('click', scrollPrev, false)\r\n nextBtn.addEventListener('click', scrollNext, false)\r\n\r\n const removeTogglePrevNextBtnsActive = addTogglePrevNextBtnsActive(emblaApi, prevBtn, nextBtn)\r\n\r\n return () => {\r\n removeTogglePrevNextBtnsActive()\r\n prevBtn.removeEventListener('click', scrollPrev, false)\r\n nextBtn.removeEventListener('click', scrollNext, false)\r\n }\r\n}\r\n"],"names":["addDotBtnsAndClickHandlers","emblaApi","dotsNode","dotNodes","addDotBtnsWithClickHandlers","scrollTo","index","dotNode","activeClass","inActiveClass","toggleDotBtnsActive","previous","selected","tweenOpacity","slideNodes","selectedIndex","slide","setOpacity","setupTweenOpacity","addTogglePrevNextBtnsActive","prevBtn","nextBtn","togglePrevNextBtnsState","addPrevNextBtnsClickHandlers","scrollPrev","scrollNext","removeTogglePrevNextBtnsActive"],"mappings":"AAEa,MAAAA,EAA6B,CACtCC,EACAC,IACe,CACf,IAAIC,EAA0B,CAAA,EAE9B,MAAMC,EAA8B,IAAY,CACnCF,EAAA,UAAYD,EAChB,eACA,EAAA,IACG,IACI,0SAAA,EAEP,KAAK,EAAE,EAEN,MAAAI,EAAYC,GAAwB,CACtCL,EAAS,SAASK,CAAK,CAAA,EAG3BH,EAAW,MAAM,KAAKD,EAAS,iBAAiB,aAAa,CAAC,EACrDC,EAAA,QAAQ,CAACI,EAASD,IAAU,CACjCC,EAAQ,iBAAiB,QAAS,IAAMF,EAASC,CAAK,EAAG,EAAK,CAAA,CACjE,CAAA,EAGCE,EAAc,CAAC,MAAO,MAAO,YAAY,EACzCC,EAAgB,CAAC,SAAU,cAAc,EAEzCC,EAAsB,IAAY,CAC9B,MAAAC,EAAWV,EAAS,qBACpBW,EAAWX,EAAS,qBAEFE,EAASQ,CAAQ,IAIzCR,EAASQ,CAAQ,EAAE,UAAU,OAAO,sBAAsB,EAC1DR,EAASQ,CAAQ,EAAE,UAAU,OAAO,GAAGH,CAAW,EAClDL,EAASQ,CAAQ,EAAE,UAAU,IA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