buzzcasting-utils 1.9.2 → 1.9.4

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.
@@ -104,6 +104,8 @@ export declare interface CountryProperties {
104
104
  code: string;
105
105
  }
106
106
 
107
+ export declare const createLogger: () => Worker;
108
+
107
109
  declare enum CSS_2 {
108
110
  API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;",
109
111
  APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;",
@@ -493,7 +495,7 @@ export declare interface ICountry {
493
495
  fillStyle: string;
494
496
  }
495
497
 
496
- declare interface ICssCard {
498
+ export declare interface ICssCard {
497
499
  avatar?: string;
498
500
  backdrop?: string;
499
501
  body?: string;
@@ -519,7 +521,7 @@ declare interface ICssCard {
519
521
  widget?: string;
520
522
  }
521
523
 
522
- declare interface ICssCloud {
524
+ export declare interface ICssCloud {
523
525
  up: string;
524
526
  down: string;
525
527
  new: string;
@@ -544,7 +546,7 @@ declare interface ICssCloud {
544
546
  words: string;
545
547
  }
546
548
 
547
- declare interface ICssContents {
549
+ export declare interface ICssContents {
548
550
  body: string;
549
551
  card: string;
550
552
  globe?: string;
@@ -552,7 +554,7 @@ declare interface ICssContents {
552
554
  widget: string;
553
555
  }
554
556
 
555
- declare interface ICssSeries {
557
+ export declare interface ICssSeries {
556
558
  arrowdown: string;
557
559
  arrowup: string;
558
560
  body: string;
@@ -922,7 +924,7 @@ export declare interface ILayoutZones {
922
924
  ["x:string"]: ILayoutZone[];
923
925
  }
924
926
 
925
- declare interface ILegend {
927
+ export declare interface ILegend {
926
928
  key: ILegendKey;
927
929
  label: ILegendLabel;
928
930
  count: ILegendCount;
@@ -932,20 +934,20 @@ declare interface ILegend {
932
934
  gap: ILegendGap;
933
935
  }
934
936
 
935
- declare interface ILegendCount {
937
+ export declare interface ILegendCount {
936
938
  width: string;
937
939
  }
938
940
 
939
- declare interface ILegendGap {
941
+ export declare interface ILegendGap {
940
942
  column: string;
941
943
  row: string;
942
944
  }
943
945
 
944
- declare interface ILegendKey {
946
+ export declare interface ILegendKey {
945
947
  width: string;
946
948
  }
947
949
 
948
- declare interface ILegendLabel {
950
+ export declare interface ILegendLabel {
949
951
  width: string;
950
952
  }
951
953
 
@@ -1018,7 +1020,7 @@ export declare interface InfluencerLabel {
1018
1020
 
1019
1021
  export declare const intToString: (num: any, digits?: number, abbreviate?: boolean, locale?: string) => string;
1020
1022
 
1021
- declare interface IPie {
1023
+ export declare interface IPie {
1022
1024
  radius: IPieRadius;
1023
1025
  animation: IPieAnimation;
1024
1026
  }
@@ -1026,14 +1028,14 @@ declare interface IPie {
1026
1028
  /**
1027
1029
  * Animation Duration
1028
1030
  */
1029
- declare interface IPieAnimation {
1031
+ export declare interface IPieAnimation {
1030
1032
  duration: number;
1031
1033
  }
1032
1034
 
1033
1035
  /**
1034
1036
  * inner and outer radius in px
1035
1037
  */
1036
- declare interface IPieRadius {
1038
+ export declare interface IPieRadius {
1037
1039
  inner: number;
1038
1040
  outer: number;
1039
1041
  }
@@ -1165,7 +1167,7 @@ export declare interface ISeriesOptions {
1165
1167
  config?: IConfig;
1166
1168
  }
1167
1169
 
1168
- declare interface IShowCard {
1170
+ export declare interface IShowCard {
1169
1171
  approve?: boolean;
1170
1172
  avatar?: boolean;
1171
1173
  brand?: boolean;
@@ -1182,7 +1184,7 @@ declare interface IShowCard {
1182
1184
  debug?: boolean;
1183
1185
  }
1184
1186
 
1185
- declare interface IShowCloud {
1187
+ export declare interface IShowCloud {
1186
1188
  emojis: boolean;
1187
1189
  brand: boolean;
1188
1190
  date: boolean;
@@ -1192,12 +1194,16 @@ declare interface IShowCloud {
1192
1194
  debug?: boolean;
1193
1195
  }
1194
1196
 
1195
- declare interface IShowLegend {
1197
+ export declare interface IShowContents {
1198
+ debug?: boolean;
1199
+ }
1200
+
1201
+ export declare interface IShowLegend {
1196
1202
  percentage: boolean;
1197
1203
  debug?: boolean;
1198
1204
  }
1199
1205
 
1200
- declare interface IShowSeries {
1206
+ export declare interface IShowSeries {
1201
1207
  brand: boolean;
1202
1208
  percentage: boolean;
1203
1209
  date: boolean;
@@ -197,7 +197,7 @@ function he(e) {
197
197
  }
198
198
  const De = (e) => {
199
199
  let t = "";
200
- return w(e, {
200
+ return _(e, {
201
201
  start: function(r, n, a) {
202
202
  t += "<" + r;
203
203
  for (let o = 0; o < n.length; o++)
@@ -214,7 +214,7 @@ const De = (e) => {
214
214
  t += `<!-- ${r} -->`;
215
215
  }
216
216
  }), t;
217
- }, _e = (e, t) => {
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
220
  const a = [];
@@ -224,7 +224,7 @@ const De = (e) => {
224
224
  }(), t.getElementsByTagName)
225
225
  for (let s in r) r[s] = t.getElementsByTagName(s)[0];
226
226
  let l = r.body;
227
- return w(e, {
227
+ return _(e, {
228
228
  start: function(s, u, c) {
229
229
  if (r[s]) {
230
230
  l = r[s], c || a.push(l);
@@ -256,7 +256,7 @@ const De = (e) => {
256
256
  "abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"
257
257
  ), B = b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), T = b(
258
258
  "checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
259
- ), H = b("script,style"), w = (e, t) => {
259
+ ), H = b("script,style"), _ = (e, t) => {
260
260
  let r, n, a, o = [], l = e;
261
261
  const s = (c, i) => {
262
262
  let d;
@@ -297,16 +297,16 @@ const De = (e) => {
297
297
  for (; o.at(-1) && G[o.at(-1)]; )
298
298
  s("", o.at(-1));
299
299
  if (B[i] && o.at(-1) == i && s("", i), p = S[i] || !!p, p || o.push(i), t.start) {
300
- const A = [];
301
- d.replace($, function(z, _) {
302
- let O = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : T[_] ? _ : "";
303
- A.push({
304
- name: _,
300
+ const w = [];
301
+ d.replace($, function(z, A) {
302
+ let O = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : T[A] ? A : "";
303
+ w.push({
304
+ name: A,
305
305
  value: O,
306
306
  escaped: O.replace(/(^|[^\\])"/g, '$1\\"')
307
307
  //"
308
308
  });
309
- }), t.start && t.start(i, A, p);
309
+ }), t.start && t.start(i, w, p);
310
310
  }
311
311
  }
312
312
  };
@@ -316,13 +316,13 @@ function W(e) {
316
316
  function F(e) {
317
317
  return e.replace(/<\?xml.*\?>\n/, "").replace(/<!doctype.*\>\n/, "").replace(/<!DOCTYPE.*\>\n/, "");
318
318
  }
319
- const we = (e) => {
319
+ const _e = (e) => {
320
320
  e = F(e);
321
321
  const t = [], r = {
322
322
  node: "root",
323
323
  child: []
324
324
  };
325
- return w(e, {
325
+ return _(e, {
326
326
  start: function(n, a, o) {
327
327
  let l = {
328
328
  node: "element",
@@ -406,7 +406,7 @@ const we = (e) => {
406
406
  return `<!-- ${e.text} -->`;
407
407
  if (e.node === "root")
408
408
  return r;
409
- }, Ae = () => {
409
+ }, we = () => {
410
410
  const e = (t = !1) => {
411
411
  const n = document.createElement("canvas").getContext("2d", { willReadFrequently: t });
412
412
  return n !== null ? (n.moveTo(0, 0), n.lineTo(120, 121), n.stroke(), n.getImageData(0, 0, 200, 200).data.join()) : null;
@@ -472,12 +472,9 @@ const we = (e) => {
472
472
  }`
473
473
  ],
474
474
  { type: "text/javascript" }
475
- );
476
- window.__bc = window.__bc || {};
477
- window.__bc.logger = window.__bc?.logger || new Worker(window.URL.createObjectURL(Y), { name: "logger" });
478
- const Le = async (e = 0, t) => {
475
+ ), Le = () => new Worker(window.URL.createObjectURL(Y), { name: "logger" }), Re = async (e = 0, t) => {
479
476
  window.__bc.logger.postMessage({ action: "log", level: e, message: t });
480
- }, Re = {
477
+ }, ve = {
481
478
  add: (e) => window.__bc.logger.postMessage({ action: "add", level: e }),
482
479
  clear: () => window.__bc.logger.postMessage({ action: "delete" }),
483
480
  delete: (e) => window.__bc.logger.postMessage({ action: "delete", level: e }),
@@ -485,12 +482,12 @@ const Le = async (e = 0, t) => {
485
482
  action: "list",
486
483
  message: ["%capp%c %clogging", g.APP, g.NONE, g.OK]
487
484
  })
488
- }, ve = (e) => e.replace(/\<\!--\s*?[^\s?\[][\s\S]*?--\>/g, "").replace(/\>\s*\</g, "><").replace(/\t/g, ""), Ee = (e) => e.replace(/\>\</g, `>
489
- <`), Pe = (e) => e.replace(/\/\*.*\*\/|\/\*[\s\S]*?\*\/|\n|\t|\v|\s{2,}/g, "").replace(/\s*\{\s*/g, "{").replace(/\s*\}\s*/g, "}").replace(/\s*\:\s*/g, ":").replace(/\s*\;\s*/g, ";").replace(/\s*\,\s*/g, ",").replace(/\s*\~\s*/g, "~").replace(/\s*\>\s*/g, ">").replace(/\s*\+\s*/g, "+").replace(/\s*\!\s*/g, "!"), Ie = (e) => e.replace(/\,/g, ", ").replace(/\{/g, ` {
485
+ }, Ee = (e) => e.replace(/\<\!--\s*?[^\s?\[][\s\S]*?--\>/g, "").replace(/\>\s*\</g, "><").replace(/\t/g, ""), Pe = (e) => e.replace(/\>\</g, `>
486
+ <`), Ie = (e) => e.replace(/\/\*.*\*\/|\/\*[\s\S]*?\*\/|\n|\t|\v|\s{2,}/g, "").replace(/\s*\{\s*/g, "{").replace(/\s*\}\s*/g, "}").replace(/\s*\:\s*/g, ":").replace(/\s*\;\s*/g, ";").replace(/\s*\,\s*/g, ",").replace(/\s*\~\s*/g, "~").replace(/\s*\>\s*/g, ">").replace(/\s*\+\s*/g, "+").replace(/\s*\!\s*/g, "!"), ke = (e) => e.replace(/\,/g, ", ").replace(/\{/g, ` {
490
487
  `).replace(/\}/g, `}
491
488
  `).replace(/\;/g, `;
492
489
  `);
493
- function ke(e, t) {
490
+ function ye(e, t) {
494
491
  const r = [
495
492
  { value: 1, symbol: "" },
496
493
  { value: 1e3, symbol: "K" },
@@ -505,18 +502,18 @@ function ke(e, t) {
505
502
  ;
506
503
  return (e / r[a].value).toFixed(t).replace(n, "$1") + r[a].symbol;
507
504
  }
508
- function ye(e) {
505
+ function Me(e) {
509
506
  const t = RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);
510
507
  return t && decodeURIComponent(t[1].replace(/\+/g, " ")) || null;
511
508
  }
512
- const Me = (e) => new Proxy(new URLSearchParams(window.location.search), {
509
+ const Ue = (e) => new Proxy(new URLSearchParams(window.location.search), {
513
510
  // @ts-ignore
514
511
  get: (r, n) => r.get(n)
515
512
  })[e];
516
- function Ue(e) {
513
+ function $e(e) {
517
514
  return e[Math.floor(Math.random() * e.length)];
518
515
  }
519
- function $e(e) {
516
+ function Se(e) {
520
517
  switch (e.language) {
521
518
  case "ar":
522
519
  return {
@@ -527,7 +524,7 @@ function $e(e) {
527
524
  return {};
528
525
  }
529
526
  }
530
- function Se(e) {
527
+ function Ce(e) {
531
528
  const t = e.filter(
532
529
  (r) => r !== void 0
533
530
  );
@@ -569,13 +566,13 @@ function Se(e) {
569
566
  }
570
567
  }), t;
571
568
  }
572
- function Ce(e, t, r, n) {
569
+ function Ge(e, t, r, n) {
573
570
  e.stopPropagation(), t.showModal({
574
571
  showComponent: "card-modal",
575
572
  props: { data: r, options: n }
576
573
  });
577
574
  }
578
- function Ge(e) {
575
+ function Be(e) {
579
576
  const t = [...e];
580
577
  for (let r = t.length - 1; r > 0; r--) {
581
578
  const n = Math.floor(Math.random() * (r + 1));
@@ -583,13 +580,13 @@ function Ge(e) {
583
580
  }
584
581
  return t;
585
582
  }
586
- function Be() {
583
+ function Te() {
587
584
  let e = "";
588
585
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
589
586
  for (let r = 0; r < 7; r++) e += t.charAt(Math.floor(Math.random() * t.length));
590
587
  return e;
591
588
  }
592
- const Te = (e) => {
589
+ const He = (e) => {
593
590
  switch (e?.type) {
594
591
  case h.MESSAGES:
595
592
  return g.MESSAGES;
@@ -602,12 +599,12 @@ const Te = (e) => {
602
599
  }
603
600
  }, Z = (e = 6) => Math.random().toString(36).substring(2, e + 2), X = (e, t = []) => !t.find(function(n) {
604
601
  return n === e;
605
- }), He = (e, t = []) => {
602
+ }), We = (e, t = []) => {
606
603
  let n = 0, a = "";
607
604
  for (; a == "" && n < 100; )
608
605
  a = Z(e), X(a, t) || (a = "", n++);
609
606
  return a;
610
- }, We = (e) => {
607
+ }, Fe = (e) => {
611
608
  switch (!0) {
612
609
  case e < 0:
613
610
  return "text-down text-xs";
@@ -616,19 +613,19 @@ const Te = (e) => {
616
613
  default:
617
614
  return "text-white text-xs";
618
615
  }
619
- }, Fe = (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));
620
- function Ke(e) {
616
+ }, Ke = (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));
617
+ function Ye(e) {
621
618
  let t = `${e.type}.${e.topics}`;
622
619
  return e.order && (t += `.${e.order}`), e.period && (t += `.${e.period}`), t;
623
620
  }
624
- function Ye(e) {
621
+ function Ze(e) {
625
622
  if (e.widget === void 0) {
626
623
  const t = e.topics?.split("-");
627
624
  t && t.length > 1 ? (e.dashboard = t ? t[0] : "", e.widget = t ? t[1] : "") : (e.widget = e.topics, e.dashboard = e.slide);
628
625
  }
629
626
  return e;
630
627
  }
631
- function Ze(e, t) {
628
+ function Xe(e, t) {
632
629
  let r, n, a, o, l;
633
630
  switch (e.moderation) {
634
631
  case D.BEFORE:
@@ -651,8 +648,8 @@ export {
651
648
  g as CSS,
652
649
  v as EVENTS,
653
650
  j as GeoType,
654
- w as HTMLParser,
655
- _e as HTMLtoDOM,
651
+ _ as HTMLParser,
652
+ Ae as HTMLtoDOM,
656
653
  De as HTMLtoXML,
657
654
  D as MODERATION,
658
655
  fe as RGBAchangeA,
@@ -669,43 +666,44 @@ export {
669
666
  ae as camelize,
670
667
  se as capitalizeFirstLetter,
671
668
  ie as clearContents,
669
+ Le as createLogger,
672
670
  I as deepMerge,
673
671
  ge as escape,
674
672
  ee as filterAttributes,
675
673
  k as flatten,
676
674
  be as formatContent,
677
675
  me as getGuid,
678
- Ke as getKey,
679
- ye as getParameterByName,
680
- Me as getQueryParam,
681
- Ae as hasHWA,
676
+ Ye as getKey,
677
+ Me as getParameterByName,
678
+ Ue as getQueryParam,
679
+ we as hasHWA,
682
680
  he as hashSum,
683
- we as html2json,
681
+ _e as html2json,
684
682
  Oe as intToString,
685
683
  xe as isEmpty,
686
684
  K as json2html,
687
- Le as log,
688
- Re as logging,
689
- Ie as maxifyCss,
690
- Ee as maxifyHtml,
691
- Pe as minifyCss,
692
- ve as minifyHtml,
693
- Ze as moderation,
694
- ke as numberFormatter,
685
+ Re as log,
686
+ ve as logging,
687
+ ke as maxifyCss,
688
+ Pe as maxifyHtml,
689
+ Ie as minifyCss,
690
+ Ee as minifyHtml,
691
+ Xe as moderation,
692
+ ye as numberFormatter,
695
693
  le as randomColor,
696
694
  ue as randomRGB,
697
695
  de as randomRGBA,
698
696
  ce as randomRGBAfull,
699
- Ue as randomValue,
700
- $e as rtl,
701
- Se as sanitize,
702
- Ce as showModal,
703
- Ge as shuffleMessages,
704
- Be as stringGen,
705
- Te as typeCss,
706
- He as uniq,
697
+ $e as randomValue,
698
+ Se as rtl,
699
+ Ce as sanitize,
700
+ Ge as showModal,
701
+ Be as shuffleMessages,
702
+ Te as stringGen,
703
+ He as typeCss,
704
+ We as uniq,
707
705
  pe as unique,
708
- We as upDownColor,
709
- Ye as widgetParams,
710
- Fe as wrapPromise
706
+ Fe as upDownColor,
707
+ Ze as widgetParams,
708
+ Ke as wrapPromise
711
709
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzcasting-utils",
3
3
  "type": "module",
4
- "version": "1.9.2",
4
+ "version": "1.9.4",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "Mark Tamis, TouchFlows SAS",