@mgdis/stencil-helpers 3.0.0 → 3.1.1

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