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Y,QAAS,QAAS,MAAO,OAAQ,OAAQ,SAAU,YAAa,UAAW,WAAY,YACvHzD,EAAO,IAAIa,KACX6C,EAAc1D,EAAK2D,cACnBC,EAAe5D,EAAK6D,WAE1B,GAAIzC,EAAM,CACT,GAAIA,EAAOsC,EAAa,MAAO,GAC/B,GAAItC,IAASsC,GAAeF,EAC3B,OAAOC,EAAMK,MAAM,EAAGF,EAAe,GAGvC,OAAOH,ECVD,SAASM,GAAuB,MAACC,EAAD,kBAAQC,GAAoB,EAA5B,QAAmCC,GAAU,IACnF,MAAMC,EAAOF,GAAqBD,KAAU,IAAInD,MAAOgD,WAAa,GAAI,IAAIhD,MAAOuD,UAAY,IAAIvD,KAAK,KAAMmD,EAAO,GAAGI,UAExH,IAAKF,EAAS,OAAOC,EAErB,MAAME,EAAsB,GAC5B,IAAK,IAAIC,EAAI,EAAGA,GAAKH,EAAMG,IAC1BD,EAAUE,KAAKD,GAEhB,OAAOD,ECdD,SAASG,EAAa1C,GAC5B,MAAO,CACNA,KAAMA,EACJzC,IAAIoF,EAAAA,YAAAA,oBACJC,WACAC,OAAO,IAAK7C,EAAKL,SAAW,GAAK,IAAM,GAAIK,EAAKL,SAASiD,YAC3DE,UAAW9C,EAAKN,OAAS,GAAK,UAAY,c,SHRhCY,GAAAA,EAAAA,MAAAA,QAAAA,EAAAA,OAAAA,SAAAA,EAAAA,KAAAA,O,CAAAA,IAAAA,EAAAA,K","sources":["webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///external commonjs \"@js-joda/core\"","webpack:///external commonjs \"@js-joda/locale_en\"","webpack:///./conversion.ts","webpack:///external commonjs \"@js-joda/timezone\"","webpack:///./formatDate.ts","webpack:///./getMonthNames.ts","webpack:///./getNumberOfDaysInMonth.ts","webpack:///./specialFormats.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@js-joda/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@js-joda/locale_en\");","import {LocalDate, LocalDateTime, nativeJs, ZonedDateTime, ZoneId, LocalTime} from '@js-joda/core';\n\n/*\n Possible Date Types\n\n LocalDate - js-joda date with no time\n Object - Object with fields that look like LocalDate internals. See ILocalDateLike below.\n Epoch Days - js-joda number of days since epoch (Jan 1, 1970)\n LocalDateTime - js-joda date with time (no zone)\n ZonedDateTime - js-joda date with time and zone\n Date - javascript date with time (no zone)\n String - ISO8601 date string (without time, with time, with time and zone)\n LocalTime - js-joda time (no zone)\n */\n\nexport interface ILocalDateLike {\n\t_year: number;\n\t_month: number;\n\t_day: number;\n}\n\nexport function isLocalDateLike(date: any): date is ILocalDateLike {\n\treturn (\n\t\tdate !== null &&\n\t\tdate !== undefined &&\n\t\ttypeof date === 'object' &&\n\t\ttypeof date._year !== 'undefined' &&\n\t\ttypeof date._month !== 'undefined' &&\n\t\ttypeof date._day !== 'undefined'\n\t);\n}\n\nexport interface ILocalTimeLike {\n\t_hour: number;\n\t_minute: number;\n\t_second: number;\n\t_nano: number;\n}\n\nexport function isLocalTimeLike(time: any): time is ILocalTimeLike {\n\treturn (\n\t\ttime !== null &&\n\t\ttime !== undefined &&\n\t\ttypeof time === 'object' &&\n\t\ttypeof time._hour !== 'undefined' &&\n\t\ttypeof time._minute !== 'undefined' &&\n\t\ttypeof time._second !== 'undefined' &&\n\t\ttypeof time._nano !== 'undefined'\n\t);\n}\n\n// const iso8601Regex = /^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\nconst iso8601DateOnly = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst iso8601ContainsZone = /(Z|[+-]\\d{2}:\\d{2})$/;\nconst iso8601TimeOnly = /^\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?$/;\n\nexport function toLocalDate(date: any, zone: ZoneId = ZoneId.SYSTEM): LocalDate {\n\tif (date instanceof LocalDate) {\n\t\treturn date;\n\t}\n\tif (date instanceof LocalDateTime) {\n\t\t// This chops the time off, because 'local' datetime === 'local date.\n\t\treturn date.toLocalDate();\n\t}\n\tif (date instanceof ZonedDateTime) {\n\t\t// Unsure of this\n\t\treturn date.toLocalDate();\n\t}\n\tif (typeof date === 'number') {\n\t\treturn LocalDate.ofEpochDay(date);\n\t}\n\tif (date instanceof Date) {\n\t\t// Javascript dates are evil. They assume you are in SYSTEM zone when reading, but can set as any zone.\n\t\treturn LocalDate.from(nativeJs(date, zone));\n\t}\n\tif (isLocalDateLike(date)) {\n\t\t// eslint-disable-next-line no-underscore-dangle\n\t\treturn LocalDate.of(date._year, date._month, date._day);\n\t}\n\tif (typeof date === 'string') {\n\t\tif (iso8601DateOnly.test(date)) {\n\t\t\treturn LocalDate.parse(date);\n\t\t}\n\t\tif (iso8601ContainsZone.test(date)) {\n\t\t\treturn ZonedDateTime.parse(date).toLocalDate();\n\t\t}\n\t\treturn LocalDateTime.parse(date).toLocalDate();\n\t}\n\tthrow new Error('Cannot convert value to LocalDate');\n}\n\nexport function toEpochDay(date: any, zone: ZoneId = ZoneId.SYSTEM): number {\n\tif (typeof date === 'number') {\n\t\treturn date;\n\t}\n\tif (date instanceof LocalDate) {\n\t\treturn date.toEpochDay();\n\t}\n\tif (date instanceof LocalDateTime || date instanceof ZonedDateTime || date instanceof Date || isLocalDateLike(date) || typeof date === 'string') {\n\t\treturn toLocalDate(date, zone).toEpochDay();\n\t}\n\n\tthrow new Error('Cannot convert value to epoch integer');\n}\n\nexport function toLocalDateTime(date: any, zone: ZoneId = ZoneId.SYSTEM): LocalDateTime {\n\tif (date instanceof LocalDateTime) {\n\t\treturn date;\n\t}\n\tif (date instanceof ZonedDateTime) {\n\t\treturn date.toLocalDateTime();\n\t}\n\tif (date instanceof Date) {\n\t\treturn LocalDateTime.from(nativeJs(date, zone));\n\t}\n\tif (date instanceof LocalDate || isLocalDateLike(date) || typeof date === 'number') {\n\t\tconst localDate = toLocalDate(date);\n\t\treturn LocalDateTime.of(localDate.year(), localDate.monthValue(), localDate.dayOfMonth(), 0, 0, 0, 0);\n\t}\n\tif (typeof date === 'string') {\n\t\tif (iso8601DateOnly.test(date)) {\n\t\t\treturn toLocalDateTime(LocalDate.parse(date));\n\t\t}\n\t\tif (iso8601ContainsZone.test(date)) {\n\t\t\treturn ZonedDateTime.parse(date).toLocalDateTime();\n\t\t}\n\t\treturn LocalDateTime.parse(date);\n\t}\n\tthrow new Error('Cannot convert value to LocalDateTime');\n}\n\nexport function toDate(date: any): Date {\n\tif (date instanceof Date) {\n\t\treturn date;\n\t}\n\tif (date instanceof LocalDate || date instanceof ZonedDateTime) {\n\t\treturn new Date(date.year(), date.monthValue() - 1, date.dayOfMonth());\n\t}\n\tif (date instanceof LocalDateTime) {\n\t\treturn new Date(date.year(), date.monthValue() - 1, date.dayOfMonth(), date.hour(), date.minute(), date.second(), date.nano() / 1000000);\n\t}\n\tif (date instanceof LocalTime) {\n\t\treturn new Date(1970, 1, 1, date.hour(), date.minute(), date.second(), date.nano() / 1000000);\n\t}\n\tif (typeof date === 'number' || isLocalDateLike(date)) {\n\t\treturn toDate(toLocalDate(date));\n\t}\n\tif (typeof date === 'string') {\n\t\treturn new Date(date);\n\t}\n\tthrow new Error('Cannot convert value to Date');\n}\n\nexport function toLocalTime(time: any, zone: ZoneId = ZoneId.SYSTEM): LocalTime {\n\tif (time instanceof LocalTime) {\n\t\treturn time;\n\t}\n\tif (time instanceof LocalDateTime) {\n\t\treturn time.toLocalTime();\n\t}\n\tif (time instanceof ZonedDateTime) {\n\t\treturn time.toLocalTime();\n\t}\n\tif (time instanceof Date) {\n\t\treturn LocalTime.from(nativeJs(time, zone));\n\t}\n\tif (isLocalTimeLike(time)) {\n\t\t// eslint-disable-next-line no-underscore-dangle\n\t\treturn LocalTime.of(time._hour, time._minute, time._second, time._nano);\n\t}\n\tif (typeof time === 'number') {\n\t\treturn LocalTime.ofSecondOfDay(time);\n\t}\n\tif (typeof time === 'string') {\n\t\tif (iso8601TimeOnly.test(time)) {\n\t\t\treturn LocalTime.parse(time);\n\t\t}\n\t\treturn toLocalDateTime(time, zone).toLocalTime();\n\t}\n\tthrow new Error('Cannot convert value to LocalTime');\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@js-joda/timezone\");","import {DateTimeFormatter, LocalDate, LocalDateTime, LocalTime, ZonedDateTime, ZoneId} from '@js-joda/core';\nimport {Locale} from '@js-joda/locale_en';\nimport '@js-joda/timezone';\nimport {toLocalDate, toLocalDateTime, ILocalDateLike, isLocalDateLike} from './conversion';\n\nexport enum FormatDateType {\n\tshort = 'short',\n\tmedium = 'medium',\n\tlong = 'long',\n}\n\nexport interface FormatDateParams {\n\ttype?: FormatDateType | 'short' | 'medium' | 'long';\n\ttime?: boolean;\n\tdate?: boolean;\n\tformat?: string;\n}\n\n/**\n * Formats a date to a string\n * @param obj\n * @param params\n * @param zone\n */\nexport function formatDate(\n\tobj: ILocalDateLike | Date | LocalDate | number | string | LocalDateTime | LocalTime | ZonedDateTime | null | undefined,\n\t{type = FormatDateType.short, time = false, date = true, format}: FormatDateParams = {type: FormatDateType.short, time: false, date: true},\n\tzone: ZoneId = ZoneId.SYSTEM,\n) {\n\tlet l: LocalDate | LocalDateTime | LocalTime | ZonedDateTime | undefined;\n\tif (!obj) return '';\n\tif (typeof obj === 'number') l = toLocalDate(obj);\n\tif (typeof obj === 'string' && time === false) l = toLocalDate(obj);\n\tif (typeof obj === 'string') l = toLocalDateTime(obj);\n\tif (isLocalDateLike(obj)) l = toLocalDate(obj);\n\tif (obj instanceof Date) l = toLocalDateTime(obj, zone);\n\tif (obj instanceof LocalDate) l = obj;\n\tif (obj instanceof LocalDateTime) l = obj;\n\tif (obj instanceof LocalTime) l = obj;\n\tif (obj instanceof ZonedDateTime) l = obj;\n\tif (!l) throw new Error('Date could not be converted to a js-joda date');\n\n\tlet dateFormat: string;\n\tlet timeFormat: string;\n\tswitch (type) {\n\t\tcase FormatDateType.medium:\n\t\t\tdateFormat = 'MMM d, yyyy';\n\t\t\ttimeFormat = 'h:mm a';\n\t\t\tbreak;\n\t\tcase FormatDateType.long:\n\t\t\tdateFormat = 'MMMM d, yyyy';\n\t\t\ttimeFormat = 'h:mm a';\n\t\t\tbreak;\n\t\tcase FormatDateType.short:\n\t\tdefault:\n\t\t\tdateFormat = 'M/d/yyyy';\n\t\t\ttimeFormat = 'h:mm a';\n\t\t\tbreak;\n\t}\n\n\tif (l instanceof LocalDate) timeFormat = '';\n\tif (l instanceof LocalTime) dateFormat = '';\n\n\tlet formatString = !date ? '' : dateFormat;\n\tif (time) {\n\t\tformatString = `${formatString} ${timeFormat}`.trim();\n\t}\n\n\tconst formatter = DateTimeFormatter.ofPattern(format || formatString).withLocale(Locale.ENGLISH);\n\n\treturn l.format(formatter).replace(/AM|PM/, x => x.toLowerCase());\n}\n","interface GetMonthNameParams {\n\tyear?: number;\n\tlimitToCurrentMonth?: boolean;\n}\n\n/**\n * Returns an array of month name strings up to the current month.\n * @param year: {number}, The year to get the months for.\n * @param limitToCurrentMonth = false: {boolean}, If set to true returns all the months for the current year.\n */\nexport function getMonthNames({year, limitToCurrentMonth = true}: GetMonthNameParams = {}): string[] {\n\tconst array = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\tconst date = new Date();\n\tconst currentYear = date.getFullYear();\n\tconst currentMonth = date.getMonth();\n\n\tif (year) {\n\t\tif (year > currentYear) return [];\n\t\tif (year === currentYear && limitToCurrentMonth) {\n\t\t\treturn array.slice(0, currentMonth + 1);\n\t\t}\n\t}\n\treturn array;\n}\n","interface GetMonthDaysParams {\n\tmonth: number;\n\tlimitToCurrentDay?: boolean;\n\tasArray?: boolean;\n}\n\n/**\n * Returns the number of days in a given month.\n * @param month: {number}, The number of the month to get where January = 1.\n * @param limitToCurrentDay = false: {boolean}, If set to true, returns number of days up to current day.\n * @param asArray = false: {boolean}, If set to true, returns array of days.\n */\nexport function getNumberOfDaysInMonth({month, limitToCurrentDay = false, asArray = false}: GetMonthDaysParams) {\n\tconst days = limitToCurrentDay && month === new Date().getMonth() + 1 ? new Date().getDate() : new Date(2019, month, 0).getDate();\n\n\tif (!asArray) return days;\n\n\tconst daysArray: number[] = [];\n\tfor (let i = 1; i <= days; i++) {\n\t\tdaysArray.push(i);\n\t}\n\treturn daysArray;\n}\n","import {ChronoField, LocalTime} from '@js-joda/core';\n\ninterface TimeOfDay {\n\ttime: string;\n\ttimeOfDay: string;\n}\n\nexport function getTimeOfDay(time: LocalTime): TimeOfDay {\n\treturn {\n\t\ttime: time\n\t\t\t.get(ChronoField.CLOCK_HOUR_OF_AMPM)\n\t\t\t.toString()\n\t\t\t.concat(':', time.minute() < 10 ? '0' : '', time.minute().toString()),\n\t\ttimeOfDay: time.hour() < 12 ? 'morning' : 'afternoon',\n\t};\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","isLocalDateLike","date","_year","_month","_day","iso8601DateOnly","iso8601ContainsZone","iso8601TimeOnly","toLocalDate","zone","ZoneId","LocalDate","LocalDateTime","ZonedDateTime","Date","nativeJs","test","Error","toEpochDay","toLocalDateTime","localDate","year","monthValue","dayOfMonth","toDate","hour","minute","second","nano","LocalTime","toLocalTime","time","_hour","_minute","_second","_nano","isLocalTimeLike","FormatDateType","formatDate","type","short","format","l","dateFormat","timeFormat","medium","long","formatString","trim","formatter","DateTimeFormatter","withLocale","Locale","replace","x","toLowerCase","getMonthNames","limitToCurrentMonth","array","currentYear","getFullYear","currentMonth","getMonth","slice","getNumberOfDaysInMonth","month","limitToCurrentDay","asArray","days","getDate","daysArray","i","push","getTimeOfDay","ChronoField","toString","concat","timeOfDay"],"sourceRoot":""}
\No newline at end of file