@oslokommune/punkt-elements 12.42.3 → 12.42.5

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.
@@ -1,46 +1,40 @@
1
1
  import { e as ht } from "./class-map-m7ZCZ49w.js";
2
- import { P as dt, E as _, x as D, n as m, a as ft } from "./element-gAd63VwC.js";
3
- import { r as F } from "./state-BxrO4zNJ.js";
2
+ import { P as dt, E as I, x as k, n as m, a as ft } from "./element-gAd63VwC.js";
3
+ import { r as H } from "./state-BxrO4zNJ.js";
4
4
  import "./icon-CO1TLSs5.js";
5
- const rt = 6048e5, mt = 864e5, gt = 36e5, X = Symbol.for("constructDateFrom");
6
- function S(t, e) {
7
- return typeof t == "function" ? t(e) : t && typeof t == "object" && X in t ? t[X](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
5
+ const at = 6048e5, mt = 864e5, V = Symbol.for("constructDateFrom");
6
+ function M(t, e) {
7
+ return typeof t == "function" ? t(e) : t && typeof t == "object" && V in t ? t[V](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
8
8
  }
9
- function k(t, e) {
10
- return S(e || t, t);
9
+ function D(t, e) {
10
+ return M(e || t, t);
11
11
  }
12
- function U(t, e, n) {
13
- const r = k(t, n == null ? void 0 : n.in);
14
- return isNaN(e) ? S(t, NaN) : (e && r.setDate(r.getDate() + e), r);
12
+ function B(t, e, n) {
13
+ const r = D(t, n == null ? void 0 : n.in);
14
+ return isNaN(e) ? M(t, NaN) : (e && r.setDate(r.getDate() + e), r);
15
15
  }
16
- function yt(t, e, n) {
17
- return S(t, +k(t) + e);
18
- }
19
- function at(t, e, n) {
20
- return yt(t, e * gt);
16
+ let gt = {};
17
+ function L() {
18
+ return gt;
21
19
  }
22
- let pt = {};
23
- function q() {
24
- return pt;
25
- }
26
- function H(t, e) {
20
+ function _(t, e) {
27
21
  var c, o, d, g;
28
- const n = q(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((o = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : o.weekStartsOn) ?? n.weekStartsOn ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.weekStartsOn) ?? 0, a = k(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
22
+ const n = L(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((o = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : o.weekStartsOn) ?? n.weekStartsOn ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.weekStartsOn) ?? 0, a = D(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
29
23
  return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
30
24
  }
31
- function I(t, e) {
32
- return H(t, { ...e, weekStartsOn: 1 });
25
+ function q(t, e) {
26
+ return _(t, { ...e, weekStartsOn: 1 });
33
27
  }
34
28
  function st(t, e) {
35
- const n = k(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = S(n, 0);
29
+ const n = D(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = M(n, 0);
36
30
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
37
- const s = I(a), i = S(n, 0);
31
+ const s = q(a), i = M(n, 0);
38
32
  i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
39
- const c = I(i);
33
+ const c = q(i);
40
34
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
41
35
  }
42
- function V(t) {
43
- const e = k(t), n = new Date(
36
+ function J(t) {
37
+ const e = D(t), n = new Date(
44
38
  Date.UTC(
45
39
  e.getFullYear(),
46
40
  e.getMonth(),
@@ -54,58 +48,58 @@ function V(t) {
54
48
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
55
49
  }
56
50
  function it(t, ...e) {
57
- const n = S.bind(
51
+ const n = M.bind(
58
52
  null,
59
53
  e.find((r) => typeof r == "object")
60
54
  );
61
55
  return e.map(n);
62
56
  }
63
- function Q(t, e) {
64
- const n = k(t, e == null ? void 0 : e.in);
57
+ function G(t, e) {
58
+ const n = D(t, e == null ? void 0 : e.in);
65
59
  return n.setHours(0, 0, 0, 0), n;
66
60
  }
67
- function wt(t, e, n) {
61
+ function yt(t, e, n) {
68
62
  const [r, a] = it(
69
63
  n == null ? void 0 : n.in,
70
64
  t,
71
65
  e
72
- ), s = Q(r), i = Q(a), c = +s - V(s), o = +i - V(i);
66
+ ), s = G(r), i = G(a), c = +s - J(s), o = +i - J(i);
73
67
  return Math.round((c - o) / mt);
74
68
  }
75
- function bt(t, e) {
76
- const n = st(t, e), r = S(t, 0);
77
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), I(r);
69
+ function pt(t, e) {
70
+ const n = st(t, e), r = M(t, 0);
71
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), q(r);
78
72
  }
79
- function kt(t) {
73
+ function wt(t) {
80
74
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
81
75
  }
82
- function vt(t) {
83
- return !(!kt(t) && typeof t != "number" || isNaN(+k(t)));
76
+ function bt(t) {
77
+ return !(!wt(t) && typeof t != "number" || isNaN(+D(t)));
84
78
  }
85
79
  function Dt(t, e) {
86
- const n = k(t, e == null ? void 0 : e.in);
80
+ const n = D(t, e == null ? void 0 : e.in);
87
81
  return n.setHours(23, 59, 59, 999), n;
88
82
  }
89
- function St(t, e) {
83
+ function kt(t, e) {
90
84
  const [n, r] = it(t, e.start, e.end);
91
85
  return { start: n, end: r };
92
86
  }
93
87
  function z(t, e) {
94
- const { start: n, end: r } = St(e == null ? void 0 : e.in, t);
88
+ const { start: n, end: r } = kt(e == null ? void 0 : e.in, t);
95
89
  let a = +n > +r;
96
90
  const s = a ? +n : +r, i = a ? r : n;
97
91
  i.setHours(0, 0, 0, 0);
98
92
  let c = 1;
99
93
  const o = [];
100
94
  for (; +i <= s; )
101
- o.push(S(n, i)), i.setDate(i.getDate() + c), i.setHours(0, 0, 0, 0);
95
+ o.push(M(n, i)), i.setDate(i.getDate() + c), i.setHours(0, 0, 0, 0);
102
96
  return a ? o.reverse() : o;
103
97
  }
104
- function Mt(t, e) {
105
- const n = k(t, e == null ? void 0 : e.in);
98
+ function vt(t, e) {
99
+ const n = D(t, e == null ? void 0 : e.in);
106
100
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
107
101
  }
108
- const xt = {
102
+ const St = {
109
103
  lessThanXSeconds: {
110
104
  one: "less than a second",
111
105
  other: "less than {{count}} seconds"
@@ -167,53 +161,53 @@ const xt = {
167
161
  one: "almost 1 year",
168
162
  other: "almost {{count}} years"
169
163
  }
170
- }, Tt = (t, e, n) => {
164
+ }, Mt = (t, e, n) => {
171
165
  let r;
172
- const a = xt[t];
166
+ const a = St[t];
173
167
  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;
174
168
  };
175
- function B(t) {
169
+ function Q(t) {
176
170
  return (e = {}) => {
177
171
  const n = e.width ? String(e.width) : t.defaultWidth;
178
172
  return t.formats[n] || t.formats[t.defaultWidth];
179
173
  };
180
174
  }
181
- const Ot = {
175
+ const Tt = {
182
176
  full: "EEEE, MMMM do, y",
183
177
  long: "MMMM do, y",
184
178
  medium: "MMM d, y",
185
179
  short: "MM/dd/yyyy"
186
- }, Pt = {
180
+ }, xt = {
187
181
  full: "h:mm:ss a zzzz",
188
182
  long: "h:mm:ss a z",
189
183
  medium: "h:mm:ss a",
190
184
  short: "h:mm a"
191
- }, Ct = {
185
+ }, Ot = {
192
186
  full: "{{date}} 'at' {{time}}",
193
187
  long: "{{date}} 'at' {{time}}",
194
188
  medium: "{{date}}, {{time}}",
195
189
  short: "{{date}}, {{time}}"
196
- }, $t = {
197
- date: B({
198
- formats: Ot,
190
+ }, Pt = {
191
+ date: Q({
192
+ formats: Tt,
199
193
  defaultWidth: "full"
200
194
  }),
201
- time: B({
202
- formats: Pt,
195
+ time: Q({
196
+ formats: xt,
203
197
  defaultWidth: "full"
204
198
  }),
205
- dateTime: B({
206
- formats: Ct,
199
+ dateTime: Q({
200
+ formats: Ot,
207
201
  defaultWidth: "full"
208
202
  })
209
- }, Et = {
203
+ }, Nt = {
210
204
  lastWeek: "'last' eeee 'at' p",
211
205
  yesterday: "'yesterday at' p",
212
206
  today: "'today at' p",
213
207
  tomorrow: "'tomorrow at' p",
214
208
  nextWeek: "eeee 'at' p",
215
209
  other: "P"
216
- }, Wt = (t, e, n, r) => Et[t];
210
+ }, $t = (t, e, n, r) => Nt[t];
217
211
  function W(t) {
218
212
  return (e, n) => {
219
213
  const r = n != null && n.context ? String(n.context) : "standalone";
@@ -229,15 +223,15 @@ function W(t) {
229
223
  return a[s];
230
224
  };
231
225
  }
232
- const Nt = {
226
+ const Ct = {
233
227
  narrow: ["B", "A"],
234
228
  abbreviated: ["BC", "AD"],
235
229
  wide: ["Before Christ", "Anno Domini"]
236
- }, Yt = {
230
+ }, Et = {
237
231
  narrow: ["1", "2", "3", "4"],
238
232
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
239
233
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
240
- }, At = {
234
+ }, Wt = {
241
235
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
242
236
  abbreviated: [
243
237
  "Jan",
@@ -267,7 +261,7 @@ const Nt = {
267
261
  "November",
268
262
  "December"
269
263
  ]
270
- }, Ht = {
264
+ }, Yt = {
271
265
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
272
266
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
273
267
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -311,7 +305,7 @@ const Nt = {
311
305
  evening: "evening",
312
306
  night: "night"
313
307
  }
314
- }, _t = {
308
+ }, At = {
315
309
  narrow: {
316
310
  am: "a",
317
311
  pm: "p",
@@ -342,7 +336,7 @@ const Nt = {
342
336
  evening: "in the evening",
343
337
  night: "at night"
344
338
  }
345
- }, It = (t, e) => {
339
+ }, _t = (t, e) => {
346
340
  const n = Number(t), r = n % 100;
347
341
  if (r > 20 || r < 10)
348
342
  switch (r % 10) {
@@ -354,40 +348,40 @@ const Nt = {
354
348
  return n + "rd";
355
349
  }
356
350
  return n + "th";
357
- }, qt = {
358
- ordinalNumber: It,
351
+ }, Ht = {
352
+ ordinalNumber: _t,
359
353
  era: W({
360
- values: Nt,
354
+ values: Ct,
361
355
  defaultWidth: "wide"
362
356
  }),
363
357
  quarter: W({
364
- values: Yt,
358
+ values: Et,
365
359
  defaultWidth: "wide",
366
360
  argumentCallback: (t) => t - 1
367
361
  }),
368
362
  month: W({
369
- values: At,
363
+ values: Wt,
370
364
  defaultWidth: "wide"
371
365
  }),
372
366
  day: W({
373
- values: Ht,
367
+ values: Yt,
374
368
  defaultWidth: "wide"
375
369
  }),
376
370
  dayPeriod: W({
377
371
  values: Ft,
378
372
  defaultWidth: "wide",
379
- formattingValues: _t,
373
+ formattingValues: At,
380
374
  defaultFormattingWidth: "wide"
381
375
  })
382
376
  };
383
- function N(t) {
377
+ function Y(t) {
384
378
  return (e, n = {}) => {
385
379
  const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = e.match(a);
386
380
  if (!s)
387
381
  return null;
388
- const i = s[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], o = Array.isArray(c) ? Rt(c, (y) => y.test(i)) : (
382
+ const i = s[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], o = Array.isArray(c) ? qt(c, (y) => y.test(i)) : (
389
383
  // [TODO] -- I challenge you to fix the type
390
- Lt(c, (y) => y.test(i))
384
+ It(c, (y) => y.test(i))
391
385
  );
392
386
  let d;
393
387
  d = t.valueCallback ? t.valueCallback(o) : o, d = n.valueCallback ? (
@@ -398,17 +392,17 @@ function N(t) {
398
392
  return { value: d, rest: g };
399
393
  };
400
394
  }
401
- function Lt(t, e) {
395
+ function It(t, e) {
402
396
  for (const n in t)
403
397
  if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
404
398
  return n;
405
399
  }
406
- function Rt(t, e) {
400
+ function qt(t, e) {
407
401
  for (let n = 0; n < t.length; n++)
408
402
  if (e(t[n]))
409
403
  return n;
410
404
  }
411
- function Ut(t) {
405
+ function Lt(t) {
412
406
  return (e, n = {}) => {
413
407
  const r = e.match(t.matchPattern);
414
408
  if (!r) return null;
@@ -420,23 +414,23 @@ function Ut(t) {
420
414
  return { value: i, rest: c };
421
415
  };
422
416
  }
423
- const zt = /^(\d+)(th|st|nd|rd)?/i, Bt = /\d+/i, jt = {
417
+ const Rt = /^(\d+)(th|st|nd|rd)?/i, Ut = /\d+/i, Bt = {
424
418
  narrow: /^(b|a)/i,
425
419
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
426
420
  wide: /^(before christ|before common era|anno domini|common era)/i
427
- }, Qt = {
421
+ }, zt = {
428
422
  any: [/^b/i, /^(a|c)/i]
429
- }, Gt = {
423
+ }, Qt = {
430
424
  narrow: /^[1234]/i,
431
425
  abbreviated: /^q[1234]/i,
432
426
  wide: /^[1234](th|st|nd|rd)? quarter/i
433
- }, Xt = {
427
+ }, jt = {
434
428
  any: [/1/i, /2/i, /3/i, /4/i]
435
- }, Vt = {
429
+ }, Gt = {
436
430
  narrow: /^[jfmasond]/i,
437
431
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
438
432
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
439
- }, Jt = {
433
+ }, Xt = {
440
434
  narrow: [
441
435
  /^j/i,
442
436
  /^f/i,
@@ -465,18 +459,18 @@ const zt = /^(\d+)(th|st|nd|rd)?/i, Bt = /\d+/i, jt = {
465
459
  /^n/i,
466
460
  /^d/i
467
461
  ]
468
- }, Kt = {
462
+ }, Vt = {
469
463
  narrow: /^[smtwf]/i,
470
464
  short: /^(su|mo|tu|we|th|fr|sa)/i,
471
465
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
472
466
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
473
- }, Zt = {
467
+ }, Jt = {
474
468
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
475
469
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
476
- }, te = {
470
+ }, Kt = {
477
471
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
478
472
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
479
- }, ee = {
473
+ }, Zt = {
480
474
  any: {
481
475
  am: /^a/i,
482
476
  pm: /^p/i,
@@ -487,99 +481,99 @@ const zt = /^(\d+)(th|st|nd|rd)?/i, Bt = /\d+/i, jt = {
487
481
  evening: /evening/i,
488
482
  night: /night/i
489
483
  }
490
- }, ne = {
491
- ordinalNumber: Ut({
492
- matchPattern: zt,
493
- parsePattern: Bt,
484
+ }, te = {
485
+ ordinalNumber: Lt({
486
+ matchPattern: Rt,
487
+ parsePattern: Ut,
494
488
  valueCallback: (t) => parseInt(t, 10)
495
489
  }),
496
- era: N({
497
- matchPatterns: jt,
490
+ era: Y({
491
+ matchPatterns: Bt,
498
492
  defaultMatchWidth: "wide",
499
- parsePatterns: Qt,
493
+ parsePatterns: zt,
500
494
  defaultParseWidth: "any"
501
495
  }),
502
- quarter: N({
503
- matchPatterns: Gt,
496
+ quarter: Y({
497
+ matchPatterns: Qt,
504
498
  defaultMatchWidth: "wide",
505
- parsePatterns: Xt,
499
+ parsePatterns: jt,
506
500
  defaultParseWidth: "any",
507
501
  valueCallback: (t) => t + 1
508
502
  }),
509
- month: N({
510
- matchPatterns: Vt,
503
+ month: Y({
504
+ matchPatterns: Gt,
511
505
  defaultMatchWidth: "wide",
512
- parsePatterns: Jt,
506
+ parsePatterns: Xt,
513
507
  defaultParseWidth: "any"
514
508
  }),
515
- day: N({
516
- matchPatterns: Kt,
509
+ day: Y({
510
+ matchPatterns: Vt,
517
511
  defaultMatchWidth: "wide",
518
- parsePatterns: Zt,
512
+ parsePatterns: Jt,
519
513
  defaultParseWidth: "any"
520
514
  }),
521
- dayPeriod: N({
522
- matchPatterns: te,
515
+ dayPeriod: Y({
516
+ matchPatterns: Kt,
523
517
  defaultMatchWidth: "any",
524
- parsePatterns: ee,
518
+ parsePatterns: Zt,
525
519
  defaultParseWidth: "any"
526
520
  })
527
- }, re = {
521
+ }, ee = {
528
522
  code: "en-US",
529
- formatDistance: Tt,
530
- formatLong: $t,
531
- formatRelative: Wt,
532
- localize: qt,
533
- match: ne,
523
+ formatDistance: Mt,
524
+ formatLong: Pt,
525
+ formatRelative: $t,
526
+ localize: Ht,
527
+ match: te,
534
528
  options: {
535
529
  weekStartsOn: 0,
536
530
  firstWeekContainsDate: 1
537
531
  }
538
532
  };
539
- function ae(t, e) {
540
- const n = k(t, e == null ? void 0 : e.in);
541
- return wt(n, Mt(n)) + 1;
533
+ function ne(t, e) {
534
+ const n = D(t, e == null ? void 0 : e.in);
535
+ return yt(n, vt(n)) + 1;
542
536
  }
543
- function se(t, e) {
544
- const n = k(t, e == null ? void 0 : e.in), r = +I(n) - +bt(n);
545
- return Math.round(r / rt) + 1;
537
+ function re(t, e) {
538
+ const n = D(t, e == null ? void 0 : e.in), r = +q(n) - +pt(n);
539
+ return Math.round(r / at) + 1;
546
540
  }
547
541
  function ot(t, e) {
548
- var g, y, f, x;
549
- const n = k(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = q(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((y = (g = e == null ? void 0 : e.locale) == null ? void 0 : g.options) == null ? void 0 : y.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((x = (f = a.locale) == null ? void 0 : f.options) == null ? void 0 : x.firstWeekContainsDate) ?? 1, i = S((e == null ? void 0 : e.in) || t, 0);
542
+ var g, y, f, T;
543
+ const n = D(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = L(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((y = (g = e == null ? void 0 : e.locale) == null ? void 0 : g.options) == null ? void 0 : y.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((T = (f = a.locale) == null ? void 0 : f.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, i = M((e == null ? void 0 : e.in) || t, 0);
550
544
  i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
551
- const c = H(i, e), o = S((e == null ? void 0 : e.in) || t, 0);
545
+ const c = _(i, e), o = M((e == null ? void 0 : e.in) || t, 0);
552
546
  o.setFullYear(r, 0, s), o.setHours(0, 0, 0, 0);
553
- const d = H(o, e);
547
+ const d = _(o, e);
554
548
  return +n >= +c ? r + 1 : +n >= +d ? r : r - 1;
555
549
  }
556
- function ie(t, e) {
550
+ function ae(t, e) {
557
551
  var c, o, d, g;
558
- const n = q(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((o = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : o.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, a = ot(t, e), s = S((e == null ? void 0 : e.in) || t, 0);
559
- return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), H(s, e);
552
+ const n = L(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((o = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : o.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, a = ot(t, e), s = M((e == null ? void 0 : e.in) || t, 0);
553
+ return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), _(s, e);
560
554
  }
561
555
  function ct(t, e) {
562
- const n = k(t, e == null ? void 0 : e.in), r = +H(n, e) - +ie(n, e);
563
- return Math.round(r / rt) + 1;
556
+ const n = D(t, e == null ? void 0 : e.in), r = +_(n, e) - +ae(n, e);
557
+ return Math.round(r / at) + 1;
564
558
  }
565
- function l(t, e) {
559
+ function u(t, e) {
566
560
  const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
567
561
  return n + r;
568
562
  }
569
- const O = {
563
+ const x = {
570
564
  // Year
571
565
  y(t, e) {
572
566
  const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
573
- return l(e === "yy" ? r % 100 : r, e.length);
567
+ return u(e === "yy" ? r % 100 : r, e.length);
574
568
  },
575
569
  // Month
576
570
  M(t, e) {
577
571
  const n = t.getMonth();
578
- return e === "M" ? String(n + 1) : l(n + 1, 2);
572
+ return e === "M" ? String(n + 1) : u(n + 1, 2);
579
573
  },
580
574
  // Day of the month
581
575
  d(t, e) {
582
- return l(t.getDate(), e.length);
576
+ return u(t.getDate(), e.length);
583
577
  },
584
578
  // AM or PM
585
579
  a(t, e) {
@@ -599,35 +593,35 @@ const O = {
599
593
  },
600
594
  // Hour [1-12]
601
595
  h(t, e) {
602
- return l(t.getHours() % 12 || 12, e.length);
596
+ return u(t.getHours() % 12 || 12, e.length);
603
597
  },
604
598
  // Hour [0-23]
605
599
  H(t, e) {
606
- return l(t.getHours(), e.length);
600
+ return u(t.getHours(), e.length);
607
601
  },
608
602
  // Minute
609
603
  m(t, e) {
610
- return l(t.getMinutes(), e.length);
604
+ return u(t.getMinutes(), e.length);
611
605
  },
612
606
  // Second
613
607
  s(t, e) {
614
- return l(t.getSeconds(), e.length);
608
+ return u(t.getSeconds(), e.length);
615
609
  },
616
610
  // Fraction of second
617
611
  S(t, e) {
618
612
  const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
619
613
  r * Math.pow(10, n - 3)
620
614
  );
621
- return l(a, e.length);
615
+ return u(a, e.length);
622
616
  }
623
- }, E = {
617
+ }, C = {
624
618
  midnight: "midnight",
625
619
  noon: "noon",
626
620
  morning: "morning",
627
621
  afternoon: "afternoon",
628
622
  evening: "evening",
629
623
  night: "night"
630
- }, J = {
624
+ }, K = {
631
625
  // Era
632
626
  G: function(t, e, n) {
633
627
  const r = t.getFullYear() > 0 ? 1 : 0;
@@ -649,21 +643,21 @@ const O = {
649
643
  const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
650
644
  return n.ordinalNumber(a, { unit: "year" });
651
645
  }
652
- return O.y(t, e);
646
+ return x.y(t, e);
653
647
  },
654
648
  // Local week-numbering year
655
649
  Y: function(t, e, n, r) {
656
650
  const a = ot(t, r), s = a > 0 ? a : 1 - a;
657
651
  if (e === "YY") {
658
652
  const i = s % 100;
659
- return l(i, 2);
653
+ return u(i, 2);
660
654
  }
661
- return e === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : l(s, e.length);
655
+ return e === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : u(s, e.length);
662
656
  },
663
657
  // ISO week-numbering year
664
658
  R: function(t, e) {
665
659
  const n = st(t);
666
- return l(n, e.length);
660
+ return u(n, e.length);
667
661
  },
668
662
  // Extended year. This is a single number designating the year of this calendar system.
669
663
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -676,7 +670,7 @@ const O = {
676
670
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
677
671
  u: function(t, e) {
678
672
  const n = t.getFullYear();
679
- return l(n, e.length);
673
+ return u(n, e.length);
680
674
  },
681
675
  // Quarter
682
676
  Q: function(t, e, n) {
@@ -685,7 +679,7 @@ const O = {
685
679
  case "Q":
686
680
  return String(r);
687
681
  case "QQ":
688
- return l(r, 2);
682
+ return u(r, 2);
689
683
  case "Qo":
690
684
  return n.ordinalNumber(r, { unit: "quarter" });
691
685
  case "QQQ":
@@ -713,7 +707,7 @@ const O = {
713
707
  case "q":
714
708
  return String(r);
715
709
  case "qq":
716
- return l(r, 2);
710
+ return u(r, 2);
717
711
  case "qo":
718
712
  return n.ordinalNumber(r, { unit: "quarter" });
719
713
  case "qqq":
@@ -740,7 +734,7 @@ const O = {
740
734
  switch (e) {
741
735
  case "M":
742
736
  case "MM":
743
- return O.M(t, e);
737
+ return x.M(t, e);
744
738
  case "Mo":
745
739
  return n.ordinalNumber(r + 1, { unit: "month" });
746
740
  case "MMM":
@@ -765,7 +759,7 @@ const O = {
765
759
  case "L":
766
760
  return String(r + 1);
767
761
  case "LL":
768
- return l(r + 1, 2);
762
+ return u(r + 1, 2);
769
763
  case "Lo":
770
764
  return n.ordinalNumber(r + 1, { unit: "month" });
771
765
  case "LLL":
@@ -786,21 +780,21 @@ const O = {
786
780
  // Local week of year
787
781
  w: function(t, e, n, r) {
788
782
  const a = ct(t, r);
789
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : l(a, e.length);
783
+ return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : u(a, e.length);
790
784
  },
791
785
  // ISO week of year
792
786
  I: function(t, e, n) {
793
- const r = se(t);
794
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : l(r, e.length);
787
+ const r = re(t);
788
+ return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : u(r, e.length);
795
789
  },
796
790
  // Day of the month
797
791
  d: function(t, e, n) {
798
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : O.d(t, e);
792
+ return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : x.d(t, e);
799
793
  },
800
794
  // Day of year
801
795
  D: function(t, e, n) {
802
- const r = ae(t);
803
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : l(r, e.length);
796
+ const r = ne(t);
797
+ return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : u(r, e.length);
804
798
  },
805
799
  // Day of week
806
800
  E: function(t, e, n) {
@@ -838,7 +832,7 @@ const O = {
838
832
  case "e":
839
833
  return String(s);
840
834
  case "ee":
841
- return l(s, 2);
835
+ return u(s, 2);
842
836
  case "eo":
843
837
  return n.ordinalNumber(s, { unit: "day" });
844
838
  case "eee":
@@ -871,7 +865,7 @@ const O = {
871
865
  case "c":
872
866
  return String(s);
873
867
  case "cc":
874
- return l(s, e.length);
868
+ return u(s, e.length);
875
869
  case "co":
876
870
  return n.ordinalNumber(s, { unit: "day" });
877
871
  case "ccc":
@@ -904,7 +898,7 @@ const O = {
904
898
  case "i":
905
899
  return String(a);
906
900
  case "ii":
907
- return l(a, e.length);
901
+ return u(a, e.length);
908
902
  case "io":
909
903
  return n.ordinalNumber(a, { unit: "day" });
910
904
  case "iii":
@@ -962,7 +956,7 @@ const O = {
962
956
  b: function(t, e, n) {
963
957
  const r = t.getHours();
964
958
  let a;
965
- switch (r === 12 ? a = E.noon : r === 0 ? a = E.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
959
+ switch (r === 12 ? a = C.noon : r === 0 ? a = C.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
966
960
  case "b":
967
961
  case "bb":
968
962
  return n.dayPeriod(a, {
@@ -991,7 +985,7 @@ const O = {
991
985
  B: function(t, e, n) {
992
986
  const r = t.getHours();
993
987
  let a;
994
- switch (r >= 17 ? a = E.evening : r >= 12 ? a = E.afternoon : r >= 4 ? a = E.morning : a = E.night, e) {
988
+ switch (r >= 17 ? a = C.evening : r >= 12 ? a = C.afternoon : r >= 4 ? a = C.morning : a = C.night, e) {
995
989
  case "B":
996
990
  case "BB":
997
991
  case "BBB":
@@ -1018,33 +1012,33 @@ const O = {
1018
1012
  let r = t.getHours() % 12;
1019
1013
  return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1020
1014
  }
1021
- return O.h(t, e);
1015
+ return x.h(t, e);
1022
1016
  },
1023
1017
  // Hour [0-23]
1024
1018
  H: function(t, e, n) {
1025
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : O.H(t, e);
1019
+ return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : x.H(t, e);
1026
1020
  },
1027
1021
  // Hour [0-11]
1028
1022
  K: function(t, e, n) {
1029
1023
  const r = t.getHours() % 12;
1030
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : l(r, e.length);
1024
+ return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : u(r, e.length);
1031
1025
  },
1032
1026
  // Hour [1-24]
1033
1027
  k: function(t, e, n) {
1034
1028
  let r = t.getHours();
1035
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : l(r, e.length);
1029
+ return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : u(r, e.length);
1036
1030
  },
1037
1031
  // Minute
1038
1032
  m: function(t, e, n) {
1039
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : O.m(t, e);
1033
+ return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : x.m(t, e);
1040
1034
  },
1041
1035
  // Second
1042
1036
  s: function(t, e, n) {
1043
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : O.s(t, e);
1037
+ return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : x.s(t, e);
1044
1038
  },
1045
1039
  // Fraction of second
1046
1040
  S: function(t, e) {
1047
- return O.S(t, e);
1041
+ return x.S(t, e);
1048
1042
  },
1049
1043
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1050
1044
  X: function(t, e, n) {
@@ -1053,14 +1047,14 @@ const O = {
1053
1047
  return "Z";
1054
1048
  switch (e) {
1055
1049
  case "X":
1056
- return Z(r);
1050
+ return tt(r);
1057
1051
  case "XXXX":
1058
1052
  case "XX":
1059
- return $(r);
1053
+ return N(r);
1060
1054
  case "XXXXX":
1061
1055
  case "XXX":
1062
1056
  default:
1063
- return $(r, ":");
1057
+ return N(r, ":");
1064
1058
  }
1065
1059
  },
1066
1060
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1068,14 +1062,14 @@ const O = {
1068
1062
  const r = t.getTimezoneOffset();
1069
1063
  switch (e) {
1070
1064
  case "x":
1071
- return Z(r);
1065
+ return tt(r);
1072
1066
  case "xxxx":
1073
1067
  case "xx":
1074
- return $(r);
1068
+ return N(r);
1075
1069
  case "xxxxx":
1076
1070
  case "xxx":
1077
1071
  default:
1078
- return $(r, ":");
1072
+ return N(r, ":");
1079
1073
  }
1080
1074
  },
1081
1075
  // Timezone (GMT)
@@ -1085,10 +1079,10 @@ const O = {
1085
1079
  case "O":
1086
1080
  case "OO":
1087
1081
  case "OOO":
1088
- return "GMT" + K(r, ":");
1082
+ return "GMT" + Z(r, ":");
1089
1083
  case "OOOO":
1090
1084
  default:
1091
- return "GMT" + $(r, ":");
1085
+ return "GMT" + N(r, ":");
1092
1086
  }
1093
1087
  },
1094
1088
  // Timezone (specific non-location)
@@ -1098,34 +1092,34 @@ const O = {
1098
1092
  case "z":
1099
1093
  case "zz":
1100
1094
  case "zzz":
1101
- return "GMT" + K(r, ":");
1095
+ return "GMT" + Z(r, ":");
1102
1096
  case "zzzz":
1103
1097
  default:
1104
- return "GMT" + $(r, ":");
1098
+ return "GMT" + N(r, ":");
1105
1099
  }
1106
1100
  },
1107
1101
  // Seconds timestamp
1108
1102
  t: function(t, e, n) {
1109
1103
  const r = Math.trunc(+t / 1e3);
1110
- return l(r, e.length);
1104
+ return u(r, e.length);
1111
1105
  },
1112
1106
  // Milliseconds timestamp
1113
1107
  T: function(t, e, n) {
1114
- return l(+t, e.length);
1108
+ return u(+t, e.length);
1115
1109
  }
1116
1110
  };
1117
- function K(t, e = "") {
1111
+ function Z(t, e = "") {
1118
1112
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), s = r % 60;
1119
- return s === 0 ? n + String(a) : n + String(a) + e + l(s, 2);
1113
+ return s === 0 ? n + String(a) : n + String(a) + e + u(s, 2);
1120
1114
  }
1121
- function Z(t, e) {
1122
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + l(Math.abs(t) / 60, 2) : $(t, e);
1115
+ function tt(t, e) {
1116
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + u(Math.abs(t) / 60, 2) : N(t, e);
1123
1117
  }
1124
- function $(t, e = "") {
1125
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = l(Math.trunc(r / 60), 2), s = l(r % 60, 2);
1118
+ function N(t, e = "") {
1119
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = u(Math.trunc(r / 60), 2), s = u(r % 60, 2);
1126
1120
  return n + a + e + s;
1127
1121
  }
1128
- const tt = (t, e) => {
1122
+ const et = (t, e) => {
1129
1123
  switch (t) {
1130
1124
  case "P":
1131
1125
  return e.date({ width: "short" });
@@ -1137,7 +1131,7 @@ const tt = (t, e) => {
1137
1131
  default:
1138
1132
  return e.date({ width: "full" });
1139
1133
  }
1140
- }, lt = (t, e) => {
1134
+ }, ut = (t, e) => {
1141
1135
  switch (t) {
1142
1136
  case "p":
1143
1137
  return e.time({ width: "short" });
@@ -1149,10 +1143,10 @@ const tt = (t, e) => {
1149
1143
  default:
1150
1144
  return e.time({ width: "full" });
1151
1145
  }
1152
- }, oe = (t, e) => {
1146
+ }, se = (t, e) => {
1153
1147
  const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1154
1148
  if (!a)
1155
- return tt(t, e);
1149
+ return et(t, e);
1156
1150
  let s;
1157
1151
  switch (r) {
1158
1152
  case "P":
@@ -1169,51 +1163,51 @@ const tt = (t, e) => {
1169
1163
  s = e.dateTime({ width: "full" });
1170
1164
  break;
1171
1165
  }
1172
- return s.replace("{{date}}", tt(r, e)).replace("{{time}}", lt(a, e));
1173
- }, ce = {
1174
- p: lt,
1175
- P: oe
1176
- }, le = /^D+$/, ue = /^Y+$/, he = ["D", "DD", "YY", "YYYY"];
1177
- function de(t) {
1178
- return le.test(t);
1166
+ return s.replace("{{date}}", et(r, e)).replace("{{time}}", ut(a, e));
1167
+ }, ie = {
1168
+ p: ut,
1169
+ P: se
1170
+ }, oe = /^D+$/, ce = /^Y+$/, ue = ["D", "DD", "YY", "YYYY"];
1171
+ function le(t) {
1172
+ return oe.test(t);
1179
1173
  }
1180
- function fe(t) {
1181
- return ue.test(t);
1174
+ function he(t) {
1175
+ return ce.test(t);
1182
1176
  }
1183
- function me(t, e, n) {
1184
- const r = ge(t, e, n);
1185
- if (console.warn(r), he.includes(t)) throw new RangeError(r);
1177
+ function de(t, e, n) {
1178
+ const r = fe(t, e, n);
1179
+ if (console.warn(r), ue.includes(t)) throw new RangeError(r);
1186
1180
  }
1187
- function ge(t, e, n) {
1181
+ function fe(t, e, n) {
1188
1182
  const r = t[0] === "Y" ? "years" : "days of the month";
1189
1183
  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`;
1190
1184
  }
1191
- const ye = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, pe = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, we = /^'([^]*?)'?$/, be = /''/g, ke = /[a-zA-Z]/;
1192
- function ve(t, e, n) {
1193
- var g, y, f, x;
1194
- const r = q(), a = r.locale ?? re, s = r.firstWeekContainsDate ?? ((y = (g = r.locale) == null ? void 0 : g.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, i = r.weekStartsOn ?? ((x = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : x.weekStartsOn) ?? 0, c = k(t, n == null ? void 0 : n.in);
1195
- if (!vt(c))
1185
+ const me = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ge = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ye = /^'([^]*?)'?$/, pe = /''/g, we = /[a-zA-Z]/;
1186
+ function be(t, e, n) {
1187
+ var g, y, f, T;
1188
+ const r = L(), a = r.locale ?? ee, s = r.firstWeekContainsDate ?? ((y = (g = r.locale) == null ? void 0 : g.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, i = r.weekStartsOn ?? ((T = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : T.weekStartsOn) ?? 0, c = D(t, n == null ? void 0 : n.in);
1189
+ if (!bt(c))
1196
1190
  throw new RangeError("Invalid time value");
1197
- let o = e.match(pe).map((w) => {
1198
- const v = w[0];
1199
- if (v === "p" || v === "P") {
1200
- const R = ce[v];
1201
- return R(w, a.formatLong);
1191
+ let o = e.match(ge).map((p) => {
1192
+ const b = p[0];
1193
+ if (b === "p" || b === "P") {
1194
+ const U = ie[b];
1195
+ return U(p, a.formatLong);
1202
1196
  }
1203
- return w;
1204
- }).join("").match(ye).map((w) => {
1205
- if (w === "''")
1197
+ return p;
1198
+ }).join("").match(me).map((p) => {
1199
+ if (p === "''")
1206
1200
  return { isToken: !1, value: "'" };
1207
- const v = w[0];
1208
- if (v === "'")
1209
- return { isToken: !1, value: De(w) };
1210
- if (J[v])
1211
- return { isToken: !0, value: w };
1212
- if (v.match(ke))
1201
+ const b = p[0];
1202
+ if (b === "'")
1203
+ return { isToken: !1, value: De(p) };
1204
+ if (K[b])
1205
+ return { isToken: !0, value: p };
1206
+ if (b.match(we))
1213
1207
  throw new RangeError(
1214
- "Format string contains an unescaped latin alphabet character `" + v + "`"
1208
+ "Format string contains an unescaped latin alphabet character `" + b + "`"
1215
1209
  );
1216
- return { isToken: !1, value: w };
1210
+ return { isToken: !1, value: p };
1217
1211
  });
1218
1212
  a.localize.preprocessor && (o = a.localize.preprocessor(c, o));
1219
1213
  const d = {
@@ -1221,27 +1215,23 @@ function ve(t, e, n) {
1221
1215
  weekStartsOn: i,
1222
1216
  locale: a
1223
1217
  };
1224
- return o.map((w) => {
1225
- if (!w.isToken) return w.value;
1226
- const v = w.value;
1227
- (fe(v) || de(v)) && me(v, e, String(t));
1228
- const R = J[v[0]];
1229
- return R(c, v, a.localize, d);
1218
+ return o.map((p) => {
1219
+ if (!p.isToken) return p.value;
1220
+ const b = p.value;
1221
+ (he(b) || le(b)) && de(b, e, String(t));
1222
+ const U = K[b[0]];
1223
+ return U(c, b, a.localize, d);
1230
1224
  }).join("");
1231
1225
  }
1232
1226
  function De(t) {
1233
- const e = t.match(we);
1234
- return e ? e[1].replace(be, "'") : t;
1227
+ const e = t.match(ye);
1228
+ return e ? e[1].replace(pe, "'") : t;
1235
1229
  }
1236
- function Se(t, e) {
1237
- const n = k(t, e == null ? void 0 : e.in).getDay();
1230
+ function ke(t, e) {
1231
+ const n = D(t, e == null ? void 0 : e.in).getDay();
1238
1232
  return n === 0 ? 7 : n;
1239
1233
  }
1240
- function Me(t, e, n) {
1241
- const r = k(t, n == null ? void 0 : n.in);
1242
- return r.setHours(e), r;
1243
- }
1244
- const j = {}, Y = {};
1234
+ const j = {}, F = {};
1245
1235
  function A(t, e) {
1246
1236
  try {
1247
1237
  const r = (j[t] || (j[t] = new Intl.DateTimeFormat("en-GB", {
@@ -1249,30 +1239,30 @@ function A(t, e) {
1249
1239
  hour: "numeric",
1250
1240
  timeZoneName: "longOffset"
1251
1241
  }).format))(e).split("GMT")[1] || "";
1252
- return r in Y ? Y[r] : et(r, r.split(":"));
1242
+ return r in F ? F[r] : nt(r, r.split(":"));
1253
1243
  } catch {
1254
- if (t in Y) return Y[t];
1255
- const n = t == null ? void 0 : t.match(xe);
1256
- return n ? et(t, n.slice(1)) : NaN;
1244
+ if (t in F) return F[t];
1245
+ const n = t == null ? void 0 : t.match(ve);
1246
+ return n ? nt(t, n.slice(1)) : NaN;
1257
1247
  }
1258
1248
  }
1259
- const xe = /([+-]\d\d):?(\d\d)?/;
1260
- function et(t, e) {
1249
+ const ve = /([+-]\d\d):?(\d\d)?/;
1250
+ function nt(t, e) {
1261
1251
  const n = +e[0], r = +(e[1] || 0);
1262
- return Y[t] = n > 0 ? n * 60 + r : n * 60 - r;
1252
+ return F[t] = n > 0 ? n * 60 + r : n * 60 - r;
1263
1253
  }
1264
- class M extends Date {
1254
+ class S extends Date {
1265
1255
  //#region static
1266
1256
  constructor(...e) {
1267
- super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(A(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), ut(this), G(this)) : this.setTime(Date.now());
1257
+ super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(A(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), lt(this), X(this)) : this.setTime(Date.now());
1268
1258
  }
1269
1259
  static tz(e, ...n) {
1270
- return n.length ? new M(...n, e) : new M(Date.now(), e);
1260
+ return n.length ? new S(...n, e) : new S(Date.now(), e);
1271
1261
  }
1272
1262
  //#endregion
1273
1263
  //#region time zone
1274
1264
  withTimeZone(e) {
1275
- return new M(+this, e);
1265
+ return new S(+this, e);
1276
1266
  }
1277
1267
  getTimezoneOffset() {
1278
1268
  return -A(this.timeZone, this);
@@ -1280,34 +1270,34 @@ class M extends Date {
1280
1270
  //#endregion
1281
1271
  //#region time
1282
1272
  setTime(e) {
1283
- return Date.prototype.setTime.apply(this, arguments), G(this), +this;
1273
+ return Date.prototype.setTime.apply(this, arguments), X(this), +this;
1284
1274
  }
1285
1275
  //#endregion
1286
1276
  //#region date-fns integration
1287
1277
  [Symbol.for("constructDateFrom")](e) {
1288
- return new M(+new Date(e), this.timeZone);
1278
+ return new S(+new Date(e), this.timeZone);
1289
1279
  }
1290
1280
  //#endregion
1291
1281
  }
1292
- const nt = /^(get|set)(?!UTC)/;
1282
+ const rt = /^(get|set)(?!UTC)/;
1293
1283
  Object.getOwnPropertyNames(Date.prototype).forEach((t) => {
1294
- if (!nt.test(t)) return;
1295
- const e = t.replace(nt, "$1UTC");
1296
- M.prototype[e] && (t.startsWith("get") ? M.prototype[t] = function() {
1284
+ if (!rt.test(t)) return;
1285
+ const e = t.replace(rt, "$1UTC");
1286
+ S.prototype[e] && (t.startsWith("get") ? S.prototype[t] = function() {
1297
1287
  return this.internal[e]();
1298
- } : (M.prototype[t] = function() {
1299
- return Date.prototype[e].apply(this.internal, arguments), Te(this), +this;
1300
- }, M.prototype[e] = function() {
1301
- return Date.prototype[e].apply(this, arguments), G(this), +this;
1288
+ } : (S.prototype[t] = function() {
1289
+ return Date.prototype[e].apply(this.internal, arguments), Se(this), +this;
1290
+ }, S.prototype[e] = function() {
1291
+ return Date.prototype[e].apply(this, arguments), X(this), +this;
1302
1292
  }));
1303
1293
  });
1304
- function G(t) {
1294
+ function X(t) {
1305
1295
  t.internal.setTime(+t), t.internal.setUTCMinutes(t.internal.getUTCMinutes() - t.getTimezoneOffset());
1306
1296
  }
1307
- function Te(t) {
1308
- Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), ut(t);
1297
+ function Se(t) {
1298
+ Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), lt(t);
1309
1299
  }
1310
- function ut(t) {
1300
+ function lt(t) {
1311
1301
  const e = A(t.timeZone, t), n = /* @__PURE__ */ new Date(+t);
1312
1302
  n.setUTCHours(n.getUTCHours() - 1);
1313
1303
  const r = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), s = r - a, i = Date.prototype.getHours.apply(t) !== t.internal.getUTCHours();
@@ -1317,14 +1307,14 @@ function ut(t) {
1317
1307
  const o = A(t.timeZone, t), g = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - o, y = o !== e, f = g - c;
1318
1308
  if (y && f) {
1319
1309
  Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + f);
1320
- const x = A(t.timeZone, t), w = o - x;
1321
- w && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + w), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + w));
1310
+ const T = A(t.timeZone, t), p = o - T;
1311
+ p && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + p), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + p));
1322
1312
  }
1323
1313
  }
1324
- class T extends M {
1314
+ class E extends S {
1325
1315
  //#region static
1326
1316
  static tz(e, ...n) {
1327
- return n.length ? new T(...n, e) : new T(Date.now(), e);
1317
+ return n.length ? new E(...n, e) : new E(Date.now(), e);
1328
1318
  }
1329
1319
  //#endregion
1330
1320
  //#region representation
@@ -1341,7 +1331,7 @@ class T extends M {
1341
1331
  }
1342
1332
  toTimeString() {
1343
1333
  const e = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
1344
- return `${e} GMT${n}${r}${a} (${Oe(this.timeZone, this)})`;
1334
+ return `${e} GMT${n}${r}${a} (${Me(this.timeZone, this)})`;
1345
1335
  }
1346
1336
  toLocaleString(e, n) {
1347
1337
  return Date.prototype.toLocaleString.call(this, e, {
@@ -1369,48 +1359,70 @@ class T extends M {
1369
1359
  }
1370
1360
  //#endregion
1371
1361
  withTimeZone(e) {
1372
- return new T(+this, e);
1362
+ return new E(+this, e);
1373
1363
  }
1374
1364
  //#region date-fns integration
1375
1365
  [Symbol.for("constructDateFrom")](e) {
1376
- return new T(+new Date(e), this.timeZone);
1366
+ return new E(+new Date(e), this.timeZone);
1377
1367
  }
1378
1368
  //#endregion
1379
1369
  }
1380
- function Oe(t, e) {
1370
+ function Me(t, e) {
1381
1371
  return new Intl.DateTimeFormat("en-GB", {
1382
1372
  timeZone: t,
1383
1373
  timeZoneName: "long"
1384
1374
  }).format(e).slice(12);
1385
1375
  }
1386
1376
  window.pktTz = window.pktTz === void 0 ? "Europe/Oslo" : window.pktTz;
1387
- const b = (t) => t.toISOString().split("T")[0], Ie = (t) => {
1377
+ const Te = (t = window.pktTz) => {
1378
+ const e = new E((/* @__PURE__ */ new Date()).toISOString(), t);
1379
+ return e.setHours(0, 0, 0, 0), isNaN(e.getTime()) ? /* @__PURE__ */ new Date() : new Date(e.getFullYear(), e.getMonth(), e.getDate());
1380
+ };
1381
+ function $(t) {
1382
+ if (!t || t === "") return /* @__PURE__ */ new Date();
1383
+ if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
1384
+ const [e, n, r] = t.split("-").map(Number);
1385
+ return new Date(e, n - 1, r);
1386
+ }
1387
+ if (/^\d{4}-\d{2}$/.test(t)) {
1388
+ const [e, n] = t.split("-").map(Number);
1389
+ return new Date(e, n - 1, 1);
1390
+ }
1391
+ return /^\d{4}$/.test(t) ? new Date(Number(t), 0, 1) : new Date(t);
1392
+ }
1393
+ const w = (t) => {
1394
+ if (!t || isNaN(t.getTime())) return "";
1395
+ const e = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
1396
+ return `${e}-${n}-${r}`;
1397
+ }, _e = (t) => {
1388
1398
  if (!t)
1389
1399
  return null;
1390
- const e = at(new T(t, window.pktTz), 12);
1400
+ const e = $(t);
1391
1401
  return isNaN(e.getTime()) ? null : e;
1392
- }, qe = (t, e) => {
1393
- const n = p(t);
1394
- return isNaN(n.getTime()) ? "" : ve(n, e);
1395
- }, p = (t = "", e) => {
1396
- const n = t === "" || !t ? /* @__PURE__ */ new Date() : t;
1397
- return e ? new T(
1398
- e === "end" ? Dt(n) : Q(n),
1399
- window.pktTz
1400
- ) : Me(new T(n.toString(), window.pktTz), 12);
1401
- }, P = (t, e, n = 1) => at(new T(t, e, n, window.pktTz), 12), Pe = (t) => new Intl.DateTimeFormat("no", { dateStyle: "full", timeZone: window.pktTz }).format(t), Ce = (t) => {
1402
+ }, He = (t, e) => {
1403
+ const n = v(t);
1404
+ return isNaN(n.getTime()) ? "" : be(n, e);
1405
+ }, v = (t = "", e) => {
1406
+ const n = typeof t == "string" ? $(t) : t;
1407
+ return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : e ? e === "end" ? Dt(n) : G(n) : n;
1408
+ }, O = (t, e, n = 1) => {
1409
+ if (typeof t != "number" || typeof e != "number" || typeof n != "number" || isNaN(t) || isNaN(e) || isNaN(n))
1410
+ return /* @__PURE__ */ new Date();
1411
+ const r = new Date(t, e, n);
1412
+ return isNaN(r.getTime()) ? /* @__PURE__ */ new Date() : r;
1413
+ }, xe = (t) => !t || isNaN(t.getTime()) ? "" : new Intl.DateTimeFormat("no", { dateStyle: "full", timeZone: window.pktTz }).format(t), Oe = (t) => {
1402
1414
  if (Array.isArray(t)) return t;
1403
1415
  if (typeof t == "string") return t.split(",");
1404
- }, $e = (t) => t ? new Date(t) : null, Ee = (t) => {
1416
+ }, Pe = (t) => t ? $(t) : null, Ne = (t) => {
1405
1417
  if (typeof t == "string")
1406
- return t.split(",").map((e) => new Date(e));
1418
+ return t.split(",").map((e) => $(e));
1407
1419
  if (Array.isArray(t))
1408
- return t.map((e) => new Date(e));
1409
- }, L = {
1410
- csvToArray: Ce,
1411
- stringToDate: $e,
1412
- stringsToDate: Ee
1413
- }, We = {
1420
+ return t.map((e) => $(e));
1421
+ }, R = {
1422
+ csvToArray: Oe,
1423
+ stringToDate: Pe,
1424
+ stringsToDate: Ne
1425
+ }, $e = {
1414
1426
  earliest: {
1415
1427
  default: null
1416
1428
  },
@@ -1432,17 +1444,17 @@ const b = (t) => t.toISOString().split("T")[0], Ie = (t) => {
1432
1444
  range: {
1433
1445
  default: !1
1434
1446
  }
1435
- }, C = {
1436
- props: We
1447
+ }, P = {
1448
+ props: $e
1437
1449
  };
1438
- var Ne = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, h = (t, e, n, r) => {
1439
- for (var a = r > 1 ? void 0 : r ? Ye(e, n) : e, s = t.length - 1, i; s >= 0; s--)
1450
+ var Ce = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, h = (t, e, n, r) => {
1451
+ for (var a = r > 1 ? void 0 : r ? Ee(e, n) : e, s = t.length - 1, i; s >= 0; s--)
1440
1452
  (i = t[s]) && (a = (r ? i(e, n, a) : i(a)) || a);
1441
- return r && a && Ne(e, n, a), a;
1453
+ return r && a && Ce(e, n, a), a;
1442
1454
  };
1443
- let u = class extends dt {
1455
+ let l = class extends dt {
1444
1456
  constructor() {
1445
- super(...arguments), this.multiple = C.props.multiple.default, this.maxMultiple = C.props.maxMultiple.default, this.range = C.props.range.default, this.weeknumbers = C.props.weeknumbers.default, this.withcontrols = C.props.withcontrols.default, this.selected = [], this.earliest = C.props.earliest.default, this.latest = C.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.dayStrings = this.strings.dates.daysShort, this.dayStringsLong = this.strings.dates.days, this.monthStrings = this.strings.dates.months, this.weekString = this.strings.dates.week, this.prevMonthString = this.strings.dates.prevMonth, this.nextMonthString = this.strings.dates.nextMonth, this._selected = [], this.year = 0, this.month = 0, this.week = 0, this.rangeHovered = null, this.inRange = {}, this.focusedDate = null, this.selectableDates = [], this.currentmonthtouched = !1, this.tabIndexSet = 0;
1457
+ super(...arguments), this.multiple = P.props.multiple.default, this.maxMultiple = P.props.maxMultiple.default, this.range = P.props.range.default, this.weeknumbers = P.props.weeknumbers.default, this.withcontrols = P.props.withcontrols.default, this.selected = [], this.earliest = P.props.earliest.default, this.latest = P.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.dayStrings = this.strings.dates.daysShort, this.dayStringsLong = this.strings.dates.days, this.monthStrings = this.strings.dates.months, this.weekString = this.strings.dates.week, this.prevMonthString = this.strings.dates.prevMonth, this.nextMonthString = this.strings.dates.nextMonth, this._selected = [], this.year = 0, this.month = 0, this.week = 0, this.rangeHovered = null, this.inRange = {}, this.focusedDate = null, this.selectableDates = [], this.currentmonthtouched = !1, this.tabIndexSet = 0;
1446
1458
  }
1447
1459
  /**
1448
1460
  * Runs on mount, used to set up various values and whatever you need to run
@@ -1463,15 +1475,15 @@ let u = class extends dt {
1463
1475
  this.addEventListener("keydown", this.handleKeydown);
1464
1476
  }
1465
1477
  convertSelected() {
1466
- if (typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected = this.selected.map((t) => p(t)), this.range && this.selected.length === 2) {
1478
+ if (typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected = this.selected.map((t) => $(t)), this.range && this.selected.length === 2) {
1467
1479
  const t = z({
1468
- start: p(this.selected[0]),
1469
- end: p(this.selected[1])
1480
+ start: this._selected[0],
1481
+ end: this._selected[1]
1470
1482
  });
1471
1483
  if (this.inRange = {}, Array.isArray(t) && t.length) {
1472
1484
  const e = {};
1473
1485
  for (let n = 0; n < t.length; n++)
1474
- e[b(t[n])] = this.isInRange(t[n]);
1486
+ e[w(t[n])] = this.isInRange(t[n]);
1475
1487
  this.inRange = e;
1476
1488
  }
1477
1489
  }
@@ -1482,7 +1494,11 @@ let u = class extends dt {
1482
1494
  this.currentmonthtouched = !0;
1483
1495
  return;
1484
1496
  }
1485
- this.selected.length && this.selected[0] !== "" ? this.currentmonth = p(this.selected[this.selected.length - 1]) : this.currentmonth === null && (this.currentmonth = p()), this.year = this.currentmonth.getFullYear(), this.month = this.currentmonth.getMonth();
1497
+ if (this.selected.length && this.selected[0] !== "") {
1498
+ const t = $(this.selected[this.selected.length - 1]);
1499
+ this.currentmonth = isNaN(t.getTime()) ? /* @__PURE__ */ new Date() : t;
1500
+ } else this.currentmonth === null && (this.currentmonth = /* @__PURE__ */ new Date());
1501
+ (!this.currentmonth || isNaN(this.currentmonth.getTime())) && (this.currentmonth = /* @__PURE__ */ new Date()), this.year = this.currentmonth.getFullYear(), this.month = this.currentmonth.getMonth();
1486
1502
  }
1487
1503
  handleKeydown(t) {
1488
1504
  switch (t.key) {
@@ -1504,19 +1520,19 @@ let u = class extends dt {
1504
1520
  var a, s, i;
1505
1521
  if (((a = t.target) == null ? void 0 : a.nodeName) === "INPUT" || ((s = t.target) == null ? void 0 : s.nodeName) === "SELECT" || ((i = t.target) == null ? void 0 : i.nodeName) === "BUTTON") return;
1506
1522
  t.preventDefault(), this.focusedDate || this.focusOnCurrentDate();
1507
- const n = this.focusedDate ? p(this.focusedDate) : P(this.year, this.month, 1);
1508
- let r = U(n, e);
1523
+ const n = this.focusedDate ? v(this.focusedDate) : O(this.year, this.month, 1);
1524
+ let r = B(n, e);
1509
1525
  if (r) {
1510
- let c = this.querySelector(`div[data-date="${b(r)}"]`);
1526
+ let c = this.querySelector(`div[data-date="${w(r)}"]`);
1511
1527
  if (c instanceof HTMLDivElement) {
1512
1528
  if (c.dataset.disabled) {
1513
- r = U(r, e);
1514
- let o = this.querySelector(`div[data-date="${b(r)}"]`);
1529
+ r = B(r, e);
1530
+ let o = this.querySelector(`div[data-date="${w(r)}"]`);
1515
1531
  for (; o && o instanceof HTMLDivElement && o.dataset.disabled; )
1516
- r = U(r, e), o = this.querySelector(`div[data-date="${b(r)}"]`);
1532
+ r = B(r, e), o = this.querySelector(`div[data-date="${w(r)}"]`);
1517
1533
  c = o;
1518
1534
  }
1519
- c instanceof HTMLDivElement && !c.dataset.disabled && (this.focusedDate = b(r), c.focus());
1535
+ c instanceof HTMLDivElement && !c.dataset.disabled && (this.focusedDate = w(r), c.focus());
1520
1536
  }
1521
1537
  }
1522
1538
  }
@@ -1524,9 +1540,9 @@ let u = class extends dt {
1524
1540
  * Component functionality and render
1525
1541
  */
1526
1542
  render() {
1527
- return D`
1543
+ return k`
1528
1544
  <div
1529
- class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : _}"
1545
+ class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : I}"
1530
1546
  @focusout=${this.closeEvent}
1531
1547
  @keydown=${(t) => {
1532
1548
  t.key === "Escape" && (t.preventDefault(), this.close());
@@ -1541,7 +1557,7 @@ let u = class extends dt {
1541
1557
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.isNextMonthAllowed() && this.prevMonth());
1542
1558
  }}
1543
1559
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${this.isPrevMonthAllowed() ? "" : "pkt-hide"}"
1544
- .data-disabled=${this.isPrevMonthAllowed() ? _ : "disabled"}
1560
+ .data-disabled=${this.isPrevMonthAllowed() ? I : "disabled"}
1545
1561
  ?aria-disabled=${!this.isPrevMonthAllowed()}
1546
1562
  tabindex=${this.isPrevMonthAllowed() ? "0" : "-1"}
1547
1563
  >
@@ -1558,7 +1574,7 @@ let u = class extends dt {
1558
1574
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.isNextMonthAllowed() && this.nextMonth());
1559
1575
  }}
1560
1576
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${this.isNextMonthAllowed() ? "" : "pkt-hide"}"
1561
- .data-disabled=${this.isNextMonthAllowed() ? _ : "disabled"}
1577
+ .data-disabled=${this.isNextMonthAllowed() ? I : "disabled"}
1562
1578
  ?aria-disabled=${!this.isNextMonthAllowed()}
1563
1579
  tabindex=${this.isNextMonthAllowed() ? "0" : "-1"}
1564
1580
  >
@@ -1584,19 +1600,19 @@ let u = class extends dt {
1584
1600
  }
1585
1601
  renderDayNames() {
1586
1602
  const t = [];
1587
- this.weeknumbers && t.push(D`<th><div>${this.weekString}</div></th>`);
1603
+ this.weeknumbers && t.push(k`<th><div>${this.weekString}</div></th>`);
1588
1604
  for (let e = 0; e < this.dayStrings.length; e++)
1589
1605
  t.push(
1590
- D`<th><div aria-label="${this.dayStringsLong[e]}">${this.dayStrings[e]}</div></th>`
1606
+ k`<th><div aria-label="${this.dayStringsLong[e]}">${this.dayStrings[e]}</div></th>`
1591
1607
  );
1592
- return D`<tr class="pkt-cal-week-row">
1608
+ return k`<tr class="pkt-cal-week-row">
1593
1609
  ${t}
1594
1610
  </tr>`;
1595
1611
  }
1596
1612
  renderMonthNav() {
1597
1613
  let t = [];
1598
1614
  return this.withcontrols ? t.push(
1599
- D`<div class="pkt-cal-month-picker">
1615
+ k`<div class="pkt-cal-month-picker">
1600
1616
  <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
1601
1617
  <select
1602
1618
  aria-label="${this.strings.dates.month}"
@@ -1607,7 +1623,7 @@ let u = class extends dt {
1607
1623
  }}
1608
1624
  >
1609
1625
  ${this.monthStrings.map(
1610
- (e, n) => D`<option value=${n} ?selected=${this.month === n}>${e}</option>`
1626
+ (e, n) => k`<option value=${n} ?selected=${this.month === n}>${e}</option>`
1611
1627
  )}
1612
1628
  </select>
1613
1629
  <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
@@ -1625,14 +1641,14 @@ let u = class extends dt {
1625
1641
  />
1626
1642
  </div> `
1627
1643
  ) : t.push(
1628
- D`<div class="pkt-txt-16-medium" aria-live="polite">
1644
+ k`<div class="pkt-txt-16-medium" aria-live="polite">
1629
1645
  ${this.monthStrings[this.month]} ${this.year}
1630
1646
  </div>`
1631
1647
  ), t;
1632
1648
  }
1633
1649
  renderDayView(t, e, n) {
1634
1650
  var y;
1635
- const r = P(this.year, this.month, t), a = b(r), s = a === b(e), i = this.selected.includes(a), c = Pe(r), o = this.isExcluded(n, r) || !i && this.multiple && this.maxMultiple > 0 && this.selected.length >= this.maxMultiple, d = this.focusedDate ? this.focusedDate === a && !o ? "0" : "-1" : !o && this.tabIndexSet === 0 || this.tabIndexSet === t ? "0" : "-1";
1651
+ const r = O(this.year, this.month, t), a = w(r), s = a === w(e), i = this.selected.includes(a), c = xe(r), o = this.isExcluded(n, r) || !i && this.multiple && this.maxMultiple > 0 && this.selected.length >= this.maxMultiple, d = this.focusedDate ? this.focusedDate === a && !o ? "0" : "-1" : !o && this.tabIndexSet === 0 || this.tabIndexSet === t ? "0" : "-1";
1636
1652
  d === "0" && (this.tabIndexSet = t), this.selectableDates.push({ currentDateISO: a, isDisabled: o, tabindex: d });
1637
1653
  const g = {
1638
1654
  "pkt-cal-today": s,
@@ -1641,9 +1657,9 @@ let u = class extends dt {
1641
1657
  "pkt-cal-excluded": this.isExcluded(n, r),
1642
1658
  "pkt-cal-in-range-first": this.range && (this.selected.length === 2 || this.rangeHovered !== null) && a === this.selected[0],
1643
1659
  "pkt-cal-in-range-last": this.range && this.selected.length === 2 && a === this.selected[1],
1644
- "pkt-cal-range-hover": this.rangeHovered !== null && a === b(this.rangeHovered)
1660
+ "pkt-cal-range-hover": this.rangeHovered !== null && a === w(this.rangeHovered)
1645
1661
  };
1646
- return D`<td class=${ht(g)}>
1662
+ return k`<td class=${ht(g)}>
1647
1663
  <div
1648
1664
  ?aria-selected=${i}
1649
1665
  role="gridcell"
@@ -1654,7 +1670,7 @@ let u = class extends dt {
1654
1670
  }}
1655
1671
  aria-label="${c}"
1656
1672
  tabindex=${(y = this.selectableDates.find((f) => f.currentDateISO === a)) == null ? void 0 : y.tabindex}
1657
- data-disabled=${o ? "disabled" : _}
1673
+ data-disabled=${o ? "disabled" : I}
1658
1674
  data-date=${a}
1659
1675
  @keydown=${(f) => {
1660
1676
  (f.key === "Enter" || f.key === " ") && (f.preventDefault(), this.handleDateSelect(r));
@@ -1668,28 +1684,28 @@ let u = class extends dt {
1668
1684
  </td>`;
1669
1685
  }
1670
1686
  renderCalendarBody() {
1671
- const t = p(), e = P(this.year, this.month, 1), n = P(this.year, this.month + 1, 0), r = (e.getDay() + 6) % 7, a = n.getDate(), s = Math.ceil((a + r) / 7), c = P(this.year, this.month, 0).getDate();
1687
+ const t = Te(), e = O(this.year, this.month, 1), n = O(this.year, this.month + 1, 0), r = (e.getDay() + 6) % 7, a = n.getDate(), s = Math.ceil((a + r) / 7), c = O(this.year, this.month, 0).getDate();
1672
1688
  let o = 1;
1673
- this.week = ct(P(this.year, this.month, 1));
1689
+ this.week = ct(O(this.year, this.month, 1));
1674
1690
  const d = [];
1675
1691
  for (let g = 0; g < s; g++) {
1676
1692
  const y = [];
1677
- this.weeknumbers && y.push(D`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
1693
+ this.weeknumbers && y.push(k`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
1678
1694
  for (let f = 1; f < 8; f++)
1679
1695
  if (g === 0 && f < r + 1) {
1680
- const x = c - (r - f);
1696
+ const T = c - (r - f);
1681
1697
  y.push(
1682
- D`<td class="pkt-cal-other">
1698
+ k`<td class="pkt-cal-other">
1683
1699
  <div
1684
1700
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
1685
1701
  data-disabled="disabled"
1686
1702
  >
1687
- <span class="pkt-btn__text pkt-txt-14-light">${x}</span>
1703
+ <span class="pkt-btn__text pkt-txt-14-light">${T}</span>
1688
1704
  </div>
1689
1705
  </td>`
1690
1706
  );
1691
1707
  } else o > a ? (y.push(
1692
- D`<td class="pkt-cal-other">
1708
+ k`<td class="pkt-cal-other">
1693
1709
  <div
1694
1710
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
1695
1711
  data-disabled="disabled"
@@ -1699,7 +1715,7 @@ let u = class extends dt {
1699
1715
  </td>`
1700
1716
  ), o++) : (y.push(this.renderDayView(o, t, f)), o++);
1701
1717
  d.push(
1702
- D`<tr class="pkt-cal-week-row" role="row">
1718
+ k`<tr class="pkt-cal-week-row" role="row">
1703
1719
  ${y}
1704
1720
  </tr>`
1705
1721
  );
@@ -1707,23 +1723,23 @@ let u = class extends dt {
1707
1723
  return d;
1708
1724
  }
1709
1725
  isExcluded(t, e) {
1710
- return this.excludeweekdays.includes(t.toString()) || this.earliest && p(e, "end") < p(this.earliest, "start") || this.latest && p(e, "start") > p(this.latest, "end") ? !0 : this.excludedates.some((n) => typeof n == "string" ? n === b(e) : n.toDateString() === e.toDateString());
1726
+ return this.excludeweekdays.includes(t.toString()) || this.earliest && v(e, "end") < v(this.earliest, "start") || this.latest && v(e, "start") > v(this.latest, "end") ? !0 : this.excludedates.some((n) => typeof n == "string" ? n === w(e) : n.toDateString() === e.toDateString());
1711
1727
  }
1712
1728
  isPrevMonthAllowed() {
1713
- const t = P(this.year, this.month, 0);
1714
- return !(this.earliest && p(this.earliest) > t);
1729
+ const t = O(this.year, this.month, 0);
1730
+ return !(this.earliest && v(this.earliest) > t);
1715
1731
  }
1716
1732
  prevMonth() {
1717
1733
  const t = this.month === 0 ? 11 : this.month - 1, e = this.month === 0 ? this.year - 1 : this.year;
1718
1734
  this.changeMonth(e, t);
1719
1735
  }
1720
1736
  isNextMonthAllowed() {
1721
- const t = P(
1737
+ const t = O(
1722
1738
  this.month === 11 ? this.year + 1 : this.year,
1723
1739
  this.month === 11 ? 0 : this.month + 1,
1724
1740
  1
1725
1741
  );
1726
- return !(this.latest && p(this.latest) < t);
1742
+ return !(this.latest && v(this.latest) < t);
1727
1743
  }
1728
1744
  nextMonth() {
1729
1745
  const t = this.month === 11 ? 0 : this.month + 1, e = this.month === 11 ? this.year + 1 : this.year;
@@ -1734,8 +1750,8 @@ let u = class extends dt {
1734
1750
  }
1735
1751
  isInRange(t) {
1736
1752
  if (this.range && this.selected.length === 2) {
1737
- if (t > p(this.selected[0]) && t < p(this.selected[1])) return !0;
1738
- } else if (this.range && this.selected.length === 1 && this.rangeHovered && t > p(this.selected[0]) && t < this.rangeHovered)
1753
+ if (t > v(this.selected[0]) && t < v(this.selected[1])) return !0;
1754
+ } else if (this.range && this.selected.length === 1 && this.rangeHovered && t > v(this.selected[0]) && t < this.rangeHovered)
1739
1755
  return !0;
1740
1756
  return !1;
1741
1757
  }
@@ -1750,7 +1766,7 @@ let u = class extends dt {
1750
1766
  for (let r = 0; r < n.length; r++)
1751
1767
  this.excludedates.forEach((a) => {
1752
1768
  a > this._selected[0] && a < t && (e = !1);
1753
- }), this.excludeweekdays.includes(Se(n[r]).toString()) && (e = !1);
1769
+ }), this.excludeweekdays.includes(ke(n[r]).toString()) && (e = !1);
1754
1770
  }
1755
1771
  return e;
1756
1772
  }
@@ -1758,22 +1774,22 @@ let u = class extends dt {
1758
1774
  this.selected = [], this._selected = [], this.inRange = {};
1759
1775
  }
1760
1776
  addToSelected(t) {
1761
- this.selected.includes(b(t)) || (this.selected = [...this.selected, b(t)], this._selected = [...this._selected, t], this.range && this.selected.length === 2 && this.close());
1777
+ this.selected.includes(w(t)) || (this.selected = [...this.selected, w(t)], this._selected = [...this._selected, t], this.range && this.selected.length === 2 && this.close());
1762
1778
  }
1763
1779
  removeFromSelected(t) {
1764
1780
  if (this.selected.length === 1)
1765
1781
  this.emptySelected();
1766
1782
  else {
1767
- const e = this.selected.indexOf(b(t)), n = [...this.selected], r = [...this._selected];
1783
+ const e = this.selected.indexOf(w(t)), n = [...this.selected], r = [...this._selected];
1768
1784
  n.splice(e, 1), r.splice(e, 1), this.selected = n, this._selected = r;
1769
1785
  }
1770
1786
  }
1771
1787
  toggleSelected(t) {
1772
- const e = b(t);
1788
+ const e = w(t);
1773
1789
  this.selected.includes(e) ? this.removeFromSelected(t) : this.maxMultiple && this.selected.length >= this.maxMultiple || this.addToSelected(t);
1774
1790
  }
1775
1791
  handleRangeSelect(t) {
1776
- const e = b(t);
1792
+ const e = w(t);
1777
1793
  return this.selected.includes(e) ? this.selected.indexOf(e) === 0 ? this.emptySelected() : this.removeFromSelected(t) : this.selected.length > 1 ? (this.emptySelected(), this.addToSelected(t)) : (this.selected.length === 1 && !this.isRangeAllowed(t) && this.emptySelected(), this.selected.length === 1 && this._selected[0] > t && this.emptySelected(), this.addToSelected(t)), Promise.resolve();
1778
1794
  }
1779
1795
  handleRangeHover(t) {
@@ -1785,13 +1801,13 @@ let u = class extends dt {
1785
1801
  });
1786
1802
  if (Array.isArray(e) && e.length)
1787
1803
  for (let n = 0; n < e.length; n++)
1788
- this.inRange[b(e[n])] = this.isInRange(e[n]);
1804
+ this.inRange[w(e[n])] = this.isInRange(e[n]);
1789
1805
  } else
1790
1806
  this.rangeHovered = null;
1791
1807
  }
1792
1808
  handleDateSelect(t) {
1793
1809
  if (t)
1794
- return this.range ? this.handleRangeSelect(t) : this.multiple ? this.toggleSelected(t) : (this.selected.includes(b(t)) ? this.emptySelected() : (this.emptySelected(), this.addToSelected(t)), this.close()), this.dispatchEvent(
1810
+ return this.range ? this.handleRangeSelect(t) : this.multiple ? this.toggleSelected(t) : (this.selected.includes(w(t)) ? this.emptySelected() : (this.emptySelected(), this.addToSelected(t)), this.close()), this.dispatchEvent(
1795
1811
  new CustomEvent("date-selected", {
1796
1812
  detail: this.selected,
1797
1813
  bubbles: !0,
@@ -1800,7 +1816,7 @@ let u = class extends dt {
1800
1816
  ), Promise.resolve();
1801
1817
  }
1802
1818
  focusOnCurrentDate() {
1803
- const t = b(p()), e = this.querySelector(`div[data-date="${t}"]`);
1819
+ const t = w(v()), e = this.querySelector(`div[data-date="${t}"]`);
1804
1820
  if (e instanceof HTMLDivElement)
1805
1821
  this.focusedDate = t, e.focus();
1806
1822
  else {
@@ -1828,94 +1844,94 @@ let u = class extends dt {
1828
1844
  };
1829
1845
  h([
1830
1846
  m({ type: Boolean })
1831
- ], u.prototype, "multiple", 2);
1847
+ ], l.prototype, "multiple", 2);
1832
1848
  h([
1833
1849
  m({ type: Number })
1834
- ], u.prototype, "maxMultiple", 2);
1850
+ ], l.prototype, "maxMultiple", 2);
1835
1851
  h([
1836
1852
  m({ type: Boolean })
1837
- ], u.prototype, "range", 2);
1853
+ ], l.prototype, "range", 2);
1838
1854
  h([
1839
1855
  m({ type: Boolean })
1840
- ], u.prototype, "weeknumbers", 2);
1856
+ ], l.prototype, "weeknumbers", 2);
1841
1857
  h([
1842
1858
  m({ type: Boolean })
1843
- ], u.prototype, "withcontrols", 2);
1859
+ ], l.prototype, "withcontrols", 2);
1844
1860
  h([
1845
- m({ converter: L.csvToArray })
1846
- ], u.prototype, "selected", 2);
1861
+ m({ converter: R.csvToArray })
1862
+ ], l.prototype, "selected", 2);
1847
1863
  h([
1848
1864
  m({ type: String })
1849
- ], u.prototype, "earliest", 2);
1865
+ ], l.prototype, "earliest", 2);
1850
1866
  h([
1851
1867
  m({ type: String })
1852
- ], u.prototype, "latest", 2);
1868
+ ], l.prototype, "latest", 2);
1853
1869
  h([
1854
- m({ converter: L.stringsToDate })
1855
- ], u.prototype, "excludedates", 2);
1870
+ m({ converter: R.stringsToDate })
1871
+ ], l.prototype, "excludedates", 2);
1856
1872
  h([
1857
- m({ converter: L.csvToArray })
1858
- ], u.prototype, "excludeweekdays", 2);
1873
+ m({ converter: R.csvToArray })
1874
+ ], l.prototype, "excludeweekdays", 2);
1859
1875
  h([
1860
- m({ converter: L.stringToDate })
1861
- ], u.prototype, "currentmonth", 2);
1876
+ m({ converter: R.stringToDate })
1877
+ ], l.prototype, "currentmonth", 2);
1862
1878
  h([
1863
1879
  m({ type: Array })
1864
- ], u.prototype, "dayStrings", 2);
1880
+ ], l.prototype, "dayStrings", 2);
1865
1881
  h([
1866
1882
  m({ type: Array })
1867
- ], u.prototype, "dayStringsLong", 2);
1883
+ ], l.prototype, "dayStringsLong", 2);
1868
1884
  h([
1869
1885
  m({ type: Array })
1870
- ], u.prototype, "monthStrings", 2);
1886
+ ], l.prototype, "monthStrings", 2);
1871
1887
  h([
1872
1888
  m({ type: String })
1873
- ], u.prototype, "weekString", 2);
1889
+ ], l.prototype, "weekString", 2);
1874
1890
  h([
1875
1891
  m({ type: String })
1876
- ], u.prototype, "prevMonthString", 2);
1892
+ ], l.prototype, "prevMonthString", 2);
1877
1893
  h([
1878
1894
  m({ type: String })
1879
- ], u.prototype, "nextMonthString", 2);
1895
+ ], l.prototype, "nextMonthString", 2);
1880
1896
  h([
1881
1897
  m({ type: Array })
1882
- ], u.prototype, "_selected", 2);
1898
+ ], l.prototype, "_selected", 2);
1883
1899
  h([
1884
1900
  m({ type: Number })
1885
- ], u.prototype, "year", 2);
1901
+ ], l.prototype, "year", 2);
1886
1902
  h([
1887
1903
  m({ type: Number })
1888
- ], u.prototype, "month", 2);
1904
+ ], l.prototype, "month", 2);
1889
1905
  h([
1890
1906
  m({ type: Number })
1891
- ], u.prototype, "week", 2);
1907
+ ], l.prototype, "week", 2);
1892
1908
  h([
1893
1909
  m({ type: Date })
1894
- ], u.prototype, "rangeHovered", 2);
1910
+ ], l.prototype, "rangeHovered", 2);
1895
1911
  h([
1896
- F()
1897
- ], u.prototype, "inRange", 2);
1912
+ H()
1913
+ ], l.prototype, "inRange", 2);
1898
1914
  h([
1899
- F()
1900
- ], u.prototype, "focusedDate", 2);
1915
+ H()
1916
+ ], l.prototype, "focusedDate", 2);
1901
1917
  h([
1902
- F()
1903
- ], u.prototype, "selectableDates", 2);
1918
+ H()
1919
+ ], l.prototype, "selectableDates", 2);
1904
1920
  h([
1905
- F()
1906
- ], u.prototype, "currentmonthtouched", 2);
1921
+ H()
1922
+ ], l.prototype, "currentmonthtouched", 2);
1907
1923
  h([
1908
- F()
1909
- ], u.prototype, "tabIndexSet", 2);
1910
- u = h([
1924
+ H()
1925
+ ], l.prototype, "tabIndexSet", 2);
1926
+ l = h([
1911
1927
  ft("pkt-calendar")
1912
- ], u);
1928
+ ], l);
1913
1929
  export {
1914
- u as P,
1915
- b as a,
1916
- qe as b,
1917
- Ce as c,
1918
- L as d,
1919
- Ie as f,
1920
- p as n
1930
+ l as P,
1931
+ w as a,
1932
+ He as b,
1933
+ Oe as c,
1934
+ R as d,
1935
+ _e as f,
1936
+ v as n
1921
1937
  };