@mgdis/stencil-helpers 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,30 +1,34 @@
1
- var $e = Object.defineProperty;
2
- var ue = (e, t, s) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var v = (e, t, s) => ue(e, typeof t != "symbol" ? t + "" : t, s);
4
- const Ce = (e = "", t = 10) => {
1
+ var ve = Object.defineProperty;
2
+ var X = (e) => {
3
+ throw TypeError(e);
4
+ };
5
+ var he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
+ var g = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s), ye = (e, t, s) => t.has(e) || X("Cannot " + s);
7
+ var k = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), P = (e, t, s) => t.has(e) ? X("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
8
+ const ze = (e = "", t = 10) => {
5
9
  const s = new Uint8Array(t);
6
10
  crypto.getRandomValues(s);
7
11
  const r = Array.from(s).map((o) => o.toString(16).padStart(2, "0")).join("").slice(0, t);
8
12
  return e !== "" ? `${e}-${r}` : r;
9
13
  };
10
- class He {
14
+ class Ie {
11
15
  constructor(t = []) {
12
16
  /**
13
17
  * Available classes
14
18
  */
15
- v(this, "classes");
19
+ g(this, "classes");
16
20
  /**
17
21
  * Add class
18
22
  * @param className - class name to add
19
23
  */
20
- v(this, "add", (t) => {
24
+ g(this, "add", (t) => {
21
25
  this.has(t) || this.classes.push(t);
22
26
  });
23
27
  /**
24
28
  * Delete class
25
29
  * @param className - class name to delete
26
30
  */
27
- v(this, "delete", (t) => {
31
+ g(this, "delete", (t) => {
28
32
  const s = this.classes.indexOf(t);
29
33
  s > -1 && this.classes.splice(s, 1);
30
34
  });
@@ -33,146 +37,34 @@ class He {
33
37
  * @param className - class name to check
34
38
  * @returns class name is in the list
35
39
  */
36
- v(this, "has", (t) => this.classes.includes(t));
40
+ g(this, "has", (t) => this.classes.includes(t));
37
41
  /**
38
42
  * Join classes seperated by spaces
39
43
  * @returns joined values
40
44
  */
41
- v(this, "join", () => this.classes.join(" "));
45
+ g(this, "join", () => this.classes.join(" "));
42
46
  this.classes = t;
43
47
  }
44
48
  }
45
- const Pe = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Be = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), We = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', ze = (e) => {
46
- const t = Q(e), s = Z(e);
49
+ const Ge = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Xe = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Ke = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Qe = (e) => {
50
+ const t = te(e), s = se(e);
47
51
  return [e, ...t, ...s];
48
- }, Q = (e, t = []) => {
52
+ }, te = (e, t = []) => {
49
53
  if (e.self !== e.top)
50
54
  try {
51
55
  const s = e.parent;
52
- return s ? (t.push(s), Q(s, t)) : t;
56
+ return s ? (t.push(s), te(s, t)) : t;
53
57
  } catch (s) {
54
58
  return console.error("Different hosts between iframes:", s), t;
55
59
  }
56
60
  return t;
57
- }, Z = (e, t = []) => {
61
+ }, se = (e, t = []) => {
58
62
  if (e.frames.length > 0)
59
63
  for (const s of Array.from(e.frames))
60
- t.push(s), Z(s, t);
64
+ t.push(s), se(s, t);
61
65
  return t;
62
- }, Ie = (e) => typeof e == "string" && e.trim() !== "", qe = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Ge = async (e) => e(), J = (e, t) => {
63
- if (!t)
64
- return;
65
- const s = t.split("/");
66
- return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
67
- }, de = (e, t) => {
68
- if (t)
69
- return `${e}${t}`;
70
- }, Y = (e) => {
71
- let t = e.overview ? `${e.overview}
72
-
73
- ` : "";
74
- const s = e.props.filter(({ attr: o }) => o !== void 0);
75
- s.length && (t += `Attributes:
76
- `, t += s.map(({ attr: o, docs: l }) => `- \`${o}\`: ${l}
77
- `).join(""), t += `
78
- `);
79
- const r = e.props.filter(({ attr: o }) => o === void 0);
80
- return r.length && (t += `Properties:
81
- `, t += r.map(({ name: o, docs: l }) => `- \`${o}\`: ${l}
82
- `).join(""), t += `
83
- `), e.methods.length && (t += `Methods:
84
- `, t += e.methods.map(({ name: o, docs: l }) => `- \`${o}\`: ${l}
85
- `).join(""), t += `
86
- `), e.events.length && (t += `Events:
87
- `, t += e.events.map(({ event: o, docs: l }) => `- \`${o}\`: ${l}
88
- `).join(""), t += `
89
- `), e.listeners.length && (t += `Listeners:
90
- `, t += e.listeners.map(({ event: o }) => `- \`${o}\`
91
- `).join(""), t += `
92
- `), e.slots.length && (t += `Slots:
93
- `, t += e.slots.map(({ name: o, docs: l }) => `- \`${o}\`: ${l}
94
- `).join(""), t += `
95
- `), t;
96
- }, _ = (e) => `${e.docs}
97
-
98
- Type: \`${e.type}\``, Xe = (e, t, s, r) => ({
99
- $schema: "https://json.schemastore.org/web-types",
100
- name: e,
101
- version: t,
102
- "description-markup": "markdown",
103
- contributions: {
104
- html: {
105
- elements: s.components.map((o) => {
106
- const l = J(r, o.filePath);
107
- return {
108
- name: o.tag,
109
- description: Y(o),
110
- "doc-url": l,
111
- attributes: o.props.filter((n) => n.attr).map((n) => ({
112
- name: n.attr,
113
- description: _(n),
114
- "doc-url": l,
115
- value: {
116
- type: n.type,
117
- default: n.default,
118
- required: n.required
119
- }
120
- })),
121
- js: {
122
- properties: o.props.map((n) => ({
123
- name: n.name,
124
- description: _(n),
125
- "doc-url": l,
126
- value: {
127
- type: n.type,
128
- default: n.default,
129
- required: n.required
130
- }
131
- })),
132
- events: o.events.map((n) => ({
133
- name: n.event,
134
- description: n.docs
135
- }))
136
- }
137
- };
138
- })
139
- }
140
- }
141
- }), pe = (e, t, s) => [
142
- { name: "Storybook", url: J(e, s) },
143
- { name: "Sources", url: de(t, s) }
144
- ], ve = (e) => {
145
- if (!e.values.some(({ value: t }) => t === void 0))
146
- return e.values.map(({ value: t }) => ({ name: t }));
147
- }, Ke = (e, t, s, r) => ({
148
- version: e,
149
- tags: t.components.map((o) => {
150
- const l = pe(s, r, o.filePath);
151
- return {
152
- name: o.tag,
153
- description: Y(o),
154
- attributes: o.props.map((n) => ({
155
- name: n.attr || n.name,
156
- description: _(n),
157
- values: ve(n),
158
- references: l
159
- })),
160
- references: l
161
- };
162
- }),
163
- globalAttributes: [],
164
- valueSets: []
165
- }), Qe = (e) => {
166
- const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
167
- return ye([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);
168
- }, Ze = (e) => e.toISOString().split("T")[0], ge = (e, t, s) => {
169
- const r = e.closest("[lang]"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), l = o.length > 0 && typeof o[0] == "string" ? o[0] : navigator.language || s, n = l.split("-").shift();
170
- return {
171
- locale: l,
172
- messages: t[n] || t[s]
173
- };
174
- }, Je = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), Ye = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), he = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ye = (e, t, s) => typeof e != "string" || e === "" || !he.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), Ve = (e, t) => (s) => ge(s, e, t);
175
- var N = {
66
+ }, Ze = (e) => typeof e == "string" && e.trim() !== "", Je = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Ye = async (e) => e();
67
+ var E = {
176
68
  allRenderFn: !1,
177
69
  cmpDidLoad: !0,
178
70
  cmpDidUnload: !1,
@@ -255,18 +147,18 @@ var N = {
255
147
  devTools: !1,
256
148
  shadowDelegatesFocus: !0,
257
149
  initializeNextTick: !1,
258
- asyncLoading: !1,
150
+ asyncLoading: !0,
259
151
  asyncQueue: !1,
260
152
  transformTagName: !1,
261
153
  attachStyles: !0,
262
154
  // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
263
155
  experimentalSlotFixes: !1
264
- }, be = Object.defineProperty, Se = (e, t) => {
156
+ }, me = Object.defineProperty, be = (e, t) => {
265
157
  for (var s in t)
266
- be(e, s, { get: t[s], enumerable: !0 });
267
- }, W = (e, t) => t in e, z = "http://www.w3.org/1999/xlink", C = typeof window < "u" ? window : {}, j = C.document || { head: {} };
268
- C.HTMLElement;
269
- var x = {
158
+ me(e, s, { get: t[s], enumerable: !0 });
159
+ }, K = (e, t) => t in e, Q = "http://www.w3.org/1999/xlink", q = typeof window < "u" ? window : {}, _ = q.document || { head: {} };
160
+ q.HTMLElement;
161
+ var L = {
270
162
  $flags$: 0,
271
163
  $resourcesUrl$: "",
272
164
  jmp: (e) => e(),
@@ -274,35 +166,35 @@ var x = {
274
166
  ael: (e, t, s, r) => e.addEventListener(t, s, r),
275
167
  rel: (e, t, s, r) => e.removeEventListener(t, s, r),
276
168
  ce: (e, t) => new CustomEvent(e, t)
277
- }, I = {}, me = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml", ke = (e) => e != null, V = (e) => (e = typeof e, e === "object" || e === "function"), xe = {};
278
- Se(xe, {
279
- err: () => ee,
280
- map: () => Ee,
281
- ok: () => F,
282
- unwrap: () => Ae,
169
+ }, Z = {}, Se = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml", ke = (e) => e != null, re = (e) => (e = typeof e, e === "object" || e === "function"), xe = {};
170
+ be(xe, {
171
+ err: () => oe,
172
+ map: () => Ae,
173
+ ok: () => U,
174
+ unwrap: () => Ee,
283
175
  unwrapErr: () => Le
284
176
  });
285
- var F = (e) => ({
177
+ var U = (e) => ({
286
178
  isOk: !0,
287
179
  isErr: !1,
288
180
  value: e
289
- }), ee = (e) => ({
181
+ }), oe = (e) => ({
290
182
  isOk: !1,
291
183
  isErr: !0,
292
184
  value: e
293
185
  });
294
- function Ee(e, t) {
186
+ function Ae(e, t) {
295
187
  if (e.isOk) {
296
188
  const s = t(e.value);
297
- return s instanceof Promise ? s.then((r) => F(r)) : F(s);
189
+ return s instanceof Promise ? s.then((r) => U(r)) : U(s);
298
190
  }
299
191
  if (e.isErr) {
300
192
  const s = e.value;
301
- return ee(s);
193
+ return oe(s);
302
194
  }
303
195
  throw "should never get here";
304
196
  }
305
- var Ae = (e) => {
197
+ var Ee = (e) => {
306
198
  if (e.isOk)
307
199
  return e.value;
308
200
  throw e.value;
@@ -310,16 +202,16 @@ var Ae = (e) => {
310
202
  if (e.isErr)
311
203
  return e.value;
312
204
  throw e.value;
313
- }, Re = (e, t, ...s) => {
314
- let r = null, o = null, l = null, n = !1, i = !1;
315
- const a = [], d = (f) => {
316
- for (let $ = 0; $ < f.length; $++)
317
- r = f[$], Array.isArray(r) ? d(r) : r != null && typeof r != "boolean" && ((n = !V(r)) && (r = String(r)), n && i ? a[a.length - 1].$text$ += r : a.push(n ? U(null, r) : r), i = n);
205
+ }, je = (e, t, ...s) => {
206
+ let r = null, o = null, n = null, l = !1, a = !1;
207
+ const c = [], d = (i) => {
208
+ for (let $ = 0; $ < i.length; $++)
209
+ r = i[$], Array.isArray(r) ? d(r) : r != null && typeof r != "boolean" && ((l = !re(r)) && (r = String(r)), l && a ? c[c.length - 1].$text$ += r : c.push(l ? W(null, r) : r), a = l);
318
210
  };
319
211
  d(s);
320
- const u = U(e, null);
321
- return u.$attrs$ = t, a.length > 0 && (u.$children$ = a), u.$key$ = o, u.$name$ = l, u;
322
- }, U = (e, t) => {
212
+ const f = W(e, null);
213
+ return f.$attrs$ = t, c.length > 0 && (f.$children$ = c), f.$key$ = o, f.$name$ = n, f;
214
+ }, W = (e, t) => {
323
215
  const s = {
324
216
  $flags$: 0,
325
217
  $tag$: e,
@@ -328,48 +220,48 @@ var Ae = (e) => {
328
220
  $children$: null
329
221
  };
330
222
  return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
331
- }, je = {}, Oe = (e) => e && e.$tag$ === je, q = (e, t, s, r, o, l) => {
223
+ }, Re = {}, Oe = (e) => e && e.$tag$ === Re, J = (e, t, s, r, o, n) => {
332
224
  if (s !== r) {
333
- let n = W(e, t), i = t.toLowerCase();
225
+ let l = K(e, t), a = t.toLowerCase();
334
226
  if (t === "class") {
335
- const a = e.classList, d = G(s), u = G(r);
336
- a.remove(...d.filter((f) => f && !u.includes(f))), a.add(...u.filter((f) => f && !d.includes(f)));
227
+ const c = e.classList, d = Y(s), f = Y(r);
228
+ c.remove(...d.filter((i) => i && !f.includes(i))), c.add(...f.filter((i) => i && !d.includes(i)));
337
229
  } else if (t === "style") {
338
- for (const a in s)
339
- (!r || r[a] == null) && (a.includes("-") ? e.style.removeProperty(a) : e.style[a] = "");
340
- for (const a in r)
341
- (!s || r[a] !== s[a]) && (a.includes("-") ? e.style.setProperty(a, r[a]) : e.style[a] = r[a]);
230
+ for (const c in s)
231
+ (!r || r[c] == null) && (c.includes("-") ? e.style.removeProperty(c) : e.style[c] = "");
232
+ for (const c in r)
233
+ (!s || r[c] !== s[c]) && (c.includes("-") ? e.style.setProperty(c, r[c]) : e.style[c] = r[c]);
342
234
  } else if (t !== "key") if (t === "ref")
343
235
  r && r(e);
344
236
  else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
345
- if (t[2] === "-" ? t = t.slice(3) : W(C, i) ? t = i.slice(2) : t = i[2] + t.slice(3), s || r) {
346
- const a = t.endsWith(te);
347
- t = t.replace(De, ""), s && x.rel(e, t, s, a), r && x.ael(e, t, r, a);
237
+ if (t[2] === "-" ? t = t.slice(3) : K(q, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {
238
+ const c = t.endsWith(ne);
239
+ t = t.replace(_e, ""), s && L.rel(e, t, s, c), r && L.ael(e, t, r, c);
348
240
  }
349
241
  } else {
350
- const a = V(r);
351
- if ((n || a && r !== null) && !o)
242
+ const c = re(r);
243
+ if ((l || c && r !== null) && !o)
352
244
  try {
353
245
  if (e.tagName.includes("-"))
354
246
  e[t] = r;
355
247
  else {
356
- const u = r ?? "";
357
- t === "list" ? n = !1 : (s == null || e[t] != u) && (e[t] = u);
248
+ const f = r ?? "";
249
+ t === "list" ? l = !1 : (s == null || e[t] != f) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = f : e.setAttribute(t, f));
358
250
  }
359
251
  } catch {
360
252
  }
361
253
  let d = !1;
362
- i !== (i = i.replace(/^xlink\:?/, "")) && (t = i, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(z, t) : e.removeAttribute(t)) : (!n || l & 4 || o) && !a && (r = r === !0 ? "" : r, d ? e.setAttributeNS(z, t, r) : e.setAttribute(t, r));
254
+ a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(Q, t) : e.removeAttribute(t)) : (!l || n & 4 || o) && !c && (r = r === !0 ? "" : r, d ? e.setAttributeNS(Q, t, r) : e.setAttribute(t, r));
363
255
  }
364
256
  }
365
- }, Me = /\s/, G = (e) => e ? e.split(Me) : [], te = "Capture", De = new RegExp(te + "$"), se = (e, t, s) => {
366
- const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || I, l = t.$attrs$ || I;
367
- for (const n of X(Object.keys(o)))
368
- n in l || q(r, n, o[n], void 0, s, t.$flags$);
369
- for (const n of X(Object.keys(l)))
370
- q(r, n, o[n], l[n], s, t.$flags$);
257
+ }, Me = /\s/, Y = (e) => e ? e.split(Me) : [], ne = "Capture", _e = new RegExp(ne + "$"), le = (e, t, s) => {
258
+ const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Z, n = t.$attrs$ || Z;
259
+ for (const l of V(Object.keys(o)))
260
+ l in n || J(r, l, o[l], void 0, s, t.$flags$);
261
+ for (const l of V(Object.keys(n)))
262
+ J(r, l, o[l], n[l], s, t.$flags$);
371
263
  };
372
- function X(e) {
264
+ function V(e) {
373
265
  return e.includes("ref") ? (
374
266
  // we need to sort these to ensure that `'ref'` is the last attr
375
267
  [...e.filter((t) => t !== "ref"), "ref"]
@@ -378,11 +270,11 @@ function X(e) {
378
270
  e
379
271
  );
380
272
  }
381
- var T, w, E, O = !1, M = !1, H = !1, h = !1, D = (e, t, s, r) => {
273
+ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
382
274
  var o;
383
- const l = t.$children$[s];
384
- let n = 0, i, a, d;
385
- if (O || (H = !0, l.$tag$ === "slot" && (T && r.classList.add(T + "-s"), l.$flags$ |= l.$children$ ? (
275
+ const n = t.$children$[s];
276
+ let l = 0, a, c, d;
277
+ if (N || (z = !0, n.$tag$ === "slot" && (x && r.classList.add(x + "-s"), n.$flags$ |= n.$children$ ? (
386
278
  // slot element has fallback content
387
279
  // still create an element that "mocks" the slot element
388
280
  2
@@ -391,85 +283,94 @@ var T, w, E, O = !1, M = !1, H = !1, h = !1, D = (e, t, s, r) => {
391
283
  // create an html comment we'll use to always reference
392
284
  // where actual slot content should sit next to
393
285
  1
394
- ))), l.$text$ !== null)
395
- i = l.$elm$ = j.createTextNode(l.$text$);
396
- else if (l.$flags$ & 1)
397
- i = l.$elm$ = j.createTextNode("");
286
+ ))), n.$text$ !== null)
287
+ a = n.$elm$ = _.createTextNode(n.$text$);
288
+ else if (n.$flags$ & 1)
289
+ a = n.$elm$ = _.createTextNode("");
398
290
  else {
399
- if (h || (h = l.$tag$ === "svg"), i = l.$elm$ = j.createElementNS(
400
- h ? me : Te,
401
- !O && N.slotRelocation && l.$flags$ & 2 ? "slot-fb" : l.$tag$
402
- ), h && l.$tag$ === "foreignObject" && (h = !1), se(null, l, h), ke(T) && i["s-si"] !== T && i.classList.add(i["s-si"] = T), B(i, r), l.$children$)
403
- for (n = 0; n < l.$children$.length; ++n)
404
- a = D(e, l, n, i), a && i.appendChild(a);
405
- l.$tag$ === "svg" ? h = !1 : i.tagName === "foreignObject" && (h = !0);
291
+ if (h || (h = n.$tag$ === "svg"), a = n.$elm$ = _.createElementNS(
292
+ h ? Se : Te,
293
+ !N && E.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
294
+ ), h && n.$tag$ === "foreignObject" && (h = !1), le(null, n, h), !!a.getRootNode().querySelector("body") && E.scoped && ke(x) && a["s-si"] !== x && a.classList.add(a["s-si"] = x), G(a, r), n.$children$)
295
+ for (l = 0; l < n.$children$.length; ++l)
296
+ c = C(e, n, l, a), c && a.appendChild(c);
297
+ n.$tag$ === "svg" ? h = !1 : a.tagName === "foreignObject" && (h = !0);
406
298
  }
407
- return i["s-hn"] = E, l.$flags$ & 3 && (i["s-sr"] = !0, i["s-cr"] = w, i["s-sn"] = l.$name$ || "", i["s-rf"] = (o = l.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === l.$tag$ && e.$elm$ && A(e.$elm$, !1)), i;
408
- }, A = (e, t) => {
409
- x.$flags$ |= 1;
299
+ return a["s-hn"] = j, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = H, a["s-sn"] = n.$name$ || "", a["s-rf"] = (o = n.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === n.$tag$ && e.$elm$ && R(e.$elm$, !1)), a;
300
+ }, R = (e, t) => {
301
+ L.$flags$ |= 1;
410
302
  const s = Array.from(e.childNodes);
411
- if (e["s-sr"] && N.experimentalSlotFixes) {
303
+ if (e["s-sr"] && E.experimentalSlotFixes) {
412
304
  let r = e;
413
305
  for (; r = r.nextSibling; )
414
- r && r["s-sn"] === e["s-sn"] && r["s-sh"] === E && s.push(r);
306
+ r && r["s-sn"] === e["s-sn"] && r["s-sh"] === j && s.push(r);
415
307
  }
416
308
  for (let r = s.length - 1; r >= 0; r--) {
417
309
  const o = s[r];
418
- o["s-hn"] !== E && o["s-ol"] && (m(le(o), o, P(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, H = !0), t && A(o, t);
310
+ o["s-hn"] !== j && o["s-ol"] && (T(ce(o), o, I(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, z = !0), t && R(o, t);
419
311
  }
420
- x.$flags$ &= -2;
421
- }, re = (e, t, s, r, o, l) => {
422
- let n = e["s-cr"] && e["s-cr"].parentNode || e, i;
423
- for (n.shadowRoot && n.tagName === E && (n = n.shadowRoot); o <= l; ++o)
424
- r[o] && (i = D(null, s, o, e), i && (r[o].$elm$ = i, m(n, i, P(t))));
425
- }, oe = (e, t, s) => {
312
+ L.$flags$ &= -2;
313
+ }, ie = (e, t, s, r, o, n) => {
314
+ let l = e["s-cr"] && e["s-cr"].parentNode || e, a;
315
+ for (l.shadowRoot && l.tagName === j && (l = l.shadowRoot); o <= n; ++o)
316
+ r[o] && (a = C(null, s, o, e), a && (r[o].$elm$ = a, T(l, a, I(t))));
317
+ }, ae = (e, t, s) => {
426
318
  for (let r = t; r <= s; ++r) {
427
319
  const o = e[r];
428
320
  if (o) {
429
- const l = o.$elm$;
430
- ae(o), l && (M = !0, l["s-ol"] ? l["s-ol"].remove() : A(l, !0), l.remove());
321
+ const n = o.$elm$;
322
+ $e(o), n && (F = !0, n["s-ol"] ? n["s-ol"].remove() : R(n, !0), n.remove());
431
323
  }
432
324
  }
433
325
  }, Ne = (e, t, s, r, o = !1) => {
434
- let l = 0, n = 0, i = 0, a = 0, d = t.length - 1, u = t[0], f = t[d], $ = r.length - 1, c = r[0], p = r[$], b, y;
435
- for (; l <= d && n <= $; )
436
- if (u == null)
437
- u = t[++l];
438
- else if (f == null)
439
- f = t[--d];
440
- else if (c == null)
441
- c = r[++n];
326
+ let n = 0, l = 0, a = 0, c = 0, d = t.length - 1, f = t[0], i = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;
327
+ for (; n <= d && l <= $; )
328
+ if (f == null)
329
+ f = t[++n];
330
+ else if (i == null)
331
+ i = t[--d];
332
+ else if (u == null)
333
+ u = r[++l];
442
334
  else if (p == null)
443
335
  p = r[--$];
444
- else if (R(u, c, o))
445
- k(u, c, o), u = t[++l], c = r[++n];
446
- else if (R(f, p, o))
447
- k(f, p, o), f = t[--d], p = r[--$];
448
- else if (R(u, p, o))
449
- (u.$tag$ === "slot" || p.$tag$ === "slot") && A(u.$elm$.parentNode, !1), k(u, p, o), m(e, u.$elm$, f.$elm$.nextSibling), u = t[++l], p = r[--$];
450
- else if (R(f, c, o))
451
- (u.$tag$ === "slot" || p.$tag$ === "slot") && A(f.$elm$.parentNode, !1), k(f, c, o), m(e, f.$elm$, u.$elm$), f = t[--d], c = r[++n];
336
+ else if (M(f, u, o))
337
+ A(f, u, o), f = t[++n], u = r[++l];
338
+ else if (M(i, p, o))
339
+ A(i, p, o), i = t[--d], p = r[--$];
340
+ else if (M(f, p, o))
341
+ (f.$tag$ === "slot" || p.$tag$ === "slot") && R(f.$elm$.parentNode, !1), A(f, p, o), T(e, f.$elm$, i.$elm$.nextSibling), f = t[++n], p = r[--$];
342
+ else if (M(i, u, o))
343
+ (f.$tag$ === "slot" || p.$tag$ === "slot") && R(i.$elm$.parentNode, !1), A(i, u, o), T(e, i.$elm$, f.$elm$), i = t[--d], u = r[++l];
452
344
  else {
453
- for (i = -1, a = l; a <= d; ++a)
454
- if (t[a] && t[a].$key$ !== null && t[a].$key$ === c.$key$) {
455
- i = a;
345
+ for (a = -1, c = n; c <= d; ++c)
346
+ if (t[c] && t[c].$key$ !== null && t[c].$key$ === u.$key$) {
347
+ a = c;
456
348
  break;
457
349
  }
458
- i >= 0 ? (y = t[i], y.$tag$ !== c.$tag$ ? b = D(t && t[n], s, i, e) : (k(y, c, o), t[i] = void 0, b = y.$elm$), c = r[++n]) : (b = D(t && t[n], s, n, e), c = r[++n]), b && m(le(u.$elm$), b, P(u.$elm$));
350
+ a >= 0 ? (y = t[a], y.$tag$ !== u.$tag$ ? m = C(t && t[l], s, a, e) : (A(y, u, o), t[a] = void 0, m = y.$elm$), u = r[++l]) : (m = C(t && t[l], s, l, e), u = r[++l]), m && T(ce(f.$elm$), m, I(f.$elm$));
459
351
  }
460
- l > d ? re(
352
+ n > d ? ie(
461
353
  e,
462
354
  r[$ + 1] == null ? null : r[$ + 1].$elm$,
463
355
  s,
464
356
  r,
465
- n,
357
+ l,
466
358
  $
467
- ) : n > $ && oe(t, l, d);
468
- }, R = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? !0 : e.$key$ === t.$key$ : !1, P = (e) => e && e["s-ol"] || e, le = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, k = (e, t, s = !1) => {
469
- const r = t.$elm$ = e.$elm$, o = e.$children$, l = t.$children$, n = t.$tag$, i = t.$text$;
470
- let a;
471
- i === null ? (h = n === "svg" ? !0 : n === "foreignObject" ? !1 : h, n === "slot" && !O || se(e, t, h), o !== null && l !== null ? Ne(r, o, t, l, s) : l !== null ? (e.$text$ !== null && (r.textContent = ""), re(r, null, t, l, 0, l.length - 1)) : o !== null && oe(o, 0, o.length - 1), h && n === "svg" && (h = !1)) : (a = r["s-cr"]) ? a.parentNode.textContent = i : e.$text$ !== i && (r.data = i);
472
- }, ne = (e) => {
359
+ ) : l > $ && ae(t, n, d);
360
+ }, M = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? (
361
+ // The component gets hydrated and no VDOM has been initialized.
362
+ // Here the comparison can't happen as $name$ property is not set for `leftNode`.
363
+ "$nodeId$" in e && s && // `leftNode` is not from type HTMLComment which would cause many
364
+ // hydration comments to be removed
365
+ e.$elm$.nodeType !== 8 ? !1 : e.$name$ === t.$name$
366
+ ) : s ? !0 : e.$key$ === t.$key$ : !1, I = (e) => e && e["s-ol"] || e, ce = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, A = (e, t, s = !1) => {
367
+ const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, l = t.$tag$, a = t.$text$;
368
+ let c;
369
+ a === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !N || le(e, t, h), o !== null && n !== null ? Ne(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = ""), ie(r, null, t, n, 0, n.length - 1)) : (
370
+ // don't do this on initial render as it can cause non-hydrated content to be removed
371
+ !s && E.updatable && o !== null && ae(o, 0, o.length - 1)
372
+ ), h && l === "svg" && (h = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);
373
+ }, fe = (e) => {
473
374
  const t = e.childNodes;
474
375
  for (const s of t)
475
376
  if (s.nodeType === 1) {
@@ -489,129 +390,129 @@ var T, w, E, O = !1, M = !1, H = !1, h = !1, D = (e, t, s, r) => {
489
390
  }
490
391
  }
491
392
  }
492
- ne(s);
393
+ fe(s);
493
394
  }
494
- }, S = [], ie = (e) => {
395
+ }, b = [], ue = (e) => {
495
396
  let t, s, r;
496
397
  for (const o of e.childNodes) {
497
398
  if (o["s-sr"] && (t = o["s-cr"]) && t.parentNode) {
498
399
  s = t.parentNode.childNodes;
499
- const l = o["s-sn"];
400
+ const n = o["s-sn"];
500
401
  for (r = s.length - 1; r >= 0; r--)
501
- if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== o["s-hn"] && !N.experimentalSlotFixes)
502
- if (K(t, l)) {
503
- let n = S.find((i) => i.$nodeToRelocate$ === t);
504
- M = !0, t["s-sn"] = t["s-sn"] || l, n ? (n.$nodeToRelocate$["s-sh"] = o["s-hn"], n.$slotRefNode$ = o) : (t["s-sh"] = o["s-hn"], S.push({
402
+ if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== o["s-hn"] && !E.experimentalSlotFixes)
403
+ if (ee(t, n)) {
404
+ let l = b.find((a) => a.$nodeToRelocate$ === t);
405
+ F = !0, t["s-sn"] = t["s-sn"] || n, l ? (l.$nodeToRelocate$["s-sh"] = o["s-hn"], l.$slotRefNode$ = o) : (t["s-sh"] = o["s-hn"], b.push({
505
406
  $slotRefNode$: o,
506
407
  $nodeToRelocate$: t
507
- })), t["s-sr"] && S.map((i) => {
508
- K(i.$nodeToRelocate$, t["s-sn"]) && (n = S.find((a) => a.$nodeToRelocate$ === t), n && !i.$slotRefNode$ && (i.$slotRefNode$ = n.$slotRefNode$));
408
+ })), t["s-sr"] && b.map((a) => {
409
+ ee(a.$nodeToRelocate$, t["s-sn"]) && (l = b.find((c) => c.$nodeToRelocate$ === t), l && !a.$slotRefNode$ && (a.$slotRefNode$ = l.$slotRefNode$));
509
410
  });
510
- } else S.some((n) => n.$nodeToRelocate$ === t) || S.push({
411
+ } else b.some((l) => l.$nodeToRelocate$ === t) || b.push({
511
412
  $nodeToRelocate$: t
512
413
  });
513
414
  }
514
- o.nodeType === 1 && ie(o);
415
+ o.nodeType === 1 && ue(o);
515
416
  }
516
- }, K = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", ae = (e) => {
517
- e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(ae);
518
- }, m = (e, t, s) => {
417
+ }, ee = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", $e = (e) => {
418
+ e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map($e);
419
+ }, T = (e, t, s) => {
519
420
  const r = e == null ? void 0 : e.insertBefore(t, s);
520
- return B(t, e), r;
521
- }, ce = (e) => {
421
+ return G(t, e), r;
422
+ }, de = (e) => {
522
423
  const t = [];
523
424
  return e && t.push(
524
425
  ...e["s-scs"] || [],
525
426
  e["s-si"],
526
427
  e["s-sc"],
527
- ...ce(e.parentElement)
428
+ ...de(e.parentElement)
528
429
  ), t;
529
- }, B = (e, t, s = !1) => {
430
+ }, G = (e, t, s = !1) => {
530
431
  var r;
531
432
  if (e && t && e.nodeType === 1) {
532
- const o = new Set(ce(t).filter(Boolean));
433
+ const o = new Set(de(t).filter(Boolean));
533
434
  if (o.size && ((r = e.classList) == null || r.add(...e["s-scs"] = [...o]), e["s-ol"] || s))
534
- for (const l of Array.from(e.childNodes))
535
- B(l, e, !0);
435
+ for (const n of Array.from(e.childNodes))
436
+ G(n, e, !0);
536
437
  }
537
- }, _e = (e, t, s = !1) => {
538
- var r, o, l, n, i;
539
- const a = e.$hostElement$, d = e.$cmpMeta$, u = e.$vnode$ || U(null, null), f = Oe(t) ? t : Re(null, null, t);
540
- if (E = a.tagName, d.$attrsToReflect$ && (f.$attrs$ = f.$attrs$ || {}, d.$attrsToReflect$.map(
541
- ([$, c]) => f.$attrs$[c] = a[$]
542
- )), s && f.$attrs$)
543
- for (const $ of Object.keys(f.$attrs$))
544
- a.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (f.$attrs$[$] = a[$]);
545
- f.$tag$ = null, f.$flags$ |= 4, e.$vnode$ = f, f.$elm$ = u.$elm$ = a.shadowRoot || a, T = a["s-sc"], O = (d.$flags$ & 1) !== 0, w = a["s-cr"], M = !1, k(u, f, s);
438
+ }, Fe = (e, t, s = !1) => {
439
+ var r, o, n, l, a;
440
+ const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), i = Oe(t) ? t : je(null, null, t);
441
+ if (j = c.tagName, d.$attrsToReflect$ && (i.$attrs$ = i.$attrs$ || {}, d.$attrsToReflect$.map(
442
+ ([$, u]) => i.$attrs$[u] = c[$]
443
+ )), s && i.$attrs$)
444
+ for (const $ of Object.keys(i.$attrs$))
445
+ c.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (i.$attrs$[$] = c[$]);
446
+ i.$tag$ = null, i.$flags$ |= 4, e.$vnode$ = i, i.$elm$ = f.$elm$ = c.shadowRoot || c, x = c["s-sc"], N = (d.$flags$ & 1) !== 0, H = c["s-cr"], F = !1, A(f, i, s);
546
447
  {
547
- if (x.$flags$ |= 1, H) {
548
- ie(f.$elm$);
549
- for (const $ of S) {
550
- const c = $.$nodeToRelocate$;
551
- if (!c["s-ol"]) {
552
- const p = j.createTextNode("");
553
- p["s-nr"] = c, m(c.parentNode, c["s-ol"] = p, c);
448
+ if (L.$flags$ |= 1, z) {
449
+ ue(i.$elm$);
450
+ for (const $ of b) {
451
+ const u = $.$nodeToRelocate$;
452
+ if (!u["s-ol"]) {
453
+ const p = _.createTextNode("");
454
+ p["s-nr"] = u, T(u.parentNode, u["s-ol"] = p, u);
554
455
  }
555
456
  }
556
- for (const $ of S) {
557
- const c = $.$nodeToRelocate$, p = $.$slotRefNode$;
457
+ for (const $ of b) {
458
+ const u = $.$nodeToRelocate$, p = $.$slotRefNode$;
558
459
  if (p) {
559
- const b = p.parentNode;
460
+ const m = p.parentNode;
560
461
  let y = p.nextSibling;
561
462
  {
562
- let L = (r = c["s-ol"]) == null ? void 0 : r.previousSibling;
563
- for (; L; ) {
564
- let g = (o = L["s-nr"]) != null ? o : null;
565
- if (g && g["s-sn"] === c["s-sn"] && b === g.parentNode) {
566
- for (g = g.nextSibling; g === c || g != null && g["s-sr"]; )
567
- g = g == null ? void 0 : g.nextSibling;
568
- if (!g || !g["s-nr"]) {
569
- y = g;
463
+ let O = (r = u["s-ol"]) == null ? void 0 : r.previousSibling;
464
+ for (; O; ) {
465
+ let v = (o = O["s-nr"]) != null ? o : null;
466
+ if (v && v["s-sn"] === u["s-sn"] && m === v.parentNode) {
467
+ for (v = v.nextSibling; v === u || v != null && v["s-sr"]; )
468
+ v = v == null ? void 0 : v.nextSibling;
469
+ if (!v || !v["s-nr"]) {
470
+ y = v;
570
471
  break;
571
472
  }
572
473
  }
573
- L = L.previousSibling;
474
+ O = O.previousSibling;
574
475
  }
575
476
  }
576
- (!y && b !== c.parentNode || c.nextSibling !== y) && c !== y && (!c["s-hn"] && c["s-ol"] && (c["s-hn"] = c["s-ol"].parentNode.nodeName), m(b, c, y), c.nodeType === 1 && (c.hidden = (l = c["s-ih"]) != null ? l : !1)), c && typeof p["s-rf"] == "function" && p["s-rf"](c);
477
+ (!y && m !== u.parentNode || u.nextSibling !== y) && u !== y && (!u["s-hn"] && u["s-ol"] && (u["s-hn"] = u["s-ol"].parentNode.nodeName), T(m, u, y), u.nodeType === 1 && (u.hidden = (n = u["s-ih"]) != null ? n : !1)), u && typeof p["s-rf"] == "function" && p["s-rf"](u);
577
478
  } else
578
- c.nodeType === 1 && (s && (c["s-ih"] = (n = c.hidden) != null ? n : !1), c.hidden = !0);
479
+ u.nodeType === 1 && (s && (u["s-ih"] = (l = u.hidden) != null ? l : !1), u.hidden = !0);
579
480
  }
580
481
  }
581
- M && ne(f.$elm$), x.$flags$ &= -2, S.length = 0;
482
+ F && fe(i.$elm$), L.$flags$ &= -2, b.length = 0;
582
483
  }
583
- if (N.experimentalScopedSlotChanges && d.$flags$ & 2)
584
- for (const $ of f.$elm$.childNodes)
585
- $["s-hn"] !== E && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (i = $.hidden) != null ? i : !1), $.hidden = !0);
586
- w = void 0;
484
+ if (E.experimentalScopedSlotChanges && d.$flags$ & 2)
485
+ for (const $ of i.$elm$.childNodes)
486
+ $["s-hn"] !== j && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);
487
+ H = void 0;
587
488
  };
588
- const Fe = (e, t, s) => {
489
+ const Ce = (e, t, s) => {
589
490
  [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);
590
- }, fe = (e, t, s, r, o) => {
491
+ }, pe = (e, t, s, r, o) => {
591
492
  if (t && typeof t == "string") {
592
- const l = document.createElement(t);
593
- Object.keys(s || {}).forEach((n) => {
594
- Fe(l, n, s[n]);
595
- }), r == null || r.forEach((n) => {
596
- fe(l, n.$tag$, n.$attrs$, n.$children$, n.$text$);
597
- }), s != null && s.innerHTML && (l.innerHTML = s.innerHTML), e.appendChild(l);
493
+ const n = document.createElement(t);
494
+ Object.keys(s || {}).forEach((l) => {
495
+ Ce(n, l, s[l]);
496
+ }), r == null || r.forEach((l) => {
497
+ pe(n, l.$tag$, l.$attrs$, l.$children$, l.$text$);
498
+ }), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);
598
499
  }
599
500
  o && (e.innerHTML = o);
600
- }, et = (e, t) => {
501
+ }, Ve = (e, t) => {
601
502
  const s = {};
602
503
  if (typeof e != "object")
603
504
  throw new Error("filterArgs - args isn't an object.");
604
505
  for (const r in e)
605
506
  if (!r.startsWith("slot")) {
606
- const o = e[r], l = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
607
- (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[l] = o);
507
+ const o = e[r], n = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
508
+ (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);
608
509
  }
609
510
  return s;
610
- }, tt = (e, t) => {
511
+ }, et = (e, t) => {
611
512
  var r, o;
612
513
  const s = document.getElementById("storybook-root");
613
- if (s)
614
- return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), _e(
514
+ if (s !== null)
515
+ return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), Fe(
615
516
  {
616
517
  $ancestorComponent$: void 0,
617
518
  $flags$: 0,
@@ -624,29 +525,291 @@ const Fe = (e, t, s) => {
624
525
  },
625
526
  e(t)
626
527
  ), s.children[s.children.length - 1];
627
- }, st = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
528
+ }, tt = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
628
529
  const o = document.createElement("div");
629
- return fe(o, e, t, s, r), o.innerHTML;
630
- }, rt = ({ disconnect: e, observe: t, takeRecords: s }) => {
530
+ return pe(o, e, t, s, r), o.innerHTML;
531
+ }, D = (e, t) => {
532
+ if (!t)
533
+ return;
534
+ const s = t.split("/");
535
+ return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
536
+ };
537
+ var S, w;
538
+ class st {
539
+ constructor(t) {
540
+ /**
541
+ * JsonDocs
542
+ */
543
+ g(this, "jsonDoc");
544
+ /**
545
+ * Get component data from the jsonDoc
546
+ * @param tagName - tag name we want to get the data from
547
+ * @returns component data
548
+ */
549
+ P(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
550
+ /**
551
+ * Get the control for the given prop
552
+ * Based on https://storybook.js.org/docs/api/arg-types#controltype
553
+ * @param prop - prop to get control for
554
+ * @returns control type and options if applicable
555
+ */
556
+ P(this, w, (t) => {
557
+ 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, "|"));
558
+ 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" } };
559
+ });
560
+ /**
561
+ * Extract component arg types from the component data
562
+ * @param tagName - tag name we want to extract the arg types from
563
+ * @returns component arg types
564
+ */
565
+ g(this, "extractArgTypes", (t) => {
566
+ const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, i) => {
567
+ const { control: $, options: u } = k(this, w).call(this, i);
568
+ return {
569
+ ...f,
570
+ [i.name]: {
571
+ name: i.attr || i.name,
572
+ description: i.docs,
573
+ type: { required: i.required },
574
+ table: {
575
+ category: "props",
576
+ type: { summary: i.type },
577
+ defaultValue: { summary: i.default }
578
+ },
579
+ control: $,
580
+ options: u
581
+ }
582
+ };
583
+ }, {}), o = s == null ? void 0 : s.events.reduce(
584
+ (f, i) => ({
585
+ ...f,
586
+ [i.event]: {
587
+ name: i.event,
588
+ description: i.docs,
589
+ table: {
590
+ category: "events",
591
+ type: { summary: i.detail }
592
+ }
593
+ }
594
+ }),
595
+ {}
596
+ ), n = s == null ? void 0 : s.methods.reduce(
597
+ (f, i) => ({
598
+ ...f,
599
+ [i.name]: {
600
+ name: i.name,
601
+ description: i.docs,
602
+ table: {
603
+ category: "methods",
604
+ type: { summary: i.signature }
605
+ }
606
+ }
607
+ }),
608
+ {}
609
+ ), l = s == null ? void 0 : s.slots.reduce(
610
+ (f, i) => ({
611
+ ...f,
612
+ [i.name]: {
613
+ name: i.name !== "" ? i.name : "default",
614
+ // default slot are unnamed
615
+ description: i.docs,
616
+ table: {
617
+ category: "slots",
618
+ type: { summary: void 0 }
619
+ }
620
+ }
621
+ }),
622
+ {}
623
+ ), a = s == null ? void 0 : s.styles.reduce(
624
+ (f, i) => ({
625
+ ...f,
626
+ [i.name]: {
627
+ name: i.name,
628
+ description: i.docs,
629
+ table: {
630
+ category: "custom properties",
631
+ type: { summary: void 0 }
632
+ }
633
+ }
634
+ }),
635
+ {}
636
+ ), c = s == null ? void 0 : s.dependencies.reduce((f, i) => {
637
+ const $ = k(this, S).call(this, i);
638
+ return {
639
+ ...f,
640
+ [i]: {
641
+ name: i,
642
+ description: `<a href="./?path=/docs/${D("", $ == null ? void 0 : $.filePath)}">View Component Documentation</a>`,
643
+ table: {
644
+ category: "depends on",
645
+ type: { summary: void 0 }
646
+ }
647
+ }
648
+ };
649
+ }, {}), d = s == null ? void 0 : s.dependents.reduce((f, i) => {
650
+ const $ = k(this, S).call(this, i);
651
+ return {
652
+ ...f,
653
+ [i]: {
654
+ name: i,
655
+ description: `<a href="./?path=/docs/${D("", $ == null ? void 0 : $.filePath)}">View Component Documentation</a>`,
656
+ table: {
657
+ category: "used by",
658
+ type: { summary: void 0 }
659
+ }
660
+ }
661
+ };
662
+ }, {});
663
+ return {
664
+ ...r,
665
+ ...o,
666
+ ...n,
667
+ ...l,
668
+ ...a,
669
+ ...c,
670
+ ...d
671
+ };
672
+ });
673
+ /**
674
+ * Extract component description from the component data
675
+ * @param tagName - tag name we want to extract the description from
676
+ * @returns component description
677
+ */
678
+ g(this, "extractComponentDescription", (t) => {
679
+ const s = k(this, S).call(this, t);
680
+ return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);
681
+ });
682
+ this.jsonDoc = t;
683
+ }
684
+ }
685
+ S = new WeakMap(), w = new WeakMap();
686
+ const De = (e, t) => {
687
+ if (t)
688
+ return `${e}${t}`;
689
+ }, ge = (e) => {
690
+ let t = e.overview ? `${e.overview}
691
+
692
+ ` : "";
693
+ const s = e.props.filter(({ attr: o }) => o !== void 0);
694
+ s.length && (t += `Attributes:
695
+ `, t += s.map(({ attr: o, docs: n }) => `- \`${o}\`: ${n}
696
+ `).join(""), t += `
697
+ `);
698
+ const r = e.props.filter(({ attr: o }) => o === void 0);
699
+ return r.length && (t += `Properties:
700
+ `, t += r.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
701
+ `).join(""), t += `
702
+ `), e.methods.length && (t += `Methods:
703
+ `, t += e.methods.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
704
+ `).join(""), t += `
705
+ `), e.events.length && (t += `Events:
706
+ `, t += e.events.map(({ event: o, docs: n }) => `- \`${o}\`: ${n}
707
+ `).join(""), t += `
708
+ `), e.listeners.length && (t += `Listeners:
709
+ `, t += e.listeners.map(({ event: o }) => `- \`${o}\`
710
+ `).join(""), t += `
711
+ `), e.slots.length && (t += `Slots:
712
+ `, t += e.slots.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
713
+ `).join(""), t += `
714
+ `), t;
715
+ }, B = (e) => `${e.docs}
716
+
717
+ Type: \`${e.type}\``, rt = (e, t, s, r) => ({
718
+ $schema: "https://json.schemastore.org/web-types",
719
+ name: e,
720
+ version: t,
721
+ "description-markup": "markdown",
722
+ contributions: {
723
+ html: {
724
+ elements: s.components.map((o) => {
725
+ const n = D(r, o.filePath);
726
+ return {
727
+ name: o.tag,
728
+ description: ge(o),
729
+ "doc-url": n,
730
+ attributes: o.props.filter((l) => l.attr).map((l) => ({
731
+ name: l.attr,
732
+ description: B(l),
733
+ "doc-url": n,
734
+ value: {
735
+ type: l.type,
736
+ default: l.default,
737
+ required: l.required
738
+ }
739
+ })),
740
+ js: {
741
+ properties: o.props.map((l) => ({
742
+ name: l.name,
743
+ description: B(l),
744
+ "doc-url": n,
745
+ value: {
746
+ type: l.type,
747
+ default: l.default,
748
+ required: l.required
749
+ }
750
+ })),
751
+ events: o.events.map((l) => ({
752
+ name: l.event,
753
+ description: l.docs
754
+ }))
755
+ }
756
+ };
757
+ })
758
+ }
759
+ }
760
+ }), we = (e, t, s) => [
761
+ { name: "Storybook", url: D(e, s) },
762
+ { name: "Sources", url: De(t, s) }
763
+ ], Pe = (e) => {
764
+ if (!e.values.some(({ value: t }) => t === void 0))
765
+ return e.values.map(({ value: t }) => ({ name: t }));
766
+ }, ot = (e, t, s, r) => ({
767
+ version: e,
768
+ tags: t.components.map((o) => {
769
+ const n = we(s, r, o.filePath);
770
+ return {
771
+ name: o.tag,
772
+ description: ge(o),
773
+ attributes: o.props.map((l) => ({
774
+ name: l.attr || l.name,
775
+ description: B(l),
776
+ values: Pe(l),
777
+ references: n
778
+ })),
779
+ references: n
780
+ };
781
+ }),
782
+ globalAttributes: [],
783
+ valueSets: []
784
+ }), nt = (e) => {
785
+ const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
786
+ return He([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);
787
+ }, lt = (e) => e.toISOString().split("T")[0], Ue = (e, t, s) => {
788
+ const r = e.closest("[lang]"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == "string" ? o[0] : navigator.language || s, l = n.split("-").shift();
789
+ return {
790
+ locale: n,
791
+ messages: t[l] || t[s]
792
+ };
793
+ }, it = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), at = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), We = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, He = (e, t, s) => typeof e != "string" || e === "" || !We.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), ct = (e, t) => (s) => Ue(s, e, t), ft = ({ disconnect: e, observe: t, takeRecords: s }) => {
631
794
  class r {
632
- constructor(l) {
795
+ constructor(n) {
633
796
  /**
634
797
  *
635
798
  */
636
- v(this, "disconnect", e);
799
+ g(this, "disconnect", e);
637
800
  /**
638
801
  *
639
802
  */
640
- v(this, "observe", t);
803
+ g(this, "observe", t);
641
804
  /**
642
805
  *
643
806
  */
644
- v(this, "takeRecords", s);
807
+ g(this, "takeRecords", s);
645
808
  /**
646
809
  *
647
810
  */
648
- v(this, "cb");
649
- this.cb = l;
811
+ g(this, "cb");
812
+ this.cb = n;
650
813
  }
651
814
  }
652
815
  return [window, global].forEach((o) => {
@@ -656,25 +819,25 @@ const Fe = (e, t, s) => {
656
819
  value: r
657
820
  });
658
821
  }), r;
659
- }, ot = ({ disconnect: e, observe: t }) => {
822
+ }, ut = ({ disconnect: e, observe: t }) => {
660
823
  class s {
661
824
  constructor(o) {
662
825
  /**
663
826
  *
664
827
  */
665
- v(this, "disconnect", e);
828
+ g(this, "disconnect", e);
666
829
  /**
667
830
  *
668
831
  */
669
- v(this, "observe", t);
832
+ g(this, "observe", t);
670
833
  /**
671
834
  *
672
835
  */
673
- v(this, "unobserve");
836
+ g(this, "unobserve");
674
837
  /**
675
838
  *
676
839
  */
677
- v(this, "cb");
840
+ g(this, "cb");
678
841
  this.cb = o;
679
842
  }
680
843
  }
@@ -686,18 +849,18 @@ const Fe = (e, t, s) => {
686
849
  });
687
850
  }), s;
688
851
  };
689
- class Ue extends Event {
852
+ class Be extends Event {
690
853
  constructor() {
691
854
  super(...arguments);
692
855
  /**
693
856
  *
694
857
  */
695
858
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
696
- v(this, "detail");
859
+ g(this, "detail");
697
860
  }
698
861
  }
699
- const lt = () => {
700
- class e extends Ue {
862
+ const $t = () => {
863
+ class e extends Be {
701
864
  }
702
865
  return [window, global].forEach((t) => {
703
866
  Object.defineProperty(t, "SubmitEvent", {
@@ -708,30 +871,32 @@ const lt = () => {
708
871
  }), e;
709
872
  };
710
873
  export {
711
- He as ClassList,
712
- Pe as allItemsAreString,
713
- qe as cleanString,
714
- Ce as createID,
715
- he as dateRegExp,
716
- Ze as dateToString,
717
- Ve as defineLocales,
718
- et as filterArgs,
719
- We as focusableElements,
720
- Qe as getLocaleDatePattern,
721
- Q as getParentWindows,
722
- st as getStoryHTML,
723
- ze as getWindows,
724
- Be as isTagName,
725
- Ie as isValidString,
726
- Je as localeCurrency,
727
- ye as localeDate,
728
- Ye as localeNumber,
729
- Ge as nextTick,
730
- rt as setupMutationObserverMock,
731
- ot as setupResizeObserverMock,
732
- lt as setupSubmitEventMock,
733
- tt as stencilWrapper,
734
- Ke as vsCodeGenerator,
735
- Xe as webTypesGenerator
874
+ Ie as ClassList,
875
+ st as StorybookPreview,
876
+ Ge as allItemsAreString,
877
+ Je as cleanString,
878
+ ze as createID,
879
+ We as dateRegExp,
880
+ lt as dateToString,
881
+ ct as defineLocales,
882
+ Ve as filterArgs,
883
+ Ke as focusableElements,
884
+ nt as getLocaleDatePattern,
885
+ te as getParentWindows,
886
+ tt as getStoryHTML,
887
+ D as getStorybookUrl,
888
+ Qe as getWindows,
889
+ Xe as isTagName,
890
+ Ze as isValidString,
891
+ it as localeCurrency,
892
+ He as localeDate,
893
+ at as localeNumber,
894
+ Ye as nextTick,
895
+ ft as setupMutationObserverMock,
896
+ ut as setupResizeObserverMock,
897
+ $t as setupSubmitEventMock,
898
+ et as stencilWrapper,
899
+ ot as vsCodeGenerator,
900
+ rt as webTypesGenerator
736
901
  };
737
902
  //# sourceMappingURL=index.es.js.map