buzzcasting-utils 1.10.2 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-utils.d.ts +32 -8
- package/dist/buzzcasting-utils.esm.js +121 -113
- package/package.json +9 -9
|
@@ -139,6 +139,8 @@ export declare interface Data {
|
|
|
139
139
|
|
|
140
140
|
export declare function deepMerge(objs: any): void;
|
|
141
141
|
|
|
142
|
+
export declare const dir: (message: IMessage) => "rtl" | "ltr";
|
|
143
|
+
|
|
142
144
|
declare const escape_2: (htmlStr: string) => string;
|
|
143
145
|
export { escape_2 as escape }
|
|
144
146
|
|
|
@@ -225,7 +227,7 @@ export declare function filterAttributes(attributes: NamedNodeMap): IFilteredAtt
|
|
|
225
227
|
|
|
226
228
|
export declare const flatten: (obj: any, res?: {}, parentKey?: string) => {};
|
|
227
229
|
|
|
228
|
-
export declare function formatContent(message: IMessage,
|
|
230
|
+
export declare function formatContent(message: IMessage, headingCss?: string): string;
|
|
229
231
|
|
|
230
232
|
export declare interface GeoCountries {
|
|
231
233
|
type: string;
|
|
@@ -380,6 +382,7 @@ export declare interface ICardOptions {
|
|
|
380
382
|
debug?: boolean;
|
|
381
383
|
delay?: number;
|
|
382
384
|
globe?: IGlobe;
|
|
385
|
+
grid?: IGridLayout;
|
|
383
386
|
locale?: string;
|
|
384
387
|
show?: IShowCard;
|
|
385
388
|
}
|
|
@@ -507,7 +510,9 @@ export declare interface ICssCard {
|
|
|
507
510
|
date?: string;
|
|
508
511
|
dynamics?: string;
|
|
509
512
|
globe?: string;
|
|
513
|
+
grid?: string;
|
|
510
514
|
handle?: string;
|
|
515
|
+
heading?: string;
|
|
511
516
|
host?: string;
|
|
512
517
|
image?: string;
|
|
513
518
|
kpi?: string;
|
|
@@ -527,6 +532,7 @@ export declare interface ICssCloud {
|
|
|
527
532
|
arrowup: string;
|
|
528
533
|
arrowdown: string;
|
|
529
534
|
chart: string;
|
|
535
|
+
container: string;
|
|
530
536
|
backdrop: string;
|
|
531
537
|
body: string;
|
|
532
538
|
brand: string;
|
|
@@ -562,6 +568,7 @@ export declare interface ICssSeries {
|
|
|
562
568
|
count: string;
|
|
563
569
|
down: string;
|
|
564
570
|
host: string;
|
|
571
|
+
key: string;
|
|
565
572
|
label: string;
|
|
566
573
|
table: string;
|
|
567
574
|
title: string;
|
|
@@ -714,13 +721,13 @@ export declare interface IGeo {
|
|
|
714
721
|
}
|
|
715
722
|
|
|
716
723
|
declare interface IGlobe {
|
|
717
|
-
width
|
|
718
|
-
height
|
|
719
|
-
arc
|
|
720
|
-
border
|
|
721
|
-
country
|
|
722
|
-
land
|
|
723
|
-
sphere
|
|
724
|
+
width?: number;
|
|
725
|
+
height?: number;
|
|
726
|
+
arc?: IGlobeArc;
|
|
727
|
+
border?: IGlobeBorder;
|
|
728
|
+
country?: IGlobeCountry;
|
|
729
|
+
land?: IGlobeLand;
|
|
730
|
+
sphere?: IGlobeSphere;
|
|
724
731
|
}
|
|
725
732
|
|
|
726
733
|
declare interface IGlobeArc {
|
|
@@ -747,6 +754,11 @@ declare interface IGlobeSphere {
|
|
|
747
754
|
fill: string;
|
|
748
755
|
}
|
|
749
756
|
|
|
757
|
+
declare interface IGridLayout {
|
|
758
|
+
rows?: number;
|
|
759
|
+
cols?: number;
|
|
760
|
+
}
|
|
761
|
+
|
|
750
762
|
export declare interface IHighlight {
|
|
751
763
|
label?: string;
|
|
752
764
|
color?: string[];
|
|
@@ -1023,6 +1035,7 @@ export declare const intToString: (num: any, digits?: number, abbreviate?: boole
|
|
|
1023
1035
|
export declare interface IPie {
|
|
1024
1036
|
radius: IPieRadius;
|
|
1025
1037
|
animation: IPieAnimation;
|
|
1038
|
+
boder: IPieBorder;
|
|
1026
1039
|
}
|
|
1027
1040
|
|
|
1028
1041
|
/**
|
|
@@ -1032,10 +1045,18 @@ export declare interface IPieAnimation {
|
|
|
1032
1045
|
duration: number;
|
|
1033
1046
|
}
|
|
1034
1047
|
|
|
1048
|
+
export declare interface IPieBorder {
|
|
1049
|
+
radius: number;
|
|
1050
|
+
width: number;
|
|
1051
|
+
color: string;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1035
1054
|
/**
|
|
1036
1055
|
* inner and outer radius in px
|
|
1037
1056
|
*/
|
|
1038
1057
|
export declare interface IPieRadius {
|
|
1058
|
+
inside: number;
|
|
1059
|
+
outside: number;
|
|
1039
1060
|
inner: number;
|
|
1040
1061
|
outer: number;
|
|
1041
1062
|
}
|
|
@@ -1190,6 +1211,9 @@ export declare interface IShowCloud {
|
|
|
1190
1211
|
date: boolean;
|
|
1191
1212
|
gradient: boolean;
|
|
1192
1213
|
hashtags: boolean;
|
|
1214
|
+
labels: true;
|
|
1215
|
+
legend: true;
|
|
1216
|
+
title: true;
|
|
1193
1217
|
trend: boolean;
|
|
1194
1218
|
debug?: boolean;
|
|
1195
1219
|
}
|
|
@@ -9,10 +9,10 @@ function N(e) {
|
|
|
9
9
|
let t = "", r = "", n = {
|
|
10
10
|
backgroundImage: ""
|
|
11
11
|
};
|
|
12
|
-
return typeof e.media < "u" && e.media.forEach((
|
|
13
|
-
(
|
|
14
|
-
backgroundImage: `url(${
|
|
15
|
-
}, r =
|
|
12
|
+
return typeof e.media < "u" && e.media.forEach((a) => {
|
|
13
|
+
(a.type === "photo" || a.type === "image") && (n = {
|
|
14
|
+
backgroundImage: `url(${a.url})`
|
|
15
|
+
}, r = a.url), a.type === "video" && (t = a.url);
|
|
16
16
|
}), {
|
|
17
17
|
image: r,
|
|
18
18
|
background: n || null,
|
|
@@ -95,13 +95,13 @@ function ne(e, t) {
|
|
|
95
95
|
return "";
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function ae(e) {
|
|
99
99
|
return e.replace(/^\w|[A-Z]|\b\w/g, (t, r) => r === 0 ? t.toLowerCase() : t.toUpperCase()).replace(/\s+/g, "");
|
|
100
100
|
}
|
|
101
101
|
function y(e) {
|
|
102
102
|
return e.toLowerCase().split("-").reduce((t, r) => t + (r.charAt(0).toUpperCase() + r.slice(1)));
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const oe = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), ie = (e) => e.charAt(0).toUpperCase() + e.slice(1);
|
|
105
105
|
function se(e) {
|
|
106
106
|
const t = document.createRange();
|
|
107
107
|
t.selectNodeContents(e), t.deleteContents();
|
|
@@ -123,9 +123,9 @@ const le = () => Math.floor(Math.random() * 16777215).toString(16), ce = () => {
|
|
|
123
123
|
function E(e) {
|
|
124
124
|
e.reduce(
|
|
125
125
|
(t, r) => Object.keys(r).reduce(
|
|
126
|
-
(n,
|
|
126
|
+
(n, a) => ({
|
|
127
127
|
...n,
|
|
128
|
-
[
|
|
128
|
+
[a]: a in t && typeof t[a] == "object" && t[a] !== null && typeof r[a] == "object" && r[a] !== null ? E([t[a], r[a]]) : r[a]
|
|
129
129
|
}),
|
|
130
130
|
t
|
|
131
131
|
),
|
|
@@ -134,13 +134,13 @@ function E(e) {
|
|
|
134
134
|
}
|
|
135
135
|
const fe = (e) => [...new Set(e)], ge = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
136
136
|
function be(e, t = "font-bold") {
|
|
137
|
-
return `${e?.title !== null ? `<div class="${t}">${e.title}</div>` : ""}${e?.content ? e.content.replace(/\n\n/g, `
|
|
137
|
+
return `${e?.title !== null ? `<div title="heading" class="${t}">${e.title}</div>` : ""}${e?.content ? e.content.replace(/\n\n/g, `
|
|
138
138
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
139
139
|
}
|
|
140
140
|
const M = (e, t = {}, r = "") => {
|
|
141
141
|
for (let n in e) {
|
|
142
|
-
let
|
|
143
|
-
typeof e[n] == "object" && !Array.isArray(e[n]) ? M(e[n], t,
|
|
142
|
+
let a = r ? `${r}-${n}` : n;
|
|
143
|
+
typeof e[n] == "object" && !Array.isArray(e[n]) ? M(e[n], t, a) : e[n] !== "" && (t[a] = e[n]);
|
|
144
144
|
}
|
|
145
145
|
return t;
|
|
146
146
|
}, me = () => [m(2), m(1), m(1), m(1), m(3)].join("-"), m = (e) => {
|
|
@@ -155,39 +155,39 @@ function k(e, t) {
|
|
|
155
155
|
return e;
|
|
156
156
|
}
|
|
157
157
|
function p(e, t) {
|
|
158
|
-
let r, n,
|
|
158
|
+
let r, n, a;
|
|
159
159
|
if (t.length === 0)
|
|
160
160
|
return e;
|
|
161
|
-
for (r = 0,
|
|
161
|
+
for (r = 0, a = t.length; r < a; r++)
|
|
162
162
|
n = t.charCodeAt(r), e = (e << 5) - e + n, e |= 0;
|
|
163
163
|
return e < 0 ? e * -2 : e;
|
|
164
164
|
}
|
|
165
165
|
function $(e, t, r) {
|
|
166
166
|
return Object.keys(t).sort().reduce(n, e);
|
|
167
|
-
function n(
|
|
168
|
-
return v(
|
|
167
|
+
function n(a, o) {
|
|
168
|
+
return v(a, t[o], o, r);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
function v(e, t, r, n) {
|
|
172
|
-
const
|
|
172
|
+
const a = p(p(p(e, r), C(t)), typeof t);
|
|
173
173
|
if (t === null)
|
|
174
|
-
return p(
|
|
174
|
+
return p(a, "null");
|
|
175
175
|
if (t === void 0)
|
|
176
|
-
return p(
|
|
176
|
+
return p(a, "undefined");
|
|
177
177
|
if (typeof t == "object" || typeof t == "function") {
|
|
178
178
|
if (n.includes(t))
|
|
179
|
-
return p(
|
|
179
|
+
return p(a, `[Circular]${r}`);
|
|
180
180
|
n.push(t);
|
|
181
|
-
const
|
|
181
|
+
const o = $(a, t, n);
|
|
182
182
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
183
|
-
return
|
|
183
|
+
return o;
|
|
184
184
|
try {
|
|
185
|
-
return p(
|
|
185
|
+
return p(o, String(t.valueOf()));
|
|
186
186
|
} catch (l) {
|
|
187
|
-
return p(
|
|
187
|
+
return p(o, `[valueOf exception]${l.stack || l.message}`);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
return p(
|
|
190
|
+
return p(a, t.toString());
|
|
191
191
|
}
|
|
192
192
|
function C(e) {
|
|
193
193
|
return Object.prototype.toString.call(e);
|
|
@@ -198,10 +198,10 @@ function he(e) {
|
|
|
198
198
|
const De = (e) => {
|
|
199
199
|
let t = "";
|
|
200
200
|
return O(e, {
|
|
201
|
-
start: function(r, n,
|
|
201
|
+
start: function(r, n, a) {
|
|
202
202
|
t += "<" + r;
|
|
203
|
-
for (let
|
|
204
|
-
t += ` ${n[
|
|
203
|
+
for (let o = 0; o < n.length; o++)
|
|
204
|
+
t += ` ${n[o].name}="${n[o].escaped}"`;
|
|
205
205
|
t += ">";
|
|
206
206
|
},
|
|
207
207
|
end: function(r) {
|
|
@@ -217,26 +217,26 @@ const De = (e) => {
|
|
|
217
217
|
}, Ae = (e, t) => {
|
|
218
218
|
const r = b("html,head,body,title"), n = { link: "head", base: "head" };
|
|
219
219
|
t ? t = t.ownerDocument || t.getOwnerDocument && t.getOwnerDocument() || t : typeof t < "u" ? t = new Document() : typeof document < "u" && document.implementation && document.implementation.createDocument && (t = document.implementation.createDocument("", "", null));
|
|
220
|
-
const
|
|
221
|
-
if (!(t.documentElement || t.getDocumentElement && t.getDocumentElement()) && t.createElement && function() {
|
|
220
|
+
const a = [];
|
|
221
|
+
if (!(t.documentElement || t.getDocumentElement && t.getDocumentElement()) && t.createElement && (function() {
|
|
222
222
|
const i = t.createElement("html"), u = t.createElement("head");
|
|
223
223
|
u.appendChild(t.createElement("title")), i.appendChild(u), i.appendChild(t.createElement("body")), t.appendChild(i);
|
|
224
|
-
}(), t.getElementsByTagName)
|
|
224
|
+
})(), t.getElementsByTagName)
|
|
225
225
|
for (let i in r) r[i] = t.getElementsByTagName(i)[0];
|
|
226
226
|
let l = r.body;
|
|
227
227
|
return O(e, {
|
|
228
228
|
start: function(i, u, c) {
|
|
229
229
|
if (r[i]) {
|
|
230
|
-
l = r[i], c ||
|
|
230
|
+
l = r[i], c || a.push(l);
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
const s = t.createElement(i);
|
|
234
234
|
for (let d in u)
|
|
235
235
|
s.setAttribute(u[d].name, u[d].value);
|
|
236
|
-
n[i] && typeof r[n[i]] != "boolean" ? r[n[i]].appendChild(s) : l && l.appendChild && l.appendChild(s), c || (
|
|
236
|
+
n[i] && typeof r[n[i]] != "boolean" ? r[n[i]].appendChild(s) : l && l.appendChild && l.appendChild(s), c || (a.push(s), l = s);
|
|
237
237
|
},
|
|
238
238
|
end: function(i) {
|
|
239
|
-
|
|
239
|
+
a.length -= 1, l = a[a.length - 1];
|
|
240
240
|
},
|
|
241
241
|
chars: function(i) {
|
|
242
242
|
l.appendChild(t.createTextNode(i));
|
|
@@ -257,22 +257,22 @@ const De = (e) => {
|
|
|
257
257
|
), T = b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), H = b(
|
|
258
258
|
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
|
|
259
259
|
), W = b("script,style"), O = (e, t) => {
|
|
260
|
-
let r, n,
|
|
260
|
+
let r, n, a, o = [], l = e;
|
|
261
261
|
const i = (c, s) => {
|
|
262
262
|
let d;
|
|
263
263
|
if (!s) d = 0;
|
|
264
264
|
else
|
|
265
|
-
for (d =
|
|
265
|
+
for (d = o.length - 1; d >= 0 && o[d] != s; d--)
|
|
266
266
|
;
|
|
267
267
|
if (d >= 0) {
|
|
268
|
-
for (let f =
|
|
269
|
-
t.end && t.end(
|
|
270
|
-
|
|
268
|
+
for (let f = o.length - 1; f >= d; f--)
|
|
269
|
+
t.end && t.end(o[f]);
|
|
270
|
+
o.length = d;
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
for (; e; ) {
|
|
274
|
-
if (n = !0, !
|
|
275
|
-
if (e.indexOf("<!--") == 0 ? (r = e.indexOf("-->"), r >= 0 && (t.comment && t.comment(e.substring(4, r)), e = e.substring(r + 3), n = !1)) : e.indexOf("</") == 0 ? (
|
|
274
|
+
if (n = !0, !o.at(-1) || !W[o.at(-1)]) {
|
|
275
|
+
if (e.indexOf("<!--") == 0 ? (r = e.indexOf("-->"), r >= 0 && (t.comment && t.comment(e.substring(4, r)), e = e.substring(r + 3), n = !1)) : e.indexOf("</") == 0 ? (a = e.match(P), a && (e = e.substring(a[0].length), a[0].replace(P, i), n = !1)) : e.indexOf("<") == 0 && (a = e.match(R), a && (e = e.substring(a[0].length), a[0].replace(R, u), n = !1)), n) {
|
|
276
276
|
r = e.indexOf("<");
|
|
277
277
|
let c = r < 0 ? e : e.substring(0, r);
|
|
278
278
|
e = r < 0 ? "" : e.substring(r), t.chars && t.chars(c);
|
|
@@ -280,23 +280,23 @@ const De = (e) => {
|
|
|
280
280
|
} else
|
|
281
281
|
e = e.replace(
|
|
282
282
|
//@ts-ignore
|
|
283
|
-
new RegExp("([\\s\\S]*?)</" +
|
|
283
|
+
new RegExp("([\\s\\S]*?)</" + o.at(-1) + "[^>]*>"),
|
|
284
284
|
function(c, s) {
|
|
285
285
|
return s = s.replace(
|
|
286
286
|
/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,
|
|
287
287
|
"$1$2"
|
|
288
288
|
), t.chars && t.chars(s), "";
|
|
289
289
|
}
|
|
290
|
-
), i("",
|
|
290
|
+
), i("", o.at(-1));
|
|
291
291
|
if (e == l) throw "Parse Error: " + e;
|
|
292
292
|
l = e;
|
|
293
293
|
}
|
|
294
294
|
i();
|
|
295
295
|
function u(c, s, d, f) {
|
|
296
296
|
if (s = s.toLowerCase(), G[s])
|
|
297
|
-
for (;
|
|
298
|
-
i("",
|
|
299
|
-
if (T[s] &&
|
|
297
|
+
for (; o.at(-1) && B[o.at(-1)]; )
|
|
298
|
+
i("", o.at(-1));
|
|
299
|
+
if (T[s] && o.at(-1) == s && i("", s), f = S[s] || !!f, f || o.push(s), t.start) {
|
|
300
300
|
const _ = [];
|
|
301
301
|
d.replace(U, function(z, x) {
|
|
302
302
|
let w = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : H[x] ? x : "";
|
|
@@ -323,49 +323,49 @@ const xe = (e) => {
|
|
|
323
323
|
child: []
|
|
324
324
|
};
|
|
325
325
|
return O(e, {
|
|
326
|
-
start: function(n,
|
|
326
|
+
start: function(n, a, o) {
|
|
327
327
|
let l = {
|
|
328
328
|
node: "element",
|
|
329
329
|
tag: n
|
|
330
330
|
};
|
|
331
|
-
if (
|
|
331
|
+
if (a.length !== 0 && (l.attr = a.reduce(function(i, u) {
|
|
332
332
|
let c = u.name, s = u.value;
|
|
333
333
|
return s.match(/ /) && (["title", "transform", "viewBox", "widget"].includes(u.name) || (s = s.split(" "))), i[c] ? Array.isArray(i[c]) ? i[c].push(s) : i[c] = [i[c], s] : i[c] = s, i;
|
|
334
|
-
}, {})),
|
|
334
|
+
}, {})), o) {
|
|
335
335
|
const i = t[0] || r;
|
|
336
336
|
i.child === void 0 && (i.child = []), i.child.push(l);
|
|
337
337
|
} else
|
|
338
338
|
t.unshift(l);
|
|
339
339
|
},
|
|
340
340
|
end: function(n) {
|
|
341
|
-
const
|
|
342
|
-
if (
|
|
343
|
-
r.child.push(
|
|
341
|
+
const a = t.shift();
|
|
342
|
+
if (a.tag !== n && console.error("invalid state: mismatch end tag"), t.length === 0)
|
|
343
|
+
r.child.push(a);
|
|
344
344
|
else {
|
|
345
|
-
const
|
|
346
|
-
|
|
345
|
+
const o = t[0];
|
|
346
|
+
o.child === void 0 && (o.child = []), o.child.push(a);
|
|
347
347
|
}
|
|
348
348
|
},
|
|
349
349
|
//@ts-ignore
|
|
350
350
|
chars: function(n) {
|
|
351
|
-
let
|
|
351
|
+
let a = {
|
|
352
352
|
node: "text",
|
|
353
353
|
text: n
|
|
354
354
|
};
|
|
355
355
|
if (t.length === 0)
|
|
356
|
-
r.child.push(
|
|
356
|
+
r.child.push(a);
|
|
357
357
|
else {
|
|
358
|
-
const
|
|
359
|
-
|
|
358
|
+
const o = t[0];
|
|
359
|
+
o.child === void 0 && (o.child = []), o.child.push(a);
|
|
360
360
|
}
|
|
361
361
|
},
|
|
362
362
|
//@ts-ignore
|
|
363
363
|
comment: function(n) {
|
|
364
|
-
const
|
|
364
|
+
const a = {
|
|
365
365
|
node: "comment",
|
|
366
366
|
text: n
|
|
367
|
-
},
|
|
368
|
-
|
|
367
|
+
}, o = t[0];
|
|
368
|
+
o.child === void 0 && (o.child = []), o.child.push(a);
|
|
369
369
|
}
|
|
370
370
|
}), r;
|
|
371
371
|
}, Z = (e) => {
|
|
@@ -386,19 +386,19 @@ const xe = (e) => {
|
|
|
386
386
|
"embed"
|
|
387
387
|
];
|
|
388
388
|
let r = "";
|
|
389
|
-
e.child && (r = e.child.map(function(
|
|
390
|
-
return Z(
|
|
389
|
+
e.child && (r = e.child.map(function(a) {
|
|
390
|
+
return Z(a);
|
|
391
391
|
}).join(""));
|
|
392
392
|
let n = "";
|
|
393
|
-
if (e.attr && (n = Object.keys(e.attr).map(function(
|
|
394
|
-
let
|
|
395
|
-
return Array.isArray(
|
|
393
|
+
if (e.attr && (n = Object.keys(e.attr).map(function(a) {
|
|
394
|
+
let o = e.attr[a];
|
|
395
|
+
return Array.isArray(o) && (o = o.join(" ")), `${a}=${F(o)}`;
|
|
396
396
|
}).join(" "), n !== "" && (n = ` ${n}`)), e.node === "element") {
|
|
397
|
-
let
|
|
398
|
-
if (t.indexOf(
|
|
397
|
+
let a = e.tag;
|
|
398
|
+
if (t.indexOf(a) > -1)
|
|
399
399
|
return `<${e.tag}${n}/>`;
|
|
400
|
-
const
|
|
401
|
-
return `${
|
|
400
|
+
const o = `<${e.tag}${n}>`, l = `</${e.tag}>`;
|
|
401
|
+
return `${o}${r}${l}`;
|
|
402
402
|
}
|
|
403
403
|
if (e.node === "text")
|
|
404
404
|
return e.text;
|
|
@@ -417,9 +417,9 @@ const xe = (e) => {
|
|
|
417
417
|
if (e = typeof e == "string" || e instanceof String ? parseFloat(e.replace(/[^0-9.]/g, "")) : e, r === !1)
|
|
418
418
|
return e.toLocaleString(n);
|
|
419
419
|
if (e < 1e3)
|
|
420
|
-
return
|
|
420
|
+
return e;
|
|
421
421
|
e = e.toString().replace(/[^0-9.]/g, "");
|
|
422
|
-
let
|
|
422
|
+
let a = [
|
|
423
423
|
{ v: 1e3, s: "k" },
|
|
424
424
|
{ v: 1e6, s: "M" },
|
|
425
425
|
{ v: 1e9, s: "G" },
|
|
@@ -428,10 +428,10 @@ const xe = (e) => {
|
|
|
428
428
|
{ v: 1e18, s: "E" },
|
|
429
429
|
{ v: 1e21, s: "Z" },
|
|
430
430
|
{ v: 1e24, s: "Y" }
|
|
431
|
-
],
|
|
432
|
-
for (
|
|
431
|
+
], o;
|
|
432
|
+
for (o = a.length - 1; o > 0 && !(e >= a[o].v); o--)
|
|
433
433
|
;
|
|
434
|
-
return (e / o
|
|
434
|
+
return (e / a[o].v).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + a[o].s;
|
|
435
435
|
}, we = (e) => Object.keys(e).length === 0, h = new BroadcastChannel("logging"), Re = async (e = 0, t) => {
|
|
436
436
|
h.postMessage({ action: "log", level: e, message: t });
|
|
437
437
|
}, Pe = {
|
|
@@ -459,10 +459,10 @@ function Ee(e, t) {
|
|
|
459
459
|
{ value: 1e21, symbol: "Z" },
|
|
460
460
|
{ value: 1e24, symbol: "Y" }
|
|
461
461
|
], n = /\.0+$|(\.\d*[1-9])0+$/;
|
|
462
|
-
let
|
|
463
|
-
for (
|
|
462
|
+
let a;
|
|
463
|
+
for (a = r.length - 1; a > 0 && !(e >= r[a].value); a--)
|
|
464
464
|
;
|
|
465
|
-
return (e / r[
|
|
465
|
+
return (e / r[a].value).toFixed(t).replace(n, "$1") + r[a].symbol;
|
|
466
466
|
}
|
|
467
467
|
function Me(e) {
|
|
468
468
|
const t = RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);
|
|
@@ -476,17 +476,24 @@ function $e(e) {
|
|
|
476
476
|
return e[Math.floor(Math.random() * e.length)];
|
|
477
477
|
}
|
|
478
478
|
function Ce(e) {
|
|
479
|
+
return e.language === "ar" ? {
|
|
480
|
+
direction: "rtl",
|
|
481
|
+
textAlign: "right"
|
|
482
|
+
} : {
|
|
483
|
+
direction: "ltr",
|
|
484
|
+
textAlign: "left"
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
const Ue = (e) => {
|
|
479
488
|
switch (e.language) {
|
|
480
489
|
case "ar":
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
textAlign: "right"
|
|
484
|
-
};
|
|
490
|
+
case "ml":
|
|
491
|
+
return "rtl";
|
|
485
492
|
default:
|
|
486
|
-
return
|
|
493
|
+
return "ltr";
|
|
487
494
|
}
|
|
488
|
-
}
|
|
489
|
-
function
|
|
495
|
+
};
|
|
496
|
+
function Se(e) {
|
|
490
497
|
const t = e.filter(
|
|
491
498
|
(r) => r !== void 0
|
|
492
499
|
);
|
|
@@ -528,13 +535,13 @@ function Ue(e) {
|
|
|
528
535
|
}
|
|
529
536
|
}), t;
|
|
530
537
|
}
|
|
531
|
-
function
|
|
538
|
+
function Ge(e, t, r, n) {
|
|
532
539
|
e.stopPropagation(), t.showModal({
|
|
533
540
|
showComponent: "card-modal",
|
|
534
541
|
props: { data: r, options: n }
|
|
535
542
|
});
|
|
536
543
|
}
|
|
537
|
-
function
|
|
544
|
+
function Be(e) {
|
|
538
545
|
const t = [...e];
|
|
539
546
|
for (let r = t.length - 1; r > 0; r--) {
|
|
540
547
|
const n = Math.floor(Math.random() * (r + 1));
|
|
@@ -542,13 +549,13 @@ function Ge(e) {
|
|
|
542
549
|
}
|
|
543
550
|
return t;
|
|
544
551
|
}
|
|
545
|
-
function
|
|
552
|
+
function Te() {
|
|
546
553
|
let e = "";
|
|
547
554
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
548
555
|
for (let r = 0; r < 7; r++) e += t.charAt(Math.floor(Math.random() * t.length));
|
|
549
556
|
return e;
|
|
550
557
|
}
|
|
551
|
-
const
|
|
558
|
+
const He = (e) => {
|
|
552
559
|
switch (e?.type) {
|
|
553
560
|
case D.MESSAGES:
|
|
554
561
|
return g.MESSAGES;
|
|
@@ -561,12 +568,12 @@ const Te = (e) => {
|
|
|
561
568
|
}
|
|
562
569
|
}, K = (e = 6) => Math.random().toString(36).substring(2, e + 2), X = (e, t = []) => !t.find(function(n) {
|
|
563
570
|
return n === e;
|
|
564
|
-
}),
|
|
565
|
-
let n = 0,
|
|
566
|
-
for (;
|
|
567
|
-
|
|
568
|
-
return
|
|
569
|
-
},
|
|
571
|
+
}), We = (e, t = []) => {
|
|
572
|
+
let n = 0, a = "";
|
|
573
|
+
for (; a == "" && n < 100; )
|
|
574
|
+
a = K(e), X(a, t) || (a = "", n++);
|
|
575
|
+
return a;
|
|
576
|
+
}, Fe = (e) => {
|
|
570
577
|
switch (!0) {
|
|
571
578
|
case e < 0:
|
|
572
579
|
return "text-down text-xs";
|
|
@@ -575,23 +582,23 @@ const Te = (e) => {
|
|
|
575
582
|
default:
|
|
576
583
|
return "text-white text-xs";
|
|
577
584
|
}
|
|
578
|
-
},
|
|
579
|
-
function
|
|
585
|
+
}, Ye = (e, t, r) => Promise.race([e, Q(t, r)]), Q = (e, t) => new Promise((r, n) => setTimeout(() => t === void 0 ? r("ok") : n(t), e));
|
|
586
|
+
function Ze(e) {
|
|
580
587
|
let t = `${e.type}.${e.topics}`;
|
|
581
588
|
return e.order && (t += `.${e.order}`), e.period && (t += `.${e.period}`), t;
|
|
582
589
|
}
|
|
583
|
-
function
|
|
590
|
+
function Ke(e) {
|
|
584
591
|
if (e.widget === void 0) {
|
|
585
592
|
const t = e.topics?.split("-");
|
|
586
593
|
t && t.length > 1 ? (e.dashboard = t ? t[0] : "", e.widget = t ? t[1] : "") : (e.widget = e.topics, e.dashboard = e.slide);
|
|
587
594
|
}
|
|
588
595
|
return e;
|
|
589
596
|
}
|
|
590
|
-
function
|
|
591
|
-
let r, n,
|
|
597
|
+
function Xe(e, t) {
|
|
598
|
+
let r, n, a, o, l;
|
|
592
599
|
switch (e.moderation) {
|
|
593
600
|
case A.BEFORE:
|
|
594
|
-
r = /* @__PURE__ */ new Date(), n = e.beforeTime?.split(":"),
|
|
601
|
+
r = /* @__PURE__ */ new Date(), n = e.beforeTime?.split(":"), a = Number.parseInt(n ? n[0] : "00"), o = Number.parseInt(n ? n[1] : "00"), l = Number.parseInt(n ? n[2] : "00"), t.before = r.setHours(a, o, l, 0) / 1e3, t.period || (t.period = r.getDay() === 1 ? 72 : 24);
|
|
595
602
|
break;
|
|
596
603
|
case A.DELAYED:
|
|
597
604
|
e.delay && e.delay > 0 && (t.delay = `${e.delay}`);
|
|
@@ -624,17 +631,18 @@ export {
|
|
|
624
631
|
ne as brandLogo,
|
|
625
632
|
y as camelCase,
|
|
626
633
|
te as camelCasedProps,
|
|
627
|
-
|
|
628
|
-
|
|
634
|
+
oe as camelToHyphen,
|
|
635
|
+
ae as camelize,
|
|
629
636
|
ie as capitalizeFirstLetter,
|
|
630
637
|
se as clearContents,
|
|
631
638
|
E as deepMerge,
|
|
639
|
+
Ue as dir,
|
|
632
640
|
ge as escape,
|
|
633
641
|
ee as filterAttributes,
|
|
634
642
|
M as flatten,
|
|
635
643
|
be as formatContent,
|
|
636
644
|
me as getGuid,
|
|
637
|
-
|
|
645
|
+
Ze as getKey,
|
|
638
646
|
Me as getParameterByName,
|
|
639
647
|
ke as getQueryParam,
|
|
640
648
|
Oe as hasHWA,
|
|
@@ -649,7 +657,7 @@ export {
|
|
|
649
657
|
Le as maxifyHtml,
|
|
650
658
|
Ie as minifyCss,
|
|
651
659
|
ve as minifyHtml,
|
|
652
|
-
|
|
660
|
+
Xe as moderation,
|
|
653
661
|
Ee as numberFormatter,
|
|
654
662
|
le as randomColor,
|
|
655
663
|
ue as randomRGB,
|
|
@@ -657,14 +665,14 @@ export {
|
|
|
657
665
|
ce as randomRGBAfull,
|
|
658
666
|
$e as randomValue,
|
|
659
667
|
Ce as rtl,
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
668
|
+
Se as sanitize,
|
|
669
|
+
Ge as showModal,
|
|
670
|
+
Be as shuffleMessages,
|
|
671
|
+
Te as stringGen,
|
|
672
|
+
He as typeCss,
|
|
673
|
+
We as uniq,
|
|
666
674
|
fe as unique,
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
675
|
+
Fe as upDownColor,
|
|
676
|
+
Ke as widgetParams,
|
|
677
|
+
Ye as wrapPromise
|
|
670
678
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzcasting-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Mark Tamis, TouchFlows SAS",
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@antfu/eslint-config": "^
|
|
35
|
-
"@commitlint/cli": "^20.
|
|
36
|
-
"@commitlint/config-conventional": "^20.
|
|
37
|
-
"@types/node": "^24.10.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
39
|
-
"@typescript-eslint/parser": "^8.
|
|
34
|
+
"@antfu/eslint-config": "^7.2.0",
|
|
35
|
+
"@commitlint/cli": "^20.4.1",
|
|
36
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
37
|
+
"@types/node": "^24.10.10",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
39
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
40
40
|
"@vitest/coverage-v8": "^4.0.1",
|
|
41
41
|
"camelcase": "^9.0.0",
|
|
42
42
|
"changelogen": "^0.6.2",
|
|
43
|
-
"eslint": "^9.39.
|
|
43
|
+
"eslint": "^9.39.2",
|
|
44
44
|
"lint-staged": "^16.2.7",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
|
-
"vite": "^7.
|
|
46
|
+
"vite": "^7.3.1",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4",
|
|
48
48
|
"vitest": "^4.0.1"
|
|
49
49
|
},
|