{"version":3,"file":"CustomSlider.js","names":["defineDs","defaultSettings","containerSelector","controls","enabled","next","previous","disabledClasses","elementClasses","active","passive","general","settings","center","enableMouseDrag","slideBy","maxGroupSize","Number","MAX_SAFE_INTEGER","CustomSlider","constructor","userSettings","_defineProperty","_containerSelector","_settings","_objectSpread","_controls","_elementClasses","_alignElementWithFirstSlide","alignElementWithFirstSlide","_init","_container","document","querySelector","HTMLElement","_alignElementWithSlides","_nextButton","_previousButton","console","error","_slides","querySelectorAll","length","_addEventListeners","_updateAttributes","_setControlClasses","_centerSlides","_currentPosition","forEach","element","i","id","classList","add","distanceToCenter","_sizes","container","width","left","elements","_index","_groupSize","right","style","transform","concat","_updateSizes","_calculateSizes","_calculateGroupSize","_setActiveClasses","_totalGroupWidth","Math","floor","spaceBetweenSlides","min","getBoundingClientRect","map","addEventListener","event","_handleTouchStart","_handleTouchEnd","_handleTouchMove","_handleMouseDown","window","_handleMouseUp","_handleMouseMove","_handleControlClick","resizeObserver","ResizeObserver","observe","parentElement","_movement","push","clientX","transitionDuration","_movementStartPosition","_isDragging","slide","remove","e","requestAnimationFrame","_touchMove","_lastMovementPosition","gestureDirection","_gestureDetection","newPosition","newIndex","_calculateNewPosition","moveDistance","at","_slide","_snap","_lastEvent","targetTouches","_touchAngleCoordinates","x","y","clientY","_touchAngleThresholdSurpassed","_touchAngle","_touchAngleMargin","_disableTransitions","touchAction","preventDefault","_enableTransitions","angle","c1","c2","c3","_angle","target","dist","elementWidth","_setTouchMovePercentage","_scaleValue","startingPosition","lastMovementPosition","diff","abs","snapIndex","closest","sliderParent","distanceToTarget","centerOfGroup","_availableSlides","direction","_this$_settings$slide","amountToSlide","endIndex","availableSlides","slideWidthWithSpace","emptySpace","scrollWidth","max","removeAttribute","_callOnSlide","onSlideCallback","callback","_onSlideCallback","indices","Array","ignore","isActive","hasNextSlides","hasPreviousSlides","onPercentageChange","_percentageChangeCallback","value","towards","awayFrom","_touchMovePercentage","_getDistance","sqrt","pow","a","b","c","rightSide","A","acos","PI","from","to","scale","capped"],"sources":["Common/Framework/Foundation.SharedScripts/Scripts/Libraries/CustomSlider.js"],"sourcesContent":["defineDs('Common/Framework/Foundation.SharedScripts/Scripts/Libraries/CustomSlider', [], function () {\r\n const defaultSettings = {\r\n containerSelector: '.slider-container',\r\n controls: {\r\n enabled: true,\r\n next: '.next',\r\n previous: '.previous',\r\n disabledClasses: []\r\n },\r\n elementClasses: {\r\n active: [],\r\n passive: [],\r\n general: []\r\n },\r\n settings: {\r\n center: true,\r\n enableMouseDrag: false, // BUGGED!!!\r\n slideBy: null, // Slides by as many as possible\r\n maxGroupSize: Number.MAX_SAFE_INTEGER\r\n }\r\n };\r\n\r\n /**\r\n * Creates an instance of the SliderBase class.\r\n * @class\r\n * @classdesc\r\n * SliderBase is a JavaScript class for creating sliders with various features\r\n * such as touch events, mouse drag, and navigation controls.\r\n *\r\n * @param {DefaultSettings} userSettings - User-defined settings to customize the slider.\r\n */\r\n return class CustomSlider {\r\n\r\n _currentPosition = 0;\r\n _touchMovePercentage = 0;\r\n _movementStartPosition = 0;\r\n _lastMovementPosition = 0;\r\n _movement = [];\r\n _isDragging = false;\r\n _groupSize = 0;\r\n _nextButton = null;\r\n _previousButton = null;\r\n _container = null;\r\n _alignElementWithSlides = null;\r\n _index = 0;\r\n _slides = [];\r\n _sizes = {};\r\n _settings = {};\r\n _controls = {};\r\n _elementClasses = {};\r\n _lastEvent = null;\r\n _touchAngleCoordinates = [];\r\n _touchAngleThresholdSurpassed = false;\r\n _touchAngleMargin = 30;\r\n _containerSelector = '';\r\n _totalGroupWidth = 0;\r\n _onSlideCallback = () => {\r\n };\r\n _percentageChangeCallback = () => {\r\n };\r\n\r\n\r\n constructor(userSettings) {\r\n this._containerSelector = userSettings.containerSelector || defaultSettings.containerSelector;\r\n this._settings = { ...defaultSettings.settings, ...userSettings.settings };\r\n this._controls = { ...defaultSettings.controls, ...userSettings.controls };\r\n this._elementClasses = { ...defaultSettings.elementClasses, ...userSettings.elementClasses };\r\n this._alignElementWithFirstSlide = userSettings.alignElementWithFirstSlide || defaultSettings.alignElementWithFirstSlide;\r\n this._init();\r\n\r\n }\r\n\r\n _init() {\r\n if (typeof this._containerSelector === 'string') {\r\n this._container = document.querySelector(this._containerSelector);\r\n } else if (this._containerSelector instanceof HTMLElement) {\r\n this._container = this._containerSelector;\r\n }\r\n if (typeof this._alignElementWithFirstSlide === 'string') {\r\n this._alignElementWithSlides = document.querySelector(this._alignElementWithFirstSlide);\r\n } else if (this._alignElementWithFirstSlide instanceof HTMLElement) {\r\n this._alignElementWithSlides = this._alignElementWithFirstSlide;\r\n }\r\n if (this._controls.enabled && this._controls.next && this._controls.previous) {\r\n // Next button\r\n if (typeof this._controls.next === 'string') {\r\n this._nextButton = document.querySelector(this._controls.next);\r\n } else if (this._controls.next instanceof HTMLElement) {\r\n this._nextButton = this._controls.next;\r\n }\r\n\r\n // previous button\r\n if (typeof this._controls.previous === 'string') {\r\n this._previousButton = document.querySelector(this._controls.previous);\r\n } else if (this._controls.previous instanceof HTMLElement) {\r\n this._previousButton = this._controls.previous;\r\n }\r\n }\r\n\r\n if (!this._container) {\r\n console.error('No container found');\r\n return;\r\n }\r\n\r\n this._slides = [...this._container.querySelectorAll(':scope > *')];\r\n\r\n if (!this._slides.length) {\r\n console.error('No elements found');\r\n return;\r\n }\r\n\r\n this._addEventListeners();\r\n this._updateAttributes();\r\n this._setControlClasses();\r\n if (this._settings.center) {\r\n this._centerSlides();\r\n } else {\r\n this._currentPosition = 0;\r\n }\r\n\r\n this._slides.forEach((element, i) => {\r\n element.id = '_' + i;\r\n element.classList.add(...this._elementClasses.general);\r\n });\r\n }\r\n\r\n _centerSlides() {\r\n const distanceToCenter = ((this._sizes.container.width / 2) + this._sizes.container.left) - ((this._sizes.elements[this._index].left + this._sizes.elements[this._index + this._groupSize - 1].right) / 2);\r\n this._currentPosition = distanceToCenter;\r\n this._container.style.transform = `translateX(${distanceToCenter}px)`;\r\n if (this._alignElementWithSlides) {\r\n this._alignElementWithSlides.style.transform = `translateX(${distanceToCenter}px)`;\r\n }\r\n }\r\n\r\n _updateAttributes() {\r\n this._updateSizes();\r\n this._calculateSizes();\r\n this._calculateGroupSize();\r\n if (this._settings.center) {\r\n this._centerSlides();\r\n }\r\n this._setActiveClasses();\r\n }\r\n\r\n _calculateGroupSize() {\r\n for (let i = this._slides.length; i > 0; i--) {\r\n this._totalGroupWidth = Math.floor((this._sizes.elements[0].width * i) + (this._sizes.spaceBetweenSlides * (i - 1)));\r\n if (this._totalGroupWidth <= this._sizes.container.width) {\r\n this._groupSize = Math.min(i, this._settings.maxGroupSize);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n _updateSizes() {\r\n this._sizes.container = this._container.getBoundingClientRect();\r\n this._sizes.container.center = (this._sizes.container.width / 2) + this._sizes.container.left;\r\n this._sizes.elements = this._slides.map((element) => element.getBoundingClientRect());\r\n }\r\n\r\n _addEventListeners() {\r\n this._container.addEventListener('touchstart', (event) => this._handleTouchStart(event), { passive: false });\r\n this._container.addEventListener('touchend', (event) => this._handleTouchEnd(event), { passive: false });\r\n this._container.addEventListener('touchmove', (event) => this._handleTouchMove(event), { passive: false });\r\n\r\n if (this._settings.enableMouseDrag) {\r\n this._container.addEventListener('mousedown', (event) => this._handleMouseDown(event));\r\n window.addEventListener('mouseup', (event) => this._handleMouseUp(event));\r\n window.addEventListener('mousemove', (event) => this._handleMouseMove(event));\r\n }\r\n if (this._controls.enabled) {\r\n this._nextButton.addEventListener('click', () => this._handleControlClick('next'));\r\n this._previousButton.addEventListener('click', () => this._handleControlClick('previous'));\r\n }\r\n window.addEventListener('resize', () => this._updateAttributes());\r\n // eslint-disable-next-line compat/compat\r\n const resizeObserver = new ResizeObserver(() => this._updateAttributes());\r\n resizeObserver.observe(this._container.parentElement);\r\n }\r\n\r\n // -- Mouse events --\r\n _handleMouseDown(event) {\r\n this._movement.push(event.clientX);\r\n this._container.style.transitionDuration = 'unset';\r\n this._movementStartPosition = event.clientX;\r\n this._isDragging = true;\r\n\r\n }\r\n\r\n _handleMouseMove(event) {\r\n this._movement.push(event.clientX);\r\n if (!this._isDragging) return;\r\n this._slides.forEach((slide) => {\r\n slide.classList.add('pointer-events-none');\r\n slide.classList.remove('pointer-events-auto');\r\n slide.querySelectorAll(':scope *').forEach((e) => {\r\n e.classList.add('select-none');\r\n e.classList.add('pointer-events-none');\r\n e.classList.remove('pointer-events-auto');\r\n });\r\n });\r\n requestAnimationFrame(() => this._touchMove());\r\n\r\n }\r\n\r\n _handleMouseUp() {\r\n this._isDragging = false;\r\n this._slides.forEach((slide) => {\r\n slide.classList.add('pointer-events-auto');\r\n slide.classList.remove('pointer-events-none');\r\n slide.querySelectorAll(':scope *').forEach((e) => {\r\n e.classList.remove('select-none');\r\n e.classList.remove('pointer-events-none');\r\n e.classList.add('pointer-events-auto');\r\n });\r\n });\r\n this._currentPosition = this._lastMovementPosition;\r\n this._container.style.transitionDuration = '';\r\n\r\n const gestureDirection = this._gestureDetection();\r\n\r\n if (gestureDirection) {\r\n let { newPosition, newIndex } = this._calculateNewPosition(gestureDirection);\r\n const moveDistance = this._movement.at(-1) - this._movement.at(0);\r\n this._slide(newPosition - moveDistance, newIndex);\r\n } else {\r\n this._snap();\r\n }\r\n\r\n this._movement = [];\r\n }\r\n\r\n // -- Touch events --\r\n _handleTouchStart(event) {\r\n this._lastEvent = event;\r\n this._movementStartPosition = event.targetTouches[0].clientX;\r\n this._lastMovementPosition = this._currentPosition;\r\n this._movement.push(event.targetTouches[0].clientX);\r\n }\r\n\r\n\r\n _handleTouchMove(event) {\r\n this._lastEvent = event;\r\n this._touchAngleCoordinates.push({ x: event.targetTouches[0].clientX, y: event.targetTouches[0].clientY });\r\n this._touchAngleThresholdSurpassed = this._touchAngleThresholdSurpassed || (this._touchAngle() && (this._touchAngle() > 90 - this._touchAngleMargin && this._touchAngle() < 90 + this._touchAngleMargin));\r\n if (this._touchAngleThresholdSurpassed) {\r\n this._touchAngleThresholdSurpassed = true;\r\n this._disableTransitions();\r\n this._container.style.touchAction = 'none';\r\n event.preventDefault();\r\n\r\n if (this._isDragging) return;\r\n requestAnimationFrame(() => this._touchMove());\r\n\r\n this._isDragging = true;\r\n }\r\n }\r\n\r\n _handleTouchEnd(event) {\r\n if (!this._touchAngleThresholdSurpassed) {\r\n this._touchAngleCoordinates = [];\r\n this._movement = [];\r\n return;\r\n }\r\n event.preventDefault();\r\n this._isDragging = false;\r\n this._enableTransitions();\r\n\r\n const gestureDirection = this._gestureDetection();\r\n\r\n if (gestureDirection) {\r\n let { newPosition, newIndex } = this._calculateNewPosition(gestureDirection);\r\n this._slide(newPosition, newIndex);\r\n } else {\r\n // this._lastMovementPosition = (this._movement[this._movement.length - 1] - this._movementStartPosition) + this._currentPosition;\r\n this._snap();\r\n }\r\n\r\n this._container.style.touchAction = 'auto';\r\n this._touchAngleThresholdSurpassed = false;\r\n this._touchAngleCoordinates = [];\r\n this._movement = [];\r\n }\r\n\r\n _touchAngle() {\r\n let angle = null;\r\n if (this._touchAngleCoordinates.length >= 2) {\r\n const c1 = this._touchAngleCoordinates[0];\r\n const c2 = this._touchAngleCoordinates[1];\r\n const c3 = { x: this._touchAngleCoordinates[0].x, y: this._touchAngleCoordinates[1].y };\r\n\r\n angle = this._angle(c1, c2, c3);\r\n }\r\n\r\n return angle;\r\n }\r\n\r\n\r\n _touchMove() {\r\n if (!this._isDragging) return;\r\n\r\n\r\n this._movement.push(this._lastEvent.targetTouches[0].clientX);\r\n const target = (this._movement.at(-1) - this._movementStartPosition) + this._currentPosition;\r\n const dist = target - this._lastMovementPosition;\r\n this._lastMovementPosition = this._lastMovementPosition + dist;\r\n this._container.style.transform = `translateX(${this._lastMovementPosition}px)`;\r\n\r\n const elementWidth = this._sizes.elements[0].width;\r\n this._setTouchMovePercentage = this._scaleValue(\r\n this._lastMovementPosition,\r\n [this._currentPosition - elementWidth, this._currentPosition + elementWidth],\r\n [-100, 100]\r\n ) * -1;\r\n\r\n requestAnimationFrame(() => this._touchMove());\r\n }\r\n\r\n _gestureDetection() {\r\n const startingPosition = this._movementStartPosition;\r\n const lastMovementPosition = this._movement.at(-1);\r\n const diff = startingPosition - lastMovementPosition;\r\n return Math.abs(diff) > 50 ? (diff < 0 ? 'previous' : 'next') : 'null';\r\n\r\n }\r\n\r\n _snap() {\r\n this._updateSizes();\r\n let snapIndex = 0;\r\n let closest = Number.MAX_SAFE_INTEGER;\r\n const sliderParent = this._container.parentElement.getBoundingClientRect();\r\n for (let i = 0; i < this._slides.length; i++) {\r\n if (i + this._groupSize - 1 > this._slides.length - 1) break;\r\n let distanceToTarget;\r\n if (this._settings.center) {\r\n const centerOfGroup = (this._sizes.elements[i].left + this._sizes.elements[i + this._groupSize - 1].right) / 2;\r\n distanceToTarget = ((sliderParent.width / 2) + sliderParent.left) - centerOfGroup;\r\n } else {\r\n distanceToTarget = sliderParent.left - this._sizes.elements[i].left;\r\n }\r\n if (Math.abs(distanceToTarget) < Math.abs(closest)) {\r\n closest = distanceToTarget;\r\n snapIndex = i;\r\n }\r\n }\r\n\r\n const newPosition = this._lastMovementPosition + closest;\r\n this._slide(newPosition, snapIndex);\r\n }\r\n\r\n _availableSlides(direction) {\r\n let amountToSlide = 0;\r\n if (direction === 'next') {\r\n const endIndex = this._index + this._groupSize - 1;\r\n const availableSlides = this._slides.length - endIndex - 1;\r\n amountToSlide = Math.min(this._groupSize, availableSlides);\r\n } else if (direction === 'previous') {\r\n amountToSlide = Math.min(this._groupSize, this._index);\r\n }\r\n\r\n return Math.min(amountToSlide, this._settings.slideBy ?? this._groupSize);\r\n }\r\n\r\n _handleControlClick(direction) {\r\n if ((direction === 'next' && this._index + this._groupSize > this._slides.length - 1)\r\n || (direction === 'previous' && this._index === 0)) {\r\n return;\r\n }\r\n\r\n\r\n const { newPosition, newIndex } = this._calculateNewPosition(direction);\r\n\r\n this._slide(newPosition, newIndex);\r\n }\r\n\r\n _calculateNewPosition(direction) {\r\n // Calculate how many slides lies outside the container\r\n const availableSlides = this._availableSlides(direction);\r\n const newPosition = ((this._sizes.slideWidthWithSpace * this._availableSlides(direction)) * (direction === 'next' ? -1 : 1)) + this._currentPosition;\r\n const newIndex = this._index + (direction === 'next' ? availableSlides : -availableSlides);\r\n return { newPosition, newIndex };\r\n }\r\n\r\n _calculateSizes() {\r\n const emptySpace = this._container.scrollWidth - (this._sizes.elements[0].width * this._slides.length);\r\n const spaceBetweenSlides = emptySpace / Math.max(this._slides.length - 1, 1); // -1 because the last element shouldn't have any space\r\n const slideWidthWithSpace = (this._sizes.elements[0].width + spaceBetweenSlides);\r\n this._sizes.spaceBetweenSlides = spaceBetweenSlides;\r\n this._sizes.spaceBetweenSlides = spaceBetweenSlides;\r\n this._sizes.slideWidthWithSpace = slideWidthWithSpace;\r\n }\r\n\r\n _slide(newPosition, newIndex) {\r\n this._slides.forEach((slide) => {\r\n slide.removeAttribute('style');\r\n });\r\n this._container.style.transform = `translateX(${newPosition}px)`;\r\n this._currentPosition = newPosition;\r\n this._index = newIndex;\r\n this._setActiveClasses();\r\n this._setControlClasses();\r\n this._callOnSlide();\r\n }\r\n\r\n set onSlideCallback(callback) {\r\n this._onSlideCallback = callback;\r\n }\r\n\r\n _callOnSlide() {\r\n const indices = [...Array(this._groupSize)].map((ignore, i) => this._index + i);\r\n const elements = [...Array(this._groupSize)].map((ignore, i) => this._index + i);\r\n\r\n this._onSlideCallback(indices, elements);\r\n }\r\n\r\n _setActiveClasses() {\r\n\r\n this._slides.forEach((element, i) => {\r\n const isActive = i >= this._index && i <= this._index + this._groupSize - 1;\r\n element.classList[isActive ? 'add' : 'remove'](...this._elementClasses.active);\r\n element.classList[isActive ? 'remove' : 'add'](...this._elementClasses.passive);\r\n });\r\n }\r\n\r\n _disableTransitions() {\r\n this._container.style.transitionDuration = 'unset';\r\n this._slides.forEach((slide) => {\r\n slide.style.transitionDuration = 'unset';\r\n });\r\n }\r\n\r\n _enableTransitions() {\r\n this._container.style.transitionDuration = '';\r\n this._slides.forEach((slide) => {\r\n slide.style.transitionDuration = '';\r\n });\r\n }\r\n\r\n _setControlClasses() {\r\n if (!this._controls.enabled) return;\r\n\r\n const hasNextSlides = !!this._availableSlides('next');\r\n const hasPreviousSlides = !!this._availableSlides('previous');\r\n this._nextButton.classList[!hasNextSlides ? 'add' : 'remove'](...this._controls.disabledClasses);\r\n this._previousButton.classList[!hasPreviousSlides ? 'add' : 'remove'](...this._controls.disabledClasses);\r\n }\r\n\r\n // Callbacks\r\n\r\n set onPercentageChange(callback) {\r\n this._percentageChangeCallback = callback;\r\n }\r\n\r\n set _setTouchMovePercentage(value) {\r\n const towards = this._index + (value > 0 ? this._groupSize : -1);\r\n const awayFrom = this._index + (value > 0 ? 0 : this._groupSize - 1);\r\n if (value !== this._touchMovePercentage) this._percentageChangeCallback(value, towards, awayFrom);\r\n this._touchMovePercentage = value;\r\n }\r\n\r\n // Helpers\r\n _getDistance(c1, c2) {\r\n return Math.abs(Math.sqrt(Math.pow((c1.x - c2.x), 2) + Math.pow((c1.y - c2.y), 2)));\r\n }\r\n\r\n _angle(c1, c2, c3) {\r\n const a = this._getDistance(c2, c3);\r\n const b = this._getDistance(c1, c3);\r\n const c = this._getDistance(c1, c2);\r\n\r\n const rightSide = 2 * b * c !== 0 ? 2 * b * c : 1;\r\n\r\n const A = ((b ** 2) + (c ** 2) - (a ** 2)) / rightSide;\r\n\r\n const angle = Math.acos(A);\r\n return (angle * (180 / Math.PI));\r\n }\r\n\r\n _scaleValue(value, from, to) {\r\n const scale = (to[1] - to[0]) / (from[1] - from[0]);\r\n const capped = Math.min(from[1], Math.max(from[0], value)) - from[0];\r\n return Math.floor((capped * scale) + to[0]);\r\n }\r\n };\r\n});\r\n\r\n\r\n"],"mappings":";;;;;AAAAA,QAAQ,CAAC,0EAA0E,EAAE,EAAE,EAAE,YAAY;EACnG,IAAMC,eAAe,GAAG;IACtBC,iBAAiB,EAAE,mBAAmB;IACtCC,QAAQ,EAAE;MACRC,OAAO,EAAE,IAAI;MACbC,IAAI,EAAE,OAAO;M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