@mgdis/stencil-helpers 2.2.6 → 3.1.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.
package/dist/index.es.js CHANGED
@@ -1,216 +1,343 @@
1
- var he = Object.defineProperty;
2
- var W = (e) => {
1
+ var Ue = Object.defineProperty;
2
+ var fe = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var ve = (e, t, s) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
- var p = (e, t, s) => ve(e, typeof t != "symbol" ? t + "" : t, s), ye = (e, t, s) => t.has(e) || W("Cannot " + s);
7
- var x = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), B = (e, t, s) => t.has(e) ? W("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
8
- const Ge = (e = "", t = 10) => {
9
- const s = new Uint8Array(t);
10
- crypto.getRandomValues(s);
11
- const r = Array.from(s).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, t);
12
- return e !== "" ? `${e}-${r}` : r;
13
- }, Xe = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
14
- class Ze {
5
+ var Ze = (e, t, r) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
6
+ var $ = (e, t, r) => Ze(e, typeof t != "symbol" ? t + "" : t, r), ue = (e, t, r) => t.has(e) || fe("Cannot " + r);
7
+ var v = (e, t, r) => (ue(e, t, "read from private field"), r ? r.call(e) : t.get(e)), j = (e, t, r) => t.has(e) ? fe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), U = (e, t, r, s) => (ue(e, t, "write to private field"), s ? s.call(e, r) : t.set(e, r), r);
8
+ const Pt = (e = "", t = 10) => {
9
+ const r = new Uint8Array(t);
10
+ crypto.getRandomValues(r);
11
+ const s = Array.from(r).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, t);
12
+ return e !== "" ? `${e}-${s}` : s;
13
+ }, Ut = (e) => De(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
14
+ class Zt {
15
15
  constructor(t = []) {
16
16
  /**
17
17
  * Available classes
18
18
  */
19
- p(this, "classes");
19
+ $(this, "classes");
20
20
  /**
21
21
  * Add class
22
22
  * @param className - class name to add
23
23
  */
24
- p(this, "add", (t) => {
24
+ $(this, "add", (t) => {
25
25
  this.has(t) || this.classes.push(t);
26
26
  });
27
27
  /**
28
28
  * Delete class
29
29
  * @param className - class name to delete
30
30
  */
31
- p(this, "delete", (t) => {
32
- const s = this.classes.indexOf(t);
33
- s > -1 && this.classes.splice(s, 1);
31
+ $(this, "delete", (t) => {
32
+ const r = this.classes.indexOf(t);
33
+ r > -1 && this.classes.splice(r, 1);
34
34
  });
35
35
  /**
36
36
  * Check if class exist in list
37
37
  * @param className - class name to check
38
38
  * @returns class name is in the list
39
39
  */
40
- p(this, "has", (t) => this.classes.includes(t));
40
+ $(this, "has", (t) => this.classes.includes(t));
41
41
  /**
42
42
  * Join classes seperated by spaces
43
43
  * @returns joined values
44
44
  */
45
- p(this, "join", () => this.classes.join(" "));
45
+ $(this, "join", () => this.classes.join(" "));
46
46
  this.classes = t;
47
47
  }
48
48
  }
49
- const Je = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Ke = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Qe = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Ye = (e) => {
50
- const t = Y(e), s = V(e);
51
- return [e, ...t, ...s];
52
- }, Y = (e, t = []) => {
49
+ const Dt = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), qt = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Ht = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Bt = (e) => {
50
+ const t = _e(e), r = ve(e);
51
+ return [e, ...t, ...r];
52
+ }, _e = (e, t = []) => {
53
53
  if (e.self !== e.top)
54
54
  try {
55
- const s = e.parent;
56
- return s ? (t.push(s), Y(s, t)) : t;
57
- } catch (s) {
58
- return console.error("Different hosts between iframes:", s), t;
55
+ const r = e.parent;
56
+ return r ? (t.push(r), _e(r, t)) : t;
57
+ } catch (r) {
58
+ return console.error("Different hosts between iframes:", r), t;
59
59
  }
60
60
  return t;
61
- }, V = (e, t = []) => {
61
+ }, ve = (e, t = []) => {
62
62
  if (e.frames.length > 0)
63
- for (const s of Array.from(e.frames))
64
- t.push(s), V(s, t);
63
+ for (const r of Array.from(e.frames))
64
+ t.push(r), ve(r, t);
65
65
  return t;
66
- }, me = (e) => typeof e == "string" && e.trim() !== "", Ve = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, et = (e) => typeof e == "number" && !Number.isNaN(e), tt = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, st = async (e) => e();
67
- var C = {
66
+ }, De = (e) => typeof e == "string" && e.trim() !== "", Gt = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, Wt = (e) => typeof e == "number" && !Number.isNaN(e), Jt = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Xt = async (e) => {
67
+ if (e) return e();
68
+ }, ie = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, qe = (e, t, r) => {
69
+ const s = ".";
70
+ if (!ie(e) || typeof t != "string")
71
+ return r;
72
+ const [n, ...i] = t.split(s);
73
+ return i.length ? qe(e[n], i.join(s)) : e[n];
74
+ }, Kt = {
75
+ FIRST: "first",
76
+ NEXT: "next",
77
+ PREVIOUS: "previous",
78
+ LAST: "last"
79
+ }, we = 10;
80
+ class He {
81
+ constructor(t) {
82
+ /**
83
+ * Define items
84
+ */
85
+ $(this, "items", []);
86
+ /**
87
+ * Define total
88
+ */
89
+ $(this, "total");
90
+ /**
91
+ * Define top
92
+ */
93
+ $(this, "top", we);
94
+ /**
95
+ * Define next
96
+ */
97
+ $(this, "next");
98
+ /**
99
+ * Define base index
100
+ */
101
+ $(this, "baseIndex", 1);
102
+ /**
103
+ * Get index of items from cursor
104
+ * @param cursor - cursor to find
105
+ * @param oldItem - previous item
106
+ * @returns item index
107
+ */
108
+ $(this, "getIndexFromCursor", (t = "first", r) => {
109
+ if (!Array.isArray(this.items) || !this.items.length) return null;
110
+ const n = this.items.length - this.baseIndex;
111
+ let i = 0, a = 0;
112
+ if (["previous", "next"].includes(t) && r) {
113
+ const c = this.items.findIndex((l) => JSON.stringify(l) === JSON.stringify(r));
114
+ if (c === -1) return 0;
115
+ a = c;
116
+ }
117
+ return t === "first" ? i = 0 : t === "last" ? i = n : t === "previous" ? i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[0]) ? n : a - this.baseIndex : t === "next" && (i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[n]) ? 0 : a + this.baseIndex), i;
118
+ });
119
+ if (ie(t))
120
+ Array.isArray(t.items) && (this.items = t.items), typeof t.top == "number" && (this.top = t.top), this.total = typeof t.total == "number" ? t.total : this.items.length, this.next = t.next;
121
+ else
122
+ throw new Error("Page - init must match IPage type.");
123
+ }
124
+ }
125
+ var S, N, M;
126
+ class Yt {
127
+ constructor(t, r) {
128
+ /**
129
+ * Define paginated items
130
+ */
131
+ $(this, "items", []);
132
+ /* Privates */
133
+ j(this, S, we);
134
+ j(this, N);
135
+ j(this, M);
136
+ /**
137
+ * Get page
138
+ * @param offset - pagiantion offset
139
+ * @param filter - filter methode
140
+ * @returns formated page
141
+ */
142
+ $(this, "getPage", (t = 0, r) => {
143
+ const s = typeof r == "function" ? this.items.filter(r) : this.items;
144
+ let n;
145
+ return v(this, N) ? n = v(this, N) : s.length > t + v(this, S) && (n = () => this.getPage(t + v(this, S), r)), new He({
146
+ items: s.slice(t, t + v(this, S)),
147
+ total: v(this, M),
148
+ top: v(this, S),
149
+ next: n
150
+ });
151
+ });
152
+ Array.isArray(t) && (this.items = t), r && (["string", "function"].includes(typeof r.next) || ie(r.next) && URL.canParse(r.next)) && U(this, N, r.next), typeof (r == null ? void 0 : r.top) == "number" && U(this, S, r.top), typeof (r == null ? void 0 : r.total) == "number" && U(this, M, r.total);
153
+ }
154
+ }
155
+ S = new WeakMap(), N = new WeakMap(), M = new WeakMap();
156
+ var K = {
68
157
  updatable: !0,
69
158
  slotRelocation: !0,
70
159
  // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
71
160
  experimentalSlotFixes: !1
72
- }, be = Object.defineProperty, Se = (e, t) => {
73
- for (var s in t)
74
- be(e, s, { get: t[s], enumerable: !0 });
75
- }, ke = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml", G = (e, t) => t in e, X = "http://www.w3.org/1999/xlink", ee = typeof window < "u" ? window : {}, R = ee.document || { head: {} }, _ = {
161
+ }, Be = Object.defineProperty, Ge = (e, t) => {
162
+ for (var r in t)
163
+ Be(e, r, { get: t[r], enumerable: !0 });
164
+ }, We = "http://www.w3.org/2000/svg", Je = "http://www.w3.org/1999/xhtml", pe = (e, t) => t in e, ge = "http://www.w3.org/1999/xlink", O = typeof window < "u" ? window : {}, z = {
76
165
  $flags$: 0,
77
166
  $resourcesUrl$: "",
78
167
  jmp: (e) => e(),
79
168
  raf: (e) => requestAnimationFrame(e),
80
- ael: (e, t, s, r) => e.addEventListener(t, s, r),
81
- rel: (e, t, s, r) => e.removeEventListener(t, s, r),
169
+ ael: (e, t, r, s) => e.addEventListener(t, r, s),
170
+ rel: (e, t, r, s) => e.removeEventListener(t, r, s),
82
171
  ce: (e, t) => new CustomEvent(e, t)
83
- }, Te = (e) => e != null && e !== void 0, te = (e) => (e = typeof e, e === "object" || e === "function"), _e = {};
84
- Se(_e, {
85
- err: () => se,
86
- map: () => Ee,
87
- ok: () => P,
88
- unwrap: () => Ae,
89
- unwrapErr: () => je
172
+ }, Xe = (e) => e != null && e !== void 0, xe = (e) => (e = typeof e, e === "object" || e === "function"), Ke = {};
173
+ Ge(Ke, {
174
+ err: () => me,
175
+ map: () => Ye,
176
+ ok: () => V,
177
+ unwrap: () => Qe,
178
+ unwrapErr: () => Ve
90
179
  });
91
- var P = (e) => ({
180
+ var V = (e) => ({
92
181
  isOk: !0,
93
182
  isErr: !1,
94
183
  value: e
95
- }), se = (e) => ({
184
+ }), me = (e) => ({
96
185
  isOk: !1,
97
186
  isErr: !0,
98
187
  value: e
99
188
  });
100
- function Ee(e, t) {
189
+ function Ye(e, t) {
101
190
  if (e.isOk) {
102
- const s = t(e.value);
103
- return s instanceof Promise ? s.then((r) => P(r)) : P(s);
191
+ const r = t(e.value);
192
+ return r instanceof Promise ? r.then((s) => V(s)) : V(r);
104
193
  }
105
194
  if (e.isErr) {
106
- const s = e.value;
107
- return se(s);
195
+ const r = e.value;
196
+ return me(r);
108
197
  }
109
198
  throw "should never get here";
110
199
  }
111
- var Ae = (e) => {
200
+ var Qe = (e) => {
112
201
  if (e.isOk)
113
202
  return e.value;
114
203
  throw e.value;
115
- }, je = (e) => {
204
+ }, Ve = (e) => {
116
205
  if (e.isErr)
117
206
  return e.value;
118
207
  throw e.value;
119
- }, re = (e) => {
120
- const t = e.__childNodes || e.childNodes;
121
- e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && ne(t, e.tagName).forEach((s) => {
122
- var r;
123
- s.nodeType === 1 && s.tagName === "SLOT-FB" && ((r = Oe(s, s["s-sn"], !1)) != null && r.length ? s.hidden = !0 : s.hidden = !1);
208
+ }, Se = (e) => {
209
+ const t = de(e, "childNodes");
210
+ e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && Ee(t, e.tagName).forEach((s) => {
211
+ s.nodeType === 1 && s.tagName === "SLOT-FB" && (tt(s, ae(s), !1).length ? s.hidden = !0 : s.hidden = !1);
124
212
  });
125
- for (const s of t)
126
- s.nodeType === 1 && (s.__childNodes || s.childNodes).length && re(s);
213
+ let r = 0;
214
+ for (r = 0; r < t.length; r++) {
215
+ const s = t[r];
216
+ s.nodeType === 1 && de(s, "childNodes").length && Se(s);
217
+ }
218
+ }, et = (e) => {
219
+ const t = [];
220
+ for (let r = 0; r < e.length; r++) {
221
+ const s = e[r]["s-nr"] || void 0;
222
+ s && s.isConnected && t.push(s);
223
+ }
224
+ return t;
127
225
  };
128
- function ne(e, t, s) {
129
- let r = 0, n = [], i;
130
- for (; r < e.length; r++)
131
- i = e[r], i["s-sr"] && i["s-hn"] === t && s === void 0 && n.push(i), n = [...n, ...ne(i.childNodes, t, s)];
226
+ function Ee(e, t, r) {
227
+ let s = 0, n = [], i;
228
+ for (; s < e.length; s++)
229
+ i = e[s], i["s-sr"] && (!t || i["s-hn"] === t) && r === void 0 && n.push(i), n = [...n, ...Ee(i.childNodes, t, r)];
132
230
  return n;
133
231
  }
134
- var Oe = (e, t, s = !0) => {
135
- const r = [];
136
- for ((s && e["s-sr"] || !e["s-sr"]) && r.push(e); (e = e.nextSibling) && e["s-sn"] === t; )
137
- r.push(e);
138
- return r;
139
- }, Z = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", Le = (e, t, ...s) => {
140
- let r = null, n = null, i = null, o = !1, f = !1;
141
- const c = [], $ = (l) => {
142
- for (let d = 0; d < l.length; d++)
143
- r = l[d], Array.isArray(r) ? $(r) : r != null && typeof r != "boolean" && ((o = !te(r)) && (r = String(r)), o && f ? c[c.length - 1].$text$ += r : c.push(o ? w(null, r) : r), f = o);
232
+ var tt = (e, t, r = !0) => {
233
+ const s = [];
234
+ (r && e["s-sr"] || !e["s-sr"]) && s.push(e);
235
+ let n = e;
236
+ for (; n = n.nextSibling; )
237
+ ae(n) === t && (r || !n["s-sr"]) && s.push(n);
238
+ return s;
239
+ }, $e = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", ae = (e) => typeof e["s-sn"] == "string" ? e["s-sn"] : e.nodeType === 1 && e.getAttribute("slot") || void 0;
240
+ function rt(e) {
241
+ if (e.assignedElements || e.assignedNodes || !e["s-sr"]) return;
242
+ const t = (r) => (function(s) {
243
+ const n = [], i = this["s-sn"];
244
+ s != null && s.flatten && console.error(`
245
+ Flattening is not supported for Stencil non-shadow slots.
246
+ You can use \`.childNodes\` to nested slot fallback content.
247
+ If you have a particular use case, please open an issue on the Stencil repo.
248
+ `);
249
+ const a = this["s-cr"].parentElement;
250
+ return (a.__childNodes ? a.childNodes : et(a.childNodes)).forEach((l) => {
251
+ i === ae(l) && n.push(l);
252
+ }), r ? n.filter(
253
+ (l) => l.nodeType === 1
254
+ /* ElementNode */
255
+ ) : n;
256
+ }).bind(e);
257
+ e.assignedElements = t(!0), e.assignedNodes = t(!1);
258
+ }
259
+ function de(e, t) {
260
+ if ("__" + t in e) {
261
+ const r = e["__" + t];
262
+ return typeof r != "function" ? r : r.bind(e);
263
+ } else
264
+ return typeof e[t] != "function" ? e[t] : e[t].bind(e);
265
+ }
266
+ var st = (e, t, ...r) => {
267
+ let s = null, n = null, i = null, a = !1, c = !1;
268
+ const l = [], f = (o) => {
269
+ for (let g = 0; g < o.length; g++)
270
+ s = o[g], Array.isArray(s) ? f(s) : s != null && typeof s != "boolean" && ((a = !xe(s)) && (s = String(s)), a && c ? l[l.length - 1].$text$ += s : l.push(a ? ee(null, s) : s), c = a);
144
271
  };
145
- $(s);
146
- const u = w(e, null);
147
- return u.$attrs$ = t, c.length > 0 && (u.$children$ = c), u.$key$ = n, u.$name$ = i, u;
148
- }, w = (e, t) => {
149
- const s = {
272
+ f(r);
273
+ const p = ee(e, null);
274
+ return p.$attrs$ = t, l.length > 0 && (p.$children$ = l), p.$key$ = n, p.$name$ = i, p;
275
+ }, ee = (e, t) => {
276
+ const r = {
150
277
  $flags$: 0,
151
278
  $tag$: e,
152
279
  $text$: t,
153
280
  $elm$: null,
154
281
  $children$: null
155
282
  };
156
- return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
157
- }, Re = {}, Me = (e) => e && e.$tag$ === Re, J = (e, t, s, r, n, i, o) => {
158
- if (s !== r) {
159
- let f = G(e, t), c = t.toLowerCase();
160
- if (t === "class") {
161
- const $ = e.classList, u = K(s);
162
- let l = K(r);
163
- $.remove(...u.filter((d) => d && !l.includes(d))), $.add(...l.filter((d) => d && !u.includes(d)));
164
- } else if (t === "style") {
165
- for (const $ in s)
166
- (!r || r[$] == null) && ($.includes("-") ? e.style.removeProperty($) : e.style[$] = "");
167
- for (const $ in r)
168
- (!s || r[$] !== s[$]) && ($.includes("-") ? e.style.setProperty($, r[$]) : e.style[$] = r[$]);
169
- } else if (t !== "key") if (t === "ref")
170
- r && r(e);
171
- else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
172
- if (t[2] === "-" ? t = t.slice(3) : G(ee, c) ? t = c.slice(2) : t = c[2] + t.slice(3), s || r) {
173
- const $ = t.endsWith(ie);
174
- t = t.replace(Fe, ""), s && _.rel(e, t, s, $), r && _.ael(e, t, r, $);
175
- }
176
- } else {
177
- const $ = te(r);
178
- if ((f || $ && r !== null) && !n)
179
- try {
180
- if (e.tagName.includes("-"))
181
- e[t] !== r && (e[t] = r);
182
- else {
183
- const l = r ?? "";
184
- t === "list" ? f = !1 : (s == null || e[t] != l) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = l : e.setAttribute(t, l));
185
- }
186
- } catch {
187
- }
188
- let u = !1;
189
- c !== (c = c.replace(/^xlink\:?/, "")) && (t = c, u = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (u ? e.removeAttributeNS(X, t) : e.removeAttribute(t)) : (!f || i & 4 || n) && !$ && (r = r === !0 ? "" : r, u ? e.setAttributeNS(X, t, r) : e.setAttribute(t, r));
283
+ return r.$attrs$ = null, r.$key$ = null, r.$name$ = null, r;
284
+ }, nt = {}, it = (e) => e && e.$tag$ === nt, ye = (e, t, r, s, n, i, a) => {
285
+ if (r === s)
286
+ return;
287
+ let c = pe(e, t), l = t.toLowerCase();
288
+ if (t === "class") {
289
+ const f = e.classList, p = he(r);
290
+ let o = he(s);
291
+ f.remove(...p.filter((g) => g && !o.includes(g))), f.add(...o.filter((g) => g && !p.includes(g)));
292
+ } else if (t === "style") {
293
+ for (const f in r)
294
+ (!s || s[f] == null) && (f.includes("-") ? e.style.removeProperty(f) : e.style[f] = "");
295
+ for (const f in s)
296
+ (!r || s[f] !== r[f]) && (f.includes("-") ? e.style.setProperty(f, s[f]) : e.style[f] = s[f]);
297
+ } else if (t !== "key") if (t === "ref")
298
+ s && s(e);
299
+ else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
300
+ if (t[2] === "-" ? t = t.slice(3) : pe(O, l) ? t = l.slice(2) : t = l[2] + t.slice(3), r || s) {
301
+ const f = t.endsWith(Oe);
302
+ t = t.replace(ot, ""), r && z.rel(e, t, r, f), s && z.ael(e, t, s, f);
190
303
  }
304
+ } else {
305
+ const f = xe(s);
306
+ if ((c || f && s !== null) && !n)
307
+ try {
308
+ if (e.tagName.includes("-"))
309
+ e[t] !== s && (e[t] = s);
310
+ else {
311
+ const o = s ?? "";
312
+ t === "list" ? c = !1 : (r == null || e[t] != o) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = o : e.setAttribute(t, o));
313
+ }
314
+ } catch {
315
+ }
316
+ let p = !1;
317
+ l !== (l = l.replace(/^xlink\:?/, "")) && (t = l, p = !0), s == null || s === !1 ? (s !== !1 || e.getAttribute(t) === "") && (p ? e.removeAttributeNS(ge, t) : e.removeAttribute(t)) : (!c || i & 4 || n) && !f && e.nodeType === 1 && (s = s === !0 ? "" : s, p ? e.setAttributeNS(ge, t, s) : e.setAttribute(t, s));
191
318
  }
192
- }, Ne = /\s/, K = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(Ne)), ie = "Capture", Fe = new RegExp(ie + "$"), oe = (e, t, s, r) => {
193
- const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, i = e && e.$attrs$ || {}, o = t.$attrs$ || {};
194
- for (const f of Q(Object.keys(i)))
195
- f in o || J(
319
+ }, at = /\s/, he = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(at)), Oe = "Capture", ot = new RegExp(Oe + "$"), te = (e, t, r, s) => {
320
+ const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, i = e && e.$attrs$ || {}, a = t.$attrs$ || {};
321
+ for (const c of be(Object.keys(i)))
322
+ c in a || ye(
196
323
  n,
197
- f,
198
- i[f],
324
+ c,
325
+ i[c],
199
326
  void 0,
200
- s,
327
+ r,
201
328
  t.$flags$
202
329
  );
203
- for (const f of Q(Object.keys(o)))
204
- J(
330
+ for (const c of be(Object.keys(a)))
331
+ ye(
205
332
  n,
206
- f,
207
- i[f],
208
- o[f],
209
- s,
333
+ c,
334
+ i[c],
335
+ a[c],
336
+ r,
210
337
  t.$flags$
211
338
  );
212
339
  };
213
- function Q(e) {
340
+ function be(e) {
214
341
  return e.includes("ref") ? (
215
342
  // we need to sort these to ensure that `'ref'` is the last attr
216
343
  [...e.filter((t) => t !== "ref"), "ref"]
@@ -219,11 +346,11 @@ function Q(e) {
219
346
  e
220
347
  );
221
348
  }
222
- var M, N, E, F = !1, H = !1, I = !1, v = !1, D = (e, t, s) => {
223
- var r;
224
- const n = t.$children$[s];
225
- let i = 0, o, f, c;
226
- if (F || (I = !0, n.$tag$ === "slot" && (n.$flags$ |= n.$children$ ? (
349
+ var D, B, I, re = !1, G = !1, oe = !1, b = !1, W = (e, t, r) => {
350
+ var s;
351
+ const n = t.$children$[r];
352
+ let i = 0, a, c, l;
353
+ if (re || (oe = !0, n.$tag$ === "slot" && (n.$flags$ |= n.$children$ ? (
227
354
  // slot element has fallback content
228
355
  // still create an element that "mocks" the slot element
229
356
  2
@@ -233,308 +360,488 @@ var M, N, E, F = !1, H = !1, I = !1, v = !1, D = (e, t, s) => {
233
360
  // where actual slot content should sit next to
234
361
  1
235
362
  ))), n.$text$ !== null)
236
- o = n.$elm$ = R.createTextNode(n.$text$);
363
+ a = n.$elm$ = O.document.createTextNode(n.$text$);
237
364
  else if (n.$flags$ & 1)
238
- o = n.$elm$ = R.createTextNode("");
365
+ a = n.$elm$ = O.document.createTextNode(""), te(null, n, b);
239
366
  else {
240
- if (v || (v = n.$tag$ === "svg"), o = n.$elm$ = R.createElementNS(
241
- v ? ke : xe,
242
- !F && C.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
243
- ), v && n.$tag$ === "foreignObject" && (v = !1), oe(null, n, v), Te(M) && o["s-si"] !== M && o.classList.add(o["s-si"] = M), n.$children$)
367
+ if (b || (b = n.$tag$ === "svg"), !O.document)
368
+ throw new Error(
369
+ "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
370
+ );
371
+ if (a = n.$elm$ = O.document.createElementNS(
372
+ b ? We : Je,
373
+ !re && K.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
374
+ ), b && n.$tag$ === "foreignObject" && (b = !1), te(null, n, b), Xe(D) && a["s-si"] !== D && a.classList.add(a["s-si"] = D), n.$children$)
244
375
  for (i = 0; i < n.$children$.length; ++i)
245
- f = D(e, n, i), f && o.appendChild(f);
246
- n.$tag$ === "svg" ? v = !1 : o.tagName === "foreignObject" && (v = !0);
376
+ c = W(e, n, i), c && a.appendChild(c);
377
+ n.$tag$ === "svg" ? b = !1 : a.tagName === "foreignObject" && (b = !0);
247
378
  }
248
- return o["s-hn"] = E, n.$flags$ & 3 && (o["s-sr"] = !0, o["s-cr"] = N, o["s-sn"] = n.$name$ || "", o["s-rf"] = (r = n.$attrs$) == null ? void 0 : r.ref, c = e && e.$children$ && e.$children$[s], c && c.$tag$ === n.$tag$ && e.$elm$ && A(e.$elm$, !1), $e(N, o, t.$elm$, e == null ? void 0 : e.$elm$)), o;
249
- }, A = (e, t) => {
250
- _.$flags$ |= 1;
251
- const s = Array.from(e.__childNodes || e.childNodes);
252
- e["s-sr"] && C.experimentalSlotFixes;
253
- for (let r = s.length - 1; r >= 0; r--) {
254
- const n = s[r];
255
- n["s-hn"] !== E && n["s-ol"] && (k(j(n).parentNode, n, j(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, I = !0), t && A(n, t);
379
+ return a["s-hn"] = I, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = B, a["s-sn"] = n.$name$ || "", a["s-rf"] = (s = n.$attrs$) == null ? void 0 : s.ref, rt(a), l = e && e.$children$ && e.$children$[r], l && l.$tag$ === n.$tag$ && e.$elm$ && L(e.$elm$, !1), Re(B, a, t.$elm$, e == null ? void 0 : e.$elm$)), a;
380
+ }, L = (e, t) => {
381
+ z.$flags$ |= 1;
382
+ const r = Array.from(e.__childNodes || e.childNodes);
383
+ e["s-sr"] && K.experimentalSlotFixes;
384
+ for (let s = r.length - 1; s >= 0; s--) {
385
+ const n = r[s];
386
+ n["s-hn"] !== I && n["s-ol"] && (T(F(n).parentNode, n, F(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, oe = !0), t && L(n, t);
256
387
  }
257
- _.$flags$ &= -2;
258
- }, le = (e, t, s, r, n, i) => {
259
- let o = e["s-cr"] && e["s-cr"].parentNode || e, f;
260
- for (o.shadowRoot && o.tagName === E && (o = o.shadowRoot); n <= i; ++n)
261
- r[n] && (f = D(null, s, n), f && (r[n].$elm$ = f, k(o, f, j(t))));
262
- }, ae = (e, t, s) => {
263
- for (let r = t; r <= s; ++r) {
264
- const n = e[r];
388
+ z.$flags$ &= -2;
389
+ }, Ae = (e, t, r, s, n, i) => {
390
+ let a = e["s-cr"] && e["s-cr"].parentNode || e, c;
391
+ for (a.shadowRoot && a.tagName === I && (a = a.shadowRoot); n <= i; ++n)
392
+ s[n] && (c = W(null, r, n), c && (s[n].$elm$ = c, T(a, c, F(t))));
393
+ }, ke = (e, t, r) => {
394
+ for (let s = t; s <= r; ++s) {
395
+ const n = e[s];
265
396
  if (n) {
266
397
  const i = n.$elm$;
267
- fe(n), i && (H = !0, i["s-ol"] ? i["s-ol"].remove() : A(i, !0), i.remove());
398
+ je(n), i && (G = !0, i["s-ol"] ? i["s-ol"].remove() : L(i, !0), i.remove());
268
399
  }
269
400
  }
270
- }, He = (e, t, s, r, n = !1) => {
271
- let i = 0, o = 0, f = 0, c = 0, $ = t.length - 1, u = t[0], l = t[$], d = r.length - 1, a = r[0], g = r[d], m, y;
272
- for (; i <= $ && o <= d; )
273
- if (u == null)
274
- u = t[++i];
275
- else if (l == null)
276
- l = t[--$];
277
- else if (a == null)
278
- a = r[++o];
279
- else if (g == null)
280
- g = r[--d];
281
- else if (L(u, a, n))
282
- T(u, a, n), u = t[++i], a = r[++o];
283
- else if (L(l, g, n))
284
- T(l, g, n), l = t[--$], g = r[--d];
285
- else if (L(u, g, n))
286
- (u.$tag$ === "slot" || g.$tag$ === "slot") && A(u.$elm$.parentNode, !1), T(u, g, n), k(e, u.$elm$, l.$elm$.nextSibling), u = t[++i], g = r[--d];
287
- else if (L(l, a, n))
288
- (u.$tag$ === "slot" || g.$tag$ === "slot") && A(l.$elm$.parentNode, !1), T(l, a, n), k(e, l.$elm$, u.$elm$), l = t[--$], a = r[++o];
401
+ }, lt = (e, t, r, s, n = !1) => {
402
+ let i = 0, a = 0, c = 0, l = 0, f = t.length - 1, p = t[0], o = t[f], g = s.length - 1, u = s[0], d = s[g], h, _;
403
+ for (; i <= f && a <= g; )
404
+ if (p == null)
405
+ p = t[++i];
406
+ else if (o == null)
407
+ o = t[--f];
408
+ else if (u == null)
409
+ u = s[++a];
410
+ else if (d == null)
411
+ d = s[--g];
412
+ else if (Z(p, u, n))
413
+ R(p, u, n), p = t[++i], u = s[++a];
414
+ else if (Z(o, d, n))
415
+ R(o, d, n), o = t[--f], d = s[--g];
416
+ else if (Z(p, d, n))
417
+ (p.$tag$ === "slot" || d.$tag$ === "slot") && L(p.$elm$.parentNode, !1), R(p, d, n), T(e, p.$elm$, o.$elm$.nextSibling), p = t[++i], d = s[--g];
418
+ else if (Z(o, u, n))
419
+ (p.$tag$ === "slot" || d.$tag$ === "slot") && L(o.$elm$.parentNode, !1), R(o, u, n), T(e, o.$elm$, p.$elm$), o = t[--f], u = s[++a];
289
420
  else {
290
- for (f = -1, c = i; c <= $; ++c)
291
- if (t[c] && t[c].$key$ !== null && t[c].$key$ === a.$key$) {
292
- f = c;
421
+ for (c = -1, l = i; l <= f; ++l)
422
+ if (t[l] && t[l].$key$ !== null && t[l].$key$ === u.$key$) {
423
+ c = l;
293
424
  break;
294
425
  }
295
- f >= 0 ? (y = t[f], y.$tag$ !== a.$tag$ ? m = D(t && t[o], s, f) : (T(y, a, n), t[f] = void 0, m = y.$elm$), a = r[++o]) : (m = D(t && t[o], s, o), a = r[++o]), m && k(
296
- j(u.$elm$).parentNode,
297
- m,
298
- j(u.$elm$)
426
+ c >= 0 ? (_ = t[c], _.$tag$ !== u.$tag$ ? h = W(t && t[a], r, c) : (R(_, u, n), t[c] = void 0, h = _.$elm$), u = s[++a]) : (h = W(t && t[a], r, a), u = s[++a]), h && T(
427
+ F(p.$elm$).parentNode,
428
+ h,
429
+ F(p.$elm$)
299
430
  );
300
431
  }
301
- i > $ ? le(
432
+ i > f ? Ae(
302
433
  e,
303
- r[d + 1] == null ? null : r[d + 1].$elm$,
304
- s,
434
+ s[g + 1] == null ? null : s[g + 1].$elm$,
305
435
  r,
306
- o,
307
- d
308
- ) : o > d && ae(t, i, $);
309
- }, L = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? (s && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, j = (e) => e && e["s-ol"] || e, T = (e, t, s = !1) => {
310
- const r = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$, o = t.$tag$, f = t.$text$;
311
- let c;
312
- f === null ? (v = o === "svg" ? !0 : o === "foreignObject" ? !1 : v, o === "slot" && !F || oe(e, t, v), n !== null && i !== null ? He(r, n, t, i, s) : i !== null ? (e.$text$ !== null && (r.textContent = ""), le(r, null, t, i, 0, i.length - 1)) : (
436
+ s,
437
+ a,
438
+ g
439
+ ) : a > g && ke(t, i, f);
440
+ }, Z = (e, t, r = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : r ? (r && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, F = (e) => e && e["s-ol"] || e, R = (e, t, r = !1) => {
441
+ const s = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$, a = t.$tag$, c = t.$text$;
442
+ let l;
443
+ c === null ? (b = a === "svg" ? !0 : a === "foreignObject" ? !1 : b, te(e, t, b), n !== null && i !== null ? lt(s, n, t, i, r) : i !== null ? (e.$text$ !== null && (s.textContent = ""), Ae(s, null, t, i, 0, i.length - 1)) : (
313
444
  // don't do this on initial render as it can cause non-hydrated content to be removed
314
- !s && C.updatable && n !== null && ae(n, 0, n.length - 1)
315
- ), v && o === "svg" && (v = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = f : e.$text$ !== f && (r.data = f);
316
- }, b = [], ce = (e) => {
317
- let t, s, r;
445
+ !r && K.updatable && n !== null && ke(n, 0, n.length - 1)
446
+ ), b && a === "svg" && (b = !1)) : (l = s["s-cr"]) ? l.parentNode.textContent = c : e.$text$ !== c && (s.data = c);
447
+ }, x = [], Te = (e) => {
448
+ let t, r, s;
318
449
  const n = e.__childNodes || e.childNodes;
319
450
  for (const i of n) {
320
451
  if (i["s-sr"] && (t = i["s-cr"]) && t.parentNode) {
321
- s = t.parentNode.__childNodes || t.parentNode.childNodes;
322
- const o = i["s-sn"];
323
- for (r = s.length - 1; r >= 0; r--)
324
- if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== i["s-hn"])
325
- if (Z(t, o)) {
326
- let f = b.find((c) => c.$nodeToRelocate$ === t);
327
- H = !0, t["s-sn"] = t["s-sn"] || o, f ? (f.$nodeToRelocate$["s-sh"] = i["s-hn"], f.$slotRefNode$ = i) : (t["s-sh"] = i["s-hn"], b.push({
452
+ r = t.parentNode.__childNodes || t.parentNode.childNodes;
453
+ const a = i["s-sn"];
454
+ for (s = r.length - 1; s >= 0; s--)
455
+ if (t = r[s], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== i["s-hn"])
456
+ if ($e(t, a)) {
457
+ let c = x.find((l) => l.$nodeToRelocate$ === t);
458
+ G = !0, t["s-sn"] = t["s-sn"] || a, c ? (c.$nodeToRelocate$["s-sh"] = i["s-hn"], c.$slotRefNode$ = i) : (t["s-sh"] = i["s-hn"], x.push({
328
459
  $slotRefNode$: i,
329
460
  $nodeToRelocate$: t
330
- })), t["s-sr"] && b.map((c) => {
331
- Z(c.$nodeToRelocate$, t["s-sn"]) && (f = b.find(($) => $.$nodeToRelocate$ === t), f && !c.$slotRefNode$ && (c.$slotRefNode$ = f.$slotRefNode$));
461
+ })), t["s-sr"] && x.map((l) => {
462
+ $e(l.$nodeToRelocate$, t["s-sn"]) && (c = x.find((f) => f.$nodeToRelocate$ === t), c && !l.$slotRefNode$ && (l.$slotRefNode$ = c.$slotRefNode$));
332
463
  });
333
- } else b.some((f) => f.$nodeToRelocate$ === t) || b.push({
464
+ } else x.some((c) => c.$nodeToRelocate$ === t) || x.push({
334
465
  $nodeToRelocate$: t
335
466
  });
336
467
  }
337
- i.nodeType === 1 && ce(i);
468
+ i.nodeType === 1 && Te(i);
338
469
  }
339
- }, fe = (e) => {
340
- e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(fe);
341
- }, k = (e, t, s) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] && $e(t["s-cr"], t, e, t.parentElement), e == null ? void 0 : e.insertBefore(t, s));
342
- function $e(e, t, s, r) {
343
- var n;
344
- let i;
345
- if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (i = t["s-si"] || e.parentNode["s-sc"])) {
346
- const o = t["s-sn"], f = t["s-hn"];
347
- if ((n = s.classList) == null || n.add(i + "-s"), r && r.classList.contains(i + "-s")) {
348
- let c = (r.__childNodes || r.childNodes)[0], $ = !1;
349
- for (; c; ) {
350
- if (c["s-sn"] !== o && c["s-hn"] === f && c["s-sr"]) {
351
- $ = !0;
470
+ }, je = (e) => {
471
+ e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(je);
472
+ }, T = (e, t, r) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] && Re(t["s-cr"], t, e, t.parentElement), e == null ? void 0 : e.insertBefore(t, r));
473
+ function Re(e, t, r, s) {
474
+ var n, i;
475
+ let a;
476
+ if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (a = t["s-si"] || e.parentNode["s-sc"])) {
477
+ const c = t["s-sn"], l = t["s-hn"];
478
+ if ((n = r.classList) == null || n.add(a + "-s"), s && ((i = s.classList) != null && i.contains(a + "-s"))) {
479
+ let f = (s.__childNodes || s.childNodes)[0], p = !1;
480
+ for (; f; ) {
481
+ if (f["s-sn"] !== c && f["s-hn"] === l && f["s-sr"]) {
482
+ p = !0;
352
483
  break;
353
484
  }
354
- c = c.nextSibling;
485
+ f = f.nextSibling;
355
486
  }
356
- $ || r.classList.remove(i + "-s");
487
+ p || s.classList.remove(a + "-s");
357
488
  }
358
489
  }
359
490
  }
360
- var De = (e, t, s = !1) => {
361
- var r, n, i, o, f;
362
- const c = e.$hostElement$, $ = e.$cmpMeta$, u = e.$vnode$ || w(null, null), l = Me(t) ? t : Le(null, null, t);
363
- if (E = c.tagName, $.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, $.$attrsToReflect$.map(
364
- ([d, a]) => l.$attrs$[a] = c[d]
365
- )), s && l.$attrs$)
366
- for (const d of Object.keys(l.$attrs$))
367
- c.hasAttribute(d) && !["key", "ref", "style", "class"].includes(d) && (l.$attrs$[d] = c[d]);
368
- l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = u.$elm$ = c.shadowRoot || c, M = c["s-sc"], F = ($.$flags$ & 1) !== 0, N = c["s-cr"], H = !1, T(u, l, s);
491
+ var ct = (e, t, r = !1) => {
492
+ var s, n, i, a, c;
493
+ const l = e.$hostElement$, f = e.$cmpMeta$, p = e.$vnode$ || ee(null, null), o = it(t) ? t : st(null, null, t);
494
+ if (I = l.tagName, f.$attrsToReflect$ && (o.$attrs$ = o.$attrs$ || {}, f.$attrsToReflect$.map(
495
+ ([g, u]) => o.$attrs$[u] = l[g]
496
+ )), r && o.$attrs$)
497
+ for (const g of Object.keys(o.$attrs$))
498
+ l.hasAttribute(g) && !["key", "ref", "style", "class"].includes(g) && (o.$attrs$[g] = l[g]);
499
+ o.$tag$ = null, o.$flags$ |= 4, e.$vnode$ = o, o.$elm$ = p.$elm$ = l.shadowRoot || l, D = l["s-sc"], re = !!(f.$flags$ & 1) && !(f.$flags$ & 128), B = l["s-cr"], G = !1, R(p, o, r);
369
500
  {
370
- if (_.$flags$ |= 1, I) {
371
- ce(l.$elm$);
372
- for (const d of b) {
373
- const a = d.$nodeToRelocate$;
374
- if (!a["s-ol"]) {
375
- const g = R.createTextNode("");
376
- g["s-nr"] = a, k(a.parentNode, a["s-ol"] = g, a);
501
+ if (z.$flags$ |= 1, oe) {
502
+ Te(o.$elm$);
503
+ for (const g of x) {
504
+ const u = g.$nodeToRelocate$;
505
+ if (!u["s-ol"] && O.document) {
506
+ const d = O.document.createTextNode("");
507
+ d["s-nr"] = u, T(u.parentNode, u["s-ol"] = d, u);
377
508
  }
378
509
  }
379
- for (const d of b) {
380
- const a = d.$nodeToRelocate$, g = d.$slotRefNode$;
381
- if (g) {
382
- const m = g.parentNode;
383
- let y = g.nextSibling;
510
+ for (const g of x) {
511
+ const u = g.$nodeToRelocate$, d = g.$slotRefNode$;
512
+ if (d) {
513
+ const h = d.parentNode;
514
+ let _ = d.nextSibling;
384
515
  {
385
- let O = (r = a["s-ol"]) == null ? void 0 : r.previousSibling;
386
- for (; O; ) {
387
- let h = (n = O["s-nr"]) != null ? n : null;
388
- if (h && h["s-sn"] === a["s-sn"] && m === (h.__parentNode || h.parentNode)) {
389
- for (h = h.nextSibling; h === a || h != null && h["s-sr"]; )
390
- h = h == null ? void 0 : h.nextSibling;
391
- if (!h || !h["s-nr"]) {
392
- y = h;
516
+ let E = (s = u["s-ol"]) == null ? void 0 : s.previousSibling;
517
+ for (; E; ) {
518
+ let y = (n = E["s-nr"]) != null ? n : null;
519
+ if (y && y["s-sn"] === u["s-sn"] && h === (y.__parentNode || y.parentNode)) {
520
+ for (y = y.nextSibling; y === u || y != null && y["s-sr"]; )
521
+ y = y == null ? void 0 : y.nextSibling;
522
+ if (!y || !y["s-nr"]) {
523
+ _ = y;
393
524
  break;
394
525
  }
395
526
  }
396
- O = O.previousSibling;
527
+ E = E.previousSibling;
397
528
  }
398
529
  }
399
- const ge = a.__parentNode || a.parentNode, pe = a.__nextSibling || a.nextSibling;
400
- (!y && m !== ge || pe !== y) && a !== y && (!a["s-hn"] && a["s-ol"] && (a["s-hn"] = a["s-ol"].parentNode.nodeName), k(m, a, y), a.nodeType === 1 && a.tagName !== "SLOT-FB" && (a.hidden = (i = a["s-ih"]) != null ? i : !1)), a && typeof g["s-rf"] == "function" && g["s-rf"](a);
530
+ const C = u.__parentNode || u.parentNode, P = u.__nextSibling || u.nextSibling;
531
+ (!_ && h !== C || P !== _) && u !== _ && (!u["s-hn"] && u["s-ol"] && (u["s-hn"] = u["s-ol"].parentNode.nodeName), T(h, u, _), u.nodeType === 1 && u.tagName !== "SLOT-FB" && (u.hidden = (i = u["s-ih"]) != null ? i : !1)), u && typeof d["s-rf"] == "function" && d["s-rf"](d);
401
532
  } else
402
- a.nodeType === 1 && (s && (a["s-ih"] = (o = a.hidden) != null ? o : !1), a.hidden = !0);
533
+ u.nodeType === 1 && (r && (u["s-ih"] = (a = u.hidden) != null ? a : !1), u.hidden = !0);
403
534
  }
404
535
  }
405
- H && re(l.$elm$), _.$flags$ &= -2, b.length = 0;
536
+ G && Se(o.$elm$), z.$flags$ &= -2, x.length = 0;
406
537
  }
407
- if (C.experimentalScopedSlotChanges && $.$flags$ & 2) {
408
- const d = l.$elm$.__childNodes || l.$elm$.childNodes;
409
- for (const a of d)
410
- a["s-hn"] !== E && !a["s-sh"] && (s && a["s-ih"] == null && (a["s-ih"] = (f = a.hidden) != null ? f : !1), a.hidden = !0);
538
+ if (K.experimentalScopedSlotChanges && f.$flags$ & 2) {
539
+ const g = o.$elm$.__childNodes || o.$elm$.childNodes;
540
+ for (const u of g)
541
+ u["s-hn"] !== I && !u["s-sh"] && (r && u["s-ih"] == null && (u["s-ih"] = (c = u.hidden) != null ? c : !1), u.hidden = !0);
411
542
  }
412
- N = void 0;
543
+ B = void 0;
413
544
  };
414
- const Ue = (e, t, s) => {
415
- [null, void 0, "", !1].includes(s) || ["innerHTML", "style"].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof s) ? "/!\\ Object props are not rendered in the code example" : s);
416
- }, ue = (e, t, s, r, n) => {
545
+ const q = {
546
+ content_wrap: 0,
547
+ ignore: [],
548
+ ignore_with: "_!i-£___£%_",
549
+ strict: !1,
550
+ tab_size: 2,
551
+ tag_wrap: 0,
552
+ tag_wrap_width: 80,
553
+ trim: []
554
+ }, m = "__!i-£___£%__", w = "!i-£___£%_", Ne = [
555
+ "area",
556
+ "base",
557
+ "br",
558
+ "col",
559
+ "embed",
560
+ "hr",
561
+ "img",
562
+ "input",
563
+ "link",
564
+ "meta",
565
+ "param",
566
+ "source",
567
+ "track",
568
+ "wbr"
569
+ ], le = (e) => /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e), ze = (e, t) => {
570
+ if (!e || !t)
571
+ throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
572
+ let r;
573
+ if (Array.isArray(e))
574
+ r = structuredClone(e).concat(t);
575
+ else if (typeof e == "object") {
576
+ r = { ...e };
577
+ for (let s of Object.keys(t))
578
+ typeof t[s] != "object" ? r[s] = t[s] : r[s] = ze(r[s] || {}, t[s]);
579
+ }
580
+ return r;
581
+ }, ft = (e, t) => ze(structuredClone(e), t), ut = (e) => (e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (t, r) => t.replace(r, (s) => s.replace(/\n/g, w + "nl!").replace(/\r/g, w + "cr!").replace(/\s/g, w + "ws!"))), e), pt = (e) => e.replace(/\n/g, m + "nl!").replace(/\r/g, m + "cr!").replace(/\s/g, m + "ws!"), gt = (e) => {
582
+ const t = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g;
583
+ return e.replace(t, (r, s, n, i, a) => {
584
+ const c = n || a;
585
+ if (!c)
586
+ return r;
587
+ const l = c.replace(/\n/g, m + "nl!").replace(/\r/g, m + "cr!").replace(/\s/g, m + "ws!");
588
+ return r.replace(c, l);
589
+ });
590
+ }, $t = (e) => {
591
+ const t = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g;
592
+ return e = e.replace(t, (r, s, n) => r.replace(n, (i) => i.replace(/</g, w + "lt!").replace(/>/g, w + "gt!"))), e;
593
+ }, dt = (e, t) => {
594
+ const r = t.ignore, s = t.ignore_with;
595
+ for (let n = 0; n < r.length; n++) {
596
+ const i = new RegExp(`<${r[n]}[^>]*>((.|
597
+ )*?)</${r[n]}>`, "g");
598
+ e = e.replace(i, (a, c) => a.replace(c, (l) => l.replace(/</g, "-" + s + "lt-").replace(/>/g, "-" + s + "gt-").replace(/\n/g, "-" + s + "nl-").replace(/\r/g, "-" + s + "cr-").replace(/\s/g, "-" + s + "ws-")));
599
+ }
600
+ return e;
601
+ }, yt = (e, t) => {
602
+ for (let r = 0; r < t.length; r++) {
603
+ const s = new RegExp(`(<${t[r]}[^>]*>)\\s+`, "g"), n = new RegExp(`\\s+(</${t[r]}>)`, "g");
604
+ e = e.replace(s, "$1").replace(n, "$1");
605
+ }
606
+ return e;
607
+ }, ht = (e) => (e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (t, r) => t.replace(r, (s) => s.replace(new RegExp(w + "nl!", "g"), `
608
+ `).replace(new RegExp(w + "cr!", "g"), "\r").replace(new RegExp(w + "ws!", "g"), " "))), e), bt = (e) => (e = e.replace(/.*__!i-£___£%__[a-z]{2}!.*/g, (t) => t.replace(/__!i-£___£%__[a-z]{2}!/g, (r) => r.replace(new RegExp(m + "nl!", "g"), `
609
+ `).replace(new RegExp(m + "cr!", "g"), "\r").replace(new RegExp(m + "ws!", "g"), " "))), e), _t = (e) => (e = e.replace(/<[\w:\-]+([^>]*)>/g, (t, r) => t.replace(r, (s) => s.replace(new RegExp(w + "lt!", "g"), "<").replace(new RegExp(w + "gt!", "g"), ">"))), e), vt = (e, t) => {
610
+ const r = t.ignore, s = t.ignore_with;
611
+ for (let n = 0; n < r.length; n++) {
612
+ const i = new RegExp(`<${r[n]}[^>]*>((.|
613
+ )*?)</${r[n]}>`, "g");
614
+ e = e.replace(i, (a, c) => a.replace(c, (l) => l.replace(new RegExp("-" + s + "lt-", "g"), "<").replace(new RegExp("-" + s + "gt-", "g"), ">").replace(new RegExp("-" + s + "nl-", "g"), `
615
+ `).replace(new RegExp("-" + s + "cr-", "g"), "\r").replace(new RegExp("-" + s + "ws-", "g"), " ")));
616
+ }
617
+ return e;
618
+ }, wt = (e) => {
619
+ var s, n;
620
+ if (typeof e != "object") throw new Error("Config must be an object.");
621
+ if (!(Object.hasOwn(e, "content_wrap") || Object.hasOwn(e, "ignore") || Object.hasOwn(e, "ignore_with") || Object.hasOwn(e, "strict") || Object.hasOwn(e, "tab_size") || Object.hasOwn(e, "tag_wrap") || Object.hasOwn(e, "tag_wrap_width") || Object.hasOwn(e, "trim"))) return q;
622
+ let r = e.tab_size;
623
+ if (r) {
624
+ if (typeof r != "number") throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);
625
+ if (!Number.isSafeInteger(r)) throw new Error(`Tab size ${r} is not safe. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger for more info.`);
626
+ if (r = Math.floor(r), r < 1 || r > 16) throw new Error("Tab size out of range. Expecting 1 to 16.");
627
+ e.tab_size = r;
628
+ }
629
+ if (Object.hasOwn(e, "content_wrap") && typeof e.content_wrap != "number")
630
+ throw new Error(`content_wrap config must be a number, not ${typeof e.tag_wrap_width}.`);
631
+ if (Object.hasOwn(e, "ignore") && (!Array.isArray(e.ignore) || !((s = e.ignore) != null && s.every((i) => typeof i == "string"))))
632
+ throw new Error("Ignore config must be an array of strings.");
633
+ if (Object.hasOwn(e, "ignore_with") && typeof e.ignore_with != "string")
634
+ throw new Error(`Ignore_with config must be a string, not ${typeof e.ignore_with}.`);
635
+ if (Object.hasOwn(e, "strict") && typeof e.strict != "boolean")
636
+ throw new Error(`Strict config must be a boolean, not ${typeof e.strict}.`);
637
+ if (Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap == "boolean" && (console.warn("tag_wrap as a boolean is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."), e.tag_wrap_width ? e.tag_wrap = e.tag_wrap_width : e.tag_wrap = q.tag_wrap_width), Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap != "number")
638
+ throw new Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);
639
+ if (Object.hasOwn(e, "tag_wrap_width") && console.warn("tag_wrap_width is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."), Object.hasOwn(e, "tag_wrap_width") && typeof e.tag_wrap_width != "number")
640
+ throw new Error(`tag_wrap_width config must be a number, not ${typeof e.tag_wrap_width}.`);
641
+ if (Object.hasOwn(e, "trim") && (!Array.isArray(e.trim) || !((n = e.trim) != null && n.every((i) => typeof i == "string"))))
642
+ throw new Error("Trim config must be an array of strings.");
643
+ return ft(q, e);
644
+ }, xt = (e, t, r) => {
645
+ const s = e.split(/\s+/);
646
+ if (s.length === 0)
647
+ return "";
648
+ const n = [];
649
+ let i = "", a = !0;
650
+ s.forEach((l) => {
651
+ if (l !== "")
652
+ if (i === "")
653
+ i = l;
654
+ else if (l.length >= t)
655
+ a ? (n.push(i.padStart(i.length)), n.push(l.padStart(l.length)), a = !1) : (n.push(i.padStart(i.length + r)), n.push(l.padStart(l.length + r)));
656
+ else {
657
+ const f = i + " " + l;
658
+ f.length <= t ? i = f : (a ? (n.push(i.padStart(i.length)), a = !1) : n.push(i.padStart(i.length + r)), i = l);
659
+ }
660
+ }), i !== "" && n.push(i.padStart(i.length + r));
661
+ const c = n.join(`
662
+ `);
663
+ return pt(c);
664
+ }, mt = (e, t = !0) => t && !le(e) ? e : e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g, (r, s) => Ne.indexOf(s) > -1 ? `${r.substring(0, r.length - 1)} />`.replace(/\/\s\//g, "/") : r.replace(/[\s]?\/>/g, `></${s}>`)), St = (e, t = !1) => (e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (r, s) => r.replace(s, (n) => n.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\n/g, "&#10;").replace(/\r/g, "&#13;").replace(/\s/g, "&nbsp;"))), t && (e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (r, s) => (r = r.replace(s, (n) => n.replace(/\n|\t/g, "").replace(/[a-z]+="\s*"/ig, "").replace(/>\s+</g, "><").replace(/\s+/g, " ")), r = r.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/class=["']\s/g, (n) => n.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"), r))), e), Et = (e, t = !0) => t && !le(e) ? e : (e = St(e), e.replace(/\n|\t/g, "").replace(/>\s+</g, "><").replace(/\s+/g, " ").replace(/(.+=)"\s+"/ig, '$1""').replace(/(.+=)'\s+'/ig, "$1''").replace(/\s>/g, ">").replace(/<\s\//g, "</").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/class=["']\s/g, (r) => r.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"));
665
+ let H, se;
666
+ const A = {
667
+ line: []
668
+ }, Ot = (e) => {
669
+ A.line = [];
670
+ let t = -1;
671
+ const r = /(<[^>]+>)|([^<]+)/g;
672
+ return e = e.replace(r, (s, n, i) => (n ? A.line.push({ type: "tag", value: s }) : i && i.trim().length > 0 && A.line.push({ type: "text", value: s }), t++, `
673
+ [#-# : ${t} : ${s} : #-#]
674
+ `)), e;
675
+ }, At = (e) => (e = mt(e, !1), se.length > 0 && (e = yt(e, se)), e = Et(e, !1), e = Ot(e), e), kt = (e, t) => {
676
+ const r = t.tab_size, s = t.tag_wrap, n = t.content_wrap;
677
+ let i = "";
678
+ A.line.forEach((l, f) => {
679
+ e = e.replace(/\n+/g, `
680
+ `).replace(`[#-# : ${f} : ${l.value} : #-#]`, (p) => {
681
+ var _, C, P;
682
+ let o = 0;
683
+ const g = `[#-# : ${f - 1} : ${(_ = A.line[f - 1]) == null ? void 0 : _.value} : #-#]`, u = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g;
684
+ i += "0", f === 0 && o++, p.indexOf(`#-# : ${f} : </`) > -1 && o++, g.indexOf("<!doctype") > -1 && o++, g.indexOf("<!--") > -1 && o++, g.indexOf("/> : #-#") > -1 && o++, g.indexOf(`#-# : ${f - 1} : </`) > -1 && o++, ((C = A.line[f - 1]) == null ? void 0 : C.type) === "text" && o++;
685
+ const d = i.length - o;
686
+ if (i = i.substring(0, d), H && p.indexOf("<!--") > -1) return "";
687
+ let h = p.replace(`[#-# : ${f} : `, "").replace(" : #-#]", "");
688
+ if (((P = A.line[f]) == null ? void 0 : P.type) === "text" && n > 0 && h.length >= n && (h = xt(h, n, r * d)), s > 0 && l.value.length > s && u.test(l.value)) {
689
+ const E = /\s{1}[A-Za-z-]+(?:=".*?")?/g, y = l.value.split(E).filter(Boolean), Fe = l.value.matchAll(E), Y = r * d, Me = Y + r;
690
+ let Q = y[0].padStart(y[0].length + Y) + `
691
+ `;
692
+ for (const ce of Fe) {
693
+ const Pe = ce[0].trim().padStart(ce[0].trim().length + Me) + `
694
+ `;
695
+ Q += Pe;
696
+ }
697
+ const Ce = y[1].padStart(
698
+ y[1].trim().length + Y + (H && Ne.includes(y[0].slice(1)) ? 1 : 0)
699
+ );
700
+ return Q += Ce, Q;
701
+ } else
702
+ return h.padStart(h.length + r * d);
703
+ });
704
+ }), s > 0 && (e = ut(e)), n > 0 && /\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n/.test(e) && (e = gt(e)), e = e.replace(
705
+ /<(?<Element>.+).*>[^<]*?[^><\/\s][^<]*?<\/{1}\k<Element>|<script[^>]*>\s+<\/script>|<(\w+)>\s+<\/(\w+)|<(?:([\w:\._-]+)|([\w:\._-]+)[^>]*[^\/])>\s+<\/([\w:\._-]+)>/g,
706
+ (l) => l.replace(/\n|\t|\s{2,}/g, "")
707
+ ), n > 0 && (e = bt(e)), s > 0 && (e = ht(e)), H && (e = e.replace(/\s\/>|\/>/g, ">"));
708
+ const a = e.substring(0, 1), c = e.substring(e.length - 1);
709
+ return a === `
710
+ ` && (e = e.substring(1, e.length)), c === `
711
+ ` && (e = e.substring(0, e.length - 1)), e;
712
+ }, Tt = (e, t) => {
713
+ if (!le(e)) return e;
714
+ const r = t ? wt(t) : q;
715
+ H = r.strict;
716
+ const s = r.ignore.length > 0;
717
+ return se = r.trim, s && (e = dt(e, r)), e = $t(e), e = At(e), e = kt(e, r), e = _t(e), s && (e = vt(e, r)), e;
718
+ }, jt = (e, t, r) => {
719
+ [null, void 0, "", !1].includes(r) || ["innerHTML", "style", ""].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof r) ? "⚠️ Property must be set through a script or a framework-specific syntax." : r);
720
+ }, Ie = (e, t, r, s, n) => {
417
721
  if (t && typeof t == "string") {
418
722
  const i = document.createElement(t);
419
- Object.keys(s || {}).forEach((o) => {
420
- Ue(i, o, s[o]);
421
- }), r == null || r.forEach((o) => {
422
- ue(i, o.$tag$, o.$attrs$, o.$children$, o.$text$);
423
- }), s != null && s.innerHTML && (i.innerHTML = s.innerHTML), e.appendChild(i);
723
+ Object.keys(r || {}).forEach((a) => {
724
+ jt(i, a, r[a]);
725
+ }), s == null || s.forEach((a) => {
726
+ Ie(i, a.$tag$, a.$attrs$, a.$children$, a.$text$);
727
+ }), r != null && r.innerHTML && (i.innerHTML = r.innerHTML), e.appendChild(i);
424
728
  }
425
729
  n && (e.innerHTML = n);
426
- }, rt = (e, t) => {
730
+ }, Qt = (e, t, r = []) => {
427
731
  const s = {};
428
732
  if (typeof e != "object")
429
733
  throw new Error("filterArgs - args isn't an object.");
430
- for (const r in e)
431
- if (!r.startsWith("slot")) {
432
- const n = e[r], i = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
433
- (!t || !Object.keys(t).includes(r) || t[r] !== n) && (s[i] = n);
734
+ for (const n in e)
735
+ if (!r.includes(n)) {
736
+ const i = e[n], a = n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
737
+ (!t || !Object.keys(t).includes(n) || t[n] !== i) && (s[a] = i);
434
738
  }
435
739
  return s;
436
- }, nt = (e, t) => {
437
- var r, n;
438
- const s = document.getElementById("storybook-root");
439
- if (s !== null)
440
- return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), De(
740
+ }, Vt = (e, t) => {
741
+ var s, n;
742
+ const r = document.getElementById("storybook-root");
743
+ if (r !== null)
744
+ return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((s = t.globals) == null ? void 0 : s.locale) || "en"), ct(
441
745
  {
442
746
  $cmpMeta$: {
443
747
  $flags$: 0,
444
- $tagName$: s.tagName
748
+ $tagName$: r.tagName
445
749
  },
446
- $hostElement$: s
750
+ $hostElement$: r
447
751
  },
448
752
  e(t)
449
- ), s.children[s.children.length - 1];
450
- }, it = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
753
+ ), r.children[r.children.length - 1];
754
+ }, er = ({ $tag$: e, $attrs$: t, $children$: r, $text$: s }) => {
451
755
  const n = document.createElement("div");
452
- return ue(n, e, t, s, r), n.innerHTML;
453
- }, U = (e, t) => {
756
+ return Ie(n, e, t, r, s), Tt(n.innerHTML, {
757
+ tag_wrap: 40,
758
+ content_wrap: 120
759
+ }).replace(/="true"/g, "");
760
+ }, J = (e, t) => {
454
761
  if (!t)
455
762
  return;
456
- const s = t.split("/");
457
- return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
763
+ const r = t.split("/");
764
+ return `${e}${r.slice(2, r.length - 1).join("-")}--docs`;
458
765
  };
459
- var S, q;
460
- class ot {
766
+ var k, X;
767
+ class tr {
461
768
  constructor(t) {
462
769
  /**
463
770
  * JsonDocs
464
771
  */
465
- p(this, "jsonDoc");
772
+ $(this, "jsonDoc");
466
773
  /**
467
774
  * Get component data from the jsonDoc
468
775
  * @param tagName - tag name we want to get the data from
469
776
  * @returns component data
470
777
  */
471
- B(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
778
+ j(this, k, (t) => this.jsonDoc.components.find((r) => r.tag === t));
472
779
  /**
473
780
  * Get the control for the given prop
474
781
  * Based on https://storybook.js.org/docs/api/arg-types#controltype
475
782
  * @param prop - prop to get control for
476
783
  * @returns control type and options if applicable
477
784
  */
478
- B(this, q, (t) => {
479
- const s = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (r) => r.replace(/\|/g, " OR ")).split("|").map((r) => r.trim().replace(/ OR /g, "|"));
480
- return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((r) => r == null ? void 0 : r.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
785
+ j(this, X, (t) => {
786
+ const r = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (s) => s.replace(/\|/g, " OR ")).split("|").map((s) => s.trim().replace(/ OR /g, "|"));
787
+ return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : r.length > 1 ? r.includes("string") ? { control: { type: "text" } } : r.every((s) => s == null ? void 0 : s.includes("[]")) ? { control: { type: "object" } } : (r.unshift(void 0), { control: { type: "select" }, options: r }) : { control: { type: "object" } };
481
788
  });
482
789
  /**
483
790
  * Extract component arg types from the component data
484
791
  * @param tagName - tag name we want to extract the arg types from
485
792
  * @returns component arg types
486
793
  */
487
- p(this, "extractArgTypes", (t) => {
488
- const s = x(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((u, l) => {
489
- const { control: d, options: a } = x(this, q).call(this, l);
794
+ $(this, "extractArgTypes", (t) => {
795
+ const r = v(this, k).call(this, t), s = r == null ? void 0 : r.props.reduce((p, o) => {
796
+ const { control: g, options: u } = v(this, X).call(this, o);
490
797
  return {
491
- ...u,
492
- [l.name]: {
493
- name: l.attr || l.name,
494
- description: l.docs,
495
- type: { required: l.required },
798
+ ...p,
799
+ [o.name]: {
800
+ name: o.attr || o.name,
801
+ description: o.docs,
802
+ type: { required: o.required },
496
803
  table: {
497
804
  category: "props",
498
- type: { summary: l.type },
499
- defaultValue: { summary: l.default }
805
+ type: { summary: o.type },
806
+ defaultValue: { summary: o.default }
500
807
  },
501
- control: d,
502
- options: a
808
+ control: g,
809
+ options: u
503
810
  }
504
811
  };
505
- }, {}), n = s == null ? void 0 : s.events.reduce(
506
- (u, l) => ({
507
- ...u,
508
- [l.event]: {
509
- name: l.event,
510
- description: l.docs,
812
+ }, {}), n = r == null ? void 0 : r.events.reduce(
813
+ (p, o) => ({
814
+ ...p,
815
+ [o.event]: {
816
+ name: o.event,
817
+ description: o.docs,
511
818
  table: {
512
819
  category: "events",
513
- type: { summary: l.detail }
820
+ type: { summary: o.detail }
514
821
  }
515
822
  }
516
823
  }),
517
824
  {}
518
- ), i = s == null ? void 0 : s.methods.reduce(
519
- (u, l) => ({
520
- ...u,
521
- [l.name]: {
522
- name: l.name,
523
- description: l.docs,
825
+ ), i = r == null ? void 0 : r.methods.reduce(
826
+ (p, o) => ({
827
+ ...p,
828
+ [o.name]: {
829
+ name: o.name,
830
+ description: o.docs,
524
831
  table: {
525
832
  category: "methods",
526
- type: { summary: l.signature }
833
+ type: { summary: o.signature }
527
834
  }
528
835
  }
529
836
  }),
530
837
  {}
531
- ), o = s == null ? void 0 : s.slots.reduce(
532
- (u, l) => ({
533
- ...u,
534
- [l.name]: {
535
- name: l.name !== "" ? l.name : "default",
838
+ ), a = r == null ? void 0 : r.slots.reduce(
839
+ (p, o) => ({
840
+ ...p,
841
+ [o.name]: {
842
+ name: o.name !== "" ? o.name : "default",
536
843
  // default slot are unnamed
537
- description: l.docs,
844
+ description: o.docs,
538
845
  table: {
539
846
  category: "slots",
540
847
  type: { summary: void 0 }
@@ -542,12 +849,12 @@ class ot {
542
849
  }
543
850
  }),
544
851
  {}
545
- ), f = s == null ? void 0 : s.styles.reduce(
546
- (u, l) => ({
547
- ...u,
548
- [l.name]: {
549
- name: l.name,
550
- description: l.docs,
852
+ ), c = r == null ? void 0 : r.styles.reduce(
853
+ (p, o) => ({
854
+ ...p,
855
+ [o.name]: {
856
+ name: o.name,
857
+ description: o.docs,
551
858
  table: {
552
859
  category: "custom properties",
553
860
  type: { summary: void 0 }
@@ -555,41 +862,41 @@ class ot {
555
862
  }
556
863
  }),
557
864
  {}
558
- ), c = s == null ? void 0 : s.dependencies.reduce((u, l) => {
559
- const d = x(this, S).call(this, l);
560
- return {
561
- ...u,
562
- [l]: {
563
- name: l,
564
- description: `<a href="./?path=/docs/${U("", d == null ? void 0 : d.filePath)}">View Component Documentation</a>`,
865
+ ), l = r == null ? void 0 : r.dependencies.reduce((p, o) => {
866
+ const g = v(this, k).call(this, o);
867
+ return g ? {
868
+ ...p,
869
+ [o]: {
870
+ name: o,
871
+ description: `<a href="./?path=/docs/${J("", g == null ? void 0 : g.filePath)}">View Component Documentation</a>`,
565
872
  table: {
566
873
  category: "depends on",
567
874
  type: { summary: void 0 }
568
875
  }
569
876
  }
570
- };
571
- }, {}), $ = s == null ? void 0 : s.dependents.reduce((u, l) => {
572
- const d = x(this, S).call(this, l);
573
- return {
574
- ...u,
575
- [l]: {
576
- name: l,
577
- description: `<a href="./?path=/docs/${U("", d == null ? void 0 : d.filePath)}">View Component Documentation</a>`,
877
+ } : p;
878
+ }, {}), f = r == null ? void 0 : r.dependents.reduce((p, o) => {
879
+ const g = v(this, k).call(this, o);
880
+ return g ? {
881
+ ...p,
882
+ [o]: {
883
+ name: o,
884
+ description: `<a href="./?path=/docs/${J("", g == null ? void 0 : g.filePath)}">View Component Documentation</a>`,
578
885
  table: {
579
886
  category: "used by",
580
887
  type: { summary: void 0 }
581
888
  }
582
889
  }
583
- };
890
+ } : p;
584
891
  }, {});
585
892
  return {
586
- ...r,
893
+ ...s,
587
894
  ...n,
588
895
  ...i,
589
- ...o,
590
- ...f,
896
+ ...a,
591
897
  ...c,
592
- ...$
898
+ ...l,
899
+ ...f
593
900
  };
594
901
  });
595
902
  /**
@@ -597,29 +904,29 @@ class ot {
597
904
  * @param tagName - tag name we want to extract the description from
598
905
  * @returns component description
599
906
  */
600
- p(this, "extractComponentDescription", (t) => {
601
- const s = x(this, S).call(this, t);
602
- return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);
907
+ $(this, "extractComponentDescription", (t) => {
908
+ const r = v(this, k).call(this, t);
909
+ return (r == null ? void 0 : r.readme) || (r == null ? void 0 : r.docs);
603
910
  });
604
911
  this.jsonDoc = t;
605
912
  }
606
913
  }
607
- S = new WeakMap(), q = new WeakMap();
608
- const qe = (e, t) => {
914
+ k = new WeakMap(), X = new WeakMap();
915
+ const Rt = (e, t) => {
609
916
  if (t)
610
917
  return `${e}${t}`;
611
- }, de = (e) => {
918
+ }, Le = (e) => {
612
919
  let t = e.overview ? `${e.overview}
613
920
 
614
921
  ` : "";
615
- const s = e.props.filter(({ attr: n }) => n !== void 0);
616
- s.length && (t += `Attributes:
617
- `, t += s.map(({ attr: n, docs: i }) => `- \`${n}\`: ${i}
922
+ const r = e.props.filter(({ attr: n }) => n !== void 0);
923
+ r.length && (t += `Attributes:
924
+ `, t += r.map(({ attr: n, docs: i }) => `- \`${n}\`: ${i}
618
925
  `).join(""), t += `
619
926
  `);
620
- const r = e.props.filter(({ attr: n }) => n === void 0);
621
- return r.length && (t += `Properties:
622
- `, t += r.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
927
+ const s = e.props.filter(({ attr: n }) => n === void 0);
928
+ return s.length && (t += `Properties:
929
+ `, t += s.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
623
930
  `).join(""), t += `
624
931
  `), e.methods.length && (t += `Methods:
625
932
  `, t += e.methods.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
@@ -634,74 +941,74 @@ const qe = (e, t) => {
634
941
  `, t += e.slots.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
635
942
  `).join(""), t += `
636
943
  `), t;
637
- }, z = (e) => `${e.docs}
944
+ }, ne = (e) => `${e.docs}
638
945
 
639
- Type: \`${e.type}\``, lt = (e, t, s, r) => ({
946
+ Type: \`${e.type}\``, rr = (e, t, r, s) => ({
640
947
  $schema: "https://json.schemastore.org/web-types",
641
948
  name: e,
642
949
  version: t,
643
950
  "description-markup": "markdown",
644
951
  contributions: {
645
952
  html: {
646
- elements: s.components.map((n) => {
647
- const i = U(r, n.filePath);
953
+ elements: r.components.map((n) => {
954
+ const i = J(s, n.filePath);
648
955
  return {
649
956
  name: n.tag,
650
- description: de(n),
957
+ description: Le(n),
651
958
  "doc-url": i,
652
- attributes: n.props.filter((o) => o.attr).map((o) => ({
653
- name: o.attr,
654
- description: z(o),
959
+ attributes: n.props.filter((a) => a.attr).map((a) => ({
960
+ name: a.attr,
961
+ description: ne(a),
655
962
  "doc-url": i,
656
963
  value: {
657
- type: o.type,
658
- default: o.default,
659
- required: o.required
964
+ type: a.type,
965
+ default: a.default,
966
+ required: a.required
660
967
  }
661
968
  })),
662
969
  js: {
663
- properties: n.props.map((o) => ({
664
- name: o.name,
665
- description: z(o),
970
+ properties: n.props.map((a) => ({
971
+ name: a.name,
972
+ description: ne(a),
666
973
  "doc-url": i,
667
974
  value: {
668
- type: o.type,
669
- default: o.default,
670
- required: o.required
975
+ type: a.type,
976
+ default: a.default,
977
+ required: a.required
671
978
  }
672
979
  })),
673
- events: n.events.map((o) => ({
674
- name: o.event,
675
- description: o.docs
980
+ events: n.events.map((a) => ({
981
+ name: a.event,
982
+ description: a.docs
676
983
  }))
677
984
  },
678
985
  css: {
679
- properties: n.styles.map((o) => ({
680
- name: o.name,
681
- description: o.docs
986
+ properties: n.styles.map((a) => ({
987
+ name: a.name,
988
+ description: a.docs
682
989
  }))
683
990
  }
684
991
  };
685
992
  })
686
993
  }
687
994
  }
688
- }), Ce = (e, t, s) => [
689
- { name: "Storybook", url: U(e, s) },
690
- { name: "Sources", url: qe(t, s) }
691
- ], Be = (e) => {
995
+ }), Nt = (e, t, r) => [
996
+ { name: "Storybook", url: J(e, r) },
997
+ { name: "Sources", url: Rt(t, r) }
998
+ ], zt = (e) => {
692
999
  if (!e.values.some(({ value: t }) => t === void 0))
693
1000
  return e.values.map(({ value: t }) => ({ name: t }));
694
- }, at = (e, t, s) => ({
1001
+ }, sr = (e, t, r) => ({
695
1002
  version: 1.1,
696
- tags: e.components.map((r) => {
697
- const n = Ce(t, s, r.filePath);
1003
+ tags: e.components.map((s) => {
1004
+ const n = Nt(t, r, s.filePath);
698
1005
  return {
699
- name: r.tag,
700
- description: de(r),
701
- attributes: r.props.map((i) => ({
1006
+ name: s.tag,
1007
+ description: Le(s),
1008
+ attributes: s.props.map((i) => ({
702
1009
  name: i.attr || i.name,
703
- description: z(i),
704
- values: Be(i),
1010
+ description: ne(i),
1011
+ values: zt(i),
705
1012
  references: n
706
1013
  })),
707
1014
  references: n
@@ -709,55 +1016,55 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
709
1016
  }),
710
1017
  globalAttributes: [],
711
1018
  valueSets: []
712
- }), ct = (e) => ({
1019
+ }), nr = (e) => ({
713
1020
  version: 1.1,
714
1021
  properties: e.components.flatMap(
715
- (t) => t.styles.map((s) => ({
716
- name: s.name,
717
- description: s.docs
1022
+ (t) => t.styles.map((r) => ({
1023
+ name: r.name,
1024
+ description: r.docs
718
1025
  }))
719
1026
  )
720
- }), ft = (e) => {
721
- const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
722
- return ze([t.value, s.value, r.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
723
- }, $t = (e) => e.toISOString().split("T")[0], Pe = (e, t, s) => {
724
- const r = e.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || s, o = i.split("-").shift();
1027
+ }), ir = (e) => {
1028
+ const t = { value: "2023", pattern: "yyyy" }, r = { value: "12", pattern: "mm" }, s = { value: "24", pattern: "dd" };
1029
+ return Ft([t.value, r.value, s.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(r.value, r.pattern).replace(s.value, s.pattern);
1030
+ }, ar = (e) => e.toISOString().split("T")[0], It = (e, t, r) => {
1031
+ const s = e.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(s == null ? void 0 : s.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || r, a = i.split("-").shift();
725
1032
  return Object.keys(t).length === 0 ? {
726
1033
  locale: i,
727
- messages: { lang: s }
1034
+ messages: { lang: r }
728
1035
  } : {
729
1036
  locale: i,
730
- messages: t[o] || t[s] || { lang: s }
1037
+ messages: t[a] || t[r] || { lang: r }
731
1038
  };
732
- }, ut = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(Number(e)), gt = (e, t, s = 0) => new Intl.NumberFormat(t, {
1039
+ }, or = (e, t, r) => new Intl.NumberFormat(t, { style: "currency", currency: r }).format(e), lr = (e, t, r = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: r }).format(Number(e)), cr = (e, t, r = 0) => new Intl.NumberFormat(t, {
733
1040
  style: "percent",
734
- minimumFractionDigits: s,
735
- maximumFractionDigits: s
736
- }).format(e), pt = (e, t, s, r = "short", n = 0) => new Intl.NumberFormat(t, {
1041
+ minimumFractionDigits: r,
1042
+ maximumFractionDigits: r
1043
+ }).format(e), fr = (e, t, r, s = "short", n = 0) => new Intl.NumberFormat(t, {
737
1044
  style: "unit",
738
- unit: s,
739
- unitDisplay: r,
1045
+ unit: r,
1046
+ unitDisplay: s,
740
1047
  minimumFractionDigits: n,
741
1048
  maximumFractionDigits: n
742
- }).format(e), we = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ze = (e, t, s) => typeof e != "string" || e === "" || !we.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), ht = (e, t) => (s) => Pe(s, e, t), vt = ({ disconnect: e, observe: t, takeRecords: s }) => {
743
- class r {
1049
+ }).format(e), Lt = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Ft = (e, t, r) => typeof e != "string" || e === "" || !Lt.test(e) ? "" : new Intl.DateTimeFormat(t, r).format(new Date(e)), ur = (e, t) => (r) => It(r, e, t), pr = ({ disconnect: e, observe: t, takeRecords: r }) => {
1050
+ class s {
744
1051
  constructor(i) {
745
1052
  /**
746
1053
  *
747
1054
  */
748
- p(this, "disconnect", e);
1055
+ $(this, "disconnect", e);
749
1056
  /**
750
1057
  *
751
1058
  */
752
- p(this, "observe", t);
1059
+ $(this, "observe", t);
753
1060
  /**
754
1061
  *
755
1062
  */
756
- p(this, "takeRecords", s);
1063
+ $(this, "takeRecords", r);
757
1064
  /**
758
1065
  *
759
1066
  */
760
- p(this, "cb");
1067
+ $(this, "cb");
761
1068
  this.cb = i;
762
1069
  }
763
1070
  }
@@ -765,51 +1072,51 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
765
1072
  Object.defineProperty(n, "MutationObserver", {
766
1073
  writable: !0,
767
1074
  configurable: !0,
768
- value: r
1075
+ value: s
769
1076
  });
770
- }), r;
771
- }, yt = ({ disconnect: e, observe: t }) => {
772
- class s {
1077
+ }), s;
1078
+ }, gr = ({ disconnect: e, observe: t }) => {
1079
+ class r {
773
1080
  constructor(n) {
774
1081
  /**
775
1082
  *
776
1083
  */
777
- p(this, "disconnect", e);
1084
+ $(this, "disconnect", e);
778
1085
  /**
779
1086
  *
780
1087
  */
781
- p(this, "observe", t);
1088
+ $(this, "observe", t);
782
1089
  /**
783
1090
  *
784
1091
  */
785
- p(this, "unobserve");
1092
+ $(this, "unobserve");
786
1093
  /**
787
1094
  *
788
1095
  */
789
- p(this, "cb");
1096
+ $(this, "cb");
790
1097
  this.cb = n;
791
1098
  }
792
1099
  }
793
- return [window, global].forEach((r) => {
794
- Object.defineProperty(r, "ResizeObserver", {
1100
+ return [window, global].forEach((s) => {
1101
+ Object.defineProperty(s, "ResizeObserver", {
795
1102
  writable: !0,
796
1103
  configurable: !0,
797
- value: s
1104
+ value: r
798
1105
  });
799
- }), s;
1106
+ }), r;
800
1107
  };
801
- class Ie extends Event {
1108
+ class Mt extends Event {
802
1109
  constructor() {
803
1110
  super(...arguments);
804
1111
  /**
805
1112
  *
806
1113
  */
807
- p(this, "detail");
1114
+ $(this, "detail");
808
1115
  }
809
1116
  // eslint-disable-line @typescript-eslint/no-explicit-any
810
1117
  }
811
- const mt = () => {
812
- class e extends Ie {
1118
+ const $r = () => {
1119
+ class e extends Mt {
813
1120
  }
814
1121
  return [window, global].forEach((t) => {
815
1122
  Object.defineProperty(t, "SubmitEvent", {
@@ -818,10 +1125,10 @@ const mt = () => {
818
1125
  value: e
819
1126
  });
820
1127
  }), e;
821
- }, bt = (e) => {
822
- const t = (s) => (setTimeout(s, 1), e(), 0);
823
- return [window, global].forEach((s) => {
824
- Object.defineProperty(s, "requestAnimationFrame", {
1128
+ }, dr = (e) => {
1129
+ const t = (r) => (setTimeout(r, 1), e(), 0);
1130
+ return [window, global].forEach((r) => {
1131
+ Object.defineProperty(r, "requestAnimationFrame", {
825
1132
  writable: !0,
826
1133
  configurable: !0,
827
1134
  value: t
@@ -829,39 +1136,44 @@ const mt = () => {
829
1136
  }), t;
830
1137
  };
831
1138
  export {
832
- Ze as ClassList,
833
- ot as StorybookPreview,
834
- Je as allItemsAreString,
835
- tt as cleanString,
836
- Ge as createID,
837
- we as dateRegExp,
838
- $t as dateToString,
839
- ht as defineLocales,
840
- rt as filterArgs,
841
- Qe as focusableElements,
842
- ft as getLocaleDatePattern,
843
- Y as getParentWindows,
844
- it as getStoryHTML,
845
- U as getStorybookUrl,
846
- Ye as getWindows,
847
- Ke as isTagName,
848
- et as isValidNumber,
849
- me as isValidString,
850
- Xe as isValideID,
851
- ut as localeCurrency,
852
- ze as localeDate,
853
- dt as localeNumber,
854
- gt as localePercent,
855
- pt as localeUnit,
856
- st as nextTick,
857
- bt as setUpRequestAnimationFrameMock,
858
- vt as setupMutationObserverMock,
859
- yt as setupResizeObserverMock,
860
- mt as setupSubmitEventMock,
861
- nt as stencilWrapper,
862
- Ve as toString,
863
- ct as vsCodeCssGenerator,
864
- at as vsCodeGenerator,
865
- lt as webTypesGenerator
1139
+ Zt as ClassList,
1140
+ Kt as Cursor,
1141
+ He as Page,
1142
+ Yt as Paginate,
1143
+ tr as StorybookPreview,
1144
+ Dt as allItemsAreString,
1145
+ Jt as cleanString,
1146
+ Pt as createID,
1147
+ Lt as dateRegExp,
1148
+ ar as dateToString,
1149
+ ur as defineLocales,
1150
+ Qt as filterArgs,
1151
+ Ht as focusableElements,
1152
+ ir as getLocaleDatePattern,
1153
+ qe as getObjectValueFromKey,
1154
+ _e as getParentWindows,
1155
+ er as getStoryHTML,
1156
+ J as getStorybookUrl,
1157
+ Bt as getWindows,
1158
+ ie as isObject,
1159
+ qt as isTagName,
1160
+ Wt as isValidNumber,
1161
+ De as isValidString,
1162
+ Ut as isValideID,
1163
+ or as localeCurrency,
1164
+ Ft as localeDate,
1165
+ lr as localeNumber,
1166
+ cr as localePercent,
1167
+ fr as localeUnit,
1168
+ Xt as nextTick,
1169
+ dr as setUpRequestAnimationFrameMock,
1170
+ pr as setupMutationObserverMock,
1171
+ gr as setupResizeObserverMock,
1172
+ $r as setupSubmitEventMock,
1173
+ Vt as stencilWrapper,
1174
+ Gt as toString,
1175
+ nr as vsCodeCssGenerator,
1176
+ sr as vsCodeGenerator,
1177
+ rr as webTypesGenerator
866
1178
  };
867
1179
  //# sourceMappingURL=index.es.js.map