@internationalized/date 3.5.3-nightly.4555 → 3.5.3-nightly.4558

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/BuddhistCalendar.main.js +54 -0
  2. package/dist/BuddhistCalendar.main.js.map +1 -0
  3. package/dist/BuddhistCalendar.mjs +49 -0
  4. package/dist/BuddhistCalendar.module.js +49 -0
  5. package/dist/BuddhistCalendar.module.js.map +1 -0
  6. package/dist/CalendarDate.main.js +260 -0
  7. package/dist/CalendarDate.main.js.map +1 -0
  8. package/dist/CalendarDate.mjs +252 -0
  9. package/dist/CalendarDate.module.js +252 -0
  10. package/dist/CalendarDate.module.js.map +1 -0
  11. package/dist/DateFormatter.main.js +145 -0
  12. package/dist/DateFormatter.main.js.map +1 -0
  13. package/dist/DateFormatter.mjs +140 -0
  14. package/dist/DateFormatter.module.js +140 -0
  15. package/dist/DateFormatter.module.js.map +1 -0
  16. package/dist/EthiopicCalendar.main.js +170 -0
  17. package/dist/EthiopicCalendar.main.js.map +1 -0
  18. package/dist/EthiopicCalendar.mjs +163 -0
  19. package/dist/EthiopicCalendar.module.js +163 -0
  20. package/dist/EthiopicCalendar.module.js.map +1 -0
  21. package/dist/GregorianCalendar.main.js +143 -0
  22. package/dist/GregorianCalendar.main.js.map +1 -0
  23. package/dist/GregorianCalendar.mjs +134 -0
  24. package/dist/GregorianCalendar.module.js +134 -0
  25. package/dist/GregorianCalendar.module.js.map +1 -0
  26. package/dist/HebrewCalendar.main.js +149 -0
  27. package/dist/HebrewCalendar.main.js.map +1 -0
  28. package/dist/HebrewCalendar.mjs +144 -0
  29. package/dist/HebrewCalendar.module.js +144 -0
  30. package/dist/HebrewCalendar.module.js.map +1 -0
  31. package/dist/IndianCalendar.main.js +107 -0
  32. package/dist/IndianCalendar.main.js.map +1 -0
  33. package/dist/IndianCalendar.mjs +102 -0
  34. package/dist/IndianCalendar.module.js +102 -0
  35. package/dist/IndianCalendar.module.js.map +1 -0
  36. package/dist/IslamicCalendar.main.js +164 -0
  37. package/dist/IslamicCalendar.main.js.map +1 -0
  38. package/dist/IslamicCalendar.mjs +157 -0
  39. package/dist/IslamicCalendar.module.js +157 -0
  40. package/dist/IslamicCalendar.module.js.map +1 -0
  41. package/dist/JapaneseCalendar.main.js +180 -0
  42. package/dist/JapaneseCalendar.main.js.map +1 -0
  43. package/dist/JapaneseCalendar.mjs +175 -0
  44. package/dist/JapaneseCalendar.module.js +175 -0
  45. package/dist/JapaneseCalendar.module.js.map +1 -0
  46. package/dist/PersianCalendar.main.js +81 -0
  47. package/dist/PersianCalendar.main.js.map +1 -0
  48. package/dist/PersianCalendar.mjs +76 -0
  49. package/dist/PersianCalendar.module.js +76 -0
  50. package/dist/PersianCalendar.module.js.map +1 -0
  51. package/dist/TaiwanCalendar.main.js +81 -0
  52. package/dist/TaiwanCalendar.main.js.map +1 -0
  53. package/dist/TaiwanCalendar.mjs +76 -0
  54. package/dist/TaiwanCalendar.module.js +76 -0
  55. package/dist/TaiwanCalendar.module.js.map +1 -0
  56. package/dist/conversion.main.js +236 -0
  57. package/dist/conversion.main.js.map +1 -0
  58. package/dist/conversion.mjs +218 -0
  59. package/dist/conversion.module.js +218 -0
  60. package/dist/conversion.module.js.map +1 -0
  61. package/dist/createCalendar.main.js +69 -0
  62. package/dist/createCalendar.main.js.map +1 -0
  63. package/dist/createCalendar.mjs +64 -0
  64. package/dist/createCalendar.module.js +64 -0
  65. package/dist/createCalendar.module.js.map +1 -0
  66. package/dist/import.mjs +15 -2534
  67. package/dist/main.js +75 -2594
  68. package/dist/main.js.map +1 -1
  69. package/dist/manipulation.main.js +362 -0
  70. package/dist/manipulation.main.js.map +1 -0
  71. package/dist/manipulation.mjs +344 -0
  72. package/dist/manipulation.module.js +344 -0
  73. package/dist/manipulation.module.js.map +1 -0
  74. package/dist/module.js +15 -2534
  75. package/dist/module.js.map +1 -1
  76. package/dist/queries.main.js +287 -0
  77. package/dist/queries.main.js.map +1 -0
  78. package/dist/queries.mjs +256 -0
  79. package/dist/queries.module.js +256 -0
  80. package/dist/queries.module.js.map +1 -0
  81. package/dist/string.main.js +171 -0
  82. package/dist/string.main.js.map +1 -0
  83. package/dist/string.mjs +156 -0
  84. package/dist/string.module.js +156 -0
  85. package/dist/string.module.js.map +1 -0
  86. package/dist/utils.main.js +33 -0
  87. package/dist/utils.main.js.map +1 -0
  88. package/dist/utils.mjs +28 -0
  89. package/dist/utils.module.js +28 -0
  90. package/dist/utils.module.js.map +1 -0
  91. package/dist/weekStartData.main.js +118 -0
  92. package/dist/weekStartData.main.js.map +1 -0
  93. package/dist/weekStartData.mjs +113 -0
  94. package/dist/weekStartData.module.js +113 -0
  95. package/dist/weekStartData.module.js.map +1 -0
  96. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -1,2435 +1,84 @@
1
- var $kgI3C$swchelperscjs_class_private_field_initcjs = require("@swc/helpers/cjs/_class_private_field_init.cjs");
1
+ var $625ad1e1f4c43bc1$exports = require("./CalendarDate.main.js");
2
+ var $af14c9812fdceb33$exports = require("./GregorianCalendar.main.js");
3
+ var $b0ac0602ef646b2c$exports = require("./JapaneseCalendar.main.js");
4
+ var $561c4ef058278b74$exports = require("./BuddhistCalendar.main.js");
5
+ var $9cc5d3577ec40243$exports = require("./TaiwanCalendar.main.js");
6
+ var $3c060181fc7249ae$exports = require("./PersianCalendar.main.js");
7
+ var $5f1dfa5c67609fe6$exports = require("./IndianCalendar.main.js");
8
+ var $ecb2c4cc8c9aae25$exports = require("./IslamicCalendar.main.js");
9
+ var $0f5324ee3bdd9396$exports = require("./HebrewCalendar.main.js");
10
+ var $4db04d1051af0f2f$exports = require("./EthiopicCalendar.main.js");
11
+ var $4922c0a5a69da0ba$exports = require("./createCalendar.main.js");
12
+ var $4ae0260a69729f1d$exports = require("./conversion.main.js");
13
+ var $1f0f7ebf1ae6c530$exports = require("./queries.main.js");
14
+ var $4c32e2d98e5a5134$exports = require("./string.main.js");
15
+ var $8f23a04ae90a588b$exports = require("./DateFormatter.main.js");
2
16
 
3
17
 
4
18
  function $parcel$export(e, n, v, s) {
5
19
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
20
  }
7
21
 
8
- $parcel$export(module.exports, "CalendarDate", () => $625ad1e1f4c43bc1$export$99faa760c7908e4f);
9
- $parcel$export(module.exports, "CalendarDateTime", () => $625ad1e1f4c43bc1$export$ca871e8dbb80966f);
10
- $parcel$export(module.exports, "Time", () => $625ad1e1f4c43bc1$export$680ea196effce5f);
11
- $parcel$export(module.exports, "ZonedDateTime", () => $625ad1e1f4c43bc1$export$d3b7288e7994edea);
12
- $parcel$export(module.exports, "GregorianCalendar", () => $af14c9812fdceb33$export$80ee6245ec4f29ec);
13
- $parcel$export(module.exports, "JapaneseCalendar", () => $b0ac0602ef646b2c$export$b746ab2b60cdffbf);
14
- $parcel$export(module.exports, "BuddhistCalendar", () => $561c4ef058278b74$export$42d20a78301dee44);
15
- $parcel$export(module.exports, "TaiwanCalendar", () => $9cc5d3577ec40243$export$65e01080afcb0799);
16
- $parcel$export(module.exports, "PersianCalendar", () => $3c060181fc7249ae$export$37fccdbfd14c5939);
17
- $parcel$export(module.exports, "IndianCalendar", () => $5f1dfa5c67609fe6$export$39f31c639fa15726);
18
- $parcel$export(module.exports, "IslamicCivilCalendar", () => $ecb2c4cc8c9aae25$export$2066795aadd37bfc);
19
- $parcel$export(module.exports, "IslamicTabularCalendar", () => $ecb2c4cc8c9aae25$export$37f0887f2f9d22f7);
20
- $parcel$export(module.exports, "IslamicUmalquraCalendar", () => $ecb2c4cc8c9aae25$export$5baab4758c231076);
21
- $parcel$export(module.exports, "HebrewCalendar", () => $0f5324ee3bdd9396$export$ca405048b8fb5af);
22
- $parcel$export(module.exports, "EthiopicCalendar", () => $4db04d1051af0f2f$export$26ba6eab5e20cd7d);
23
- $parcel$export(module.exports, "EthiopicAmeteAlemCalendar", () => $4db04d1051af0f2f$export$d72e0c37005a4914);
24
- $parcel$export(module.exports, "CopticCalendar", () => $4db04d1051af0f2f$export$fe6243cbe1a4b7c1);
25
- $parcel$export(module.exports, "createCalendar", () => $4922c0a5a69da0ba$export$dd0bbc9b26defe37);
26
- $parcel$export(module.exports, "toCalendarDate", () => $4ae0260a69729f1d$export$93522d1a439f3617);
27
- $parcel$export(module.exports, "toCalendarDateTime", () => $4ae0260a69729f1d$export$b21e0b124e224484);
28
- $parcel$export(module.exports, "toTime", () => $4ae0260a69729f1d$export$d33f79e3ffc3dc83);
29
- $parcel$export(module.exports, "toCalendar", () => $4ae0260a69729f1d$export$b4a036af3fc0b032);
30
- $parcel$export(module.exports, "toZoned", () => $4ae0260a69729f1d$export$84c95a83c799e074);
31
- $parcel$export(module.exports, "toTimeZone", () => $4ae0260a69729f1d$export$538b00033cc11c75);
32
- $parcel$export(module.exports, "toLocalTimeZone", () => $4ae0260a69729f1d$export$d9b67bc93c097491);
33
- $parcel$export(module.exports, "fromDate", () => $4ae0260a69729f1d$export$e57ff100d91bd4b9);
34
- $parcel$export(module.exports, "fromAbsolute", () => $4ae0260a69729f1d$export$1b96692a1ba042ac);
35
- $parcel$export(module.exports, "isSameDay", () => $1f0f7ebf1ae6c530$export$ea39ec197993aef0);
36
- $parcel$export(module.exports, "isSameMonth", () => $1f0f7ebf1ae6c530$export$a18c89cbd24170ff);
37
- $parcel$export(module.exports, "isSameYear", () => $1f0f7ebf1ae6c530$export$5841f9eb9773f25f);
38
- $parcel$export(module.exports, "isEqualDay", () => $1f0f7ebf1ae6c530$export$91b62ebf2ba703ee);
39
- $parcel$export(module.exports, "isEqualMonth", () => $1f0f7ebf1ae6c530$export$5a8da0c44a3afdf2);
40
- $parcel$export(module.exports, "isEqualYear", () => $1f0f7ebf1ae6c530$export$ea840f5a6dda8147);
41
- $parcel$export(module.exports, "isToday", () => $1f0f7ebf1ae6c530$export$629b0a497aa65267);
42
- $parcel$export(module.exports, "getDayOfWeek", () => $1f0f7ebf1ae6c530$export$2061056d06d7cdf7);
43
- $parcel$export(module.exports, "now", () => $1f0f7ebf1ae6c530$export$461939dd4422153);
44
- $parcel$export(module.exports, "today", () => $1f0f7ebf1ae6c530$export$d0bdf45af03a6ea3);
45
- $parcel$export(module.exports, "getHoursInDay", () => $1f0f7ebf1ae6c530$export$126c91c941de7e);
46
- $parcel$export(module.exports, "getLocalTimeZone", () => $1f0f7ebf1ae6c530$export$aa8b41735afcabd2);
47
- $parcel$export(module.exports, "startOfMonth", () => $1f0f7ebf1ae6c530$export$a5a3b454ada2268e);
48
- $parcel$export(module.exports, "startOfWeek", () => $1f0f7ebf1ae6c530$export$42c81a444fbfb5d4);
49
- $parcel$export(module.exports, "startOfYear", () => $1f0f7ebf1ae6c530$export$f91e89d3d0406102);
50
- $parcel$export(module.exports, "endOfMonth", () => $1f0f7ebf1ae6c530$export$a2258d9c4118825c);
51
- $parcel$export(module.exports, "endOfWeek", () => $1f0f7ebf1ae6c530$export$ef8b6d9133084f4e);
52
- $parcel$export(module.exports, "endOfYear", () => $1f0f7ebf1ae6c530$export$8b7aa55c66d5569e);
53
- $parcel$export(module.exports, "getMinimumMonthInYear", () => $1f0f7ebf1ae6c530$export$5412ac11713b72ad);
54
- $parcel$export(module.exports, "getMinimumDayInMonth", () => $1f0f7ebf1ae6c530$export$b2f4953d301981d5);
55
- $parcel$export(module.exports, "getWeeksInMonth", () => $1f0f7ebf1ae6c530$export$ccc1b2479e7dd654);
56
- $parcel$export(module.exports, "minDate", () => $1f0f7ebf1ae6c530$export$5c333a116e949cdd);
57
- $parcel$export(module.exports, "maxDate", () => $1f0f7ebf1ae6c530$export$a75f2bff57811055);
58
- $parcel$export(module.exports, "isWeekend", () => $1f0f7ebf1ae6c530$export$618d60ea299da42);
59
- $parcel$export(module.exports, "isWeekday", () => $1f0f7ebf1ae6c530$export$ee9d87258e1d19ed);
60
- $parcel$export(module.exports, "parseDate", () => $4c32e2d98e5a5134$export$6b862160d295c8e);
61
- $parcel$export(module.exports, "parseDateTime", () => $4c32e2d98e5a5134$export$588937bcd60ade55);
62
- $parcel$export(module.exports, "parseTime", () => $4c32e2d98e5a5134$export$c9698ec7f05a07e1);
63
- $parcel$export(module.exports, "parseAbsolute", () => $4c32e2d98e5a5134$export$5adfdab05168c219);
64
- $parcel$export(module.exports, "parseAbsoluteToLocal", () => $4c32e2d98e5a5134$export$8e384432362ed0f0);
65
- $parcel$export(module.exports, "parseZonedDateTime", () => $4c32e2d98e5a5134$export$fd7893f06e92a6a4);
66
- $parcel$export(module.exports, "parseDuration", () => $4c32e2d98e5a5134$export$ecae829bb3747ea6);
67
- $parcel$export(module.exports, "DateFormatter", () => $8f23a04ae90a588b$export$ad991b66133851cf);
68
- /*
69
- * Copyright 2020 Adobe. All rights reserved.
70
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
71
- * you may not use this file except in compliance with the License. You may obtain a copy
72
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
73
- *
74
- * Unless required by applicable law or agreed to in writing, software distributed under
75
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
76
- * OF ANY KIND, either express or implied. See the License for the specific language
77
- * governing permissions and limitations under the License.
78
- */ /*
79
- * Copyright 2020 Adobe. All rights reserved.
80
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
81
- * you may not use this file except in compliance with the License. You may obtain a copy
82
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
83
- *
84
- * Unless required by applicable law or agreed to in writing, software distributed under
85
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
86
- * OF ANY KIND, either express or implied. See the License for the specific language
87
- * governing permissions and limitations under the License.
88
- */
89
- /*
90
- * Copyright 2020 Adobe. All rights reserved.
91
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
92
- * you may not use this file except in compliance with the License. You may obtain a copy
93
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
94
- *
95
- * Unless required by applicable law or agreed to in writing, software distributed under
96
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
97
- * OF ANY KIND, either express or implied. See the License for the specific language
98
- * governing permissions and limitations under the License.
99
- */ /*
100
- * Copyright 2020 Adobe. All rights reserved.
101
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
102
- * you may not use this file except in compliance with the License. You may obtain a copy
103
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
104
- *
105
- * Unless required by applicable law or agreed to in writing, software distributed under
106
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
107
- * OF ANY KIND, either express or implied. See the License for the specific language
108
- * governing permissions and limitations under the License.
109
- */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
110
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
111
-
112
-
113
- /*
114
- * Copyright 2020 Adobe. All rights reserved.
115
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
116
- * you may not use this file except in compliance with the License. You may obtain a copy
117
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
118
- *
119
- * Unless required by applicable law or agreed to in writing, software distributed under
120
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
121
- * OF ANY KIND, either express or implied. See the License for the specific language
122
- * governing permissions and limitations under the License.
123
- */ // Portions of the code in this file are based on code from ICU.
124
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
125
-
126
- /*
127
- * Copyright 2020 Adobe. All rights reserved.
128
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
129
- * you may not use this file except in compliance with the License. You may obtain a copy
130
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
131
- *
132
- * Unless required by applicable law or agreed to in writing, software distributed under
133
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
134
- * OF ANY KIND, either express or implied. See the License for the specific language
135
- * governing permissions and limitations under the License.
136
- */
137
- function $a5090d6430502238$export$842a2cf37af977e1(amount, numerator) {
138
- return amount - numerator * Math.floor(amount / numerator);
139
- }
140
- function $a5090d6430502238$export$784d13d8ee351f07(date) {
141
- if (date.era) return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(date.calendar, date.era, date.year, date.month, date.day);
142
- else return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(date.calendar, date.year, date.month, date.day);
143
- }
144
- function $a5090d6430502238$export$27fa0172ae2644b3(date) {
145
- if (date.era) return new (0, $625ad1e1f4c43bc1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
146
- else return new (0, $625ad1e1f4c43bc1$export$ca871e8dbb80966f)(date.calendar, date.year, date.month, date.day, date.hour, date.minute, date.second);
147
- }
148
-
149
-
150
- const $af14c9812fdceb33$var$EPOCH = 1721426; // 001/01/03 Julian C.E.
151
- function $af14c9812fdceb33$export$f297eb839006d339(era, year, month, day) {
152
- year = $af14c9812fdceb33$export$c36e0ecb2d4fa69d(era, year);
153
- let y1 = year - 1;
154
- let monthOffset = -2;
155
- if (month <= 2) monthOffset = 0;
156
- else if ($af14c9812fdceb33$export$553d7fa8e3805fc0(year)) monthOffset = -1;
157
- return $af14c9812fdceb33$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);
158
- }
159
- function $af14c9812fdceb33$export$553d7fa8e3805fc0(year) {
160
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
161
- }
162
- function $af14c9812fdceb33$export$c36e0ecb2d4fa69d(era, year) {
163
- return era === "BC" ? 1 - year : year;
164
- }
165
- function $af14c9812fdceb33$export$4475b7e617eb123c(year) {
166
- let era = "AD";
167
- if (year <= 0) {
168
- era = "BC";
169
- year = 1 - year;
170
- }
171
- return [
172
- era,
173
- year
174
- ];
175
- }
176
- const $af14c9812fdceb33$var$daysInMonth = {
177
- standard: [
178
- 31,
179
- 28,
180
- 31,
181
- 30,
182
- 31,
183
- 30,
184
- 31,
185
- 31,
186
- 30,
187
- 31,
188
- 30,
189
- 31
190
- ],
191
- leapyear: [
192
- 31,
193
- 29,
194
- 31,
195
- 30,
196
- 31,
197
- 30,
198
- 31,
199
- 31,
200
- 30,
201
- 31,
202
- 30,
203
- 31
204
- ]
205
- };
206
- class $af14c9812fdceb33$export$80ee6245ec4f29ec {
207
- fromJulianDay(jd) {
208
- let jd0 = jd;
209
- let depoch = jd0 - $af14c9812fdceb33$var$EPOCH;
210
- let quadricent = Math.floor(depoch / 146097);
211
- let dqc = (0, $a5090d6430502238$export$842a2cf37af977e1)(depoch, 146097);
212
- let cent = Math.floor(dqc / 36524);
213
- let dcent = (0, $a5090d6430502238$export$842a2cf37af977e1)(dqc, 36524);
214
- let quad = Math.floor(dcent / 1461);
215
- let dquad = (0, $a5090d6430502238$export$842a2cf37af977e1)(dcent, 1461);
216
- let yindex = Math.floor(dquad / 365);
217
- let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
218
- let [era, year] = $af14c9812fdceb33$export$4475b7e617eb123c(extendedYear);
219
- let yearDay = jd0 - $af14c9812fdceb33$export$f297eb839006d339(era, year, 1, 1);
220
- let leapAdj = 2;
221
- if (jd0 < $af14c9812fdceb33$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
222
- else if ($af14c9812fdceb33$export$553d7fa8e3805fc0(year)) leapAdj = 1;
223
- let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
224
- let day = jd0 - $af14c9812fdceb33$export$f297eb839006d339(era, year, month, 1) + 1;
225
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(era, year, month, day);
226
- }
227
- toJulianDay(date) {
228
- return $af14c9812fdceb33$export$f297eb839006d339(date.era, date.year, date.month, date.day);
229
- }
230
- getDaysInMonth(date) {
231
- return $af14c9812fdceb33$var$daysInMonth[$af14c9812fdceb33$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
232
- }
233
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
234
- getMonthsInYear(date) {
235
- return 12;
236
- }
237
- getDaysInYear(date) {
238
- return $af14c9812fdceb33$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
239
- }
240
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
241
- getYearsInEra(date) {
242
- return 9999;
243
- }
244
- getEras() {
245
- return [
246
- "BC",
247
- "AD"
248
- ];
249
- }
250
- isInverseEra(date) {
251
- return date.era === "BC";
252
- }
253
- balanceDate(date) {
254
- if (date.year <= 0) {
255
- date.era = date.era === "BC" ? "AD" : "BC";
256
- date.year = 1 - date.year;
257
- }
258
- }
259
- constructor(){
260
- this.identifier = "gregory";
261
- }
262
- }
263
-
264
-
265
- /*
266
- * Copyright 2020 Adobe. All rights reserved.
267
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
268
- * you may not use this file except in compliance with the License. You may obtain a copy
269
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
270
- *
271
- * Unless required by applicable law or agreed to in writing, software distributed under
272
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
273
- * OF ANY KIND, either express or implied. See the License for the specific language
274
- * governing permissions and limitations under the License.
275
- */
276
- /*
277
- * Copyright 2020 Adobe. All rights reserved.
278
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
279
- * you may not use this file except in compliance with the License. You may obtain a copy
280
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
281
- *
282
- * Unless required by applicable law or agreed to in writing, software distributed under
283
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
284
- * OF ANY KIND, either express or implied. See the License for the specific language
285
- * governing permissions and limitations under the License.
286
- */ // Data from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json
287
- // Locales starting on Sunday have been removed for compression.
288
- const $4d88eff242b38a9e$export$7a5acbd77d414bd9 = {
289
- "001": 1,
290
- AD: 1,
291
- AE: 6,
292
- AF: 6,
293
- AI: 1,
294
- AL: 1,
295
- AM: 1,
296
- AN: 1,
297
- AR: 1,
298
- AT: 1,
299
- AU: 1,
300
- AX: 1,
301
- AZ: 1,
302
- BA: 1,
303
- BE: 1,
304
- BG: 1,
305
- BH: 6,
306
- BM: 1,
307
- BN: 1,
308
- BY: 1,
309
- CH: 1,
310
- CL: 1,
311
- CM: 1,
312
- CN: 1,
313
- CR: 1,
314
- CY: 1,
315
- CZ: 1,
316
- DE: 1,
317
- DJ: 6,
318
- DK: 1,
319
- DZ: 6,
320
- EC: 1,
321
- EE: 1,
322
- EG: 6,
323
- ES: 1,
324
- FI: 1,
325
- FJ: 1,
326
- FO: 1,
327
- FR: 1,
328
- GB: 1,
329
- GE: 1,
330
- GF: 1,
331
- GP: 1,
332
- GR: 1,
333
- HR: 1,
334
- HU: 1,
335
- IE: 1,
336
- IQ: 6,
337
- IR: 6,
338
- IS: 1,
339
- IT: 1,
340
- JO: 6,
341
- KG: 1,
342
- KW: 6,
343
- KZ: 1,
344
- LB: 1,
345
- LI: 1,
346
- LK: 1,
347
- LT: 1,
348
- LU: 1,
349
- LV: 1,
350
- LY: 6,
351
- MC: 1,
352
- MD: 1,
353
- ME: 1,
354
- MK: 1,
355
- MN: 1,
356
- MQ: 1,
357
- MV: 5,
358
- MY: 1,
359
- NL: 1,
360
- NO: 1,
361
- NZ: 1,
362
- OM: 6,
363
- PL: 1,
364
- QA: 6,
365
- RE: 1,
366
- RO: 1,
367
- RS: 1,
368
- RU: 1,
369
- SD: 6,
370
- SE: 1,
371
- SI: 1,
372
- SK: 1,
373
- SM: 1,
374
- SY: 6,
375
- TJ: 1,
376
- TM: 1,
377
- TR: 1,
378
- UA: 1,
379
- UY: 1,
380
- UZ: 1,
381
- VA: 1,
382
- VN: 1,
383
- XK: 1
384
- };
385
-
386
-
387
- function $1f0f7ebf1ae6c530$export$ea39ec197993aef0(a, b) {
388
- b = (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)(b, a.calendar);
389
- return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
390
- }
391
- function $1f0f7ebf1ae6c530$export$a18c89cbd24170ff(a, b) {
392
- b = (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)(b, a.calendar);
393
- // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.
394
- a = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(a);
395
- b = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(b);
396
- return a.era === b.era && a.year === b.year && a.month === b.month;
397
- }
398
- function $1f0f7ebf1ae6c530$export$5841f9eb9773f25f(a, b) {
399
- b = (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)(b, a.calendar);
400
- a = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(a);
401
- b = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(b);
402
- return a.era === b.era && a.year === b.year;
403
- }
404
- function $1f0f7ebf1ae6c530$export$91b62ebf2ba703ee(a, b) {
405
- return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
406
- }
407
- function $1f0f7ebf1ae6c530$export$5a8da0c44a3afdf2(a, b) {
408
- a = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(a);
409
- b = $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(b);
410
- return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year && a.month === b.month;
411
- }
412
- function $1f0f7ebf1ae6c530$export$ea840f5a6dda8147(a, b) {
413
- a = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(a);
414
- b = $1f0f7ebf1ae6c530$export$f91e89d3d0406102(b);
415
- return a.calendar.identifier === b.calendar.identifier && a.era === b.era && a.year === b.year;
416
- }
417
- function $1f0f7ebf1ae6c530$export$629b0a497aa65267(date, timeZone) {
418
- return $1f0f7ebf1ae6c530$export$ea39ec197993aef0(date, $1f0f7ebf1ae6c530$export$d0bdf45af03a6ea3(timeZone));
419
- }
420
- function $1f0f7ebf1ae6c530$export$2061056d06d7cdf7(date, locale) {
421
- let julian = date.calendar.toJulianDay(date);
422
- // If julian is negative, then julian % 7 will be negative, so we adjust
423
- // accordingly. Julian day 0 is Monday.
424
- let dayOfWeek = Math.ceil(julian + 1 - $1f0f7ebf1ae6c530$var$getWeekStart(locale)) % 7;
425
- if (dayOfWeek < 0) dayOfWeek += 7;
426
- return dayOfWeek;
427
- }
428
- function $1f0f7ebf1ae6c530$export$461939dd4422153(timeZone) {
429
- return (0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(Date.now(), timeZone);
430
- }
431
- function $1f0f7ebf1ae6c530$export$d0bdf45af03a6ea3(timeZone) {
432
- return (0, $4ae0260a69729f1d$export$93522d1a439f3617)($1f0f7ebf1ae6c530$export$461939dd4422153(timeZone));
433
- }
434
- function $1f0f7ebf1ae6c530$export$68781ddf31c0090f(a, b) {
435
- return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);
436
- }
437
- function $1f0f7ebf1ae6c530$export$c19a80a9721b80f6(a, b) {
438
- return $1f0f7ebf1ae6c530$var$timeToMs(a) - $1f0f7ebf1ae6c530$var$timeToMs(b);
439
- }
440
- function $1f0f7ebf1ae6c530$var$timeToMs(a) {
441
- return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
442
- }
443
- function $1f0f7ebf1ae6c530$export$126c91c941de7e(a, timeZone) {
444
- let ms = (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(a, timeZone);
445
- let tomorrow = a.add({
446
- days: 1
447
- });
448
- let tomorrowMs = (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(tomorrow, timeZone);
449
- return (tomorrowMs - ms) / 3600000;
450
- }
451
- let $1f0f7ebf1ae6c530$var$localTimeZone = null;
452
- function $1f0f7ebf1ae6c530$export$aa8b41735afcabd2() {
453
- // TODO: invalidate this somehow?
454
- if ($1f0f7ebf1ae6c530$var$localTimeZone == null) $1f0f7ebf1ae6c530$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
455
- return $1f0f7ebf1ae6c530$var$localTimeZone;
456
- }
457
- function $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(date) {
458
- // Use `subtract` instead of `set` so we don't get constrained in an era.
459
- return date.subtract({
460
- days: date.day - 1
461
- });
462
- }
463
- function $1f0f7ebf1ae6c530$export$a2258d9c4118825c(date) {
464
- return date.add({
465
- days: date.calendar.getDaysInMonth(date) - date.day
466
- });
467
- }
468
- function $1f0f7ebf1ae6c530$export$f91e89d3d0406102(date) {
469
- return $1f0f7ebf1ae6c530$export$a5a3b454ada2268e(date.subtract({
470
- months: date.month - 1
471
- }));
472
- }
473
- function $1f0f7ebf1ae6c530$export$8b7aa55c66d5569e(date) {
474
- return $1f0f7ebf1ae6c530$export$a2258d9c4118825c(date.add({
475
- months: date.calendar.getMonthsInYear(date) - date.month
476
- }));
477
- }
478
- function $1f0f7ebf1ae6c530$export$5412ac11713b72ad(date) {
479
- if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);
480
- return 1;
481
- }
482
- function $1f0f7ebf1ae6c530$export$b2f4953d301981d5(date) {
483
- if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);
484
- return 1;
485
- }
486
- function $1f0f7ebf1ae6c530$export$42c81a444fbfb5d4(date, locale) {
487
- let dayOfWeek = $1f0f7ebf1ae6c530$export$2061056d06d7cdf7(date, locale);
488
- return date.subtract({
489
- days: dayOfWeek
490
- });
491
- }
492
- function $1f0f7ebf1ae6c530$export$ef8b6d9133084f4e(date, locale) {
493
- return $1f0f7ebf1ae6c530$export$42c81a444fbfb5d4(date, locale).add({
494
- days: 6
495
- });
496
- }
497
- const $1f0f7ebf1ae6c530$var$cachedRegions = new Map();
498
- function $1f0f7ebf1ae6c530$var$getRegion(locale) {
499
- // If the Intl.Locale API is available, use it to get the region for the locale.
500
- // @ts-ignore
501
- if (Intl.Locale) {
502
- // Constructing an Intl.Locale is expensive, so cache the result.
503
- let region = $1f0f7ebf1ae6c530$var$cachedRegions.get(locale);
504
- if (!region) {
505
- // @ts-ignore
506
- region = new Intl.Locale(locale).maximize().region;
507
- if (region) $1f0f7ebf1ae6c530$var$cachedRegions.set(locale, region);
508
- }
509
- return region;
510
- }
511
- // If not, just try splitting the string.
512
- // If the second part of the locale string is 'u',
513
- // then this is a unicode extension, so ignore it.
514
- // Otherwise, it should be the region.
515
- let part = locale.split("-")[1];
516
- return part === "u" ? undefined : part;
517
- }
518
- function $1f0f7ebf1ae6c530$var$getWeekStart(locale) {
519
- // TODO: use Intl.Locale for this once browsers support the weekInfo property
520
- // https://github.com/tc39/proposal-intl-locale-info
521
- let region = $1f0f7ebf1ae6c530$var$getRegion(locale);
522
- return region ? (0, $4d88eff242b38a9e$export$7a5acbd77d414bd9)[region] || 0 : 0;
523
- }
524
- function $1f0f7ebf1ae6c530$export$ccc1b2479e7dd654(date, locale) {
525
- let days = date.calendar.getDaysInMonth(date);
526
- return Math.ceil(($1f0f7ebf1ae6c530$export$2061056d06d7cdf7($1f0f7ebf1ae6c530$export$a5a3b454ada2268e(date), locale) + days) / 7);
527
- }
528
- function $1f0f7ebf1ae6c530$export$5c333a116e949cdd(a, b) {
529
- if (a && b) return a.compare(b) <= 0 ? a : b;
530
- return a || b;
531
- }
532
- function $1f0f7ebf1ae6c530$export$a75f2bff57811055(a, b) {
533
- if (a && b) return a.compare(b) >= 0 ? a : b;
534
- return a || b;
535
- }
536
- const $1f0f7ebf1ae6c530$var$WEEKEND_DATA = {
537
- AF: [
538
- 4,
539
- 5
540
- ],
541
- AE: [
542
- 5,
543
- 6
544
- ],
545
- BH: [
546
- 5,
547
- 6
548
- ],
549
- DZ: [
550
- 5,
551
- 6
552
- ],
553
- EG: [
554
- 5,
555
- 6
556
- ],
557
- IL: [
558
- 5,
559
- 6
560
- ],
561
- IQ: [
562
- 5,
563
- 6
564
- ],
565
- IR: [
566
- 5,
567
- 5
568
- ],
569
- JO: [
570
- 5,
571
- 6
572
- ],
573
- KW: [
574
- 5,
575
- 6
576
- ],
577
- LY: [
578
- 5,
579
- 6
580
- ],
581
- OM: [
582
- 5,
583
- 6
584
- ],
585
- QA: [
586
- 5,
587
- 6
588
- ],
589
- SA: [
590
- 5,
591
- 6
592
- ],
593
- SD: [
594
- 5,
595
- 6
596
- ],
597
- SY: [
598
- 5,
599
- 6
600
- ],
601
- YE: [
602
- 5,
603
- 6
604
- ]
605
- };
606
- function $1f0f7ebf1ae6c530$export$618d60ea299da42(date, locale) {
607
- let julian = date.calendar.toJulianDay(date);
608
- // If julian is negative, then julian % 7 will be negative, so we adjust
609
- // accordingly. Julian day 0 is Monday.
610
- let dayOfWeek = Math.ceil(julian + 1) % 7;
611
- if (dayOfWeek < 0) dayOfWeek += 7;
612
- let region = $1f0f7ebf1ae6c530$var$getRegion(locale);
613
- // Use Intl.Locale for this once weekInfo is supported.
614
- // https://github.com/tc39/proposal-intl-locale-info
615
- let [start, end] = $1f0f7ebf1ae6c530$var$WEEKEND_DATA[region] || [
616
- 6,
617
- 0
618
- ];
619
- return dayOfWeek === start || dayOfWeek === end;
620
- }
621
- function $1f0f7ebf1ae6c530$export$ee9d87258e1d19ed(date, locale) {
622
- return !$1f0f7ebf1ae6c530$export$618d60ea299da42(date, locale);
623
- }
624
-
625
-
626
- function $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(date) {
627
- date = $4ae0260a69729f1d$export$b4a036af3fc0b032(date, new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)());
628
- let year = (0, $af14c9812fdceb33$export$c36e0ecb2d4fa69d)(date.era, date.year);
629
- return $4ae0260a69729f1d$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
630
- }
631
- function $4ae0260a69729f1d$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
632
- // Note: Date.UTC() interprets one and two-digit years as being in the
633
- // 20th century, so don't use it
634
- let date = new Date();
635
- date.setUTCHours(hour, minute, second, millisecond);
636
- date.setUTCFullYear(year, month - 1, day);
637
- return date.getTime();
638
- }
639
- function $4ae0260a69729f1d$export$59c99f3515d3493f(ms, timeZone) {
640
- // Fast path for UTC.
641
- if (timeZone === "UTC") return 0;
642
- // Fast path: for local timezone after 1970, use native Date.
643
- if (ms > 0 && timeZone === (0, $1f0f7ebf1ae6c530$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -60000;
644
- let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $4ae0260a69729f1d$var$getTimeZoneParts(ms, timeZone);
645
- let utc = $4ae0260a69729f1d$var$epochFromParts(year, month, day, hour, minute, second, 0);
646
- return utc - Math.floor(ms / 1000) * 1000;
647
- }
648
- const $4ae0260a69729f1d$var$formattersByTimeZone = new Map();
649
- function $4ae0260a69729f1d$var$getTimeZoneParts(ms, timeZone) {
650
- let formatter = $4ae0260a69729f1d$var$formattersByTimeZone.get(timeZone);
651
- if (!formatter) {
652
- formatter = new Intl.DateTimeFormat("en-US", {
653
- timeZone: timeZone,
654
- hour12: false,
655
- era: "short",
656
- year: "numeric",
657
- month: "numeric",
658
- day: "numeric",
659
- hour: "numeric",
660
- minute: "numeric",
661
- second: "numeric"
662
- });
663
- $4ae0260a69729f1d$var$formattersByTimeZone.set(timeZone, formatter);
664
- }
665
- let parts = formatter.formatToParts(new Date(ms));
666
- let namedParts = {};
667
- for (let part of parts)if (part.type !== "literal") namedParts[part.type] = part.value;
668
- return {
669
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
670
- year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
671
- month: +namedParts.month,
672
- day: +namedParts.day,
673
- hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
674
- minute: +namedParts.minute,
675
- second: +namedParts.second
676
- };
677
- }
678
- const $4ae0260a69729f1d$var$DAYMILLIS = 86400000;
679
- function $4ae0260a69729f1d$export$136f38efe7caf549(date, timeZone) {
680
- let ms = $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(date);
681
- let earlier = ms - $4ae0260a69729f1d$export$59c99f3515d3493f(ms - $4ae0260a69729f1d$var$DAYMILLIS, timeZone);
682
- let later = ms - $4ae0260a69729f1d$export$59c99f3515d3493f(ms + $4ae0260a69729f1d$var$DAYMILLIS, timeZone);
683
- return $4ae0260a69729f1d$var$getValidWallTimes(date, timeZone, earlier, later);
684
- }
685
- function $4ae0260a69729f1d$var$getValidWallTimes(date, timeZone, earlier, later) {
686
- let found = earlier === later ? [
687
- earlier
688
- ] : [
689
- earlier,
690
- later
691
- ];
692
- return found.filter((absolute)=>$4ae0260a69729f1d$var$isValidWallTime(date, timeZone, absolute));
693
- }
694
- function $4ae0260a69729f1d$var$isValidWallTime(date, timeZone, absolute) {
695
- let parts = $4ae0260a69729f1d$var$getTimeZoneParts(absolute, timeZone);
696
- 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;
697
- }
698
- function $4ae0260a69729f1d$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
699
- let dateTime = $4ae0260a69729f1d$export$b21e0b124e224484(date);
700
- // Fast path: if the time zone is UTC, use native Date.
701
- if (timeZone === "UTC") return $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(dateTime);
702
- // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
703
- if (timeZone === (0, $1f0f7ebf1ae6c530$export$aa8b41735afcabd2)() && disambiguation === "compatible") {
704
- dateTime = $4ae0260a69729f1d$export$b4a036af3fc0b032(dateTime, new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)());
705
- // Don't use Date constructor here because two-digit years are interpreted in the 20th century.
706
- let date = new Date();
707
- let year = (0, $af14c9812fdceb33$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
708
- date.setFullYear(year, dateTime.month - 1, dateTime.day);
709
- date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
710
- return date.getTime();
711
- }
712
- let ms = $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(dateTime);
713
- let offsetBefore = $4ae0260a69729f1d$export$59c99f3515d3493f(ms - $4ae0260a69729f1d$var$DAYMILLIS, timeZone);
714
- let offsetAfter = $4ae0260a69729f1d$export$59c99f3515d3493f(ms + $4ae0260a69729f1d$var$DAYMILLIS, timeZone);
715
- let valid = $4ae0260a69729f1d$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
716
- if (valid.length === 1) return valid[0];
717
- if (valid.length > 1) switch(disambiguation){
718
- // 'compatible' means 'earlier' for "fall back" transitions
719
- case "compatible":
720
- case "earlier":
721
- return valid[0];
722
- case "later":
723
- return valid[valid.length - 1];
724
- case "reject":
725
- throw new RangeError("Multiple possible absolute times found");
726
- }
727
- switch(disambiguation){
728
- case "earlier":
729
- return Math.min(ms - offsetBefore, ms - offsetAfter);
730
- // 'compatible' means 'later' for "spring forward" transitions
731
- case "compatible":
732
- case "later":
733
- return Math.max(ms - offsetBefore, ms - offsetAfter);
734
- case "reject":
735
- throw new RangeError("No such absolute time found");
736
- }
737
- }
738
- function $4ae0260a69729f1d$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
739
- return new Date($4ae0260a69729f1d$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
740
- }
741
- function $4ae0260a69729f1d$export$1b96692a1ba042ac(ms, timeZone) {
742
- let offset = $4ae0260a69729f1d$export$59c99f3515d3493f(ms, timeZone);
743
- let date = new Date(ms + offset);
744
- let year = date.getUTCFullYear();
745
- let month = date.getUTCMonth() + 1;
746
- let day = date.getUTCDate();
747
- let hour = date.getUTCHours();
748
- let minute = date.getUTCMinutes();
749
- let second = date.getUTCSeconds();
750
- let millisecond = date.getUTCMilliseconds();
751
- return new (0, $625ad1e1f4c43bc1$export$d3b7288e7994edea)(year, month, day, timeZone, offset, hour, minute, second, millisecond);
752
- }
753
- function $4ae0260a69729f1d$export$e57ff100d91bd4b9(date, timeZone) {
754
- return $4ae0260a69729f1d$export$1b96692a1ba042ac(date.getTime(), timeZone);
755
- }
756
- function $4ae0260a69729f1d$export$d7f92bcd3596b086(date) {
757
- return $4ae0260a69729f1d$export$e57ff100d91bd4b9(date, (0, $1f0f7ebf1ae6c530$export$aa8b41735afcabd2)());
758
- }
759
- function $4ae0260a69729f1d$export$93522d1a439f3617(dateTime) {
760
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
761
- }
762
- function $4ae0260a69729f1d$export$6f4d78149f3f53ac(date) {
763
- return {
764
- era: date.era,
765
- year: date.year,
766
- month: date.month,
767
- day: date.day
768
- };
769
- }
770
- function $4ae0260a69729f1d$export$4d0393e732857be5(date) {
771
- return {
772
- hour: date.hour,
773
- minute: date.minute,
774
- second: date.second,
775
- millisecond: date.millisecond
776
- };
777
- }
778
- function $4ae0260a69729f1d$export$b21e0b124e224484(date, time) {
779
- let hour = 0, minute = 0, second = 0, millisecond = 0;
780
- if ("timeZone" in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
781
- else if ("hour" in date && !time) return date;
782
- if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
783
- return new (0, $625ad1e1f4c43bc1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
784
- }
785
- function $4ae0260a69729f1d$export$d33f79e3ffc3dc83(dateTime) {
786
- return new (0, $625ad1e1f4c43bc1$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
787
- }
788
- function $4ae0260a69729f1d$export$b4a036af3fc0b032(date, calendar) {
789
- if (date.calendar.identifier === calendar.identifier) return date;
790
- let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
791
- let copy = date.copy();
792
- copy.calendar = calendar;
793
- copy.era = calendarDate.era;
794
- copy.year = calendarDate.year;
795
- copy.month = calendarDate.month;
796
- copy.day = calendarDate.day;
797
- (0, $5c0571aa5b6fb5da$export$c4e2ecac49351ef2)(copy);
798
- return copy;
799
- }
800
- function $4ae0260a69729f1d$export$84c95a83c799e074(date, timeZone, disambiguation) {
801
- if (date instanceof (0, $625ad1e1f4c43bc1$export$d3b7288e7994edea)) {
802
- if (date.timeZone === timeZone) return date;
803
- return $4ae0260a69729f1d$export$538b00033cc11c75(date, timeZone);
804
- }
805
- let ms = $4ae0260a69729f1d$export$5107c82f94518f5c(date, timeZone, disambiguation);
806
- return $4ae0260a69729f1d$export$1b96692a1ba042ac(ms, timeZone);
807
- }
808
- function $4ae0260a69729f1d$export$83aac07b4c37b25(date) {
809
- let ms = $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(date) - date.offset;
810
- return new Date(ms);
811
- }
812
- function $4ae0260a69729f1d$export$538b00033cc11c75(date, timeZone) {
813
- let ms = $4ae0260a69729f1d$export$bd4fb2bc8bb06fb(date) - date.offset;
814
- return $4ae0260a69729f1d$export$b4a036af3fc0b032($4ae0260a69729f1d$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
815
- }
816
- function $4ae0260a69729f1d$export$d9b67bc93c097491(date) {
817
- return $4ae0260a69729f1d$export$538b00033cc11c75(date, (0, $1f0f7ebf1ae6c530$export$aa8b41735afcabd2)());
818
- }
819
-
820
-
821
-
822
- const $5c0571aa5b6fb5da$var$ONE_HOUR = 3600000;
823
- function $5c0571aa5b6fb5da$export$e16d8520af44a096(date, duration) {
824
- let mutableDate = date.copy();
825
- let days = "hour" in mutableDate ? $5c0571aa5b6fb5da$var$addTimeFields(mutableDate, duration) : 0;
826
- $5c0571aa5b6fb5da$var$addYears(mutableDate, duration.years || 0);
827
- if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
828
- mutableDate.month += duration.months || 0;
829
- $5c0571aa5b6fb5da$var$balanceYearMonth(mutableDate);
830
- $5c0571aa5b6fb5da$var$constrainMonthDay(mutableDate);
831
- mutableDate.day += (duration.weeks || 0) * 7;
832
- mutableDate.day += duration.days || 0;
833
- mutableDate.day += days;
834
- $5c0571aa5b6fb5da$var$balanceDay(mutableDate);
835
- if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
836
- // Constrain in case adding ended up with a date outside the valid range for the calendar system.
837
- // The behavior here is slightly different than when constraining in the `set` function in that
838
- // we adjust smaller fields to their minimum/maximum values rather than constraining each field
839
- // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.
840
- if (mutableDate.year < 1) {
841
- mutableDate.year = 1;
842
- mutableDate.month = 1;
843
- mutableDate.day = 1;
844
- }
845
- let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
846
- if (mutableDate.year > maxYear) {
847
- var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
848
- 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);
849
- mutableDate.year = maxYear;
850
- mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
851
- mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
852
- }
853
- if (mutableDate.month < 1) {
854
- mutableDate.month = 1;
855
- mutableDate.day = 1;
856
- }
857
- let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
858
- if (mutableDate.month > maxMonth) {
859
- mutableDate.month = maxMonth;
860
- mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
861
- }
862
- mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
863
- return mutableDate;
864
- }
865
- function $5c0571aa5b6fb5da$var$addYears(date, years) {
866
- var _date_calendar_isInverseEra, _date_calendar;
867
- 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;
868
- date.year += years;
869
- }
870
- function $5c0571aa5b6fb5da$var$balanceYearMonth(date) {
871
- while(date.month < 1){
872
- $5c0571aa5b6fb5da$var$addYears(date, -1);
873
- date.month += date.calendar.getMonthsInYear(date);
874
- }
875
- let monthsInYear = 0;
876
- while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){
877
- date.month -= monthsInYear;
878
- $5c0571aa5b6fb5da$var$addYears(date, 1);
879
- }
880
- }
881
- function $5c0571aa5b6fb5da$var$balanceDay(date) {
882
- while(date.day < 1){
883
- date.month--;
884
- $5c0571aa5b6fb5da$var$balanceYearMonth(date);
885
- date.day += date.calendar.getDaysInMonth(date);
886
- }
887
- while(date.day > date.calendar.getDaysInMonth(date)){
888
- date.day -= date.calendar.getDaysInMonth(date);
889
- date.month++;
890
- $5c0571aa5b6fb5da$var$balanceYearMonth(date);
891
- }
892
- }
893
- function $5c0571aa5b6fb5da$var$constrainMonthDay(date) {
894
- date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
895
- date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
896
- }
897
- function $5c0571aa5b6fb5da$export$c4e2ecac49351ef2(date) {
898
- if (date.calendar.constrainDate) date.calendar.constrainDate(date);
899
- date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
900
- $5c0571aa5b6fb5da$var$constrainMonthDay(date);
901
- }
902
- function $5c0571aa5b6fb5da$export$3e2544e88a25bff8(duration) {
903
- let inverseDuration = {};
904
- for(let key in duration)if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
905
- return inverseDuration;
906
- }
907
- function $5c0571aa5b6fb5da$export$4e2d2ead65e5f7e3(date, duration) {
908
- return $5c0571aa5b6fb5da$export$e16d8520af44a096(date, $5c0571aa5b6fb5da$export$3e2544e88a25bff8(duration));
909
- }
910
- function $5c0571aa5b6fb5da$export$adaa4cf7ef1b65be(date, fields) {
911
- let mutableDate = date.copy();
912
- if (fields.era != null) mutableDate.era = fields.era;
913
- if (fields.year != null) mutableDate.year = fields.year;
914
- if (fields.month != null) mutableDate.month = fields.month;
915
- if (fields.day != null) mutableDate.day = fields.day;
916
- $5c0571aa5b6fb5da$export$c4e2ecac49351ef2(mutableDate);
917
- return mutableDate;
918
- }
919
- function $5c0571aa5b6fb5da$export$e5d5e1c1822b6e56(value, fields) {
920
- let mutableValue = value.copy();
921
- if (fields.hour != null) mutableValue.hour = fields.hour;
922
- if (fields.minute != null) mutableValue.minute = fields.minute;
923
- if (fields.second != null) mutableValue.second = fields.second;
924
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
925
- $5c0571aa5b6fb5da$export$7555de1e070510cb(mutableValue);
926
- return mutableValue;
927
- }
928
- function $5c0571aa5b6fb5da$var$balanceTime(time) {
929
- time.second += Math.floor(time.millisecond / 1000);
930
- time.millisecond = $5c0571aa5b6fb5da$var$nonNegativeMod(time.millisecond, 1000);
931
- time.minute += Math.floor(time.second / 60);
932
- time.second = $5c0571aa5b6fb5da$var$nonNegativeMod(time.second, 60);
933
- time.hour += Math.floor(time.minute / 60);
934
- time.minute = $5c0571aa5b6fb5da$var$nonNegativeMod(time.minute, 60);
935
- let days = Math.floor(time.hour / 24);
936
- time.hour = $5c0571aa5b6fb5da$var$nonNegativeMod(time.hour, 24);
937
- return days;
938
- }
939
- function $5c0571aa5b6fb5da$export$7555de1e070510cb(time) {
940
- time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
941
- time.second = Math.max(0, Math.min(time.second, 59));
942
- time.minute = Math.max(0, Math.min(time.minute, 59));
943
- time.hour = Math.max(0, Math.min(time.hour, 23));
944
- }
945
- function $5c0571aa5b6fb5da$var$nonNegativeMod(a, b) {
946
- let result = a % b;
947
- if (result < 0) result += b;
948
- return result;
949
- }
950
- function $5c0571aa5b6fb5da$var$addTimeFields(time, duration) {
951
- time.hour += duration.hours || 0;
952
- time.minute += duration.minutes || 0;
953
- time.second += duration.seconds || 0;
954
- time.millisecond += duration.milliseconds || 0;
955
- return $5c0571aa5b6fb5da$var$balanceTime(time);
956
- }
957
- function $5c0571aa5b6fb5da$export$7ed87b6bc2506470(time, duration) {
958
- let res = time.copy();
959
- $5c0571aa5b6fb5da$var$addTimeFields(res, duration);
960
- return res;
961
- }
962
- function $5c0571aa5b6fb5da$export$fe34d3a381cd7501(time, duration) {
963
- return $5c0571aa5b6fb5da$export$7ed87b6bc2506470(time, $5c0571aa5b6fb5da$export$3e2544e88a25bff8(duration));
964
- }
965
- function $5c0571aa5b6fb5da$export$d52ced6badfb9a4c(value, field, amount, options) {
966
- let mutable = value.copy();
967
- switch(field){
968
- case "era":
969
- {
970
- let eras = value.calendar.getEras();
971
- let eraIndex = eras.indexOf(value.era);
972
- if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
973
- eraIndex = $5c0571aa5b6fb5da$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
974
- mutable.era = eras[eraIndex];
975
- // Constrain the year and other fields within the era, so the era doesn't change when we balance below.
976
- $5c0571aa5b6fb5da$export$c4e2ecac49351ef2(mutable);
977
- break;
978
- }
979
- case "year":
980
- var _mutable_calendar_isInverseEra, _mutable_calendar;
981
- 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;
982
- // The year field should not cycle within the era as that can cause weird behavior affecting other fields.
983
- // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back
984
- // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.
985
- mutable.year = $5c0571aa5b6fb5da$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
986
- if (mutable.year === -Infinity) mutable.year = 1;
987
- if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
988
- break;
989
- case "month":
990
- mutable.month = $5c0571aa5b6fb5da$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
991
- break;
992
- case "day":
993
- mutable.day = $5c0571aa5b6fb5da$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
994
- break;
995
- default:
996
- throw new Error("Unsupported field " + field);
997
- }
998
- if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
999
- $5c0571aa5b6fb5da$export$c4e2ecac49351ef2(mutable);
1000
- return mutable;
1001
- }
1002
- function $5c0571aa5b6fb5da$export$dd02b3e0007dfe28(value, field, amount, options) {
1003
- let mutable = value.copy();
1004
- switch(field){
1005
- case "hour":
1006
- {
1007
- let hours = value.hour;
1008
- let min = 0;
1009
- let max = 23;
1010
- if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
1011
- let isPM = hours >= 12;
1012
- min = isPM ? 12 : 0;
1013
- max = isPM ? 23 : 11;
1014
- }
1015
- mutable.hour = $5c0571aa5b6fb5da$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
1016
- break;
1017
- }
1018
- case "minute":
1019
- mutable.minute = $5c0571aa5b6fb5da$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
1020
- break;
1021
- case "second":
1022
- mutable.second = $5c0571aa5b6fb5da$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
1023
- break;
1024
- case "millisecond":
1025
- mutable.millisecond = $5c0571aa5b6fb5da$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
1026
- break;
1027
- default:
1028
- throw new Error("Unsupported field " + field);
1029
- }
1030
- return mutable;
1031
- }
1032
- function $5c0571aa5b6fb5da$var$cycleValue(value, amount, min, max, round = false) {
1033
- if (round) {
1034
- value += Math.sign(amount);
1035
- if (value < min) value = max;
1036
- let div = Math.abs(amount);
1037
- if (amount > 0) value = Math.ceil(value / div) * div;
1038
- else value = Math.floor(value / div) * div;
1039
- if (value > max) value = min;
1040
- } else {
1041
- value += amount;
1042
- if (value < min) value = max - (min - value - 1);
1043
- else if (value > max) value = min + (value - max - 1);
1044
- }
1045
- return value;
1046
- }
1047
- function $5c0571aa5b6fb5da$export$96b1d28349274637(dateTime, duration) {
1048
- let ms;
1049
- 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) {
1050
- let res = $5c0571aa5b6fb5da$export$e16d8520af44a096((0, $4ae0260a69729f1d$export$b21e0b124e224484)(dateTime), {
1051
- years: duration.years,
1052
- months: duration.months,
1053
- weeks: duration.weeks,
1054
- days: duration.days
1055
- });
1056
- // Changing the date may change the timezone offset, so we need to recompute
1057
- // using the 'compatible' disambiguation.
1058
- ms = (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(res, dateTime.timeZone);
1059
- } else // Otherwise, preserve the offset of the original date.
1060
- ms = (0, $4ae0260a69729f1d$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
1061
- // Perform time manipulation in milliseconds rather than on the original time fields to account for DST.
1062
- // For example, adding one hour during a DST transition may result in the hour field staying the same or
1063
- // skipping an hour. This results in the offset field changing value instead of the specified field.
1064
- ms += duration.milliseconds || 0;
1065
- ms += (duration.seconds || 0) * 1000;
1066
- ms += (duration.minutes || 0) * 60000;
1067
- ms += (duration.hours || 0) * 3600000;
1068
- let res = (0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, dateTime.timeZone);
1069
- return (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)(res, dateTime.calendar);
1070
- }
1071
- function $5c0571aa5b6fb5da$export$6814caac34ca03c7(dateTime, duration) {
1072
- return $5c0571aa5b6fb5da$export$96b1d28349274637(dateTime, $5c0571aa5b6fb5da$export$3e2544e88a25bff8(duration));
1073
- }
1074
- function $5c0571aa5b6fb5da$export$9a297d111fc86b79(dateTime, field, amount, options) {
1075
- // For date fields, we want the time to remain consistent and the UTC offset to potentially change to account for DST changes.
1076
- // 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
1077
- // offset changing in the case of a backward DST transition, or skipping an hour in the case of a forward DST transition.
1078
- switch(field){
1079
- case "hour":
1080
- {
1081
- let min = 0;
1082
- let max = 23;
1083
- if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
1084
- let isPM = dateTime.hour >= 12;
1085
- min = isPM ? 12 : 0;
1086
- max = isPM ? 23 : 11;
1087
- }
1088
- // The minimum and maximum hour may be affected by daylight saving time.
1089
- // For example, it might jump forward at midnight, and skip 1am.
1090
- // Or it might end at midnight and repeat the 11pm hour. To handle this, we get
1091
- // the possible absolute times for the min and max, and find the maximum range
1092
- // that is within the current day.
1093
- let plainDateTime = (0, $4ae0260a69729f1d$export$b21e0b124e224484)(dateTime);
1094
- let minDate = (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)($5c0571aa5b6fb5da$export$e5d5e1c1822b6e56(plainDateTime, {
1095
- hour: min
1096
- }), new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)());
1097
- let minAbsolute = [
1098
- (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(minDate, dateTime.timeZone, "earlier"),
1099
- (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(minDate, dateTime.timeZone, "later")
1100
- ].filter((ms)=>(0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === minDate.day)[0];
1101
- let maxDate = (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)($5c0571aa5b6fb5da$export$e5d5e1c1822b6e56(plainDateTime, {
1102
- hour: max
1103
- }), new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)());
1104
- let maxAbsolute = [
1105
- (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, "earlier"),
1106
- (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(maxDate, dateTime.timeZone, "later")
1107
- ].filter((ms)=>(0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, dateTime.timeZone).day === maxDate.day).pop();
1108
- // Since hours may repeat, we need to operate on the absolute time in milliseconds.
1109
- // This is done in hours from the Unix epoch so that cycleValue works correctly,
1110
- // and then converted back to milliseconds.
1111
- let ms = (0, $4ae0260a69729f1d$export$bd4fb2bc8bb06fb)(dateTime) - dateTime.offset;
1112
- let hours = Math.floor(ms / $5c0571aa5b6fb5da$var$ONE_HOUR);
1113
- let remainder = ms % $5c0571aa5b6fb5da$var$ONE_HOUR;
1114
- ms = $5c0571aa5b6fb5da$var$cycleValue(hours, amount, Math.floor(minAbsolute / $5c0571aa5b6fb5da$var$ONE_HOUR), Math.floor(maxAbsolute / $5c0571aa5b6fb5da$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $5c0571aa5b6fb5da$var$ONE_HOUR + remainder;
1115
- // Now compute the new timezone offset, and convert the absolute time back to local time.
1116
- return (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)((0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
1117
- }
1118
- case "minute":
1119
- case "second":
1120
- case "millisecond":
1121
- // @ts-ignore
1122
- return $5c0571aa5b6fb5da$export$dd02b3e0007dfe28(dateTime, field, amount, options);
1123
- case "era":
1124
- case "year":
1125
- case "month":
1126
- case "day":
1127
- {
1128
- let res = $5c0571aa5b6fb5da$export$d52ced6badfb9a4c((0, $4ae0260a69729f1d$export$b21e0b124e224484)(dateTime), field, amount, options);
1129
- let ms = (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(res, dateTime.timeZone);
1130
- return (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)((0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
1131
- }
1132
- default:
1133
- throw new Error("Unsupported field " + field);
1134
- }
1135
- }
1136
- function $5c0571aa5b6fb5da$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
1137
- // Set the date/time fields, and recompute the UTC offset to account for DST changes.
1138
- // We also need to validate by converting back to a local time in case hours are skipped during forward DST transitions.
1139
- let plainDateTime = (0, $4ae0260a69729f1d$export$b21e0b124e224484)(dateTime);
1140
- let res = $5c0571aa5b6fb5da$export$e5d5e1c1822b6e56($5c0571aa5b6fb5da$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
1141
- // If the resulting plain date time values are equal, return the original time.
1142
- // We don't want to change the offset when setting the time to the same value.
1143
- if (res.compare(plainDateTime) === 0) return dateTime;
1144
- let ms = (0, $4ae0260a69729f1d$export$5107c82f94518f5c)(res, dateTime.timeZone, disambiguation);
1145
- return (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)((0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, dateTime.timeZone), dateTime.calendar);
1146
- }
1147
-
1148
-
1149
-
1150
- /*
1151
- * Copyright 2020 Adobe. All rights reserved.
1152
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1153
- * you may not use this file except in compliance with the License. You may obtain a copy
1154
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1155
- *
1156
- * Unless required by applicable law or agreed to in writing, software distributed under
1157
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1158
- * OF ANY KIND, either express or implied. See the License for the specific language
1159
- * governing permissions and limitations under the License.
1160
- */
1161
-
1162
-
1163
-
1164
- const $4c32e2d98e5a5134$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
1165
- const $4c32e2d98e5a5134$var$DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
1166
- const $4c32e2d98e5a5134$var$DATE_TIME_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
1167
- const $4c32e2d98e5a5134$var$ZONED_DATE_TIME_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?)?\[(.*?)\]$/;
1168
- const $4c32e2d98e5a5134$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
1169
- const $4c32e2d98e5a5134$var$DATE_TIME_DURATION_RE = /^((?<negative>-)|\+)?P((?<years>\d*)Y)?((?<months>\d*)M)?((?<weeks>\d*)W)?((?<days>\d*)D)?((?<time>T)((?<hours>\d*[.,]?\d{1,9})H)?((?<minutes>\d*[.,]?\d{1,9})M)?((?<seconds>\d*[.,]?\d{1,9})S)?)?$/;
1170
- const $4c32e2d98e5a5134$var$requiredDurationTimeGroups = [
1171
- "hours",
1172
- "minutes",
1173
- "seconds"
1174
- ];
1175
- const $4c32e2d98e5a5134$var$requiredDurationGroups = [
1176
- "years",
1177
- "months",
1178
- "weeks",
1179
- "days",
1180
- ...$4c32e2d98e5a5134$var$requiredDurationTimeGroups
1181
- ];
1182
- function $4c32e2d98e5a5134$export$c9698ec7f05a07e1(value) {
1183
- let m = value.match($4c32e2d98e5a5134$var$TIME_RE);
1184
- if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
1185
- return new (0, $625ad1e1f4c43bc1$export$680ea196effce5f)($4c32e2d98e5a5134$var$parseNumber(m[1], 0, 23), m[2] ? $4c32e2d98e5a5134$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $4c32e2d98e5a5134$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $4c32e2d98e5a5134$var$parseNumber(m[4], 0, Infinity) * 1000 : 0);
1186
- }
1187
- function $4c32e2d98e5a5134$export$6b862160d295c8e(value) {
1188
- let m = value.match($4c32e2d98e5a5134$var$DATE_RE);
1189
- if (!m) throw new Error("Invalid ISO 8601 date string: " + value);
1190
- let date = new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)($4c32e2d98e5a5134$var$parseNumber(m[1], 0, 9999), $4c32e2d98e5a5134$var$parseNumber(m[2], 1, 12), 1);
1191
- date.day = $4c32e2d98e5a5134$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1192
- return date;
1193
- }
1194
- function $4c32e2d98e5a5134$export$588937bcd60ade55(value) {
1195
- let m = value.match($4c32e2d98e5a5134$var$DATE_TIME_RE);
1196
- if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
1197
- let date = new (0, $625ad1e1f4c43bc1$export$ca871e8dbb80966f)($4c32e2d98e5a5134$var$parseNumber(m[1], 1, 9999), $4c32e2d98e5a5134$var$parseNumber(m[2], 1, 12), 1, m[4] ? $4c32e2d98e5a5134$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $4c32e2d98e5a5134$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $4c32e2d98e5a5134$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $4c32e2d98e5a5134$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
1198
- date.day = $4c32e2d98e5a5134$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1199
- return date;
1200
- }
1201
- function $4c32e2d98e5a5134$export$fd7893f06e92a6a4(value, disambiguation) {
1202
- let m = value.match($4c32e2d98e5a5134$var$ZONED_DATE_TIME_RE);
1203
- if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
1204
- let date = new (0, $625ad1e1f4c43bc1$export$d3b7288e7994edea)($4c32e2d98e5a5134$var$parseNumber(m[1], 1, 9999), $4c32e2d98e5a5134$var$parseNumber(m[2], 1, 12), 1, m[10], 0, m[4] ? $4c32e2d98e5a5134$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $4c32e2d98e5a5134$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $4c32e2d98e5a5134$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $4c32e2d98e5a5134$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
1205
- date.day = $4c32e2d98e5a5134$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1206
- let plainDateTime = (0, $4ae0260a69729f1d$export$b21e0b124e224484)(date);
1207
- let ms;
1208
- if (m[8]) {
1209
- var _m_;
1210
- date.offset = $4c32e2d98e5a5134$var$parseNumber(m[8], -23, 23) * 3600000 + $4c32e2d98e5a5134$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 60000;
1211
- ms = (0, $4ae0260a69729f1d$export$bd4fb2bc8bb06fb)(date) - date.offset;
1212
- // Validate offset against parsed date.
1213
- let absolutes = (0, $4ae0260a69729f1d$export$136f38efe7caf549)(plainDateTime, date.timeZone);
1214
- if (!absolutes.includes(ms)) throw new Error(`Offset ${$4c32e2d98e5a5134$var$offsetToString(date.offset)} is invalid for ${$4c32e2d98e5a5134$export$4223de14708adc63(date)} in ${date.timeZone}`);
1215
- } else // Convert to absolute and back to fix invalid times due to DST.
1216
- ms = (0, $4ae0260a69729f1d$export$5107c82f94518f5c)((0, $4ae0260a69729f1d$export$b21e0b124e224484)(plainDateTime), date.timeZone, disambiguation);
1217
- return (0, $4ae0260a69729f1d$export$1b96692a1ba042ac)(ms, date.timeZone);
1218
- }
1219
- function $4c32e2d98e5a5134$export$5adfdab05168c219(value, timeZone) {
1220
- let m = value.match($4c32e2d98e5a5134$var$ABSOLUTE_RE);
1221
- if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
1222
- let date = new (0, $625ad1e1f4c43bc1$export$d3b7288e7994edea)($4c32e2d98e5a5134$var$parseNumber(m[1], 1, 9999), $4c32e2d98e5a5134$var$parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? $4c32e2d98e5a5134$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $4c32e2d98e5a5134$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $4c32e2d98e5a5134$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $4c32e2d98e5a5134$var$parseNumber(m[7], 0, Infinity) * 1000 : 0);
1223
- date.day = $4c32e2d98e5a5134$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
1224
- var _m_;
1225
- if (m[8]) date.offset = $4c32e2d98e5a5134$var$parseNumber(m[8], -23, 23) * 3600000 + $4c32e2d98e5a5134$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 60000;
1226
- return (0, $4ae0260a69729f1d$export$538b00033cc11c75)(date, timeZone);
1227
- }
1228
- function $4c32e2d98e5a5134$export$8e384432362ed0f0(value) {
1229
- return $4c32e2d98e5a5134$export$5adfdab05168c219(value, (0, $1f0f7ebf1ae6c530$export$aa8b41735afcabd2)());
1230
- }
1231
- function $4c32e2d98e5a5134$var$parseNumber(value, min, max) {
1232
- let val = Number(value);
1233
- if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
1234
- return val;
1235
- }
1236
- function $4c32e2d98e5a5134$export$f59dee82248f5ad4(time) {
1237
- return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ""}`;
1238
- }
1239
- function $4c32e2d98e5a5134$export$60dfd74aa96791bd(date) {
1240
- let gregorianDate = (0, $4ae0260a69729f1d$export$b4a036af3fc0b032)(date, new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)());
1241
- return `${String(gregorianDate.year).padStart(4, "0")}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
1242
- }
1243
- function $4c32e2d98e5a5134$export$4223de14708adc63(date) {
1244
- // @ts-ignore
1245
- return `${$4c32e2d98e5a5134$export$60dfd74aa96791bd(date)}T${$4c32e2d98e5a5134$export$f59dee82248f5ad4(date)}`;
1246
- }
1247
- function $4c32e2d98e5a5134$var$offsetToString(offset) {
1248
- let sign = Math.sign(offset) < 0 ? "-" : "+";
1249
- offset = Math.abs(offset);
1250
- let offsetHours = Math.floor(offset / 3600000);
1251
- let offsetMinutes = offset % 3600000 / 60000;
1252
- return `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
1253
- }
1254
- function $4c32e2d98e5a5134$export$bf79f1ebf4b18792(date) {
1255
- return `${$4c32e2d98e5a5134$export$4223de14708adc63(date)}${$4c32e2d98e5a5134$var$offsetToString(date.offset)}[${date.timeZone}]`;
1256
- }
1257
- function $4c32e2d98e5a5134$export$ecae829bb3747ea6(value) {
1258
- var _match_groups, _match_groups1, _match_groups2, _match_groups3, _match_groups4, _match_groups5, _match_groups6, _match_groups7, _match_groups8;
1259
- const match = value.match($4c32e2d98e5a5134$var$DATE_TIME_DURATION_RE);
1260
- if (!match) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1261
- const parseDurationGroup = (group, isNegative, min, max)=>{
1262
- if (!group) return 0;
1263
- try {
1264
- const sign = isNegative ? -1 : 1;
1265
- return sign * $4c32e2d98e5a5134$var$parseNumber(group.replace(",", "."), min, max);
1266
- } catch {
1267
- throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1268
- }
1269
- };
1270
- const isNegative = !!((_match_groups = match.groups) === null || _match_groups === void 0 ? void 0 : _match_groups.negative);
1271
- const hasRequiredGroups = $4c32e2d98e5a5134$var$requiredDurationGroups.some((group)=>{
1272
- var _match_groups;
1273
- return (_match_groups = match.groups) === null || _match_groups === void 0 ? void 0 : _match_groups[group];
1274
- });
1275
- if (!hasRequiredGroups) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1276
- const durationStringIncludesTime = (_match_groups1 = match.groups) === null || _match_groups1 === void 0 ? void 0 : _match_groups1.time;
1277
- if (durationStringIncludesTime) {
1278
- const hasRequiredDurationTimeGroups = $4c32e2d98e5a5134$var$requiredDurationTimeGroups.some((group)=>{
1279
- var _match_groups;
1280
- return (_match_groups = match.groups) === null || _match_groups === void 0 ? void 0 : _match_groups[group];
1281
- });
1282
- if (!hasRequiredDurationTimeGroups) throw new Error(`Invalid ISO 8601 Duration string: ${value}`);
1283
- }
1284
- const duration = {
1285
- years: parseDurationGroup((_match_groups2 = match.groups) === null || _match_groups2 === void 0 ? void 0 : _match_groups2.years, isNegative, 0, 9999),
1286
- months: parseDurationGroup((_match_groups3 = match.groups) === null || _match_groups3 === void 0 ? void 0 : _match_groups3.months, isNegative, 0, 12),
1287
- weeks: parseDurationGroup((_match_groups4 = match.groups) === null || _match_groups4 === void 0 ? void 0 : _match_groups4.weeks, isNegative, 0, Infinity),
1288
- days: parseDurationGroup((_match_groups5 = match.groups) === null || _match_groups5 === void 0 ? void 0 : _match_groups5.days, isNegative, 0, 31),
1289
- hours: parseDurationGroup((_match_groups6 = match.groups) === null || _match_groups6 === void 0 ? void 0 : _match_groups6.hours, isNegative, 0, 23),
1290
- minutes: parseDurationGroup((_match_groups7 = match.groups) === null || _match_groups7 === void 0 ? void 0 : _match_groups7.minutes, isNegative, 0, 59),
1291
- seconds: parseDurationGroup((_match_groups8 = match.groups) === null || _match_groups8 === void 0 ? void 0 : _match_groups8.seconds, isNegative, 0, 59)
1292
- };
1293
- if (duration.hours !== undefined && duration.hours % 1 !== 0 && (duration.minutes || duration.seconds)) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1294
- if (duration.minutes !== undefined && duration.minutes % 1 !== 0 && duration.seconds) throw new Error(`Invalid ISO 8601 Duration string: ${value} - only the smallest unit can be fractional`);
1295
- return duration;
1296
- }
1297
-
1298
-
1299
-
1300
-
1301
- function $625ad1e1f4c43bc1$var$shiftArgs(args) {
1302
- let calendar = typeof args[0] === "object" ? args.shift() : new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)();
1303
- let era;
1304
- if (typeof args[0] === "string") era = args.shift();
1305
- else {
1306
- let eras = calendar.getEras();
1307
- era = eras[eras.length - 1];
1308
- }
1309
- let year = args.shift();
1310
- let month = args.shift();
1311
- let day = args.shift();
1312
- return [
1313
- calendar,
1314
- era,
1315
- year,
1316
- month,
1317
- day
1318
- ];
1319
- }
1320
- var // This prevents TypeScript from allowing other types with the same fields to match.
1321
- // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
1322
- // If that behavior is desired, use the AnyCalendarDate interface instead.
1323
- // @ts-ignore
1324
- $625ad1e1f4c43bc1$var$_type = /*#__PURE__*/ new WeakMap();
1325
- class $625ad1e1f4c43bc1$export$99faa760c7908e4f {
1326
- /** Returns a copy of this date. */ copy() {
1327
- if (this.era) return new $625ad1e1f4c43bc1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
1328
- else return new $625ad1e1f4c43bc1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
1329
- }
1330
- /** Returns a new `CalendarDate` with the given duration added to it. */ add(duration) {
1331
- return (0, $5c0571aa5b6fb5da$export$e16d8520af44a096)(this, duration);
1332
- }
1333
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(duration) {
1334
- return (0, $5c0571aa5b6fb5da$export$4e2d2ead65e5f7e3)(this, duration);
1335
- }
1336
- /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1337
- return (0, $5c0571aa5b6fb5da$export$adaa4cf7ef1b65be)(this, fields);
1338
- }
1339
- /**
1340
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
1341
- * When the resulting value reaches the limits of the field, it wraps around.
1342
- */ cycle(field, amount, options) {
1343
- return (0, $5c0571aa5b6fb5da$export$d52ced6badfb9a4c)(this, field, amount, options);
1344
- }
1345
- /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(timeZone) {
1346
- return (0, $4ae0260a69729f1d$export$e67a095c620b86fe)(this, timeZone);
1347
- }
1348
- /** Converts the date to an ISO 8601 formatted string. */ toString() {
1349
- return (0, $4c32e2d98e5a5134$export$60dfd74aa96791bd)(this);
1350
- }
1351
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
1352
- return (0, $1f0f7ebf1ae6c530$export$68781ddf31c0090f)(this, b);
1353
- }
1354
- constructor(...args){
1355
- (0, $kgI3C$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type, {
1356
- writable: true,
1357
- value: void 0
1358
- });
1359
- let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
1360
- this.calendar = calendar;
1361
- this.era = era;
1362
- this.year = year;
1363
- this.month = month;
1364
- this.day = day;
1365
- (0, $5c0571aa5b6fb5da$export$c4e2ecac49351ef2)(this);
1366
- }
1367
- }
1368
- var // This prevents TypeScript from allowing other types with the same fields to match.
1369
- // @ts-ignore
1370
- $625ad1e1f4c43bc1$var$_type1 = /*#__PURE__*/ new WeakMap();
1371
- class $625ad1e1f4c43bc1$export$680ea196effce5f {
1372
- /** Returns a copy of this time. */ copy() {
1373
- return new $625ad1e1f4c43bc1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
1374
- }
1375
- /** Returns a new `Time` with the given duration added to it. */ add(duration) {
1376
- return (0, $5c0571aa5b6fb5da$export$7ed87b6bc2506470)(this, duration);
1377
- }
1378
- /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
1379
- return (0, $5c0571aa5b6fb5da$export$fe34d3a381cd7501)(this, duration);
1380
- }
1381
- /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1382
- return (0, $5c0571aa5b6fb5da$export$e5d5e1c1822b6e56)(this, fields);
1383
- }
1384
- /**
1385
- * Returns a new `Time` with the given field adjusted by a specified amount.
1386
- * When the resulting value reaches the limits of the field, it wraps around.
1387
- */ cycle(field, amount, options) {
1388
- return (0, $5c0571aa5b6fb5da$export$dd02b3e0007dfe28)(this, field, amount, options);
1389
- }
1390
- /** Converts the time to an ISO 8601 formatted string. */ toString() {
1391
- return (0, $4c32e2d98e5a5134$export$f59dee82248f5ad4)(this);
1392
- }
1393
- /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
1394
- return (0, $1f0f7ebf1ae6c530$export$c19a80a9721b80f6)(this, b);
1395
- }
1396
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
1397
- (0, $kgI3C$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type1, {
1398
- writable: true,
1399
- value: void 0
1400
- });
1401
- this.hour = hour;
1402
- this.minute = minute;
1403
- this.second = second;
1404
- this.millisecond = millisecond;
1405
- (0, $5c0571aa5b6fb5da$export$7555de1e070510cb)(this);
1406
- }
1407
- }
1408
- var // This prevents TypeScript from allowing other types with the same fields to match.
1409
- // @ts-ignore
1410
- $625ad1e1f4c43bc1$var$_type2 = /*#__PURE__*/ new WeakMap();
1411
- class $625ad1e1f4c43bc1$export$ca871e8dbb80966f {
1412
- /** Returns a copy of this date. */ copy() {
1413
- if (this.era) return new $625ad1e1f4c43bc1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
1414
- else return new $625ad1e1f4c43bc1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
1415
- }
1416
- /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(duration) {
1417
- return (0, $5c0571aa5b6fb5da$export$e16d8520af44a096)(this, duration);
1418
- }
1419
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(duration) {
1420
- return (0, $5c0571aa5b6fb5da$export$4e2d2ead65e5f7e3)(this, duration);
1421
- }
1422
- /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1423
- return (0, $5c0571aa5b6fb5da$export$adaa4cf7ef1b65be)((0, $5c0571aa5b6fb5da$export$e5d5e1c1822b6e56)(this, fields), fields);
1424
- }
1425
- /**
1426
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
1427
- * When the resulting value reaches the limits of the field, it wraps around.
1428
- */ cycle(field, amount, options) {
1429
- switch(field){
1430
- case "era":
1431
- case "year":
1432
- case "month":
1433
- case "day":
1434
- return (0, $5c0571aa5b6fb5da$export$d52ced6badfb9a4c)(this, field, amount, options);
1435
- default:
1436
- return (0, $5c0571aa5b6fb5da$export$dd02b3e0007dfe28)(this, field, amount, options);
1437
- }
1438
- }
1439
- /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(timeZone, disambiguation) {
1440
- return (0, $4ae0260a69729f1d$export$e67a095c620b86fe)(this, timeZone, disambiguation);
1441
- }
1442
- /** Converts the date to an ISO 8601 formatted string. */ toString() {
1443
- return (0, $4c32e2d98e5a5134$export$4223de14708adc63)(this);
1444
- }
1445
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
1446
- let res = (0, $1f0f7ebf1ae6c530$export$68781ddf31c0090f)(this, b);
1447
- if (res === 0) return (0, $1f0f7ebf1ae6c530$export$c19a80a9721b80f6)(this, (0, $4ae0260a69729f1d$export$b21e0b124e224484)(b));
1448
- return res;
1449
- }
1450
- constructor(...args){
1451
- (0, $kgI3C$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type2, {
1452
- writable: true,
1453
- value: void 0
1454
- });
1455
- let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
1456
- this.calendar = calendar;
1457
- this.era = era;
1458
- this.year = year;
1459
- this.month = month;
1460
- this.day = day;
1461
- this.hour = args.shift() || 0;
1462
- this.minute = args.shift() || 0;
1463
- this.second = args.shift() || 0;
1464
- this.millisecond = args.shift() || 0;
1465
- (0, $5c0571aa5b6fb5da$export$c4e2ecac49351ef2)(this);
1466
- }
1467
- }
1468
- var // This prevents TypeScript from allowing other types with the same fields to match.
1469
- // @ts-ignore
1470
- $625ad1e1f4c43bc1$var$_type3 = /*#__PURE__*/ new WeakMap();
1471
- class $625ad1e1f4c43bc1$export$d3b7288e7994edea {
1472
- /** Returns a copy of this date. */ copy() {
1473
- if (this.era) return new $625ad1e1f4c43bc1$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
1474
- else return new $625ad1e1f4c43bc1$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
1475
- }
1476
- /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(duration) {
1477
- return (0, $5c0571aa5b6fb5da$export$96b1d28349274637)(this, duration);
1478
- }
1479
- /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(duration) {
1480
- return (0, $5c0571aa5b6fb5da$export$6814caac34ca03c7)(this, duration);
1481
- }
1482
- /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields, disambiguation) {
1483
- return (0, $5c0571aa5b6fb5da$export$31b5430eb18be4f8)(this, fields, disambiguation);
1484
- }
1485
- /**
1486
- * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
1487
- * When the resulting value reaches the limits of the field, it wraps around.
1488
- */ cycle(field, amount, options) {
1489
- return (0, $5c0571aa5b6fb5da$export$9a297d111fc86b79)(this, field, amount, options);
1490
- }
1491
- /** Converts the date to a native JavaScript Date object. */ toDate() {
1492
- return (0, $4ae0260a69729f1d$export$83aac07b4c37b25)(this);
1493
- }
1494
- /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() {
1495
- return (0, $4c32e2d98e5a5134$export$bf79f1ebf4b18792)(this);
1496
- }
1497
- /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() {
1498
- return this.toDate().toISOString();
1499
- }
1500
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(b) {
1501
- // TODO: Is this a bad idea??
1502
- return this.toDate().getTime() - (0, $4ae0260a69729f1d$export$84c95a83c799e074)(b, this.timeZone).toDate().getTime();
1503
- }
1504
- constructor(...args){
1505
- (0, $kgI3C$swchelperscjs_class_private_field_initcjs._)(this, $625ad1e1f4c43bc1$var$_type3, {
1506
- writable: true,
1507
- value: void 0
1508
- });
1509
- let [calendar, era, year, month, day] = $625ad1e1f4c43bc1$var$shiftArgs(args);
1510
- let timeZone = args.shift();
1511
- let offset = args.shift();
1512
- this.calendar = calendar;
1513
- this.era = era;
1514
- this.year = year;
1515
- this.month = month;
1516
- this.day = day;
1517
- this.timeZone = timeZone;
1518
- this.offset = offset;
1519
- this.hour = args.shift() || 0;
1520
- this.minute = args.shift() || 0;
1521
- this.second = args.shift() || 0;
1522
- this.millisecond = args.shift() || 0;
1523
- (0, $5c0571aa5b6fb5da$export$c4e2ecac49351ef2)(this);
1524
- }
1525
- }
1526
-
1527
-
1528
-
1529
- /*
1530
- * Copyright 2020 Adobe. All rights reserved.
1531
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1532
- * you may not use this file except in compliance with the License. You may obtain a copy
1533
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1534
- *
1535
- * Unless required by applicable law or agreed to in writing, software distributed under
1536
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1537
- * OF ANY KIND, either express or implied. See the License for the specific language
1538
- * governing permissions and limitations under the License.
1539
- */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
1540
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1541
-
1542
-
1543
- const $b0ac0602ef646b2c$var$ERA_START_DATES = [
1544
- [
1545
- 1868,
1546
- 9,
1547
- 8
1548
- ],
1549
- [
1550
- 1912,
1551
- 7,
1552
- 30
1553
- ],
1554
- [
1555
- 1926,
1556
- 12,
1557
- 25
1558
- ],
1559
- [
1560
- 1989,
1561
- 1,
1562
- 8
1563
- ],
1564
- [
1565
- 2019,
1566
- 5,
1567
- 1
1568
- ]
1569
- ];
1570
- const $b0ac0602ef646b2c$var$ERA_END_DATES = [
1571
- [
1572
- 1912,
1573
- 7,
1574
- 29
1575
- ],
1576
- [
1577
- 1926,
1578
- 12,
1579
- 24
1580
- ],
1581
- [
1582
- 1989,
1583
- 1,
1584
- 7
1585
- ],
1586
- [
1587
- 2019,
1588
- 4,
1589
- 30
1590
- ]
1591
- ];
1592
- const $b0ac0602ef646b2c$var$ERA_ADDENDS = [
1593
- 1867,
1594
- 1911,
1595
- 1925,
1596
- 1988,
1597
- 2018
1598
- ];
1599
- const $b0ac0602ef646b2c$var$ERA_NAMES = [
1600
- "meiji",
1601
- "taisho",
1602
- "showa",
1603
- "heisei",
1604
- "reiwa"
1605
- ];
1606
- function $b0ac0602ef646b2c$var$findEraFromGregorianDate(date) {
1607
- const idx = $b0ac0602ef646b2c$var$ERA_START_DATES.findIndex(([year, month, day])=>{
1608
- if (date.year < year) return true;
1609
- if (date.year === year && date.month < month) return true;
1610
- if (date.year === year && date.month === month && date.day < day) return true;
1611
- return false;
1612
- });
1613
- if (idx === -1) return $b0ac0602ef646b2c$var$ERA_START_DATES.length - 1;
1614
- if (idx === 0) return 0;
1615
- return idx - 1;
1616
- }
1617
- function $b0ac0602ef646b2c$var$toGregorian(date) {
1618
- let eraAddend = $b0ac0602ef646b2c$var$ERA_ADDENDS[$b0ac0602ef646b2c$var$ERA_NAMES.indexOf(date.era)];
1619
- if (!eraAddend) throw new Error("Unknown era: " + date.era);
1620
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(date.year + eraAddend, date.month, date.day);
1621
- }
1622
- class $b0ac0602ef646b2c$export$b746ab2b60cdffbf extends (0, $af14c9812fdceb33$export$80ee6245ec4f29ec) {
1623
- fromJulianDay(jd) {
1624
- let date = super.fromJulianDay(jd);
1625
- let era = $b0ac0602ef646b2c$var$findEraFromGregorianDate(date);
1626
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, $b0ac0602ef646b2c$var$ERA_NAMES[era], date.year - $b0ac0602ef646b2c$var$ERA_ADDENDS[era], date.month, date.day);
1627
- }
1628
- toJulianDay(date) {
1629
- return super.toJulianDay($b0ac0602ef646b2c$var$toGregorian(date));
1630
- }
1631
- balanceDate(date) {
1632
- let gregorianDate = $b0ac0602ef646b2c$var$toGregorian(date);
1633
- let era = $b0ac0602ef646b2c$var$findEraFromGregorianDate(gregorianDate);
1634
- if ($b0ac0602ef646b2c$var$ERA_NAMES[era] !== date.era) {
1635
- date.era = $b0ac0602ef646b2c$var$ERA_NAMES[era];
1636
- date.year = gregorianDate.year - $b0ac0602ef646b2c$var$ERA_ADDENDS[era];
1637
- }
1638
- // Constrain in case we went before the first supported era.
1639
- this.constrainDate(date);
1640
- }
1641
- constrainDate(date) {
1642
- let idx = $b0ac0602ef646b2c$var$ERA_NAMES.indexOf(date.era);
1643
- let end = $b0ac0602ef646b2c$var$ERA_END_DATES[idx];
1644
- if (end != null) {
1645
- let [endYear, endMonth, endDay] = end;
1646
- // Constrain the year to the maximum possible value in the era.
1647
- // Then constrain the month and day fields within that.
1648
- let maxYear = endYear - $b0ac0602ef646b2c$var$ERA_ADDENDS[idx];
1649
- date.year = Math.max(1, Math.min(maxYear, date.year));
1650
- if (date.year === maxYear) {
1651
- date.month = Math.min(endMonth, date.month);
1652
- if (date.month === endMonth) date.day = Math.min(endDay, date.day);
1653
- }
1654
- }
1655
- if (date.year === 1 && idx >= 0) {
1656
- let [, startMonth, startDay] = $b0ac0602ef646b2c$var$ERA_START_DATES[idx];
1657
- date.month = Math.max(startMonth, date.month);
1658
- if (date.month === startMonth) date.day = Math.max(startDay, date.day);
1659
- }
1660
- }
1661
- getEras() {
1662
- return $b0ac0602ef646b2c$var$ERA_NAMES;
1663
- }
1664
- getYearsInEra(date) {
1665
- // Get the number of years in the era, taking into account the date's month and day fields.
1666
- let era = $b0ac0602ef646b2c$var$ERA_NAMES.indexOf(date.era);
1667
- let cur = $b0ac0602ef646b2c$var$ERA_START_DATES[era];
1668
- let next = $b0ac0602ef646b2c$var$ERA_START_DATES[era + 1];
1669
- if (next == null) // 9999 gregorian is the maximum year allowed.
1670
- return 9999 - cur[0] + 1;
1671
- let years = next[0] - cur[0];
1672
- if (date.month < next[1] || date.month === next[1] && date.day < next[2]) years++;
1673
- return years;
1674
- }
1675
- getDaysInMonth(date) {
1676
- return super.getDaysInMonth($b0ac0602ef646b2c$var$toGregorian(date));
1677
- }
1678
- getMinimumMonthInYear(date) {
1679
- let start = $b0ac0602ef646b2c$var$getMinimums(date);
1680
- return start ? start[1] : 1;
1681
- }
1682
- getMinimumDayInMonth(date) {
1683
- let start = $b0ac0602ef646b2c$var$getMinimums(date);
1684
- return start && date.month === start[1] ? start[2] : 1;
1685
- }
1686
- constructor(...args){
1687
- super(...args);
1688
- this.identifier = "japanese";
1689
- }
1690
- }
1691
- function $b0ac0602ef646b2c$var$getMinimums(date) {
1692
- if (date.year === 1) {
1693
- let idx = $b0ac0602ef646b2c$var$ERA_NAMES.indexOf(date.era);
1694
- return $b0ac0602ef646b2c$var$ERA_START_DATES[idx];
1695
- }
1696
- }
1697
-
1698
-
1699
- /*
1700
- * Copyright 2020 Adobe. All rights reserved.
1701
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1702
- * you may not use this file except in compliance with the License. You may obtain a copy
1703
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1704
- *
1705
- * Unless required by applicable law or agreed to in writing, software distributed under
1706
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1707
- * OF ANY KIND, either express or implied. See the License for the specific language
1708
- * governing permissions and limitations under the License.
1709
- */ // Portions of the code in this file are based on code from ICU.
1710
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1711
-
1712
-
1713
- const $561c4ef058278b74$var$BUDDHIST_ERA_START = -543;
1714
- class $561c4ef058278b74$export$42d20a78301dee44 extends (0, $af14c9812fdceb33$export$80ee6245ec4f29ec) {
1715
- fromJulianDay(jd) {
1716
- let gregorianDate = super.fromJulianDay(jd);
1717
- let year = (0, $af14c9812fdceb33$export$c36e0ecb2d4fa69d)(gregorianDate.era, gregorianDate.year);
1718
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, year - $561c4ef058278b74$var$BUDDHIST_ERA_START, gregorianDate.month, gregorianDate.day);
1719
- }
1720
- toJulianDay(date) {
1721
- return super.toJulianDay($561c4ef058278b74$var$toGregorian(date));
1722
- }
1723
- getEras() {
1724
- return [
1725
- "BE"
1726
- ];
1727
- }
1728
- getDaysInMonth(date) {
1729
- return super.getDaysInMonth($561c4ef058278b74$var$toGregorian(date));
1730
- }
1731
- balanceDate() {}
1732
- constructor(...args){
1733
- super(...args);
1734
- this.identifier = "buddhist";
1735
- }
1736
- }
1737
- function $561c4ef058278b74$var$toGregorian(date) {
1738
- let [era, year] = (0, $af14c9812fdceb33$export$4475b7e617eb123c)(date.year + $561c4ef058278b74$var$BUDDHIST_ERA_START);
1739
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(era, year, date.month, date.day);
1740
- }
1741
-
1742
-
1743
- /*
1744
- * Copyright 2020 Adobe. All rights reserved.
1745
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1746
- * you may not use this file except in compliance with the License. You may obtain a copy
1747
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1748
- *
1749
- * Unless required by applicable law or agreed to in writing, software distributed under
1750
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1751
- * OF ANY KIND, either express or implied. See the License for the specific language
1752
- * governing permissions and limitations under the License.
1753
- */ // Portions of the code in this file are based on code from ICU.
1754
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1755
-
1756
-
1757
- const $9cc5d3577ec40243$var$TAIWAN_ERA_START = 1911;
1758
- function $9cc5d3577ec40243$var$gregorianYear(date) {
1759
- return date.era === "minguo" ? date.year + $9cc5d3577ec40243$var$TAIWAN_ERA_START : 1 - date.year + $9cc5d3577ec40243$var$TAIWAN_ERA_START;
1760
- }
1761
- function $9cc5d3577ec40243$var$gregorianToTaiwan(year) {
1762
- let y = year - $9cc5d3577ec40243$var$TAIWAN_ERA_START;
1763
- if (y > 0) return [
1764
- "minguo",
1765
- y
1766
- ];
1767
- else return [
1768
- "before_minguo",
1769
- 1 - y
1770
- ];
1771
- }
1772
- class $9cc5d3577ec40243$export$65e01080afcb0799 extends (0, $af14c9812fdceb33$export$80ee6245ec4f29ec) {
1773
- fromJulianDay(jd) {
1774
- let date = super.fromJulianDay(jd);
1775
- let extendedYear = (0, $af14c9812fdceb33$export$c36e0ecb2d4fa69d)(date.era, date.year);
1776
- let [era, year] = $9cc5d3577ec40243$var$gregorianToTaiwan(extendedYear);
1777
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, era, year, date.month, date.day);
1778
- }
1779
- toJulianDay(date) {
1780
- return super.toJulianDay($9cc5d3577ec40243$var$toGregorian(date));
1781
- }
1782
- getEras() {
1783
- return [
1784
- "before_minguo",
1785
- "minguo"
1786
- ];
1787
- }
1788
- balanceDate(date) {
1789
- let [era, year] = $9cc5d3577ec40243$var$gregorianToTaiwan($9cc5d3577ec40243$var$gregorianYear(date));
1790
- date.era = era;
1791
- date.year = year;
1792
- }
1793
- isInverseEra(date) {
1794
- return date.era === "before_minguo";
1795
- }
1796
- getDaysInMonth(date) {
1797
- return super.getDaysInMonth($9cc5d3577ec40243$var$toGregorian(date));
1798
- }
1799
- getYearsInEra(date) {
1800
- return date.era === "before_minguo" ? 9999 : 9999 - $9cc5d3577ec40243$var$TAIWAN_ERA_START;
1801
- }
1802
- constructor(...args){
1803
- super(...args);
1804
- this.identifier = "roc" // Republic of China
1805
- ;
1806
- }
1807
- }
1808
- function $9cc5d3577ec40243$var$toGregorian(date) {
1809
- let [era, year] = (0, $af14c9812fdceb33$export$4475b7e617eb123c)($9cc5d3577ec40243$var$gregorianYear(date));
1810
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(era, year, date.month, date.day);
1811
- }
1812
-
1813
-
1814
- /*
1815
- * Copyright 2020 Adobe. All rights reserved.
1816
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1817
- * you may not use this file except in compliance with the License. You may obtain a copy
1818
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1819
- *
1820
- * Unless required by applicable law or agreed to in writing, software distributed under
1821
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1822
- * OF ANY KIND, either express or implied. See the License for the specific language
1823
- * governing permissions and limitations under the License.
1824
- */ // Portions of the code in this file are based on code from ICU.
1825
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1826
-
1827
-
1828
- const $3c060181fc7249ae$var$PERSIAN_EPOCH = 1948320;
1829
- // Number of days from the start of the year to the start of each month.
1830
- const $3c060181fc7249ae$var$MONTH_START = [
1831
- 0,
1832
- 31,
1833
- 62,
1834
- 93,
1835
- 124,
1836
- 155,
1837
- 186,
1838
- 216,
1839
- 246,
1840
- 276,
1841
- 306,
1842
- 336 // Esfand
1843
- ];
1844
- class $3c060181fc7249ae$export$37fccdbfd14c5939 {
1845
- fromJulianDay(jd) {
1846
- let daysSinceEpoch = jd - $3c060181fc7249ae$var$PERSIAN_EPOCH;
1847
- let year = 1 + Math.floor((33 * daysSinceEpoch + 3) / 12053);
1848
- let farvardin1 = 365 * (year - 1) + Math.floor((8 * year + 21) / 33);
1849
- let dayOfYear = daysSinceEpoch - farvardin1;
1850
- let month = dayOfYear < 216 ? Math.floor(dayOfYear / 31) : Math.floor((dayOfYear - 6) / 30);
1851
- let day = dayOfYear - $3c060181fc7249ae$var$MONTH_START[month] + 1;
1852
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, year, month + 1, day);
1853
- }
1854
- toJulianDay(date) {
1855
- let jd = $3c060181fc7249ae$var$PERSIAN_EPOCH - 1 + 365 * (date.year - 1) + Math.floor((8 * date.year + 21) / 33);
1856
- jd += $3c060181fc7249ae$var$MONTH_START[date.month - 1];
1857
- jd += date.day;
1858
- return jd;
1859
- }
1860
- getMonthsInYear() {
1861
- return 12;
1862
- }
1863
- getDaysInMonth(date) {
1864
- if (date.month <= 6) return 31;
1865
- if (date.month <= 11) return 30;
1866
- let isLeapYear = (0, $a5090d6430502238$export$842a2cf37af977e1)(25 * date.year + 11, 33) < 8;
1867
- return isLeapYear ? 30 : 29;
1868
- }
1869
- getEras() {
1870
- return [
1871
- "AP"
1872
- ];
1873
- }
1874
- getYearsInEra() {
1875
- // 9378-10-10 persian is 9999-12-31 gregorian.
1876
- // Round down to 9377 to set the maximum full year.
1877
- return 9377;
1878
- }
1879
- constructor(){
1880
- this.identifier = "persian";
1881
- }
1882
- }
1883
-
1884
-
1885
- /*
1886
- * Copyright 2020 Adobe. All rights reserved.
1887
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1888
- * you may not use this file except in compliance with the License. You may obtain a copy
1889
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1890
- *
1891
- * Unless required by applicable law or agreed to in writing, software distributed under
1892
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1893
- * OF ANY KIND, either express or implied. See the License for the specific language
1894
- * governing permissions and limitations under the License.
1895
- */ // Portions of the code in this file are based on code from ICU.
1896
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1897
-
1898
-
1899
- // Starts in 78 AD,
1900
- const $5f1dfa5c67609fe6$var$INDIAN_ERA_START = 78;
1901
- // The Indian year starts 80 days later than the Gregorian year.
1902
- const $5f1dfa5c67609fe6$var$INDIAN_YEAR_START = 80;
1903
- class $5f1dfa5c67609fe6$export$39f31c639fa15726 extends (0, $af14c9812fdceb33$export$80ee6245ec4f29ec) {
1904
- fromJulianDay(jd) {
1905
- // Gregorian date for Julian day
1906
- let date = super.fromJulianDay(jd);
1907
- // Year in Saka era
1908
- let indianYear = date.year - $5f1dfa5c67609fe6$var$INDIAN_ERA_START;
1909
- // Day number in Gregorian year (starting from 0)
1910
- let yDay = jd - (0, $af14c9812fdceb33$export$f297eb839006d339)(date.era, date.year, 1, 1);
1911
- let leapMonth;
1912
- if (yDay < $5f1dfa5c67609fe6$var$INDIAN_YEAR_START) {
1913
- // Day is at the end of the preceding Saka year
1914
- indianYear--;
1915
- // Days in leapMonth this year, previous Gregorian year
1916
- leapMonth = (0, $af14c9812fdceb33$export$553d7fa8e3805fc0)(date.year - 1) ? 31 : 30;
1917
- yDay += leapMonth + 155 + 90 + 10;
1918
- } else {
1919
- // Days in leapMonth this year
1920
- leapMonth = (0, $af14c9812fdceb33$export$553d7fa8e3805fc0)(date.year) ? 31 : 30;
1921
- yDay -= $5f1dfa5c67609fe6$var$INDIAN_YEAR_START;
1922
- }
1923
- let indianMonth;
1924
- let indianDay;
1925
- if (yDay < leapMonth) {
1926
- indianMonth = 1;
1927
- indianDay = yDay + 1;
1928
- } else {
1929
- let mDay = yDay - leapMonth;
1930
- if (mDay < 155) {
1931
- indianMonth = Math.floor(mDay / 31) + 2;
1932
- indianDay = mDay % 31 + 1;
1933
- } else {
1934
- mDay -= 155;
1935
- indianMonth = Math.floor(mDay / 30) + 7;
1936
- indianDay = mDay % 30 + 1;
1937
- }
1938
- }
1939
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, indianYear, indianMonth, indianDay);
1940
- }
1941
- toJulianDay(date) {
1942
- let extendedYear = date.year + $5f1dfa5c67609fe6$var$INDIAN_ERA_START;
1943
- let [era, year] = (0, $af14c9812fdceb33$export$4475b7e617eb123c)(extendedYear);
1944
- let leapMonth;
1945
- let jd;
1946
- if ((0, $af14c9812fdceb33$export$553d7fa8e3805fc0)(year)) {
1947
- leapMonth = 31;
1948
- jd = (0, $af14c9812fdceb33$export$f297eb839006d339)(era, year, 3, 21);
1949
- } else {
1950
- leapMonth = 30;
1951
- jd = (0, $af14c9812fdceb33$export$f297eb839006d339)(era, year, 3, 22);
1952
- }
1953
- if (date.month === 1) return jd + date.day - 1;
1954
- jd += leapMonth + Math.min(date.month - 2, 5) * 31;
1955
- if (date.month >= 8) jd += (date.month - 7) * 30;
1956
- jd += date.day - 1;
1957
- return jd;
1958
- }
1959
- getDaysInMonth(date) {
1960
- if (date.month === 1 && (0, $af14c9812fdceb33$export$553d7fa8e3805fc0)(date.year + $5f1dfa5c67609fe6$var$INDIAN_ERA_START)) return 31;
1961
- if (date.month >= 2 && date.month <= 6) return 31;
1962
- return 30;
1963
- }
1964
- getYearsInEra() {
1965
- // 9999-12-31 gregorian is 9920-10-10 indian.
1966
- // Round down to 9919 for the last full year.
1967
- return 9919;
1968
- }
1969
- getEras() {
1970
- return [
1971
- "saka"
1972
- ];
1973
- }
1974
- balanceDate() {}
1975
- constructor(...args){
1976
- super(...args);
1977
- this.identifier = "indian";
1978
- }
1979
- }
1980
-
1981
-
1982
- /*
1983
- * Copyright 2020 Adobe. All rights reserved.
1984
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1985
- * you may not use this file except in compliance with the License. You may obtain a copy
1986
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1987
- *
1988
- * Unless required by applicable law or agreed to in writing, software distributed under
1989
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1990
- * OF ANY KIND, either express or implied. See the License for the specific language
1991
- * governing permissions and limitations under the License.
1992
- */ // Portions of the code in this file are based on code from ICU.
1993
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
1994
-
1995
- const $ecb2c4cc8c9aae25$var$CIVIL_EPOC = 1948440; // CE 622 July 16 Friday (Julian calendar) / CE 622 July 19 (Gregorian calendar)
1996
- const $ecb2c4cc8c9aae25$var$ASTRONOMICAL_EPOC = 1948439; // CE 622 July 15 Thursday (Julian calendar)
1997
- const $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START = 1300;
1998
- const $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END = 1600;
1999
- const $ecb2c4cc8c9aae25$var$UMALQURA_START_DAYS = 460322;
2000
- function $ecb2c4cc8c9aae25$var$islamicToJulianDay(epoch, year, month, day) {
2001
- return day + Math.ceil(29.5 * (month - 1)) + (year - 1) * 354 + Math.floor((3 + 11 * year) / 30) + epoch - 1;
2002
- }
2003
- function $ecb2c4cc8c9aae25$var$julianDayToIslamic(calendar, epoch, jd) {
2004
- let year = Math.floor((30 * (jd - epoch) + 10646) / 10631);
2005
- let month = Math.min(12, Math.ceil((jd - (29 + $ecb2c4cc8c9aae25$var$islamicToJulianDay(epoch, year, 1, 1))) / 29.5) + 1);
2006
- let day = jd - $ecb2c4cc8c9aae25$var$islamicToJulianDay(epoch, year, month, 1) + 1;
2007
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(calendar, year, month, day);
2008
- }
2009
- function $ecb2c4cc8c9aae25$var$isLeapYear(year) {
2010
- return (14 + 11 * year) % 30 < 11;
2011
- }
2012
- class $ecb2c4cc8c9aae25$export$2066795aadd37bfc {
2013
- fromJulianDay(jd) {
2014
- return $ecb2c4cc8c9aae25$var$julianDayToIslamic(this, $ecb2c4cc8c9aae25$var$CIVIL_EPOC, jd);
2015
- }
2016
- toJulianDay(date) {
2017
- return $ecb2c4cc8c9aae25$var$islamicToJulianDay($ecb2c4cc8c9aae25$var$CIVIL_EPOC, date.year, date.month, date.day);
2018
- }
2019
- getDaysInMonth(date) {
2020
- let length = 29 + date.month % 2;
2021
- if (date.month === 12 && $ecb2c4cc8c9aae25$var$isLeapYear(date.year)) length++;
2022
- return length;
2023
- }
2024
- getMonthsInYear() {
2025
- return 12;
2026
- }
2027
- getDaysInYear(date) {
2028
- return $ecb2c4cc8c9aae25$var$isLeapYear(date.year) ? 355 : 354;
2029
- }
2030
- getYearsInEra() {
2031
- // 9999 gregorian
2032
- return 9665;
2033
- }
2034
- getEras() {
2035
- return [
2036
- "AH"
2037
- ];
2038
- }
2039
- constructor(){
2040
- this.identifier = "islamic-civil";
2041
- }
2042
- }
2043
- class $ecb2c4cc8c9aae25$export$37f0887f2f9d22f7 extends $ecb2c4cc8c9aae25$export$2066795aadd37bfc {
2044
- fromJulianDay(jd) {
2045
- return $ecb2c4cc8c9aae25$var$julianDayToIslamic(this, $ecb2c4cc8c9aae25$var$ASTRONOMICAL_EPOC, jd);
2046
- }
2047
- toJulianDay(date) {
2048
- return $ecb2c4cc8c9aae25$var$islamicToJulianDay($ecb2c4cc8c9aae25$var$ASTRONOMICAL_EPOC, date.year, date.month, date.day);
2049
- }
2050
- constructor(...args){
2051
- super(...args);
2052
- this.identifier = "islamic-tbla";
2053
- }
2054
- }
2055
- // Generated by scripts/generate-umalqura.js
2056
- const $ecb2c4cc8c9aae25$var$UMALQURA_DATA = "qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";
2057
- let $ecb2c4cc8c9aae25$var$UMALQURA_MONTHLENGTH;
2058
- let $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE;
2059
- function $ecb2c4cc8c9aae25$var$umalquraYearStart(year) {
2060
- return $ecb2c4cc8c9aae25$var$UMALQURA_START_DAYS + $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE[year - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START];
2061
- }
2062
- function $ecb2c4cc8c9aae25$var$umalquraMonthLength(year, month) {
2063
- let idx = year - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START;
2064
- let mask = 0x01 << 11 - (month - 1);
2065
- if (($ecb2c4cc8c9aae25$var$UMALQURA_MONTHLENGTH[idx] & mask) === 0) return 29;
2066
- else return 30;
2067
- }
2068
- function $ecb2c4cc8c9aae25$var$umalquraMonthStart(year, month) {
2069
- let day = $ecb2c4cc8c9aae25$var$umalquraYearStart(year);
2070
- for(let i = 1; i < month; i++)day += $ecb2c4cc8c9aae25$var$umalquraMonthLength(year, i);
2071
- return day;
2072
- }
2073
- function $ecb2c4cc8c9aae25$var$umalquraYearLength(year) {
2074
- return $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE[year + 1 - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START] - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE[year - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START];
2075
- }
2076
- class $ecb2c4cc8c9aae25$export$5baab4758c231076 extends $ecb2c4cc8c9aae25$export$2066795aadd37bfc {
2077
- fromJulianDay(jd) {
2078
- let days = jd - $ecb2c4cc8c9aae25$var$CIVIL_EPOC;
2079
- let startDays = $ecb2c4cc8c9aae25$var$umalquraYearStart($ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START);
2080
- let endDays = $ecb2c4cc8c9aae25$var$umalquraYearStart($ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END);
2081
- if (days < startDays || days > endDays) return super.fromJulianDay(jd);
2082
- else {
2083
- let y = $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START - 1;
2084
- let m = 1;
2085
- let d = 1;
2086
- while(d > 0){
2087
- y++;
2088
- d = days - $ecb2c4cc8c9aae25$var$umalquraYearStart(y) + 1;
2089
- let yearLength = $ecb2c4cc8c9aae25$var$umalquraYearLength(y);
2090
- if (d === yearLength) {
2091
- m = 12;
2092
- break;
2093
- } else if (d < yearLength) {
2094
- let monthLength = $ecb2c4cc8c9aae25$var$umalquraMonthLength(y, m);
2095
- m = 1;
2096
- while(d > monthLength){
2097
- d -= monthLength;
2098
- m++;
2099
- monthLength = $ecb2c4cc8c9aae25$var$umalquraMonthLength(y, m);
2100
- }
2101
- break;
2102
- }
2103
- }
2104
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, y, m, days - $ecb2c4cc8c9aae25$var$umalquraMonthStart(y, m) + 1);
2105
- }
2106
- }
2107
- toJulianDay(date) {
2108
- if (date.year < $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START || date.year > $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END) return super.toJulianDay(date);
2109
- return $ecb2c4cc8c9aae25$var$CIVIL_EPOC + $ecb2c4cc8c9aae25$var$umalquraMonthStart(date.year, date.month) + (date.day - 1);
2110
- }
2111
- getDaysInMonth(date) {
2112
- if (date.year < $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START || date.year > $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END) return super.getDaysInMonth(date);
2113
- return $ecb2c4cc8c9aae25$var$umalquraMonthLength(date.year, date.month);
2114
- }
2115
- getDaysInYear(date) {
2116
- if (date.year < $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START || date.year > $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END) return super.getDaysInYear(date);
2117
- return $ecb2c4cc8c9aae25$var$umalquraYearLength(date.year);
2118
- }
2119
- constructor(){
2120
- super();
2121
- this.identifier = "islamic-umalqura";
2122
- if (!$ecb2c4cc8c9aae25$var$UMALQURA_MONTHLENGTH) $ecb2c4cc8c9aae25$var$UMALQURA_MONTHLENGTH = new Uint16Array(Uint8Array.from(atob($ecb2c4cc8c9aae25$var$UMALQURA_DATA), (c)=>c.charCodeAt(0)).buffer);
2123
- if (!$ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE) {
2124
- $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE = new Uint32Array($ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START + 1);
2125
- let yearStart = 0;
2126
- for(let year = $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START; year <= $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_END; year++){
2127
- $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START_TABLE[year - $ecb2c4cc8c9aae25$var$UMALQURA_YEAR_START] = yearStart;
2128
- for(let i = 1; i <= 12; i++)yearStart += $ecb2c4cc8c9aae25$var$umalquraMonthLength(year, i);
2129
- }
2130
- }
2131
- }
2132
- }
2133
-
2134
-
2135
- /*
2136
- * Copyright 2020 Adobe. All rights reserved.
2137
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2138
- * you may not use this file except in compliance with the License. You may obtain a copy
2139
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2140
- *
2141
- * Unless required by applicable law or agreed to in writing, software distributed under
2142
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2143
- * OF ANY KIND, either express or implied. See the License for the specific language
2144
- * governing permissions and limitations under the License.
2145
- */ // Portions of the code in this file are based on code from ICU.
2146
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
2147
-
2148
-
2149
- const $0f5324ee3bdd9396$var$HEBREW_EPOCH = 347997;
2150
- // Hebrew date calculations are performed in terms of days, hours, and
2151
- // "parts" (or halakim), which are 1/1080 of an hour, or 3 1/3 seconds.
2152
- const $0f5324ee3bdd9396$var$HOUR_PARTS = 1080;
2153
- const $0f5324ee3bdd9396$var$DAY_PARTS = 24 * $0f5324ee3bdd9396$var$HOUR_PARTS;
2154
- // An approximate value for the length of a lunar month.
2155
- // It is used to calculate the approximate year and month of a given
2156
- // absolute date.
2157
- const $0f5324ee3bdd9396$var$MONTH_DAYS = 29;
2158
- const $0f5324ee3bdd9396$var$MONTH_FRACT = 12 * $0f5324ee3bdd9396$var$HOUR_PARTS + 793;
2159
- const $0f5324ee3bdd9396$var$MONTH_PARTS = $0f5324ee3bdd9396$var$MONTH_DAYS * $0f5324ee3bdd9396$var$DAY_PARTS + $0f5324ee3bdd9396$var$MONTH_FRACT;
2160
- function $0f5324ee3bdd9396$var$isLeapYear(year) {
2161
- return (0, $a5090d6430502238$export$842a2cf37af977e1)(year * 7 + 1, 19) < 7;
2162
- }
2163
- // Test for delay of start of new year and to avoid
2164
- // Sunday, Wednesday, and Friday as start of the new year.
2165
- function $0f5324ee3bdd9396$var$hebrewDelay1(year) {
2166
- let months = Math.floor((235 * year - 234) / 19);
2167
- let parts = 12084 + 13753 * months;
2168
- let day = months * 29 + Math.floor(parts / 25920);
2169
- if ((0, $a5090d6430502238$export$842a2cf37af977e1)(3 * (day + 1), 7) < 3) day += 1;
2170
- return day;
2171
- }
2172
- // Check for delay in start of new year due to length of adjacent years
2173
- function $0f5324ee3bdd9396$var$hebrewDelay2(year) {
2174
- let last = $0f5324ee3bdd9396$var$hebrewDelay1(year - 1);
2175
- let present = $0f5324ee3bdd9396$var$hebrewDelay1(year);
2176
- let next = $0f5324ee3bdd9396$var$hebrewDelay1(year + 1);
2177
- if (next - present === 356) return 2;
2178
- if (present - last === 382) return 1;
2179
- return 0;
2180
- }
2181
- function $0f5324ee3bdd9396$var$startOfYear(year) {
2182
- return $0f5324ee3bdd9396$var$hebrewDelay1(year) + $0f5324ee3bdd9396$var$hebrewDelay2(year);
2183
- }
2184
- function $0f5324ee3bdd9396$var$getDaysInYear(year) {
2185
- return $0f5324ee3bdd9396$var$startOfYear(year + 1) - $0f5324ee3bdd9396$var$startOfYear(year);
2186
- }
2187
- function $0f5324ee3bdd9396$var$getYearType(year) {
2188
- let yearLength = $0f5324ee3bdd9396$var$getDaysInYear(year);
2189
- if (yearLength > 380) yearLength -= 30; // Subtract length of leap month.
2190
- switch(yearLength){
2191
- case 353:
2192
- return 0; // deficient
2193
- case 354:
2194
- return 1; // normal
2195
- case 355:
2196
- return 2; // complete
2197
- }
2198
- }
2199
- function $0f5324ee3bdd9396$var$getDaysInMonth(year, month) {
2200
- // Normalize month numbers from 1 - 13, even on non-leap years
2201
- if (month >= 6 && !$0f5324ee3bdd9396$var$isLeapYear(year)) month++;
2202
- // First of all, dispose of fixed-length 29 day months
2203
- if (month === 4 || month === 7 || month === 9 || month === 11 || month === 13) return 29;
2204
- let yearType = $0f5324ee3bdd9396$var$getYearType(year);
2205
- // If it's Heshvan, days depend on length of year
2206
- if (month === 2) return yearType === 2 ? 30 : 29;
2207
- // Similarly, Kislev varies with the length of year
2208
- if (month === 3) return yearType === 0 ? 29 : 30;
2209
- // Adar I only exists in leap years
2210
- if (month === 6) return $0f5324ee3bdd9396$var$isLeapYear(year) ? 30 : 0;
2211
- return 30;
2212
- }
2213
- class $0f5324ee3bdd9396$export$ca405048b8fb5af {
2214
- fromJulianDay(jd) {
2215
- let d = jd - $0f5324ee3bdd9396$var$HEBREW_EPOCH;
2216
- let m = d * $0f5324ee3bdd9396$var$DAY_PARTS / $0f5324ee3bdd9396$var$MONTH_PARTS; // Months (approx)
2217
- let year = Math.floor((19 * m + 234) / 235) + 1; // Years (approx)
2218
- let ys = $0f5324ee3bdd9396$var$startOfYear(year); // 1st day of year
2219
- let dayOfYear = Math.floor(d - ys);
2220
- // Because of the postponement rules, it's possible to guess wrong. Fix it.
2221
- while(dayOfYear < 1){
2222
- year--;
2223
- ys = $0f5324ee3bdd9396$var$startOfYear(year);
2224
- dayOfYear = Math.floor(d - ys);
2225
- }
2226
- // Now figure out which month we're in, and the date within that month
2227
- let month = 1;
2228
- let monthStart = 0;
2229
- while(monthStart < dayOfYear){
2230
- monthStart += $0f5324ee3bdd9396$var$getDaysInMonth(year, month);
2231
- month++;
2232
- }
2233
- month--;
2234
- monthStart -= $0f5324ee3bdd9396$var$getDaysInMonth(year, month);
2235
- let day = dayOfYear - monthStart;
2236
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, year, month, day);
2237
- }
2238
- toJulianDay(date) {
2239
- let jd = $0f5324ee3bdd9396$var$startOfYear(date.year);
2240
- for(let month = 1; month < date.month; month++)jd += $0f5324ee3bdd9396$var$getDaysInMonth(date.year, month);
2241
- return jd + date.day + $0f5324ee3bdd9396$var$HEBREW_EPOCH;
2242
- }
2243
- getDaysInMonth(date) {
2244
- return $0f5324ee3bdd9396$var$getDaysInMonth(date.year, date.month);
2245
- }
2246
- getMonthsInYear(date) {
2247
- return $0f5324ee3bdd9396$var$isLeapYear(date.year) ? 13 : 12;
2248
- }
2249
- getDaysInYear(date) {
2250
- return $0f5324ee3bdd9396$var$getDaysInYear(date.year);
2251
- }
2252
- getYearsInEra() {
2253
- // 6239 gregorian
2254
- return 9999;
2255
- }
2256
- getEras() {
2257
- return [
2258
- "AM"
2259
- ];
2260
- }
2261
- balanceYearMonth(date, previousDate) {
2262
- // Keep date in the same month when switching between leap years and non leap years
2263
- if (previousDate.year !== date.year) {
2264
- if ($0f5324ee3bdd9396$var$isLeapYear(previousDate.year) && !$0f5324ee3bdd9396$var$isLeapYear(date.year) && previousDate.month > 6) date.month--;
2265
- else if (!$0f5324ee3bdd9396$var$isLeapYear(previousDate.year) && $0f5324ee3bdd9396$var$isLeapYear(date.year) && previousDate.month > 6) date.month++;
2266
- }
2267
- }
2268
- constructor(){
2269
- this.identifier = "hebrew";
2270
- }
2271
- }
2272
-
2273
-
2274
- /*
2275
- * Copyright 2020 Adobe. All rights reserved.
2276
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2277
- * you may not use this file except in compliance with the License. You may obtain a copy
2278
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2279
- *
2280
- * Unless required by applicable law or agreed to in writing, software distributed under
2281
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2282
- * OF ANY KIND, either express or implied. See the License for the specific language
2283
- * governing permissions and limitations under the License.
2284
- */ // Portions of the code in this file are based on code from ICU.
2285
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
2286
-
2287
- const $4db04d1051af0f2f$var$ETHIOPIC_EPOCH = 1723856;
2288
- const $4db04d1051af0f2f$var$COPTIC_EPOCH = 1824665;
2289
- // The delta between Amete Alem 1 and Amete Mihret 1
2290
- // AA 5501 = AM 1
2291
- const $4db04d1051af0f2f$var$AMETE_MIHRET_DELTA = 5500;
2292
- function $4db04d1051af0f2f$var$ceToJulianDay(epoch, year, month, day) {
2293
- return epoch // difference from Julian epoch to 1,1,1
2294
- + 365 * year // number of days from years
2295
- + Math.floor(year / 4) // extra day of leap year
2296
- + 30 * (month - 1 // number of days from months (1 based)
2297
- ) + day - 1 // number of days for present month (1 based)
2298
- ;
2299
- }
2300
- function $4db04d1051af0f2f$var$julianDayToCE(epoch, jd) {
2301
- let year = Math.floor(4 * (jd - epoch) / 1461);
2302
- let month = 1 + Math.floor((jd - $4db04d1051af0f2f$var$ceToJulianDay(epoch, year, 1, 1)) / 30);
2303
- let day = jd + 1 - $4db04d1051af0f2f$var$ceToJulianDay(epoch, year, month, 1);
2304
- return [
2305
- year,
2306
- month,
2307
- day
2308
- ];
2309
- }
2310
- function $4db04d1051af0f2f$var$getLeapDay(year) {
2311
- return Math.floor(year % 4 / 3);
2312
- }
2313
- function $4db04d1051af0f2f$var$getDaysInMonth(year, month) {
2314
- // The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and
2315
- // an intercalary month at the end of the year of 5 or 6 days, depending whether
2316
- // the year is a leap year or not. The Leap Year follows the same rules as the
2317
- // Julian Calendar so that the extra month always has six days in the year before
2318
- // a Julian Leap Year.
2319
- if (month % 13 !== 0) // not intercalary month
2320
- return 30;
2321
- else // intercalary month 5 days + possible leap day
2322
- return $4db04d1051af0f2f$var$getLeapDay(year) + 5;
2323
- }
2324
- class $4db04d1051af0f2f$export$26ba6eab5e20cd7d {
2325
- fromJulianDay(jd) {
2326
- let [year, month, day] = $4db04d1051af0f2f$var$julianDayToCE($4db04d1051af0f2f$var$ETHIOPIC_EPOCH, jd);
2327
- let era = "AM";
2328
- if (year <= 0) {
2329
- era = "AA";
2330
- year += $4db04d1051af0f2f$var$AMETE_MIHRET_DELTA;
2331
- }
2332
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, era, year, month, day);
2333
- }
2334
- toJulianDay(date) {
2335
- let year = date.year;
2336
- if (date.era === "AA") year -= $4db04d1051af0f2f$var$AMETE_MIHRET_DELTA;
2337
- return $4db04d1051af0f2f$var$ceToJulianDay($4db04d1051af0f2f$var$ETHIOPIC_EPOCH, year, date.month, date.day);
2338
- }
2339
- getDaysInMonth(date) {
2340
- return $4db04d1051af0f2f$var$getDaysInMonth(date.year, date.month);
2341
- }
2342
- getMonthsInYear() {
2343
- return 13;
2344
- }
2345
- getDaysInYear(date) {
2346
- return 365 + $4db04d1051af0f2f$var$getLeapDay(date.year);
2347
- }
2348
- getYearsInEra(date) {
2349
- // 9999-12-31 gregorian is 9992-20-02 ethiopic.
2350
- // Round down to 9991 for the last full year.
2351
- // AA 9999-01-01 ethiopic is 4506-09-30 gregorian.
2352
- return date.era === "AA" ? 9999 : 9991;
2353
- }
2354
- getEras() {
2355
- return [
2356
- "AA",
2357
- "AM"
2358
- ];
2359
- }
2360
- constructor(){
2361
- this.identifier = "ethiopic";
2362
- }
2363
- }
2364
- class $4db04d1051af0f2f$export$d72e0c37005a4914 extends $4db04d1051af0f2f$export$26ba6eab5e20cd7d {
2365
- fromJulianDay(jd) {
2366
- let [year, month, day] = $4db04d1051af0f2f$var$julianDayToCE($4db04d1051af0f2f$var$ETHIOPIC_EPOCH, jd);
2367
- year += $4db04d1051af0f2f$var$AMETE_MIHRET_DELTA;
2368
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, "AA", year, month, day);
2369
- }
2370
- getEras() {
2371
- return [
2372
- "AA"
2373
- ];
2374
- }
2375
- getYearsInEra() {
2376
- // 9999-13-04 ethioaa is the maximum date, which is equivalent to 4506-09-29 gregorian.
2377
- return 9999;
2378
- }
2379
- constructor(...args){
2380
- super(...args);
2381
- this.identifier = "ethioaa" // also known as 'ethiopic-amete-alem' in ICU
2382
- ;
2383
- }
2384
- }
2385
- class $4db04d1051af0f2f$export$fe6243cbe1a4b7c1 extends $4db04d1051af0f2f$export$26ba6eab5e20cd7d {
2386
- fromJulianDay(jd) {
2387
- let [year, month, day] = $4db04d1051af0f2f$var$julianDayToCE($4db04d1051af0f2f$var$COPTIC_EPOCH, jd);
2388
- let era = "CE";
2389
- if (year <= 0) {
2390
- era = "BCE";
2391
- year = 1 - year;
2392
- }
2393
- return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, era, year, month, day);
2394
- }
2395
- toJulianDay(date) {
2396
- let year = date.year;
2397
- if (date.era === "BCE") year = 1 - year;
2398
- return $4db04d1051af0f2f$var$ceToJulianDay($4db04d1051af0f2f$var$COPTIC_EPOCH, year, date.month, date.day);
2399
- }
2400
- getDaysInMonth(date) {
2401
- let year = date.year;
2402
- if (date.era === "BCE") year = 1 - year;
2403
- return $4db04d1051af0f2f$var$getDaysInMonth(year, date.month);
2404
- }
2405
- isInverseEra(date) {
2406
- return date.era === "BCE";
2407
- }
2408
- balanceDate(date) {
2409
- if (date.year <= 0) {
2410
- date.era = date.era === "BCE" ? "CE" : "BCE";
2411
- date.year = 1 - date.year;
2412
- }
2413
- }
2414
- getEras() {
2415
- return [
2416
- "BCE",
2417
- "CE"
2418
- ];
2419
- }
2420
- getYearsInEra(date) {
2421
- // 9999-12-30 gregorian is 9716-02-20 coptic.
2422
- // Round down to 9715 for the last full year.
2423
- // BCE 9999-01-01 coptic is BC 9716-06-15 gregorian.
2424
- return date.era === "BCE" ? 9999 : 9715;
2425
- }
2426
- constructor(...args){
2427
- super(...args);
2428
- this.identifier = "coptic";
2429
- }
2430
- }
2431
-
2432
-
22
+ $parcel$export(module.exports, "CalendarDate", () => $625ad1e1f4c43bc1$exports.CalendarDate);
23
+ $parcel$export(module.exports, "CalendarDateTime", () => $625ad1e1f4c43bc1$exports.CalendarDateTime);
24
+ $parcel$export(module.exports, "Time", () => $625ad1e1f4c43bc1$exports.Time);
25
+ $parcel$export(module.exports, "ZonedDateTime", () => $625ad1e1f4c43bc1$exports.ZonedDateTime);
26
+ $parcel$export(module.exports, "GregorianCalendar", () => $af14c9812fdceb33$exports.GregorianCalendar);
27
+ $parcel$export(module.exports, "JapaneseCalendar", () => $b0ac0602ef646b2c$exports.JapaneseCalendar);
28
+ $parcel$export(module.exports, "BuddhistCalendar", () => $561c4ef058278b74$exports.BuddhistCalendar);
29
+ $parcel$export(module.exports, "TaiwanCalendar", () => $9cc5d3577ec40243$exports.TaiwanCalendar);
30
+ $parcel$export(module.exports, "PersianCalendar", () => $3c060181fc7249ae$exports.PersianCalendar);
31
+ $parcel$export(module.exports, "IndianCalendar", () => $5f1dfa5c67609fe6$exports.IndianCalendar);
32
+ $parcel$export(module.exports, "IslamicCivilCalendar", () => $ecb2c4cc8c9aae25$exports.IslamicCivilCalendar);
33
+ $parcel$export(module.exports, "IslamicTabularCalendar", () => $ecb2c4cc8c9aae25$exports.IslamicTabularCalendar);
34
+ $parcel$export(module.exports, "IslamicUmalquraCalendar", () => $ecb2c4cc8c9aae25$exports.IslamicUmalquraCalendar);
35
+ $parcel$export(module.exports, "HebrewCalendar", () => $0f5324ee3bdd9396$exports.HebrewCalendar);
36
+ $parcel$export(module.exports, "EthiopicCalendar", () => $4db04d1051af0f2f$exports.EthiopicCalendar);
37
+ $parcel$export(module.exports, "EthiopicAmeteAlemCalendar", () => $4db04d1051af0f2f$exports.EthiopicAmeteAlemCalendar);
38
+ $parcel$export(module.exports, "CopticCalendar", () => $4db04d1051af0f2f$exports.CopticCalendar);
39
+ $parcel$export(module.exports, "createCalendar", () => $4922c0a5a69da0ba$exports.createCalendar);
40
+ $parcel$export(module.exports, "toCalendarDate", () => $4ae0260a69729f1d$exports.toCalendarDate);
41
+ $parcel$export(module.exports, "toCalendarDateTime", () => $4ae0260a69729f1d$exports.toCalendarDateTime);
42
+ $parcel$export(module.exports, "toTime", () => $4ae0260a69729f1d$exports.toTime);
43
+ $parcel$export(module.exports, "toCalendar", () => $4ae0260a69729f1d$exports.toCalendar);
44
+ $parcel$export(module.exports, "toZoned", () => $4ae0260a69729f1d$exports.toZoned);
45
+ $parcel$export(module.exports, "toTimeZone", () => $4ae0260a69729f1d$exports.toTimeZone);
46
+ $parcel$export(module.exports, "toLocalTimeZone", () => $4ae0260a69729f1d$exports.toLocalTimeZone);
47
+ $parcel$export(module.exports, "fromDate", () => $4ae0260a69729f1d$exports.fromDate);
48
+ $parcel$export(module.exports, "fromAbsolute", () => $4ae0260a69729f1d$exports.fromAbsolute);
49
+ $parcel$export(module.exports, "isSameDay", () => $1f0f7ebf1ae6c530$exports.isSameDay);
50
+ $parcel$export(module.exports, "isSameMonth", () => $1f0f7ebf1ae6c530$exports.isSameMonth);
51
+ $parcel$export(module.exports, "isSameYear", () => $1f0f7ebf1ae6c530$exports.isSameYear);
52
+ $parcel$export(module.exports, "isEqualDay", () => $1f0f7ebf1ae6c530$exports.isEqualDay);
53
+ $parcel$export(module.exports, "isEqualMonth", () => $1f0f7ebf1ae6c530$exports.isEqualMonth);
54
+ $parcel$export(module.exports, "isEqualYear", () => $1f0f7ebf1ae6c530$exports.isEqualYear);
55
+ $parcel$export(module.exports, "isToday", () => $1f0f7ebf1ae6c530$exports.isToday);
56
+ $parcel$export(module.exports, "getDayOfWeek", () => $1f0f7ebf1ae6c530$exports.getDayOfWeek);
57
+ $parcel$export(module.exports, "now", () => $1f0f7ebf1ae6c530$exports.now);
58
+ $parcel$export(module.exports, "today", () => $1f0f7ebf1ae6c530$exports.today);
59
+ $parcel$export(module.exports, "getHoursInDay", () => $1f0f7ebf1ae6c530$exports.getHoursInDay);
60
+ $parcel$export(module.exports, "getLocalTimeZone", () => $1f0f7ebf1ae6c530$exports.getLocalTimeZone);
61
+ $parcel$export(module.exports, "startOfMonth", () => $1f0f7ebf1ae6c530$exports.startOfMonth);
62
+ $parcel$export(module.exports, "startOfWeek", () => $1f0f7ebf1ae6c530$exports.startOfWeek);
63
+ $parcel$export(module.exports, "startOfYear", () => $1f0f7ebf1ae6c530$exports.startOfYear);
64
+ $parcel$export(module.exports, "endOfMonth", () => $1f0f7ebf1ae6c530$exports.endOfMonth);
65
+ $parcel$export(module.exports, "endOfWeek", () => $1f0f7ebf1ae6c530$exports.endOfWeek);
66
+ $parcel$export(module.exports, "endOfYear", () => $1f0f7ebf1ae6c530$exports.endOfYear);
67
+ $parcel$export(module.exports, "getMinimumMonthInYear", () => $1f0f7ebf1ae6c530$exports.getMinimumMonthInYear);
68
+ $parcel$export(module.exports, "getMinimumDayInMonth", () => $1f0f7ebf1ae6c530$exports.getMinimumDayInMonth);
69
+ $parcel$export(module.exports, "getWeeksInMonth", () => $1f0f7ebf1ae6c530$exports.getWeeksInMonth);
70
+ $parcel$export(module.exports, "minDate", () => $1f0f7ebf1ae6c530$exports.minDate);
71
+ $parcel$export(module.exports, "maxDate", () => $1f0f7ebf1ae6c530$exports.maxDate);
72
+ $parcel$export(module.exports, "isWeekend", () => $1f0f7ebf1ae6c530$exports.isWeekend);
73
+ $parcel$export(module.exports, "isWeekday", () => $1f0f7ebf1ae6c530$exports.isWeekday);
74
+ $parcel$export(module.exports, "parseDate", () => $4c32e2d98e5a5134$exports.parseDate);
75
+ $parcel$export(module.exports, "parseDateTime", () => $4c32e2d98e5a5134$exports.parseDateTime);
76
+ $parcel$export(module.exports, "parseTime", () => $4c32e2d98e5a5134$exports.parseTime);
77
+ $parcel$export(module.exports, "parseAbsolute", () => $4c32e2d98e5a5134$exports.parseAbsolute);
78
+ $parcel$export(module.exports, "parseAbsoluteToLocal", () => $4c32e2d98e5a5134$exports.parseAbsoluteToLocal);
79
+ $parcel$export(module.exports, "parseZonedDateTime", () => $4c32e2d98e5a5134$exports.parseZonedDateTime);
80
+ $parcel$export(module.exports, "parseDuration", () => $4c32e2d98e5a5134$exports.parseDuration);
81
+ $parcel$export(module.exports, "DateFormatter", () => $8f23a04ae90a588b$exports.DateFormatter);
2433
82
  /*
2434
83
  * Copyright 2020 Adobe. All rights reserved.
2435
84
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -2449,178 +98,10 @@ class $4db04d1051af0f2f$export$fe6243cbe1a4b7c1 extends $4db04d1051af0f2f$export
2449
98
 
2450
99
 
2451
100
 
2452
- function $4922c0a5a69da0ba$export$dd0bbc9b26defe37(name) {
2453
- switch(name){
2454
- case "buddhist":
2455
- return new (0, $561c4ef058278b74$export$42d20a78301dee44)();
2456
- case "ethiopic":
2457
- return new (0, $4db04d1051af0f2f$export$26ba6eab5e20cd7d)();
2458
- case "ethioaa":
2459
- return new (0, $4db04d1051af0f2f$export$d72e0c37005a4914)();
2460
- case "coptic":
2461
- return new (0, $4db04d1051af0f2f$export$fe6243cbe1a4b7c1)();
2462
- case "hebrew":
2463
- return new (0, $0f5324ee3bdd9396$export$ca405048b8fb5af)();
2464
- case "indian":
2465
- return new (0, $5f1dfa5c67609fe6$export$39f31c639fa15726)();
2466
- case "islamic-civil":
2467
- return new (0, $ecb2c4cc8c9aae25$export$2066795aadd37bfc)();
2468
- case "islamic-tbla":
2469
- return new (0, $ecb2c4cc8c9aae25$export$37f0887f2f9d22f7)();
2470
- case "islamic-umalqura":
2471
- return new (0, $ecb2c4cc8c9aae25$export$5baab4758c231076)();
2472
- case "japanese":
2473
- return new (0, $b0ac0602ef646b2c$export$b746ab2b60cdffbf)();
2474
- case "persian":
2475
- return new (0, $3c060181fc7249ae$export$37fccdbfd14c5939)();
2476
- case "roc":
2477
- return new (0, $9cc5d3577ec40243$export$65e01080afcb0799)();
2478
- case "gregory":
2479
- default:
2480
- return new (0, $af14c9812fdceb33$export$80ee6245ec4f29ec)();
2481
- }
2482
- }
2483
-
2484
101
 
2485
102
 
2486
103
 
2487
104
 
2488
- /*
2489
- * Copyright 2020 Adobe. All rights reserved.
2490
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
2491
- * you may not use this file except in compliance with the License. You may obtain a copy
2492
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
2493
- *
2494
- * Unless required by applicable law or agreed to in writing, software distributed under
2495
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
2496
- * OF ANY KIND, either express or implied. See the License for the specific language
2497
- * governing permissions and limitations under the License.
2498
- */ let $8f23a04ae90a588b$var$formatterCache = new Map();
2499
- class $8f23a04ae90a588b$export$ad991b66133851cf {
2500
- /** Formats a date as a string according to the locale and format options passed to the constructor. */ format(value) {
2501
- return this.formatter.format(value);
2502
- }
2503
- /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */ formatToParts(value) {
2504
- return this.formatter.formatToParts(value);
2505
- }
2506
- /** Formats a date range as a string. */ formatRange(start, end) {
2507
- // @ts-ignore
2508
- if (typeof this.formatter.formatRange === "function") // @ts-ignore
2509
- return this.formatter.formatRange(start, end);
2510
- if (end < start) throw new RangeError("End date must be >= start date");
2511
- // Very basic fallback for old browsers.
2512
- return `${this.formatter.format(start)} \u{2013} ${this.formatter.format(end)}`;
2513
- }
2514
- /** Formats a date range as an array of parts. */ formatRangeToParts(start, end) {
2515
- // @ts-ignore
2516
- if (typeof this.formatter.formatRangeToParts === "function") // @ts-ignore
2517
- return this.formatter.formatRangeToParts(start, end);
2518
- if (end < start) throw new RangeError("End date must be >= start date");
2519
- let startParts = this.formatter.formatToParts(start);
2520
- let endParts = this.formatter.formatToParts(end);
2521
- return [
2522
- ...startParts.map((p)=>({
2523
- ...p,
2524
- source: "startRange"
2525
- })),
2526
- {
2527
- type: "literal",
2528
- value: " \u2013 ",
2529
- source: "shared"
2530
- },
2531
- ...endParts.map((p)=>({
2532
- ...p,
2533
- source: "endRange"
2534
- }))
2535
- ];
2536
- }
2537
- /** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
2538
- let resolvedOptions = this.formatter.resolvedOptions();
2539
- if ($8f23a04ae90a588b$var$hasBuggyResolvedHourCycle()) {
2540
- if (!this.resolvedHourCycle) this.resolvedHourCycle = $8f23a04ae90a588b$var$getResolvedHourCycle(resolvedOptions.locale, this.options);
2541
- resolvedOptions.hourCycle = this.resolvedHourCycle;
2542
- resolvedOptions.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12";
2543
- }
2544
- // Safari uses a different name for the Ethiopic (Amete Alem) calendar.
2545
- // https://bugs.webkit.org/show_bug.cgi?id=241564
2546
- if (resolvedOptions.calendar === "ethiopic-amete-alem") resolvedOptions.calendar = "ethioaa";
2547
- return resolvedOptions;
2548
- }
2549
- constructor(locale, options = {}){
2550
- this.formatter = $8f23a04ae90a588b$var$getCachedDateFormatter(locale, options);
2551
- this.options = options;
2552
- }
2553
- }
2554
- // There are multiple bugs involving the hour12 and hourCycle options in various browser engines.
2555
- // - Chrome [1] (and the ECMA 402 spec [2]) resolve hour12: false in English and other locales to h24 (24:00 - 23:59)
2556
- // rather than h23 (00:00 - 23:59). Same can happen with hour12: true in French, which Chrome resolves to h11 (00:00 - 11:59)
2557
- // rather than h12 (12:00 - 11:59).
2558
- // - WebKit returns an incorrect hourCycle resolved option in the French locale due to incorrect parsing of 'h' literal
2559
- // in the resolved pattern. It also formats incorrectly when specifying the hourCycle option for the same reason. [3]
2560
- // [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1045791
2561
- // [2] https://github.com/tc39/ecma402/issues/402
2562
- // [3] https://bugs.webkit.org/show_bug.cgi?id=229313
2563
- // https://github.com/unicode-org/cldr/blob/018b55eff7ceb389c7e3fc44e2f657eae3b10b38/common/supplemental/supplementalData.xml#L4774-L4802
2564
- const $8f23a04ae90a588b$var$hour12Preferences = {
2565
- true: {
2566
- // Only Japanese uses the h11 style for 12 hour time. All others use h12.
2567
- ja: "h11"
2568
- },
2569
- false: {
2570
- }
2571
- };
2572
- function $8f23a04ae90a588b$var$getCachedDateFormatter(locale, options = {}) {
2573
- // Work around buggy hour12 behavior in Chrome / ECMA 402 spec by using hourCycle instead.
2574
- // Only apply the workaround if the issue is detected, because the hourCycle option is buggy in Safari.
2575
- if (typeof options.hour12 === "boolean" && $8f23a04ae90a588b$var$hasBuggyHour12Behavior()) {
2576
- options = {
2577
- ...options
2578
- };
2579
- let pref = $8f23a04ae90a588b$var$hour12Preferences[String(options.hour12)][locale.split("-")[0]];
2580
- let defaultHourCycle = options.hour12 ? "h12" : "h23";
2581
- options.hourCycle = pref !== null && pref !== void 0 ? pref : defaultHourCycle;
2582
- delete options.hour12;
2583
- }
2584
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
2585
- if ($8f23a04ae90a588b$var$formatterCache.has(cacheKey)) return $8f23a04ae90a588b$var$formatterCache.get(cacheKey);
2586
- let numberFormatter = new Intl.DateTimeFormat(locale, options);
2587
- $8f23a04ae90a588b$var$formatterCache.set(cacheKey, numberFormatter);
2588
- return numberFormatter;
2589
- }
2590
- let $8f23a04ae90a588b$var$_hasBuggyHour12Behavior = null;
2591
- function $8f23a04ae90a588b$var$hasBuggyHour12Behavior() {
2592
- if ($8f23a04ae90a588b$var$_hasBuggyHour12Behavior == null) $8f23a04ae90a588b$var$_hasBuggyHour12Behavior = new Intl.DateTimeFormat("en-US", {
2593
- hour: "numeric",
2594
- hour12: false
2595
- }).format(new Date(2020, 2, 3, 0)) === "24";
2596
- return $8f23a04ae90a588b$var$_hasBuggyHour12Behavior;
2597
- }
2598
- let $8f23a04ae90a588b$var$_hasBuggyResolvedHourCycle = null;
2599
- function $8f23a04ae90a588b$var$hasBuggyResolvedHourCycle() {
2600
- if ($8f23a04ae90a588b$var$_hasBuggyResolvedHourCycle == null) $8f23a04ae90a588b$var$_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat("fr", {
2601
- hour: "numeric",
2602
- hour12: false
2603
- }).resolvedOptions().hourCycle === "h12";
2604
- return $8f23a04ae90a588b$var$_hasBuggyResolvedHourCycle;
2605
- }
2606
- function $8f23a04ae90a588b$var$getResolvedHourCycle(locale, options) {
2607
- if (!options.timeStyle && !options.hour) return undefined;
2608
- // Work around buggy results in resolved hourCycle and hour12 options in WebKit.
2609
- // Format the minimum possible hour and maximum possible hour in a day and parse the results.
2610
- locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, "");
2611
- locale += (locale.includes("-u-") ? "" : "-u") + "-nu-latn";
2612
- let formatter = $8f23a04ae90a588b$var$getCachedDateFormatter(locale, {
2613
- ...options,
2614
- timeZone: undefined // use local timezone
2615
- });
2616
- let min = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find((p)=>p.type === "hour").value, 10);
2617
- let max = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find((p)=>p.type === "hour").value, 10);
2618
- if (min === 0 && max === 23) return "h23";
2619
- if (min === 24 && max === 23) return "h24";
2620
- if (min === 0 && max === 11) return "h11";
2621
- if (min === 12 && max === 11) return "h12";
2622
- throw new Error("Unexpected hour cycle result");
2623
- }
2624
105
 
2625
106
 
2626
107