\n \n \n \n \n\n","import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f} from \"./CalendarDate.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \nfunction $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {\n return amount - numerator * Math.floor(amount / numerator);\n}\nfunction $2b4dce13dd5a17fa$export$784d13d8ee351f07(date) {\n if (date.era) return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.era, date.year, date.month, date.day);\n else return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(date.calendar, date.year, date.month, date.day);\n}\nfunction $2b4dce13dd5a17fa$export$27fa0172ae2644b3(date) {\n if (date.era) return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n else return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);\n}\n\n\nexport {$2b4dce13dd5a17fa$export$842a2cf37af977e1 as mod, $2b4dce13dd5a17fa$export$784d13d8ee351f07 as copy, $2b4dce13dd5a17fa$export$27fa0172ae2644b3 as copyDateTime};\n//# sourceMappingURL=utils.module.js.map\n","import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from \"./CalendarDate.mjs\";\nimport {mod as $2b4dce13dd5a17fa$export$842a2cf37af977e1} from \"./utils.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\n\nconst $3b62074eb05584b2$var$EPOCH = 1721426; // 001/01/03 Julian C.E.\nfunction $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {\n year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);\n let y1 = year - 1;\n let monthOffset = -2;\n if (month <= 2) monthOffset = 0;\n else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;\n return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);\n}\nfunction $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\nfunction $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {\n return era === 'BC' ? 1 - year : year;\n}\nfunction $3b62074eb05584b2$export$4475b7e617eb123c(year) {\n let era = 'AD';\n if (year <= 0) {\n era = 'BC';\n year = 1 - year;\n }\n return [\n era,\n year\n ];\n}\nconst $3b62074eb05584b2$var$daysInMonth = {\n standard: [\n 31,\n 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n ],\n leapyear: [\n 31,\n 29,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n ]\n};\nclass $3b62074eb05584b2$export$80ee6245ec4f29ec {\n fromJulianDay(jd) {\n let jd0 = jd;\n let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;\n let quadricent = Math.floor(depoch / 146097);\n let dqc = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(depoch, 146097);\n let cent = Math.floor(dqc / 36524);\n let dcent = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(dqc, 36524);\n let quad = Math.floor(dcent / 1461);\n let dquad = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(dcent, 1461);\n let yindex = Math.floor(dquad / 365);\n let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);\n let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);\n let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);\n let leapAdj = 2;\n if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;\n else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;\n let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);\n let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;\n return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, month, day);\n }\n toJulianDay(date) {\n return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);\n }\n getDaysInMonth(date) {\n return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 'leapyear' : 'standard'][date.month - 1];\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getMonthsInYear(date) {\n return 12;\n }\n getDaysInYear(date) {\n return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getYearsInEra(date) {\n return 9999;\n }\n getEras() {\n return [\n 'BC',\n 'AD'\n ];\n }\n isInverseEra(date) {\n return date.era === 'BC';\n }\n balanceDate(date) {\n if (date.year <= 0) {\n date.era = date.era === 'BC' ? 'AD' : 'BC';\n date.year = 1 - date.year;\n }\n }\n constructor(){\n this.identifier = 'gregory';\n }\n}\n\n\nexport {$3b62074eb05584b2$export$f297eb839006d339 as gregorianToJulianDay, $3b62074eb05584b2$export$c36e0ecb2d4fa69d as getExtendedYear, $3b62074eb05584b2$export$553d7fa8e3805fc0 as isLeapYear, $3b62074eb05584b2$export$4475b7e617eb123c as fromExtendedYear, $3b62074eb05584b2$export$80ee6245ec4f29ec as GregorianCalendar};\n//# sourceMappingURL=GregorianCalendar.module.js.map\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json\n// Locales starting on Sunday have been removed for compression.\nconst $2fe286d2fb449abb$export$7a5acbd77d414bd9 = {\n '001': 1,\n AD: 1,\n AE: 6,\n AF: 6,\n AI: 1,\n AL: 1,\n AM: 1,\n AN: 1,\n AR: 1,\n AT: 1,\n AU: 1,\n AX: 1,\n AZ: 1,\n BA: 1,\n BE: 1,\n BG: 1,\n BH: 6,\n BM: 1,\n BN: 1,\n BY: 1,\n CH: 1,\n CL: 1,\n CM: 1,\n CN: 1,\n CR: 1,\n CY: 1,\n CZ: 1,\n DE: 1,\n DJ: 6,\n DK: 1,\n DZ: 6,\n EC: 1,\n EE: 1,\n EG: 6,\n ES: 1,\n FI: 1,\n FJ: 1,\n FO: 1,\n FR: 1,\n GB: 1,\n GE: 1,\n GF: 1,\n GP: 1,\n GR: 1,\n HR: 1,\n HU: 1,\n IE: 1,\n IQ: 6,\n IR: 6,\n IS: 1,\n IT: 1,\n JO: 6,\n KG: 1,\n KW: 6,\n KZ: 1,\n LB: 1,\n LI: 1,\n LK: 1,\n LT: 1,\n LU: 1,\n LV: 1,\n LY: 6,\n MC: 1,\n MD: 1,\n ME: 1,\n MK: 1,\n MN: 1,\n MQ: 1,\n MV: 5,\n MY: 1,\n NL: 1,\n NO: 1,\n NZ: 1,\n OM: 6,\n PL: 1,\n QA: 6,\n RE: 1,\n RO: 1,\n RS: 1,\n RU: 1,\n SD: 6,\n SE: 1,\n SI: 1,\n SK: 1,\n SM: 1,\n SY: 6,\n TJ: 1,\n TM: 1,\n TR: 1,\n UA: 1,\n UY: 1,\n UZ: 1,\n VA: 1,\n VN: 1,\n XK: 1\n};\n\n\nexport {$2fe286d2fb449abb$export$7a5acbd77d414bd9 as weekStartData};\n//# sourceMappingURL=weekStartData.module.js.map\n","import {fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, toAbsolute as $11d87f3f76e88657$export$5107c82f94518f5c, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDate as $11d87f3f76e88657$export$93522d1a439f3617} from \"./conversion.mjs\";\nimport {weekStartData as $2fe286d2fb449abb$export$7a5acbd77d414bd9} from \"./weekStartData.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nfunction $14e0f24ef4ac5c92$export$ea39ec197993aef0(a, b) {\n b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);\n return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\nfunction $14e0f24ef4ac5c92$export$a18c89cbd24170ff(a, b) {\n b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);\n // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.\n a = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(a);\n b = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(b);\n return a.era === b.era && a.year === b.year && a.month === b.month;\n}\nfunction $14e0f24ef4ac5c92$export$5841f9eb9773f25f(a, b) {\n b = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(b, a.calendar);\n a = $14e0f24ef4ac5c92$export$f91e89d3d0406102(a);\n b = $14e0f24ef4ac5c92$export$f91e89d3d0406102(b);\n return a.era === b.era && a.year === b.year;\n}\nfunction $14e0f24ef4ac5c92$export$91b62ebf2ba703ee(a, b) {\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\nfunction $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2(a, b) {\n a = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(a);\n b = $14e0f24ef4ac5c92$export$a5a3b454ada2268e(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;\n}\nfunction $14e0f24ef4ac5c92$export$ea840f5a6dda8147(a, b) {\n a = $14e0f24ef4ac5c92$export$f91e89d3d0406102(a);\n b = $14e0f24ef4ac5c92$export$f91e89d3d0406102(b);\n return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;\n}\nfunction $14e0f24ef4ac5c92$export$629b0a497aa65267(date, timeZone) {\n return $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone));\n}\nfunction $14e0f24ef4ac5c92$export$2061056d06d7cdf7(date, locale) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1 - $14e0f24ef4ac5c92$var$getWeekStart(locale)) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n return dayOfWeek;\n}\nfunction $14e0f24ef4ac5c92$export$461939dd4422153(timeZone) {\n return (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(Date.now(), timeZone);\n}\nfunction $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(timeZone) {\n return (0, $11d87f3f76e88657$export$93522d1a439f3617)($14e0f24ef4ac5c92$export$461939dd4422153(timeZone));\n}\nfunction $14e0f24ef4ac5c92$export$68781ddf31c0090f(a, b) {\n return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);\n}\nfunction $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {\n return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);\n}\nfunction $14e0f24ef4ac5c92$var$timeToMs(a) {\n return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;\n}\nfunction $14e0f24ef4ac5c92$export$126c91c941de7e(a, timeZone) {\n let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(a, timeZone);\n let tomorrow = a.add({\n days: 1\n });\n let tomorrowMs = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(tomorrow, timeZone);\n return (tomorrowMs - ms) / 3600000;\n}\nlet $14e0f24ef4ac5c92$var$localTimeZone = null;\nfunction $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {\n // TODO: invalidate this somehow?\n if ($14e0f24ef4ac5c92$var$localTimeZone == null) $14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;\n return $14e0f24ef4ac5c92$var$localTimeZone;\n}\nfunction $14e0f24ef4ac5c92$export$a5a3b454ada2268e(date) {\n // Use `subtract` instead of `set` so we don't get constrained in an era.\n return date.subtract({\n days: date.day - 1\n });\n}\nfunction $14e0f24ef4ac5c92$export$a2258d9c4118825c(date) {\n return date.add({\n days: date.calendar.getDaysInMonth(date) - date.day\n });\n}\nfunction $14e0f24ef4ac5c92$export$f91e89d3d0406102(date) {\n return $14e0f24ef4ac5c92$export$a5a3b454ada2268e(date.subtract({\n months: date.month - 1\n }));\n}\nfunction $14e0f24ef4ac5c92$export$8b7aa55c66d5569e(date) {\n return $14e0f24ef4ac5c92$export$a2258d9c4118825c(date.add({\n months: date.calendar.getMonthsInYear(date) - date.month\n }));\n}\nfunction $14e0f24ef4ac5c92$export$5412ac11713b72ad(date) {\n if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);\n return 1;\n}\nfunction $14e0f24ef4ac5c92$export$b2f4953d301981d5(date) {\n if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);\n return 1;\n}\nfunction $14e0f24ef4ac5c92$export$42c81a444fbfb5d4(date, locale) {\n let dayOfWeek = $14e0f24ef4ac5c92$export$2061056d06d7cdf7(date, locale);\n return date.subtract({\n days: dayOfWeek\n });\n}\nfunction $14e0f24ef4ac5c92$export$ef8b6d9133084f4e(date, locale) {\n return $14e0f24ef4ac5c92$export$42c81a444fbfb5d4(date, locale).add({\n days: 6\n });\n}\nconst $14e0f24ef4ac5c92$var$cachedRegions = new Map();\nfunction $14e0f24ef4ac5c92$var$getRegion(locale) {\n // If the Intl.Locale API is available, use it to get the region for the locale.\n // @ts-ignore\n if (Intl.Locale) {\n // Constructing an Intl.Locale is expensive, so cache the result.\n let region = $14e0f24ef4ac5c92$var$cachedRegions.get(locale);\n if (!region) {\n // @ts-ignore\n region = new Intl.Locale(locale).maximize().region;\n if (region) $14e0f24ef4ac5c92$var$cachedRegions.set(locale, region);\n }\n return region;\n }\n // If not, just try splitting the string.\n // If the second part of the locale string is 'u',\n // then this is a unicode extension, so ignore it.\n // Otherwise, it should be the region.\n let part = locale.split('-')[1];\n return part === 'u' ? undefined : part;\n}\nfunction $14e0f24ef4ac5c92$var$getWeekStart(locale) {\n // TODO: use Intl.Locale for this once browsers support the weekInfo property\n // https://github.com/tc39/proposal-intl-locale-info\n let region = $14e0f24ef4ac5c92$var$getRegion(locale);\n return region ? (0, $2fe286d2fb449abb$export$7a5acbd77d414bd9)[region] || 0 : 0;\n}\nfunction $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(date, locale) {\n let days = date.calendar.getDaysInMonth(date);\n return Math.ceil(($14e0f24ef4ac5c92$export$2061056d06d7cdf7($14e0f24ef4ac5c92$export$a5a3b454ada2268e(date), locale) + days) / 7);\n}\nfunction $14e0f24ef4ac5c92$export$5c333a116e949cdd(a, b) {\n if (a && b) return a.compare(b) <= 0 ? a : b;\n return a || b;\n}\nfunction $14e0f24ef4ac5c92$export$a75f2bff57811055(a, b) {\n if (a && b) return a.compare(b) >= 0 ? a : b;\n return a || b;\n}\nconst $14e0f24ef4ac5c92$var$WEEKEND_DATA = {\n AF: [\n 4,\n 5\n ],\n AE: [\n 5,\n 6\n ],\n BH: [\n 5,\n 6\n ],\n DZ: [\n 5,\n 6\n ],\n EG: [\n 5,\n 6\n ],\n IL: [\n 5,\n 6\n ],\n IQ: [\n 5,\n 6\n ],\n IR: [\n 5,\n 5\n ],\n JO: [\n 5,\n 6\n ],\n KW: [\n 5,\n 6\n ],\n LY: [\n 5,\n 6\n ],\n OM: [\n 5,\n 6\n ],\n QA: [\n 5,\n 6\n ],\n SA: [\n 5,\n 6\n ],\n SD: [\n 5,\n 6\n ],\n SY: [\n 5,\n 6\n ],\n YE: [\n 5,\n 6\n ]\n};\nfunction $14e0f24ef4ac5c92$export$618d60ea299da42(date, locale) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n let region = $14e0f24ef4ac5c92$var$getRegion(locale);\n // Use Intl.Locale for this once weekInfo is supported.\n // https://github.com/tc39/proposal-intl-locale-info\n let [start, end] = $14e0f24ef4ac5c92$var$WEEKEND_DATA[region] || [\n 6,\n 0\n ];\n return dayOfWeek === start || dayOfWeek === end;\n}\nfunction $14e0f24ef4ac5c92$export$ee9d87258e1d19ed(date, locale) {\n return !$14e0f24ef4ac5c92$export$618d60ea299da42(date, locale);\n}\n\n\nexport {$14e0f24ef4ac5c92$export$ea39ec197993aef0 as isSameDay, $14e0f24ef4ac5c92$export$a18c89cbd24170ff as isSameMonth, $14e0f24ef4ac5c92$export$a5a3b454ada2268e as startOfMonth, $14e0f24ef4ac5c92$export$5841f9eb9773f25f as isSameYear, $14e0f24ef4ac5c92$export$f91e89d3d0406102 as startOfYear, $14e0f24ef4ac5c92$export$91b62ebf2ba703ee as isEqualDay, $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2 as isEqualMonth, $14e0f24ef4ac5c92$export$ea840f5a6dda8147 as isEqualYear, $14e0f24ef4ac5c92$export$629b0a497aa65267 as isToday, $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3 as today, $14e0f24ef4ac5c92$export$2061056d06d7cdf7 as getDayOfWeek, $14e0f24ef4ac5c92$export$461939dd4422153 as now, $14e0f24ef4ac5c92$export$68781ddf31c0090f as compareDate, $14e0f24ef4ac5c92$export$c19a80a9721b80f6 as compareTime, $14e0f24ef4ac5c92$export$126c91c941de7e as getHoursInDay, $14e0f24ef4ac5c92$export$aa8b41735afcabd2 as getLocalTimeZone, $14e0f24ef4ac5c92$export$a2258d9c4118825c as endOfMonth, $14e0f24ef4ac5c92$export$8b7aa55c66d5569e as endOfYear, $14e0f24ef4ac5c92$export$5412ac11713b72ad as getMinimumMonthInYear, $14e0f24ef4ac5c92$export$b2f4953d301981d5 as getMinimumDayInMonth, $14e0f24ef4ac5c92$export$42c81a444fbfb5d4 as startOfWeek, $14e0f24ef4ac5c92$export$ef8b6d9133084f4e as endOfWeek, $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 as getWeeksInMonth, $14e0f24ef4ac5c92$export$5c333a116e949cdd as minDate, $14e0f24ef4ac5c92$export$a75f2bff57811055 as maxDate, $14e0f24ef4ac5c92$export$618d60ea299da42 as isWeekend, $14e0f24ef4ac5c92$export$ee9d87258e1d19ed as isWeekday};\n//# sourceMappingURL=queries.module.js.map\n","import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from \"./CalendarDate.mjs\";\nimport {constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2} from \"./manipulation.mjs\";\nimport {getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\nimport {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2} from \"./queries.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\n\n\n\nfunction $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {\n date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);\n return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\nfunction $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\nfunction $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {\n // Fast path for UTC.\n if (timeZone === 'UTC') return 0;\n // Fast path: for local timezone after 1970, use native Date.\n if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -60000;\n let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);\n let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\nconst $11d87f3f76e88657$var$formattersByTimeZone = new Map();\nfunction $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {\n let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone: timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);\n }\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts = {};\n for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour,\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\nconst $11d87f3f76e88657$var$DAYMILLIS = 86400000;\nfunction $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);\n let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);\n}\nfunction $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {\n let found = earlier === later ? [\n earlier\n ] : [\n earlier,\n later\n ];\n return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));\n}\nfunction $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {\n let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;\n}\nfunction $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {\n let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible') {\n dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n if (valid.length === 1) return valid[0];\n if (valid.length > 1) switch(disambiguation){\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n switch(disambiguation){\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\nfunction $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {\n return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));\n}\nfunction $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {\n let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {\n return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);\n}\nfunction $11d87f3f76e88657$export$d7f92bcd3596b086(date) {\n return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\nfunction $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\nfunction $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\nfunction $11d87f3f76e88657$export$4d0393e732857be5(date) {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\nfunction $11d87f3f76e88657$export$b21e0b124e224484(date, time) {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);\n else if ('hour' in date && !time) return date;\n if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);\n return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\nfunction $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {\n if (date.calendar.identifier === calendar.identifier) return date;\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);\n return copy;\n}\nfunction $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {\n if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {\n if (date.timeZone === timeZone) return date;\n return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);\n }\n let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);\n return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);\n}\nfunction $11d87f3f76e88657$export$83aac07b4c37b25(date) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return new Date(ms);\n}\nfunction $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);\n}\nfunction $11d87f3f76e88657$export$d9b67bc93c097491(date) {\n return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\n\n\nexport {$11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$136f38efe7caf549 as possibleAbsolutes, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$d7f92bcd3596b086 as fromDateToLocal, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$6f4d78149f3f53ac as toDateFields, $11d87f3f76e88657$export$4d0393e732857be5 as toTimeFields, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone};\n//# sourceMappingURL=conversion.module.js.map\n","import {epochFromDate as $11d87f3f76e88657$export$bd4fb2bc8bb06fb, fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, toAbsolute as $11d87f3f76e88657$export$5107c82f94518f5c, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484} from \"./conversion.mjs\";\nimport {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nconst $735220c2d4774dd3$var$ONE_HOUR = 3600000;\nfunction $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {\n let mutableDate = date.copy();\n let days = 'hour' in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;\n $735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);\n if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);\n mutableDate.month += duration.months || 0;\n $735220c2d4774dd3$var$balanceYearMonth(mutableDate);\n $735220c2d4774dd3$var$constrainMonthDay(mutableDate);\n mutableDate.day += (duration.weeks || 0) * 7;\n mutableDate.day += duration.days || 0;\n mutableDate.day += days;\n $735220c2d4774dd3$var$balanceDay(mutableDate);\n if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);\n // Constrain in case adding ended up with a date outside the valid range for the calendar system.\n // The behavior here is slightly different than when constraining in the `set` function in that\n // we adjust smaller fields to their minimum/maximum values rather than constraining each field\n // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.\n if (mutableDate.year < 1) {\n mutableDate.year = 1;\n mutableDate.month = 1;\n mutableDate.day = 1;\n }\n let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);\n if (mutableDate.year > maxYear) {\n var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;\n let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);\n mutableDate.year = maxYear;\n mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);\n mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);\n }\n if (mutableDate.month < 1) {\n mutableDate.month = 1;\n mutableDate.day = 1;\n }\n let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);\n if (mutableDate.month > maxMonth) {\n mutableDate.month = maxMonth;\n mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);\n }\n mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));\n return mutableDate;\n}\nfunction $735220c2d4774dd3$var$addYears(date, years) {\n var _date_calendar_isInverseEra, _date_calendar;\n if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date)) years = -years;\n date.year += years;\n}\nfunction $735220c2d4774dd3$var$balanceYearMonth(date) {\n while(date.month < 1){\n $735220c2d4774dd3$var$addYears(date, -1);\n date.month += date.calendar.getMonthsInYear(date);\n }\n let monthsInYear = 0;\n while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){\n date.month -= monthsInYear;\n $735220c2d4774dd3$var$addYears(date, 1);\n }\n}\nfunction $735220c2d4774dd3$var$balanceDay(date) {\n while(date.day < 1){\n date.month--;\n $735220c2d4774dd3$var$balanceYearMonth(date);\n date.day += date.calendar.getDaysInMonth(date);\n }\n while(date.day > date.calendar.getDaysInMonth(date)){\n date.day -= date.calendar.getDaysInMonth(date);\n date.month++;\n $735220c2d4774dd3$var$balanceYearMonth(date);\n }\n}\nfunction $735220c2d4774dd3$var$constrainMonthDay(date) {\n date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));\n date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));\n}\nfunction $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {\n if (date.calendar.constrainDate) date.calendar.constrainDate(date);\n date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));\n $735220c2d4774dd3$var$constrainMonthDay(date);\n}\nfunction $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {\n let inverseDuration = {};\n for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];\n return inverseDuration;\n}\nfunction $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {\n return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));\n}\nfunction $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {\n let mutableDate = date.copy();\n if (fields.era != null) mutableDate.era = fields.era;\n if (fields.year != null) mutableDate.year = fields.year;\n if (fields.month != null) mutableDate.month = fields.month;\n if (fields.day != null) mutableDate.day = fields.day;\n $735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);\n return mutableDate;\n}\nfunction $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {\n let mutableValue = value.copy();\n if (fields.hour != null) mutableValue.hour = fields.hour;\n if (fields.minute != null) mutableValue.minute = fields.minute;\n if (fields.second != null) mutableValue.second = fields.second;\n if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;\n $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);\n return mutableValue;\n}\nfunction $735220c2d4774dd3$var$balanceTime(time) {\n time.second += Math.floor(time.millisecond / 1000);\n time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);\n time.minute += Math.floor(time.second / 60);\n time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);\n time.hour += Math.floor(time.minute / 60);\n time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);\n let days = Math.floor(time.hour / 24);\n time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);\n return days;\n}\nfunction $735220c2d4774dd3$export$7555de1e070510cb(time) {\n time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));\n time.second = Math.max(0, Math.min(time.second, 59));\n time.minute = Math.max(0, Math.min(time.minute, 59));\n time.hour = Math.max(0, Math.min(time.hour, 23));\n}\nfunction $735220c2d4774dd3$var$nonNegativeMod(a, b) {\n let result = a % b;\n if (result < 0) result += b;\n return result;\n}\nfunction $735220c2d4774dd3$var$addTimeFields(time, duration) {\n time.hour += duration.hours || 0;\n time.minute += duration.minutes || 0;\n time.second += duration.seconds || 0;\n time.millisecond += duration.milliseconds || 0;\n return $735220c2d4774dd3$var$balanceTime(time);\n}\nfunction $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {\n let res = time.copy();\n $735220c2d4774dd3$var$addTimeFields(res, duration);\n return res;\n}\nfunction $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {\n return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));\n}\nfunction $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {\n let mutable = value.copy();\n switch(field){\n case 'era':\n {\n let eras = value.calendar.getEras();\n let eraIndex = eras.indexOf(value.era);\n if (eraIndex < 0) throw new Error('Invalid era: ' + value.era);\n eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);\n mutable.era = eras[eraIndex];\n // Constrain the year and other fields within the era, so the era doesn't change when we balance below.\n $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);\n break;\n }\n case 'year':\n var _mutable_calendar_isInverseEra, _mutable_calendar;\n if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;\n // The year field should not cycle within the era as that can cause weird behavior affecting other fields.\n // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back\n // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.\n mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);\n if (mutable.year === -Infinity) mutable.year = 1;\n if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);\n break;\n case 'month':\n mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);\n break;\n case 'day':\n mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);\n break;\n default:\n throw new Error('Unsupported field ' + field);\n }\n if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);\n $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);\n return mutable;\n}\nfunction $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {\n let mutable = value.copy();\n switch(field){\n case 'hour':\n {\n let hours = value.hour;\n let min = 0;\n let max = 23;\n if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {\n let isPM = hours >= 12;\n min = isPM ? 12 : 0;\n max = isPM ? 23 : 11;\n }\n mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);\n break;\n }\n case 'minute':\n mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);\n break;\n case 'second':\n mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);\n break;\n case 'millisecond':\n mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);\n break;\n default:\n throw new Error('Unsupported field ' + field);\n }\n return mutable;\n}\nfunction $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {\n if (round) {\n value += Math.sign(amount);\n if (value < min) value = max;\n let div = Math.abs(amount);\n if (amount > 0) value = Math.ceil(value / div) * div;\n else value = Math.floor(value / div) * div;\n if (value > max) value = min;\n } else {\n value += amount;\n if (value < min) value = max - (min - value - 1);\n else if (value > max) value = min + (value - max - 1);\n }\n return value;\n}\nfunction $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {\n let ms;\n if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {\n let res = $735220c2d4774dd3$export$e16d8520af44a096((0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime), {\n years: duration.years,\n months: duration.months,\n weeks: duration.weeks,\n days: duration.days\n });\n // Changing the date may change the timezone offset, so we need to recompute\n // using the 'compatible' disambiguation.\n ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);\n } else // Otherwise, preserve the offset of the original date.\n ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;\n // Perform time manipulation in milliseconds rather than on the original time fields to account for DST.\n // For example, adding one hour during a DST transition may result in the hour field staying the same or\n // skipping an hour. This results in the offset field changing value instead of the specified field.\n ms += duration.milliseconds || 0;\n ms += (duration.seconds || 0) * 1000;\n ms += (duration.minutes || 0) * 60000;\n ms += (duration.hours || 0) * 3600000;\n let res = (0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone);\n return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)(res, dateTime.calendar);\n}\nfunction $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {\n return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));\n}\nfunction $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {\n // For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.\n // For time fields, we want the time to change by the amount given. This may result in the hour field staying the same, but the UTC\n // offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.\n switch(field){\n case 'hour':\n {\n let min = 0;\n let max = 23;\n if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {\n let isPM = dateTime.hour >= 12;\n min = isPM ? 12 : 0;\n max = isPM ? 23 : 11;\n }\n // The minimum and maximum hour may be affected by daylight saving time.\n // For example, it might jump forward at midnight, and skip 1am.\n // Or it might end at midnight and repeat the 11pm hour. To handle this, we get\n // the possible absolute times for the min and max, and find the maximum range\n // that is within the current day.\n let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime);\n let minDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {\n hour: min\n }), new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n let minAbsolute = [\n (0, $11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'earlier'),\n (0, $11d87f3f76e88657$export$5107c82f94518f5c)(minDate, dateTime.timeZone, 'later')\n ].filter((ms)=>(0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === minDate.day)[0];\n let maxDate = (0, $11d87f3f76e88657$export$b4a036af3fc0b032)($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {\n hour: max\n }), new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n let maxAbsolute = [\n (0, $11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'earlier'),\n (0, $11d87f3f76e88657$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, 'later')\n ].filter((ms)=>(0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === maxDate.day).pop();\n // Since hours may repeat, we need to operate on the absolute time in milliseconds.\n // This is done in hours from the Unix epoch so that cycleValue works correctly,\n // and then converted back to milliseconds.\n let ms = (0, $11d87f3f76e88657$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;\n let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);\n let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;\n ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;\n // Now compute the new timezone offset, and convert the absolute time back to local time.\n return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);\n }\n case 'minute':\n case 'second':\n case 'millisecond':\n // @ts-ignore\n return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n {\n let res = $735220c2d4774dd3$export$d52ced6badfb9a4c((0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime), field, amount, options);\n let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone);\n return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);\n }\n default:\n throw new Error('Unsupported field ' + field);\n }\n}\nfunction $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {\n // Set the date/time fields, and recompute the UTC offset to account for DST changes.\n // We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.\n let plainDateTime = (0, $11d87f3f76e88657$export$b21e0b124e224484)(dateTime);\n let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);\n // If the resulting plain date time values are equal, return the original time.\n // We don't want to change the offset when setting the time to the same value.\n if (res.compare(plainDateTime) === 0) return dateTime;\n let ms = (0, $11d87f3f76e88657$export$5107c82f94518f5c)(res, dateTime.timeZone, disambiguation);\n return (0, $11d87f3f76e88657$export$b4a036af3fc0b032)((0, $11d87f3f76e88657$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);\n}\n\n\nexport {$735220c2d4774dd3$export$e16d8520af44a096 as add, $735220c2d4774dd3$export$c4e2ecac49351ef2 as constrain, $735220c2d4774dd3$export$3e2544e88a25bff8 as invertDuration, $735220c2d4774dd3$export$4e2d2ead65e5f7e3 as subtract, $735220c2d4774dd3$export$adaa4cf7ef1b65be as set, $735220c2d4774dd3$export$e5d5e1c1822b6e56 as setTime, $735220c2d4774dd3$export$7555de1e070510cb as constrainTime, $735220c2d4774dd3$export$7ed87b6bc2506470 as addTime, $735220c2d4774dd3$export$fe34d3a381cd7501 as subtractTime, $735220c2d4774dd3$export$d52ced6badfb9a4c as cycleDate, $735220c2d4774dd3$export$dd02b3e0007dfe28 as cycleTime, $735220c2d4774dd3$export$96b1d28349274637 as addZoned, $735220c2d4774dd3$export$6814caac34ca03c7 as subtractZoned, $735220c2d4774dd3$export$9a297d111fc86b79 as cycleZoned, $735220c2d4774dd3$export$31b5430eb18be4f8 as setZoned};\n//# sourceMappingURL=manipulation.module.js.map\n","import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from \"./CalendarDate.mjs\";\nimport {epochFromDate as $11d87f3f76e88657$export$bd4fb2bc8bb06fb, fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, possibleAbsolutes as $11d87f3f76e88657$export$136f38efe7caf549, toAbsolute as $11d87f3f76e88657$export$5107c82f94518f5c, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toTimeZone as $11d87f3f76e88657$export$538b00033cc11c75} from \"./conversion.mjs\";\nimport {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2} from \"./queries.mjs\";\nimport {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\nconst $fae977aafc393c5c$var$TIME_RE = /^(\\d{2})(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?$/;\nconst $fae977aafc393c5c$var$DATE_RE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst $fae977aafc393c5c$var$DATE_TIME_RE = /^(\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?$/;\nconst $fae977aafc393c5c$var$ZONED_DATE_TIME_RE = /^(\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?(?:([+-]\\d{2})(?::?(\\d{2}))?)?\\[(.*?)\\]$/;\nconst $fae977aafc393c5c$var$ABSOLUTE_RE = /^(\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}))?(?::(\\d{2}))?(?::(\\d{2}))?(\\.\\d+)?(?:(?:([+-]\\d{2})(?::?(\\d{2}))?)|Z)$/;\nconst $fae977aafc393c5c$var$DATE_TIME_DURATION_RE = /^((?-)|\\+)?P((?\\d*)Y)?((?\\d*)M)?((?\\d*)W)?((?\\d*)D)?((?