@sbb-esta/lyne-elements-experimental 1.9.0 → 1.11.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 (52) hide show
  1. package/core/datetime.js +116 -105
  2. package/core/timetable/access-leg-helper.d.ts +2 -1
  3. package/core/timetable/access-leg-helper.d.ts.map +1 -1
  4. package/core/timetable.js +111 -76
  5. package/custom-elements.json +44 -0
  6. package/development/core/datetime.js +53 -51
  7. package/development/core/timetable/access-leg-helper.d.ts +2 -1
  8. package/development/core/timetable/access-leg-helper.d.ts.map +1 -1
  9. package/development/core/timetable.js +57 -22
  10. package/development/differenceInMinutes-Cmyza6nm.js +26 -0
  11. package/development/format-DTy5_IOt.js +1371 -0
  12. package/development/isValid-DO_pHwcW.js +53 -0
  13. package/development/journey-summary.js +4 -17
  14. package/development/pearl-chain/pearl-chain.sample-data.d.ts +1 -0
  15. package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -1
  16. package/development/pearl-chain-time/pearl-chain-time.d.ts +2 -0
  17. package/development/pearl-chain-time/pearl-chain-time.d.ts.map +1 -1
  18. package/development/pearl-chain-time.js +21 -21
  19. package/development/pearl-chain-vertical-item.js +2 -15
  20. package/development/pearl-chain-vertical.js +2 -15
  21. package/development/pearl-chain.js +8 -25
  22. package/development/timetable-duration.js +2 -15
  23. package/development/timetable-row/timetable-row.d.ts +7 -0
  24. package/development/timetable-row/timetable-row.d.ts.map +1 -1
  25. package/development/timetable-row/timetable-row.sample-data.d.ts +2 -0
  26. package/development/timetable-row/timetable-row.sample-data.d.ts.map +1 -1
  27. package/development/timetable-row.js +9 -17
  28. package/development/toDate-B6IBgPYH.js +24 -0
  29. package/differenceInMinutes-BI2zjbtS.js +23 -0
  30. package/{format-fWxoS2xH.js → format-oBQcGL50.js} +343 -344
  31. package/isValid-mroh13Xp.js +45 -0
  32. package/journey-summary.js +2 -2
  33. package/package.json +2 -2
  34. package/pearl-chain/pearl-chain.sample-data.d.ts +1 -0
  35. package/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -1
  36. package/pearl-chain-time/pearl-chain-time.d.ts +2 -0
  37. package/pearl-chain-time/pearl-chain-time.d.ts.map +1 -1
  38. package/pearl-chain-time.js +38 -34
  39. package/pearl-chain.js +57 -59
  40. package/timetable-row/timetable-row.d.ts +7 -0
  41. package/timetable-row/timetable-row.d.ts.map +1 -1
  42. package/timetable-row/timetable-row.sample-data.d.ts +2 -0
  43. package/timetable-row/timetable-row.sample-data.d.ts.map +1 -1
  44. package/timetable-row.js +41 -36
  45. package/toDate-DQg4ZFnf.js +15 -0
  46. package/constants-DSR8hPvP.js +0 -16
  47. package/development/constants-BMGwMkN3.js +0 -30
  48. package/development/differenceInMinutes-DHtPDiUE.js +0 -30
  49. package/development/format-DkbylFCM.js +0 -1373
  50. package/development/isValid-BVccOlli.js +0 -44
  51. package/differenceInMinutes-BhHyuJc4.js +0 -28
  52. package/isValid-DSjxf8eh.js +0 -36
@@ -1,34 +1,34 @@
1
- import { d as Q, i as X } from "./isValid-DSjxf8eh.js";
2
- import { t as w, c as b, m as q } from "./constants-DSR8hPvP.js";
3
- let L = {};
4
- function p() {
5
- return L;
1
+ import { d as X, i as L } from "./isValid-mroh13Xp.js";
2
+ import { t as w, c as P, m as C } from "./toDate-DQg4ZFnf.js";
3
+ let G = {};
4
+ function S() {
5
+ return G;
6
6
  }
7
- function x(t, e) {
7
+ function x(n, t) {
8
8
  var u, c, d, f;
9
- const n = p(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = w(t), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
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;
10
10
  return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
11
11
  }
12
- function W(t) {
13
- return x(t, { weekStartsOn: 1 });
12
+ function W(n, t) {
13
+ return x(n, { ...t, weekStartsOn: 1 });
14
14
  }
15
- function C(t) {
16
- const e = w(t), n = e.getFullYear(), r = b(t, 0);
17
- r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
18
- const a = W(r), i = b(t, 0);
19
- i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
20
- const s = W(i);
21
- return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
15
+ function N(n, t) {
16
+ const e = w(n, t == null ? void 0 : t.in), r = e.getFullYear(), a = P(e, 0);
17
+ a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
18
+ const i = W(a), s = P(e, 0);
19
+ s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
20
+ const u = W(s);
21
+ return e.getTime() >= i.getTime() ? r + 1 : e.getTime() >= u.getTime() ? r : r - 1;
22
22
  }
23
- function G(t) {
24
- const e = C(t), n = b(t, 0);
25
- return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), W(n);
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);
26
26
  }
27
- function _(t) {
28
- const e = w(t), n = b(t, 0);
29
- return n.setFullYear(e.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;
30
30
  }
31
- const B = {
31
+ const R = {
32
32
  lessThanXSeconds: {
33
33
  one: "less than a second",
34
34
  other: "less than {{count}} seconds"
@@ -90,44 +90,44 @@ const B = {
90
90
  one: "almost 1 year",
91
91
  other: "almost {{count}} years"
92
92
  }
93
- }, R = (t, e, n) => {
93
+ }, A = (n, t, e) => {
94
94
  let r;
95
- const a = B[t];
96
- return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && 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;
97
97
  };
98
- function Y(t) {
99
- return (e = {}) => {
100
- const n = e.width ? String(e.width) : t.defaultWidth;
101
- 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];
102
102
  };
103
103
  }
104
- const A = {
104
+ const V = {
105
105
  full: "EEEE, MMMM do, y",
106
106
  long: "MMMM do, y",
107
107
  medium: "MMM d, y",
108
108
  short: "MM/dd/yyyy"
109
- }, V = {
109
+ }, j = {
110
110
  full: "h:mm:ss a zzzz",
111
111
  long: "h:mm:ss a z",
112
112
  medium: "h:mm:ss a",
113
113
  short: "h:mm a"
114
- }, j = {
114
+ }, p = {
115
115
  full: "{{date}} 'at' {{time}}",
116
116
  long: "{{date}} 'at' {{time}}",
117
117
  medium: "{{date}}, {{time}}",
118
118
  short: "{{date}}, {{time}}"
119
119
  }, I = {
120
- date: Y({
121
- formats: A,
122
- defaultWidth: "full"
123
- }),
124
- time: Y({
120
+ date: D({
125
121
  formats: V,
126
122
  defaultWidth: "full"
127
123
  }),
128
- dateTime: Y({
124
+ time: D({
129
125
  formats: j,
130
126
  defaultWidth: "full"
127
+ }),
128
+ dateTime: D({
129
+ formats: p,
130
+ defaultWidth: "full"
131
131
  })
132
132
  }, J = {
133
133
  lastWeek: "'last' eeee 'at' p",
@@ -136,19 +136,19 @@ const A = {
136
136
  tomorrow: "'tomorrow at' p",
137
137
  nextWeek: "eeee 'at' p",
138
138
  other: "P"
139
- }, $ = (t, e, n, r) => J[t];
140
- function v(t) {
141
- return (e, n) => {
142
- const r = n != null && n.context ? String(n.context) : "standalone";
139
+ }, $ = (n, t, e, r) => J[n];
140
+ function v(n) {
141
+ return (t, e) => {
142
+ const r = e != null && e.context ? String(e.context) : "standalone";
143
143
  let a;
144
- if (r === "formatting" && t.formattingValues) {
145
- const s = t.defaultFormattingWidth || t.defaultWidth, u = n != null && n.width ? String(n.width) : s;
146
- a = t.formattingValues[u] || 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];
147
147
  } else {
148
- const s = t.defaultWidth, u = n != null && n.width ? String(n.width) : t.defaultWidth;
149
- a = t.values[u] || 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];
150
150
  }
151
- const i = t.argumentCallback ? t.argumentCallback(e) : e;
151
+ const i = n.argumentCallback ? n.argumentCallback(t) : t;
152
152
  return a[i];
153
153
  };
154
154
  }
@@ -265,18 +265,18 @@ const K = {
265
265
  evening: "in the evening",
266
266
  night: "at night"
267
267
  }
268
- }, nt = (t, e) => {
269
- const n = Number(t), r = n % 100;
268
+ }, nt = (n, t) => {
269
+ const e = Number(n), r = e % 100;
270
270
  if (r > 20 || r < 10)
271
271
  switch (r % 10) {
272
272
  case 1:
273
- return n + "st";
273
+ return e + "st";
274
274
  case 2:
275
- return n + "nd";
275
+ return e + "nd";
276
276
  case 3:
277
- return n + "rd";
277
+ return e + "rd";
278
278
  }
279
- return n + "th";
279
+ return e + "th";
280
280
  }, rt = {
281
281
  ordinalNumber: nt,
282
282
  era: v({
@@ -286,7 +286,7 @@ const K = {
286
286
  quarter: v({
287
287
  values: U,
288
288
  defaultWidth: "wide",
289
- argumentCallback: (t) => t - 1
289
+ argumentCallback: (n) => n - 1
290
290
  }),
291
291
  month: v({
292
292
  values: z,
@@ -303,43 +303,43 @@ const K = {
303
303
  defaultFormattingWidth: "wide"
304
304
  })
305
305
  };
306
- function k(t) {
307
- return (e, n = {}) => {
308
- const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
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
309
  if (!i)
310
310
  return null;
311
- const s = i[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(u) ? it(u, (l) => l.test(s)) : (
312
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
311
+ const s = i[0], u = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], c = Array.isArray(u) ? it(u, (l) => l.test(s)) : (
312
+ // [TODO] -- I challenge you to fix the type
313
313
  at(u, (l) => l.test(s))
314
314
  );
315
315
  let d;
316
- d = t.valueCallback ? t.valueCallback(c) : c, d = n.valueCallback ? (
317
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
318
- n.valueCallback(d)
316
+ d = n.valueCallback ? n.valueCallback(c) : c, d = e.valueCallback ? (
317
+ // [TODO] -- I challenge you to fix the type
318
+ e.valueCallback(d)
319
319
  ) : d;
320
- const f = e.slice(s.length);
320
+ const f = t.slice(s.length);
321
321
  return { value: d, rest: f };
322
322
  };
323
323
  }
324
- function at(t, e) {
325
- for (const n in t)
326
- if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
327
- 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;
328
328
  }
329
- function it(t, e) {
330
- for (let n = 0; n < t.length; n++)
331
- if (e(t[n]))
332
- return n;
329
+ function it(n, t) {
330
+ for (let e = 0; e < n.length; e++)
331
+ if (t(n[e]))
332
+ return e;
333
333
  }
334
- function ot(t) {
335
- return (e, n = {}) => {
336
- const r = e.match(t.matchPattern);
334
+ function ot(n) {
335
+ return (t, e = {}) => {
336
+ const r = t.match(n.matchPattern);
337
337
  if (!r) return null;
338
- const a = r[0], i = e.match(t.parsePattern);
338
+ const a = r[0], i = t.match(n.parsePattern);
339
339
  if (!i) return null;
340
- let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
341
- s = n.valueCallback ? n.valueCallback(s) : s;
342
- const u = e.slice(a.length);
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
343
  return { value: s, rest: u };
344
344
  };
345
345
  }
@@ -414,7 +414,7 @@ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
414
414
  ordinalNumber: ot({
415
415
  matchPattern: st,
416
416
  parsePattern: ut,
417
- valueCallback: (t) => parseInt(t, 10)
417
+ valueCallback: (n) => parseInt(n, 10)
418
418
  }),
419
419
  era: k({
420
420
  matchPatterns: ct,
@@ -427,7 +427,7 @@ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
427
427
  defaultMatchWidth: "wide",
428
428
  parsePatterns: ft,
429
429
  defaultParseWidth: "any",
430
- valueCallback: (t) => t + 1
430
+ valueCallback: (n) => n + 1
431
431
  }),
432
432
  month: k({
433
433
  matchPatterns: mt,
@@ -449,7 +449,7 @@ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
449
449
  })
450
450
  }, Mt = {
451
451
  code: "en-US",
452
- formatDistance: R,
452
+ formatDistance: A,
453
453
  formatLong: I,
454
454
  formatRelative: $,
455
455
  localize: rt,
@@ -459,91 +459,91 @@ const st = /^(\d+)(th|st|nd|rd)?/i, ut = /\d+/i, ct = {
459
459
  firstWeekContainsDate: 1
460
460
  }
461
461
  };
462
- function Ot(t) {
463
- const e = w(t);
464
- return Q(e, _(e)) + 1;
462
+ function Ot(n, t) {
463
+ const e = w(n, t == null ? void 0 : t.in);
464
+ return X(e, B(e)) + 1;
465
465
  }
466
- function vt(t) {
467
- const e = w(t), n = +W(e) - +G(e);
468
- return Math.round(n / q) + 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;
469
469
  }
470
- function N(t, e) {
470
+ function H(n, t) {
471
471
  var f, l, M, O;
472
- const n = w(t), r = n.getFullYear(), a = p(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((l = (f = e == null ? void 0 : e.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 = b(t, 0);
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
473
  s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
474
- const u = x(s, e), c = b(t, 0);
474
+ const u = x(s, t), c = P((t == null ? void 0 : t.in) || n, 0);
475
475
  c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
476
- const d = x(c, e);
477
- return n.getTime() >= u.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
476
+ const d = x(c, t);
477
+ return +e >= +u ? r + 1 : +e >= +d ? r : r - 1;
478
478
  }
479
- function kt(t, e) {
479
+ function kt(n, t) {
480
480
  var u, c, d, f;
481
- const n = p(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, a = N(t, e), i = b(t, 0);
482
- return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), x(i, e);
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);
483
483
  }
484
- function xt(t, e) {
485
- const n = w(t), r = +x(n, e) - +kt(n, e);
486
- return Math.round(r / q) + 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;
487
487
  }
488
- function o(t, e) {
489
- const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
490
- 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;
491
491
  }
492
492
  const g = {
493
493
  // Year
494
- y(t, e) {
495
- const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
496
- return o(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);
497
497
  },
498
498
  // Month
499
- M(t, e) {
500
- const n = t.getMonth();
501
- return e === "M" ? String(n + 1) : o(n + 1, 2);
499
+ M(n, t) {
500
+ const e = n.getMonth();
501
+ return t === "M" ? String(e + 1) : o(e + 1, 2);
502
502
  },
503
503
  // Day of the month
504
- d(t, e) {
505
- return o(t.getDate(), e.length);
504
+ d(n, t) {
505
+ return o(n.getDate(), t.length);
506
506
  },
507
507
  // AM or PM
508
- a(t, e) {
509
- const n = t.getHours() / 12 >= 1 ? "pm" : "am";
510
- switch (e) {
508
+ a(n, t) {
509
+ const e = n.getHours() / 12 >= 1 ? "pm" : "am";
510
+ switch (t) {
511
511
  case "a":
512
512
  case "aa":
513
- return n.toUpperCase();
513
+ return e.toUpperCase();
514
514
  case "aaa":
515
- return n;
515
+ return e;
516
516
  case "aaaaa":
517
- return n[0];
517
+ return e[0];
518
518
  case "aaaa":
519
519
  default:
520
- return n === "am" ? "a.m." : "p.m.";
520
+ return e === "am" ? "a.m." : "p.m.";
521
521
  }
522
522
  },
523
523
  // Hour [1-12]
524
- h(t, e) {
525
- return o(t.getHours() % 12 || 12, e.length);
524
+ h(n, t) {
525
+ return o(n.getHours() % 12 || 12, t.length);
526
526
  },
527
527
  // Hour [0-23]
528
- H(t, e) {
529
- return o(t.getHours(), e.length);
528
+ H(n, t) {
529
+ return o(n.getHours(), t.length);
530
530
  },
531
531
  // Minute
532
- m(t, e) {
533
- return o(t.getMinutes(), e.length);
532
+ m(n, t) {
533
+ return o(n.getMinutes(), t.length);
534
534
  },
535
535
  // Second
536
- s(t, e) {
537
- return o(t.getSeconds(), e.length);
536
+ s(n, t) {
537
+ return o(n.getSeconds(), t.length);
538
538
  },
539
539
  // Fraction of second
540
- S(t, e) {
541
- const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
542
- 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)
543
543
  );
544
- return o(a, e.length);
544
+ return o(a, t.length);
545
545
  }
546
- }, P = {
546
+ }, b = {
547
547
  am: "am",
548
548
  pm: "pm",
549
549
  midnight: "midnight",
@@ -554,41 +554,41 @@ const g = {
554
554
  night: "night"
555
555
  }, T = {
556
556
  // Era
557
- G: function(t, e, n) {
558
- const r = t.getFullYear() > 0 ? 1 : 0;
559
- switch (e) {
557
+ G: function(n, t, e) {
558
+ const r = n.getFullYear() > 0 ? 1 : 0;
559
+ switch (t) {
560
560
  case "G":
561
561
  case "GG":
562
562
  case "GGG":
563
- return n.era(r, { width: "abbreviated" });
563
+ return e.era(r, { width: "abbreviated" });
564
564
  case "GGGGG":
565
- return n.era(r, { width: "narrow" });
565
+ return e.era(r, { width: "narrow" });
566
566
  case "GGGG":
567
567
  default:
568
- return n.era(r, { width: "wide" });
568
+ return e.era(r, { width: "wide" });
569
569
  }
570
570
  },
571
571
  // Year
572
- y: function(t, e, n) {
573
- if (e === "yo") {
574
- const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
575
- return n.ordinalNumber(a, { unit: "year" });
572
+ y: function(n, t, e) {
573
+ if (t === "yo") {
574
+ const r = n.getFullYear(), a = r > 0 ? r : 1 - r;
575
+ return e.ordinalNumber(a, { unit: "year" });
576
576
  }
577
- return g.y(t, e);
577
+ return g.y(n, t);
578
578
  },
579
579
  // Local week-numbering year
580
- Y: function(t, e, n, r) {
581
- const a = N(t, r), i = a > 0 ? a : 1 - a;
582
- if (e === "YY") {
580
+ Y: function(n, t, e, r) {
581
+ const a = H(n, r), i = a > 0 ? a : 1 - a;
582
+ if (t === "YY") {
583
583
  const s = i % 100;
584
584
  return o(s, 2);
585
585
  }
586
- return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, e.length);
586
+ return t === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : o(i, t.length);
587
587
  },
588
588
  // ISO week-numbering year
589
- R: function(t, e) {
590
- const n = C(t);
591
- return o(n, e.length);
589
+ R: function(n, t) {
590
+ const e = N(n);
591
+ return o(e, t.length);
592
592
  },
593
593
  // Extended year. This is a single number designating the year of this calendar system.
594
594
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -599,386 +599,386 @@ const g = {
599
599
  // | BC 2 | 2 | -1 |
600
600
  // Also `yy` always returns the last two digits of a year,
601
601
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
602
- u: function(t, e) {
603
- const n = t.getFullYear();
604
- return o(n, e.length);
602
+ u: function(n, t) {
603
+ const e = n.getFullYear();
604
+ return o(e, t.length);
605
605
  },
606
606
  // Quarter
607
- Q: function(t, e, n) {
608
- const r = Math.ceil((t.getMonth() + 1) / 3);
609
- switch (e) {
607
+ Q: function(n, t, e) {
608
+ const r = Math.ceil((n.getMonth() + 1) / 3);
609
+ switch (t) {
610
610
  case "Q":
611
611
  return String(r);
612
612
  case "QQ":
613
613
  return o(r, 2);
614
614
  case "Qo":
615
- return n.ordinalNumber(r, { unit: "quarter" });
615
+ return e.ordinalNumber(r, { unit: "quarter" });
616
616
  case "QQQ":
617
- return n.quarter(r, {
617
+ return e.quarter(r, {
618
618
  width: "abbreviated",
619
619
  context: "formatting"
620
620
  });
621
621
  case "QQQQQ":
622
- return n.quarter(r, {
622
+ return e.quarter(r, {
623
623
  width: "narrow",
624
624
  context: "formatting"
625
625
  });
626
626
  case "QQQQ":
627
627
  default:
628
- return n.quarter(r, {
628
+ return e.quarter(r, {
629
629
  width: "wide",
630
630
  context: "formatting"
631
631
  });
632
632
  }
633
633
  },
634
634
  // Stand-alone quarter
635
- q: function(t, e, n) {
636
- const r = Math.ceil((t.getMonth() + 1) / 3);
637
- switch (e) {
635
+ q: function(n, t, e) {
636
+ const r = Math.ceil((n.getMonth() + 1) / 3);
637
+ switch (t) {
638
638
  case "q":
639
639
  return String(r);
640
640
  case "qq":
641
641
  return o(r, 2);
642
642
  case "qo":
643
- return n.ordinalNumber(r, { unit: "quarter" });
643
+ return e.ordinalNumber(r, { unit: "quarter" });
644
644
  case "qqq":
645
- return n.quarter(r, {
645
+ return e.quarter(r, {
646
646
  width: "abbreviated",
647
647
  context: "standalone"
648
648
  });
649
649
  case "qqqqq":
650
- return n.quarter(r, {
650
+ return e.quarter(r, {
651
651
  width: "narrow",
652
652
  context: "standalone"
653
653
  });
654
654
  case "qqqq":
655
655
  default:
656
- return n.quarter(r, {
656
+ return e.quarter(r, {
657
657
  width: "wide",
658
658
  context: "standalone"
659
659
  });
660
660
  }
661
661
  },
662
662
  // Month
663
- M: function(t, e, n) {
664
- const r = t.getMonth();
665
- switch (e) {
663
+ M: function(n, t, e) {
664
+ const r = n.getMonth();
665
+ switch (t) {
666
666
  case "M":
667
667
  case "MM":
668
- return g.M(t, e);
668
+ return g.M(n, t);
669
669
  case "Mo":
670
- return n.ordinalNumber(r + 1, { unit: "month" });
670
+ return e.ordinalNumber(r + 1, { unit: "month" });
671
671
  case "MMM":
672
- return n.month(r, {
672
+ return e.month(r, {
673
673
  width: "abbreviated",
674
674
  context: "formatting"
675
675
  });
676
676
  case "MMMMM":
677
- return n.month(r, {
677
+ return e.month(r, {
678
678
  width: "narrow",
679
679
  context: "formatting"
680
680
  });
681
681
  case "MMMM":
682
682
  default:
683
- return n.month(r, { width: "wide", context: "formatting" });
683
+ return e.month(r, { width: "wide", context: "formatting" });
684
684
  }
685
685
  },
686
686
  // Stand-alone month
687
- L: function(t, e, n) {
688
- const r = t.getMonth();
689
- switch (e) {
687
+ L: function(n, t, e) {
688
+ const r = n.getMonth();
689
+ switch (t) {
690
690
  case "L":
691
691
  return String(r + 1);
692
692
  case "LL":
693
693
  return o(r + 1, 2);
694
694
  case "Lo":
695
- return n.ordinalNumber(r + 1, { unit: "month" });
695
+ return e.ordinalNumber(r + 1, { unit: "month" });
696
696
  case "LLL":
697
- return n.month(r, {
697
+ return e.month(r, {
698
698
  width: "abbreviated",
699
699
  context: "standalone"
700
700
  });
701
701
  case "LLLLL":
702
- return n.month(r, {
702
+ return e.month(r, {
703
703
  width: "narrow",
704
704
  context: "standalone"
705
705
  });
706
706
  case "LLLL":
707
707
  default:
708
- return n.month(r, { width: "wide", context: "standalone" });
708
+ return e.month(r, { width: "wide", context: "standalone" });
709
709
  }
710
710
  },
711
711
  // Local week of year
712
- w: function(t, e, n, r) {
713
- const a = xt(t, r);
714
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : o(a, e.length);
712
+ w: function(n, t, e, r) {
713
+ const a = xt(n, r);
714
+ return t === "wo" ? e.ordinalNumber(a, { unit: "week" }) : o(a, t.length);
715
715
  },
716
716
  // ISO week of year
717
- I: function(t, e, n) {
718
- const r = vt(t);
719
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : o(r, e.length);
717
+ I: function(n, t, e) {
718
+ const r = vt(n);
719
+ return t === "Io" ? e.ordinalNumber(r, { unit: "week" }) : o(r, t.length);
720
720
  },
721
721
  // Day of the month
722
- d: function(t, e, n) {
723
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : g.d(t, e);
722
+ d: function(n, t, e) {
723
+ return t === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : g.d(n, t);
724
724
  },
725
725
  // Day of year
726
- D: function(t, e, n) {
727
- const r = Ot(t);
728
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, e.length);
726
+ D: function(n, t, e) {
727
+ const r = Ot(n);
728
+ return t === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, t.length);
729
729
  },
730
730
  // Day of week
731
- E: function(t, e, n) {
732
- const r = t.getDay();
733
- switch (e) {
731
+ E: function(n, t, e) {
732
+ const r = n.getDay();
733
+ switch (t) {
734
734
  case "E":
735
735
  case "EE":
736
736
  case "EEE":
737
- return n.day(r, {
737
+ return e.day(r, {
738
738
  width: "abbreviated",
739
739
  context: "formatting"
740
740
  });
741
741
  case "EEEEE":
742
- return n.day(r, {
742
+ return e.day(r, {
743
743
  width: "narrow",
744
744
  context: "formatting"
745
745
  });
746
746
  case "EEEEEE":
747
- return n.day(r, {
747
+ return e.day(r, {
748
748
  width: "short",
749
749
  context: "formatting"
750
750
  });
751
751
  case "EEEE":
752
752
  default:
753
- return n.day(r, {
753
+ return e.day(r, {
754
754
  width: "wide",
755
755
  context: "formatting"
756
756
  });
757
757
  }
758
758
  },
759
759
  // Local day of week
760
- e: function(t, e, n, r) {
761
- const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
762
- switch (e) {
760
+ e: function(n, t, e, r) {
761
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
762
+ switch (t) {
763
763
  case "e":
764
764
  return String(i);
765
765
  case "ee":
766
766
  return o(i, 2);
767
767
  case "eo":
768
- return n.ordinalNumber(i, { unit: "day" });
768
+ return e.ordinalNumber(i, { unit: "day" });
769
769
  case "eee":
770
- return n.day(a, {
770
+ return e.day(a, {
771
771
  width: "abbreviated",
772
772
  context: "formatting"
773
773
  });
774
774
  case "eeeee":
775
- return n.day(a, {
775
+ return e.day(a, {
776
776
  width: "narrow",
777
777
  context: "formatting"
778
778
  });
779
779
  case "eeeeee":
780
- return n.day(a, {
780
+ return e.day(a, {
781
781
  width: "short",
782
782
  context: "formatting"
783
783
  });
784
784
  case "eeee":
785
785
  default:
786
- return n.day(a, {
786
+ return e.day(a, {
787
787
  width: "wide",
788
788
  context: "formatting"
789
789
  });
790
790
  }
791
791
  },
792
792
  // Stand-alone local day of week
793
- c: function(t, e, n, r) {
794
- const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
795
- switch (e) {
793
+ c: function(n, t, e, r) {
794
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
795
+ switch (t) {
796
796
  case "c":
797
797
  return String(i);
798
798
  case "cc":
799
- return o(i, e.length);
799
+ return o(i, t.length);
800
800
  case "co":
801
- return n.ordinalNumber(i, { unit: "day" });
801
+ return e.ordinalNumber(i, { unit: "day" });
802
802
  case "ccc":
803
- return n.day(a, {
803
+ return e.day(a, {
804
804
  width: "abbreviated",
805
805
  context: "standalone"
806
806
  });
807
807
  case "ccccc":
808
- return n.day(a, {
808
+ return e.day(a, {
809
809
  width: "narrow",
810
810
  context: "standalone"
811
811
  });
812
812
  case "cccccc":
813
- return n.day(a, {
813
+ return e.day(a, {
814
814
  width: "short",
815
815
  context: "standalone"
816
816
  });
817
817
  case "cccc":
818
818
  default:
819
- return n.day(a, {
819
+ return e.day(a, {
820
820
  width: "wide",
821
821
  context: "standalone"
822
822
  });
823
823
  }
824
824
  },
825
825
  // ISO day of week
826
- i: function(t, e, n) {
827
- const r = t.getDay(), a = r === 0 ? 7 : r;
828
- switch (e) {
826
+ i: function(n, t, e) {
827
+ const r = n.getDay(), a = r === 0 ? 7 : r;
828
+ switch (t) {
829
829
  case "i":
830
830
  return String(a);
831
831
  case "ii":
832
- return o(a, e.length);
832
+ return o(a, t.length);
833
833
  case "io":
834
- return n.ordinalNumber(a, { unit: "day" });
834
+ return e.ordinalNumber(a, { unit: "day" });
835
835
  case "iii":
836
- return n.day(r, {
836
+ return e.day(r, {
837
837
  width: "abbreviated",
838
838
  context: "formatting"
839
839
  });
840
840
  case "iiiii":
841
- return n.day(r, {
841
+ return e.day(r, {
842
842
  width: "narrow",
843
843
  context: "formatting"
844
844
  });
845
845
  case "iiiiii":
846
- return n.day(r, {
846
+ return e.day(r, {
847
847
  width: "short",
848
848
  context: "formatting"
849
849
  });
850
850
  case "iiii":
851
851
  default:
852
- return n.day(r, {
852
+ return e.day(r, {
853
853
  width: "wide",
854
854
  context: "formatting"
855
855
  });
856
856
  }
857
857
  },
858
858
  // AM or PM
859
- a: function(t, e, n) {
860
- const a = t.getHours() / 12 >= 1 ? "pm" : "am";
861
- switch (e) {
859
+ a: function(n, t, e) {
860
+ const a = n.getHours() / 12 >= 1 ? "pm" : "am";
861
+ switch (t) {
862
862
  case "a":
863
863
  case "aa":
864
- return n.dayPeriod(a, {
864
+ return e.dayPeriod(a, {
865
865
  width: "abbreviated",
866
866
  context: "formatting"
867
867
  });
868
868
  case "aaa":
869
- return n.dayPeriod(a, {
869
+ return e.dayPeriod(a, {
870
870
  width: "abbreviated",
871
871
  context: "formatting"
872
872
  }).toLowerCase();
873
873
  case "aaaaa":
874
- return n.dayPeriod(a, {
874
+ return e.dayPeriod(a, {
875
875
  width: "narrow",
876
876
  context: "formatting"
877
877
  });
878
878
  case "aaaa":
879
879
  default:
880
- return n.dayPeriod(a, {
880
+ return e.dayPeriod(a, {
881
881
  width: "wide",
882
882
  context: "formatting"
883
883
  });
884
884
  }
885
885
  },
886
886
  // AM, PM, midnight, noon
887
- b: function(t, e, n) {
888
- const r = t.getHours();
887
+ b: function(n, t, e) {
888
+ const r = n.getHours();
889
889
  let a;
890
- switch (r === 12 ? a = P.noon : r === 0 ? a = P.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
890
+ switch (r === 12 ? a = b.noon : r === 0 ? a = b.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
891
891
  case "b":
892
892
  case "bb":
893
- return n.dayPeriod(a, {
893
+ return e.dayPeriod(a, {
894
894
  width: "abbreviated",
895
895
  context: "formatting"
896
896
  });
897
897
  case "bbb":
898
- return n.dayPeriod(a, {
898
+ return e.dayPeriod(a, {
899
899
  width: "abbreviated",
900
900
  context: "formatting"
901
901
  }).toLowerCase();
902
902
  case "bbbbb":
903
- return n.dayPeriod(a, {
903
+ return e.dayPeriod(a, {
904
904
  width: "narrow",
905
905
  context: "formatting"
906
906
  });
907
907
  case "bbbb":
908
908
  default:
909
- return n.dayPeriod(a, {
909
+ return e.dayPeriod(a, {
910
910
  width: "wide",
911
911
  context: "formatting"
912
912
  });
913
913
  }
914
914
  },
915
915
  // in the morning, in the afternoon, in the evening, at night
916
- B: function(t, e, n) {
917
- const r = t.getHours();
916
+ B: function(n, t, e) {
917
+ const r = n.getHours();
918
918
  let a;
919
- switch (r >= 17 ? a = P.evening : r >= 12 ? a = P.afternoon : r >= 4 ? a = P.morning : a = P.night, e) {
919
+ switch (r >= 17 ? a = b.evening : r >= 12 ? a = b.afternoon : r >= 4 ? a = b.morning : a = b.night, t) {
920
920
  case "B":
921
921
  case "BB":
922
922
  case "BBB":
923
- return n.dayPeriod(a, {
923
+ return e.dayPeriod(a, {
924
924
  width: "abbreviated",
925
925
  context: "formatting"
926
926
  });
927
927
  case "BBBBB":
928
- return n.dayPeriod(a, {
928
+ return e.dayPeriod(a, {
929
929
  width: "narrow",
930
930
  context: "formatting"
931
931
  });
932
932
  case "BBBB":
933
933
  default:
934
- return n.dayPeriod(a, {
934
+ return e.dayPeriod(a, {
935
935
  width: "wide",
936
936
  context: "formatting"
937
937
  });
938
938
  }
939
939
  },
940
940
  // Hour [1-12]
941
- h: function(t, e, n) {
942
- if (e === "ho") {
943
- let r = t.getHours() % 12;
944
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
941
+ h: function(n, t, e) {
942
+ if (t === "ho") {
943
+ let r = n.getHours() % 12;
944
+ return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
945
945
  }
946
- return g.h(t, e);
946
+ return g.h(n, t);
947
947
  },
948
948
  // Hour [0-23]
949
- H: function(t, e, n) {
950
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : g.H(t, e);
949
+ H: function(n, t, e) {
950
+ return t === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : g.H(n, t);
951
951
  },
952
952
  // Hour [0-11]
953
- K: function(t, e, n) {
954
- const r = t.getHours() % 12;
955
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
953
+ K: function(n, t, e) {
954
+ const r = n.getHours() % 12;
955
+ return t === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : o(r, t.length);
956
956
  },
957
957
  // Hour [1-24]
958
- k: function(t, e, n) {
959
- let r = t.getHours();
960
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : o(r, e.length);
958
+ k: function(n, t, e) {
959
+ let r = n.getHours();
960
+ return r === 0 && (r = 24), t === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : o(r, t.length);
961
961
  },
962
962
  // Minute
963
- m: function(t, e, n) {
964
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : g.m(t, e);
963
+ m: function(n, t, e) {
964
+ return t === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : g.m(n, t);
965
965
  },
966
966
  // Second
967
- s: function(t, e, n) {
968
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : g.s(t, e);
967
+ s: function(n, t, e) {
968
+ return t === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : g.s(n, t);
969
969
  },
970
970
  // Fraction of second
971
- S: function(t, e) {
972
- return g.S(t, e);
971
+ S: function(n, t) {
972
+ return g.S(n, t);
973
973
  },
974
974
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
975
- X: function(t, e, n) {
976
- const r = t.getTimezoneOffset();
975
+ X: function(n, t, e) {
976
+ const r = n.getTimezoneOffset();
977
977
  if (r === 0)
978
978
  return "Z";
979
- switch (e) {
979
+ switch (t) {
980
980
  case "X":
981
- return E(r);
981
+ return F(r);
982
982
  case "XXXX":
983
983
  case "XX":
984
984
  return y(r);
@@ -989,11 +989,11 @@ const g = {
989
989
  }
990
990
  },
991
991
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
992
- x: function(t, e, n) {
993
- const r = t.getTimezoneOffset();
994
- switch (e) {
992
+ x: function(n, t, e) {
993
+ const r = n.getTimezoneOffset();
994
+ switch (t) {
995
995
  case "x":
996
- return E(r);
996
+ return F(r);
997
997
  case "xxxx":
998
998
  case "xx":
999
999
  return y(r);
@@ -1004,138 +1004,137 @@ const g = {
1004
1004
  }
1005
1005
  },
1006
1006
  // Timezone (GMT)
1007
- O: function(t, e, n) {
1008
- const r = t.getTimezoneOffset();
1009
- switch (e) {
1007
+ O: function(n, t, e) {
1008
+ const r = n.getTimezoneOffset();
1009
+ switch (t) {
1010
1010
  case "O":
1011
1011
  case "OO":
1012
1012
  case "OOO":
1013
- return "GMT" + D(r, ":");
1013
+ return "GMT" + E(r, ":");
1014
1014
  case "OOOO":
1015
1015
  default:
1016
1016
  return "GMT" + y(r, ":");
1017
1017
  }
1018
1018
  },
1019
1019
  // Timezone (specific non-location)
1020
- z: function(t, e, n) {
1021
- const r = t.getTimezoneOffset();
1022
- switch (e) {
1020
+ z: function(n, t, e) {
1021
+ const r = n.getTimezoneOffset();
1022
+ switch (t) {
1023
1023
  case "z":
1024
1024
  case "zz":
1025
1025
  case "zzz":
1026
- return "GMT" + D(r, ":");
1026
+ return "GMT" + E(r, ":");
1027
1027
  case "zzzz":
1028
1028
  default:
1029
1029
  return "GMT" + y(r, ":");
1030
1030
  }
1031
1031
  },
1032
1032
  // Seconds timestamp
1033
- t: function(t, e, n) {
1034
- const r = Math.trunc(t.getTime() / 1e3);
1035
- return o(r, e.length);
1033
+ t: function(n, t, e) {
1034
+ const r = Math.trunc(+n / 1e3);
1035
+ return o(r, t.length);
1036
1036
  },
1037
1037
  // Milliseconds timestamp
1038
- T: function(t, e, n) {
1039
- const r = t.getTime();
1040
- return o(r, e.length);
1038
+ T: function(n, t, e) {
1039
+ return o(+n, t.length);
1041
1040
  }
1042
1041
  };
1043
- function D(t, e = "") {
1044
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
1045
- return i === 0 ? n + String(a) : n + String(a) + e + o(i, 2);
1042
+ function E(n, t = "") {
1043
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = Math.trunc(r / 60), i = r % 60;
1044
+ return i === 0 ? e + String(a) : e + String(a) + t + o(i, 2);
1046
1045
  }
1047
- function E(t, e) {
1048
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : y(t, e);
1046
+ function F(n, t) {
1047
+ return n % 60 === 0 ? (n > 0 ? "-" : "+") + o(Math.abs(n) / 60, 2) : y(n, t);
1049
1048
  }
1050
- function y(t, e = "") {
1051
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
1052
- return n + a + e + i;
1049
+ function y(n, t = "") {
1050
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
1051
+ return e + a + t + i;
1053
1052
  }
1054
- const F = (t, e) => {
1055
- switch (t) {
1053
+ const q = (n, t) => {
1054
+ switch (n) {
1056
1055
  case "P":
1057
- return e.date({ width: "short" });
1056
+ return t.date({ width: "short" });
1058
1057
  case "PP":
1059
- return e.date({ width: "medium" });
1058
+ return t.date({ width: "medium" });
1060
1059
  case "PPP":
1061
- return e.date({ width: "long" });
1060
+ return t.date({ width: "long" });
1062
1061
  case "PPPP":
1063
1062
  default:
1064
- return e.date({ width: "full" });
1063
+ return t.date({ width: "full" });
1065
1064
  }
1066
- }, H = (t, e) => {
1067
- switch (t) {
1065
+ }, Q = (n, t) => {
1066
+ switch (n) {
1068
1067
  case "p":
1069
- return e.time({ width: "short" });
1068
+ return t.time({ width: "short" });
1070
1069
  case "pp":
1071
- return e.time({ width: "medium" });
1070
+ return t.time({ width: "medium" });
1072
1071
  case "ppp":
1073
- return e.time({ width: "long" });
1072
+ return t.time({ width: "long" });
1074
1073
  case "pppp":
1075
1074
  default:
1076
- return e.time({ width: "full" });
1075
+ return t.time({ width: "full" });
1077
1076
  }
1078
- }, Wt = (t, e) => {
1079
- const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1077
+ }, Wt = (n, t) => {
1078
+ const e = n.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
1080
1079
  if (!a)
1081
- return F(t, e);
1080
+ return q(n, t);
1082
1081
  let i;
1083
1082
  switch (r) {
1084
1083
  case "P":
1085
- i = e.dateTime({ width: "short" });
1084
+ i = t.dateTime({ width: "short" });
1086
1085
  break;
1087
1086
  case "PP":
1088
- i = e.dateTime({ width: "medium" });
1087
+ i = t.dateTime({ width: "medium" });
1089
1088
  break;
1090
1089
  case "PPP":
1091
- i = e.dateTime({ width: "long" });
1090
+ i = t.dateTime({ width: "long" });
1092
1091
  break;
1093
1092
  case "PPPP":
1094
1093
  default:
1095
- i = e.dateTime({ width: "full" });
1094
+ i = t.dateTime({ width: "full" });
1096
1095
  break;
1097
1096
  }
1098
- return i.replace("{{date}}", F(r, e)).replace("{{time}}", H(a, e));
1099
- }, pt = {
1100
- p: H,
1097
+ return i.replace("{{date}}", q(r, t)).replace("{{time}}", Q(a, t));
1098
+ }, St = {
1099
+ p: Q,
1101
1100
  P: Wt
1102
- }, St = /^D+$/, Yt = /^Y+$/, Tt = ["D", "DD", "YY", "YYYY"];
1103
- function Dt(t) {
1104
- return St.test(t);
1101
+ }, Yt = /^D+$/, Dt = /^Y+$/, Tt = ["D", "DD", "YY", "YYYY"];
1102
+ function Et(n) {
1103
+ return Yt.test(n);
1105
1104
  }
1106
- function Et(t) {
1107
- return Yt.test(t);
1105
+ function Ft(n) {
1106
+ return Dt.test(n);
1108
1107
  }
1109
- function Ft(t, e, n) {
1110
- const r = qt(t, e, n);
1111
- if (console.warn(r), Tt.includes(t)) throw new RangeError(r);
1108
+ function qt(n, t, e) {
1109
+ const r = Ct(n, t, e);
1110
+ if (console.warn(r), Tt.includes(n)) throw new RangeError(r);
1112
1111
  }
1113
- function qt(t, e, n) {
1114
- const r = t[0] === "Y" ? "years" : "days of the month";
1115
- 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`;
1112
+ function Ct(n, t, e) {
1113
+ const r = n[0] === "Y" ? "years" : "days of the month";
1114
+ 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`;
1116
1115
  }
1117
- const Ct = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Nt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ht = /^'([^]*?)'?$/, Qt = /''/g, Xt = /[a-zA-Z]/;
1118
- function Bt(t, e, n) {
1116
+ const Nt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ht = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qt = /^'([^]*?)'?$/, Xt = /''/g, Lt = /[a-zA-Z]/;
1117
+ function Rt(n, t, e) {
1119
1118
  var f, l, M, O;
1120
- const r = p(), 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(t);
1121
- if (!X(u))
1119
+ 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);
1120
+ if (!L(u))
1122
1121
  throw new RangeError("Invalid time value");
1123
- let c = e.match(Nt).map((m) => {
1122
+ let c = t.match(Ht).map((m) => {
1124
1123
  const h = m[0];
1125
1124
  if (h === "p" || h === "P") {
1126
- const S = pt[h];
1127
- return S(m, a.formatLong);
1125
+ const Y = St[h];
1126
+ return Y(m, a.formatLong);
1128
1127
  }
1129
1128
  return m;
1130
- }).join("").match(Ct).map((m) => {
1129
+ }).join("").match(Nt).map((m) => {
1131
1130
  if (m === "''")
1132
1131
  return { isToken: !1, value: "'" };
1133
1132
  const h = m[0];
1134
1133
  if (h === "'")
1135
- return { isToken: !1, value: Lt(m) };
1134
+ return { isToken: !1, value: Gt(m) };
1136
1135
  if (T[h])
1137
1136
  return { isToken: !0, value: m };
1138
- if (h.match(Xt))
1137
+ if (h.match(Lt))
1139
1138
  throw new RangeError(
1140
1139
  "Format string contains an unescaped latin alphabet character `" + h + "`"
1141
1140
  );
@@ -1150,15 +1149,15 @@ function Bt(t, e, n) {
1150
1149
  return c.map((m) => {
1151
1150
  if (!m.isToken) return m.value;
1152
1151
  const h = m.value;
1153
- (Et(h) || Dt(h)) && Ft(h, e, String(t));
1154
- const S = T[h[0]];
1155
- return S(u, h, a.localize, d);
1152
+ (Ft(h) || Et(h)) && qt(h, t, String(n));
1153
+ const Y = T[h[0]];
1154
+ return Y(u, h, a.localize, d);
1156
1155
  }).join("");
1157
1156
  }
1158
- function Lt(t) {
1159
- const e = t.match(Ht);
1160
- return e ? e[1].replace(Qt, "'") : t;
1157
+ function Gt(n) {
1158
+ const t = n.match(Qt);
1159
+ return t ? t[1].replace(Xt, "'") : n;
1161
1160
  }
1162
1161
  export {
1163
- Bt as f
1162
+ Rt as f
1164
1163
  };