@oslokommune/punkt-elements 12.3.1 → 12.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{class-map-DiT0qP3E.js → class-map-CEzmgstO.js} +1 -1
  2. package/dist/{class-map-CA8wadiN.cjs → class-map-DfznHRRW.cjs} +1 -1
  3. package/dist/{index-DSplpVWQ.cjs → index-BCVyjeWS.cjs} +1 -1
  4. package/dist/{index-CPvZ03uX.js → index-BkKs8Yam.js} +52 -53
  5. package/dist/index-BkqOsymS.cjs +90 -0
  6. package/dist/{index-BlHnvy7v.js → index-C7OaW8f8.js} +1 -1
  7. package/dist/{index-BHzxfdBK.js → index-CINnuWkG.js} +113 -97
  8. package/dist/{index-BJ_4AGO3.cjs → index-CkBUiPHx.cjs} +10 -6
  9. package/dist/index.d.ts +2 -0
  10. package/dist/pkt-alert.cjs +1 -1
  11. package/dist/pkt-alert.js +4 -4
  12. package/dist/pkt-calendar.cjs +1 -1
  13. package/dist/pkt-calendar.js +5 -6
  14. package/dist/pkt-card.cjs +1 -1
  15. package/dist/pkt-card.js +4 -4
  16. package/dist/pkt-component-template.cjs +1 -1
  17. package/dist/pkt-component-template.js +3 -3
  18. package/dist/pkt-datepicker.cjs +3 -3
  19. package/dist/pkt-datepicker.js +444 -442
  20. package/dist/pkt-element.cjs +1 -1
  21. package/dist/pkt-element.js +1 -1
  22. package/dist/pkt-icon.cjs +1 -1
  23. package/dist/pkt-icon.js +2 -2
  24. package/dist/pkt-index.cjs +1 -1
  25. package/dist/pkt-index.js +2 -2
  26. package/dist/pkt-input-wrapper.cjs +1 -1
  27. package/dist/pkt-input-wrapper.js +4 -4
  28. package/dist/pkt-link.cjs +1 -1
  29. package/dist/pkt-link.js +4 -4
  30. package/dist/pkt-messagebox.cjs +1 -1
  31. package/dist/pkt-messagebox.js +4 -4
  32. package/dist/pkt-tag.cjs +2 -2
  33. package/dist/pkt-tag.js +18 -19
  34. package/dist/{ref-Bk590hog.cjs → ref-BkUqMgQu.cjs} +1 -1
  35. package/dist/{ref-Co_S0Cgj.js → ref-Cau3ksvI.js} +1 -1
  36. package/package.json +2 -2
  37. package/src/components/datepicker/index.ts +13 -11
  38. package/src/components/element/index.ts +7 -1
  39. package/dist/index-DkGcZra2.cjs +0 -90
  40. package/dist/state-BRgFbJX9.js +0 -12
  41. package/dist/state-D2tUtTi6.cjs +0 -5
@@ -1,63 +1,63 @@
1
- import { R as K, a as z, k as P, D as N, n as y } from "./index-BHzxfdBK.js";
2
- import { e as Z, i as ee, a as te, t as ne } from "./directive-DA0-wdk7.js";
3
- import { u as ae, c as M, a as S, p as q, d as re, i as R, K as $ } from "./ref-Co_S0Cgj.js";
4
- import { R as C } from "./class-map-DiT0qP3E.js";
1
+ import { R as K, a as z, k as P, D as N, n as y } from "./index-CINnuWkG.js";
2
+ import { e as Z, i as tt, a as et, t as nt } from "./directive-DA0-wdk7.js";
3
+ import { u as at, c as M, a as S, p as F, d as rt, i as R, K as $ } from "./ref-Cau3ksvI.js";
4
+ import { R as C } from "./class-map-CEzmgstO.js";
5
5
  import { a as G } from "./converters-DNCwIFwr.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-CPvZ03uX.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-BkKs8Yam.js";
7
7
  import "./pkt-input-wrapper.js";
8
- import "./index-BlHnvy7v.js";
8
+ import "./index-C7OaW8f8.js";
9
9
  import "./pkt-tag.js";
10
- function Y(e) {
11
- return ie(e, { weekStartsOn: 1 });
10
+ function Y(t) {
11
+ return it(t, { weekStartsOn: 1 });
12
12
  }
13
- function U(e) {
14
- const t = k(e), n = t.getFullYear(), a = _(e, 0);
13
+ function U(t) {
14
+ const e = k(t), n = e.getFullYear(), a = _(t, 0);
15
15
  a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
16
- const r = Y(a), i = _(e, 0);
16
+ const r = Y(a), i = _(t, 0);
17
17
  i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
18
18
  const s = Y(i);
19
- return t.getTime() >= r.getTime() ? n + 1 : t.getTime() >= s.getTime() ? n : n - 1;
19
+ return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
20
20
  }
21
- function A(e) {
22
- const t = k(e);
23
- return t.setHours(0, 0, 0, 0), t;
21
+ function A(t) {
22
+ const e = k(t);
23
+ return e.setHours(0, 0, 0, 0), e;
24
24
  }
25
- function B(e) {
26
- const t = k(e), n = new Date(
25
+ function B(t) {
26
+ const e = k(t), n = new Date(
27
27
  Date.UTC(
28
- t.getFullYear(),
29
- t.getMonth(),
30
- t.getDate(),
31
- t.getHours(),
32
- t.getMinutes(),
33
- t.getSeconds(),
34
- t.getMilliseconds()
28
+ e.getFullYear(),
29
+ e.getMonth(),
30
+ e.getDate(),
31
+ e.getHours(),
32
+ e.getMinutes(),
33
+ e.getSeconds(),
34
+ e.getMilliseconds()
35
35
  )
36
36
  );
37
- return n.setUTCFullYear(t.getFullYear()), +e - +n;
37
+ return n.setUTCFullYear(e.getFullYear()), +t - +n;
38
38
  }
39
- function ce(e, t) {
40
- const n = A(e), a = A(t), r = +n - B(n), i = +a - B(a);
41
- return Math.round((r - i) / se);
39
+ function ct(t, e) {
40
+ const n = A(t), a = A(e), r = +n - B(n), i = +a - B(a);
41
+ return Math.round((r - i) / st);
42
42
  }
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), Y(n);
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), Y(n);
46
46
  }
47
- function me(e) {
48
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
47
+ function mt(t) {
48
+ return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
49
49
  }
50
- function fe(e) {
51
- if (!me(e) && typeof e != "number")
50
+ function ft(t) {
51
+ if (!mt(t) && typeof t != "number")
52
52
  return !1;
53
- const t = k(e);
54
- return !isNaN(Number(t));
53
+ const e = k(t);
54
+ return !isNaN(Number(e));
55
55
  }
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;
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;
59
59
  }
60
- const ge = {
60
+ const gt = {
61
61
  lessThanXSeconds: {
62
62
  one: "less than a second",
63
63
  other: "less than {{count}} seconds"
@@ -119,77 +119,77 @@ const ge = {
119
119
  one: "almost 1 year",
120
120
  other: "almost {{count}} years"
121
121
  }
122
- }, ye = (e, t, n) => {
122
+ }, yt = (t, e, n) => {
123
123
  let 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;
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;
126
126
  };
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];
127
+ function q(t) {
128
+ return (e = {}) => {
129
+ const n = e.width ? String(e.width) : t.defaultWidth;
130
+ return t.formats[n] || t.formats[t.defaultWidth];
131
131
  };
132
132
  }
133
- const ve = {
133
+ const vt = {
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
- }, we = {
138
+ }, wt = {
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
- }, be = {
143
+ }, bt = {
144
144
  full: "{{date}} 'at' {{time}}",
145
145
  long: "{{date}} 'at' {{time}}",
146
146
  medium: "{{date}}, {{time}}",
147
147
  short: "{{date}}, {{time}}"
148
- }, ke = {
149
- date: F({
150
- formats: ve,
148
+ }, kt = {
149
+ date: q({
150
+ formats: vt,
151
151
  defaultWidth: "full"
152
152
  }),
153
- time: F({
154
- formats: we,
153
+ time: q({
154
+ formats: wt,
155
155
  defaultWidth: "full"
156
156
  }),
157
- dateTime: F({
158
- formats: be,
157
+ dateTime: q({
158
+ formats: bt,
159
159
  defaultWidth: "full"
160
160
  })
161
- }, xe = {
161
+ }, xt = {
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
- }, Oe = (e, t, n, a) => xe[e];
169
- function W(e) {
170
- return (t, n) => {
168
+ }, Ot = (t, e, n, a) => xt[t];
169
+ function W(t) {
170
+ return (e, n) => {
171
171
  const a = n != null && n.context ? String(n.context) : "standalone";
172
172
  let r;
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];
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];
176
176
  } else {
177
- const s = e.defaultWidth, d = n != null && n.width ? String(n.width) : e.defaultWidth;
178
- r = e.values[d] || e.values[s];
177
+ const s = t.defaultWidth, d = n != null && n.width ? String(n.width) : t.defaultWidth;
178
+ r = t.values[d] || t.values[s];
179
179
  }
180
- const i = e.argumentCallback ? e.argumentCallback(t) : t;
180
+ const i = t.argumentCallback ? t.argumentCallback(e) : e;
181
181
  return r[i];
182
182
  };
183
183
  }
184
- const Pe = {
184
+ const Pt = {
185
185
  narrow: ["B", "A"],
186
186
  abbreviated: ["BC", "AD"],
187
187
  wide: ["Before Christ", "Anno Domini"]
188
- }, Me = {
188
+ }, Mt = {
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
- }, $e = {
192
+ }, $t = {
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 Pe = {
219
219
  "November",
220
220
  "December"
221
221
  ]
222
- }, De = {
222
+ }, Dt = {
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 Pe = {
232
232
  "Friday",
233
233
  "Saturday"
234
234
  ]
235
- }, Te = {
235
+ }, Tt = {
236
236
  narrow: {
237
237
  am: "a",
238
238
  pm: "p",
@@ -263,7 +263,7 @@ const Pe = {
263
263
  evening: "evening",
264
264
  night: "night"
265
265
  }
266
- }, Se = {
266
+ }, St = {
267
267
  narrow: {
268
268
  am: "a",
269
269
  pm: "p",
@@ -294,8 +294,8 @@ const Pe = {
294
294
  evening: "in the evening",
295
295
  night: "at night"
296
296
  }
297
- }, Re = (e, t) => {
298
- const n = Number(e), a = n % 100;
297
+ }, Rt = (t, e) => {
298
+ const n = Number(t), a = n % 100;
299
299
  if (a > 20 || a < 10)
300
300
  switch (a % 10) {
301
301
  case 1:
@@ -306,89 +306,89 @@ const Pe = {
306
306
  return n + "rd";
307
307
  }
308
308
  return n + "th";
309
- }, Ce = {
310
- ordinalNumber: Re,
309
+ }, Ct = {
310
+ ordinalNumber: Rt,
311
311
  era: W({
312
- values: Pe,
312
+ values: Pt,
313
313
  defaultWidth: "wide"
314
314
  }),
315
315
  quarter: W({
316
- values: Me,
316
+ values: Mt,
317
317
  defaultWidth: "wide",
318
- argumentCallback: (e) => e - 1
318
+ argumentCallback: (t) => t - 1
319
319
  }),
320
320
  month: W({
321
- values: $e,
321
+ values: $t,
322
322
  defaultWidth: "wide"
323
323
  }),
324
324
  day: W({
325
- values: De,
325
+ values: Dt,
326
326
  defaultWidth: "wide"
327
327
  }),
328
328
  dayPeriod: W({
329
- values: Te,
329
+ values: Tt,
330
330
  defaultWidth: "wide",
331
- formattingValues: Se,
331
+ formattingValues: St,
332
332
  defaultFormattingWidth: "wide"
333
333
  })
334
334
  };
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);
335
+ function E(t) {
336
+ return (e, n = {}) => {
337
+ const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
338
338
  if (!i)
339
339
  return null;
340
- const s = i[0], d = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], g = Array.isArray(d) ? Ee(d, (l) => l.test(s)) : (
340
+ const s = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(d) ? Et(d, (l) => l.test(s)) : (
341
341
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
342
- We(d, (l) => l.test(s))
342
+ Wt(d, (l) => l.test(s))
343
343
  );
344
344
  let v;
345
- v = e.valueCallback ? e.valueCallback(g) : g, v = n.valueCallback ? (
345
+ v = t.valueCallback ? t.valueCallback(g) : g, 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 = t.slice(s.length);
349
+ const x = e.slice(s.length);
350
350
  return { value: v, rest: x };
351
351
  };
352
352
  }
353
- function We(e, t) {
354
- for (const n in e)
355
- if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
353
+ function Wt(t, e) {
354
+ for (const n in t)
355
+ if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
356
356
  return n;
357
357
  }
358
- function Ee(e, t) {
359
- for (let n = 0; n < e.length; n++)
360
- if (t(e[n]))
358
+ function Et(t, e) {
359
+ for (let n = 0; n < t.length; n++)
360
+ if (e(t[n]))
361
361
  return n;
362
362
  }
363
- function _e(e) {
364
- return (t, n = {}) => {
365
- const a = t.match(e.matchPattern);
363
+ function _t(t) {
364
+ return (e, n = {}) => {
365
+ const a = e.match(t.matchPattern);
366
366
  if (!a) return null;
367
- const r = a[0], i = t.match(e.parsePattern);
367
+ const r = a[0], i = e.match(t.parsePattern);
368
368
  if (!i) return null;
369
- let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
369
+ let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
370
370
  s = n.valueCallback ? n.valueCallback(s) : s;
371
- const d = t.slice(r.length);
371
+ const d = e.slice(r.length);
372
372
  return { value: s, rest: d };
373
373
  };
374
374
  }
375
- const Ye = /^(\d+)(th|st|nd|rd)?/i, qe = /\d+/i, Fe = {
375
+ const Yt = /^(\d+)(th|st|nd|rd)?/i, Ft = /\d+/i, qt = {
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
- }, Ie = {
379
+ }, It = {
380
380
  any: [/^b/i, /^(a|c)/i]
381
- }, Ne = {
381
+ }, Nt = {
382
382
  narrow: /^[1234]/i,
383
383
  abbreviated: /^q[1234]/i,
384
384
  wide: /^[1234](th|st|nd|rd)? quarter/i
385
- }, Ae = {
385
+ }, At = {
386
386
  any: [/1/i, /2/i, /3/i, /4/i]
387
- }, Be = {
387
+ }, Bt = {
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
- }, He = {
391
+ }, Ht = {
392
392
  narrow: [
393
393
  /^j/i,
394
394
  /^f/i,
@@ -417,18 +417,18 @@ const Ye = /^(\d+)(th|st|nd|rd)?/i, qe = /\d+/i, Fe = {
417
417
  /^n/i,
418
418
  /^d/i
419
419
  ]
420
- }, je = {
420
+ }, jt = {
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
- }, Ve = {
425
+ }, Vt = {
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
- }, Le = {
428
+ }, Lt = {
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
- }, Qe = {
431
+ }, Qt = {
432
432
  any: {
433
433
  am: /^a/i,
434
434
  pm: /^p/i,
@@ -439,86 +439,86 @@ const Ye = /^(\d+)(th|st|nd|rd)?/i, qe = /\d+/i, Fe = {
439
439
  evening: /evening/i,
440
440
  night: /night/i
441
441
  }
442
- }, Xe = {
443
- ordinalNumber: _e({
444
- matchPattern: Ye,
445
- parsePattern: qe,
446
- valueCallback: (e) => parseInt(e, 10)
442
+ }, Xt = {
443
+ ordinalNumber: _t({
444
+ matchPattern: Yt,
445
+ parsePattern: Ft,
446
+ valueCallback: (t) => parseInt(t, 10)
447
447
  }),
448
448
  era: E({
449
- matchPatterns: Fe,
449
+ matchPatterns: qt,
450
450
  defaultMatchWidth: "wide",
451
- parsePatterns: Ie,
451
+ parsePatterns: It,
452
452
  defaultParseWidth: "any"
453
453
  }),
454
454
  quarter: E({
455
- matchPatterns: Ne,
455
+ matchPatterns: Nt,
456
456
  defaultMatchWidth: "wide",
457
- parsePatterns: Ae,
457
+ parsePatterns: At,
458
458
  defaultParseWidth: "any",
459
- valueCallback: (e) => e + 1
459
+ valueCallback: (t) => t + 1
460
460
  }),
461
461
  month: E({
462
- matchPatterns: Be,
462
+ matchPatterns: Bt,
463
463
  defaultMatchWidth: "wide",
464
- parsePatterns: He,
464
+ parsePatterns: Ht,
465
465
  defaultParseWidth: "any"
466
466
  }),
467
467
  day: E({
468
- matchPatterns: je,
468
+ matchPatterns: jt,
469
469
  defaultMatchWidth: "wide",
470
- parsePatterns: Ve,
470
+ parsePatterns: Vt,
471
471
  defaultParseWidth: "any"
472
472
  }),
473
473
  dayPeriod: E({
474
- matchPatterns: Le,
474
+ matchPatterns: Lt,
475
475
  defaultMatchWidth: "any",
476
- parsePatterns: Qe,
476
+ parsePatterns: Qt,
477
477
  defaultParseWidth: "any"
478
478
  })
479
- }, Ge = {
479
+ }, Gt = {
480
480
  code: "en-US",
481
- formatDistance: ye,
482
- formatLong: ke,
483
- formatRelative: Oe,
484
- localize: Ce,
485
- match: Xe,
481
+ formatDistance: yt,
482
+ formatLong: kt,
483
+ formatRelative: Ot,
484
+ localize: Ct,
485
+ match: Xt,
486
486
  options: {
487
487
  weekStartsOn: 0,
488
488
  firstWeekContainsDate: 1
489
489
  }
490
490
  };
491
- function Ue(e) {
492
- const t = k(e);
493
- return ce(t, pe(t)) + 1;
491
+ function Ut(t) {
492
+ const e = k(t);
493
+ return ct(e, pt(e)) + 1;
494
494
  }
495
- function Je(e) {
496
- const t = k(e), n = +Y(t) - +he(t);
497
- return Math.round(n / oe) + 1;
495
+ function Jt(t) {
496
+ const e = k(t), n = +Y(e) - +ht(e);
497
+ return Math.round(n / ot) + 1;
498
498
  }
499
- function o(e, t) {
500
- const n = e < 0 ? "-" : "", a = Math.abs(e).toString().padStart(t, "0");
499
+ function o(t, e) {
500
+ const n = t < 0 ? "-" : "", a = Math.abs(t).toString().padStart(e, "0");
501
501
  return n + a;
502
502
  }
503
503
  const b = {
504
504
  // Year
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);
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);
508
508
  },
509
509
  // Month
510
- M(e, t) {
511
- const n = e.getMonth();
512
- return t === "M" ? String(n + 1) : o(n + 1, 2);
510
+ M(t, e) {
511
+ const n = t.getMonth();
512
+ return e === "M" ? String(n + 1) : o(n + 1, 2);
513
513
  },
514
514
  // Day of the month
515
- d(e, t) {
516
- return o(e.getDate(), t.length);
515
+ d(t, e) {
516
+ return o(t.getDate(), e.length);
517
517
  },
518
518
  // AM or PM
519
- a(e, t) {
520
- const n = e.getHours() / 12 >= 1 ? "pm" : "am";
521
- switch (t) {
519
+ a(t, e) {
520
+ const n = t.getHours() / 12 >= 1 ? "pm" : "am";
521
+ switch (e) {
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(e, t) {
536
- return o(e.getHours() % 12 || 12, t.length);
535
+ h(t, e) {
536
+ return o(t.getHours() % 12 || 12, e.length);
537
537
  },
538
538
  // Hour [0-23]
539
- H(e, t) {
540
- return o(e.getHours(), t.length);
539
+ H(t, e) {
540
+ return o(t.getHours(), e.length);
541
541
  },
542
542
  // Minute
543
- m(e, t) {
544
- return o(e.getMinutes(), t.length);
543
+ m(t, e) {
544
+ return o(t.getMinutes(), e.length);
545
545
  },
546
546
  // Second
547
- s(e, t) {
548
- return o(e.getSeconds(), t.length);
547
+ s(t, e) {
548
+ return o(t.getSeconds(), e.length);
549
549
  },
550
550
  // Fraction of second
551
- S(e, t) {
552
- const n = t.length, a = e.getMilliseconds(), r = Math.trunc(
551
+ S(t, e) {
552
+ const n = e.length, a = t.getMilliseconds(), r = Math.trunc(
553
553
  a * Math.pow(10, n - 3)
554
554
  );
555
- return o(r, t.length);
555
+ return o(r, e.length);
556
556
  }
557
557
  }, T = {
558
558
  am: "am",
@@ -565,9 +565,9 @@ const b = {
565
565
  night: "night"
566
566
  }, H = {
567
567
  // Era
568
- G: function(e, t, n) {
569
- const a = e.getFullYear() > 0 ? 1 : 0;
570
- switch (t) {
568
+ G: function(t, e, n) {
569
+ const a = t.getFullYear() > 0 ? 1 : 0;
570
+ switch (e) {
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(e, t, n) {
584
- if (t === "yo") {
585
- const a = e.getFullYear(), r = a > 0 ? a : 1 - a;
583
+ y: function(t, e, n) {
584
+ if (e === "yo") {
585
+ const a = t.getFullYear(), r = a > 0 ? a : 1 - a;
586
586
  return n.ordinalNumber(r, { unit: "year" });
587
587
  }
588
- return b.y(e, t);
588
+ return b.y(t, e);
589
589
  },
590
590
  // Local week-numbering year
591
- Y: function(e, t, n, a) {
592
- const r = ue(e, a), i = r > 0 ? r : 1 - r;
593
- if (t === "YY") {
591
+ Y: function(t, e, n, a) {
592
+ const r = ut(t, a), i = r > 0 ? r : 1 - r;
593
+ if (e === "YY") {
594
594
  const s = i % 100;
595
595
  return o(s, 2);
596
596
  }
597
- return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, t.length);
597
+ return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : o(i, e.length);
598
598
  },
599
599
  // ISO week-numbering year
600
- R: function(e, t) {
601
- const n = U(e);
602
- return o(n, t.length);
600
+ R: function(t, e) {
601
+ const n = U(t);
602
+ return o(n, e.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(e, t) {
614
- const n = e.getFullYear();
615
- return o(n, t.length);
613
+ u: function(t, e) {
614
+ const n = t.getFullYear();
615
+ return o(n, e.length);
616
616
  },
617
617
  // Quarter
618
- Q: function(e, t, n) {
619
- const a = Math.ceil((e.getMonth() + 1) / 3);
620
- switch (t) {
618
+ Q: function(t, e, n) {
619
+ const a = Math.ceil((t.getMonth() + 1) / 3);
620
+ switch (e) {
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(e, t, n) {
647
- const a = Math.ceil((e.getMonth() + 1) / 3);
648
- switch (t) {
646
+ q: function(t, e, n) {
647
+ const a = Math.ceil((t.getMonth() + 1) / 3);
648
+ switch (e) {
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(e, t, n) {
675
- const a = e.getMonth();
676
- switch (t) {
674
+ M: function(t, e, n) {
675
+ const a = t.getMonth();
676
+ switch (e) {
677
677
  case "M":
678
678
  case "MM":
679
- return b.M(e, t);
679
+ return b.M(t, e);
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(e, t, n) {
699
- const a = e.getMonth();
700
- switch (t) {
698
+ L: function(t, e, n) {
699
+ const a = t.getMonth();
700
+ switch (e) {
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(e, t, n, a) {
724
- const r = le(e, a);
725
- return t === "wo" ? n.ordinalNumber(r, { unit: "week" }) : o(r, t.length);
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);
726
726
  },
727
727
  // ISO week of year
728
- I: function(e, t, n) {
729
- const a = Je(e);
730
- return t === "Io" ? n.ordinalNumber(a, { unit: "week" }) : o(a, t.length);
728
+ I: function(t, e, n) {
729
+ const a = Jt(t);
730
+ return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) : o(a, e.length);
731
731
  },
732
732
  // Day of the month
733
- d: function(e, t, n) {
734
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : b.d(e, t);
733
+ d: function(t, e, n) {
734
+ return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : b.d(t, e);
735
735
  },
736
736
  // Day of year
737
- D: function(e, t, n) {
738
- const a = Ue(e);
739
- return t === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : o(a, t.length);
737
+ D: function(t, e, n) {
738
+ const a = Ut(t);
739
+ return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : o(a, e.length);
740
740
  },
741
741
  // Day of week
742
- E: function(e, t, n) {
743
- const a = e.getDay();
744
- switch (t) {
742
+ E: function(t, e, n) {
743
+ const a = t.getDay();
744
+ switch (e) {
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(e, t, n, a) {
772
- const r = e.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
773
- switch (t) {
771
+ e: function(t, e, n, a) {
772
+ const r = t.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
773
+ switch (e) {
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(e, t, n, a) {
805
- const r = e.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
806
- switch (t) {
804
+ c: function(t, e, n, a) {
805
+ const r = t.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
806
+ switch (e) {
807
807
  case "c":
808
808
  return String(i);
809
809
  case "cc":
810
- return o(i, t.length);
810
+ return o(i, e.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(e, t, n) {
838
- const a = e.getDay(), r = a === 0 ? 7 : a;
839
- switch (t) {
837
+ i: function(t, e, n) {
838
+ const a = t.getDay(), r = a === 0 ? 7 : a;
839
+ switch (e) {
840
840
  case "i":
841
841
  return String(r);
842
842
  case "ii":
843
- return o(r, t.length);
843
+ return o(r, e.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(e, t, n) {
871
- const r = e.getHours() / 12 >= 1 ? "pm" : "am";
872
- switch (t) {
870
+ a: function(t, e, n) {
871
+ const r = t.getHours() / 12 >= 1 ? "pm" : "am";
872
+ switch (e) {
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(e, t, n) {
899
- const a = e.getHours();
898
+ b: function(t, e, n) {
899
+ const a = t.getHours();
900
900
  let r;
901
- switch (a === 12 ? r = T.noon : a === 0 ? r = T.midnight : r = a / 12 >= 1 ? "pm" : "am", t) {
901
+ switch (a === 12 ? r = T.noon : a === 0 ? r = T.midnight : r = a / 12 >= 1 ? "pm" : "am", e) {
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(e, t, n) {
928
- const a = e.getHours();
927
+ B: function(t, e, n) {
928
+ const a = t.getHours();
929
929
  let r;
930
- switch (a >= 17 ? r = T.evening : a >= 12 ? r = T.afternoon : a >= 4 ? r = T.morning : r = T.night, t) {
930
+ switch (a >= 17 ? r = T.evening : a >= 12 ? r = T.afternoon : a >= 4 ? r = T.morning : r = T.night, e) {
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(e, t, n) {
953
- if (t === "ho") {
954
- let a = e.getHours() % 12;
952
+ h: function(t, e, n) {
953
+ if (e === "ho") {
954
+ let a = t.getHours() % 12;
955
955
  return a === 0 && (a = 12), n.ordinalNumber(a, { unit: "hour" });
956
956
  }
957
- return b.h(e, t);
957
+ return b.h(t, e);
958
958
  },
959
959
  // Hour [0-23]
960
- H: function(e, t, n) {
961
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : b.H(e, t);
960
+ H: function(t, e, n) {
961
+ return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : b.H(t, e);
962
962
  },
963
963
  // Hour [0-11]
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);
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);
967
967
  },
968
968
  // Hour [1-24]
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);
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);
972
972
  },
973
973
  // Minute
974
- m: function(e, t, n) {
975
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : b.m(e, t);
974
+ m: function(t, e, n) {
975
+ return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : b.m(t, e);
976
976
  },
977
977
  // Second
978
- s: function(e, t, n) {
979
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : b.s(e, t);
978
+ s: function(t, e, n) {
979
+ return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : b.s(t, e);
980
980
  },
981
981
  // Fraction of second
982
- S: function(e, t) {
983
- return b.S(e, t);
982
+ S: function(t, e) {
983
+ return b.S(t, e);
984
984
  },
985
985
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
986
- X: function(e, t, n) {
987
- const a = e.getTimezoneOffset();
986
+ X: function(t, e, n) {
987
+ const a = t.getTimezoneOffset();
988
988
  if (a === 0)
989
989
  return "Z";
990
- switch (t) {
990
+ switch (e) {
991
991
  case "X":
992
992
  return V(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(e, t, n) {
1004
- const a = e.getTimezoneOffset();
1005
- switch (t) {
1003
+ x: function(t, e, n) {
1004
+ const a = t.getTimezoneOffset();
1005
+ switch (e) {
1006
1006
  case "x":
1007
1007
  return V(a);
1008
1008
  case "xxxx":
@@ -1015,9 +1015,9 @@ const b = {
1015
1015
  }
1016
1016
  },
1017
1017
  // Timezone (GMT)
1018
- O: function(e, t, n) {
1019
- const a = e.getTimezoneOffset();
1020
- switch (t) {
1018
+ O: function(t, e, n) {
1019
+ const a = t.getTimezoneOffset();
1020
+ switch (e) {
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(e, t, n) {
1032
- const a = e.getTimezoneOffset();
1033
- switch (t) {
1031
+ z: function(t, e, n) {
1032
+ const a = t.getTimezoneOffset();
1033
+ switch (e) {
1034
1034
  case "z":
1035
1035
  case "zz":
1036
1036
  case "zzz":
@@ -1041,112 +1041,112 @@ const b = {
1041
1041
  }
1042
1042
  },
1043
1043
  // Seconds timestamp
1044
- t: function(e, t, n) {
1045
- const a = Math.trunc(e.getTime() / 1e3);
1046
- return o(a, t.length);
1044
+ t: function(t, e, n) {
1045
+ const a = Math.trunc(t.getTime() / 1e3);
1046
+ return o(a, e.length);
1047
1047
  },
1048
1048
  // Milliseconds timestamp
1049
- T: function(e, t, n) {
1050
- const a = e.getTime();
1051
- return o(a, t.length);
1049
+ T: function(t, e, n) {
1050
+ const a = t.getTime();
1051
+ return o(a, e.length);
1052
1052
  }
1053
1053
  };
1054
- function j(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);
1054
+ function j(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);
1057
1057
  }
1058
- function V(e, t) {
1059
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + o(Math.abs(e) / 60, 2) : D(e, t);
1058
+ function V(t, e) {
1059
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : D(t, e);
1060
1060
  }
1061
- function D(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;
1061
+ function D(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;
1064
1064
  }
1065
- const L = (e, t) => {
1066
- switch (e) {
1065
+ const L = (t, e) => {
1066
+ switch (t) {
1067
1067
  case "P":
1068
- return t.date({ width: "short" });
1068
+ return e.date({ width: "short" });
1069
1069
  case "PP":
1070
- return t.date({ width: "medium" });
1070
+ return e.date({ width: "medium" });
1071
1071
  case "PPP":
1072
- return t.date({ width: "long" });
1072
+ return e.date({ width: "long" });
1073
1073
  case "PPPP":
1074
1074
  default:
1075
- return t.date({ width: "full" });
1075
+ return e.date({ width: "full" });
1076
1076
  }
1077
- }, J = (e, t) => {
1078
- switch (e) {
1077
+ }, J = (t, e) => {
1078
+ switch (t) {
1079
1079
  case "p":
1080
- return t.time({ width: "short" });
1080
+ return e.time({ width: "short" });
1081
1081
  case "pp":
1082
- return t.time({ width: "medium" });
1082
+ return e.time({ width: "medium" });
1083
1083
  case "ppp":
1084
- return t.time({ width: "long" });
1084
+ return e.time({ width: "long" });
1085
1085
  case "pppp":
1086
1086
  default:
1087
- return t.time({ width: "full" });
1087
+ return e.time({ width: "full" });
1088
1088
  }
1089
- }, Ke = (e, t) => {
1090
- const n = e.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
1089
+ }, Kt = (t, e) => {
1090
+ const n = t.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
1091
1091
  if (!r)
1092
- return L(e, t);
1092
+ return L(t, e);
1093
1093
  let i;
1094
1094
  switch (a) {
1095
1095
  case "P":
1096
- i = t.dateTime({ width: "short" });
1096
+ i = e.dateTime({ width: "short" });
1097
1097
  break;
1098
1098
  case "PP":
1099
- i = t.dateTime({ width: "medium" });
1099
+ i = e.dateTime({ width: "medium" });
1100
1100
  break;
1101
1101
  case "PPP":
1102
- i = t.dateTime({ width: "long" });
1102
+ i = e.dateTime({ width: "long" });
1103
1103
  break;
1104
1104
  case "PPPP":
1105
1105
  default:
1106
- i = t.dateTime({ width: "full" });
1106
+ i = e.dateTime({ width: "full" });
1107
1107
  break;
1108
1108
  }
1109
- return i.replace("{{date}}", L(a, t)).replace("{{time}}", J(r, t));
1110
- }, ze = {
1109
+ return i.replace("{{date}}", L(a, e)).replace("{{time}}", J(r, e));
1110
+ }, zt = {
1111
1111
  p: J,
1112
- P: Ke
1113
- }, Ze = /^D+$/, et = /^Y+$/, tt = ["D", "DD", "YY", "YYYY"];
1114
- function nt(e) {
1115
- return Ze.test(e);
1112
+ P: Kt
1113
+ }, Zt = /^D+$/, te = /^Y+$/, ee = ["D", "DD", "YY", "YYYY"];
1114
+ function ne(t) {
1115
+ return Zt.test(t);
1116
1116
  }
1117
- function at(e) {
1118
- return et.test(e);
1117
+ function ae(t) {
1118
+ return te.test(t);
1119
1119
  }
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);
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);
1123
1123
  }
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`;
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`;
1127
1127
  }
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) {
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
1130
  var x, l, f, 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 = (f = a.locale) == null ? void 0 : f.options) == null ? void 0 : h.weekStartsOn) ?? 0, d = k(e);
1132
- if (!fe(d))
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 = (f = a.locale) == null ? void 0 : f.options) == null ? void 0 : h.weekStartsOn) ?? 0, d = k(t);
1132
+ if (!ft(d))
1133
1133
  throw new RangeError("Invalid time value");
1134
- let g = t.match(ot).map((u) => {
1134
+ let g = e.match(oe).map((u) => {
1135
1135
  const c = u[0];
1136
1136
  if (c === "p" || c === "P") {
1137
- const O = ze[c];
1137
+ const O = zt[c];
1138
1138
  return O(u, r.formatLong);
1139
1139
  }
1140
1140
  return u;
1141
- }).join("").match(st).map((u) => {
1141
+ }).join("").match(se).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: ht(u) };
1146
+ return { isToken: !1, value: he(u) };
1147
1147
  if (H[c])
1148
1148
  return { isToken: !0, value: u };
1149
- if (c.match(dt))
1149
+ if (c.match(de))
1150
1150
  throw new RangeError(
1151
1151
  "Format string contains an unescaped latin alphabet character `" + c + "`"
1152
1152
  );
@@ -1161,41 +1161,41 @@ function ct(e, t, n) {
1161
1161
  return g.map((u) => {
1162
1162
  if (!u.isToken) return u.value;
1163
1163
  const c = u.value;
1164
- (at(c) || nt(c)) && rt(c, t, String(e));
1164
+ (ae(c) || ne(c)) && re(c, e, String(t));
1165
1165
  const O = H[c[0]];
1166
1166
  return O(d, c, r.localize, v);
1167
1167
  }).join("");
1168
1168
  }
1169
- function ht(e) {
1170
- const t = e.match(ut);
1171
- return t ? t[1].replace(lt, "'") : e;
1169
+ function he(t) {
1170
+ const e = t.match(ue);
1171
+ return e ? e[1].replace(le, "'") : t;
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 = (e, t, n) => {
1178
+ const Q = (t, e, n) => {
1179
1179
  const a = /* @__PURE__ */ new Map();
1180
- for (let r = t; r <= n; r++) a.set(e[r], r);
1180
+ for (let r = e; r <= n; r++) a.set(t[r], r);
1181
1181
  return a;
1182
- }, mt = 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");
1182
+ }, me = 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");
1185
1185
  }
1186
- dt(e, t, n) {
1186
+ dt(t, e, n) {
1187
1187
  let a;
1188
- n === void 0 ? n = t : t !== void 0 && (a = t);
1188
+ n === void 0 ? n = e : e !== void 0 && (a = e);
1189
1189
  const r = [], i = [];
1190
1190
  let s = 0;
1191
- for (const d of e) r[s] = a ? a(d, s) : s, i[s] = n(d, s), s++;
1191
+ for (const d of t) r[s] = a ? a(d, s) : s, i[s] = n(d, s), s++;
1192
1192
  return { values: i, keys: r };
1193
1193
  }
1194
- render(e, t, n) {
1195
- return this.dt(e, t, n).values;
1194
+ render(t, e, n) {
1195
+ return this.dt(t, e, n).values;
1196
1196
  }
1197
- update(e, [t, n, a]) {
1198
- const r = ae(e), { values: i, keys: s } = this.dt(t, n, a);
1197
+ update(t, [e, n, a]) {
1198
+ const r = at(t), { values: i, keys: s } = this.dt(e, n, a);
1199
1199
  if (!Array.isArray(r)) return this.ut = s, i;
1200
1200
  const d = this.ut ?? (this.ut = []), g = [];
1201
1201
  let v, x, l = 0, f = r.length - 1, h = 0, u = i.length - 1;
@@ -1203,28 +1203,28 @@ const Q = (e, t, n) => {
1203
1203
  else if (r[f] === null) f--;
1204
1204
  else if (d[l] === s[h]) g[h] = M(r[l], i[h]), l++, h++;
1205
1205
  else if (d[f] === s[u]) g[u] = M(r[f], i[u]), f--, u--;
1206
- else if (d[l] === s[u]) g[u] = M(r[l], i[u]), S(e, g[u + 1], r[l]), l++, u--;
1207
- else if (d[f] === s[h]) g[h] = M(r[f], i[h]), S(e, r[l], r[f]), f--, h++;
1206
+ else if (d[l] === s[u]) g[u] = M(r[l], i[u]), S(t, g[u + 1], r[l]), l++, u--;
1207
+ else if (d[f] === s[h]) g[h] = M(r[f], i[h]), S(t, r[l], r[f]), f--, h++;
1208
1208
  else if (v === void 0 && (v = Q(s, h, u), x = Q(d, l, f)), v.has(d[l])) if (v.has(d[f])) {
1209
1209
  const c = x.get(s[h]), O = c !== void 0 ? r[c] : null;
1210
1210
  if (O === null) {
1211
- const I = S(e, r[l]);
1211
+ const I = S(t, r[l]);
1212
1212
  M(I, i[h]), g[h] = I;
1213
- } else g[h] = M(O, i[h]), S(e, r[l], O), r[c] = null;
1213
+ } else g[h] = M(O, i[h]), S(t, r[l], O), r[c] = null;
1214
1214
  h++;
1215
- } else q(r[f]), f--;
1216
- else q(r[l]), l++;
1215
+ } else F(r[f]), f--;
1216
+ else F(r[l]), l++;
1217
1217
  for (; h <= u; ) {
1218
- const c = S(e, g[u + 1]);
1218
+ const c = S(t, g[u + 1]);
1219
1219
  M(c, i[h]), g[h++] = c;
1220
1220
  }
1221
1221
  for (; l <= f; ) {
1222
1222
  const c = r[l++];
1223
- c !== null && q(c);
1223
+ c !== null && F(c);
1224
1224
  }
1225
- return this.ut = s, re(e, g), K;
1225
+ return this.ut = s, rt(t, g), K;
1226
1226
  }
1227
- }), ft = "pkt-datepicker", pt = !0, gt = {
1227
+ }), fe = "pkt-datepicker", pe = !0, ge = {
1228
1228
  name: {
1229
1229
  type: "string",
1230
1230
  name: "Navn",
@@ -1386,7 +1386,7 @@ const Q = (e, t, n) => {
1386
1386
  name: "ID",
1387
1387
  description: "Unik identifikasjon for datovelgeren"
1388
1388
  }
1389
- }, yt = {
1389
+ }, ye = {
1390
1390
  change: {
1391
1391
  description: "Returnerer kommaseparert liste av valgte datoer i ISO-format"
1392
1392
  },
@@ -1397,18 +1397,18 @@ const Q = (e, t, n) => {
1397
1397
  description: "Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes"
1398
1398
  }
1399
1399
  }, w = {
1400
- name: ft,
1400
+ name: fe,
1401
1401
  "css-class": "pkt-datepicker",
1402
- isElement: pt,
1403
- props: gt,
1404
- events: yt
1402
+ isElement: pe,
1403
+ props: ge,
1404
+ events: ye
1405
1405
  };
1406
- var vt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, p = (e, t, n, a) => {
1407
- for (var r = a > 1 ? void 0 : a ? wt(t, n) : t, i = e.length - 1, s; i >= 0; i--)
1408
- (s = e[i]) && (r = (a ? s(t, n, r) : s(r)) || r);
1409
- return a && r && vt(t, n, r), r;
1406
+ var ve = Object.defineProperty, we = Object.getOwnPropertyDescriptor, p = (t, e, n, a) => {
1407
+ for (var r = a > 1 ? void 0 : a ? we(e, n) : e, i = t.length - 1, s; i >= 0; i--)
1408
+ (s = t[i]) && (r = (a ? s(e, n, r) : s(r)) || r);
1409
+ return a && r && ve(e, n, r), r;
1410
1410
  };
1411
- const X = (e) => new Promise((t) => setTimeout(t, e));
1411
+ const X = (t) => new Promise((e) => setTimeout(e, t));
1412
1412
  let m = class extends z {
1413
1413
  constructor() {
1414
1414
  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 = this.formatISODate(/* @__PURE__ */ new Date()), this.calendarOpen = !1, this.inputRef = R(), this.inputRefTo = R(), this.btnRef = R(), this.calRef = R(), this.popupRef = R(), this.inputClasses = {
@@ -1420,40 +1420,40 @@ let m = class extends z {
1420
1420
  "pkt-btn": !0,
1421
1421
  "pkt-btn--icon-only": !0,
1422
1422
  "pkt-btn--tertiary": !0
1423
- }, this.fromISOToDate = (e) => {
1424
- if (!e)
1423
+ }, this.fromISOToDate = (t) => {
1424
+ if (!t)
1425
1425
  return null;
1426
- const t = new Date(e);
1427
- return t.setHours(12, 0, 0, 0), isNaN(t.getTime()) ? null : t;
1428
- }, this.fromISOtoLocal = (e) => {
1429
- const t = new Date(e);
1430
- return isNaN(t.getTime()) ? "" : ct(t, this.dateformat);
1431
- }, this.massageDates = (e) => {
1432
- const t = e.map((n) => n ?? void 0);
1433
- return this.multiple ? t : this.range ? t.slice(0, 2) : [t[0]];
1434
- }, this.addToSelected = (e) => {
1435
- 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]);
1436
- 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 = "", this.requestUpdate("value");
1426
+ const e = new Date(t);
1427
+ return e.setHours(12, 0, 0, 0), isNaN(e.getTime()) ? null : e;
1428
+ }, this.fromISOtoLocal = (t) => {
1429
+ const e = new Date(t);
1430
+ return isNaN(e.getTime()) ? "" : ce(e, this.dateformat);
1431
+ }, this.massageDates = (t) => {
1432
+ const e = t.map((n) => n ?? void 0);
1433
+ return this.multiple ? e : this.range ? e.slice(0, 2) : [e[0]];
1434
+ }, this.addToSelected = (t) => {
1435
+ 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]);
1436
+ 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 = "", this.requestUpdate("value");
1437
1437
  };
1438
1438
  }
1439
1439
  /**
1440
1440
  * Housekeeping / lifecycle methods
1441
1441
  */
1442
1442
  async connectedCallback() {
1443
- super.connectedCallback(), document && document.body.addEventListener("click", (e) => {
1444
- var t, n;
1445
- (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.hideCalendar();
1443
+ super.connectedCallback(), document && document.body.addEventListener("click", (t) => {
1444
+ var e, n;
1445
+ (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.hideCalendar();
1446
1446
  }), 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());
1447
1447
  }
1448
1448
  disconnectedCallback() {
1449
- super.disconnectedCallback(), document && document.body.removeEventListener("click", (e) => {
1450
- var t, n;
1451
- (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();
1449
+ super.disconnectedCallback(), document && document.body.removeEventListener("click", (t) => {
1450
+ var e, n;
1451
+ (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();
1452
1452
  });
1453
1453
  }
1454
- attributeChangedCallback(e, t, n) {
1454
+ attributeChangedCallback(t, e, n) {
1455
1455
  var a, r;
1456
- if (super.attributeChangedCallback(e, t, n), e === "value") {
1456
+ if (super.attributeChangedCallback(t, e, n), t === "value") {
1457
1457
  if (this.value === "" || this.value.length === 0)
1458
1458
  this._value = [];
1459
1459
  else if (this.value.length && this._value.length === 0) {
@@ -1461,12 +1461,14 @@ let m = class extends z {
1461
1461
  for (const s of i)
1462
1462
  s && !this._value.includes(s) && ((r = (a = this.calRef) == null ? void 0 : a.value) == null || r.handleDateSelect(this.fromISOToDate(s)));
1463
1463
  }
1464
- this.requestUpdate("value");
1465
1464
  }
1466
- 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(",")) ?? []);
1465
+ 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(",")) ?? []);
1467
1466
  }
1468
- updated(e) {
1469
- if (super.updated(e), e.has("value")) {
1467
+ firstUpdated(t) {
1468
+ super.firstUpdated(t);
1469
+ }
1470
+ updated(t) {
1471
+ if (super.updated(t), t.has("value")) {
1470
1472
  if (this.range && this._value.length === 1)
1471
1473
  return;
1472
1474
  this.onInput(this.value);
@@ -1475,8 +1477,8 @@ let m = class extends z {
1475
1477
  /**
1476
1478
  * Date value manipulation
1477
1479
  */
1478
- formatISODate(e) {
1479
- return e.toISOString().split("T")[0];
1480
+ formatISODate(t) {
1481
+ return t.toISOString().split("T")[0];
1480
1482
  }
1481
1483
  renderInput() {
1482
1484
  return P`
@@ -1489,15 +1491,15 @@ let m = class extends z {
1489
1491
  min=${this.min}
1490
1492
  max=${this.max}
1491
1493
  @focus=${this.showCalendar}
1492
- @click=${(e) => {
1493
- e.preventDefault();
1494
+ @click=${(t) => {
1495
+ t.preventDefault();
1494
1496
  }}
1495
1497
  ?disabled=${this.disabled}
1496
- @blur=${(e) => {
1497
- this.manageValidity(e.target), this.value = e.target.value, this._value = this.massageDates(e.target.value.split(","));
1498
+ @blur=${(t) => {
1499
+ this.manageValidity(t.target), this.value = t.target.value, this._value = this.massageDates(t.target.value.split(","));
1498
1500
  }}
1499
- @change=${(e) => {
1500
- e.stopImmediatePropagation();
1501
+ @change=${(t) => {
1502
+ t.stopImmediatePropagation();
1501
1503
  }}
1502
1504
  ${$(this.inputRef)}
1503
1505
  />
@@ -1515,20 +1517,20 @@ let m = class extends z {
1515
1517
  min=${this.min}
1516
1518
  max=${this.max}
1517
1519
  @focus=${this.showCalendar}
1518
- @click=${(e) => {
1519
- e.preventDefault();
1520
+ @click=${(t) => {
1521
+ t.preventDefault();
1520
1522
  }}
1521
1523
  ?disabled=${this.disabled}
1522
- @blur=${(e) => {
1523
- var t, n;
1524
- if (e.target.value) {
1525
- this.manageValidity(e.target);
1526
- const a = this.fromISOToDate(e.target.value);
1527
- a && ((n = (t = this.calRef) == null ? void 0 : t.value) == null || n.handleDateSelect(a));
1524
+ @blur=${(t) => {
1525
+ var e, n;
1526
+ if (t.target.value) {
1527
+ this.manageValidity(t.target);
1528
+ const a = this.fromISOToDate(t.target.value);
1529
+ a && ((n = (e = this.calRef) == null ? void 0 : e.value) == null || n.handleDateSelect(a));
1528
1530
  }
1529
1531
  }}
1530
- @change=${(e) => {
1531
- e.stopImmediatePropagation();
1532
+ @change=${(t) => {
1533
+ t.stopImmediatePropagation();
1532
1534
  }}
1533
1535
  ${$(this.inputRef)}
1534
1536
  />
@@ -1542,30 +1544,30 @@ let m = class extends z {
1542
1544
  min=${this.min}
1543
1545
  max=${this.max}
1544
1546
  @focus=${this.showCalendar}
1545
- @click=${(e) => {
1546
- e.preventDefault();
1547
+ @click=${(t) => {
1548
+ t.preventDefault();
1547
1549
  }}
1548
1550
  ?disabled=${this.disabled}
1549
- @blur=${(e) => {
1550
- var t, n;
1551
- if (e.target.value) {
1552
- this.manageValidity(e.target);
1553
- const a = e.target.value;
1551
+ @blur=${(t) => {
1552
+ var e, n;
1553
+ if (t.target.value) {
1554
+ this.manageValidity(t.target);
1555
+ const a = t.target.value;
1554
1556
  this.min && this.min > a ? this.internals.setValidity(
1555
1557
  { rangeUnderflow: !0 },
1556
1558
  this.strings.forms.messages.rangeUnderflow,
1557
- e.target
1559
+ t.target
1558
1560
  ) : this.max && this.max < a && this.internals.setValidity(
1559
1561
  { rangeOverflow: !0 },
1560
1562
  this.strings.forms.messages.rangeOverflow,
1561
- e.target
1563
+ t.target
1562
1564
  );
1563
- const r = this.fromISOToDate(e.target.value);
1564
- r && this._value[1] !== this.formatISODate(r) && ((n = (t = this.calRef) == null ? void 0 : t.value) == null || n.handleDateSelect(r));
1565
+ const r = this.fromISOToDate(t.target.value);
1566
+ r && this._value[1] !== this.formatISODate(r) && ((n = (e = this.calRef) == null ? void 0 : e.value) == null || n.handleDateSelect(r));
1565
1567
  }
1566
1568
  }}
1567
- @change=${(e) => {
1568
- e.stopImmediatePropagation();
1569
+ @change=${(t) => {
1570
+ t.stopImmediatePropagation();
1569
1571
  }}
1570
1572
  ${$(this.inputRefTo)}
1571
1573
  />
@@ -1581,18 +1583,18 @@ let m = class extends z {
1581
1583
  min=${this.min}
1582
1584
  max=${this.max}
1583
1585
  @focus=${this.showCalendar}
1584
- @click=${(e) => {
1585
- e.preventDefault();
1586
+ @click=${(t) => {
1587
+ t.preventDefault();
1586
1588
  }}
1587
- @blur=${(e) => {
1588
- this.addToSelected(e);
1589
+ @blur=${(t) => {
1590
+ this.addToSelected(t);
1589
1591
  }}
1590
- @keydown=${(e) => {
1591
- (e.key === "," || e.key === "Enter") && (e.preventDefault(), this.addToSelected(e));
1592
+ @keydown=${(t) => {
1593
+ (t.key === "," || t.key === "Enter") && (t.preventDefault(), this.addToSelected(t));
1592
1594
  }}
1593
1595
  ?disabled=${this.disabled || this.maxlength && this._value.length >= this.maxlength}
1594
- @change=${(e) => {
1595
- e.stopImmediatePropagation();
1596
+ @change=${(t) => {
1597
+ t.stopImmediatePropagation();
1596
1598
  }}
1597
1599
  ${$(this.inputRef)}
1598
1600
  />
@@ -1601,18 +1603,18 @@ let m = class extends z {
1601
1603
  renderTags() {
1602
1604
  return P`
1603
1605
  <div class="pkt-datepicker__tags" aria-live="polite">
1604
- ${this._value[0] ? mt(
1606
+ ${this._value[0] ? me(
1605
1607
  this._value ?? [],
1606
- (e) => e,
1607
- (e) => P`
1608
+ (t) => t,
1609
+ (t) => P`
1608
1610
  <pkt-tag
1609
- .id="${this.id + e + "-tag"}"
1611
+ .id="${this.id + t + "-tag"}"
1610
1612
  closeTag
1611
1613
  @onClose=${() => {
1612
- var t;
1613
- return (t = this.calRef.value) == null ? void 0 : t.handleDateSelect(this.fromISOToDate(e));
1614
+ var e;
1615
+ return (e = this.calRef.value) == null ? void 0 : e.handleDateSelect(this.fromISOToDate(t));
1614
1616
  }}
1615
- >${this.fromISOtoLocal(e)}</pkt-tag
1617
+ >${this.fromISOtoLocal(t)}</pkt-tag
1616
1618
  >
1617
1619
  `
1618
1620
  ) : N}
@@ -1639,8 +1641,8 @@ let m = class extends z {
1639
1641
  .excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
1640
1642
  .excludeweekdays=${this.excludeweekdays}
1641
1643
  .currentmonth=${new Date(this.currentmonth)}
1642
- @date-selected=${(e) => {
1643
- this.value = !this.multiple && !this.range ? Array.isArray(e.detail) ? e.detail[0] : e.detail.split(",")[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] : ""));
1644
+ @date-selected=${(t) => {
1645
+ this.value = !this.multiple && !this.range ? Array.isArray(t.detail) ? t.detail[0] : t.detail.split(",")[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] : ""));
1644
1646
  }}
1645
1647
  @close=${this.hideCalendar}
1646
1648
  ${$(this.calRef)}
@@ -1690,15 +1692,15 @@ let m = class extends z {
1690
1692
  * Handlers
1691
1693
  */
1692
1694
  handleCalendarPosition() {
1693
- var e;
1695
+ var t;
1694
1696
  if (this.popupRef.value && this.inputRef.value) {
1695
- 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;
1696
- let i = t ? "calc(100% - 30px)" : "100%";
1697
+ 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;
1698
+ let i = e ? "calc(100% - 30px)" : "100%";
1697
1699
  n && n.top + r > window.innerHeight && n.top - r > 0 && (i = `calc(100% - ${a}px - ${r}px)`), this.popupRef.value.style.top = i;
1698
1700
  }
1699
1701
  }
1700
- handleFocusOut(e) {
1701
- this.contains(e.target) || this.hideCalendar();
1702
+ handleFocusOut(t) {
1703
+ this.contains(t.target) || this.hideCalendar();
1702
1704
  }
1703
1705
  async showCalendar() {
1704
1706
  this.calendarOpen = !0, await X(20), this.handleCalendarPosition();
@@ -1706,8 +1708,8 @@ let m = class extends z {
1706
1708
  hideCalendar() {
1707
1709
  this.calendarOpen = !1;
1708
1710
  }
1709
- toggleCalendar(e) {
1710
- e.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
1711
+ toggleCalendar(t) {
1712
+ t.preventDefault(), this.calendarOpen ? this.hideCalendar() : this.showCalendar();
1711
1713
  }
1712
1714
  };
1713
1715
  p([
@@ -1717,19 +1719,19 @@ p([
1717
1719
  y({ type: Array, reflect: !1 })
1718
1720
  ], m.prototype, "_value", 2);
1719
1721
  p([
1720
- y({ type: String, reflect: !0 })
1722
+ y({ type: String })
1721
1723
  ], m.prototype, "label", 2);
1722
1724
  p([
1723
- y({ type: String, reflect: !0 })
1725
+ y({ type: String })
1724
1726
  ], m.prototype, "helptext", 2);
1725
1727
  p([
1726
- y({ type: String, reflect: !0 })
1728
+ y({ type: String })
1727
1729
  ], m.prototype, "helptextDropdown", 2);
1728
1730
  p([
1729
- y({ type: String, reflect: !0 })
1731
+ y({ type: String })
1730
1732
  ], m.prototype, "helptextDropdownButton", 2);
1731
1733
  p([
1732
- y({ type: String, reflect: !0 })
1734
+ y({ type: String })
1733
1735
  ], m.prototype, "dateformat", 2);
1734
1736
  p([
1735
1737
  y({ type: Boolean, reflect: !0 })
@@ -1741,13 +1743,13 @@ p([
1741
1743
  y({ type: Boolean, reflect: !0 })
1742
1744
  ], m.prototype, "range", 2);
1743
1745
  p([
1744
- y({ type: Boolean, reflect: !0 })
1746
+ y({ type: Boolean })
1745
1747
  ], m.prototype, "weeknumbers", 2);
1746
1748
  p([
1747
- y({ type: Boolean, reflect: !0 })
1749
+ y({ type: Boolean })
1748
1750
  ], m.prototype, "withcontrols", 2);
1749
1751
  p([
1750
- y({ type: Boolean, reflect: !0 })
1752
+ y({ type: Boolean })
1751
1753
  ], m.prototype, "fullwidth", 2);
1752
1754
  p([
1753
1755
  y({ converter: G.csvToArray })
@@ -1756,13 +1758,13 @@ p([
1756
1758
  y({ converter: G.csvToArray })
1757
1759
  ], m.prototype, "excludeweekdays", 2);
1758
1760
  p([
1759
- y({ type: String, reflect: !0 })
1761
+ y({ type: String })
1760
1762
  ], m.prototype, "currentmonth", 2);
1761
1763
  p([
1762
1764
  y({ type: Boolean, reflect: !0 })
1763
1765
  ], m.prototype, "calendarOpen", 2);
1764
1766
  m = p([
1765
- ne("pkt-datepicker")
1767
+ nt("pkt-datepicker")
1766
1768
  ], m);
1767
1769
  export {
1768
1770
  m as PktDatepicker