@sbb-esta/lyne-elements-experimental 5.0.2 → 5.2.0

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 (256) hide show
  1. package/autocomplete-grid.js +1 -10
  2. package/autocomplete-grid.pure.js +12 -7
  3. package/core.js +31 -5
  4. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +0 -1
  5. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts +4 -5
  6. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts +1 -2
  7. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts +2 -3
  8. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts +1 -2
  9. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts +1 -2
  10. package/development/autocomplete-grid.d.ts +0 -1
  11. package/development/autocomplete-grid.js +5 -10
  12. package/development/autocomplete-grid.pure.d.ts +0 -1
  13. package/development/autocomplete-grid.pure.js +328 -7
  14. package/development/core/datetime/date-helper.d.ts +0 -1
  15. package/development/core/timetable/access-leg-helper.d.ts +3 -3
  16. package/development/core/timetable/timetable-helper.d.ts +1 -2
  17. package/development/core/timetable/timetable-properties.d.ts +2 -1
  18. package/development/core.d.ts +0 -1
  19. package/development/core.js +1195 -5
  20. package/development/journey-summary/journey-summary.component.d.ts +3 -4
  21. package/development/journey-summary.d.ts +0 -1
  22. package/development/journey-summary.js +5 -5
  23. package/development/journey-summary.pure.d.ts +0 -1
  24. package/development/journey-summary.pure.js +2605 -2
  25. package/development/pearl-chain/pearl-chain.component.d.ts +2 -3
  26. package/development/pearl-chain-time/pearl-chain-time.component.d.ts +3 -4
  27. package/development/pearl-chain-time.d.ts +0 -1
  28. package/development/pearl-chain-time.js +5 -5
  29. package/development/pearl-chain-time.pure.d.ts +0 -1
  30. package/development/pearl-chain-time.pure.js +2582 -2
  31. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts +1 -2
  32. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts +1 -2
  33. package/development/pearl-chain-vertical-item.d.ts +0 -1
  34. package/development/pearl-chain-vertical-item.js +5 -5
  35. package/development/pearl-chain-vertical-item.pure.d.ts +0 -1
  36. package/development/pearl-chain-vertical-item.pure.js +132 -2
  37. package/development/pearl-chain-vertical.d.ts +0 -1
  38. package/development/pearl-chain-vertical.js +5 -5
  39. package/development/pearl-chain-vertical.pure.d.ts +0 -1
  40. package/development/pearl-chain-vertical.pure.js +31 -2
  41. package/development/pearl-chain.d.ts +0 -1
  42. package/development/pearl-chain.js +5 -5
  43. package/development/pearl-chain.pure.d.ts +0 -1
  44. package/development/pearl-chain.pure.js +619 -2
  45. package/development/seat-reservation/common/mapper/icon-mapper.d.ts +0 -1
  46. package/development/seat-reservation/common/mapper/mapper.d.ts +1 -2
  47. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.private.d.ts +68 -0
  48. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.private.d.ts +122 -0
  49. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.private.d.ts +68 -0
  50. package/development/seat-reservation/common/mapper.d.ts +0 -1
  51. package/development/seat-reservation/common/svgs.d.ts +20 -21
  52. package/development/seat-reservation/common/translations/i18n.d.ts +0 -1
  53. package/development/seat-reservation/common/translations.d.ts +0 -1
  54. package/development/seat-reservation/common/types.d.ts +0 -1
  55. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +2 -3
  56. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +2 -3
  57. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +1 -2
  58. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +2 -3
  59. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +3 -4
  60. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +2 -3
  61. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +3 -4
  62. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +1 -2
  63. package/development/seat-reservation.d.ts +0 -1
  64. package/development/seat-reservation.js +5 -16
  65. package/development/seat-reservation.pure.d.ts +0 -1
  66. package/development/seat-reservation.pure.js +16019 -14
  67. package/development/timetable-duration/timetable-duration.component.d.ts +1 -2
  68. package/development/timetable-duration.d.ts +0 -1
  69. package/development/timetable-duration.js +5 -5
  70. package/development/timetable-duration.pure.d.ts +0 -1
  71. package/development/timetable-duration.pure.js +97 -2
  72. package/development/timetable-row/timetable-row.component.d.ts +3 -4
  73. package/development/timetable-row.d.ts +0 -1
  74. package/development/timetable-row.js +5 -5
  75. package/development/timetable-row.pure.d.ts +0 -1
  76. package/development/timetable-row.pure.js +3005 -2
  77. package/journey-summary.js +1 -6
  78. package/journey-summary.pure.js +55 -2
  79. package/package.json +3 -4
  80. package/pearl-chain-time.js +1 -6
  81. package/pearl-chain-time.pure.js +28 -2
  82. package/pearl-chain-vertical-item.js +1 -6
  83. package/pearl-chain-vertical-item.pure.js +26 -2
  84. package/pearl-chain-vertical.js +1 -6
  85. package/pearl-chain-vertical.pure.js +6 -2
  86. package/pearl-chain.js +1 -6
  87. package/pearl-chain.pure.js +27 -2
  88. package/seat-reservation.js +1 -16
  89. package/seat-reservation.pure.js +468 -14
  90. package/timetable-duration.js +1 -6
  91. package/timetable-duration.pure.js +9 -2
  92. package/timetable-row.js +1 -6
  93. package/timetable-row.pure.js +113 -2
  94. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +0 -65
  95. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +0 -44
  96. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +0 -2
  97. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +0 -21
  98. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +0 -2
  99. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +0 -2
  100. package/autocomplete-grid-cell.component-79IjA__I.js +0 -23
  101. package/autocomplete-grid-option.component-DUFBhQwI.js +0 -35
  102. package/autocomplete-grid-row.component-B3U15Rwa.js +0 -26
  103. package/core/datetime/date-helper.js +0 -2
  104. package/core/timetable/access-leg-helper.js +0 -96
  105. package/core/timetable/timetable-helper.js +0 -10
  106. package/core/timetable/timetable-properties.js +0 -0
  107. package/date-helper-DNzMLcyb.js +0 -185
  108. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +0 -1
  109. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +0 -118
  110. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts.map +0 -1
  111. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +0 -69
  112. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts.map +0 -1
  113. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +0 -2
  114. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts.map +0 -1
  115. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +0 -30
  116. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts.map +0 -1
  117. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +0 -2
  118. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts.map +0 -1
  119. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +0 -2
  120. package/development/autocomplete-grid-cell.component-BbdELDro.js +0 -33
  121. package/development/autocomplete-grid-option.component-C7WuqRit.js +0 -57
  122. package/development/autocomplete-grid-row.component-DoXbOsQM.js +0 -38
  123. package/development/autocomplete-grid.d.ts.map +0 -1
  124. package/development/autocomplete-grid.pure.d.ts.map +0 -1
  125. package/development/core/datetime/date-helper.d.ts.map +0 -1
  126. package/development/core/datetime/date-helper.js +0 -2
  127. package/development/core/timetable/access-leg-helper.d.ts.map +0 -1
  128. package/development/core/timetable/access-leg-helper.js +0 -147
  129. package/development/core/timetable/timetable-helper.d.ts.map +0 -1
  130. package/development/core/timetable/timetable-helper.js +0 -19
  131. package/development/core/timetable/timetable-properties.d.ts.map +0 -1
  132. package/development/core/timetable/timetable-properties.js +0 -0
  133. package/development/core.d.ts.map +0 -1
  134. package/development/date-helper-BcTDWVeP.js +0 -539
  135. package/development/differenceInMinutes-CxAbGYQ3.js +0 -110
  136. package/development/format-Cx3zmmaF.js +0 -1848
  137. package/development/isValid-40Olgzo1.js +0 -178
  138. package/development/journey-summary/journey-summary.component.d.ts.map +0 -1
  139. package/development/journey-summary/journey-summary.component.js +0 -2
  140. package/development/journey-summary.component-BsC7wBIn.js +0 -341
  141. package/development/journey-summary.d.ts.map +0 -1
  142. package/development/journey-summary.pure.d.ts.map +0 -1
  143. package/development/mapper-BrZOqqfe.js +0 -11454
  144. package/development/pearl-chain/pearl-chain.component.d.ts.map +0 -1
  145. package/development/pearl-chain/pearl-chain.component.js +0 -2
  146. package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +0 -1
  147. package/development/pearl-chain-time/pearl-chain-time.component.js +0 -2
  148. package/development/pearl-chain-time.component-C-CuC1ke.js +0 -317
  149. package/development/pearl-chain-time.d.ts.map +0 -1
  150. package/development/pearl-chain-time.pure.d.ts.map +0 -1
  151. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts.map +0 -1
  152. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +0 -2
  153. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +0 -1
  154. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +0 -2
  155. package/development/pearl-chain-vertical-item.component-CLu9QrqJ.js +0 -131
  156. package/development/pearl-chain-vertical-item.d.ts.map +0 -1
  157. package/development/pearl-chain-vertical-item.pure.d.ts.map +0 -1
  158. package/development/pearl-chain-vertical.component-DbPz5k_R.js +0 -30
  159. package/development/pearl-chain-vertical.d.ts.map +0 -1
  160. package/development/pearl-chain-vertical.pure.d.ts.map +0 -1
  161. package/development/pearl-chain.component-10OsJZIX.js +0 -318
  162. package/development/pearl-chain.d.ts.map +0 -1
  163. package/development/pearl-chain.pure.d.ts.map +0 -1
  164. package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +0 -1
  165. package/development/seat-reservation/common/mapper/icon-mapper.js +0 -170
  166. package/development/seat-reservation/common/mapper/mapper.d.ts.map +0 -1
  167. package/development/seat-reservation/common/mapper/mapper.js +0 -2
  168. package/development/seat-reservation/common/mapper.d.ts.map +0 -1
  169. package/development/seat-reservation/common/mapper.js +0 -3
  170. package/development/seat-reservation/common/svgs.d.ts.map +0 -1
  171. package/development/seat-reservation/common/svgs.js +0 -2
  172. package/development/seat-reservation/common/translations/i18n.d.ts.map +0 -1
  173. package/development/seat-reservation/common/translations/i18n.js +0 -1120
  174. package/development/seat-reservation/common/translations.d.ts.map +0 -1
  175. package/development/seat-reservation/common/translations.js +0 -2
  176. package/development/seat-reservation/common/types.d.ts.map +0 -1
  177. package/development/seat-reservation/common/types.js +0 -0
  178. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +0 -1
  179. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +0 -1476
  180. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +0 -1
  181. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +0 -2
  182. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +0 -1
  183. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +0 -2
  184. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +0 -1
  185. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +0 -2
  186. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
  187. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +0 -2
  188. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
  189. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -2
  190. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +0 -1
  191. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +0 -2
  192. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
  193. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +0 -2
  194. package/development/seat-reservation-area.component-DPhQJFid.js +0 -94
  195. package/development/seat-reservation-graphic.component-0LYsmerm.js +0 -129
  196. package/development/seat-reservation-navigation-coach.component-B97jKD7Y.js +0 -438
  197. package/development/seat-reservation-navigation-services.component-Cx0Is97w.js +0 -159
  198. package/development/seat-reservation-place-control.component-DaL1g8WH.js +0 -431
  199. package/development/seat-reservation-scoped.component-BHbORVsR.js +0 -24
  200. package/development/seat-reservation.component-DI9pSlzt.js +0 -473
  201. package/development/seat-reservation.d.ts.map +0 -1
  202. package/development/seat-reservation.pure.d.ts.map +0 -1
  203. package/development/svgs-Dj-RKmRs.js +0 -28
  204. package/development/timetable-duration/timetable-duration.component.d.ts.map +0 -1
  205. package/development/timetable-duration/timetable-duration.component.js +0 -2
  206. package/development/timetable-duration.component-Chk5D4Is.js +0 -96
  207. package/development/timetable-duration.d.ts.map +0 -1
  208. package/development/timetable-duration.pure.d.ts.map +0 -1
  209. package/development/timetable-row/timetable-row.component.d.ts.map +0 -1
  210. package/development/timetable-row/timetable-row.component.js +0 -2
  211. package/development/timetable-row.component-nzrQzxL6.js +0 -736
  212. package/development/timetable-row.d.ts.map +0 -1
  213. package/development/timetable-row.pure.d.ts.map +0 -1
  214. package/development/toDate-CDWut5fS.js +0 -150
  215. package/differenceInMinutes-BAZ-Fham.js +0 -27
  216. package/format-DjgG1QPc.js +0 -1103
  217. package/isValid-CXnsFZVu.js +0 -36
  218. package/journey-summary/journey-summary.component.js +0 -2
  219. package/journey-summary.component-DNoO3OCf.js +0 -265
  220. package/mapper-Dcou8VEf.js +0 -11382
  221. package/pearl-chain/pearl-chain.component.js +0 -2
  222. package/pearl-chain-time/pearl-chain-time.component.js +0 -2
  223. package/pearl-chain-time.component-BuvA6IE1.js +0 -237
  224. package/pearl-chain-vertical/pearl-chain-vertical.component.js +0 -2
  225. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +0 -2
  226. package/pearl-chain-vertical-item.component-QZ4s8Jbv.js +0 -106
  227. package/pearl-chain-vertical.component-Dc3vaHsQ.js +0 -20
  228. package/pearl-chain.component-DtGXXkY6.js +0 -190
  229. package/seat-reservation/common/mapper/icon-mapper.js +0 -72
  230. package/seat-reservation/common/mapper/mapper.js +0 -2
  231. package/seat-reservation/common/mapper.js +0 -3
  232. package/seat-reservation/common/svgs.js +0 -2
  233. package/seat-reservation/common/translations/i18n.js +0 -1085
  234. package/seat-reservation/common/translations.js +0 -2
  235. package/seat-reservation/common/types.js +0 -0
  236. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +0 -926
  237. package/seat-reservation/seat-reservation/seat-reservation.component.js +0 -2
  238. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +0 -2
  239. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +0 -2
  240. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +0 -2
  241. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -2
  242. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +0 -2
  243. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +0 -2
  244. package/seat-reservation-area.component-G9lHb7S8.js +0 -73
  245. package/seat-reservation-graphic.component-BXFcQDxY.js +0 -102
  246. package/seat-reservation-navigation-coach.component-BXy8EkJe.js +0 -338
  247. package/seat-reservation-navigation-services.component-49XmV9rv.js +0 -124
  248. package/seat-reservation-place-control.component-DToIW328.js +0 -317
  249. package/seat-reservation-scoped.component-D8dAmrP7.js +0 -16
  250. package/seat-reservation.component--0XnrCkk.js +0 -372
  251. package/svgs-D4fuYTHV.js +0 -26
  252. package/timetable-duration/timetable-duration.component.js +0 -2
  253. package/timetable-duration.component-iMCvh1zr.js +0 -61
  254. package/timetable-row/timetable-row.component.js +0 -2
  255. package/timetable-row.component-mNKmhRmP.js +0 -566
  256. package/toDate-BhNUyM4s.js +0 -16
@@ -1,2 +1,2582 @@
1
- import { t as SbbPearlChainTimeElement } from "./pearl-chain-time.component-C-CuC1ke.js";
2
- export { SbbPearlChainTimeElement };
1
+ import { __esDecorate, __runInitializers } from "tslib";
2
+ import { SbbElement, SbbLanguageController, defaultDateAdapter, forceType, i18nArrival, i18nDeparture, i18nTransferProcedures, screenReaderOnlyStyles } from "@sbb-esta/lyne-elements/core.js";
3
+ import { SbbIconElement } from "@sbb-esta/lyne-elements/icon.pure.js";
4
+ import { html, nothing, unsafeCSS } from "lit";
5
+ import { property } from "lit/decorators.js";
6
+ import { getDepartureArrivalTimeAttribute, isRideLeg, removeTimezoneFromISOTimeString } from "./core.js";
7
+ import { SbbPearlChainElement } from "./pearl-chain.pure.js";
8
+
9
+ //#region node_modules/date-fns/constants.js
10
+ /**
11
+ * @constant
12
+ * @name daysInYear
13
+ * @summary Days in 1 year.
14
+ *
15
+ * @description
16
+ * How many days in a year.
17
+ *
18
+ * One years equals 365.2425 days according to the formula:
19
+ *
20
+ * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
21
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
22
+ */
23
+ const daysInYear = 365.2425;
24
+ /**
25
+ * @constant
26
+ * @name maxTime
27
+ * @summary Maximum allowed time.
28
+ *
29
+ * @example
30
+ * import { maxTime } from "./constants/date-fns/constants";
31
+ *
32
+ * const isValid = 8640000000000001 <= maxTime;
33
+ * //=> false
34
+ *
35
+ * new Date(8640000000000001);
36
+ * //=> Invalid Date
37
+ */
38
+ const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
39
+ /**
40
+ * @constant
41
+ * @name minTime
42
+ * @summary Minimum allowed time.
43
+ *
44
+ * @example
45
+ * import { minTime } from "./constants/date-fns/constants";
46
+ *
47
+ * const isValid = -8640000000000001 >= minTime;
48
+ * //=> false
49
+ *
50
+ * new Date(-8640000000000001)
51
+ * //=> Invalid Date
52
+ */
53
+ const minTime = -maxTime;
54
+ /**
55
+ * @constant
56
+ * @name millisecondsInWeek
57
+ * @summary Milliseconds in 1 week.
58
+ */
59
+ const millisecondsInWeek = 6048e5;
60
+ /**
61
+ * @constant
62
+ * @name millisecondsInDay
63
+ * @summary Milliseconds in 1 day.
64
+ */
65
+ const millisecondsInDay = 864e5;
66
+ /**
67
+ * @constant
68
+ * @name secondsInHour
69
+ * @summary Seconds in 1 hour.
70
+ */
71
+ const secondsInHour = 3600;
72
+ /**
73
+ * @constant
74
+ * @name secondsInDay
75
+ * @summary Seconds in 1 day.
76
+ */
77
+ const secondsInDay = secondsInHour * 24;
78
+ /**
79
+ * @constant
80
+ * @name secondsInWeek
81
+ * @summary Seconds in 1 week.
82
+ */
83
+ const secondsInWeek = secondsInDay * 7;
84
+ /**
85
+ * @constant
86
+ * @name secondsInYear
87
+ * @summary Seconds in 1 year.
88
+ */
89
+ const secondsInYear = secondsInDay * daysInYear;
90
+ /**
91
+ * @constant
92
+ * @name secondsInMonth
93
+ * @summary Seconds in 1 month
94
+ */
95
+ const secondsInMonth = secondsInYear / 12;
96
+ /**
97
+ * @constant
98
+ * @name secondsInQuarter
99
+ * @summary Seconds in 1 quarter.
100
+ */
101
+ const secondsInQuarter = secondsInMonth * 3;
102
+ /**
103
+ * @constant
104
+ * @name constructFromSymbol
105
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
106
+ *
107
+ * The symbol is used to enable the `constructFrom` function to construct a date
108
+ * using a reference date and a value. It allows to transfer extra properties
109
+ * from the reference date to the new date. It's useful for extensions like
110
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
111
+ * a constructor argument.
112
+ */
113
+ const constructFromSymbol = Symbol.for("constructDateFrom");
114
+
115
+ //#endregion
116
+ //#region node_modules/date-fns/constructFrom.js
117
+ /**
118
+ * @name constructFrom
119
+ * @category Generic Helpers
120
+ * @summary Constructs a date using the reference date and the value
121
+ *
122
+ * @description
123
+ * The function constructs a new date using the constructor from the reference
124
+ * date and the given value. It helps to build generic functions that accept
125
+ * date extensions.
126
+ *
127
+ * It defaults to `Date` if the passed reference date is a number or a string.
128
+ *
129
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
130
+ * enabling to transfer extra properties from the reference date to the new date.
131
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
132
+ * that accept a time zone as a constructor argument.
133
+ *
134
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
135
+ *
136
+ * @param date - The reference date to take constructor from
137
+ * @param value - The value to create the date
138
+ *
139
+ * @returns Date initialized using the given date and value
140
+ *
141
+ * @example
142
+ * import { constructFrom } from "./constructFrom/date-fns";
143
+ *
144
+ * // A function that clones a date preserving the original type
145
+ * function cloneDate<DateType extends Date>(date: DateType): DateType {
146
+ * return constructFrom(
147
+ * date, // Use constructor from the given date
148
+ * date.getTime() // Use the date value to create a new date
149
+ * );
150
+ * }
151
+ */
152
+ function constructFrom(date, value) {
153
+ if (typeof date === "function") return date(value);
154
+ if (date && typeof date === "object" && constructFromSymbol in date) return date[constructFromSymbol](value);
155
+ if (date instanceof Date) return new date.constructor(value);
156
+ return new Date(value);
157
+ }
158
+
159
+ //#endregion
160
+ //#region node_modules/date-fns/toDate.js
161
+ /**
162
+ * @name toDate
163
+ * @category Common Helpers
164
+ * @summary Convert the given argument to an instance of Date.
165
+ *
166
+ * @description
167
+ * Convert the given argument to an instance of Date.
168
+ *
169
+ * If the argument is an instance of Date, the function returns its clone.
170
+ *
171
+ * If the argument is a number, it is treated as a timestamp.
172
+ *
173
+ * If the argument is none of the above, the function returns Invalid Date.
174
+ *
175
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
176
+ * enabling to transfer extra properties from the reference date to the new date.
177
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
178
+ * that accept a time zone as a constructor argument.
179
+ *
180
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
181
+ *
182
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
183
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
184
+ *
185
+ * @param argument - The value to convert
186
+ *
187
+ * @returns The parsed date in the local time zone
188
+ *
189
+ * @example
190
+ * // Clone the date:
191
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
192
+ * //=> Tue Feb 11 2014 11:30:30
193
+ *
194
+ * @example
195
+ * // Convert the timestamp to date:
196
+ * const result = toDate(1392098430000)
197
+ * //=> Tue Feb 11 2014 11:30:30
198
+ */
199
+ function toDate(argument, context) {
200
+ return constructFrom(context || argument, argument);
201
+ }
202
+
203
+ //#endregion
204
+ //#region node_modules/date-fns/_lib/defaultOptions.js
205
+ let defaultOptions = {};
206
+ function getDefaultOptions() {
207
+ return defaultOptions;
208
+ }
209
+
210
+ //#endregion
211
+ //#region node_modules/date-fns/startOfWeek.js
212
+ /**
213
+ * The {@link startOfWeek} function options.
214
+ */
215
+ /**
216
+ * @name startOfWeek
217
+ * @category Week Helpers
218
+ * @summary Return the start of a week for the given date.
219
+ *
220
+ * @description
221
+ * Return the start of a week for the given date.
222
+ * The result will be in the local timezone.
223
+ *
224
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
225
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
226
+ *
227
+ * @param date - The original date
228
+ * @param options - An object with options
229
+ *
230
+ * @returns The start of a week
231
+ *
232
+ * @example
233
+ * // The start of a week for 2 September 2014 11:55:00:
234
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
235
+ * //=> Sun Aug 31 2014 00:00:00
236
+ *
237
+ * @example
238
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
239
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
240
+ * //=> Mon Sep 01 2014 00:00:00
241
+ */
242
+ function startOfWeek(date, options) {
243
+ const defaultOptions = getDefaultOptions();
244
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
245
+ const _date = toDate(date, options?.in);
246
+ const day = _date.getDay();
247
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
248
+ _date.setDate(_date.getDate() - diff);
249
+ _date.setHours(0, 0, 0, 0);
250
+ return _date;
251
+ }
252
+
253
+ //#endregion
254
+ //#region node_modules/date-fns/startOfISOWeek.js
255
+ /**
256
+ * The {@link startOfISOWeek} function options.
257
+ */
258
+ /**
259
+ * @name startOfISOWeek
260
+ * @category ISO Week Helpers
261
+ * @summary Return the start of an ISO week for the given date.
262
+ *
263
+ * @description
264
+ * Return the start of an ISO week for the given date.
265
+ * The result will be in the local timezone.
266
+ *
267
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
268
+ *
269
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
270
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
271
+ *
272
+ * @param date - The original date
273
+ * @param options - An object with options
274
+ *
275
+ * @returns The start of an ISO week
276
+ *
277
+ * @example
278
+ * // The start of an ISO week for 2 September 2014 11:55:00:
279
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
280
+ * //=> Mon Sep 01 2014 00:00:00
281
+ */
282
+ function startOfISOWeek(date, options) {
283
+ return startOfWeek(date, {
284
+ ...options,
285
+ weekStartsOn: 1
286
+ });
287
+ }
288
+
289
+ //#endregion
290
+ //#region node_modules/date-fns/getISOWeekYear.js
291
+ /**
292
+ * The {@link getISOWeekYear} function options.
293
+ */
294
+ /**
295
+ * @name getISOWeekYear
296
+ * @category ISO Week-Numbering Year Helpers
297
+ * @summary Get the ISO week-numbering year of the given date.
298
+ *
299
+ * @description
300
+ * Get the ISO week-numbering year of the given date,
301
+ * which always starts 3 days before the year's first Thursday.
302
+ *
303
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
304
+ *
305
+ * @param date - The given date
306
+ *
307
+ * @returns The ISO week-numbering year
308
+ *
309
+ * @example
310
+ * // Which ISO-week numbering year is 2 January 2005?
311
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
312
+ * //=> 2004
313
+ */
314
+ function getISOWeekYear(date, options) {
315
+ const _date = toDate(date, options?.in);
316
+ const year = _date.getFullYear();
317
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
318
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
319
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
320
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
321
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
322
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
323
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
324
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
325
+ if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
326
+ else if (_date.getTime() >= startOfThisYear.getTime()) return year;
327
+ else return year - 1;
328
+ }
329
+
330
+ //#endregion
331
+ //#region node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
332
+ /**
333
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
334
+ * They usually appear for dates that denote time before the timezones were introduced
335
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
336
+ * and GMT+01:00:00 after that date)
337
+ *
338
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
339
+ * which would lead to incorrect calculations.
340
+ *
341
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
342
+ */
343
+ function getTimezoneOffsetInMilliseconds(date) {
344
+ const _date = toDate(date);
345
+ const utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
346
+ utcDate.setUTCFullYear(_date.getFullYear());
347
+ return +date - +utcDate;
348
+ }
349
+
350
+ //#endregion
351
+ //#region node_modules/date-fns/_lib/normalizeDates.js
352
+ function normalizeDates(context, ...dates) {
353
+ const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === "object"));
354
+ return dates.map(normalize);
355
+ }
356
+
357
+ //#endregion
358
+ //#region node_modules/date-fns/startOfDay.js
359
+ /**
360
+ * The {@link startOfDay} function options.
361
+ */
362
+ /**
363
+ * @name startOfDay
364
+ * @category Day Helpers
365
+ * @summary Return the start of a day for the given date.
366
+ *
367
+ * @description
368
+ * Return the start of a day for the given date.
369
+ * The result will be in the local timezone.
370
+ *
371
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
372
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
373
+ *
374
+ * @param date - The original date
375
+ * @param options - The options
376
+ *
377
+ * @returns The start of a day
378
+ *
379
+ * @example
380
+ * // The start of a day for 2 September 2014 11:55:00:
381
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
382
+ * //=> Tue Sep 02 2014 00:00:00
383
+ */
384
+ function startOfDay(date, options) {
385
+ const _date = toDate(date, options?.in);
386
+ _date.setHours(0, 0, 0, 0);
387
+ return _date;
388
+ }
389
+
390
+ //#endregion
391
+ //#region node_modules/date-fns/differenceInCalendarDays.js
392
+ /**
393
+ * The {@link differenceInCalendarDays} function options.
394
+ */
395
+ /**
396
+ * @name differenceInCalendarDays
397
+ * @category Day Helpers
398
+ * @summary Get the number of calendar days between the given dates.
399
+ *
400
+ * @description
401
+ * Get the number of calendar days between the given dates. This means that the times are removed
402
+ * from the dates and then the difference in days is calculated.
403
+ *
404
+ * @param laterDate - The later date
405
+ * @param earlierDate - The earlier date
406
+ * @param options - The options object
407
+ *
408
+ * @returns The number of calendar days
409
+ *
410
+ * @example
411
+ * // How many calendar days are between
412
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
413
+ * const result = differenceInCalendarDays(
414
+ * new Date(2012, 6, 2, 0, 0),
415
+ * new Date(2011, 6, 2, 23, 0)
416
+ * )
417
+ * //=> 366
418
+ * // How many calendar days are between
419
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
420
+ * const result = differenceInCalendarDays(
421
+ * new Date(2011, 6, 3, 0, 1),
422
+ * new Date(2011, 6, 2, 23, 59)
423
+ * )
424
+ * //=> 1
425
+ */
426
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
427
+ const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
428
+ const laterStartOfDay = startOfDay(laterDate_);
429
+ const earlierStartOfDay = startOfDay(earlierDate_);
430
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
431
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
432
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
433
+ }
434
+
435
+ //#endregion
436
+ //#region node_modules/date-fns/startOfISOWeekYear.js
437
+ /**
438
+ * The {@link startOfISOWeekYear} function options.
439
+ */
440
+ /**
441
+ * @name startOfISOWeekYear
442
+ * @category ISO Week-Numbering Year Helpers
443
+ * @summary Return the start of an ISO week-numbering year for the given date.
444
+ *
445
+ * @description
446
+ * Return the start of an ISO week-numbering year,
447
+ * which always starts 3 days before the year's first Thursday.
448
+ * The result will be in the local timezone.
449
+ *
450
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
451
+ *
452
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
453
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
454
+ *
455
+ * @param date - The original date
456
+ * @param options - An object with options
457
+ *
458
+ * @returns The start of an ISO week-numbering year
459
+ *
460
+ * @example
461
+ * // The start of an ISO week-numbering year for 2 July 2005:
462
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
463
+ * //=> Mon Jan 03 2005 00:00:00
464
+ */
465
+ function startOfISOWeekYear(date, options) {
466
+ const year = getISOWeekYear(date, options);
467
+ const fourthOfJanuary = constructFrom(options?.in || date, 0);
468
+ fourthOfJanuary.setFullYear(year, 0, 4);
469
+ fourthOfJanuary.setHours(0, 0, 0, 0);
470
+ return startOfISOWeek(fourthOfJanuary);
471
+ }
472
+
473
+ //#endregion
474
+ //#region node_modules/date-fns/isDate.js
475
+ /**
476
+ * @name isDate
477
+ * @category Common Helpers
478
+ * @summary Is the given value a date?
479
+ *
480
+ * @description
481
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
482
+ *
483
+ * @param value - The value to check
484
+ *
485
+ * @returns True if the given value is a date
486
+ *
487
+ * @example
488
+ * // For a valid date:
489
+ * const result = isDate(new Date())
490
+ * //=> true
491
+ *
492
+ * @example
493
+ * // For an invalid date:
494
+ * const result = isDate(new Date(NaN))
495
+ * //=> true
496
+ *
497
+ * @example
498
+ * // For some value:
499
+ * const result = isDate('2014-02-31')
500
+ * //=> false
501
+ *
502
+ * @example
503
+ * // For an object:
504
+ * const result = isDate({})
505
+ * //=> false
506
+ */
507
+ function isDate(value) {
508
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
509
+ }
510
+
511
+ //#endregion
512
+ //#region node_modules/date-fns/isValid.js
513
+ /**
514
+ * @name isValid
515
+ * @category Common Helpers
516
+ * @summary Is the given date valid?
517
+ *
518
+ * @description
519
+ * Returns false if argument is Invalid Date and true otherwise.
520
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
521
+ * Invalid Date is a Date, whose time value is NaN.
522
+ *
523
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
524
+ *
525
+ * @param date - The date to check
526
+ *
527
+ * @returns The date is valid
528
+ *
529
+ * @example
530
+ * // For the valid date:
531
+ * const result = isValid(new Date(2014, 1, 31))
532
+ * //=> true
533
+ *
534
+ * @example
535
+ * // For the value, convertible into a date:
536
+ * const result = isValid(1393804800000)
537
+ * //=> true
538
+ *
539
+ * @example
540
+ * // For the invalid date:
541
+ * const result = isValid(new Date(''))
542
+ * //=> false
543
+ */
544
+ function isValid(date) {
545
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
546
+ }
547
+
548
+ //#endregion
549
+ //#region node_modules/date-fns/startOfYear.js
550
+ /**
551
+ * The {@link startOfYear} function options.
552
+ */
553
+ /**
554
+ * @name startOfYear
555
+ * @category Year Helpers
556
+ * @summary Return the start of a year for the given date.
557
+ *
558
+ * @description
559
+ * Return the start of a year for the given date.
560
+ * The result will be in the local timezone.
561
+ *
562
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
563
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
564
+ *
565
+ * @param date - The original date
566
+ * @param options - The options
567
+ *
568
+ * @returns The start of a year
569
+ *
570
+ * @example
571
+ * // The start of a year for 2 September 2014 11:55:00:
572
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
573
+ * //=> Wed Jan 01 2014 00:00:00
574
+ */
575
+ function startOfYear(date, options) {
576
+ const date_ = toDate(date, options?.in);
577
+ date_.setFullYear(date_.getFullYear(), 0, 1);
578
+ date_.setHours(0, 0, 0, 0);
579
+ return date_;
580
+ }
581
+
582
+ //#endregion
583
+ //#region node_modules/date-fns/locale/en-US/_lib/formatDistance.js
584
+ const formatDistanceLocale = {
585
+ lessThanXSeconds: {
586
+ one: "less than a second",
587
+ other: "less than {{count}} seconds"
588
+ },
589
+ xSeconds: {
590
+ one: "1 second",
591
+ other: "{{count}} seconds"
592
+ },
593
+ halfAMinute: "half a minute",
594
+ lessThanXMinutes: {
595
+ one: "less than a minute",
596
+ other: "less than {{count}} minutes"
597
+ },
598
+ xMinutes: {
599
+ one: "1 minute",
600
+ other: "{{count}} minutes"
601
+ },
602
+ aboutXHours: {
603
+ one: "about 1 hour",
604
+ other: "about {{count}} hours"
605
+ },
606
+ xHours: {
607
+ one: "1 hour",
608
+ other: "{{count}} hours"
609
+ },
610
+ xDays: {
611
+ one: "1 day",
612
+ other: "{{count}} days"
613
+ },
614
+ aboutXWeeks: {
615
+ one: "about 1 week",
616
+ other: "about {{count}} weeks"
617
+ },
618
+ xWeeks: {
619
+ one: "1 week",
620
+ other: "{{count}} weeks"
621
+ },
622
+ aboutXMonths: {
623
+ one: "about 1 month",
624
+ other: "about {{count}} months"
625
+ },
626
+ xMonths: {
627
+ one: "1 month",
628
+ other: "{{count}} months"
629
+ },
630
+ aboutXYears: {
631
+ one: "about 1 year",
632
+ other: "about {{count}} years"
633
+ },
634
+ xYears: {
635
+ one: "1 year",
636
+ other: "{{count}} years"
637
+ },
638
+ overXYears: {
639
+ one: "over 1 year",
640
+ other: "over {{count}} years"
641
+ },
642
+ almostXYears: {
643
+ one: "almost 1 year",
644
+ other: "almost {{count}} years"
645
+ }
646
+ };
647
+ const formatDistance = (token, count, options) => {
648
+ let result;
649
+ const tokenValue = formatDistanceLocale[token];
650
+ if (typeof tokenValue === "string") result = tokenValue;
651
+ else if (count === 1) result = tokenValue.one;
652
+ else result = tokenValue.other.replace("{{count}}", count.toString());
653
+ if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
654
+ else return result + " ago";
655
+ return result;
656
+ };
657
+
658
+ //#endregion
659
+ //#region node_modules/date-fns/locale/_lib/buildFormatLongFn.js
660
+ function buildFormatLongFn(args) {
661
+ return (options = {}) => {
662
+ const width = options.width ? String(options.width) : args.defaultWidth;
663
+ return args.formats[width] || args.formats[args.defaultWidth];
664
+ };
665
+ }
666
+
667
+ //#endregion
668
+ //#region node_modules/date-fns/locale/en-US/_lib/formatLong.js
669
+ const dateFormats = {
670
+ full: "EEEE, MMMM do, y",
671
+ long: "MMMM do, y",
672
+ medium: "MMM d, y",
673
+ short: "MM/dd/yyyy"
674
+ };
675
+ const timeFormats = {
676
+ full: "h:mm:ss a zzzz",
677
+ long: "h:mm:ss a z",
678
+ medium: "h:mm:ss a",
679
+ short: "h:mm a"
680
+ };
681
+ const dateTimeFormats = {
682
+ full: "{{date}} 'at' {{time}}",
683
+ long: "{{date}} 'at' {{time}}",
684
+ medium: "{{date}}, {{time}}",
685
+ short: "{{date}}, {{time}}"
686
+ };
687
+ const formatLong = {
688
+ date: buildFormatLongFn({
689
+ formats: dateFormats,
690
+ defaultWidth: "full"
691
+ }),
692
+ time: buildFormatLongFn({
693
+ formats: timeFormats,
694
+ defaultWidth: "full"
695
+ }),
696
+ dateTime: buildFormatLongFn({
697
+ formats: dateTimeFormats,
698
+ defaultWidth: "full"
699
+ })
700
+ };
701
+
702
+ //#endregion
703
+ //#region node_modules/date-fns/locale/en-US/_lib/formatRelative.js
704
+ const formatRelativeLocale = {
705
+ lastWeek: "'last' eeee 'at' p",
706
+ yesterday: "'yesterday at' p",
707
+ today: "'today at' p",
708
+ tomorrow: "'tomorrow at' p",
709
+ nextWeek: "eeee 'at' p",
710
+ other: "P"
711
+ };
712
+ const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
713
+
714
+ //#endregion
715
+ //#region node_modules/date-fns/locale/_lib/buildLocalizeFn.js
716
+ /**
717
+ * The localize function argument callback which allows to convert raw value to
718
+ * the actual type.
719
+ *
720
+ * @param value - The value to convert
721
+ *
722
+ * @returns The converted value
723
+ */
724
+ /**
725
+ * The map of localized values for each width.
726
+ */
727
+ /**
728
+ * The index type of the locale unit value. It types conversion of units of
729
+ * values that don't start at 0 (i.e. quarters).
730
+ */
731
+ /**
732
+ * Converts the unit value to the tuple of values.
733
+ */
734
+ /**
735
+ * The tuple of localized era values. The first element represents BC,
736
+ * the second element represents AD.
737
+ */
738
+ /**
739
+ * The tuple of localized quarter values. The first element represents Q1.
740
+ */
741
+ /**
742
+ * The tuple of localized day values. The first element represents Sunday.
743
+ */
744
+ /**
745
+ * The tuple of localized month values. The first element represents January.
746
+ */
747
+ function buildLocalizeFn(args) {
748
+ return (value, options) => {
749
+ const context = options?.context ? String(options.context) : "standalone";
750
+ let valuesArray;
751
+ if (context === "formatting" && args.formattingValues) {
752
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
753
+ const width = options?.width ? String(options.width) : defaultWidth;
754
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
755
+ } else {
756
+ const defaultWidth = args.defaultWidth;
757
+ const width = options?.width ? String(options.width) : args.defaultWidth;
758
+ valuesArray = args.values[width] || args.values[defaultWidth];
759
+ }
760
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
761
+ return valuesArray[index];
762
+ };
763
+ }
764
+
765
+ //#endregion
766
+ //#region node_modules/date-fns/locale/en-US/_lib/localize.js
767
+ const eraValues = {
768
+ narrow: ["B", "A"],
769
+ abbreviated: ["BC", "AD"],
770
+ wide: ["Before Christ", "Anno Domini"]
771
+ };
772
+ const quarterValues = {
773
+ narrow: [
774
+ "1",
775
+ "2",
776
+ "3",
777
+ "4"
778
+ ],
779
+ abbreviated: [
780
+ "Q1",
781
+ "Q2",
782
+ "Q3",
783
+ "Q4"
784
+ ],
785
+ wide: [
786
+ "1st quarter",
787
+ "2nd quarter",
788
+ "3rd quarter",
789
+ "4th quarter"
790
+ ]
791
+ };
792
+ const monthValues = {
793
+ narrow: [
794
+ "J",
795
+ "F",
796
+ "M",
797
+ "A",
798
+ "M",
799
+ "J",
800
+ "J",
801
+ "A",
802
+ "S",
803
+ "O",
804
+ "N",
805
+ "D"
806
+ ],
807
+ abbreviated: [
808
+ "Jan",
809
+ "Feb",
810
+ "Mar",
811
+ "Apr",
812
+ "May",
813
+ "Jun",
814
+ "Jul",
815
+ "Aug",
816
+ "Sep",
817
+ "Oct",
818
+ "Nov",
819
+ "Dec"
820
+ ],
821
+ wide: [
822
+ "January",
823
+ "February",
824
+ "March",
825
+ "April",
826
+ "May",
827
+ "June",
828
+ "July",
829
+ "August",
830
+ "September",
831
+ "October",
832
+ "November",
833
+ "December"
834
+ ]
835
+ };
836
+ const dayValues = {
837
+ narrow: [
838
+ "S",
839
+ "M",
840
+ "T",
841
+ "W",
842
+ "T",
843
+ "F",
844
+ "S"
845
+ ],
846
+ short: [
847
+ "Su",
848
+ "Mo",
849
+ "Tu",
850
+ "We",
851
+ "Th",
852
+ "Fr",
853
+ "Sa"
854
+ ],
855
+ abbreviated: [
856
+ "Sun",
857
+ "Mon",
858
+ "Tue",
859
+ "Wed",
860
+ "Thu",
861
+ "Fri",
862
+ "Sat"
863
+ ],
864
+ wide: [
865
+ "Sunday",
866
+ "Monday",
867
+ "Tuesday",
868
+ "Wednesday",
869
+ "Thursday",
870
+ "Friday",
871
+ "Saturday"
872
+ ]
873
+ };
874
+ const dayPeriodValues = {
875
+ narrow: {
876
+ am: "a",
877
+ pm: "p",
878
+ midnight: "mi",
879
+ noon: "n",
880
+ morning: "morning",
881
+ afternoon: "afternoon",
882
+ evening: "evening",
883
+ night: "night"
884
+ },
885
+ abbreviated: {
886
+ am: "AM",
887
+ pm: "PM",
888
+ midnight: "midnight",
889
+ noon: "noon",
890
+ morning: "morning",
891
+ afternoon: "afternoon",
892
+ evening: "evening",
893
+ night: "night"
894
+ },
895
+ wide: {
896
+ am: "a.m.",
897
+ pm: "p.m.",
898
+ midnight: "midnight",
899
+ noon: "noon",
900
+ morning: "morning",
901
+ afternoon: "afternoon",
902
+ evening: "evening",
903
+ night: "night"
904
+ }
905
+ };
906
+ const formattingDayPeriodValues = {
907
+ narrow: {
908
+ am: "a",
909
+ pm: "p",
910
+ midnight: "mi",
911
+ noon: "n",
912
+ morning: "in the morning",
913
+ afternoon: "in the afternoon",
914
+ evening: "in the evening",
915
+ night: "at night"
916
+ },
917
+ abbreviated: {
918
+ am: "AM",
919
+ pm: "PM",
920
+ midnight: "midnight",
921
+ noon: "noon",
922
+ morning: "in the morning",
923
+ afternoon: "in the afternoon",
924
+ evening: "in the evening",
925
+ night: "at night"
926
+ },
927
+ wide: {
928
+ am: "a.m.",
929
+ pm: "p.m.",
930
+ midnight: "midnight",
931
+ noon: "noon",
932
+ morning: "in the morning",
933
+ afternoon: "in the afternoon",
934
+ evening: "in the evening",
935
+ night: "at night"
936
+ }
937
+ };
938
+ const ordinalNumber = (dirtyNumber, _options) => {
939
+ const number = Number(dirtyNumber);
940
+ const rem100 = number % 100;
941
+ if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
942
+ case 1: return number + "st";
943
+ case 2: return number + "nd";
944
+ case 3: return number + "rd";
945
+ }
946
+ return number + "th";
947
+ };
948
+ const localize = {
949
+ ordinalNumber,
950
+ era: buildLocalizeFn({
951
+ values: eraValues,
952
+ defaultWidth: "wide"
953
+ }),
954
+ quarter: buildLocalizeFn({
955
+ values: quarterValues,
956
+ defaultWidth: "wide",
957
+ argumentCallback: (quarter) => quarter - 1
958
+ }),
959
+ month: buildLocalizeFn({
960
+ values: monthValues,
961
+ defaultWidth: "wide"
962
+ }),
963
+ day: buildLocalizeFn({
964
+ values: dayValues,
965
+ defaultWidth: "wide"
966
+ }),
967
+ dayPeriod: buildLocalizeFn({
968
+ values: dayPeriodValues,
969
+ defaultWidth: "wide",
970
+ formattingValues: formattingDayPeriodValues,
971
+ defaultFormattingWidth: "wide"
972
+ })
973
+ };
974
+
975
+ //#endregion
976
+ //#region node_modules/date-fns/locale/_lib/buildMatchFn.js
977
+ function buildMatchFn(args) {
978
+ return (string, options = {}) => {
979
+ const width = options.width;
980
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
981
+ const matchResult = string.match(matchPattern);
982
+ if (!matchResult) return null;
983
+ const matchedString = matchResult[0];
984
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
985
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
986
+ let value;
987
+ value = args.valueCallback ? args.valueCallback(key) : key;
988
+ value = options.valueCallback ? options.valueCallback(value) : value;
989
+ const rest = string.slice(matchedString.length);
990
+ return {
991
+ value,
992
+ rest
993
+ };
994
+ };
995
+ }
996
+ function findKey(object, predicate) {
997
+ for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
998
+ }
999
+ function findIndex(array, predicate) {
1000
+ for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
1001
+ }
1002
+
1003
+ //#endregion
1004
+ //#region node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
1005
+ function buildMatchPatternFn(args) {
1006
+ return (string, options = {}) => {
1007
+ const matchResult = string.match(args.matchPattern);
1008
+ if (!matchResult) return null;
1009
+ const matchedString = matchResult[0];
1010
+ const parseResult = string.match(args.parsePattern);
1011
+ if (!parseResult) return null;
1012
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1013
+ value = options.valueCallback ? options.valueCallback(value) : value;
1014
+ const rest = string.slice(matchedString.length);
1015
+ return {
1016
+ value,
1017
+ rest
1018
+ };
1019
+ };
1020
+ }
1021
+
1022
+ //#endregion
1023
+ //#region node_modules/date-fns/locale/en-US/_lib/match.js
1024
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1025
+ const parseOrdinalNumberPattern = /\d+/i;
1026
+ const matchEraPatterns = {
1027
+ narrow: /^(b|a)/i,
1028
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1029
+ wide: /^(before christ|before common era|anno domini|common era)/i
1030
+ };
1031
+ const parseEraPatterns = { any: [/^b/i, /^(a|c)/i] };
1032
+ const matchQuarterPatterns = {
1033
+ narrow: /^[1234]/i,
1034
+ abbreviated: /^q[1234]/i,
1035
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1036
+ };
1037
+ const parseQuarterPatterns = { any: [
1038
+ /1/i,
1039
+ /2/i,
1040
+ /3/i,
1041
+ /4/i
1042
+ ] };
1043
+ const matchMonthPatterns = {
1044
+ narrow: /^[jfmasond]/i,
1045
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1046
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1047
+ };
1048
+ const parseMonthPatterns = {
1049
+ narrow: [
1050
+ /^j/i,
1051
+ /^f/i,
1052
+ /^m/i,
1053
+ /^a/i,
1054
+ /^m/i,
1055
+ /^j/i,
1056
+ /^j/i,
1057
+ /^a/i,
1058
+ /^s/i,
1059
+ /^o/i,
1060
+ /^n/i,
1061
+ /^d/i
1062
+ ],
1063
+ any: [
1064
+ /^ja/i,
1065
+ /^f/i,
1066
+ /^mar/i,
1067
+ /^ap/i,
1068
+ /^may/i,
1069
+ /^jun/i,
1070
+ /^jul/i,
1071
+ /^au/i,
1072
+ /^s/i,
1073
+ /^o/i,
1074
+ /^n/i,
1075
+ /^d/i
1076
+ ]
1077
+ };
1078
+ const matchDayPatterns = {
1079
+ narrow: /^[smtwf]/i,
1080
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1081
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1082
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1083
+ };
1084
+ const parseDayPatterns = {
1085
+ narrow: [
1086
+ /^s/i,
1087
+ /^m/i,
1088
+ /^t/i,
1089
+ /^w/i,
1090
+ /^t/i,
1091
+ /^f/i,
1092
+ /^s/i
1093
+ ],
1094
+ any: [
1095
+ /^su/i,
1096
+ /^m/i,
1097
+ /^tu/i,
1098
+ /^w/i,
1099
+ /^th/i,
1100
+ /^f/i,
1101
+ /^sa/i
1102
+ ]
1103
+ };
1104
+ const matchDayPeriodPatterns = {
1105
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1106
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1107
+ };
1108
+ const parseDayPeriodPatterns = { any: {
1109
+ am: /^a/i,
1110
+ pm: /^p/i,
1111
+ midnight: /^mi/i,
1112
+ noon: /^no/i,
1113
+ morning: /morning/i,
1114
+ afternoon: /afternoon/i,
1115
+ evening: /evening/i,
1116
+ night: /night/i
1117
+ } };
1118
+ const match = {
1119
+ ordinalNumber: buildMatchPatternFn({
1120
+ matchPattern: matchOrdinalNumberPattern,
1121
+ parsePattern: parseOrdinalNumberPattern,
1122
+ valueCallback: (value) => parseInt(value, 10)
1123
+ }),
1124
+ era: buildMatchFn({
1125
+ matchPatterns: matchEraPatterns,
1126
+ defaultMatchWidth: "wide",
1127
+ parsePatterns: parseEraPatterns,
1128
+ defaultParseWidth: "any"
1129
+ }),
1130
+ quarter: buildMatchFn({
1131
+ matchPatterns: matchQuarterPatterns,
1132
+ defaultMatchWidth: "wide",
1133
+ parsePatterns: parseQuarterPatterns,
1134
+ defaultParseWidth: "any",
1135
+ valueCallback: (index) => index + 1
1136
+ }),
1137
+ month: buildMatchFn({
1138
+ matchPatterns: matchMonthPatterns,
1139
+ defaultMatchWidth: "wide",
1140
+ parsePatterns: parseMonthPatterns,
1141
+ defaultParseWidth: "any"
1142
+ }),
1143
+ day: buildMatchFn({
1144
+ matchPatterns: matchDayPatterns,
1145
+ defaultMatchWidth: "wide",
1146
+ parsePatterns: parseDayPatterns,
1147
+ defaultParseWidth: "any"
1148
+ }),
1149
+ dayPeriod: buildMatchFn({
1150
+ matchPatterns: matchDayPeriodPatterns,
1151
+ defaultMatchWidth: "any",
1152
+ parsePatterns: parseDayPeriodPatterns,
1153
+ defaultParseWidth: "any"
1154
+ })
1155
+ };
1156
+
1157
+ //#endregion
1158
+ //#region node_modules/date-fns/locale/en-US.js
1159
+ /**
1160
+ * @category Locales
1161
+ * @summary English locale (United States).
1162
+ * @language English
1163
+ * @iso-639-2 eng
1164
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
1165
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
1166
+ */
1167
+ const enUS = {
1168
+ code: "en-US",
1169
+ formatDistance,
1170
+ formatLong,
1171
+ formatRelative,
1172
+ localize,
1173
+ match,
1174
+ options: {
1175
+ weekStartsOn: 0,
1176
+ firstWeekContainsDate: 1
1177
+ }
1178
+ };
1179
+
1180
+ //#endregion
1181
+ //#region node_modules/date-fns/getDayOfYear.js
1182
+ /**
1183
+ * The {@link getDayOfYear} function options.
1184
+ */
1185
+ /**
1186
+ * @name getDayOfYear
1187
+ * @category Day Helpers
1188
+ * @summary Get the day of the year of the given date.
1189
+ *
1190
+ * @description
1191
+ * Get the day of the year of the given date.
1192
+ *
1193
+ * @param date - The given date
1194
+ * @param options - The options
1195
+ *
1196
+ * @returns The day of year
1197
+ *
1198
+ * @example
1199
+ * // Which day of the year is 2 July 2014?
1200
+ * const result = getDayOfYear(new Date(2014, 6, 2))
1201
+ * //=> 183
1202
+ */
1203
+ function getDayOfYear(date, options) {
1204
+ const _date = toDate(date, options?.in);
1205
+ return differenceInCalendarDays(_date, startOfYear(_date)) + 1;
1206
+ }
1207
+
1208
+ //#endregion
1209
+ //#region node_modules/date-fns/getISOWeek.js
1210
+ /**
1211
+ * The {@link getISOWeek} function options.
1212
+ */
1213
+ /**
1214
+ * @name getISOWeek
1215
+ * @category ISO Week Helpers
1216
+ * @summary Get the ISO week of the given date.
1217
+ *
1218
+ * @description
1219
+ * Get the ISO week of the given date.
1220
+ *
1221
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1222
+ *
1223
+ * @param date - The given date
1224
+ * @param options - The options
1225
+ *
1226
+ * @returns The ISO week
1227
+ *
1228
+ * @example
1229
+ * // Which week of the ISO-week numbering year is 2 January 2005?
1230
+ * const result = getISOWeek(new Date(2005, 0, 2))
1231
+ * //=> 53
1232
+ */
1233
+ function getISOWeek(date, options) {
1234
+ const _date = toDate(date, options?.in);
1235
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1236
+ return Math.round(diff / millisecondsInWeek) + 1;
1237
+ }
1238
+
1239
+ //#endregion
1240
+ //#region node_modules/date-fns/getWeekYear.js
1241
+ /**
1242
+ * The {@link getWeekYear} function options.
1243
+ */
1244
+ /**
1245
+ * @name getWeekYear
1246
+ * @category Week-Numbering Year Helpers
1247
+ * @summary Get the local week-numbering year of the given date.
1248
+ *
1249
+ * @description
1250
+ * Get the local week-numbering year of the given date.
1251
+ * The exact calculation depends on the values of
1252
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1253
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1254
+ * the first week of the week-numbering year)
1255
+ *
1256
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1257
+ *
1258
+ * @param date - The given date
1259
+ * @param options - An object with options.
1260
+ *
1261
+ * @returns The local week-numbering year
1262
+ *
1263
+ * @example
1264
+ * // Which week numbering year is 26 December 2004 with the default settings?
1265
+ * const result = getWeekYear(new Date(2004, 11, 26))
1266
+ * //=> 2005
1267
+ *
1268
+ * @example
1269
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
1270
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
1271
+ * //=> 2004
1272
+ *
1273
+ * @example
1274
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
1275
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
1276
+ * //=> 2004
1277
+ */
1278
+ function getWeekYear(date, options) {
1279
+ const _date = toDate(date, options?.in);
1280
+ const year = _date.getFullYear();
1281
+ const defaultOptions = getDefaultOptions();
1282
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1283
+ const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1284
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1285
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1286
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1287
+ const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1288
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1289
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1290
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1291
+ if (+_date >= +startOfNextYear) return year + 1;
1292
+ else if (+_date >= +startOfThisYear) return year;
1293
+ else return year - 1;
1294
+ }
1295
+
1296
+ //#endregion
1297
+ //#region node_modules/date-fns/startOfWeekYear.js
1298
+ /**
1299
+ * The {@link startOfWeekYear} function options.
1300
+ */
1301
+ /**
1302
+ * @name startOfWeekYear
1303
+ * @category Week-Numbering Year Helpers
1304
+ * @summary Return the start of a local week-numbering year for the given date.
1305
+ *
1306
+ * @description
1307
+ * Return the start of a local week-numbering year.
1308
+ * The exact calculation depends on the values of
1309
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1310
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1311
+ * the first week of the week-numbering year)
1312
+ *
1313
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1314
+ *
1315
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1316
+ * @typeParam ResultDate - The result `Date` type.
1317
+ *
1318
+ * @param date - The original date
1319
+ * @param options - An object with options
1320
+ *
1321
+ * @returns The start of a week-numbering year
1322
+ *
1323
+ * @example
1324
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
1325
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
1326
+ * //=> Sun Dec 26 2004 00:00:00
1327
+ *
1328
+ * @example
1329
+ * // The start of a week-numbering year for 2 July 2005
1330
+ * // if Monday is the first day of week
1331
+ * // and 4 January is always in the first week of the year:
1332
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
1333
+ * weekStartsOn: 1,
1334
+ * firstWeekContainsDate: 4
1335
+ * })
1336
+ * //=> Mon Jan 03 2005 00:00:00
1337
+ */
1338
+ function startOfWeekYear(date, options) {
1339
+ const defaultOptions = getDefaultOptions();
1340
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1341
+ const year = getWeekYear(date, options);
1342
+ const firstWeek = constructFrom(options?.in || date, 0);
1343
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1344
+ firstWeek.setHours(0, 0, 0, 0);
1345
+ return startOfWeek(firstWeek, options);
1346
+ }
1347
+
1348
+ //#endregion
1349
+ //#region node_modules/date-fns/getWeek.js
1350
+ /**
1351
+ * The {@link getWeek} function options.
1352
+ */
1353
+ /**
1354
+ * @name getWeek
1355
+ * @category Week Helpers
1356
+ * @summary Get the local week index of the given date.
1357
+ *
1358
+ * @description
1359
+ * Get the local week index of the given date.
1360
+ * The exact calculation depends on the values of
1361
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1362
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1363
+ * the first week of the week-numbering year)
1364
+ *
1365
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1366
+ *
1367
+ * @param date - The given date
1368
+ * @param options - An object with options
1369
+ *
1370
+ * @returns The week
1371
+ *
1372
+ * @example
1373
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
1374
+ * const result = getWeek(new Date(2005, 0, 2))
1375
+ * //=> 2
1376
+ *
1377
+ * @example
1378
+ * // Which week of the local week numbering year is 2 January 2005,
1379
+ * // if Monday is the first day of the week,
1380
+ * // and the first week of the year always contains 4 January?
1381
+ * const result = getWeek(new Date(2005, 0, 2), {
1382
+ * weekStartsOn: 1,
1383
+ * firstWeekContainsDate: 4
1384
+ * })
1385
+ * //=> 53
1386
+ */
1387
+ function getWeek(date, options) {
1388
+ const _date = toDate(date, options?.in);
1389
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
1390
+ return Math.round(diff / millisecondsInWeek) + 1;
1391
+ }
1392
+
1393
+ //#endregion
1394
+ //#region node_modules/date-fns/_lib/addLeadingZeros.js
1395
+ function addLeadingZeros(number, targetLength) {
1396
+ return (number < 0 ? "-" : "") + Math.abs(number).toString().padStart(targetLength, "0");
1397
+ }
1398
+
1399
+ //#endregion
1400
+ //#region node_modules/date-fns/_lib/format/lightFormatters.js
1401
+ const lightFormatters = {
1402
+ y(date, token) {
1403
+ const signedYear = date.getFullYear();
1404
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1405
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
1406
+ },
1407
+ M(date, token) {
1408
+ const month = date.getMonth();
1409
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
1410
+ },
1411
+ d(date, token) {
1412
+ return addLeadingZeros(date.getDate(), token.length);
1413
+ },
1414
+ a(date, token) {
1415
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1416
+ switch (token) {
1417
+ case "a":
1418
+ case "aa": return dayPeriodEnumValue.toUpperCase();
1419
+ case "aaa": return dayPeriodEnumValue;
1420
+ case "aaaaa": return dayPeriodEnumValue[0];
1421
+ default: return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1422
+ }
1423
+ },
1424
+ h(date, token) {
1425
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
1426
+ },
1427
+ H(date, token) {
1428
+ return addLeadingZeros(date.getHours(), token.length);
1429
+ },
1430
+ m(date, token) {
1431
+ return addLeadingZeros(date.getMinutes(), token.length);
1432
+ },
1433
+ s(date, token) {
1434
+ return addLeadingZeros(date.getSeconds(), token.length);
1435
+ },
1436
+ S(date, token) {
1437
+ const numberOfDigits = token.length;
1438
+ const milliseconds = date.getMilliseconds();
1439
+ return addLeadingZeros(Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3)), token.length);
1440
+ }
1441
+ };
1442
+
1443
+ //#endregion
1444
+ //#region node_modules/date-fns/_lib/format/formatters.js
1445
+ const dayPeriodEnum = {
1446
+ am: "am",
1447
+ pm: "pm",
1448
+ midnight: "midnight",
1449
+ noon: "noon",
1450
+ morning: "morning",
1451
+ afternoon: "afternoon",
1452
+ evening: "evening",
1453
+ night: "night"
1454
+ };
1455
+ const formatters = {
1456
+ G: function(date, token, localize) {
1457
+ const era = date.getFullYear() > 0 ? 1 : 0;
1458
+ switch (token) {
1459
+ case "G":
1460
+ case "GG":
1461
+ case "GGG": return localize.era(era, { width: "abbreviated" });
1462
+ case "GGGGG": return localize.era(era, { width: "narrow" });
1463
+ default: return localize.era(era, { width: "wide" });
1464
+ }
1465
+ },
1466
+ y: function(date, token, localize) {
1467
+ if (token === "yo") {
1468
+ const signedYear = date.getFullYear();
1469
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1470
+ return localize.ordinalNumber(year, { unit: "year" });
1471
+ }
1472
+ return lightFormatters.y(date, token);
1473
+ },
1474
+ Y: function(date, token, localize, options) {
1475
+ const signedWeekYear = getWeekYear(date, options);
1476
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1477
+ if (token === "YY") return addLeadingZeros(weekYear % 100, 2);
1478
+ if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
1479
+ return addLeadingZeros(weekYear, token.length);
1480
+ },
1481
+ R: function(date, token) {
1482
+ return addLeadingZeros(getISOWeekYear(date), token.length);
1483
+ },
1484
+ u: function(date, token) {
1485
+ return addLeadingZeros(date.getFullYear(), token.length);
1486
+ },
1487
+ Q: function(date, token, localize) {
1488
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1489
+ switch (token) {
1490
+ case "Q": return String(quarter);
1491
+ case "QQ": return addLeadingZeros(quarter, 2);
1492
+ case "Qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1493
+ case "QQQ": return localize.quarter(quarter, {
1494
+ width: "abbreviated",
1495
+ context: "formatting"
1496
+ });
1497
+ case "QQQQQ": return localize.quarter(quarter, {
1498
+ width: "narrow",
1499
+ context: "formatting"
1500
+ });
1501
+ default: return localize.quarter(quarter, {
1502
+ width: "wide",
1503
+ context: "formatting"
1504
+ });
1505
+ }
1506
+ },
1507
+ q: function(date, token, localize) {
1508
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1509
+ switch (token) {
1510
+ case "q": return String(quarter);
1511
+ case "qq": return addLeadingZeros(quarter, 2);
1512
+ case "qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1513
+ case "qqq": return localize.quarter(quarter, {
1514
+ width: "abbreviated",
1515
+ context: "standalone"
1516
+ });
1517
+ case "qqqqq": return localize.quarter(quarter, {
1518
+ width: "narrow",
1519
+ context: "standalone"
1520
+ });
1521
+ default: return localize.quarter(quarter, {
1522
+ width: "wide",
1523
+ context: "standalone"
1524
+ });
1525
+ }
1526
+ },
1527
+ M: function(date, token, localize) {
1528
+ const month = date.getMonth();
1529
+ switch (token) {
1530
+ case "M":
1531
+ case "MM": return lightFormatters.M(date, token);
1532
+ case "Mo": return localize.ordinalNumber(month + 1, { unit: "month" });
1533
+ case "MMM": return localize.month(month, {
1534
+ width: "abbreviated",
1535
+ context: "formatting"
1536
+ });
1537
+ case "MMMMM": return localize.month(month, {
1538
+ width: "narrow",
1539
+ context: "formatting"
1540
+ });
1541
+ default: return localize.month(month, {
1542
+ width: "wide",
1543
+ context: "formatting"
1544
+ });
1545
+ }
1546
+ },
1547
+ L: function(date, token, localize) {
1548
+ const month = date.getMonth();
1549
+ switch (token) {
1550
+ case "L": return String(month + 1);
1551
+ case "LL": return addLeadingZeros(month + 1, 2);
1552
+ case "Lo": return localize.ordinalNumber(month + 1, { unit: "month" });
1553
+ case "LLL": return localize.month(month, {
1554
+ width: "abbreviated",
1555
+ context: "standalone"
1556
+ });
1557
+ case "LLLLL": return localize.month(month, {
1558
+ width: "narrow",
1559
+ context: "standalone"
1560
+ });
1561
+ default: return localize.month(month, {
1562
+ width: "wide",
1563
+ context: "standalone"
1564
+ });
1565
+ }
1566
+ },
1567
+ w: function(date, token, localize, options) {
1568
+ const week = getWeek(date, options);
1569
+ if (token === "wo") return localize.ordinalNumber(week, { unit: "week" });
1570
+ return addLeadingZeros(week, token.length);
1571
+ },
1572
+ I: function(date, token, localize) {
1573
+ const isoWeek = getISOWeek(date);
1574
+ if (token === "Io") return localize.ordinalNumber(isoWeek, { unit: "week" });
1575
+ return addLeadingZeros(isoWeek, token.length);
1576
+ },
1577
+ d: function(date, token, localize) {
1578
+ if (token === "do") return localize.ordinalNumber(date.getDate(), { unit: "date" });
1579
+ return lightFormatters.d(date, token);
1580
+ },
1581
+ D: function(date, token, localize) {
1582
+ const dayOfYear = getDayOfYear(date);
1583
+ if (token === "Do") return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
1584
+ return addLeadingZeros(dayOfYear, token.length);
1585
+ },
1586
+ E: function(date, token, localize) {
1587
+ const dayOfWeek = date.getDay();
1588
+ switch (token) {
1589
+ case "E":
1590
+ case "EE":
1591
+ case "EEE": return localize.day(dayOfWeek, {
1592
+ width: "abbreviated",
1593
+ context: "formatting"
1594
+ });
1595
+ case "EEEEE": return localize.day(dayOfWeek, {
1596
+ width: "narrow",
1597
+ context: "formatting"
1598
+ });
1599
+ case "EEEEEE": return localize.day(dayOfWeek, {
1600
+ width: "short",
1601
+ context: "formatting"
1602
+ });
1603
+ default: return localize.day(dayOfWeek, {
1604
+ width: "wide",
1605
+ context: "formatting"
1606
+ });
1607
+ }
1608
+ },
1609
+ e: function(date, token, localize, options) {
1610
+ const dayOfWeek = date.getDay();
1611
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1612
+ switch (token) {
1613
+ case "e": return String(localDayOfWeek);
1614
+ case "ee": return addLeadingZeros(localDayOfWeek, 2);
1615
+ case "eo": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1616
+ case "eee": return localize.day(dayOfWeek, {
1617
+ width: "abbreviated",
1618
+ context: "formatting"
1619
+ });
1620
+ case "eeeee": return localize.day(dayOfWeek, {
1621
+ width: "narrow",
1622
+ context: "formatting"
1623
+ });
1624
+ case "eeeeee": return localize.day(dayOfWeek, {
1625
+ width: "short",
1626
+ context: "formatting"
1627
+ });
1628
+ default: return localize.day(dayOfWeek, {
1629
+ width: "wide",
1630
+ context: "formatting"
1631
+ });
1632
+ }
1633
+ },
1634
+ c: function(date, token, localize, options) {
1635
+ const dayOfWeek = date.getDay();
1636
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1637
+ switch (token) {
1638
+ case "c": return String(localDayOfWeek);
1639
+ case "cc": return addLeadingZeros(localDayOfWeek, token.length);
1640
+ case "co": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1641
+ case "ccc": return localize.day(dayOfWeek, {
1642
+ width: "abbreviated",
1643
+ context: "standalone"
1644
+ });
1645
+ case "ccccc": return localize.day(dayOfWeek, {
1646
+ width: "narrow",
1647
+ context: "standalone"
1648
+ });
1649
+ case "cccccc": return localize.day(dayOfWeek, {
1650
+ width: "short",
1651
+ context: "standalone"
1652
+ });
1653
+ default: return localize.day(dayOfWeek, {
1654
+ width: "wide",
1655
+ context: "standalone"
1656
+ });
1657
+ }
1658
+ },
1659
+ i: function(date, token, localize) {
1660
+ const dayOfWeek = date.getDay();
1661
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1662
+ switch (token) {
1663
+ case "i": return String(isoDayOfWeek);
1664
+ case "ii": return addLeadingZeros(isoDayOfWeek, token.length);
1665
+ case "io": return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
1666
+ case "iii": return localize.day(dayOfWeek, {
1667
+ width: "abbreviated",
1668
+ context: "formatting"
1669
+ });
1670
+ case "iiiii": return localize.day(dayOfWeek, {
1671
+ width: "narrow",
1672
+ context: "formatting"
1673
+ });
1674
+ case "iiiiii": return localize.day(dayOfWeek, {
1675
+ width: "short",
1676
+ context: "formatting"
1677
+ });
1678
+ default: return localize.day(dayOfWeek, {
1679
+ width: "wide",
1680
+ context: "formatting"
1681
+ });
1682
+ }
1683
+ },
1684
+ a: function(date, token, localize) {
1685
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1686
+ switch (token) {
1687
+ case "a":
1688
+ case "aa": return localize.dayPeriod(dayPeriodEnumValue, {
1689
+ width: "abbreviated",
1690
+ context: "formatting"
1691
+ });
1692
+ case "aaa": return localize.dayPeriod(dayPeriodEnumValue, {
1693
+ width: "abbreviated",
1694
+ context: "formatting"
1695
+ }).toLowerCase();
1696
+ case "aaaaa": return localize.dayPeriod(dayPeriodEnumValue, {
1697
+ width: "narrow",
1698
+ context: "formatting"
1699
+ });
1700
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1701
+ width: "wide",
1702
+ context: "formatting"
1703
+ });
1704
+ }
1705
+ },
1706
+ b: function(date, token, localize) {
1707
+ const hours = date.getHours();
1708
+ let dayPeriodEnumValue;
1709
+ if (hours === 12) dayPeriodEnumValue = dayPeriodEnum.noon;
1710
+ else if (hours === 0) dayPeriodEnumValue = dayPeriodEnum.midnight;
1711
+ else dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1712
+ switch (token) {
1713
+ case "b":
1714
+ case "bb": return localize.dayPeriod(dayPeriodEnumValue, {
1715
+ width: "abbreviated",
1716
+ context: "formatting"
1717
+ });
1718
+ case "bbb": return localize.dayPeriod(dayPeriodEnumValue, {
1719
+ width: "abbreviated",
1720
+ context: "formatting"
1721
+ }).toLowerCase();
1722
+ case "bbbbb": return localize.dayPeriod(dayPeriodEnumValue, {
1723
+ width: "narrow",
1724
+ context: "formatting"
1725
+ });
1726
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1727
+ width: "wide",
1728
+ context: "formatting"
1729
+ });
1730
+ }
1731
+ },
1732
+ B: function(date, token, localize) {
1733
+ const hours = date.getHours();
1734
+ let dayPeriodEnumValue;
1735
+ if (hours >= 17) dayPeriodEnumValue = dayPeriodEnum.evening;
1736
+ else if (hours >= 12) dayPeriodEnumValue = dayPeriodEnum.afternoon;
1737
+ else if (hours >= 4) dayPeriodEnumValue = dayPeriodEnum.morning;
1738
+ else dayPeriodEnumValue = dayPeriodEnum.night;
1739
+ switch (token) {
1740
+ case "B":
1741
+ case "BB":
1742
+ case "BBB": return localize.dayPeriod(dayPeriodEnumValue, {
1743
+ width: "abbreviated",
1744
+ context: "formatting"
1745
+ });
1746
+ case "BBBBB": return localize.dayPeriod(dayPeriodEnumValue, {
1747
+ width: "narrow",
1748
+ context: "formatting"
1749
+ });
1750
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1751
+ width: "wide",
1752
+ context: "formatting"
1753
+ });
1754
+ }
1755
+ },
1756
+ h: function(date, token, localize) {
1757
+ if (token === "ho") {
1758
+ let hours = date.getHours() % 12;
1759
+ if (hours === 0) hours = 12;
1760
+ return localize.ordinalNumber(hours, { unit: "hour" });
1761
+ }
1762
+ return lightFormatters.h(date, token);
1763
+ },
1764
+ H: function(date, token, localize) {
1765
+ if (token === "Ho") return localize.ordinalNumber(date.getHours(), { unit: "hour" });
1766
+ return lightFormatters.H(date, token);
1767
+ },
1768
+ K: function(date, token, localize) {
1769
+ const hours = date.getHours() % 12;
1770
+ if (token === "Ko") return localize.ordinalNumber(hours, { unit: "hour" });
1771
+ return addLeadingZeros(hours, token.length);
1772
+ },
1773
+ k: function(date, token, localize) {
1774
+ let hours = date.getHours();
1775
+ if (hours === 0) hours = 24;
1776
+ if (token === "ko") return localize.ordinalNumber(hours, { unit: "hour" });
1777
+ return addLeadingZeros(hours, token.length);
1778
+ },
1779
+ m: function(date, token, localize) {
1780
+ if (token === "mo") return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
1781
+ return lightFormatters.m(date, token);
1782
+ },
1783
+ s: function(date, token, localize) {
1784
+ if (token === "so") return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
1785
+ return lightFormatters.s(date, token);
1786
+ },
1787
+ S: function(date, token) {
1788
+ return lightFormatters.S(date, token);
1789
+ },
1790
+ X: function(date, token, _localize) {
1791
+ const timezoneOffset = date.getTimezoneOffset();
1792
+ if (timezoneOffset === 0) return "Z";
1793
+ switch (token) {
1794
+ case "X": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1795
+ case "XXXX":
1796
+ case "XX": return formatTimezone(timezoneOffset);
1797
+ default: return formatTimezone(timezoneOffset, ":");
1798
+ }
1799
+ },
1800
+ x: function(date, token, _localize) {
1801
+ const timezoneOffset = date.getTimezoneOffset();
1802
+ switch (token) {
1803
+ case "x": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1804
+ case "xxxx":
1805
+ case "xx": return formatTimezone(timezoneOffset);
1806
+ default: return formatTimezone(timezoneOffset, ":");
1807
+ }
1808
+ },
1809
+ O: function(date, token, _localize) {
1810
+ const timezoneOffset = date.getTimezoneOffset();
1811
+ switch (token) {
1812
+ case "O":
1813
+ case "OO":
1814
+ case "OOO": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1815
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1816
+ }
1817
+ },
1818
+ z: function(date, token, _localize) {
1819
+ const timezoneOffset = date.getTimezoneOffset();
1820
+ switch (token) {
1821
+ case "z":
1822
+ case "zz":
1823
+ case "zzz": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1824
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1825
+ }
1826
+ },
1827
+ t: function(date, token, _localize) {
1828
+ return addLeadingZeros(Math.trunc(+date / 1e3), token.length);
1829
+ },
1830
+ T: function(date, token, _localize) {
1831
+ return addLeadingZeros(+date, token.length);
1832
+ }
1833
+ };
1834
+ function formatTimezoneShort(offset, delimiter = "") {
1835
+ const sign = offset > 0 ? "-" : "+";
1836
+ const absOffset = Math.abs(offset);
1837
+ const hours = Math.trunc(absOffset / 60);
1838
+ const minutes = absOffset % 60;
1839
+ if (minutes === 0) return sign + String(hours);
1840
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1841
+ }
1842
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
1843
+ if (offset % 60 === 0) return (offset > 0 ? "-" : "+") + addLeadingZeros(Math.abs(offset) / 60, 2);
1844
+ return formatTimezone(offset, delimiter);
1845
+ }
1846
+ function formatTimezone(offset, delimiter = "") {
1847
+ const sign = offset > 0 ? "-" : "+";
1848
+ const absOffset = Math.abs(offset);
1849
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
1850
+ const minutes = addLeadingZeros(absOffset % 60, 2);
1851
+ return sign + hours + delimiter + minutes;
1852
+ }
1853
+
1854
+ //#endregion
1855
+ //#region node_modules/date-fns/_lib/format/longFormatters.js
1856
+ const dateLongFormatter = (pattern, formatLong) => {
1857
+ switch (pattern) {
1858
+ case "P": return formatLong.date({ width: "short" });
1859
+ case "PP": return formatLong.date({ width: "medium" });
1860
+ case "PPP": return formatLong.date({ width: "long" });
1861
+ default: return formatLong.date({ width: "full" });
1862
+ }
1863
+ };
1864
+ const timeLongFormatter = (pattern, formatLong) => {
1865
+ switch (pattern) {
1866
+ case "p": return formatLong.time({ width: "short" });
1867
+ case "pp": return formatLong.time({ width: "medium" });
1868
+ case "ppp": return formatLong.time({ width: "long" });
1869
+ default: return formatLong.time({ width: "full" });
1870
+ }
1871
+ };
1872
+ const dateTimeLongFormatter = (pattern, formatLong) => {
1873
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
1874
+ const datePattern = matchResult[1];
1875
+ const timePattern = matchResult[2];
1876
+ if (!timePattern) return dateLongFormatter(pattern, formatLong);
1877
+ let dateTimeFormat;
1878
+ switch (datePattern) {
1879
+ case "P":
1880
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
1881
+ break;
1882
+ case "PP":
1883
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
1884
+ break;
1885
+ case "PPP":
1886
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
1887
+ break;
1888
+ default:
1889
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
1890
+ break;
1891
+ }
1892
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
1893
+ };
1894
+ const longFormatters = {
1895
+ p: timeLongFormatter,
1896
+ P: dateTimeLongFormatter
1897
+ };
1898
+
1899
+ //#endregion
1900
+ //#region node_modules/date-fns/_lib/protectedTokens.js
1901
+ const dayOfYearTokenRE = /^D+$/;
1902
+ const weekYearTokenRE = /^Y+$/;
1903
+ const throwTokens = [
1904
+ "D",
1905
+ "DD",
1906
+ "YY",
1907
+ "YYYY"
1908
+ ];
1909
+ function isProtectedDayOfYearToken(token) {
1910
+ return dayOfYearTokenRE.test(token);
1911
+ }
1912
+ function isProtectedWeekYearToken(token) {
1913
+ return weekYearTokenRE.test(token);
1914
+ }
1915
+ function warnOrThrowProtectedError(token, format, input) {
1916
+ const _message = message(token, format, input);
1917
+ console.warn(_message);
1918
+ if (throwTokens.includes(token)) throw new RangeError(_message);
1919
+ }
1920
+ function message(token, format, input) {
1921
+ const subject = token[0] === "Y" ? "years" : "days of the month";
1922
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1923
+ }
1924
+
1925
+ //#endregion
1926
+ //#region node_modules/date-fns/format.js
1927
+ const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1928
+ const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1929
+ const escapedStringRegExp = /^'([^]*?)'?$/;
1930
+ const doubleQuoteRegExp = /''/g;
1931
+ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1932
+ /**
1933
+ * The {@link format} function options.
1934
+ */
1935
+ /**
1936
+ * @name format
1937
+ * @alias formatDate
1938
+ * @category Common Helpers
1939
+ * @summary Format the date.
1940
+ *
1941
+ * @description
1942
+ * Return the formatted date string in the given format. The result may vary by locale.
1943
+ *
1944
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1945
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1946
+ *
1947
+ * The characters wrapped between two single quotes characters (') are escaped.
1948
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1949
+ * (see the last example)
1950
+ *
1951
+ * Format of the string is based on Unicode Technical Standard #35:
1952
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1953
+ * with a few additions (see note 7 below the table).
1954
+ *
1955
+ * Accepted patterns:
1956
+ * | Unit | Pattern | Result examples | Notes |
1957
+ * |---------------------------------|---------|-----------------------------------|-------|
1958
+ * | Era | G..GGG | AD, BC | |
1959
+ * | | GGGG | Anno Domini, Before Christ | 2 |
1960
+ * | | GGGGG | A, B | |
1961
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1962
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1963
+ * | | yy | 44, 01, 00, 17 | 5 |
1964
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
1965
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1966
+ * | | yyyyy | ... | 3,5 |
1967
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1968
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1969
+ * | | YY | 44, 01, 00, 17 | 5,8 |
1970
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
1971
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1972
+ * | | YYYYY | ... | 3,5 |
1973
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1974
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1975
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1976
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1977
+ * | | RRRRR | ... | 3,5,7 |
1978
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1979
+ * | | uu | -43, 01, 1900, 2017 | 5 |
1980
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
1981
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1982
+ * | | uuuuu | ... | 3,5 |
1983
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1984
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1985
+ * | | QQ | 01, 02, 03, 04 | |
1986
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
1987
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1988
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
1989
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1990
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1991
+ * | | qq | 01, 02, 03, 04 | |
1992
+ * | | qqq | Q1, Q2, Q3, Q4 | |
1993
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1994
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
1995
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
1996
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
1997
+ * | | MM | 01, 02, ..., 12 | |
1998
+ * | | MMM | Jan, Feb, ..., Dec | |
1999
+ * | | MMMM | January, February, ..., December | 2 |
2000
+ * | | MMMMM | J, F, ..., D | |
2001
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2002
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2003
+ * | | LL | 01, 02, ..., 12 | |
2004
+ * | | LLL | Jan, Feb, ..., Dec | |
2005
+ * | | LLLL | January, February, ..., December | 2 |
2006
+ * | | LLLLL | J, F, ..., D | |
2007
+ * | Local week of year | w | 1, 2, ..., 53 | |
2008
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2009
+ * | | ww | 01, 02, ..., 53 | |
2010
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2011
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2012
+ * | | II | 01, 02, ..., 53 | 7 |
2013
+ * | Day of month | d | 1, 2, ..., 31 | |
2014
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2015
+ * | | dd | 01, 02, ..., 31 | |
2016
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2017
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2018
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2019
+ * | | DDD | 001, 002, ..., 365, 366 | |
2020
+ * | | DDDD | ... | 3 |
2021
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2022
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2023
+ * | | EEEEE | M, T, W, T, F, S, S | |
2024
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2025
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2026
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2027
+ * | | ii | 01, 02, ..., 07 | 7 |
2028
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2029
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2030
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2031
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2032
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2033
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2034
+ * | | ee | 02, 03, ..., 01 | |
2035
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2036
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2037
+ * | | eeeee | M, T, W, T, F, S, S | |
2038
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2039
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2040
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2041
+ * | | cc | 02, 03, ..., 01 | |
2042
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2043
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2044
+ * | | ccccc | M, T, W, T, F, S, S | |
2045
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2046
+ * | AM, PM | a..aa | AM, PM | |
2047
+ * | | aaa | am, pm | |
2048
+ * | | aaaa | a.m., p.m. | 2 |
2049
+ * | | aaaaa | a, p | |
2050
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2051
+ * | | bbb | am, pm, noon, midnight | |
2052
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2053
+ * | | bbbbb | a, p, n, mi | |
2054
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2055
+ * | | BBBB | at night, in the morning, ... | 2 |
2056
+ * | | BBBBB | at night, in the morning, ... | |
2057
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2058
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2059
+ * | | hh | 01, 02, ..., 11, 12 | |
2060
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2061
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2062
+ * | | HH | 00, 01, 02, ..., 23 | |
2063
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2064
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2065
+ * | | KK | 01, 02, ..., 11, 00 | |
2066
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2067
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2068
+ * | | kk | 24, 01, 02, ..., 23 | |
2069
+ * | Minute | m | 0, 1, ..., 59 | |
2070
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2071
+ * | | mm | 00, 01, ..., 59 | |
2072
+ * | Second | s | 0, 1, ..., 59 | |
2073
+ * | | so | 0th, 1st, ..., 59th | 7 |
2074
+ * | | ss | 00, 01, ..., 59 | |
2075
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2076
+ * | | SS | 00, 01, ..., 99 | |
2077
+ * | | SSS | 000, 001, ..., 999 | |
2078
+ * | | SSSS | ... | 3 |
2079
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2080
+ * | | XX | -0800, +0530, Z | |
2081
+ * | | XXX | -08:00, +05:30, Z | |
2082
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2083
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2084
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2085
+ * | | xx | -0800, +0530, +0000 | |
2086
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2087
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2088
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2089
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2090
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2091
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2092
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2093
+ * | Seconds timestamp | t | 512969520 | 7 |
2094
+ * | | tt | ... | 3,7 |
2095
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2096
+ * | | TT | ... | 3,7 |
2097
+ * | Long localized date | P | 04/29/1453 | 7 |
2098
+ * | | PP | Apr 29, 1453 | 7 |
2099
+ * | | PPP | April 29th, 1453 | 7 |
2100
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2101
+ * | Long localized time | p | 12:00 AM | 7 |
2102
+ * | | pp | 12:00:00 AM | 7 |
2103
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2104
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2105
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2106
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2107
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2108
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2109
+ * Notes:
2110
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2111
+ * are the same as "stand-alone" units, but are different in some languages.
2112
+ * "Formatting" units are declined according to the rules of the language
2113
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2114
+ *
2115
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2116
+ *
2117
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2118
+ *
2119
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2120
+ * the single quote characters (see below).
2121
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2122
+ * the output will be the same as default pattern for this unit, usually
2123
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2124
+ * are marked with "2" in the last column of the table.
2125
+ *
2126
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2127
+ *
2128
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2129
+ *
2130
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2131
+ *
2132
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2133
+ *
2134
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2135
+ *
2136
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2137
+ * The output will be padded with zeros to match the length of the pattern.
2138
+ *
2139
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2140
+ *
2141
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2142
+ * These tokens represent the shortest form of the quarter.
2143
+ *
2144
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2145
+ *
2146
+ * | Year | `y` | `u` |
2147
+ * |------|-----|-----|
2148
+ * | AC 1 | 1 | 1 |
2149
+ * | BC 1 | 1 | 0 |
2150
+ * | BC 2 | 2 | -1 |
2151
+ *
2152
+ * Also `yy` always returns the last two digits of a year,
2153
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2154
+ *
2155
+ * | Year | `yy` | `uu` |
2156
+ * |------|------|------|
2157
+ * | 1 | 01 | 01 |
2158
+ * | 14 | 14 | 14 |
2159
+ * | 376 | 76 | 376 |
2160
+ * | 1453 | 53 | 1453 |
2161
+ *
2162
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2163
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2164
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
2165
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
2166
+ *
2167
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2168
+ * so right now these tokens fall back to GMT timezones.
2169
+ *
2170
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2171
+ * - `i`: ISO day of week
2172
+ * - `I`: ISO week of year
2173
+ * - `R`: ISO week-numbering year
2174
+ * - `t`: seconds timestamp
2175
+ * - `T`: milliseconds timestamp
2176
+ * - `o`: ordinal number modifier
2177
+ * - `P`: long localized date
2178
+ * - `p`: long localized time
2179
+ *
2180
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2181
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2182
+ *
2183
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2184
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2185
+ *
2186
+ * @param date - The original date
2187
+ * @param format - The string of tokens
2188
+ * @param options - An object with options
2189
+ *
2190
+ * @returns The formatted date string
2191
+ *
2192
+ * @throws `date` must not be Invalid Date
2193
+ * @throws `options.locale` must contain `localize` property
2194
+ * @throws `options.locale` must contain `formatLong` property
2195
+ * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2196
+ * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2197
+ * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2198
+ * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2199
+ * @throws format string contains an unescaped latin alphabet character
2200
+ *
2201
+ * @example
2202
+ * // Represent 11 February 2014 in middle-endian format:
2203
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2204
+ * //=> '02/11/2014'
2205
+ *
2206
+ * @example
2207
+ * // Represent 2 July 2014 in Esperanto:
2208
+ * import { eoLocale } from 'date-fns/locale/eo'
2209
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2210
+ * locale: eoLocale
2211
+ * })
2212
+ * //=> '2-a de julio 2014'
2213
+ *
2214
+ * @example
2215
+ * // Escape string by single quote characters:
2216
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2217
+ * //=> "3 o'clock"
2218
+ */
2219
+ function format(date, formatStr, options) {
2220
+ const defaultOptions = getDefaultOptions();
2221
+ const locale = options?.locale ?? defaultOptions.locale ?? enUS;
2222
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
2223
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
2224
+ const originalDate = toDate(date, options?.in);
2225
+ if (!isValid(originalDate)) throw new RangeError("Invalid time value");
2226
+ let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
2227
+ const firstCharacter = substring[0];
2228
+ if (firstCharacter === "p" || firstCharacter === "P") {
2229
+ const longFormatter = longFormatters[firstCharacter];
2230
+ return longFormatter(substring, locale.formatLong);
2231
+ }
2232
+ return substring;
2233
+ }).join("").match(formattingTokensRegExp).map((substring) => {
2234
+ if (substring === "''") return {
2235
+ isToken: false,
2236
+ value: "'"
2237
+ };
2238
+ const firstCharacter = substring[0];
2239
+ if (firstCharacter === "'") return {
2240
+ isToken: false,
2241
+ value: cleanEscapedString(substring)
2242
+ };
2243
+ if (formatters[firstCharacter]) return {
2244
+ isToken: true,
2245
+ value: substring
2246
+ };
2247
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
2248
+ return {
2249
+ isToken: false,
2250
+ value: substring
2251
+ };
2252
+ });
2253
+ if (locale.localize.preprocessor) parts = locale.localize.preprocessor(originalDate, parts);
2254
+ const formatterOptions = {
2255
+ firstWeekContainsDate,
2256
+ weekStartsOn,
2257
+ locale
2258
+ };
2259
+ return parts.map((part) => {
2260
+ if (!part.isToken) return part.value;
2261
+ const token = part.value;
2262
+ if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) warnOrThrowProtectedError(token, formatStr, String(date));
2263
+ const formatter = formatters[token[0]];
2264
+ return formatter(originalDate, token, locale.localize, formatterOptions);
2265
+ }).join("");
2266
+ }
2267
+ function cleanEscapedString(input) {
2268
+ const matched = input.match(escapedStringRegExp);
2269
+ if (!matched) return input;
2270
+ return matched[1].replace(doubleQuoteRegExp, "'");
2271
+ }
2272
+
2273
+ //#endregion
2274
+ //#region src/elements-experimental/pearl-chain-time/pearl-chain-time.scss?inline
2275
+ var pearl_chain_time_default = ":host {\n display: block;\n --sbb-pearl-chain-time-height: auto;\n}\n@media (min-width: calc(37.5rem)) {\n :host {\n --sbb-pearl-chain-time-height: 1.5625rem;\n }\n}\n@media (min-width: calc(64rem)) {\n :host {\n --sbb-pearl-chain-time-height: 1.75rem;\n }\n}\n\n.sbb-pearl-chain__time {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n align-items: center;\n height: var(--sbb-pearl-chain-time-height);\n}\n\n.sbb-pearl-chain__time-walktime,\n.sbb-pearl-chain__time-transfer {\n --sbb-text-font-size: var(--sbb-text-font-size-xxs);\n font-family: var(--sbb-typo-font-family);\n font-weight: normal;\n line-height: var(--sbb-typo-line-height-text);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n font-size: var(--sbb-text-font-size);\n display: inline-flex;\n align-items: center;\n}\n\n.sbb-pearl-chain__time-walktime--walk-small-left {\n transform: translateX(-0.4375rem);\n margin-inline-end: calc(var(--sbb-spacing-fixed-2x) - 0.4375rem);\n}\n\n.sbb-pearl-chain__time-walktime--walk-small-right {\n margin-inline-start: calc(var(--sbb-spacing-fixed-2x) - 0.25rem);\n}\n\n.sbb-pearl-chain__time-walktime--wheelchair-small-left {\n transform: translateX(-0.375rem);\n margin-inline-end: calc(var(--sbb-spacing-fixed-2x) - 0.4375rem);\n}\n\n.sbb-pearl-chain__time-walktime--wheelchair-small-right {\n margin-inline-start: calc(var(--sbb-spacing-fixed-2x) - 0.25rem);\n}\n\n.sbb-pearl-chain__time-walktime-prime-symbol {\n float: right;\n}\n\n.sbb-pearl-chain__time-transfer {\n gap: var(--sbb-spacing-fixed-1x);\n}\n\n.sbb-pearl-chain__time-transfer--sa-ci-departure {\n margin-inline-end: var(--sbb-spacing-fixed-2x);\n}\n\n.sbb-pearl-chain__time-transfer--sa-ci-arrival {\n margin-inline-start: calc(var(--sbb-spacing-fixed-2x) - 0.25rem);\n}\n\n.sbb-pearl-chain__time-chain {\n flex: 1 1 auto;\n align-self: center;\n margin-inline: var(--sbb-spacing-fixed-3x);\n}\n\n.sbb-pearl-chain__time-time {\n --sbb-text-font-size: var(--sbb-text-font-size-s);\n font-family: var(--sbb-typo-font-family);\n font-weight: normal;\n line-height: var(--sbb-typo-line-height-text);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n font-size: var(--sbb-text-font-size);\n font-weight: bold;\n color: var(--sbb-color-2);\n}\n";
2276
+
2277
+ //#endregion
2278
+ //#region src/elements-experimental/pearl-chain-time/pearl-chain-time.component.ts
2279
+ /**
2280
+ * Combined with `sbb-pearl-chain`, it displays walk time information.
2281
+ */
2282
+ let SbbPearlChainTimeElement = (() => {
2283
+ let _classSuper = SbbElement;
2284
+ let _instanceExtraInitializers = [];
2285
+ let _legs_decorators;
2286
+ let _legs_initializers = [];
2287
+ let _legs_extraInitializers = [];
2288
+ let _departureTime_decorators;
2289
+ let _departureTime_initializers = [];
2290
+ let _departureTime_extraInitializers = [];
2291
+ let _arrivalTime_decorators;
2292
+ let _arrivalTime_initializers = [];
2293
+ let _arrivalTime_extraInitializers = [];
2294
+ let _departureWalk_decorators;
2295
+ let _departureWalk_initializers = [];
2296
+ let _departureWalk_extraInitializers = [];
2297
+ let _arrivalWalk_decorators;
2298
+ let _arrivalWalk_initializers = [];
2299
+ let _arrivalWalk_extraInitializers = [];
2300
+ let _disableAnimation_decorators;
2301
+ let _disableAnimation_initializers = [];
2302
+ let _disableAnimation_extraInitializers = [];
2303
+ let _a11yFootpath_decorators;
2304
+ let _a11yFootpath_initializers = [];
2305
+ let _a11yFootpath_extraInitializers = [];
2306
+ let _set_now_decorators;
2307
+ return class SbbPearlChainTimeElement extends _classSuper {
2308
+ constructor() {
2309
+ super(...arguments);
2310
+ this.#legs_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _legs_initializers, []));
2311
+ this.#departureTime_accessor_storage = (__runInitializers(this, _legs_extraInitializers), __runInitializers(this, _departureTime_initializers, ""));
2312
+ this.#arrivalTime_accessor_storage = (__runInitializers(this, _departureTime_extraInitializers), __runInitializers(this, _arrivalTime_initializers, ""));
2313
+ this.#departureWalk_accessor_storage = (__runInitializers(this, _arrivalTime_extraInitializers), __runInitializers(this, _departureWalk_initializers, NaN));
2314
+ this.#arrivalWalk_accessor_storage = (__runInitializers(this, _departureWalk_extraInitializers), __runInitializers(this, _arrivalWalk_initializers, NaN));
2315
+ this.#disableAnimation_accessor_storage = (__runInitializers(this, _arrivalWalk_extraInitializers), __runInitializers(this, _disableAnimation_initializers, false));
2316
+ this.#a11yFootpath_accessor_storage = (__runInitializers(this, _disableAnimation_extraInitializers), __runInitializers(this, _a11yFootpath_initializers, false));
2317
+ this._now = (__runInitializers(this, _a11yFootpath_extraInitializers), null);
2318
+ this._language = new SbbLanguageController(this);
2319
+ }
2320
+ static {
2321
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2322
+ _legs_decorators = [property({ type: Array })];
2323
+ _departureTime_decorators = [forceType(), property({ attribute: "departure-time" })];
2324
+ _arrivalTime_decorators = [forceType(), property({ attribute: "arrival-time" })];
2325
+ _departureWalk_decorators = [forceType(), property({
2326
+ attribute: "departure-walk",
2327
+ type: Number
2328
+ })];
2329
+ _arrivalWalk_decorators = [forceType(), property({
2330
+ attribute: "arrival-walk",
2331
+ type: Number
2332
+ })];
2333
+ _disableAnimation_decorators = [forceType(), property({
2334
+ attribute: "disable-animation",
2335
+ type: Boolean
2336
+ })];
2337
+ _a11yFootpath_decorators = [forceType(), property({
2338
+ attribute: "a11y-footpath",
2339
+ type: Boolean
2340
+ })];
2341
+ _set_now_decorators = [property()];
2342
+ __esDecorate(this, null, _legs_decorators, {
2343
+ kind: "accessor",
2344
+ name: "legs",
2345
+ static: false,
2346
+ private: false,
2347
+ access: {
2348
+ has: (obj) => "legs" in obj,
2349
+ get: (obj) => obj.legs,
2350
+ set: (obj, value) => {
2351
+ obj.legs = value;
2352
+ }
2353
+ },
2354
+ metadata: _metadata
2355
+ }, _legs_initializers, _legs_extraInitializers);
2356
+ __esDecorate(this, null, _departureTime_decorators, {
2357
+ kind: "accessor",
2358
+ name: "departureTime",
2359
+ static: false,
2360
+ private: false,
2361
+ access: {
2362
+ has: (obj) => "departureTime" in obj,
2363
+ get: (obj) => obj.departureTime,
2364
+ set: (obj, value) => {
2365
+ obj.departureTime = value;
2366
+ }
2367
+ },
2368
+ metadata: _metadata
2369
+ }, _departureTime_initializers, _departureTime_extraInitializers);
2370
+ __esDecorate(this, null, _arrivalTime_decorators, {
2371
+ kind: "accessor",
2372
+ name: "arrivalTime",
2373
+ static: false,
2374
+ private: false,
2375
+ access: {
2376
+ has: (obj) => "arrivalTime" in obj,
2377
+ get: (obj) => obj.arrivalTime,
2378
+ set: (obj, value) => {
2379
+ obj.arrivalTime = value;
2380
+ }
2381
+ },
2382
+ metadata: _metadata
2383
+ }, _arrivalTime_initializers, _arrivalTime_extraInitializers);
2384
+ __esDecorate(this, null, _departureWalk_decorators, {
2385
+ kind: "accessor",
2386
+ name: "departureWalk",
2387
+ static: false,
2388
+ private: false,
2389
+ access: {
2390
+ has: (obj) => "departureWalk" in obj,
2391
+ get: (obj) => obj.departureWalk,
2392
+ set: (obj, value) => {
2393
+ obj.departureWalk = value;
2394
+ }
2395
+ },
2396
+ metadata: _metadata
2397
+ }, _departureWalk_initializers, _departureWalk_extraInitializers);
2398
+ __esDecorate(this, null, _arrivalWalk_decorators, {
2399
+ kind: "accessor",
2400
+ name: "arrivalWalk",
2401
+ static: false,
2402
+ private: false,
2403
+ access: {
2404
+ has: (obj) => "arrivalWalk" in obj,
2405
+ get: (obj) => obj.arrivalWalk,
2406
+ set: (obj, value) => {
2407
+ obj.arrivalWalk = value;
2408
+ }
2409
+ },
2410
+ metadata: _metadata
2411
+ }, _arrivalWalk_initializers, _arrivalWalk_extraInitializers);
2412
+ __esDecorate(this, null, _disableAnimation_decorators, {
2413
+ kind: "accessor",
2414
+ name: "disableAnimation",
2415
+ static: false,
2416
+ private: false,
2417
+ access: {
2418
+ has: (obj) => "disableAnimation" in obj,
2419
+ get: (obj) => obj.disableAnimation,
2420
+ set: (obj, value) => {
2421
+ obj.disableAnimation = value;
2422
+ }
2423
+ },
2424
+ metadata: _metadata
2425
+ }, _disableAnimation_initializers, _disableAnimation_extraInitializers);
2426
+ __esDecorate(this, null, _a11yFootpath_decorators, {
2427
+ kind: "accessor",
2428
+ name: "a11yFootpath",
2429
+ static: false,
2430
+ private: false,
2431
+ access: {
2432
+ has: (obj) => "a11yFootpath" in obj,
2433
+ get: (obj) => obj.a11yFootpath,
2434
+ set: (obj, value) => {
2435
+ obj.a11yFootpath = value;
2436
+ }
2437
+ },
2438
+ metadata: _metadata
2439
+ }, _a11yFootpath_initializers, _a11yFootpath_extraInitializers);
2440
+ __esDecorate(this, null, _set_now_decorators, {
2441
+ kind: "setter",
2442
+ name: "now",
2443
+ static: false,
2444
+ private: false,
2445
+ access: {
2446
+ has: (obj) => "now" in obj,
2447
+ set: (obj, value) => {
2448
+ obj.now = value;
2449
+ }
2450
+ },
2451
+ metadata: _metadata
2452
+ }, null, _instanceExtraInitializers);
2453
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, {
2454
+ enumerable: true,
2455
+ configurable: true,
2456
+ writable: true,
2457
+ value: _metadata
2458
+ });
2459
+ }
2460
+ static {
2461
+ this.elementName = "sbb-pearl-chain-time";
2462
+ }
2463
+ static {
2464
+ this.elementDependencies = [SbbIconElement, SbbPearlChainElement];
2465
+ }
2466
+ static {
2467
+ this.styles = [screenReaderOnlyStyles, unsafeCSS(pearl_chain_time_default)];
2468
+ }
2469
+ #legs_accessor_storage;
2470
+ /**
2471
+ * define the legs of the pearl-chain.
2472
+ * Format:
2473
+ * `{"legs": [{"duration": 25}, ...]}`
2474
+ * `duration` in minutes. Duration of the leg is relative
2475
+ * to the total travel time. Example: departure 16:30, change at 16:40,
2476
+ * arrival at 17:00. So the change should have a duration of 33.33%.
2477
+ */
2478
+ get legs() {
2479
+ return this.#legs_accessor_storage;
2480
+ }
2481
+ set legs(value) {
2482
+ this.#legs_accessor_storage = value;
2483
+ }
2484
+ #departureTime_accessor_storage;
2485
+ /** Prop to render the departure time - will be formatted as "H:mm" */
2486
+ get departureTime() {
2487
+ return this.#departureTime_accessor_storage;
2488
+ }
2489
+ set departureTime(value) {
2490
+ this.#departureTime_accessor_storage = value;
2491
+ }
2492
+ #arrivalTime_accessor_storage;
2493
+ /** Prop to render the arrival time - will be formatted as "H:mm" */
2494
+ get arrivalTime() {
2495
+ return this.#arrivalTime_accessor_storage;
2496
+ }
2497
+ set arrivalTime(value) {
2498
+ this.#arrivalTime_accessor_storage = value;
2499
+ }
2500
+ #departureWalk_accessor_storage;
2501
+ /** Optional prop to render the walk time (in minutes) before departure */
2502
+ get departureWalk() {
2503
+ return this.#departureWalk_accessor_storage;
2504
+ }
2505
+ set departureWalk(value) {
2506
+ this.#departureWalk_accessor_storage = value;
2507
+ }
2508
+ #arrivalWalk_accessor_storage;
2509
+ /** Optional prop to render the walk time (in minutes) after arrival */
2510
+ get arrivalWalk() {
2511
+ return this.#arrivalWalk_accessor_storage;
2512
+ }
2513
+ set arrivalWalk(value) {
2514
+ this.#arrivalWalk_accessor_storage = value;
2515
+ }
2516
+ #disableAnimation_accessor_storage;
2517
+ /**
2518
+ * Per default, the current location has a pulsating animation. You can
2519
+ * disable the animation with this property.
2520
+ */
2521
+ get disableAnimation() {
2522
+ return this.#disableAnimation_accessor_storage;
2523
+ }
2524
+ set disableAnimation(value) {
2525
+ this.#disableAnimation_accessor_storage = value;
2526
+ }
2527
+ #a11yFootpath_accessor_storage;
2528
+ /** Optional prop to render wheelchair-small instead of walk-small */
2529
+ get a11yFootpath() {
2530
+ return this.#a11yFootpath_accessor_storage;
2531
+ }
2532
+ set a11yFootpath(value) {
2533
+ this.#a11yFootpath_accessor_storage = value;
2534
+ }
2535
+ /**
2536
+ * A configured date which acts as the current date instead of the real current date.
2537
+ * Only recommended for testing purposes.
2538
+ */
2539
+ set now(value) {
2540
+ this._now = defaultDateAdapter.getValidDateOrNull(defaultDateAdapter.deserialize(value));
2541
+ }
2542
+ get now() {
2543
+ return this._now ?? /* @__PURE__ */ new Date();
2544
+ }
2545
+ render() {
2546
+ const departure = this.departureTime ? removeTimezoneFromISOTimeString(this.departureTime) : void 0;
2547
+ const arrival = this.arrivalTime ? removeTimezoneFromISOTimeString(this.arrivalTime) : void 0;
2548
+ const { renderDepartureTimeAttribute, renderArrivalTimeAttribute } = getDepartureArrivalTimeAttribute(this.legs, this.departureWalk || 0, this.arrivalWalk || 0, this._language.current, this.a11yFootpath);
2549
+ const rideLegs = this.legs?.filter((leg) => isRideLeg(leg));
2550
+ return html`
2551
+ <div class="sbb-pearl-chain__time">
2552
+ ${renderDepartureTimeAttribute()}
2553
+ ${departure ? html`<time class="sbb-pearl-chain__time-time" datetime=${this.departureTime}>
2554
+ <span class="sbb-screen-reader-only"
2555
+ >${i18nDeparture[this._language.current]}:&nbsp;</span
2556
+ >
2557
+ ${format(departure, "HH:mm")}
2558
+ </time>` : nothing}
2559
+ ${rideLegs?.length > 1 ? html`<span class="sbb-screen-reader-only" role="paragraph">
2560
+ ${rideLegs?.length - 1} ${i18nTransferProcedures[this._language.current]}
2561
+ </span>` : nothing}
2562
+ <sbb-pearl-chain
2563
+ class="sbb-pearl-chain__time-chain"
2564
+ .legs=${this.legs}
2565
+ .disableAnimation=${this.disableAnimation}
2566
+ .now=${this.now}
2567
+ ></sbb-pearl-chain>
2568
+ ${arrival ? html`<time class="sbb-pearl-chain__time-time" datetime=${this.arrivalTime}>
2569
+ <span class="sbb-screen-reader-only"
2570
+ >${i18nArrival[this._language.current]}:&nbsp;</span
2571
+ >
2572
+ ${format(arrival, "HH:mm")}
2573
+ </time>` : nothing}
2574
+ ${renderArrivalTimeAttribute()}
2575
+ </div>
2576
+ `;
2577
+ }
2578
+ };
2579
+ })();
2580
+
2581
+ //#endregion
2582
+ export { SbbPearlChainTimeElement };