@tixyel/streamelements 6.2.0 → 6.2.2

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
@@ -168,24 +168,24 @@ class Z {
168
168
  switch (t.provider) {
169
169
  case "twitch": {
170
170
  const c = t.data;
171
- i = c.event.data.nick || c.event.data.displayName, c.event.data.tags?.badges && (s = c.event.data.tags.badges.toString().replace(/\/\d+/g, "").split(",").map((u) => u in n ? n[u] : u));
171
+ i = c.event.data.nick || c.event.data.displayName, c.event.data.tags?.badges && (s = c.event.data.tags.badges.toString().replace(/\/\d+/g, "").split(",").map((p) => p in n ? n[p] : p));
172
172
  break;
173
173
  }
174
174
  case "youtube": {
175
- const c = t.data, f = {
175
+ const c = t.data, b = {
176
176
  isVerified: "verified",
177
177
  isChatOwner: "owner",
178
178
  isChatSponsor: "sponsor",
179
179
  isChatModerator: "moderator"
180
180
  };
181
- i = c.event.data.nick || c.event.data.displayName, s = Object.entries(c.event.data.authorDetails).filter(([u, o]) => u.startsWith("is") && o).map(([u]) => f[u]).filter(Boolean), s.includes("sponsor") && (s.push("premium"), s.push("prime")), s.includes("owner") && (s.push("moderator"), s.push("broadcaster"));
181
+ i = c.event.data.nick || c.event.data.displayName, s = Object.entries(c.event.data.authorDetails).filter(([p, o]) => p.startsWith("is") && o).map(([p]) => b[p]).filter(Boolean), s.includes("sponsor") && (s.push("premium"), s.push("prime")), s.includes("owner") && (s.push("moderator"), s.push("broadcaster"));
182
182
  break;
183
183
  }
184
184
  case "kick":
185
185
  return !1;
186
186
  }
187
- const l = this.verify(i, s, a);
188
- return l === !0 && this.run.apply(window.client, [a, t]), l;
187
+ const m = this.verify(i, s, a);
188
+ return m === !0 && this.run.apply(window.client, [a, t]), m;
189
189
  }
190
190
  remove() {
191
191
  if (!(window.client instanceof G)) return;
@@ -203,7 +203,7 @@ class Z {
203
203
  });
204
204
  if (a.length && a.every((i) => i instanceof Z))
205
205
  return a.forEach((i) => {
206
- i.parse(t.event.data.text, e), window.client.emit("action", i, "executed"), R.received(`Command executed: ${t.event.data.text} by ${t.event.data.nick || t.event.data.displayName}`, t);
206
+ i.parse(t.event.data.text, e), window.client.emit("action", i, "executed"), N.received(`Command executed: ${t.event.data.text} by ${t.event.data.nick || t.event.data.displayName}`, t);
207
207
  }), !0;
208
208
  }
209
209
  } catch {
@@ -364,17 +364,17 @@ const ut = [
364
364
  "yellowgreen",
365
365
  "transparent"
366
366
  ];
367
- function ft(d, e) {
367
+ function ft(l, e) {
368
368
  if (!e) return null;
369
369
  switch (e) {
370
370
  case "hex": {
371
- const t = d.replace("#", "");
371
+ const t = l.replace("#", "");
372
372
  let a = 0, i = 0, s = 0, n = 1;
373
373
  return t.length === 3 ? (a = parseInt(t[0] + t[0], 16), i = parseInt(t[1] + t[1], 16), s = parseInt(t[2] + t[2], 16)) : t.length === 6 ? (a = parseInt(t.slice(0, 2), 16), i = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16)) : t.length === 4 ? (a = parseInt(t[0] + t[0], 16), i = parseInt(t[1] + t[1], 16), s = parseInt(t[2] + t[2], 16), n = parseInt(t[3] + t[3], 16) / 255) : t.length === 8 && (a = parseInt(t.slice(0, 2), 16), i = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16), n = parseInt(t.slice(6, 8), 16) / 255), { r: a, g: i, b: s, a: n };
374
374
  }
375
375
  case "rgb":
376
376
  case "rgba": {
377
- const t = d.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);
377
+ const t = l.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);
378
378
  return t ? {
379
379
  r: parseInt(t[1]),
380
380
  g: parseInt(t[2]),
@@ -384,7 +384,7 @@ function ft(d, e) {
384
384
  }
385
385
  case "hsl":
386
386
  case "hsla": {
387
- const t = d.match(/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*([\d.]+))?\s*\)/);
387
+ const t = l.match(/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*([\d.]+))?\s*\)/);
388
388
  if (!t) return null;
389
389
  const a = parseInt(t[1]), i = parseInt(t[2]), s = parseInt(t[3]), n = t[4] ? parseFloat(t[4]) : 1;
390
390
  return { ...yt(a, i, s), a: n };
@@ -394,7 +394,7 @@ function ft(d, e) {
394
394
  t.width = t.height = 1;
395
395
  const a = t.getContext("2d");
396
396
  if (!a) return null;
397
- a.fillStyle = d, a.fillRect(0, 0, 1, 1);
397
+ a.fillStyle = l, a.fillRect(0, 0, 1, 1);
398
398
  const [i, s, n] = a.getImageData(0, 0, 1, 1).data;
399
399
  return { r: i, g: s, b: n, a: 1 };
400
400
  }
@@ -402,42 +402,42 @@ function ft(d, e) {
402
402
  return null;
403
403
  }
404
404
  }
405
- function bt(d, e = !0) {
405
+ function bt(l, e = !0) {
406
406
  const t = (i) => Math.round(i).toString(16).padStart(2, "0");
407
- let a = `#${t(d.r)}${t(d.g)}${t(d.b)}`;
408
- return e && d.a < 1 && (a += t(d.a * 255)), a;
407
+ let a = `#${t(l.r)}${t(l.g)}${t(l.b)}`;
408
+ return e && l.a < 1 && (a += t(l.a * 255)), a;
409
409
  }
410
- function lt(d, e, t) {
411
- d /= 255, e /= 255, t /= 255;
412
- const a = Math.max(d, e, t), i = Math.min(d, e, t), s = a - i;
413
- let n = 0, l = 0;
410
+ function lt(l, e, t) {
411
+ l /= 255, e /= 255, t /= 255;
412
+ const a = Math.max(l, e, t), i = Math.min(l, e, t), s = a - i;
413
+ let n = 0, m = 0;
414
414
  const c = (a + i) / 2;
415
415
  if (s !== 0)
416
- switch (l = c > 0.5 ? s / (2 - a - i) : s / (a + i), a) {
417
- case d:
416
+ switch (m = c > 0.5 ? s / (2 - a - i) : s / (a + i), a) {
417
+ case l:
418
418
  n = ((e - t) / s + (e < t ? 6 : 0)) / 6;
419
419
  break;
420
420
  case e:
421
- n = ((t - d) / s + 2) / 6;
421
+ n = ((t - l) / s + 2) / 6;
422
422
  break;
423
423
  case t:
424
- n = ((d - e) / s + 4) / 6;
424
+ n = ((l - e) / s + 4) / 6;
425
425
  break;
426
426
  }
427
427
  return {
428
428
  h: Math.round(n * 360),
429
- s: Math.round(l * 100),
429
+ s: Math.round(m * 100),
430
430
  l: Math.round(c * 100)
431
431
  };
432
432
  }
433
- function yt(d, e, t) {
434
- d /= 360, e /= 100, t /= 100;
433
+ function yt(l, e, t) {
434
+ l /= 360, e /= 100, t /= 100;
435
435
  let a, i, s;
436
436
  if (e === 0)
437
437
  a = i = s = t;
438
438
  else {
439
- const n = (f, u, o) => (o < 0 && (o += 1), o > 1 && (o -= 1), o < 0.16666666666666666 ? f + (u - f) * 6 * o : o < 0.5 ? u : o < 0.6666666666666666 ? f + (u - f) * (0.6666666666666666 - o) * 6 : f), l = t < 0.5 ? t * (1 + e) : t + e - t * e, c = 2 * t - l;
440
- a = n(c, l, d + 1 / 3), i = n(c, l, d), s = n(c, l, d - 1 / 3);
439
+ const n = (b, p, o) => (o < 0 && (o += 1), o > 1 && (o -= 1), o < 0.16666666666666666 ? b + (p - b) * 6 * o : o < 0.5 ? p : o < 0.6666666666666666 ? b + (p - b) * (0.6666666666666666 - o) * 6 : b), m = t < 0.5 ? t * (1 + e) : t + e - t * e, c = 2 * t - m;
440
+ a = n(c, m, l + 1 / 3), i = n(c, m, l), s = n(c, m, l - 1 / 3);
441
441
  }
442
442
  return {
443
443
  r: Math.round(a * 255),
@@ -445,17 +445,17 @@ function yt(d, e, t) {
445
445
  b: Math.round(s * 255)
446
446
  };
447
447
  }
448
- async function wt(d, e, t) {
448
+ async function wt(l, e, t) {
449
449
  const a = ut;
450
450
  let i = a[0], s = 1 / 0;
451
451
  for await (const n of a) {
452
- const l = document.createElement("canvas");
453
- l.width = l.height = 1;
454
- const c = l.getContext("2d");
452
+ const m = document.createElement("canvas");
453
+ m.width = m.height = 1;
454
+ const c = m.getContext("2d");
455
455
  if (!c) continue;
456
456
  c.fillStyle = n, c.fillRect(0, 0, 1, 1);
457
- const [f, u, o] = c.getImageData(0, 0, 1, 1).data, m = Math.sqrt(Math.pow(d - f, 2) + Math.pow(e - u, 2) + Math.pow(t - o, 2));
458
- if (m < s && (s = m, i = n), m === 0) break;
457
+ const [b, p, o] = c.getImageData(0, 0, 1, 1).data, h = Math.sqrt(Math.pow(l - b, 2) + Math.pow(e - p, 2) + Math.pow(t - o, 2));
458
+ if (h < s && (s = h, i = n), h === 0) break;
459
459
  }
460
460
  return i;
461
461
  }
@@ -1909,11 +1909,11 @@ const vt = [
1909
1909
  }
1910
1910
  }
1911
1911
  ]).reduce(
1912
- (d, e) => (d.some((t) => t.name === e.name) || d.push({
1912
+ (l, e) => (l.some((t) => t.name === e.name) || l.push({
1913
1913
  ...e,
1914
1914
  start: 0,
1915
1915
  end: 0
1916
- }), d),
1916
+ }), l),
1917
1917
  []
1918
1918
  ), jt = [], xt = [
1919
1919
  "Hello everyone!",
@@ -5229,15 +5229,15 @@ const vt = [
5229
5229
  }
5230
5230
  ];
5231
5231
  var A;
5232
- ((d) => {
5233
- d.avatars = vt, d.badges = kt, d.css_color_names = ut, d.emotes = Ct, d.items = jt, d.messages = xt, d.names = Ut, d.tiers = Et, d.tts = It, d.youtube_emotes = Tt;
5232
+ ((l) => {
5233
+ l.avatars = vt, l.badges = kt, l.css_color_names = ut, l.emotes = Ct, l.items = jt, l.messages = xt, l.names = Ut, l.tiers = Et, l.tts = It, l.youtube_emotes = Tt;
5234
5234
  })(A || (A = {}));
5235
- var b;
5236
- ((d) => {
5235
+ var w;
5236
+ ((l) => {
5237
5237
  let e;
5238
5238
  ((n) => {
5239
- function l(u, o = "cardinal") {
5240
- const m = {
5239
+ function m(o, h = "cardinal") {
5240
+ const f = {
5241
5241
  single: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"],
5242
5242
  tens: [
5243
5243
  "ten",
@@ -5252,7 +5252,7 @@ var b;
5252
5252
  "nineteen"
5253
5253
  ],
5254
5254
  decades: ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
5255
- }, w = {
5255
+ }, d = {
5256
5256
  single: [
5257
5257
  "zeroth",
5258
5258
  "first",
@@ -5287,7 +5287,7 @@ var b;
5287
5287
  "eightieth",
5288
5288
  "ninetieth"
5289
5289
  ]
5290
- }, h = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"], p = [
5290
+ }, g = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"], y = [
5291
5291
  "",
5292
5292
  "thousand",
5293
5293
  "million",
@@ -5295,297 +5295,283 @@ var b;
5295
5295
  "trillion",
5296
5296
  "quadrillion",
5297
5297
  "quintillion"
5298
- ], y = p.map((U) => U ? `${U}th` : "");
5299
- if (u = Math.abs(Math.floor(u)), o === "suffix") {
5300
- const U = u % 100;
5301
- if (U >= 11 && U <= 13) return `${u}th`;
5302
- const S = u % 10;
5303
- return `${u}${h[S]}`;
5304
- }
5305
- function C(U, S) {
5306
- if (U < 10) return S === "ordinal" ? w.single[U] : m.single[U];
5307
- if (U < 20) return S === "ordinal" ? w.tens[U - 10] : m.tens[U - 10];
5308
- const L = Math.floor(U / 10), O = U % 10;
5309
- if (O === 0)
5310
- return S === "ordinal" ? w.decades[L - 2] : m.decades[L - 2];
5311
- const z = m.decades[L - 2], V = S === "ordinal" ? w.single[O] : m.single[O];
5312
- return `${z}-${V}`;
5313
- }
5314
- function k(U, S) {
5315
- if (U === 0) return S === "ordinal" ? w.single[0] : m.single[0];
5316
- const L = Math.floor(U / 100), O = U % 100, z = [];
5317
- return L > 0 && (S === "ordinal" && O === 0 ? z.push(`${m.single[L]} hundredth`) : z.push(`${m.single[L]} hundred`)), O > 0 && z.push(C(O, S)), z.join(" ");
5318
- }
5319
- if (u < 1e3) return k(u, o);
5320
- const j = [];
5321
- let D = u;
5298
+ ], v = y.map((j) => j ? `${j}th` : "");
5299
+ if (o = Math.abs(Math.floor(o)), h === "suffix") {
5300
+ const j = o % 100;
5301
+ if (j >= 11 && j <= 13) return `${o}th`;
5302
+ const J = o % 10;
5303
+ return `${o}${g[J]}`;
5304
+ }
5305
+ function C(j, J) {
5306
+ if (j < 10) return J === "ordinal" ? d.single[j] : f.single[j];
5307
+ if (j < 20) return J === "ordinal" ? d.tens[j - 10] : f.tens[j - 10];
5308
+ const R = Math.floor(j / 10), H = j % 10;
5309
+ if (H === 0)
5310
+ return J === "ordinal" ? d.decades[R - 2] : f.decades[R - 2];
5311
+ const W = f.decades[R - 2], O = J === "ordinal" ? d.single[H] : f.single[H];
5312
+ return `${W}-${O}`;
5313
+ }
5314
+ function x(j, J) {
5315
+ if (j === 0) return J === "ordinal" ? d.single[0] : f.single[0];
5316
+ const R = Math.floor(j / 100), H = j % 100, W = [];
5317
+ return R > 0 && (J === "ordinal" && H === 0 ? W.push(`${f.single[R]} hundredth`) : W.push(`${f.single[R]} hundred`)), H > 0 && W.push(C(H, J)), W.join(" ");
5318
+ }
5319
+ if (o < 1e3) return x(o, h);
5320
+ const S = [];
5321
+ let D = o;
5322
5322
  for (; D > 0; )
5323
- j.push(D % 1e3), D = Math.floor(D / 1e3);
5324
- let J = -1;
5325
- for (let U = 0; U < j.length; U++) j[U] !== 0 && (J = U);
5326
- const P = [];
5327
- for (let U = j.length - 1; U >= 0; U--) {
5328
- const S = j[U];
5329
- if (S === 0) continue;
5330
- const L = p[U];
5331
- if (o === "cardinal") {
5332
- let O = k(S, "cardinal");
5333
- L && (O += ` ${L}`), P.push(O);
5334
- } else if (U === J)
5335
- if (U > 0) {
5336
- const z = k(S, "cardinal"), V = y[U];
5337
- P.push(z ? `${z} ${V}` : V);
5323
+ S.push(D % 1e3), D = Math.floor(D / 1e3);
5324
+ let M = -1;
5325
+ for (let j = 0; j < S.length; j++) S[j] !== 0 && (M = j);
5326
+ const _ = [];
5327
+ for (let j = S.length - 1; j >= 0; j--) {
5328
+ const J = S[j];
5329
+ if (J === 0) continue;
5330
+ const R = y[j];
5331
+ if (h === "cardinal") {
5332
+ let H = x(J, "cardinal");
5333
+ R && (H += ` ${R}`), _.push(H);
5334
+ } else if (j === M)
5335
+ if (j > 0) {
5336
+ const W = x(J, "cardinal"), O = v[j];
5337
+ _.push(W ? `${W} ${O}` : O);
5338
5338
  } else {
5339
- const z = k(S, "ordinal");
5340
- P.push(z);
5339
+ const W = x(J, "ordinal");
5340
+ _.push(W);
5341
5341
  }
5342
5342
  else {
5343
- let z = k(S, "cardinal");
5344
- L && (z += ` ${L}`), P.push(z);
5343
+ let W = x(J, "cardinal");
5344
+ R && (W += ` ${R}`), _.push(W);
5345
5345
  }
5346
5346
  }
5347
- return P.join(", ");
5347
+ return _.join(", ");
5348
5348
  }
5349
- n.translate = l;
5350
- function c(u, o = 0, m = 100, w = 0) {
5351
- const h = Math.min(Math.max(u, o), m);
5352
- return f(h, w);
5349
+ n.translate = m;
5350
+ function c(o, h = 0, f = 100, d = 0) {
5351
+ const g = Math.min(Math.max(o, h), f);
5352
+ return b(g, d);
5353
5353
  }
5354
5354
  n.balance = c;
5355
- function f(u, o = 2) {
5356
- const m = Math.pow(10, o);
5357
- return Math.round(u * m) / m;
5355
+ function b(o, h = 2) {
5356
+ const f = Math.pow(10, h);
5357
+ return Math.round(o * f) / f;
5358
5358
  }
5359
- n.round = f, n.random = d.random.number;
5360
- })(e = d.number || (d.number = {})), ((n) => {
5361
- function l(f, u) {
5362
- return new Promise(
5363
- (o) => setTimeout(() => {
5364
- if (u) {
5365
- const m = u();
5366
- o(m ?? null);
5367
- } else o(null);
5368
- }, f)
5369
- );
5370
- }
5371
- n.delay = l, n.typedEntries = a.entries, n.typedValues = a.values, n.typedKeys = a.keys;
5372
- function c(f) {
5373
- const u = Object.values(f).reduce((h, p) => h + p, 0), o = (0, n.typedEntries)(f).sort((h, p) => p[1] - h[1]), m = Math.random() * u;
5374
- let w = 0;
5375
- for (const [h, p] of o)
5376
- if (w += p, m < w)
5377
- return h;
5359
+ n.round = b;
5360
+ function p(o, h, f = 0) {
5361
+ o > h && ([o, h] = [h, o]);
5362
+ const d = Math.random() * (h - o) + o;
5363
+ return f ? Number(d.toFixed(f)) : Math.round(d);
5378
5364
  }
5379
- n.probability = c;
5380
- })(d.utils || (d.utils = {}));
5365
+ n.number = p;
5366
+ })(e = l.number || (l.number = {}));
5381
5367
  let t;
5382
5368
  ((n) => {
5383
- function l(m, w, h) {
5384
- const p = w.match(/^<span(?: class="[^"]*")? style="([^"]*)">(.*)<\/span>$/s);
5385
- if (p) {
5386
- const y = p[1], C = p[2], k = p[0].match(/class="([^"]*)"/)?.[1] || "";
5387
- let j = [y, m].filter((D) => D.length).map((D) => D.endsWith(";") ? D.slice(0, -1) : D).join("; ").replace(/\s*;\s*/g, "; ").trim();
5388
- return j.endsWith(";") || (j += ";"), `<span${k ? ` class="${k} ${h ?? ""}"` : ""}${j ? ` style="${j}"` : ""}>${C}</span>`;
5369
+ function m(h, f, d) {
5370
+ const g = f.match(/^<span(?: class="[^"]*")? style="([^"]*)">(.*)<\/span>$/s);
5371
+ if (g) {
5372
+ const y = g[1], v = g[2], C = g[0].match(/class="([^"]*)"/)?.[1] || "";
5373
+ let x = [y, h].filter((S) => S.length).map((S) => S.endsWith(";") ? S.slice(0, -1) : S).join("; ").replace(/\s*;\s*/g, "; ").trim();
5374
+ return x.endsWith(";") || (x += ";"), `<span${C ? ` class="${C} ${d ?? ""}"` : ""}${x ? ` style="${x}"` : ""}>${v}</span>`;
5389
5375
  } else
5390
- return m && m.length && !m.endsWith(";") && (m += ";"), `<span${h ? ` class="${h}"` : ""}${m ? ` style="${m}"` : ""}>${w}</span>`;
5376
+ return h && h.length && !h.endsWith(";") && (h += ";"), `<span${d ? ` class="${d}"` : ""}${h ? ` style="${h}"` : ""}>${f}</span>`;
5391
5377
  }
5392
- n.mergeSpanStyles = l;
5393
- function c(m, w = 0, h = 1, p) {
5394
- const { return: y = !1, parent: C, base: k } = p || {}, j = C || m.parentElement || document.body;
5395
- if (!j)
5378
+ n.mergeSpanStyles = m;
5379
+ function c(h, f = 0, d = 1, g) {
5380
+ const { return: y = !1, parent: v, base: C } = g || {}, x = v || h.parentElement || document.body;
5381
+ if (!x)
5396
5382
  throw new Error("No parent element found for scaling");
5397
- const D = j.getBoundingClientRect(), J = m.offsetWidth, P = m.offsetHeight;
5398
- if (J === 0 || P === 0)
5383
+ const S = x.getBoundingClientRect(), D = h.offsetWidth, M = h.offsetHeight;
5384
+ if (D === 0 || M === 0)
5399
5385
  throw new Error("Element has zero width or height, cannot scale");
5400
- const U = D.width * h / J, S = D.height * h / P;
5401
- let L = k === "width" ? U : k === "height" ? S : Math.min(U, S);
5402
- if (w > 0) {
5403
- const z = D.width * w / J, V = D.height * w / P, W = Math.max(z, V);
5404
- L = Math.max(W, L);
5405
- }
5406
- const O = {
5407
- width: J * L,
5408
- height: P * L,
5409
- scale: L
5386
+ const _ = S.width * d / D, j = S.height * d / M;
5387
+ let J = C === "width" ? _ : C === "height" ? j : Math.min(_, j);
5388
+ if (f > 0) {
5389
+ const H = S.width * f / D, W = S.height * f / M, O = Math.max(H, W);
5390
+ J = Math.max(O, J);
5391
+ }
5392
+ const R = {
5393
+ width: D * J,
5394
+ height: M * J,
5395
+ scale: J
5410
5396
  };
5411
- return y || (m.style.transform = `scale(${L})`, m.style.transformOrigin = "center center"), O;
5397
+ return y || (h.style.transform = `scale(${J})`, h.style.transformOrigin = "center center"), R;
5412
5398
  }
5413
5399
  n.scale = c;
5414
- function f(m, w = {}) {
5400
+ function b(h, f = {}) {
5415
5401
  const {
5416
- parent: h = m.parentElement,
5417
- prefer: p = "auto",
5402
+ parent: d = h.parentElement,
5403
+ prefer: g = "auto",
5418
5404
  min: y = 0,
5419
- max: C = 1,
5420
- apply: k = () => {
5405
+ max: v = 1,
5406
+ apply: C = () => {
5421
5407
  }
5422
- } = w;
5423
- if (!h)
5408
+ } = f;
5409
+ if (!d)
5424
5410
  throw new Error("No parent element found for scaling");
5425
- const j = h.getBoundingClientRect(), D = m.getBoundingClientRect(), J = j.width, P = j.height, U = D.width, S = D.height;
5426
- let L = J * y / U, O = P * y / S, z = J * C / U, V = P * C / S, W = Math.min(z, V);
5427
- const F = Math.max(L, O);
5428
- W = Math.max(W, F);
5429
- const B = U * W, st = S * W;
5430
- return p === "width" ? W = Math.max(L, Math.min(z, J / U)) : p === "height" ? W = Math.max(O, Math.min(V, P / S)) : B > J ? W = Math.max(L, Math.min(z, J / U)) : st > P && (W = Math.max(O, Math.min(V, P / S))), k.apply(m, [W, m]), W;
5411
+ const x = d.getBoundingClientRect(), S = h.getBoundingClientRect(), D = x.width, M = x.height, _ = S.width, j = S.height;
5412
+ let J = D * y / _, R = M * y / j, H = D * v / _, W = M * v / j, O = Math.min(H, W);
5413
+ const F = Math.max(J, R);
5414
+ O = Math.max(O, F);
5415
+ const B = _ * O, st = j * O;
5416
+ return g === "width" ? O = Math.max(J, Math.min(H, D / _)) : g === "height" ? O = Math.max(R, Math.min(W, M / j)) : B > D ? O = Math.max(J, Math.min(H, D / _)) : st > M && (O = Math.max(R, Math.min(W, M / j))), C.apply(h, [O, h]), O;
5431
5417
  }
5432
- n.scalev2 = f;
5433
- function u(m, w = 1, h = {}) {
5434
- const p = parseFloat(getComputedStyle(m).getPropertyValue("font-size")), y = {
5435
- minFontSize: h?.minFontSize ?? 0,
5436
- maxFontSize: h?.maxFontSize ?? p
5437
- }, C = h?.parent || m.parentElement;
5438
- if (!C)
5418
+ n.scalev2 = b;
5419
+ function p(h, f = 1, d = {}) {
5420
+ const g = parseFloat(getComputedStyle(h).getPropertyValue("font-size")), y = {
5421
+ minFontSize: d?.minFontSize ?? 0,
5422
+ maxFontSize: d?.maxFontSize ?? g
5423
+ }, v = d?.parent || h.parentElement;
5424
+ if (!v)
5439
5425
  throw new Error("No parent element found for fitting text");
5440
- const k = C.clientWidth * w, j = m.offsetWidth, D = k / j, J = p * D, P = e.balance(J, y.minFontSize, y.maxFontSize);
5441
- return m.style.fontSize = P + "px", m;
5426
+ const C = v.clientWidth * f, x = h.offsetWidth, S = C / x, D = g * S, M = e.balance(D, y.minFontSize, y.maxFontSize);
5427
+ return h.style.fontSize = M + "px", h;
5442
5428
  }
5443
- n.fitText = u;
5444
- function o(m, w = 0) {
5445
- const p = new DOMParser().parseFromString(m, "text/html");
5446
- let y = w;
5447
- function C(J) {
5448
- if (J.nodeType === Node.TEXT_NODE) {
5449
- const U = (J.textContent || "").split("").map((L, O) => {
5450
- const z = document.createElement("span");
5451
- return z.classList.add("char"), z.dataset.index = String(y), z.dataset.exclusivityIndex = String(y), z.style.setProperty("--char-index", String(y)), z.style.setProperty("--exclusivity-index", String(y)), (L === " " || L === `
5452
- ` || L === " ") && (z.style.whiteSpace = "pre-wrap"), z.textContent = L, y++, z;
5453
- }), S = document.createDocumentFragment();
5454
- return U.forEach((L) => S.appendChild(L)), S;
5455
- } else if (J.nodeType === Node.ELEMENT_NODE) {
5456
- const P = J.cloneNode(!1);
5457
- return P.classList.add("container"), P.dataset.index = String(y), P.style.setProperty("--char-index", String(y)), J.childNodes.forEach((U) => {
5458
- const S = C(U);
5459
- (S instanceof DocumentFragment || S instanceof Node) && P.appendChild(S);
5460
- }), P;
5461
- }
5462
- return J.cloneNode(!0);
5463
- }
5464
- const k = p.body, j = document.createElement("div");
5465
- k.childNodes.forEach((J) => {
5466
- if (J.nodeType === Node.TEXT_NODE && !J.textContent?.trim())
5429
+ n.fitText = p;
5430
+ function o(h, f = 0) {
5431
+ const g = new DOMParser().parseFromString(h, "text/html");
5432
+ let y = f;
5433
+ function v(D) {
5434
+ if (D.nodeType === Node.TEXT_NODE) {
5435
+ const _ = (D.textContent || "").split("").map((J, R) => {
5436
+ const H = document.createElement("span");
5437
+ return H.classList.add("char"), H.dataset.index = String(y), H.dataset.exclusivityIndex = String(y), H.style.setProperty("--char-index", String(y)), H.style.setProperty("--exclusivity-index", String(y)), (J === " " || J === `
5438
+ ` || J === " ") && (H.style.whiteSpace = "pre-wrap"), H.textContent = J, y++, H;
5439
+ }), j = document.createDocumentFragment();
5440
+ return _.forEach((J) => j.appendChild(J)), j;
5441
+ } else if (D.nodeType === Node.ELEMENT_NODE) {
5442
+ const M = D.cloneNode(!1);
5443
+ return M.classList.add("container"), M.dataset.index = String(y), M.style.setProperty("--char-index", String(y)), D.childNodes.forEach((_) => {
5444
+ const j = v(_);
5445
+ (j instanceof DocumentFragment || j instanceof Node) && M.appendChild(j);
5446
+ }), M;
5447
+ }
5448
+ return D.cloneNode(!0);
5449
+ }
5450
+ const C = g.body, x = document.createElement("div");
5451
+ C.childNodes.forEach((D) => {
5452
+ if (D.nodeType === Node.TEXT_NODE && !D.textContent?.trim())
5467
5453
  return;
5468
- const P = C(J);
5469
- (P instanceof DocumentFragment || P instanceof Node) && j.appendChild(P);
5454
+ const M = v(D);
5455
+ (M instanceof DocumentFragment || M instanceof Node) && x.appendChild(M);
5470
5456
  });
5471
- let D = "";
5472
- return Array.from(j.childNodes).forEach((J) => {
5473
- J.nodeType === Node.TEXT_NODE ? D += J.textContent : D += J.outerHTML;
5474
- }), D;
5457
+ let S = "";
5458
+ return Array.from(x.childNodes).forEach((D) => {
5459
+ D.nodeType === Node.TEXT_NODE ? S += D.textContent : S += D.outerHTML;
5460
+ }), S;
5475
5461
  }
5476
5462
  n.splitTextToChars = o;
5477
- })(t = d.element || (d.element = {}));
5463
+ })(t = l.element || (l.element = {}));
5478
5464
  let a;
5479
5465
  ((n) => {
5480
- function l(o, m = !0, w = "") {
5481
- const h = {};
5482
- for (const p in o) {
5483
- if (!Object.prototype.hasOwnProperty.call(o, p)) continue;
5484
- const y = o[p], C = w ? `${w}.${p}` : p;
5466
+ function m(o, h = !0, f = "") {
5467
+ const d = {};
5468
+ for (const g in o) {
5469
+ if (!Object.prototype.hasOwnProperty.call(o, g)) continue;
5470
+ const y = o[g], v = f ? `${f}.${g}` : g;
5485
5471
  if (y == null) {
5486
- h[C] = String(y);
5472
+ d[v] = String(y);
5487
5473
  continue;
5488
5474
  }
5489
5475
  if (typeof y == "number" && isNaN(y)) {
5490
- h[C] = "NaN";
5476
+ d[v] = "NaN";
5491
5477
  continue;
5492
5478
  }
5493
5479
  if (typeof y == "number" && !isNaN(y)) {
5494
- h[C] = m ? String(y) : y;
5480
+ d[v] = h ? String(y) : y;
5495
5481
  continue;
5496
5482
  }
5497
5483
  if (y instanceof Date) {
5498
- h[C] = y.toISOString();
5484
+ d[v] = y.toISOString();
5499
5485
  continue;
5500
5486
  }
5501
5487
  if (y instanceof Map) {
5502
- y.forEach((k, j) => {
5503
- h[`${C}.${j}`] = JSON.stringify(k);
5488
+ y.forEach((C, x) => {
5489
+ d[`${v}.${x}`] = JSON.stringify(C);
5504
5490
  });
5505
5491
  continue;
5506
5492
  }
5507
5493
  if (Array.isArray(y)) {
5508
- y.forEach((k, j) => {
5509
- const D = `${C}:${j}`;
5510
- typeof k == "object" ? Object.assign(h, l(k, m, D)) : h[D] = m ? String(k) : k;
5494
+ y.forEach((C, x) => {
5495
+ const S = `${v}:${x}`;
5496
+ typeof C == "object" ? Object.assign(d, m(C, h, S)) : d[S] = h ? String(C) : C;
5511
5497
  });
5512
5498
  continue;
5513
5499
  }
5514
5500
  if (typeof y == "object") {
5515
- Object.assign(h, l(y, m, C));
5501
+ Object.assign(d, m(y, h, v));
5516
5502
  continue;
5517
5503
  }
5518
- h[C] = String(y);
5504
+ d[v] = String(y);
5519
5505
  }
5520
- return h;
5506
+ return d;
5521
5507
  }
5522
- n.flatten = l;
5508
+ n.flatten = m;
5523
5509
  function c(o) {
5524
5510
  return Object.entries(o);
5525
5511
  }
5526
5512
  n.entries = c;
5527
- function f(o) {
5513
+ function b(o) {
5528
5514
  return Object.values(o);
5529
5515
  }
5530
- n.values = f;
5531
- function u(o) {
5516
+ n.values = b;
5517
+ function p(o) {
5532
5518
  return Object.keys(o);
5533
5519
  }
5534
- n.keys = u;
5535
- })(a = d.object || (d.object = {})), ((n) => {
5536
- function l(o, m = A.emotes) {
5537
- const w = [];
5538
- return m.forEach((h) => {
5539
- const p = h.name;
5540
- let y = 0, C = 0;
5520
+ n.keys = p;
5521
+ })(a = l.object || (l.object = {})), ((n) => {
5522
+ function m(o, h = A.emotes) {
5523
+ const f = [];
5524
+ return h.forEach((d) => {
5525
+ const g = d.name;
5526
+ let y = 0, v = 0;
5541
5527
  for (; y < o.length; ) {
5542
- const k = o.indexOf(p, C);
5543
- if (k === -1) break;
5544
- const j = k > 0 ? o[k - 1] : " ", D = k + p.length < o.length ? o[k + p.length] : " ";
5545
- /\s/.test(j) && /\s/.test(D) && w.push({ ...h, start: k, end: k + p.length }), C = k + 1;
5528
+ const C = o.indexOf(g, v);
5529
+ if (C === -1) break;
5530
+ const x = C > 0 ? o[C - 1] : " ", S = C + g.length < o.length ? o[C + g.length] : " ";
5531
+ /\s/.test(x) && /\s/.test(S) && f.push({ ...d, start: C, end: C + g.length }), v = C + 1;
5546
5532
  }
5547
- }), w.sort((h, p) => h.start - p.start);
5533
+ }), f.sort((d, g) => d.start - g.start);
5548
5534
  }
5549
- n.findEmotesInText = l;
5550
- function c(o, m) {
5551
- if (!m.length) return o;
5552
- let w = "", h = 0;
5553
- return m.forEach((p) => {
5554
- w += o.substring(h, p.start);
5555
- const C = Array.from({ ...p.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || p.urls[1];
5556
- w += `<img src="${C}" alt="${p.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, h = p.end;
5557
- }), w += o.substring(h), w;
5535
+ n.findEmotesInText = m;
5536
+ function c(o, h) {
5537
+ if (!h.length) return o;
5538
+ let f = "", d = 0;
5539
+ return h.forEach((g) => {
5540
+ f += o.substring(d, g.start);
5541
+ const v = Array.from({ ...g.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || g.urls[1];
5542
+ f += `<img src="${v}" alt="${g.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, d = g.end;
5543
+ }), f += o.substring(d), f;
5558
5544
  }
5559
5545
  n.replaceEmotesWithHTML = c;
5560
- function f(o, m = A.youtube_emotes) {
5561
- return Array.from(o.matchAll(/:(.*?):/gim), (h) => h[0]).forEach((h) => {
5562
- const p = m.find(
5563
- (y) => y.shortcuts.includes(h) || y.searchTerms.includes(h.slice(1, -1))
5546
+ function b(o, h = A.youtube_emotes) {
5547
+ return Array.from(o.matchAll(/:(.*?):/gim), (d) => d[0]).forEach((d) => {
5548
+ const g = h.find(
5549
+ (y) => y.shortcuts.includes(d) || y.searchTerms.includes(d.slice(1, -1))
5564
5550
  );
5565
- if (p) {
5566
- const y = p.image.thumbnails.at(-1)?.url, C = p.image.accessibility.accessibilityData.label;
5551
+ if (g) {
5552
+ const y = g.image.thumbnails.at(-1)?.url, v = g.image.accessibility.accessibilityData.label;
5567
5553
  y && (o = o.replace(
5568
- h,
5569
- `<img src="${y}" alt="${C}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`
5554
+ d,
5555
+ `<img src="${y}" alt="${v}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`
5570
5556
  ));
5571
5557
  }
5572
5558
  }), o;
5573
5559
  }
5574
- n.replaceYoutubeEmotesWithHTML = f;
5575
- async function u(o = [], m) {
5576
- if (!Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((C) => C.trim())), !o || !o.length) {
5577
- var w = s.number(1, 3);
5578
- for await (const C of Array.from({ length: w }, () => "")) {
5579
- var h = s.array(Object.keys(A.badges))[0];
5580
- !o.includes(h) && Array.isArray(o) ? o.push(h) : o = [h];
5560
+ n.replaceYoutubeEmotesWithHTML = b;
5561
+ async function p(o = [], h) {
5562
+ if (!Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((v) => v.trim())), !o || !o.length) {
5563
+ var f = s.number(1, 3);
5564
+ for await (const v of Array.from({ length: f }, () => "")) {
5565
+ var d = s.array(Object.keys(A.badges))[0];
5566
+ !o.includes(d) && Array.isArray(o) ? o.push(d) : o = [d];
5581
5567
  }
5582
5568
  }
5583
- var p;
5584
- switch (m) {
5569
+ var g;
5570
+ switch (h) {
5585
5571
  case "twitch": {
5586
- p = {
5587
- keys: Array.from(o).filter((C) => C in A.badges),
5588
- badges: Array.from(o).slice(0, 3).map((C) => A.badges[C]).filter(Boolean)
5572
+ g = {
5573
+ keys: Array.from(o).filter((v) => v in A.badges),
5574
+ badges: Array.from(o).slice(0, 3).map((v) => A.badges[v]).filter(Boolean)
5589
5575
  };
5590
5576
  break;
5591
5577
  }
@@ -5598,8 +5584,8 @@ var b;
5598
5584
  subscriber: { isChatSponsor: !0 },
5599
5585
  moderator: { isChatModerator: !0 }
5600
5586
  };
5601
- p = Object.entries(o).reduce(
5602
- (C, [k]) => (k in y && Object.assign(C, y[k]), C),
5587
+ g = Object.entries(o).reduce(
5588
+ (v, [C]) => (C in y && Object.assign(v, y[C]), v),
5603
5589
  {
5604
5590
  isVerified: !1,
5605
5591
  isChatOwner: !1,
@@ -5610,12 +5596,12 @@ var b;
5610
5596
  break;
5611
5597
  }
5612
5598
  }
5613
- return p;
5599
+ return g;
5614
5600
  }
5615
- n.generateBadges = u;
5616
- })(d.message || (d.message = {})), ((n) => {
5617
- function l(c) {
5618
- var f = (
5601
+ n.generateBadges = p;
5602
+ })(l.message || (l.message = {})), ((n) => {
5603
+ function m(c) {
5604
+ var b = (
5619
5605
  // @ts-ignore
5620
5606
  c.event?.provider || // @ts-ignore
5621
5607
  c.event?.service || // @ts-ignore
@@ -5629,86 +5615,86 @@ var b;
5629
5615
  "tip-latest",
5630
5616
  "event:test",
5631
5617
  "event:skip"
5632
- ].some((m) => m === c.listener) && (f = "streamelements"), { provider: f, data: c };
5618
+ ].some((h) => h === c.listener) && (b = "streamelements"), { provider: b, data: c };
5633
5619
  }
5634
- n.parseProvider = l;
5635
- })(d.event || (d.event = {})), ((n) => {
5620
+ n.parseProvider = m;
5621
+ })(l.event || (l.event = {})), ((n) => {
5636
5622
  n.PRESETS = {};
5637
- async function l(u, o, m) {
5638
- const w = [];
5639
- u.replace(o, (p, ...y) => {
5640
- const C = typeof m == "function" ? m(p, ...y) : p;
5641
- return w.push(Promise.resolve(C)), p;
5623
+ async function m(p, o, h) {
5624
+ const f = [];
5625
+ p.replace(o, (g, ...y) => {
5626
+ const v = typeof h == "function" ? h(g, ...y) : g;
5627
+ return f.push(Promise.resolve(v)), g;
5642
5628
  });
5643
- const h = await Promise.all(w);
5644
- return u.replace(o, () => h.shift() ?? "");
5629
+ const d = await Promise.all(f);
5630
+ return p.replace(o, () => d.shift() ?? "");
5645
5631
  }
5646
- n.replace = l;
5647
- function c(u) {
5648
- return u.charAt(0).toUpperCase() + u.slice(1);
5632
+ n.replace = m;
5633
+ function c(p) {
5634
+ return p.charAt(0).toUpperCase() + p.slice(1);
5649
5635
  }
5650
5636
  n.capitalize = c;
5651
- function f(u, o = {}, m = {
5637
+ function b(p, o = {}, h = {
5652
5638
  method: "index",
5653
5639
  html: !1,
5654
5640
  debug: !1,
5655
5641
  modifiers: {},
5656
5642
  aliases: {}
5657
5643
  }) {
5658
- const { mergeSpanStyles: w } = t, h = (r, g, v) => m.html ? w(r, g, v) : g, p = {
5644
+ const { mergeSpanStyles: f } = t, d = (r, u, k) => h.html ? f(r, u, k) : u, g = {
5659
5645
  skip: "<br/>",
5660
5646
  newline: "<br/>",
5661
5647
  ...o
5662
5648
  };
5663
- let y = "$", C = "USD";
5649
+ let y = "$", v = "USD";
5664
5650
  if (typeof window < "u")
5665
5651
  try {
5666
- const g = window.client?.details?.currency;
5667
- g?.symbol && (y = String(g.symbol)), g?.code && (C = String(g.code));
5652
+ const u = window.client?.details?.currency;
5653
+ u?.symbol && (y = String(u.symbol)), u?.code && (v = String(u.code));
5668
5654
  } catch {
5669
5655
  }
5670
- const k = Object.entries(a.flatten(p)).reduce(
5671
- (r, [g, v]) => {
5672
- if (r[g] = String(v), ["username", "name", "nick", "nickname", "sender"].some((x) => g === x)) {
5673
- const x = r?.username || r?.name || r?.nick || r?.nickname || r?.sender;
5674
- r.username = r.username || x, r.usernameAt = `@${r.username}`, r.name = r.name || x, r.nick = r.nick || x, r.nickname = r.nickname || x, r.sender = r.sender || x, r.senderAt = `@${r.sender}`;
5656
+ const C = Object.entries(a.flatten(g)).reduce(
5657
+ (r, [u, k]) => {
5658
+ if (r[u] = String(k), ["username", "name", "nick", "nickname", "sender"].some((U) => u === U)) {
5659
+ const U = r?.username || r?.name || r?.nick || r?.nickname || r?.sender;
5660
+ r.username = r.username || U, r.usernameAt = `@${r.username}`, r.name = r.name || U, r.nick = r.nick || U, r.nickname = r.nickname || U, r.sender = r.sender || U, r.senderAt = `@${r.sender}`;
5675
5661
  }
5676
- return ["amount", "count"].some((x) => g === x) && (r.amount = String(r?.amount || r.count || v), r.count = String(r?.count || r?.amount || v)), r.currency = r.currency || y, r.currencyCode = r.currencyCode || C, r;
5662
+ return ["amount", "count"].some((U) => u === U) && (r.amount = String(r?.amount || r.count || k), r.count = String(r?.count || r?.amount || k)), r.currency = r.currency || y, r.currencyCode = r.currencyCode || v, r;
5677
5663
  },
5678
5664
  {}
5679
- ), j = {
5665
+ ), x = {
5680
5666
  PLACEHOLDERS: /{([^}]+)}/g,
5681
5667
  MODIFIERS: /\[([^\]=]+)=([^\]]+)\]/g
5682
5668
  };
5683
- var D = parseFloat(k?.amount ?? k?.count ?? 0);
5684
- function J(r, g) {
5685
- const v = r?.trim?.() ?? "";
5686
- if (!v.length) return null;
5687
- const x = g[v], I = parseFloat(String(x !== void 0 ? x : v).replace(/\s/g, ""));
5669
+ var S = parseFloat(C?.amount ?? C?.count ?? 0);
5670
+ function D(r, u) {
5671
+ const k = r?.trim?.() ?? "";
5672
+ if (!k.length) return null;
5673
+ const U = u[k], I = parseFloat(String(U !== void 0 ? U : k).replace(/\s/g, ""));
5688
5674
  return isNaN(I) ? null : I;
5689
5675
  }
5690
- function P(r, g, v) {
5691
- const x = isNaN(Number(g)) ? 0 : Math.max(0, parseInt(String(g))), N = J(r, v);
5692
- if (N === null) return r;
5676
+ function M(r, u, k) {
5677
+ const U = isNaN(Number(u)) ? 0 : Math.max(0, parseInt(String(u))), L = D(r, k);
5678
+ if (L === null) return r;
5693
5679
  try {
5694
- return N.toLocaleString(void 0, {
5695
- minimumFractionDigits: x,
5696
- maximumFractionDigits: x
5680
+ return L.toLocaleString(void 0, {
5681
+ minimumFractionDigits: U,
5682
+ maximumFractionDigits: U
5697
5683
  });
5698
5684
  } catch {
5699
- return N.toFixed(x);
5685
+ return L.toFixed(U);
5700
5686
  }
5701
5687
  }
5702
- function U(r, g = /* @__PURE__ */ new Date()) {
5703
- const v = g.getTime() - r.getTime(), x = v >= 0, N = Math.abs(v), I = Math.floor(N / 1e3), T = Math.floor(I / 60), M = Math.floor(T / 60), E = Math.floor(M / 24), H = Math.floor(E / 30), _ = Math.floor(E / 365), Y = x ? "ago" : "from now";
5704
- return _ > 0 ? `${_}y ${Y}` : H > 0 ? `${H}mo ${Y}` : E > 0 ? `${E}d ${Y}` : M > 0 ? `${M}h ${Y}` : T > 0 ? `${T}m ${Y}` : `${Math.max(I, 0)}s ${Y}`;
5688
+ function _(r, u = /* @__PURE__ */ new Date()) {
5689
+ const k = u.getTime() - r.getTime(), U = k >= 0, L = Math.abs(k), I = Math.floor(L / 1e3), T = Math.floor(I / 60), P = Math.floor(T / 60), E = Math.floor(P / 24), z = Math.floor(E / 30), V = Math.floor(E / 365), Y = U ? "ago" : "from now";
5690
+ return V > 0 ? `${V}y ${Y}` : z > 0 ? `${z}mo ${Y}` : E > 0 ? `${E}d ${Y}` : P > 0 ? `${P}h ${Y}` : T > 0 ? `${T}m ${Y}` : `${Math.max(I, 0)}s ${Y}`;
5705
5691
  }
5706
- function S(r, g, v) {
5707
- const x = r?.trim?.() ?? "";
5708
- if (!x.length) return r;
5709
- const N = v[x] ?? x, I = new Date(N);
5692
+ function j(r, u, k) {
5693
+ const U = r?.trim?.() ?? "";
5694
+ if (!U.length) return r;
5695
+ const L = k[U] ?? U, I = new Date(L);
5710
5696
  if (isNaN(I.getTime())) return r;
5711
- const T = (g ?? "date").toString().toLowerCase();
5697
+ const T = (u ?? "date").toString().toLowerCase();
5712
5698
  try {
5713
5699
  switch (T) {
5714
5700
  case "time":
@@ -5718,7 +5704,7 @@ var b;
5718
5704
  return I.toLocaleString();
5719
5705
  case "relative":
5720
5706
  case "ago":
5721
- return U(I);
5707
+ return _(I);
5722
5708
  case "iso":
5723
5709
  return I.toISOString();
5724
5710
  default:
@@ -5728,187 +5714,187 @@ var b;
5728
5714
  return r;
5729
5715
  }
5730
5716
  }
5731
- function L(r, g, v) {
5732
- const x = r ?? "", [N, I = N] = x.split("|", 2), T = g?.trim();
5733
- let M;
5734
- T && v[T] !== void 0 ? M = v[T] : M = v.amount ?? v.count;
5735
- const E = parseFloat(String(M));
5736
- return isNaN(E) ? N : Math.abs(E) !== 1 ? I : N;
5717
+ function J(r, u, k) {
5718
+ const U = r ?? "", [L, I = L] = U.split("|", 2), T = u?.trim();
5719
+ let P;
5720
+ T && k[T] !== void 0 ? P = k[T] : P = k.amount ?? k.count;
5721
+ const E = parseFloat(String(P));
5722
+ return isNaN(E) ? L : Math.abs(E) !== 1 ? I : L;
5737
5723
  }
5738
- function O(r, g, v) {
5739
- const x = g?.trim() ?? "", N = x && v[x] !== void 0 ? v[x] : "", I = String(N), T = (r ?? "").split("|").map((E) => E.trim()).filter((E) => E.length);
5740
- let M;
5724
+ function R(r, u, k) {
5725
+ const U = u?.trim() ?? "", L = U && k[U] !== void 0 ? k[U] : "", I = String(L), T = (r ?? "").split("|").map((E) => E.trim()).filter((E) => E.length);
5726
+ let P;
5741
5727
  for (const E of T) {
5742
- const H = E.indexOf(":");
5743
- if (H === -1) continue;
5744
- const _ = E.slice(0, H).trim(), Y = E.slice(H + 1);
5745
- if (_.length) {
5746
- if (_.toLowerCase() === "default") {
5747
- M = Y;
5728
+ const z = E.indexOf(":");
5729
+ if (z === -1) continue;
5730
+ const V = E.slice(0, z).trim(), Y = E.slice(z + 1);
5731
+ if (V.length) {
5732
+ if (V.toLowerCase() === "default") {
5733
+ P = Y;
5748
5734
  continue;
5749
5735
  }
5750
- if (I === _) return Y;
5736
+ if (I === V) return Y;
5751
5737
  }
5752
5738
  }
5753
- return M ?? "";
5739
+ return P ?? "";
5754
5740
  }
5755
- function z(r) {
5741
+ function H(r) {
5756
5742
  return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
5757
5743
  }
5758
- function V(r, g) {
5759
- let v = r.trim();
5760
- if (!v.length) return;
5761
- const x = v[0], N = v[v.length - 1];
5762
- if (x === '"' && N === '"' || x === "'" && N === "'")
5763
- return v.slice(1, -1);
5764
- const I = v.toLowerCase();
5744
+ function W(r, u) {
5745
+ let k = r.trim();
5746
+ if (!k.length) return;
5747
+ const U = k[0], L = k[k.length - 1];
5748
+ if (U === '"' && L === '"' || U === "'" && L === "'")
5749
+ return k.slice(1, -1);
5750
+ const I = k.toLowerCase();
5765
5751
  if (I === "true") return !0;
5766
5752
  if (I === "false") return !1;
5767
- if (/^-?\d+(\.\d+)?$/.test(v)) return parseFloat(v);
5768
- const T = g?.[v];
5769
- if (T === void 0) return v;
5770
- const M = String(T).trim(), E = M.toLowerCase();
5771
- return E === "true" ? !0 : E === "false" ? !1 : /^-?\d+(\.\d+)?$/.test(M) ? parseFloat(M) : T;
5753
+ if (/^-?\d+(\.\d+)?$/.test(k)) return parseFloat(k);
5754
+ const T = u?.[k];
5755
+ if (T === void 0) return k;
5756
+ const P = String(T).trim(), E = P.toLowerCase();
5757
+ return E === "true" ? !0 : E === "false" ? !1 : /^-?\d+(\.\d+)?$/.test(P) ? parseFloat(P) : T;
5772
5758
  }
5773
- function W(r) {
5759
+ function O(r) {
5774
5760
  if (typeof r == "boolean") return r;
5775
5761
  if (r == null) return !1;
5776
- const g = String(r).trim().toLowerCase();
5777
- return !(!g.length || ["false", "0", "no", "off", "null", "undefined", "nan"].includes(g));
5778
- }
5779
- function F(r, g) {
5780
- let v = r.trim();
5781
- if (!v.length) return !1;
5782
- let x = !1;
5783
- for (; v.startsWith("!"); )
5784
- x = !x, v = v.slice(1).trim();
5785
- const N = ["===", "!==", "==", "!=", ">=", "<=", ">", "<"];
5786
- let I = null, T = v, M = "";
5787
- for (const H of N) {
5788
- const _ = v.indexOf(H);
5789
- if (_ !== -1) {
5790
- I = H, T = v.slice(0, _), M = v.slice(_ + H.length);
5762
+ const u = String(r).trim().toLowerCase();
5763
+ return !(!u.length || ["false", "0", "no", "off", "null", "undefined", "nan"].includes(u));
5764
+ }
5765
+ function F(r, u) {
5766
+ let k = r.trim();
5767
+ if (!k.length) return !1;
5768
+ let U = !1;
5769
+ for (; k.startsWith("!"); )
5770
+ U = !U, k = k.slice(1).trim();
5771
+ const L = ["===", "!==", "==", "!=", ">=", "<=", ">", "<"];
5772
+ let I = null, T = k, P = "";
5773
+ for (const z of L) {
5774
+ const V = k.indexOf(z);
5775
+ if (V !== -1) {
5776
+ I = z, T = k.slice(0, V), P = k.slice(V + z.length);
5791
5777
  break;
5792
5778
  }
5793
5779
  }
5794
5780
  let E;
5795
5781
  if (I) {
5796
- const H = V(T, g), _ = V(M, g);
5782
+ const z = W(T, u), V = W(P, u);
5797
5783
  switch (I) {
5798
5784
  case "===":
5799
- E = H === _;
5785
+ E = z === V;
5800
5786
  break;
5801
5787
  case "!==":
5802
- E = H !== _;
5788
+ E = z !== V;
5803
5789
  break;
5804
5790
  case "==":
5805
- E = H == _;
5791
+ E = z == V;
5806
5792
  break;
5807
5793
  case "!=":
5808
- E = H != _;
5794
+ E = z != V;
5809
5795
  break;
5810
5796
  case ">=":
5811
- E = H >= _;
5797
+ E = z >= V;
5812
5798
  break;
5813
5799
  case "<=":
5814
- E = H <= _;
5800
+ E = z <= V;
5815
5801
  break;
5816
5802
  case ">":
5817
- E = H > _;
5803
+ E = z > V;
5818
5804
  break;
5819
5805
  case "<":
5820
- E = H < _;
5806
+ E = z < V;
5821
5807
  break;
5822
5808
  default:
5823
5809
  E = !1;
5824
5810
  break;
5825
5811
  }
5826
5812
  } else {
5827
- const H = V(T, g);
5828
- E = W(H);
5829
- }
5830
- return x ? !E : E;
5831
- }
5832
- function B(r, g) {
5833
- let v = r.trim();
5834
- if (!v.length) return !1;
5835
- let x = !1;
5836
- for (; v.startsWith("!"); )
5837
- x = !x, v = v.slice(1).trim();
5838
- const N = v.split("||").map((T) => T.trim()).filter((T) => T.length);
5839
- if (!N.length) return !!x;
5813
+ const z = W(T, u);
5814
+ E = O(z);
5815
+ }
5816
+ return U ? !E : E;
5817
+ }
5818
+ function B(r, u) {
5819
+ let k = r.trim();
5820
+ if (!k.length) return !1;
5821
+ let U = !1;
5822
+ for (; k.startsWith("!"); )
5823
+ U = !U, k = k.slice(1).trim();
5824
+ const L = k.split("||").map((T) => T.trim()).filter((T) => T.length);
5825
+ if (!L.length) return !!U;
5840
5826
  let I = !1;
5841
- for (const T of N) {
5842
- const M = T.split("&&").map((H) => H.trim()).filter((H) => H.length);
5843
- if (!M.length) continue;
5827
+ for (const T of L) {
5828
+ const P = T.split("&&").map((z) => z.trim()).filter((z) => z.length);
5829
+ if (!P.length) continue;
5844
5830
  let E = !0;
5845
- for (const H of M) {
5846
- const _ = F(H, g);
5847
- if (E = E && _, !E) break;
5831
+ for (const z of P) {
5832
+ const V = F(z, u);
5833
+ if (E = E && V, !E) break;
5848
5834
  }
5849
5835
  if (I = I || E, I) break;
5850
5836
  }
5851
- return x ? !I : I;
5837
+ return U ? !I : I;
5852
5838
  }
5853
5839
  const st = {
5854
- COLOR: (r, g) => h(g && i.validate(g) ? `color: ${g}` : "", r, "color"),
5855
- WEIGHT: (r, g) => h(g && !isNaN(parseInt(g)) ? `font-weight: ${g}` : "", r, "weight"),
5856
- SEMIBOLD: (r) => h("font-weight: 600", r, "semibold"),
5857
- BOLD: (r) => h("font-weight: bold", r, "bold"),
5858
- BLACK: (r) => h("font-weight: 900", r, "black"),
5859
- LIGHT: (r) => h("font-weight: lighter", r, "light"),
5860
- STRONG: (r) => h("font-weight: bolder", r, "strong"),
5861
- ITALIC: (r) => h("font-style: italic", r, "italic"),
5862
- UNDERLINE: (r) => h("text-decoration: underline", r, "underline"),
5863
- STRIKETHROUGH: (r) => h("text-decoration: line-through", r, "strikethrough"),
5864
- SUB: (r) => h("vertical-align: sub", r, "sub"),
5865
- SUP: (r) => h("vertical-align: super", r, "sup"),
5866
- LARGER: (r) => h("font-size: larger", r, "larger"),
5867
- SMALL: (r) => h("font-size: smaller", r, "small"),
5868
- SHADOW: (r, g) => h(`text-shadow: ${g}`, r, "shadow"),
5869
- SIZE: (r, g) => h(g ? `font-size: ${g}` : "", r, "size")
5840
+ COLOR: (r, u) => d(u && i.validate(u) ? `color: ${u}` : "", r, "color"),
5841
+ WEIGHT: (r, u) => d(u && !isNaN(parseInt(u)) ? `font-weight: ${u}` : "", r, "weight"),
5842
+ SEMIBOLD: (r) => d("font-weight: 600", r, "semibold"),
5843
+ BOLD: (r) => d("font-weight: bold", r, "bold"),
5844
+ BLACK: (r) => d("font-weight: 900", r, "black"),
5845
+ LIGHT: (r) => d("font-weight: lighter", r, "light"),
5846
+ STRONG: (r) => d("font-weight: bolder", r, "strong"),
5847
+ ITALIC: (r) => d("font-style: italic", r, "italic"),
5848
+ UNDERLINE: (r) => d("text-decoration: underline", r, "underline"),
5849
+ STRIKETHROUGH: (r) => d("text-decoration: line-through", r, "strikethrough"),
5850
+ SUB: (r) => d("vertical-align: sub", r, "sub"),
5851
+ SUP: (r) => d("vertical-align: super", r, "sup"),
5852
+ LARGER: (r) => d("font-size: larger", r, "larger"),
5853
+ SMALL: (r) => d("font-size: smaller", r, "small"),
5854
+ SHADOW: (r, u) => d(`text-shadow: ${u}`, r, "shadow"),
5855
+ SIZE: (r, u) => d(u ? `font-size: ${u}` : "", r, "size")
5870
5856
  }, dt = {
5871
5857
  ...{
5872
- BT1: (r) => D > 1 ? r : "",
5873
- BT0: (r) => D > 0 ? r : "",
5874
- ST1: (r) => D < 1 ? r : "",
5875
- ST0: (r) => D < 0 ? r : "",
5858
+ BT1: (r) => S > 1 ? r : "",
5859
+ BT0: (r) => S > 0 ? r : "",
5860
+ ST1: (r) => S < 1 ? r : "",
5861
+ ST0: (r) => S < 0 ? r : "",
5876
5862
  UPC: (r) => r.toUpperCase(),
5877
5863
  LOW: (r) => r.toLowerCase(),
5878
5864
  REV: (r) => r.split("").reverse().join(""),
5879
5865
  CAP: (r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase(),
5880
- NUMBER: (r, g, v) => P(r, g, v),
5881
- PLURAL: (r, g, v) => L(r, g, v),
5882
- DATE: (r, g, v) => S(r, g, v),
5883
- MAP: (r, g, v) => O(r, g, v),
5884
- ESCAPE: (r) => z(r),
5885
- IF: (r, g, v) => {
5886
- const x = r ?? "", [N, I] = x.split("?", 2);
5887
- if (!I) return x;
5888
- const [T, M = ""] = I.split("|", 2);
5866
+ NUMBER: (r, u, k) => M(r, u, k),
5867
+ PLURAL: (r, u, k) => J(r, u, k),
5868
+ DATE: (r, u, k) => j(r, u, k),
5869
+ MAP: (r, u, k) => R(r, u, k),
5870
+ ESCAPE: (r) => H(r),
5871
+ IF: (r, u, k) => {
5872
+ const U = r ?? "", [L, I] = U.split("?", 2);
5873
+ if (!I) return U;
5874
+ const [T, P = ""] = I.split("|", 2);
5889
5875
  return B(
5890
- N,
5891
- v
5892
- ) ? T : M;
5876
+ L,
5877
+ k
5878
+ ) ? T : P;
5893
5879
  },
5894
- PRESET: (r, g) => {
5895
- const v = g?.trim() ?? "";
5896
- if (!v.length) return r;
5897
- const x = n.PRESETS[v];
5898
- if (!x || !x.length) return r;
5899
- const N = x.split(",").map((T) => T.trim()).filter((T) => T.length).map((T) => {
5900
- const [M, E] = T.split(":");
5901
- return { name: M.trim(), param: E?.trim() ?? null };
5880
+ PRESET: (r, u) => {
5881
+ const k = u?.trim() ?? "";
5882
+ if (!k.length) return r;
5883
+ const U = n.PRESETS[k];
5884
+ if (!U || !U.length) return r;
5885
+ const L = U.split(",").map((T) => T.trim()).filter((T) => T.length).map((T) => {
5886
+ const [P, E] = T.split(":");
5887
+ return { name: P.trim(), param: E?.trim() ?? null };
5902
5888
  });
5903
5889
  let I = r;
5904
- for (const { name: T, param: M } of N)
5905
- I = K(I, T, M);
5890
+ for (const { name: T, param: P } of L)
5891
+ I = K(I, T, P);
5906
5892
  return I;
5907
5893
  },
5908
- FALLBACK: (r, g) => r.length ? r : g ?? r
5894
+ FALLBACK: (r, u) => r.length ? r : u ?? r
5909
5895
  },
5910
- ...m?.html ? st : {},
5911
- ...m.modifiers ?? {}
5896
+ ...h?.html ? st : {},
5897
+ ...h.modifiers ?? {}
5912
5898
  }, ht = {
5913
5899
  UPC: ["UPPERCASE", "UPPER", "UPP"],
5914
5900
  LOW: ["LOWERCASE", "LOWER", "LWC"],
@@ -5937,181 +5923,181 @@ var b;
5937
5923
  SHADOW: ["SHADOW", "SHD"],
5938
5924
  FALLBACK: ["FALLBACK", "FB"],
5939
5925
  IF: ["IF", "COND", "CONDITION"],
5940
- ...m.aliases ?? {}
5926
+ ...h.aliases ?? {}
5941
5927
  };
5942
- function K(r, g, v) {
5943
- const x = Object.entries(ht).find(([I, T]) => T.some((M) => M.toUpperCase() === g.toUpperCase()) ? !0 : I.toUpperCase() === g.toUpperCase()), N = x ? x[0] : g.toUpperCase();
5928
+ function K(r, u, k) {
5929
+ const U = Object.entries(ht).find(([I, T]) => T.some((P) => P.toUpperCase() === u.toUpperCase()) ? !0 : I.toUpperCase() === u.toUpperCase()), L = U ? U[0] : u.toUpperCase();
5944
5930
  try {
5945
- return dt[N] ? dt[N](r, typeof v == "string" ? v.trim() : null, k) : m?.html ? h("", r, N.toLowerCase()) : r;
5931
+ return dt[L] ? dt[L](r, typeof k == "string" ? k.trim() : null, C) : h?.html ? d("", r, L.toLowerCase()) : r;
5946
5932
  } catch (I) {
5947
- return m?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: g, param: v, error: I }), r;
5933
+ return h?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: u, param: k, error: I }), r;
5948
5934
  }
5949
5935
  }
5950
5936
  function nt(r) {
5951
- let g = r, v;
5952
- for (; (v = j.MODIFIERS.exec(g)) !== null; ) {
5953
- const [x, N, I] = v, T = N.split(",").map((E) => E.trim()).filter((E) => E.length).map((E) => {
5954
- const [H, _] = E.split(":");
5955
- return { name: H.trim(), param: _?.trim() ?? null };
5937
+ let u = r, k;
5938
+ for (; (k = x.MODIFIERS.exec(u)) !== null; ) {
5939
+ const [U, L, I] = k, T = L.split(",").map((E) => E.trim()).filter((E) => E.length).map((E) => {
5940
+ const [z, V] = E.split(":");
5941
+ return { name: z.trim(), param: V?.trim() ?? null };
5956
5942
  });
5957
- let M = nt(I);
5958
- for (const { name: E, param: H } of T)
5959
- M = K(M, E, H);
5960
- g = g.replace(x, M ?? ""), j.MODIFIERS.lastIndex = 0;
5943
+ let P = nt(I);
5944
+ for (const { name: E, param: z } of T)
5945
+ P = K(P, E, z);
5946
+ u = u.replace(U, P ?? ""), x.MODIFIERS.lastIndex = 0;
5961
5947
  }
5962
- return g;
5948
+ return u;
5963
5949
  }
5964
5950
  function Q(r) {
5965
- let g = 0;
5966
- const v = r.length;
5967
- function x(I) {
5951
+ let u = 0;
5952
+ const k = r.length;
5953
+ function U(I) {
5968
5954
  let T = "";
5969
- for (; g < v; )
5970
- if (r[g] === "\\")
5971
- g + 1 < v ? (T += r[g + 1], g += 2) : g++;
5972
- else if (r[g] === "[" && (!I || I !== "["))
5973
- T += N();
5974
- else if (I && r[g] === I) {
5975
- g++;
5955
+ for (; u < k; )
5956
+ if (r[u] === "\\")
5957
+ u + 1 < k ? (T += r[u + 1], u += 2) : u++;
5958
+ else if (r[u] === "[" && (!I || I !== "["))
5959
+ T += L();
5960
+ else if (I && r[u] === I) {
5961
+ u++;
5976
5962
  break;
5977
5963
  } else
5978
- T += r[g++];
5964
+ T += r[u++];
5979
5965
  return T;
5980
5966
  }
5981
- function N() {
5982
- g++;
5967
+ function L() {
5968
+ u++;
5983
5969
  const I = [];
5984
- for (; g < v && r[g] !== "="; ) {
5985
- if (r[g] === ",") {
5986
- g++;
5970
+ for (; u < k && r[u] !== "="; ) {
5971
+ if (r[u] === ",") {
5972
+ u++;
5987
5973
  continue;
5988
5974
  }
5989
- let M = "";
5990
- for (; g < v && /[A-Za-z0-9]/.test(r[g]); ) M += r[g++];
5975
+ let P = "";
5976
+ for (; u < k && /[A-Za-z0-9]/.test(r[u]); ) P += r[u++];
5991
5977
  let E = null;
5992
- if (r[g] === ":") {
5993
- g++;
5994
- const H = g;
5995
- for (; g < v && r[g] !== "," && r[g] !== "="; ) g++;
5996
- E = r.slice(H, g);
5978
+ if (r[u] === ":") {
5979
+ u++;
5980
+ const z = u;
5981
+ for (; u < k && r[u] !== "," && r[u] !== "="; ) u++;
5982
+ E = r.slice(z, u);
5997
5983
  }
5998
- M.length && I.push({ name: M, param: E }), r[g] === "," && g++;
5984
+ P.length && I.push({ name: P, param: E }), r[u] === "," && u++;
5999
5985
  }
6000
- r[g] === "=" && g++;
6001
- const T = x("]");
6002
- return I.reduce((M, { name: E, param: H }) => K(M, E, H), T);
5986
+ r[u] === "=" && u++;
5987
+ const T = U("]");
5988
+ return I.reduce((P, { name: E, param: z }) => K(P, E, z), T);
6003
5989
  }
6004
- return x();
5990
+ return U();
6005
5991
  }
6006
- let $ = u.replace(
6007
- j.PLACEHOLDERS,
6008
- (r, g) => typeof k[g] == "string" || typeof k[g] == "number" ? String(k[g]) : g ?? g
5992
+ let $ = p.replace(
5993
+ x.PLACEHOLDERS,
5994
+ (r, u) => typeof C[u] == "string" || typeof C[u] == "number" ? String(C[u]) : u ?? u
6009
5995
  );
6010
- return $ = m.method === "loop" ? nt($) : Q($), $;
5996
+ return $ = h.method === "loop" ? nt($) : Q($), $;
6011
5997
  }
6012
- n.compose = f;
6013
- })(d.string || (d.string = {})), ((n) => {
5998
+ n.compose = b;
5999
+ })(l.string || (l.string = {})), ((n) => {
6014
6000
  n.playing = !1;
6015
- function l(c, f = 100, u = !1) {
6001
+ function m(c, b = 100, p = !1) {
6016
6002
  if (!c || !c.length)
6017
6003
  throw new Error("No sound URL provided");
6018
6004
  try {
6019
- u && n.playing && n.audio && n.audio.state !== "closed" && n.audio.close();
6020
- let o = new AudioContext(), m = o.createGain();
6021
- m.connect(o.destination), u && (n.audio = o, n.playing = !0), fetch(c).then((w) => w.arrayBuffer()).then((w) => o.decodeAudioData(w)).then((w) => {
6005
+ p && n.playing && n.audio && n.audio.state !== "closed" && n.audio.close();
6006
+ let o = new AudioContext(), h = o.createGain();
6007
+ h.connect(o.destination), p && (n.audio = o, n.playing = !0), fetch(c).then((f) => f.arrayBuffer()).then((f) => o.decodeAudioData(f)).then((f) => {
6022
6008
  if (o.state !== "closed") {
6023
- const h = o.createBufferSource();
6024
- h.buffer = w, h.connect(m), m.gain.value = f / 100, h.start(o.currentTime);
6009
+ const d = o.createBufferSource();
6010
+ d.buffer = f, d.connect(h), h.gain.value = b / 100, d.start(o.currentTime);
6025
6011
  }
6026
6012
  });
6027
6013
  } catch (o) {
6028
6014
  throw new Error(`Error playing sound: ${o}`);
6029
6015
  }
6030
6016
  }
6031
- n.play = l;
6032
- })(d.sound || (d.sound = {}));
6017
+ n.play = m;
6018
+ })(l.sound || (l.sound = {}));
6033
6019
  let i;
6034
6020
  ((n) => {
6035
- function l(o = 100, m = "") {
6036
- m = m.length > 7 ? m?.substring(0, 6) : m, o = o > 1 ? o / 100 : o;
6037
- let w = Math.round(Math.min(Math.max(o, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
6038
- return m + w;
6021
+ function m(o = 100, h = "") {
6022
+ h = h.length > 7 ? h?.substring(0, 6) : h, o = o > 1 ? o / 100 : o;
6023
+ let f = Math.round(Math.min(Math.max(o, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
6024
+ return h + f;
6039
6025
  }
6040
- n.opacity = l;
6026
+ n.opacity = m;
6041
6027
  function c(o) {
6042
6028
  if (!o.startsWith("#") || o.length <= 7)
6043
6029
  return {
6044
6030
  color: o,
6045
6031
  opacity: 100
6046
6032
  };
6047
- var h = o.slice(-2), m = parseInt(h, 16) / 255, w = Math.round(m * 100), h = o.length > 7 ? o.slice(0, 7) : o;
6033
+ var d = o.slice(-2), h = parseInt(d, 16) / 255, f = Math.round(h * 100), d = o.length > 7 ? o.slice(0, 7) : o;
6048
6034
  return {
6049
- color: h,
6050
- opacity: w
6035
+ color: d,
6036
+ opacity: f
6051
6037
  };
6052
6038
  }
6053
6039
  n.extract = c;
6054
- function f(o) {
6040
+ function b(o) {
6055
6041
  if (typeof o != "string" || !String(o).trim().length) return !1;
6056
- const m = o.trim();
6057
- return /^#([A-Fa-f0-9]{3}){1,2}$/.test(m) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(m) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(m) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(m) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(m) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(m) ? "hsla" : A.css_color_names.includes(m.toLowerCase()) ? "css-color-name" : !1;
6042
+ const h = o.trim();
6043
+ return /^#([A-Fa-f0-9]{3}){1,2}$/.test(h) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(h) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(h) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(h) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(h) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(h) ? "hsla" : A.css_color_names.includes(h.toLowerCase()) ? "css-color-name" : !1;
6058
6044
  }
6059
- n.validate = f;
6060
- async function u(o, m) {
6061
- const w = f(o);
6062
- if (!w) throw new Error(`Invalid color format: ${o}`);
6063
- if (w === m) throw new Error(`Color is already in the desired format: ${m}`);
6064
- const h = ft(o.trim(), w);
6065
- if (!h) throw new Error(`Failed to parse color: ${o}`);
6066
- switch (m) {
6045
+ n.validate = b;
6046
+ async function p(o, h) {
6047
+ const f = b(o);
6048
+ if (!f) throw new Error(`Invalid color format: ${o}`);
6049
+ if (f === h) throw new Error(`Color is already in the desired format: ${h}`);
6050
+ const d = ft(o.trim(), f);
6051
+ if (!d) throw new Error(`Failed to parse color: ${o}`);
6052
+ switch (h) {
6067
6053
  case "hex":
6068
- return bt(h, !1);
6054
+ return bt(d, !1);
6069
6055
  case "rgb":
6070
- return `rgb(${h.r}, ${h.g}, ${h.b})`;
6056
+ return `rgb(${d.r}, ${d.g}, ${d.b})`;
6071
6057
  case "rgba":
6072
- return `rgba(${h.r}, ${h.g}, ${h.b}, ${h.a})`;
6058
+ return `rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`;
6073
6059
  case "hsl": {
6074
- const p = lt(h.r, h.g, h.b);
6075
- return `hsl(${p.h}, ${p.s}%, ${p.l}%)`;
6060
+ const g = lt(d.r, d.g, d.b);
6061
+ return `hsl(${g.h}, ${g.s}%, ${g.l}%)`;
6076
6062
  }
6077
6063
  case "hsla": {
6078
- const p = lt(h.r, h.g, h.b);
6079
- return `hsla(${p.h}, ${p.s}%, ${p.l}%, ${h.a})`;
6064
+ const g = lt(d.r, d.g, d.b);
6065
+ return `hsla(${g.h}, ${g.s}%, ${g.l}%, ${d.a})`;
6080
6066
  }
6081
6067
  case "css-color-name":
6082
- return await wt(h.r, h.g, h.b);
6068
+ return await wt(d.r, d.g, d.b);
6083
6069
  default:
6084
6070
  return null;
6085
6071
  }
6086
6072
  }
6087
- n.convert = u;
6088
- })(i = d.color || (d.color = {}));
6073
+ n.convert = p;
6074
+ })(i = l.color || (l.color = {}));
6089
6075
  let s;
6090
6076
  ((n) => {
6091
- function l(p = "hex") {
6092
- switch (p) {
6077
+ function m(g = "hex") {
6078
+ switch (g) {
6093
6079
  default:
6094
6080
  case "hex":
6095
6081
  return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
6096
6082
  case "hexa": {
6097
- const C = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`, k = Math.floor(Math.random() * 256).toString(16).padStart(2, "0");
6098
- return C + k;
6083
+ const v = `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`, C = Math.floor(Math.random() * 256).toString(16).padStart(2, "0");
6084
+ return v + C;
6099
6085
  }
6100
6086
  case "rgb": {
6101
- const C = Math.floor(Math.random() * 256), k = Math.floor(Math.random() * 256), j = Math.floor(Math.random() * 256);
6102
- return `rgb(${C}, ${k}, ${j})`;
6087
+ const v = Math.floor(Math.random() * 256), C = Math.floor(Math.random() * 256), x = Math.floor(Math.random() * 256);
6088
+ return `rgb(${v}, ${C}, ${x})`;
6103
6089
  }
6104
6090
  case "rgba": {
6105
- const C = Math.floor(Math.random() * 256), k = Math.floor(Math.random() * 256), j = Math.floor(Math.random() * 256), D = Math.random().toFixed(2);
6106
- return `rgba(${C}, ${k}, ${j}, ${D})`;
6091
+ const v = Math.floor(Math.random() * 256), C = Math.floor(Math.random() * 256), x = Math.floor(Math.random() * 256), S = Math.random().toFixed(2);
6092
+ return `rgba(${v}, ${C}, ${x}, ${S})`;
6107
6093
  }
6108
6094
  case "hsl": {
6109
- const C = Math.floor(Math.random() * 361), k = Math.floor(Math.random() * 101), j = Math.floor(Math.random() * 101);
6110
- return `hsl(${C}, ${k}%, ${j}%)`;
6095
+ const v = Math.floor(Math.random() * 361), C = Math.floor(Math.random() * 101), x = Math.floor(Math.random() * 101);
6096
+ return `hsl(${v}, ${C}%, ${x}%)`;
6111
6097
  }
6112
6098
  case "hsla": {
6113
- const C = Math.floor(Math.random() * 361), k = Math.floor(Math.random() * 101), j = Math.floor(Math.random() * 101), D = Math.random().toFixed(2);
6114
- return `hsla(${C}, ${k}%, ${j}%, ${D})`;
6099
+ const v = Math.floor(Math.random() * 361), C = Math.floor(Math.random() * 101), x = Math.floor(Math.random() * 101), S = Math.random().toFixed(2);
6100
+ return `hsla(${v}, ${C}%, ${x}%, ${S})`;
6115
6101
  }
6116
6102
  case "css-color-name": {
6117
6103
  var y = A.css_color_names;
@@ -6119,66 +6105,98 @@ var b;
6119
6105
  }
6120
6106
  }
6121
6107
  }
6122
- n.color = l;
6123
- function c(p, y, C = 0) {
6124
- p > y && ([p, y] = [y, p]);
6125
- const k = Math.random() * (y - p) + p;
6126
- return C ? Number(k.toFixed(C)) : Math.round(k);
6108
+ n.color = m;
6109
+ function c(g, y, v = 0) {
6110
+ g > y && ([g, y] = [y, g]);
6111
+ const C = Math.random() * (y - g) + g;
6112
+ return v ? Number(C.toFixed(v)) : Math.round(C);
6127
6113
  }
6128
6114
  n.number = c;
6129
- function f(p = 0.5) {
6130
- return Math.random() > p;
6115
+ function b(g = 0.5) {
6116
+ return Math.random() > g;
6131
6117
  }
6132
- n.boolean = f;
6133
- function u(p, y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
6134
- let C = "";
6135
- for (let k = 0; k < p; k++)
6136
- C += y.charAt(Math.floor(Math.random() * y.length));
6137
- return C;
6118
+ n.boolean = b;
6119
+ function p(g, y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
6120
+ let v = "";
6121
+ for (let C = 0; C < g; C++)
6122
+ v += y.charAt(Math.floor(Math.random() * y.length));
6123
+ return v;
6138
6124
  }
6139
- n.string = u;
6140
- function o(p) {
6141
- const y = c(0, p.length - 1);
6142
- return [p[y], y];
6125
+ n.string = p;
6126
+ function o(g) {
6127
+ const y = c(0, g.length - 1);
6128
+ return [g[y], y];
6143
6129
  }
6144
6130
  n.array = o;
6145
- function m(p = new Date(2e3, 0, 1), y = /* @__PURE__ */ new Date()) {
6146
- return new Date(c(p.getTime(), y.getTime()));
6131
+ function h(g = new Date(2e3, 0, 1), y = /* @__PURE__ */ new Date()) {
6132
+ return new Date(c(g.getTime(), y.getTime()));
6147
6133
  }
6148
- n.date = m;
6149
- function w(p) {
6150
- const C = Date.now() - c(0, p * 24 * 60 * 60 * 1e3);
6151
- return new Date(C).toISOString();
6134
+ n.date = h;
6135
+ function f(g) {
6136
+ const v = Date.now() - c(0, g * 24 * 60 * 60 * 1e3);
6137
+ return new Date(v).toISOString();
6152
6138
  }
6153
- n.daysOffset = w;
6154
- function h() {
6139
+ n.daysOffset = f;
6140
+ function d() {
6155
6141
  return crypto.randomUUID();
6156
6142
  }
6157
- n.uuid = h;
6158
- })(s = d.random || (d.random = {})), ((n) => {
6159
- function l(f, u, o) {
6160
- return f.apply(u, o);
6143
+ n.uuid = d;
6144
+ })(s = l.random || (l.random = {})), ((n) => {
6145
+ function m(b, p, o) {
6146
+ return b.apply(p, o);
6161
6147
  }
6162
- n.apply = l;
6163
- function c(f, u, ...o) {
6164
- return f.call(u, ...o);
6148
+ n.apply = m;
6149
+ function c(b, p, ...o) {
6150
+ return b.call(p, ...o);
6165
6151
  }
6166
6152
  n.call = c;
6167
- })(d.fn || (d.fn = {}));
6168
- })(b || (b = {}));
6153
+ })(l.fn || (l.fn = {})), ((n) => {
6154
+ function m(h, f) {
6155
+ return new Promise(
6156
+ (d) => setTimeout(() => {
6157
+ if (f) {
6158
+ const g = f();
6159
+ d(g ?? null);
6160
+ } else d(null);
6161
+ }, h)
6162
+ );
6163
+ }
6164
+ n.delay = m;
6165
+ function c(h) {
6166
+ return Object.entries(h);
6167
+ }
6168
+ n.typedEntries = c;
6169
+ function b(h) {
6170
+ return Object.values(h);
6171
+ }
6172
+ n.typedValues = b;
6173
+ function p(h) {
6174
+ return Object.keys(h);
6175
+ }
6176
+ n.typedKeys = p;
6177
+ function o(h) {
6178
+ const f = Object.values(h).reduce((v, C) => v + C, 0), d = c(h).sort((v, C) => C[1] - v[1]), g = Math.random() * f;
6179
+ let y = 0;
6180
+ for (const [v, C] of d)
6181
+ if (y += C, g < y)
6182
+ return v;
6183
+ }
6184
+ n.probability = o;
6185
+ })(l.utils || (l.utils = {}));
6186
+ })(w || (w = {}));
6169
6187
  class at {
6170
6188
  constructor(e) {
6171
6189
  this.field = "button", this.template = "button", this.name = "Button", this.value = "", window.client instanceof G && (this.field = e.field ?? this.field, this.template = e.template ?? (typeof this.field == "string" ? this.field : this.template), this.name = e.name ?? this.name, this.value = e.value ?? this.value, this.run = e.run, window.client.actions.buttons.push(this), window.client.emit("action", this, "created"));
6172
6190
  }
6173
6191
  generate(e) {
6174
- return b.utils.typedValues(e).reduce(
6192
+ return w.utils.typedValues(e).reduce(
6175
6193
  (a, i, s) => {
6176
- const n = b.string.compose(this.template, { index: s, ...i }, { html: !1 }), l = b.string.compose(this.name, { index: s, ...i }, { html: !1 });
6194
+ const n = w.string.compose(this.template, { index: s, ...i }, { html: !1 }), m = w.string.compose(this.name, { index: s, ...i }, { html: !1 });
6177
6195
  a[n] = {
6178
6196
  type: "button",
6179
- label: l
6197
+ label: m
6180
6198
  };
6181
- let c = b.string.compose(String(this.value), { index: s, ...i }, { html: !1 });
6199
+ let c = w.string.compose(String(this.value), { index: s, ...i }, { html: !1 });
6182
6200
  return isNaN(Number(c)) ? c.toLowerCase() === "true" ? c = !0 : c.toLowerCase() === "false" && (c = !1) : c = Number(c), typeof c < "u" && c && (typeof c != "string" || c.length) && (a[n].value = c), a;
6183
6201
  },
6184
6202
  {}
@@ -6206,9 +6224,9 @@ class at {
6206
6224
  if (a.length && a.every((i) => i instanceof at))
6207
6225
  return a.forEach((i) => {
6208
6226
  try {
6209
- i.parse(e, t), window.client.emit("action", i, "executed"), R.received(`Button executed: ${e}${t ? ` with value: ${t}` : ""}`);
6227
+ i.parse(e, t), window.client.emit("action", i, "executed"), N.received(`Button executed: ${e}${t ? ` with value: ${t}` : ""}`);
6210
6228
  } catch (s) {
6211
- R.error(`Error executing button "${e}": ${s instanceof Error ? s.message : s}`);
6229
+ N.error(`Error executing button "${e}": ${s instanceof Error ? s.message : s}`);
6212
6230
  }
6213
6231
  }), !0;
6214
6232
  }
@@ -6220,8 +6238,8 @@ class at {
6220
6238
  }
6221
6239
  }
6222
6240
  var q;
6223
- ((d) => {
6224
- d.generate = {
6241
+ ((l) => {
6242
+ l.generate = {
6225
6243
  session: {
6226
6244
  types: {
6227
6245
  name: { type: "string", options: A.names.filter((t) => t.length) },
@@ -6599,45 +6617,45 @@ var q;
6599
6617
  const a = this.available();
6600
6618
  if (t) return t;
6601
6619
  const i = (n) => {
6602
- const l = (u) => {
6603
- if (!u || !("amount" in u)) return [];
6620
+ const m = (p) => {
6621
+ if (!p || !("amount" in p)) return [];
6604
6622
  const o = [];
6605
- for (let m = 0; m < u.amount; m++)
6606
- o.push(i(u.value));
6623
+ for (let h = 0; h < p.amount; h++)
6624
+ o.push(i(p.value));
6607
6625
  return o.sort(
6608
- (m, w) => new Date(w.createdAt).getTime() - new Date(m.createdAt).getTime()
6626
+ (h, f) => new Date(f.createdAt).getTime() - new Date(h.createdAt).getTime()
6609
6627
  );
6610
- }, c = (u) => {
6628
+ }, c = (p) => {
6611
6629
  const o = {};
6612
- for (const m in u) {
6613
- const w = m.replace("_type", "type");
6614
- o[w] = i(u[m]);
6630
+ for (const h in p) {
6631
+ const f = h.replace("_type", "type");
6632
+ o[f] = i(p[h]);
6615
6633
  }
6616
6634
  return o;
6617
- }, f = (u) => {
6618
- if (!u) return u;
6619
- switch (u.type) {
6635
+ }, b = (p) => {
6636
+ if (!p) return p;
6637
+ switch (p.type) {
6620
6638
  case "int":
6621
- return b.random.number(u.min, u.max);
6639
+ return w.random.number(p.min, p.max);
6622
6640
  case "string":
6623
- return b.random.array(u.options)[0];
6641
+ return w.random.array(p.options)[0];
6624
6642
  case "date":
6625
- return b.random.daysOffset(u.range);
6643
+ return w.random.daysOffset(p.range);
6626
6644
  case "array":
6627
- return b.random.array(u.options)[0];
6645
+ return w.random.array(p.options)[0];
6628
6646
  case "recent":
6629
- return l(u);
6647
+ return m(p);
6630
6648
  default:
6631
- return u;
6649
+ return p;
6632
6650
  }
6633
6651
  };
6634
- return typeof n != "object" || n === null ? n : "type" in n && typeof n.type == "string" ? f(n) : c(n);
6652
+ return typeof n != "object" || n === null ? n : "type" in n && typeof n.type == "string" ? b(n) : c(n);
6635
6653
  };
6636
6654
  var s = Object.entries(i(a)).reduce(
6637
- (n, [l, c]) => (Object.entries(c).forEach(
6638
- ([f, u]) => (
6655
+ (n, [m, c]) => (Object.entries(c).forEach(
6656
+ ([b, p]) => (
6639
6657
  //
6640
- n[`${l}-${f}`] = u
6658
+ n[`${m}-${b}`] = p
6641
6659
  )
6642
6660
  ), n),
6643
6661
  {}
@@ -6691,27 +6709,27 @@ var q;
6691
6709
  * @returns A Promise that resolves to the simulated onSessionUpdate event data.
6692
6710
  */
6693
6711
  async onSessionUpdate(t, a) {
6694
- if (t ??= await d.generate.session.get(), a) {
6712
+ if (t ??= await l.generate.session.get(), a) {
6695
6713
  const i = (s, n) => new Date(n.createdAt).getTime() - new Date(s.createdAt).getTime();
6696
6714
  switch (a.provider) {
6697
6715
  case "twitch": {
6698
6716
  const s = a.data;
6699
6717
  switch (s.listener) {
6700
6718
  case "cheer-latest": {
6701
- const n = s.event.amount, l = s.event.displayName ?? s.event.name, c = s.event.message;
6702
- t["cheer-latest"] = { name: l, amount: n, message: c };
6703
- const f = (u) => {
6704
- if (u === "all") {
6705
- f("alltime"), f("monthly"), f("weekly"), f("session");
6719
+ const n = s.event.amount, m = s.event.displayName ?? s.event.name, c = s.event.message;
6720
+ t["cheer-latest"] = { name: m, amount: n, message: c };
6721
+ const b = (p) => {
6722
+ if (p === "all") {
6723
+ b("alltime"), b("monthly"), b("weekly"), b("session");
6706
6724
  return;
6707
6725
  }
6708
- const o = t[`cheer-${u}-top-donation`];
6709
- o && n > o.amount && (o.amount = n, o.name = l);
6710
- const m = t[`cheer-${u}-top-donator`], w = t["cheer-recent"].filter((p) => p.name.toLowerCase() === m.name.toLowerCase()).reduce((p, y) => p + y.amount, 0), h = t["cheer-recent"].filter((p) => p.name.toLowerCase() === l.toLowerCase()).reduce((p, y) => p + y.amount, 0);
6711
- h > w && (m.amount = h, m.name = l);
6726
+ const o = t[`cheer-${p}-top-donation`];
6727
+ o && n > o.amount && (o.amount = n, o.name = m);
6728
+ const h = t[`cheer-${p}-top-donator`], f = t["cheer-recent"].filter((g) => g.name.toLowerCase() === h.name.toLowerCase()).reduce((g, y) => g + y.amount, 0), d = t["cheer-recent"].filter((g) => g.name.toLowerCase() === m.toLowerCase()).reduce((g, y) => g + y.amount, 0);
6729
+ d > f && (h.amount = d, h.name = m);
6712
6730
  };
6713
- f("all"), t["cheer-session"].amount += n, t["cheer-week"].amount += n, t["cheer-month"].amount += n, t["cheer-total"].amount += n, t["cheer-count"].count += 1, t["cheer-goal"].amount += n, t["cheer-recent"].unshift({
6714
- name: l,
6731
+ b("all"), t["cheer-session"].amount += n, t["cheer-week"].amount += n, t["cheer-month"].amount += n, t["cheer-total"].amount += n, t["cheer-count"].count += 1, t["cheer-goal"].amount += n, t["cheer-recent"].unshift({
6732
+ name: m,
6715
6733
  amount: n,
6716
6734
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
6717
6735
  }), t["cheer-recent"] = (t["cheer-recent"] || []).sort(i);
@@ -6728,22 +6746,22 @@ var q;
6728
6746
  break;
6729
6747
  }
6730
6748
  case "subscriber-latest": {
6731
- const n = s.event.displayName ?? s.event.name, l = s.event.amount, c = s.event.tier, f = s.event.message;
6732
- if (t["subscriber-latest"] = { name: n, amount: l, tier: c, message: f ?? "" }, t["subscriber-recent"].find(
6733
- (u) => u.name.toLowerCase() === n.toLowerCase()
6734
- ) ? l > 1 && (t["subscriber-resub-latest"] = { name: n, amount: l, message: f ?? "" }, t["subscriber-resub-session"].count += 1) : (t["subscriber-new-latest"] = { name: n, amount: l, message: f ?? "" }, t["subscriber-new-session"].count += 1), !(!s.event.gifted && !s.event.bulkGifted && !s.event.isCommunityGift)) if (s.event.gifted && !s.event.bulkGifted && !s.event.isCommunityGift) {
6735
- const u = s.event.sender;
6749
+ const n = s.event.displayName ?? s.event.name, m = s.event.amount, c = s.event.tier, b = s.event.message;
6750
+ if (t["subscriber-latest"] = { name: n, amount: m, tier: c, message: b ?? "" }, t["subscriber-recent"].find(
6751
+ (p) => p.name.toLowerCase() === n.toLowerCase()
6752
+ ) ? m > 1 && (t["subscriber-resub-latest"] = { name: n, amount: m, message: b ?? "" }, t["subscriber-resub-session"].count += 1) : (t["subscriber-new-latest"] = { name: n, amount: m, message: b ?? "" }, t["subscriber-new-session"].count += 1), !(!s.event.gifted && !s.event.bulkGifted && !s.event.isCommunityGift)) if (s.event.gifted && !s.event.bulkGifted && !s.event.isCommunityGift) {
6753
+ const p = s.event.sender;
6736
6754
  t["subscriber-gifted-latest"] = {
6737
6755
  name: n,
6738
- amount: l,
6756
+ amount: m,
6739
6757
  tier: c,
6740
- message: f ?? "",
6741
- sender: u
6742
- }, t["subscriber-gifted-session"].count += 1, t["subscriber-alltime-gifter"] = { name: u, amount: l };
6758
+ message: b ?? "",
6759
+ sender: p
6760
+ }, t["subscriber-gifted-session"].count += 1, t["subscriber-alltime-gifter"] = { name: p, amount: m };
6743
6761
  } else s.event.gifted && !s.event.bulkGifted && s.event.isCommunityGift || !s.event.gifted && s.event.bulkGifted && s.event.isCommunityGift;
6744
- t["subscriber-session"].count += l, t["subscriber-week"].count += l, t["subscriber-month"].count += l, t["subscriber-total"].count += l, t["subscriber-goal"].amount += l, t["subscriber-points"].amount += l, t["subscriber-recent"].unshift({
6762
+ t["subscriber-session"].count += m, t["subscriber-week"].count += m, t["subscriber-month"].count += m, t["subscriber-total"].count += m, t["subscriber-goal"].amount += m, t["subscriber-points"].amount += m, t["subscriber-recent"].unshift({
6745
6763
  name: n,
6746
- amount: l,
6764
+ amount: m,
6747
6765
  tier: c,
6748
6766
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
6749
6767
  }), t["subscriber-recent"] = (t["subscriber-recent"] || []).sort(
@@ -6752,10 +6770,10 @@ var q;
6752
6770
  break;
6753
6771
  }
6754
6772
  case "raid-latest": {
6755
- const n = s.event.displayName ?? s.event.name, l = s.event.amount;
6756
- t["raid-latest"] = { name: n, amount: l }, t["raid-recent"].unshift({
6773
+ const n = s.event.displayName ?? s.event.name, m = s.event.amount;
6774
+ t["raid-latest"] = { name: n, amount: m }, t["raid-recent"].unshift({
6757
6775
  name: n,
6758
- amount: l,
6776
+ amount: m,
6759
6777
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
6760
6778
  }), t["raid-recent"] = (t["raid-recent"] || []).sort(i);
6761
6779
  break;
@@ -6766,33 +6784,33 @@ var q;
6766
6784
  case "youtube": {
6767
6785
  const s = a.data;
6768
6786
  if (s.listener === "superchat-latest") {
6769
- const n = s.event.displayName ?? s.event.name, l = s.event.amount;
6787
+ const n = s.event.displayName ?? s.event.name, m = s.event.amount;
6770
6788
  t["superchat-latest"] = {
6771
6789
  name: n.toLowerCase(),
6772
6790
  displayName: n,
6773
- amount: l,
6774
- _id: b.random.uuid(),
6791
+ amount: m,
6792
+ _id: w.random.uuid(),
6775
6793
  sessionTop: !1,
6776
6794
  type: "superchat",
6777
6795
  originalEventName: "superchat-latest",
6778
6796
  providerId: "",
6779
6797
  avatar: ""
6780
6798
  };
6781
- const c = (f) => {
6782
- if (f === "all") {
6799
+ const c = (b) => {
6800
+ if (b === "all") {
6783
6801
  c("alltime"), c("monthly"), c("weekly"), c("session");
6784
6802
  return;
6785
6803
  }
6786
- const u = t[`superchat-${f}-top-donation`];
6787
- u && l > u.amount && (u.amount = l, u.name = n);
6788
- const o = t[`superchat-${f}-top-donator`], m = t["superchat-recent"].filter((h) => h.name.toLowerCase() === o.name.toLowerCase()).reduce((h, p) => h + p.amount, 0), w = t["superchat-recent"].filter((h) => h.name.toLowerCase() === n.toLowerCase()).reduce((h, p) => h + p.amount, 0);
6789
- w > m && (o.amount = w, o.name = n);
6804
+ const p = t[`superchat-${b}-top-donation`];
6805
+ p && m > p.amount && (p.amount = m, p.name = n);
6806
+ const o = t[`superchat-${b}-top-donator`], h = t["superchat-recent"].filter((d) => d.name.toLowerCase() === o.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["superchat-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
6807
+ f > h && (o.amount = f, o.name = n);
6790
6808
  };
6791
- c("all"), t["superchat-session"].amount += l, t["superchat-week"].amount += l, t["superchat-month"].amount += l, t["superchat-total"].amount += l, t["superchat-count"].count += 1, t["superchat-goal"].amount += l, t["superchat-recent"].unshift({
6809
+ c("all"), t["superchat-session"].amount += m, t["superchat-week"].amount += m, t["superchat-month"].amount += m, t["superchat-total"].amount += m, t["superchat-count"].count += 1, t["superchat-goal"].amount += m, t["superchat-recent"].unshift({
6792
6810
  name: n.toLowerCase(),
6793
6811
  displayName: n,
6794
- amount: l,
6795
- _id: b.random.uuid(),
6812
+ amount: m,
6813
+ _id: w.random.uuid(),
6796
6814
  sessionTop: !1,
6797
6815
  type: "superchat",
6798
6816
  originalEventName: "superchat-latest",
@@ -6805,21 +6823,21 @@ var q;
6805
6823
  case "streamelements": {
6806
6824
  const s = a.data;
6807
6825
  if (s.listener === "tip-latest") {
6808
- const n = s.event.displayName ?? s.event.name, l = s.event.amount;
6809
- t["tip-latest"] = { name: n, amount: l };
6810
- const c = (f) => {
6811
- if (f === "all") {
6826
+ const n = s.event.displayName ?? s.event.name, m = s.event.amount;
6827
+ t["tip-latest"] = { name: n, amount: m };
6828
+ const c = (b) => {
6829
+ if (b === "all") {
6812
6830
  c("alltime"), c("monthly"), c("weekly"), c("session");
6813
6831
  return;
6814
6832
  }
6815
- const u = t[`tip-${f}-top-donation`];
6816
- u && l > u.amount && (u.amount = l, u.name = n);
6817
- const o = t[`tip-${f}-top-donator`], m = t["tip-recent"].filter((h) => h.name.toLowerCase() === o.name.toLowerCase()).reduce((h, p) => h + p.amount, 0), w = t["tip-recent"].filter((h) => h.name.toLowerCase() === n.toLowerCase()).reduce((h, p) => h + p.amount, 0);
6818
- w > m && (o.amount = w, o.name = n);
6833
+ const p = t[`tip-${b}-top-donation`];
6834
+ p && m > p.amount && (p.amount = m, p.name = n);
6835
+ const o = t[`tip-${b}-top-donator`], h = t["tip-recent"].filter((d) => d.name.toLowerCase() === o.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["tip-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
6836
+ f > h && (o.amount = f, o.name = n);
6819
6837
  };
6820
- c("all"), t["tip-session"].amount += l, t["tip-week"].amount += l, t["tip-month"].amount += l, t["tip-total"].amount += l, t["tip-count"].count += 1, t["tip-goal"].amount += l, t["tip-recent"].unshift({
6838
+ c("all"), t["tip-session"].amount += m, t["tip-week"].amount += m, t["tip-month"].amount += m, t["tip-total"].amount += m, t["tip-count"].count += 1, t["tip-goal"].amount += m, t["tip-recent"].unshift({
6821
6839
  name: n,
6822
- amount: l,
6840
+ amount: m,
6823
6841
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
6824
6842
  }), t["tip-recent"] = (t["tip-recent"] || []).sort(i);
6825
6843
  }
@@ -6861,27 +6879,27 @@ var q;
6861
6879
  switch (t) {
6862
6880
  default:
6863
6881
  case "random": {
6864
- var n = b.random.array(
6865
- Object.keys(s).filter((O) => s[O].length)
6866
- )[0], l = b.random.array(
6882
+ var n = w.random.array(
6883
+ Object.keys(s).filter((R) => s[R].length)
6884
+ )[0], m = w.random.array(
6867
6885
  s[n]
6868
6886
  )[0];
6869
- return this.onEventReceived(n, l);
6887
+ return this.onEventReceived(n, m);
6870
6888
  }
6871
6889
  case "twitch":
6872
6890
  switch (a) {
6873
6891
  default:
6874
6892
  case "random": {
6875
- var l = b.random.array(
6893
+ var m = w.random.array(
6876
6894
  s[t]
6877
6895
  )[0];
6878
- return this.onEventReceived(t, l);
6896
+ return this.onEventReceived(t, m);
6879
6897
  }
6880
6898
  case "message": {
6881
- var c = i?.name ?? b.random.array(A.names.filter((z) => z.length))[0], f = i?.message ?? b.random.array(A.messages.filter((z) => z.length))[0], u = await b.message.generateBadges(
6899
+ var c = i?.name ?? w.random.array(A.names.filter((H) => H.length))[0], b = i?.message ?? w.random.array(A.messages.filter((H) => H.length))[0], p = await w.message.generateBadges(
6882
6900
  i?.badges ?? [],
6883
6901
  t
6884
- ), o = b.message.findEmotesInText(f), m = b.message.replaceEmotesWithHTML(f, o), w = i?.color ?? b.random.color("hex"), h = i?.userId ?? b.random.number(1e7, 99999999).toString(), p = i?.msgId ?? b.random.uuid(), y = i?.time ?? Date.now(), C = i?.channel ?? client.details.user.username;
6902
+ ), o = w.message.findEmotesInText(b), h = w.message.replaceEmotesWithHTML(b, o), f = i?.color ?? w.random.color("hex"), d = i?.userId ?? w.random.number(1e7, 99999999).toString(), g = i?.msgId ?? w.random.uuid(), y = i?.time ?? Date.now(), v = i?.channel ?? client.details.user.username;
6885
6903
  return {
6886
6904
  listener: "message",
6887
6905
  event: {
@@ -6889,35 +6907,35 @@ var q;
6889
6907
  data: {
6890
6908
  time: y,
6891
6909
  tags: {
6892
- "badge-info": `${u.keys.map((z) => `${z}/${b.random.number(1, 5)}`).join(",")}`,
6893
- badges: u.keys.join("/1,"),
6894
- mod: u.keys.includes("moderator") ? "1" : "0",
6895
- subscriber: u.keys.includes("subscriber") ? "1" : "0",
6896
- turbo: u.keys.includes("turbo") ? "1" : "0",
6910
+ "badge-info": `${p.keys.map((H) => `${H}/${w.random.number(1, 5)}`).join(",")}`,
6911
+ badges: p.keys.join("/1,"),
6912
+ mod: p.keys.includes("moderator") ? "1" : "0",
6913
+ subscriber: p.keys.includes("subscriber") ? "1" : "0",
6914
+ turbo: p.keys.includes("turbo") ? "1" : "0",
6897
6915
  "tmi-sent-ts": y.toString(),
6898
- "user-id": h,
6916
+ "user-id": d,
6899
6917
  "user-type": "",
6900
- color: w,
6918
+ color: f,
6901
6919
  "display-name": c,
6902
6920
  emotes: "",
6903
- "client-nonce": b.random.string(16),
6921
+ "client-nonce": w.random.string(16),
6904
6922
  flags: "",
6905
- id: p,
6923
+ id: g,
6906
6924
  "first-msg": "0",
6907
6925
  "returning-chatter": "0"
6908
6926
  },
6909
6927
  nick: c.toLowerCase(),
6910
6928
  displayName: c,
6911
- displayColor: w,
6912
- channel: C,
6913
- text: f,
6929
+ displayColor: f,
6930
+ channel: v,
6931
+ text: b,
6914
6932
  isAction: !1,
6915
- userId: h,
6916
- msgId: p,
6917
- badges: u.badges,
6933
+ userId: d,
6934
+ msgId: g,
6935
+ badges: p.badges,
6918
6936
  emotes: o
6919
6937
  },
6920
- renderedText: m
6938
+ renderedText: h
6921
6939
  },
6922
6940
  // @ts-ignore
6923
6941
  emulated: !0
@@ -6925,17 +6943,17 @@ var q;
6925
6943
  }
6926
6944
  case "cheer":
6927
6945
  case "cheer-latest": {
6928
- var k = i?.amount ?? b.random.number(100, 1e4), j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((W) => W.length))[0], f = i?.message ?? b.random.array(A.messages.filter((W) => W.length))[0];
6946
+ var C = i?.amount ?? w.random.number(100, 1e4), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((O) => O.length))[0], b = i?.message ?? w.random.array(A.messages.filter((O) => O.length))[0];
6929
6947
  return {
6930
6948
  listener: "cheer-latest",
6931
6949
  event: {
6932
- amount: k,
6933
- avatar: j,
6950
+ amount: C,
6951
+ avatar: x,
6934
6952
  name: c.toLowerCase(),
6935
6953
  displayName: c,
6936
- message: f,
6954
+ message: b,
6937
6955
  providerId: "",
6938
- _id: b.random.uuid(),
6956
+ _id: w.random.uuid(),
6939
6957
  sessionTop: !1,
6940
6958
  type: "cheer",
6941
6959
  originalEventName: "cheer-latest",
@@ -6947,15 +6965,15 @@ var q;
6947
6965
  }
6948
6966
  case "follower":
6949
6967
  case "follower-latest": {
6950
- var j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((W) => W.length))[0];
6968
+ var x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((O) => O.length))[0];
6951
6969
  return {
6952
6970
  listener: "follower-latest",
6953
6971
  event: {
6954
- avatar: j,
6972
+ avatar: x,
6955
6973
  name: c.toLowerCase(),
6956
6974
  displayName: c,
6957
6975
  providerId: "",
6958
- _id: b.random.uuid(),
6976
+ _id: w.random.uuid(),
6959
6977
  sessionTop: !1,
6960
6978
  type: "follower",
6961
6979
  originalEventName: "follower-latest",
@@ -6967,16 +6985,16 @@ var q;
6967
6985
  }
6968
6986
  case "raid":
6969
6987
  case "raid-latest": {
6970
- var k = i?.amount ?? b.random.number(1, 100), j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((F) => F.length))[0];
6988
+ var C = i?.amount ?? w.random.number(1, 100), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((F) => F.length))[0];
6971
6989
  return {
6972
6990
  listener: "raid-latest",
6973
6991
  event: {
6974
- amount: k,
6975
- avatar: j,
6992
+ amount: C,
6993
+ avatar: x,
6976
6994
  name: c.toLowerCase(),
6977
6995
  displayName: c,
6978
6996
  providerId: "",
6979
- _id: b.random.uuid(),
6997
+ _id: w.random.uuid(),
6980
6998
  sessionTop: !1,
6981
6999
  type: "raid",
6982
7000
  originalEventName: "raid-latest",
@@ -6988,37 +7006,37 @@ var q;
6988
7006
  }
6989
7007
  case "subscriber":
6990
7008
  case "subscriber-latest": {
6991
- var D = i?.tier ?? b.random.array(["1000", "2000", "3000", "prime"])[0], k = i?.amount ?? b.random.number(1, 24), j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((B) => B.length))[0], J = i?.sender ?? b.random.array(A.names.filter((B) => B.length && B !== c))[0], f = i?.message ?? b.random.array(A.messages.filter((B) => B.length))[0], P = {
7009
+ var S = i?.tier ?? w.random.array(["1000", "2000", "3000", "prime"])[0], C = i?.amount ?? w.random.number(1, 24), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((B) => B.length))[0], D = i?.sender ?? w.random.array(A.names.filter((B) => B.length && B !== c))[0], b = i?.message ?? w.random.array(A.messages.filter((B) => B.length))[0], M = {
6992
7010
  default: {
6993
- avatar: j,
7011
+ avatar: x,
6994
7012
  playedAsCommunityGift: !1
6995
7013
  },
6996
7014
  gift: {
6997
- sender: J,
7015
+ sender: D,
6998
7016
  gifted: !0
6999
7017
  },
7000
7018
  community: {
7001
- message: f,
7002
- sender: J,
7019
+ message: b,
7020
+ sender: D,
7003
7021
  bulkGifted: !0
7004
7022
  },
7005
7023
  spam: {
7006
- sender: J,
7024
+ sender: D,
7007
7025
  gifted: !0,
7008
7026
  isCommunityGift: !0
7009
7027
  }
7010
- }, U = ["default", "gift", "community", "spam"], S = i?.subType ?? b.random.array(U)[0];
7011
- return S = U.includes(S) ? S : "default", {
7028
+ }, _ = ["default", "gift", "community", "spam"], j = i?.subType ?? w.random.array(_)[0];
7029
+ return j = _.includes(j) ? j : "default", {
7012
7030
  listener: "subscriber-latest",
7013
7031
  event: {
7014
- amount: k,
7032
+ amount: C,
7015
7033
  name: c.toLowerCase(),
7016
7034
  displayName: c,
7017
7035
  providerId: "",
7018
- tier: D,
7019
- ...P.default,
7020
- ...P[S],
7021
- _id: b.random.uuid(),
7036
+ tier: S,
7037
+ ...M.default,
7038
+ ...M[j],
7039
+ _id: w.random.uuid(),
7022
7040
  sessionTop: !1,
7023
7041
  type: "subscriber",
7024
7042
  originalEventName: "subscriber-latest",
@@ -7032,7 +7050,7 @@ var q;
7032
7050
  return {
7033
7051
  listener: "delete-message",
7034
7052
  event: {
7035
- msgId: i?.id ?? b.random.uuid(),
7053
+ msgId: i?.id ?? w.random.uuid(),
7036
7054
  provider: t
7037
7055
  },
7038
7056
  // @ts-ignore
@@ -7042,7 +7060,7 @@ var q;
7042
7060
  return {
7043
7061
  listener: "delete-messages",
7044
7062
  event: {
7045
- userId: i?.id ?? b.random.number(1e7, 99999999).toString(),
7063
+ userId: i?.id ?? w.random.number(1e7, 99999999).toString(),
7046
7064
  provider: t
7047
7065
  },
7048
7066
  // @ts-ignore
@@ -7053,23 +7071,23 @@ var q;
7053
7071
  switch (a) {
7054
7072
  default:
7055
7073
  case "random": {
7056
- var l = b.random.array(
7074
+ var m = w.random.array(
7057
7075
  s[t]
7058
7076
  )[0];
7059
- return this.onEventReceived(t, l);
7077
+ return this.onEventReceived(t, m);
7060
7078
  }
7061
7079
  case "tip":
7062
7080
  case "tip-latest": {
7063
- var k = i?.amount ?? b.random.number(100, 4e3), j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((F) => F.length))[0];
7081
+ var C = i?.amount ?? w.random.number(100, 4e3), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((F) => F.length))[0];
7064
7082
  return {
7065
7083
  listener: "tip-latest",
7066
7084
  event: {
7067
- amount: k,
7068
- avatar: j,
7085
+ amount: C,
7086
+ avatar: x,
7069
7087
  name: c.toLowerCase(),
7070
7088
  displayName: c,
7071
7089
  providerId: "",
7072
- _id: b.random.uuid(),
7090
+ _id: w.random.uuid(),
7073
7091
  sessionTop: !1,
7074
7092
  type: "tip",
7075
7093
  originalEventName: "tip-latest",
@@ -7097,7 +7115,7 @@ var q;
7097
7115
  listener: "bot:counter",
7098
7116
  event: {
7099
7117
  counter: i?.counter ?? "sampleCounter",
7100
- value: i?.value ?? b.random.number(0, 100),
7118
+ value: i?.value ?? w.random.number(0, 100),
7101
7119
  provider: t
7102
7120
  },
7103
7121
  // @ts-ignore
@@ -7106,11 +7124,11 @@ var q;
7106
7124
  case "mute":
7107
7125
  case "unmute":
7108
7126
  case "alertService:toggleSound": {
7109
- var L = i?.muted ?? !client.details.overlay.muted;
7127
+ var J = i?.muted ?? !client.details.overlay.muted;
7110
7128
  return {
7111
7129
  listener: "alertService:toggleSound",
7112
7130
  event: {
7113
- muted: L,
7131
+ muted: J,
7114
7132
  provider: t
7115
7133
  },
7116
7134
  // @ts-ignore
@@ -7132,18 +7150,18 @@ var q;
7132
7150
  switch (a) {
7133
7151
  default:
7134
7152
  case "random": {
7135
- var l = b.random.array(
7153
+ var m = w.random.array(
7136
7154
  s[t]
7137
7155
  )[0];
7138
- return this.onEventReceived(t, l);
7156
+ return this.onEventReceived(t, m);
7139
7157
  }
7140
7158
  case "message": {
7141
- var c = i?.name ?? b.random.array(A.names.filter((Q) => Q.length))[0], f = i?.message ?? b.random.array(A.messages.filter((Q) => Q.length))[0];
7142
- const V = await b.message.generateBadges(
7159
+ var c = i?.name ?? w.random.array(A.names.filter((Q) => Q.length))[0], b = i?.message ?? w.random.array(A.messages.filter((Q) => Q.length))[0];
7160
+ const W = await w.message.generateBadges(
7143
7161
  i?.badges ?? [],
7144
7162
  t
7145
7163
  );
7146
- var o = b.message.findEmotesInText(f), m = b.message.replaceEmotesWithHTML(f, o), w = i?.color ?? b.random.color("hex"), h = i?.userId ?? b.random.number(1e7, 99999999).toString(), p = i?.msgId ?? b.random.uuid(), y = i?.time ?? Date.now(), j = i?.avatar ?? b.random.array(A.avatars)[0], C = i?.channel ?? client.details.user.username;
7164
+ var o = w.message.findEmotesInText(b), h = w.message.replaceEmotesWithHTML(b, o), f = i?.color ?? w.random.color("hex"), d = i?.userId ?? w.random.number(1e7, 99999999).toString(), g = i?.msgId ?? w.random.uuid(), y = i?.time ?? Date.now(), x = i?.avatar ?? w.random.array(A.avatars)[0], v = i?.channel ?? client.details.user.username;
7147
7165
  return {
7148
7166
  listener: "message",
7149
7167
  event: {
@@ -7155,36 +7173,36 @@ var q;
7155
7173
  snippet: {
7156
7174
  type: "",
7157
7175
  liveChatId: "",
7158
- authorChannelId: C,
7176
+ authorChannelId: v,
7159
7177
  publishedAt: (/* @__PURE__ */ new Date()).toISOString(),
7160
7178
  hasDisplayContent: !0,
7161
- displayMessage: f,
7179
+ displayMessage: b,
7162
7180
  textMessageDetails: {
7163
- messageText: f
7181
+ messageText: b
7164
7182
  }
7165
7183
  },
7166
7184
  authorDetails: {
7167
- channelId: C,
7185
+ channelId: v,
7168
7186
  channelUrl: "",
7169
7187
  displayName: c,
7170
- profileImageUrl: j,
7171
- ...V
7188
+ profileImageUrl: x,
7189
+ ...W
7172
7190
  },
7173
- msgId: p,
7174
- userId: h,
7191
+ msgId: g,
7192
+ userId: d,
7175
7193
  nick: c.toLowerCase(),
7176
7194
  badges: [],
7177
7195
  displayName: c,
7178
7196
  isAction: !1,
7179
7197
  time: y,
7180
7198
  tags: [],
7181
- displayColor: w,
7182
- channel: C,
7183
- text: f,
7184
- avatar: j,
7199
+ displayColor: f,
7200
+ channel: v,
7201
+ text: b,
7202
+ avatar: x,
7185
7203
  emotes: []
7186
7204
  },
7187
- renderedText: f
7205
+ renderedText: b
7188
7206
  },
7189
7207
  // @ts-ignore
7190
7208
  emulated: !0
@@ -7192,15 +7210,15 @@ var q;
7192
7210
  }
7193
7211
  case "subscriber":
7194
7212
  case "subscriber-latest": {
7195
- var j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((W) => W.length))[0];
7213
+ var x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((O) => O.length))[0];
7196
7214
  return {
7197
7215
  listener: "subscriber-latest",
7198
7216
  event: {
7199
- avatar: j,
7217
+ avatar: x,
7200
7218
  displayName: c,
7201
7219
  name: c.toLowerCase(),
7202
7220
  providerId: "",
7203
- _id: b.random.uuid(),
7221
+ _id: w.random.uuid(),
7204
7222
  sessionTop: !1,
7205
7223
  type: "subscriber",
7206
7224
  originalEventName: "subscriber-latest",
@@ -7212,16 +7230,16 @@ var q;
7212
7230
  }
7213
7231
  case "superchat":
7214
7232
  case "superchat-latest": {
7215
- var k = i?.amount ?? b.random.number(100, 4e3), j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((F) => F.length))[0];
7233
+ var C = i?.amount ?? w.random.number(100, 4e3), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((F) => F.length))[0];
7216
7234
  return {
7217
7235
  listener: "superchat-latest",
7218
7236
  event: {
7219
- amount: k,
7220
- avatar: j,
7237
+ amount: C,
7238
+ avatar: x,
7221
7239
  name: c.toLowerCase(),
7222
7240
  displayName: c,
7223
7241
  providerId: "",
7224
- _id: b.random.uuid(),
7242
+ _id: w.random.uuid(),
7225
7243
  sessionTop: !1,
7226
7244
  type: "superchat",
7227
7245
  originalEventName: "superchat-latest",
@@ -7233,36 +7251,36 @@ var q;
7233
7251
  }
7234
7252
  case "sponsor":
7235
7253
  case "sponsor-latest": {
7236
- var D = i?.tier ?? b.random.array(["1000", "2000", "3000"])[0], k = i?.amount ?? b.random.number(1, 24), j = i?.avatar ?? b.random.array(A.avatars)[0], c = i?.name ?? b.random.array(A.names.filter((K) => K.length))[0], J = i?.sender ?? b.random.array(A.names.filter((K) => K.length && K !== c))[0], f = i?.message ?? b.random.array(A.messages.filter((K) => K.length))[0], P = {
7254
+ var S = i?.tier ?? w.random.array(["1000", "2000", "3000"])[0], C = i?.amount ?? w.random.number(1, 24), x = i?.avatar ?? w.random.array(A.avatars)[0], c = i?.name ?? w.random.array(A.names.filter((K) => K.length))[0], D = i?.sender ?? w.random.array(A.names.filter((K) => K.length && K !== c))[0], b = i?.message ?? w.random.array(A.messages.filter((K) => K.length))[0], M = {
7237
7255
  default: {
7238
- avatar: j,
7256
+ avatar: x,
7239
7257
  playedAsCommunityGift: !1
7240
7258
  },
7241
7259
  gift: {
7242
- sender: J,
7260
+ sender: D,
7243
7261
  gifted: !0
7244
7262
  },
7245
7263
  community: {
7246
- message: f,
7247
- sender: J,
7264
+ message: b,
7265
+ sender: D,
7248
7266
  bulkGifted: !0
7249
7267
  },
7250
7268
  spam: {
7251
- sender: J,
7269
+ sender: D,
7252
7270
  gifted: !0,
7253
7271
  isCommunityGift: !0
7254
7272
  }
7255
- }, U = ["default", "gift", "community", "spam"], S = i?.subType ?? b.random.array(U)[0];
7256
- return S = U.includes(S) ? S : "default", {
7273
+ }, _ = ["default", "gift", "community", "spam"], j = i?.subType ?? w.random.array(_)[0];
7274
+ return j = _.includes(j) ? j : "default", {
7257
7275
  listener: "sponsor-latest",
7258
7276
  event: {
7259
- amount: k,
7277
+ amount: C,
7260
7278
  name: c.toLowerCase(),
7261
7279
  displayName: c,
7262
7280
  providerId: "",
7263
- ...P.default,
7264
- ...P[S],
7265
- _id: b.random.uuid(),
7281
+ ...M.default,
7282
+ ...M[j],
7283
+ _id: w.random.uuid(),
7266
7284
  sessionTop: !1,
7267
7285
  type: "sponsor",
7268
7286
  originalEventName: "sponsor-latest",
@@ -7276,15 +7294,15 @@ var q;
7276
7294
  }
7277
7295
  }
7278
7296
  }
7279
- }, d.emulate = {
7297
+ }, l.emulate = {
7280
7298
  twitch: {
7281
7299
  message(t = {}) {
7282
- d.generate.event.onEventReceived(
7300
+ l.generate.event.onEventReceived(
7283
7301
  "twitch",
7284
7302
  "message",
7285
7303
  t
7286
7304
  ).then((a) => {
7287
- a && d.emulate.send("onEventReceived", a);
7305
+ a && l.emulate.send("onEventReceived", a);
7288
7306
  });
7289
7307
  },
7290
7308
  deleteMessage(t) {
@@ -7295,7 +7313,7 @@ var q;
7295
7313
  msgId: t
7296
7314
  }
7297
7315
  };
7298
- d.emulate.send("onEventReceived", a);
7316
+ l.emulate.send("onEventReceived", a);
7299
7317
  },
7300
7318
  deleteMessages(t) {
7301
7319
  if (!t || typeof t != "string") return;
@@ -7305,104 +7323,104 @@ var q;
7305
7323
  userId: t
7306
7324
  }
7307
7325
  };
7308
- d.emulate.send("onEventReceived", a);
7326
+ l.emulate.send("onEventReceived", a);
7309
7327
  },
7310
7328
  follower(t = {}) {
7311
- d.generate.event.onEventReceived(
7329
+ l.generate.event.onEventReceived(
7312
7330
  "twitch",
7313
7331
  "follower-latest",
7314
7332
  t
7315
7333
  ).then((a) => {
7316
- a && d.emulate.send("onEventReceived", a);
7334
+ a && l.emulate.send("onEventReceived", a);
7317
7335
  });
7318
7336
  },
7319
7337
  raid(t = {}) {
7320
- d.generate.event.onEventReceived(
7338
+ l.generate.event.onEventReceived(
7321
7339
  "twitch",
7322
7340
  "raid-latest",
7323
7341
  t
7324
7342
  ).then((a) => {
7325
- a && d.emulate.send("onEventReceived", a);
7343
+ a && l.emulate.send("onEventReceived", a);
7326
7344
  });
7327
7345
  },
7328
7346
  cheer(t = {}) {
7329
- d.generate.event.onEventReceived(
7347
+ l.generate.event.onEventReceived(
7330
7348
  "twitch",
7331
7349
  "cheer-latest",
7332
7350
  t
7333
7351
  ).then((a) => {
7334
- a && d.emulate.send("onEventReceived", a);
7352
+ a && l.emulate.send("onEventReceived", a);
7335
7353
  });
7336
7354
  },
7337
7355
  subscriber(t = {}) {
7338
- d.generate.event.onEventReceived(
7356
+ l.generate.event.onEventReceived(
7339
7357
  "twitch",
7340
7358
  "subscriber-latest",
7341
7359
  t
7342
7360
  ).then((a) => {
7343
- a && d.emulate.send("onEventReceived", a);
7361
+ a && l.emulate.send("onEventReceived", a);
7344
7362
  });
7345
7363
  }
7346
7364
  },
7347
7365
  streamelements: {
7348
7366
  tip(t = {}) {
7349
- d.generate.event.onEventReceived(
7367
+ l.generate.event.onEventReceived(
7350
7368
  "streamelements",
7351
7369
  "tip-latest",
7352
7370
  t
7353
7371
  ).then((a) => {
7354
- a && d.emulate.send("onEventReceived", a);
7372
+ a && l.emulate.send("onEventReceived", a);
7355
7373
  });
7356
7374
  }
7357
7375
  },
7358
7376
  youtube: {
7359
7377
  message(t = {}) {
7360
- d.generate.event.onEventReceived(
7378
+ l.generate.event.onEventReceived(
7361
7379
  "youtube",
7362
7380
  "message",
7363
7381
  t
7364
7382
  ).then((a) => {
7365
- a && d.emulate.send("onEventReceived", a);
7383
+ a && l.emulate.send("onEventReceived", a);
7366
7384
  });
7367
7385
  },
7368
7386
  subscriber(t = {}) {
7369
- d.generate.event.onEventReceived(
7387
+ l.generate.event.onEventReceived(
7370
7388
  "youtube",
7371
7389
  "subscriber-latest",
7372
7390
  t
7373
7391
  ).then((a) => {
7374
- a && d.emulate.send("onEventReceived", a);
7392
+ a && l.emulate.send("onEventReceived", a);
7375
7393
  });
7376
7394
  },
7377
7395
  superchat(t = {}) {
7378
- d.generate.event.onEventReceived(
7396
+ l.generate.event.onEventReceived(
7379
7397
  "youtube",
7380
7398
  "superchat-latest",
7381
7399
  t
7382
7400
  ).then((a) => {
7383
- a && d.emulate.send("onEventReceived", a);
7401
+ a && l.emulate.send("onEventReceived", a);
7384
7402
  });
7385
7403
  },
7386
7404
  sponsor(t = {}) {
7387
- d.generate.event.onEventReceived(
7405
+ l.generate.event.onEventReceived(
7388
7406
  "youtube",
7389
7407
  "sponsor-latest",
7390
7408
  t
7391
7409
  ).then((a) => {
7392
- a && d.emulate.send("onEventReceived", a);
7410
+ a && l.emulate.send("onEventReceived", a);
7393
7411
  });
7394
7412
  }
7395
7413
  },
7396
7414
  kick: {},
7397
7415
  facebook: {},
7398
7416
  send(t, a) {
7399
- if (!d.queue) {
7400
- R.warn("Local queue is not initialized."), window.dispatchEvent(new CustomEvent(t, { detail: a }));
7417
+ if (!l.queue) {
7418
+ N.warn("Local queue is not initialized."), window.dispatchEvent(new CustomEvent(t, { detail: a }));
7401
7419
  return;
7402
7420
  }
7403
7421
  switch (t) {
7404
7422
  case "onEventReceived": {
7405
- d.queue.enqueue({
7423
+ l.queue.enqueue({
7406
7424
  listener: t,
7407
7425
  data: a,
7408
7426
  session: t === "onEventReceived" ? !0 : void 0
@@ -7410,14 +7428,14 @@ var q;
7410
7428
  break;
7411
7429
  }
7412
7430
  case "onSessionUpdate": {
7413
- d.queue.enqueue({
7431
+ l.queue.enqueue({
7414
7432
  listener: t,
7415
7433
  data: a
7416
7434
  });
7417
7435
  break;
7418
7436
  }
7419
7437
  case "onWidgetLoad": {
7420
- d.queue.enqueue({
7438
+ l.queue.enqueue({
7421
7439
  listener: t,
7422
7440
  data: a
7423
7441
  });
@@ -7428,16 +7446,16 @@ var q;
7428
7446
  };
7429
7447
  async function e(t = ["fields.json", "cf.json", "field.json", "customfields.json"], a = ["data.json", "fielddata.json", "fd.json", "DATA.json"], i) {
7430
7448
  const s = {
7431
- fields: t.find((l) => {
7449
+ fields: t.find((m) => {
7432
7450
  try {
7433
- return new URL("./" + l, window.location.href), !0;
7451
+ return new URL("./" + m, window.location.href), !0;
7434
7452
  } catch {
7435
7453
  return !1;
7436
7454
  }
7437
7455
  }),
7438
- data: a.find((l) => {
7456
+ data: a.find((m) => {
7439
7457
  try {
7440
- return new URL("./" + l, window.location.href), !0;
7458
+ return new URL("./" + m, window.location.href), !0;
7441
7459
  } catch {
7442
7460
  return !1;
7443
7461
  }
@@ -7447,23 +7465,23 @@ var q;
7447
7465
  {
7448
7466
  cache: "no-store"
7449
7467
  }
7450
- ).then((l) => l.json()).catch(() => ({}));
7468
+ ).then((m) => m.json()).catch(() => ({}));
7451
7469
  await fetch("./" + (s.fields ?? "fields.json"), {
7452
7470
  cache: "no-store"
7453
- }).then((l) => l.json()).then(async (l) => {
7454
- const c = Object.entries(l).filter(([u, { value: o }]) => o != null).reduce(
7455
- (u, [o, { value: m }]) => (n && n[o] !== void 0 && (m = n[o]), u[o] = m, u),
7471
+ }).then((m) => m.json()).then(async (m) => {
7472
+ const c = Object.entries(m).filter(([p, { value: o }]) => o != null).reduce(
7473
+ (p, [o, { value: h }]) => (n && n[o] !== void 0 && (h = n[o]), p[o] = h, p),
7456
7474
  {
7457
7475
  ...n
7458
7476
  }
7459
- ), f = await d.generate.event.onWidgetLoad(
7477
+ ), b = await l.generate.event.onWidgetLoad(
7460
7478
  c,
7461
- await d.generate.session.get(i)
7479
+ await l.generate.session.get(i)
7462
7480
  );
7463
- window.dispatchEvent(new CustomEvent("onWidgetLoad", { detail: f }));
7481
+ window.dispatchEvent(new CustomEvent("onWidgetLoad", { detail: b }));
7464
7482
  });
7465
7483
  }
7466
- d.start = e;
7484
+ l.start = e;
7467
7485
  })(q || (q = {}));
7468
7486
  class gt extends X {
7469
7487
  constructor(e) {
@@ -7510,7 +7528,7 @@ class gt extends X {
7510
7528
  try {
7511
7529
  await this.processor.apply(this, [e.value, this]), this.emit("process", e, this);
7512
7530
  } catch (a) {
7513
- R.error(
7531
+ N.error(
7514
7532
  `Error during item processing: ${a instanceof Error ? a.message : String(a)}`
7515
7533
  );
7516
7534
  }
@@ -7608,14 +7626,14 @@ typeof window !== void 0 && (window.addEventListener("load", () => {
7608
7626
  if (window.dispatchEvent(new CustomEvent(e.listener, { detail: e.data })), e.listener === "onEventReceived" && e.session) {
7609
7627
  const t = await q.generate.event.onSessionUpdate(
7610
7628
  client.session,
7611
- b.event.parseProvider(e.data)
7629
+ w.event.parseProvider(e.data)
7612
7630
  );
7613
7631
  window.dispatchEvent(new CustomEvent("onSessionUpdate", { detail: t }));
7614
7632
  }
7615
7633
  }
7616
7634
  }));
7617
- }), window.addEventListener("onWidgetLoad", async (d) => {
7618
- const { detail: e } = d;
7635
+ }), window.addEventListener("onWidgetLoad", async (l) => {
7636
+ const { detail: e } = l;
7619
7637
  if (window.client instanceof G) {
7620
7638
  const t = window.client;
7621
7639
  if (t.fields = e.fieldData, t.session = e.session.data, t.details = {
@@ -7630,37 +7648,37 @@ typeof window !== void 0 && (window.addEventListener("load", () => {
7630
7648
  }).catch(() => {
7631
7649
  t.details.provider = "local";
7632
7650
  }) : t.details.provider = "local", t.emit("load", e), t.debug) {
7633
- R.received("Widget loaded!", d.detail);
7634
- const a = d.detail.fieldData;
7635
- Object.keys(a).length && R.received("Field data:", a);
7651
+ N.received("Widget loaded!", l.detail);
7652
+ const a = l.detail.fieldData;
7653
+ Object.keys(a).length && N.received("Field data:", a);
7636
7654
  }
7637
7655
  t.loaded = !0, t.storage.on("load", (a) => {
7638
- if (t.debug && a ? R.debug(
7656
+ if (t.debug && a ? N.debug(
7639
7657
  "[Client]",
7640
7658
  "Storage loaded for client",
7641
7659
  `"${t.id}";`,
7642
7660
  `Provider: "${t.details.provider}";`,
7643
7661
  a
7644
- ) : t.debug && R.debug(
7662
+ ) : t.debug && N.debug(
7645
7663
  "[Client]",
7646
7664
  "Storage loaded for client",
7647
7665
  `"${t.id}";`,
7648
7666
  `Provider: "${t.details.provider}";`,
7649
7667
  "No data found."
7650
7668
  ), a) {
7651
- const i = (f) => {
7652
- const u = Date.now(), o = {};
7653
- for (const m in f)
7654
- if (f.hasOwnProperty(m)) {
7655
- const w = f[m];
7656
- w.expire && w.expire > u && (o[m] = w);
7669
+ const i = (b) => {
7670
+ const p = Date.now(), o = {};
7671
+ for (const h in b)
7672
+ if (b.hasOwnProperty(h)) {
7673
+ const f = b[h];
7674
+ f.expire && f.expire > p && (o[h] = f);
7657
7675
  }
7658
7676
  return o;
7659
- }, s = i(a.user || {}), n = i(a.avatar || {}), l = i(a.pronoun || {}), c = i(a.emote || {});
7677
+ }, s = i(a.user || {}), n = i(a.avatar || {}), m = i(a.pronoun || {}), c = i(a.emote || {});
7660
7678
  t.storage.update({
7661
7679
  user: s,
7662
7680
  avatar: n,
7663
- pronoun: l,
7681
+ pronoun: m,
7664
7682
  emote: c
7665
7683
  });
7666
7684
  }
@@ -7671,15 +7689,15 @@ typeof window !== void 0 && (window.addEventListener("load", () => {
7671
7689
  });
7672
7690
  });
7673
7691
  }
7674
- }), window.addEventListener("onSessionUpdate", (d) => {
7675
- const { detail: e } = d;
7692
+ }), window.addEventListener("onSessionUpdate", (l) => {
7693
+ const { detail: e } = l;
7676
7694
  if (window.client instanceof G) {
7677
7695
  const t = window.client;
7678
- t.session = e.session, t.emit("session", e.session), t.debug && R.debug("[Client]", "Session updated", e.session);
7696
+ t.session = e.session, t.emit("session", e.session), t.debug && N.debug("[Client]", "Session updated", e.session);
7679
7697
  }
7680
- }), window.addEventListener("onEventReceived", ({ detail: d }) => {
7698
+ }), window.addEventListener("onEventReceived", ({ detail: l }) => {
7681
7699
  if (window.client instanceof G) {
7682
- const t = b.event.parseProvider(d);
7700
+ const t = w.event.parseProvider(l);
7683
7701
  switch (t.provider) {
7684
7702
  case "streamelements": {
7685
7703
  const i = t.data;
@@ -7716,7 +7734,7 @@ typeof window !== void 0 && (window.addEventListener("load", () => {
7716
7734
  }
7717
7735
  if (et.length) {
7718
7736
  const n = et.find(
7719
- (l) => l.id === s.data.key.replace("customWidget.", "") || l.id === s.data.key
7737
+ (m) => m.id === s.data.key.replace("customWidget.", "") || m.id === s.data.key
7720
7738
  );
7721
7739
  n && n.update(s.data.value);
7722
7740
  }
@@ -7810,7 +7828,7 @@ typeof window !== void 0 && (window.addEventListener("load", () => {
7810
7828
  "event:test",
7811
7829
  "kvstore:update"
7812
7830
  ];
7813
- client.debug && !a.some((i) => i === t.data.listener) && R.received(
7831
+ client.debug && !a.some((i) => i === t.data.listener) && N.received(
7814
7832
  "[Client]",
7815
7833
  `Event ${t.data.listener} received from ${t.provider}`,
7816
7834
  t.data.event
@@ -7825,55 +7843,55 @@ const rt = {
7825
7843
  resumeQueue: () => {
7826
7844
  },
7827
7845
  responses: {},
7828
- sendMessage(d, e) {
7846
+ sendMessage(l, e) {
7829
7847
  },
7830
7848
  counters: {
7831
- get(d) {
7849
+ get(l) {
7832
7850
  return null;
7833
7851
  }
7834
7852
  },
7835
- sanitize(d) {
7836
- return d;
7853
+ sanitize(l) {
7854
+ return l;
7837
7855
  },
7838
- cheerFilter(d) {
7839
- return d;
7856
+ cheerFilter(l) {
7857
+ return l;
7840
7858
  },
7841
- setField(d, e, t) {
7859
+ setField(l, e, t) {
7842
7860
  },
7843
7861
  store: {
7844
- set: function(d, e) {
7845
- this.list[d] = e, localStorage.setItem("SE_API-STORE", JSON.stringify(rt.store.list));
7862
+ set: function(l, e) {
7863
+ this.list[l] = e, localStorage.setItem("SE_API-STORE", JSON.stringify(rt.store.list));
7846
7864
  },
7847
- get: async function(d) {
7848
- return this.list[d] ? this.list[d] : null;
7865
+ get: async function(l) {
7866
+ return this.list[l] ? this.list[l] : null;
7849
7867
  },
7850
7868
  list: {}
7851
7869
  }
7852
7870
  };
7853
7871
  async function Dt() {
7854
- let d = localStorage.getItem("SE_API-STORE") ?? "", e = d ? JSON.parse(d) : {};
7872
+ let l = localStorage.getItem("SE_API-STORE") ?? "", e = l ? JSON.parse(l) : {};
7855
7873
  return rt.store.list = e, rt;
7856
7874
  }
7857
7875
  var ot;
7858
- ((d) => {
7876
+ ((l) => {
7859
7877
  let e;
7860
7878
  ((i) => {
7861
7879
  ((s) => {
7862
7880
  s.hehim = "He/Him", s.sheher = "She/Her", s.theythem = "They/Them", s.shethem = "She/They", s.hethem = "He/They", s.heshe = "He/She", s.xexem = "Xe/Xem", s.faefaer = "Fae/Faer", s.vever = "Ve/Ver", s.aeaer = "Ae/Aer", s.ziehir = "Zie/Hir", s.perper = "Per/Per", s.eem = "E/Em", s.itits = "It/Its";
7863
7881
  })(i.map || (i.map = {}));
7864
- })(e = d.Pronouns || (d.Pronouns = {}));
7882
+ })(e = l.Pronouns || (l.Pronouns = {}));
7865
7883
  async function t() {
7866
7884
  try {
7867
7885
  const i = await fetch("https://pronouns.alejo.io/api/pronouns").then((s) => s.json());
7868
7886
  if (Array.isArray(i) && i.length) {
7869
- const s = Object.fromEntries(i.map(({ name: n, display: l }) => [n, l]));
7887
+ const s = Object.fromEntries(i.map(({ name: n, display: m }) => [n, m]));
7870
7888
  return { ...e.map, ...s };
7871
7889
  }
7872
7890
  } catch {
7873
7891
  }
7874
7892
  return { ...e.map };
7875
7893
  }
7876
- d.list = t;
7894
+ l.list = t;
7877
7895
  async function a(i) {
7878
7896
  if (!i) throw new Error("Username is required to fetch Alejo data.");
7879
7897
  if (i = i.toLowerCase(), i in client.storage.data.pronoun && client.storage.data.pronoun[i].expire > Date.now())
@@ -7890,7 +7908,7 @@ var ot;
7890
7908
  throw new Error(`Failed to fetch pronoun data for user "${i}": ${s instanceof Error ? s.message : s}`);
7891
7909
  }
7892
7910
  }
7893
- d.get = a;
7911
+ l.get = a;
7894
7912
  })(ot || (ot = {}));
7895
7913
  class At extends X {
7896
7914
  /**
@@ -7902,7 +7920,7 @@ class At extends X {
7902
7920
  super(), this.isDebug = !1, this.init = !1, this.emulate = !1, this.username = e.username, this.password = e.password, this.channels = e.channels, this.isDebug = !!e.isDebug, this.init = !!e.init, this.emulate = t, this.load().then((a) => {
7903
7921
  this.instance = a, this.emit("load", a), this.connect();
7904
7922
  }).catch((a) => {
7905
- R.error("useComfyJs: Failed to load ComfyJS", a);
7923
+ N.error("useComfyJs: Failed to load ComfyJS", a);
7906
7924
  });
7907
7925
  }
7908
7926
  /**
@@ -7924,9 +7942,9 @@ class At extends X {
7924
7942
  */
7925
7943
  connect() {
7926
7944
  this.instance.onError = (e) => {
7927
- this.emit("error", e), client.debug && R.error("[Client]", "ComfyJS Error:", e);
7945
+ this.emit("error", e), client.debug && N.error("[Client]", "ComfyJS Error:", e);
7928
7946
  }, this.instance.onCommand = (e, t, a, i, s) => {
7929
- if (this.emit("command", e, t, a, i, s), client.debug && R.debug("[Client]", `ComfyJS Command: !${t} ${a} (User: ${e})`), this.emulate) {
7947
+ if (this.emit("command", e, t, a, i, s), client.debug && N.debug("[Client]", `ComfyJS Command: !${t} ${a} (User: ${e})`), this.emulate) {
7930
7948
  const n = {
7931
7949
  ...i,
7932
7950
  broadcaster: i.broadcaster,
@@ -7934,20 +7952,20 @@ class At extends X {
7934
7952
  vip: i.vip,
7935
7953
  subscriber: i.subscriber,
7936
7954
  founder: i.founder
7937
- }, l = {
7955
+ }, m = {
7938
7956
  name: e,
7939
7957
  message: `!${t} ${a}`,
7940
- badges: Object.entries(n).map(([c, f]) => f ? c : null).filter(Boolean),
7958
+ badges: Object.entries(n).map(([c, b]) => b ? c : null).filter(Boolean),
7941
7959
  color: s.userColor,
7942
7960
  time: new Date(s.timestamp).getTime(),
7943
7961
  userId: s.userId,
7944
7962
  msgId: s.id,
7945
7963
  channel: s.channel
7946
7964
  };
7947
- q.emulate.twitch.message(l);
7965
+ q.emulate.twitch.message(m);
7948
7966
  }
7949
7967
  }, this.instance.onChat = (e, t, a, i, s) => {
7950
- if (this.emit("chat", e, t, a, i, s), client.debug && R.debug("[Client]", `ComfyJS Chat: ${t} (User: ${e})`), this.emulate) {
7968
+ if (this.emit("chat", e, t, a, i, s), client.debug && N.debug("[Client]", `ComfyJS Chat: ${t} (User: ${e})`), this.emulate) {
7951
7969
  const n = {
7952
7970
  ...a,
7953
7971
  ...s.userBadges,
@@ -7960,7 +7978,7 @@ class At extends X {
7960
7978
  q.emulate.twitch.message({
7961
7979
  name: e,
7962
7980
  message: t,
7963
- badges: Object.entries(n).map(([l, c]) => c ? l : null).filter(Boolean),
7981
+ badges: Object.entries(n).map(([m, c]) => c ? m : null).filter(Boolean),
7964
7982
  color: s.userColor,
7965
7983
  time: new Date(s.timestamp).getTime(),
7966
7984
  userId: s.userId,
@@ -7969,22 +7987,22 @@ class At extends X {
7969
7987
  });
7970
7988
  }
7971
7989
  }, this.instance.onWhisper = (e, t, a, i, s) => {
7972
- this.emit("whisper", e, t, a, i, s), client.debug && R.debug("[Client]", `ComfyJS Whisper: ${t} (User: ${e})`);
7990
+ this.emit("whisper", e, t, a, i, s), client.debug && N.debug("[Client]", `ComfyJS Whisper: ${t} (User: ${e})`);
7973
7991
  }, this.instance.onMessageDeleted = (e, t) => {
7974
- this.emit("messageDeleted", e, t), client.debug && R.debug("[Client]", `ComfyJS Message Deleted: ${e}`), this.emulate && q.emulate.twitch.deleteMessage(e);
7992
+ this.emit("messageDeleted", e, t), client.debug && N.debug("[Client]", `ComfyJS Message Deleted: ${e}`), this.emulate && q.emulate.twitch.deleteMessage(e);
7975
7993
  }, this.instance.onJoin = (e, t, a) => {
7976
- this.emit("join", e, t, a), client.debug && R.debug("[Client]", `ComfyJS Join: ${e}`);
7994
+ this.emit("join", e, t, a), client.debug && N.debug("[Client]", `ComfyJS Join: ${e}`);
7977
7995
  }, this.instance.onPart = (e, t, a) => {
7978
- this.emit("part", e, t, a), client.debug && R.debug("[Client]", `ComfyJS Part: ${e}`);
7996
+ this.emit("part", e, t, a), client.debug && N.debug("[Client]", `ComfyJS Part: ${e}`);
7979
7997
  }, this.instance.onHosted = (e, t, a, i) => {
7980
- this.emit("hosted", e, t, a, i), client.debug && R.debug("[Client]", `ComfyJS Hosted: ${e} (${t} viewers)`);
7998
+ this.emit("hosted", e, t, a, i), client.debug && N.debug("[Client]", `ComfyJS Hosted: ${e} (${t} viewers)`);
7981
7999
  }, this.instance.onRaid = (e, t, a) => {
7982
- this.emit("raid", e, t, a), client.debug && R.debug("[Client]", `ComfyJS Raid: ${e} (${t} viewers)`), this.emulate && q.emulate.twitch.raid({
8000
+ this.emit("raid", e, t, a), client.debug && N.debug("[Client]", `ComfyJS Raid: ${e} (${t} viewers)`), this.emulate && q.emulate.twitch.raid({
7983
8001
  name: e,
7984
8002
  amount: t
7985
8003
  });
7986
8004
  }, this.instance.onSub = (e, t, a, i) => {
7987
- if (this.emit("sub", e, t, a, i), client.debug && R.debug("[Client]", `ComfyJS Sub: ${e} (${a.plan})`), this.emulate) {
8005
+ if (this.emit("sub", e, t, a, i), client.debug && N.debug("[Client]", `ComfyJS Sub: ${e} (${a.plan})`), this.emulate) {
7988
8006
  const s = a.plan === "Prime" ? "prime" : a.plan;
7989
8007
  q.emulate.twitch.subscriber({
7990
8008
  name: e,
@@ -7994,12 +8012,12 @@ class At extends X {
7994
8012
  });
7995
8013
  }
7996
8014
  }, this.instance.onResub = (e, t, a, i, s, n) => {
7997
- if (this.emit("resub", e, t, a, i, s, n), client.debug && R.debug("[Client]", `ComfyJS Resub: ${e} (${i} months)`), this.emulate) {
7998
- const l = s.plan === "Prime" ? "prime" : s.plan;
8015
+ if (this.emit("resub", e, t, a, i, s, n), client.debug && N.debug("[Client]", `ComfyJS Resub: ${e} (${i} months)`), this.emulate) {
8016
+ const m = s.plan === "Prime" ? "prime" : s.plan;
7999
8017
  q.emulate.twitch.subscriber({
8000
8018
  name: e,
8001
8019
  message: t,
8002
- tier: l,
8020
+ tier: m,
8003
8021
  amount: i,
8004
8022
  subType: "default"
8005
8023
  });
@@ -8013,19 +8031,19 @@ class At extends X {
8013
8031
  i,
8014
8032
  s,
8015
8033
  n
8016
- ), client.debug && R.debug("[Client]", `ComfyJS Sub Gift: ${e} gifted ${i} subs`), this.emulate) {
8017
- const l = s.plan === "Prime" ? "prime" : s.plan;
8034
+ ), client.debug && N.debug("[Client]", `ComfyJS Sub Gift: ${e} gifted ${i} subs`), this.emulate) {
8035
+ const m = s.plan === "Prime" ? "prime" : s.plan;
8018
8036
  q.emulate.twitch.subscriber({
8019
8037
  name: a,
8020
8038
  message: "",
8021
8039
  sender: e,
8022
- tier: l,
8040
+ tier: m,
8023
8041
  amount: i,
8024
8042
  subType: "gift"
8025
8043
  });
8026
8044
  }
8027
8045
  }, this.instance.onSubMysteryGift = (e, t, a, i, s) => {
8028
- if (this.emit("subMysteryGift", e, t, a, i, s), client.debug && R.debug(
8046
+ if (this.emit("subMysteryGift", e, t, a, i, s), client.debug && N.debug(
8029
8047
  "[Client]",
8030
8048
  `ComfyJS Sub Mystery Gift: ${e} gifted ${t} subs`
8031
8049
  ), this.emulate) {
@@ -8039,7 +8057,7 @@ class At extends X {
8039
8057
  });
8040
8058
  }
8041
8059
  }, this.instance.onGiftSubContinue = (e, t, a) => {
8042
- this.emit("giftSubContinue", e, t, a), client.debug && R.debug(
8060
+ this.emit("giftSubContinue", e, t, a), client.debug && N.debug(
8043
8061
  "[Client]",
8044
8062
  `ComfyJS Gift Sub Continue: ${e} continued their gifted sub from ${t}`
8045
8063
  ), this.emulate && q.emulate.twitch.subscriber({
@@ -8050,25 +8068,25 @@ class At extends X {
8050
8068
  subType: "gift"
8051
8069
  });
8052
8070
  }, this.instance.onCheer = (e, t, a, i, s) => {
8053
- this.emit("cheer", e, t, a, i, s), client.debug && R.debug("[Client]", `ComfyJS Cheer: ${e} cheered ${a} bits - ${t}`), this.emulate && q.emulate.twitch.cheer({
8071
+ this.emit("cheer", e, t, a, i, s), client.debug && N.debug("[Client]", `ComfyJS Cheer: ${e} cheered ${a} bits - ${t}`), this.emulate && q.emulate.twitch.cheer({
8054
8072
  name: e,
8055
8073
  message: t,
8056
8074
  amount: a
8057
8075
  });
8058
8076
  }, this.instance.onChatMode = (e, t) => {
8059
- this.emit("chatMode", e, t), client.debug && R.debug("[Client]", `ComfyJS Chat Mode Changed on ${t}`);
8077
+ this.emit("chatMode", e, t), client.debug && N.debug("[Client]", `ComfyJS Chat Mode Changed on ${t}`);
8060
8078
  }, this.instance.onReward = (e, t, a, i, s) => {
8061
- this.emit("reward", e, t, a, i, s), client.debug && R.debug(
8079
+ this.emit("reward", e, t, a, i, s), client.debug && N.debug(
8062
8080
  "[Client]",
8063
8081
  `ComfyJS Reward: ${e} redeemed ${t} for ${a} - ${i}`
8064
8082
  );
8065
8083
  }, this.instance.onConnected = (e, t, a) => {
8066
- this.emit("connected", e, t, a), client.debug && R.debug(
8084
+ this.emit("connected", e, t, a), client.debug && N.debug(
8067
8085
  "[Client]",
8068
8086
  `ComfyJS Connected: ${e}:${t} (First Connect: ${a})`
8069
8087
  );
8070
8088
  }, this.instance.onReconnect = (e) => {
8071
- this.emit("reconnect", e), client.debug && R.debug("[Client]", `ComfyJS Reconnect: Attempt #${e}`);
8089
+ this.emit("reconnect", e), client.debug && N.debug("[Client]", `ComfyJS Reconnect: Attempt #${e}`);
8072
8090
  }, this.init && this.instance.Init(this.username, this.password, this.channels, this.isDebug);
8073
8091
  }
8074
8092
  }
@@ -8139,13 +8157,13 @@ class pt {
8139
8157
  if (!this.enabled || typeof console > "u") return;
8140
8158
  let s = "";
8141
8159
  typeof this.prefix == "function" ? s = this.prefix() : typeof this.prefix == "string" && (s = this.prefix);
8142
- const n = [], l = [];
8160
+ const n = [], m = [];
8143
8161
  if (i.forEach((c) => {
8144
- typeof c == "string" || typeof c == "number" || typeof c == "boolean" ? n.push(c) : l.push(c);
8162
+ typeof c == "string" || typeof c == "number" || typeof c == "boolean" ? n.push(c) : m.push(c);
8145
8163
  }), n.length > 0) {
8146
8164
  const c = n.join(" ");
8147
- console.log(`%c${s.endsWith(" ") ? s : s.trim() + " "}${a}${c}`, t, ...l);
8148
- } else l.length > 0 && console.log(`%c${s.endsWith(" ") ? s : s.trim() + " "}${a}`, t, ...l);
8165
+ console.log(`%c${s.endsWith(" ") ? s : s.trim() + " "}${a}${c}`, t, ...m);
8166
+ } else m.length > 0 && console.log(`%c${s.endsWith(" ") ? s : s.trim() + " "}${a}`, t, ...m);
8149
8167
  };
8150
8168
  }
8151
8169
  style(e) {
@@ -8171,13 +8189,13 @@ class pt {
8171
8189
  !this.enabled || !console.timeEnd || console.timeEnd(e);
8172
8190
  }
8173
8191
  }
8174
- const ct = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(Dt()), R = new pt(), mt = {
8192
+ const ct = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(Dt()), N = new pt(), mt = {
8175
8193
  SeAPI: ct,
8176
8194
  Client: G,
8177
- Helper: b,
8195
+ Helper: w,
8178
8196
  Local: q,
8179
8197
  Data: A,
8180
- logger: R,
8198
+ logger: N,
8181
8199
  modules: { EventProvider: X, useStorage: it, useQueue: gt, useLogger: pt, useComms: St },
8182
8200
  actions: { Button: at, Command: Z },
8183
8201
  multistream: { useComfyJs: At },