@sbb-esta/lyne-elements-experimental 2.11.2 → 3.0.0-next.1

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 (67) hide show
  1. package/core/datetime/date-helper.js +142 -142
  2. package/core/timetable/access-leg-helper.js +52 -49
  3. package/core/timetable/timetable-helper.js +8 -7
  4. package/custom-elements.json +8 -8
  5. package/development/core/datetime/date-helper.js +10 -10
  6. package/development/core/timetable/access-leg-helper.js +15 -12
  7. package/development/core/timetable/timetable-helper.js +7 -6
  8. package/development/{differenceInMinutes-D5Nj8Stc.js → differenceInMinutes-CHSyWiQs.js} +3 -3
  9. package/development/{format-BQfaa1ZT.js → format-D0-yhzi4.js} +26 -22
  10. package/development/{isValid-DvieCZVi.js → isValid-Bo4R7iA7.js} +3 -3
  11. package/development/journey-summary/journey-summary.component.d.ts +5 -3
  12. package/development/journey-summary/journey-summary.component.d.ts.map +1 -1
  13. package/development/journey-summary/journey-summary.component.js +9 -5
  14. package/development/pearl-chain/pearl-chain.component.d.ts +5 -3
  15. package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
  16. package/development/pearl-chain/pearl-chain.component.js +43 -29
  17. package/development/pearl-chain-time/pearl-chain-time.component.d.ts +5 -3
  18. package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -1
  19. package/development/pearl-chain-time/pearl-chain-time.component.js +10 -6
  20. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
  21. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
  22. package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
  23. package/development/seat-reservation/common/mapper/mapper.js +16 -14
  24. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
  25. package/development/seat-reservation/common/svgs.js +1 -1
  26. package/development/seat-reservation/common/translations/i18n.js +3 -2
  27. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +33 -22
  28. package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +7 -6
  29. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +23 -16
  30. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
  31. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +3 -2
  32. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +8 -7
  33. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +11 -7
  34. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +3 -2
  35. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +5 -4
  36. package/development/timetable-duration/timetable-duration.component.js +1 -1
  37. package/development/timetable-row/timetable-row.component.d.ts +5 -3
  38. package/development/timetable-row/timetable-row.component.d.ts.map +1 -1
  39. package/development/timetable-row/timetable-row.component.js +93 -59
  40. package/differenceInMinutes-BMqUZdhj.js +23 -0
  41. package/{format-lqeCzmzS.js → format-Dg8rkk7h.js} +442 -438
  42. package/isValid-DJ69OMZJ.js +45 -0
  43. package/journey-summary/journey-summary.component.d.ts +5 -3
  44. package/journey-summary/journey-summary.component.d.ts.map +1 -1
  45. package/journey-summary/journey-summary.component.js +8 -4
  46. package/package.json +2 -2
  47. package/pearl-chain/pearl-chain.component.d.ts +5 -3
  48. package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
  49. package/pearl-chain/pearl-chain.component.js +99 -79
  50. package/pearl-chain-time/pearl-chain-time.component.d.ts +5 -3
  51. package/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -1
  52. package/pearl-chain-time/pearl-chain-time.component.js +49 -45
  53. package/seat-reservation/common/mapper/mapper.js +54 -50
  54. package/seat-reservation/common/translations/i18n.js +6 -5
  55. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +115 -104
  56. package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +41 -40
  57. package/seat-reservation/seat-reservation/seat-reservation.component.js +87 -78
  58. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +18 -15
  59. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +59 -58
  60. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +75 -71
  61. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +13 -12
  62. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +24 -23
  63. package/timetable-row/timetable-row.component.d.ts +5 -3
  64. package/timetable-row/timetable-row.component.d.ts.map +1 -1
  65. package/timetable-row/timetable-row.component.js +251 -208
  66. package/differenceInMinutes-CP_C5onR.js +0 -23
  67. package/isValid-Ceq2O0NQ.js +0 -45
@@ -1,33 +1,34 @@
1
- import { d as q, i as C } from "./isValid-Ceq2O0NQ.js";
2
- import { t as l, c as y, d as D } from "./toDate-BCXKL_wM.js";
3
- let N = {};
4
- function O() {
5
- return N;
1
+ import { d as X, i as L } from "./isValid-DJ69OMZJ.js";
2
+ import { t as w, c as P, d as C } from "./toDate-BCXKL_wM.js";
3
+ let G = {};
4
+ function S() {
5
+ return G;
6
6
  }
7
- function p(t, e) {
8
- const n = O(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = l(t, e?.in), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
7
+ function x(n, t) {
8
+ var u, c, d, f;
9
+ const e = S(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((f = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = w(n, t == null ? void 0 : t.in), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
9
10
  return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
10
11
  }
11
- function M(t, e) {
12
- return p(t, { ...e, weekStartsOn: 1 });
12
+ function W(n, t) {
13
+ return x(n, { ...t, weekStartsOn: 1 });
13
14
  }
14
- function T(t, e) {
15
- const n = l(t, e?.in), r = n.getFullYear(), a = y(n, 0);
15
+ function N(n, t) {
16
+ const e = w(n, t == null ? void 0 : t.in), r = e.getFullYear(), a = P(e, 0);
16
17
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
17
- const o = M(a), s = y(n, 0);
18
+ const i = W(a), s = P(e, 0);
18
19
  s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
19
- const c = M(s);
20
- return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
20
+ const u = W(s);
21
+ return e.getTime() >= i.getTime() ? r + 1 : e.getTime() >= u.getTime() ? r : r - 1;
21
22
  }
22
- function H(t, e) {
23
- const n = T(t, e), r = y(t, 0);
24
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), M(r);
23
+ function _(n, t) {
24
+ const e = N(n, t), r = P(n, 0);
25
+ return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0), W(r);
25
26
  }
26
- function Q(t, e) {
27
- const n = l(t, e?.in);
28
- return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
27
+ function B(n, t) {
28
+ const e = w(n, t == null ? void 0 : t.in);
29
+ return e.setFullYear(e.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
29
30
  }
30
- const X = {
31
+ const R = {
31
32
  lessThanXSeconds: {
32
33
  one: "less than a second",
33
34
  other: "less than {{count}} seconds"
@@ -89,77 +90,77 @@ const X = {
89
90
  one: "almost 1 year",
90
91
  other: "almost {{count}} years"
91
92
  }
92
- }, L = (t, e, n) => {
93
+ }, A = (n, t, e) => {
93
94
  let r;
94
- const a = X[t];
95
- return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
95
+ const a = R[n];
96
+ return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
96
97
  };
97
- function k(t) {
98
- return (e = {}) => {
99
- const n = e.width ? String(e.width) : t.defaultWidth;
100
- return t.formats[n] || t.formats[t.defaultWidth];
98
+ function D(n) {
99
+ return (t = {}) => {
100
+ const e = t.width ? String(t.width) : n.defaultWidth;
101
+ return n.formats[e] || n.formats[n.defaultWidth];
101
102
  };
102
103
  }
103
- const G = {
104
+ const V = {
104
105
  full: "EEEE, MMMM do, y",
105
106
  long: "MMMM do, y",
106
107
  medium: "MMM d, y",
107
108
  short: "MM/dd/yyyy"
108
- }, _ = {
109
+ }, j = {
109
110
  full: "h:mm:ss a zzzz",
110
111
  long: "h:mm:ss a z",
111
112
  medium: "h:mm:ss a",
112
113
  short: "h:mm a"
113
- }, B = {
114
+ }, I = {
114
115
  full: "{{date}} 'at' {{time}}",
115
116
  long: "{{date}} 'at' {{time}}",
116
117
  medium: "{{date}}, {{time}}",
117
118
  short: "{{date}}, {{time}}"
118
- }, R = {
119
- date: k({
120
- formats: G,
119
+ }, J = {
120
+ date: D({
121
+ formats: V,
121
122
  defaultWidth: "full"
122
123
  }),
123
- time: k({
124
- formats: _,
124
+ time: D({
125
+ formats: j,
125
126
  defaultWidth: "full"
126
127
  }),
127
- dateTime: k({
128
- formats: B,
128
+ dateTime: D({
129
+ formats: I,
129
130
  defaultWidth: "full"
130
131
  })
131
- }, A = {
132
+ }, p = {
132
133
  lastWeek: "'last' eeee 'at' p",
133
134
  yesterday: "'yesterday at' p",
134
135
  today: "'today at' p",
135
136
  tomorrow: "'tomorrow at' p",
136
137
  nextWeek: "eeee 'at' p",
137
138
  other: "P"
138
- }, V = (t, e, n, r) => A[t];
139
- function b(t) {
140
- return (e, n) => {
141
- const r = n?.context ? String(n.context) : "standalone";
139
+ }, $ = (n, t, e, r) => p[n];
140
+ function v(n) {
141
+ return (t, e) => {
142
+ const r = e != null && e.context ? String(e.context) : "standalone";
142
143
  let a;
143
- if (r === "formatting" && t.formattingValues) {
144
- const s = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : s;
145
- a = t.formattingValues[c] || t.formattingValues[s];
144
+ if (r === "formatting" && n.formattingValues) {
145
+ const s = n.defaultFormattingWidth || n.defaultWidth, u = e != null && e.width ? String(e.width) : s;
146
+ a = n.formattingValues[u] || n.formattingValues[s];
146
147
  } else {
147
- const s = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
148
- a = t.values[c] || t.values[s];
148
+ const s = n.defaultWidth, u = e != null && e.width ? String(e.width) : n.defaultWidth;
149
+ a = n.values[u] || n.values[s];
149
150
  }
150
- const o = t.argumentCallback ? t.argumentCallback(e) : e;
151
- return a[o];
151
+ const i = n.argumentCallback ? n.argumentCallback(t) : t;
152
+ return a[i];
152
153
  };
153
154
  }
154
- const j = {
155
+ const K = {
155
156
  narrow: ["B", "A"],
156
157
  abbreviated: ["BC", "AD"],
157
158
  wide: ["Before Christ", "Anno Domini"]
158
- }, I = {
159
+ }, U = {
159
160
  narrow: ["1", "2", "3", "4"],
160
161
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
161
162
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
162
- }, J = {
163
+ }, z = {
163
164
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
164
165
  abbreviated: [
165
166
  "Jan",
@@ -189,7 +190,7 @@ const j = {
189
190
  "November",
190
191
  "December"
191
192
  ]
192
- }, $ = {
193
+ }, Z = {
193
194
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
194
195
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
195
196
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -202,7 +203,7 @@ const j = {
202
203
  "Friday",
203
204
  "Saturday"
204
205
  ]
205
- }, K = {
206
+ }, tt = {
206
207
  narrow: {
207
208
  am: "a",
208
209
  pm: "p",
@@ -233,7 +234,7 @@ const j = {
233
234
  evening: "evening",
234
235
  night: "night"
235
236
  }
236
- }, U = {
237
+ }, et = {
237
238
  narrow: {
238
239
  am: "a",
239
240
  pm: "p",
@@ -264,101 +265,101 @@ const j = {
264
265
  evening: "in the evening",
265
266
  night: "at night"
266
267
  }
267
- }, z = (t, e) => {
268
- const n = Number(t), r = n % 100;
268
+ }, nt = (n, t) => {
269
+ const e = Number(n), r = e % 100;
269
270
  if (r > 20 || r < 10)
270
271
  switch (r % 10) {
271
272
  case 1:
272
- return n + "st";
273
+ return e + "st";
273
274
  case 2:
274
- return n + "nd";
275
+ return e + "nd";
275
276
  case 3:
276
- return n + "rd";
277
+ return e + "rd";
277
278
  }
278
- return n + "th";
279
- }, Z = {
280
- ordinalNumber: z,
281
- era: b({
282
- values: j,
279
+ return e + "th";
280
+ }, rt = {
281
+ ordinalNumber: nt,
282
+ era: v({
283
+ values: K,
283
284
  defaultWidth: "wide"
284
285
  }),
285
- quarter: b({
286
- values: I,
286
+ quarter: v({
287
+ values: U,
287
288
  defaultWidth: "wide",
288
- argumentCallback: (t) => t - 1
289
+ argumentCallback: (n) => n - 1
289
290
  }),
290
- month: b({
291
- values: J,
291
+ month: v({
292
+ values: z,
292
293
  defaultWidth: "wide"
293
294
  }),
294
- day: b({
295
- values: $,
295
+ day: v({
296
+ values: Z,
296
297
  defaultWidth: "wide"
297
298
  }),
298
- dayPeriod: b({
299
- values: K,
299
+ dayPeriod: v({
300
+ values: tt,
300
301
  defaultWidth: "wide",
301
- formattingValues: U,
302
+ formattingValues: et,
302
303
  defaultFormattingWidth: "wide"
303
304
  })
304
305
  };
305
- function P(t) {
306
- return (e, n = {}) => {
307
- const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
308
- if (!o)
306
+ function k(n) {
307
+ return (t, e = {}) => {
308
+ const r = e.width, a = r && n.matchPatterns[r] || n.matchPatterns[n.defaultMatchWidth], i = t.match(a);
309
+ if (!i)
309
310
  return null;
310
- const s = o[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], h = Array.isArray(c) ? et(c, (u) => u.test(s)) : (
311
+ const s = i[0], u = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], c = Array.isArray(u) ? it(u, (l) => l.test(s)) : (
311
312
  // [TODO] -- I challenge you to fix the type
312
- tt(c, (u) => u.test(s))
313
+ at(u, (l) => l.test(s))
313
314
  );
314
- let f;
315
- f = t.valueCallback ? t.valueCallback(h) : h, f = n.valueCallback ? (
315
+ let d;
316
+ d = n.valueCallback ? n.valueCallback(c) : c, d = e.valueCallback ? (
316
317
  // [TODO] -- I challenge you to fix the type
317
- n.valueCallback(f)
318
- ) : f;
319
- const d = e.slice(s.length);
320
- return { value: f, rest: d };
318
+ e.valueCallback(d)
319
+ ) : d;
320
+ const f = t.slice(s.length);
321
+ return { value: d, rest: f };
321
322
  };
322
323
  }
323
- function tt(t, e) {
324
- for (const n in t)
325
- if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
326
- return n;
324
+ function at(n, t) {
325
+ for (const e in n)
326
+ if (Object.prototype.hasOwnProperty.call(n, e) && t(n[e]))
327
+ return e;
327
328
  }
328
- function et(t, e) {
329
- for (let n = 0; n < t.length; n++)
330
- if (e(t[n]))
331
- return n;
329
+ function it(n, t) {
330
+ for (let e = 0; e < n.length; e++)
331
+ if (t(n[e]))
332
+ return e;
332
333
  }
333
- function nt(t) {
334
- return (e, n = {}) => {
335
- const r = e.match(t.matchPattern);
334
+ function ot(n) {
335
+ return (t, e = {}) => {
336
+ const r = t.match(n.matchPattern);
336
337
  if (!r) return null;
337
- const a = r[0], o = e.match(t.parsePattern);
338
- if (!o) return null;
339
- let s = t.valueCallback ? t.valueCallback(o[0]) : o[0];
340
- s = n.valueCallback ? n.valueCallback(s) : s;
341
- const c = e.slice(a.length);
342
- return { value: s, rest: c };
338
+ const a = r[0], i = t.match(n.parsePattern);
339
+ if (!i) return null;
340
+ let s = n.valueCallback ? n.valueCallback(i[0]) : i[0];
341
+ s = e.valueCallback ? e.valueCallback(s) : s;
342
+ const u = t.slice(a.length);
343
+ return { value: s, rest: u };
343
344
  };
344
345
  }
345
- const rt = /^(\d+)(th|st|nd|rd)?/i, at = /\d+/i, ot = {
346
+ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
346
347
  narrow: /^(b|a)/i,
347
348
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
348
349
  wide: /^(before christ|before common era|anno domini|common era)/i
349
- }, it = {
350
+ }, dt = {
350
351
  any: [/^b/i, /^(a|c)/i]
351
- }, st = {
352
+ }, ht = {
352
353
  narrow: /^[1234]/i,
353
354
  abbreviated: /^q[1234]/i,
354
355
  wide: /^[1234](th|st|nd|rd)? quarter/i
355
- }, ut = {
356
+ }, ft = {
356
357
  any: [/1/i, /2/i, /3/i, /4/i]
357
- }, ct = {
358
+ }, mt = {
358
359
  narrow: /^[jfmasond]/i,
359
360
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
360
361
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
361
- }, dt = {
362
+ }, lt = {
362
363
  narrow: [
363
364
  /^j/i,
364
365
  /^f/i,
@@ -387,18 +388,18 @@ const rt = /^(\d+)(th|st|nd|rd)?/i, at = /\d+/i, ot = {
387
388
  /^n/i,
388
389
  /^d/i
389
390
  ]
390
- }, ht = {
391
+ }, gt = {
391
392
  narrow: /^[smtwf]/i,
392
393
  short: /^(su|mo|tu|we|th|fr|sa)/i,
393
394
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
394
395
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
395
- }, ft = {
396
+ }, wt = {
396
397
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
397
398
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
398
- }, mt = {
399
+ }, yt = {
399
400
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
400
401
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
401
- }, lt = {
402
+ }, bt = {
402
403
  any: {
403
404
  am: /^a/i,
404
405
  pm: /^p/i,
@@ -409,184 +410,186 @@ const rt = /^(\d+)(th|st|nd|rd)?/i, at = /\d+/i, ot = {
409
410
  evening: /evening/i,
410
411
  night: /night/i
411
412
  }
412
- }, gt = {
413
- ordinalNumber: nt({
414
- matchPattern: rt,
415
- parsePattern: at,
416
- valueCallback: (t) => parseInt(t, 10)
413
+ }, Pt = {
414
+ ordinalNumber: ot({
415
+ matchPattern: st,
416
+ parsePattern: ut,
417
+ valueCallback: (n) => parseInt(n, 10)
417
418
  }),
418
- era: P({
419
- matchPatterns: ot,
419
+ era: k({
420
+ matchPatterns: ct,
420
421
  defaultMatchWidth: "wide",
421
- parsePatterns: it,
422
+ parsePatterns: dt,
422
423
  defaultParseWidth: "any"
423
424
  }),
424
- quarter: P({
425
- matchPatterns: st,
425
+ quarter: k({
426
+ matchPatterns: ht,
426
427
  defaultMatchWidth: "wide",
427
- parsePatterns: ut,
428
+ parsePatterns: ft,
428
429
  defaultParseWidth: "any",
429
- valueCallback: (t) => t + 1
430
+ valueCallback: (n) => n + 1
430
431
  }),
431
- month: P({
432
- matchPatterns: ct,
432
+ month: k({
433
+ matchPatterns: mt,
433
434
  defaultMatchWidth: "wide",
434
- parsePatterns: dt,
435
+ parsePatterns: lt,
435
436
  defaultParseWidth: "any"
436
437
  }),
437
- day: P({
438
- matchPatterns: ht,
438
+ day: k({
439
+ matchPatterns: gt,
439
440
  defaultMatchWidth: "wide",
440
- parsePatterns: ft,
441
+ parsePatterns: wt,
441
442
  defaultParseWidth: "any"
442
443
  }),
443
- dayPeriod: P({
444
- matchPatterns: mt,
444
+ dayPeriod: k({
445
+ matchPatterns: yt,
445
446
  defaultMatchWidth: "any",
446
- parsePatterns: lt,
447
+ parsePatterns: bt,
447
448
  defaultParseWidth: "any"
448
449
  })
449
- }, wt = {
450
+ }, Mt = {
450
451
  code: "en-US",
451
- formatDistance: L,
452
- formatLong: R,
453
- formatRelative: V,
454
- localize: Z,
455
- match: gt,
452
+ formatDistance: A,
453
+ formatLong: J,
454
+ formatRelative: $,
455
+ localize: rt,
456
+ match: Pt,
456
457
  options: {
457
458
  weekStartsOn: 0,
458
459
  firstWeekContainsDate: 1
459
460
  }
460
461
  };
461
- function yt(t, e) {
462
- const n = l(t, e?.in);
463
- return q(n, Q(n)) + 1;
462
+ function Ot(n, t) {
463
+ const e = w(n, t == null ? void 0 : t.in);
464
+ return X(e, B(e)) + 1;
464
465
  }
465
- function bt(t, e) {
466
- const n = l(t, e?.in), r = +M(n) - +H(n);
467
- return Math.round(r / D) + 1;
466
+ function vt(n, t) {
467
+ const e = w(n, t == null ? void 0 : t.in), r = +W(e) - +_(e);
468
+ return Math.round(r / C) + 1;
468
469
  }
469
- function E(t, e) {
470
- const n = l(t, e?.in), r = n.getFullYear(), a = O(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = y(e?.in || t, 0);
471
- s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
472
- const c = p(s, e), h = y(e?.in || t, 0);
473
- h.setFullYear(r, 0, o), h.setHours(0, 0, 0, 0);
474
- const f = p(h, e);
475
- return +n >= +c ? r + 1 : +n >= +f ? r : r - 1;
470
+ function H(n, t) {
471
+ var f, l, M, O;
472
+ const e = w(n, t == null ? void 0 : t.in), r = e.getFullYear(), a = S(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((O = (M = a.locale) == null ? void 0 : M.options) == null ? void 0 : O.firstWeekContainsDate) ?? 1, s = P((t == null ? void 0 : t.in) || n, 0);
473
+ s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
474
+ const u = x(s, t), c = P((t == null ? void 0 : t.in) || n, 0);
475
+ c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
476
+ const d = x(c, t);
477
+ return +e >= +u ? r + 1 : +e >= +d ? r : r - 1;
476
478
  }
477
- function Pt(t, e) {
478
- const n = O(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = E(t, e), o = y(e?.in || t, 0);
479
- return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), p(o, e);
479
+ function kt(n, t) {
480
+ var u, c, d, f;
481
+ const e = S(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : c.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((f = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, a = H(n, t), i = P((t == null ? void 0 : t.in) || n, 0);
482
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), x(i, t);
480
483
  }
481
- function pt(t, e) {
482
- const n = l(t, e?.in), r = +p(n, e) - +Pt(n, e);
483
- return Math.round(r / D) + 1;
484
+ function xt(n, t) {
485
+ const e = w(n, t == null ? void 0 : t.in), r = +x(e, t) - +kt(e, t);
486
+ return Math.round(r / C) + 1;
484
487
  }
485
- function i(t, e) {
486
- const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
487
- return n + r;
488
+ function o(n, t) {
489
+ const e = n < 0 ? "-" : "", r = Math.abs(n).toString().padStart(t, "0");
490
+ return e + r;
488
491
  }
489
- const m = {
492
+ const g = {
490
493
  // Year
491
- y(t, e) {
492
- const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
493
- return i(e === "yy" ? r % 100 : r, e.length);
494
+ y(n, t) {
495
+ const e = n.getFullYear(), r = e > 0 ? e : 1 - e;
496
+ return o(t === "yy" ? r % 100 : r, t.length);
494
497
  },
495
498
  // Month
496
- M(t, e) {
497
- const n = t.getMonth();
498
- return e === "M" ? String(n + 1) : i(n + 1, 2);
499
+ M(n, t) {
500
+ const e = n.getMonth();
501
+ return t === "M" ? String(e + 1) : o(e + 1, 2);
499
502
  },
500
503
  // Day of the month
501
- d(t, e) {
502
- return i(t.getDate(), e.length);
504
+ d(n, t) {
505
+ return o(n.getDate(), t.length);
503
506
  },
504
507
  // AM or PM
505
- a(t, e) {
506
- const n = t.getHours() / 12 >= 1 ? "pm" : "am";
507
- switch (e) {
508
+ a(n, t) {
509
+ const e = n.getHours() / 12 >= 1 ? "pm" : "am";
510
+ switch (t) {
508
511
  case "a":
509
512
  case "aa":
510
- return n.toUpperCase();
513
+ return e.toUpperCase();
511
514
  case "aaa":
512
- return n;
515
+ return e;
513
516
  case "aaaaa":
514
- return n[0];
517
+ return e[0];
515
518
  case "aaaa":
516
519
  default:
517
- return n === "am" ? "a.m." : "p.m.";
520
+ return e === "am" ? "a.m." : "p.m.";
518
521
  }
519
522
  },
520
523
  // Hour [1-12]
521
- h(t, e) {
522
- return i(t.getHours() % 12 || 12, e.length);
524
+ h(n, t) {
525
+ return o(n.getHours() % 12 || 12, t.length);
523
526
  },
524
527
  // Hour [0-23]
525
- H(t, e) {
526
- return i(t.getHours(), e.length);
528
+ H(n, t) {
529
+ return o(n.getHours(), t.length);
527
530
  },
528
531
  // Minute
529
- m(t, e) {
530
- return i(t.getMinutes(), e.length);
532
+ m(n, t) {
533
+ return o(n.getMinutes(), t.length);
531
534
  },
532
535
  // Second
533
- s(t, e) {
534
- return i(t.getSeconds(), e.length);
536
+ s(n, t) {
537
+ return o(n.getSeconds(), t.length);
535
538
  },
536
539
  // Fraction of second
537
- S(t, e) {
538
- const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
539
- r * Math.pow(10, n - 3)
540
+ S(n, t) {
541
+ const e = t.length, r = n.getMilliseconds(), a = Math.trunc(
542
+ r * Math.pow(10, e - 3)
540
543
  );
541
- return i(a, e.length);
544
+ return o(a, t.length);
542
545
  }
543
- }, w = {
546
+ }, b = {
544
547
  midnight: "midnight",
545
548
  noon: "noon",
546
549
  morning: "morning",
547
550
  afternoon: "afternoon",
548
551
  evening: "evening",
549
552
  night: "night"
550
- }, x = {
553
+ }, T = {
551
554
  // Era
552
- G: function(t, e, n) {
553
- const r = t.getFullYear() > 0 ? 1 : 0;
554
- switch (e) {
555
+ G: function(n, t, e) {
556
+ const r = n.getFullYear() > 0 ? 1 : 0;
557
+ switch (t) {
555
558
  // AD, BC
556
559
  case "G":
557
560
  case "GG":
558
561
  case "GGG":
559
- return n.era(r, { width: "abbreviated" });
562
+ return e.era(r, { width: "abbreviated" });
560
563
  // A, B
561
564
  case "GGGGG":
562
- return n.era(r, { width: "narrow" });
565
+ return e.era(r, { width: "narrow" });
563
566
  // Anno Domini, Before Christ
564
567
  case "GGGG":
565
568
  default:
566
- return n.era(r, { width: "wide" });
569
+ return e.era(r, { width: "wide" });
567
570
  }
568
571
  },
569
572
  // Year
570
- y: function(t, e, n) {
571
- if (e === "yo") {
572
- const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
573
- return n.ordinalNumber(a, { unit: "year" });
573
+ y: function(n, t, e) {
574
+ if (t === "yo") {
575
+ const r = n.getFullYear(), a = r > 0 ? r : 1 - r;
576
+ return e.ordinalNumber(a, { unit: "year" });
574
577
  }
575
- return m.y(t, e);
578
+ return g.y(n, t);
576
579
  },
577
580
  // Local week-numbering year
578
- Y: function(t, e, n, r) {
579
- const a = E(t, r), o = a > 0 ? a : 1 - a;
580
- if (e === "YY") {
581
- const s = o % 100;
582
- return i(s, 2);
581
+ Y: function(n, t, e, r) {
582
+ const a = H(n, r), i = a > 0 ? a : 1 - a;
583
+ if (t === "YY") {
584
+ const s = i % 100;
585
+ return o(s, 2);
583
586
  }
584
- return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : i(o, e.length);
587
+ return t === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : o(i, t.length);
585
588
  },
586
589
  // ISO week-numbering year
587
- R: function(t, e) {
588
- const n = T(t);
589
- return i(n, e.length);
590
+ R: function(n, t) {
591
+ const e = N(n);
592
+ return o(e, t.length);
590
593
  },
591
594
  // Extended year. This is a single number designating the year of this calendar system.
592
595
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -597,438 +600,438 @@ const m = {
597
600
  // | BC 2 | 2 | -1 |
598
601
  // Also `yy` always returns the last two digits of a year,
599
602
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
600
- u: function(t, e) {
601
- const n = t.getFullYear();
602
- return i(n, e.length);
603
+ u: function(n, t) {
604
+ const e = n.getFullYear();
605
+ return o(e, t.length);
603
606
  },
604
607
  // Quarter
605
- Q: function(t, e, n) {
606
- const r = Math.ceil((t.getMonth() + 1) / 3);
607
- switch (e) {
608
+ Q: function(n, t, e) {
609
+ const r = Math.ceil((n.getMonth() + 1) / 3);
610
+ switch (t) {
608
611
  // 1, 2, 3, 4
609
612
  case "Q":
610
613
  return String(r);
611
614
  // 01, 02, 03, 04
612
615
  case "QQ":
613
- return i(r, 2);
616
+ return o(r, 2);
614
617
  // 1st, 2nd, 3rd, 4th
615
618
  case "Qo":
616
- return n.ordinalNumber(r, { unit: "quarter" });
619
+ return e.ordinalNumber(r, { unit: "quarter" });
617
620
  // Q1, Q2, Q3, Q4
618
621
  case "QQQ":
619
- return n.quarter(r, {
622
+ return e.quarter(r, {
620
623
  width: "abbreviated",
621
624
  context: "formatting"
622
625
  });
623
626
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
624
627
  case "QQQQQ":
625
- return n.quarter(r, {
628
+ return e.quarter(r, {
626
629
  width: "narrow",
627
630
  context: "formatting"
628
631
  });
629
632
  // 1st quarter, 2nd quarter, ...
630
633
  case "QQQQ":
631
634
  default:
632
- return n.quarter(r, {
635
+ return e.quarter(r, {
633
636
  width: "wide",
634
637
  context: "formatting"
635
638
  });
636
639
  }
637
640
  },
638
641
  // Stand-alone quarter
639
- q: function(t, e, n) {
640
- const r = Math.ceil((t.getMonth() + 1) / 3);
641
- switch (e) {
642
+ q: function(n, t, e) {
643
+ const r = Math.ceil((n.getMonth() + 1) / 3);
644
+ switch (t) {
642
645
  // 1, 2, 3, 4
643
646
  case "q":
644
647
  return String(r);
645
648
  // 01, 02, 03, 04
646
649
  case "qq":
647
- return i(r, 2);
650
+ return o(r, 2);
648
651
  // 1st, 2nd, 3rd, 4th
649
652
  case "qo":
650
- return n.ordinalNumber(r, { unit: "quarter" });
653
+ return e.ordinalNumber(r, { unit: "quarter" });
651
654
  // Q1, Q2, Q3, Q4
652
655
  case "qqq":
653
- return n.quarter(r, {
656
+ return e.quarter(r, {
654
657
  width: "abbreviated",
655
658
  context: "standalone"
656
659
  });
657
660
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
658
661
  case "qqqqq":
659
- return n.quarter(r, {
662
+ return e.quarter(r, {
660
663
  width: "narrow",
661
664
  context: "standalone"
662
665
  });
663
666
  // 1st quarter, 2nd quarter, ...
664
667
  case "qqqq":
665
668
  default:
666
- return n.quarter(r, {
669
+ return e.quarter(r, {
667
670
  width: "wide",
668
671
  context: "standalone"
669
672
  });
670
673
  }
671
674
  },
672
675
  // Month
673
- M: function(t, e, n) {
674
- const r = t.getMonth();
675
- switch (e) {
676
+ M: function(n, t, e) {
677
+ const r = n.getMonth();
678
+ switch (t) {
676
679
  case "M":
677
680
  case "MM":
678
- return m.M(t, e);
681
+ return g.M(n, t);
679
682
  // 1st, 2nd, ..., 12th
680
683
  case "Mo":
681
- return n.ordinalNumber(r + 1, { unit: "month" });
684
+ return e.ordinalNumber(r + 1, { unit: "month" });
682
685
  // Jan, Feb, ..., Dec
683
686
  case "MMM":
684
- return n.month(r, {
687
+ return e.month(r, {
685
688
  width: "abbreviated",
686
689
  context: "formatting"
687
690
  });
688
691
  // J, F, ..., D
689
692
  case "MMMMM":
690
- return n.month(r, {
693
+ return e.month(r, {
691
694
  width: "narrow",
692
695
  context: "formatting"
693
696
  });
694
697
  // January, February, ..., December
695
698
  case "MMMM":
696
699
  default:
697
- return n.month(r, { width: "wide", context: "formatting" });
700
+ return e.month(r, { width: "wide", context: "formatting" });
698
701
  }
699
702
  },
700
703
  // Stand-alone month
701
- L: function(t, e, n) {
702
- const r = t.getMonth();
703
- switch (e) {
704
+ L: function(n, t, e) {
705
+ const r = n.getMonth();
706
+ switch (t) {
704
707
  // 1, 2, ..., 12
705
708
  case "L":
706
709
  return String(r + 1);
707
710
  // 01, 02, ..., 12
708
711
  case "LL":
709
- return i(r + 1, 2);
712
+ return o(r + 1, 2);
710
713
  // 1st, 2nd, ..., 12th
711
714
  case "Lo":
712
- return n.ordinalNumber(r + 1, { unit: "month" });
715
+ return e.ordinalNumber(r + 1, { unit: "month" });
713
716
  // Jan, Feb, ..., Dec
714
717
  case "LLL":
715
- return n.month(r, {
718
+ return e.month(r, {
716
719
  width: "abbreviated",
717
720
  context: "standalone"
718
721
  });
719
722
  // J, F, ..., D
720
723
  case "LLLLL":
721
- return n.month(r, {
724
+ return e.month(r, {
722
725
  width: "narrow",
723
726
  context: "standalone"
724
727
  });
725
728
  // January, February, ..., December
726
729
  case "LLLL":
727
730
  default:
728
- return n.month(r, { width: "wide", context: "standalone" });
731
+ return e.month(r, { width: "wide", context: "standalone" });
729
732
  }
730
733
  },
731
734
  // Local week of year
732
- w: function(t, e, n, r) {
733
- const a = pt(t, r);
734
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : i(a, e.length);
735
+ w: function(n, t, e, r) {
736
+ const a = xt(n, r);
737
+ return t === "wo" ? e.ordinalNumber(a, { unit: "week" }) : o(a, t.length);
735
738
  },
736
739
  // ISO week of year
737
- I: function(t, e, n) {
738
- const r = bt(t);
739
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : i(r, e.length);
740
+ I: function(n, t, e) {
741
+ const r = vt(n);
742
+ return t === "Io" ? e.ordinalNumber(r, { unit: "week" }) : o(r, t.length);
740
743
  },
741
744
  // Day of the month
742
- d: function(t, e, n) {
743
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : m.d(t, e);
745
+ d: function(n, t, e) {
746
+ return t === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : g.d(n, t);
744
747
  },
745
748
  // Day of year
746
- D: function(t, e, n) {
747
- const r = yt(t);
748
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : i(r, e.length);
749
+ D: function(n, t, e) {
750
+ const r = Ot(n);
751
+ return t === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, t.length);
749
752
  },
750
753
  // Day of week
751
- E: function(t, e, n) {
752
- const r = t.getDay();
753
- switch (e) {
754
+ E: function(n, t, e) {
755
+ const r = n.getDay();
756
+ switch (t) {
754
757
  // Tue
755
758
  case "E":
756
759
  case "EE":
757
760
  case "EEE":
758
- return n.day(r, {
761
+ return e.day(r, {
759
762
  width: "abbreviated",
760
763
  context: "formatting"
761
764
  });
762
765
  // T
763
766
  case "EEEEE":
764
- return n.day(r, {
767
+ return e.day(r, {
765
768
  width: "narrow",
766
769
  context: "formatting"
767
770
  });
768
771
  // Tu
769
772
  case "EEEEEE":
770
- return n.day(r, {
773
+ return e.day(r, {
771
774
  width: "short",
772
775
  context: "formatting"
773
776
  });
774
777
  // Tuesday
775
778
  case "EEEE":
776
779
  default:
777
- return n.day(r, {
780
+ return e.day(r, {
778
781
  width: "wide",
779
782
  context: "formatting"
780
783
  });
781
784
  }
782
785
  },
783
786
  // Local day of week
784
- e: function(t, e, n, r) {
785
- const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
786
- switch (e) {
787
+ e: function(n, t, e, r) {
788
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
789
+ switch (t) {
787
790
  // Numerical value (Nth day of week with current locale or weekStartsOn)
788
791
  case "e":
789
- return String(o);
792
+ return String(i);
790
793
  // Padded numerical value
791
794
  case "ee":
792
- return i(o, 2);
795
+ return o(i, 2);
793
796
  // 1st, 2nd, ..., 7th
794
797
  case "eo":
795
- return n.ordinalNumber(o, { unit: "day" });
798
+ return e.ordinalNumber(i, { unit: "day" });
796
799
  case "eee":
797
- return n.day(a, {
800
+ return e.day(a, {
798
801
  width: "abbreviated",
799
802
  context: "formatting"
800
803
  });
801
804
  // T
802
805
  case "eeeee":
803
- return n.day(a, {
806
+ return e.day(a, {
804
807
  width: "narrow",
805
808
  context: "formatting"
806
809
  });
807
810
  // Tu
808
811
  case "eeeeee":
809
- return n.day(a, {
812
+ return e.day(a, {
810
813
  width: "short",
811
814
  context: "formatting"
812
815
  });
813
816
  // Tuesday
814
817
  case "eeee":
815
818
  default:
816
- return n.day(a, {
819
+ return e.day(a, {
817
820
  width: "wide",
818
821
  context: "formatting"
819
822
  });
820
823
  }
821
824
  },
822
825
  // Stand-alone local day of week
823
- c: function(t, e, n, r) {
824
- const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
825
- switch (e) {
826
+ c: function(n, t, e, r) {
827
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
828
+ switch (t) {
826
829
  // Numerical value (same as in `e`)
827
830
  case "c":
828
- return String(o);
831
+ return String(i);
829
832
  // Padded numerical value
830
833
  case "cc":
831
- return i(o, e.length);
834
+ return o(i, t.length);
832
835
  // 1st, 2nd, ..., 7th
833
836
  case "co":
834
- return n.ordinalNumber(o, { unit: "day" });
837
+ return e.ordinalNumber(i, { unit: "day" });
835
838
  case "ccc":
836
- return n.day(a, {
839
+ return e.day(a, {
837
840
  width: "abbreviated",
838
841
  context: "standalone"
839
842
  });
840
843
  // T
841
844
  case "ccccc":
842
- return n.day(a, {
845
+ return e.day(a, {
843
846
  width: "narrow",
844
847
  context: "standalone"
845
848
  });
846
849
  // Tu
847
850
  case "cccccc":
848
- return n.day(a, {
851
+ return e.day(a, {
849
852
  width: "short",
850
853
  context: "standalone"
851
854
  });
852
855
  // Tuesday
853
856
  case "cccc":
854
857
  default:
855
- return n.day(a, {
858
+ return e.day(a, {
856
859
  width: "wide",
857
860
  context: "standalone"
858
861
  });
859
862
  }
860
863
  },
861
864
  // ISO day of week
862
- i: function(t, e, n) {
863
- const r = t.getDay(), a = r === 0 ? 7 : r;
864
- switch (e) {
865
+ i: function(n, t, e) {
866
+ const r = n.getDay(), a = r === 0 ? 7 : r;
867
+ switch (t) {
865
868
  // 2
866
869
  case "i":
867
870
  return String(a);
868
871
  // 02
869
872
  case "ii":
870
- return i(a, e.length);
873
+ return o(a, t.length);
871
874
  // 2nd
872
875
  case "io":
873
- return n.ordinalNumber(a, { unit: "day" });
876
+ return e.ordinalNumber(a, { unit: "day" });
874
877
  // Tue
875
878
  case "iii":
876
- return n.day(r, {
879
+ return e.day(r, {
877
880
  width: "abbreviated",
878
881
  context: "formatting"
879
882
  });
880
883
  // T
881
884
  case "iiiii":
882
- return n.day(r, {
885
+ return e.day(r, {
883
886
  width: "narrow",
884
887
  context: "formatting"
885
888
  });
886
889
  // Tu
887
890
  case "iiiiii":
888
- return n.day(r, {
891
+ return e.day(r, {
889
892
  width: "short",
890
893
  context: "formatting"
891
894
  });
892
895
  // Tuesday
893
896
  case "iiii":
894
897
  default:
895
- return n.day(r, {
898
+ return e.day(r, {
896
899
  width: "wide",
897
900
  context: "formatting"
898
901
  });
899
902
  }
900
903
  },
901
904
  // AM or PM
902
- a: function(t, e, n) {
903
- const a = t.getHours() / 12 >= 1 ? "pm" : "am";
904
- switch (e) {
905
+ a: function(n, t, e) {
906
+ const a = n.getHours() / 12 >= 1 ? "pm" : "am";
907
+ switch (t) {
905
908
  case "a":
906
909
  case "aa":
907
- return n.dayPeriod(a, {
910
+ return e.dayPeriod(a, {
908
911
  width: "abbreviated",
909
912
  context: "formatting"
910
913
  });
911
914
  case "aaa":
912
- return n.dayPeriod(a, {
915
+ return e.dayPeriod(a, {
913
916
  width: "abbreviated",
914
917
  context: "formatting"
915
918
  }).toLowerCase();
916
919
  case "aaaaa":
917
- return n.dayPeriod(a, {
920
+ return e.dayPeriod(a, {
918
921
  width: "narrow",
919
922
  context: "formatting"
920
923
  });
921
924
  case "aaaa":
922
925
  default:
923
- return n.dayPeriod(a, {
926
+ return e.dayPeriod(a, {
924
927
  width: "wide",
925
928
  context: "formatting"
926
929
  });
927
930
  }
928
931
  },
929
932
  // AM, PM, midnight, noon
930
- b: function(t, e, n) {
931
- const r = t.getHours();
933
+ b: function(n, t, e) {
934
+ const r = n.getHours();
932
935
  let a;
933
- switch (r === 12 ? a = w.noon : r === 0 ? a = w.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
936
+ switch (r === 12 ? a = b.noon : r === 0 ? a = b.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
934
937
  case "b":
935
938
  case "bb":
936
- return n.dayPeriod(a, {
939
+ return e.dayPeriod(a, {
937
940
  width: "abbreviated",
938
941
  context: "formatting"
939
942
  });
940
943
  case "bbb":
941
- return n.dayPeriod(a, {
944
+ return e.dayPeriod(a, {
942
945
  width: "abbreviated",
943
946
  context: "formatting"
944
947
  }).toLowerCase();
945
948
  case "bbbbb":
946
- return n.dayPeriod(a, {
949
+ return e.dayPeriod(a, {
947
950
  width: "narrow",
948
951
  context: "formatting"
949
952
  });
950
953
  case "bbbb":
951
954
  default:
952
- return n.dayPeriod(a, {
955
+ return e.dayPeriod(a, {
953
956
  width: "wide",
954
957
  context: "formatting"
955
958
  });
956
959
  }
957
960
  },
958
961
  // in the morning, in the afternoon, in the evening, at night
959
- B: function(t, e, n) {
960
- const r = t.getHours();
962
+ B: function(n, t, e) {
963
+ const r = n.getHours();
961
964
  let a;
962
- switch (r >= 17 ? a = w.evening : r >= 12 ? a = w.afternoon : r >= 4 ? a = w.morning : a = w.night, e) {
965
+ switch (r >= 17 ? a = b.evening : r >= 12 ? a = b.afternoon : r >= 4 ? a = b.morning : a = b.night, t) {
963
966
  case "B":
964
967
  case "BB":
965
968
  case "BBB":
966
- return n.dayPeriod(a, {
969
+ return e.dayPeriod(a, {
967
970
  width: "abbreviated",
968
971
  context: "formatting"
969
972
  });
970
973
  case "BBBBB":
971
- return n.dayPeriod(a, {
974
+ return e.dayPeriod(a, {
972
975
  width: "narrow",
973
976
  context: "formatting"
974
977
  });
975
978
  case "BBBB":
976
979
  default:
977
- return n.dayPeriod(a, {
980
+ return e.dayPeriod(a, {
978
981
  width: "wide",
979
982
  context: "formatting"
980
983
  });
981
984
  }
982
985
  },
983
986
  // Hour [1-12]
984
- h: function(t, e, n) {
985
- if (e === "ho") {
986
- let r = t.getHours() % 12;
987
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
987
+ h: function(n, t, e) {
988
+ if (t === "ho") {
989
+ let r = n.getHours() % 12;
990
+ return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
988
991
  }
989
- return m.h(t, e);
992
+ return g.h(n, t);
990
993
  },
991
994
  // Hour [0-23]
992
- H: function(t, e, n) {
993
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : m.H(t, e);
995
+ H: function(n, t, e) {
996
+ return t === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : g.H(n, t);
994
997
  },
995
998
  // Hour [0-11]
996
- K: function(t, e, n) {
997
- const r = t.getHours() % 12;
998
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : i(r, e.length);
999
+ K: function(n, t, e) {
1000
+ const r = n.getHours() % 12;
1001
+ return t === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : o(r, t.length);
999
1002
  },
1000
1003
  // Hour [1-24]
1001
- k: function(t, e, n) {
1002
- let r = t.getHours();
1003
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : i(r, e.length);
1004
+ k: function(n, t, e) {
1005
+ let r = n.getHours();
1006
+ return r === 0 && (r = 24), t === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : o(r, t.length);
1004
1007
  },
1005
1008
  // Minute
1006
- m: function(t, e, n) {
1007
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : m.m(t, e);
1009
+ m: function(n, t, e) {
1010
+ return t === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : g.m(n, t);
1008
1011
  },
1009
1012
  // Second
1010
- s: function(t, e, n) {
1011
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : m.s(t, e);
1013
+ s: function(n, t, e) {
1014
+ return t === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : g.s(n, t);
1012
1015
  },
1013
1016
  // Fraction of second
1014
- S: function(t, e) {
1015
- return m.S(t, e);
1017
+ S: function(n, t) {
1018
+ return g.S(n, t);
1016
1019
  },
1017
1020
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1018
- X: function(t, e, n) {
1019
- const r = t.getTimezoneOffset();
1021
+ X: function(n, t, e) {
1022
+ const r = n.getTimezoneOffset();
1020
1023
  if (r === 0)
1021
1024
  return "Z";
1022
- switch (e) {
1025
+ switch (t) {
1023
1026
  // Hours and optional minutes
1024
1027
  case "X":
1025
- return S(r);
1028
+ return F(r);
1026
1029
  // Hours, minutes and optional seconds without `:` delimiter
1027
1030
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1028
1031
  // so this token always has the same output as `XX`
1029
1032
  case "XXXX":
1030
1033
  case "XX":
1031
- return g(r);
1034
+ return y(r);
1032
1035
  // Hours, minutes and optional seconds with `:` delimiter
1033
1036
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1034
1037
  // so this token always has the same output as `XXX`
@@ -1036,22 +1039,22 @@ const m = {
1036
1039
  case "XXX":
1037
1040
  // Hours and minutes with `:` delimiter
1038
1041
  default:
1039
- return g(r, ":");
1042
+ return y(r, ":");
1040
1043
  }
1041
1044
  },
1042
1045
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1043
- x: function(t, e, n) {
1044
- const r = t.getTimezoneOffset();
1045
- switch (e) {
1046
+ x: function(n, t, e) {
1047
+ const r = n.getTimezoneOffset();
1048
+ switch (t) {
1046
1049
  // Hours and optional minutes
1047
1050
  case "x":
1048
- return S(r);
1051
+ return F(r);
1049
1052
  // Hours, minutes and optional seconds without `:` delimiter
1050
1053
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1051
1054
  // so this token always has the same output as `xx`
1052
1055
  case "xxxx":
1053
1056
  case "xx":
1054
- return g(r);
1057
+ return y(r);
1055
1058
  // Hours, minutes and optional seconds with `:` delimiter
1056
1059
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1057
1060
  // so this token always has the same output as `xxx`
@@ -1059,167 +1062,168 @@ const m = {
1059
1062
  case "xxx":
1060
1063
  // Hours and minutes with `:` delimiter
1061
1064
  default:
1062
- return g(r, ":");
1065
+ return y(r, ":");
1063
1066
  }
1064
1067
  },
1065
1068
  // Timezone (GMT)
1066
- O: function(t, e, n) {
1067
- const r = t.getTimezoneOffset();
1068
- switch (e) {
1069
+ O: function(n, t, e) {
1070
+ const r = n.getTimezoneOffset();
1071
+ switch (t) {
1069
1072
  // Short
1070
1073
  case "O":
1071
1074
  case "OO":
1072
1075
  case "OOO":
1073
- return "GMT" + W(r, ":");
1076
+ return "GMT" + E(r, ":");
1074
1077
  // Long
1075
1078
  case "OOOO":
1076
1079
  default:
1077
- return "GMT" + g(r, ":");
1080
+ return "GMT" + y(r, ":");
1078
1081
  }
1079
1082
  },
1080
1083
  // Timezone (specific non-location)
1081
- z: function(t, e, n) {
1082
- const r = t.getTimezoneOffset();
1083
- switch (e) {
1084
+ z: function(n, t, e) {
1085
+ const r = n.getTimezoneOffset();
1086
+ switch (t) {
1084
1087
  // Short
1085
1088
  case "z":
1086
1089
  case "zz":
1087
1090
  case "zzz":
1088
- return "GMT" + W(r, ":");
1091
+ return "GMT" + E(r, ":");
1089
1092
  // Long
1090
1093
  case "zzzz":
1091
1094
  default:
1092
- return "GMT" + g(r, ":");
1095
+ return "GMT" + y(r, ":");
1093
1096
  }
1094
1097
  },
1095
1098
  // Seconds timestamp
1096
- t: function(t, e, n) {
1097
- const r = Math.trunc(+t / 1e3);
1098
- return i(r, e.length);
1099
+ t: function(n, t, e) {
1100
+ const r = Math.trunc(+n / 1e3);
1101
+ return o(r, t.length);
1099
1102
  },
1100
1103
  // Milliseconds timestamp
1101
- T: function(t, e, n) {
1102
- return i(+t, e.length);
1104
+ T: function(n, t, e) {
1105
+ return o(+n, t.length);
1103
1106
  }
1104
1107
  };
1105
- function W(t, e = "") {
1106
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
1107
- return o === 0 ? n + String(a) : n + String(a) + e + i(o, 2);
1108
+ function E(n, t = "") {
1109
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = Math.trunc(r / 60), i = r % 60;
1110
+ return i === 0 ? e + String(a) : e + String(a) + t + o(i, 2);
1108
1111
  }
1109
- function S(t, e) {
1110
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + i(Math.abs(t) / 60, 2) : g(t, e);
1112
+ function F(n, t) {
1113
+ return n % 60 === 0 ? (n > 0 ? "-" : "+") + o(Math.abs(n) / 60, 2) : y(n, t);
1111
1114
  }
1112
- function g(t, e = "") {
1113
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = i(Math.trunc(r / 60), 2), o = i(r % 60, 2);
1114
- return n + a + e + o;
1115
+ function y(n, t = "") {
1116
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
1117
+ return e + a + t + i;
1115
1118
  }
1116
- const Y = (t, e) => {
1117
- switch (t) {
1119
+ const q = (n, t) => {
1120
+ switch (n) {
1118
1121
  case "P":
1119
- return e.date({ width: "short" });
1122
+ return t.date({ width: "short" });
1120
1123
  case "PP":
1121
- return e.date({ width: "medium" });
1124
+ return t.date({ width: "medium" });
1122
1125
  case "PPP":
1123
- return e.date({ width: "long" });
1126
+ return t.date({ width: "long" });
1124
1127
  case "PPPP":
1125
1128
  default:
1126
- return e.date({ width: "full" });
1129
+ return t.date({ width: "full" });
1127
1130
  }
1128
- }, F = (t, e) => {
1129
- switch (t) {
1131
+ }, Q = (n, t) => {
1132
+ switch (n) {
1130
1133
  case "p":
1131
- return e.time({ width: "short" });
1134
+ return t.time({ width: "short" });
1132
1135
  case "pp":
1133
- return e.time({ width: "medium" });
1136
+ return t.time({ width: "medium" });
1134
1137
  case "ppp":
1135
- return e.time({ width: "long" });
1138
+ return t.time({ width: "long" });
1136
1139
  case "pppp":
1137
1140
  default:
1138
- return e.time({ width: "full" });
1141
+ return t.time({ width: "full" });
1139
1142
  }
1140
- }, Mt = (t, e) => {
1141
- const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1143
+ }, Wt = (n, t) => {
1144
+ const e = n.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
1142
1145
  if (!a)
1143
- return Y(t, e);
1144
- let o;
1146
+ return q(n, t);
1147
+ let i;
1145
1148
  switch (r) {
1146
1149
  case "P":
1147
- o = e.dateTime({ width: "short" });
1150
+ i = t.dateTime({ width: "short" });
1148
1151
  break;
1149
1152
  case "PP":
1150
- o = e.dateTime({ width: "medium" });
1153
+ i = t.dateTime({ width: "medium" });
1151
1154
  break;
1152
1155
  case "PPP":
1153
- o = e.dateTime({ width: "long" });
1156
+ i = t.dateTime({ width: "long" });
1154
1157
  break;
1155
1158
  case "PPPP":
1156
1159
  default:
1157
- o = e.dateTime({ width: "full" });
1160
+ i = t.dateTime({ width: "full" });
1158
1161
  break;
1159
1162
  }
1160
- return o.replace("{{date}}", Y(r, e)).replace("{{time}}", F(a, e));
1161
- }, Ot = {
1162
- p: F,
1163
- P: Mt
1164
- }, vt = /^D+$/, kt = /^Y+$/, xt = ["D", "DD", "YY", "YYYY"];
1165
- function Wt(t) {
1166
- return vt.test(t);
1163
+ return i.replace("{{date}}", q(r, t)).replace("{{time}}", Q(a, t));
1164
+ }, St = {
1165
+ p: Q,
1166
+ P: Wt
1167
+ }, Yt = /^D+$/, Dt = /^Y+$/, Tt = ["D", "DD", "YY", "YYYY"];
1168
+ function Et(n) {
1169
+ return Yt.test(n);
1167
1170
  }
1168
- function St(t) {
1169
- return kt.test(t);
1171
+ function Ft(n) {
1172
+ return Dt.test(n);
1170
1173
  }
1171
- function Yt(t, e, n) {
1172
- const r = Dt(t, e, n);
1173
- if (console.warn(r), xt.includes(t)) throw new RangeError(r);
1174
+ function qt(n, t, e) {
1175
+ const r = Ct(n, t, e);
1176
+ if (console.warn(r), Tt.includes(n)) throw new RangeError(r);
1174
1177
  }
1175
- function Dt(t, e, n) {
1176
- const r = t[0] === "Y" ? "years" : "days of the month";
1177
- return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1178
+ function Ct(n, t, e) {
1179
+ const r = n[0] === "Y" ? "years" : "days of the month";
1180
+ return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1178
1181
  }
1179
- const Tt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Et = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ft = /^'([^]*?)'?$/, qt = /''/g, Ct = /[a-zA-Z]/;
1180
- function Xt(t, e, n) {
1181
- const r = O(), a = r.locale ?? wt, o = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = l(t, n?.in);
1182
- if (!C(c))
1182
+ const Nt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ht = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qt = /^'([^]*?)'?$/, Xt = /''/g, Lt = /[a-zA-Z]/;
1183
+ function Rt(n, t, e) {
1184
+ var f, l, M, O;
1185
+ const r = S(), a = r.locale ?? Mt, i = r.firstWeekContainsDate ?? ((l = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, s = r.weekStartsOn ?? ((O = (M = r.locale) == null ? void 0 : M.options) == null ? void 0 : O.weekStartsOn) ?? 0, u = w(n, e == null ? void 0 : e.in);
1186
+ if (!L(u))
1183
1187
  throw new RangeError("Invalid time value");
1184
- let h = e.match(Et).map((d) => {
1185
- const u = d[0];
1186
- if (u === "p" || u === "P") {
1187
- const v = Ot[u];
1188
- return v(d, a.formatLong);
1188
+ let c = t.match(Ht).map((m) => {
1189
+ const h = m[0];
1190
+ if (h === "p" || h === "P") {
1191
+ const Y = St[h];
1192
+ return Y(m, a.formatLong);
1189
1193
  }
1190
- return d;
1191
- }).join("").match(Tt).map((d) => {
1192
- if (d === "''")
1194
+ return m;
1195
+ }).join("").match(Nt).map((m) => {
1196
+ if (m === "''")
1193
1197
  return { isToken: !1, value: "'" };
1194
- const u = d[0];
1195
- if (u === "'")
1196
- return { isToken: !1, value: Nt(d) };
1197
- if (x[u])
1198
- return { isToken: !0, value: d };
1199
- if (u.match(Ct))
1198
+ const h = m[0];
1199
+ if (h === "'")
1200
+ return { isToken: !1, value: Gt(m) };
1201
+ if (T[h])
1202
+ return { isToken: !0, value: m };
1203
+ if (h.match(Lt))
1200
1204
  throw new RangeError(
1201
- "Format string contains an unescaped latin alphabet character `" + u + "`"
1205
+ "Format string contains an unescaped latin alphabet character `" + h + "`"
1202
1206
  );
1203
- return { isToken: !1, value: d };
1207
+ return { isToken: !1, value: m };
1204
1208
  });
1205
- a.localize.preprocessor && (h = a.localize.preprocessor(c, h));
1206
- const f = {
1207
- firstWeekContainsDate: o,
1209
+ a.localize.preprocessor && (c = a.localize.preprocessor(u, c));
1210
+ const d = {
1211
+ firstWeekContainsDate: i,
1208
1212
  weekStartsOn: s,
1209
1213
  locale: a
1210
1214
  };
1211
- return h.map((d) => {
1212
- if (!d.isToken) return d.value;
1213
- const u = d.value;
1214
- (St(u) || Wt(u)) && Yt(u, e, String(t));
1215
- const v = x[u[0]];
1216
- return v(c, u, a.localize, f);
1215
+ return c.map((m) => {
1216
+ if (!m.isToken) return m.value;
1217
+ const h = m.value;
1218
+ (Ft(h) || Et(h)) && qt(h, t, String(n));
1219
+ const Y = T[h[0]];
1220
+ return Y(u, h, a.localize, d);
1217
1221
  }).join("");
1218
1222
  }
1219
- function Nt(t) {
1220
- const e = t.match(Ft);
1221
- return e ? e[1].replace(qt, "'") : t;
1223
+ function Gt(n) {
1224
+ const t = n.match(Qt);
1225
+ return t ? t[1].replace(Xt, "'") : n;
1222
1226
  }
1223
1227
  export {
1224
- Xt as f
1228
+ Rt as f
1225
1229
  };