@oslokommune/punkt-elements 12.2.0 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +30 -0
  2. package/dist/alert.d.ts +1 -0
  3. package/dist/calendar.d.ts +1 -0
  4. package/dist/card.d.ts +1 -0
  5. package/dist/class-map-CA8wadiN.cjs +5 -0
  6. package/dist/class-map-DiT0qP3E.js +34 -0
  7. package/dist/component-template.d.ts +1 -0
  8. package/dist/converters-DNCwIFwr.js +17 -0
  9. package/dist/converters-DhM11VlY.cjs +1 -0
  10. package/dist/datepicker.d.ts +1 -0
  11. package/dist/directive-19_ixLKS.cjs +9 -0
  12. package/dist/directive-DA0-wdk7.js +38 -0
  13. package/dist/element.d.ts +1 -0
  14. package/dist/icon.d.ts +1 -0
  15. package/dist/index-BHzxfdBK.js +807 -0
  16. package/dist/index-BJ_4AGO3.cjs +23 -0
  17. package/dist/index-BlHnvy7v.js +82 -0
  18. package/dist/index-CPvZ03uX.js +577 -0
  19. package/dist/index-DSplpVWQ.cjs +9 -0
  20. package/dist/index-DkGcZra2.cjs +90 -0
  21. package/dist/index.d.ts +393 -3
  22. package/dist/input-wrapper.d.ts +1 -0
  23. package/dist/link.d.ts +1 -0
  24. package/dist/messagebox.d.ts +1 -0
  25. package/dist/pkt-alert.cjs +27 -0
  26. package/dist/pkt-alert.js +86 -0
  27. package/dist/pkt-calendar.cjs +1 -0
  28. package/dist/pkt-calendar.js +10 -0
  29. package/dist/pkt-card.cjs +23 -0
  30. package/dist/pkt-card.js +177 -0
  31. package/dist/pkt-component-template.cjs +29 -0
  32. package/dist/{pkt-el-component-template.js → pkt-component-template.js} +25 -26
  33. package/dist/pkt-datepicker.cjs +140 -0
  34. package/dist/pkt-datepicker.js +1769 -0
  35. package/dist/pkt-element.cjs +1 -0
  36. package/dist/pkt-element.js +5 -0
  37. package/dist/pkt-icon.cjs +1 -0
  38. package/dist/pkt-icon.js +6 -0
  39. package/dist/pkt-index.cjs +1 -0
  40. package/dist/pkt-index.js +20 -0
  41. package/dist/pkt-input-wrapper.cjs +59 -0
  42. package/dist/pkt-input-wrapper.js +293 -0
  43. package/dist/pkt-link.cjs +3 -0
  44. package/dist/pkt-link.js +90 -0
  45. package/dist/pkt-messagebox.cjs +12 -0
  46. package/dist/pkt-messagebox.js +62 -0
  47. package/dist/pkt-tag.cjs +17 -0
  48. package/dist/pkt-tag.js +151 -0
  49. package/dist/ref-Bk590hog.cjs +13 -0
  50. package/dist/ref-Co_S0Cgj.js +173 -0
  51. package/dist/state-BRgFbJX9.js +12 -0
  52. package/dist/state-D2tUtTi6.cjs +5 -0
  53. package/dist/tag.d.ts +1 -0
  54. package/package.json +10 -7
  55. package/src/components/alert/index.ts +86 -0
  56. package/src/components/calendar/index.ts +391 -143
  57. package/src/components/card/index.ts +78 -0
  58. package/src/components/component-template/index.ts +25 -9
  59. package/src/components/datepicker/index.ts +546 -0
  60. package/src/components/element/index.ts +181 -8
  61. package/src/components/icon/index.ts +44 -49
  62. package/src/components/index.ts +7 -1
  63. package/src/components/input-wrapper/index.ts +260 -0
  64. package/src/components/link/index.ts +51 -0
  65. package/src/components/messagebox/index.ts +63 -0
  66. package/src/components/tag/index.ts +110 -0
  67. package/dist/components/calendar/index.d.ts +0 -59
  68. package/dist/components/component-template/index.d.ts +0 -34
  69. package/dist/components/element/index.d.ts +0 -24
  70. package/dist/components/icon/index.d.ts +0 -29
  71. package/dist/components/index.d.ts +0 -3
  72. package/dist/controllers/pkt-slot-controller.d.ts +0 -11
  73. package/dist/converters-Bi8tmNvQ.cjs +0 -5
  74. package/dist/converters-DMveycvc.js +0 -100
  75. package/dist/directive-C7mkmyiy.js +0 -573
  76. package/dist/directive-DfhMJ1ie.cjs +0 -23
  77. package/dist/helpers/converters.d.ts +0 -3
  78. package/dist/index-0PZgk9Oc.js +0 -159
  79. package/dist/index-xoVy6sfy.cjs +0 -13
  80. package/dist/pkt-el-calendar.cjs +0 -60
  81. package/dist/pkt-el-calendar.js +0 -1496
  82. package/dist/pkt-el-component-template.cjs +0 -29
  83. package/dist/pkt-el-element.cjs +0 -1
  84. package/dist/pkt-el-element.js +0 -5
  85. package/dist/pkt-el-icon.cjs +0 -9
  86. package/dist/pkt-el-icon.js +0 -98
  87. package/dist/pkt-el-index.cjs +0 -1
  88. package/dist/pkt-el-index.js +0 -8
  89. package/dist/property-BBVRv-DT.js +0 -47
  90. package/dist/property-CK6SFc5B.cjs +0 -9
  91. package/dist/src/translations/no.json.d.ts +0 -43
@@ -0,0 +1,807 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const I = globalThis, W = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, dt = Symbol(), Y = /* @__PURE__ */ new WeakMap();
7
+ let At = class {
8
+ constructor(t, e, s) {
9
+ if (this._$cssResult$ = !0, s !== dt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = t, this.t = e;
11
+ }
12
+ get styleSheet() {
13
+ let t = this.o;
14
+ const e = this.t;
15
+ if (W && t === void 0) {
16
+ const s = e !== void 0 && e.length === 1;
17
+ s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t));
18
+ }
19
+ return t;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const bt = (r) => new At(typeof r == "string" ? r : r + "", void 0, dt), St = (r, t) => {
26
+ if (W) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
27
+ else for (const e of t) {
28
+ const s = document.createElement("style"), i = I.litNonce;
29
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
30
+ }
31
+ }, X = W ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
32
+ let e = "";
33
+ for (const s of t.cssRules) e += s.cssText;
34
+ return bt(e);
35
+ })(r) : r;
36
+ /**
37
+ * @license
38
+ * Copyright 2017 Google LLC
39
+ * SPDX-License-Identifier: BSD-3-Clause
40
+ */
41
+ const { is: Et, defineProperty: wt, getOwnPropertyDescriptor: Ut, getOwnPropertyNames: xt, getOwnPropertySymbols: Pt, getPrototypeOf: Ct } = Object, A = globalThis, tt = A.trustedTypes, Tt = tt ? tt.emptyScript : "", j = A.reactiveElementPolyfillSupport, T = (r, t) => r, D = { toAttribute(r, t) {
42
+ switch (t) {
43
+ case Boolean:
44
+ r = r ? Tt : null;
45
+ break;
46
+ case Object:
47
+ case Array:
48
+ r = r == null ? r : JSON.stringify(r);
49
+ }
50
+ return r;
51
+ }, fromAttribute(r, t) {
52
+ let e = r;
53
+ switch (t) {
54
+ case Boolean:
55
+ e = r !== null;
56
+ break;
57
+ case Number:
58
+ e = r === null ? null : Number(r);
59
+ break;
60
+ case Object:
61
+ case Array:
62
+ try {
63
+ e = JSON.parse(r);
64
+ } catch {
65
+ e = null;
66
+ }
67
+ }
68
+ return e;
69
+ } }, K = (r, t) => !Et(r, t), et = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: K };
70
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
71
+ class U extends HTMLElement {
72
+ static addInitializer(t) {
73
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
74
+ }
75
+ static get observedAttributes() {
76
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
77
+ }
78
+ static createProperty(t, e = et) {
79
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
80
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
81
+ i !== void 0 && wt(this.prototype, t, i);
82
+ }
83
+ }
84
+ static getPropertyDescriptor(t, e, s) {
85
+ const { get: i, set: o } = Ut(this.prototype, t) ?? { get() {
86
+ return this[e];
87
+ }, set(n) {
88
+ this[e] = n;
89
+ } };
90
+ return { get() {
91
+ return i == null ? void 0 : i.call(this);
92
+ }, set(n) {
93
+ const h = i == null ? void 0 : i.call(this);
94
+ o.call(this, n), this.requestUpdate(t, h, s);
95
+ }, configurable: !0, enumerable: !0 };
96
+ }
97
+ static getPropertyOptions(t) {
98
+ return this.elementProperties.get(t) ?? et;
99
+ }
100
+ static _$Ei() {
101
+ if (this.hasOwnProperty(T("elementProperties"))) return;
102
+ const t = Ct(this);
103
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
104
+ }
105
+ static finalize() {
106
+ if (this.hasOwnProperty(T("finalized"))) return;
107
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
108
+ const e = this.properties, s = [...xt(e), ...Pt(e)];
109
+ for (const i of s) this.createProperty(i, e[i]);
110
+ }
111
+ const t = this[Symbol.metadata];
112
+ if (t !== null) {
113
+ const e = litPropertyMetadata.get(t);
114
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
115
+ }
116
+ this._$Eh = /* @__PURE__ */ new Map();
117
+ for (const [e, s] of this.elementProperties) {
118
+ const i = this._$Eu(e, s);
119
+ i !== void 0 && this._$Eh.set(i, e);
120
+ }
121
+ this.elementStyles = this.finalizeStyles(this.styles);
122
+ }
123
+ static finalizeStyles(t) {
124
+ const e = [];
125
+ if (Array.isArray(t)) {
126
+ const s = new Set(t.flat(1 / 0).reverse());
127
+ for (const i of s) e.unshift(X(i));
128
+ } else t !== void 0 && e.push(X(t));
129
+ return e;
130
+ }
131
+ static _$Eu(t, e) {
132
+ const s = e.attribute;
133
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
134
+ }
135
+ constructor() {
136
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
137
+ }
138
+ _$Ev() {
139
+ var t;
140
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
141
+ }
142
+ addController(t) {
143
+ var e;
144
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
145
+ }
146
+ removeController(t) {
147
+ var e;
148
+ (e = this._$EO) == null || e.delete(t);
149
+ }
150
+ _$E_() {
151
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
152
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
153
+ t.size > 0 && (this._$Ep = t);
154
+ }
155
+ createRenderRoot() {
156
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
157
+ return St(t, this.constructor.elementStyles), t;
158
+ }
159
+ connectedCallback() {
160
+ var t;
161
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
162
+ var s;
163
+ return (s = e.hostConnected) == null ? void 0 : s.call(e);
164
+ });
165
+ }
166
+ enableUpdating(t) {
167
+ }
168
+ disconnectedCallback() {
169
+ var t;
170
+ (t = this._$EO) == null || t.forEach((e) => {
171
+ var s;
172
+ return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
173
+ });
174
+ }
175
+ attributeChangedCallback(t, e, s) {
176
+ this._$AK(t, s);
177
+ }
178
+ _$EC(t, e) {
179
+ var o;
180
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
181
+ if (i !== void 0 && s.reflect === !0) {
182
+ const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : D).toAttribute(e, s.type);
183
+ this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
184
+ }
185
+ }
186
+ _$AK(t, e) {
187
+ var o;
188
+ const s = this.constructor, i = s._$Eh.get(t);
189
+ if (i !== void 0 && this._$Em !== i) {
190
+ const n = s.getPropertyOptions(i), h = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : D;
191
+ this._$Em = i, this[i] = h.fromAttribute(e, n.type), this._$Em = null;
192
+ }
193
+ }
194
+ requestUpdate(t, e, s) {
195
+ if (t !== void 0) {
196
+ if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? K)(this[t], e)) return;
197
+ this.P(t, e, s);
198
+ }
199
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
200
+ }
201
+ P(t, e, s) {
202
+ this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
203
+ }
204
+ async _$ET() {
205
+ this.isUpdatePending = !0;
206
+ try {
207
+ await this._$ES;
208
+ } catch (e) {
209
+ Promise.reject(e);
210
+ }
211
+ const t = this.scheduleUpdate();
212
+ return t != null && await t, !this.isUpdatePending;
213
+ }
214
+ scheduleUpdate() {
215
+ return this.performUpdate();
216
+ }
217
+ performUpdate() {
218
+ var s;
219
+ if (!this.isUpdatePending) return;
220
+ if (!this.hasUpdated) {
221
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
222
+ for (const [o, n] of this._$Ep) this[o] = n;
223
+ this._$Ep = void 0;
224
+ }
225
+ const i = this.constructor.elementProperties;
226
+ if (i.size > 0) for (const [o, n] of i) n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n);
227
+ }
228
+ let t = !1;
229
+ const e = this._$AL;
230
+ try {
231
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
232
+ var o;
233
+ return (o = i.hostUpdate) == null ? void 0 : o.call(i);
234
+ }), this.update(e)) : this._$EU();
235
+ } catch (i) {
236
+ throw t = !1, this._$EU(), i;
237
+ }
238
+ t && this._$AE(e);
239
+ }
240
+ willUpdate(t) {
241
+ }
242
+ _$AE(t) {
243
+ var e;
244
+ (e = this._$EO) == null || e.forEach((s) => {
245
+ var i;
246
+ return (i = s.hostUpdated) == null ? void 0 : i.call(s);
247
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
248
+ }
249
+ _$EU() {
250
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
251
+ }
252
+ get updateComplete() {
253
+ return this.getUpdateComplete();
254
+ }
255
+ getUpdateComplete() {
256
+ return this._$ES;
257
+ }
258
+ shouldUpdate(t) {
259
+ return !0;
260
+ }
261
+ update(t) {
262
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
263
+ }
264
+ updated(t) {
265
+ }
266
+ firstUpdated(t) {
267
+ }
268
+ }
269
+ U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[T("elementProperties")] = /* @__PURE__ */ new Map(), U[T("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: U }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.0.4");
270
+ /**
271
+ * @license
272
+ * Copyright 2017 Google LLC
273
+ * SPDX-License-Identifier: BSD-3-Clause
274
+ */
275
+ const M = globalThis, q = M.trustedTypes, st = q ? q.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, G = "?" + _, Mt = `<${G}>`, E = document, R = () => E.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", Q = Array.isArray, ct = (r) => Q(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", B = `[
276
+ \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, rt = />/g, b = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
277
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, pt = /^(?:script|style|textarea|title)$/i, Ot = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Wt = Ot(1), x = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), S = E.createTreeWalker(E, 129);
278
+ function ut(r, t) {
279
+ if (!Q(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
280
+ return st !== void 0 ? st.createHTML(t) : t;
281
+ }
282
+ const gt = (r, t) => {
283
+ const e = r.length - 1, s = [];
284
+ let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C;
285
+ for (let h = 0; h < e; h++) {
286
+ const a = r[h];
287
+ let d, y, l = -1, $ = 0;
288
+ for (; $ < a.length && (n.lastIndex = $, y = n.exec(a), y !== null); ) $ = n.lastIndex, n === C ? y[1] === "!--" ? n = it : y[1] !== void 0 ? n = rt : y[2] !== void 0 ? (pt.test(y[2]) && (i = RegExp("</" + y[2], "g")), n = b) : y[3] !== void 0 && (n = b) : n === b ? y[0] === ">" ? (n = i ?? C, l = -1) : y[1] === void 0 ? l = -2 : (l = n.lastIndex - y[2].length, d = y[1], n = y[3] === void 0 ? b : y[3] === '"' ? ot : nt) : n === ot || n === nt ? n = b : n === it || n === rt ? n = C : (n = b, i = void 0);
289
+ const v = n === b && r[h + 1].startsWith("/>") ? " " : "";
290
+ o += n === C ? a + Mt : l >= 0 ? (s.push(d), a.slice(0, l) + Z + a.slice(l) + _ + v) : a + _ + (l === -2 ? h : v);
291
+ }
292
+ return [ut(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
293
+ };
294
+ class k {
295
+ constructor({ strings: t, _$litType$: e }, s) {
296
+ let i;
297
+ this.parts = [];
298
+ let o = 0, n = 0;
299
+ const h = t.length - 1, a = this.parts, [d, y] = gt(t, e);
300
+ if (this.el = k.createElement(d, s), S.currentNode = this.el.content, e === 2 || e === 3) {
301
+ const l = this.el.content.firstChild;
302
+ l.replaceWith(...l.childNodes);
303
+ }
304
+ for (; (i = S.nextNode()) !== null && a.length < h; ) {
305
+ if (i.nodeType === 1) {
306
+ if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(Z)) {
307
+ const $ = y[n++], v = i.getAttribute(l).split(_), V = /([.?@])?(.*)/.exec($);
308
+ a.push({ type: 1, index: o, name: V[2], strings: v, ctor: V[1] === "." ? mt : V[1] === "?" ? ft : V[1] === "@" ? $t : H }), i.removeAttribute(l);
309
+ } else l.startsWith(_) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
310
+ if (pt.test(i.tagName)) {
311
+ const l = i.textContent.split(_), $ = l.length - 1;
312
+ if ($ > 0) {
313
+ i.textContent = q ? q.emptyScript : "";
314
+ for (let v = 0; v < $; v++) i.append(l[v], R()), S.nextNode(), a.push({ type: 2, index: ++o });
315
+ i.append(l[$], R());
316
+ }
317
+ }
318
+ } else if (i.nodeType === 8) if (i.data === G) a.push({ type: 2, index: o });
319
+ else {
320
+ let l = -1;
321
+ for (; (l = i.data.indexOf(_, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += _.length - 1;
322
+ }
323
+ o++;
324
+ }
325
+ }
326
+ static createElement(t, e) {
327
+ const s = E.createElement("template");
328
+ return s.innerHTML = t, s;
329
+ }
330
+ }
331
+ function w(r, t, e = r, s) {
332
+ var n, h;
333
+ if (t === x) return t;
334
+ let i = s !== void 0 ? (n = e.o) == null ? void 0 : n[s] : e.l;
335
+ const o = N(t) ? void 0 : t._$litDirective$;
336
+ return (i == null ? void 0 : i.constructor) !== o && ((h = i == null ? void 0 : i._$AO) == null || h.call(i, !1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e.o ?? (e.o = []))[s] = i : e.l = i), i !== void 0 && (t = w(r, i._$AS(r, t.values), i, s)), t;
337
+ }
338
+ class yt {
339
+ constructor(t, e) {
340
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
341
+ }
342
+ get parentNode() {
343
+ return this._$AM.parentNode;
344
+ }
345
+ get _$AU() {
346
+ return this._$AM._$AU;
347
+ }
348
+ u(t) {
349
+ const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? E).importNode(e, !0);
350
+ S.currentNode = i;
351
+ let o = S.nextNode(), n = 0, h = 0, a = s[0];
352
+ for (; a !== void 0; ) {
353
+ if (n === a.index) {
354
+ let d;
355
+ a.type === 2 ? d = new P(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new _t(o, this, t)), this._$AV.push(d), a = s[++h];
356
+ }
357
+ n !== (a == null ? void 0 : a.index) && (o = S.nextNode(), n++);
358
+ }
359
+ return S.currentNode = E, i;
360
+ }
361
+ p(t) {
362
+ let e = 0;
363
+ 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++;
364
+ }
365
+ }
366
+ class P {
367
+ get _$AU() {
368
+ var t;
369
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this.v;
370
+ }
371
+ constructor(t, e, s, i) {
372
+ this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this.v = (i == null ? void 0 : i.isConnected) ?? !0;
373
+ }
374
+ get parentNode() {
375
+ let t = this._$AA.parentNode;
376
+ const e = this._$AM;
377
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
378
+ }
379
+ get startNode() {
380
+ return this._$AA;
381
+ }
382
+ get endNode() {
383
+ return this._$AB;
384
+ }
385
+ _$AI(t, e = this) {
386
+ t = w(this, t, e), N(t) ? t === c || t == null || t === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ct(t) ? this.k(t) : this._(t);
387
+ }
388
+ O(t) {
389
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
390
+ }
391
+ T(t) {
392
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
393
+ }
394
+ _(t) {
395
+ this._$AH !== c && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(E.createTextNode(t)), this._$AH = t;
396
+ }
397
+ $(t) {
398
+ var o;
399
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(ut(s.h, s.h[0]), this.options)), s);
400
+ if (((o = this._$AH) == null ? void 0 : o._$AD) === i) this._$AH.p(e);
401
+ else {
402
+ const n = new yt(i, this), h = n.u(this.options);
403
+ n.p(e), this.T(h), this._$AH = n;
404
+ }
405
+ }
406
+ _$AC(t) {
407
+ let e = at.get(t.strings);
408
+ return e === void 0 && at.set(t.strings, e = new k(t)), e;
409
+ }
410
+ k(t) {
411
+ Q(this._$AH) || (this._$AH = [], this._$AR());
412
+ const e = this._$AH;
413
+ let s, i = 0;
414
+ for (const o of t) i === e.length ? e.push(s = new P(this.O(R()), this.O(R()), this, this.options)) : s = e[i], s._$AI(o), i++;
415
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
416
+ }
417
+ _$AR(t = this._$AA.nextSibling, e) {
418
+ var s;
419
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
420
+ const i = t.nextSibling;
421
+ t.remove(), t = i;
422
+ }
423
+ }
424
+ setConnected(t) {
425
+ var e;
426
+ this._$AM === void 0 && (this.v = t, (e = this._$AP) == null || e.call(this, t));
427
+ }
428
+ }
429
+ class H {
430
+ get tagName() {
431
+ return this.element.tagName;
432
+ }
433
+ get _$AU() {
434
+ return this._$AM._$AU;
435
+ }
436
+ constructor(t, e, s, i, o) {
437
+ this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
438
+ }
439
+ _$AI(t, e = this, s, i) {
440
+ const o = this.strings;
441
+ let n = !1;
442
+ if (o === void 0) t = w(this, t, e, 0), n = !N(t) || t !== this._$AH && t !== x, n && (this._$AH = t);
443
+ else {
444
+ const h = t;
445
+ let a, d;
446
+ for (t = o[0], a = 0; a < o.length - 1; a++) d = w(this, h[s + a], e, a), d === x && (d = this._$AH[a]), n || (n = !N(d) || d !== this._$AH[a]), d === c ? t = c : t !== c && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d;
447
+ }
448
+ n && !i && this.j(t);
449
+ }
450
+ j(t) {
451
+ t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
452
+ }
453
+ }
454
+ class mt extends H {
455
+ constructor() {
456
+ super(...arguments), this.type = 3;
457
+ }
458
+ j(t) {
459
+ this.element[this.name] = t === c ? void 0 : t;
460
+ }
461
+ }
462
+ class ft extends H {
463
+ constructor() {
464
+ super(...arguments), this.type = 4;
465
+ }
466
+ j(t) {
467
+ this.element.toggleAttribute(this.name, !!t && t !== c);
468
+ }
469
+ }
470
+ class $t extends H {
471
+ constructor(t, e, s, i, o) {
472
+ super(t, e, s, i, o), this.type = 5;
473
+ }
474
+ _$AI(t, e = this) {
475
+ if ((t = w(this, t, e, 0) ?? c) === x) return;
476
+ const s = this._$AH, i = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== c && (s === c || i);
477
+ i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
478
+ }
479
+ handleEvent(t) {
480
+ var e;
481
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
482
+ }
483
+ }
484
+ class _t {
485
+ constructor(t, e, s) {
486
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
487
+ }
488
+ get _$AU() {
489
+ return this._$AM._$AU;
490
+ }
491
+ _$AI(t) {
492
+ w(this, t);
493
+ }
494
+ }
495
+ const Kt = { M: Z, P: _, A: G, C: 1, L: gt, R: yt, D: ct, V: w, I: P, H, N: ft, U: $t, B: mt, F: _t }, F = M.litHtmlPolyfillSupport;
496
+ F == null || F(k, P), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.2.0");
497
+ const Rt = (r, t, e) => {
498
+ const s = (e == null ? void 0 : e.renderBefore) ?? t;
499
+ let i = s._$litPart$;
500
+ if (i === void 0) {
501
+ const o = (e == null ? void 0 : e.renderBefore) ?? null;
502
+ s._$litPart$ = i = new P(t.insertBefore(R(), o), o, void 0, e ?? {});
503
+ }
504
+ return i._$AI(r), i;
505
+ };
506
+ /**
507
+ * @license
508
+ * Copyright 2017 Google LLC
509
+ * SPDX-License-Identifier: BSD-3-Clause
510
+ */
511
+ class O extends U {
512
+ constructor() {
513
+ super(...arguments), this.renderOptions = { host: this }, this.o = void 0;
514
+ }
515
+ createRenderRoot() {
516
+ var e;
517
+ const t = super.createRenderRoot();
518
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
519
+ }
520
+ update(t) {
521
+ const e = this.render();
522
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this.o = Rt(e, this.renderRoot, this.renderOptions);
523
+ }
524
+ connectedCallback() {
525
+ var t;
526
+ super.connectedCallback(), (t = this.o) == null || t.setConnected(!0);
527
+ }
528
+ disconnectedCallback() {
529
+ var t;
530
+ super.disconnectedCallback(), (t = this.o) == null || t.setConnected(!1);
531
+ }
532
+ render() {
533
+ return x;
534
+ }
535
+ }
536
+ var lt;
537
+ O._$litElement$ = !0, O.finalized = !0, (lt = globalThis.litElementHydrateSupport) == null || lt.call(globalThis, { LitElement: O });
538
+ const z = globalThis.litElementPolyfillSupport;
539
+ z == null || z({ LitElement: O });
540
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.0");
541
+ /**
542
+ * @license
543
+ * Copyright 2017 Google LLC
544
+ * SPDX-License-Identifier: BSD-3-Clause
545
+ */
546
+ const Nt = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: K }, kt = (r = Nt, t, e) => {
547
+ const { kind: s, metadata: i } = e;
548
+ let o = globalThis.litPropertyMetadata.get(i);
549
+ if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), o.set(e.name, r), s === "accessor") {
550
+ const { name: n } = e;
551
+ return { set(h) {
552
+ const a = t.get.call(this);
553
+ t.set.call(this, h), this.requestUpdate(n, a, r);
554
+ }, init(h) {
555
+ return h !== void 0 && this.P(n, void 0, r), h;
556
+ } };
557
+ }
558
+ if (s === "setter") {
559
+ const { name: n } = e;
560
+ return function(h) {
561
+ const a = this[n];
562
+ t.call(this, h), this.requestUpdate(n, a, r);
563
+ };
564
+ }
565
+ throw Error("Unsupported decorator location: " + s);
566
+ };
567
+ function u(r) {
568
+ return (t, e) => typeof e == "object" ? kt(r, t, e) : ((s, i, o) => {
569
+ const n = i.hasOwnProperty(o);
570
+ return i.constructor.createProperty(o, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
571
+ })(r, t, e);
572
+ }
573
+ var p = [];
574
+ for (var J = 0; J < 256; ++J)
575
+ p.push((J + 256).toString(16).slice(1));
576
+ function Ht(r, t = 0) {
577
+ return (p[r[t + 0]] + p[r[t + 1]] + p[r[t + 2]] + p[r[t + 3]] + "-" + p[r[t + 4]] + p[r[t + 5]] + "-" + p[r[t + 6]] + p[r[t + 7]] + "-" + p[r[t + 8]] + p[r[t + 9]] + "-" + p[r[t + 10]] + p[r[t + 11]] + p[r[t + 12]] + p[r[t + 13]] + p[r[t + 14]] + p[r[t + 15]]).toLowerCase();
578
+ }
579
+ var L, Vt = new Uint8Array(16);
580
+ function Lt() {
581
+ if (!L && (L = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !L))
582
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
583
+ return L(Vt);
584
+ }
585
+ var It = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
586
+ const ht = {
587
+ randomUUID: It
588
+ };
589
+ function Dt(r, t, e) {
590
+ if (ht.randomUUID && !t && !r)
591
+ return ht.randomUUID();
592
+ r = r || {};
593
+ var s = r.random || (r.rng || Lt)();
594
+ return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Ht(s);
595
+ }
596
+ const qt = {
597
+ hi: "Hei!"
598
+ }, jt = {
599
+ buttonAltText: "Åpne kalender"
600
+ }, Bt = {
601
+ days: [
602
+ "Mandag",
603
+ "Tirsdag",
604
+ "Onsdag",
605
+ "Torsdag",
606
+ "Fredag",
607
+ "Lørdag",
608
+ "Søndag"
609
+ ],
610
+ daysShort: [
611
+ "Man",
612
+ "Tir",
613
+ "Ons",
614
+ "Tor",
615
+ "Fre",
616
+ "Lør",
617
+ "Søn"
618
+ ],
619
+ months: [
620
+ "Januar",
621
+ "Februar",
622
+ "Mars",
623
+ "April",
624
+ "Mai",
625
+ "Juni",
626
+ "Juli",
627
+ "August",
628
+ "September",
629
+ "Oktober",
630
+ "November",
631
+ "Desember"
632
+ ],
633
+ monthsShort: [
634
+ "Jan",
635
+ "Feb",
636
+ "Mar",
637
+ "Apr",
638
+ "Mai",
639
+ "Jun",
640
+ "Jul",
641
+ "Aug",
642
+ "Sep",
643
+ "Okt",
644
+ "Nov",
645
+ "Des"
646
+ ],
647
+ week: "Uke",
648
+ prevMonth: "Forrige måned",
649
+ nextMonth: "Neste måned"
650
+ }, Ft = {
651
+ labels: {
652
+ optional: "Valgfritt",
653
+ required: "Må fylles ut"
654
+ },
655
+ messages: {
656
+ required: "Dette feltet er påkrevd",
657
+ invalid: "Ugyldig verdi",
658
+ invalidPattern: "Ugyldig format",
659
+ tooShort: "For kort",
660
+ tooLong: "For lang",
661
+ rangeUnderflow: "For lav verdi",
662
+ rangeOverflow: "For høy verdi",
663
+ dateUnderflow: "For tidlig dato",
664
+ dateOverflow: "For sen dato"
665
+ },
666
+ date: {
667
+ multiple: "Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."
668
+ }
669
+ }, f = {
670
+ example: qt,
671
+ calendar: jt,
672
+ dates: Bt,
673
+ forms: Ft
674
+ };
675
+ var zt = Object.defineProperty, g = (r, t, e, s) => {
676
+ for (var i = void 0, o = r.length - 1, n; o >= 0; o--)
677
+ (n = r[o]) && (i = n(t, e, i) || i);
678
+ return i && zt(t, e, i), i;
679
+ };
680
+ class vt extends O {
681
+ /**
682
+ * Add extra stuff here whenever we decide what should be added here…
683
+ */
684
+ constructor() {
685
+ super(), this.strings = f;
686
+ }
687
+ /**
688
+ * Runs on mount, used to set up various values and whatever you need to run
689
+ */
690
+ connectedCallback() {
691
+ super.connectedCallback();
692
+ }
693
+ /**
694
+ * Make sure the component renders in light DOM instead of shadow DOM
695
+ */
696
+ createRenderRoot() {
697
+ return this;
698
+ }
699
+ /**
700
+ * Add support for Hot Module Reloading in dev mode
701
+ */
702
+ hotReplacedCallback() {
703
+ this.requestUpdate();
704
+ }
705
+ }
706
+ g([
707
+ u({ type: Object })
708
+ ], vt.prototype, "strings");
709
+ class m extends vt {
710
+ constructor() {
711
+ super(), this.id = Dt(), this.name = this.id, this.required = !1, this.disabled = !1, this.placeholder = "", this.min = null, this.max = null, this.minlength = 0, this.maxlength = 0, this.pattern = "", this.optionalTag = !1, this.optionalText = f.forms.labels.optional, this.requiredTag = !1, this.requiredText = f.forms.labels.required, this.hasError = !1, this.errorMessage = "", this.internals = this.attachInternals();
712
+ }
713
+ static get formAssociated() {
714
+ return !0;
715
+ }
716
+ manageValidity(t) {
717
+ this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, f.forms.messages.required, t) : t.validity.typeMismatch || t.validity.badInput ? this.internals.setValidity({ typeMismatch: !0 }, f.forms.messages.invalid, t) : t.validity.patternMismatch ? this.internals.setValidity(
718
+ { patternMismatch: !0 },
719
+ f.forms.messages.invalidPattern,
720
+ t
721
+ ) : t.validity.tooShort || this.minLength > 0 && this.value.length < this.minLength ? this.internals.setValidity({ tooShort: !0 }, f.forms.messages.tooShort, t) : t.validity.tooLong || this.maxLength > 0 && this.value.length > this.maxLength ? this.internals.setValidity({ tooLong: !0 }, f.forms.messages.tooLong, t) : t.validity.rangeUnderflow ? this.internals.setValidity(
722
+ { rangeUnderflow: !0 },
723
+ f.forms.messages.rangeUnderflow,
724
+ t
725
+ ) : t.validity.rangeOverflow ? this.internals.setValidity(
726
+ { rangeOverflow: !0 },
727
+ f.forms.messages.rangeOverflow,
728
+ t
729
+ ) : t.validity.customError ? this.internals.setValidity({ customError: !0 }, t.validationMessage, t) : this.internals.setValidity({});
730
+ }
731
+ // Trigger this when you want to set the value of the input out to the form
732
+ onInput(t) {
733
+ if (console.log("onInput", t), typeof t != "string" && !Array.isArray(t)) {
734
+ console.log("Value must be a string or an array");
735
+ return;
736
+ }
737
+ !Array.isArray(t) && t.includes(",") && (t = t.split(",")), !this.multiple && !this.range && Array.isArray(t) && (t = t[0]), this.manageValidity(this.inputRef.value), this.inputRef2 && this.manageValidity(this.inputRef2.value), this.internals.setFormValue(t), this.dispatchEvent(new Event("input")), this.dispatchEvent(new Event("change")), this.dispatchEvent(
738
+ new CustomEvent("value-changed", {
739
+ detail: this._value,
740
+ bubbles: !0,
741
+ composed: !0
742
+ })
743
+ ), this.internals.reportValidity();
744
+ }
745
+ firstUpdated(t) {
746
+ super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.disabled = !0, this.internals.ariaDisabled = !0), this.internals.setFormValue(this.value), this.manageValidity(this.inputRef.value);
747
+ }
748
+ }
749
+ g([
750
+ u({ type: String, reflect: !0 })
751
+ ], m.prototype, "id");
752
+ g([
753
+ u({ type: String, reflect: !0 })
754
+ ], m.prototype, "name");
755
+ g([
756
+ u({ type: Boolean, reflect: !0 })
757
+ ], m.prototype, "required");
758
+ g([
759
+ u({ type: Boolean, reflect: !0 })
760
+ ], m.prototype, "disabled");
761
+ g([
762
+ u({ type: String, reflect: !0 })
763
+ ], m.prototype, "placeholder");
764
+ g([
765
+ u({ type: Number, reflect: !0 })
766
+ ], m.prototype, "min");
767
+ g([
768
+ u({ type: Number, reflect: !0 })
769
+ ], m.prototype, "max");
770
+ g([
771
+ u({ type: Number, reflect: !0 })
772
+ ], m.prototype, "minlength");
773
+ g([
774
+ u({ type: Number, reflect: !0 })
775
+ ], m.prototype, "maxlength");
776
+ g([
777
+ u({ type: String, reflect: !0 })
778
+ ], m.prototype, "pattern");
779
+ g([
780
+ u({ type: Boolean, reflect: !0 })
781
+ ], m.prototype, "optionalTag");
782
+ g([
783
+ u({ type: String, reflect: !0 })
784
+ ], m.prototype, "optionalText");
785
+ g([
786
+ u({ type: Boolean, reflect: !0 })
787
+ ], m.prototype, "requiredTag");
788
+ g([
789
+ u({ type: String, reflect: !0 })
790
+ ], m.prototype, "requiredText");
791
+ g([
792
+ u({ type: Boolean, reflect: !0 })
793
+ ], m.prototype, "hasError");
794
+ g([
795
+ u({ type: String, reflect: !0 })
796
+ ], m.prototype, "errorMessage");
797
+ export {
798
+ c as D,
799
+ vt as P,
800
+ x as R,
801
+ m as a,
802
+ Wt as k,
803
+ u as n,
804
+ Kt as s,
805
+ f as t,
806
+ Dt as v
807
+ };