{"version":3,"names":["tempusDominus","$","luxon","_interopDefaultLegacy","e","default","_interopNamespace","__esModule","n","Object","create","keys","forEach","k","d","getOwnPropertyDescriptor","defineProperty","get","enumerable","$__default","luxon__namespace","TdError","Error","NAME","Namespace","dataKey","events","Events","constructor","this","key","change","update","error","show","hide","blur","focus","keyup","keydown","css","Css","widget","calendarHeader","switch","toolbar","noHighlight","sideBySide","previous","next","disabled","old","new","active","dateContainer","decadesContainer","decade","yearsContainer","year","monthsContainer","month","daysContainer","day","calendarWeeks","dayOfTheWeek","today","weekend","rangeIn","rangeStart","rangeEnd","timeContainer","separator","clockContainer","hourContainer","minuteContainer","secondContainer","hour","minute","second","toggleMeridiem","collapsing","collapse","inline","lightTheme","darkTheme","isDarkPreferredQuery","errorMessages","ErrorMessages","base","failedToSetInvalidDate","failedToParseInput","unexpectedOption","optionName","code","unexpectedOptions","join","unexpectedOptionValue","badValue","validOptions","typeMismatch","badType","expectedType","numbersOutOfRange","lower","upper","failedToParseDate","date","soft","console","warn","mustProvideElement","subscribeMismatch","conflictingConfiguration","message","customDateFormatError","dateString","deprecatedWarning","remediation","throwError","Unit","DefaultFormatLocalization$1","dateFormats","LTS","LT","L","LL","LLL","LLLL","format","locale","hourCycle","undefined","ordinal","s","v","twoDigitTemplate","getFormatByUnit","unit","dateStyle","guessHourCycle","template","numberingSystem","dt","DateTime","setLocalization","hours","start","parts","end","Date","super","arguments","localization","nonLeapLadder","leapLadder","dateTimeRegex","formattingTokens","match2","match3","match4","match1to2","matchSigned","matchOffset","matchWord","zoneExpressions","obj","input","offset","offsetFromString","expressions","t","pattern","parser","afternoon","meridiemMatch","T","fff","milliseconds","addInput","ss","m","mm","H","h","HH","hh","dd","Do","match","i","replace","M","MM","MMM","months","getAllMonths","matchIndex","map","_","slice","indexOf","MMMM","y","yy","parseTwoDigitYear","yyyy","setLocale","value","static","formatLocalization","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","clone","minutes","seconds","JSON","stringify","name","startOf","startOfTheWeek","setMilliseconds","setSeconds","setMinutes","setHours","weekDay","goBack","manipulate","setDate","setMonth","endOf","endOfWeek","isBefore","compare","isValid","valueOf","isAfter","isSame","convert","isBetween","left","right","inclusivity","leftInclusivity","rightInclusivity","isLeftInRange","isRightInRange","timeStyle","Intl","DateTimeFormat","formatToParts","filter","x","type","secondsFormatted","minutesFormatted","getHoursFormatted","meridiem","hour12","find","p","dateFormatted","getDay","targetMonth","endOfMonth","monthFormatted","setFullYear","week","computeOrdinal","weekday","getUTCDay","weekNumber","Math","floor","weeksInWeekYear","p1","last","p2","isLeapYear","applyFormat","Array","replaceTokens","formatStr","formats","a","b","B","toUpperCase","first","third","zoneInformation","style","timeZoneName","negative","includes","substring","property","getLocaleAfternoon","toLowerCase","correctHours","time","makeParser","matchArray","length","expressionArray","token","expression","part","exec","call","zone","UTC","formatString","formatter","HHCycle","startsWith","hhCycle","matches","ddd","dddd","$1","ServiceLocator","cache","Map","locate","identifier","service","set","serviceLocator","CalendarModes","className","step","OptionsStore","_currentCalendarViewMode","_viewDate","minimumCalendarViewMode","currentView","currentCalendarViewMode","viewDate","options","refreshCurrentView","isTwelveHour","Validation","optionsStore","targetDate","granularity","_enabledDisabledDatesIsValid","restrictions","daysOfWeekDisabled","_minMaxIsValid","_enabledDisabledHoursIsValid","disabledTimeIntervals","internal","from","to","disabledDates","_isInDisabledDates","enabledDates","_isInEnabledDates","testDate","minDate","maxDate","disabledHours","_isInDisabledHours","enabledHours","_isInEnabledHours","formattedDate","dateRangeIsValid","dates","index","target","dateRange","EventEmitter","subscribers","subscribe","callback","push","unsubscribe","bind","splice","emit","destroy","EventEmitters","triggerEvent","viewUpdate","updateDisplay","action","updateViewDate","defaultEnLocalization","clear","close","dayViewHeaderFormat","decrementHour","decrementMinute","decrementSecond","incrementHour","incrementMinute","incrementSecond","maxWeekdayLength","nextCentury","nextDecade","nextMonth","nextYear","pickHour","pickMinute","pickSecond","previousCentury","previousDecade","previousMonth","previousYear","selectDate","selectDecade","selectMonth","selectTime","selectYear","DefaultOptions","allowInputToggle","container","debug","defaultDate","display","icons","up","down","viewMode","toolbarPlacement","keepOpen","buttons","components","calendar","decades","clock","useTwentyfourHour","theme","placement","keepInvalid","meta","multipleDates","multipleDatesSeparator","promptTimeOnDateChange","promptTimeOnDateChangeTransitionDelay","stepping","useCurrent","DefaultEnLocalization","tryConvertToDateTime","dateTime","fromString","convertToDateTime","converted","typeCheckDateArray","providedType","isArray","typeCheckNumberArray","some","mandatoryDate","optionalDate","mandatory","args","numbersInRange","validHourRange","validDateArray","validKeyOption","keyOptions","path","optionProcessors","freeze","valueObject","vk","subOptionName","HTMLElement","Element","appendChild","defaultType","defaultProcessor","toString","processKey","OptionConverter","o","inputElement","deepCopy","paths","charAt","split","reduce","isValue","provided","copyTo","defaultOptions","objectPath","unsupportedOptions","flattenedOptions","getFlattenDefaultOptions","errors","didYouMean","defaultOptionValue","lastIndexOf","ignoreProperties","spread","providedOptions","mergeTo","newConfig","element","eData","parse","dataset","tdTargetInput","tdTargetToggle","dataOptions","objectToNormalized","object","lowered","normalizeObject","optionsLower","keyOption","_mergeOptions","optionSubgroup","internalObject","_flattenDefaults","deepKeys","pre","entries","flatMap","config","Dates","_dates","validation","_eventEmitters","picked","lastPicked","lastPickedIndex","formatInput","parseInput","dateConversion","reason","setFromInput","setValue","add","isPicked","innerDateFormatted","pickedIndex","unset","oldDate","isClear","factor","startYear","updateInput","newValue","noIndex","_setValueNull","round","onUpdate","ActionTypes","ActionTypes$1","DateDisplay","getPicker","document","createElement","classList","append","_daysOfTheWeek","div","rangeHoverEvent","rangeHoverOutEvent","handleMouseEvents","setAttribute","selectDay","matchMedia","addEventListener","_update","paint","getElementsByClassName","_updateCalendarView","innerDate","_handleCalendarWeeks","querySelectorAll","classes","_handleDateRange","remove","_dateToDataValue","innerText","padStart","currentTarget","contains","allDays","attributeValue","getAttribute","dayIndex","findIndex","rangeStartFormatted","rangeStartIndex","rangeStartElement","lambda","switcher","parentElement","getElementsByTagName","row","htmlDivElement","MonthDisplay","containerClone","YearDisplay","_startYear","_endYear","DecadeDisplay","getStartEndYear","_startDecade","_endDecade","pickedYears","textContent","startDecadeYear","endDecadeYear","TimeDisplay","_gridColumns","iconTag","_grid","timesDiv","querySelector","incrementHours","decrementHours","incrementMinutes","decrementMinutes","incrementSeconds","decrementSeconds","toggle","meridiemDate","gridTemplateAreas","top","middle","bottom","upIcon","downIcon","separatorColon","cloneNode","innerHTML","getSeparator","colon","divElement","showHours","showMinutes","showSeconds","button","trim","HourDisplay","selectHour","MinuteDisplay","selectMinute","secondDisplay","selectSecond","Collapse","height","setTimeout","showImmediately","getTransitionDurationFromElement","scrollHeight","getBoundingClientRect","offsetHeight","hideImmediately","transitionDuration","transitionDelay","window","getComputedStyle","floatTransitionDuration","Number","parseFloat","floatTransitionDelay","Display","_isVisible","_documentClickEvent","composedPath","_actionsClickEvent","dateDisplay","monthDisplay","yearDisplay","decadeDisplay","timeDisplay","hourDisplay","minuteDisplay","_widget","result","isVisible","_hasTime","_updateCalendarHeader","_hasDate","_unit","_date","_classes","_element","_showSetDefaultIfNeeded","_buildWidget","_updateTheme","_showSetupViewMode","body","createPopup","modifiers","enabled","documentElement","dir","then","showClock","updatePopup","onlyClock","_showMode","tries","direction","async","createPopperFunction","Popper","createPopper","import","_popperInstance","max","min","datePickerMode","picker","_getThemeClass","removeEventListener","currentTheme","isDarkMode","showing","_dispose","parentNode","removeChild","dateView","getHeadTemplate","timeView","_iconTag","getToolbarElements","_hasDateAndTime","_buildWidgetSideBySide","setupComponentView","hasFirst","hasSecond","shouldShow","arrow","title","icon","togglePicker","changeCalendarView","iconClass","svg","createElementNS","_rebuild","wasVisible","Actions","do","handleNextPrevious","handleSelectCalendarMode","handleSelectDay","hideOrClock","manipulateAndSet","handleToggle","handleShowClockContainers","handleDateRange","handleMultiDate","htmlElement","classToUse","newDate","outerHTML","other","getTime","TempusDominus","_subscribers","_isDisabled","_inputChangeEvent","event","internallyTriggered","detail","setViewDate","valueSplit","_toggleClickEvent","_toggle","nodeName","_openClickEvent","actions","_initializeOptions","_initializeInput","_initializeToggle","_triggerEvent","_viewUpdate","updateOptions","reset","disable","enable","removeAttribute","eventTypes","callbacks","callBackArray","returnArray","eventType","_unsubscribe","dispose","language","asked","loadedLocales","isChangeEvent","_handleAfterChangeEvent","dispatchEvent","CustomEvent","jQuery","trigger","_publish","eventName","includeDataset","_dataToOptions","_validateConflicts","tagName","query","clearTimeout","_currentPromptTimeTimeout","loadLocale","l","extend","plugin","option","installed","tempusDominus$1","version","__proto__","tdClasses","tdFactory","prototype","opts","parsedDate","fromFormat","toJSDate","outputCalendar","fromJSDate","toFormat","jQueryInterface","argument","jQueryHandleThis","each","me","data","isDateUpdateThroughDateOptionFromClientCode","ret","JQUERY_NO_CONFLICT","fn","Constructor","noConflict"],"sources":["./dist/js/tempus-dominus.js"],"sourcesContent":["/*!\n * Tempus Dominus v6.9.4 (https://getdatepicker.com/)\n * Copyright 2013-2024 Jonathan Peterson\n * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)\n */\nvar tempusDominus = (function ($, luxon) {\n 'use strict';\n\n function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n function _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return n;\n }\n\n var $__default = /*#__PURE__*/_interopDefaultLegacy($);\n var luxon__namespace = /*#__PURE__*/_interopNamespace(luxon);\n\n class TdError extends Error {\r\n }\r\n class ErrorMessages {\r\n constructor() {\r\n this.base = 'TD:';\r\n //#endregion\r\n //#region used with notify.error\r\n /**\r\n * Used with an Error Event type if the user selects a date that\r\n * fails restriction validation.\r\n */\r\n this.failedToSetInvalidDate = 'Failed to set invalid date';\r\n /**\r\n * Used with an Error Event type when a user changes the value of the\r\n * input field directly, and does not provide a valid date.\r\n */\r\n this.failedToParseInput = 'Failed parse input field';\r\n //#endregion\r\n }\r\n //#region out to console\r\n /**\r\n * Throws an error indicating that a key in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOption(optionName) {\r\n const error = new TdError(`${this.base} Unexpected option: ${optionName} does not match a known option.`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error indicating that one more keys in the options object is invalid.\r\n * @param optionName\r\n */\r\n unexpectedOptions(optionName) {\r\n const error = new TdError(`${this.base}: ${optionName.join(', ')}`);\r\n error.code = 1;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when an option is provide an unsupported value.\r\n * For example a value of 'cheese' for toolbarPlacement which only supports\r\n * 'top', 'bottom', 'default'.\r\n * @param optionName\r\n * @param badValue\r\n * @param validOptions\r\n */\r\n unexpectedOptionValue(optionName, badValue, validOptions) {\r\n const error = new TdError(`${this.base} Unexpected option value: ${optionName} does not accept a value of \"${badValue}\". Valid values are: ${validOptions.join(', ')}`);\r\n error.code = 2;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when an option value is the wrong type.\r\n * For example a string value was provided to multipleDates which only\r\n * supports true or false.\r\n * @param optionName\r\n * @param badType\r\n * @param expectedType\r\n */\r\n typeMismatch(optionName, badType, expectedType) {\r\n const error = new TdError(`${this.base} Mismatch types: ${optionName} has a type of ${badType} instead of the required ${expectedType}`);\r\n error.code = 3;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when an option value is outside of the expected range.\r\n * For example restrictions.daysOfWeekDisabled excepts a value between 0 and 6.\r\n * @param optionName\r\n * @param lower\r\n * @param upper\r\n */\r\n numbersOutOfRange(optionName, lower, upper) {\r\n const error = new TdError(`${this.base} ${optionName} expected an array of number between ${lower} and ${upper}.`);\r\n error.code = 4;\r\n throw error;\r\n }\r\n /**\r\n * Throws an error when a value for a date options couldn't be parsed. Either\r\n * the option was an invalid string or an invalid Date object.\r\n * @param optionName\r\n * @param date\r\n * @param soft If true, logs a warning instead of an error.\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n failedToParseDate(optionName, date, soft = false) {\r\n const error = new TdError(`${this.base} Could not correctly parse \"${date}\" to a date for ${optionName}.`);\r\n error.code = 5;\r\n if (!soft)\r\n throw error;\r\n console.warn(error);\r\n }\r\n /**\r\n * Throws when an element to attach to was not provided in the constructor.\r\n */\r\n mustProvideElement() {\r\n const error = new TdError(`${this.base} No element was provided.`);\r\n error.code = 6;\r\n throw error;\r\n }\r\n /**\r\n * Throws if providing an array for the events to subscribe method doesn't have\r\n * the same number of callbacks. E.g., subscribe([1,2], [1])\r\n */\r\n subscribeMismatch() {\r\n const error = new TdError(`${this.base} The subscribed events does not match the number of callbacks`);\r\n error.code = 7;\r\n throw error;\r\n }\r\n /**\r\n * Throws if the configuration has conflicting rules e.g. minDate is after maxDate\r\n */\r\n conflictingConfiguration(message) {\r\n const error = new TdError(`${this.base} A configuration value conflicts with another rule. ${message}`);\r\n error.code = 8;\r\n throw error;\r\n }\r\n /**\r\n * customDateFormat errors\r\n */\r\n customDateFormatError(message) {\r\n const error = new TdError(`${this.base} Custom Date Format: ${message}`);\r\n error.code = 9;\r\n throw error;\r\n }\r\n /**\r\n * Logs a warning if a date option value is provided as a string, instead of\r\n * a date/datetime object.\r\n */\r\n dateString() {\r\n console.warn(`${this.base} Using a string for date options is not recommended unless you specify an ISO string or use the customDateFormat plugin.`);\r\n }\r\n deprecatedWarning(message, remediation) {\r\n console.warn(`${this.base} Warning ${message} is deprecated and will be removed in a future version. ${remediation}`);\r\n }\r\n throwError(message) {\r\n const error = new TdError(`${this.base} ${message}`);\r\n error.code = 9;\r\n throw error;\r\n }\r\n }\n\n // this is not the way I want this to stay but nested classes seemed to blown up once its compiled.\r\n const NAME = 'tempus-dominus', dataKey = 'td';\r\n /**\r\n * Events\r\n */\r\n class Events {\r\n constructor() {\r\n this.key = `.${dataKey}`;\r\n /**\r\n * Change event. Fired when the user selects a date.\r\n * See also EventTypes.ChangeEvent\r\n */\r\n this.change = `change${this.key}`;\r\n /**\r\n * Emit when the view changes for example from month view to the year view.\r\n * See also EventTypes.ViewUpdateEvent\r\n */\r\n this.update = `update${this.key}`;\r\n /**\r\n * Emits when a selected date or value from the input field fails to meet the provided validation rules.\r\n * See also EventTypes.FailEvent\r\n */\r\n this.error = `error${this.key}`;\r\n /**\r\n * Show event\r\n * @event Events#show\r\n */\r\n this.show = `show${this.key}`;\r\n /**\r\n * Hide event\r\n * @event Events#hide\r\n */\r\n this.hide = `hide${this.key}`;\r\n // blur and focus are used in the jQuery provider but are otherwise unused.\r\n // keyup/down will be used later for keybinding options\r\n this.blur = `blur${this.key}`;\r\n this.focus = `focus${this.key}`;\r\n this.keyup = `keyup${this.key}`;\r\n this.keydown = `keydown${this.key}`;\r\n }\r\n }\r\n class Css {\r\n constructor() {\r\n /**\r\n * The outer element for the widget.\r\n */\r\n this.widget = `${NAME}-widget`;\r\n /**\r\n * Hold the previous, next and switcher divs\r\n */\r\n this.calendarHeader = 'calendar-header';\r\n /**\r\n * The element for the action to change the calendar view. E.g. month -> year.\r\n */\r\n this.switch = 'picker-switch';\r\n /**\r\n * The elements for all the toolbar options\r\n */\r\n this.toolbar = 'toolbar';\r\n /**\r\n * Disables the hover and rounding affect.\r\n */\r\n this.noHighlight = 'no-highlight';\r\n /**\r\n * Applied to the widget element when the side by side option is in use.\r\n */\r\n this.sideBySide = 'timepicker-sbs';\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> July\r\n */\r\n this.previous = 'previous';\r\n /**\r\n * The element for the action to change the calendar view, e.g. August -> September\r\n */\r\n this.next = 'next';\r\n /**\r\n * Applied to any action that would violate any restriction options. ALso applied\r\n * to an input field if the disabled function is called.\r\n */\r\n this.disabled = 'disabled';\r\n /**\r\n * Applied to any date that is less than requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n this.old = 'old';\r\n /**\r\n * Applied to any date that is greater than of requested view,\r\n * e.g. the last day of the previous month.\r\n */\r\n this.new = 'new';\r\n /**\r\n * Applied to any date that is currently selected.\r\n */\r\n this.active = 'active';\r\n //#region date element\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n this.dateContainer = 'date-container';\r\n /**\r\n * The outer element for the decades view.\r\n */\r\n this.decadesContainer = `${this.dateContainer}-decades`;\r\n /**\r\n * Applied to elements within the decade container, e.g. 2020, 2030\r\n */\r\n this.decade = 'decade';\r\n /**\r\n * The outer element for the years view.\r\n */\r\n this.yearsContainer = `${this.dateContainer}-years`;\r\n /**\r\n * Applied to elements within the years container, e.g. 2021, 2021\r\n */\r\n this.year = 'year';\r\n /**\r\n * The outer element for the month view.\r\n */\r\n this.monthsContainer = `${this.dateContainer}-months`;\r\n /**\r\n * Applied to elements within the month container, e.g. January, February\r\n */\r\n this.month = 'month';\r\n /**\r\n * The outer element for the calendar view.\r\n */\r\n this.daysContainer = `${this.dateContainer}-days`;\r\n /**\r\n * Applied to elements within the day container, e.g. 1, 2..31\r\n */\r\n this.day = 'day';\r\n /**\r\n * If display.calendarWeeks is enabled, a column displaying the week of year\r\n * is shown. This class is applied to each cell in that column.\r\n */\r\n this.calendarWeeks = 'cw';\r\n /**\r\n * Applied to the first row of the calendar view, e.g. Sunday, Monday\r\n */\r\n this.dayOfTheWeek = 'dow';\r\n /**\r\n * Applied to the current date on the calendar view.\r\n */\r\n this.today = 'today';\r\n /**\r\n * Applied to the locale's weekend dates on the calendar view, e.g. Sunday, Saturday\r\n */\r\n this.weekend = 'weekend';\r\n this.rangeIn = 'range-in';\r\n this.rangeStart = 'range-start';\r\n this.rangeEnd = 'range-end';\r\n //#endregion\r\n //#region time element\r\n /**\r\n * The outer element for all time related elements.\r\n */\r\n this.timeContainer = 'time-container';\r\n /**\r\n * Applied the separator columns between time elements, e.g. hour *:* minute *:* second\r\n */\r\n this.separator = 'separator';\r\n /**\r\n * The outer element for the clock view.\r\n */\r\n this.clockContainer = `${this.timeContainer}-clock`;\r\n /**\r\n * The outer element for the hours selection view.\r\n */\r\n this.hourContainer = `${this.timeContainer}-hour`;\r\n /**\r\n * The outer element for the minutes selection view.\r\n */\r\n this.minuteContainer = `${this.timeContainer}-minute`;\r\n /**\r\n * The outer element for the seconds selection view.\r\n */\r\n this.secondContainer = `${this.timeContainer}-second`;\r\n /**\r\n * Applied to each element in the hours selection view.\r\n */\r\n this.hour = 'hour';\r\n /**\r\n * Applied to each element in the minutes selection view.\r\n */\r\n this.minute = 'minute';\r\n /**\r\n * Applied to each element in the seconds selection view.\r\n */\r\n this.second = 'second';\r\n /**\r\n * Applied AM/PM toggle button.\r\n */\r\n this.toggleMeridiem = 'toggleMeridiem';\r\n //#endregion\r\n //#region collapse\r\n /**\r\n * Applied the element of the current view mode, e.g. calendar or clock.\r\n */\r\n this.show = 'show';\r\n /**\r\n * Applied to the currently showing view mode during a transition\r\n * between calendar and clock views\r\n */\r\n this.collapsing = 'td-collapsing';\r\n /**\r\n * Applied to the currently hidden view mode.\r\n */\r\n this.collapse = 'td-collapse';\r\n //#endregion\r\n /**\r\n * Applied to the widget when the option display.inline is enabled.\r\n */\r\n this.inline = 'inline';\r\n /**\r\n * Applied to the widget when the option display.theme is light.\r\n */\r\n this.lightTheme = 'light';\r\n /**\r\n * Applied to the widget when the option display.theme is dark.\r\n */\r\n this.darkTheme = 'dark';\r\n /**\r\n * Used for detecting if the system color preference is dark mode\r\n */\r\n this.isDarkPreferredQuery = '(prefers-color-scheme: dark)';\r\n }\r\n }\r\n class Namespace {\r\n }\r\n Namespace.NAME = NAME;\r\n // noinspection JSUnusedGlobalSymbols\r\n Namespace.dataKey = dataKey;\r\n Namespace.events = new Events();\r\n Namespace.css = new Css();\r\n Namespace.errorMessages = new ErrorMessages();\n\n const DefaultFormatLocalization = {\r\n dateFormats: {\r\n LTS: 'h:mm:ss T',\r\n LT: 'h:mm T',\r\n L: 'MM/dd/yyyy',\r\n LL: 'MMMM d, yyyy',\r\n LLL: 'MMMM d, yyyy h:mm T',\r\n LLLL: 'dddd, MMMM d, yyyy h:mm T',\r\n },\r\n format: 'L LT',\r\n locale: 'default',\r\n hourCycle: undefined,\r\n ordinal: (n) => {\r\n const s = ['th', 'st', 'nd', 'rd'];\r\n const v = n % 100;\r\n return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;\r\n },\r\n };\r\n var DefaultFormatLocalization$1 = { ...DefaultFormatLocalization };\n\n var Unit;\r\n (function (Unit) {\r\n Unit[\"seconds\"] = \"seconds\";\r\n Unit[\"minutes\"] = \"minutes\";\r\n Unit[\"hours\"] = \"hours\";\r\n Unit[\"date\"] = \"date\";\r\n Unit[\"month\"] = \"month\";\r\n Unit[\"year\"] = \"year\";\r\n })(Unit || (Unit = {}));\r\n const twoDigitTemplate = {\r\n month: '2-digit',\r\n day: '2-digit',\r\n year: 'numeric',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit',\r\n };\r\n /**\r\n * Returns an Intl format object based on the provided object\r\n * @param unit\r\n */\r\n const getFormatByUnit = (unit) => {\r\n switch (unit) {\r\n case 'date':\r\n return { dateStyle: 'short' };\r\n case 'month':\r\n return {\r\n month: 'numeric',\r\n year: 'numeric',\r\n };\r\n case 'year':\r\n return { year: 'numeric' };\r\n }\r\n };\r\n /**\r\n * Attempts to guess the hour cycle of the given local\r\n * @param locale\r\n */\r\n const guessHourCycle = (locale) => {\r\n if (!locale)\r\n return 'h12';\r\n // noinspection SpellCheckingInspection\r\n const template = {\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n numberingSystem: 'latn',\r\n };\r\n const dt = new DateTime().setLocalization({ locale });\r\n dt.hours = 0;\r\n const start = dt.parts(undefined, template).hour;\r\n //midnight is 12 so en-US style 12 AM\r\n if (start === '12')\r\n return 'h12';\r\n //midnight is 24 is from 00-24\r\n if (start === '24')\r\n return 'h24';\r\n dt.hours = 23;\r\n const end = dt.parts(undefined, template).hour;\r\n //if midnight is 00 and hour 23 is 11 then\r\n if (start === '00' && end === '11')\r\n return 'h11';\r\n if (start === '00' && end === '23')\r\n return 'h23';\r\n console.warn(`couldn't determine hour cycle for ${locale}. start: ${start}. end: ${end}`);\r\n return undefined;\r\n };\r\n /**\r\n * For the most part this object behaves exactly the same way\r\n * as the native Date object with a little extra spice.\r\n */\r\n class DateTime extends Date {\r\n constructor() {\r\n super(...arguments);\r\n this.localization = DefaultFormatLocalization$1;\r\n this.nonLeapLadder = [\r\n 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,\r\n ];\r\n this.leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\r\n //#region CDF stuff\r\n this.dateTimeRegex = \r\n //is regex cannot be simplified beyond what it already is\r\n /(\\[[^[\\]]*])|y{1,4}|M{1,4}|d{1,4}|H{1,2}|h{1,2}|t|T|m{1,2}|s{1,2}|f{3}/g; //NOSONAR\r\n this.formattingTokens = /(\\[[^[\\]]*])|([-_:/.,()\\s]+)|(T|t|yyyy|yy?|MM?M?M?|Do|dd?d?d?|hh?|HH?|mm?|ss?)/g; //NOSONAR is regex cannot be simplified beyond what it already is\r\n this.match2 = /\\d\\d/; // 00 - 99\r\n this.match3 = /\\d{3}/; // 000 - 999\r\n this.match4 = /\\d{4}/; // 0000 - 9999\r\n this.match1to2 = /\\d\\d?/; // 0 - 99\r\n this.matchSigned = /[+-]?\\d+/; // -inf - inf\r\n this.matchOffset = /[+-]\\d\\d:?(\\d\\d)?|Z/; // +00:00 -00:00 +0000 or -0000 +00 or Z\r\n this.matchWord = /[^\\d_:/,\\-()\\s]+/; // Word\r\n this.zoneExpressions = [\r\n this.matchOffset,\r\n (obj, input) => {\r\n obj.offset = this.offsetFromString(input);\r\n },\r\n ];\r\n this.expressions = {\r\n t: {\r\n pattern: undefined,\r\n parser: (obj, input) => {\r\n obj.afternoon = this.meridiemMatch(input);\r\n },\r\n },\r\n T: {\r\n pattern: undefined,\r\n parser: (obj, input) => {\r\n obj.afternoon = this.meridiemMatch(input);\r\n },\r\n },\r\n fff: {\r\n pattern: this.match3,\r\n parser: (obj, input) => {\r\n obj.milliseconds = +input;\r\n },\r\n },\r\n s: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('seconds'),\r\n },\r\n ss: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('seconds'),\r\n },\r\n m: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('minutes'),\r\n },\r\n mm: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('minutes'),\r\n },\r\n H: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n h: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n HH: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n hh: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('hours'),\r\n },\r\n d: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('day'),\r\n },\r\n dd: {\r\n pattern: this.match2,\r\n parser: this.addInput('day'),\r\n },\r\n Do: {\r\n pattern: this.matchWord,\r\n parser: (obj, input) => {\r\n obj.day = +(input.match(/\\d+/)[0] || 1);\r\n if (!this.localization.ordinal)\r\n return;\r\n for (let i = 1; i <= 31; i += 1) {\r\n if (this.localization.ordinal(i).replace(/[[\\]]/g, '') === input) {\r\n obj.day = i;\r\n }\r\n }\r\n },\r\n },\r\n M: {\r\n pattern: this.match1to2,\r\n parser: this.addInput('month'),\r\n },\r\n MM: {\r\n pattern: this.match2,\r\n parser: this.addInput('month'),\r\n },\r\n MMM: {\r\n pattern: this.matchWord,\r\n parser: (obj, input) => {\r\n const months = this.getAllMonths();\r\n const monthsShort = this.getAllMonths('short');\r\n const matchIndex = (monthsShort || months.map((_) => _.slice(0, 3))).indexOf(input) + 1;\r\n if (matchIndex < 1) {\r\n throw new Error();\r\n }\r\n obj.month = matchIndex % 12 || matchIndex;\r\n },\r\n },\r\n MMMM: {\r\n pattern: this.matchWord,\r\n parser: (obj, input) => {\r\n const months = this.getAllMonths();\r\n const matchIndex = months.indexOf(input) + 1;\r\n if (matchIndex < 1) {\r\n throw new Error();\r\n }\r\n obj.month = matchIndex % 12 || matchIndex;\r\n },\r\n },\r\n y: {\r\n pattern: this.matchSigned,\r\n parser: this.addInput('year'),\r\n },\r\n yy: {\r\n pattern: this.match2,\r\n parser: (obj, input) => {\r\n obj.year = this.parseTwoDigitYear(+input);\r\n },\r\n },\r\n yyyy: {\r\n pattern: this.match4,\r\n parser: this.addInput('year'),\r\n },\r\n // z: this.zoneExpressions,\r\n // zz: this.zoneExpressions,\r\n // zzz: this.zoneExpressions\r\n };\r\n //#endregion CDF stuff\r\n }\r\n /**\r\n * Chainable way to set the {@link locale}\r\n * @param value\r\n * @deprecated use setLocalization with a FormatLocalization object instead\r\n */\r\n setLocale(value) {\r\n if (!this.localization) {\r\n this.localization = DefaultFormatLocalization$1;\r\n this.localization.locale = value;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Chainable way to set the {@link localization}\r\n * @param value\r\n */\r\n setLocalization(value) {\r\n this.localization = value;\r\n return this;\r\n }\r\n /**\r\n * Converts a plain JS date object to a DateTime object.\r\n * Doing this allows access to format, etc.\r\n * @param date\r\n * @param locale this parameter is deprecated. Use formatLocalization instead.\r\n * @param formatLocalization\r\n */\r\n static convert(date, locale = 'default', formatLocalization = undefined) {\r\n if (!date)\r\n throw new Error(`A date is required`);\r\n if (!formatLocalization) {\r\n formatLocalization = DefaultFormatLocalization$1;\r\n formatLocalization.locale = locale;\r\n }\r\n return new DateTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()).setLocalization(formatLocalization);\r\n }\r\n /**\r\n * Native date manipulations are not pure functions. This function creates a duplicate of the DateTime object.\r\n */\r\n get clone() {\r\n return new DateTime(this.year, this.month, this.date, this.hours, this.minutes, this.seconds, this.getMilliseconds()).setLocalization(this.localization);\r\n }\r\n static isValid(d) {\r\n if (d === undefined || JSON.stringify(d) === 'null')\r\n return false;\r\n if (d.constructor.name === DateTime.name)\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Sets the current date to the start of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).startOf('month')\r\n * would return April 1, 2021, 12:00:00.000 AM (midnight)\r\n * @param unit\r\n * @param startOfTheWeek Allows for the changing the start of the week.\r\n */\r\n startOf(unit, startOfTheWeek = 0) {\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(0);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(0, 0);\r\n break;\r\n case 'hours':\r\n this.setMinutes(0, 0, 0);\r\n break;\r\n case 'date':\r\n this.setHours(0, 0, 0, 0);\r\n break;\r\n case 'weekDay': {\r\n this.startOf(Unit.date);\r\n if (this.weekDay === startOfTheWeek)\r\n break;\r\n const goBack = (this.weekDay - startOfTheWeek + 7) % 7;\r\n this.manipulate(goBack * -1, Unit.date);\r\n break;\r\n }\r\n case 'month':\r\n this.startOf(Unit.date);\r\n this.setDate(1);\r\n break;\r\n case 'year':\r\n this.startOf(Unit.date);\r\n this.setMonth(0, 1);\r\n break;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Sets the current date to the end of the {@link unit} provided\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).endOf('month')\r\n * would return April 30, 2021, 11:59:59.999 PM\r\n * @param unit\r\n * @param startOfTheWeek\r\n */\r\n endOf(unit, startOfTheWeek = 0) {\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n switch (unit) {\r\n case 'seconds':\r\n this.setMilliseconds(999);\r\n break;\r\n case 'minutes':\r\n this.setSeconds(59, 999);\r\n break;\r\n case 'hours':\r\n this.setMinutes(59, 59, 999);\r\n break;\r\n case 'date':\r\n this.setHours(23, 59, 59, 999);\r\n break;\r\n case 'weekDay': {\r\n this.endOf(Unit.date);\r\n const endOfWeek = 6 + startOfTheWeek;\r\n if (this.weekDay === endOfWeek)\r\n break;\r\n this.manipulate(endOfWeek - this.weekDay, Unit.date);\r\n break;\r\n }\r\n case 'month':\r\n this.endOf(Unit.date);\r\n this.manipulate(1, Unit.month);\r\n this.setDate(0);\r\n break;\r\n case 'year':\r\n this.endOf(Unit.date);\r\n this.setMonth(11, 31);\r\n break;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Change a {@link unit} value. Value can be positive or negative\r\n * Example: Consider a date of \"April 30, 2021, 11:45:32.984 AM\" => new DateTime(2021, 3, 30, 11, 45, 32, 984).manipulate(1, 'month')\r\n * would return May 30, 2021, 11:45:32.984 AM\r\n * @param value A positive or negative number\r\n * @param unit\r\n */\r\n manipulate(value, unit) {\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n this[unit] += value;\r\n return this;\r\n }\r\n /**\r\n * Return true if {@link compare} is before this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparison.\r\n */\r\n isBefore(compare, unit) {\r\n // If the comparisons is undefined, return false\r\n if (!DateTime.isValid(compare))\r\n return false;\r\n if (!unit)\r\n return this.valueOf() < compare.valueOf();\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n return (this.clone.startOf(unit).valueOf() < compare.clone.startOf(unit).valueOf());\r\n }\r\n /**\r\n * Return true if {@link compare} is after this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparison.\r\n */\r\n isAfter(compare, unit) {\r\n // If the comparisons is undefined, return false\r\n if (!DateTime.isValid(compare))\r\n return false;\r\n if (!unit)\r\n return this.valueOf() > compare.valueOf();\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n return (this.clone.startOf(unit).valueOf() > compare.clone.startOf(unit).valueOf());\r\n }\r\n /**\r\n * Return true if {@link compare} is same this date\r\n * @param compare The Date/DateTime to compare\r\n * @param unit If provided, uses {@link startOf} for\r\n * comparison.\r\n */\r\n isSame(compare, unit) {\r\n // If the comparisons is undefined, return false\r\n if (!DateTime.isValid(compare))\r\n return false;\r\n if (!unit)\r\n return this.valueOf() === compare.valueOf();\r\n if (this[unit] === undefined)\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n compare = DateTime.convert(compare);\r\n return (this.clone.startOf(unit).valueOf() === compare.startOf(unit).valueOf());\r\n }\r\n /**\r\n * Check if this is between two other DateTimes, optionally looking at unit scale. The match is exclusive.\r\n * @param left\r\n * @param right\r\n * @param unit.\r\n * @param inclusivity. A [ indicates inclusion of a value. A ( indicates exclusion.\r\n * If the inclusivity parameter is used, both indicators must be passed.\r\n */\r\n isBetween(left, right, unit, inclusivity = '()') {\r\n // If one of the comparisons is undefined, return false\r\n if (!DateTime.isValid(left) || !DateTime.isValid(right))\r\n return false;\r\n // If a unit is provided and is not a valid property of the DateTime object, throw an error\r\n if (unit && this[unit] === undefined) {\r\n throw new Error(`Unit '${unit}' is not valid`);\r\n }\r\n const leftInclusivity = inclusivity[0] === '(';\r\n const rightInclusivity = inclusivity[1] === ')';\r\n const isLeftInRange = leftInclusivity\r\n ? this.isAfter(left, unit)\r\n : !this.isBefore(left, unit);\r\n const isRightInRange = rightInclusivity\r\n ? this.isBefore(right, unit)\r\n : !this.isAfter(right, unit);\r\n return isLeftInRange && isRightInRange;\r\n }\r\n /**\r\n * Returns flattened object of the date. Does not include literals\r\n * @param locale\r\n * @param template\r\n */\r\n parts(locale = this.localization.locale, template = { dateStyle: 'full', timeStyle: 'long' }) {\r\n const parts = {};\r\n new Intl.DateTimeFormat(locale, template)\r\n .formatToParts(this)\r\n .filter((x) => x.type !== 'literal')\r\n .forEach((x) => (parts[x.type] = x.value));\r\n return parts;\r\n }\r\n /**\r\n * Shortcut to Date.getSeconds()\r\n */\r\n get seconds() {\r\n return this.getSeconds();\r\n }\r\n /**\r\n * Shortcut to Date.setSeconds()\r\n */\r\n set seconds(value) {\r\n this.setSeconds(value);\r\n }\r\n /**\r\n * Returns two digit hours\r\n */\r\n get secondsFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).second;\r\n }\r\n /**\r\n * Shortcut to Date.getMinutes()\r\n */\r\n get minutes() {\r\n return this.getMinutes();\r\n }\r\n /**\r\n * Shortcut to Date.setMinutes()\r\n */\r\n set minutes(value) {\r\n this.setMinutes(value);\r\n }\r\n /**\r\n * Returns two digit minutes\r\n */\r\n get minutesFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).minute;\r\n }\r\n /**\r\n * Shortcut to Date.getHours()\r\n */\r\n get hours() {\r\n return this.getHours();\r\n }\r\n /**\r\n * Shortcut to Date.setHours()\r\n */\r\n set hours(value) {\r\n this.setHours(value);\r\n }\r\n /**\r\n * Returns two digit hour, e.g. 01...10\r\n * @param hourCycle Providing an hour cycle will change 00 to 24 depending on the given value.\r\n */\r\n getHoursFormatted(hourCycle = 'h12') {\r\n return this.parts(undefined, { ...twoDigitTemplate, hourCycle: hourCycle })\r\n .hour;\r\n }\r\n /**\r\n * Get the meridiem of the date. E.g. AM or PM.\r\n * If the {@link locale} provides a \"dayPeriod\" then this will be returned,\r\n * otherwise it will return AM or PM.\r\n * @param locale\r\n */\r\n meridiem(locale = this.localization.locale) {\r\n return new Intl.DateTimeFormat(locale, {\r\n hour: 'numeric',\r\n hour12: true,\r\n })\r\n .formatToParts(this)\r\n .find((p) => p.type === 'dayPeriod')?.value;\r\n }\r\n /**\r\n * Shortcut to Date.getDate()\r\n */\r\n get date() {\r\n return this.getDate();\r\n }\r\n /**\r\n * Shortcut to Date.setDate()\r\n */\r\n set date(value) {\r\n this.setDate(value);\r\n }\r\n /**\r\n * Return two digit date\r\n */\r\n get dateFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).day;\r\n }\r\n /**\r\n * Shortcut to Date.getDay()\r\n */\r\n get weekDay() {\r\n return this.getDay();\r\n }\r\n /**\r\n * Shortcut to Date.getMonth()\r\n */\r\n get month() {\r\n return this.getMonth();\r\n }\r\n /**\r\n * Shortcut to Date.setMonth()\r\n */\r\n set month(value) {\r\n const targetMonth = new Date(this.year, value + 1);\r\n targetMonth.setDate(0);\r\n const endOfMonth = targetMonth.getDate();\r\n if (this.date > endOfMonth) {\r\n this.date = endOfMonth;\r\n }\r\n this.setMonth(value);\r\n }\r\n /**\r\n * Return two digit, human expected month. E.g. January = 1, December = 12\r\n */\r\n get monthFormatted() {\r\n return this.parts(undefined, twoDigitTemplate).month;\r\n }\r\n /**\r\n * Shortcut to Date.getFullYear()\r\n */\r\n get year() {\r\n return this.getFullYear();\r\n }\r\n /**\r\n * Shortcut to Date.setFullYear()\r\n */\r\n set year(value) {\r\n this.setFullYear(value);\r\n }\r\n // borrowed a bunch of stuff from Luxon\r\n /**\r\n * Gets the week of the year\r\n */\r\n get week() {\r\n const ordinal = this.computeOrdinal(), weekday = this.getUTCDay();\r\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7);\r\n if (weekNumber < 1) {\r\n weekNumber = this.weeksInWeekYear();\r\n }\r\n else if (weekNumber > this.weeksInWeekYear()) {\r\n weekNumber = 1;\r\n }\r\n return weekNumber;\r\n }\r\n /**\r\n * Returns the number of weeks in the year\r\n */\r\n weeksInWeekYear() {\r\n const p1 = (this.year +\r\n Math.floor(this.year / 4) -\r\n Math.floor(this.year / 100) +\r\n Math.floor(this.year / 400)) %\r\n 7, last = this.year - 1, p2 = (last +\r\n Math.floor(last / 4) -\r\n Math.floor(last / 100) +\r\n Math.floor(last / 400)) %\r\n 7;\r\n return p1 === 4 || p2 === 3 ? 53 : 52;\r\n }\r\n /**\r\n * Returns true or false depending on if the year is a leap year or not.\r\n */\r\n get isLeapYear() {\r\n return (this.year % 4 === 0 && (this.year % 100 !== 0 || this.year % 400 === 0));\r\n }\r\n computeOrdinal() {\r\n return (this.date +\r\n (this.isLeapYear ? this.leapLadder : this.nonLeapLadder)[this.month]);\r\n }\r\n /**\r\n * Returns a list of month values based on the current locale\r\n */\r\n getAllMonths(format = 'long') {\r\n const applyFormat = new Intl.DateTimeFormat(this.localization.locale, {\r\n month: format,\r\n }).format;\r\n return [...Array(12).keys()].map((m) => applyFormat(new Date(2021, m)));\r\n }\r\n /**\r\n * Replaces an expanded token set (e.g. LT/LTS)\r\n */\r\n replaceTokens(formatStr, formats) {\r\n /***\r\n * _ => match\r\n * a => first capture group. Anything between [ and ]\r\n * b => second capture group\r\n */\r\n return formatStr.replace(/(\\[[^[\\]]*])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {\r\n const B = b && b.toUpperCase();\r\n return a || formats[B] || DefaultFormatLocalization$1.dateFormats[B];\r\n });\r\n }\r\n parseTwoDigitYear(input) {\r\n return input + (input > 68 ? 1900 : 2000);\r\n }\r\n offsetFromString(input) {\r\n if (!input)\r\n return 0;\r\n if (input === 'Z')\r\n return 0;\r\n const [first, second, third] = input.match(/([+-]|\\d\\d)/g);\r\n const minutes = +second * 60 + (+third || 0);\r\n const signed = first === '+' ? -minutes : minutes;\r\n return minutes === 0 ? 0 : signed; // eslint-disable-line no-nested-ternary\r\n }\r\n /**\r\n * z = -4, zz = -04, zzz = -0400\r\n * @param date\r\n * @param style\r\n * @private\r\n */\r\n zoneInformation(date, style) {\r\n let name = date\r\n .parts(this.localization.locale, { timeZoneName: 'longOffset' })\r\n .timeZoneName.replace('GMT', '')\r\n .replace(':', '');\r\n const negative = name.includes('-');\r\n name = name.replace('-', '');\r\n if (style === 'z')\r\n name = name.substring(1, 2);\r\n else if (style === 'zz')\r\n name = name.substring(0, 2);\r\n return `${negative ? '-' : ''}${name}`;\r\n }\r\n addInput(property) {\r\n return (obj, input) => {\r\n obj[property] = +input;\r\n };\r\n }\r\n getLocaleAfternoon() {\r\n return new Intl.DateTimeFormat(this.localization.locale, {\r\n hour: 'numeric',\r\n hour12: true,\r\n })\r\n .formatToParts(new Date(2022, 3, 4, 13))\r\n .find((p) => p.type === 'dayPeriod')\r\n ?.value?.replace(/\\s+/g, ' ');\r\n }\r\n meridiemMatch(input) {\r\n return input.toLowerCase() === this.getLocaleAfternoon().toLowerCase();\r\n }\r\n correctHours(time) {\r\n const { afternoon } = time;\r\n if (afternoon !== undefined) {\r\n const { hours } = time;\r\n if (afternoon) {\r\n if (hours < 12) {\r\n time.hours += 12;\r\n }\r\n }\r\n else if (hours === 12) {\r\n time.hours = 0;\r\n }\r\n delete time.afternoon;\r\n }\r\n }\r\n makeParser(format) {\r\n format = this.replaceTokens(format, this.localization.dateFormats);\r\n const matchArray = format.match(this.formattingTokens);\r\n const { length } = matchArray;\r\n const expressionArray = [];\r\n for (let i = 0; i < length; i += 1) {\r\n const token = matchArray[i];\r\n const expression = this.expressions[token];\r\n if (expression?.parser) {\r\n expressionArray[i] = expression;\r\n }\r\n else {\r\n expressionArray[i] = token.replace(/^\\[[^[\\]]*]$/g, '');\r\n }\r\n }\r\n return (input) => {\r\n const time = {\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n milliseconds: 0,\r\n };\r\n for (let i = 0, start = 0; i < length; i += 1) {\r\n const token = expressionArray[i];\r\n if (typeof token === 'string') {\r\n start += token.length;\r\n }\r\n else {\r\n const part = input.slice(start);\r\n let value = part;\r\n if (token.pattern) {\r\n const match = token.pattern.exec(part);\r\n value = match[0];\r\n }\r\n token.parser.call(this, time, value);\r\n input = input.replace(value, '');\r\n }\r\n }\r\n this.correctHours(time);\r\n return time;\r\n };\r\n }\r\n /**\r\n * Attempts to create a DateTime from a string.\r\n * @param input date as string\r\n * @param localization provides the date template the string is in via the format property\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n static fromString(input, localization) {\r\n if (!localization?.format) {\r\n Namespace.errorMessages.customDateFormatError('No format was provided');\r\n }\r\n try {\r\n const dt = new DateTime();\r\n dt.setLocalization(localization);\r\n if (['x', 'X'].indexOf(localization.format) > -1)\r\n return new DateTime((localization.format === 'X' ? 1000 : 1) * +input);\r\n input = input.replace(/\\s+/g, ' ');\r\n const parser = dt.makeParser(localization.format);\r\n const { year, month, day, hours, minutes, seconds, milliseconds, zone } = parser(input);\r\n const d = day || (!year && !month ? dt.getDate() : 1);\r\n const y = year || dt.getFullYear();\r\n let M = 0;\r\n if (!(year && !month)) {\r\n M = month > 0 ? month - 1 : dt.getMonth();\r\n }\r\n if (zone) {\r\n return new DateTime(Date.UTC(y, M, d, hours, minutes, seconds, milliseconds + zone.offset * 60 * 1000));\r\n }\r\n return new DateTime(y, M, d, hours, minutes, seconds, milliseconds);\r\n }\r\n catch (e) {\r\n Namespace.errorMessages.customDateFormatError(`Unable to parse provided input: ${input}, format: ${localization.format}`);\r\n }\r\n }\r\n /**\r\n * Returns a string format.\r\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\r\n * for valid templates and locale objects\r\n * @param template An optional object. If provided, method will use Intl., otherwise the localizations format properties\r\n * @param locale Can be a string or an array of strings. Uses browser defaults otherwise.\r\n */\r\n format(template, locale = this.localization.locale) {\r\n if (template && typeof template === 'object')\r\n return new Intl.DateTimeFormat(locale, template).format(this);\r\n const formatString = this.replaceTokens(\r\n //try template first\r\n template ||\r\n //otherwise try localization format\r\n this.localization.format ||\r\n //otherwise try date + time\r\n `${DefaultFormatLocalization$1.dateFormats.L}, ${DefaultFormatLocalization$1.dateFormats.LT}`, this.localization.dateFormats);\r\n const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(this);\r\n if (!this.localization.hourCycle)\r\n this.localization.hourCycle = guessHourCycle(this.localization.locale);\r\n //if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess\r\n const HHCycle = this.localization.hourCycle.startsWith('h1')\r\n ? 'h24'\r\n : this.localization.hourCycle;\r\n const hhCycle = this.localization.hourCycle.startsWith('h2')\r\n ? 'h12'\r\n : this.localization.hourCycle;\r\n const matches = {\r\n y: this.year,\r\n yy: formatter({ year: '2-digit' }),\r\n yyyy: this.year,\r\n M: formatter({ month: 'numeric' }),\r\n MM: this.monthFormatted,\r\n MMM: this.getAllMonths('short')[this.getMonth()],\r\n MMMM: this.getAllMonths()[this.getMonth()],\r\n d: this.date,\r\n dd: this.dateFormatted,\r\n ddd: formatter({ weekday: 'short' }),\r\n dddd: formatter({ weekday: 'long' }),\r\n H: this.getHours(),\r\n HH: this.getHoursFormatted(HHCycle),\r\n h: this.hours > 12 ? this.hours - 12 : this.hours,\r\n hh: this.getHoursFormatted(hhCycle),\r\n t: this.meridiem(),\r\n T: this.meridiem().toUpperCase(),\r\n m: this.minutes,\r\n mm: this.minutesFormatted,\r\n s: this.seconds,\r\n ss: this.secondsFormatted,\r\n fff: this.getMilliseconds(),\r\n // z: this.zoneInformation(dateTime, 'z'), //-4\r\n // zz: this.zoneInformation(dateTime, 'zz'), //-04\r\n // zzz: this.zoneInformation(dateTime, 'zzz') //-0400\r\n };\r\n return formatString\r\n .replace(this.dateTimeRegex, (match, $1) => {\r\n return $1 || matches[match];\r\n })\r\n .replace(/\\[/g, '')\r\n .replace(/]/g, '');\r\n }\r\n }\n\n class ServiceLocator {\r\n constructor() {\r\n this.cache = new Map();\r\n }\r\n locate(identifier) {\r\n const service = this.cache.get(identifier);\r\n if (service)\r\n return service;\r\n const value = new identifier();\r\n this.cache.set(identifier, value);\r\n return value;\r\n }\r\n }\r\n const setupServiceLocator = () => {\r\n serviceLocator = new ServiceLocator();\r\n };\r\n let serviceLocator;\n\n const CalendarModes = [\r\n {\r\n name: 'calendar',\r\n className: Namespace.css.daysContainer,\r\n unit: Unit.month,\r\n step: 1,\r\n },\r\n {\r\n name: 'months',\r\n className: Namespace.css.monthsContainer,\r\n unit: Unit.year,\r\n step: 1,\r\n },\r\n {\r\n name: 'years',\r\n className: Namespace.css.yearsContainer,\r\n unit: Unit.year,\r\n step: 10,\r\n },\r\n {\r\n name: 'decades',\r\n className: Namespace.css.decadesContainer,\r\n unit: Unit.year,\r\n step: 100,\r\n },\r\n ];\n\n class OptionsStore {\r\n constructor() {\r\n this._currentCalendarViewMode = 0;\r\n this._viewDate = new DateTime();\r\n this.minimumCalendarViewMode = 0;\r\n this.currentView = 'calendar';\r\n }\r\n get currentCalendarViewMode() {\r\n return this._currentCalendarViewMode;\r\n }\r\n set currentCalendarViewMode(value) {\r\n this._currentCalendarViewMode = value;\r\n this.currentView = CalendarModes[value].name;\r\n }\r\n get viewDate() {\r\n return this._viewDate;\r\n }\r\n set viewDate(v) {\r\n this._viewDate = v;\r\n if (this.options)\r\n this.options.viewDate = v;\r\n }\r\n /**\r\n * When switching back to the calendar from the clock,\r\n * this sets currentView to the correct calendar view.\r\n */\r\n refreshCurrentView() {\r\n this.currentView = CalendarModes[this.currentCalendarViewMode].name;\r\n }\r\n get isTwelveHour() {\r\n return ['h12', 'h11'].includes(this.options.localization.hourCycle);\r\n }\r\n }\n\n /**\r\n * Main class for date validation rules based on the options provided.\r\n */\r\n class Validation {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n }\r\n /**\r\n * Checks to see if the target date is valid based on the rules provided in the options.\r\n * Granularity can be provided to check portions of the date instead of the whole.\r\n * @param targetDate\r\n * @param granularity\r\n */\r\n isValid(targetDate, granularity) {\r\n if (!this._enabledDisabledDatesIsValid(granularity, targetDate))\r\n return false;\r\n if (granularity !== Unit.month &&\r\n granularity !== Unit.year &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled?.length > 0 &&\r\n this.optionsStore.options.restrictions.daysOfWeekDisabled.indexOf(targetDate.weekDay) !== -1)\r\n return false;\r\n if (!this._minMaxIsValid(granularity, targetDate))\r\n return false;\r\n if (granularity === Unit.hours ||\r\n granularity === Unit.minutes ||\r\n granularity === Unit.seconds) {\r\n if (!this._enabledDisabledHoursIsValid(targetDate))\r\n return false;\r\n if (this.optionsStore.options.restrictions.disabledTimeIntervals?.filter((internal) => targetDate.isBetween(internal.from, internal.to)).length !== 0)\r\n return false;\r\n }\r\n return true;\r\n }\r\n _enabledDisabledDatesIsValid(granularity, targetDate) {\r\n if (granularity !== Unit.date)\r\n return true;\r\n if (this.optionsStore.options.restrictions.disabledDates.length > 0 &&\r\n this._isInDisabledDates(targetDate)) {\r\n return false;\r\n }\r\n // noinspection RedundantIfStatementJS\r\n if (this.optionsStore.options.restrictions.enabledDates.length > 0 &&\r\n !this._isInEnabledDates(targetDate)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Checks to see if the disabledDates option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInDisabledDates(testDate) {\r\n if (!this.optionsStore.options.restrictions.disabledDates ||\r\n this.optionsStore.options.restrictions.disabledDates.length === 0)\r\n return false;\r\n return !!this.optionsStore.options.restrictions.disabledDates.find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n /**\r\n * Checks to see if the enabledDates option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by date.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInEnabledDates(testDate) {\r\n if (!this.optionsStore.options.restrictions.enabledDates ||\r\n this.optionsStore.options.restrictions.enabledDates.length === 0)\r\n return true;\r\n return !!this.optionsStore.options.restrictions.enabledDates.find((x) => x.isSame(testDate, Unit.date));\r\n }\r\n _minMaxIsValid(granularity, targetDate) {\r\n if (this.optionsStore.options.restrictions.minDate &&\r\n targetDate.isBefore(this.optionsStore.options.restrictions.minDate, granularity)) {\r\n return false;\r\n }\r\n // noinspection RedundantIfStatementJS\r\n if (this.optionsStore.options.restrictions.maxDate &&\r\n targetDate.isAfter(this.optionsStore.options.restrictions.maxDate, granularity)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n _enabledDisabledHoursIsValid(targetDate) {\r\n if (this.optionsStore.options.restrictions.disabledHours.length > 0 &&\r\n this._isInDisabledHours(targetDate)) {\r\n return false;\r\n }\r\n // noinspection RedundantIfStatementJS\r\n if (this.optionsStore.options.restrictions.enabledHours.length > 0 &&\r\n !this._isInEnabledHours(targetDate)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Checks to see if the disabledHours option is in use and returns true (meaning invalid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInDisabledHours(testDate) {\r\n if (!this.optionsStore.options.restrictions.disabledHours ||\r\n this.optionsStore.options.restrictions.disabledHours.length === 0)\r\n return false;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.disabledHours.includes(formattedDate);\r\n }\r\n /**\r\n * Checks to see if the enabledHours option is in use and returns true (meaning valid)\r\n * if the `testDate` is with in the array. Granularity is by hours.\r\n * @param testDate\r\n * @private\r\n */\r\n _isInEnabledHours(testDate) {\r\n if (!this.optionsStore.options.restrictions.enabledHours ||\r\n this.optionsStore.options.restrictions.enabledHours.length === 0)\r\n return true;\r\n const formattedDate = testDate.hours;\r\n return this.optionsStore.options.restrictions.enabledHours.includes(formattedDate);\r\n }\r\n dateRangeIsValid(dates, index, target) {\r\n // if we're not using the option, then return valid\r\n if (!this.optionsStore.options.dateRange)\r\n return true;\r\n // if we've only selected 0..1 dates, and we're not setting the end date\r\n // then return valid. We only want to validate the range if both are selected,\r\n // because the other validation on the target has already occurred.\r\n if (dates.length !== 2 && index !== 1)\r\n return true;\r\n // initialize start date\r\n const start = dates[0].clone;\r\n // check if start date is not the same as target date\r\n if (start.isSame(target, Unit.date))\r\n return true;\r\n // add one day to start; start has already been validated\r\n start.manipulate(1, Unit.date);\r\n // check each date in the range to make sure it's valid\r\n while (!start.isSame(target, Unit.date)) {\r\n const valid = this.isValid(start, Unit.date);\r\n if (!valid)\r\n return false;\r\n start.manipulate(1, Unit.date);\r\n }\r\n return true;\r\n }\r\n }\n\n class EventEmitter {\r\n constructor() {\r\n this.subscribers = [];\r\n }\r\n subscribe(callback) {\r\n this.subscribers.push(callback);\r\n return this.unsubscribe.bind(this, this.subscribers.length - 1);\r\n }\r\n unsubscribe(index) {\r\n this.subscribers.splice(index, 1);\r\n }\r\n emit(value) {\r\n this.subscribers.forEach((callback) => {\r\n callback(value);\r\n });\r\n }\r\n destroy() {\r\n this.subscribers = null;\r\n this.subscribers = [];\r\n }\r\n }\r\n class EventEmitters {\r\n constructor() {\r\n this.triggerEvent = new EventEmitter();\r\n this.viewUpdate = new EventEmitter();\r\n this.updateDisplay = new EventEmitter();\r\n this.action = new EventEmitter(); //eslint-disable-line @typescript-eslint/no-explicit-any\r\n this.updateViewDate = new EventEmitter();\r\n }\r\n destroy() {\r\n this.triggerEvent.destroy();\r\n this.viewUpdate.destroy();\r\n this.updateDisplay.destroy();\r\n this.action.destroy();\r\n this.updateViewDate.destroy();\r\n }\r\n }\n\n const defaultEnLocalization = {\r\n clear: 'Clear selection',\r\n close: 'Close the picker',\r\n dateFormats: DefaultFormatLocalization$1.dateFormats,\r\n dayViewHeaderFormat: { month: 'long', year: '2-digit' },\r\n decrementHour: 'Decrement Hour',\r\n decrementMinute: 'Decrement Minute',\r\n decrementSecond: 'Decrement Second',\r\n format: DefaultFormatLocalization$1.format,\r\n hourCycle: DefaultFormatLocalization$1.hourCycle,\r\n incrementHour: 'Increment Hour',\r\n incrementMinute: 'Increment Minute',\r\n incrementSecond: 'Increment Second',\r\n locale: DefaultFormatLocalization$1.locale,\r\n maxWeekdayLength: 0,\r\n nextCentury: 'Next Century',\r\n nextDecade: 'Next Decade',\r\n nextMonth: 'Next Month',\r\n nextYear: 'Next Year',\r\n ordinal: DefaultFormatLocalization$1.ordinal,\r\n pickHour: 'Pick Hour',\r\n pickMinute: 'Pick Minute',\r\n pickSecond: 'Pick Second',\r\n previousCentury: 'Previous Century',\r\n previousDecade: 'Previous Decade',\r\n previousMonth: 'Previous Month',\r\n previousYear: 'Previous Year',\r\n selectDate: 'Select Date',\r\n selectDecade: 'Select Decade',\r\n selectMonth: 'Select Month',\r\n selectTime: 'Select Time',\r\n selectYear: 'Select Year',\r\n startOfTheWeek: 0,\r\n today: 'Go to today',\r\n toggleMeridiem: 'Toggle Meridiem',\r\n };\r\n const DefaultOptions = {\r\n allowInputToggle: false,\r\n container: undefined,\r\n dateRange: false,\r\n debug: false,\r\n defaultDate: undefined,\r\n display: {\r\n icons: {\r\n type: 'icons',\r\n time: 'fa-solid fa-clock',\r\n date: 'fa-solid fa-calendar',\r\n up: 'fa-solid fa-arrow-up',\r\n down: 'fa-solid fa-arrow-down',\r\n previous: 'fa-solid fa-chevron-left',\r\n next: 'fa-solid fa-chevron-right',\r\n today: 'fa-solid fa-calendar-check',\r\n clear: 'fa-solid fa-trash',\r\n close: 'fa-solid fa-xmark',\r\n },\r\n sideBySide: false,\r\n calendarWeeks: false,\r\n viewMode: 'calendar',\r\n toolbarPlacement: 'bottom',\r\n keepOpen: false,\r\n buttons: {\r\n today: false,\r\n clear: false,\r\n close: false,\r\n },\r\n components: {\r\n calendar: true,\r\n date: true,\r\n month: true,\r\n year: true,\r\n decades: true,\r\n clock: true,\r\n hours: true,\r\n minutes: true,\r\n seconds: false,\r\n useTwentyfourHour: undefined,\r\n },\r\n inline: false,\r\n theme: 'auto',\r\n placement: 'bottom',\r\n },\r\n keepInvalid: false,\r\n localization: defaultEnLocalization,\r\n meta: {},\r\n multipleDates: false,\r\n multipleDatesSeparator: '; ',\r\n promptTimeOnDateChange: false,\r\n promptTimeOnDateChangeTransitionDelay: 200,\r\n restrictions: {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n disabledDates: [],\r\n enabledDates: [],\r\n daysOfWeekDisabled: [],\r\n disabledTimeIntervals: [],\r\n disabledHours: [],\r\n enabledHours: [],\r\n },\r\n stepping: 1,\r\n useCurrent: true,\r\n viewDate: new DateTime(),\r\n };\r\n const DefaultEnLocalization = { ...defaultEnLocalization };\n\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n function tryConvertToDateTime(d, localization) {\r\n if (!d)\r\n return null;\r\n if (d.constructor.name === DateTime.name)\r\n return d;\r\n if (d.constructor.name === Date.name) {\r\n return DateTime.convert(d);\r\n }\r\n if (typeof d === typeof '') {\r\n const dateTime = DateTime.fromString(d, localization);\r\n if (JSON.stringify(dateTime) === 'null') {\r\n return null;\r\n }\r\n return dateTime;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n function convertToDateTime(d, optionName, localization) {\r\n if (typeof d === typeof '' && optionName !== 'input') {\r\n Namespace.errorMessages.dateString();\r\n }\r\n const converted = tryConvertToDateTime(d, localization);\r\n if (!converted) {\r\n Namespace.errorMessages.failedToParseDate(optionName, d, optionName === 'input');\r\n }\r\n return converted;\r\n }\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n function typeCheckDateArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n providedType, localization = DefaultFormatLocalization$1) {\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of DateTime or Date');\r\n }\r\n for (let i = 0; i < value.length; i++) {\r\n const d = value[i];\r\n const dateTime = convertToDateTime(d, optionName, localization);\r\n dateTime.setLocalization(localization);\r\n value[i] = dateTime;\r\n }\r\n }\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n function typeCheckNumberArray(optionName, value, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n providedType) {\r\n if (!Array.isArray(value) || value.some((x) => typeof x !== typeof 0)) {\r\n Namespace.errorMessages.typeMismatch(optionName, providedType, 'array of numbers');\r\n }\r\n }\n\n function mandatoryDate(key) {\r\n return ({ value, providedType, localization }) => {\r\n const dateTime = convertToDateTime(value, key, localization);\r\n if (dateTime !== undefined) {\r\n dateTime.setLocalization(localization);\r\n return dateTime;\r\n }\r\n };\r\n }\r\n function optionalDate(key) {\r\n const mandatory = mandatoryDate(key);\r\n return (args) => {\r\n if (args.value === undefined) {\r\n return args.value;\r\n }\r\n return mandatory(args);\r\n };\r\n }\r\n function numbersInRange(key, lower, upper) {\r\n return ({ value, providedType }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckNumberArray(key, value, providedType);\r\n if (value.some((x) => x < lower || x > upper))\r\n Namespace.errorMessages.numbersOutOfRange(key, lower, upper);\r\n return value;\r\n };\r\n }\r\n function validHourRange(key) {\r\n return numbersInRange(key, 0, 23);\r\n }\r\n function validDateArray(key) {\r\n return ({ value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n typeCheckDateArray(key, value, providedType, localization);\r\n return value;\r\n };\r\n }\r\n function validKeyOption(keyOptions) {\r\n return ({ value, path }) => {\r\n if (!keyOptions.includes(value))\r\n Namespace.errorMessages.unexpectedOptionValue(path.substring(1), value, keyOptions);\r\n return value;\r\n };\r\n }\r\n const optionProcessors = Object.freeze({\r\n defaultDate: mandatoryDate('defaultDate'),\r\n viewDate: mandatoryDate('viewDate'),\r\n minDate: optionalDate('restrictions.minDate'),\r\n maxDate: optionalDate('restrictions.maxDate'),\r\n disabledHours: validHourRange('restrictions.disabledHours'),\r\n enabledHours: validHourRange('restrictions.enabledHours'),\r\n disabledDates: validDateArray('restrictions.disabledDates'),\r\n enabledDates: validDateArray('restrictions.enabledDates'),\r\n daysOfWeekDisabled: numbersInRange('restrictions.daysOfWeekDisabled', 0, 6),\r\n disabledTimeIntervals: ({ key, value, providedType, localization }) => {\r\n if (value === undefined) {\r\n return [];\r\n }\r\n if (!Array.isArray(value)) {\r\n Namespace.errorMessages.typeMismatch(key, providedType, 'array of { from: DateTime|Date, to: DateTime|Date }');\r\n }\r\n const valueObject = value; //eslint-disable-line @typescript-eslint/no-explicit-any\r\n for (let i = 0; i < valueObject.length; i++) {\r\n Object.keys(valueObject[i]).forEach((vk) => {\r\n const subOptionName = `${key}[${i}].${vk}`;\r\n const d = valueObject[i][vk];\r\n const dateTime = convertToDateTime(d, subOptionName, localization);\r\n dateTime.setLocalization(localization);\r\n valueObject[i][vk] = dateTime;\r\n });\r\n }\r\n return valueObject;\r\n },\r\n toolbarPlacement: validKeyOption(['top', 'bottom', 'default']),\r\n type: validKeyOption(['icons', 'sprites']),\r\n viewMode: validKeyOption([\r\n 'clock',\r\n 'calendar',\r\n 'months',\r\n 'years',\r\n 'decades',\r\n ]),\r\n theme: validKeyOption(['light', 'dark', 'auto']),\r\n placement: validKeyOption(['top', 'bottom']),\r\n meta: ({ value }) => value,\r\n dayViewHeaderFormat: ({ value }) => value,\r\n container: ({ value, path }) => {\r\n if (value &&\r\n !(value instanceof HTMLElement ||\r\n value instanceof Element ||\r\n value?.appendChild)) {\r\n Namespace.errorMessages.typeMismatch(path.substring(1), typeof value, 'HTMLElement');\r\n }\r\n return value;\r\n },\r\n useTwentyfourHour: ({ value, path, providedType, defaultType }) => {\r\n Namespace.errorMessages.deprecatedWarning('useTwentyfourHour', 'Please use \"options.localization.hourCycle\" instead');\r\n if (value === undefined || providedType === 'boolean')\r\n return value;\r\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\r\n },\r\n hourCycle: validKeyOption(['h11', 'h12', 'h23', 'h24']),\r\n });\r\n const defaultProcessor = ({ value, defaultType, providedType, path, }) => {\r\n switch (defaultType) {\r\n case 'boolean':\r\n return value === 'true' || value === true;\r\n case 'number':\r\n return +value;\r\n case 'string':\r\n return value.toString();\r\n case 'object':\r\n return {};\r\n case 'function':\r\n return value;\r\n default:\r\n Namespace.errorMessages.typeMismatch(path, providedType, defaultType);\r\n }\r\n };\r\n function processKey(args) {\r\n return (optionProcessors[args.key] || defaultProcessor)(args);\r\n }\n\n class OptionConverter {\r\n static deepCopy(input) {\r\n const o = {};\r\n Object.keys(input).forEach((key) => {\r\n const inputElement = input[key];\r\n if (inputElement instanceof DateTime) {\r\n o[key] = inputElement.clone;\r\n return;\r\n }\r\n else if (inputElement instanceof Date) {\r\n o[key] = new Date(inputElement.valueOf());\r\n return;\r\n }\r\n o[key] = inputElement;\r\n if (typeof inputElement !== 'object' ||\r\n inputElement instanceof HTMLElement ||\r\n inputElement instanceof Element)\r\n return;\r\n if (!Array.isArray(inputElement)) {\r\n o[key] = OptionConverter.deepCopy(inputElement);\r\n }\r\n });\r\n return o;\r\n }\r\n /**\r\n * Finds value out of an object based on a string, period delimited, path\r\n * @param paths\r\n * @param obj\r\n */\r\n static objectPath(paths, obj) {\r\n if (paths.charAt(0) === '.')\r\n paths = paths.slice(1);\r\n if (!paths)\r\n return obj;\r\n return paths\r\n .split('.')\r\n .reduce((value, key) => OptionConverter.isValue(value) || OptionConverter.isValue(value[key])\r\n ? value[key]\r\n : undefined, obj);\r\n }\r\n /**\r\n * The spread operator caused sub keys to be missing after merging.\r\n * This is to fix that issue by using spread on the child objects first.\r\n * Also handles complex options like disabledDates\r\n * @param provided An option from new providedOptions\r\n * @param copyTo Destination object. This was added to prevent reference copies\r\n * @param localization\r\n * @param path\r\n */\r\n static spread(provided, copyTo, localization, path = '') {\r\n const defaultOptions = OptionConverter.objectPath(path, DefaultOptions);\r\n const unsupportedOptions = Object.keys(provided).filter((x) => !Object.keys(defaultOptions).includes(x));\r\n if (unsupportedOptions.length > 0) {\r\n const flattenedOptions = OptionConverter.getFlattenDefaultOptions();\r\n const errors = unsupportedOptions.map((x) => {\r\n let error = `\"${path}.${x}\" in not a known option.`;\r\n const didYouMean = flattenedOptions.find((y) => y.includes(x));\r\n if (didYouMean)\r\n error += ` Did you mean \"${didYouMean}\"?`;\r\n return error;\r\n });\r\n Namespace.errorMessages.unexpectedOptions(errors);\r\n }\r\n Object.keys(provided)\r\n .filter((key) => key !== '__proto__' && key !== 'constructor')\r\n .forEach((key) => {\r\n path += `.${key}`;\r\n if (path.charAt(0) === '.')\r\n path = path.slice(1);\r\n const defaultOptionValue = defaultOptions[key];\r\n const providedType = typeof provided[key];\r\n const defaultType = typeof defaultOptionValue;\r\n const value = provided[key];\r\n if (value === undefined || value === null) {\r\n copyTo[key] = value;\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n return;\r\n }\r\n if (typeof defaultOptionValue === 'object' &&\r\n !Array.isArray(provided[key]) &&\r\n !(defaultOptionValue instanceof Date ||\r\n OptionConverter.ignoreProperties.includes(key))) {\r\n OptionConverter.spread(provided[key], copyTo[key], localization, path);\r\n }\r\n else {\r\n copyTo[key] = OptionConverter.processKey(key, value, providedType, defaultType, path, localization);\r\n }\r\n path = path.substring(0, path.lastIndexOf(`.${key}`));\r\n });\r\n }\r\n static processKey(key, value, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n providedType, defaultType, path, localization) {\r\n return processKey({\r\n key,\r\n value,\r\n providedType,\r\n defaultType,\r\n path,\r\n localization,\r\n });\r\n }\r\n static _mergeOptions(providedOptions, mergeTo) {\r\n const newConfig = OptionConverter.deepCopy(mergeTo);\r\n //see if the options specify a locale\r\n const localization = mergeTo.localization?.locale !== 'default'\r\n ? mergeTo.localization\r\n : providedOptions?.localization || DefaultOptions.localization;\r\n OptionConverter.spread(providedOptions, newConfig, localization, '');\r\n return newConfig;\r\n }\r\n static _dataToOptions(element, options) {\r\n const eData = JSON.parse(JSON.stringify(element.dataset));\r\n if (eData?.tdTargetInput)\r\n delete eData.tdTargetInput;\r\n if (eData?.tdTargetToggle)\r\n delete eData.tdTargetToggle;\r\n if (!eData || Object.keys(eData).length === 0)\r\n return options;\r\n const dataOptions = {};\r\n // because dataset returns camelCase including the 'td' key the option\r\n // key won't align\r\n const objectToNormalized = (object) => {\r\n const lowered = {};\r\n Object.keys(object).forEach((x) => {\r\n lowered[x.toLowerCase()] = x;\r\n });\r\n return lowered;\r\n };\r\n const normalizeObject = this.normalizeObject(objectToNormalized);\r\n const optionsLower = objectToNormalized(options);\r\n Object.keys(eData)\r\n .filter((x) => x.startsWith(Namespace.dataKey))\r\n .map((x) => x.substring(2))\r\n .forEach((key) => {\r\n let keyOption = optionsLower[key.toLowerCase()];\r\n // dataset merges dashes to camelCase... yay\r\n // i.e. key = display_components_seconds\r\n if (key.includes('_')) {\r\n // [display, components, seconds]\r\n const split = key.split('_');\r\n // display\r\n keyOption = optionsLower[split[0].toLowerCase()];\r\n if (keyOption !== undefined &&\r\n options[keyOption].constructor === Object) {\r\n dataOptions[keyOption] = normalizeObject(split, 1, options[keyOption], eData[`td${key}`]);\r\n }\r\n }\r\n // or key = multipleDate\r\n else if (keyOption !== undefined) {\r\n dataOptions[keyOption] = eData[`td${key}`];\r\n }\r\n });\r\n return this._mergeOptions(dataOptions, options);\r\n }\r\n //todo clean this up\r\n static normalizeObject(objectToNormalized) {\r\n const normalizeObject = (split, index, optionSubgroup, value) => {\r\n // first round = display { ... }\r\n const normalizedOptions = objectToNormalized(optionSubgroup);\r\n const keyOption = normalizedOptions[split[index].toLowerCase()];\r\n const internalObject = {};\r\n if (keyOption === undefined)\r\n return internalObject;\r\n // if this is another object, continue down the rabbit hole\r\n if (optionSubgroup[keyOption]?.constructor === Object) {\r\n index++;\r\n internalObject[keyOption] = normalizeObject(split, index, optionSubgroup[keyOption], value);\r\n }\r\n else {\r\n internalObject[keyOption] = value;\r\n }\r\n return internalObject;\r\n };\r\n return normalizeObject;\r\n }\r\n /**\r\n * Attempts to prove `d` is a DateTime or Date or can be converted into one.\r\n * @param d If a string will attempt creating a date from it.\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n * @private\r\n */\r\n static _dateTypeCheck(d, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n localization) {\r\n return tryConvertToDateTime(d, localization);\r\n }\r\n /**\r\n * Type checks that `value` is an array of Date or DateTime\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n * @param localization\r\n */\r\n static _typeCheckDateArray(optionName, value, providedType, localization) {\r\n return typeCheckDateArray(optionName, value, providedType, localization);\r\n }\r\n /**\r\n * Type checks that `value` is an array of numbers\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param value Option value\r\n * @param providedType Used to provide text to error messages\r\n */\r\n static _typeCheckNumberArray(optionName, value, providedType) {\r\n return typeCheckNumberArray(optionName, value, providedType);\r\n }\r\n /**\r\n * Attempts to convert `d` to a DateTime object\r\n * @param d value to convert\r\n * @param optionName Provides text to error messages e.g. disabledDates\r\n * @param localization object containing locale and format settings. Only used with the custom formats\r\n */\r\n static dateConversion(d, //eslint-disable-line @typescript-eslint/no-explicit-any\r\n optionName, localization) {\r\n return convertToDateTime(d, optionName, localization);\r\n }\r\n static getFlattenDefaultOptions() {\r\n if (this._flattenDefaults)\r\n return this._flattenDefaults;\r\n const deepKeys = (t, pre = []) => {\r\n if (Array.isArray(t))\r\n return [];\r\n if (Object(t) === t) {\r\n return Object.entries(t).flatMap(([k, v]) => deepKeys(v, [...pre, k]));\r\n }\r\n else {\r\n return pre.join('.');\r\n }\r\n };\r\n this._flattenDefaults = deepKeys(DefaultOptions);\r\n return this._flattenDefaults;\r\n }\r\n /**\r\n * Some options conflict like min/max date. Verify that these kinds of options\r\n * are set correctly.\r\n * @param config\r\n */\r\n static _validateConflicts(config) {\r\n if (config.display.sideBySide &&\r\n (!config.display.components.clock ||\r\n !(config.display.components.hours ||\r\n config.display.components.minutes ||\r\n config.display.components.seconds))) {\r\n Namespace.errorMessages.conflictingConfiguration('Cannot use side by side mode without the clock components');\r\n }\r\n if (config.restrictions.minDate && config.restrictions.maxDate) {\r\n if (config.restrictions.minDate.isAfter(config.restrictions.maxDate)) {\r\n Namespace.errorMessages.conflictingConfiguration('minDate is after maxDate');\r\n }\r\n if (config.restrictions.maxDate.isBefore(config.restrictions.minDate)) {\r\n Namespace.errorMessages.conflictingConfiguration('maxDate is before minDate');\r\n }\r\n }\r\n if (config.multipleDates && config.dateRange) {\r\n Namespace.errorMessages.conflictingConfiguration('Cannot uss option \"multipleDates\" with \"dateRange\"');\r\n }\r\n }\r\n }\r\n OptionConverter.ignoreProperties = [\r\n 'meta',\r\n 'dayViewHeaderFormat',\r\n 'container',\r\n 'dateForms',\r\n 'ordinal',\r\n ];\r\n OptionConverter.isValue = (a) => a != null; // everything except undefined + null\n\n class Dates {\r\n constructor() {\r\n this._dates = [];\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n }\r\n /**\r\n * Returns the array of selected dates\r\n */\r\n get picked() {\r\n return [...this._dates];\r\n }\r\n /**\r\n * Returns the last picked value.\r\n */\r\n get lastPicked() {\r\n return this._dates[this.lastPickedIndex]?.clone;\r\n }\r\n /**\r\n * Returns the length of picked dates -1 or 0 if none are selected.\r\n */\r\n get lastPickedIndex() {\r\n if (this._dates.length === 0)\r\n return 0;\r\n return this._dates.length - 1;\r\n }\r\n /**\r\n * Formats a DateTime object to a string. Used when setting the input value.\r\n * @param date\r\n */\r\n formatInput(date) {\r\n if (!date)\r\n return '';\r\n date.localization = this.optionsStore.options.localization;\r\n return date.format();\r\n }\r\n /**\r\n * parse the value into a DateTime object.\r\n * this can be overwritten to supply your own parsing.\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n parseInput(value) {\r\n try {\r\n return OptionConverter.dateConversion(value, 'input', this.optionsStore.options.localization);\r\n }\r\n catch (e) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToParseInput,\r\n format: this.optionsStore.options.localization.format,\r\n value: value,\r\n });\r\n return undefined;\r\n }\r\n }\r\n /**\r\n * Tries to convert the provided value to a DateTime object.\r\n * If value is null|undefined then clear the value of the provided index (or 0).\r\n * @param value Value to convert or null|undefined\r\n * @param index When using multidates this is the index in the array\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n setFromInput(value, index) {\r\n if (!value) {\r\n this.setValue(undefined, index);\r\n return;\r\n }\r\n const converted = this.parseInput(value);\r\n if (converted) {\r\n converted.setLocalization(this.optionsStore.options.localization);\r\n this.setValue(converted, index);\r\n }\r\n }\r\n /**\r\n * Adds a new DateTime to selected dates array\r\n * @param date\r\n */\r\n add(date) {\r\n this._dates.push(date);\r\n }\r\n /**\r\n * Returns true if the `targetDate` is part of the selected dates array.\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n isPicked(targetDate, unit) {\r\n if (!DateTime.isValid(targetDate))\r\n return false;\r\n if (!unit)\r\n return this._dates.find((x) => x.isSame(targetDate)) !== undefined;\r\n const format = getFormatByUnit(unit);\r\n const innerDateFormatted = targetDate.format(format);\r\n return (this._dates\r\n .map((x) => x.format(format))\r\n .find((x) => x === innerDateFormatted) !== undefined);\r\n }\r\n /**\r\n * Returns the index at which `targetDate` is in the array.\r\n * This is used for updating or removing a date when multi-date is used\r\n * If `unit` is provided then a granularity to that unit will be used.\r\n * @param targetDate\r\n * @param unit\r\n */\r\n pickedIndex(targetDate, unit) {\r\n if (!DateTime.isValid(targetDate))\r\n return -1;\r\n if (!unit)\r\n return this._dates.map((x) => x.valueOf()).indexOf(targetDate.valueOf());\r\n const format = getFormatByUnit(unit);\r\n const innerDateFormatted = targetDate.format(format);\r\n return this._dates.map((x) => x.format(format)).indexOf(innerDateFormatted);\r\n }\r\n /**\r\n * Clears all selected dates.\r\n */\r\n clear() {\r\n this.optionsStore.unset = true;\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate: this.lastPicked,\r\n isClear: true,\r\n isValid: true,\r\n });\r\n this._dates = [];\r\n if (this.optionsStore.input)\r\n this.optionsStore.input.value = '';\r\n this._eventEmitters.updateDisplay.emit('all');\r\n }\r\n /**\r\n * Find the \"book end\" years given a `year` and a `factor`\r\n * @param factor e.g. 100 for decades\r\n * @param year e.g. 2021\r\n */\r\n static getStartEndYear(factor, year) {\r\n const step = factor / 10, startYear = Math.floor(year / factor) * factor, endYear = startYear + step * 9, focusValue = Math.floor(year / step) * step;\r\n return [startYear, endYear, focusValue];\r\n }\r\n updateInput(target) {\r\n if (!this.optionsStore.input)\r\n return;\r\n let newValue = this.formatInput(target);\r\n if (this.optionsStore.options.multipleDates ||\r\n this.optionsStore.options.dateRange) {\r\n newValue = this._dates\r\n .map((d) => this.formatInput(d))\r\n .join(this.optionsStore.options.multipleDatesSeparator);\r\n }\r\n if (this.optionsStore.input.value != newValue)\r\n this.optionsStore.input.value = newValue;\r\n }\r\n /**\r\n * Attempts to either clear or set the `target` date at `index`.\r\n * If the `target` is null then the date will be cleared.\r\n * If multi-date is being used then it will be removed from the array.\r\n * If `target` is valid and multi-date is used then if `index` is\r\n * provided the date at that index will be replaced, otherwise it is appended.\r\n * @param target\r\n * @param index\r\n */\r\n setValue(target, index) {\r\n const noIndex = typeof index === 'undefined', isClear = !target && noIndex;\r\n let oldDate = this.optionsStore.unset ? null : this._dates[index]?.clone;\r\n if (!oldDate && !this.optionsStore.unset && noIndex && isClear) {\r\n oldDate = this.lastPicked;\r\n }\r\n if (target && oldDate?.isSame(target)) {\r\n this.updateInput(target);\r\n return;\r\n }\r\n // case of calling setValue(null)\r\n if (!target) {\r\n this._setValueNull(isClear, index, oldDate);\r\n return;\r\n }\r\n index = index || 0;\r\n target = target.clone;\r\n // minute stepping is being used, force the minute to the closest value\r\n if (this.optionsStore.options.stepping !== 1) {\r\n target.minutes =\r\n Math.round(target.minutes / this.optionsStore.options.stepping) *\r\n this.optionsStore.options.stepping;\r\n target.startOf(Unit.minutes);\r\n }\r\n const onUpdate = (isValid) => {\r\n this._dates[index] = target;\r\n this._eventEmitters.updateViewDate.emit(target.clone);\r\n this.updateInput(target);\r\n this.optionsStore.unset = false;\r\n this._eventEmitters.updateDisplay.emit('all');\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: target,\r\n oldDate,\r\n isClear,\r\n isValid: isValid,\r\n });\r\n };\r\n if (this.validation.isValid(target) &&\r\n this.validation.dateRangeIsValid(this.picked, index, target)) {\r\n onUpdate(true);\r\n return;\r\n }\r\n if (this.optionsStore.options.keepInvalid) {\r\n onUpdate(false);\r\n }\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.error,\r\n reason: Namespace.errorMessages.failedToSetInvalidDate,\r\n date: target,\r\n oldDate,\r\n });\r\n }\r\n _setValueNull(isClear, index, oldDate) {\r\n if (!this.optionsStore.options.multipleDates ||\r\n this._dates.length === 1 ||\r\n isClear) {\r\n this.optionsStore.unset = true;\r\n this._dates = [];\r\n }\r\n else {\r\n this._dates.splice(index, 1);\r\n }\r\n this.updateInput();\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.change,\r\n date: undefined,\r\n oldDate,\r\n isClear,\r\n isValid: true,\r\n });\r\n this._eventEmitters.updateDisplay.emit('all');\r\n }\r\n }\n\n var ActionTypes;\r\n (function (ActionTypes) {\r\n ActionTypes[\"next\"] = \"next\";\r\n ActionTypes[\"previous\"] = \"previous\";\r\n ActionTypes[\"changeCalendarView\"] = \"changeCalendarView\";\r\n ActionTypes[\"selectMonth\"] = \"selectMonth\";\r\n ActionTypes[\"selectYear\"] = \"selectYear\";\r\n ActionTypes[\"selectDecade\"] = \"selectDecade\";\r\n ActionTypes[\"selectDay\"] = \"selectDay\";\r\n ActionTypes[\"selectHour\"] = \"selectHour\";\r\n ActionTypes[\"selectMinute\"] = \"selectMinute\";\r\n ActionTypes[\"selectSecond\"] = \"selectSecond\";\r\n ActionTypes[\"incrementHours\"] = \"incrementHours\";\r\n ActionTypes[\"incrementMinutes\"] = \"incrementMinutes\";\r\n ActionTypes[\"incrementSeconds\"] = \"incrementSeconds\";\r\n ActionTypes[\"decrementHours\"] = \"decrementHours\";\r\n ActionTypes[\"decrementMinutes\"] = \"decrementMinutes\";\r\n ActionTypes[\"decrementSeconds\"] = \"decrementSeconds\";\r\n ActionTypes[\"toggleMeridiem\"] = \"toggleMeridiem\";\r\n ActionTypes[\"togglePicker\"] = \"togglePicker\";\r\n ActionTypes[\"showClock\"] = \"showClock\";\r\n ActionTypes[\"showHours\"] = \"showHours\";\r\n ActionTypes[\"showMinutes\"] = \"showMinutes\";\r\n ActionTypes[\"showSeconds\"] = \"showSeconds\";\r\n ActionTypes[\"clear\"] = \"clear\";\r\n ActionTypes[\"close\"] = \"close\";\r\n ActionTypes[\"today\"] = \"today\";\r\n })(ActionTypes || (ActionTypes = {}));\r\n var ActionTypes$1 = ActionTypes;\n\n /**\r\n * Creates and updates the grid for `date`\r\n */\r\n class DateDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.daysContainer);\r\n container.append(...this._daysOfTheWeek());\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement('div');\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n const { rangeHoverEvent, rangeHoverOutEvent } = this.handleMouseEvents(container);\r\n for (let i = 0; i < 42; i++) {\r\n if (i !== 0 && i % 7 === 0) {\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const div = document.createElement('div');\r\n div.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n container.appendChild(div);\r\n }\r\n }\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectDay);\r\n container.appendChild(div);\r\n // if hover is supported then add the events\r\n if (matchMedia('(hover: hover)').matches &&\r\n this.optionsStore.options.dateRange) {\r\n div.addEventListener('mouseover', rangeHoverEvent);\r\n div.addEventListener('mouseout', rangeHoverOutEvent);\r\n }\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.daysContainer)[0];\r\n this._updateCalendarView(container);\r\n const innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.month)\r\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\r\n .manipulate(12, Unit.hours);\r\n this._handleCalendarWeeks(container, innerDate.clone);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectDay}\"]`)\r\n .forEach((element) => {\r\n const classes = [];\r\n classes.push(Namespace.css.day);\r\n if (innerDate.isBefore(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.old);\r\n }\r\n if (innerDate.isAfter(this.optionsStore.viewDate, Unit.month)) {\r\n classes.push(Namespace.css.new);\r\n }\r\n if (!this.optionsStore.unset &&\r\n !this.optionsStore.options.dateRange &&\r\n this.dates.isPicked(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.date)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n if (innerDate.isSame(new DateTime(), Unit.date)) {\r\n classes.push(Namespace.css.today);\r\n }\r\n if (innerDate.weekDay === 0 || innerDate.weekDay === 6) {\r\n classes.push(Namespace.css.weekend);\r\n }\r\n this._handleDateRange(innerDate, classes);\r\n paint(Unit.date, innerDate, classes, element);\r\n element.classList.remove(...element.classList);\r\n element.classList.add(...classes);\r\n element.setAttribute('data-value', this._dateToDataValue(innerDate));\r\n element.setAttribute('data-day', `${innerDate.date}`);\r\n element.innerText = innerDate.parts(undefined, {\r\n day: 'numeric',\r\n }).day;\r\n innerDate.manipulate(1, Unit.date);\r\n });\r\n }\r\n _dateToDataValue(date) {\r\n if (!DateTime.isValid(date))\r\n return '';\r\n return `${date.year}-${date.month.toString().padStart(2, '0')}-${date.date\r\n .toString()\r\n .padStart(2, '0')}`;\r\n }\r\n _handleDateRange(innerDate, classes) {\r\n const rangeStart = this.dates.picked[0];\r\n const rangeEnd = this.dates.picked[1];\r\n if (this.optionsStore.options.dateRange) {\r\n if (innerDate.isBetween(rangeStart, rangeEnd, Unit.date)) {\r\n classes.push(Namespace.css.rangeIn);\r\n }\r\n if (innerDate.isSame(rangeStart, Unit.date)) {\r\n classes.push(Namespace.css.rangeStart);\r\n }\r\n if (innerDate.isSame(rangeEnd, Unit.date)) {\r\n classes.push(Namespace.css.rangeEnd);\r\n }\r\n }\r\n }\r\n handleMouseEvents(container) {\r\n const rangeHoverEvent = (e) => {\r\n const currentTarget = e?.currentTarget;\r\n // if we have 0 or 2 selected or if the target is disabled then ignore\r\n if (this.dates.picked.length !== 1 ||\r\n currentTarget.classList.contains(Namespace.css.disabled))\r\n return;\r\n // select all the date divs\r\n const allDays = [...container.querySelectorAll('.day')];\r\n // get the date value from the element being hovered over\r\n const attributeValue = currentTarget.getAttribute('data-value');\r\n // format the string to a date\r\n const innerDate = DateTime.fromString(attributeValue, {\r\n format: 'yyyy-MM-dd',\r\n });\r\n // find the position of the target in the date container\r\n const dayIndex = allDays.findIndex((e) => e.getAttribute('data-value') === attributeValue);\r\n // find the first and second selected dates\r\n const rangeStart = this.dates.picked[0];\r\n const rangeEnd = this.dates.picked[1];\r\n //format the start date so that it can be found by the attribute\r\n const rangeStartFormatted = this._dateToDataValue(rangeStart);\r\n const rangeStartIndex = allDays.findIndex((e) => e.getAttribute('data-value') === rangeStartFormatted);\r\n const rangeStartElement = allDays[rangeStartIndex];\r\n //make sure we don't leave start/end classes if we don't need them\r\n if (!innerDate.isSame(rangeStart, Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeStart);\r\n }\r\n if (!innerDate.isSame(rangeEnd, Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeEnd);\r\n }\r\n // the following figures out which direct from start date is selected\r\n // the selection \"cap\" classes are applied if needed\r\n // otherwise all the dates between will get the `rangeIn` class.\r\n // We make this selection based on the element's index and the rangeStart index\r\n let lambda;\r\n if (innerDate.isBefore(rangeStart)) {\r\n currentTarget.classList.add(Namespace.css.rangeStart);\r\n rangeStartElement?.classList.remove(Namespace.css.rangeStart);\r\n rangeStartElement?.classList.add(Namespace.css.rangeEnd);\r\n lambda = (_, index) => index > dayIndex && index < rangeStartIndex;\r\n }\r\n else {\r\n currentTarget.classList.add(Namespace.css.rangeEnd);\r\n rangeStartElement?.classList.remove(Namespace.css.rangeEnd);\r\n rangeStartElement?.classList.add(Namespace.css.rangeStart);\r\n lambda = (_, index) => index < dayIndex && index > rangeStartIndex;\r\n }\r\n allDays.filter(lambda).forEach((e) => {\r\n e.classList.add(Namespace.css.rangeIn);\r\n });\r\n };\r\n const rangeHoverOutEvent = (e) => {\r\n // find all the dates in the container\r\n const allDays = [...container.querySelectorAll('.day')];\r\n // if only the start is selected, remove all the rangeIn classes\r\n // we do this because once the user hovers over a new date the range will be recalculated.\r\n if (this.dates.picked.length === 1)\r\n allDays.forEach((e) => e.classList.remove(Namespace.css.rangeIn));\r\n // if we have 0 or 2 dates selected then ignore\r\n if (this.dates.picked.length !== 1)\r\n return;\r\n const currentTarget = e?.currentTarget;\r\n // get the elements date from the attribute value\r\n const innerDate = new DateTime(currentTarget.getAttribute('data-value'));\r\n // verify selections and remove invalid classes\r\n if (!innerDate.isSame(this.dates.picked[0], Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeStart);\r\n }\r\n if (!innerDate.isSame(this.dates.picked[1], Unit.date)) {\r\n currentTarget.classList.remove(Namespace.css.rangeEnd);\r\n }\r\n };\r\n return { rangeHoverEvent, rangeHoverOutEvent };\r\n }\r\n _updateCalendarView(container) {\r\n if (this.optionsStore.currentView !== 'calendar')\r\n return;\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switcher.setAttribute(Namespace.css.daysContainer, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat));\r\n this.optionsStore.options.display.components.month\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.month), Unit.month)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.month), Unit.month)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n /***\r\n * Generates a html row that contains the days of the week.\r\n * @private\r\n */\r\n _daysOfTheWeek() {\r\n const innerDate = this.optionsStore.viewDate.clone\r\n .startOf('weekDay', this.optionsStore.options.localization.startOfTheWeek)\r\n .startOf(Unit.date);\r\n const row = [];\r\n document.createElement('div');\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n const htmlDivElement = document.createElement('div');\r\n htmlDivElement.classList.add(Namespace.css.calendarWeeks, Namespace.css.noHighlight);\r\n htmlDivElement.innerText = '#';\r\n row.push(htmlDivElement);\r\n }\r\n for (let i = 0; i < 7; i++) {\r\n const htmlDivElement = document.createElement('div');\r\n htmlDivElement.classList.add(Namespace.css.dayOfTheWeek, Namespace.css.noHighlight);\r\n let weekDay = innerDate.format({ weekday: 'short' });\r\n if (this.optionsStore.options.localization.maxWeekdayLength > 0)\r\n weekDay = weekDay.substring(0, this.optionsStore.options.localization.maxWeekdayLength);\r\n htmlDivElement.innerText = weekDay;\r\n innerDate.manipulate(1, Unit.date);\r\n row.push(htmlDivElement);\r\n }\r\n return row;\r\n }\r\n _handleCalendarWeeks(container, innerDate) {\r\n [...container.querySelectorAll(`.${Namespace.css.calendarWeeks}`)]\r\n .filter((e) => e.innerText !== '#')\r\n .forEach((element) => {\r\n element.innerText = `${innerDate.week}`;\r\n innerDate.manipulate(7, Unit.date);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `month`\r\n */\r\n class MonthDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.monthsContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectMonth);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.monthsContainer)[0];\r\n if (this.optionsStore.currentView === 'months') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switcher.setAttribute(Namespace.css.monthsContainer, this.optionsStore.viewDate.format({ year: 'numeric' }));\r\n this.optionsStore.options.display.components.year\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.year), Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.year), Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectMonth}\"]`)\r\n .forEach((containerClone, index) => {\r\n const classes = [];\r\n classes.push(Namespace.css.month);\r\n if (!this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.month)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.month, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${index}`);\r\n containerClone.innerText = `${innerDate.format({ month: 'short' })}`;\r\n innerDate.manipulate(1, Unit.month);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `year`\r\n */\r\n class YearDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.yearsContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectYear);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n this._startYear = this.optionsStore.viewDate.clone.manipulate(-1, Unit.year);\r\n this._endYear = this.optionsStore.viewDate.clone.manipulate(10, Unit.year);\r\n const container = widget.getElementsByClassName(Namespace.css.yearsContainer)[0];\r\n if (this.optionsStore.currentView === 'years') {\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switcher.setAttribute(Namespace.css.yearsContainer, `${this._startYear.format({ year: 'numeric' })}-${this._endYear.format({\r\n year: 'numeric',\r\n })}`);\r\n this.optionsStore.options.display.components.decades\r\n ? switcher.classList.remove(Namespace.css.disabled)\r\n : switcher.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._startYear, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endYear, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n const innerDate = this.optionsStore.viewDate.clone\r\n .startOf(Unit.year)\r\n .manipulate(-1, Unit.year);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectYear}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.year);\r\n if (!this.optionsStore.unset &&\r\n this.dates.isPicked(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(innerDate, Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.year, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.year}`);\r\n containerClone.innerText = innerDate.format({ year: 'numeric' });\r\n innerDate.manipulate(1, Unit.year);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `seconds`\r\n */\r\n class DecadeDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.decadesContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectDecade);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const [start, end] = Dates.getStartEndYear(100, this.optionsStore.viewDate.year);\r\n this._startDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._startDecade.year = start;\r\n this._endDecade = this.optionsStore.viewDate.clone.startOf(Unit.year);\r\n this._endDecade.year = end;\r\n const container = widget.getElementsByClassName(Namespace.css.decadesContainer)[0];\r\n const [previous, switcher, next] = container.parentElement\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n if (this.optionsStore.currentView === 'decades') {\r\n switcher.setAttribute(Namespace.css.decadesContainer, `${this._startDecade.format({\r\n year: 'numeric',\r\n })}-${this._endDecade.format({ year: 'numeric' })}`);\r\n this.validation.isValid(this._startDecade, Unit.year)\r\n ? previous.classList.remove(Namespace.css.disabled)\r\n : previous.classList.add(Namespace.css.disabled);\r\n this.validation.isValid(this._endDecade, Unit.year)\r\n ? next.classList.remove(Namespace.css.disabled)\r\n : next.classList.add(Namespace.css.disabled);\r\n }\r\n const pickedYears = this.dates.picked.map((x) => x.year);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectDecade}\"]`)\r\n .forEach((containerClone, index) => {\r\n if (index === 0) {\r\n containerClone.classList.add(Namespace.css.old);\r\n if (this._startDecade.year - 10 < 0) {\r\n containerClone.textContent = ' ';\r\n previous.classList.add(Namespace.css.disabled);\r\n containerClone.classList.add(Namespace.css.disabled);\r\n containerClone.setAttribute('data-value', '');\r\n return;\r\n }\r\n else {\r\n containerClone.innerText = this._startDecade.clone\r\n .manipulate(-10, Unit.year)\r\n .format({ year: 'numeric' });\r\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\r\n return;\r\n }\r\n }\r\n const classes = [];\r\n classes.push(Namespace.css.decade);\r\n const startDecadeYear = this._startDecade.year;\r\n const endDecadeYear = this._startDecade.year + 9;\r\n if (!this.optionsStore.unset &&\r\n pickedYears.filter((x) => x >= startDecadeYear && x <= endDecadeYear)\r\n .length > 0) {\r\n classes.push(Namespace.css.active);\r\n }\r\n if (!this.validation.isValid(this._startDecade, Unit.year) &&\r\n !this.validation.isValid(this._startDecade.clone.manipulate(10, Unit.year), Unit.year)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint('decade', this._startDecade, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${this._startDecade.year}`);\r\n containerClone.innerText = `${this._startDecade.format({\r\n year: 'numeric',\r\n })}`;\r\n this._startDecade.manipulate(10, Unit.year);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates the clock display\r\n */\r\n class TimeDisplay {\r\n constructor() {\r\n this._gridColumns = '';\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the clock display\r\n * @private\r\n */\r\n getPicker(iconTag) {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.clockContainer);\r\n container.append(...this._grid(iconTag));\r\n return container;\r\n }\r\n /**\r\n * Populates the various elements with in the clock display\r\n * like the current hour and if the manipulation icons are enabled.\r\n * @private\r\n */\r\n _update(widget) {\r\n const timesDiv = (widget.getElementsByClassName(Namespace.css.clockContainer)[0]);\r\n let lastPicked = this.dates.lastPicked?.clone;\r\n if (!lastPicked && this.optionsStore.options.useCurrent)\r\n lastPicked = this.optionsStore.viewDate.clone;\r\n timesDiv\r\n .querySelectorAll('.disabled')\r\n .forEach((element) => element.classList.remove(Namespace.css.disabled));\r\n if (this.optionsStore.options.display.components.hours) {\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.hours), Unit.hours)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.incrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.hours), Unit.hours)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.decrementHours}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(`[data-time-component=${Unit.hours}]`).innerText = lastPicked\r\n ? lastPicked.getHoursFormatted(this.optionsStore.options.localization.hourCycle)\r\n : '--';\r\n }\r\n if (this.optionsStore.options.display.components.minutes) {\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.minutes), Unit.minutes)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.incrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.minutes), Unit.minutes)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.decrementMinutes}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(`[data-time-component=${Unit.minutes}]`).innerText = lastPicked ? lastPicked.minutesFormatted : '--';\r\n }\r\n if (this.optionsStore.options.display.components.seconds) {\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(1, Unit.seconds), Unit.seconds)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.incrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n if (!this.validation.isValid(this.optionsStore.viewDate.clone.manipulate(-1, Unit.seconds), Unit.seconds)) {\r\n timesDiv\r\n .querySelector(`[data-action=${ActionTypes$1.decrementSeconds}]`)\r\n .classList.add(Namespace.css.disabled);\r\n }\r\n timesDiv.querySelector(`[data-time-component=${Unit.seconds}]`).innerText = lastPicked ? lastPicked.secondsFormatted : '--';\r\n }\r\n if (this.optionsStore.isTwelveHour) {\r\n const toggle = timesDiv.querySelector(`[data-action=${ActionTypes$1.toggleMeridiem}]`);\r\n const meridiemDate = (lastPicked || this.optionsStore.viewDate).clone;\r\n toggle.innerText = meridiemDate.meridiem();\r\n if (!this.validation.isValid(meridiemDate.manipulate(meridiemDate.hours >= 12 ? -12 : 12, Unit.hours))) {\r\n toggle.classList.add(Namespace.css.disabled);\r\n }\r\n else {\r\n toggle.classList.remove(Namespace.css.disabled);\r\n }\r\n }\r\n timesDiv.style.gridTemplateAreas = `\"${this._gridColumns}\"`;\r\n }\r\n /**\r\n * Creates the table for the clock display depending on what options are selected.\r\n * @private\r\n */\r\n _grid(iconTag) {\r\n this._gridColumns = '';\r\n const top = [], middle = [], bottom = [], separator = document.createElement('div'), upIcon = iconTag(this.optionsStore.options.display.icons.up), downIcon = iconTag(this.optionsStore.options.display.icons.down);\r\n separator.classList.add(Namespace.css.separator, Namespace.css.noHighlight);\r\n const separatorColon = separator.cloneNode(true);\r\n separatorColon.innerHTML = ':';\r\n const getSeparator = (colon = false) => {\r\n return colon\r\n ? separatorColon.cloneNode(true)\r\n : separator.cloneNode(true);\r\n };\r\n if (this.optionsStore.options.display.components.hours) {\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.incrementHour);\r\n divElement.setAttribute('data-action', ActionTypes$1.incrementHours);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.pickHour);\r\n divElement.setAttribute('data-action', ActionTypes$1.showHours);\r\n divElement.setAttribute('data-time-component', Unit.hours);\r\n middle.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.decrementHour);\r\n divElement.setAttribute('data-action', ActionTypes$1.decrementHours);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n this._gridColumns += 'a';\r\n }\r\n if (this.optionsStore.options.display.components.minutes) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.hours) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.incrementMinute);\r\n divElement.setAttribute('data-action', ActionTypes$1.incrementMinutes);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.pickMinute);\r\n divElement.setAttribute('data-action', ActionTypes$1.showMinutes);\r\n divElement.setAttribute('data-time-component', Unit.minutes);\r\n middle.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.decrementMinute);\r\n divElement.setAttribute('data-action', ActionTypes$1.decrementMinutes);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n if (this.optionsStore.options.display.components.seconds) {\r\n this._gridColumns += ' a';\r\n if (this.optionsStore.options.display.components.minutes) {\r\n top.push(getSeparator());\r\n middle.push(getSeparator(true));\r\n bottom.push(getSeparator());\r\n this._gridColumns += ' a';\r\n }\r\n let divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.incrementSecond);\r\n divElement.setAttribute('data-action', ActionTypes$1.incrementSeconds);\r\n divElement.appendChild(upIcon.cloneNode(true));\r\n top.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.pickSecond);\r\n divElement.setAttribute('data-action', ActionTypes$1.showSeconds);\r\n divElement.setAttribute('data-time-component', Unit.seconds);\r\n middle.push(divElement);\r\n divElement = document.createElement('div');\r\n divElement.setAttribute('title', this.optionsStore.options.localization.decrementSecond);\r\n divElement.setAttribute('data-action', ActionTypes$1.decrementSeconds);\r\n divElement.appendChild(downIcon.cloneNode(true));\r\n bottom.push(divElement);\r\n }\r\n if (this.optionsStore.isTwelveHour) {\r\n this._gridColumns += ' a';\r\n let divElement = getSeparator();\r\n top.push(divElement);\r\n const button = document.createElement('button');\r\n button.setAttribute('type', 'button');\r\n button.setAttribute('title', this.optionsStore.options.localization.toggleMeridiem);\r\n button.setAttribute('data-action', ActionTypes$1.toggleMeridiem);\r\n button.setAttribute('tabindex', '-1');\r\n if (Namespace.css.toggleMeridiem.includes(',')) {\r\n //todo move this to paint function?\r\n button.classList.add(...Namespace.css.toggleMeridiem.split(','));\r\n }\r\n else\r\n button.classList.add(Namespace.css.toggleMeridiem);\r\n divElement = document.createElement('div');\r\n divElement.classList.add(Namespace.css.noHighlight);\r\n divElement.appendChild(button);\r\n middle.push(divElement);\r\n divElement = getSeparator();\r\n bottom.push(divElement);\r\n }\r\n this._gridColumns = this._gridColumns.trim();\r\n return [...top, ...middle, ...bottom];\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `hours`\r\n */\r\n class HourDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.hourContainer);\r\n for (let i = 0; i < (this.optionsStore.isTwelveHour ? 12 : 24); i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectHour);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.hourContainer)[0];\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.date);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectHour}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.hour);\r\n if (!this.validation.isValid(innerDate, Unit.hours)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.hours, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.hours}`);\r\n containerClone.innerText = innerDate.getHoursFormatted(this.optionsStore.options.localization.hourCycle);\r\n innerDate.manipulate(1, Unit.hours);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `minutes`\r\n */\r\n class MinuteDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.minuteContainer);\r\n const step = this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n for (let i = 0; i < 60 / step; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectMinute);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.minuteContainer)[0];\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.hours);\r\n const step = this.optionsStore.options.stepping === 1\r\n ? 5\r\n : this.optionsStore.options.stepping;\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectMinute}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.minute);\r\n if (!this.validation.isValid(innerDate, Unit.minutes)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.minutes, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.minutes}`);\r\n containerClone.innerText = innerDate.minutesFormatted;\r\n innerDate.manipulate(step, Unit.minutes);\r\n });\r\n }\r\n }\n\n /**\r\n * Creates and updates the grid for `seconds`\r\n */\r\n class secondDisplay {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n }\r\n /**\r\n * Build the container html for the display\r\n * @private\r\n */\r\n getPicker() {\r\n const container = document.createElement('div');\r\n container.classList.add(Namespace.css.secondContainer);\r\n for (let i = 0; i < 12; i++) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.selectSecond);\r\n container.appendChild(div);\r\n }\r\n return container;\r\n }\r\n /**\r\n * Populates the grid and updates enabled states\r\n * @private\r\n */\r\n _update(widget, paint) {\r\n const container = widget.getElementsByClassName(Namespace.css.secondContainer)[0];\r\n const innerDate = this.optionsStore.viewDate.clone.startOf(Unit.minutes);\r\n container\r\n .querySelectorAll(`[data-action=\"${ActionTypes$1.selectSecond}\"]`)\r\n .forEach((containerClone) => {\r\n const classes = [];\r\n classes.push(Namespace.css.second);\r\n if (!this.validation.isValid(innerDate, Unit.seconds)) {\r\n classes.push(Namespace.css.disabled);\r\n }\r\n paint(Unit.seconds, innerDate, classes, containerClone);\r\n containerClone.classList.remove(...containerClone.classList);\r\n containerClone.classList.add(...classes);\r\n containerClone.setAttribute('data-value', `${innerDate.seconds}`);\r\n containerClone.innerText = innerDate.secondsFormatted;\r\n innerDate.manipulate(5, Unit.seconds);\r\n });\r\n }\r\n }\n\n /**\r\n * Provides a collapse functionality to the view changes\r\n */\r\n class Collapse {\r\n /**\r\n * Flips the show/hide state of `target`\r\n * @param target html element to affect.\r\n */\r\n static toggle(target) {\r\n if (target.classList.contains(Namespace.css.show)) {\r\n this.hide(target);\r\n }\r\n else {\r\n this.show(target);\r\n }\r\n }\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to show.\r\n * @param target\r\n */\r\n static showImmediately(target) {\r\n target.classList.remove(Namespace.css.collapsing);\r\n target.classList.add(Namespace.css.collapse, Namespace.css.show);\r\n target.style.height = '';\r\n }\r\n /**\r\n * If `target` is not already showing, then show after the animation.\r\n * @param target\r\n */\r\n static show(target) {\r\n if (target.classList.contains(Namespace.css.collapsing) ||\r\n target.classList.contains(Namespace.css.show))\r\n return;\r\n const complete = () => {\r\n Collapse.showImmediately(target);\r\n };\r\n target.style.height = '0';\r\n target.classList.remove(Namespace.css.collapse);\r\n target.classList.add(Namespace.css.collapsing);\r\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n setTimeout(complete, this.getTransitionDurationFromElement(target));\r\n target.style.height = `${target.scrollHeight}px`;\r\n }\r\n /**\r\n * Skips any animation or timeouts and immediately set the element to hide.\r\n * @param target\r\n */\r\n static hideImmediately(target) {\r\n if (!target)\r\n return;\r\n target.classList.remove(Namespace.css.collapsing, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapse);\r\n }\r\n /**\r\n * If `target` is not already hidden, then hide after the animation.\r\n * @param target HTML Element\r\n */\r\n static hide(target) {\r\n if (target.classList.contains(Namespace.css.collapsing) ||\r\n !target.classList.contains(Namespace.css.show))\r\n return;\r\n const complete = () => {\r\n Collapse.hideImmediately(target);\r\n };\r\n target.style.height = `${target.getBoundingClientRect()['height']}px`;\r\n const reflow = (element) => element.offsetHeight;\r\n reflow(target);\r\n target.classList.remove(Namespace.css.collapse, Namespace.css.show);\r\n target.classList.add(Namespace.css.collapsing);\r\n target.style.height = '';\r\n //eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n setTimeout(complete, this.getTransitionDurationFromElement(target));\r\n }\r\n }\r\n /**\r\n * Gets the transition duration from the `element` by getting css properties\r\n * `transition-duration` and `transition-delay`\r\n * @param element HTML Element\r\n */\r\n Collapse.getTransitionDurationFromElement = (element) => {\r\n if (!element) {\r\n return 0;\r\n }\r\n // Get transition-duration of the element\r\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element);\r\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\r\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\r\n // Return 0 if element or transition duration is not found\r\n if (!floatTransitionDuration && !floatTransitionDelay) {\r\n return 0;\r\n }\r\n // If multiple durations are defined, take the first\r\n transitionDuration = transitionDuration.split(',')[0];\r\n transitionDelay = transitionDelay.split(',')[0];\r\n return ((Number.parseFloat(transitionDuration) +\r\n Number.parseFloat(transitionDelay)) *\r\n 1000);\r\n };\n\n /**\r\n * Main class for all things display related.\r\n */\r\n class Display {\r\n constructor() {\r\n this._isVisible = false;\r\n /**\r\n * A document click event to hide the widget if click is outside\r\n * @private\r\n * @param e MouseEvent\r\n */\r\n this._documentClickEvent = (e) => {\r\n if (this.optionsStore.options.debug || window.debug)\r\n return; //eslint-disable-line @typescript-eslint/no-explicit-any\r\n if (this._isVisible &&\r\n !e.composedPath().includes(this.widget) && // click inside the widget\r\n !e.composedPath()?.includes(this.optionsStore.element) // click on the element\r\n ) {\r\n this.hide();\r\n }\r\n };\r\n /**\r\n * Click event for any action like selecting a date\r\n * @param e MouseEvent\r\n * @private\r\n */\r\n this._actionsClickEvent = (e) => {\r\n this._eventEmitters.action.emit({ e: e });\r\n };\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.dateDisplay = serviceLocator.locate(DateDisplay);\r\n this.monthDisplay = serviceLocator.locate(MonthDisplay);\r\n this.yearDisplay = serviceLocator.locate(YearDisplay);\r\n this.decadeDisplay = serviceLocator.locate(DecadeDisplay);\r\n this.timeDisplay = serviceLocator.locate(TimeDisplay);\r\n this.hourDisplay = serviceLocator.locate(HourDisplay);\r\n this.minuteDisplay = serviceLocator.locate(MinuteDisplay);\r\n this.secondDisplay = serviceLocator.locate(secondDisplay);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._widget = undefined;\r\n this._eventEmitters.updateDisplay.subscribe((result) => {\r\n this._update(result);\r\n });\r\n }\r\n /**\r\n * Returns the widget body or undefined\r\n * @private\r\n */\r\n get widget() {\r\n return this._widget;\r\n }\r\n get dateContainer() {\r\n return this.widget?.querySelector(`div.${Namespace.css.dateContainer}`);\r\n }\r\n get timeContainer() {\r\n return this.widget?.querySelector(`div.${Namespace.css.timeContainer}`);\r\n }\r\n /**\r\n * Returns this visible state of the picker (shown)\r\n */\r\n get isVisible() {\r\n return this._isVisible;\r\n }\r\n /**\r\n * Updates the table for a particular unit. Used when an option as changed or\r\n * whenever the class list might need to be refreshed.\r\n * @param unit\r\n * @private\r\n */\r\n _update(unit) {\r\n if (!this.widget)\r\n return;\r\n switch (unit) {\r\n case Unit.seconds:\r\n this.secondDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.minutes:\r\n this.minuteDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.hours:\r\n this.hourDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.date:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.month:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Unit.year:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'decade':\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case 'clock':\r\n if (!this._hasTime)\r\n break;\r\n this.timeDisplay._update(this.widget);\r\n this._update(Unit.hours);\r\n this._update(Unit.minutes);\r\n this._update(Unit.seconds);\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n this._update(Unit.year);\r\n this._update(Unit.month);\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n this._updateCalendarHeader();\r\n break;\r\n case 'all':\r\n if (this._hasTime) {\r\n this._update('clock');\r\n }\r\n if (this._hasDate) {\r\n this._update('calendar');\r\n }\r\n }\r\n }\r\n // noinspection JSUnusedLocalSymbols\r\n /**\r\n * Allows developers to add/remove classes from an element.\r\n * @param _unit\r\n * @param _date\r\n * @param _classes\r\n * @param _element\r\n */\r\n /* eslint-disable @typescript-eslint/no-unused-vars */\r\n paint(_unit, _date, _classes, _element) {\r\n // implemented in plugin\r\n }\r\n /**\r\n * Shows the picker and creates a Popper instance if needed.\r\n * Add document click event to hide when clicking outside the picker.\r\n * fires Events#show\r\n */\r\n show() {\r\n if (this.widget == undefined) {\r\n this._showSetDefaultIfNeeded();\r\n this._buildWidget();\r\n this._updateTheme();\r\n this._showSetupViewMode();\r\n if (!this.optionsStore.options.display.inline) {\r\n // If needed to change the parent container\r\n const container = this.optionsStore.options?.container || document.body;\r\n const placement = this.optionsStore.options?.display?.placement || 'bottom';\r\n container.appendChild(this.widget);\r\n this.createPopup(this.optionsStore.element, this.widget, {\r\n modifiers: [{ name: 'eventListeners', enabled: true }],\r\n //#2400\r\n placement: document.documentElement.dir === 'rtl'\r\n ? `${placement}-end`\r\n : `${placement}-start`,\r\n }).then();\r\n }\r\n else {\r\n this.optionsStore.element.appendChild(this.widget);\r\n }\r\n if (this.optionsStore.options.display.viewMode == 'clock') {\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes$1.showClock,\r\n });\r\n }\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) => element.addEventListener('click', this._actionsClickEvent));\r\n // show the clock when using sideBySide\r\n if (this._hasTime && this.optionsStore.options.display.sideBySide) {\r\n this.timeDisplay._update(this.widget);\r\n this.widget.getElementsByClassName(Namespace.css.clockContainer)[0].style.display = 'grid';\r\n }\r\n }\r\n this.widget.classList.add(Namespace.css.show);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.updatePopup();\r\n document.addEventListener('click', this._documentClickEvent);\r\n }\r\n this._eventEmitters.triggerEvent.emit({ type: Namespace.events.show });\r\n this._isVisible = true;\r\n }\r\n _showSetupViewMode() {\r\n // If modeView is only clock\r\n const onlyClock = this._hasTime && !this._hasDate;\r\n // reset the view to the clock if there's no date components\r\n if (onlyClock) {\r\n this.optionsStore.currentView = 'clock';\r\n this._eventEmitters.action.emit({\r\n e: null,\r\n action: ActionTypes$1.showClock,\r\n });\r\n }\r\n // otherwise return to the calendar view\r\n else if (!this.optionsStore.currentCalendarViewMode) {\r\n this.optionsStore.currentCalendarViewMode =\r\n this.optionsStore.minimumCalendarViewMode;\r\n }\r\n if (!onlyClock && this.optionsStore.options.display.viewMode !== 'clock') {\r\n if (this._hasTime) {\r\n if (!this.optionsStore.options.display.sideBySide) {\r\n Collapse.hideImmediately(this.timeContainer);\r\n }\r\n else {\r\n Collapse.show(this.timeContainer);\r\n }\r\n }\r\n Collapse.show(this.dateContainer);\r\n }\r\n if (this._hasDate) {\r\n this._showMode();\r\n }\r\n }\r\n _showSetDefaultIfNeeded() {\r\n if (this.dates.picked.length != 0)\r\n return;\r\n if (this.optionsStore.options.useCurrent &&\r\n !this.optionsStore.options.defaultDate) {\r\n const date = new DateTime().setLocalization(this.optionsStore.options.localization);\r\n if (!this.optionsStore.options.keepInvalid) {\r\n let tries = 0;\r\n let direction = 1;\r\n if (this.optionsStore.options.restrictions.maxDate?.isBefore(date)) {\r\n direction = -1;\r\n }\r\n while (!this.validation.isValid(date) && tries > 31) {\r\n date.manipulate(direction, Unit.date);\r\n tries++;\r\n }\r\n }\r\n this.dates.setValue(date);\r\n }\r\n if (this.optionsStore.options.defaultDate) {\r\n this.dates.setValue(this.optionsStore.options.defaultDate);\r\n }\r\n }\r\n async createPopup(element, widget, \r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n options) {\r\n let createPopperFunction;\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (window?.Popper) {\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n createPopperFunction = window?.Popper?.createPopper;\r\n }\r\n else {\r\n const { createPopper } = await import('@popperjs/core');\r\n createPopperFunction = createPopper;\r\n }\r\n if (createPopperFunction) {\r\n this._popperInstance = createPopperFunction(element, widget, options);\r\n }\r\n }\r\n updatePopup() {\r\n this._popperInstance?.update();\r\n }\r\n /**\r\n * Changes the calendar view mode. E.g. month <-> year\r\n * @param direction -/+ number to move currentViewMode\r\n * @private\r\n */\r\n _showMode(direction) {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (direction) {\r\n const max = Math.max(this.optionsStore.minimumCalendarViewMode, Math.min(3, this.optionsStore.currentCalendarViewMode + direction));\r\n if (this.optionsStore.currentCalendarViewMode == max)\r\n return;\r\n this.optionsStore.currentCalendarViewMode = max;\r\n }\r\n this.widget\r\n .querySelectorAll(`.${Namespace.css.dateContainer} > div:not(.${Namespace.css.calendarHeader}), .${Namespace.css.timeContainer} > div:not(.${Namespace.css.clockContainer})`)\r\n .forEach((e) => (e.style.display = 'none'));\r\n const datePickerMode = CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n const picker = this.widget.querySelector(`.${datePickerMode.className}`);\r\n switch (datePickerMode.className) {\r\n case Namespace.css.decadesContainer:\r\n this.decadeDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n this.yearDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n this.monthDisplay._update(this.widget, this.paint);\r\n break;\r\n case Namespace.css.daysContainer:\r\n this.dateDisplay._update(this.widget, this.paint);\r\n break;\r\n }\r\n picker.style.display = 'grid';\r\n if (this.optionsStore.options.display.sideBySide)\r\n (this.widget.querySelectorAll(`.${Namespace.css.clockContainer}`)[0]).style.display = 'grid';\r\n this._updateCalendarHeader();\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n /**\r\n * Changes the theme. E.g. light, dark or auto\r\n * @param theme the theme name\r\n * @private\r\n */\r\n _updateTheme(theme) {\r\n if (!this.widget) {\r\n return;\r\n }\r\n if (theme) {\r\n if (this.optionsStore.options.display.theme === theme)\r\n return;\r\n this.optionsStore.options.display.theme = theme;\r\n }\r\n this.widget.classList.remove('light', 'dark');\r\n this.widget.classList.add(this._getThemeClass());\r\n if (this.optionsStore.options.display.theme === 'auto') {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .addEventListener('change', () => this._updateTheme());\r\n }\r\n else {\r\n window\r\n .matchMedia(Namespace.css.isDarkPreferredQuery)\r\n .removeEventListener('change', () => this._updateTheme());\r\n }\r\n }\r\n _getThemeClass() {\r\n const currentTheme = this.optionsStore.options.display.theme || 'auto';\r\n const isDarkMode = window.matchMedia &&\r\n window.matchMedia(Namespace.css.isDarkPreferredQuery).matches;\r\n switch (currentTheme) {\r\n case 'light':\r\n return Namespace.css.lightTheme;\r\n case 'dark':\r\n return Namespace.css.darkTheme;\r\n case 'auto':\r\n return isDarkMode ? Namespace.css.darkTheme : Namespace.css.lightTheme;\r\n }\r\n }\r\n _updateCalendarHeader() {\r\n if (!this._hasDate)\r\n return;\r\n const showing = [\r\n ...this.widget.querySelector(`.${Namespace.css.dateContainer} div[style*=\"display: grid\"]`).classList,\r\n ].find((x) => x.startsWith(Namespace.css.dateContainer));\r\n const [previous, switcher, next] = this.widget\r\n .getElementsByClassName(Namespace.css.calendarHeader)[0]\r\n .getElementsByTagName('div');\r\n switch (showing) {\r\n case Namespace.css.decadesContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousCentury);\r\n switcher.setAttribute('title', '');\r\n next.setAttribute('title', this.optionsStore.options.localization.nextCentury);\r\n break;\r\n case Namespace.css.yearsContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousDecade);\r\n switcher.setAttribute('title', this.optionsStore.options.localization.selectDecade);\r\n next.setAttribute('title', this.optionsStore.options.localization.nextDecade);\r\n break;\r\n case Namespace.css.monthsContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousYear);\r\n switcher.setAttribute('title', this.optionsStore.options.localization.selectYear);\r\n next.setAttribute('title', this.optionsStore.options.localization.nextYear);\r\n break;\r\n case Namespace.css.daysContainer:\r\n previous.setAttribute('title', this.optionsStore.options.localization.previousMonth);\r\n switcher.setAttribute('title', this.optionsStore.options.localization.selectMonth);\r\n next.setAttribute('title', this.optionsStore.options.localization.nextMonth);\r\n switcher.setAttribute(showing, this.optionsStore.viewDate.format(this.optionsStore.options.localization.dayViewHeaderFormat));\r\n break;\r\n }\r\n switcher.innerText = switcher.getAttribute(showing);\r\n }\r\n /**\r\n * Hides the picker if needed.\r\n * Remove document click event to hide when clicking outside the picker.\r\n * fires Events#hide\r\n */\r\n hide() {\r\n if (!this.widget || !this._isVisible)\r\n return;\r\n this.widget.classList.remove(Namespace.css.show);\r\n if (this._isVisible) {\r\n this._eventEmitters.triggerEvent.emit({\r\n type: Namespace.events.hide,\r\n date: this.optionsStore.unset ? null : this.dates.lastPicked?.clone,\r\n });\r\n this._isVisible = false;\r\n }\r\n document.removeEventListener('click', this._documentClickEvent);\r\n }\r\n /**\r\n * Toggles the picker's open state. Fires a show/hide event depending.\r\n */\r\n toggle() {\r\n return this._isVisible ? this.hide() : this.show();\r\n }\r\n /**\r\n * Removes document and data-action click listener and reset the widget\r\n * @private\r\n */\r\n _dispose() {\r\n document.removeEventListener('click', this._documentClickEvent);\r\n if (!this.widget)\r\n return;\r\n this.widget\r\n .querySelectorAll('[data-action]')\r\n .forEach((element) => element.removeEventListener('click', this._actionsClickEvent));\r\n this.widget.parentNode.removeChild(this.widget);\r\n this._widget = undefined;\r\n }\r\n /**\r\n * Builds the widgets html template.\r\n * @private\r\n */\r\n _buildWidget() {\r\n const template = document.createElement('div');\r\n template.classList.add(Namespace.css.widget);\r\n const dateView = document.createElement('div');\r\n dateView.classList.add(Namespace.css.dateContainer);\r\n dateView.append(this.getHeadTemplate(), this.decadeDisplay.getPicker(), this.yearDisplay.getPicker(), this.monthDisplay.getPicker(), this.dateDisplay.getPicker());\r\n const timeView = document.createElement('div');\r\n timeView.classList.add(Namespace.css.timeContainer);\r\n timeView.appendChild(this.timeDisplay.getPicker(this._iconTag.bind(this)));\r\n timeView.appendChild(this.hourDisplay.getPicker());\r\n timeView.appendChild(this.minuteDisplay.getPicker());\r\n timeView.appendChild(this.secondDisplay.getPicker());\r\n const toolbar = document.createElement('div');\r\n toolbar.classList.add(Namespace.css.toolbar);\r\n toolbar.append(...this.getToolbarElements());\r\n if (this.optionsStore.options.display.inline) {\r\n template.classList.add(Namespace.css.inline);\r\n }\r\n if (this.optionsStore.options.display.calendarWeeks) {\r\n template.classList.add('calendarWeeks');\r\n }\r\n if (this.optionsStore.options.display.sideBySide && this._hasDateAndTime) {\r\n this._buildWidgetSideBySide(template, dateView, timeView, toolbar);\r\n return;\r\n }\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const setupComponentView = (hasFirst, hasSecond, element, shouldShow) => {\r\n if (!hasFirst)\r\n return;\r\n if (hasSecond) {\r\n element.classList.add(Namespace.css.collapse);\r\n if (shouldShow)\r\n element.classList.add(Namespace.css.show);\r\n }\r\n template.appendChild(element);\r\n };\r\n setupComponentView(this._hasDate, this._hasTime, dateView, this.optionsStore.options.display.viewMode !== 'clock');\r\n setupComponentView(this._hasTime, this._hasDate, timeView, this.optionsStore.options.display.viewMode === 'clock');\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n const arrow = document.createElement('div');\r\n arrow.classList.add('arrow');\r\n arrow.setAttribute('data-popper-arrow', '');\r\n template.appendChild(arrow);\r\n this._widget = template;\r\n }\r\n _buildWidgetSideBySide(template, dateView, timeView, toolbar) {\r\n template.classList.add(Namespace.css.sideBySide);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'top') {\r\n template.appendChild(toolbar);\r\n }\r\n const row = document.createElement('div');\r\n row.classList.add('td-row');\r\n dateView.classList.add('td-half');\r\n timeView.classList.add('td-half');\r\n row.appendChild(dateView);\r\n row.appendChild(timeView);\r\n template.appendChild(row);\r\n if (this.optionsStore.options.display.toolbarPlacement === 'bottom') {\r\n template.appendChild(toolbar);\r\n }\r\n this._widget = template;\r\n }\r\n /**\r\n * Returns true if the hours, minutes, or seconds component is turned on\r\n */\r\n get _hasTime() {\r\n return (this.optionsStore.options.display.components.clock &&\r\n (this.optionsStore.options.display.components.hours ||\r\n this.optionsStore.options.display.components.minutes ||\r\n this.optionsStore.options.display.components.seconds));\r\n }\r\n /**\r\n * Returns true if the year, month, or date component is turned on\r\n */\r\n get _hasDate() {\r\n return (this.optionsStore.options.display.components.calendar &&\r\n (this.optionsStore.options.display.components.year ||\r\n this.optionsStore.options.display.components.month ||\r\n this.optionsStore.options.display.components.date));\r\n }\r\n get _hasDateAndTime() {\r\n return this._hasDate && this._hasTime;\r\n }\r\n /**\r\n * Get the toolbar html based on options like buttons => today\r\n * @private\r\n */\r\n getToolbarElements() {\r\n const toolbar = [];\r\n if (this.optionsStore.options.display.buttons.today) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.today);\r\n div.setAttribute('title', this.optionsStore.options.localization.today);\r\n div.appendChild(this._iconTag(this.optionsStore.options.display.icons.today));\r\n toolbar.push(div);\r\n }\r\n if (!this.optionsStore.options.display.sideBySide &&\r\n this._hasDate &&\r\n this._hasTime) {\r\n let title, icon;\r\n if (this.optionsStore.options.display.viewMode === 'clock') {\r\n title = this.optionsStore.options.localization.selectDate;\r\n icon = this.optionsStore.options.display.icons.date;\r\n }\r\n else {\r\n title = this.optionsStore.options.localization.selectTime;\r\n icon = this.optionsStore.options.display.icons.time;\r\n }\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.togglePicker);\r\n div.setAttribute('title', title);\r\n div.appendChild(this._iconTag(icon));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.clear) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.clear);\r\n div.setAttribute('title', this.optionsStore.options.localization.clear);\r\n div.appendChild(this._iconTag(this.optionsStore.options.display.icons.clear));\r\n toolbar.push(div);\r\n }\r\n if (this.optionsStore.options.display.buttons.close) {\r\n const div = document.createElement('div');\r\n div.setAttribute('data-action', ActionTypes$1.close);\r\n div.setAttribute('title', this.optionsStore.options.localization.close);\r\n div.appendChild(this._iconTag(this.optionsStore.options.display.icons.close));\r\n toolbar.push(div);\r\n }\r\n return toolbar;\r\n }\r\n /***\r\n * Builds the base header template with next and previous icons\r\n * @private\r\n */\r\n getHeadTemplate() {\r\n const calendarHeader = document.createElement('div');\r\n calendarHeader.classList.add(Namespace.css.calendarHeader);\r\n const previous = document.createElement('div');\r\n previous.classList.add(Namespace.css.previous);\r\n previous.setAttribute('data-action', ActionTypes$1.previous);\r\n previous.appendChild(this._iconTag(this.optionsStore.options.display.icons[document.documentElement.dir === 'rtl' ? 'next' : 'previous']) //***\r\n );\r\n const switcher = document.createElement('div');\r\n switcher.classList.add(Namespace.css.switch);\r\n switcher.setAttribute('data-action', ActionTypes$1.changeCalendarView);\r\n const next = document.createElement('div');\r\n next.classList.add(Namespace.css.next);\r\n next.setAttribute('data-action', ActionTypes$1.next);\r\n next.appendChild(this._iconTag(this.optionsStore.options.display.icons[document.documentElement.dir === 'rtl' ? 'previous' : 'next']) //***\r\n );\r\n calendarHeader.append(previous, switcher, next);\r\n return calendarHeader;\r\n }\r\n /**\r\n * Builds an icon tag as either an ``\r\n * or with icons => type is `sprites` then a svg tag instead\r\n * @param iconClass\r\n * @private\r\n */\r\n _iconTag(iconClass) {\r\n if (this.optionsStore.options.display.icons.type === 'sprites') {\r\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n const icon = document.createElementNS('http://www.w3.org/2000/svg', 'use');\r\n icon.setAttribute('xlink:href', iconClass); // Deprecated. Included for backward compatibility\r\n icon.setAttribute('href', iconClass);\r\n svg.appendChild(icon);\r\n return svg;\r\n }\r\n const icon = document.createElement('i');\r\n icon.classList.add(...iconClass.split(' '));\r\n return icon;\r\n }\r\n /**\r\n * Causes the widget to get rebuilt on next show. If the picker is already open\r\n * then hide and reshow it.\r\n * @private\r\n */\r\n _rebuild() {\r\n const wasVisible = this._isVisible;\r\n this._dispose();\r\n if (wasVisible)\r\n this.show();\r\n }\r\n refreshCurrentView() {\r\n //if the widget is not showing, just destroy it\r\n if (!this._isVisible)\r\n this._dispose();\r\n switch (this.optionsStore.currentView) {\r\n case 'clock':\r\n this._update('clock');\r\n break;\r\n case 'calendar':\r\n this._update(Unit.date);\r\n break;\r\n case 'months':\r\n this._update(Unit.month);\r\n break;\r\n case 'years':\r\n this._update(Unit.year);\r\n break;\r\n case 'decades':\r\n this._update('decade');\r\n break;\r\n }\r\n }\r\n }\n\n /**\r\n * Logic for various click actions\r\n */\r\n class Actions {\r\n constructor() {\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.validation = serviceLocator.locate(Validation);\r\n this.display = serviceLocator.locate(Display);\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this._eventEmitters.action.subscribe((result) => {\r\n this.do(result.e, result.action);\r\n });\r\n }\r\n /**\r\n * Performs the selected `action`. See ActionTypes\r\n * @param e This is normally a click event\r\n * @param action If not provided, then look for a [data-action]\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n do(e, action) {\r\n const currentTarget = e?.currentTarget;\r\n if (currentTarget?.classList?.contains(Namespace.css.disabled))\r\n return;\r\n action = action || currentTarget?.dataset?.action;\r\n const lastPicked = (this.dates.lastPicked || this.optionsStore.viewDate)\r\n .clone;\r\n switch (action) {\r\n case ActionTypes$1.next:\r\n case ActionTypes$1.previous:\r\n this.handleNextPrevious(action);\r\n break;\r\n case ActionTypes$1.changeCalendarView:\r\n this.display._showMode(1);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes$1.selectMonth:\r\n case ActionTypes$1.selectYear:\r\n case ActionTypes$1.selectDecade:\r\n this.handleSelectCalendarMode(action, currentTarget);\r\n break;\r\n case ActionTypes$1.selectDay:\r\n this.handleSelectDay(currentTarget);\r\n break;\r\n case ActionTypes$1.selectHour: {\r\n let hour = +currentTarget.dataset.value;\r\n if (lastPicked.hours >= 12 && this.optionsStore.isTwelveHour)\r\n hour += 12;\r\n lastPicked.hours = hour;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n }\r\n case ActionTypes$1.selectMinute: {\r\n lastPicked.minutes = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n }\r\n case ActionTypes$1.selectSecond: {\r\n lastPicked.seconds = +currentTarget.dataset.value;\r\n this.dates.setValue(lastPicked, this.dates.lastPickedIndex);\r\n this.hideOrClock(e);\r\n break;\r\n }\r\n case ActionTypes$1.incrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours);\r\n break;\r\n case ActionTypes$1.incrementMinutes:\r\n this.manipulateAndSet(lastPicked, Unit.minutes, this.optionsStore.options.stepping);\r\n break;\r\n case ActionTypes$1.incrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds);\r\n break;\r\n case ActionTypes$1.decrementHours:\r\n this.manipulateAndSet(lastPicked, Unit.hours, -1);\r\n break;\r\n case ActionTypes$1.decrementMinutes:\r\n this.manipulateAndSet(lastPicked, Unit.minutes, this.optionsStore.options.stepping * -1);\r\n break;\r\n case ActionTypes$1.decrementSeconds:\r\n this.manipulateAndSet(lastPicked, Unit.seconds, -1);\r\n break;\r\n case ActionTypes$1.toggleMeridiem:\r\n this.manipulateAndSet(lastPicked, Unit.hours, this.dates.lastPicked.hours >= 12 ? -12 : 12);\r\n break;\r\n case ActionTypes$1.togglePicker:\r\n this.handleToggle(currentTarget);\r\n break;\r\n case ActionTypes$1.showClock:\r\n case ActionTypes$1.showHours:\r\n case ActionTypes$1.showMinutes:\r\n case ActionTypes$1.showSeconds:\r\n //make sure the clock is actually displaying\r\n if (!this.optionsStore.options.display.sideBySide &&\r\n this.optionsStore.currentView !== 'clock') {\r\n //hide calendar\r\n Collapse.hideImmediately(this.display.dateContainer);\r\n //show clock\r\n Collapse.showImmediately(this.display.timeContainer);\r\n }\r\n this.handleShowClockContainers(action);\r\n break;\r\n case ActionTypes$1.clear:\r\n this.dates.setValue(null);\r\n this.display._updateCalendarHeader();\r\n break;\r\n case ActionTypes$1.close:\r\n this.display.hide();\r\n break;\r\n case ActionTypes$1.today: {\r\n const day = new DateTime().setLocalization(this.optionsStore.options.localization);\r\n this._eventEmitters.updateViewDate.emit(day);\r\n if (!this.validation.isValid(day, Unit.date))\r\n break;\r\n if (this.optionsStore.options.dateRange)\r\n this.handleDateRange(day);\r\n else if (this.optionsStore.options.multipleDates) {\r\n this.handleMultiDate(day);\r\n }\r\n else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n handleShowClockContainers(action) {\r\n if (!this.display._hasTime) {\r\n Namespace.errorMessages.throwError('Cannot show clock containers when time is disabled.');\r\n /* ignore coverage: should never happen */\r\n return;\r\n }\r\n this.optionsStore.currentView = 'clock';\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.timeContainer} > div`)\r\n .forEach((htmlElement) => (htmlElement.style.display = 'none'));\r\n let classToUse = '';\r\n switch (action) {\r\n case ActionTypes$1.showClock:\r\n classToUse = Namespace.css.clockContainer;\r\n this.display._update('clock');\r\n break;\r\n case ActionTypes$1.showHours:\r\n classToUse = Namespace.css.hourContainer;\r\n this.display._update(Unit.hours);\r\n break;\r\n case ActionTypes$1.showMinutes:\r\n classToUse = Namespace.css.minuteContainer;\r\n this.display._update(Unit.minutes);\r\n break;\r\n case ActionTypes$1.showSeconds:\r\n classToUse = Namespace.css.secondContainer;\r\n this.display._update(Unit.seconds);\r\n break;\r\n }\r\n (this.display.widget.getElementsByClassName(classToUse)[0]).style.display = 'grid';\r\n }\r\n handleNextPrevious(action) {\r\n const { unit, step } = CalendarModes[this.optionsStore.currentCalendarViewMode];\r\n if (action === ActionTypes$1.next)\r\n this.optionsStore.viewDate.manipulate(step, unit);\r\n else\r\n this.optionsStore.viewDate.manipulate(step * -1, unit);\r\n this._eventEmitters.viewUpdate.emit();\r\n this.display._showMode();\r\n }\r\n /**\r\n * After setting the value it will either show the clock or hide the widget.\r\n * @param e\r\n */\r\n hideOrClock(e) {\r\n if (!this.optionsStore.isTwelveHour &&\r\n !this.optionsStore.options.display.components.minutes &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n else {\r\n this.do(e, ActionTypes$1.showClock);\r\n }\r\n }\r\n /**\r\n * Common function to manipulate {@link lastPicked} by `unit`.\r\n * @param lastPicked\r\n * @param unit\r\n * @param value Value to change by\r\n */\r\n manipulateAndSet(lastPicked, unit, value = 1) {\r\n const newDate = lastPicked.manipulate(value, unit);\r\n if (this.validation.isValid(newDate, unit)) {\r\n this.dates.setValue(newDate, this.dates.lastPickedIndex);\r\n }\r\n }\r\n handleSelectCalendarMode(action, currentTarget) {\r\n const value = +currentTarget.dataset.value;\r\n switch (action) {\r\n case ActionTypes$1.selectMonth:\r\n this.optionsStore.viewDate.month = value;\r\n break;\r\n case ActionTypes$1.selectYear:\r\n case ActionTypes$1.selectDecade:\r\n this.optionsStore.viewDate.year = value;\r\n break;\r\n }\r\n if (this.optionsStore.currentCalendarViewMode ===\r\n this.optionsStore.minimumCalendarViewMode) {\r\n this.dates.setValue(this.optionsStore.viewDate, this.dates.lastPickedIndex);\r\n if (!this.optionsStore.options.display.inline) {\r\n this.display.hide();\r\n }\r\n }\r\n else {\r\n this.display._showMode(-1);\r\n }\r\n }\r\n handleToggle(currentTarget) {\r\n if (currentTarget.getAttribute('title') ===\r\n this.optionsStore.options.localization.selectDate) {\r\n currentTarget.setAttribute('title', this.optionsStore.options.localization.selectTime);\r\n currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.time).outerHTML;\r\n this.display._updateCalendarHeader();\r\n this.optionsStore.refreshCurrentView();\r\n }\r\n else {\r\n currentTarget.setAttribute('title', this.optionsStore.options.localization.selectDate);\r\n currentTarget.innerHTML = this.display._iconTag(this.optionsStore.options.display.icons.date).outerHTML;\r\n if (this.display._hasTime) {\r\n this.handleShowClockContainers(ActionTypes$1.showClock);\r\n this.display._update('clock');\r\n }\r\n }\r\n this.display.widget\r\n .querySelectorAll(`.${Namespace.css.dateContainer}, .${Namespace.css.timeContainer}`)\r\n .forEach((htmlElement) => Collapse.toggle(htmlElement));\r\n this._eventEmitters.viewUpdate.emit();\r\n }\r\n handleSelectDay(currentTarget) {\r\n const day = this.optionsStore.viewDate.clone;\r\n if (currentTarget.classList.contains(Namespace.css.old)) {\r\n day.manipulate(-1, Unit.month);\r\n }\r\n if (currentTarget.classList.contains(Namespace.css.new)) {\r\n day.manipulate(1, Unit.month);\r\n }\r\n day.date = +currentTarget.dataset.day;\r\n if (this.optionsStore.options.dateRange)\r\n this.handleDateRange(day);\r\n else if (this.optionsStore.options.multipleDates) {\r\n this.handleMultiDate(day);\r\n }\r\n else {\r\n this.dates.setValue(day, this.dates.lastPickedIndex);\r\n }\r\n if (!this.display._hasTime &&\r\n !this.optionsStore.options.display.keepOpen &&\r\n !this.optionsStore.options.display.inline &&\r\n !this.optionsStore.options.multipleDates &&\r\n !this.optionsStore.options.dateRange) {\r\n this.display.hide();\r\n }\r\n }\r\n handleMultiDate(day) {\r\n let index = this.dates.pickedIndex(day, Unit.date);\r\n if (index !== -1) {\r\n this.dates.setValue(null, index); //deselect multi-date\r\n }\r\n else {\r\n index = this.dates.lastPickedIndex + 1;\r\n if (this.dates.picked.length === 0)\r\n index = 0;\r\n this.dates.setValue(day, index);\r\n }\r\n }\r\n handleDateRange(day) {\r\n switch (this.dates.picked.length) {\r\n case 2: {\r\n this.dates.clear();\r\n break;\r\n }\r\n case 1: {\r\n const other = this.dates.picked[0];\r\n if (day.getTime() === other.getTime()) {\r\n this.dates.clear();\r\n break;\r\n }\r\n if (day.isBefore(other)) {\r\n this.dates.setValue(day, 0);\r\n this.dates.setValue(other, 1);\r\n return;\r\n }\r\n else {\r\n this.dates.setValue(day, 1);\r\n return;\r\n }\r\n }\r\n }\r\n this.dates.setValue(day, 0);\r\n }\r\n }\n\n /**\r\n * A robust and powerful date/time picker component.\r\n */\r\n class TempusDominus {\r\n constructor(element, options = {}) {\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this._subscribers = {};\r\n this._isDisabled = false;\r\n /**\r\n * Event for when the input field changes. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n this._inputChangeEvent = (event) => {\r\n const internallyTriggered = event?.detail;\r\n if (internallyTriggered)\r\n return;\r\n const setViewDate = () => {\r\n if (this.dates.lastPicked)\r\n this.optionsStore.viewDate = this.dates.lastPicked.clone;\r\n };\r\n const value = this.optionsStore.input.value;\r\n if (this.optionsStore.options.multipleDates ||\r\n this.optionsStore.options.dateRange) {\r\n try {\r\n const valueSplit = value.split(this.optionsStore.options.multipleDatesSeparator);\r\n for (let i = 0; i < valueSplit.length; i++) {\r\n this.dates.setFromInput(valueSplit[i], i);\r\n }\r\n setViewDate();\r\n }\r\n catch {\r\n console.warn('TD: Something went wrong trying to set the multipleDates values from the input field.');\r\n }\r\n }\r\n else {\r\n this.dates.setFromInput(value, 0);\r\n setViewDate();\r\n }\r\n };\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n this._toggleClickEvent = () => {\r\n if (this.optionsStore.element?.disabled ||\r\n this.optionsStore.input?.disabled ||\r\n //if we just have the input and allow input toggle is enabled, then don't cause a toggle\r\n (this._toggle.nodeName === 'INPUT' &&\r\n this._toggle?.type === 'text' &&\r\n this.optionsStore.options.allowInputToggle))\r\n return;\r\n this.toggle();\r\n };\r\n /**\r\n * Event for when the toggle is clicked. This is a class level method so there's\r\n * something for the remove listener function.\r\n * @private\r\n */\r\n this._openClickEvent = () => {\r\n if (this.optionsStore.element?.disabled ||\r\n this.optionsStore.input?.disabled)\r\n return;\r\n if (!this.display.isVisible)\r\n this.show();\r\n };\r\n setupServiceLocator();\r\n this._eventEmitters = serviceLocator.locate(EventEmitters);\r\n this.optionsStore = serviceLocator.locate(OptionsStore);\r\n this.display = serviceLocator.locate(Display);\r\n this.dates = serviceLocator.locate(Dates);\r\n this.actions = serviceLocator.locate(Actions);\r\n if (!element) {\r\n Namespace.errorMessages.mustProvideElement();\r\n }\r\n this.optionsStore.element = element;\r\n this._initializeOptions(options, DefaultOptions, true);\r\n this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization);\r\n this.optionsStore.unset = true;\r\n this._initializeInput();\r\n this._initializeToggle();\r\n if (this.optionsStore.options.display.inline)\r\n this.display.show();\r\n this._eventEmitters.triggerEvent.subscribe((e) => {\r\n this._triggerEvent(e);\r\n });\r\n this._eventEmitters.viewUpdate.subscribe(() => {\r\n this._viewUpdate();\r\n });\r\n this._eventEmitters.updateViewDate.subscribe((dateTime) => {\r\n this.viewDate = dateTime;\r\n });\r\n }\r\n get viewDate() {\r\n return this.optionsStore.viewDate;\r\n }\r\n set viewDate(value) {\r\n this.optionsStore.viewDate = value;\r\n this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization);\r\n this.display._update(this.optionsStore.currentView === 'clock' ? 'clock' : 'calendar');\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Update the picker options. If `reset` is provide `options` will be merged with DefaultOptions instead.\r\n * @param options\r\n * @param reset\r\n * @public\r\n */\r\n updateOptions(options, reset = false) {\r\n if (reset)\r\n this._initializeOptions(options, DefaultOptions);\r\n else\r\n this._initializeOptions(options, this.optionsStore.options);\r\n this.optionsStore.viewDate.setLocalization(this.optionsStore.options.localization);\r\n this.display.refreshCurrentView();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Toggles the picker open or closed. If the picker is disabled, nothing will happen.\r\n * @public\r\n */\r\n toggle() {\r\n if (this._isDisabled)\r\n return;\r\n this.display.toggle();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Shows the picker unless the picker is disabled.\r\n * @public\r\n */\r\n show() {\r\n if (this._isDisabled)\r\n return;\r\n this.display.show();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker unless the picker is disabled.\r\n * @public\r\n */\r\n hide() {\r\n this.display.hide();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Disables the picker and the target input field.\r\n * @public\r\n */\r\n disable() {\r\n this._isDisabled = true;\r\n // todo this might be undesired. If a dev disables the input field to\r\n // only allow using the picker, this will break that.\r\n this.optionsStore.input?.setAttribute('disabled', 'disabled');\r\n this.display.hide();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Enables the picker and the target input field.\r\n * @public\r\n */\r\n enable() {\r\n this._isDisabled = false;\r\n this.optionsStore.input?.removeAttribute('disabled');\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Clears all the selected dates\r\n * @public\r\n */\r\n clear() {\r\n this.optionsStore.input.value = '';\r\n this.dates.clear();\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Allows for a direct subscription to picker events, without having to use addEventListener on the element.\r\n * @param eventTypes See Namespace.Events\r\n * @param callbacks Function to call when event is triggered\r\n * @public\r\n */\r\n subscribe(eventTypes, callbacks //eslint-disable-line @typescript-eslint/no-explicit-any\r\n ) {\r\n if (typeof eventTypes === 'string') {\r\n eventTypes = [eventTypes];\r\n }\r\n let callBackArray; //eslint-disable-line @typescript-eslint/no-explicit-any\r\n if (!Array.isArray(callbacks)) {\r\n callBackArray = [callbacks];\r\n }\r\n else {\r\n callBackArray = callbacks;\r\n }\r\n if (eventTypes.length !== callBackArray.length) {\r\n Namespace.errorMessages.subscribeMismatch();\r\n }\r\n const returnArray = [];\r\n for (let i = 0; i < eventTypes.length; i++) {\r\n const eventType = eventTypes[i];\r\n if (!Array.isArray(this._subscribers[eventType])) {\r\n this._subscribers[eventType] = [];\r\n }\r\n this._subscribers[eventType].push(callBackArray[i]);\r\n returnArray.push({\r\n unsubscribe: this._unsubscribe.bind(this, eventType, this._subscribers[eventType].length - 1),\r\n });\r\n if (eventTypes.length === 1) {\r\n return returnArray[0];\r\n }\r\n }\r\n return returnArray;\r\n }\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Hides the picker and removes event listeners\r\n */\r\n dispose() {\r\n this.display.hide();\r\n // this will clear the document click event listener\r\n this.display._dispose();\r\n this._eventEmitters.destroy();\r\n this.optionsStore.input?.removeEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input?.removeEventListener('click', this._openClickEvent);\r\n this.optionsStore.input?.removeEventListener('focus', this._openClickEvent);\r\n }\r\n this._toggle?.removeEventListener('click', this._toggleClickEvent);\r\n this._subscribers = {};\r\n }\r\n /**\r\n * Updates the options to use the provided language.\r\n * THe language file must be loaded first.\r\n * @param language\r\n */\r\n locale(language) {\r\n const asked = loadedLocales[language];\r\n if (!asked)\r\n return;\r\n this.updateOptions({\r\n localization: asked,\r\n });\r\n }\r\n /**\r\n * Triggers an event like ChangeEvent when the picker has updated the value\r\n * of a selected date.\r\n * @param event Accepts a BaseEvent object.\r\n * @private\r\n */\r\n _triggerEvent(event) {\r\n event.viewMode = this.optionsStore.currentView;\r\n const isChangeEvent = event.type === Namespace.events.change;\r\n if (isChangeEvent) {\r\n const { date, oldDate, isClear } = event;\r\n if ((date && oldDate && date.isSame(oldDate)) ||\r\n (!isClear && !date && !oldDate)) {\r\n return;\r\n }\r\n this._handleAfterChangeEvent(event);\r\n this.optionsStore.input?.dispatchEvent(\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n new CustomEvent('change', { detail: event }));\r\n }\r\n this.optionsStore.element.dispatchEvent(\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n new CustomEvent(event.type, { detail: event }));\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n if (window.jQuery) {\r\n //eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const $ = window.jQuery;\r\n if (isChangeEvent && this.optionsStore.input) {\r\n $(this.optionsStore.input).trigger(event);\r\n }\r\n else {\r\n $(this.optionsStore.element).trigger(event);\r\n }\r\n }\r\n this._publish(event);\r\n }\r\n _publish(event) {\r\n // return if event is not subscribed\r\n if (!Array.isArray(this._subscribers[event.type])) {\r\n return;\r\n }\r\n // Trigger callback for each subscriber\r\n this._subscribers[event.type].forEach((callback) => {\r\n callback(event);\r\n });\r\n }\r\n /**\r\n * Fires a ViewUpdate event when, for example, the month view is changed.\r\n * @private\r\n */\r\n _viewUpdate() {\r\n this._triggerEvent({\r\n type: Namespace.events.update,\r\n viewDate: this.optionsStore.viewDate.clone,\r\n });\r\n }\r\n _unsubscribe(eventName, index) {\r\n this._subscribers[eventName].splice(index, 1);\r\n }\r\n /**\r\n * Merges two Option objects together and validates options type\r\n * @param config new Options\r\n * @param mergeTo Options to merge into\r\n * @param includeDataset When true, the elements data-td attributes will be included in the\r\n * @private\r\n */\r\n _initializeOptions(config, mergeTo, includeDataset = false) {\r\n let newConfig = OptionConverter.deepCopy(config);\r\n newConfig = OptionConverter._mergeOptions(newConfig, mergeTo);\r\n if (includeDataset)\r\n newConfig = OptionConverter._dataToOptions(this.optionsStore.element, newConfig);\r\n OptionConverter._validateConflicts(newConfig);\r\n newConfig.viewDate = newConfig.viewDate.setLocalization(newConfig.localization);\r\n if (!this.optionsStore.viewDate.isSame(newConfig.viewDate)) {\r\n this.optionsStore.viewDate = newConfig.viewDate;\r\n }\r\n /**\r\n * Sets the minimum view allowed by the picker. For example the case of only\r\n * allowing year and month to be selected but not date.\r\n */\r\n if (newConfig.display.components.year) {\r\n this.optionsStore.minimumCalendarViewMode = 2;\r\n }\r\n if (newConfig.display.components.month) {\r\n this.optionsStore.minimumCalendarViewMode = 1;\r\n }\r\n if (newConfig.display.components.date) {\r\n this.optionsStore.minimumCalendarViewMode = 0;\r\n }\r\n this.optionsStore.currentCalendarViewMode = Math.max(this.optionsStore.minimumCalendarViewMode, this.optionsStore.currentCalendarViewMode);\r\n // Update view mode if needed\r\n if (CalendarModes[this.optionsStore.currentCalendarViewMode].name !==\r\n newConfig.display.viewMode) {\r\n this.optionsStore.currentCalendarViewMode = Math.max(CalendarModes.findIndex((x) => x.name === newConfig.display.viewMode), this.optionsStore.minimumCalendarViewMode);\r\n }\r\n if (this.display?.isVisible) {\r\n this.display._update('all');\r\n }\r\n if (newConfig.display.components.useTwentyfourHour &&\r\n newConfig.localization.hourCycle === undefined)\r\n newConfig.localization.hourCycle = 'h24';\r\n else if (newConfig.localization.hourCycle === undefined) {\r\n newConfig.localization.hourCycle = guessHourCycle(newConfig.localization.locale);\r\n }\r\n this.optionsStore.options = newConfig;\r\n if (newConfig.restrictions.maxDate &&\r\n this.viewDate.isAfter(newConfig.restrictions.maxDate))\r\n this.viewDate = newConfig.restrictions.maxDate.clone;\r\n if (newConfig.restrictions.minDate &&\r\n this.viewDate.isBefore(newConfig.restrictions.minDate))\r\n this.viewDate = newConfig.restrictions.minDate.clone;\r\n }\r\n /**\r\n * Checks if an input field is being used, attempts to locate one and sets an\r\n * event listener if found.\r\n * @private\r\n */\r\n _initializeInput() {\r\n if (this.optionsStore.element.tagName == 'INPUT') {\r\n this.optionsStore.input = this.optionsStore.element;\r\n }\r\n else {\r\n const query = this.optionsStore.element.dataset.tdTargetInput;\r\n if (query == undefined || query == 'nearest') {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector('input');\r\n }\r\n else {\r\n this.optionsStore.input =\r\n this.optionsStore.element.querySelector(query);\r\n }\r\n }\r\n if (!this.optionsStore.input)\r\n return;\r\n if (!this.optionsStore.input.value && this.optionsStore.options.defaultDate)\r\n this.optionsStore.input.value = this.dates.formatInput(this.optionsStore.options.defaultDate);\r\n this.optionsStore.input.addEventListener('change', this._inputChangeEvent);\r\n if (this.optionsStore.options.allowInputToggle) {\r\n this.optionsStore.input.addEventListener('click', this._openClickEvent);\r\n this.optionsStore.input.addEventListener('focus', this._openClickEvent);\r\n }\r\n if (this.optionsStore.input.value) {\r\n this._inputChangeEvent();\r\n }\r\n }\r\n /**\r\n * Attempts to locate a toggle for the picker and sets an event listener\r\n * @private\r\n */\r\n _initializeToggle() {\r\n if (this.optionsStore.options.display.inline)\r\n return;\r\n let query = this.optionsStore.element.dataset.tdTargetToggle;\r\n if (query == 'nearest') {\r\n query = '[data-td-toggle=\"datetimepicker\"]';\r\n }\r\n this._toggle =\r\n query == undefined\r\n ? this.optionsStore.element\r\n : this.optionsStore.element.querySelector(query);\r\n this._toggle.addEventListener('click', this._toggleClickEvent);\r\n }\r\n /**\r\n * If the option is enabled this will render the clock view after a date pick.\r\n * @param e change event\r\n * @private\r\n */\r\n _handleAfterChangeEvent(e) {\r\n if (\r\n // options is disabled\r\n !this.optionsStore.options.promptTimeOnDateChange ||\r\n this.optionsStore.options.multipleDates ||\r\n this.optionsStore.options.display.inline ||\r\n this.optionsStore.options.display.sideBySide ||\r\n // time is disabled\r\n !this.display._hasTime ||\r\n // clock component is already showing\r\n this.display.widget\r\n ?.getElementsByClassName(Namespace.css.show)[0]\r\n .classList.contains(Namespace.css.timeContainer))\r\n return;\r\n // First time ever. If useCurrent option is set to true (default), do nothing\r\n // because the first date is selected automatically.\r\n // or date didn't change (time did) or date changed because time did.\r\n if ((!e.oldDate && this.optionsStore.options.useCurrent) ||\r\n (e.oldDate && e.date?.isSame(e.oldDate))) {\r\n return;\r\n }\r\n clearTimeout(this._currentPromptTimeTimeout);\r\n this._currentPromptTimeTimeout = setTimeout(() => {\r\n if (this.display.widget) {\r\n this._eventEmitters.action.emit({\r\n e: {\r\n currentTarget: this.display.widget.querySelector('[data-action=\"togglePicker\"]'),\r\n },\r\n action: ActionTypes$1.togglePicker,\r\n });\r\n }\r\n }, this.optionsStore.options.promptTimeOnDateChangeTransitionDelay);\r\n }\r\n }\r\n /**\r\n * Whenever a locale is loaded via a plugin then store it here based on the\r\n * locale name. E.g. loadedLocales['ru']\r\n */\r\n const loadedLocales = {};\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Called from a locale plugin.\r\n * @param l locale object for localization options\r\n */\r\n const loadLocale = (l) => {\r\n if (loadedLocales[l.name])\r\n return;\r\n loadedLocales[l.name] = l.localization;\r\n };\r\n /**\r\n * A sets the global localization options to the provided locale name.\r\n * `loadLocale` MUST be called first.\r\n * @param l\r\n */\r\n const locale = (l) => {\r\n const asked = loadedLocales[l];\r\n if (!asked)\r\n return;\r\n DefaultOptions.localization = asked;\r\n };\r\n // noinspection JSUnusedGlobalSymbols\r\n /**\r\n * Called from a plugin to extend or override picker defaults.\r\n * @param plugin\r\n * @param option\r\n */\r\n const extend = function (plugin, option = undefined) {\r\n if (!plugin)\r\n return tempusDominus$1;\r\n if (!plugin.installed) {\r\n // install plugin only once\r\n plugin(option, { TempusDominus, Dates, Display, DateTime, Namespace }, tempusDominus$1);\r\n plugin.installed = true;\r\n }\r\n return tempusDominus$1;\r\n };\r\n const version = '6.9.4';\r\n const tempusDominus$1 = {\r\n TempusDominus,\r\n extend,\r\n loadLocale,\r\n locale,\r\n Namespace,\r\n DefaultOptions,\r\n DateTime,\r\n Unit,\r\n version,\r\n DefaultEnLocalization,\r\n };\n\n var _tempusDominus = {\n __proto__: null,\n TempusDominus: TempusDominus,\n extend: extend,\n loadLocale: loadLocale,\n locale: locale,\n Namespace: Namespace,\n DefaultOptions: DefaultOptions,\n DateTime: DateTime,\n get Unit () { return Unit; },\n version: version,\n DefaultEnLocalization: DefaultEnLocalization\n };\n\n var luxon_parse = (_, tdClasses, tdFactory) => {\r\n tdClasses.Dates.prototype.setFromInput = function (value, index) {\r\n let locale = this.optionsStore.options.localization.locale, format = this.optionsStore.options.localization.format;\r\n if (format) {\r\n let opts = {\r\n locale\r\n };\r\n let parsedDate = new tdFactory.DateTime(luxon__namespace.DateTime.fromFormat(value, format, opts).toJSDate());\r\n // Check if the date is valid (An invalid date object returns NaN for getTime() and NaN is the only object not strictly equal to itself.)\r\n if (parsedDate && parsedDate.getTime() === parsedDate.getTime()) {\r\n let date = tdFactory.DateTime.convert(parsedDate, '', this.optionsStore.options.localization);\r\n this.setValue(date, index);\r\n }\r\n else {\r\n console.error('Luxon failed to parse the input date.');\r\n }\r\n }\r\n else {\r\n console.error('Missing format.');\r\n }\r\n };\r\n tdClasses.Dates.prototype.formatInput = function (date) {\r\n let locale = this.optionsStore.options.localization.locale, format = this.optionsStore.options.localization.format;\r\n if (format) {\r\n let opts = {\r\n locale,\r\n outputCalendar: \"gregory\" // Make sure the date is converted back to \"gregory\" format\r\n };\r\n return date ? luxon__namespace.DateTime.fromJSDate(date, opts).toFormat(format) : \"\";\r\n }\r\n else {\r\n console.error('Missing format.');\r\n }\r\n };\r\n };\n\n ///\n\n const tempusDominus = _tempusDominus;\n\n tempusDominus.extend(luxon_parse); //***\n // tempusDominus.extend(fa_five); //*** for v2022 only\n\n /*!\n * Tempus Dominus v6.9.4 (https://getdatepicker.com/)\n * Copyright 2013-2021 Jonathan Peterson\n * Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)\n */\n tempusDominus.jQueryInterface = function (option, argument) {\n if (this.length === 1) {\n return tempusDominus.jQueryHandleThis(this, option, argument);\n }\n // \"this\" is jquery here\n return this.each(function () {\n tempusDominus.jQueryHandleThis(this, option, argument);\n });\n };\n\n tempusDominus.jQueryHandleThis = function (me, option, argument) {\n let data = $__default[\"default\"](me).data(tempusDominus.Namespace.dataKey);\n if (typeof option === 'object') {\n option = $__default[\"default\"].extend({}, tempusDominus.DefaultOptions, option);\n }\n\n if (!data) {\n data = new tempusDominus.TempusDominus($__default[\"default\"](me)[0], option);\n $__default[\"default\"](me).data(tempusDominus.Namespace.dataKey, data);\n }\n\n if (typeof option === 'string') {\n if (data[option] === undefined) {\n throw new Error(`No method named \"${option}\"`);\n }\n if (argument === undefined) {\n return data[option]();\n } else {\n if (option === 'date') {\n data.isDateUpdateThroughDateOptionFromClientCode = true;\n }\n const ret = data[option](argument);\n data.isDateUpdateThroughDateOptionFromClientCode = false;\n return ret;\n }\n }\n };\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n //*** $(document)\n // .on(\n // `click${tempusDominus.Namespace.events.key}.data-api`,\n // `[data-toggle=\"${tempusDominus.Namespace.dataKey}\"]`,\n // function () {\n // const $originalTarget = $(this),\n // $target = tempusDominus.getSelectorFromElement($originalTarget),\n // config = $target.data(tempusDominus.Namespace.dataKey);\n // if ($target.length === 0) {\n // return;\n // }\n // if (\n // config._options.allowInputToggle &&\n // $originalTarget.is('input[data-toggle=\"datetimepicker\"]')\n // ) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, 'toggle');\n // }\n // )\n // .on(\n // tempusDominus.Namespace.events.change,\n // `.${tempusDominus.Namespace.NAME}-input`,\n // function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this));\n // if ($target.length === 0 || event.isInit) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, '_change', event);\n // }\n // )\n // .on(\n // tempusDominus.Namespace.events.blur,\n // `.${tempusDominus.Namespace.NAME}-input`,\n // function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this)),\n // config = $target.data(tempusDominus.Namespace.dataKey);\n // if ($target.length === 0) {\n // return;\n // }\n // if (config._options.debug || window.debug) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, 'hide', event);\n // }\n // )\n // /*.on(tempusDominus.Namespace.Events.keydown, `.${tempusDominus.Namespace.NAME}-input`, function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this));\n // if ($target.length === 0) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, '_keydown', event);\n // })\n // .on(tempusDominus.Namespace.Events.keyup, `.${tempusDominus.Namespace.NAME}-input`, function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this));\n // if ($target.length === 0) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, '_keyup', event);\n // })*/\n // .on(\n // tempusDominus.Namespace.events.focus,\n // `.${tempusDominus.Namespace.NAME}-input`,\n // function (event) {\n // const $target = tempusDominus.getSelectorFromElement($(this)),\n // config = $target.data(tempusDominus.Namespace.dataKey);\n // if ($target.length === 0) {\n // return;\n // }\n // if (!config._options.allowInputToggle) {\n // return;\n // }\n // tempusDominus.jQueryInterface.call($target, 'show', event);\n // }\n // );\n const name = 'tempusDominus';\n const JQUERY_NO_CONFLICT = $__default[\"default\"].fn[name];\n $__default[\"default\"].fn[name] = tempusDominus.jQueryInterface;\n $__default[\"default\"].fn[name].Constructor = tempusDominus.TempusDominus;\n $__default[\"default\"].fn[name].noConflict = function () {\n $__default[\"default\"].fn[name] = JQUERY_NO_CONFLICT;\n return tempusDominus.jQueryInterface;\n };\n\n return tempusDominus;\n\n})(jQuery, luxon);\n"],"mappings":";;;;;AAKA,IAAIA,cAAgB,SAAWC,EAAGC,GAChC,aAEA,SAASC,EAAuBC,GAAK,OAAOA,GAAkB,iBAANA,GAAkB,YAAaA,E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