{"version":3,"file":"zodiac.min.js","sources":["../src/eventBus.ts","../src/options.ts","../src/components/componentBase.ts","../src/utilities.ts","../src/components/autoplay.ts","../src/components/controls.ts","../src/components/itemState.ts","../src/components/liveRegion.ts","../src/components/track.ts","../src/components/drag.ts","../src/zodiac.ts"],"sourcesContent":["/**\n * Defines a zodiac slider event.\n */\nexport interface EventInterface {\n /**\n * The callback function for the event.\n */\n callback: CallableFunction;\n\n /**\n * The name of the event.\n */\n name: string;\n}\n\n/**\n * Provides an event bus for tracking slider related events.\n */\nexport class EventBus {\n\n /**\n * A list of subscribed events.\n */\n protected events: EventInterface[];\n\n constructor() {\n this.events = [];\n }\n\n /**\n * Emits events by name with arguments for the callback function.\n *\n * @param names - The event names to emit.\n * @param args - Arguments for the callback function.\n */\n public emit(names: string[], ...args: unknown[]): void {\n names.forEach((name) => {\n this.filterByName(name).forEach((event) => {\n event.callback(...args);\n });\n });\n }\n\n /**\n * Unsubscribes event(s) by name(s).\n *\n * @param names - A list of event names to unsubscribe.\n */\n public off(names: string[]): void {\n for (const name of names) {\n this.events = this.events.filter((event) => event.name !== name);\n }\n }\n\n /**\n * Subscribes an event with a callback function.\n *\n * @param names - A list of event names to subscribe to.\n * @param callback - A callback function to run on the events.\n */\n public on(names: string[], callback: CallableFunction): void {\n names.forEach((name) => this.events.push({name, callback}));\n }\n\n /**\n * Filter events by name.\n *\n * @param name - The name to filter by.\n *\n * @returns The result event set.\n */\n protected filterByName(name: string): EventInterface[] {\n return this.events.filter((event) => event.name === name);\n }\n\n}\n","import { EventBus } from './eventBus';\n\n/**\n * A collection of classes used by the slider to identify specific elements.\n *\n * These classes cannot be set in the media query options.\n */\nexport interface ClassesInterface {\n\n /**\n * The class used for the inner slider container.\n */\n inner?: string;\n\n /**\n * The class used by the slider items.\n */\n items?: string;\n\n /**\n * The class for the track slider div surrounding the items.\n */\n track?: string;\n\n}\n\n/**\n * A collection of options used to configure the slider.\n */\nexport interface OptionsInterface {\n\n /**\n * Whether or not the slider should autoplay.\n */\n autoplay?: boolean;\n\n /**\n * The delay before the carousel will transition.\n */\n autoplaySpeed?: number;\n\n /**\n * A collection of classes used by the slider to identify specific elements.\n *\n * These classes cannot be set in the media query options.\n */\n classes?: ClassesInterface;\n\n /**\n * Enables the live region element.\n */\n enableLiveRegion?: boolean;\n\n /**\n * The gap between slides.\n */\n gap?: number;\n\n /**\n * Allows to slider to transition endlessly.\n */\n infiniteScrolling?: boolean;\n\n /**\n * The total number of items to display per view.\n */\n itemsPerView?: number;\n\n /**\n * A template that is used for the live region's text.\n *\n * The following patterns will be replaced programmatically:\n * - `@position` - The position of the active slider item.\n * - `@total` - The total number of slider items\n * - `@title` - The title of the slider item. The title is derived from the\n * `data-zodiac-live-region-title` attribute within or on an item.\n */\n liveRegionText?: string;\n\n /**\n * The media queries configured with options.\n */\n mediaQueryLists?: {\n\n [key: string]: MediaQueryList;\n\n };\n\n /**\n * A collection of options applied at the specific media query.\n */\n mediaQueryOptions?: MediaQueryOptionsInterface;\n\n /**\n * Whether or not autoplay should pause on hover.\n */\n pauseOnHover?: boolean;\n\n /**\n * The speed at which slides will transition.\n */\n transitionSpeed?: number;\n\n}\n\n/**\n * A collection of options applied at the specific media query.\n */\nexport interface MediaQueryOptionsInterface {\n\n [key: string]: OptionsInterface;\n\n}\n\n/**\n * The media queries configured with options.\n */\nexport interface MediaQueryListsInterface {\n\n /**\n * The `MediaQueryList` for the supplied options.\n */\n mediaQueryList: MediaQueryList;\n\n /**\n * The options for the provided `MediaQueryList`.\n */\n options: OptionsInterface;\n}\n\n/**\n * An object used to configure the slider.\n */\nexport class Options {\n\n /**\n * The base options unrestricted by any media query.\n */\n protected baseOptions: OptionsInterface = {\n autoplay: true,\n autoplaySpeed: 5000,\n classes: {\n inner: 'zodiac-inner',\n items: 'zodiac-item',\n track: 'zodiac-track',\n },\n enableLiveRegion: true,\n gap: 8,\n infiniteScrolling: true,\n itemsPerView: 5,\n liveRegionText: 'Slide @position of @total @title',\n pauseOnHover: true,\n transitionSpeed: 500,\n };\n\n /**\n * The active options based on the computed media queries.\n */\n protected effectiveOptions: OptionsInterface;\n\n /**\n * The event bus.\n *\n * The event bus is used to notify when a media query has changed.\n */\n protected eventBus: EventBus;\n\n /**\n * The media queries configured with options.\n */\n protected mediaQueryLists: MediaQueryListsInterface[] = [];\n\n /**\n * A collection of options applied at the specific media query.\n */\n protected mediaQueryOptions: MediaQueryOptionsInterface = {};\n\n /**\n * Constructs a slider option set.\n *\n * A default set of options is used if no user options are provided.\n *\n * @throws {@link TypeError}\n * Throws an error if the `classes`, `enableLiveRegion` or `liveRegionText`\n * options are found in the `mediaQueryOptions`.\n *\n * @param eventBus - The event bus.\n * @param options - The user supplied options.\n */\n public constructor(eventBus: EventBus, options: OptionsInterface = {}) {\n this.eventBus = eventBus;\n\n // Override the default base options with those provided by the user.\n Object.assign(this.baseOptions, options);\n\n // Check if any media query options were provided.\n if (options.mediaQueryOptions) {\n const mediaQueryOptions = options.mediaQueryOptions;\n\n for (const [mediaQuery, mediaQueryOptionSet] of Object.entries(mediaQueryOptions)) {\n if (mediaQueryOptionSet) {\n const mediaQueryList = matchMedia(mediaQuery);\n\n this.validateMediaQueryOptions(mediaQueryOptionSet);\n\n this.mediaQueryLists.push({\n mediaQueryList,\n options: mediaQueryOptionSet,\n });\n\n mediaQueryList.addEventListener('change', () => {\n this.rebuildEffectiveOptions();\n });\n }\n }\n }\n\n this.rebuildEffectiveOptions();\n }\n\n /**\n * Gets the effective options.\n *\n * @returns The effective options.\n */\n public getEffectiveOptions(): OptionsInterface {\n return this.effectiveOptions;\n }\n\n /**\n * Rebuilds the effective options.\n *\n * If there are any matching media query options, they will override the base\n * options.\n */\n protected rebuildEffectiveOptions() {\n this.eventBus.emit(['rebuildEffectiveOptions.before']);\n\n const effectiveOptions = Object.assign({}, this.baseOptions);\n\n for (const list of this.mediaQueryLists) {\n if (list.mediaQueryList.matches) {\n Object.assign(effectiveOptions, list.options);\n }\n }\n\n this.effectiveOptions = Object.freeze(effectiveOptions);\n\n this.eventBus.emit(['rebuildEffectiveOptions.after']);\n }\n\n /**\n * Checks the media query options for invalid properties.\n *\n * @throws {@link TypeError}\n * Throws an error if the `classes`, `enableLiveRegion` or `liveRegionText`\n * options are found in the `mediaQueryOptions`.\n */\n protected validateMediaQueryOptions(options: OptionsInterface) {\n const invalidOptions = [\n 'classes',\n 'enableLiveRegion',\n 'infiniteScrolling',\n 'liveRegionText',\n ];\n\n invalidOptions.forEach((invalidOption) => {\n if (Object.hasOwnProperty.call(options, invalidOption)) {\n throw new TypeError(`The ${invalidOption} property can only be set once.`);\n }\n });\n }\n\n}\n","import { OptionsInterface } from '../options';\n\nimport Zodiac from '../zodiac';\n\n/**\n * Defines the structure of a component.\n *\n * Components in Zodiac are used to compartmentalize specific areas of concern\n * within the slider. Functionality that is common between all components is\n * placed in the base `Zodiac` instance.\n */\nexport interface ComponentInterface {\n\n /**\n * Mounts the component to the slider.\n */\n mount(zodiac: Zodiac): void;\n\n}\n\n/**\n * A base implementation of ComponentInterface.\n * @api\n */\nexport abstract class ComponentBase implements ComponentInterface {\n\n /**\n * The slider's options.\n */\n protected options: OptionsInterface;\n\n /**\n * The slider instance.\n */\n protected zodiac: Zodiac;\n\n /**\n * {@inheritDoc ComponentInterface.mount}\n */\n public mount(zodiac: Zodiac): void {\n this.zodiac = zodiac;\n this.options = this.zodiac.getEffectiveOptions();\n }\n\n}\n\n// The constructor for the `UpdateEffectiveOptions` mixin. The `any` type is\n// required for the mixin's constructor.\n// @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype UpdateEffectiveOptionsConstructor = new (...args: any[]) => ComponentBase;\n\n/**\n * A mixin that rebuilds the options when they are changed.\n *\n * @returns A mixin that rebuilds the effective options.\n */\nexport function UpdateEffectiveOptions<TBase extends UpdateEffectiveOptionsConstructor>(Base: TBase) {\n return class UpdatingEffectiveOptions extends Base {\n\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n this.zodiac.getEventBus().on(['rebuildEffectiveOptions.after'], () => {\n this.zodiac.getEventBus().emit(['updateEffectiveOptions.before']);\n this.options = this.zodiac.getEffectiveOptions();\n this.zodiac.getEventBus().emit(['updateEffectiveOptions.after']);\n });\n }\n\n };\n}\n","/**\n * A collection of static helper methods.\n */\nexport class Utilities {\n\n /**\n * CSS selectors for focusable elements.\n */\n public static readonly focusableSelectors = [\n '* a',\n '* area',\n '* input',\n '* select',\n '* textarea',\n '* button',\n '* iframe',\n '* object',\n '* embed',\n '* *[tabindex]',\n '* *[contenteditable]',\n ];\n\n /**\n * Generates an array of numbers starting at a given position.\n *\n * @param size - The size of the array to generate.\n * @param startAt - The position to start at.\n *\n * @returns The generated array.\n */\n public static range(size: number, startAt = 0): number[] {\n return [...Array(size).keys()].map((index) => index + startAt);\n }\n\n}\n","import Zodiac from '../zodiac';\n\nimport { ComponentBase } from './componentBase';\nimport { Utilities } from '../utilities';\n\n/**\n * Adds autoplay capabilities to the slider.\n *\n * When mounted, this component will have the following possible side effects:\n * - Auto-rotation will be started (if configured correctly)\n * - Auto-rotation will be paused when the slider is being dragged\n * - Auto-rotation will be paused when a focusable element is focused\n * - Auto-rotation will be conditionally paused when hovering over the slider\n *\n * @see Utilities.focusableSelectors\n * For a description of what qualifies as a \"focusable\" element.\n */\nexport class Autoplay extends ComponentBase {\n\n /**\n * The autoplay interval ID.\n */\n protected interval: NodeJS.Timeout;\n\n /**\n * An `AbortController` for resetting the mouse events in `this.pauseOnHover()`.\n */\n protected abortController: AbortController;\n\n /**\n * {@inheritDoc ComponentBase.mount}\n */\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n this.abortController = new AbortController();\n\n this.start();\n this.pauseOnDrag();\n this.pauseOnFocus();\n this.pauseOnHover();\n\n // Reconfigure autoplay and pause on hover configuration when the options\n // are rebuilt.\n this.zodiac.getEventBus().on(['updateEffectiveOptions.after'], () => {\n this.abortController.abort();\n\n this.abortController = new AbortController();\n\n this.stop();\n this.start();\n this.pauseOnHover();\n });\n }\n\n /**\n * Pauses the slider's auto-rotation when the slider is being dragged.\n */\n protected pauseOnDrag(): void {\n this.zodiac.getEventBus().on(['drag.before'], () => {\n this.stop();\n });\n\n this.zodiac.getEventBus().on(['drag.after'], () => {\n this.start();\n });\n }\n\n /**\n * Pauses the slider's auto-rotation when any focusable element is focused.\n */\n protected pauseOnFocus(): void {\n const focusableSelectors = Utilities.focusableSelectors.join(', ');\n const focusable = this.zodiac.getSliderElement().querySelectorAll<HTMLElement>(focusableSelectors);\n\n focusable.forEach((element) => {\n element.addEventListener('focusin', () => this.stop());\n element.addEventListener('focusout', () => this.start());\n });\n }\n\n /**\n * Pauses the slider's auto-rotation on hover (if applicable).\n *\n * If `pauseOnHover` is true, the slider's auto-rotation will be stopped when\n * the user's cursor enters the slider element, then resumed when it leaves.\n */\n protected pauseOnHover(): void {\n if (!this.options.pauseOnHover) {\n // This is a no-op method if pause on hover is not enabled.\n return;\n }\n\n const sliderElement = this.zodiac.getSliderElement();\n\n sliderElement.addEventListener('mouseenter', () => {\n this.stop();\n }, { signal: this.abortController.signal });\n sliderElement.addEventListener('mouseleave', () => {\n this.start();\n }, { signal: this.abortController.signal });\n }\n\n /**\n * Auto-rotates the slider using the configured interval.\n */\n protected start(): void {\n const { autoplay, autoplaySpeed } = this.options;\n\n // Check if autoplay is enabled with a positive interval duration.\n if (autoplay && autoplaySpeed > 0) {\n // Prevent multiple autoplay intervals from occurring simultaneously.\n this.stop();\n\n // Create an interval to continuously switch to the next item on a delay.\n this.interval = setInterval(() => {\n this.zodiac.getEventBus().emit(['autoplay.before']);\n this.zodiac.next();\n this.zodiac.getEventBus().emit(['autoplay.after']);\n }, autoplaySpeed);\n }\n }\n\n /**\n * Stops the slider's auto-rotation (if applicable).\n */\n protected stop(): void {\n clearInterval(this.interval);\n }\n\n}\n","import Zodiac from '../zodiac';\n\nimport { ComponentBase } from './componentBase';\n\n/**\n * Adds UI control capabilities to the slider.\n */\nexport class Controls extends ComponentBase {\n\n /**\n * {@inheritDoc ComponentBase.mount}\n */\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n this.setUpControls();\n }\n\n /**\n * Attaches navigation buttons to the next & previous slider controls.\n */\n protected setUpControls(): void {\n // Create a flag that will disable control movement, if the slider is\n // transitioning.\n let allowMove = true;\n\n const eventBus = this.zodiac.getEventBus();\n eventBus.on(['transitionDuration.before'], () => allowMove = false);\n eventBus.on(['transitionDuration.after'], () => allowMove = true);\n\n const sliderElement = this.zodiac.getSliderElement();\n\n const nextBtn = sliderElement.querySelector('[data-zodiac-direction=\"right\"]');\n\n if (nextBtn) {\n nextBtn.addEventListener('click', () => {\n if (allowMove) {\n this.zodiac.next();\n }\n });\n }\n\n const prevBtn = sliderElement.querySelector('[data-zodiac-direction=\"left\"]');\n\n if (prevBtn) {\n prevBtn.addEventListener('click', () => {\n if (allowMove) {\n this.zodiac.previous();\n }\n });\n }\n }\n\n}\n","import Zodiac from '../zodiac';\n\nimport { ComponentBase } from './componentBase';\nimport { Utilities } from '../utilities';\n\n/**\n * Keeps the state of each item updated.\n */\nexport class ItemState extends ComponentBase {\n\n /**\n * The class that indicates an item is active.\n */\n protected readonly activeClass = 'active';\n\n /**\n * {@inheritDoc ComponentBase.mount}\n */\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n this.setActiveClass();\n this.setAccessibilityAttributes();\n this.setInitialItemState();\n this.adjustItemStateOnMove();\n }\n\n /**\n * Adds the active class to an item.\n *\n * @param item - The element to apply the active class to.\n */\n protected addActiveClassToItem(item: HTMLElement): void {\n item.classList.add(this.activeClass);\n }\n\n /**\n * Adjusts each item's state by listening to slider events.\n */\n protected adjustItemStateOnMove(): void {\n this.zodiac.getEventBus().on([\n 'move.after',\n 'drag.after',\n ], () => {\n this.setActiveClass();\n this.setAccessibilityAttributes();\n });\n }\n\n /**\n * Removes the active class from each item in the slider.\n */\n protected removeActiveClass(): void {\n this.zodiac.getItems().forEach((item) => item.classList.remove(this.activeClass));\n }\n\n /**\n * Applies the appropriate attributes for accessibility to each item.\n *\n * Items that aren't currently visible will be set as hidden (using\n * `aria-hidden`) and have a negative tab index applied to them.\n */\n protected setAccessibilityAttributes(): void {\n const { itemsPerView } = this.options;\n const position = this.zodiac.getPosition();\n\n // Compute a range of visible slide positions based on the the number of\n // items per view and the current position.\n const visibleRange = Utilities.range(itemsPerView, position);\n\n this.zodiac.getItems().forEach((item, index) => {\n const visible = visibleRange.includes(index);\n\n // This value must be converted to a string since `setAttribute()`\n // expects `value` to be a string.\n const ariaHidden = (!visible).toString();\n\n item.setAttribute('aria-hidden', ariaHidden);\n this.setTabindex(item, visible);\n\n // Collect a list of focusable items within each slider item.\n const focusableItems = item.querySelectorAll(Utilities.focusableSelectors.join(', '));\n\n // Set the tab index for each focusable element within each slider item.\n focusableItems.forEach((element: HTMLElement) => {\n this.setTabindex(element, visible);\n });\n });\n }\n\n /**\n * Sets the active class on the active item and removes it from the rest.\n *\n * There can only be one active item at a time. The active item is tracked by\n * `Zodiac.getPosition()`.\n */\n protected setActiveClass(): void {\n const currentPosition = this.zodiac.getPosition();\n\n const activeItem = this.zodiac.getItems().item(currentPosition);\n this.removeActiveClass();\n this.addActiveClassToItem(activeItem);\n }\n\n /**\n * Applies an indexing attribute to each item.\n */\n protected setInitialItemState(): void {\n this.zodiac.getItems().forEach((item, index) => {\n item.setAttribute('data-zodiac-item-index', (index + 1).toString());\n });\n }\n\n /**\n * Sets the tabindex of an element based on whether it is visible.\n *\n * @param element - The element to modify.\n * @param visible - Whether or not the element is active.\n */\n protected setTabindex(element: HTMLElement, visible: boolean): void {\n if (!visible) {\n element.setAttribute('tabindex', '-1');\n } else {\n element.removeAttribute('tabindex');\n }\n }\n\n}\n","import Zodiac from '../zodiac';\n\nimport { ComponentBase } from './componentBase';\n\n/**\n * Adds a live region, so the slide position can be announced to screen readers.\n */\nexport class LiveRegion extends ComponentBase {\n\n /**\n * The live region element.\n */\n protected liveRegion: HTMLDivElement;\n\n /**\n * {@inheritDoc ComponentBase.mount}\n */\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n if (this.options.enableLiveRegion) {\n this.createLiveRegion();\n this.updateLiveRegion();\n }\n }\n\n /**\n * Creates and adds the live region element to the slider.\n */\n protected createLiveRegion() {\n this.liveRegion = document.createElement('div');\n this.liveRegion.setAttribute('aria-live', 'polite');\n this.liveRegion.setAttribute('aria-atomic', 'true');\n this.liveRegion.classList.add('zodiac-live-region');\n\n this.zodiac.getSliderElement().appendChild(this.liveRegion);\n }\n\n /**\n * Retrieves the title of the active item that will be used in the live region.\n *\n * The title is expected to be placed in the `data-zodiac-live-region-title`\n * attribute. This can be on a `zodiac-item` element, or within.\n *\n * @returns The title of the active slider item.\n */\n protected getLiveRegionTitle(): string {\n let title = '';\n\n const sliderElement = this.zodiac.getSliderElement();\n const titleElement = sliderElement.querySelector<HTMLElement>(\n '.zodiac-item.active[data-zodiac-live-region-title], .zodiac-item.active [data-zodiac-live-region-title]',\n );\n\n if (titleElement) {\n title = titleElement.dataset.zodiacLiveRegionTitle;\n }\n\n return title;\n }\n\n /**\n * Updates the text of the live region when the slider is moved.\n */\n protected updateLiveRegion() {\n this.zodiac.getEventBus().on(['move.after', 'drag.after'], () => {\n const position = this.zodiac.getPosition() + 1;\n const total = this.zodiac.getItemTotal() + 1;\n const title = this.getLiveRegionTitle();\n\n this.liveRegion.innerText = this.options.liveRegionText\n .replace('@position', position.toString())\n .replace('@total', total.toString())\n .replace('@title', title)\n .trim();\n });\n }\n\n}\n","import Zodiac from '../zodiac';\n\nimport { ComponentBase } from './componentBase';\nimport { Utilities } from '../utilities';\n\n/**\n * Manipulates the width of the slider track and each slider item.\n */\nexport class Track extends ComponentBase {\n\n /**\n * {@inheritDoc ComponentBase.mount}\n */\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n this.setItemWidth();\n\n if (this.options.infiniteScrolling) {\n this.cloneSliderItems();\n }\n\n this.setTrackWidth();\n this.setTrackTransitionDuration();\n this.updateTrackOnResize();\n this.disableTransition();\n this.zodiac.getEventBus().emit(['track.after']);\n }\n\n /**\n * Clones a node, returning it with the original type.\n *\n * @param node - The node to clone.\n *\n * @returns The cloned node.\n */\n protected cloneNode<T extends Node>(node: T): T {\n return <T>node.cloneNode(true);\n }\n\n /**\n * Clones the slider items for the `infiniteScrolling` option.\n */\n protected cloneSliderItems(): void {\n const { itemsPerView } = this.options;\n const itemTotal = this.zodiac.getItemTotal();\n const items = this.zodiac.getItems();\n const trackElement = this.zodiac.getTrackElement();\n\n for (let i = itemTotal; i > itemTotal - itemsPerView; --i) {\n if (items[i]) {\n const cloned = this.getClonedSlide(items[i]);\n cloned.classList.add('zodiac-cloned-before');\n\n trackElement.prepend(cloned);\n }\n }\n\n for (let i = 0; i < itemTotal + itemsPerView; i += 1) {\n if (items[i]) {\n const cloned = this.getClonedSlide(items[i]);\n cloned.classList.add('zodiac-cloned-after');\n\n trackElement.append(cloned);\n }\n }\n }\n\n /**\n * Disables the track transition animation.\n */\n protected disableTransition(): void {\n const eventBus = this.zodiac.getEventBus();\n const trackElement = this.zodiac.getTrackElement();\n\n eventBus.on(['disableTransition.before'], () => {\n trackElement.style.transition = 'none';\n });\n\n eventBus.on(['disableTransition.after'], () => {\n trackElement.style.transition = null;\n });\n }\n\n /**\n * Clones the provided slider item.\n */\n protected getClonedSlide(slide: HTMLElement): HTMLElement {\n const cloned = this.cloneNode(slide);\n\n cloned.removeAttribute('id');\n cloned.classList.add('zodiac-cloned');\n cloned.setAttribute('aria-hidden', 'true');\n\n const selector = Utilities.focusableSelectors.join(', ');\n\n cloned.querySelectorAll(selector).forEach((element) => {\n // Ensure none of the links nested within the cloned items can\n // receive focus.\n element.setAttribute('tabindex', '-1');\n });\n\n return cloned;\n }\n\n /**\n * Gets the margin size for slider items by dividing the gap option in half.\n *\n * @returns The gap option value divided in half.\n */\n protected getSliderItemMargin(): number {\n return this.options.gap / 2;\n }\n\n /**\n * Retrieves the width of the slider's inner element.\n *\n * @returns The width of the slider.\n */\n protected getSliderWidth(): number {\n const selector = this.options.classes.inner;\n const inner = this.zodiac.getSliderElement().querySelector(`.${selector}`);\n\n const { width } = inner.getBoundingClientRect();\n\n return width;\n }\n\n /**\n * Sets the width and margin of each slider item.\n *\n * Each slider item's width is calculated by dividing the slider's width by\n * configured total items per view minus the configured gap setting.\n */\n protected setItemWidth(): void {\n const { itemsPerView } = this.options;\n\n // Calculate the width of each slider item by dividing the total size of\n // the inner slider by the total items per view.\n this.zodiac.setItemWidth(this.getSliderWidth() / itemsPerView);\n\n const sliderItemMargin = this.getSliderItemMargin();\n\n this.zodiac.getItems().forEach((item) => {\n // Apply the width to the slide item.\n item.style.width = `${this.zodiac.getItemWidth() - sliderItemMargin * 2}px`;\n\n // Add spacing between each slider item with left and right margin.\n item.style.marginLeft = `${sliderItemMargin}px`;\n item.style.marginRight = `${sliderItemMargin}px`;\n });\n }\n\n /**\n * Applies the transition speed setting to the track.\n */\n protected setTrackTransitionDuration(): void {\n const { transitionSpeed } = this.options;\n\n const eventBus = this.zodiac.getEventBus();\n\n eventBus.on(['move.before', 'move.after', 'drag.after'], () => {\n eventBus.emit(['transitionDuration.before']);\n this.zodiac.getTrackElement().style.transitionDuration = `${transitionSpeed}ms`;\n\n setTimeout(() => {\n this.zodiac.getTrackElement().style.transitionDuration = '';\n eventBus.emit(['transitionDuration.after']);\n }, transitionSpeed);\n });\n }\n\n /**\n * Set the width of the track element.\n *\n * The width of track element is equal to the width of the slider multiplied\n * by the total number of items.\n */\n protected setTrackWidth(): void {\n // Get all slider items, included those that have been cloned.\n const items = this.zodiac.getTrackElement().querySelectorAll('.zodiac-item');\n const trackWidth = this.zodiac.getItemWidth() * items.length;\n\n this.zodiac.getTrackElement().style.width = `${trackWidth}px`;\n }\n\n /**\n * Update the track and item width when the window is resized.\n */\n protected updateTrackOnResize(): void {\n this.zodiac.getEventBus().on(['updateEffectiveOptions.after'], () => {\n this.zodiac.getEventBus().emit(['trackUpdated.before']);\n this.setItemWidth();\n this.setTrackWidth();\n this.setTrackTransitionDuration();\n this.zodiac.getEventBus().emit(['trackUpdated.after']);\n });\n }\n\n}\n","import Zodiac from '../zodiac';\n\nimport { ComponentBase } from './componentBase';\n\ntype DragEvent = MouseEvent | TouchEvent;\n\n/**\n * A map of events that will represent dragging.\n */\ninterface DragEventMap {\n 'mousedown': DragEvent,\n 'mousemove': DragEvent,\n 'mouseleave': DragEvent,\n 'mouseup': DragEvent,\n 'touchcancel': DragEvent,\n 'touchend': DragEvent,\n 'touchmove': DragEvent,\n 'touchstart': DragEvent,\n}\n\ntype EventKey = keyof DragEventMap;\n\n/**\n * Adds dragging capabilities to the slider (for both mouse & touch inputs).\n */\nexport class Drag extends ComponentBase {\n\n /**\n * The class used to indicate that the slider is being dragged.\n */\n protected readonly draggingClass = 'dragging';\n\n /**\n * The value used to track and apply the `translate` CSS while dragging.\n */\n protected dragPosition = 0;\n\n /**\n * The `AbortController` for the `this.move()` method.\n */\n protected moveController: AbortController = null;\n\n /**\n * Events that move the slider when dragging.\n */\n protected readonly moveEventKeys: EventKey[] = [\n 'mousemove',\n 'touchmove',\n ];\n\n /**\n * A flag used to determine whether the clicking of links is disallowed.\n */\n protected preventClick = false;\n\n /**\n * The position that will be given to `Zodiac` after the dragging has stopped.\n */\n protected snapPosition = 0;\n\n /**\n * Events that signal when dragging should begin.\n */\n protected readonly startEventKeys: EventKey[] = [\n 'mousedown',\n 'touchstart',\n ];\n\n /**\n * The position of the event dispatcher at the start of the dragging process.\n */\n protected startingEventPosition = 0;\n\n /**\n * The `AbortController` for the `this.stop()` method.\n */\n protected stopController: AbortController = null;\n\n /**\n * Events that signal when dragging should end.\n */\n protected readonly stopEventKeys: EventKey[] = [\n 'mouseup',\n 'mouseleave',\n 'touchend',\n 'touchcancel',\n ];\n\n /**\n * How far the slider must be dragged before moving begins.\n */\n protected readonly threshold = 20;\n\n /**\n * {@inheritDoc ComponentBase.mount}\n */\n public mount(zodiac: Zodiac): void {\n super.mount(zodiac);\n\n this.addStartEvents();\n this.onDragEvents();\n this.preventDefaultOnDragStart();\n this.preventDefaultClickOnDragStart();\n }\n\n /**\n * Applies the move events to the slider.\n */\n protected addMoveEvents(): void {\n // Create an `AbortController` to remove these events after dragging is\n // complete. This controller is recreated every time this method is called\n // because it will be disabled after it's `abort` signal is sent.\n this.moveController = new AbortController();\n\n this.moveEventKeys.forEach((eventType) => {\n this.zodiac.getTrackElement().addEventListener(eventType, (event) => this.move(event), { signal: this.moveController.signal });\n });\n }\n\n /**\n * Applies the start events to the slider.\n */\n protected addStartEvents(): void {\n this.startEventKeys.forEach((eventType) => {\n this.zodiac.getTrackElement().addEventListener(eventType, (event) => this.start(event));\n });\n }\n\n /**\n * Applies the stop events to the slider.\n */\n protected addStopEvents(): void {\n // Create an `AbortController` to remove these events after dragging is\n // complete. This controller is recreated every time this method is called\n // because it will be disabled after it's `abort` signal is sent.\n this.stopController = new AbortController();\n\n this.stopEventKeys.forEach((eventType) => {\n this.zodiac.getTrackElement().addEventListener(eventType, () => this.stop(), { signal: this.stopController.signal });\n });\n }\n\n /**\n * Retrieves the `screenX` value from an event depending on the event type.\n *\n * @param event - The event in which to derive the `screenX` value.\n *\n * @returns The `screenX` value of the event.\n */\n protected getScreenX(event: DragEvent): number {\n let screenX: number = null;\n\n if (window.TouchEvent && event instanceof TouchEvent) {\n screenX = event.touches[0].screenX ?? 0;\n } else if (event instanceof MouseEvent) {\n screenX = event.screenX;\n }\n\n return screenX;\n }\n\n /**\n * Snaps a drag position into a valid `Zodiac` position.\n *\n * The `Drag` component tracks the drag position with a pixel value to\n * animate dragging. This method snaps a drag position into valid `Zodiac`\n * position to set the active slide.\n *\n * @param dragPosition - The position in pixels.\n *\n * @returns The position as a numeric index.\n */\n protected getSnapPosition(dragPosition: number): number {\n const clonedOffset = this.zodiac.getClonedOffset();\n\n return -Math.round(dragPosition / this.zodiac.getItemWidth()) - clonedOffset;\n }\n\n /**\n * Mark all links within the slider track as draggable or un-draggable.\n *\n * Depending on the value of `draggable`, links within the slider track will\n * be enabled or disabled by swapping between storing the link in an `href`\n * or `data-href` attribute and toggling the `draggable` attribute.\n *\n * @param draggable - Whether to mark the items as draggable or un-draggable.\n */\n protected modifyLinks(draggable: boolean): void {\n // Retrieve all links within the track element.\n const links = this.zodiac.getTrackElement().querySelectorAll('a');\n\n // Prevent unnecessary modification by checking if the draggable value\n // matches the prevent click state.\n if (this.preventClick === draggable) {\n links.forEach((link) => {\n // Determine the source and destination of the attribute modification\n // based on the whether draggability is being enabled or disabled.\n const source = draggable ? 'data-href' : 'href';\n const destination = draggable ? 'href' : 'data-href';\n\n // Add or remove the draggable attribute on the link element.\n link.draggable = draggable;\n\n link.setAttribute(destination, link.getAttribute(source));\n link.removeAttribute(source);\n });\n\n // Indicate click has or hasn't been prevented.\n this.preventClick = !this.preventClick;\n }\n }\n\n /**\n * Calculates & updates the position of the slider track on drag.\n *\n * During the move stage of the dragging, this method has the following side\n * effects:\n * - Calculates the dragging distance based on where the user clicked or\n * touched.\n * - Determines how fast the slider should be dragged based on how close to\n * the edge the mouse cursor is moved.\n * - Computes which slide to snap to after dragging is complete.\n * - Animates the slider track while dragging.\n *\n * @param event - The DOM event emitted during the drag movement.\n */\n protected move(event: DragEvent): void {\n this.zodiac.getEventBus().emit(['drag.move.before']);\n\n // Determine the distance between the position of current event dispatcher\n // the starting event dispatcher position.\n const currentEventPosition = this.getScreenX(event) - this.zodiac.getSliderElement().offsetLeft;\n const distance = currentEventPosition - this.startingEventPosition;\n\n // Exit this method if the distance is less than the drag threshold.\n if (Math.abs(distance) < this.threshold) {\n return;\n }\n\n // Determine by drag position by adding distance multiplied by the\n // acceleration speed.\n const dragPosition = this.dragPosition + distance;\n\n event.preventDefault();\n\n // Get the snap position from the current drag position.\n this.snapPosition = this.getSnapPosition(dragPosition);\n // Animate the dragging.\n this.zodiac.getTrackElement().style.transform = `translate3d(${dragPosition}px, 0, 0)`;\n\n this.zodiac.getEventBus().emit(['drag.move.after']);\n }\n\n /**\n * Adds the `dragging` class to the slider track while it is being dragged.\n */\n protected onDragEvents(): void {\n this.zodiac.getEventBus().on(['drag.before'], () => {\n this.zodiac.getTrackElement().classList.add(this.draggingClass);\n });\n\n this.zodiac.getEventBus().on(['drag.after'], () => {\n this.zodiac.getTrackElement().classList.remove(this.draggingClass);\n });\n }\n\n /**\n * Prevent link clicking when the slider is being dragged.\n */\n protected preventDefaultClickOnDragStart(): void {\n this.zodiac.getEventBus().on(['drag.move.before'], () => {\n this.modifyLinks(false);\n });\n\n this.zodiac.getEventBus().on(['drag.after'], () => {\n // Wait for the slider to finishing animating before enabling the links.\n setTimeout(() => {\n this.modifyLinks(true);\n }, this.options.transitionSpeed);\n });\n }\n\n /**\n * Prevents unnecessary dragging for slider items.\n */\n protected preventDefaultOnDragStart(): void {\n this.zodiac.getItems().forEach((item) => {\n item.addEventListener('dragstart', (event) => event.preventDefault());\n });\n }\n\n /**\n * Removes the move events from the slider to prevent unnecessary calculations.\n */\n protected removeMoveEvents(): void {\n this.moveController.abort();\n }\n\n /**\n * Removes the stop events from the slider to prevent unnecessary calculations.\n */\n protected removeStopEvents(): void {\n this.stopController.abort();\n }\n\n /**\n * Prepares the slider to be dragged when dragging has started.\n *\n * The slider is prepared by calculating the current drag position, relative\n * to the `Zodiac`'s current position, and the position of the event\n * dispatcher.\n *\n * @param event - The DOM event which fired this method.\n */\n protected start(event: DragEvent): void {\n this.zodiac.getEventBus().emit(['drag.before']);\n\n const clonedOffset = this.zodiac.getClonedOffset();\n\n // Calculate the drag position by multiplying the slider's current position\n // by the width of a single slide. The value of this calculation is\n // converted to a negative number to animate the slider since it will\n // eventually be passed into `translate3d`.\n this.dragPosition = -((this.zodiac.getPosition() + clonedOffset) * this.zodiac.getItemWidth());\n\n this.snapPosition = this.getSnapPosition(this.dragPosition);\n\n // Determine the position of the event dispatcher by subtracting the event\n // dispatcher's position on the screen by the slider's offset of it's\n // parent element.\n this.startingEventPosition = this.getScreenX(event) - this.zodiac.getSliderElement().offsetLeft;\n\n this.addMoveEvents();\n this.addStopEvents();\n }\n\n /**\n * Positions the slider after the dragging is complete.\n */\n protected stop(): void {\n this.zodiac.move(this.snapPosition);\n\n this.removeMoveEvents();\n this.removeStopEvents();\n\n this.zodiac.getEventBus().emit(['drag.after']);\n }\n\n}\n","import { EventBus } from './eventBus';\nimport { Options, OptionsInterface } from './options';\n\nimport { ComponentInterface, UpdateEffectiveOptions } from './components/componentBase';\nimport { Autoplay } from './components/autoplay';\nimport { Controls } from './components/controls';\nimport { ItemState } from './components/itemState';\nimport { LiveRegion } from './components/liveRegion';\nimport { Track } from './components/track';\nimport { Drag } from './components/drag';\n\n/**\n * The entry point for the Zodiac Slider.\n *\n * This class contains all properties and methods shared between each component.\n *\n * Components are mounted in `Zodiac.mount()`. This function iterates over each\n * component, invoking their `mount()` method & supplying itself as an argument.\n */\nexport default class Zodiac {\n\n /**\n * The number of cloned slider items preceding the normal slider items.\n */\n protected clonedOffset: number;\n\n /**\n * The slider components.\n */\n protected components: ComponentInterface[];\n\n /**\n * The event bus.\n */\n protected eventBus: EventBus;\n\n /**\n * The slider items.\n */\n protected items: NodeListOf<HTMLElement>;\n\n /**\n * The width of each slider item.\n */\n protected itemWidth: number;\n\n /**\n * The slider options.\n */\n protected options: Options;\n\n /**\n * The slider's current position in the item sequence (zero-indexed).\n */\n protected position: number;\n\n /**\n * The CSS selector for identifying the slider.\n */\n protected selector: string;\n\n /**\n * The element on which the slider has been initialized.\n */\n protected readonly sliderElement: HTMLElement;\n\n /**\n * The slider track element.\n */\n protected readonly trackElement: HTMLElement;\n\n /**\n * Constructs a `Zodiac` instance based on the provided selector and options.\n *\n * @param selector - The base selector to use.\n * @param options - The options to initialize the slider with.\n */\n public constructor(selector: string, options?: OptionsInterface) {\n this.eventBus = new EventBus();\n\n this.selector = selector;\n this.options = new Options(this.eventBus, options);\n\n const effectiveOptions = this.options.getEffectiveOptions();\n\n this.components = this.registerComponents();\n\n this.sliderElement = document.querySelector(this.selector);\n this.trackElement = this.sliderElement.querySelector(`.${effectiveOptions.classes.track}`);\n this.items = this.sliderElement.querySelectorAll(`.${effectiveOptions.classes.items}`);\n\n this.position = 0;\n\n // Set the slider's initial position\n this.eventBus.on(['track.after'], () => {\n this.eventBus.emit(['disableTransition.before']);\n this.next(0);\n this.eventBus.emit(['disableTransition.after']);\n });\n\n // Reposition the slider items on media query change.\n this.eventBus.on(['trackUpdated.after'], () => this.next(0));\n }\n\n /**\n * Retrieves the number of cloned slider items before the normal slider items.\n *\n * @returns The cloned offset value.\n */\n public getClonedOffset(): number {\n if (this.clonedOffset === undefined) {\n this.loadClonedOffset();\n }\n\n return this.clonedOffset;\n }\n\n /**\n * Retrieves the slider's effective options.\n *\n * @returns The slider's effective options.\n */\n public getEffectiveOptions(): OptionsInterface {\n return this.options.getEffectiveOptions();\n }\n\n /**\n * Retrieves the event bus.\n *\n * @returns The event bus.\n */\n public getEventBus(): EventBus {\n return this.eventBus;\n }\n\n /**\n * Retrieves the total number of items.\n *\n * @returns The total number of items offset by 1.\n */\n public getItemTotal(): number {\n return this.items.length - 1;\n }\n\n /**\n * Retrieves the width of a slider item.\n *\n * @returns The width of individual slider items.\n */\n public getItemWidth(): number {\n return this.itemWidth;\n }\n\n /**\n * Retrieves the slider's items.\n *\n * @returns The slider's items.\n */\n public getItems(): NodeListOf<HTMLElement> {\n return this.items;\n }\n\n /**\n * Retrieves the slider's position.\n *\n * @returns The position of the slider.\n */\n public getPosition(): number {\n return this.position;\n }\n\n /**\n * Retrieves the slider element.\n *\n * @returns The slider element.\n */\n public getSliderElement(): HTMLElement {\n return this.sliderElement;\n }\n\n /**\n * Retrieves the track element.\n *\n * @returns The track element.\n */\n public getTrackElement(): HTMLElement {\n return this.trackElement;\n }\n\n /**\n * Mounts the sliders components.\n *\n * @param thirdPartyComponents - A list of user defined components.\n *\n * @returns The current `Zodiac` instance.\n */\n public mount(thirdPartyComponents: ComponentInterface[] = []): this {\n for (const component of this.components.concat(thirdPartyComponents)) {\n component.mount(this);\n }\n\n return this;\n }\n\n /**\n * Moves the slider based on the provided offset.\n *\n * @param position - The position to move the slider.\n */\n public move(position: number): void {\n this.eventBus.emit(['move.before']);\n\n const { infiniteScrolling, transitionSpeed } = this.getEffectiveOptions();\n\n if (infiniteScrolling) {\n this.trackElement.style.transform = `translate3d(${this.convertPositionToPixels(position)}px, 0px, 0px)`;\n\n // Convert the position into a value that is within range.\n const itemTotal = this.getItemTotal() + 1;\n position = (position % itemTotal + itemTotal) % itemTotal;\n\n setTimeout(() => {\n this.eventBus.emit(['disableTransition.before']);\n const transform = this.convertPositionToPixels(position);\n this.trackElement.style.transform = `translate3d(${transform}px, 0px, 0px)`;\n this.eventBus.emit(['disableTransition.after']);\n }, transitionSpeed);\n } else {\n if (position > this.getItemTotal()) {\n position = 0;\n }\n\n if (position < 0) {\n position = this.getItemTotal();\n }\n\n const transform = this.convertPositionToPixels(position);\n this.trackElement.style.transform = `translate3d(${transform}px, 0px, 0px)`;\n }\n\n this.setPosition(position);\n this.eventBus.emit(['move.after']);\n }\n\n /**\n * Move to the next slide.\n *\n * @param offset - How many slides to move forward.\n */\n public next(offset = 1): void {\n this.move(this.getPosition() + offset);\n }\n\n /**\n * Removes a custom event listener.\n *\n * @param names - A list of event names to unsubscribe.\n *\n * @returns The current `Zodiac` instance.\n */\n public off(names: string[]): this {\n this.eventBus.off(names);\n\n return this;\n }\n\n /**\n * Adds a custom event listener with a callback function.\n *\n * @param names - A list of event names to subscribe to.\n * @param callback - A callback function to run on the events.\n *\n * @returns The current `Zodiac` instance.\n */\n public on(names: string[], callback: CallableFunction): this {\n this.eventBus.on(names, callback);\n\n return this;\n }\n\n /**\n * Move to the previous slide.\n *\n * @param offset - How many slides to move forward.\n */\n public previous(offset = 1): void {\n this.move(this.getPosition() - offset);\n }\n\n /**\n * Sets the width of individual slider items.\n *\n * @param itemWidth - The new item width.\n */\n public setItemWidth(itemWidth: number): void {\n this.itemWidth = itemWidth;\n }\n\n /**\n * Sets the sliders position.\n *\n * @throws {@link RangeError}\n * Will throw an error if the position is `Nan`, less than zero, or greater\n * than the total number of items.\n *\n * @param position - The position to set.\n */\n public setPosition(position: number): void {\n if (Number.isNaN(position) || position < 0 || position > this.getItemTotal()) {\n throw new RangeError(`Invalid position: ${position}`);\n }\n\n this.position = Math.trunc(position);\n }\n\n /**\n * Converts the provided positional value into a pixel value.\n *\n * @param position - This position to convert.\n *\n * @returns The converted pixel value.\n */\n protected convertPositionToPixels(position: number): number {\n const clonedOffset = this.getClonedOffset();\n\n return -1 * (this.getItemWidth() * (position + clonedOffset));\n }\n\n /**\n * Loads the cloned offset value.\n */\n protected loadClonedOffset(): void {\n this.clonedOffset = 0;\n\n if (this.options.getEffectiveOptions().infiniteScrolling) {\n this.clonedOffset = this.getTrackElement().querySelectorAll('.zodiac-cloned-before').length;\n }\n }\n\n /**\n * Registers the required components provided by Zodiac.\n *\n * @returns A list of instantiated components.\n */\n protected registerComponents(): ComponentInterface[] {\n return [\n ItemState,\n UpdateEffectiveOptions(Track),\n UpdateEffectiveOptions(Autoplay),\n Controls,\n UpdateEffectiveOptions(Drag),\n LiveRegion,\n ].map((Component) => new Component());\n }\n\n}\n"],"names":["EventBus","_createClass","_classCallCheck","this","events","key","value","names","_this","_len","arguments","length","args","Array","_key","forEach","name","filterByName","event","callback","apply","_step","_this2","_iterator","_createForOfIteratorHelper","_loop","filter","s","n","done","err","e","f","_this3","push","Options","eventBus","options","undefined","_defineProperty","autoplay","autoplaySpeed","classes","inner","items","track","enableLiveRegion","gap","infiniteScrolling","itemsPerView","liveRegionText","pauseOnHover","transitionSpeed","Object","assign","baseOptions","mediaQueryOptions","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray","mediaQuery","mediaQueryOptionSet","mediaQueryList","matchMedia","validateMediaQueryOptions","mediaQueryLists","addEventListener","rebuildEffectiveOptions","effectiveOptions","emit","list","matches","freeze","invalidOption","hasOwnProperty","call","TypeError","concat","ComponentBase","zodiac","getEffectiveOptions","UpdateEffectiveOptions","Base","_Base","UpdatingEffectiveOptions","_callSuper","_inherits","_superPropGet","getEventBus","on","Utilities","size","startAt","_toConsumableArray","keys","map","index","Autoplay","_ComponentBase","abortController","AbortController","start","pauseOnDrag","pauseOnFocus","abort","stop","focusableSelectors","join","getSliderElement","querySelectorAll","element","_this4","sliderElement","signal","_this5","_this$options","interval","setInterval","next","clearInterval","Controls","setUpControls","allowMove","nextBtn","querySelector","prevBtn","previous","ItemState","setActiveClass","setAccessibilityAttributes","setInitialItemState","adjustItemStateOnMove","item","classList","add","activeClass","getItems","remove","position","getPosition","visibleRange","range","visible","includes","ariaHidden","toString","setAttribute","setTabindex","currentPosition","activeItem","removeActiveClass","addActiveClassToItem","removeAttribute","LiveRegion","createLiveRegion","updateLiveRegion","liveRegion","document","createElement","appendChild","title","titleElement","dataset","zodiacLiveRegionTitle","total","getItemTotal","getLiveRegionTitle","innerText","replace","trim","Track","setItemWidth","cloneSliderItems","setTrackWidth","setTrackTransitionDuration","updateTrackOnResize","disableTransition","node","cloneNode","itemTotal","trackElement","getTrackElement","i","cloned","getClonedSlide","prepend","append","style","transition","slide","selector","getBoundingClientRect","width","getSliderWidth","sliderItemMargin","getSliderItemMargin","getItemWidth","marginLeft","marginRight","transitionDuration","setTimeout","trackWidth","Drag","addStartEvents","onDragEvents","preventDefaultOnDragStart","preventDefaultClickOnDragStart","moveController","moveEventKeys","eventType","move","startEventKeys","stopController","stopEventKeys","_event$touches$0$scre","screenX","window","TouchEvent","touches","MouseEvent","dragPosition","clonedOffset","getClonedOffset","Math","round","draggable","links","preventClick","link","source","destination","getAttribute","distance","getScreenX","offsetLeft","startingEventPosition","abs","threshold","preventDefault","snapPosition","getSnapPosition","transform","draggingClass","_this6","modifyLinks","addMoveEvents","addStopEvents","removeMoveEvents","removeStopEvents","Zodiac","components","registerComponents","loadClonedOffset","itemWidth","thirdPartyComponents","mount","_this$getEffectiveOpt","convertPositionToPixels","setPosition","offset","off","Number","isNaN","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