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