@oslokommune/punkt-elements 12.6.7 → 12.6.9

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,63 +1,63 @@
1
- import { T as K, a as z, x as M, E as N, n as y } from "./index-CF6_-ZoF.js";
2
- import { e as Z, i as tt, a as et, t as nt } from "./directive-Cxhakbpr.js";
3
- import { p as at, v as O, r as S, M as Y, m as rt, e as C, n as P } from "./ref-rfvuMlT1.js";
1
+ import { T as K, a as z, x as M, E as B, n as g } from "./index-CF6_-ZoF.js";
2
+ import { e as Z, i as ee, a as te, t as ne } from "./directive-Cxhakbpr.js";
3
+ import { p as ae, v as O, r as S, M as Y, m as re, e as C, n as P } from "./ref-rfvuMlT1.js";
4
4
  import { e as R } from "./class-map-luGhSuLj.js";
5
5
  import { a as G } from "./converters-DNCwIFwr.js";
6
- import { s as it, t as k, c as _, m as st, a as ot, g as ut, b as lt, d as dt } from "./index-BkXggpNp.js";
6
+ import { s as ie, t as k, c as _, m as se, a as oe, g as ue, b as le, d as de } from "./index-BkXggpNp.js";
7
7
  import "./pkt-input-wrapper.js";
8
8
  import "./index-B-KXmo65.js";
9
9
  import "./pkt-tag.js";
10
- function I(t) {
11
- return it(t, { weekStartsOn: 1 });
10
+ function I(e) {
11
+ return ie(e, { weekStartsOn: 1 });
12
12
  }
13
- function U(t) {
14
- const e = k(t), n = e.getFullYear(), a = _(t, 0);
13
+ function U(e) {
14
+ const t = k(e), n = t.getFullYear(), a = _(e, 0);
15
15
  a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
16
- const r = I(a), i = _(t, 0);
16
+ const r = I(a), i = _(e, 0);
17
17
  i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
18
18
  const s = I(i);
19
- return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
19
+ return t.getTime() >= r.getTime() ? n + 1 : t.getTime() >= s.getTime() ? n : n - 1;
20
20
  }
21
- function B(t) {
22
- const e = k(t);
23
- return e.setHours(0, 0, 0, 0), e;
21
+ function N(e) {
22
+ const t = k(e);
23
+ return t.setHours(0, 0, 0, 0), t;
24
24
  }
25
- function V(t) {
26
- const e = k(t), n = new Date(
25
+ function V(e) {
26
+ const t = k(e), n = new Date(
27
27
  Date.UTC(
28
- e.getFullYear(),
29
- e.getMonth(),
30
- e.getDate(),
31
- e.getHours(),
32
- e.getMinutes(),
33
- e.getSeconds(),
34
- e.getMilliseconds()
28
+ t.getFullYear(),
29
+ t.getMonth(),
30
+ t.getDate(),
31
+ t.getHours(),
32
+ t.getMinutes(),
33
+ t.getSeconds(),
34
+ t.getMilliseconds()
35
35
  )
36
36
  );
37
- return n.setUTCFullYear(e.getFullYear()), +t - +n;
37
+ return n.setUTCFullYear(t.getFullYear()), +e - +n;
38
38
  }
39
- function ct(t, e) {
40
- const n = B(t), a = B(e), r = +n - V(n), i = +a - V(a);
41
- return Math.round((r - i) / st);
39
+ function ce(e, t) {
40
+ const n = N(e), a = N(t), r = +n - V(n), i = +a - V(a);
41
+ return Math.round((r - i) / se);
42
42
  }
43
- function ht(t) {
44
- const e = U(t), n = _(t, 0);
45
- return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), I(n);
43
+ function he(e) {
44
+ const t = U(e), n = _(e, 0);
45
+ return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), I(n);
46
46
  }
47
- function ft(t) {
48
- return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
47
+ function fe(e) {
48
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
49
49
  }
50
- function mt(t) {
51
- if (!ft(t) && typeof t != "number")
50
+ function me(e) {
51
+ if (!fe(e) && typeof e != "number")
52
52
  return !1;
53
- const e = k(t);
54
- return !isNaN(Number(e));
53
+ const t = k(e);
54
+ return !isNaN(Number(t));
55
55
  }
56
- function pt(t) {
57
- const e = k(t), n = _(t, 0);
58
- return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
56
+ function pe(e) {
57
+ const t = k(e), n = _(e, 0);
58
+ return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
59
59
  }
60
- const gt = {
60
+ const ge = {
61
61
  lessThanXSeconds: {
62
62
  one: "less than a second",
63
63
  other: "less than {{count}} seconds"
@@ -119,77 +119,77 @@ const gt = {
119
119
  one: "almost 1 year",
120
120
  other: "almost {{count}} years"
121
121
  }
122
- }, yt = (t, e, n) => {
122
+ }, ye = (e, t, n) => {
123
123
  let a;
124
- const r = gt[t];
125
- return typeof r == "string" ? a = r : e === 1 ? a = r.one : a = r.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
124
+ const r = ge[e];
125
+ return typeof r == "string" ? a = r : t === 1 ? a = r.one : a = r.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
126
126
  };
127
- function F(t) {
128
- return (e = {}) => {
129
- const n = e.width ? String(e.width) : t.defaultWidth;
130
- return t.formats[n] || t.formats[t.defaultWidth];
127
+ function F(e) {
128
+ return (t = {}) => {
129
+ const n = t.width ? String(t.width) : e.defaultWidth;
130
+ return e.formats[n] || e.formats[e.defaultWidth];
131
131
  };
132
132
  }
133
- const vt = {
133
+ const ve = {
134
134
  full: "EEEE, MMMM do, y",
135
135
  long: "MMMM do, y",
136
136
  medium: "MMM d, y",
137
137
  short: "MM/dd/yyyy"
138
- }, wt = {
138
+ }, we = {
139
139
  full: "h:mm:ss a zzzz",
140
140
  long: "h:mm:ss a z",
141
141
  medium: "h:mm:ss a",
142
142
  short: "h:mm a"
143
- }, bt = {
143
+ }, be = {
144
144
  full: "{{date}} 'at' {{time}}",
145
145
  long: "{{date}} 'at' {{time}}",
146
146
  medium: "{{date}}, {{time}}",
147
147
  short: "{{date}}, {{time}}"
148
- }, kt = {
148
+ }, ke = {
149
149
  date: F({
150
- formats: vt,
150
+ formats: ve,
151
151
  defaultWidth: "full"
152
152
  }),
153
153
  time: F({
154
- formats: wt,
154
+ formats: we,
155
155
  defaultWidth: "full"
156
156
  }),
157
157
  dateTime: F({
158
- formats: bt,
158
+ formats: be,
159
159
  defaultWidth: "full"
160
160
  })
161
- }, xt = {
161
+ }, xe = {
162
162
  lastWeek: "'last' eeee 'at' p",
163
163
  yesterday: "'yesterday at' p",
164
164
  today: "'today at' p",
165
165
  tomorrow: "'tomorrow at' p",
166
166
  nextWeek: "eeee 'at' p",
167
167
  other: "P"
168
- }, $t = (t, e, n, a) => xt[t];
169
- function E(t) {
170
- return (e, n) => {
168
+ }, $e = (e, t, n, a) => xe[e];
169
+ function W(e) {
170
+ return (t, n) => {
171
171
  const a = n != null && n.context ? String(n.context) : "standalone";
172
172
  let r;
173
- if (a === "formatting" && t.formattingValues) {
174
- const s = t.defaultFormattingWidth || t.defaultWidth, d = n != null && n.width ? String(n.width) : s;
175
- r = t.formattingValues[d] || t.formattingValues[s];
173
+ if (a === "formatting" && e.formattingValues) {
174
+ const s = e.defaultFormattingWidth || e.defaultWidth, d = n != null && n.width ? String(n.width) : s;
175
+ r = e.formattingValues[d] || e.formattingValues[s];
176
176
  } else {
177
- const s = t.defaultWidth, d = n != null && n.width ? String(n.width) : t.defaultWidth;
178
- r = t.values[d] || t.values[s];
177
+ const s = e.defaultWidth, d = n != null && n.width ? String(n.width) : e.defaultWidth;
178
+ r = e.values[d] || e.values[s];
179
179
  }
180
- const i = t.argumentCallback ? t.argumentCallback(e) : e;
180
+ const i = e.argumentCallback ? e.argumentCallback(t) : t;
181
181
  return r[i];
182
182
  };
183
183
  }
184
- const Mt = {
184
+ const Me = {
185
185
  narrow: ["B", "A"],
186
186
  abbreviated: ["BC", "AD"],
187
187
  wide: ["Before Christ", "Anno Domini"]
188
- }, Ot = {
188
+ }, Oe = {
189
189
  narrow: ["1", "2", "3", "4"],
190
190
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
191
191
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
192
- }, Pt = {
192
+ }, Pe = {
193
193
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
194
194
  abbreviated: [
195
195
  "Jan",
@@ -219,7 +219,7 @@ const Mt = {
219
219
  "November",
220
220
  "December"
221
221
  ]
222
- }, Tt = {
222
+ }, Te = {
223
223
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
224
224
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
225
225
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -232,7 +232,7 @@ const Mt = {
232
232
  "Friday",
233
233
  "Saturday"
234
234
  ]
235
- }, Dt = {
235
+ }, De = {
236
236
  narrow: {
237
237
  am: "a",
238
238
  pm: "p",
@@ -263,7 +263,7 @@ const Mt = {
263
263
  evening: "evening",
264
264
  night: "night"
265
265
  }
266
- }, St = {
266
+ }, Se = {
267
267
  narrow: {
268
268
  am: "a",
269
269
  pm: "p",
@@ -294,8 +294,8 @@ const Mt = {
294
294
  evening: "in the evening",
295
295
  night: "at night"
296
296
  }
297
- }, Ct = (t, e) => {
298
- const n = Number(t), a = n % 100;
297
+ }, Ce = (e, t) => {
298
+ const n = Number(e), a = n % 100;
299
299
  if (a > 20 || a < 10)
300
300
  switch (a % 10) {
301
301
  case 1:
@@ -306,89 +306,89 @@ const Mt = {
306
306
  return n + "rd";
307
307
  }
308
308
  return n + "th";
309
- }, Rt = {
310
- ordinalNumber: Ct,
311
- era: E({
312
- values: Mt,
309
+ }, Re = {
310
+ ordinalNumber: Ce,
311
+ era: W({
312
+ values: Me,
313
313
  defaultWidth: "wide"
314
314
  }),
315
- quarter: E({
316
- values: Ot,
315
+ quarter: W({
316
+ values: Oe,
317
317
  defaultWidth: "wide",
318
- argumentCallback: (t) => t - 1
318
+ argumentCallback: (e) => e - 1
319
319
  }),
320
- month: E({
321
- values: Pt,
320
+ month: W({
321
+ values: Pe,
322
322
  defaultWidth: "wide"
323
323
  }),
324
- day: E({
325
- values: Tt,
324
+ day: W({
325
+ values: Te,
326
326
  defaultWidth: "wide"
327
327
  }),
328
- dayPeriod: E({
329
- values: Dt,
328
+ dayPeriod: W({
329
+ values: De,
330
330
  defaultWidth: "wide",
331
- formattingValues: St,
331
+ formattingValues: Se,
332
332
  defaultFormattingWidth: "wide"
333
333
  })
334
334
  };
335
- function W(t) {
336
- return (e, n = {}) => {
337
- const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
335
+ function E(e) {
336
+ return (t, n = {}) => {
337
+ const a = n.width, r = a && e.matchPatterns[a] || e.matchPatterns[e.defaultMatchWidth], i = t.match(r);
338
338
  if (!i)
339
339
  return null;
340
- const s = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(d) ? Wt(d, (l) => l.test(s)) : (
340
+ const s = i[0], d = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], y = Array.isArray(d) ? Ee(d, (l) => l.test(s)) : (
341
341
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
342
- Et(d, (l) => l.test(s))
342
+ We(d, (l) => l.test(s))
343
343
  );
344
344
  let v;
345
- v = t.valueCallback ? t.valueCallback(g) : g, v = n.valueCallback ? (
345
+ v = e.valueCallback ? e.valueCallback(y) : y, v = n.valueCallback ? (
346
346
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
347
347
  n.valueCallback(v)
348
348
  ) : v;
349
- const x = e.slice(s.length);
349
+ const x = t.slice(s.length);
350
350
  return { value: v, rest: x };
351
351
  };
352
352
  }
353
- function Et(t, e) {
354
- for (const n in t)
355
- if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
353
+ function We(e, t) {
354
+ for (const n in e)
355
+ if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
356
356
  return n;
357
357
  }
358
- function Wt(t, e) {
359
- for (let n = 0; n < t.length; n++)
360
- if (e(t[n]))
358
+ function Ee(e, t) {
359
+ for (let n = 0; n < e.length; n++)
360
+ if (t(e[n]))
361
361
  return n;
362
362
  }
363
- function _t(t) {
364
- return (e, n = {}) => {
365
- const a = e.match(t.matchPattern);
363
+ function _e(e) {
364
+ return (t, n = {}) => {
365
+ const a = t.match(e.matchPattern);
366
366
  if (!a) return null;
367
- const r = a[0], i = e.match(t.parsePattern);
367
+ const r = a[0], i = t.match(e.parsePattern);
368
368
  if (!i) return null;
369
- let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
369
+ let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
370
370
  s = n.valueCallback ? n.valueCallback(s) : s;
371
- const d = e.slice(r.length);
371
+ const d = t.slice(r.length);
372
372
  return { value: s, rest: d };
373
373
  };
374
374
  }
375
- const It = /^(\d+)(th|st|nd|rd)?/i, Yt = /\d+/i, Ft = {
375
+ const Ie = /^(\d+)(th|st|nd|rd)?/i, Ye = /\d+/i, Fe = {
376
376
  narrow: /^(b|a)/i,
377
377
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
378
378
  wide: /^(before christ|before common era|anno domini|common era)/i
379
- }, qt = {
379
+ }, qe = {
380
380
  any: [/^b/i, /^(a|c)/i]
381
- }, Nt = {
381
+ }, Be = {
382
382
  narrow: /^[1234]/i,
383
383
  abbreviated: /^q[1234]/i,
384
384
  wide: /^[1234](th|st|nd|rd)? quarter/i
385
- }, Bt = {
385
+ }, Ne = {
386
386
  any: [/1/i, /2/i, /3/i, /4/i]
387
- }, Vt = {
387
+ }, Ve = {
388
388
  narrow: /^[jfmasond]/i,
389
389
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
390
390
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
391
- }, jt = {
391
+ }, je = {
392
392
  narrow: [
393
393
  /^j/i,
394
394
  /^f/i,
@@ -417,18 +417,18 @@ const It = /^(\d+)(th|st|nd|rd)?/i, Yt = /\d+/i, Ft = {
417
417
  /^n/i,
418
418
  /^d/i
419
419
  ]
420
- }, Ht = {
420
+ }, He = {
421
421
  narrow: /^[smtwf]/i,
422
422
  short: /^(su|mo|tu|we|th|fr|sa)/i,
423
423
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
424
424
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
425
- }, At = {
425
+ }, Ae = {
426
426
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
427
427
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
428
- }, Lt = {
428
+ }, Le = {
429
429
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
430
430
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
431
- }, Qt = {
431
+ }, Qe = {
432
432
  any: {
433
433
  am: /^a/i,
434
434
  pm: /^p/i,
@@ -439,86 +439,86 @@ const It = /^(\d+)(th|st|nd|rd)?/i, Yt = /\d+/i, Ft = {
439
439
  evening: /evening/i,
440
440
  night: /night/i
441
441
  }
442
- }, Xt = {
443
- ordinalNumber: _t({
444
- matchPattern: It,
445
- parsePattern: Yt,
446
- valueCallback: (t) => parseInt(t, 10)
442
+ }, Xe = {
443
+ ordinalNumber: _e({
444
+ matchPattern: Ie,
445
+ parsePattern: Ye,
446
+ valueCallback: (e) => parseInt(e, 10)
447
447
  }),
448
- era: W({
449
- matchPatterns: Ft,
448
+ era: E({
449
+ matchPatterns: Fe,
450
450
  defaultMatchWidth: "wide",
451
- parsePatterns: qt,
451
+ parsePatterns: qe,
452
452
  defaultParseWidth: "any"
453
453
  }),
454
- quarter: W({
455
- matchPatterns: Nt,
454
+ quarter: E({
455
+ matchPatterns: Be,
456
456
  defaultMatchWidth: "wide",
457
- parsePatterns: Bt,
457
+ parsePatterns: Ne,
458
458
  defaultParseWidth: "any",
459
- valueCallback: (t) => t + 1
459
+ valueCallback: (e) => e + 1
460
460
  }),
461
- month: W({
462
- matchPatterns: Vt,
461
+ month: E({
462
+ matchPatterns: Ve,
463
463
  defaultMatchWidth: "wide",
464
- parsePatterns: jt,
464
+ parsePatterns: je,
465
465
  defaultParseWidth: "any"
466
466
  }),
467
- day: W({
468
- matchPatterns: Ht,
467
+ day: E({
468
+ matchPatterns: He,
469
469
  defaultMatchWidth: "wide",
470
- parsePatterns: At,
470
+ parsePatterns: Ae,
471
471
  defaultParseWidth: "any"
472
472
  }),
473
- dayPeriod: W({
474
- matchPatterns: Lt,
473
+ dayPeriod: E({
474
+ matchPatterns: Le,
475
475
  defaultMatchWidth: "any",
476
- parsePatterns: Qt,
476
+ parsePatterns: Qe,
477
477
  defaultParseWidth: "any"
478
478
  })
479
- }, Gt = {
479
+ }, Ge = {
480
480
  code: "en-US",
481
- formatDistance: yt,
482
- formatLong: kt,
483
- formatRelative: $t,
484
- localize: Rt,
485
- match: Xt,
481
+ formatDistance: ye,
482
+ formatLong: ke,
483
+ formatRelative: $e,
484
+ localize: Re,
485
+ match: Xe,
486
486
  options: {
487
487
  weekStartsOn: 0,
488
488
  firstWeekContainsDate: 1
489
489
  }
490
490
  };
491
- function Ut(t) {
492
- const e = k(t);
493
- return ct(e, pt(e)) + 1;
491
+ function Ue(e) {
492
+ const t = k(e);
493
+ return ce(t, pe(t)) + 1;
494
494
  }
495
- function Jt(t) {
496
- const e = k(t), n = +I(e) - +ht(e);
497
- return Math.round(n / ot) + 1;
495
+ function Je(e) {
496
+ const t = k(e), n = +I(t) - +he(t);
497
+ return Math.round(n / oe) + 1;
498
498
  }
499
- function o(t, e) {
500
- const n = t < 0 ? "-" : "", a = Math.abs(t).toString().padStart(e, "0");
499
+ function o(e, t) {
500
+ const n = e < 0 ? "-" : "", a = Math.abs(e).toString().padStart(t, "0");
501
501
  return n + a;
502
502
  }
503
503
  const b = {
504
504
  // Year
505
- y(t, e) {
506
- const n = t.getFullYear(), a = n > 0 ? n : 1 - n;
507
- return o(e === "yy" ? a % 100 : a, e.length);
505
+ y(e, t) {
506
+ const n = e.getFullYear(), a = n > 0 ? n : 1 - n;
507
+ return o(t === "yy" ? a % 100 : a, t.length);
508
508
  },
509
509
  // Month
510
- M(t, e) {
511
- const n = t.getMonth();
512
- return e === "M" ? String(n + 1) : o(n + 1, 2);
510
+ M(e, t) {
511
+ const n = e.getMonth();
512
+ return t === "M" ? String(n + 1) : o(n + 1, 2);
513
513
  },
514
514
  // Day of the month
515
- d(t, e) {
516
- return o(t.getDate(), e.length);
515
+ d(e, t) {
516
+ return o(e.getDate(), t.length);
517
517
  },
518
518
  // AM or PM
519
- a(t, e) {
520
- const n = t.getHours() / 12 >= 1 ? "pm" : "am";
521
- switch (e) {
519
+ a(e, t) {
520
+ const n = e.getHours() / 12 >= 1 ? "pm" : "am";
521
+ switch (t) {
522
522
  case "a":
523
523
  case "aa":
524
524
  return n.toUpperCase();
@@ -532,27 +532,27 @@ const b = {
532
532
  }
533
533
  },
534
534
  // Hour [1-12]
535
- h(t, e) {
536
- return o(t.getHours() % 12 || 12, e.length);
535
+ h(e, t) {
536
+ return o(e.getHours() % 12 || 12, t.length);
537
537
  },
538
538
  // Hour [0-23]
539
- H(t, e) {
540
- return o(t.getHours(), e.length);
539
+ H(e, t) {
540
+ return o(e.getHours(), t.length);
541
541
  },
542
542
  // Minute
543
- m(t, e) {
544
- return o(t.getMinutes(), e.length);
543
+ m(e, t) {
544
+ return o(e.getMinutes(), t.length);
545
545
  },
546
546
  // Second
547
- s(t, e) {
548
- return o(t.getSeconds(), e.length);
547
+ s(e, t) {
548
+ return o(e.getSeconds(), t.length);
549
549
  },
550
550
  // Fraction of second
551
- S(t, e) {
552
- const n = e.length, a = t.getMilliseconds(), r = Math.trunc(
551
+ S(e, t) {
552
+ const n = t.length, a = e.getMilliseconds(), r = Math.trunc(
553
553
  a * Math.pow(10, n - 3)
554
554
  );
555
- return o(r, e.length);
555
+ return o(r, t.length);
556
556
  }
557
557
  }, D = {
558
558
  am: "am",
@@ -565,9 +565,9 @@ const b = {
565
565
  night: "night"
566
566
  }, j = {
567
567
  // Era
568
- G: function(t, e, n) {
569
- const a = t.getFullYear() > 0 ? 1 : 0;
570
- switch (e) {
568
+ G: function(e, t, n) {
569
+ const a = e.getFullYear() > 0 ? 1 : 0;
570
+ switch (t) {
571
571
  case "G":
572
572
  case "GG":
573
573
  case "GGG":
@@ -580,26 +580,26 @@ const b = {
580
580
  }
581
581
  },
582
582
  // Year
583
- y: function(t, e, n) {
584
- if (e === "yo") {
585
- const a = t.getFullYear(), r = a > 0 ? a : 1 - a;
583
+ y: function(e, t, n) {
584
+ if (t === "yo") {
585
+ const a = e.getFullYear(), r = a > 0 ? a : 1 - a;
586
586
  return n.ordinalNumber(r, { unit: "year" });
587
587
  }
588
- return b.y(t, e);
588
+ return b.y(e, t);
589
589
  },
590
590
  // Local week-numbering year
591
- Y: function(t, e, n, a) {
592
- const r = ut(t, a), i = r > 0 ? r : 1 - r;
593
- if (e === "YY") {
591
+ Y: function(e, t, n, a) {
592
+ const r = ue(e, a), i = r > 0 ? r : 1 - r;
593
+ if (t === "YY") {
594
594
  const s = i % 100;
595
595
  return o(s, 2);
596
596
  }
597
- return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, e.length);
597
+ return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, t.length);
598
598
  },
599
599
  // ISO week-numbering year
600
- R: function(t, e) {
601
- const n = U(t);
602
- return o(n, e.length);
600
+ R: function(e, t) {
601
+ const n = U(e);
602
+ return o(n, t.length);
603
603
  },
604
604
  // Extended year. This is a single number designating the year of this calendar system.
605
605
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -610,14 +610,14 @@ const b = {
610
610
  // | BC 2 | 2 | -1 |
611
611
  // Also `yy` always returns the last two digits of a year,
612
612
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
613
- u: function(t, e) {
614
- const n = t.getFullYear();
615
- return o(n, e.length);
613
+ u: function(e, t) {
614
+ const n = e.getFullYear();
615
+ return o(n, t.length);
616
616
  },
617
617
  // Quarter
618
- Q: function(t, e, n) {
619
- const a = Math.ceil((t.getMonth() + 1) / 3);
620
- switch (e) {
618
+ Q: function(e, t, n) {
619
+ const a = Math.ceil((e.getMonth() + 1) / 3);
620
+ switch (t) {
621
621
  case "Q":
622
622
  return String(a);
623
623
  case "QQ":
@@ -643,9 +643,9 @@ const b = {
643
643
  }
644
644
  },
645
645
  // Stand-alone quarter
646
- q: function(t, e, n) {
647
- const a = Math.ceil((t.getMonth() + 1) / 3);
648
- switch (e) {
646
+ q: function(e, t, n) {
647
+ const a = Math.ceil((e.getMonth() + 1) / 3);
648
+ switch (t) {
649
649
  case "q":
650
650
  return String(a);
651
651
  case "qq":
@@ -671,12 +671,12 @@ const b = {
671
671
  }
672
672
  },
673
673
  // Month
674
- M: function(t, e, n) {
675
- const a = t.getMonth();
676
- switch (e) {
674
+ M: function(e, t, n) {
675
+ const a = e.getMonth();
676
+ switch (t) {
677
677
  case "M":
678
678
  case "MM":
679
- return b.M(t, e);
679
+ return b.M(e, t);
680
680
  case "Mo":
681
681
  return n.ordinalNumber(a + 1, { unit: "month" });
682
682
  case "MMM":
@@ -695,9 +695,9 @@ const b = {
695
695
  }
696
696
  },
697
697
  // Stand-alone month
698
- L: function(t, e, n) {
699
- const a = t.getMonth();
700
- switch (e) {
698
+ L: function(e, t, n) {
699
+ const a = e.getMonth();
700
+ switch (t) {
701
701
  case "L":
702
702
  return String(a + 1);
703
703
  case "LL":
@@ -720,28 +720,28 @@ const b = {
720
720
  }
721
721
  },
722
722
  // Local week of year
723
- w: function(t, e, n, a) {
724
- const r = lt(t, a);
725
- return e === "wo" ? n.ordinalNumber(r, { unit: "week" }) : o(r, e.length);
723
+ w: function(e, t, n, a) {
724
+ const r = le(e, a);
725
+ return t === "wo" ? n.ordinalNumber(r, { unit: "week" }) : o(r, t.length);
726
726
  },
727
727
  // ISO week of year
728
- I: function(t, e, n) {
729
- const a = Jt(t);
730
- return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) : o(a, e.length);
728
+ I: function(e, t, n) {
729
+ const a = Je(e);
730
+ return t === "Io" ? n.ordinalNumber(a, { unit: "week" }) : o(a, t.length);
731
731
  },
732
732
  // Day of the month
733
- d: function(t, e, n) {
734
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : b.d(t, e);
733
+ d: function(e, t, n) {
734
+ return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : b.d(e, t);
735
735
  },
736
736
  // Day of year
737
- D: function(t, e, n) {
738
- const a = Ut(t);
739
- return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : o(a, e.length);
737
+ D: function(e, t, n) {
738
+ const a = Ue(e);
739
+ return t === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : o(a, t.length);
740
740
  },
741
741
  // Day of week
742
- E: function(t, e, n) {
743
- const a = t.getDay();
744
- switch (e) {
742
+ E: function(e, t, n) {
743
+ const a = e.getDay();
744
+ switch (t) {
745
745
  case "E":
746
746
  case "EE":
747
747
  case "EEE":
@@ -768,9 +768,9 @@ const b = {
768
768
  }
769
769
  },
770
770
  // Local day of week
771
- e: function(t, e, n, a) {
772
- const r = t.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
773
- switch (e) {
771
+ e: function(e, t, n, a) {
772
+ const r = e.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
773
+ switch (t) {
774
774
  case "e":
775
775
  return String(i);
776
776
  case "ee":
@@ -801,13 +801,13 @@ const b = {
801
801
  }
802
802
  },
803
803
  // Stand-alone local day of week
804
- c: function(t, e, n, a) {
805
- const r = t.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
806
- switch (e) {
804
+ c: function(e, t, n, a) {
805
+ const r = e.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
806
+ switch (t) {
807
807
  case "c":
808
808
  return String(i);
809
809
  case "cc":
810
- return o(i, e.length);
810
+ return o(i, t.length);
811
811
  case "co":
812
812
  return n.ordinalNumber(i, { unit: "day" });
813
813
  case "ccc":
@@ -834,13 +834,13 @@ const b = {
834
834
  }
835
835
  },
836
836
  // ISO day of week
837
- i: function(t, e, n) {
838
- const a = t.getDay(), r = a === 0 ? 7 : a;
839
- switch (e) {
837
+ i: function(e, t, n) {
838
+ const a = e.getDay(), r = a === 0 ? 7 : a;
839
+ switch (t) {
840
840
  case "i":
841
841
  return String(r);
842
842
  case "ii":
843
- return o(r, e.length);
843
+ return o(r, t.length);
844
844
  case "io":
845
845
  return n.ordinalNumber(r, { unit: "day" });
846
846
  case "iii":
@@ -867,9 +867,9 @@ const b = {
867
867
  }
868
868
  },
869
869
  // AM or PM
870
- a: function(t, e, n) {
871
- const r = t.getHours() / 12 >= 1 ? "pm" : "am";
872
- switch (e) {
870
+ a: function(e, t, n) {
871
+ const r = e.getHours() / 12 >= 1 ? "pm" : "am";
872
+ switch (t) {
873
873
  case "a":
874
874
  case "aa":
875
875
  return n.dayPeriod(r, {
@@ -895,10 +895,10 @@ const b = {
895
895
  }
896
896
  },
897
897
  // AM, PM, midnight, noon
898
- b: function(t, e, n) {
899
- const a = t.getHours();
898
+ b: function(e, t, n) {
899
+ const a = e.getHours();
900
900
  let r;
901
- switch (a === 12 ? r = D.noon : a === 0 ? r = D.midnight : r = a / 12 >= 1 ? "pm" : "am", e) {
901
+ switch (a === 12 ? r = D.noon : a === 0 ? r = D.midnight : r = a / 12 >= 1 ? "pm" : "am", t) {
902
902
  case "b":
903
903
  case "bb":
904
904
  return n.dayPeriod(r, {
@@ -924,10 +924,10 @@ const b = {
924
924
  }
925
925
  },
926
926
  // in the morning, in the afternoon, in the evening, at night
927
- B: function(t, e, n) {
928
- const a = t.getHours();
927
+ B: function(e, t, n) {
928
+ const a = e.getHours();
929
929
  let r;
930
- switch (a >= 17 ? r = D.evening : a >= 12 ? r = D.afternoon : a >= 4 ? r = D.morning : r = D.night, e) {
930
+ switch (a >= 17 ? r = D.evening : a >= 12 ? r = D.afternoon : a >= 4 ? r = D.morning : r = D.night, t) {
931
931
  case "B":
932
932
  case "BB":
933
933
  case "BBB":
@@ -949,45 +949,45 @@ const b = {
949
949
  }
950
950
  },
951
951
  // Hour [1-12]
952
- h: function(t, e, n) {
953
- if (e === "ho") {
954
- let a = t.getHours() % 12;
952
+ h: function(e, t, n) {
953
+ if (t === "ho") {
954
+ let a = e.getHours() % 12;
955
955
  return a === 0 && (a = 12), n.ordinalNumber(a, { unit: "hour" });
956
956
  }
957
- return b.h(t, e);
957
+ return b.h(e, t);
958
958
  },
959
959
  // Hour [0-23]
960
- H: function(t, e, n) {
961
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : b.H(t, e);
960
+ H: function(e, t, n) {
961
+ return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : b.H(e, t);
962
962
  },
963
963
  // Hour [0-11]
964
- K: function(t, e, n) {
965
- const a = t.getHours() % 12;
966
- return e === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : o(a, e.length);
964
+ K: function(e, t, n) {
965
+ const a = e.getHours() % 12;
966
+ return t === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : o(a, t.length);
967
967
  },
968
968
  // Hour [1-24]
969
- k: function(t, e, n) {
970
- let a = t.getHours();
971
- return a === 0 && (a = 24), e === "ko" ? n.ordinalNumber(a, { unit: "hour" }) : o(a, e.length);
969
+ k: function(e, t, n) {
970
+ let a = e.getHours();
971
+ return a === 0 && (a = 24), t === "ko" ? n.ordinalNumber(a, { unit: "hour" }) : o(a, t.length);
972
972
  },
973
973
  // Minute
974
- m: function(t, e, n) {
975
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : b.m(t, e);
974
+ m: function(e, t, n) {
975
+ return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : b.m(e, t);
976
976
  },
977
977
  // Second
978
- s: function(t, e, n) {
979
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : b.s(t, e);
978
+ s: function(e, t, n) {
979
+ return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : b.s(e, t);
980
980
  },
981
981
  // Fraction of second
982
- S: function(t, e) {
983
- return b.S(t, e);
982
+ S: function(e, t) {
983
+ return b.S(e, t);
984
984
  },
985
985
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
986
- X: function(t, e, n) {
987
- const a = t.getTimezoneOffset();
986
+ X: function(e, t, n) {
987
+ const a = e.getTimezoneOffset();
988
988
  if (a === 0)
989
989
  return "Z";
990
- switch (e) {
990
+ switch (t) {
991
991
  case "X":
992
992
  return A(a);
993
993
  case "XXXX":
@@ -1000,9 +1000,9 @@ const b = {
1000
1000
  }
1001
1001
  },
1002
1002
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1003
- x: function(t, e, n) {
1004
- const a = t.getTimezoneOffset();
1005
- switch (e) {
1003
+ x: function(e, t, n) {
1004
+ const a = e.getTimezoneOffset();
1005
+ switch (t) {
1006
1006
  case "x":
1007
1007
  return A(a);
1008
1008
  case "xxxx":
@@ -1015,9 +1015,9 @@ const b = {
1015
1015
  }
1016
1016
  },
1017
1017
  // Timezone (GMT)
1018
- O: function(t, e, n) {
1019
- const a = t.getTimezoneOffset();
1020
- switch (e) {
1018
+ O: function(e, t, n) {
1019
+ const a = e.getTimezoneOffset();
1020
+ switch (t) {
1021
1021
  case "O":
1022
1022
  case "OO":
1023
1023
  case "OOO":
@@ -1028,9 +1028,9 @@ const b = {
1028
1028
  }
1029
1029
  },
1030
1030
  // Timezone (specific non-location)
1031
- z: function(t, e, n) {
1032
- const a = t.getTimezoneOffset();
1033
- switch (e) {
1031
+ z: function(e, t, n) {
1032
+ const a = e.getTimezoneOffset();
1033
+ switch (t) {
1034
1034
  case "z":
1035
1035
  case "zz":
1036
1036
  case "zzz":
@@ -1041,190 +1041,190 @@ const b = {
1041
1041
  }
1042
1042
  },
1043
1043
  // Seconds timestamp
1044
- t: function(t, e, n) {
1045
- const a = Math.trunc(t.getTime() / 1e3);
1046
- return o(a, e.length);
1044
+ t: function(e, t, n) {
1045
+ const a = Math.trunc(e.getTime() / 1e3);
1046
+ return o(a, t.length);
1047
1047
  },
1048
1048
  // Milliseconds timestamp
1049
- T: function(t, e, n) {
1050
- const a = t.getTime();
1051
- return o(a, e.length);
1049
+ T: function(e, t, n) {
1050
+ const a = e.getTime();
1051
+ return o(a, t.length);
1052
1052
  }
1053
1053
  };
1054
- function H(t, e = "") {
1055
- const n = t > 0 ? "-" : "+", a = Math.abs(t), r = Math.trunc(a / 60), i = a % 60;
1056
- return i === 0 ? n + String(r) : n + String(r) + e + o(i, 2);
1054
+ function H(e, t = "") {
1055
+ const n = e > 0 ? "-" : "+", a = Math.abs(e), r = Math.trunc(a / 60), i = a % 60;
1056
+ return i === 0 ? n + String(r) : n + String(r) + t + o(i, 2);
1057
1057
  }
1058
- function A(t, e) {
1059
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : T(t, e);
1058
+ function A(e, t) {
1059
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + o(Math.abs(e) / 60, 2) : T(e, t);
1060
1060
  }
1061
- function T(t, e = "") {
1062
- const n = t > 0 ? "-" : "+", a = Math.abs(t), r = o(Math.trunc(a / 60), 2), i = o(a % 60, 2);
1063
- return n + r + e + i;
1061
+ function T(e, t = "") {
1062
+ const n = e > 0 ? "-" : "+", a = Math.abs(e), r = o(Math.trunc(a / 60), 2), i = o(a % 60, 2);
1063
+ return n + r + t + i;
1064
1064
  }
1065
- const L = (t, e) => {
1066
- switch (t) {
1065
+ const L = (e, t) => {
1066
+ switch (e) {
1067
1067
  case "P":
1068
- return e.date({ width: "short" });
1068
+ return t.date({ width: "short" });
1069
1069
  case "PP":
1070
- return e.date({ width: "medium" });
1070
+ return t.date({ width: "medium" });
1071
1071
  case "PPP":
1072
- return e.date({ width: "long" });
1072
+ return t.date({ width: "long" });
1073
1073
  case "PPPP":
1074
1074
  default:
1075
- return e.date({ width: "full" });
1075
+ return t.date({ width: "full" });
1076
1076
  }
1077
- }, J = (t, e) => {
1078
- switch (t) {
1077
+ }, J = (e, t) => {
1078
+ switch (e) {
1079
1079
  case "p":
1080
- return e.time({ width: "short" });
1080
+ return t.time({ width: "short" });
1081
1081
  case "pp":
1082
- return e.time({ width: "medium" });
1082
+ return t.time({ width: "medium" });
1083
1083
  case "ppp":
1084
- return e.time({ width: "long" });
1084
+ return t.time({ width: "long" });
1085
1085
  case "pppp":
1086
1086
  default:
1087
- return e.time({ width: "full" });
1087
+ return t.time({ width: "full" });
1088
1088
  }
1089
- }, Kt = (t, e) => {
1090
- const n = t.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
1089
+ }, Ke = (e, t) => {
1090
+ const n = e.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
1091
1091
  if (!r)
1092
- return L(t, e);
1092
+ return L(e, t);
1093
1093
  let i;
1094
1094
  switch (a) {
1095
1095
  case "P":
1096
- i = e.dateTime({ width: "short" });
1096
+ i = t.dateTime({ width: "short" });
1097
1097
  break;
1098
1098
  case "PP":
1099
- i = e.dateTime({ width: "medium" });
1099
+ i = t.dateTime({ width: "medium" });
1100
1100
  break;
1101
1101
  case "PPP":
1102
- i = e.dateTime({ width: "long" });
1102
+ i = t.dateTime({ width: "long" });
1103
1103
  break;
1104
1104
  case "PPPP":
1105
1105
  default:
1106
- i = e.dateTime({ width: "full" });
1106
+ i = t.dateTime({ width: "full" });
1107
1107
  break;
1108
1108
  }
1109
- return i.replace("{{date}}", L(a, e)).replace("{{time}}", J(r, e));
1110
- }, zt = {
1109
+ return i.replace("{{date}}", L(a, t)).replace("{{time}}", J(r, t));
1110
+ }, ze = {
1111
1111
  p: J,
1112
- P: Kt
1113
- }, Zt = /^D+$/, te = /^Y+$/, ee = ["D", "DD", "YY", "YYYY"];
1114
- function ne(t) {
1115
- return Zt.test(t);
1112
+ P: Ke
1113
+ }, Ze = /^D+$/, et = /^Y+$/, tt = ["D", "DD", "YY", "YYYY"];
1114
+ function nt(e) {
1115
+ return Ze.test(e);
1116
1116
  }
1117
- function ae(t) {
1118
- return te.test(t);
1117
+ function at(e) {
1118
+ return et.test(e);
1119
1119
  }
1120
- function re(t, e, n) {
1121
- const a = ie(t, e, n);
1122
- if (console.warn(a), ee.includes(t)) throw new RangeError(a);
1120
+ function rt(e, t, n) {
1121
+ const a = it(e, t, n);
1122
+ if (console.warn(a), tt.includes(e)) throw new RangeError(a);
1123
1123
  }
1124
- function ie(t, e, n) {
1125
- const a = t[0] === "Y" ? "years" : "days of the month";
1126
- return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1124
+ function it(e, t, n) {
1125
+ const a = e[0] === "Y" ? "years" : "days of the month";
1126
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1127
1127
  }
1128
- const se = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, oe = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ue = /^'([^]*?)'?$/, le = /''/g, de = /[a-zA-Z]/;
1129
- function ce(t, e, n) {
1130
- var x, l, m, h;
1131
- const a = dt(), r = a.locale ?? Gt, i = a.firstWeekContainsDate ?? ((l = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, s = a.weekStartsOn ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.weekStartsOn) ?? 0, d = k(t);
1132
- if (!mt(d))
1128
+ const st = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ot = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ut = /^'([^]*?)'?$/, lt = /''/g, dt = /[a-zA-Z]/;
1129
+ function ct(e, t, n) {
1130
+ var x, l, p, h;
1131
+ const a = de(), r = a.locale ?? Ge, i = a.firstWeekContainsDate ?? ((l = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, s = a.weekStartsOn ?? ((h = (p = a.locale) == null ? void 0 : p.options) == null ? void 0 : h.weekStartsOn) ?? 0, d = k(e);
1132
+ if (!me(d))
1133
1133
  throw new RangeError("Invalid time value");
1134
- let g = e.match(oe).map((u) => {
1134
+ let y = t.match(ot).map((u) => {
1135
1135
  const c = u[0];
1136
1136
  if (c === "p" || c === "P") {
1137
- const $ = zt[c];
1137
+ const $ = ze[c];
1138
1138
  return $(u, r.formatLong);
1139
1139
  }
1140
1140
  return u;
1141
- }).join("").match(se).map((u) => {
1141
+ }).join("").match(st).map((u) => {
1142
1142
  if (u === "''")
1143
1143
  return { isToken: !1, value: "'" };
1144
1144
  const c = u[0];
1145
1145
  if (c === "'")
1146
- return { isToken: !1, value: he(u) };
1146
+ return { isToken: !1, value: ht(u) };
1147
1147
  if (j[c])
1148
1148
  return { isToken: !0, value: u };
1149
- if (c.match(de))
1149
+ if (c.match(dt))
1150
1150
  throw new RangeError(
1151
1151
  "Format string contains an unescaped latin alphabet character `" + c + "`"
1152
1152
  );
1153
1153
  return { isToken: !1, value: u };
1154
1154
  });
1155
- r.localize.preprocessor && (g = r.localize.preprocessor(d, g));
1155
+ r.localize.preprocessor && (y = r.localize.preprocessor(d, y));
1156
1156
  const v = {
1157
1157
  firstWeekContainsDate: i,
1158
1158
  weekStartsOn: s,
1159
1159
  locale: r
1160
1160
  };
1161
- return g.map((u) => {
1161
+ return y.map((u) => {
1162
1162
  if (!u.isToken) return u.value;
1163
1163
  const c = u.value;
1164
- (ae(c) || ne(c)) && re(c, e, String(t));
1164
+ (at(c) || nt(c)) && rt(c, t, String(e));
1165
1165
  const $ = j[c[0]];
1166
1166
  return $(d, c, r.localize, v);
1167
1167
  }).join("");
1168
1168
  }
1169
- function he(t) {
1170
- const e = t.match(ue);
1171
- return e ? e[1].replace(le, "'") : t;
1169
+ function ht(e) {
1170
+ const t = e.match(ut);
1171
+ return t ? t[1].replace(lt, "'") : e;
1172
1172
  }
1173
1173
  /**
1174
1174
  * @license
1175
1175
  * Copyright 2017 Google LLC
1176
1176
  * SPDX-License-Identifier: BSD-3-Clause
1177
1177
  */
1178
- const Q = (t, e, n) => {
1178
+ const Q = (e, t, n) => {
1179
1179
  const a = /* @__PURE__ */ new Map();
1180
- for (let r = e; r <= n; r++) a.set(t[r], r);
1180
+ for (let r = t; r <= n; r++) a.set(e[r], r);
1181
1181
  return a;
1182
- }, fe = Z(class extends tt {
1183
- constructor(t) {
1184
- if (super(t), t.type !== et.CHILD) throw Error("repeat() can only be used in text expressions");
1182
+ }, ft = Z(class extends ee {
1183
+ constructor(e) {
1184
+ if (super(e), e.type !== te.CHILD) throw Error("repeat() can only be used in text expressions");
1185
1185
  }
1186
- dt(t, e, n) {
1186
+ dt(e, t, n) {
1187
1187
  let a;
1188
- n === void 0 ? n = e : e !== void 0 && (a = e);
1188
+ n === void 0 ? n = t : t !== void 0 && (a = t);
1189
1189
  const r = [], i = [];
1190
1190
  let s = 0;
1191
- for (const d of t) r[s] = a ? a(d, s) : s, i[s] = n(d, s), s++;
1191
+ for (const d of e) r[s] = a ? a(d, s) : s, i[s] = n(d, s), s++;
1192
1192
  return { values: i, keys: r };
1193
1193
  }
1194
- render(t, e, n) {
1195
- return this.dt(t, e, n).values;
1194
+ render(e, t, n) {
1195
+ return this.dt(e, t, n).values;
1196
1196
  }
1197
- update(t, [e, n, a]) {
1198
- const r = at(t), { values: i, keys: s } = this.dt(e, n, a);
1197
+ update(e, [t, n, a]) {
1198
+ const r = ae(e), { values: i, keys: s } = this.dt(t, n, a);
1199
1199
  if (!Array.isArray(r)) return this.ut = s, i;
1200
- const d = this.ut ?? (this.ut = []), g = [];
1201
- let v, x, l = 0, m = r.length - 1, h = 0, u = i.length - 1;
1202
- for (; l <= m && h <= u; ) if (r[l] === null) l++;
1203
- else if (r[m] === null) m--;
1204
- else if (d[l] === s[h]) g[h] = O(r[l], i[h]), l++, h++;
1205
- else if (d[m] === s[u]) g[u] = O(r[m], i[u]), m--, u--;
1206
- else if (d[l] === s[u]) g[u] = O(r[l], i[u]), S(t, g[u + 1], r[l]), l++, u--;
1207
- else if (d[m] === s[h]) g[h] = O(r[m], i[h]), S(t, r[l], r[m]), m--, h++;
1208
- else if (v === void 0 && (v = Q(s, h, u), x = Q(d, l, m)), v.has(d[l])) if (v.has(d[m])) {
1200
+ const d = this.ut ?? (this.ut = []), y = [];
1201
+ let v, x, l = 0, p = r.length - 1, h = 0, u = i.length - 1;
1202
+ for (; l <= p && h <= u; ) if (r[l] === null) l++;
1203
+ else if (r[p] === null) p--;
1204
+ else if (d[l] === s[h]) y[h] = O(r[l], i[h]), l++, h++;
1205
+ else if (d[p] === s[u]) y[u] = O(r[p], i[u]), p--, u--;
1206
+ else if (d[l] === s[u]) y[u] = O(r[l], i[u]), S(e, y[u + 1], r[l]), l++, u--;
1207
+ else if (d[p] === s[h]) y[h] = O(r[p], i[h]), S(e, r[l], r[p]), p--, h++;
1208
+ else if (v === void 0 && (v = Q(s, h, u), x = Q(d, l, p)), v.has(d[l])) if (v.has(d[p])) {
1209
1209
  const c = x.get(s[h]), $ = c !== void 0 ? r[c] : null;
1210
1210
  if ($ === null) {
1211
- const q = S(t, r[l]);
1212
- O(q, i[h]), g[h] = q;
1213
- } else g[h] = O($, i[h]), S(t, r[l], $), r[c] = null;
1211
+ const q = S(e, r[l]);
1212
+ O(q, i[h]), y[h] = q;
1213
+ } else y[h] = O($, i[h]), S(e, r[l], $), r[c] = null;
1214
1214
  h++;
1215
- } else Y(r[m]), m--;
1215
+ } else Y(r[p]), p--;
1216
1216
  else Y(r[l]), l++;
1217
1217
  for (; h <= u; ) {
1218
- const c = S(t, g[u + 1]);
1219
- O(c, i[h]), g[h++] = c;
1218
+ const c = S(e, y[u + 1]);
1219
+ O(c, i[h]), y[h++] = c;
1220
1220
  }
1221
- for (; l <= m; ) {
1221
+ for (; l <= p; ) {
1222
1222
  const c = r[l++];
1223
1223
  c !== null && Y(c);
1224
1224
  }
1225
- return this.ut = s, rt(t, g), K;
1225
+ return this.ut = s, re(e, y), K;
1226
1226
  }
1227
- }), me = "pkt-datepicker", pe = !0, ge = {
1227
+ }), mt = "pkt-datepicker", pt = !0, gt = {
1228
1228
  name: {
1229
1229
  type: "string",
1230
1230
  name: "Navn",
@@ -1381,12 +1381,18 @@ const Q = (t, e, n) => {
1381
1381
  default: "Valgfritt",
1382
1382
  description: "Tekst som vises i valgfritt-merkingen"
1383
1383
  },
1384
+ useWrapper: {
1385
+ type: "boolean",
1386
+ name: "Bruk wrapper",
1387
+ description: "Indikerer at feltet skal ha synlig label og hjelpetekst",
1388
+ default: !0
1389
+ },
1384
1390
  id: {
1385
1391
  type: "string",
1386
1392
  name: "ID",
1387
1393
  description: "Unik identifikasjon for datovelgeren"
1388
1394
  }
1389
- }, ye = {
1395
+ }, yt = {
1390
1396
  change: {
1391
1397
  type: "Event",
1392
1398
  description: "Returnerer valgt dato som streng i ISO-format"
@@ -1400,21 +1406,21 @@ const Q = (t, e, n) => {
1400
1406
  description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
1401
1407
  }
1402
1408
  }, w = {
1403
- name: me,
1409
+ name: mt,
1404
1410
  "css-class": "pkt-datepicker",
1405
- isElement: pe,
1406
- props: ge,
1407
- events: ye
1411
+ isElement: pt,
1412
+ props: gt,
1413
+ events: yt
1408
1414
  };
1409
- var ve = Object.defineProperty, we = Object.getOwnPropertyDescriptor, p = (t, e, n, a) => {
1410
- for (var r = a > 1 ? void 0 : a ? we(e, n) : e, i = t.length - 1, s; i >= 0; i--)
1411
- (s = t[i]) && (r = (a ? s(e, n, r) : s(r)) || r);
1412
- return a && r && ve(e, n, r), r;
1415
+ var vt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, m = (e, t, n, a) => {
1416
+ for (var r = a > 1 ? void 0 : a ? wt(t, n) : t, i = e.length - 1, s; i >= 0; i--)
1417
+ (s = e[i]) && (r = (a ? s(t, n, r) : s(r)) || r);
1418
+ return a && r && vt(t, n, r), r;
1413
1419
  };
1414
- const X = (t) => new Promise((e) => setTimeout(e, t));
1420
+ const X = (e) => new Promise((t) => setTimeout(t, e));
1415
1421
  let f = class extends z {
1416
1422
  constructor() {
1417
- super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = w.props.helptextDropdownButton.default, this.dateformat = w.props.dateformat.default, this.multiple = w.props.multiple.default, this.maxlength = w.props.maxlength.default, this.range = w.props.range.default, this.weeknumbers = w.props.weeknumbers.default, this.withcontrols = w.props.withcontrols.default, this.fullwidth = !1, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.calendarOpen = !1, this.inputRef = C(), this.inputRefTo = C(), this.btnRef = C(), this.calRef = C(), this.popupRef = C(), this.inputClasses = {
1423
+ super(...arguments), this.value = "", this._value = this.value ? Array.isArray(this.value) ? this.value : this.value.split(",") : [], this.label = "Datovelger", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = w.props.helptextDropdownButton.default, this.dateformat = w.props.dateformat.default, this.multiple = w.props.multiple.default, this.maxlength = w.props.maxlength.default, this.range = w.props.range.default, this.weeknumbers = w.props.weeknumbers.default, this.withcontrols = w.props.withcontrols.default, this.fullwidth = !1, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.useWrapper = !0, this.calendarOpen = !1, this.inputRef = C(), this.inputRefTo = C(), this.btnRef = C(), this.calRef = C(), this.popupRef = C(), this.inputClasses = {
1418
1424
  "pkt-input": !0,
1419
1425
  "pkt-datepicker__input": !0,
1420
1426
  "pkt-input--fullwidth": this.fullwidth
@@ -1423,54 +1429,54 @@ let f = class extends z {
1423
1429
  "pkt-btn": !0,
1424
1430
  "pkt-btn--icon-only": !0,
1425
1431
  "pkt-btn--tertiary": !0
1426
- }, this.fromISOToDate = (t) => {
1427
- if (!t)
1432
+ }, this.fromISOToDate = (e) => {
1433
+ if (!e)
1428
1434
  return null;
1429
- const e = new Date(t);
1430
- return e.setHours(12, 0, 0, 0), isNaN(e.getTime()) ? null : e;
1431
- }, this.fromISOtoLocal = (t) => {
1432
- const e = new Date(t);
1433
- return isNaN(e.getTime()) ? "" : ce(e, this.dateformat);
1434
- }, this.massageDates = (t) => {
1435
- const e = t.map((n) => n ?? void 0);
1436
- return this.multiple ? e : this.range ? e.slice(0, 2) : [e[0]];
1437
- }, this.addToSelected = (t) => {
1438
- const e = t.target, n = this.min ? new Date(this.min) : null, a = this.max ? new Date(this.max) : null, r = new Date(e.value.split(",")[0]);
1439
- r.setHours(12, 0, 0, 0), r && !isNaN(r.getTime()) && (!n || r >= n) && (!a || r <= a) && this.calRef.value && this.calRef.value.handleDateSelect(r), e.value = "";
1435
+ const t = new Date(e);
1436
+ return t.setHours(12, 0, 0, 0), isNaN(t.getTime()) ? null : t;
1437
+ }, this.fromISOtoLocal = (e) => {
1438
+ const t = new Date(e);
1439
+ return isNaN(t.getTime()) ? "" : ct(t, this.dateformat);
1440
+ }, this.massageDates = (e) => {
1441
+ const t = e.map((n) => n ?? void 0);
1442
+ return this.multiple ? t : this.range ? t.slice(0, 2) : [t[0]];
1443
+ }, this.addToSelected = (e) => {
1444
+ const t = e.target, n = this.min ? new Date(this.min) : null, a = this.max ? new Date(this.max) : null, r = new Date(t.value.split(",")[0]);
1445
+ r.setHours(12, 0, 0, 0), r && !isNaN(r.getTime()) && (!n || r >= n) && (!a || r <= a) && this.calRef.value && this.calRef.value.handleDateSelect(r), t.value = "";
1440
1446
  };
1441
1447
  }
1442
1448
  /**
1443
1449
  * Housekeeping / lifecycle methods
1444
1450
  */
1445
1451
  async connectedCallback() {
1446
- super.connectedCallback(), this.isMobileSafari = /iP(ad|od|hone)/i.test(window.navigator.userAgent) && !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/), this.inputType = this.isMobileSafari ? "text" : "date", document && document.body.addEventListener("click", (t) => {
1447
- var e, n;
1448
- (e = this.inputRef) != null && e.value && ((n = this.btnRef) != null && n.value) && !this.inputRef.value.contains(t.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(t.target)) && !this.btnRef.value.contains(t.target) && !t.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
1452
+ super.connectedCallback(), this.isMobileSafari = /iP(ad|od|hone)/i.test(window.navigator.userAgent) && !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/), this.inputType = this.isMobileSafari ? "text" : "date", document && document.body.addEventListener("click", (e) => {
1453
+ var t, n;
1454
+ (t = this.inputRef) != null && t.value && ((n = this.btnRef) != null && n.value) && !this.inputRef.value.contains(e.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(e.target)) && !this.btnRef.value.contains(e.target) && !e.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
1449
1455
  }), this.value.length && this._value.length === 0 && (this._value = Array.isArray(this.value) ? this.value : this.value.split(",")), this.min = this.min || w.props.min.default, this.max = this.max || w.props.max.default, typeof this.excludedates == "string" && (this.excludedates = this.excludedates.split(",")), typeof this.excludeweekdays == "string" && (this.excludeweekdays = this.excludeweekdays.split(",")), (this.multiple || this.range) && this.name && !this.name.endsWith("[]") && (this.name = this.name + "[]"), this.calendarOpen && (await X(20), this.handleCalendarPosition());
1450
1456
  }
1451
1457
  disconnectedCallback() {
1452
- super.disconnectedCallback(), document && document.body.removeEventListener("click", (t) => {
1453
- var e, n;
1454
- (e = this.inputRef) != null && e.value && ((n = this.btnRef) != null && n.value) && !this.inputRef.value.contains(t.target) && !this.btnRef.value.contains(t.target) && this.hideCalendar();
1458
+ super.disconnectedCallback(), document && document.body.removeEventListener("click", (e) => {
1459
+ var t, n;
1460
+ (t = this.inputRef) != null && t.value && ((n = this.btnRef) != null && n.value) && !this.inputRef.value.contains(e.target) && !this.btnRef.value.contains(e.target) && this.hideCalendar();
1455
1461
  });
1456
1462
  }
1457
- attributeChangedCallback(t, e, n) {
1458
- t === "value" && this.valueChanged(this.value, e), t === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (n == null ? void 0 : n.split(",")) ?? []), t === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (n == null ? void 0 : n.split(",")) ?? []), super.attributeChangedCallback(t, e, n);
1463
+ attributeChangedCallback(e, t, n) {
1464
+ e === "value" && this.valueChanged(this.value, t), e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (n == null ? void 0 : n.split(",")) ?? []), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (n == null ? void 0 : n.split(",")) ?? []), super.attributeChangedCallback(e, t, n);
1459
1465
  }
1460
- firstUpdated(t) {
1461
- super.firstUpdated(t);
1466
+ firstUpdated(e) {
1467
+ super.firstUpdated(e);
1462
1468
  }
1463
- updated(t) {
1464
- if (super.updated(t), t.has("value")) {
1469
+ updated(e) {
1470
+ if (super.updated(e), e.has("value")) {
1465
1471
  if (this.range && this._value.length === 1) return;
1466
- this.valueChanged(this.value, t.get("value"));
1472
+ this.valueChanged(this.value, e.get("value"));
1467
1473
  }
1468
1474
  }
1469
1475
  /**
1470
1476
  * Date value manipulation
1471
1477
  */
1472
- formatISODate(t) {
1473
- return t.toISOString().split("T")[0];
1478
+ formatISODate(e) {
1479
+ return e.toISOString().split("T")[0];
1474
1480
  }
1475
1481
  renderInput() {
1476
1482
  return M`
@@ -1481,26 +1487,26 @@ let f = class extends z {
1481
1487
  .value=${this._value[0] ?? ""}
1482
1488
  min=${this.min}
1483
1489
  max=${this.max}
1484
- @click=${(t) => {
1485
- t.preventDefault(), this.showCalendar();
1490
+ @click=${(e) => {
1491
+ e.preventDefault(), this.showCalendar();
1486
1492
  }}
1487
1493
  ?disabled=${this.disabled}
1488
- @keydown=${(t) => {
1489
- var e;
1490
- (t.key === "," || t.key === "Enter") && ((e = this.inputRef.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
1494
+ @keydown=${(e) => {
1495
+ var t;
1496
+ (e.key === "," || e.key === "Enter") && ((t = this.inputRef.value) == null || t.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e));
1491
1497
  }}
1492
- @input=${(t) => {
1493
- this.onInput(), t.stopImmediatePropagation();
1498
+ @input=${(e) => {
1499
+ this.onInput(), e.stopImmediatePropagation();
1494
1500
  }}
1495
1501
  @focus=${() => {
1496
1502
  this.onFocus(), this.isMobileSafari && this.showCalendar();
1497
1503
  }}
1498
- @blur=${(t) => {
1499
- var e;
1500
- (e = this.calRef.value) != null && e.contains(t.relatedTarget) || this.onBlur(), this.manageValidity(t.target), this.value = t.target.value;
1504
+ @blur=${(e) => {
1505
+ var t;
1506
+ (t = this.calRef.value) != null && t.contains(e.relatedTarget) || this.onBlur(), this.manageValidity(e.target), this.value = e.target.value;
1501
1507
  }}
1502
- @change=${(t) => {
1503
- t.stopImmediatePropagation();
1508
+ @change=${(e) => {
1509
+ e.stopImmediatePropagation();
1504
1510
  }}
1505
1511
  ${P(this.inputRef)}
1506
1512
  />
@@ -1516,30 +1522,30 @@ let f = class extends z {
1516
1522
  .value=${this._value[0] ?? ""}
1517
1523
  min=${this.min}
1518
1524
  max=${this.max}
1519
- @click=${(t) => {
1520
- t.preventDefault(), this.showCalendar();
1525
+ @click=${(e) => {
1526
+ e.preventDefault(), this.showCalendar();
1521
1527
  }}
1522
1528
  ?disabled=${this.disabled}
1523
- @keydown=${(t) => {
1524
- var e;
1525
- (t.key === "," || t.key === "Enter") && ((e = this.inputRef.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
1529
+ @keydown=${(e) => {
1530
+ var t;
1531
+ (e.key === "," || e.key === "Enter") && ((t = this.inputRef.value) == null || t.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e));
1526
1532
  }}
1527
- @input=${(t) => {
1528
- this.onInput(), t.stopImmediatePropagation();
1533
+ @input=${(e) => {
1534
+ this.onInput(), e.stopImmediatePropagation();
1529
1535
  }}
1530
1536
  @focus=${() => {
1531
1537
  this.onFocus(), this.isMobileSafari && this.showCalendar();
1532
1538
  }}
1533
- @blur=${(t) => {
1534
- var e, n;
1535
- if (t.target.value) {
1536
- this.manageValidity(t.target);
1537
- const a = this.fromISOToDate(t.target.value);
1538
- a && this._value[0] !== t.target.value && this._value[1] && (this.clearInputValue(), (n = (e = this.calRef) == null ? void 0 : e.value) == null || n.handleDateSelect(a));
1539
+ @blur=${(e) => {
1540
+ var t, n;
1541
+ if (e.target.value) {
1542
+ this.manageValidity(e.target);
1543
+ const a = this.fromISOToDate(e.target.value);
1544
+ a && this._value[0] !== e.target.value && this._value[1] && (this.clearInputValue(), (n = (t = this.calRef) == null ? void 0 : t.value) == null || n.handleDateSelect(a));
1539
1545
  } else this._value[0] && this.clearInputValue();
1540
1546
  }}
1541
- @change=${(t) => {
1542
- t.stopImmediatePropagation();
1547
+ @change=${(e) => {
1548
+ e.stopImmediatePropagation();
1543
1549
  }}
1544
1550
  ${P(this.inputRef)}
1545
1551
  />
@@ -1552,40 +1558,40 @@ let f = class extends z {
1552
1558
  .value=${this._value[1] ?? ""}
1553
1559
  min=${this.min}
1554
1560
  max=${this.max}
1555
- @click=${(t) => {
1556
- t.preventDefault(), this.showCalendar();
1561
+ @click=${(e) => {
1562
+ e.preventDefault(), this.showCalendar();
1557
1563
  }}
1558
1564
  ?disabled=${this.disabled}
1559
- @keydown=${(t) => {
1560
- var e;
1561
- (t.key === "," || t.key === "Enter") && ((e = this.inputRefTo.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
1565
+ @keydown=${(e) => {
1566
+ var t;
1567
+ (e.key === "," || e.key === "Enter") && ((t = this.inputRefTo.value) == null || t.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e));
1562
1568
  }}
1563
- @input=${(t) => {
1564
- this.onInput(), t.stopImmediatePropagation();
1569
+ @input=${(e) => {
1570
+ this.onInput(), e.stopImmediatePropagation();
1565
1571
  }}
1566
1572
  @focus=${() => {
1567
1573
  this.onFocus(), this.isMobileSafari && this.showCalendar();
1568
1574
  }}
1569
- @blur=${(t) => {
1570
- var e, n, a;
1571
- if ((e = this.calRef.value) != null && e.contains(t.relatedTarget) || this.onBlur(), t.target.value) {
1572
- this.manageValidity(t.target);
1573
- const r = t.target.value;
1575
+ @blur=${(e) => {
1576
+ var t, n, a;
1577
+ if ((t = this.calRef.value) != null && t.contains(e.relatedTarget) || this.onBlur(), e.target.value) {
1578
+ this.manageValidity(e.target);
1579
+ const r = e.target.value;
1574
1580
  this.min && this.min > r ? this.internals.setValidity(
1575
1581
  { rangeUnderflow: !0 },
1576
1582
  this.strings.forms.messages.rangeUnderflow,
1577
- t.target
1583
+ e.target
1578
1584
  ) : this.max && this.max < r && this.internals.setValidity(
1579
1585
  { rangeOverflow: !0 },
1580
1586
  this.strings.forms.messages.rangeOverflow,
1581
- t.target
1587
+ e.target
1582
1588
  );
1583
- const i = this.fromISOToDate(t.target.value);
1589
+ const i = this.fromISOToDate(e.target.value);
1584
1590
  i && this._value[1] !== this.formatISODate(i) && ((a = (n = this.calRef) == null ? void 0 : n.value) == null || a.handleDateSelect(i));
1585
1591
  }
1586
1592
  }}
1587
- @change=${(t) => {
1588
- t.stopImmediatePropagation();
1593
+ @change=${(e) => {
1594
+ e.stopImmediatePropagation();
1589
1595
  }}
1590
1596
  ${P(this.inputRefTo)}
1591
1597
  />
@@ -1599,25 +1605,25 @@ let f = class extends z {
1599
1605
  id="${this.id}-input"
1600
1606
  min=${this.min}
1601
1607
  max=${this.max}
1602
- @click=${(t) => {
1603
- t.preventDefault(), this.showCalendar();
1608
+ @click=${(e) => {
1609
+ e.preventDefault(), this.showCalendar();
1604
1610
  }}
1605
- @blur=${(t) => {
1606
- var e;
1607
- (e = this.calRef.value) != null && e.contains(t.relatedTarget) || this.onBlur(), this.addToSelected(t);
1611
+ @blur=${(e) => {
1612
+ var t;
1613
+ (t = this.calRef.value) != null && t.contains(e.relatedTarget) || this.onBlur(), this.addToSelected(e);
1608
1614
  }}
1609
- @input=${(t) => {
1610
- this.onInput(), t.stopImmediatePropagation();
1615
+ @input=${(e) => {
1616
+ this.onInput(), e.stopImmediatePropagation();
1611
1617
  }}
1612
1618
  @focus=${() => {
1613
1619
  this.onFocus(), this.isMobileSafari && this.showCalendar();
1614
1620
  }}
1615
- @keydown=${(t) => {
1616
- (t.key === "," || t.key === "Enter") && (t.preventDefault(), this.addToSelected(t)), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t));
1621
+ @keydown=${(e) => {
1622
+ (e.key === "," || e.key === "Enter") && (e.preventDefault(), this.addToSelected(e)), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e));
1617
1623
  }}
1618
1624
  ?disabled=${this.disabled || this.maxlength && this._value.length >= this.maxlength}
1619
- @change=${(t) => {
1620
- t.stopImmediatePropagation();
1625
+ @change=${(e) => {
1626
+ e.stopImmediatePropagation();
1621
1627
  }}
1622
1628
  ${P(this.inputRef)}
1623
1629
  />
@@ -1626,30 +1632,30 @@ let f = class extends z {
1626
1632
  renderTags() {
1627
1633
  return M`
1628
1634
  <div class="pkt-datepicker__tags" aria-live="polite">
1629
- ${this._value[0] ? fe(
1635
+ ${this._value[0] ? ft(
1630
1636
  this._value ?? [],
1631
- (t) => t,
1632
- (t) => M`
1637
+ (e) => e,
1638
+ (e) => M`
1633
1639
  <pkt-tag
1634
- .id="${this.id + t + "-tag"}"
1640
+ .id="${this.id + e + "-tag"}"
1635
1641
  closeTag
1636
- ariaLabel="${this.strings.calendar.deleteDate} ${this.fromISOtoLocal(t)}"
1642
+ ariaLabel="${this.strings.calendar.deleteDate} ${this.fromISOtoLocal(e)}"
1637
1643
  @close=${() => {
1638
- var e;
1639
- return (e = this.calRef.value) == null ? void 0 : e.handleDateSelect(this.fromISOToDate(t));
1644
+ var t;
1645
+ return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(this.fromISOToDate(e));
1640
1646
  }}
1641
- >${this.fromISOtoLocal(t)}</pkt-tag
1647
+ >${this.fromISOtoLocal(e)}</pkt-tag
1642
1648
  >
1643
1649
  `
1644
- ) : N}
1650
+ ) : B}
1645
1651
  </div>
1646
1652
  `;
1647
1653
  }
1648
1654
  renderCalendar() {
1649
1655
  return M`<div
1650
1656
  class="pkt-calendar-popup pkt-${this.calendarOpen ? "show" : "hide"}"
1651
- @focusout=${(t) => {
1652
- this.calendarOpen && this.handleFocusOut(t);
1657
+ @focusout=${(e) => {
1658
+ this.calendarOpen && this.handleFocusOut(e);
1653
1659
  }}
1654
1660
  id="${this.id}-popup"
1655
1661
  ${P(this.popupRef)}
@@ -1667,8 +1673,8 @@ let f = class extends z {
1667
1673
  .excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
1668
1674
  .excludeweekdays=${this.excludeweekdays}
1669
1675
  .currentmonth=${this.currentmonth ? new Date(this.currentmonth) : null}
1670
- @date-selected=${(t) => {
1671
- this.value = !this.multiple && !this.range ? t.detail[0] : t.detail, this._value = t.detail, this.inputRef.value && (this.range && this.inputRefTo.value ? (this.inputRef.value.value = this._value[0] ?? "", this.inputRefTo.value.value = this._value[1] ?? "") : this.multiple || (this.inputRef.value.value = this._value.length ? this._value[0] : ""));
1676
+ @date-selected=${(e) => {
1677
+ this.value = !this.multiple && !this.range ? e.detail[0] : e.detail, this._value = e.detail, this.inputRef.value && (this.range && this.inputRefTo.value ? (this.inputRef.value.value = this._value[0] ?? "", this.inputRefTo.value.value = this._value[1] ?? "") : this.multiple || (this.inputRef.value.value = this._value.length ? this._value[0] : ""));
1672
1678
  }}
1673
1679
  @close=${() => {
1674
1680
  this.onBlur(), this.hideCalendar();
@@ -1690,7 +1696,7 @@ let f = class extends z {
1690
1696
  ?required=${this.required}
1691
1697
  ?optionalTag=${this.optionalTag}
1692
1698
  ?requiredTag=${this.requiredTag}
1693
- ?focusPreventDefault=${!0}
1699
+ ?useWrapper=${this.useWrapper}
1694
1700
  .optionalText=${this.optionalText}
1695
1701
  .requiredText=${this.requiredText}
1696
1702
  .errorMessage=${this.errorMessage}
@@ -1699,7 +1705,7 @@ let f = class extends z {
1699
1705
  .helptextDropdownButton=${this.helptextDropdownButton}
1700
1706
  class="pkt-datepicker"
1701
1707
  >
1702
- ${this.multiple ? this.renderTags() : N}
1708
+ ${this.multiple ? this.renderTags() : B}
1703
1709
  <div class="pkt-datepicker__inputs ${this.range ? "pkt-input__range-inputs" : ""}">
1704
1710
  <div class="pkt-input__container">
1705
1711
  ${this.range ? this.renderRangeInput() : this.multiple ? this.renderMultipleInput() : this.renderInput()}
@@ -1723,80 +1729,83 @@ let f = class extends z {
1723
1729
  * Handlers
1724
1730
  */
1725
1731
  handleCalendarPosition() {
1726
- var t;
1732
+ var e;
1727
1733
  if (this.popupRef.value && this.inputRef.value) {
1728
- const e = this.multiple && !!this.maxlength, n = ((t = this.inputRef.value.parentElement) == null ? void 0 : t.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = e ? n.height + 30 : n.height, r = this.popupRef.value.getBoundingClientRect().height;
1729
- let i = e ? "calc(100% - 30px)" : "100%";
1734
+ const t = this.multiple && !!this.maxlength, n = ((e = this.inputRef.value.parentElement) == null ? void 0 : e.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = t ? n.height + 30 : n.height, r = this.popupRef.value.getBoundingClientRect().height;
1735
+ let i = t ? "calc(100% - 30px)" : "100%";
1730
1736
  n && n.top + r > window.innerHeight && n.top - r > 0 && (i = `calc(100% - ${a}px - ${r}px)`), this.popupRef.value.style.top = i;
1731
1737
  }
1732
1738
  }
1733
- handleFocusOut(t) {
1734
- this.contains(t.target) || (this.onBlur(), this.hideCalendar());
1739
+ handleFocusOut(e) {
1740
+ this.contains(e.target) || (this.onBlur(), this.hideCalendar());
1735
1741
  }
1736
1742
  async showCalendar() {
1737
- var t;
1738
- this.calendarOpen = !0, await X(20), this.handleCalendarPosition(), this.isMobileSafari && ((t = this.calRef.value) == null || t.focusOnCurrentDate());
1743
+ var e;
1744
+ this.calendarOpen = !0, await X(20), this.handleCalendarPosition(), this.isMobileSafari && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
1739
1745
  }
1740
1746
  hideCalendar() {
1741
1747
  this.calendarOpen = !1;
1742
1748
  }
1743
- async toggleCalendar(t) {
1744
- t.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
1749
+ async toggleCalendar(e) {
1750
+ e.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
1745
1751
  }
1746
1752
  };
1747
- p([
1748
- y({ type: String, reflect: !0 })
1753
+ m([
1754
+ g({ type: String, reflect: !0 })
1749
1755
  ], f.prototype, "value", 2);
1750
- p([
1751
- y({ type: Array, reflect: !1 })
1756
+ m([
1757
+ g({ type: Array, reflect: !1 })
1752
1758
  ], f.prototype, "_value", 2);
1753
- p([
1754
- y({ type: String })
1759
+ m([
1760
+ g({ type: String })
1755
1761
  ], f.prototype, "label", 2);
1756
- p([
1757
- y({ type: String })
1762
+ m([
1763
+ g({ type: String })
1758
1764
  ], f.prototype, "helptext", 2);
1759
- p([
1760
- y({ type: String })
1765
+ m([
1766
+ g({ type: String })
1761
1767
  ], f.prototype, "helptextDropdown", 2);
1762
- p([
1763
- y({ type: String })
1768
+ m([
1769
+ g({ type: String })
1764
1770
  ], f.prototype, "helptextDropdownButton", 2);
1765
- p([
1766
- y({ type: String })
1771
+ m([
1772
+ g({ type: String })
1767
1773
  ], f.prototype, "dateformat", 2);
1768
- p([
1769
- y({ type: Boolean, reflect: !0 })
1774
+ m([
1775
+ g({ type: Boolean, reflect: !0 })
1770
1776
  ], f.prototype, "multiple", 2);
1771
- p([
1772
- y({ type: Number })
1777
+ m([
1778
+ g({ type: Number })
1773
1779
  ], f.prototype, "maxlength", 2);
1774
- p([
1775
- y({ type: Boolean, reflect: !0 })
1780
+ m([
1781
+ g({ type: Boolean, reflect: !0 })
1776
1782
  ], f.prototype, "range", 2);
1777
- p([
1778
- y({ type: Boolean })
1783
+ m([
1784
+ g({ type: Boolean })
1779
1785
  ], f.prototype, "weeknumbers", 2);
1780
- p([
1781
- y({ type: Boolean })
1786
+ m([
1787
+ g({ type: Boolean })
1782
1788
  ], f.prototype, "withcontrols", 2);
1783
- p([
1784
- y({ type: Boolean })
1789
+ m([
1790
+ g({ type: Boolean })
1785
1791
  ], f.prototype, "fullwidth", 2);
1786
- p([
1787
- y({ converter: G.csvToArray })
1792
+ m([
1793
+ g({ converter: G.csvToArray })
1788
1794
  ], f.prototype, "excludedates", 2);
1789
- p([
1790
- y({ converter: G.csvToArray })
1795
+ m([
1796
+ g({ converter: G.csvToArray })
1791
1797
  ], f.prototype, "excludeweekdays", 2);
1792
- p([
1793
- y({ type: String })
1798
+ m([
1799
+ g({ type: String })
1794
1800
  ], f.prototype, "currentmonth", 2);
1795
- p([
1796
- y({ type: Boolean, reflect: !0 })
1801
+ m([
1802
+ g({ type: Boolean })
1803
+ ], f.prototype, "useWrapper", 2);
1804
+ m([
1805
+ g({ type: Boolean, reflect: !0 })
1797
1806
  ], f.prototype, "calendarOpen", 2);
1798
- f = p([
1799
- nt("pkt-datepicker")
1807
+ f = m([
1808
+ ne("pkt-datepicker")
1800
1809
  ], f);
1801
1810
  export {
1802
1811
  f as PktDatepicker