{"version":3,"file":"stimulus-5eb5ff3a.js","sources":["../../../app/frontend/controllers/accordion_controller.ts","../../../app/frontend/controllers/ahoy_controller.ts","../../../node_modules/stimulus-use/dist/index.js","../../../app/frontend/controllers/close_details_controller.ts","../../../app/frontend/controllers/copy_controller.ts","../../../app/frontend/controllers/delayed_redirect_controller.ts","../../../app/frontend/controllers/form_confirm_controller.ts","../../../app/frontend/controllers/modal_trigger_controller.ts","../../../app/frontend/controllers/show_after_controller.ts","../../../node_modules/@rails/request.js/src/fetch_response.js","../../../node_modules/@rails/request.js/src/request_interceptor.js","../../../node_modules/@rails/request.js/src/lib/utils.js","../../../node_modules/@rails/request.js/src/fetch_request.js","../../../node_modules/@rails/request.js/src/verbs.js","../../../node_modules/sortablejs/modular/sortable.esm.js","../../../node_modules/stimulus-sortable/dist/stimulus-sortable.mjs","../../../app/frontend/controllers/sortable_controller.ts","../../../app/frontend/controllers/submit_loading_controller.ts","../../../app/frontend/controllers/submit_on_change_controller.ts","../../../app/components/auth/auth_message/controller.ts","../../../node_modules/date-fns/toDate.mjs","../../../node_modules/date-fns/constructFrom.mjs","../../../node_modules/date-fns/addMilliseconds.mjs","../../../node_modules/date-fns/constants.mjs","../../../node_modules/date-fns/_lib/defaultOptions.mjs","../../../node_modules/date-fns/startOfWeek.mjs","../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../../node_modules/date-fns/addSeconds.mjs","../../../node_modules/date-fns/compareAsc.mjs","../../../node_modules/date-fns/_lib/roundingMethods.mjs","../../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../../node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../../node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../../node_modules/date-fns/locale/en-US/_lib/match.mjs","../../../node_modules/date-fns/locale/en-US.mjs","../../../node_modules/date-fns/formatDistanceStrict.mjs","../../../node_modules/date-fns/isSameWeek.mjs","../../../node_modules/date-fns/locale/de/_lib/formatDistance.mjs","../../../node_modules/date-fns/locale/de/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/de/_lib/formatRelative.mjs","../../../node_modules/date-fns/locale/de/_lib/localize.mjs","../../../node_modules/date-fns/locale/de/_lib/match.mjs","../../../node_modules/date-fns/locale/de.mjs","../../../node_modules/date-fns/locale/en-GB/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/en-GB.mjs","../../../node_modules/date-fns/locale/fr/_lib/formatDistance.mjs","../../../node_modules/date-fns/locale/fr/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/fr/_lib/formatRelative.mjs","../../../node_modules/date-fns/locale/fr/_lib/localize.mjs","../../../node_modules/date-fns/locale/fr/_lib/match.mjs","../../../node_modules/date-fns/locale/fr.mjs","../../../node_modules/date-fns/locale/nl-BE/_lib/formatDistance.mjs","../../../node_modules/date-fns/locale/nl-BE/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/nl-BE/_lib/formatRelative.mjs","../../../node_modules/date-fns/locale/nl-BE/_lib/localize.mjs","../../../node_modules/date-fns/locale/nl-BE/_lib/match.mjs","../../../node_modules/date-fns/locale/nl-BE.mjs","../../../node_modules/date-fns/locale/uk/_lib/formatDistance.mjs","../../../node_modules/date-fns/locale/uk/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/uk/_lib/formatRelative.mjs","../../../node_modules/date-fns/locale/uk/_lib/localize.mjs","../../../node_modules/date-fns/locale/uk/_lib/match.mjs","../../../node_modules/date-fns/locale/uk.mjs","../../../node_modules/date-fns/locale/zh-CN/_lib/formatDistance.mjs","../../../node_modules/date-fns/locale/zh-CN/_lib/formatLong.mjs","../../../node_modules/date-fns/locale/zh-CN/_lib/formatRelative.mjs","../../../node_modules/date-fns/locale/zh-CN/_lib/localize.mjs","../../../node_modules/date-fns/locale/zh-CN/_lib/match.mjs","../../../node_modules/date-fns/locale/zh-CN.mjs","../../../app/components/auth/login/page/controller.ts","../../../app/components/auth/magic_link/controller.ts","../../../app/components/auth/registrations/newsletter_query/controller.ts","../../../app/components/auth/registrations/page/controller.ts","../../../app/components/form/field/password/controller.ts","../../../app/frontend/lib/passedTranslations.ts","../../../app/components/form/field/password_with_validation/controller.ts","../../../app/components/form/field/password_with_validation/requirement_controller.ts","../../../node_modules/intl-tel-input/build/js/intlTelInput.js","../../../node_modules/intl-tel-input/index.js","../../../node_modules/intl-tel-input/build/js/utils.js","../../../app/components/form/field/phone/controller.ts","../../../app/components/form/fields/select/controller.ts","../../../app/components/hideable/controller.ts","../../../app/components/language_switch/controller.ts","../../../app/components/layout/flash/controller.ts","../../../app/components/layout/header/controller.ts","../../../app/components/layout/toolbar/dev_toolbar/controller.ts","../../../app/components/modal/controller.ts","../../../app/components/profile/delete_account/controller.ts","../../../app/components/profile/forms/controller.ts","../../../app/frontend/entrypoints/stimulus.js"],"sourcesContent":["import { Target, TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target detailsTarget!: HTMLDetailsElement;\n\n on_toggle(event) {\n const ids = this.getIds();\n if (event.target.open) {\n this.setIds([...ids, this.detailsTarget.dataset.id]);\n } else {\n this.setIds(ids.filter((id) => id !== this.detailsTarget.dataset.id));\n }\n }\n\n private setIds(ids: string[]) {\n const val = JSON.stringify([...new Set(ids)]);\n const urlParams = new URLSearchParams(window.location.search);\n urlParams.set(\"open\", val);\n\n window.history.replaceState({}, \"\", `${window.location.pathname}?${urlParams.toString()}`);\n document.querySelectorAll(\"input[name='open']\").forEach((elem: HTMLInputElement) => {\n elem.value = val;\n });\n }\n\n private getIds() {\n const currentHash = new URLSearchParams(window.location.search);\n try {\n return JSON.parse(currentHash.get(\"open\") || \"[]\");\n } catch (e) {\n return [];\n }\n }\n}\n","import { TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class AhoyController extends Controller {\n @Value(String) eventValue!: string;\n @Value(String) propertiesValue: string | undefined = undefined;\n\n track() {\n window.ahoy.track(this.eventValue, this.props);\n }\n\n private get props(): Record | undefined {\n try {\n return JSON.parse(this.propertiesValue || \"{}\");\n } catch (e) {\n return undefined;\n }\n }\n}\n","/*\n * stimulus-use 0.52.2\n */\nimport { Controller } from \"@hotwired/stimulus\";\n\nconst method = (controller, methodName) => {\n const method = controller[methodName];\n if (typeof method == \"function\") {\n return method;\n } else {\n return (...args) => {};\n }\n};\n\nconst composeEventName = (name, controller, eventPrefix) => {\n let composedName = name;\n if (eventPrefix === true) {\n composedName = `${controller.identifier}:${name}`;\n } else if (typeof eventPrefix === \"string\") {\n composedName = `${eventPrefix}:${name}`;\n }\n return composedName;\n};\n\nconst extendedEvent = (type, event, detail) => {\n const {bubbles: bubbles, cancelable: cancelable, composed: composed} = event || {\n bubbles: true,\n cancelable: true,\n composed: true\n };\n if (event) {\n Object.assign(detail, {\n originalEvent: event\n });\n }\n const customEvent = new CustomEvent(type, {\n bubbles: bubbles,\n cancelable: cancelable,\n composed: composed,\n detail: detail\n });\n return customEvent;\n};\n\nfunction isElementInViewport(el) {\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n const vertInView = rect.top <= windowHeight && rect.top + rect.height > 0;\n const horInView = rect.left <= windowWidth && rect.left + rect.width > 0;\n return vertInView && horInView;\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, ((_, char) => char.toUpperCase()));\n}\n\n/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */ function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nconst defaultOptions$8 = {\n debug: false,\n logger: console,\n dispatchEvent: true,\n eventPrefix: true\n};\n\nclass StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c;\n this.log = (functionName, args) => {\n if (!this.debug) return;\n this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${functionName}`, \"color: #3B82F6\", \"color: unset\");\n this.logger.log(Object.assign({\n controllerId: this.controllerId\n }, args));\n this.logger.groupEnd();\n };\n this.warn = message => {\n this.logger.warn(`%c${this.controller.identifier} %c${message}`, \"color: #3B82F6; font-weight: bold\", \"color: unset\");\n };\n this.dispatch = (eventName, details = {}) => {\n if (this.dispatchEvent) {\n const {event: event} = details, eventDetails = __rest(details, [ \"event\" ]);\n const customEvent = this.extendedEvent(eventName, event || null, eventDetails);\n this.targetElement.dispatchEvent(customEvent);\n this.log(\"dispatchEvent\", Object.assign({\n eventName: customEvent.type\n }, eventDetails));\n }\n };\n this.call = (methodName, args = {}) => {\n const method = this.controller[methodName];\n if (typeof method == \"function\") {\n return method.call(this.controller, args);\n }\n };\n this.extendedEvent = (name, event, detail) => {\n const {bubbles: bubbles, cancelable: cancelable, composed: composed} = event || {\n bubbles: true,\n cancelable: true,\n composed: true\n };\n if (event) {\n Object.assign(detail, {\n originalEvent: event\n });\n }\n const customEvent = new CustomEvent(this.composeEventName(name), {\n bubbles: bubbles,\n cancelable: cancelable,\n composed: composed,\n detail: detail\n });\n return customEvent;\n };\n this.composeEventName = name => {\n let composedName = name;\n if (this.eventPrefix === true) {\n composedName = `${this.controller.identifier}:${name}`;\n } else if (typeof this.eventPrefix === \"string\") {\n composedName = `${this.eventPrefix}:${name}`;\n }\n return composedName;\n };\n this.debug = (_b = (_a = options === null || options === void 0 ? void 0 : options.debug) !== null && _a !== void 0 ? _a : controller.application.stimulusUseDebug) !== null && _b !== void 0 ? _b : defaultOptions$8.debug;\n this.logger = (_c = options === null || options === void 0 ? void 0 : options.logger) !== null && _c !== void 0 ? _c : defaultOptions$8.logger;\n this.controller = controller;\n this.controllerId = controller.element.id || controller.element.dataset.id;\n this.targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n const {dispatchEvent: dispatchEvent, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$8, options);\n Object.assign(this, {\n dispatchEvent: dispatchEvent,\n eventPrefix: eventPrefix\n });\n this.controllerInitialize = controller.initialize.bind(controller);\n this.controllerConnect = controller.connect.bind(controller);\n this.controllerDisconnect = controller.disconnect.bind(controller);\n }\n}\n\nconst defaultOptions$7 = {\n eventPrefix: true,\n bubbles: true,\n cancelable: true\n};\n\nclass UseDispatch extends StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c, _d;\n super(controller, options);\n this.dispatch = (eventName, detail = {}) => {\n const {controller: controller, targetElement: targetElement, eventPrefix: eventPrefix, bubbles: bubbles, cancelable: cancelable, log: log, warn: warn} = this;\n Object.assign(detail, {\n controller: controller\n });\n const eventNameWithPrefix = composeEventName(eventName, this.controller, eventPrefix);\n const event = new CustomEvent(eventNameWithPrefix, {\n detail: detail,\n bubbles: bubbles,\n cancelable: cancelable\n });\n targetElement.dispatchEvent(event);\n warn(\"`useDispatch()` is deprecated. Please use the built-in `this.dispatch()` function from Stimulus. You can find more information on how to upgrade at: https://stimulus-use.github.io/stimulus-use/#/use-dispatch\");\n log(\"dispatch\", {\n eventName: eventNameWithPrefix,\n detail: detail,\n bubbles: bubbles,\n cancelable: cancelable\n });\n return event;\n };\n this.targetElement = (_a = options.element) !== null && _a !== void 0 ? _a : controller.element;\n this.eventPrefix = (_b = options.eventPrefix) !== null && _b !== void 0 ? _b : defaultOptions$7.eventPrefix;\n this.bubbles = (_c = options.bubbles) !== null && _c !== void 0 ? _c : defaultOptions$7.bubbles;\n this.cancelable = (_d = options.cancelable) !== null && _d !== void 0 ? _d : defaultOptions$7.cancelable;\n this.enhanceController();\n }\n enhanceController() {\n Object.assign(this.controller, {\n dispatch: this.dispatch\n });\n }\n}\n\nconst useDispatch = (controller, options = {}) => new UseDispatch(controller, options);\n\nconst defaultOptions$6 = {\n overwriteDispatch: true\n};\n\nconst useApplication = (controller, options = {}) => {\n const {overwriteDispatch: overwriteDispatch} = Object.assign({}, defaultOptions$6, options);\n Object.defineProperty(controller, \"isPreview\", {\n get() {\n return document.documentElement.hasAttribute(\"data-turbolinks-preview\") || document.documentElement.hasAttribute(\"data-turbo-preview\");\n }\n });\n Object.defineProperty(controller, \"isConnected\", {\n get() {\n return !!Array.from(this.context.module.connectedContexts).find((c => c === this.context));\n }\n });\n Object.defineProperty(controller, \"csrfToken\", {\n get() {\n return this.metaValue(\"csrf-token\");\n }\n });\n if (overwriteDispatch) {\n useDispatch(controller, options);\n }\n Object.assign(controller, {\n metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element && element.getAttribute(\"content\");\n }\n });\n};\n\nclass ApplicationController extends Controller {\n constructor(context) {\n super(context);\n this.isPreview = false;\n this.isConnected = false;\n this.csrfToken = \"\";\n useApplication(this, this.options);\n }\n}\n\nconst defaultOptions$5 = {\n events: [ \"click\", \"touchend\" ],\n onlyVisible: true,\n dispatchEvent: true,\n eventPrefix: true\n};\n\nconst useClickOutside = (composableController, options = {}) => {\n const controller = composableController;\n const {onlyVisible: onlyVisible, dispatchEvent: dispatchEvent, events: events, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$5, options);\n const onEvent = event => {\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n if (targetElement.contains(event.target) || !isElementInViewport(targetElement) && onlyVisible) {\n return;\n }\n if (controller.clickOutside) {\n controller.clickOutside(event);\n }\n if (dispatchEvent) {\n const eventName = composeEventName(\"click:outside\", controller, eventPrefix);\n const clickOutsideEvent = extendedEvent(eventName, event, {\n controller: controller\n });\n targetElement.dispatchEvent(clickOutsideEvent);\n }\n };\n const observe = () => {\n events === null || events === void 0 ? void 0 : events.forEach((event => {\n window.addEventListener(event, onEvent, true);\n }));\n };\n const unobserve = () => {\n events === null || events === void 0 ? void 0 : events.forEach((event => {\n window.removeEventListener(event, onEvent, true);\n }));\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass ClickOutsideComposableController extends Controller {}\n\nclass ClickOutsideController extends ClickOutsideComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useClickOutside(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass DebounceController extends Controller {}\n\nDebounceController.debounces = [];\n\nconst defaultWait$1 = 200;\n\nconst debounce = (fn, wait = defaultWait$1) => {\n let timeoutId = null;\n return function() {\n const args = Array.from(arguments);\n const context = this;\n const params = args.map((arg => arg.params));\n const callback = () => {\n args.forEach(((arg, index) => arg.params = params[index]));\n return fn.apply(context, args);\n };\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(callback, wait);\n };\n};\n\nconst useDebounce = (composableController, options) => {\n const controller = composableController;\n const constructor = controller.constructor;\n constructor.debounces.forEach((func => {\n if (typeof func === \"string\") {\n controller[func] = debounce(controller[func], options === null || options === void 0 ? void 0 : options.wait);\n }\n if (typeof func === \"object\") {\n const {name: name, wait: wait} = func;\n if (!name) return;\n controller[name] = debounce(controller[name], wait || (options === null || options === void 0 ? void 0 : options.wait));\n }\n }));\n};\n\nclass UseHover extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.targetElement.addEventListener(\"mouseenter\", this.onEnter);\n this.targetElement.addEventListener(\"mouseleave\", this.onLeave);\n };\n this.unobserve = () => {\n this.targetElement.removeEventListener(\"mouseenter\", this.onEnter);\n this.targetElement.removeEventListener(\"mouseleave\", this.onLeave);\n };\n this.onEnter = event => {\n this.call(\"mouseEnter\", event);\n this.log(\"mouseEnter\", {\n hover: true\n });\n this.dispatch(\"mouseEnter\", {\n hover: false\n });\n };\n this.onLeave = event => {\n this.call(\"mouseLeave\", event);\n this.log(\"mouseLeave\", {\n hover: false\n });\n this.dispatch(\"mouseLeave\", {\n hover: false\n });\n };\n this.controller = controller;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useHover = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseHover(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass HoverComposableController extends Controller {}\n\nclass HoverController extends HoverComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useHover(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultEvents = [ \"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\" ];\n\nconst oneMinute = 6e4;\n\nconst defaultOptions$4 = {\n ms: oneMinute,\n initialState: false,\n events: defaultEvents,\n dispatchEvent: true,\n eventPrefix: true\n};\n\nconst useIdle = (composableController, options = {}) => {\n const controller = composableController;\n const {ms: ms, initialState: initialState, events: events, dispatchEvent: dispatchEvent, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$4, options);\n let isIdle = initialState;\n let timeout = setTimeout((() => {\n isIdle = true;\n dispatchAway();\n }), ms);\n const dispatchAway = event => {\n const eventName = composeEventName(\"away\", controller, eventPrefix);\n controller.isIdle = true;\n method(controller, \"away\").call(controller, event);\n if (dispatchEvent) {\n const clickOutsideEvent = extendedEvent(eventName, event || null, {\n controller: controller\n });\n controller.element.dispatchEvent(clickOutsideEvent);\n }\n };\n const dispatchBack = event => {\n const eventName = composeEventName(\"back\", controller, eventPrefix);\n controller.isIdle = false;\n method(controller, \"back\").call(controller, event);\n if (dispatchEvent) {\n const clickOutsideEvent = extendedEvent(eventName, event || null, {\n controller: controller\n });\n controller.element.dispatchEvent(clickOutsideEvent);\n }\n };\n const onEvent = event => {\n if (isIdle) dispatchBack(event);\n isIdle = false;\n clearTimeout(timeout);\n timeout = setTimeout((() => {\n isIdle = true;\n dispatchAway(event);\n }), ms);\n };\n const onVisibility = event => {\n if (!document.hidden) onEvent(event);\n };\n if (isIdle) {\n dispatchAway();\n } else {\n dispatchBack();\n }\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observe = () => {\n events.forEach((event => {\n window.addEventListener(event, onEvent);\n }));\n document.addEventListener(\"visibilitychange\", onVisibility);\n };\n const unobserve = () => {\n clearTimeout(timeout);\n events.forEach((event => {\n window.removeEventListener(event, onEvent);\n }));\n document.removeEventListener(\"visibilitychange\", onVisibility);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass IdleComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isIdle = false;\n }\n}\n\nclass IdleController extends IdleComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useIdle(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultOptions$3 = {\n dispatchEvent: true,\n eventPrefix: true,\n visibleAttribute: \"isVisible\"\n};\n\nconst useIntersection = (composableController, options = {}) => {\n const controller = composableController;\n const {dispatchEvent: dispatchEvent, eventPrefix: eventPrefix, visibleAttribute: visibleAttribute} = Object.assign({}, defaultOptions$3, options);\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n if (!controller.intersectionElements) controller.intersectionElements = [];\n controller.intersectionElements.push(targetElement);\n const callback = entries => {\n const [entry] = entries;\n if (entry.isIntersecting) {\n dispatchAppear(entry);\n } else if (targetElement.hasAttribute(visibleAttribute)) {\n dispatchDisappear(entry);\n }\n };\n const observer = new IntersectionObserver(callback, options);\n const dispatchAppear = entry => {\n targetElement.setAttribute(visibleAttribute, \"true\");\n method(controller, \"appear\").call(controller, entry, observer);\n if (dispatchEvent) {\n const eventName = composeEventName(\"appear\", controller, eventPrefix);\n const appearEvent = extendedEvent(eventName, null, {\n controller: controller,\n entry: entry,\n observer: observer\n });\n targetElement.dispatchEvent(appearEvent);\n }\n };\n const dispatchDisappear = entry => {\n targetElement.removeAttribute(visibleAttribute);\n method(controller, \"disappear\").call(controller, entry, observer);\n if (dispatchEvent) {\n const eventName = composeEventName(\"disappear\", controller, eventPrefix);\n const disappearEvent = extendedEvent(eventName, null, {\n controller: controller,\n entry: entry,\n observer: observer\n });\n targetElement.dispatchEvent(disappearEvent);\n }\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const disconnect = () => {\n unobserve();\n controllerDisconnect();\n };\n const observe = () => {\n observer.observe(targetElement);\n };\n const unobserve = () => {\n observer.unobserve(targetElement);\n };\n const noneVisible = () => controller.intersectionElements.filter((element => element.hasAttribute(visibleAttribute))).length === 0;\n const oneVisible = () => controller.intersectionElements.filter((element => element.hasAttribute(visibleAttribute))).length === 1;\n const atLeastOneVisible = () => controller.intersectionElements.some((element => element.hasAttribute(visibleAttribute)));\n const allVisible = () => controller.intersectionElements.every((element => element.hasAttribute(visibleAttribute)));\n const isVisible = allVisible;\n Object.assign(controller, {\n isVisible: isVisible,\n noneVisible: noneVisible,\n oneVisible: oneVisible,\n atLeastOneVisible: atLeastOneVisible,\n allVisible: allVisible,\n disconnect: disconnect\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass IntersectionComposableController extends Controller {}\n\nclass IntersectionController extends IntersectionComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useIntersection(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst useLazyLoad = (controller, options) => {\n const callback = entries => {\n const [entry] = entries;\n if (entry.isIntersecting && !controller.isLoaded) {\n handleAppear();\n }\n };\n const handleAppear = entry => {\n const src = controller.data.get(\"src\");\n if (!src) return;\n const imageElement = controller.element;\n controller.isLoading = true;\n method(controller, \"loading\").call(controller, src);\n imageElement.onload = () => {\n handleLoaded(src);\n };\n imageElement.src = src;\n };\n const handleLoaded = src => {\n controller.isLoading = false;\n controller.isLoaded = true;\n method(controller, \"loaded\").call(controller, src);\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new IntersectionObserver(callback, options);\n const observe = () => {\n observer.observe(controller.element);\n };\n const unobserve = () => {\n observer.unobserve(controller.element);\n };\n Object.assign(controller, {\n isVisible: false,\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass LazyLoadComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isLoading = false;\n this.isLoaded = false;\n }\n}\n\nclass LazyLoadController extends LazyLoadComposableController {\n constructor(context) {\n super(context);\n this.options = {\n rootMargin: \"10%\"\n };\n requestAnimationFrame((() => {\n const [observe, unobserve] = useLazyLoad(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultOptions$2 = {\n mediaQueries: {},\n dispatchEvent: true,\n eventPrefix: true,\n debug: false\n};\n\nclass UseMatchMedia extends StimulusUse {\n constructor(controller, options = {}) {\n var _a, _b, _c, _d;\n super(controller, options);\n this.matches = [];\n this.callback = event => {\n const name = Object.keys(this.mediaQueries).find((name => this.mediaQueries[name] === event.media));\n if (!name) return;\n const {media: media, matches: matches} = event;\n this.changed({\n name: name,\n media: media,\n matches: matches,\n event: event\n });\n };\n this.changed = payload => {\n const {name: name} = payload;\n if (payload.event) {\n this.call(camelize(`${name}_changed`), payload);\n this.dispatch(`${name}:changed`, payload);\n this.log(`media query \"${name}\" changed`, payload);\n }\n if (payload.matches) {\n this.call(camelize(`is_${name}`), payload);\n this.dispatch(`is:${name}`, payload);\n } else {\n this.call(camelize(`not_${name}`), payload);\n this.dispatch(`not:${name}`, payload);\n }\n };\n this.observe = () => {\n Object.keys(this.mediaQueries).forEach((name => {\n const media = this.mediaQueries[name];\n const match = window.matchMedia(media);\n match.addListener(this.callback);\n this.matches.push(match);\n this.changed({\n name: name,\n media: media,\n matches: match.matches\n });\n }));\n };\n this.unobserve = () => {\n this.matches.forEach((match => match.removeListener(this.callback)));\n };\n this.controller = controller;\n this.mediaQueries = (_a = options.mediaQueries) !== null && _a !== void 0 ? _a : defaultOptions$2.mediaQueries;\n this.dispatchEvent = (_b = options.dispatchEvent) !== null && _b !== void 0 ? _b : defaultOptions$2.dispatchEvent;\n this.eventPrefix = (_c = options.eventPrefix) !== null && _c !== void 0 ? _c : defaultOptions$2.eventPrefix;\n this.debug = (_d = options.debug) !== null && _d !== void 0 ? _d : defaultOptions$2.debug;\n if (!window.matchMedia) {\n console.error(\"window.matchMedia() is not available\");\n return;\n }\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useMatchMedia = (controller, options = {}) => {\n const observer = new UseMatchMedia(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nconst memoize = (controller, name, value) => {\n Object.defineProperty(controller, name, {\n value: value\n });\n return value;\n};\n\nconst useMemo = controller => {\n var _a;\n (_a = controller.constructor.memos) === null || _a === void 0 ? void 0 : _a.forEach((getter => {\n memoize(controller, getter, controller[getter]);\n }));\n};\n\nconst defineMetaGetter = (controller, metaName, suffix) => {\n const getterName = suffix ? `${camelize(metaName)}Meta` : camelize(metaName);\n Object.defineProperty(controller, getterName, {\n get() {\n return typeCast(metaValue(metaName));\n }\n });\n};\n\nfunction metaValue(name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`);\n return element && element.getAttribute(\"content\");\n}\n\nfunction typeCast(value) {\n try {\n return JSON.parse(value);\n } catch (o_O) {\n return value;\n }\n}\n\nconst useMeta = (controller, options = {\n suffix: true\n}) => {\n const metaNames = controller.constructor.metaNames;\n const suffix = options.suffix;\n metaNames === null || metaNames === void 0 ? void 0 : metaNames.forEach((metaName => {\n defineMetaGetter(controller, metaName, suffix);\n }));\n Object.defineProperty(controller, \"metas\", {\n get() {\n const result = {};\n metaNames === null || metaNames === void 0 ? void 0 : metaNames.forEach((metaName => {\n const value = typeCast(metaValue(metaName));\n if (value !== undefined && value !== null) {\n result[camelize(metaName)] = value;\n }\n }));\n return result;\n }\n });\n};\n\nclass UseMutation extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n try {\n this.observer.observe(this.targetElement, this.options);\n } catch (error) {\n this.controller.application.handleError(error, \"At a minimum, one of childList, attributes, and/or characterData must be true\", {});\n }\n };\n this.unobserve = () => {\n this.observer.disconnect();\n };\n this.mutation = entries => {\n this.call(\"mutate\", entries);\n this.log(\"mutate\", {\n entries: entries\n });\n this.dispatch(\"mutate\", {\n entries: entries\n });\n };\n this.targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n this.controller = controller;\n this.options = options;\n this.observer = new MutationObserver(this.mutation);\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useMutation = (controller, options = {}) => {\n const observer = new UseMutation(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass MutationComposableController extends Controller {}\n\nclass MutationController extends MutationComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useMutation(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst defaultOptions$1 = {\n dispatchEvent: true,\n eventPrefix: true\n};\n\nconst useResize = (composableController, options = {}) => {\n const controller = composableController;\n const {dispatchEvent: dispatchEvent, eventPrefix: eventPrefix} = Object.assign({}, defaultOptions$1, options);\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || controller.element;\n const callback = entries => {\n const [entry] = entries;\n method(controller, \"resize\").call(controller, entry.contentRect);\n if (dispatchEvent) {\n const eventName = composeEventName(\"resize\", controller, eventPrefix);\n const appearEvent = extendedEvent(eventName, null, {\n controller: controller,\n entry: entry\n });\n targetElement.dispatchEvent(appearEvent);\n }\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observer = new ResizeObserver(callback);\n const observe = () => {\n observer.observe(targetElement);\n };\n const unobserve = () => {\n observer.unobserve(targetElement);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass ResizeComposableController extends Controller {}\n\nclass ResizeController extends ResizeComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useResize(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass UseTargetMutation extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.observer.observe(this.targetElement, {\n subtree: true,\n characterData: true,\n childList: true,\n attributes: true,\n attributeOldValue: true,\n attributeFilter: [ this.targetSelector, this.scopedTargetSelector ]\n });\n };\n this.unobserve = () => {\n this.observer.disconnect();\n };\n this.mutation = entries => {\n for (const mutation of entries) {\n switch (mutation.type) {\n case \"attributes\":\n let newValue = mutation.target.getAttribute(mutation.attributeName);\n let oldValue = mutation.oldValue;\n if (mutation.attributeName === this.targetSelector || mutation.attributeName === this.scopedTargetSelector) {\n let oldTargets = this.targetsUsedByThisController(oldValue);\n let newTargets = this.targetsUsedByThisController(newValue);\n let removedTargets = oldTargets.filter((target => !newTargets.includes(target)));\n let addedTargets = newTargets.filter((target => !oldTargets.includes(target)));\n removedTargets.forEach((target => this.targetRemoved(this.stripIdentifierPrefix(target), mutation.target, \"attributeChange\")));\n addedTargets.forEach((target => this.targetAdded(this.stripIdentifierPrefix(target), mutation.target, \"attributeChange\")));\n }\n break;\n\n case \"characterData\":\n let nodule = this.findTargetInAncestry(mutation.target);\n if (nodule == null) {\n return;\n } else {\n let supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n supportedTargets.forEach((target => {\n this.targetChanged(this.stripIdentifierPrefix(target), nodule, \"domMutation\");\n }));\n }\n break;\n\n case \"childList\":\n let {addedNodes: addedNodes, removedNodes: removedNodes} = mutation;\n addedNodes.forEach((node => this.processNodeDOMMutation(node, this.targetAdded)));\n removedNodes.forEach((node => this.processNodeDOMMutation(node, this.targetRemoved)));\n break;\n }\n }\n };\n this.controller = controller;\n this.options = options;\n this.targetElement = controller.element;\n this.identifier = controller.scope.identifier;\n this.identifierPrefix = `${this.identifier}.`;\n this.targetSelector = controller.scope.schema.targetAttribute;\n this.scopedTargetSelector = `data-${this.identifier}-target`;\n this.targets = options.targets || controller.constructor.targets;\n this.prefixedTargets = this.targets.map((target => `${this.identifierPrefix}${target}`));\n this.observer = new MutationObserver(this.mutation);\n this.enhanceController();\n this.observe();\n }\n processNodeDOMMutation(node, initialChangeModeAssumption) {\n let nodule = node;\n let change = initialChangeModeAssumption;\n let supportedTargets = [];\n if (nodule.nodeName == \"#text\" || this.targetsUsedByThisControllerFromNode(nodule).length == 0) {\n change = this.targetChanged;\n nodule = this.findTargetInAncestry(node);\n } else {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n if (nodule == null) {\n return;\n } else if (supportedTargets.length == 0) {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n supportedTargets.forEach((target => {\n change.call(this, this.stripIdentifierPrefix(target), nodule, \"domMutation\");\n }));\n }\n findTargetInAncestry(node) {\n let nodule = node;\n let supportedTargets = [];\n if (nodule.nodeName != \"#text\") {\n supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n }\n while (nodule.parentNode !== null && nodule.parentNode != this.targetElement && supportedTargets.length == 0) {\n nodule = nodule.parentNode;\n if (nodule.nodeName !== \"#text\") {\n let supportedTargets = this.targetsUsedByThisControllerFromNode(nodule);\n if (supportedTargets.length > 0) {\n return nodule;\n }\n }\n }\n if (nodule.nodeName == \"#text\") {\n return null;\n }\n if (nodule.parentNode == null) {\n return null;\n }\n if (nodule.parentNode == this.targetElement) {\n if (this.targetsUsedByThisControllerFromNode(nodule).length > 0) {\n return nodule;\n }\n return null;\n }\n return null;\n }\n targetAdded(name, node, trigger) {\n let targetCallback = `${name}TargetAdded`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.warn(\"`[target]TargetAdded` is deprecated. Please use the built-in `[target]TargetConnected()` function from Stimulus.\");\n this.log(\"targetAdded\", {\n target: name,\n node: node,\n trigger: trigger\n });\n }\n targetRemoved(name, node, trigger) {\n let targetCallback = `${name}TargetRemoved`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.warn(\"`[target]TargetRemoved` is deprecated. Please use the built-in `[target]TargetDisconnected()` function from Stimulus.\");\n this.log(\"targetRemoved\", {\n target: name,\n node: node,\n trigger: trigger\n });\n }\n targetChanged(name, node, trigger) {\n let targetCallback = `${name}TargetChanged`;\n this.controller[targetCallback] && method(this.controller, targetCallback).call(this.controller, node);\n this.log(\"targetChanged\", {\n target: name,\n node: node,\n trigger: trigger\n });\n }\n targetsUsedByThisControllerFromNode(node) {\n if (node.nodeName == \"#text\" || node.nodeName == \"#comment\") {\n return [];\n }\n let nodeElement = node;\n return this.targetsUsedByThisController(nodeElement.getAttribute(this.scopedTargetSelector) || nodeElement.getAttribute(this.targetSelector));\n }\n targetsUsedByThisController(targetStr) {\n targetStr = targetStr || \"\";\n let targetsToCheck = this.stripIdentifierPrefix(targetStr).split(\" \");\n return this.targets.filter((n => targetsToCheck.indexOf(n) !== -1));\n }\n stripIdentifierPrefix(target) {\n return target.replace(new RegExp(this.identifierPrefix, \"g\"), \"\");\n }\n enhanceController() {\n const controllerDisconnect = this.controller.disconnect.bind(this.controller);\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useTargetMutation = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseTargetMutation(controller, options);\n observer.warn(\"`[target]TargetAdded` and `[target]TargetRemoved` are deprecated. Please use the built-in `[target]TargetConnected()` and `[target]TargetDisconnected()` functions from Stimulus.\");\n return [ observer.observe, observer.unobserve ];\n};\n\nclass TargetMutationComposableController extends Controller {}\n\nclass TargetMutationController extends TargetMutationComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useTargetMutation(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass ThrottleController extends Controller {}\n\nThrottleController.throttles = [];\n\nconst defaultWait = 200;\n\nfunction throttle(func, wait = defaultWait) {\n let inThrottle;\n return function() {\n const args = arguments;\n const context = this;\n if (!inThrottle) {\n inThrottle = true;\n func.apply(context, args);\n setTimeout((() => inThrottle = false), wait);\n }\n };\n}\n\nconst useThrottle = (composableController, options = {}) => {\n var _a;\n const controller = composableController;\n const constructor = controller.constructor;\n (_a = constructor.throttles) === null || _a === void 0 ? void 0 : _a.forEach((func => {\n if (typeof func === \"string\") {\n controller[func] = throttle(controller[func], options === null || options === void 0 ? void 0 : options.wait);\n }\n if (typeof func === \"object\") {\n const {name: name, wait: wait} = func;\n if (!name) return;\n controller[name] = throttle(controller[name], wait || (options === null || options === void 0 ? void 0 : options.wait));\n }\n }));\n};\n\nconst alpineNames = {\n enterFromClass: \"enter\",\n enterActiveClass: \"enterStart\",\n enterToClass: \"enterEnd\",\n leaveFromClass: \"leave\",\n leaveActiveClass: \"leaveStart\",\n leaveToClass: \"leaveEnd\"\n};\n\nconst defaultOptions = {\n transitioned: false,\n hiddenClass: \"hidden\",\n preserveOriginalClass: true,\n removeToClasses: true\n};\n\nconst useTransition = (composableController, options = {}) => {\n var _a, _b, _c;\n const controller = composableController;\n const targetName = controller.element.dataset.transitionTarget;\n let targetFromAttribute;\n if (targetName) {\n targetFromAttribute = controller[`${targetName}Target`];\n }\n const targetElement = (options === null || options === void 0 ? void 0 : options.element) || targetFromAttribute || controller.element;\n if (!(targetElement instanceof HTMLElement || targetElement instanceof SVGElement)) return;\n const dataset = targetElement.dataset;\n const leaveAfter = parseInt(dataset.leaveAfter || \"\") || options.leaveAfter || 0;\n const {transitioned: transitioned, hiddenClass: hiddenClass, preserveOriginalClass: preserveOriginalClass, removeToClasses: removeToClasses} = Object.assign({}, defaultOptions, options);\n const controllerEnter = (_a = controller.enter) === null || _a === void 0 ? void 0 : _a.bind(controller);\n const controllerLeave = (_b = controller.leave) === null || _b === void 0 ? void 0 : _b.bind(controller);\n const controllerToggleTransition = (_c = controller.toggleTransition) === null || _c === void 0 ? void 0 : _c.bind(controller);\n async function enter(event) {\n if (controller.transitioned) return;\n controller.transitioned = true;\n controllerEnter && controllerEnter(event);\n const enterFromClasses = getAttribute(\"enterFrom\", options, dataset);\n const enterActiveClasses = getAttribute(\"enterActive\", options, dataset);\n const enterToClasses = getAttribute(\"enterTo\", options, dataset);\n const leaveToClasses = getAttribute(\"leaveTo\", options, dataset);\n if (!!hiddenClass) {\n targetElement.classList.remove(hiddenClass);\n }\n if (!removeToClasses) {\n removeClasses(targetElement, leaveToClasses);\n }\n await transition(targetElement, enterFromClasses, enterActiveClasses, enterToClasses, hiddenClass, preserveOriginalClass, removeToClasses);\n if (leaveAfter > 0) {\n setTimeout((() => {\n leave(event);\n }), leaveAfter);\n }\n }\n async function leave(event) {\n if (!controller.transitioned) return;\n controller.transitioned = false;\n controllerLeave && controllerLeave(event);\n const leaveFromClasses = getAttribute(\"leaveFrom\", options, dataset);\n const leaveActiveClasses = getAttribute(\"leaveActive\", options, dataset);\n const leaveToClasses = getAttribute(\"leaveTo\", options, dataset);\n const enterToClasses = getAttribute(\"enterTo\", options, dataset);\n if (!removeToClasses) {\n removeClasses(targetElement, enterToClasses);\n }\n await transition(targetElement, leaveFromClasses, leaveActiveClasses, leaveToClasses, hiddenClass, preserveOriginalClass, removeToClasses);\n if (!!hiddenClass) {\n targetElement.classList.add(hiddenClass);\n }\n }\n function toggleTransition(event) {\n controllerToggleTransition && controllerToggleTransition(event);\n if (controller.transitioned) {\n leave();\n } else {\n enter();\n }\n }\n async function transition(element, initialClasses, activeClasses, endClasses, hiddenClass, preserveOriginalClass, removeEndClasses) {\n const stashedClasses = [];\n if (preserveOriginalClass) {\n initialClasses.forEach((cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls)));\n activeClasses.forEach((cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls)));\n endClasses.forEach((cls => element.classList.contains(cls) && cls !== hiddenClass && stashedClasses.push(cls)));\n }\n addClasses(element, initialClasses);\n removeClasses(element, stashedClasses);\n addClasses(element, activeClasses);\n await nextAnimationFrame();\n removeClasses(element, initialClasses);\n addClasses(element, endClasses);\n await afterTransition(element);\n removeClasses(element, activeClasses);\n if (removeEndClasses) {\n removeClasses(element, endClasses);\n }\n addClasses(element, stashedClasses);\n }\n function initialState() {\n controller.transitioned = transitioned;\n if (transitioned) {\n if (!!hiddenClass) {\n targetElement.classList.remove(hiddenClass);\n }\n enter();\n } else {\n if (!!hiddenClass) {\n targetElement.classList.add(hiddenClass);\n }\n leave();\n }\n }\n function addClasses(element, classes) {\n if (classes.length > 0) {\n element.classList.add(...classes);\n }\n }\n function removeClasses(element, classes) {\n if (classes.length > 0) {\n element.classList.remove(...classes);\n }\n }\n initialState();\n Object.assign(controller, {\n enter: enter,\n leave: leave,\n toggleTransition: toggleTransition\n });\n return [ enter, leave, toggleTransition ];\n};\n\nfunction getAttribute(name, options, dataset) {\n const datasetName = `transition${name[0].toUpperCase()}${name.substr(1)}`;\n const datasetAlpineName = alpineNames[name];\n const classes = options[name] || dataset[datasetName] || dataset[datasetAlpineName] || \" \";\n return isEmpty(classes) ? [] : classes.split(\" \");\n}\n\nasync function afterTransition(element) {\n return new Promise((resolve => {\n const duration = Number(getComputedStyle(element).transitionDuration.split(\",\")[0].replace(\"s\", \"\")) * 1e3;\n setTimeout((() => {\n resolve(duration);\n }), duration);\n }));\n}\n\nasync function nextAnimationFrame() {\n return new Promise((resolve => {\n requestAnimationFrame((() => {\n requestAnimationFrame(resolve);\n }));\n }));\n}\n\nfunction isEmpty(str) {\n return str.length === 0 || !str.trim();\n}\n\nclass TransitionComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.transitioned = false;\n }\n}\n\nclass TransitionController extends TransitionComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n useTransition(this, this.options);\n }));\n }\n}\n\nclass UseVisibility extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n this.controller.isVisible = !document.hidden;\n document.addEventListener(\"visibilitychange\", this.handleVisibilityChange);\n this.handleVisibilityChange();\n };\n this.unobserve = () => {\n document.removeEventListener(\"visibilitychange\", this.handleVisibilityChange);\n };\n this.becomesInvisible = event => {\n this.controller.isVisible = false;\n this.call(\"invisible\", event);\n this.log(\"invisible\", {\n isVisible: false\n });\n this.dispatch(\"invisible\", {\n event: event,\n isVisible: false\n });\n };\n this.becomesVisible = event => {\n this.controller.isVisible = true;\n this.call(\"visible\", event);\n this.log(\"visible\", {\n isVisible: true\n });\n this.dispatch(\"visible\", {\n event: event,\n isVisible: true\n });\n };\n this.handleVisibilityChange = event => {\n if (document.hidden) {\n this.becomesInvisible(event);\n } else {\n this.becomesVisible(event);\n }\n };\n this.controller = controller;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controllerDisconnect;\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useVisibility = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseVisibility(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass VisibilityComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.isVisible = false;\n }\n}\n\nclass VisibilityController extends VisibilityComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useVisibility(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nclass UseWindowFocus extends StimulusUse {\n constructor(controller, options = {}) {\n super(controller, options);\n this.observe = () => {\n if (document.hasFocus()) {\n this.becomesFocused();\n } else {\n this.becomesUnfocused();\n }\n this.interval = setInterval((() => {\n this.handleWindowFocusChange();\n }), this.intervalDuration);\n };\n this.unobserve = () => {\n clearInterval(this.interval);\n };\n this.becomesUnfocused = event => {\n this.controller.hasFocus = false;\n this.call(\"unfocus\", event);\n this.log(\"unfocus\", {\n hasFocus: false\n });\n this.dispatch(\"unfocus\", {\n event: event,\n hasFocus: false\n });\n };\n this.becomesFocused = event => {\n this.controller.hasFocus = true;\n this.call(\"focus\", event);\n this.log(\"focus\", {\n hasFocus: true\n });\n this.dispatch(\"focus\", {\n event: event,\n hasFocus: true\n });\n };\n this.handleWindowFocusChange = event => {\n if (document.hasFocus() && !this.controller.hasFocus) {\n this.becomesFocused(event);\n } else if (!document.hasFocus() && this.controller.hasFocus) {\n this.becomesUnfocused(event);\n }\n };\n this.controller = controller;\n this.intervalDuration = options.interval || 200;\n this.enhanceController();\n this.observe();\n }\n enhanceController() {\n const controllerDisconnect = this.controllerDisconnect;\n const disconnect = () => {\n this.unobserve();\n controllerDisconnect();\n };\n Object.assign(this.controller, {\n disconnect: disconnect\n });\n }\n}\n\nconst useWindowFocus = (composableController, options = {}) => {\n const controller = composableController;\n const observer = new UseWindowFocus(controller, options);\n return [ observer.observe, observer.unobserve ];\n};\n\nclass WindowFocusComposableController extends Controller {\n constructor() {\n super(...arguments);\n this.hasFocus = false;\n }\n}\n\nclass WindowFocusController extends WindowFocusComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useWindowFocus(this, this.options);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nconst useWindowResize = composableController => {\n const controller = composableController;\n const callback = event => {\n const {innerWidth: innerWidth, innerHeight: innerHeight} = window;\n const payload = {\n height: innerHeight || Infinity,\n width: innerWidth || Infinity,\n event: event\n };\n method(controller, \"windowResize\").call(controller, payload);\n };\n const controllerDisconnect = controller.disconnect.bind(controller);\n const observe = () => {\n window.addEventListener(\"resize\", callback);\n callback();\n };\n const unobserve = () => {\n window.removeEventListener(\"resize\", callback);\n };\n Object.assign(controller, {\n disconnect() {\n unobserve();\n controllerDisconnect();\n }\n });\n observe();\n return [ observe, unobserve ];\n};\n\nclass WindowResizeComposableController extends Controller {}\n\nclass WindowResizeController extends WindowResizeComposableController {\n constructor(context) {\n super(context);\n requestAnimationFrame((() => {\n const [observe, unobserve] = useWindowResize(this);\n Object.assign(this, {\n observe: observe,\n unobserve: unobserve\n });\n }));\n }\n}\n\nfunction useHotkeys() {\n throw \"[stimulus-use] Notice: The import for `useHotkeys()` has been moved from `stimulus-use` to `stimulus-use/hotkeys`. \\nPlease change the import accordingly and add `hotkey-js` as a dependency to your project. \\n\\nFor more information see: https://stimulus-use.github.io/stimulus-use/#/use-hotkeys?id=importing-the-behavior\";\n}\n\nexport { ApplicationController, ClickOutsideController, HoverController, IdleController, IntersectionController, LazyLoadController, MutationController, ResizeController, TargetMutationController, TransitionController, UseHover, UseMutation, UseTargetMutation, UseVisibility, UseWindowFocus, VisibilityController, WindowFocusController, WindowResizeController, debounce, useApplication, useClickOutside, useDebounce, useDispatch, useHotkeys, useHover, useIdle, useIntersection, useLazyLoad, useMatchMedia, useMemo, useMeta, useMutation, useResize, useTargetMutation, useThrottle, useTransition, useVisibility, useWindowFocus, useWindowResize };\n","import { Controller } from \"@hotwired/stimulus\";\nimport { useClickOutside } from \"stimulus-use\";\n\nexport default class extends Controller {\n connect() {\n useClickOutside(this, { element: this.element });\n }\n\n clickOutside(event: Event) {\n this.element.open = false;\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport { TypedController, Value } from \"@vytant/stimulus-decorators\";\n\n@TypedController\nexport default class extends Controller {\n @Value(String) textValue: string;\n\n copy() {\n navigator.clipboard.writeText(this.textValue);\n }\n}\n","import { Target, TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly remainingTimeTarget?: HTMLElement;\n\n @Value(String) redirectUrlValue: string;\n @Value(Number) durationValue = 3000;\n\n connect() {\n super.connect();\n let time = Math.floor(Math.round(this.durationValue / 100) / 10);\n\n this.updateRemainingTime(time);\n time--;\n\n const int = setInterval(() => {\n this.updateRemainingTime(time);\n time--;\n\n if (time <= 0) {\n clearInterval(int);\n window.location.href = this.redirectUrlValue;\n }\n }, 1000);\n }\n\n private updateRemainingTime(time: number) {\n if (!this.remainingTimeTarget) return;\n\n this.remainingTimeTarget.innerText = time.toString();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport { TypedController, Value } from \"@vytant/stimulus-decorators\";\n\n@TypedController\nexport default class extends Controller {\n @Value(String) textValue!: string;\n\n connect() {\n this.element.addEventListener(\"submit\", (event) => {\n if (event.submitter?.dataset.skipConfirm !== \"true\") {\n if (!confirm(this.textValue || \"Are you sure?\")) {\n event.preventDefault();\n return;\n }\n }\n\n this.element.form?.requestSubmit();\n });\n }\n}\n","import { TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\nimport ModalController from \"../../components/modal/controller\";\n\n@TypedController\nexport default class extends Controller {\n static outlets = [\"modal\"];\n\n declare readonly modalOutlet: ModalController;\n\n open() {\n this.modalOutlet.openModal();\n }\n\n close() {\n this.modalOutlet.closeModal();\n }\n}\n","import { TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Value(Number) readonly timeValue = 5000;\n\n connect() {\n setTimeout(() => {\n this.element.classList.remove(\"hidden\");\n }, this.timeValue);\n }\n}\n","export class FetchResponse {\n constructor (response) {\n this.response = response\n }\n\n get statusCode () {\n return this.response.status\n }\n\n get redirected () {\n return this.response.redirected\n }\n\n get ok () {\n return this.response.ok\n }\n\n get unauthenticated () {\n return this.statusCode === 401\n }\n\n get unprocessableEntity () {\n return this.statusCode === 422\n }\n\n get authenticationURL () {\n return this.response.headers.get('WWW-Authenticate')\n }\n\n get contentType () {\n const contentType = this.response.headers.get('Content-Type') || ''\n\n return contentType.replace(/;.*$/, '')\n }\n\n get headers () {\n return this.response.headers\n }\n\n get html () {\n if (this.contentType.match(/^(application|text)\\/(html|xhtml\\+xml)$/)) {\n return this.text\n }\n\n return Promise.reject(new Error(`Expected an HTML response but got \"${this.contentType}\" instead`))\n }\n\n get json () {\n if (this.contentType.match(/^application\\/.*json$/)) {\n return this.responseJson || (this.responseJson = this.response.json())\n }\n\n return Promise.reject(new Error(`Expected a JSON response but got \"${this.contentType}\" instead`))\n }\n\n get text () {\n return this.responseText || (this.responseText = this.response.text())\n }\n\n get isTurboStream () {\n return this.contentType.match(/^text\\/vnd\\.turbo-stream\\.html/)\n }\n\n async renderTurboStream () {\n if (this.isTurboStream) {\n if (window.Turbo) {\n await window.Turbo.renderStreamMessage(await this.text)\n } else {\n console.warn('You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js')\n }\n } else {\n return Promise.reject(new Error(`Expected a Turbo Stream response but got \"${this.contentType}\" instead`))\n }\n }\n}\n","export class RequestInterceptor {\n static register (interceptor) {\n this.interceptor = interceptor\n }\n\n static get () {\n return this.interceptor\n }\n\n static reset () {\n this.interceptor = undefined\n }\n}\n","export function getCookie (name) {\n const cookies = document.cookie ? document.cookie.split('; ') : []\n const prefix = `${encodeURIComponent(name)}=`\n const cookie = cookies.find(cookie => cookie.startsWith(prefix))\n\n if (cookie) {\n const value = cookie.split('=').slice(1).join('=')\n\n if (value) {\n return decodeURIComponent(value)\n }\n }\n}\n\nexport function compact (object) {\n const result = {}\n\n for (const key in object) {\n const value = object[key]\n if (value !== undefined) {\n result[key] = value\n }\n }\n\n return result\n}\n\nexport function metaContent (name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`)\n return element && element.content\n}\n\nexport function stringEntriesFromFormData (formData) {\n return [...formData].reduce((entries, [name, value]) => {\n return entries.concat(typeof value === 'string' ? [[name, value]] : [])\n }, [])\n}\n\nexport function mergeEntries (searchParams, entries) {\n for (const [name, value] of entries) {\n if (value instanceof window.File) continue\n\n if (searchParams.has(name) && !name.includes('[]')) {\n searchParams.delete(name)\n searchParams.set(name, value)\n } else {\n searchParams.append(name, value)\n }\n }\n}\n","import { FetchResponse } from './fetch_response'\nimport { RequestInterceptor } from './request_interceptor'\nimport { getCookie, compact, metaContent, stringEntriesFromFormData, mergeEntries } from './lib/utils'\n\nexport class FetchRequest {\n constructor (method, url, options = {}) {\n this.method = method\n this.options = options\n this.originalUrl = url.toString()\n }\n\n async perform () {\n try {\n const requestInterceptor = RequestInterceptor.get()\n if (requestInterceptor) {\n await requestInterceptor(this)\n }\n } catch (error) {\n console.error(error)\n }\n\n const response = new FetchResponse(await window.fetch(this.url, this.fetchOptions))\n\n if (response.unauthenticated && response.authenticationURL) {\n return Promise.reject(window.location.href = response.authenticationURL)\n }\n\n const responseStatusIsTurboStreamable = response.ok || response.unprocessableEntity\n\n if (responseStatusIsTurboStreamable && response.isTurboStream) {\n await response.renderTurboStream()\n }\n\n return response\n }\n\n addHeader (key, value) {\n const headers = this.additionalHeaders\n headers[key] = value\n this.options.headers = headers\n }\n\n sameHostname () {\n if (!this.originalUrl.startsWith('http:')) {\n return true\n }\n\n try {\n return new URL(this.originalUrl).hostname === window.location.hostname\n } catch (_) {\n return true\n }\n }\n\n get fetchOptions () {\n return {\n method: this.method.toUpperCase(),\n headers: this.headers,\n body: this.formattedBody,\n signal: this.signal,\n credentials: this.credentials,\n redirect: this.redirect\n }\n }\n\n get headers () {\n const baseHeaders = {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': this.contentType,\n Accept: this.accept\n }\n\n if (this.sameHostname()) {\n baseHeaders['X-CSRF-Token'] = this.csrfToken\n }\n\n return compact(\n Object.assign(baseHeaders, this.additionalHeaders)\n )\n }\n\n get csrfToken () {\n return getCookie(metaContent('csrf-param')) || metaContent('csrf-token')\n }\n\n get contentType () {\n if (this.options.contentType) {\n return this.options.contentType\n } else if (this.body == null || this.body instanceof window.FormData) {\n return undefined\n } else if (this.body instanceof window.File) {\n return this.body.type\n }\n\n return 'application/json'\n }\n\n get accept () {\n switch (this.responseKind) {\n case 'html':\n return 'text/html, application/xhtml+xml'\n case 'turbo-stream':\n return 'text/vnd.turbo-stream.html, text/html, application/xhtml+xml'\n case 'json':\n return 'application/json, application/vnd.api+json'\n default:\n return '*/*'\n }\n }\n\n get body () {\n return this.options.body\n }\n\n get query () {\n const originalQuery = (this.originalUrl.split('?')[1] || '').split('#')[0]\n const params = new URLSearchParams(originalQuery)\n\n let requestQuery = this.options.query\n if (requestQuery instanceof window.FormData) {\n requestQuery = stringEntriesFromFormData(requestQuery)\n } else if (requestQuery instanceof window.URLSearchParams) {\n requestQuery = requestQuery.entries()\n } else {\n requestQuery = Object.entries(requestQuery || {})\n }\n\n mergeEntries(params, requestQuery)\n\n const query = params.toString()\n return (query.length > 0 ? `?${query}` : '')\n }\n\n get url () {\n return (this.originalUrl.split('?')[0]).split('#')[0] + this.query\n }\n\n get responseKind () {\n return this.options.responseKind || 'html'\n }\n\n get signal () {\n return this.options.signal\n }\n\n get redirect () {\n return this.options.redirect || 'follow'\n }\n\n get credentials () {\n return this.options.credentials || 'same-origin'\n }\n\n get additionalHeaders () {\n return this.options.headers || {}\n }\n\n get formattedBody () {\n const bodyIsAString = Object.prototype.toString.call(this.body) === '[object String]'\n const contentTypeIsJson = this.headers['Content-Type'] === 'application/json'\n\n if (contentTypeIsJson && !bodyIsAString) {\n return JSON.stringify(this.body)\n }\n\n return this.body\n }\n}\n","import { FetchRequest } from './fetch_request'\n\nasync function get (url, options) {\n const request = new FetchRequest('get', url, options)\n return request.perform()\n}\n\nasync function post (url, options) {\n const request = new FetchRequest('post', url, options)\n return request.perform()\n}\n\nasync function put (url, options) {\n const request = new FetchRequest('put', url, options)\n return request.perform()\n}\n\nasync function patch (url, options) {\n const request = new FetchRequest('patch', url, options)\n return request.perform()\n}\n\nasync function destroy (url, options) {\n const request = new FetchRequest('delete', url, options)\n return request.perform()\n}\n\nexport { get, post, put, patch, destroy }\n","/**!\n * Sortable 1.15.1\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n return target;\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n return _typeof(obj);\n}\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = _objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.1\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Returns the content rect of the element (bounding rect minus border and padding)\r\n * @param {HTMLElement} el \r\n */\nfunction getContentRect(el) {\n var rect = getRect(el);\n var paddingLeft = parseInt(css(el, 'padding-left')),\n paddingTop = parseInt(css(el, 'padding-top')),\n paddingRight = parseInt(css(el, 'padding-right')),\n paddingBottom = parseInt(css(el, 'padding-bottom'));\n rect.top += paddingTop + parseInt(css(el, 'border-top-width'));\n rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));\n // Client Width/Height includes padding only\n rect.width = el.clientWidth - paddingLeft - paddingRight;\n rect.height = el.clientHeight - paddingTop - paddingBottom;\n rect.bottom = rect.top + rect.height;\n rect.right = rect.left + rect.width;\n return rect;\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = parent.parentNode);\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var sortableContentRect = getContentRect(sortable.el);\n var spacer = 10;\n return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","import { Controller as n } from \"@hotwired/stimulus\";\nimport s from \"sortablejs\";\nimport { patch as o } from \"@rails/request.js\";\nclass r extends n {\n initialize() {\n this.onUpdate = this.onUpdate.bind(this);\n }\n connect() {\n this.sortable = new s(this.element, {\n ...this.defaultOptions,\n ...this.options\n });\n }\n disconnect() {\n this.sortable.destroy(), this.sortable = void 0;\n }\n async onUpdate({ item: t, newIndex: a }) {\n if (!t.dataset.sortableUpdateUrl)\n return;\n const i = this.resourceNameValue ? `${this.resourceNameValue}[${this.paramNameValue}]` : this.paramNameValue, e = new FormData();\n return e.append(i, a + 1), await o(t.dataset.sortableUpdateUrl, { body: e, responseKind: this.responseKindValue });\n }\n get options() {\n return {\n animation: this.animationValue || this.defaultOptions.animation || 150,\n handle: this.handleValue || this.defaultOptions.handle || void 0,\n onUpdate: this.onUpdate\n };\n }\n get defaultOptions() {\n return {};\n }\n}\nr.values = {\n resourceName: String,\n paramName: {\n type: String,\n default: \"position\"\n },\n responseKind: {\n type: String,\n default: \"html\"\n },\n animation: Number,\n handle: String\n};\nexport {\n r as default\n};\n","import { patch } from \"@rails/request.js/src/verbs\";\nimport SortableController from \"stimulus-sortable\";\nimport { Controller } from \"stimulus\";\n\nexport default class extends (SortableController as typeof Controller) {\n private declare readonly resourceNameValue: string | null;\n private declare readonly paramNameValue: string;\n\n async onUpdate(args: any) {\n const { item, newIndex } = args;\n if (!item.dataset.sortableUpdateUrl) return;\n\n const positionOfTheOldElement = this.element.querySelector(`[data-sortable-index=\"${newIndex}\"]`);\n if (!positionOfTheOldElement) return;\n\n const position = positionOfTheOldElement.dataset.sortablePosition;\n if (position === undefined) return;\n\n const resourceKey = this.resourceNameValue ? `${this.resourceNameValue}[${this.paramNameValue}]` : this.paramNameValue;\n const data = new FormData();\n\n data.append(resourceKey, position);\n\n await patch(item.dataset.sortableUpdateUrl, { body: data, responseKind: \"json\", redirect: \"manual\" });\n\n window.location.reload();\n }\n}\n","import { TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Value(String) loadingLabelValue!: string;\n\n connect() {\n this.element.addEventListener(\"click\", (event) => {\n if (!this.element.form) return;\n\n if (this.element.form.checkValidity()) {\n if (this.loadingLabelValue) {\n this.element.value = this.loadingLabelValue;\n }\n\n this.element.disabled = true; // this cancels the default event\n }\n\n this.element.form?.requestSubmit();\n });\n }\n}\n","import { Target, Targets, TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Targets elementTargets: (HTMLInputElement | HTMLSelectElement)[];\n\n @Target submitterTarget: HTMLInputElement | null;\n declare readonly hasSubmitterTarget: boolean;\n\n connect() {\n this.elementTargets.forEach((elem) => {\n if (![\"select\", \"checkbox\"].includes(elem.type)) {\n console.error(\"This controller doesnt work on textarea/input because it submits without any debounce on any change\");\n return;\n }\n\n elem.addEventListener(\"change\", () => {\n const submitter = this.hasSubmitterTarget ? this.submitterTarget : null;\n elem.form!.requestSubmit(submitter); // it should fail if form is null\n\n // TODO: This will technically break for turbo use-cases since we don't want to disable all but fix it then\n this.elementTargets.forEach((e) => e.setAttribute(\"disabled\", \"disabled\"));\n });\n });\n }\n}\n","import { Target, TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly resendAgainTextTarget: HTMLInputElement;\n @Target readonly resendAgainButtonTarget: HTMLButtonElement;\n\n private declare readonly hasResendAgainTextTarget: boolean;\n\n connect() {\n if (!this.hasResendAgainTextTarget) {\n return;\n }\n\n setTimeout(() => {\n this.resendAgainButtonTarget.disabled = false;\n this.resendAgainTextTarget.classList.remove(\"tw-opacity-40\");\n }, 10000);\n }\n}\n","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument) {\n const argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (\n argument instanceof Date ||\n (typeof argument === \"object\" && argStr === \"[object Date]\")\n ) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new argument.constructor(+argument);\n } else if (\n typeof argument === \"number\" ||\n argStr === \"[object Number]\" ||\n typeof argument === \"string\" ||\n argStr === \"[object String]\"\n ) {\n // TODO: Can we get rid of as?\n return new Date(argument);\n } else {\n // TODO: Can we get rid of as?\n return new Date(NaN);\n }\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from 'date-fns'\n *\n * // A function that clones a date preserving the original type\n * function cloneDate Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount) {\n const timestamp = +toDate(date);\n return constructFrom(date, timestamp + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { toDate } from \"./toDate.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const utcDate = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}\n","import { addMilliseconds } from \"./addMilliseconds.mjs\";\n\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be added.\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport function addSeconds(date, amount) {\n return addMilliseconds(date, amount * 1000);\n}\n\n// Fallback for modularized imports:\nexport default addSeconds;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const diff = _dateLeft.getTime() - _dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","export function getRoundingMethod(method) {\n return method ? Math[method] : Math.trunc;\n}\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/* eslint-disable no-unused-vars */\n\n/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./en-US/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\nimport { getRoundingMethod } from \"./_lib/roundingMethods.mjs\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date\n * @param baseDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(date, baseDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(date, baseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n let dateLeft;\n let dateRight;\n if (comparison > 0) {\n dateLeft = toDate(baseDate);\n dateRight = toDate(date);\n } else {\n dateLeft = toDate(date);\n dateRight = toDate(baseDate);\n }\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = dateRight.getTime() - dateLeft.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(dateRight) -\n getTimezoneOffsetInMilliseconds(dateLeft);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","import { startOfWeek } from \"./startOfWeek.mjs\";\n\n/**\n * The {@link isSameWeek} function options.\n */\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to check\n * @param dateRight - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same week (and month and year)\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameWeek(dateLeft, dateRight, options) {\n const dateLeftStartOfWeek = startOfWeek(dateLeft, options);\n const dateRightStartOfWeek = startOfWeek(dateRight, options);\n\n return +dateLeftStartOfWeek === +dateRightStartOfWeek;\n}\n\n// Fallback for modularized imports:\nexport default isSameWeek;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n standalone: {\n one: \"weniger als 1 Sekunde\",\n other: \"weniger als {{count}} Sekunden\",\n },\n withPreposition: {\n one: \"weniger als 1 Sekunde\",\n other: \"weniger als {{count}} Sekunden\",\n },\n },\n\n xSeconds: {\n standalone: {\n one: \"1 Sekunde\",\n other: \"{{count}} Sekunden\",\n },\n withPreposition: {\n one: \"1 Sekunde\",\n other: \"{{count}} Sekunden\",\n },\n },\n\n halfAMinute: {\n standalone: \"halbe Minute\",\n withPreposition: \"halben Minute\",\n },\n\n lessThanXMinutes: {\n standalone: {\n one: \"weniger als 1 Minute\",\n other: \"weniger als {{count}} Minuten\",\n },\n withPreposition: {\n one: \"weniger als 1 Minute\",\n other: \"weniger als {{count}} Minuten\",\n },\n },\n\n xMinutes: {\n standalone: {\n one: \"1 Minute\",\n other: \"{{count}} Minuten\",\n },\n withPreposition: {\n one: \"1 Minute\",\n other: \"{{count}} Minuten\",\n },\n },\n\n aboutXHours: {\n standalone: {\n one: \"etwa 1 Stunde\",\n other: \"etwa {{count}} Stunden\",\n },\n withPreposition: {\n one: \"etwa 1 Stunde\",\n other: \"etwa {{count}} Stunden\",\n },\n },\n\n xHours: {\n standalone: {\n one: \"1 Stunde\",\n other: \"{{count}} Stunden\",\n },\n withPreposition: {\n one: \"1 Stunde\",\n other: \"{{count}} Stunden\",\n },\n },\n\n xDays: {\n standalone: {\n one: \"1 Tag\",\n other: \"{{count}} Tage\",\n },\n withPreposition: {\n one: \"1 Tag\",\n other: \"{{count}} Tagen\",\n },\n },\n\n aboutXWeeks: {\n standalone: {\n one: \"etwa 1 Woche\",\n other: \"etwa {{count}} Wochen\",\n },\n withPreposition: {\n one: \"etwa 1 Woche\",\n other: \"etwa {{count}} Wochen\",\n },\n },\n\n xWeeks: {\n standalone: {\n one: \"1 Woche\",\n other: \"{{count}} Wochen\",\n },\n withPreposition: {\n one: \"1 Woche\",\n other: \"{{count}} Wochen\",\n },\n },\n\n aboutXMonths: {\n standalone: {\n one: \"etwa 1 Monat\",\n other: \"etwa {{count}} Monate\",\n },\n withPreposition: {\n one: \"etwa 1 Monat\",\n other: \"etwa {{count}} Monaten\",\n },\n },\n\n xMonths: {\n standalone: {\n one: \"1 Monat\",\n other: \"{{count}} Monate\",\n },\n withPreposition: {\n one: \"1 Monat\",\n other: \"{{count}} Monaten\",\n },\n },\n\n aboutXYears: {\n standalone: {\n one: \"etwa 1 Jahr\",\n other: \"etwa {{count}} Jahre\",\n },\n withPreposition: {\n one: \"etwa 1 Jahr\",\n other: \"etwa {{count}} Jahren\",\n },\n },\n\n xYears: {\n standalone: {\n one: \"1 Jahr\",\n other: \"{{count}} Jahre\",\n },\n withPreposition: {\n one: \"1 Jahr\",\n other: \"{{count}} Jahren\",\n },\n },\n\n overXYears: {\n standalone: {\n one: \"mehr als 1 Jahr\",\n other: \"mehr als {{count}} Jahre\",\n },\n withPreposition: {\n one: \"mehr als 1 Jahr\",\n other: \"mehr als {{count}} Jahren\",\n },\n },\n\n almostXYears: {\n standalone: {\n one: \"fast 1 Jahr\",\n other: \"fast {{count}} Jahre\",\n },\n withPreposition: {\n one: \"fast 1 Jahr\",\n other: \"fast {{count}} Jahren\",\n },\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = options?.addSuffix\n ? formatDistanceLocale[token].withPreposition\n : formatDistanceLocale[token].standalone;\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", String(count));\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return \"vor \" + result;\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\n// DIN 5008: https://de.wikipedia.org/wiki/Datumsformat#DIN_5008\nconst dateFormats = {\n full: \"EEEE, do MMMM y\", // Montag, 7. Januar 2018\n long: \"do MMMM y\", // 7. Januar 2018\n medium: \"do MMM y\", // 7. Jan. 2018\n short: \"dd.MM.y\", // 07.01.2018\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'um' {{time}}\",\n long: \"{{date}} 'um' {{time}}\",\n medium: \"{{date}} {{time}}\",\n short: \"{{date}} {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'letzten' eeee 'um' p\",\n yesterday: \"'gestern um' p\",\n today: \"'heute um' p\",\n tomorrow: \"'morgen um' p\",\n nextWeek: \"eeee 'um' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"v.Chr.\", \"n.Chr.\"],\n abbreviated: [\"v.Chr.\", \"n.Chr.\"],\n wide: [\"vor Christus\", \"nach Christus\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1. Quartal\", \"2. Quartal\", \"3. Quartal\", \"4. Quartal\"],\n};\n\n// Note: in German, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mär\",\n \"Apr\",\n \"Mai\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Okt\",\n \"Nov\",\n \"Dez\",\n ],\n\n wide: [\n \"Januar\",\n \"Februar\",\n \"März\",\n \"April\",\n \"Mai\",\n \"Juni\",\n \"Juli\",\n \"August\",\n \"September\",\n \"Oktober\",\n \"November\",\n \"Dezember\",\n ],\n};\n\n// https://st.unicode.org/cldr-apps/v#/de/Gregorian/\nconst formattingMonthValues = {\n narrow: monthValues.narrow,\n abbreviated: [\n \"Jan.\",\n \"Feb.\",\n \"März\",\n \"Apr.\",\n \"Mai\",\n \"Juni\",\n \"Juli\",\n \"Aug.\",\n \"Sep.\",\n \"Okt.\",\n \"Nov.\",\n \"Dez.\",\n ],\n\n wide: monthValues.wide,\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"D\", \"M\", \"D\", \"F\", \"S\"],\n short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\n abbreviated: [\"So.\", \"Mo.\", \"Di.\", \"Mi.\", \"Do.\", \"Fr.\", \"Sa.\"],\n wide: [\n \"Sonntag\",\n \"Montag\",\n \"Dienstag\",\n \"Mittwoch\",\n \"Donnerstag\",\n \"Freitag\",\n \"Samstag\",\n ],\n};\n\n// https://www.unicode.org/cldr/charts/32/summary/de.html#1881\nconst dayPeriodValues = {\n narrow: {\n am: \"vm.\",\n pm: \"nm.\",\n midnight: \"Mitternacht\",\n noon: \"Mittag\",\n morning: \"Morgen\",\n afternoon: \"Nachm.\",\n evening: \"Abend\",\n night: \"Nacht\",\n },\n abbreviated: {\n am: \"vorm.\",\n pm: \"nachm.\",\n midnight: \"Mitternacht\",\n noon: \"Mittag\",\n morning: \"Morgen\",\n afternoon: \"Nachmittag\",\n evening: \"Abend\",\n night: \"Nacht\",\n },\n wide: {\n am: \"vormittags\",\n pm: \"nachmittags\",\n midnight: \"Mitternacht\",\n noon: \"Mittag\",\n morning: \"Morgen\",\n afternoon: \"Nachmittag\",\n evening: \"Abend\",\n night: \"Nacht\",\n },\n};\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"vm.\",\n pm: \"nm.\",\n midnight: \"Mitternacht\",\n noon: \"Mittag\",\n morning: \"morgens\",\n afternoon: \"nachm.\",\n evening: \"abends\",\n night: \"nachts\",\n },\n abbreviated: {\n am: \"vorm.\",\n pm: \"nachm.\",\n midnight: \"Mitternacht\",\n noon: \"Mittag\",\n morning: \"morgens\",\n afternoon: \"nachmittags\",\n evening: \"abends\",\n night: \"nachts\",\n },\n wide: {\n am: \"vormittags\",\n pm: \"nachmittags\",\n midnight: \"Mitternacht\",\n noon: \"Mittag\",\n morning: \"morgens\",\n afternoon: \"nachmittags\",\n evening: \"abends\",\n night: \"nachts\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber) => {\n const number = Number(dirtyNumber);\n\n return number + \".\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n formattingValues: formattingMonthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(\\.)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(v\\.? ?Chr\\.?|n\\.? ?Chr\\.?)/i,\n abbreviated: /^(v\\.? ?Chr\\.?|n\\.? ?Chr\\.?)/i,\n wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i,\n};\nconst parseEraPatterns = {\n any: [/^v/i, /^n/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](\\.)? Quartal/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated:\n /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\\.?/i,\n wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^j[aä]/i,\n /^f/i,\n /^mär/i,\n /^ap/i,\n /^mai/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smdmf]/i,\n short: /^(so|mo|di|mi|do|fr|sa)/i,\n abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\\.?/i,\n wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i,\n};\nconst parseDayPatterns = {\n any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(vm\\.?|nm\\.?|Mitternacht|Mittag|morgens|nachm\\.?|abends|nachts)/i,\n abbreviated:\n /^(vorm\\.?|nachm\\.?|Mitternacht|Mittag|morgens|nachm\\.?|abends|nachts)/i,\n wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^v/i,\n pm: /^n/i,\n midnight: /^Mitte/i,\n noon: /^Mitta/i,\n morning: /morgens/i,\n afternoon: /nachmittags/i, // will never be matched. Afternoon is matched by `pm`\n evening: /abends/i,\n night: /nachts/i, // will never be matched. Night is matched by `pm`\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./de/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./de/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./de/_lib/formatRelative.mjs\";\nimport { localize } from \"./de/_lib/localize.mjs\";\nimport { match } from \"./de/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary German locale.\n * @language German\n * @iso-639-2 deu\n * @author Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu)\n * @author Asia [@asia-t](https://github.com/asia-t)\n * @author Van Vuong Ngo [@vanvuongngo](https://github.com/vanvuongngo)\n * @author RomanErnst [@pex](https://github.com/pex)\n * @author Philipp Keck [@Philipp91](https://github.com/Philipp91)\n */\nexport const de = {\n code: \"de\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default de;\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, d MMMM yyyy\",\n long: \"d MMMM yyyy\",\n medium: \"d MMM yyyy\",\n short: \"dd/MM/yyyy\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.mjs\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.mjs\";\nimport { localize } from \"./en-US/_lib/localize.mjs\";\nimport { match } from \"./en-US/_lib/match.mjs\";\nimport { formatLong } from \"./en-GB/_lib/formatLong.mjs\";\n\n/**\n * @category Locales\n * @summary English locale (United Kingdom).\n * @language English\n * @iso-639-2 eng\n * @author Alex [@glintik](https://github.com/glintik)\n */\nexport const enGB = {\n code: \"en-GB\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default enGB;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"moins d’une seconde\",\n other: \"moins de {{count}} secondes\",\n },\n\n xSeconds: {\n one: \"1 seconde\",\n other: \"{{count}} secondes\",\n },\n\n halfAMinute: \"30 secondes\",\n\n lessThanXMinutes: {\n one: \"moins d’une minute\",\n other: \"moins de {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"environ 1 heure\",\n other: \"environ {{count}} heures\",\n },\n\n xHours: {\n one: \"1 heure\",\n other: \"{{count}} heures\",\n },\n\n xDays: {\n one: \"1 jour\",\n other: \"{{count}} jours\",\n },\n\n aboutXWeeks: {\n one: \"environ 1 semaine\",\n other: \"environ {{count}} semaines\",\n },\n\n xWeeks: {\n one: \"1 semaine\",\n other: \"{{count}} semaines\",\n },\n\n aboutXMonths: {\n one: \"environ 1 mois\",\n other: \"environ {{count}} mois\",\n },\n\n xMonths: {\n one: \"1 mois\",\n other: \"{{count}} mois\",\n },\n\n aboutXYears: {\n one: \"environ 1 an\",\n other: \"environ {{count}} ans\",\n },\n\n xYears: {\n one: \"1 an\",\n other: \"{{count}} ans\",\n },\n\n overXYears: {\n one: \"plus d’un an\",\n other: \"plus de {{count}} ans\",\n },\n\n almostXYears: {\n one: \"presqu’un an\",\n other: \"presque {{count}} ans\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n const form = formatDistanceLocale[token];\n if (typeof form === \"string\") {\n result = form;\n } else if (count === 1) {\n result = form.one;\n } else {\n result = form.other.replace(\"{{count}}\", String(count));\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"dans \" + result;\n } else {\n return \"il y a \" + result;\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE d MMMM y\",\n long: \"d MMMM y\",\n medium: \"d MMM y\",\n short: \"dd/MM/y\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'à' {{time}}\",\n long: \"{{date}} 'à' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"eeee 'dernier à' p\",\n yesterday: \"'hier à' p\",\n today: \"'aujourd’hui à' p\",\n tomorrow: \"'demain à' p'\",\n nextWeek: \"eeee 'prochain à' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"av. J.-C\", \"ap. J.-C\"],\n abbreviated: [\"av. J.-C\", \"ap. J.-C\"],\n wide: [\"avant Jésus-Christ\", \"après Jésus-Christ\"],\n};\n\nconst quarterValues = {\n narrow: [\"T1\", \"T2\", \"T3\", \"T4\"],\n abbreviated: [\"1er trim.\", \"2ème trim.\", \"3ème trim.\", \"4ème trim.\"],\n wide: [\"1er trimestre\", \"2ème trimestre\", \"3ème trimestre\", \"4ème trimestre\"],\n};\n\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"janv.\",\n \"févr.\",\n \"mars\",\n \"avr.\",\n \"mai\",\n \"juin\",\n \"juil.\",\n \"août\",\n \"sept.\",\n \"oct.\",\n \"nov.\",\n \"déc.\",\n ],\n\n wide: [\n \"janvier\",\n \"février\",\n \"mars\",\n \"avril\",\n \"mai\",\n \"juin\",\n \"juillet\",\n \"août\",\n \"septembre\",\n \"octobre\",\n \"novembre\",\n \"décembre\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"D\", \"L\", \"M\", \"M\", \"J\", \"V\", \"S\"],\n short: [\"di\", \"lu\", \"ma\", \"me\", \"je\", \"ve\", \"sa\"],\n abbreviated: [\"dim.\", \"lun.\", \"mar.\", \"mer.\", \"jeu.\", \"ven.\", \"sam.\"],\n\n wide: [\n \"dimanche\",\n \"lundi\",\n \"mardi\",\n \"mercredi\",\n \"jeudi\",\n \"vendredi\",\n \"samedi\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"minuit\",\n noon: \"midi\",\n morning: \"mat.\",\n afternoon: \"ap.m.\",\n evening: \"soir\",\n night: \"mat.\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"minuit\",\n noon: \"midi\",\n morning: \"matin\",\n afternoon: \"après-midi\",\n evening: \"soir\",\n night: \"matin\",\n },\n wide: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"minuit\",\n noon: \"midi\",\n morning: \"du matin\",\n afternoon: \"de l’après-midi\",\n evening: \"du soir\",\n night: \"du matin\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, options) => {\n const number = Number(dirtyNumber);\n const unit = options?.unit;\n\n if (number === 0) return \"0\";\n\n const feminineUnits = [\"year\", \"week\", \"hour\", \"minute\", \"second\"];\n let suffix;\n\n if (number === 1) {\n suffix = unit && feminineUnits.includes(unit) ? \"ère\" : \"er\";\n } else {\n suffix = \"ème\";\n }\n\n return number + suffix;\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(ième|ère|ème|er|e)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(av\\.J\\.C|ap\\.J\\.C|ap\\.J\\.-C)/i,\n abbreviated: /^(av\\.J\\.-C|av\\.J-C|apr\\.J\\.-C|apr\\.J-C|ap\\.J-C)/i,\n wide: /^(avant Jésus-Christ|après Jésus-Christ)/i,\n};\nconst parseEraPatterns = {\n any: [/^av/i, /^ap/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^T?[1234]/i,\n abbreviated: /^[1234](er|ème|e)? trim\\.?/i,\n wide: /^[1234](er|ème|e)? trimestre/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated:\n /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\\.?/i,\n wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^av/i,\n /^ma/i,\n /^juin/i,\n /^juil/i,\n /^ao/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[lmjvsd]/i,\n short: /^(di|lu|ma|me|je|ve|sa)/i,\n abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\\.?/i,\n wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],\n any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|minuit|midi|mat\\.?|ap\\.?m\\.?|soir|nuit)/i,\n any: /^([ap]\\.?\\s?m\\.?|du matin|de l'après[-\\s]midi|du soir|de la nuit)/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^min/i,\n noon: /^mid/i,\n morning: /mat/i,\n afternoon: /ap/i,\n evening: /soir/i,\n night: /nuit/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./fr/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./fr/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./fr/_lib/formatRelative.mjs\";\nimport { localize } from \"./fr/_lib/localize.mjs\";\nimport { match } from \"./fr/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary French locale.\n * @language French\n * @iso-639-2 fra\n * @author Jean Dupouy [@izeau](https://github.com/izeau)\n * @author François B [@fbonzon](https://github.com/fbonzon)\n */\nexport const fr = {\n code: \"fr\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default fr;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"minder dan een seconde\",\n other: \"minder dan {{count}} seconden\",\n },\n\n xSeconds: {\n one: \"1 seconde\",\n other: \"{{count}} seconden\",\n },\n\n halfAMinute: \"een halve minuut\",\n\n lessThanXMinutes: {\n one: \"minder dan een minuut\",\n other: \"minder dan {{count}} minuten\",\n },\n\n xMinutes: {\n one: \"een minuut\",\n other: \"{{count}} minuten\",\n },\n\n aboutXHours: {\n one: \"ongeveer 1 uur\",\n other: \"ongeveer {{count}} uur\",\n },\n\n xHours: {\n one: \"1 uur\",\n other: \"{{count}} uur\",\n },\n\n xDays: {\n one: \"1 dag\",\n other: \"{{count}} dagen\",\n },\n\n aboutXWeeks: {\n one: \"ongeveer 1 week\",\n other: \"ongeveer {{count}} weken\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weken\",\n },\n\n aboutXMonths: {\n one: \"ongeveer 1 maand\",\n other: \"ongeveer {{count}} maanden\",\n },\n\n xMonths: {\n one: \"1 maand\",\n other: \"{{count}} maanden\",\n },\n\n aboutXYears: {\n one: \"ongeveer 1 jaar\",\n other: \"ongeveer {{count}} jaar\",\n },\n\n xYears: {\n one: \"1 jaar\",\n other: \"{{count}} jaar\",\n },\n\n overXYears: {\n one: \"meer dan 1 jaar\",\n other: \"meer dan {{count}} jaar\",\n },\n\n almostXYears: {\n one: \"bijna 1 jaar\",\n other: \"bijna {{count}} jaar\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", String(count));\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"over \" + result;\n } else {\n return result + \" geleden\";\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE d MMMM y\",\n long: \"d MMMM y\",\n medium: \"d MMM y\",\n short: \"dd.MM.y\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'om' {{time}}\",\n long: \"{{date}} 'om' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'vorige' eeee 'om' p\",\n yesterday: \"'gisteren om' p\",\n today: \"'vandaag om' p\",\n tomorrow: \"'morgen om' p\",\n nextWeek: \"eeee 'om' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"v.C.\", \"n.C.\"],\n abbreviated: [\"v.Chr.\", \"n.Chr.\"],\n wide: [\"voor Christus\", \"na Christus\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"K1\", \"K2\", \"K3\", \"K4\"],\n wide: [\"1e kwartaal\", \"2e kwartaal\", \"3e kwartaal\", \"4e kwartaal\"],\n};\n\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"jan.\",\n \"feb.\",\n \"mrt.\",\n \"apr.\",\n \"mei\",\n \"jun.\",\n \"jul.\",\n \"aug.\",\n \"sep.\",\n \"okt.\",\n \"nov.\",\n \"dec.\",\n ],\n\n wide: [\n \"januari\",\n \"februari\",\n \"maart\",\n \"april\",\n \"mei\",\n \"juni\",\n \"juli\",\n \"augustus\",\n \"september\",\n \"oktober\",\n \"november\",\n \"december\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"Z\", \"M\", \"D\", \"W\", \"D\", \"V\", \"Z\"],\n short: [\"zo\", \"ma\", \"di\", \"wo\", \"do\", \"vr\", \"za\"],\n abbreviated: [\"zon\", \"maa\", \"din\", \"woe\", \"don\", \"vri\", \"zat\"],\n wide: [\n \"zondag\",\n \"maandag\",\n \"dinsdag\",\n \"woensdag\",\n \"donderdag\",\n \"vrijdag\",\n \"zaterdag\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"middernacht\",\n noon: \"het middag\",\n morning: \"'s ochtends\",\n afternoon: \"'s namiddags\",\n evening: \"'s avonds\",\n night: \"'s nachts\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"middernacht\",\n noon: \"het middag\",\n morning: \"'s ochtends\",\n afternoon: \"'s namiddags\",\n evening: \"'s avonds\",\n night: \"'s nachts\",\n },\n wide: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"middernacht\",\n noon: \"het middag\",\n morning: \"'s ochtends\",\n afternoon: \"'s namiddags\",\n evening: \"'s avonds\",\n night: \"'s nachts\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n return number + \"e\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)e?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^([vn]\\.? ?C\\.?)/,\n abbreviated: /^([vn]\\. ?Chr\\.?)/,\n wide: /^((voor|na) Christus)/,\n};\nconst parseEraPatterns = {\n any: [/^v/, /^n/],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^K[1234]/i,\n wide: /^[1234]e kwartaal/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,\n wide: /^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^jan/i,\n /^feb/i,\n /^m(r|a)/i,\n /^apr/i,\n /^mei/i,\n /^jun/i,\n /^jul/i,\n /^aug/i,\n /^sep/i,\n /^okt/i,\n /^nov/i,\n /^dec/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[zmdwv]/i,\n short: /^(zo|ma|di|wo|do|vr|za)/i,\n abbreviated: /^(zon|maa|din|woe|don|vri|zat)/i,\n wide: /^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^z/i, /^m/i, /^d/i, /^w/i, /^d/i, /^v/i, /^z/i],\n any: [/^zo/i, /^ma/i, /^di/i, /^wo/i, /^do/i, /^vr/i, /^za/i],\n};\n\nconst matchDayPeriodPatterns = {\n any: /^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^am/i,\n pm: /^pm/i,\n midnight: /^middernacht/i,\n noon: /^het middaguur/i,\n morning: /ochtend/i,\n afternoon: /middag/i,\n evening: /avond/i,\n night: /nacht/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./nl-BE/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./nl-BE/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./nl-BE/_lib/formatRelative.mjs\";\nimport { localize } from \"./nl-BE/_lib/localize.mjs\";\nimport { match } from \"./nl-BE/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary Dutch locale.\n * @language Dutch\n * @iso-639-2 nld\n * @author Jorik Tangelder [@jtangelder](https://github.com/jtangelder)\n * @author Ruben Stolk [@rubenstolk](https://github.com/rubenstolk)\n * @author Lode Vanhove [@bitcrumb](https://github.com/bitcrumb)\n * @author Alex Hoeing [@dcbn](https://github.com/dcbn)\n */\nexport const nlBE = {\n code: \"nl-BE\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default nlBE;\n","function declension(scheme, count) {\n // scheme for count=1 exists\n if (scheme.one !== undefined && count === 1) {\n return scheme.one;\n }\n\n const rem10 = count % 10;\n const rem100 = count % 100;\n\n // 1, 21, 31, ...\n if (rem10 === 1 && rem100 !== 11) {\n return scheme.singularNominative.replace(\"{{count}}\", String(count));\n\n // 2, 3, 4, 22, 23, 24, 32 ...\n } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {\n return scheme.singularGenitive.replace(\"{{count}}\", String(count));\n\n // 5, 6, 7, 8, 9, 10, 11, ...\n } else {\n return scheme.pluralGenitive.replace(\"{{count}}\", String(count));\n }\n}\n\nfunction buildLocalizeTokenFn(scheme) {\n return (count, options) => {\n if (options && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n if (scheme.future) {\n return declension(scheme.future, count);\n } else {\n return \"за \" + declension(scheme.regular, count);\n }\n } else {\n if (scheme.past) {\n return declension(scheme.past, count);\n } else {\n return declension(scheme.regular, count) + \" тому\";\n }\n }\n } else {\n return declension(scheme.regular, count);\n }\n };\n}\n\nconst halfAtMinute = (_, options) => {\n if (options && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"за півхвилини\";\n } else {\n return \"півхвилини тому\";\n }\n }\n\n return \"півхвилини\";\n};\n\nconst formatDistanceLocale = {\n lessThanXSeconds: buildLocalizeTokenFn({\n regular: {\n one: \"менше секунди\",\n singularNominative: \"менше {{count}} секунди\",\n singularGenitive: \"менше {{count}} секунд\",\n pluralGenitive: \"менше {{count}} секунд\",\n },\n future: {\n one: \"менше, ніж за секунду\",\n singularNominative: \"менше, ніж за {{count}} секунду\",\n singularGenitive: \"менше, ніж за {{count}} секунди\",\n pluralGenitive: \"менше, ніж за {{count}} секунд\",\n },\n }),\n\n xSeconds: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} секунда\",\n singularGenitive: \"{{count}} секунди\",\n pluralGenitive: \"{{count}} секунд\",\n },\n past: {\n singularNominative: \"{{count}} секунду тому\",\n singularGenitive: \"{{count}} секунди тому\",\n pluralGenitive: \"{{count}} секунд тому\",\n },\n future: {\n singularNominative: \"за {{count}} секунду\",\n singularGenitive: \"за {{count}} секунди\",\n pluralGenitive: \"за {{count}} секунд\",\n },\n }),\n\n halfAMinute: halfAtMinute,\n\n lessThanXMinutes: buildLocalizeTokenFn({\n regular: {\n one: \"менше хвилини\",\n singularNominative: \"менше {{count}} хвилини\",\n singularGenitive: \"менше {{count}} хвилин\",\n pluralGenitive: \"менше {{count}} хвилин\",\n },\n future: {\n one: \"менше, ніж за хвилину\",\n singularNominative: \"менше, ніж за {{count}} хвилину\",\n singularGenitive: \"менше, ніж за {{count}} хвилини\",\n pluralGenitive: \"менше, ніж за {{count}} хвилин\",\n },\n }),\n\n xMinutes: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} хвилина\",\n singularGenitive: \"{{count}} хвилини\",\n pluralGenitive: \"{{count}} хвилин\",\n },\n past: {\n singularNominative: \"{{count}} хвилину тому\",\n singularGenitive: \"{{count}} хвилини тому\",\n pluralGenitive: \"{{count}} хвилин тому\",\n },\n future: {\n singularNominative: \"за {{count}} хвилину\",\n singularGenitive: \"за {{count}} хвилини\",\n pluralGenitive: \"за {{count}} хвилин\",\n },\n }),\n\n aboutXHours: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"близько {{count}} години\",\n singularGenitive: \"близько {{count}} годин\",\n pluralGenitive: \"близько {{count}} годин\",\n },\n future: {\n singularNominative: \"приблизно за {{count}} годину\",\n singularGenitive: \"приблизно за {{count}} години\",\n pluralGenitive: \"приблизно за {{count}} годин\",\n },\n }),\n\n xHours: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} годину\",\n singularGenitive: \"{{count}} години\",\n pluralGenitive: \"{{count}} годин\",\n },\n }),\n\n xDays: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} день\",\n singularGenitive: \"{{count}} днi\",\n pluralGenitive: \"{{count}} днів\",\n },\n }),\n\n aboutXWeeks: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"близько {{count}} тижня\",\n singularGenitive: \"близько {{count}} тижнів\",\n pluralGenitive: \"близько {{count}} тижнів\",\n },\n future: {\n singularNominative: \"приблизно за {{count}} тиждень\",\n singularGenitive: \"приблизно за {{count}} тижні\",\n pluralGenitive: \"приблизно за {{count}} тижнів\",\n },\n }),\n\n xWeeks: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} тиждень\",\n singularGenitive: \"{{count}} тижні\",\n pluralGenitive: \"{{count}} тижнів\",\n },\n }),\n\n aboutXMonths: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"близько {{count}} місяця\",\n singularGenitive: \"близько {{count}} місяців\",\n pluralGenitive: \"близько {{count}} місяців\",\n },\n future: {\n singularNominative: \"приблизно за {{count}} місяць\",\n singularGenitive: \"приблизно за {{count}} місяці\",\n pluralGenitive: \"приблизно за {{count}} місяців\",\n },\n }),\n\n xMonths: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} місяць\",\n singularGenitive: \"{{count}} місяці\",\n pluralGenitive: \"{{count}} місяців\",\n },\n }),\n\n aboutXYears: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"близько {{count}} року\",\n singularGenitive: \"близько {{count}} років\",\n pluralGenitive: \"близько {{count}} років\",\n },\n future: {\n singularNominative: \"приблизно за {{count}} рік\",\n singularGenitive: \"приблизно за {{count}} роки\",\n pluralGenitive: \"приблизно за {{count}} років\",\n },\n }),\n\n xYears: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"{{count}} рік\",\n singularGenitive: \"{{count}} роки\",\n pluralGenitive: \"{{count}} років\",\n },\n }),\n\n overXYears: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"більше {{count}} року\",\n singularGenitive: \"більше {{count}} років\",\n pluralGenitive: \"більше {{count}} років\",\n },\n future: {\n singularNominative: \"більше, ніж за {{count}} рік\",\n singularGenitive: \"більше, ніж за {{count}} роки\",\n pluralGenitive: \"більше, ніж за {{count}} років\",\n },\n }),\n\n almostXYears: buildLocalizeTokenFn({\n regular: {\n singularNominative: \"майже {{count}} рік\",\n singularGenitive: \"майже {{count}} роки\",\n pluralGenitive: \"майже {{count}} років\",\n },\n future: {\n singularNominative: \"майже за {{count}} рік\",\n singularGenitive: \"майже за {{count}} роки\",\n pluralGenitive: \"майже за {{count}} років\",\n },\n }),\n};\n\nexport const formatDistance = (token, count, options) => {\n options = options || {};\n\n return formatDistanceLocale[token](count, options);\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"EEEE, do MMMM y 'р.'\",\n long: \"do MMMM y 'р.'\",\n medium: \"d MMM y 'р.'\",\n short: \"dd.MM.y\",\n};\n\nconst timeFormats = {\n full: \"H:mm:ss zzzz\",\n long: \"H:mm:ss z\",\n medium: \"H:mm:ss\",\n short: \"H:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'о' {{time}}\",\n long: \"{{date}} 'о' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { isSameWeek } from \"../../../isSameWeek.mjs\";\nimport { toDate } from \"../../../toDate.mjs\";\n\nconst accusativeWeekdays = [\n \"неділю\",\n \"понеділок\",\n \"вівторок\",\n \"середу\",\n \"четвер\",\n \"п’ятницю\",\n \"суботу\",\n];\n\nfunction lastWeek(day) {\n const weekday = accusativeWeekdays[day];\n\n switch (day) {\n case 0:\n case 3:\n case 5:\n case 6:\n return \"'у минулу \" + weekday + \" о' p\";\n case 1:\n case 2:\n case 4:\n return \"'у минулий \" + weekday + \" о' p\";\n }\n}\n\nfunction thisWeek(day) {\n const weekday = accusativeWeekdays[day];\n\n return \"'у \" + weekday + \" о' p\";\n}\n\nfunction nextWeek(day) {\n const weekday = accusativeWeekdays[day];\n\n switch (day) {\n case 0:\n case 3:\n case 5:\n case 6:\n return \"'у наступну \" + weekday + \" о' p\";\n case 1:\n case 2:\n case 4:\n return \"'у наступний \" + weekday + \" о' p\";\n }\n}\n\nconst lastWeekFormat = (dirtyDate, baseDate, options) => {\n const date = toDate(dirtyDate);\n const day = date.getDay();\n\n if (isSameWeek(date, baseDate, options)) {\n return thisWeek(day);\n } else {\n return lastWeek(day);\n }\n};\n\nconst nextWeekFormat = (dirtyDate, baseDate, options) => {\n const date = toDate(dirtyDate);\n const day = date.getDay();\n if (isSameWeek(date, baseDate, options)) {\n return thisWeek(day);\n } else {\n return nextWeek(day);\n }\n};\n\nconst formatRelativeLocale = {\n lastWeek: lastWeekFormat,\n yesterday: \"'вчора о' p\",\n today: \"'сьогодні о' p\",\n tomorrow: \"'завтра о' p\",\n nextWeek: nextWeekFormat,\n other: \"P\",\n};\n\nexport const formatRelative = (token, date, baseDate, options) => {\n const format = formatRelativeLocale[token];\n\n if (typeof format === \"function\") {\n return format(date, baseDate, options);\n }\n\n return format;\n};\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"до н.е.\", \"н.е.\"],\n abbreviated: [\"до н. е.\", \"н. е.\"],\n wide: [\"до нашої ери\", \"нашої ери\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"1-й кв.\", \"2-й кв.\", \"3-й кв.\", \"4-й кв.\"],\n wide: [\"1-й квартал\", \"2-й квартал\", \"3-й квартал\", \"4-й квартал\"],\n};\n\nconst monthValues = {\n // ДСТУ 3582:2013\n narrow: [\"С\", \"Л\", \"Б\", \"К\", \"Т\", \"Ч\", \"Л\", \"С\", \"В\", \"Ж\", \"Л\", \"Г\"],\n abbreviated: [\n \"січ.\",\n \"лют.\",\n \"берез.\",\n \"квіт.\",\n \"трав.\",\n \"черв.\",\n \"лип.\",\n \"серп.\",\n \"верес.\",\n \"жовт.\",\n \"листоп.\",\n \"груд.\",\n ],\n\n wide: [\n \"січень\",\n \"лютий\",\n \"березень\",\n \"квітень\",\n \"травень\",\n \"червень\",\n \"липень\",\n \"серпень\",\n \"вересень\",\n \"жовтень\",\n \"листопад\",\n \"грудень\",\n ],\n};\n\nconst formattingMonthValues = {\n narrow: [\"С\", \"Л\", \"Б\", \"К\", \"Т\", \"Ч\", \"Л\", \"С\", \"В\", \"Ж\", \"Л\", \"Г\"],\n abbreviated: [\n \"січ.\",\n \"лют.\",\n \"берез.\",\n \"квіт.\",\n \"трав.\",\n \"черв.\",\n \"лип.\",\n \"серп.\",\n \"верес.\",\n \"жовт.\",\n \"листоп.\",\n \"груд.\",\n ],\n\n wide: [\n \"січня\",\n \"лютого\",\n \"березня\",\n \"квітня\",\n \"травня\",\n \"червня\",\n \"липня\",\n \"серпня\",\n \"вересня\",\n \"жовтня\",\n \"листопада\",\n \"грудня\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"Н\", \"П\", \"В\", \"С\", \"Ч\", \"П\", \"С\"],\n short: [\"нд\", \"пн\", \"вт\", \"ср\", \"чт\", \"пт\", \"сб\"],\n abbreviated: [\"нед\", \"пон\", \"вів\", \"сер\", \"чтв\", \"птн\", \"суб\"],\n wide: [\n \"неділя\",\n \"понеділок\",\n \"вівторок\",\n \"середа\",\n \"четвер\",\n \"п’ятниця\",\n \"субота\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"ДП\",\n pm: \"ПП\",\n midnight: \"півн.\",\n noon: \"пол.\",\n morning: \"ранок\",\n afternoon: \"день\",\n evening: \"веч.\",\n night: \"ніч\",\n },\n abbreviated: {\n am: \"ДП\",\n pm: \"ПП\",\n midnight: \"півн.\",\n noon: \"пол.\",\n morning: \"ранок\",\n afternoon: \"день\",\n evening: \"веч.\",\n night: \"ніч\",\n },\n wide: {\n am: \"ДП\",\n pm: \"ПП\",\n midnight: \"північ\",\n noon: \"полудень\",\n morning: \"ранок\",\n afternoon: \"день\",\n evening: \"вечір\",\n night: \"ніч\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"ДП\",\n pm: \"ПП\",\n midnight: \"півн.\",\n noon: \"пол.\",\n morning: \"ранку\",\n afternoon: \"дня\",\n evening: \"веч.\",\n night: \"ночі\",\n },\n abbreviated: {\n am: \"ДП\",\n pm: \"ПП\",\n midnight: \"півн.\",\n noon: \"пол.\",\n morning: \"ранку\",\n afternoon: \"дня\",\n evening: \"веч.\",\n night: \"ночі\",\n },\n wide: {\n am: \"ДП\",\n pm: \"ПП\",\n midnight: \"північ\",\n noon: \"полудень\",\n morning: \"ранку\",\n afternoon: \"дня\",\n evening: \"веч.\",\n night: \"ночі\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, options) => {\n const unit = String(options?.unit);\n const number = Number(dirtyNumber);\n let suffix;\n\n if (unit === \"date\") {\n if (number === 3 || number === 23) {\n suffix = \"-є\";\n } else {\n suffix = \"-е\";\n }\n } else if (unit === \"minute\" || unit === \"second\" || unit === \"hour\") {\n suffix = \"-а\";\n } else {\n suffix = \"-й\";\n }\n\n return number + suffix;\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n formattingValues: formattingMonthValues,\n defaultFormattingWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"any\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(-?(е|й|є|а|я))?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^((до )?н\\.?\\s?е\\.?)/i,\n abbreviated: /^((до )?н\\.?\\s?е\\.?)/i,\n wide: /^(до нашої ери|нашої ери|наша ера)/i,\n};\n\nconst parseEraPatterns = {\n any: [/^д/i, /^н/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^[1234](-?[иі]?й?)? кв.?/i,\n wide: /^[1234](-?[иі]?й?)? квартал/i,\n};\n\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[слбктчвжг]/i,\n abbreviated:\n /^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\\.?/i,\n wide: /^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i,\n};\n\nconst parseMonthPatterns = {\n narrow: [\n /^с/i,\n /^л/i,\n /^б/i,\n /^к/i,\n /^т/i,\n /^ч/i,\n /^л/i,\n /^с/i,\n /^в/i,\n /^ж/i,\n /^л/i,\n /^г/i,\n ],\n\n any: [\n /^сі/i,\n /^лю/i,\n /^б/i,\n /^к/i,\n /^т/i,\n /^ч/i,\n /^лип/i,\n /^се/i,\n /^в/i,\n /^ж/i,\n /^лис/i,\n /^г/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[нпвсч]/i,\n short: /^(нд|пн|вт|ср|чт|пт|сб)\\.?/i,\n abbreviated: /^(нед|пон|вів|сер|че?тв|птн?|суб)\\.?/i,\n wide: /^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\\W*?ятниц[яі]|субот[аи])/i,\n};\n\nconst parseDayPatterns = {\n narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],\n any: [/^н/i, /^п[он]/i, /^в/i, /^с[ер]/i, /^ч/i, /^п\\W*?[ят]/i, /^с[уб]/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^([дп]п|півн\\.?|пол\\.?|ранок|ранку|день|дня|веч\\.?|ніч|ночі)/i,\n abbreviated: /^([дп]п|півн\\.?|пол\\.?|ранок|ранку|день|дня|веч\\.?|ніч|ночі)/i,\n wide: /^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i,\n};\n\nconst parseDayPeriodPatterns = {\n any: {\n am: /^дп/i,\n pm: /^пп/i,\n midnight: /^півн/i,\n noon: /^пол/i,\n morning: /^р/i,\n afternoon: /^д[ен]/i,\n evening: /^в/i,\n night: /^н/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./uk/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./uk/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./uk/_lib/formatRelative.mjs\";\nimport { localize } from \"./uk/_lib/localize.mjs\";\nimport { match } from \"./uk/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary Ukrainian locale.\n * @language Ukrainian\n * @iso-639-2 ukr\n * @author Andrii Korzh [@korzhyk](https://github.com/korzhyk)\n * @author Andriy Shcherbyak [@shcherbyakdev](https://github.com/shcherbyakdev)\n */\nexport const uk = {\n code: \"uk\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default uk;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"不到 1 秒\",\n other: \"不到 {{count}} 秒\",\n },\n\n xSeconds: {\n one: \"1 秒\",\n other: \"{{count}} 秒\",\n },\n\n halfAMinute: \"半分钟\",\n\n lessThanXMinutes: {\n one: \"不到 1 分钟\",\n other: \"不到 {{count}} 分钟\",\n },\n\n xMinutes: {\n one: \"1 分钟\",\n other: \"{{count}} 分钟\",\n },\n\n xHours: {\n one: \"1 小时\",\n other: \"{{count}} 小时\",\n },\n\n aboutXHours: {\n one: \"大约 1 小时\",\n other: \"大约 {{count}} 小时\",\n },\n\n xDays: {\n one: \"1 天\",\n other: \"{{count}} 天\",\n },\n\n aboutXWeeks: {\n one: \"大约 1 个星期\",\n other: \"大约 {{count}} 个星期\",\n },\n\n xWeeks: {\n one: \"1 个星期\",\n other: \"{{count}} 个星期\",\n },\n\n aboutXMonths: {\n one: \"大约 1 个月\",\n other: \"大约 {{count}} 个月\",\n },\n\n xMonths: {\n one: \"1 个月\",\n other: \"{{count}} 个月\",\n },\n\n aboutXYears: {\n one: \"大约 1 年\",\n other: \"大约 {{count}} 年\",\n },\n\n xYears: {\n one: \"1 年\",\n other: \"{{count}} 年\",\n },\n\n overXYears: {\n one: \"超过 1 年\",\n other: \"超过 {{count}} 年\",\n },\n\n almostXYears: {\n one: \"将近 1 年\",\n other: \"将近 {{count}} 年\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", String(count));\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return result + \"内\";\n } else {\n return result + \"前\";\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.mjs\";\n\nconst dateFormats = {\n full: \"y'年'M'月'd'日' EEEE\",\n long: \"y'年'M'月'd'日'\",\n medium: \"yyyy-MM-dd\",\n short: \"yy-MM-dd\",\n};\n\nconst timeFormats = {\n full: \"zzzz a h:mm:ss\",\n long: \"z a h:mm:ss\",\n medium: \"a h:mm:ss\",\n short: \"a h:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} {{time}}\",\n long: \"{{date}} {{time}}\",\n medium: \"{{date}} {{time}}\",\n short: \"{{date}} {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { isSameWeek } from \"../../../isSameWeek.mjs\";\n\nfunction checkWeek(date, baseDate, options) {\n const baseFormat = \"eeee p\";\n\n if (isSameWeek(date, baseDate, options)) {\n return baseFormat; // in same week\n } else if (date.getTime() > baseDate.getTime()) {\n return \"'下个'\" + baseFormat; // in next week\n }\n return \"'上个'\" + baseFormat; // in last week\n}\n\nconst formatRelativeLocale = {\n lastWeek: checkWeek, // days before yesterday, maybe in this week or last week\n yesterday: \"'昨天' p\",\n today: \"'今天' p\",\n tomorrow: \"'明天' p\",\n nextWeek: checkWeek, // days after tomorrow, maybe in this week or next week\n other: \"PP p\",\n};\n\nexport const formatRelative = (token, date, baseDate, options) => {\n const format = formatRelativeLocale[token];\n\n if (typeof format === \"function\") {\n return format(date, baseDate, options);\n }\n\n return format;\n};\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.mjs\";\n\nconst eraValues = {\n narrow: [\"前\", \"公元\"],\n abbreviated: [\"前\", \"公元\"],\n wide: [\"公元前\", \"公元\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"第一季\", \"第二季\", \"第三季\", \"第四季\"],\n wide: [\"第一季度\", \"第二季度\", \"第三季度\", \"第四季度\"],\n};\n\nconst monthValues = {\n narrow: [\n \"一\",\n \"二\",\n \"三\",\n \"四\",\n \"五\",\n \"六\",\n \"七\",\n \"八\",\n \"九\",\n \"十\",\n \"十一\",\n \"十二\",\n ],\n\n abbreviated: [\n \"1月\",\n \"2月\",\n \"3月\",\n \"4月\",\n \"5月\",\n \"6月\",\n \"7月\",\n \"8月\",\n \"9月\",\n \"10月\",\n \"11月\",\n \"12月\",\n ],\n\n wide: [\n \"一月\",\n \"二月\",\n \"三月\",\n \"四月\",\n \"五月\",\n \"六月\",\n \"七月\",\n \"八月\",\n \"九月\",\n \"十月\",\n \"十一月\",\n \"十二月\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"],\n short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"],\n abbreviated: [\"周日\", \"周一\", \"周二\", \"周三\", \"周四\", \"周五\", \"周六\"],\n\n wide: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"上\",\n pm: \"下\",\n midnight: \"凌晨\",\n noon: \"午\",\n morning: \"早\",\n afternoon: \"下午\",\n evening: \"晚\",\n night: \"夜\",\n },\n abbreviated: {\n am: \"上午\",\n pm: \"下午\",\n midnight: \"凌晨\",\n noon: \"中午\",\n morning: \"早晨\",\n afternoon: \"中午\",\n evening: \"晚上\",\n night: \"夜间\",\n },\n wide: {\n am: \"上午\",\n pm: \"下午\",\n midnight: \"凌晨\",\n noon: \"中午\",\n morning: \"早晨\",\n afternoon: \"中午\",\n evening: \"晚上\",\n night: \"夜间\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"上\",\n pm: \"下\",\n midnight: \"凌晨\",\n noon: \"午\",\n morning: \"早\",\n afternoon: \"下午\",\n evening: \"晚\",\n night: \"夜\",\n },\n abbreviated: {\n am: \"上午\",\n pm: \"下午\",\n midnight: \"凌晨\",\n noon: \"中午\",\n morning: \"早晨\",\n afternoon: \"中午\",\n evening: \"晚上\",\n night: \"夜间\",\n },\n wide: {\n am: \"上午\",\n pm: \"下午\",\n midnight: \"凌晨\",\n noon: \"中午\",\n morning: \"早晨\",\n afternoon: \"中午\",\n evening: \"晚上\",\n night: \"夜间\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, options) => {\n const number = Number(dirtyNumber);\n\n switch (options?.unit) {\n case \"date\":\n return number.toString() + \"日\";\n case \"hour\":\n return number.toString() + \"时\";\n case \"minute\":\n return number.toString() + \"分\";\n case \"second\":\n return number.toString() + \"秒\";\n default:\n return \"第 \" + number.toString();\n }\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.mjs\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.mjs\";\n\nconst matchOrdinalNumberPattern = /^(第\\s*)?\\d+(日|时|分|秒)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(前)/i,\n abbreviated: /^(前)/i,\n wide: /^(公元前|公元)/i,\n};\nconst parseEraPatterns = {\n any: [/^(前)/i, /^(公元)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^第[一二三四]刻/i,\n wide: /^第[一二三四]刻钟/i,\n};\nconst parseQuarterPatterns = {\n any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,\n abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\\d|1[12])月/i,\n wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^一/i,\n /^二/i,\n /^三/i,\n /^四/i,\n /^五/i,\n /^六/i,\n /^七/i,\n /^八/i,\n /^九/i,\n /^十(?!(一|二))/i,\n /^十一/i,\n /^十二/i,\n ],\n\n any: [\n /^一|1/i,\n /^二|2/i,\n /^三|3/i,\n /^四|4/i,\n /^五|5/i,\n /^六|6/i,\n /^七|7/i,\n /^八|8/i,\n /^九|9/i,\n /^十(?!(一|二))|10/i,\n /^十一|11/i,\n /^十二|12/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[一二三四五六日]/i,\n short: /^[一二三四五六日]/i,\n abbreviated: /^周[一二三四五六日]/i,\n wide: /^星期[一二三四五六日]/i,\n};\nconst parseDayPatterns = {\n any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i],\n};\n\nconst matchDayPeriodPatterns = {\n any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^上午?/i,\n pm: /^下午?/i,\n midnight: /^午夜/i,\n noon: /^[中正]午/i,\n morning: /^早上/i,\n afternoon: /^下午/i,\n evening: /^晚上?/i,\n night: /^凌晨/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./zh-CN/_lib/formatDistance.mjs\";\nimport { formatLong } from \"./zh-CN/_lib/formatLong.mjs\";\nimport { formatRelative } from \"./zh-CN/_lib/formatRelative.mjs\";\nimport { localize } from \"./zh-CN/_lib/localize.mjs\";\nimport { match } from \"./zh-CN/_lib/match.mjs\";\n\n/**\n * @category Locales\n * @summary Chinese Simplified locale.\n * @language Chinese Simplified\n * @iso-639-2 zho\n * @author Changyu Geng [@KingMario](https://github.com/KingMario)\n * @author Song Shuoyun [@fnlctrl](https://github.com/fnlctrl)\n * @author sabrinaM [@sabrinamiao](https://github.com/sabrinamiao)\n * @author Carney Wu [@cubicwork](https://github.com/cubicwork)\n * @author Terrence Lam [@skyuplam](https://github.com/skyuplam)\n */\nexport const zhCN = {\n code: \"zh-CN\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 1 /* Monday */,\n firstWeekContainsDate: 4,\n },\n};\n\n// Fallback for modularized imports:\nexport default zhCN;\n","import { Target, TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { addSeconds, formatDistanceStrict } from \"date-fns\";\nimport { de, enGB, fr, nlBE, uk, zhCN } from \"date-fns/locale\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly passwordInputTarget: HTMLInputElement;\n @Target readonly sendMagicLinkButtonTarget: HTMLButtonElement;\n @Target readonly submitButtonTarget!: HTMLButtonElement;\n @Target readonly remainingTimeLockedMessageTarget: HTMLElement;\n\n @Value(String) secondsRemainingLockedValue: number;\n @Value(String) currentLanguageValue: string;\n\n connect() {\n this.passwordInputTarget.addEventListener(\"input\", this.updateSubmitButtonVisibility.bind(this));\n\n // @ts-ignore StimulusDecorators default values are broken 🙄\n if (this.secondsRemainingLockedValue === \"\") this.secondsRemainingLockedValue = 0;\n if (this.currentLanguageValue === \"\") this.currentLanguageValue = \"de\";\n\n if (this.secondsRemainingLockedValue > 0) {\n this.disablePasswordInputAndCountdown();\n }\n }\n\n updateSubmitButtonVisibility() {\n const value = this.passwordInputTarget.value;\n if (value.length > 0) {\n this.submitButtonTarget.removeAttribute(\"disabled\");\n } else {\n this.submitButtonTarget.setAttribute(\"disabled\", \"true\");\n }\n }\n\n disablePasswordInputAndCountdown() {\n this.setRemainingTimeLockedMessage();\n\n const interval = setInterval(() => {\n this.secondsRemainingLockedValue = this.secondsRemainingLockedValue - 1;\n\n if (this.secondsRemainingLockedValue <= 0) {\n clearInterval(interval);\n\n this.passwordInputTarget.disabled = false;\n this.sendMagicLinkButtonTarget.disabled = false;\n this.remainingTimeLockedMessageTarget.classList.add(\"hidden\");\n }\n\n this.setRemainingTimeLockedMessage();\n }, 1000);\n }\n\n setRemainingTimeLockedMessage() {\n const timeSpan = this.remainingTimeLockedMessageTarget.querySelector(\"#remaining-time\");\n\n const time = addSeconds(new Date(), this.secondsRemainingLockedValue);\n timeSpan!.innerHTML = formatDistanceStrict(new Date(), time, { locale: this.dateFnsLocale(this.currentLanguageValue) });\n }\n\n dateFnsLocale(lang: string) {\n switch (lang) {\n case \"de\":\n return de;\n case \"en\":\n return enGB;\n case \"fr\":\n return fr;\n case \"nl\":\n return nlBE;\n case \"uk\":\n return uk;\n case \"zh\":\n return zhCN;\n default:\n return de;\n }\n }\n}\n","import { Target, Targets, TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { addSeconds, formatDistanceStrict } from \"date-fns\";\nimport { de, enGB, fr, nlBE, uk, zhCN } from \"date-fns/locale\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Targets readonly digitTargets: HTMLInputElement[];\n @Target readonly invalidCodeMessageTarget: HTMLElement;\n @Target readonly resendAgainButtonTarget: HTMLButtonElement;\n @Target readonly resendAgainTextTarget: HTMLElement;\n @Target readonly formTarget: HTMLFormElement;\n @Target readonly spinnerTarget: HTMLElement;\n @Target readonly remainingTimeLockedMessageTarget: HTMLElement;\n\n @Value(Number) readonly digitCountValue: number = 4;\n @Value(Number) readonly resendAgainTimeValue: number = 30000;\n @Value(Number) secondsRemainingLockedValue = 0;\n @Value(String) currentLanguageValue = \"de\";\n\n connect() {\n document.addEventListener(\"paste\", this.codePasted.bind(this));\n\n if (this.secondsRemainingLockedValue > 0) {\n this.disabledInputsAndCountdown();\n this.setRemainingTimeLockedMessage();\n\n setTimeout(() => this.enableResend(), this.resendAgainTimeValue);\n }\n }\n\n disabledInputsAndCountdown() {\n this.removeInvalidCodeErrorMessage();\n this.setInputsDisabledAttributeTo(true);\n\n const interval = setInterval(() => {\n this.secondsRemainingLockedValue = this.secondsRemainingLockedValue - 1;\n\n if (this.secondsRemainingLockedValue <= 0) {\n clearInterval(interval);\n this.setInputsDisabledAttributeTo(false);\n this.digitTargets[0].focus();\n this.remainingTimeLockedMessageTarget.classList.add(\"hidden\");\n }\n\n this.setRemainingTimeLockedMessage();\n }, 1000);\n }\n\n digitEntered(event: any) {\n const index = Number((event.target as HTMLElement).dataset.index);\n if (event.key === \"Enter\") {\n event.preventDefault();\n this.submit();\n\n return;\n }\n\n switch (event.key) {\n case \"Backspace\":\n case \"Delete\":\n event.preventDefault();\n\n // @ts-expect-error IDK WHY\n this.digitTargets[index].value = null;\n\n if (index > 0) {\n this.digitTargets[index - 1].focus();\n } else {\n this.digitTargets[index].focus();\n }\n return;\n case \"ArrowLeft\":\n event.preventDefault();\n\n if (index > 0) {\n this.digitTargets[index - 1].focus();\n }\n return;\n case \"ArrowRight\":\n event.preventDefault();\n\n if (index < this.digitCountValue - 1) {\n this.digitTargets[index + 1].focus();\n }\n return;\n default:\n if (!/^[0-9]$/i.test(event.key)) {\n return;\n }\n\n event.preventDefault();\n\n if (index < this.digitCountValue) {\n this.digitTargets[index].value = event.key;\n }\n\n if (index + 1 < this.digitCountValue) {\n this.digitTargets[index + 1].focus();\n }\n\n if (index + 1 === this.digitCountValue) {\n this.submit();\n }\n }\n\n this.removeInvalidCodeErrorMessage();\n }\n\n codePasted(event: ClipboardEvent) {\n event.preventDefault();\n\n if (this.secondsRemainingLockedValue > 0) {\n return;\n }\n\n this.removeInvalidCodeErrorMessage();\n const pastedCode = event.clipboardData?.getData(\"text\").slice(0, this.digitCountValue) || \"\";\n for (let i = 0; i < this.digitCountValue; i++) {\n if (pastedCode[i] === undefined) {\n break;\n }\n\n if (!/^[0-9]$/i.test(pastedCode[i])) {\n continue;\n }\n\n this.digitTargets[i].value = pastedCode[i];\n }\n\n if (pastedCode.length === this.digitCountValue) {\n this.submit();\n }\n }\n\n removeInvalidCodeErrorMessage() {\n this.digitTargets.forEach((digitTarget) => {\n digitTarget.classList.remove(\"border-red-500\");\n });\n\n this.invalidCodeMessageTarget.classList.add(\"hidden\");\n }\n\n enableResend() {\n this.resendAgainButtonTarget.disabled = false;\n this.resendAgainTextTarget.classList.remove(\"opacity-40\");\n }\n\n submit() {\n this.spinnerTarget.classList.remove(\"hidden\");\n this.formTarget.submit();\n this.setInputsDisabledAttributeTo(false);\n }\n\n setInputsDisabledAttributeTo(state: boolean) {\n this.digitTargets.forEach((digitTarget) => {\n digitTarget.disabled = state;\n });\n }\n\n setRemainingTimeLockedMessage() {\n const timeSpan = this.remainingTimeLockedMessageTarget.querySelector(\"#remaining-time\");\n\n const time = addSeconds(new Date(), this.secondsRemainingLockedValue);\n timeSpan!.innerHTML = formatDistanceStrict(new Date(), time, { locale: this.dateFnsLocale(this.currentLanguageValue) });\n }\n\n dateFnsLocale(lang: string) {\n switch (lang) {\n case \"de\":\n return de;\n case \"en\":\n return enGB;\n case \"fr\":\n return fr;\n case \"nl\":\n return nlBE;\n case \"uk\":\n return uk;\n case \"zh\":\n return zhCN;\n default:\n return de;\n }\n }\n}\n","import { Target, Targets, TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly checkboxTarget: HTMLInputElement;\n @Targets readonly inputsTargets: HTMLInputElement[];\n @Targets readonly labelsTargets: HTMLLabelElement[];\n\n connect() {\n this.checkboxTarget.addEventListener(\"change\", this.toggleInputs.bind(this));\n this.toggleInputs();\n }\n\n toggleInputs() {\n this.labelsTargets.forEach((label) => label.classList.toggle(\"text-gray-300\", !this.checkboxTarget.checked));\n this.inputsTargets.forEach((input) => {\n input.disabled = !this.checkboxTarget.checked;\n\n if (this.checkboxTarget.checked && input.dataset.shouldCheck === \"true\") {\n input.checked = true;\n input.dataset.shouldCheck = undefined;\n }\n });\n }\n}\n","import { Target, Targets, TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Targets readonly checkboxTargets!: HTMLInputElement[];\n @Target readonly valuesContainerTarget!: HTMLDivElement;\n\n connect() {\n this.checkboxTargets.forEach((checkboxTarget) => {\n checkboxTarget.addEventListener(\"change\", () => {\n const inputs = this.checkboxTargets\n .filter((c) => c.checked)\n .map((c) => {\n const tmp = document.createElement(\"input\");\n tmp.type = \"hidden\";\n tmp.name = \"newsletter_accept[]\";\n tmp.value = c.value;\n return tmp;\n });\n\n this.valuesContainerTarget.innerHTML = \"\";\n inputs.forEach((node) => this.valuesContainerTarget.appendChild(node));\n });\n });\n }\n}\n","import { Target, TypedController } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly showPasswordTarget!: HTMLElement;\n @Target readonly eyeClosedTarget!: HTMLElement;\n @Target readonly eyeOpenedTarget!: HTMLElement;\n\n connect() {\n this.showPasswordTarget.addEventListener(\"click\", this.togglePasswordVisibility.bind(this));\n }\n\n togglePasswordVisibility() {\n const passwordInputTarget = this.showPasswordTarget.closest(\"div\")?.querySelector(\"input\");\n if (!passwordInputTarget) throw new Error(\"Password input not found\");\n\n if (passwordInputTarget.type === \"password\") {\n passwordInputTarget.type = \"text\";\n this.eyeClosedTarget.classList.add(\"tw-hidden\");\n this.eyeOpenedTarget.classList.remove(\"tw-hidden\");\n } else {\n passwordInputTarget.type = \"password\";\n this.eyeClosedTarget.classList.remove(\"tw-hidden\");\n this.eyeOpenedTarget.classList.add(\"tw-hidden\");\n }\n }\n}\n","type RecursiveRecord = {\n [K: string]: T | RecursiveRecord;\n};\n\nexport class PassedTranslations {\n private readonly translations: RecursiveRecord;\n\n constructor(translations: string) {\n try {\n this.translations = JSON.parse(translations);\n } catch (e) {\n if (process.env.NODE_ENV === \"development\") {\n console.error(e);\n }\n\n this.translations = {};\n }\n }\n\n public t(key: string, params = {}): any {\n const path = key.split(\".\");\n const value = path.reduce((translations, key) => translations[key], this.translations);\n\n if (!value) {\n return null;\n }\n\n if (typeof value === \"string\") {\n return value?.replace(/%\\{(\\w+)\\}/g, (_, key) => params[key]);\n }\n\n return value;\n }\n}\n","import { Target, TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\nimport { PassedTranslations } from \"~/lib/passedTranslations\";\n\nimport RequirementController from \"./requirement_controller\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly fieldTarget!: HTMLInputElement;\n @Target readonly progressTarget!: HTMLSpanElement;\n @Target readonly progressTextTarget!: HTMLSpanElement;\n\n @Value(String) requirementsValue!: string;\n @Value(String) translationsValue!: string;\n\n // I hate naming in this...\n static outlets = [\"form--field--password-with-validation--requirement\"];\n private declare readonly formFieldPasswordWithValidationRequirementOutlets: RequirementController[];\n\n private translations: PassedTranslations;\n\n readonly RULES = {\n min_length: (value: string, count: number) => value.length >= count,\n NUMBER: (value: string) => value.match(/\\d/) !== null,\n MIXED_CASE: (value: string) => value.match(/[a-z]/) !== null && value.match(/[A-Z]/) !== null,\n SYMBOL: (value: string) => value.match(/[^a-zA-Z0-9]/) !== null,\n };\n\n connect(): void {\n this.fieldTarget.addEventListener(\"input\", this.validate.bind(this));\n this.getSubmitButton().disabled = true;\n\n this.translations = new PassedTranslations(this.translationsValue);\n\n // safari autofill fix\n this.fieldTarget.value && this.validate.apply(this);\n }\n\n validate() {\n const value = this.fieldTarget.value;\n\n const errors = this.jsonRequirements()\n .map(([rule, { message, count }]) => ({ rule, message, ok: this.RULES[rule](value, count) }))\n .map((requirement) => {\n const reqField = this.formFieldPasswordWithValidationRequirementOutlets.find((elem) => elem.ruleValue === requirement.rule);\n reqField?.setValidity(requirement.ok);\n\n return !requirement.ok && requirement.message;\n })\n .filter(Boolean);\n\n if (errors.length > 0) {\n this.getSubmitButton().disabled = true;\n this.fieldTarget.setCustomValidity(errors.join(\", \"));\n\n this.progressTarget.style.setProperty(\"--progress\", \"5%\");\n this.progressTarget.style.setProperty(\"--progress-color\", \"red\");\n this.progressTextTarget.textContent = this.translations.t(\"strength.not_valid\");\n this.progressTextTarget.style.setProperty(\"--progress-color\", \"red\");\n } else {\n this.getSubmitButton().disabled = false;\n this.fieldTarget.setCustomValidity(\"\");\n\n const progress = this.calculateProgress(value);\n this.progressTarget.style.setProperty(\"--progress\", `${progress}%`);\n this.progressTarget.style.setProperty(\"--progress-color\", this.progressColor(progress));\n this.progressTextTarget.textContent = this.progressText(progress);\n this.progressTextTarget.style.setProperty(\"--progress-color\", this.progressColor(progress));\n }\n }\n\n private getSubmitButton(): HTMLButtonElement {\n return this.fieldTarget.closest(\"form\")?.querySelector(\"input[type=submit]\")!;\n }\n\n private calculateProgress(value: string) {\n if (value === \"\") {\n return 0;\n }\n\n const scope = [\n { re: /[a-z]/, length: 26 },\n { re: /[A-Z]/, length: 26 },\n { re: /[0-9]/, length: 10 },\n { re: /[^a-zA-Z0-9]/, length: 33 },\n ].reduce((progress, { re, length }) => {\n if (value.match(re)) {\n return progress + length;\n }\n\n return progress;\n }, 0);\n\n return (Math.round((value.length * Math.log(scope)) / Math.LN2) / 120) * 100;\n }\n\n private progressColor(value: number) {\n if (value === 0) {\n return \"#adadad\";\n }\n if (value < 30) {\n return \"red\";\n }\n if (value < 50) {\n return \"orange\";\n }\n if (value < 80) {\n return \"#0093ff\";\n }\n return \"green\";\n }\n\n private progressText(value: number) {\n if (value === 0) {\n return this.translations.t(\"strength.empty\");\n }\n if (value < 30) {\n return this.translations.t(\"strength.very_weak\");\n }\n if (value < 50) {\n return this.translations.t(\"strength.weak\");\n }\n if (value < 80) {\n return this.translations.t(\"strength.strong\");\n }\n return this.translations.t(\"strength.very_strong\");\n }\n\n private jsonRequirements(): [string, { message: string; count?: number }][] {\n try {\n return JSON.parse(this.requirementsValue);\n } catch (e) {\n return [];\n }\n }\n}\n","import { Target, TypedController, Value } from \"@vytant/stimulus-decorators\";\nimport { Controller } from \"stimulus\";\n\n@TypedController\nexport default class extends Controller {\n @Target readonly checkTarget!: HTMLElement;\n @Target readonly crossTarget!: HTMLElement;\n\n @Value(String) ruleValue!: string;\n\n setValidity(valid: boolean) {\n this.checkTarget.classList.toggle(\"tw-hidden\", !valid);\n this.crossTarget.classList.toggle(\"tw-hidden\", valid);\n\n this.element.classList.toggle(\"tw-text-lime-600\", valid);\n }\n}\n","/*\n * International Telephone Input v20.1.0\n * https://github.com/jackocnr/intl-tel-input.git\n * Licensed under the MIT license\n */\n\n// wrap in UMD\n(function(factory) {\n if (typeof module === \"object\" && module.exports) module.exports = factory(); else window.intlTelInput = factory();\n})(function(undefined) {\n \"use strict\";\n return function() {\n // Array of country objects for the flag dropdown.\n // Here is the criteria for the plugin to support a given country/territory\n // - It has an iso2 code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\n // - It has it's own country calling code (it is not a sub-region of another country): https://en.wikipedia.org/wiki/List_of_country_calling_codes\n // - It has a flag in the region-flags project: https://github.com/behdad/region-flags/tree/gh-pages/png\n // - It is supported by libphonenumber (it must be listed on this page): https://github.com/googlei18n/libphonenumber/blob/master/resources/ShortNumberMetadata.xml\n // Each country array has the following information:\n // [\n // Country name,\n // iso2 code,\n // International dial code,\n // Order (if >1 country with same dial code),\n // Area codes\n // ]\n var allCountries = [ [ \"Afghanistan\", \"af\", \"93\" ], [ \"Albania\", \"al\", \"355\" ], [ \"Algeria\", \"dz\", \"213\" ], [ \"American Samoa\", \"as\", \"1\", 5, [ \"684\" ] ], [ \"Andorra\", \"ad\", \"376\" ], [ \"Angola\", \"ao\", \"244\" ], [ \"Anguilla\", \"ai\", \"1\", 6, [ \"264\" ] ], [ \"Antigua & Barbuda\", \"ag\", \"1\", 7, [ \"268\" ] ], [ \"Argentina\", \"ar\", \"54\" ], [ \"Armenia\", \"am\", \"374\" ], [ \"Aruba\", \"aw\", \"297\" ], [ \"Ascension Island\", \"ac\", \"247\" ], [ \"Australia\", \"au\", \"61\", 0 ], [ \"Austria\", \"at\", \"43\" ], [ \"Azerbaijan\", \"az\", \"994\" ], [ \"Bahamas\", \"bs\", \"1\", 8, [ \"242\" ] ], [ \"Bahrain\", \"bh\", \"973\" ], [ \"Bangladesh\", \"bd\", \"880\" ], [ \"Barbados\", \"bb\", \"1\", 9, [ \"246\" ] ], [ \"Belarus\", \"by\", \"375\" ], [ \"Belgium\", \"be\", \"32\" ], [ \"Belize\", \"bz\", \"501\" ], [ \"Benin\", \"bj\", \"229\" ], [ \"Bermuda\", \"bm\", \"1\", 10, [ \"441\" ] ], [ \"Bhutan\", \"bt\", \"975\" ], [ \"Bolivia\", \"bo\", \"591\" ], [ \"Bosnia & Herzegovina\", \"ba\", \"387\" ], [ \"Botswana\", \"bw\", \"267\" ], [ \"Brazil\", \"br\", \"55\" ], [ \"British Indian Ocean Territory\", \"io\", \"246\" ], [ \"British Virgin Islands\", \"vg\", \"1\", 11, [ \"284\" ] ], [ \"Brunei\", \"bn\", \"673\" ], [ \"Bulgaria\", \"bg\", \"359\" ], [ \"Burkina Faso\", \"bf\", \"226\" ], [ \"Burundi\", \"bi\", \"257\" ], [ \"Cambodia\", \"kh\", \"855\" ], [ \"Cameroon\", \"cm\", \"237\" ], [ \"Canada\", \"ca\", \"1\", 1, [ \"204\", \"226\", \"236\", \"249\", \"250\", \"263\", \"289\", \"306\", \"343\", \"354\", \"365\", \"367\", \"368\", \"382\", \"387\", \"403\", \"416\", \"418\", \"428\", \"431\", \"437\", \"438\", \"450\", \"584\", \"468\", \"474\", \"506\", \"514\", \"519\", \"548\", \"579\", \"581\", \"584\", \"587\", \"604\", \"613\", \"639\", \"647\", \"672\", \"683\", \"705\", \"709\", \"742\", \"753\", \"778\", \"780\", \"782\", \"807\", \"819\", \"825\", \"867\", \"873\", \"902\", \"905\" ] ], [ \"Cape Verde\", \"cv\", \"238\" ], [ \"Caribbean Netherlands\", \"bq\", \"599\", 1, [ \"3\", \"4\", \"7\" ] ], [ \"Cayman Islands\", \"ky\", \"1\", 12, [ \"345\" ] ], [ \"Central African Republic\", \"cf\", \"236\" ], [ \"Chad\", \"td\", \"235\" ], [ \"Chile\", \"cl\", \"56\" ], [ \"China\", \"cn\", \"86\" ], [ \"Christmas Island\", \"cx\", \"61\", 2, [ \"89164\" ] ], [ \"Cocos (Keeling) Islands\", \"cc\", \"61\", 1, [ \"89162\" ] ], [ \"Colombia\", \"co\", \"57\" ], [ \"Comoros\", \"km\", \"269\" ], [ \"Congo - Brazzaville\", \"cg\", \"242\" ], [ \"Congo - Kinshasa\", \"cd\", \"243\" ], [ \"Cook Islands\", \"ck\", \"682\" ], [ \"Costa Rica\", \"cr\", \"506\" ], [ \"Côte d’Ivoire\", \"ci\", \"225\" ], [ \"Croatia\", \"hr\", \"385\" ], [ \"Cuba\", \"cu\", \"53\" ], [ \"Curaçao\", \"cw\", \"599\", 0 ], [ \"Cyprus\", \"cy\", \"357\" ], [ \"Czech Republic\", \"cz\", \"420\" ], [ \"Denmark\", \"dk\", \"45\" ], [ \"Djibouti\", \"dj\", \"253\" ], [ \"Dominica\", \"dm\", \"1\", 13, [ \"767\" ] ], [ \"Dominican Republic\", \"do\", \"1\", 2, [ \"809\", \"829\", \"849\" ] ], [ \"Ecuador\", \"ec\", \"593\" ], [ \"Egypt\", \"eg\", \"20\" ], [ \"El Salvador\", \"sv\", \"503\" ], [ \"Equatorial Guinea\", \"gq\", \"240\" ], [ \"Eritrea\", \"er\", \"291\" ], [ \"Estonia\", \"ee\", \"372\" ], [ \"Eswatini\", \"sz\", \"268\" ], [ \"Ethiopia\", \"et\", \"251\" ], [ \"Falkland Islands\", \"fk\", \"500\" ], [ \"Faroe Islands\", \"fo\", \"298\" ], [ \"Fiji\", \"fj\", \"679\" ], [ \"Finland\", \"fi\", \"358\", 0 ], [ \"France\", \"fr\", \"33\" ], [ \"French Guiana\", \"gf\", \"594\" ], [ \"French Polynesia\", \"pf\", \"689\" ], [ \"Gabon\", \"ga\", \"241\" ], [ \"Gambia\", \"gm\", \"220\" ], [ \"Georgia\", \"ge\", \"995\" ], [ \"Germany\", \"de\", \"49\" ], [ \"Ghana\", \"gh\", \"233\" ], [ \"Gibraltar\", \"gi\", \"350\" ], [ \"Greece\", \"gr\", \"30\" ], [ \"Greenland\", \"gl\", \"299\" ], [ \"Grenada\", \"gd\", \"1\", 14, [ \"473\" ] ], [ \"Guadeloupe\", \"gp\", \"590\", 0 ], [ \"Guam\", \"gu\", \"1\", 15, [ \"671\" ] ], [ \"Guatemala\", \"gt\", \"502\" ], [ \"Guernsey\", \"gg\", \"44\", 1, [ \"1481\", \"7781\", \"7839\", \"7911\" ] ], [ \"Guinea\", \"gn\", \"224\" ], [ \"Guinea-Bissau\", \"gw\", \"245\" ], [ \"Guyana\", \"gy\", \"592\" ], [ \"Haiti\", \"ht\", \"509\" ], [ \"Honduras\", \"hn\", \"504\" ], [ \"Hong Kong\", \"hk\", \"852\" ], [ \"Hungary\", \"hu\", \"36\" ], [ \"Iceland\", \"is\", \"354\" ], [ \"India\", \"in\", \"91\" ], [ \"Indonesia\", \"id\", \"62\" ], [ \"Iran\", \"ir\", \"98\" ], [ \"Iraq\", \"iq\", \"964\" ], [ \"Ireland\", \"ie\", \"353\" ], [ \"Isle of Man\", \"im\", \"44\", 2, [ \"1624\", \"74576\", \"7524\", \"7924\", \"7624\" ] ], [ \"Israel\", \"il\", \"972\" ], [ \"Italy\", \"it\", \"39\", 0 ], [ \"Jamaica\", \"jm\", \"1\", 4, [ \"876\", \"658\" ] ], [ \"Japan\", \"jp\", \"81\" ], [ \"Jersey\", \"je\", \"44\", 3, [ \"1534\", \"7509\", \"7700\", \"7797\", \"7829\", \"7937\" ] ], [ \"Jordan\", \"jo\", \"962\" ], [ \"Kazakhstan\", \"kz\", \"7\", 1, [ \"33\", \"7\" ] ], [ \"Kenya\", \"ke\", \"254\" ], [ \"Kiribati\", \"ki\", \"686\" ], [ \"Kosovo\", \"xk\", \"383\" ], [ \"Kuwait\", \"kw\", \"965\" ], [ \"Kyrgyzstan\", \"kg\", \"996\" ], [ \"Laos\", \"la\", \"856\" ], [ \"Latvia\", \"lv\", \"371\" ], [ \"Lebanon\", \"lb\", \"961\" ], [ \"Lesotho\", \"ls\", \"266\" ], [ \"Liberia\", \"lr\", \"231\" ], [ \"Libya\", \"ly\", \"218\" ], [ \"Liechtenstein\", \"li\", \"423\" ], [ \"Lithuania\", \"lt\", \"370\" ], [ \"Luxembourg\", \"lu\", \"352\" ], [ \"Macau\", \"mo\", \"853\" ], [ \"Madagascar\", \"mg\", \"261\" ], [ \"Malawi\", \"mw\", \"265\" ], [ \"Malaysia\", \"my\", \"60\" ], [ \"Maldives\", \"mv\", \"960\" ], [ \"Mali\", \"ml\", \"223\" ], [ \"Malta\", \"mt\", \"356\" ], [ \"Marshall Islands\", \"mh\", \"692\" ], [ \"Martinique\", \"mq\", \"596\" ], [ \"Mauritania\", \"mr\", \"222\" ], [ \"Mauritius\", \"mu\", \"230\" ], [ \"Mayotte\", \"yt\", \"262\", 1, [ \"269\", \"639\" ] ], [ \"Mexico\", \"mx\", \"52\" ], [ \"Micronesia\", \"fm\", \"691\" ], [ \"Moldova\", \"md\", \"373\" ], [ \"Monaco\", \"mc\", \"377\" ], [ \"Mongolia\", \"mn\", \"976\" ], [ \"Montenegro\", \"me\", \"382\" ], [ \"Montserrat\", \"ms\", \"1\", 16, [ \"664\" ] ], [ \"Morocco\", \"ma\", \"212\", 0 ], [ \"Mozambique\", \"mz\", \"258\" ], [ \"Myanmar (Burma)\", \"mm\", \"95\" ], [ \"Namibia\", \"na\", \"264\" ], [ \"Nauru\", \"nr\", \"674\" ], [ \"Nepal\", \"np\", \"977\" ], [ \"Netherlands\", \"nl\", \"31\" ], [ \"New Caledonia\", \"nc\", \"687\" ], [ \"New Zealand\", \"nz\", \"64\" ], [ \"Nicaragua\", \"ni\", \"505\" ], [ \"Niger\", \"ne\", \"227\" ], [ \"Nigeria\", \"ng\", \"234\" ], [ \"Niue\", \"nu\", \"683\" ], [ \"Norfolk Island\", \"nf\", \"672\" ], [ \"North Korea\", \"kp\", \"850\" ], [ \"North Macedonia\", \"mk\", \"389\" ], [ \"Northern Mariana Islands\", \"mp\", \"1\", 17, [ \"670\" ] ], [ \"Norway\", \"no\", \"47\", 0 ], [ \"Oman\", \"om\", \"968\" ], [ \"Pakistan\", \"pk\", \"92\" ], [ \"Palau\", \"pw\", \"680\" ], [ \"Palestine\", \"ps\", \"970\" ], [ \"Panama\", \"pa\", \"507\" ], [ \"Papua New Guinea\", \"pg\", \"675\" ], [ \"Paraguay\", \"py\", \"595\" ], [ \"Peru\", \"pe\", \"51\" ], [ \"Philippines\", \"ph\", \"63\" ], [ \"Poland\", \"pl\", \"48\" ], [ \"Portugal\", \"pt\", \"351\" ], [ \"Puerto Rico\", \"pr\", \"1\", 3, [ \"787\", \"939\" ] ], [ \"Qatar\", \"qa\", \"974\" ], [ \"Réunion\", \"re\", \"262\", 0 ], [ \"Romania\", \"ro\", \"40\" ], [ \"Russia\", \"ru\", \"7\", 0 ], [ \"Rwanda\", \"rw\", \"250\" ], [ \"Samoa\", \"ws\", \"685\" ], [ \"San Marino\", \"sm\", \"378\" ], [ \"São Tomé & Príncipe\", \"st\", \"239\" ], [ \"Saudi Arabia\", \"sa\", \"966\" ], [ \"Senegal\", \"sn\", \"221\" ], [ \"Serbia\", \"rs\", \"381\" ], [ \"Seychelles\", \"sc\", \"248\" ], [ \"Sierra Leone\", \"sl\", \"232\" ], [ \"Singapore\", \"sg\", \"65\" ], [ \"Sint Maarten\", \"sx\", \"1\", 21, [ \"721\" ] ], [ \"Slovakia\", \"sk\", \"421\" ], [ \"Slovenia\", \"si\", \"386\" ], [ \"Solomon Islands\", \"sb\", \"677\" ], [ \"Somalia\", \"so\", \"252\" ], [ \"South Africa\", \"za\", \"27\" ], [ \"South Korea\", \"kr\", \"82\" ], [ \"South Sudan\", \"ss\", \"211\" ], [ \"Spain\", \"es\", \"34\" ], [ \"Sri Lanka\", \"lk\", \"94\" ], [ \"St Barthélemy\", \"bl\", \"590\", 1 ], [ \"St Helena\", \"sh\", \"290\" ], [ \"St Kitts & Nevis\", \"kn\", \"1\", 18, [ \"869\" ] ], [ \"St Lucia\", \"lc\", \"1\", 19, [ \"758\" ] ], [ \"St Martin\", \"mf\", \"590\", 2 ], [ \"St Pierre & Miquelon\", \"pm\", \"508\" ], [ \"St Vincent & Grenadines\", \"vc\", \"1\", 20, [ \"784\" ] ], [ \"Sudan\", \"sd\", \"249\" ], [ \"Suriname\", \"sr\", \"597\" ], [ \"Svalbard & Jan Mayen\", \"sj\", \"47\", 1, [ \"79\" ] ], [ \"Sweden\", \"se\", \"46\" ], [ \"Switzerland\", \"ch\", \"41\" ], [ \"Syria\", \"sy\", \"963\" ], [ \"Taiwan\", \"tw\", \"886\" ], [ \"Tajikistan\", \"tj\", \"992\" ], [ \"Tanzania\", \"tz\", \"255\" ], [ \"Thailand\", \"th\", \"66\" ], [ \"Timor-Leste\", \"tl\", \"670\" ], [ \"Togo\", \"tg\", \"228\" ], [ \"Tokelau\", \"tk\", \"690\" ], [ \"Tonga\", \"to\", \"676\" ], [ \"Trinidad & Tobago\", \"tt\", \"1\", 22, [ \"868\" ] ], [ \"Tunisia\", \"tn\", \"216\" ], [ \"Turkey\", \"tr\", \"90\" ], [ \"Turkmenistan\", \"tm\", \"993\" ], [ \"Turks & Caicos Islands\", \"tc\", \"1\", 23, [ \"649\" ] ], [ \"Tuvalu\", \"tv\", \"688\" ], [ \"Uganda\", \"ug\", \"256\" ], [ \"Ukraine\", \"ua\", \"380\" ], [ \"United Arab Emirates\", \"ae\", \"971\" ], [ \"United Kingdom\", \"gb\", \"44\", 0 ], [ \"United States\", \"us\", \"1\", 0 ], [ \"Uruguay\", \"uy\", \"598\" ], [ \"US Virgin Islands\", \"vi\", \"1\", 24, [ \"340\" ] ], [ \"Uzbekistan\", \"uz\", \"998\" ], [ \"Vanuatu\", \"vu\", \"678\" ], [ \"Vatican City\", \"va\", \"39\", 1, [ \"06698\" ] ], [ \"Venezuela\", \"ve\", \"58\" ], [ \"Vietnam\", \"vn\", \"84\" ], [ \"Wallis & Futuna\", \"wf\", \"681\" ], [ \"Western Sahara\", \"eh\", \"212\", 1, [ \"5288\", \"5289\" ] ], [ \"Yemen\", \"ye\", \"967\" ], [ \"Zambia\", \"zm\", \"260\" ], [ \"Zimbabwe\", \"zw\", \"263\" ], [ \"Åland Islands\", \"ax\", \"358\", 1, [ \"18\" ] ] ];\n // loop over all of the countries above, restructuring the data to be objects with named keys\n for (var i = 0; i < allCountries.length; i++) {\n var c = allCountries[i];\n allCountries[i] = {\n name: c[0],\n iso2: c[1],\n dialCode: c[2],\n priority: c[3] || 0,\n areaCodes: c[4] || null,\n nodeById: {}\n };\n }\n \"use strict\";\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n return keys;\n }\n function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function(key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n }\n function _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n }\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n }\n function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n }\n function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (;!(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) ;\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n }\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n }\n function _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n }\n function _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n }\n var intlTelInputGlobals = {\n getInstance: function getInstance(input) {\n var id = input.getAttribute(\"data-intl-tel-input-id\");\n return window.intlTelInputGlobals.instances[id];\n },\n instances: {},\n // using a global like this allows us to mock it in the tests\n documentReady: function documentReady() {\n return document.readyState === \"complete\";\n }\n };\n if (typeof window === \"object\") {\n window.intlTelInputGlobals = intlTelInputGlobals;\n }\n // these vars persist through all instances of the plugin\n var id = 0;\n var defaults = {\n // whether or not to allow the dropdown\n allowDropdown: true,\n // add a placeholder in the input with an example number for the selected country\n autoPlaceholder: \"polite\",\n // add a country search input at the top of the dropdown\n countrySearch: true,\n // modify the parentClass\n containerClass: \"\",\n // modify the auto placeholder\n customPlaceholder: null,\n // append menu to specified element\n dropdownContainer: null,\n // don't display these countries\n excludeCountries: [],\n // fix the dropdown width to the input width (rather than being as wide as the longest country name)\n fixDropdownWidth: true,\n // format the number as the user types\n formatAsYouType: true,\n // format the input value during initialisation and on setNumber\n formatOnDisplay: true,\n // geoIp lookup function\n geoIpLookup: null,\n // inject a hidden input with the name returned from this function, and on submit, populate it with the result of getNumber\n hiddenInput: null,\n // internationalise the plugin text e.g. search input placeholder, country names\n i18n: {},\n // initial country\n initialCountry: \"\",\n // national vs international formatting for numbers e.g. placeholders and displaying existing numbers\n nationalMode: true,\n // display only these countries\n onlyCountries: [],\n // number type to use for placeholders\n placeholderNumberType: \"MOBILE\",\n // the countries at the top of the list\n preferredCountries: [],\n // option to hide the flags - must be used with showSelectedDialCode, or allowDropdown=false\n showFlags: true,\n // display the international dial code next to the selected flag\n showSelectedDialCode: false,\n // use full screen popup instead of dropdown for country list\n useFullscreenPopup: typeof navigator !== \"undefined\" && typeof window !== \"undefined\" ? // we cannot just test screen size as some smartphones/website meta tags will report desktop\n // resolutions\n // Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'\n /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500 : false,\n // specify the path to the libphonenumber script to enable validation/formatting\n utilsScript: \"\"\n };\n // https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes#Non-geographic_area_codes\n var regionlessNanpNumbers = [ \"800\", \"822\", \"833\", \"844\", \"855\", \"866\", \"877\", \"880\", \"881\", \"882\", \"883\", \"884\", \"885\", \"886\", \"887\", \"888\", \"889\" ];\n // run a method on each instance of the plugin\n var forEachInstance = function forEachInstance(method) {\n var instances = window.intlTelInputGlobals.instances;\n Object.values(instances).forEach(function(instance) {\n return instance[method]();\n });\n };\n // this is our plugin class that we will create an instance of\n // eslint-disable-next-line no-unused-vars\n var Iti = /*#__PURE__*/ function() {\n function Iti(input) {\n var customOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Iti);\n this.id = id++;\n this.telInput = input;\n this.activeItem = null;\n this.highlightedItem = null;\n // process specified options / defaults\n this.options = Object.assign({}, defaults, customOptions);\n this.hadInitialPlaceholder = Boolean(input.getAttribute(\"placeholder\"));\n }\n _createClass(Iti, [ {\n key: \"_init\",\n value: function _init() {\n var _this = this;\n // if showing fullscreen popup, do not fix the width\n if (this.options.useFullscreenPopup) {\n this.options.fixDropdownWidth = false;\n }\n // when search enabled, we must fix the width else it would change with different results\n if (this.options.countrySearch && !this.options.useFullscreenPopup) {\n this.options.fixDropdownWidth = true;\n }\n // force showFlags=true if there's a dropdown and we're not displaying the dial code,\n // as otherwise you just have a down arrow on it's own which doesn't make sense\n var forceShowFlags = this.options.allowDropdown && !this.options.showSelectedDialCode;\n if (!this.options.showFlags && forceShowFlags) {\n this.options.showFlags = true;\n }\n // on mobile, we want a full screen dropdown, so we must append it to the body\n if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {\n this.options.dropdownContainer = document.body;\n }\n // check if input has one parent with RTL\n this.isRTL = !!this.telInput.closest(\"[dir=rtl]\");\n // these promises get resolved when their individual requests complete\n // this way the dev can do something like iti.promise.then(...) to know when all requests are\n // complete\n var autoCountryPromise = new Promise(function(resolve, reject) {\n _this.resolveAutoCountryPromise = resolve;\n _this.rejectAutoCountryPromise = reject;\n });\n var utilsScriptPromise = new Promise(function(resolve, reject) {\n _this.resolveUtilsScriptPromise = resolve;\n _this.rejectUtilsScriptPromise = reject;\n });\n this.promise = Promise.all([ autoCountryPromise, utilsScriptPromise ]);\n // in various situations there could be no country selected initially, but we need to be able\n // to assume this variable exists\n this.selectedCountryData = {};\n // process all the data: onlyCountries, excludeCountries, preferredCountries etc\n this._processCountryData();\n // generate the markup\n this._generateMarkup();\n // set the initial state of the input value and the selected flag\n this._setInitialState();\n // start all of the event listeners: input keydown, selectedFlag click\n this._initListeners();\n // utils script, and auto country\n this._initRequests();\n }\n }, {\n key: \"_processCountryData\",\n value: function _processCountryData() {\n // process onlyCountries or excludeCountries array if present\n this._processAllCountries();\n // generate this.dialCodes and this.dialCodeToIso2Map\n this._processDialCodes();\n // process the preferredCountries\n this._processPreferredCountries();\n // translate country names according to i18n option\n this._translateCountryNames();\n // sort countries by name\n if (this.options.onlyCountries.length || this.options.i18n) {\n this.countries.sort(this._countryNameSort);\n }\n }\n }, {\n key: \"_addToDialCodeMap\",\n value: function _addToDialCodeMap(iso2, dialCode, priority) {\n if (dialCode.length > this.dialCodeMaxLen) {\n this.dialCodeMaxLen = dialCode.length;\n }\n if (!this.dialCodeToIso2Map.hasOwnProperty(dialCode)) {\n this.dialCodeToIso2Map[dialCode] = [];\n }\n // bail if we already have this country for this dialCode\n for (var i = 0; i < this.dialCodeToIso2Map[dialCode].length; i++) {\n if (this.dialCodeToIso2Map[dialCode][i] === iso2) {\n return;\n }\n }\n // check for undefined as 0 is falsy\n var index = priority !== undefined ? priority : this.dialCodeToIso2Map[dialCode].length;\n this.dialCodeToIso2Map[dialCode][index] = iso2;\n }\n }, {\n key: \"_processAllCountries\",\n value: function _processAllCountries() {\n if (this.options.onlyCountries.length) {\n var lowerCaseOnlyCountries = this.options.onlyCountries.map(function(country) {\n return country.toLowerCase();\n });\n this.countries = allCountries.filter(function(country) {\n return lowerCaseOnlyCountries.indexOf(country.iso2) > -1;\n });\n } else if (this.options.excludeCountries.length) {\n var lowerCaseExcludeCountries = this.options.excludeCountries.map(function(country) {\n return country.toLowerCase();\n });\n this.countries = allCountries.filter(function(country) {\n return lowerCaseExcludeCountries.indexOf(country.iso2) === -1;\n });\n } else {\n this.countries = allCountries;\n }\n }\n }, {\n key: \"_translateCountryNames\",\n value: function _translateCountryNames() {\n for (var i = 0; i < this.countries.length; i++) {\n var iso2 = this.countries[i].iso2.toLowerCase();\n if (this.options.i18n.hasOwnProperty(iso2)) {\n this.countries[i].name = this.options.i18n[iso2];\n }\n }\n }\n }, {\n key: \"_countryNameSort\",\n value: function _countryNameSort(a, b) {\n if (a.name < b.name) {\n return -1;\n }\n if (a.name > b.name) {\n return 1;\n }\n return 0;\n }\n }, {\n key: \"_processDialCodes\",\n value: function _processDialCodes() {\n // here we store just dial codes, where the key is the dial code, and the value is true\n // e.g. { 1: true, 7: true, 20: true, ... }\n this.dialCodes = {};\n this.dialCodeMaxLen = 0;\n // here we map dialCodes (inc both dialCode and dialCode+areaCode) to iso2 codes\n /* e.g.\n * {\n * 1: [ 'us', 'ca', ... ], # all NANP countries\n * 12: [ 'us', 'ca', ... ], # subset of NANP countries\n * 120: [ 'us', 'ca' ], # just US and Canada\n * 1204: [ 'ca' ], # only Canada\n * ...\n * }\n */\n this.dialCodeToIso2Map = {};\n // first: add dial codes\n for (var i = 0; i < this.countries.length; i++) {\n var c = this.countries[i];\n if (!this.dialCodes[c.dialCode]) {\n this.dialCodes[c.dialCode] = true;\n }\n this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);\n }\n // next: add area codes\n // this is a second loop over countries, to make sure we have all of the \"root\" countries\n // already in the map, so that we can access them, as each time we add an area code substring\n // to the map, we also need to include the \"root\" country's code, as that also matches\n for (var _i = 0; _i < this.countries.length; _i++) {\n var _c = this.countries[_i];\n // area codes\n if (_c.areaCodes) {\n var rootIso2Code = this.dialCodeToIso2Map[_c.dialCode][0];\n // for each area code\n for (var j = 0; j < _c.areaCodes.length; j++) {\n var areaCode = _c.areaCodes[j];\n // for each digit in the area code to add all partial matches as well\n for (var k = 1; k < areaCode.length; k++) {\n var partialDialCode = _c.dialCode + areaCode.substr(0, k);\n // start with the root country, as that also matches this dial code\n this._addToDialCodeMap(rootIso2Code, partialDialCode);\n this._addToDialCodeMap(_c.iso2, partialDialCode);\n }\n // add the full area code\n this._addToDialCodeMap(_c.iso2, _c.dialCode + areaCode);\n }\n }\n }\n }\n }, {\n key: \"_processPreferredCountries\",\n value: function _processPreferredCountries() {\n this.preferredCountries = [];\n for (var i = 0; i < this.options.preferredCountries.length; i++) {\n var iso2 = this.options.preferredCountries[i].toLowerCase();\n var countryData = this._getCountryData(iso2, true);\n if (countryData) {\n this.preferredCountries.push(countryData);\n }\n }\n }\n }, {\n key: \"_createEl\",\n value: function _createEl(name, attrs, container) {\n var el = document.createElement(name);\n if (attrs) {\n Object.entries(attrs).forEach(function(_ref) {\n var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];\n return el.setAttribute(key, value);\n });\n }\n if (container) {\n container.appendChild(el);\n }\n return el;\n }\n }, {\n key: \"_generateMarkup\",\n value: function _generateMarkup() {\n this.telInput.classList.add(\"iti__tel-input\");\n // if autocomplete does not exist on the element and its form, then\n // prevent autocomplete as there's no safe, cross-browser event we can react to, so it can\n // easily put the plugin in an inconsistent state e.g. the wrong flag selected for the\n // autocompleted number, which on submit could mean wrong number is saved\n if (!this.telInput.hasAttribute(\"autocomplete\") && !(this.telInput.form && this.telInput.form.hasAttribute(\"autocomplete\"))) {\n this.telInput.setAttribute(\"autocomplete\", \"off\");\n }\n var _this$options = this.options, allowDropdown = _this$options.allowDropdown, showSelectedDialCode = _this$options.showSelectedDialCode, showFlags = _this$options.showFlags, containerClass = _this$options.containerClass, hiddenInput = _this$options.hiddenInput, dropdownContainer = _this$options.dropdownContainer, fixDropdownWidth = _this$options.fixDropdownWidth, useFullscreenPopup = _this$options.useFullscreenPopup, countrySearch = _this$options.countrySearch, i18n = _this$options.i18n;\n // containers (mostly for positioning)\n var parentClass = \"iti\";\n if (allowDropdown) {\n parentClass += \" iti--allow-dropdown\";\n }\n if (showSelectedDialCode) {\n parentClass += \" iti--show-selected-dial-code\";\n }\n if (showFlags) {\n parentClass += \" iti--show-flags\";\n }\n if (containerClass) {\n parentClass += \" \".concat(containerClass);\n }\n if (!useFullscreenPopup) {\n parentClass += \" iti--inline-dropdown\";\n }\n var wrapper = this._createEl(\"div\", {\n \"class\": parentClass\n });\n this.telInput.parentNode.insertBefore(wrapper, this.telInput);\n // if we're showing flags or dial codes, we need the flags container etc\n if (showFlags || showSelectedDialCode) {\n this.flagsContainer = this._createEl(\"div\", {\n \"class\": \"iti__flag-container\"\n }, wrapper);\n // selected flag (displayed on left of input while allowDropdown is enabled, otherwise to right)\n // when countrySearch disabled: using Aria tags for \"Select-Only Combobox Example\"\n // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/\n this.selectedFlag = this._createEl(\"div\", _objectSpread({\n \"class\": \"iti__selected-flag\"\n }, allowDropdown && _objectSpread({\n role: \"button\",\n \"aria-expanded\": \"false\",\n \"aria-label\": this.options.i18n.selectedCountryAriaLabel || \"Selected country\",\n \"aria-haspopup\": countrySearch ? \"true\" : \"listbox\",\n \"aria-controls\": countrySearch ? \"iti-\".concat(this.id, \"__dropdown-content\") : \"iti-\".concat(this.id, \"__country-listbox\")\n }, countrySearch || {\n role: \"combobox\"\n })), this.flagsContainer);\n // we now include the selected flag element even when showFlags is disabled,\n // as need to show globe icon for showSelectedDialCode empty state\n this.selectedFlagInner = this._createEl(\"div\", null, this.selectedFlag);\n this.selectedFlagA11yText = this._createEl(\"span\", {\n \"class\": \"iti__a11y-text\"\n }, this.selectedFlagInner);\n }\n wrapper.appendChild(this.telInput);\n if (this.selectedFlag && this.telInput.disabled) {\n this.selectedFlag.setAttribute(\"aria-disabled\", \"true\");\n }\n if (showSelectedDialCode) {\n this.selectedDialCode = this._createEl(\"div\", {\n \"class\": \"iti__selected-dial-code\"\n }, this.selectedFlag);\n }\n if (allowDropdown) {\n if (!this.telInput.disabled) {\n // make element focusable and tab navigable\n this.selectedFlag.setAttribute(\"tabindex\", \"0\");\n }\n this.dropdownArrow = this._createEl(\"div\", {\n \"class\": \"iti__arrow\",\n \"aria-hidden\": \"true\"\n }, this.selectedFlag);\n var extraClasses = fixDropdownWidth ? \"\" : \"iti--flexible-dropdown-width\";\n this.dropdownContent = this._createEl(\"div\", {\n id: \"iti-\".concat(this.id, \"__dropdown-content\"),\n \"class\": \"iti__dropdown-content iti__hide \".concat(extraClasses)\n });\n if (countrySearch) {\n this.searchInput = this._createEl(\"input\", {\n type: \"text\",\n \"class\": \"iti__search-input\",\n placeholder: i18n.searchPlaceholder || \"Search\",\n role: \"combobox\",\n \"aria-expanded\": \"true\",\n \"aria-label\": i18n.searchPlaceholder || \"Search\",\n \"aria-controls\": \"iti-\".concat(this.id, \"__country-listbox\"),\n \"aria-autocomplete\": \"list\",\n autocomplete: \"off\"\n }, this.dropdownContent);\n this.searchResultsA11yText = this._createEl(\"span\", {\n \"class\": \"iti__a11y-text\"\n }, this.dropdownContent);\n }\n // country list: preferred countries, then divider, then all countries\n this.countryList = this._createEl(\"ul\", {\n \"class\": \"iti__country-list\",\n id: \"iti-\".concat(this.id, \"__country-listbox\"),\n role: \"listbox\",\n \"aria-label\": i18n.countryListAriaLabel || \"List of countries\"\n }, this.dropdownContent);\n if (this.preferredCountries.length && !countrySearch) {\n this._appendListItems(this.preferredCountries, \"iti__preferred\", true);\n this._createEl(\"li\", {\n \"class\": \"iti__divider\",\n \"aria-hidden\": \"true\"\n }, this.countryList);\n }\n this._appendListItems(this.countries, \"iti__standard\");\n if (countrySearch) {\n this._updateSearchResultsText();\n }\n // create dropdownContainer markup\n if (dropdownContainer) {\n var dropdownClasses = \"iti iti--container\";\n if (useFullscreenPopup) {\n dropdownClasses += \" iti--fullscreen-popup\";\n } else {\n dropdownClasses += \" iti--inline-dropdown\";\n }\n if (countrySearch) {\n dropdownClasses += \" iti--country-search\";\n }\n this.dropdown = this._createEl(\"div\", {\n \"class\": dropdownClasses\n });\n this.dropdown.appendChild(this.dropdownContent);\n } else {\n this.flagsContainer.appendChild(this.dropdownContent);\n }\n }\n if (hiddenInput) {\n var telInputName = this.telInput.getAttribute(\"name\");\n var names = hiddenInput(telInputName);\n if (names.phone) {\n // Create hidden input for the full international number\n this.hiddenInput = this._createEl(\"input\", {\n type: \"hidden\",\n name: names.phone\n });\n wrapper.appendChild(this.hiddenInput);\n }\n if (names.country) {\n // Create hidden input for the selected country iso2 code\n this.hiddenInputCountry = this._createEl(\"input\", {\n type: \"hidden\",\n name: names.country\n });\n wrapper.appendChild(this.hiddenInputCountry);\n }\n }\n }\n }, {\n key: \"_appendListItems\",\n value: function _appendListItems(countries, className, preferred) {\n for (var i = 0; i < countries.length; i++) {\n var c = countries[i];\n var idSuffix = preferred ? \"-preferred\" : \"\";\n var listItem = this._createEl(\"li\", {\n id: \"iti-\".concat(this.id, \"__item-\").concat(c.iso2).concat(idSuffix),\n \"class\": \"iti__country \".concat(className),\n tabindex: \"-1\",\n role: \"option\",\n \"data-dial-code\": c.dialCode,\n \"data-country-code\": c.iso2,\n \"aria-selected\": \"false\"\n }, this.countryList);\n // store this for later use e.g. country search filtering\n c.nodeById[this.id] = listItem;\n var content = \"\";\n // add the flag\n if (this.options.showFlags) {\n content += \"
\");\n }\n // and the country name and dial code\n content += \"\".concat(c.name, \"\");\n content += \"+\".concat(c.dialCode, \"\");\n listItem.insertAdjacentHTML(\"beforeend\", content);\n }\n }\n }, {\n key: \"_setInitialState\",\n value: function _setInitialState() {\n var overrideAutoCountry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n // fix firefox bug: when first load page (with input with value set to number with intl dial\n // code) and initialising plugin removes the dial code from the input, then refresh page,\n // and we try to init plugin again but this time on number without dial code so get grey flag\n var attributeValue = this.telInput.getAttribute(\"value\");\n var inputValue = this.telInput.value;\n var useAttribute = attributeValue && attributeValue.charAt(0) === \"+\" && (!inputValue || inputValue.charAt(0) !== \"+\");\n var val = useAttribute ? attributeValue : inputValue;\n var dialCode = this._getDialCode(val);\n var isRegionlessNanp = this._isRegionlessNanp(val);\n var initialCountry = this.options.initialCountry;\n // if we already have a dial code, and it's not a regionlessNanp, we can go ahead and set the\n // flag, else fall back to the default country\n if (dialCode && !isRegionlessNanp) {\n this._updateFlagFromNumber(val);\n } else if (initialCountry !== \"auto\" || overrideAutoCountry) {\n var lowerInitialCountry = initialCountry ? initialCountry.toLowerCase() : \"\";\n var isValidInitialCountry = lowerInitialCountry && this._getCountryData(lowerInitialCountry, true);\n // see if we should select a flag\n if (isValidInitialCountry) {\n this._setCountry(lowerInitialCountry);\n } else {\n if (dialCode && isRegionlessNanp) {\n // has intl dial code, is regionless nanp, and no initialCountry, so default to US\n this._setCountry(\"us\");\n } else {\n // display the empty state (globe icon)\n this._setCountry();\n }\n }\n }\n // NOTE: if initialCountry is set to auto, that will be handled separately\n // format - note this wont be run after _updateDialCode as that's only called if no val\n if (val) {\n this._updateValFromNumber(val);\n }\n }\n }, {\n key: \"_initListeners\",\n value: function _initListeners() {\n this._initKeyListeners();\n if (this.options.allowDropdown) {\n this._initDropdownListeners();\n }\n if ((this.hiddenInput || this.hiddenInputCountry) && this.telInput.form) {\n this._initHiddenInputListener();\n }\n }\n }, {\n key: \"_initHiddenInputListener\",\n value: function _initHiddenInputListener() {\n var _this2 = this;\n this._handleHiddenInputSubmit = function() {\n if (_this2.hiddenInput) {\n _this2.hiddenInput.value = _this2.getNumber();\n }\n if (_this2.hiddenInputCountry) {\n _this2.hiddenInputCountry.value = _this2.getSelectedCountryData().iso2;\n }\n };\n this.telInput.form.addEventListener(\"submit\", this._handleHiddenInputSubmit);\n }\n }, {\n key: \"_initDropdownListeners\",\n value: function _initDropdownListeners() {\n var _this3 = this;\n // hack for input nested inside label (which is valid markup): clicking the selected-flag to\n // open the dropdown would then automatically trigger a 2nd click on the input which would\n // close it again\n this._handleLabelClick = function(e) {\n // if the dropdown is closed, then focus the input, else ignore the click\n if (_this3.dropdownContent.classList.contains(\"iti__hide\")) {\n _this3.telInput.focus();\n } else {\n e.preventDefault();\n }\n };\n var label = this.telInput.closest(\"label\");\n if (label) {\n label.addEventListener(\"click\", this._handleLabelClick);\n }\n // toggle country dropdown on click\n this._handleClickSelectedFlag = function() {\n // only intercept this event if we're opening the dropdown\n // else let it bubble up to the top (\"click-off-to-close\" listener)\n // we cannot just stopPropagation as it may be needed to close another instance\n if (_this3.dropdownContent.classList.contains(\"iti__hide\") && !_this3.telInput.disabled && !_this3.telInput.readOnly) {\n _this3._openDropdown();\n }\n };\n this.selectedFlag.addEventListener(\"click\", this._handleClickSelectedFlag);\n // open dropdown if selected flag is focused and they press up/down/space/enter\n this._handleFlagsContainerKeydown = function(e) {\n var isDropdownHidden = _this3.dropdownContent.classList.contains(\"iti__hide\");\n if (isDropdownHidden && [ \"ArrowUp\", \"ArrowDown\", \" \", \"Enter\" ].includes(e.key)) {\n // prevent form from being submitted if \"ENTER\" was pressed\n e.preventDefault();\n // prevent event from being handled again by document\n e.stopPropagation();\n _this3._openDropdown();\n }\n // allow navigation from dropdown to input on TAB\n if (e.key === \"Tab\") {\n _this3._closeDropdown();\n }\n };\n this.flagsContainer.addEventListener(\"keydown\", this._handleFlagsContainerKeydown);\n }\n }, {\n key: \"_initRequests\",\n value: function _initRequests() {\n var _this4 = this;\n // if the user has specified the path to the utils script, fetch it on window.load, else resolve\n if (this.options.utilsScript && !window.intlTelInputUtils) {\n // if the plugin is being initialised after the window.load event has already been fired\n if (window.intlTelInputGlobals.documentReady()) {\n window.intlTelInputGlobals.loadUtils(this.options.utilsScript);\n } else {\n // wait until the load event so we don't block any other requests e.g. the flags image\n window.addEventListener(\"load\", function() {\n window.intlTelInputGlobals.loadUtils(_this4.options.utilsScript);\n });\n }\n } else {\n this.resolveUtilsScriptPromise();\n }\n // dont bother with IP lookup if we already have a selected country\n if (this.options.initialCountry === \"auto\" && !this.selectedCountryData.iso2) {\n this._loadAutoCountry();\n } else {\n this.resolveAutoCountryPromise();\n }\n }\n }, {\n key: \"_loadAutoCountry\",\n value: function _loadAutoCountry() {\n var _this5 = this;\n // 3 options:\n // 1) already loaded (we're done)\n // 2) not already started loading (start)\n // 3) already started loading (do nothing - just wait for loading callback to fire)\n if (window.intlTelInputGlobals.autoCountry) {\n this.handleAutoCountry();\n } else if (!window.intlTelInputGlobals.startedLoadingAutoCountry) {\n // don't do this twice!\n window.intlTelInputGlobals.startedLoadingAutoCountry = true;\n if (typeof this.options.geoIpLookup === \"function\") {\n this.options.geoIpLookup(function() {\n var iso2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n var iso2Lower = iso2.toLowerCase();\n var isValidIso2 = iso2Lower && _this5._getCountryData(iso2Lower, true);\n if (isValidIso2) {\n window.intlTelInputGlobals.autoCountry = iso2Lower;\n // tell all instances the auto country is ready\n // TODO: this should just be the current instances\n // UPDATE: use setTimeout in case their geoIpLookup function calls this callback straight\n // away (e.g. if they have already done the geo ip lookup somewhere else). Using\n // setTimeout means that the current thread of execution will finish before executing\n // this, which allows the plugin to finish initialising.\n setTimeout(function() {\n return forEachInstance(\"handleAutoCountry\");\n });\n } else {\n _this5._setInitialState(true);\n forEachInstance(\"rejectAutoCountryPromise\");\n }\n }, function() {\n return forEachInstance(\"rejectAutoCountryPromise\");\n });\n }\n }\n }\n }, {\n key: \"_initKeyListeners\",\n value: function _initKeyListeners() {\n var _this6 = this;\n var userOverrideFormatting = false;\n // update flag on input event\n this._handleKeyEvent = function(e) {\n if (_this6._updateFlagFromNumber(_this6.telInput.value)) {\n _this6._triggerCountryChange();\n }\n // if user types their own formatting char (not a plus or a numeric), then set the override\n var isFormattingChar = e && e.data && /[^+0-9]/.test(e.data);\n var isPaste = e && e.inputType === \"insertFromPaste\" && _this6.telInput.value;\n if (isFormattingChar || isPaste) {\n userOverrideFormatting = true;\n } else if (!/[^+0-9]/.test(_this6.telInput.value)) {\n userOverrideFormatting = false;\n }\n // handle FAYT, unless userOverrideFormatting or it's a paste event\n if (_this6.options.formatAsYouType && !userOverrideFormatting && !isPaste) {\n // maintain caret position after reformatting\n var currentCaretPos = _this6.telInput.selectionStart;\n var valueBeforeCaret = _this6.telInput.value.substring(0, currentCaretPos);\n var relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, \"\").length;\n var isDeleteForwards = e && e.inputType === \"deleteContentForward\";\n var formattedValue = _this6._formatNumberAsYouType();\n var newCaretPos = _this6._translateCursorPosition(relevantCharsBeforeCaret, formattedValue, currentCaretPos, isDeleteForwards);\n _this6.telInput.value = formattedValue;\n _this6.telInput.setSelectionRange(newCaretPos, newCaretPos);\n }\n };\n // this handles individual key presses as well as cut/paste events\n // the advantage of the \"input\" event over \"keyup\" etc is that \"input\" only fires when the value changes,\n // whereas \"keyup\" fires even for arrow key presses etc\n this.telInput.addEventListener(\"input\", this._handleKeyEvent);\n }\n }, {\n key: \"_translateCursorPosition\",\n value: function _translateCursorPosition(relevantChars, formattedValue, prevCaretPos, isDeleteForwards) {\n // if the first char is a formatting char, and they backspace delete it:\n // cursor should stay at the start (pos 0), rather than stick to the first digit (pos 1)\n if (prevCaretPos === 0 && !isDeleteForwards) {\n return 0;\n }\n var count = 0;\n for (var i = 0; i < formattedValue.length; i++) {\n if (/[+0-9]/.test(formattedValue[i])) {\n count++;\n }\n // normal case: stop when you hit the right number of relevant chars\n // (cursor will be just after the final relevant char)\n if (count === relevantChars && !isDeleteForwards) {\n return i + 1;\n }\n // spacial case: delete forwards (fn + delete on a mac):\n // wait until hit one extra relevant char, and put the cursor just before it (after any formatting chars)\n if (isDeleteForwards && count === relevantChars + 1) {\n return i;\n }\n }\n return formattedValue.length;\n }\n }, {\n key: \"_cap\",\n value: function _cap(number) {\n var max = this.telInput.getAttribute(\"maxlength\");\n return max && number.length > max ? number.substr(0, max) : number;\n }\n }, {\n key: \"_removeEmptyDialCode\",\n value: function _removeEmptyDialCode() {\n if (this.telInput.value.charAt(0) === \"+\") {\n var numeric = this._getNumeric(this.telInput.value);\n // if just a plus, or if just a dial code\n if (!numeric || this.selectedCountryData.dialCode === numeric) {\n this.telInput.value = \"\";\n }\n }\n }\n }, {\n key: \"_getNumeric\",\n value: function _getNumeric(s) {\n return s.replace(/\\D/g, \"\");\n }\n }, {\n key: \"_trigger\",\n value: function _trigger(name) {\n var e = new Event(name, {\n bubbles: true,\n cancelable: true\n });\n this.telInput.dispatchEvent(e);\n }\n }, {\n key: \"_openDropdown\",\n value: function _openDropdown() {\n var _this$options2 = this.options, fixDropdownWidth = _this$options2.fixDropdownWidth, countrySearch = _this$options2.countrySearch;\n if (fixDropdownWidth) {\n this.dropdownContent.style.width = \"\".concat(this.telInput.offsetWidth, \"px\");\n }\n this.dropdownContent.classList.remove(\"iti__hide\");\n this.selectedFlag.setAttribute(\"aria-expanded\", \"true\");\n this._setDropdownPosition();\n // if we have previously selected a country (and countrySearch is disabled), then highlight that item and scroll to it\n // else highlight the first item and scroll to top (even if countrySearch is disabled e.g. on init, showing globe icon)\n if (this.activeItem && !countrySearch) {\n // update highlighting and scroll to active list item\n this._highlightListItem(this.activeItem, false);\n this._scrollTo(this.activeItem, true);\n } else {\n // start by highlighting the first item in the list\n var firstElementChild = this.countryList.firstElementChild;\n if (firstElementChild) {\n this._highlightListItem(firstElementChild, false);\n this.countryList.scrollTop = 0;\n }\n if (countrySearch) {\n this.searchInput.focus();\n }\n }\n // bind all the dropdown-related listeners: mouseover, click, click-off, keydown\n this._bindDropdownListeners();\n // update the arrow\n this.dropdownArrow.classList.add(\"iti__arrow--up\");\n this._trigger(\"open:countrydropdown\");\n }\n }, {\n key: \"_toggleClass\",\n value: function _toggleClass(el, className, shouldHaveClass) {\n if (shouldHaveClass && !el.classList.contains(className)) {\n el.classList.add(className);\n } else if (!shouldHaveClass && el.classList.contains(className)) {\n el.classList.remove(className);\n }\n }\n }, {\n key: \"_setDropdownPosition\",\n value: function _setDropdownPosition() {\n var _this7 = this;\n if (this.options.dropdownContainer) {\n this.options.dropdownContainer.appendChild(this.dropdown);\n }\n if (!this.options.useFullscreenPopup) {\n var pos = this.telInput.getBoundingClientRect();\n // windowTop from https://stackoverflow.com/a/14384091/217866\n var windowTop = document.documentElement.scrollTop;\n var inputTop = pos.top + windowTop;\n var dropdownHeight = this.dropdownContent.offsetHeight;\n // dropdownFitsBelow = (dropdownBottom < windowBottom)\n var dropdownFitsBelow = inputTop + this.telInput.offsetHeight + dropdownHeight < windowTop + window.innerHeight;\n var dropdownFitsAbove = inputTop - dropdownHeight > windowTop;\n // dont allow positioning above when country search enabled as the search box jumps around as you filter countries\n var positionDropdownAboveInput = !this.options.countrySearch && !dropdownFitsBelow && dropdownFitsAbove;\n // by default, the dropdown will be below the input. If we want to position it above the\n // input, we add the dropup class.\n this._toggleClass(this.dropdownContent, \"iti__dropdown-content--dropup\", positionDropdownAboveInput);\n // if dropdownContainer is enabled, calculate postion\n if (this.options.dropdownContainer) {\n // if we want to position the dropdown below the input, we need to add the input height to the top value\n var extraTop = positionDropdownAboveInput ? 0 : this.telInput.offsetHeight;\n // calculate placement\n this.dropdown.style.top = \"\".concat(inputTop + extraTop, \"px\");\n this.dropdown.style.left = \"\".concat(pos.left + document.body.scrollLeft, \"px\");\n // close menu on window scroll\n this._handleWindowScroll = function() {\n return _this7._closeDropdown();\n };\n window.addEventListener(\"scroll\", this._handleWindowScroll);\n }\n }\n }\n }, {\n key: \"_bindDropdownListeners\",\n value: function _bindDropdownListeners() {\n var _this8 = this;\n // when mouse over a list item, just highlight that one\n // we add the class \"highlight\", so if they hit \"enter\" we know which one to select\n this._handleMouseoverCountryList = function(e) {\n // handle event delegation, as we're listening for this event on the countryList\n var listItem = e.target.closest(\".iti__country\");\n if (listItem) {\n _this8._highlightListItem(listItem, false);\n }\n };\n this.countryList.addEventListener(\"mouseover\", this._handleMouseoverCountryList);\n // listen for country selection\n this._handleClickCountryList = function(e) {\n var listItem = e.target.closest(\".iti__country\");\n if (listItem) {\n _this8._selectListItem(listItem);\n }\n };\n this.countryList.addEventListener(\"click\", this._handleClickCountryList);\n // click off to close\n // (except when this initial opening click is bubbling up)\n // we cannot just stopPropagation as it may be needed to close another instance\n var isOpening = true;\n this._handleClickOffToClose = function() {\n if (!isOpening) {\n _this8._closeDropdown();\n }\n isOpening = false;\n };\n document.documentElement.addEventListener(\"click\", this._handleClickOffToClose);\n // listen for up/down scrolling, enter to select, or escape to close\n // use keydown as keypress doesn't fire for non-char keys and we want to catch if they\n // just hit down and hold it to scroll down (no keyup event).\n // listen on the document because that's where key events are triggered if no input has focus\n var query = \"\";\n var queryTimer = null;\n this._handleKeydownOnDropdown = function(e) {\n // prevent down key from scrolling the whole page,\n // and enter key from submitting a form etc\n if ([ \"ArrowUp\", \"ArrowDown\", \"Enter\", \"Escape\" ].includes(e.key)) {\n e.preventDefault();\n e.stopPropagation();\n // up and down to navigate\n if (e.key === \"ArrowUp\" || e.key === \"ArrowDown\") {\n _this8._handleUpDownKey(e.key);\n } else if (e.key === \"Enter\") {\n _this8._handleEnterKey();\n } else if (e.key === \"Escape\") {\n _this8._closeDropdown();\n }\n }\n // alpha chars to perform search\n // regex allows one latin alpha char or space, based on https://stackoverflow.com/a/26900132/217866)\n if (!_this8.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)) {\n e.stopPropagation();\n // jump to countries that start with the query string\n if (queryTimer) {\n clearTimeout(queryTimer);\n }\n query += e.key.toLowerCase();\n _this8._searchForCountry(query);\n // if the timer hits 1 second, reset the query\n queryTimer = setTimeout(function() {\n query = \"\";\n }, 1e3);\n }\n };\n document.addEventListener(\"keydown\", this._handleKeydownOnDropdown);\n if (this.options.countrySearch) {\n var doFilter = function doFilter() {\n var inputQuery = _this8.searchInput.value.trim();\n if (inputQuery) {\n _this8._filterCountries(inputQuery);\n } else {\n _this8._filterCountries(\"\", true);\n }\n };\n var keyupTimer = null;\n this._handleSearchChange = function() {\n // filtering country nodes is expensive (lots of DOM manipulation), so rate limit it\n if (keyupTimer) {\n clearTimeout(keyupTimer);\n }\n keyupTimer = setTimeout(function() {\n doFilter();\n keyupTimer = null;\n }, 100);\n };\n this.searchInput.addEventListener(\"input\", this._handleSearchChange);\n // stop propagation on search input click, so doesn't trigger click-off-to-close listener\n this.searchInput.addEventListener(\"click\", function(e) {\n return e.stopPropagation();\n });\n }\n }\n }, {\n key: \"_normaliseString\",\n value: function _normaliseString() {\n var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n return s.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\").toLowerCase();\n }\n }, {\n key: \"_filterCountries\",\n value: function _filterCountries(query) {\n var isReset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isFirst = true;\n this.countryList.innerHTML = \"\";\n var normalisedQuery = this._normaliseString(query);\n for (var i = 0; i < this.countries.length; i++) {\n var c = this.countries[i];\n var normalisedCountryName = this._normaliseString(c.name);\n var fullDialCode = \"+\".concat(c.dialCode);\n if (isReset || normalisedCountryName.includes(normalisedQuery) || fullDialCode.includes(normalisedQuery) || c.iso2.includes(normalisedQuery)) {\n this.countryList.appendChild(c.nodeById[this.id]);\n // highlight the first item\n if (isFirst) {\n this._highlightListItem(c.nodeById[this.id], false);\n isFirst = false;\n }\n }\n }\n // scroll to top (useful if user had previously scrolled down)\n this.countryList.scrollTop = 0;\n this._updateSearchResultsText();\n }\n }, {\n key: \"_updateSearchResultsText\",\n value: function _updateSearchResultsText() {\n var i18n = this.options.i18n;\n var count = this.countryList.childElementCount;\n var searchText;\n if (count === 0) {\n searchText = i18n.zeroSearchResults || \"No results found\";\n } else if (count === 1) {\n searchText = i18n.oneSearchResult || \"1 result found\";\n } else {\n // eslint-disable-next-line no-template-curly-in-string\n searchText = i18n.multipleSearchResults ? i18n.multipleSearchResults.replace(\"${count}\", count) : \"\".concat(count, \" results found\");\n }\n this.searchResultsA11yText.textContent = searchText;\n }\n }, {\n key: \"_handleUpDownKey\",\n value: function _handleUpDownKey(key) {\n var next = key === \"ArrowUp\" ? this.highlightedItem.previousElementSibling : this.highlightedItem.nextElementSibling;\n if (next) {\n // skip the divider\n if (next.classList.contains(\"iti__divider\")) {\n next = key === \"ArrowUp\" ? next.previousElementSibling : next.nextElementSibling;\n }\n } else if (this.countryList.childElementCount > 1) {\n // otherwise, we must be at the end, so loop round again\n next = key === \"ArrowUp\" ? this.countryList.lastElementChild : this.countryList.firstElementChild;\n }\n if (next) {\n // make sure the next item is visible\n // (before calling focus(), which can cause the next item to scroll to the middle of the dropdown, which is jarring)\n this._scrollTo(next, false);\n // if country search enabled, dont lose focus from the search input on up/down\n var doFocus = !this.options.countrySearch;\n this._highlightListItem(next, doFocus);\n }\n }\n }, {\n key: \"_handleEnterKey\",\n value: function _handleEnterKey() {\n if (this.highlightedItem) {\n this._selectListItem(this.highlightedItem);\n }\n }\n }, {\n key: \"_searchForCountry\",\n value: function _searchForCountry(query) {\n for (var i = 0; i < this.countries.length; i++) {\n if (this._startsWith(this.countries[i].name, query)) {\n var listItem = this.countries[i].nodeById[this.id];\n // update highlighting and scroll\n this._highlightListItem(listItem, false);\n this._scrollTo(listItem, true);\n break;\n }\n }\n }\n }, {\n key: \"_startsWith\",\n value: function _startsWith(a, b) {\n return a.substr(0, b.length).toLowerCase() === b;\n }\n }, {\n key: \"_updateValFromNumber\",\n value: function _updateValFromNumber(fullNumber) {\n var number = fullNumber;\n if (this.options.formatOnDisplay && window.intlTelInputUtils && this.selectedCountryData) {\n var useNational = this.options.nationalMode || number.charAt(0) !== \"+\" && !this.options.showSelectedDialCode;\n var _intlTelInputUtils$nu = intlTelInputUtils.numberFormat, NATIONAL = _intlTelInputUtils$nu.NATIONAL, INTERNATIONAL = _intlTelInputUtils$nu.INTERNATIONAL;\n var format = useNational ? NATIONAL : INTERNATIONAL;\n number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);\n }\n number = this._beforeSetNumber(number);\n this.telInput.value = number;\n }\n }, {\n key: \"_updateFlagFromNumber\",\n value: function _updateFlagFromNumber(fullNumber) {\n var plusIndex = fullNumber.indexOf(\"+\");\n // if it contains a plus, discard any chars before it e.g. accidental space char.\n // this keeps the selected country auto-updating correctly, which we want as\n // libphonenumber's validation/getNumber methods will ignore these chars anyway\n var number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;\n // if we already have US/Canada selected, make sure the number starts\n // with a +1 so _getDialCode will be able to extract the area code\n // update: if we dont yet have selectedCountryData, but we're here (trying to update the flag\n // from the number), that means we're initialising the plugin with a number that already has a\n // dial code, so fine to ignore this bit\n var selectedDialCode = this.selectedCountryData.dialCode;\n var isNanp = selectedDialCode === \"1\";\n if (number && isNanp && number.charAt(0) !== \"+\") {\n if (number.charAt(0) !== \"1\") {\n number = \"1\".concat(number);\n }\n number = \"+\".concat(number);\n }\n // if showSelectedDialCode enabled, then consider the selected dial code to be part of the number\n if (this.options.showSelectedDialCode && selectedDialCode && number.charAt(0) !== \"+\") {\n number = \"+\".concat(selectedDialCode).concat(number);\n }\n // try and extract valid dial code from input\n var dialCode = this._getDialCode(number, true);\n var numeric = this._getNumeric(number);\n var iso2 = null;\n if (dialCode) {\n var iso2Codes = this.dialCodeToIso2Map[this._getNumeric(dialCode)];\n // check if the right country is already selected. this should be false if the number is\n // longer than the matched dial code because in this case we need to make sure that if\n // there are multiple country matches, that the first one is selected (note: we could\n // just check that here, but it requires the same loop that we already have later)\n var alreadySelected = iso2Codes.indexOf(this.selectedCountryData.iso2) !== -1 && numeric.length <= dialCode.length - 1;\n var isRegionlessNanpNumber = selectedDialCode === \"1\" && this._isRegionlessNanp(numeric);\n // only update the flag if:\n // A) NOT (we currently have a NANP flag selected, and the number is a regionlessNanp)\n // AND\n // B) the right country is not already selected\n if (!isRegionlessNanpNumber && !alreadySelected) {\n // if using onlyCountries option, iso2Codes[0] may be empty, so we must find the first\n // non-empty index\n for (var j = 0; j < iso2Codes.length; j++) {\n if (iso2Codes[j]) {\n iso2 = iso2Codes[j];\n break;\n }\n }\n }\n } else if (number.charAt(0) === \"+\" && numeric.length) {\n // invalid dial code, so empty\n // Note: use getNumeric here because the number has not been formatted yet, so could contain\n // bad chars\n iso2 = \"\";\n } else if ((!number || number === \"+\") && !this.selectedCountryData.iso2) {\n // if no selected flag, and user either clears the input, or just types a plus, then show default\n iso2 = this.defaultCountry;\n }\n if (iso2 !== null) {\n return this._setCountry(iso2);\n }\n return false;\n }\n }, {\n key: \"_isRegionlessNanp\",\n value: function _isRegionlessNanp(number) {\n var numeric = this._getNumeric(number);\n if (numeric.charAt(0) === \"1\") {\n var areaCode = numeric.substr(1, 3);\n return regionlessNanpNumbers.indexOf(areaCode) !== -1;\n }\n return false;\n }\n }, {\n key: \"_highlightListItem\",\n value: function _highlightListItem(listItem, shouldFocus) {\n var prevItem = this.highlightedItem;\n if (prevItem) {\n prevItem.classList.remove(\"iti__highlight\");\n prevItem.setAttribute(\"aria-selected\", \"false\");\n }\n this.highlightedItem = listItem;\n this.highlightedItem.classList.add(\"iti__highlight\");\n this.highlightedItem.setAttribute(\"aria-selected\", \"true\");\n this.selectedFlag.setAttribute(\"aria-activedescendant\", listItem.getAttribute(\"id\"));\n if (this.options.countrySearch) {\n this.searchInput.setAttribute(\"aria-activedescendant\", listItem.getAttribute(\"id\"));\n }\n if (shouldFocus) {\n this.highlightedItem.focus();\n }\n }\n }, {\n key: \"_getCountryData\",\n value: function _getCountryData(iso2, allowFail) {\n for (var i = 0; i < this.countries.length; i++) {\n if (this.countries[i].iso2 === iso2) {\n return this.countries[i];\n }\n }\n if (allowFail) {\n return null;\n }\n throw new Error(\"No country data for '\".concat(iso2, \"'\"));\n }\n }, {\n key: \"_setCountry\",\n value: function _setCountry(iso2) {\n var _this$options3 = this.options, allowDropdown = _this$options3.allowDropdown, showSelectedDialCode = _this$options3.showSelectedDialCode, showFlags = _this$options3.showFlags, countrySearch = _this$options3.countrySearch, i18n = _this$options3.i18n;\n var prevCountry = this.selectedCountryData.iso2 ? this.selectedCountryData : {};\n // do this first as it will throw an error and stop if iso2 is invalid\n this.selectedCountryData = iso2 ? this._getCountryData(iso2, false) : {};\n // update the defaultCountry - we only need the iso2 from now on, so just store that\n if (this.selectedCountryData.iso2) {\n this.defaultCountry = this.selectedCountryData.iso2;\n }\n // update the flag class and the a11y text\n if (this.selectedFlagInner) {\n var flagClass = \"\";\n var a11yText = \"\";\n if (iso2) {\n if (showFlags) {\n flagClass = \"iti__flag iti__\".concat(iso2);\n a11yText = \"\".concat(this.selectedCountryData.name, \" +\").concat(this.selectedCountryData.dialCode);\n }\n } else {\n flagClass = \"iti__flag iti__globe\";\n a11yText = i18n.noCountrySelected || \"No country selected\";\n }\n this.selectedFlagInner.className = flagClass;\n this.selectedFlagA11yText.textContent = a11yText;\n }\n this._setSelectedCountryFlagTitleAttribute(iso2, showSelectedDialCode);\n // update the selected dial code\n if (showSelectedDialCode) {\n var dialCode = this.selectedCountryData.dialCode ? \"+\".concat(this.selectedCountryData.dialCode) : \"\";\n this.selectedDialCode.innerHTML = dialCode;\n // offsetWidth is zero if input is in a hidden container during initialisation\n var selectedFlagWidth = this.selectedFlag.offsetWidth || this._getHiddenSelectedFlagWidth();\n // add 6px of padding after the grey selected-dial-code box, as this is what we use in the css\n if (this.isRTL) {\n this.telInput.style.paddingRight = \"\".concat(selectedFlagWidth + 6, \"px\");\n } else {\n this.telInput.style.paddingLeft = \"\".concat(selectedFlagWidth + 6, \"px\");\n }\n }\n // and the input's placeholder\n this._updatePlaceholder();\n // update the active list item (only if country search disabled, as country search doesn't store the active item)\n if (allowDropdown && !countrySearch) {\n var prevItem = this.activeItem;\n if (prevItem) {\n prevItem.classList.remove(\"iti__active\");\n prevItem.setAttribute(\"aria-selected\", \"false\");\n }\n if (iso2) {\n // check if there is a preferred item first, else fall back to standard\n var nextItem = this.countryList.querySelector(\"#iti-\".concat(this.id, \"__item-\").concat(iso2, \"-preferred\")) || this.countryList.querySelector(\"#iti-\".concat(this.id, \"__item-\").concat(iso2));\n nextItem.setAttribute(\"aria-selected\", \"true\");\n nextItem.classList.add(\"iti__active\");\n this.activeItem = nextItem;\n }\n }\n // return if the flag has changed or not\n return prevCountry.iso2 !== iso2;\n }\n }, {\n key: \"_setSelectedCountryFlagTitleAttribute\",\n value: function _setSelectedCountryFlagTitleAttribute(iso2, showSelectedDialCode) {\n if (!this.selectedFlag) {\n return;\n }\n var title;\n if (iso2 && !showSelectedDialCode) {\n title = \"\".concat(this.selectedCountryData.name, \": +\").concat(this.selectedCountryData.dialCode);\n } else if (iso2) {\n // For screen reader output, we don't want to include the dial code in the reader output twice\n // so just use the selected country name here:\n title = this.selectedCountryData.name;\n } else {\n title = \"Unknown\";\n }\n this.selectedFlag.setAttribute(\"title\", title);\n }\n }, {\n key: \"_getHiddenSelectedFlagWidth\",\n value: function _getHiddenSelectedFlagWidth() {\n // to get the right styling to apply, all we need is a shallow clone of the container,\n // and then to inject a deep clone of the selectedFlag element\n var containerClone = this.telInput.parentNode.cloneNode();\n containerClone.style.visibility = \"hidden\";\n document.body.appendChild(containerClone);\n var flagsContainerClone = this.flagsContainer.cloneNode();\n containerClone.appendChild(flagsContainerClone);\n var selectedFlagClone = this.selectedFlag.cloneNode(true);\n flagsContainerClone.appendChild(selectedFlagClone);\n var width = selectedFlagClone.offsetWidth;\n containerClone.parentNode.removeChild(containerClone);\n return width;\n }\n }, {\n key: \"_updatePlaceholder\",\n value: function _updatePlaceholder() {\n var _this$options4 = this.options, autoPlaceholder = _this$options4.autoPlaceholder, placeholderNumberType = _this$options4.placeholderNumberType, nationalMode = _this$options4.nationalMode, customPlaceholder = _this$options4.customPlaceholder;\n var shouldSetPlaceholder = autoPlaceholder === \"aggressive\" || !this.hadInitialPlaceholder && autoPlaceholder === \"polite\";\n if (window.intlTelInputUtils && shouldSetPlaceholder) {\n var numberType = intlTelInputUtils.numberType[placeholderNumberType];\n var placeholder = this.selectedCountryData.iso2 ? intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2, nationalMode, numberType) : \"\";\n placeholder = this._beforeSetNumber(placeholder);\n if (typeof customPlaceholder === \"function\") {\n placeholder = customPlaceholder(placeholder, this.selectedCountryData);\n }\n this.telInput.setAttribute(\"placeholder\", placeholder);\n }\n }\n }, {\n key: \"_selectListItem\",\n value: function _selectListItem(listItem) {\n // update selected flag and active list item\n var flagChanged = this._setCountry(listItem.getAttribute(\"data-country-code\"));\n this._closeDropdown();\n this._updateDialCode(listItem.getAttribute(\"data-dial-code\"));\n // focus the input\n this.telInput.focus();\n if (flagChanged) {\n this._triggerCountryChange();\n }\n }\n }, {\n key: \"_closeDropdown\",\n value: function _closeDropdown() {\n this.dropdownContent.classList.add(\"iti__hide\");\n this.selectedFlag.setAttribute(\"aria-expanded\", \"false\");\n this.selectedFlag.removeAttribute(\"aria-activedescendant\");\n if (this.highlightedItem) {\n this.highlightedItem.setAttribute(\"aria-selected\", \"false\");\n }\n if (this.options.countrySearch) {\n this.searchInput.removeAttribute(\"aria-activedescendant\");\n }\n // update the arrow\n this.dropdownArrow.classList.remove(\"iti__arrow--up\");\n // unbind key events\n document.removeEventListener(\"keydown\", this._handleKeydownOnDropdown);\n if (this.options.countrySearch) {\n this.searchInput.removeEventListener(\"input\", this._handleSearchChange);\n }\n document.documentElement.removeEventListener(\"click\", this._handleClickOffToClose);\n this.countryList.removeEventListener(\"mouseover\", this._handleMouseoverCountryList);\n this.countryList.removeEventListener(\"click\", this._handleClickCountryList);\n // remove menu from container\n if (this.options.dropdownContainer) {\n if (!this.options.useFullscreenPopup) {\n window.removeEventListener(\"scroll\", this._handleWindowScroll);\n }\n if (this.dropdown.parentNode) {\n this.dropdown.parentNode.removeChild(this.dropdown);\n }\n }\n this._trigger(\"close:countrydropdown\");\n }\n }, {\n key: \"_scrollTo\",\n value: function _scrollTo(element, middle) {\n var container = this.countryList;\n // windowTop from https://stackoverflow.com/a/14384091/217866\n var windowTop = document.documentElement.scrollTop;\n var containerHeight = container.offsetHeight;\n var containerTop = container.getBoundingClientRect().top + windowTop;\n var containerBottom = containerTop + containerHeight;\n var elementHeight = element.offsetHeight;\n var elementTop = element.getBoundingClientRect().top + windowTop;\n var elementBottom = elementTop + elementHeight;\n var newScrollTop = elementTop - containerTop + container.scrollTop;\n var middleOffset = containerHeight / 2 - elementHeight / 2;\n if (elementTop < containerTop) {\n // scroll up\n if (middle) {\n newScrollTop -= middleOffset;\n }\n container.scrollTop = newScrollTop;\n } else if (elementBottom > containerBottom) {\n // scroll down\n if (middle) {\n newScrollTop += middleOffset;\n }\n var heightDifference = containerHeight - elementHeight;\n container.scrollTop = newScrollTop - heightDifference;\n }\n }\n }, {\n key: \"_updateDialCode\",\n value: function _updateDialCode(newDialCodeBare) {\n var inputVal = this.telInput.value;\n // save having to pass this every time\n var newDialCode = \"+\".concat(newDialCodeBare);\n var newNumber;\n if (inputVal.charAt(0) === \"+\") {\n // there's a plus so we're dealing with a replacement\n var prevDialCode = this._getDialCode(inputVal);\n if (prevDialCode) {\n // current number contains a valid dial code, so replace it\n newNumber = inputVal.replace(prevDialCode, newDialCode);\n } else {\n // current number contains an invalid dial code, so ditch it\n // (no way to determine where the invalid dial code ends and the rest of the number begins)\n newNumber = newDialCode;\n }\n this.telInput.value = newNumber;\n }\n }\n }, {\n key: \"_getDialCode\",\n value: function _getDialCode(number, includeAreaCode) {\n var dialCode = \"\";\n // only interested in international numbers (starting with a plus)\n if (number.charAt(0) === \"+\") {\n var numericChars = \"\";\n // iterate over chars\n for (var i = 0; i < number.length; i++) {\n var c = number.charAt(i);\n // if char is number (https://stackoverflow.com/a/8935649/217866)\n if (!isNaN(parseInt(c, 10))) {\n numericChars += c;\n // if current numericChars make a valid dial code\n if (includeAreaCode) {\n if (this.dialCodeToIso2Map[numericChars]) {\n // store the actual raw string (useful for matching later)\n dialCode = number.substr(0, i + 1);\n }\n } else {\n if (this.dialCodes[numericChars]) {\n dialCode = number.substr(0, i + 1);\n // if we're just looking for a dial code, we can break as soon as we find one\n break;\n }\n }\n // stop searching as soon as we can - in this case when we hit max len\n if (numericChars.length === this.dialCodeMaxLen) {\n break;\n }\n }\n }\n }\n return dialCode;\n }\n }, {\n key: \"_getFullNumber\",\n value: function _getFullNumber() {\n var val = this.telInput.value.trim();\n var dialCode = this.selectedCountryData.dialCode;\n var prefix;\n var numericVal = this._getNumeric(val);\n if (this.options.showSelectedDialCode && !this.options.nationalMode && val.charAt(0) !== \"+\" && dialCode && numericVal) {\n // when using showSelectedDialCode, it is visible so is effectively part of the typed number\n prefix = \"+\".concat(dialCode);\n } else {\n prefix = \"\";\n }\n return prefix + val;\n }\n }, {\n key: \"_beforeSetNumber\",\n value: function _beforeSetNumber(fullNumber) {\n var number = fullNumber;\n if (this.options.showSelectedDialCode) {\n var dialCode = this._getDialCode(number);\n // if there is a valid dial code\n if (dialCode) {\n // in case _getDialCode returned an area code as well\n dialCode = \"+\".concat(this.selectedCountryData.dialCode);\n // a lot of numbers will have a space separating the dial code and the main number, and\n // some NANP numbers will have a hyphen e.g. +1 684-733-1234 - in both cases we want to get\n // rid of it\n // NOTE: don't just trim all non-numerics as may want to preserve an open parenthesis etc\n var start = number[dialCode.length] === \" \" || number[dialCode.length] === \"-\" ? dialCode.length + 1 : dialCode.length;\n number = number.substr(start);\n }\n }\n return this._cap(number);\n }\n }, {\n key: \"_triggerCountryChange\",\n value: function _triggerCountryChange() {\n this._trigger(\"countrychange\");\n }\n }, {\n key: \"_formatNumberAsYouType\",\n value: function _formatNumberAsYouType() {\n var val = this._getFullNumber();\n var result = window.intlTelInputUtils ? intlTelInputUtils.formatNumberAsYouType(val, this.selectedCountryData.iso2) : val;\n // if showSelectedDialCode and they haven't (re)typed the dial code in the input as well, then remove the dial code\n var dialCode = this.selectedCountryData.dialCode;\n if (this.options.showSelectedDialCode && !this.options.nationalMode && this.telInput.value.charAt(0) !== \"+\" && result.includes(\"+\".concat(dialCode))) {\n var afterDialCode = result.split(\"+\".concat(dialCode))[1] || \"\";\n return afterDialCode.trim();\n }\n return result;\n }\n }, {\n key: \"handleAutoCountry\",\n value: function handleAutoCountry() {\n if (this.options.initialCountry === \"auto\") {\n // we must set this even if there is an initial val in the input: in case the initial val is\n // invalid and they delete it - they should see their auto country\n this.defaultCountry = window.intlTelInputGlobals.autoCountry;\n // if there's no initial value in the input, then update the flag\n if (!this.telInput.value) {\n this.setCountry(this.defaultCountry);\n }\n this.resolveAutoCountryPromise();\n }\n }\n }, {\n key: \"handleUtils\",\n value: function handleUtils() {\n // if the request was successful\n if (window.intlTelInputUtils) {\n // if there's an initial value in the input, then format it\n if (this.telInput.value) {\n this._updateValFromNumber(this.telInput.value);\n }\n if (this.selectedCountryData.iso2) {\n this._updatePlaceholder();\n }\n }\n this.resolveUtilsScriptPromise();\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (this.options.allowDropdown) {\n // make sure the dropdown is closed (and unbind listeners)\n this._closeDropdown();\n this.selectedFlag.removeEventListener(\"click\", this._handleClickSelectedFlag);\n this.flagsContainer.removeEventListener(\"keydown\", this._handleFlagsContainerKeydown);\n // label click hack\n var label = this.telInput.closest(\"label\");\n if (label) {\n label.removeEventListener(\"click\", this._handleLabelClick);\n }\n }\n // unbind hiddenInput listeners\n var form = this.telInput.form;\n if (this._handleHiddenInputSubmit && form) {\n form.removeEventListener(\"submit\", this._handleHiddenInputSubmit);\n }\n // unbind key events, and cut/paste events\n this.telInput.removeEventListener(\"input\", this._handleKeyEvent);\n // remove attribute of id instance: data-intl-tel-input-id\n this.telInput.removeAttribute(\"data-intl-tel-input-id\");\n // remove markup (but leave the original input)\n var wrapper = this.telInput.parentNode;\n wrapper.parentNode.insertBefore(this.telInput, wrapper);\n wrapper.parentNode.removeChild(wrapper);\n delete window.intlTelInputGlobals.instances[this.id];\n }\n }, {\n key: \"getExtension\",\n value: function getExtension() {\n if (window.intlTelInputUtils) {\n return intlTelInputUtils.getExtension(this._getFullNumber(), this.selectedCountryData.iso2);\n }\n return \"\";\n }\n }, {\n key: \"getNumber\",\n value: function getNumber(format) {\n if (window.intlTelInputUtils) {\n var iso2 = this.selectedCountryData.iso2;\n return intlTelInputUtils.formatNumber(this._getFullNumber(), iso2, format);\n }\n return \"\";\n }\n }, {\n key: \"getNumberType\",\n value: function getNumberType() {\n if (window.intlTelInputUtils) {\n return intlTelInputUtils.getNumberType(this._getFullNumber(), this.selectedCountryData.iso2);\n }\n return -99;\n }\n }, {\n key: \"getSelectedCountryData\",\n value: function getSelectedCountryData() {\n return this.selectedCountryData;\n }\n }, {\n key: \"getValidationError\",\n value: function getValidationError() {\n if (window.intlTelInputUtils) {\n var iso2 = this.selectedCountryData.iso2;\n return intlTelInputUtils.getValidationError(this._getFullNumber(), iso2);\n }\n return -99;\n }\n }, {\n key: \"isValidNumber\",\n value: function isValidNumber() {\n var mobileOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var val = this._getFullNumber();\n // return false for any alpha chars\n if (/(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])/.test(val)) {\n return false;\n }\n return window.intlTelInputUtils ? intlTelInputUtils.isPossibleNumber(val, this.selectedCountryData.iso2, mobileOnly) : null;\n }\n }, {\n key: \"isValidNumberPrecise\",\n value: function isValidNumberPrecise() {\n var val = this._getFullNumber();\n // return false for any alpha chars\n if (/(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])/.test(val)) {\n return false;\n }\n return window.intlTelInputUtils ? intlTelInputUtils.isValidNumber(val, this.selectedCountryData.iso2) : null;\n }\n }, {\n key: \"setCountry\",\n value: function setCountry(iso2) {\n var iso2Lower = iso2.toLowerCase();\n // check if already selected\n if (this.selectedCountryData.iso2 !== iso2Lower) {\n this._setCountry(iso2Lower);\n this._updateDialCode(this.selectedCountryData.dialCode);\n this._triggerCountryChange();\n }\n }\n }, {\n key: \"setNumber\",\n value: function setNumber(number) {\n // we must update the flag first, which updates this.selectedCountryData, which is used for\n // formatting the number before displaying it\n var flagChanged = this._updateFlagFromNumber(number);\n this._updateValFromNumber(number);\n if (flagChanged) {\n this._triggerCountryChange();\n }\n }\n }, {\n key: \"setPlaceholderNumberType\",\n value: function setPlaceholderNumberType(type) {\n this.options.placeholderNumberType = type;\n this._updatePlaceholder();\n }\n } ]);\n return Iti;\n }();\n /********************\n * STATIC METHODS\n ********************/\n // get the country data object\n intlTelInputGlobals.getCountryData = function() {\n return allCountries;\n };\n // inject a