@oslokommune/punkt-elements 13.5.13 → 13.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/{accordionitem-Csh7iSVG.cjs → accordionitem-BOmnm80g.cjs} +1 -1
  3. package/dist/{accordionitem-C9T3nlM0.js → accordionitem-B_h5XGCo.js} +4 -4
  4. package/dist/{alert-cUBtwi2k.js → alert-CTTm6ugp.js} +6 -6
  5. package/dist/{alert-7rUOhlNi.cjs → alert-ZP5-fqlt.cjs} +1 -1
  6. package/dist/{backlink-JbBNi3qg.cjs → backlink-BT7DO6rV.cjs} +1 -1
  7. package/dist/{backlink-C2jbzu0U.js → backlink-Bq8O2bt8.js} +3 -3
  8. package/dist/{button-B8rdtaHB.cjs → button-BfqxLnMT.cjs} +1 -1
  9. package/dist/{button-DhispFOY.js → button-x6Xw-5w0.js} +5 -5
  10. package/dist/{calendar-32W9p9uc.cjs → calendar-CL9O0tLP.cjs} +1 -1
  11. package/dist/{calendar-CJSxvwAq.js → calendar-ChphTIhk.js} +7 -7
  12. package/dist/{card-DBlFf1ry.cjs → card-BwLe5f50.cjs} +1 -1
  13. package/dist/{card-BDz4RWxK.js → card-DpUEM1tU.js} +7 -7
  14. package/dist/{checkbox-Gn7Wtk9h.cjs → checkbox-CH8xeK-0.cjs} +1 -1
  15. package/dist/{checkbox-ym7z6cpt.js → checkbox-DSAcMC-D.js} +4 -4
  16. package/dist/{class-map-BBG2gMX4.cjs → class-map-CG3vIaNm.cjs} +1 -1
  17. package/dist/{class-map-BpTj9gtz.js → class-map-Dw6Wrxwi.js} +1 -1
  18. package/dist/{combobox-D84REr9N.cjs → combobox-COuxR036.cjs} +1 -1
  19. package/dist/{combobox-BXP1PL0M.js → combobox-D3aPvdrE.js} +11 -11
  20. package/dist/{consent-BpcQFvbi.js → consent-CXp0bLvg.js} +3 -3
  21. package/dist/{consent-hYeFWNFr.cjs → consent-DFrsiYGQ.cjs} +1 -1
  22. package/dist/datepicker-CV73pLqD.cjs +169 -0
  23. package/dist/{datepicker-F3TwE9o7.js → datepicker-Ca552mbJ.js} +148 -111
  24. package/dist/{directive-helpers-BBbxqP2W.cjs → directive-helpers-_qHew-gi.cjs} +1 -1
  25. package/dist/{directive-helpers-r-kOS_Mf.js → directive-helpers-cAOIHg9K.js} +1 -1
  26. package/dist/element-D62wHiNU.cjs +27 -0
  27. package/dist/element-DJZPsA_J.js +722 -0
  28. package/dist/{heading-CNycsyMj.cjs → heading-BBzoDZGk.cjs} +1 -1
  29. package/dist/{heading-Bdh9absf.js → heading-CfxZa1QR.js} +1 -1
  30. package/dist/{helptext-B7eI0iBQ.js → helptext-8ykxyegi.js} +5 -5
  31. package/dist/{helptext-CzQX6YVE.cjs → helptext-D1fkGmfT.cjs} +1 -1
  32. package/dist/{icon-CC1js8eR.js → icon-B1-mkmwB.js} +1 -1
  33. package/dist/{icon-B_ryAy4Q.cjs → icon-__Hjt2XZ.cjs} +1 -1
  34. package/dist/{if-defined-Cni-RHLS.cjs → if-defined-CkVc_RJD.cjs} +1 -1
  35. package/dist/{if-defined-CmuO4Vz9.js → if-defined-D3lgJqT7.js} +1 -1
  36. package/dist/index.d.ts +24 -6
  37. package/dist/{input-element-NnrDmp4r.js → input-element-DQOVrqUZ.js} +2 -2
  38. package/dist/{input-element-C4xJoM-X.cjs → input-element-Y8sdrq9C.cjs} +1 -1
  39. package/dist/{input-wrapper-CZ-a00V7.cjs → input-wrapper-C9rZEgju.cjs} +1 -1
  40. package/dist/{input-wrapper-Dr__Sxql.js → input-wrapper-D_JdEqcO.js} +6 -6
  41. package/dist/{link-Cjl0xwSq.cjs → link-CyiVlb-7.cjs} +1 -1
  42. package/dist/{link-AIyVfcyH.js → link-DSSJYrtn.js} +4 -4
  43. package/dist/{linkcard-DqIvb54H.cjs → linkcard-fH9uydjS.cjs} +1 -1
  44. package/dist/{linkcard-9CNlyT0S.js → linkcard-g8JtooPU.js} +4 -4
  45. package/dist/{listbox-C4supLfR.cjs → listbox-BBO1d5Jd.cjs} +1 -1
  46. package/dist/{listbox-CLsSW32I.js → listbox-DJ7b3Wmc.js} +5 -5
  47. package/dist/{loader-h3d-3D7s.js → loader-Bzf1sPSg.js} +5 -5
  48. package/dist/{loader-DNidjwH-.cjs → loader-C-3l7kb9.cjs} +1 -1
  49. package/dist/{messagebox-CjPtPPrW.cjs → messagebox---xPIAwR.cjs} +1 -1
  50. package/dist/{messagebox-C8KQgCl_.js → messagebox-okJLeSpj.js} +5 -5
  51. package/dist/{modal-CRtxhCaP.cjs → modal-IjDRQfX1.cjs} +1 -1
  52. package/dist/{modal-Zj8yRX3K.js → modal-pohCsr_x.js} +5 -5
  53. package/dist/pkt-accordion.cjs +1 -1
  54. package/dist/pkt-accordion.js +2 -2
  55. package/dist/pkt-alert.cjs +1 -1
  56. package/dist/pkt-alert.js +1 -1
  57. package/dist/pkt-backlink.cjs +1 -1
  58. package/dist/pkt-backlink.js +1 -1
  59. package/dist/pkt-button.cjs +1 -1
  60. package/dist/pkt-button.js +1 -1
  61. package/dist/pkt-calendar.cjs +1 -1
  62. package/dist/pkt-calendar.js +1 -1
  63. package/dist/pkt-card.cjs +1 -1
  64. package/dist/pkt-card.js +1 -1
  65. package/dist/pkt-checkbox.cjs +1 -1
  66. package/dist/pkt-checkbox.js +1 -1
  67. package/dist/pkt-combobox.cjs +1 -1
  68. package/dist/pkt-combobox.js +1 -1
  69. package/dist/pkt-consent.cjs +1 -1
  70. package/dist/pkt-consent.js +1 -1
  71. package/dist/pkt-datepicker.cjs +1 -1
  72. package/dist/pkt-datepicker.js +3 -3
  73. package/dist/pkt-heading.cjs +1 -1
  74. package/dist/pkt-heading.js +1 -1
  75. package/dist/pkt-helptext.cjs +1 -1
  76. package/dist/pkt-helptext.js +1 -1
  77. package/dist/pkt-icon.cjs +1 -1
  78. package/dist/pkt-icon.js +1 -1
  79. package/dist/pkt-index.cjs +3 -3
  80. package/dist/pkt-index.js +55 -54
  81. package/dist/pkt-input-wrapper.cjs +1 -1
  82. package/dist/pkt-input-wrapper.js +1 -1
  83. package/dist/pkt-link.cjs +1 -1
  84. package/dist/pkt-link.js +1 -1
  85. package/dist/pkt-linkcard.cjs +1 -1
  86. package/dist/pkt-linkcard.js +1 -1
  87. package/dist/pkt-listbox.cjs +1 -1
  88. package/dist/pkt-listbox.js +1 -1
  89. package/dist/pkt-loader.cjs +1 -1
  90. package/dist/pkt-loader.js +1 -1
  91. package/dist/pkt-messagebox.cjs +1 -1
  92. package/dist/pkt-messagebox.js +1 -1
  93. package/dist/pkt-modal.cjs +1 -1
  94. package/dist/pkt-modal.js +1 -1
  95. package/dist/pkt-progressbar.cjs +1 -1
  96. package/dist/pkt-progressbar.js +2 -2
  97. package/dist/pkt-radiobutton.cjs +1 -1
  98. package/dist/pkt-radiobutton.js +1 -1
  99. package/dist/pkt-select.cjs +1 -1
  100. package/dist/pkt-select.js +1 -1
  101. package/dist/pkt-tag.cjs +1 -1
  102. package/dist/pkt-tag.js +1 -1
  103. package/dist/pkt-textarea.cjs +1 -1
  104. package/dist/pkt-textarea.js +1 -1
  105. package/dist/pkt-textinput.cjs +1 -1
  106. package/dist/pkt-textinput.js +1 -1
  107. package/dist/{progressbar-DhMBXkww.cjs → progressbar-DJzEC7cx.cjs} +1 -1
  108. package/dist/{progressbar-Dj_mI_A6.js → progressbar-DjsupQ7Y.js} +5 -5
  109. package/dist/{radiobutton-CWxiIVfA.js → radiobutton-Bz_qApF3.js} +5 -5
  110. package/dist/{radiobutton-CdT6v1oq.cjs → radiobutton-DEboKECm.cjs} +1 -1
  111. package/dist/{ref-BBYSqgeW.js → ref-BCGCor-j.js} +2 -2
  112. package/dist/{ref-iJtiv3o2.cjs → ref-BfgcOXko.cjs} +1 -1
  113. package/dist/{repeat-C8BeHwYx.js → repeat-B6qPUgAq.js} +2 -2
  114. package/dist/{repeat-CDsZqct8.cjs → repeat-DzibMwhi.cjs} +1 -1
  115. package/dist/{select-Be--DBcR.cjs → select-Cf1RWSsI.cjs} +1 -1
  116. package/dist/{select-VpX_cjMM.js → select-D7OQaUrQ.js} +6 -6
  117. package/dist/{state-DPobt-Yz.cjs → state-BkE_Rxl7.cjs} +1 -1
  118. package/dist/{state-Bo2bck5_.js → state-CPQXJ4Ct.js} +1 -1
  119. package/dist/{tag-Bbs0U_Au.cjs → tag-BKq07hGI.cjs} +1 -1
  120. package/dist/{tag-DyXzTY68.js → tag-NZ5oeGfw.js} +6 -6
  121. package/dist/{textarea-BZL8Mkm0.js → textarea-C0vTWTov.js} +9 -9
  122. package/dist/{textarea-CPXsMFUq.cjs → textarea-CXu8UUsY.cjs} +1 -1
  123. package/dist/{textinput-aNI5kibM.cjs → textinput-C6wccDhZ.cjs} +1 -1
  124. package/dist/{textinput-DjPhmmkB.js → textinput-CmZrfH4A.js} +8 -8
  125. package/package.json +2 -3
  126. package/src/components/accordion/accordionitem.ts +1 -1
  127. package/src/components/datepicker/date-tags.test.ts +126 -0
  128. package/src/components/datepicker/date-tags.ts +59 -0
  129. package/src/components/datepicker/datepicker.ts +13 -35
  130. package/src/components/index.ts +1 -0
  131. package/dist/datepicker-DonUad47.cjs +0 -164
  132. package/dist/element-6DBpyGQm.cjs +0 -238
  133. package/dist/element-CgEWt74-.js +0 -21288
@@ -1,16 +1,68 @@
1
- import { e as f } from "./class-map-BpTj9gtz.js";
2
- import { o as h } from "./if-defined-CmuO4Vz9.js";
3
- import { x as u, E as g, n as r, a as R } from "./element-CgEWt74-.js";
4
- import { r as k } from "./state-Bo2bck5_.js";
5
- import { n as v, f as y, a as w, b as $, p as C, d as x } from "./calendar-CJSxvwAq.js";
6
- import { P as _ } from "./input-element-NnrDmp4r.js";
7
- import { e as m, n as p } from "./ref-BBYSqgeW.js";
8
- import { c as S } from "./repeat-C8BeHwYx.js";
9
- import "./icon-CC1js8eR.js";
10
- import "./input-wrapper-Dr__Sxql.js";
11
- import "./tag-DyXzTY68.js";
12
- import { P as T } from "./pkt-slot-controller-BPGj-LC5.js";
13
- const D = {
1
+ import { e as f } from "./class-map-Dw6Wrxwi.js";
2
+ import { o } from "./if-defined-D3lgJqT7.js";
3
+ import { P as _, E as y, x as p, n as r, a as w } from "./element-DJZPsA_J.js";
4
+ import { r as R } from "./state-CPQXJ4Ct.js";
5
+ import { f as k, n as $, a as b, b as S, p as T, d as C } from "./calendar-ChphTIhk.js";
6
+ import { P as D } from "./input-element-DQOVrqUZ.js";
7
+ import { e as m, n as d } from "./ref-BCGCor-j.js";
8
+ import "./icon-B1-mkmwB.js";
9
+ import "./input-wrapper-D_JdEqcO.js";
10
+ import { c as P } from "./repeat-B6qPUgAq.js";
11
+ import "./tag-NZ5oeGfw.js";
12
+ import { u as B } from "./stringutils-DJjRa8dG.js";
13
+ import { P as I } from "./pkt-slot-controller-BPGj-LC5.js";
14
+ var O = Object.defineProperty, A = Object.getOwnPropertyDescriptor, v = (t, e, i, a) => {
15
+ for (var s = a > 1 ? void 0 : a ? A(e, i) : e, h = t.length - 1, u; h >= 0; h--)
16
+ (u = t[h]) && (s = (a ? u(e, i, s) : u(s)) || s);
17
+ return a && s && O(e, i, s), s;
18
+ };
19
+ let g = class extends _ {
20
+ constructor() {
21
+ super(...arguments), this.dates = [], this.dateformat = "dd.MM.yyyy", this.className = "pkt-datepicker__tags", this.idBase = B();
22
+ }
23
+ render() {
24
+ return this.classes = {
25
+ "pkt-date-tags": !0,
26
+ [this.className]: !0
27
+ }, p`
28
+ <div class=${f(this.classes)} aria-live="polite">
29
+ ${Array.isArray(this.dates) && this.dates[0] ? P(
30
+ (this.dates ?? []).filter(Boolean).sort(),
31
+ (t) => t,
32
+ (t) => {
33
+ var e;
34
+ return p` <pkt-tag
35
+ id=${this.idBase + t + "-tag"}
36
+ closeTag
37
+ @close=${() => {
38
+ this.dispatchEvent(new CustomEvent("date-tag-removed", { detail: t }));
39
+ }}
40
+ .ariaLabel=${`${(e = this.strings) == null ? void 0 : e.calendar.deleteDate} ${k(t, this.dateformat)}`}
41
+ >
42
+ <time datetime=${t}>${k(t, this.dateformat)}</time>
43
+ </pkt-tag>`;
44
+ }
45
+ ) : y}
46
+ </div>
47
+ `;
48
+ }
49
+ };
50
+ v([
51
+ r({ type: Array })
52
+ ], g.prototype, "dates", 2);
53
+ v([
54
+ r({ type: String })
55
+ ], g.prototype, "dateformat", 2);
56
+ v([
57
+ r({ type: String, attribute: "class" })
58
+ ], g.prototype, "className", 2);
59
+ v([
60
+ r({ type: String, attribute: "id-base" })
61
+ ], g.prototype, "idBase", 2);
62
+ g = v([
63
+ w("pkt-date-tags")
64
+ ], g);
65
+ const E = {
14
66
  dateformat: {
15
67
  default: "dd.MM.yyyy"
16
68
  },
@@ -33,15 +85,15 @@ const D = {
33
85
  default: !1
34
86
  }
35
87
  }, c = {
36
- props: D
88
+ props: E
37
89
  };
38
- var I = Object.defineProperty, P = Object.getOwnPropertyDescriptor, n = (t, e, i, s) => {
39
- for (var a = s > 1 ? void 0 : s ? P(e, i) : e, o = t.length - 1, d; o >= 0; o--)
40
- (d = t[o]) && (a = (s ? d(e, i, a) : d(a)) || a);
41
- return s && a && I(e, i, a), a;
90
+ var L = Object.defineProperty, M = Object.getOwnPropertyDescriptor, n = (t, e, i, a) => {
91
+ for (var s = a > 1 ? void 0 : a ? M(e, i) : e, h = t.length - 1, u; h >= 0; h--)
92
+ (u = t[h]) && (s = (a ? u(e, i, s) : u(s)) || s);
93
+ return a && s && L(e, i, s), s;
42
94
  };
43
- const b = (t) => new Promise((e) => setTimeout(e, t));
44
- let l = class extends _ {
95
+ const x = (t) => new Promise((e) => setTimeout(e, t));
96
+ let l = class extends D {
45
97
  /**
46
98
  * Housekeeping / lifecycle methods
47
99
  */
@@ -49,9 +101,9 @@ let l = class extends _ {
49
101
  super(), this._valueProperty = "", this._value = [], this.label = "Datovelger", this.dateformat = c.props.dateformat.default, this.multiple = c.props.multiple.default, this.maxlength = null, this.range = c.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = c.props.weeknumbers.default, this.withcontrols = c.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.buttonClasses = {}, this.inputRef = m(), this.inputRefTo = m(), this.btnRef = m(), this.calRef = m(), this.popupRef = m(), this.helptextSlot = m(), this.addToSelected = (t) => {
50
102
  const e = t.target;
51
103
  if (!e.value) return;
52
- const i = this.min ? v(this.min) : null, s = this.max ? v(this.max) : null, a = v(e.value.split(",")[0]);
53
- a && !isNaN(a.getTime()) && (!i || a >= i) && (!s || a <= s) && this.calRef.value && this.calRef.value.handleDateSelect(a), e.value = "";
54
- }, this.slotController = new T(this, this.helptextSlot);
104
+ const i = this.min ? $(this.min) : null, a = this.max ? $(this.max) : null, s = $(e.value.split(",")[0]);
105
+ s && !isNaN(s.getTime()) && (!i || s >= i) && (!a || s <= a) && this.calRef.value && this.calRef.value.handleDateSelect(s), e.value = "";
106
+ }, this.slotController = new I(this, this.helptextSlot);
55
107
  }
56
108
  get value() {
57
109
  return this._valueProperty;
@@ -64,11 +116,11 @@ let l = class extends _ {
64
116
  super.connectedCallback();
65
117
  const t = navigator.userAgent, e = /iP(hone|od|ad)/.test(t);
66
118
  this.inputType = e ? "text" : "date", document && document.body.addEventListener("click", (i) => {
67
- var s, a;
68
- (s = this.inputRef) != null && s.value && ((a = this.btnRef) != null && a.value) && !this.inputRef.value.contains(i.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(i.target)) && !this.btnRef.value.contains(i.target) && !i.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
119
+ var a, s;
120
+ (a = this.inputRef) != null && a.value && ((s = this.btnRef) != null && s.value) && !this.inputRef.value.contains(i.target) && !(this.inputRefTo.value && this.inputRefTo.value.contains(i.target)) && !this.btnRef.value.contains(i.target) && !i.target.closest(".pkt-calendar-popup") && this.calendarOpen && (this.onBlur(), this.hideCalendar());
69
121
  }), document && document.body.addEventListener("keydown", (i) => {
70
122
  i.key === "Escape" && this.calendarOpen && this.hideCalendar();
71
- }), this.value && (this._value = Array.isArray(this.value) ? this.value.filter(Boolean) : this.value.split(",").filter(Boolean)), this.min = this.min || c.props.min.default, this.max = this.max || c.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 b(20), this.handleCalendarPosition());
123
+ }), this.value && (this._value = Array.isArray(this.value) ? this.value.filter(Boolean) : this.value.split(",").filter(Boolean)), this.min = this.min || c.props.min.default, this.max = this.max || c.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());
72
124
  }
73
125
  disconnectedCallback() {
74
126
  super.disconnectedCallback(), document && document.body.removeEventListener("click", (t) => {
@@ -83,16 +135,16 @@ let l = class extends _ {
83
135
  if (t === e) return;
84
136
  let i = [];
85
137
  t && (typeof t == "string" ? i = t.split(",").filter(Boolean) : i = String(t).split(",").filter(Boolean)), this._value = i;
86
- const s = i.join(",");
87
- this._valueProperty !== s && (this._valueProperty = s), super.valueChanged(s, e);
138
+ const a = i.join(",");
139
+ this._valueProperty !== a && (this._valueProperty = a), super.valueChanged(a, e);
88
140
  }
89
141
  attributeChangedCallback(t, e, i) {
90
142
  t === "value" && this.value !== e && this.valueChanged(i, e), t === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = (i == null ? void 0 : i.split(",")) ?? []), t === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = (i == null ? void 0 : i.split(",")) ?? []), super.attributeChangedCallback(t, e, i);
91
143
  }
92
144
  updated(t) {
93
145
  if (t.has("value")) {
94
- const e = Array.isArray(this.value) ? this.value.join(",") : this.value, i = t.get("value"), s = Array.isArray(i) ? i.join(",") : i;
95
- this.valueChanged(e, s);
146
+ const e = Array.isArray(this.value) ? this.value.join(",") : this.value, i = t.get("value"), a = Array.isArray(i) ? i.join(",") : i;
147
+ this.valueChanged(e, a);
96
148
  }
97
149
  t.has("multiple") && (this.multiple && !Array.isArray(this._value) ? this._value = typeof this.value == "string" ? this.value ? this.value.split(",").filter(Boolean) : [] : [] : !this.multiple && Array.isArray(this._value) && (this._value = this._value.filter(Boolean)), !this.multiple && !this.range && Array.isArray(this._value) && (this._value = [this._value[0] ?? ""])), super.updated(t);
98
150
  }
@@ -100,15 +152,15 @@ let l = class extends _ {
100
152
  * Rendering
101
153
  */
102
154
  renderInput() {
103
- return u`
155
+ return p`
104
156
  <input
105
157
  class="${f(this.inputClasses)}"
106
158
  .type=${this.inputType}
107
159
  id="${this.id}-input"
108
160
  .value=${this._value[0] ?? ""}
109
- min=${h(this.min)}
110
- max=${h(this.max)}
111
- placeholder=${h(this.placeholder)}
161
+ min=${o(this.min)}
162
+ max=${o(this.max)}
163
+ placeholder=${o(this.placeholder)}
112
164
  ?readonly=${this.readonly}
113
165
  aria-describedby="${this.id}-helptext"
114
166
  @click=${(t) => {
@@ -118,8 +170,8 @@ let l = class extends _ {
118
170
  @keydown=${(t) => {
119
171
  var e, i;
120
172
  if (t.key === "," && ((e = this.inputRef.value) == null || e.blur()), (t.key === "Space" || t.key === " ") && (t.preventDefault(), this.toggleCalendar(t)), t.key === "Enter") {
121
- const s = this.internals.form;
122
- s ? s.requestSubmit() : (i = this.inputRef.value) == null || i.blur();
173
+ const a = this.internals.form;
174
+ a ? a.requestSubmit() : (i = this.inputRef.value) == null || i.blur();
123
175
  }
124
176
  }}
125
177
  @input=${(t) => {
@@ -135,7 +187,7 @@ let l = class extends _ {
135
187
  @change=${(t) => {
136
188
  this.touched = !0, t.stopImmediatePropagation();
137
189
  }}
138
- ${p(this.inputRef)}
190
+ ${d(this.inputRef)}
139
191
  />
140
192
  `;
141
193
  }
@@ -144,26 +196,26 @@ let l = class extends _ {
144
196
  "pkt-input-prefix": this.showRangeLabels,
145
197
  "pkt-hide": !this.showRangeLabels
146
198
  };
147
- return u`
148
- ${this.showRangeLabels ? u` <div class="pkt-input-prefix">${this.strings.generic.from}</div> ` : g}
199
+ return p`
200
+ ${this.showRangeLabels ? p` <div class="pkt-input-prefix">${this.strings.generic.from}</div> ` : y}
149
201
  <input
150
202
  class=${f(this.inputClasses)}
151
203
  .type=${this.inputType}
152
204
  id="${this.id}-input"
153
205
  .value=${this._value[0] ?? ""}
154
- min=${h(this.min)}
155
- max=${h(this.max)}
156
- placeholder=${h(this.placeholder)}
206
+ min=${o(this.min)}
207
+ max=${o(this.max)}
208
+ placeholder=${o(this.placeholder)}
157
209
  ?readonly=${this.readonly}
158
210
  ?disabled=${this.disabled}
159
211
  @click=${(e) => {
160
212
  e.preventDefault(), this.showCalendar();
161
213
  }}
162
214
  @keydown=${(e) => {
163
- var i, s;
215
+ var i, a;
164
216
  if (e.key === "," && ((i = this.inputRef.value) == null || i.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e)), e.key === "Enter") {
165
- const a = this.internals.form;
166
- a ? a.requestSubmit() : (s = this.inputRefTo.value) == null || s.focus();
217
+ const s = this.internals.form;
218
+ s ? s.requestSubmit() : (a = this.inputRefTo.value) == null || a.focus();
167
219
  }
168
220
  }}
169
221
  @input=${(e) => {
@@ -173,41 +225,41 @@ let l = class extends _ {
173
225
  this.onFocus(), this.isMobileSafari && this.showCalendar();
174
226
  }}
175
227
  @blur=${(e) => {
176
- var i, s;
228
+ var i, a;
177
229
  if (e.target.value) {
178
230
  this.manageValidity(e.target);
179
- const a = y(e.target.value);
180
- a && this._value[0] !== e.target.value && this._value[1] && (this.clearInputValue(), (s = (i = this.calRef) == null ? void 0 : i.value) == null || s.handleDateSelect(a));
231
+ const s = b(e.target.value);
232
+ s && this._value[0] !== e.target.value && this._value[1] && (this.clearInputValue(), (a = (i = this.calRef) == null ? void 0 : i.value) == null || a.handleDateSelect(s));
181
233
  } else this._value[0] && this.clearInputValue();
182
234
  }}
183
235
  @change=${(e) => {
184
236
  e.stopImmediatePropagation();
185
237
  }}
186
- ${p(this.inputRef)}
238
+ ${d(this.inputRef)}
187
239
  />
188
240
  <div class="${f(t)}" id="${this.id}-to-label">
189
241
  ${this.strings.generic.to}
190
242
  </div>
191
- ${this.showRangeLabels ? g : u` <div class="pkt-input-separator">–</div> `}
243
+ ${this.showRangeLabels ? y : p` <div class="pkt-input-separator">–</div> `}
192
244
  <input
193
245
  class=${f(this.inputClasses)}
194
246
  .type=${this.inputType}
195
247
  id="${this.id}-to"
196
248
  aria-labelledby="${this.id}-to-label"
197
249
  .value=${this._value[1] ?? ""}
198
- min=${h(this.min)}
199
- max=${h(this.max)}
200
- placeholder=${h(this.placeholder)}
250
+ min=${o(this.min)}
251
+ max=${o(this.max)}
252
+ placeholder=${o(this.placeholder)}
201
253
  ?readonly=${this.readonly}
202
254
  ?disabled=${this.disabled}
203
255
  @click=${(e) => {
204
256
  e.preventDefault(), this.showCalendar();
205
257
  }}
206
258
  @keydown=${(e) => {
207
- var i, s;
259
+ var i, a;
208
260
  if (e.key === "," && ((i = this.inputRefTo.value) == null || i.blur()), (e.key === "Space" || e.key === " ") && (e.preventDefault(), this.toggleCalendar(e)), e.key === "Enter") {
209
- const a = this.internals.form;
210
- a ? a.requestSubmit() : (s = this.inputRefTo.value) == null || s.blur();
261
+ const s = this.internals.form;
262
+ s ? s.requestSubmit() : (a = this.inputRefTo.value) == null || a.blur();
211
263
  }
212
264
  }}
213
265
  @input=${(e) => {
@@ -217,39 +269,39 @@ let l = class extends _ {
217
269
  this.onFocus(), this.isMobileSafari && this.showCalendar();
218
270
  }}
219
271
  @blur=${(e) => {
220
- var i, s, a;
272
+ var i, a, s;
221
273
  if ((i = this.calRef.value) != null && i.contains(e.relatedTarget) || this.onBlur(), e.target.value) {
222
274
  this.manageValidity(e.target);
223
- const o = e.target.value;
224
- this.min && this.min > o ? this.internals.setValidity(
275
+ const h = e.target.value;
276
+ this.min && this.min > h ? this.internals.setValidity(
225
277
  { rangeUnderflow: !0 },
226
278
  this.strings.forms.messages.rangeUnderflow,
227
279
  e.target
228
- ) : this.max && this.max < o && this.internals.setValidity(
280
+ ) : this.max && this.max < h && this.internals.setValidity(
229
281
  { rangeOverflow: !0 },
230
282
  this.strings.forms.messages.rangeOverflow,
231
283
  e.target
232
284
  );
233
- const d = y(e.target.value);
234
- d && this._value[1] !== w(d) && ((a = (s = this.calRef) == null ? void 0 : s.value) == null || a.handleDateSelect(d));
285
+ const u = b(e.target.value);
286
+ u && this._value[1] !== S(u) && ((s = (a = this.calRef) == null ? void 0 : a.value) == null || s.handleDateSelect(u));
235
287
  }
236
288
  }}
237
289
  @change=${(e) => {
238
290
  this.touched = !0, e.stopImmediatePropagation();
239
291
  }}
240
- ${p(this.inputRefTo)}
292
+ ${d(this.inputRefTo)}
241
293
  />
242
294
  `;
243
295
  }
244
296
  renderMultipleInput() {
245
- return u`
297
+ return p`
246
298
  <input
247
299
  class=${f(this.inputClasses)}
248
300
  .type=${this.inputType}
249
301
  id="${this.id}-input"
250
- min=${h(this.min)}
251
- max=${h(this.max)}
252
- placeholder=${h(this.placeholder)}
302
+ min=${o(this.min)}
303
+ max=${o(this.max)}
304
+ placeholder=${o(this.placeholder)}
253
305
  ?readonly=${this.readonly}
254
306
  ?disabled=${this.disabled || this.maxlength && this._value.length >= this.maxlength}
255
307
  @click=${(t) => {
@@ -275,43 +327,18 @@ let l = class extends _ {
275
327
  @change=${(t) => {
276
328
  this.touched = !0, t.stopImmediatePropagation();
277
329
  }}
278
- ${p(this.inputRef)}
330
+ ${d(this.inputRef)}
279
331
  />
280
332
  `;
281
333
  }
282
- renderTags() {
283
- return u`
284
- <div class="pkt-datepicker__tags" aria-live="polite">
285
- ${this._value[0] ? S(
286
- (this._value ?? []).filter(Boolean).sort(),
287
- (t) => t,
288
- (t) => u`
289
- <pkt-tag
290
- .id="${this.id + t + "-tag"}"
291
- closeTag
292
- ariaLabel="${this.strings.calendar.deleteDate} ${$(
293
- t,
294
- this.dateformat
295
- )}"
296
- @close=${() => {
297
- var e;
298
- return (e = this.calRef.value) == null ? void 0 : e.handleDateSelect(y(t));
299
- }}
300
- ><time datetime="${t}">${$(t, this.dateformat)}</time></pkt-tag
301
- >
302
- `
303
- ) : g}
304
- </div>
305
- `;
306
- }
307
334
  renderCalendar() {
308
- return u`<div
335
+ return p`<div
309
336
  class="pkt-calendar-popup pkt-${this.calendarOpen ? "show" : "hide"}"
310
337
  @focusout=${(t) => {
311
338
  this.calendarOpen && this.handleFocusOut(t);
312
339
  }}
313
340
  id="${this.id}-popup"
314
- ${p(this.popupRef)}
341
+ ${d(this.popupRef)}
315
342
  >
316
343
  <pkt-calendar
317
344
  id="${this.id}-calendar"
@@ -325,14 +352,14 @@ let l = class extends _ {
325
352
  .latest=${this.max}
326
353
  .excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
327
354
  .excludeweekdays=${this.excludeweekdays}
328
- .currentmonth=${this.currentmonth ? C(this.currentmonth) : null}
355
+ .currentmonth=${this.currentmonth ? T(this.currentmonth) : null}
329
356
  @date-selected=${(t) => {
330
357
  this.value = !this.multiple && !this.range ? t.detail[0] : Array.isArray(t.detail) ? t.detail.join(",") : 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.manageValidity(this.inputRef.value), this.manageValidity(this.inputRefTo.value)) : this.multiple || (this.inputRef.value.value = this._value.length ? this._value[0] : "", this.manageValidity(this.inputRef.value)));
331
358
  }}
332
359
  @close=${() => {
333
360
  this.onBlur(), this.hideCalendar();
334
361
  }}
335
- ${p(this.calRef)}
362
+ ${d(this.calRef)}
336
363
  ></pkt-calendar>
337
364
  </div>`;
338
365
  }
@@ -350,7 +377,7 @@ let l = class extends _ {
350
377
  "pkt-btn--icon-only": !0,
351
378
  "pkt-btn--tertiary": !0,
352
379
  "pkt-datepicker__calendar-button": !0
353
- }, u`
380
+ }, p`
354
381
  <pkt-input-wrapper
355
382
  label="${this.label}"
356
383
  forId="${this.id}-input"
@@ -375,8 +402,17 @@ let l = class extends _ {
375
402
  .ariaDescribedBy=${this.ariaDescribedBy}
376
403
  class="pkt-datepicker"
377
404
  >
378
- <div class="pkt-contents" ${p(this.helptextSlot)} name="helptext" slot="helptext"></div>
379
- ${this.multiple ? this.renderTags() : g}
405
+ <div class="pkt-contents" ${d(this.helptextSlot)} name="helptext" slot="helptext"></div>
406
+ ${this.multiple ? p`<pkt-date-tags
407
+ .dates=${this._value}
408
+ dateformat=${this.dateformat}
409
+ strings=${this.strings}
410
+ id-base=${this.id}
411
+ @date-tag-removed=${(t) => {
412
+ var e;
413
+ (e = this.calRef.value) == null || e.handleDateSelect(b(t.detail));
414
+ }}
415
+ ></pkt-date-tags>` : y}
380
416
  <div
381
417
  class="pkt-datepicker__inputs ${this.range && this.showRangeLabels ? "pkt-input__range-inputs" : ""}"
382
418
  >
@@ -390,7 +426,7 @@ let l = class extends _ {
390
426
  (t.key === "Enter" || t.key === " " || t.key === "Space") && (t.preventDefault(), this.toggleCalendar(t));
391
427
  }}
392
428
  ?disabled=${this.disabled}
393
- ${p(this.btnRef)}
429
+ ${d(this.btnRef)}
394
430
  >
395
431
  <pkt-icon name="calendar"></pkt-icon>
396
432
  <span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
@@ -407,9 +443,9 @@ let l = class extends _ {
407
443
  handleCalendarPosition() {
408
444
  var t;
409
445
  if (this.popupRef.value && this.inputRef.value) {
410
- const e = this.multiple && !!this.maxlength, i = ((t = this.inputRef.value.parentElement) == null ? void 0 : t.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), s = e ? i.height + 30 : i.height, a = this.popupRef.value.getBoundingClientRect().height;
411
- let o = e ? "calc(100% - 30px)" : "100%";
412
- i && i.top + a > window.innerHeight && i.top - a > 0 && (o = `calc(100% - ${s}px - ${a}px)`), this.popupRef.value.style.top = o;
446
+ const e = this.multiple && !!this.maxlength, i = ((t = this.inputRef.value.parentElement) == null ? void 0 : t.getBoundingClientRect()) || this.inputRef.value.getBoundingClientRect(), a = e ? i.height + 30 : i.height, s = this.popupRef.value.getBoundingClientRect().height;
447
+ let h = e ? "calc(100% - 30px)" : "100%";
448
+ i && i.top + s > window.innerHeight && i.top - s > 0 && (h = `calc(100% - ${a}px - ${s}px)`), this.popupRef.value.style.top = h;
413
449
  }
414
450
  }
415
451
  handleFocusOut(t) {
@@ -417,7 +453,7 @@ let l = class extends _ {
417
453
  }
418
454
  async showCalendar() {
419
455
  var t;
420
- this.calendarOpen = !0, await b(20), this.handleCalendarPosition(), this.isMobileSafari && ((t = this.calRef.value) == null || t.focusOnCurrentDate());
456
+ this.calendarOpen = !0, await x(20), this.handleCalendarPosition(), this.isMobileSafari && ((t = this.calRef.value) == null || t.focusOnCurrentDate());
421
457
  }
422
458
  hideCalendar() {
423
459
  this.calendarOpen = !1;
@@ -466,10 +502,10 @@ n([
466
502
  r({ type: Boolean, reflect: !0 })
467
503
  ], l.prototype, "withcontrols", 2);
468
504
  n([
469
- r({ converter: x.csvToArray })
505
+ r({ converter: C.csvToArray })
470
506
  ], l.prototype, "excludedates", 2);
471
507
  n([
472
- r({ converter: x.csvToArray })
508
+ r({ converter: C.csvToArray })
473
509
  ], l.prototype, "excludeweekdays", 2);
474
510
  n([
475
511
  r({ type: String })
@@ -481,14 +517,15 @@ n([
481
517
  r({ type: String })
482
518
  ], l.prototype, "timezone", 2);
483
519
  n([
484
- k()
520
+ R()
485
521
  ], l.prototype, "inputClasses", 2);
486
522
  n([
487
- k()
523
+ R()
488
524
  ], l.prototype, "buttonClasses", 2);
489
525
  l = n([
490
- R("pkt-datepicker")
526
+ w("pkt-datepicker")
491
527
  ], l);
492
528
  export {
493
- l as P
529
+ g as P,
530
+ l as a
494
531
  };
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("./element-6DBpyGQm.cjs");/**
1
+ "use strict";const o=require("./element-D62wHiNU.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- import { Z as l } from "./element-CgEWt74-.js";
1
+ import { Z as l } from "./element-DJZPsA_J.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC
@@ -0,0 +1,27 @@
1
+ "use strict";/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const C=globalThis,H=C.trustedTypes,J=H?H.createPolicy("lit-html",{createHTML:r=>r}):void 0,it="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,rt="?"+f,ct=`<${rt}>`,y=document,U=()=>y.createComment(""),O=r=>r===null||typeof r!="object"&&typeof r!="function",B=Array.isArray,dt=r=>B(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",L=`[
6
+ \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,Z=/>/g,m=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,G=/"/g,nt=/^(?:script|style|textarea|title)$/i,pt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),ut=pt(1),v=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Q=new WeakMap,g=y.createTreeWalker(y,129);function ot(r,t){if(!B(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return J!==void 0?J.createHTML(t):t}const $t=(r,t)=>{const e=r.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",o=P;for(let a=0;a<e;a++){const h=r[a];let d,p,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===P?p[1]==="!--"?o=W:p[1]!==void 0?o=Z:p[2]!==void 0?(nt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=m):p[3]!==void 0&&(o=m):o===m?p[0]===">"?(o=i??P,l=-1):p[1]===void 0?l=-2:(l=o.lastIndex-p[2].length,d=p[1],o=p[3]===void 0?m:p[3]==='"'?G:K):o===G||o===K?o=m:o===W||o===Z?o=P:(o=m,i=void 0);const $=o===m&&r[a+1].startsWith("/>")?" ":"";n+=o===P?h+ct:l>=0?(s.push(d),h.slice(0,l)+it+h.slice(l)+f+$):h+f+(l===-2?a:$)}return[ot(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class M{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const a=t.length-1,h=this.parts,[d,p]=$t(t,e);if(this.el=M.createElement(d,s),g.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=g.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(it)){const u=p[o++],$=i.getAttribute(l).split(f),T=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:T[2],strings:$,ctor:T[1]==="."?_t:T[1]==="?"?mt:T[1]==="@"?gt:R}),i.removeAttribute(l)}else l.startsWith(f)&&(h.push({type:6,index:n}),i.removeAttribute(l));if(nt.test(i.tagName)){const l=i.textContent.split(f),u=l.length-1;if(u>0){i.textContent=H?H.emptyScript:"";for(let $=0;$<u;$++)i.append(l[$],U()),g.nextNode(),h.push({type:2,index:++n});i.append(l[u],U())}}}else if(i.nodeType===8)if(i.data===rt)h.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(f,l+1))!==-1;)h.push({type:7,index:n}),l+=f.length-1}n++}}static createElement(t,e){const s=y.createElement("template");return s.innerHTML=t,s}}function b(r,t,e=r,s){var o,a;if(t===v)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=b(r,i._$AS(r,t.values),i,s)),t}class ft{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??y).importNode(e,!0);g.currentNode=i;let n=g.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let d;h.type===2?d=new w(n,n.nextSibling,this,t):h.type===1?d=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(d=new At(n,this,t)),this._$AV.push(d),h=s[++a]}o!==(h==null?void 0:h.index)&&(n=g.nextNode(),o++)}return g.currentNode=y,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class w{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=b(this,t,e),O(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):dt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==c&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=M.createElement(ot(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const o=new ft(i,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Q.get(t.strings);return e===void 0&&Q.set(t.strings,e=new M(t)),e}k(t){B(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new w(this.O(U()),this.O(U()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(n===void 0)t=b(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const a=t;let h,d;for(t=n[0],h=0;h<n.length-1;h++)d=b(this,a[s+h],e,h),d===v&&(d=this._$AH[h]),o||(o=!O(d)||d!==this._$AH[h]),d===c?t=c:t!==c&&(t+=(d??"")+n[h+1]),this._$AH[h]=d}o&&!i&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class _t extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class mt extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class gt extends R{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=b(this,t,e,0)??c)===v)return;const s=this._$AH,i=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==c&&(s===c||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class At{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){b(this,t)}}const yt={I:w},j=C.litHtmlPolyfillSupport;j==null||j(M,w),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.0");const vt=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new w(t.insertBefore(U(),n),n,void 0,e??{})}return i._$AI(r),i};/**
8
+ * @license
9
+ * Copyright 2017 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */const Et=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
12
+ * @license
13
+ * Copyright 2019 Google LLC
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ */const k=globalThis,F=k.ShadowRoot&&(k.ShadyCSS===void 0||k.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),X=new WeakMap;let St=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(F&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&X.set(e,t))}return t}toString(){return this.cssText}};const bt=r=>new St(typeof r=="string"?r:r+"",void 0,ht),wt=(r,t)=>{if(F)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=k.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},Y=F?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return bt(e)})(r):r;/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */const{is:Pt,defineProperty:Ct,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Ut,getOwnPropertySymbols:Ot,getPrototypeOf:Mt}=Object,_=globalThis,tt=_.trustedTypes,Tt=tt?tt.emptyScript:"",z=_.reactiveElementPolyfillSupport,x=(r,t)=>r,N={toAttribute(r,t){switch(t){case Boolean:r=r?Tt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},q=(r,t)=>!Pt(r,t),et={attribute:!0,type:String,converter:N,reflect:!1,useDefault:!1,hasChanged:q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=et){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ct(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=xt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);n==null||n.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??et}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=Mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,s=[...Ut(e),...Ot(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Y(i))}else t!==void 0&&e.push(Y(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:N).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var n,o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const a=s.getPropertyOptions(i),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:N;this._$Em=i,this[i]=h.fromAttribute(e,a.type)??((o=this._$Ej)==null?void 0:o.get(i))??null,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const n=this.constructor,o=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??q)(o,e)||s.useDefault&&s.reflect&&o===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,o]of i){const{wrapped:a}=o,h=this[n];a!==!0||this._$AL.has(n)||h===void 0||this.C(n,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)}),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[x("elementProperties")]=new Map,E[x("finalized")]=new Map,z==null||z({ReactiveElement:E}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.1.0");/**
20
+ * @license
21
+ * Copyright 2017 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */const kt={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:q},Ht=(r=kt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(e.name,r),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,r)},init(a){return a!==void 0&&this.C(o,void 0,r,a),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,r)}}throw Error("Unsupported decorator location: "+s)};function V(r){return(t,e)=>typeof e=="object"?Ht(r,t,e):((s,i,n)=>{const o=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(i,n):void 0})(r,t,e)}/**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */const A=globalThis;class S extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=vt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}}var st;S._$litElement$=!0,S.finalized=!0,(st=A.litElementHydrateSupport)==null||st.call(A,{LitElement:S});const I=A.litElementPolyfillSupport;I==null||I({LitElement:S});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.0");const Nt={hi:"Hei!"},Rt={from:"Fra",to:"Til"},Dt={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Lt={month:"Måned",year:"År",days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},jt={search:{placeholder:"Søk…"},labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",rangeUnderflowMin:"Verdien må være større enn eller lik {min}.",rangeOverflowMax:"Verdien må være mindre enn eller lik {max}.",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},helptext:{helptextDropdownButton:"Les mer"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},at={example:Nt,generic:Rt,calendar:Dt,dates:Lt,forms:jt};var zt=Object.defineProperty,lt=(r,t,e,s)=>{for(var i=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(i=o(t,e,i)||i);return i&&zt(t,e,i),i};class D extends S{constructor(){super(...arguments),this.strings=at,this.role=null}hotReplacedCallback(){this.requestUpdate()}}lt([V({type:Object})],D.prototype,"strings");lt([V({type:String})],D.prototype,"role");class It extends D{createRenderRoot(){return this}}exports.E=c;exports.PktElement=It;exports.PktShadowElement=D;exports.T=v;exports.Z=yt;exports.i=S;exports.n=V;exports.t=Et;exports.translations=at;exports.x=ut;