@streamlayer/react 1.24.6 → 1.24.8-pre.11da316

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.
Files changed (167) hide show
  1. package/lib/app/advertisement.d.ts +5 -0
  2. package/lib/cjs/advertisement.js +19657 -203
  3. package/lib/cjs/auth.js +4459 -1
  4. package/lib/cjs/bet-pack.js +15728 -1
  5. package/lib/cjs/index.js +19469 -1
  6. package/lib/cjs/insight.js +13571 -1
  7. package/lib/cjs/masters.js +20735 -1
  8. package/lib/cjs/notification.js +13118 -1
  9. package/lib/cjs/package.json +1 -0
  10. package/lib/cjs/pause-ad.js +8390 -1
  11. package/lib/cjs/points.js +7220 -1
  12. package/lib/cjs/polyfills.js +69 -0
  13. package/lib/cjs/polymarket.js +16395 -14
  14. package/lib/cjs/style.css +1 -0
  15. package/lib/cjs/useStreamLayerApp.js +4705 -1
  16. package/lib/dist/cjs/index.js +20735 -1
  17. package/lib/dist/es/index.js +20708 -10
  18. package/lib/dist/es/polyfills.js +92 -0
  19. package/lib/es/Question.js +75 -72
  20. package/lib/es/advertisement.js +9223 -8168
  21. package/lib/es/analytics.js +35 -31
  22. package/lib/es/auth.js +1 -1
  23. package/lib/es/bet-pack.js +1 -1
  24. package/lib/es/feature.js +60 -56
  25. package/lib/{classic/es/hooks-n9ax4LRT.js → es/hooks-42q2i9Iw.js} +25 -23
  26. package/lib/{dist/es/index-CfSdnrfA.js → es/index-sWgEw6jy.js} +1 -1
  27. package/lib/es/index.js +1 -1
  28. package/lib/es/index10.js +181 -7
  29. package/lib/es/index11.js +371 -181
  30. package/lib/es/index12.js +116 -128
  31. package/lib/es/index13.js +101 -97
  32. package/lib/es/index14.js +14 -14
  33. package/lib/es/index15.js +384 -414
  34. package/lib/es/index16.js +380 -382
  35. package/lib/es/index2.js +53 -56
  36. package/lib/es/index3.js +34 -4
  37. package/lib/es/index4.js +2 -2
  38. package/lib/es/index5.js +272 -16
  39. package/lib/es/index6.js +1 -1
  40. package/lib/es/index8.js +8 -282
  41. package/lib/es/index9.js +133 -75
  42. package/lib/es/insight.js +2 -2
  43. package/lib/es/masters.js +1 -1
  44. package/lib/es/masters2.js +34 -35
  45. package/lib/es/notification.js +28 -28
  46. package/lib/es/pause-ad.js +20 -20
  47. package/lib/es/points.js +9 -9
  48. package/lib/es/polymarket.js +38 -38
  49. package/lib/es/storage.js +19 -19
  50. package/lib/es/style.css +1 -0
  51. package/lib/es/useStreamLayerApp.js +1 -1
  52. package/lib/es/useStreamLayerApp2.js +6756 -5470
  53. package/lib/es/utils.js +86 -41
  54. package/lib/source.css +1 -120
  55. package/package.json +99 -83
  56. package/lib/cjs/Question.js +0 -1
  57. package/lib/cjs/analytics.js +0 -1
  58. package/lib/cjs/feature.js +0 -1
  59. package/lib/cjs/gamification-feature.js +0 -1
  60. package/lib/cjs/gamification-feature2.js +0 -1
  61. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  62. package/lib/cjs/index-CfSdnrfA.js +0 -5
  63. package/lib/cjs/index10.js +0 -1
  64. package/lib/cjs/index11.js +0 -1
  65. package/lib/cjs/index12.js +0 -1
  66. package/lib/cjs/index13.js +0 -4
  67. package/lib/cjs/index14.js +0 -1
  68. package/lib/cjs/index15.js +0 -1
  69. package/lib/cjs/index16.js +0 -5
  70. package/lib/cjs/index2.js +0 -1
  71. package/lib/cjs/index3.js +0 -1
  72. package/lib/cjs/index4.js +0 -5
  73. package/lib/cjs/index5.js +0 -1
  74. package/lib/cjs/index6.js +0 -1
  75. package/lib/cjs/index7.js +0 -1
  76. package/lib/cjs/index8.js +0 -1
  77. package/lib/cjs/index9.js +0 -7
  78. package/lib/cjs/masters2.js +0 -8
  79. package/lib/cjs/storage.js +0 -1
  80. package/lib/cjs/theme.js +0 -1
  81. package/lib/cjs/useStreamLayerApp2.js +0 -17
  82. package/lib/cjs/utils.js +0 -47
  83. package/lib/classic/app/advertisement.d.ts +0 -19
  84. package/lib/classic/app/app.d.ts +0 -23
  85. package/lib/classic/app/auth.d.ts +0 -4
  86. package/lib/classic/app/bet-pack.d.ts +0 -10
  87. package/lib/classic/app/insight.d.ts +0 -13
  88. package/lib/classic/app/masters.d.ts +0 -19
  89. package/lib/classic/app/notification.d.ts +0 -5
  90. package/lib/classic/app/pause-ad.d.ts +0 -27
  91. package/lib/classic/app/points.d.ts +0 -3
  92. package/lib/classic/app/polymarket.d.ts +0 -7
  93. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  94. package/lib/classic/cjs/Question.js +0 -1
  95. package/lib/classic/cjs/advertisement.js +0 -203
  96. package/lib/classic/cjs/analytics.js +0 -1
  97. package/lib/classic/cjs/auth.js +0 -1
  98. package/lib/classic/cjs/bet-pack.js +0 -5
  99. package/lib/classic/cjs/feature.js +0 -1
  100. package/lib/classic/cjs/gamification-feature.js +0 -1
  101. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  102. package/lib/classic/cjs/index-CfSdnrfA.js +0 -5
  103. package/lib/classic/cjs/index.js +0 -1
  104. package/lib/classic/cjs/index10.js +0 -1
  105. package/lib/classic/cjs/index11.js +0 -1
  106. package/lib/classic/cjs/index12.js +0 -1
  107. package/lib/classic/cjs/index13.js +0 -4
  108. package/lib/classic/cjs/index2.js +0 -5
  109. package/lib/classic/cjs/index3.js +0 -1
  110. package/lib/classic/cjs/index4.js +0 -1
  111. package/lib/classic/cjs/index5.js +0 -1
  112. package/lib/classic/cjs/index6.js +0 -1
  113. package/lib/classic/cjs/index7.js +0 -7
  114. package/lib/classic/cjs/index8.js +0 -1
  115. package/lib/classic/cjs/index9.js +0 -1
  116. package/lib/classic/cjs/insight.js +0 -1
  117. package/lib/classic/cjs/notification.js +0 -1
  118. package/lib/classic/cjs/notification2.js +0 -1
  119. package/lib/classic/cjs/pause-ad.js +0 -1
  120. package/lib/classic/cjs/points.js +0 -1
  121. package/lib/classic/cjs/polymarket.js +0 -14
  122. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  123. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  124. package/lib/classic/cjs/utils.js +0 -47
  125. package/lib/classic/es/Question.js +0 -503
  126. package/lib/classic/es/advertisement.js +0 -38792
  127. package/lib/classic/es/analytics.js +0 -84
  128. package/lib/classic/es/auth.js +0 -11
  129. package/lib/classic/es/bet-pack.js +0 -3418
  130. package/lib/classic/es/feature.js +0 -210
  131. package/lib/classic/es/gamification-feature.js +0 -4
  132. package/lib/classic/es/index-CfSdnrfA.js +0 -3775
  133. package/lib/classic/es/index.js +0 -15
  134. package/lib/classic/es/index10.js +0 -321
  135. package/lib/classic/es/index11.js +0 -2592
  136. package/lib/classic/es/index12.js +0 -185
  137. package/lib/classic/es/index13.js +0 -820
  138. package/lib/classic/es/index2.js +0 -2605
  139. package/lib/classic/es/index3.js +0 -19
  140. package/lib/classic/es/index4.js +0 -6
  141. package/lib/classic/es/index5.js +0 -4
  142. package/lib/classic/es/index6.js +0 -285
  143. package/lib/classic/es/index7.js +0 -181
  144. package/lib/classic/es/index8.js +0 -7
  145. package/lib/classic/es/index9.js +0 -11
  146. package/lib/classic/es/insight.js +0 -79
  147. package/lib/classic/es/notification.js +0 -9
  148. package/lib/classic/es/notification2.js +0 -1126
  149. package/lib/classic/es/pause-ad.js +0 -232
  150. package/lib/classic/es/points.js +0 -76
  151. package/lib/classic/es/polymarket.js +0 -6617
  152. package/lib/classic/es/useStreamLayerApp.js +0 -4
  153. package/lib/classic/es/useStreamLayerApp2.js +0 -11627
  154. package/lib/classic/es/utils.js +0 -76
  155. package/lib/classic/index.d.ts +0 -6
  156. package/lib/classic/masters.d.ts +0 -8
  157. package/lib/classic/source.css +0 -110
  158. package/lib/dist/cjs/gamification-feature.js +0 -1
  159. package/lib/dist/cjs/index-CfSdnrfA.js +0 -5
  160. package/lib/dist/cjs/masters.js +0 -69
  161. package/lib/dist/es/gamification-feature.js +0 -4
  162. package/lib/dist/es/masters.js +0 -22387
  163. package/lib/dist/index.d.ts +0 -1357
  164. package/lib/dist/source.css +0 -64
  165. package/lib/es/hooks-n9ax4LRT.js +0 -97
  166. package/lib/es/index-CfSdnrfA.js +0 -3775
  167. package/lib/style.css +0 -1
@@ -1,8 +1,11 @@
1
- import { useEffect as c } from "react";
2
- import { e as s } from "./index3.js";
3
- import { A as v } from "./index9.js";
4
- let i = [], r = 0;
5
- const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
1
+ import "./feature.js";
2
+ import { a as c } from "./useStreamLayerApp2.js";
3
+ import { useEffect as v } from "react";
4
+ import { e as u } from "./index3.js";
5
+ import { A as m } from "./index9.js";
6
+ const A = (a) => c(a);
7
+ let o = [], r = 0;
8
+ const s = 4, p = /* @__NO_SIDE_EFFECTS__ */ (a) => {
6
9
  let e = [], t = {
7
10
  get() {
8
11
  return t.lc || t.listen(() => {
@@ -11,24 +14,24 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
11
14
  lc: 0,
12
15
  listen(n) {
13
16
  return t.lc = e.push(n), () => {
14
- for (let o = r + u; o < i.length; )
15
- i[o] === n ? i.splice(o, u) : o += u;
17
+ for (let i = r + s; i < o.length; )
18
+ o[i] === n ? o.splice(i, s) : i += s;
16
19
  let l = e.indexOf(n);
17
20
  ~l && (e.splice(l, 1), --t.lc || t.off());
18
21
  };
19
22
  },
20
23
  notify(n, l) {
21
- let o = !i.length;
24
+ let i = !o.length;
22
25
  for (let f of e)
23
- i.push(f, t.value, n, l);
24
- if (o) {
25
- for (r = 0; r < i.length; r += u)
26
- i[r](
27
- i[r + 1],
28
- i[r + 2],
29
- i[r + 3]
26
+ o.push(f, t.value, n, l);
27
+ if (i) {
28
+ for (r = 0; r < o.length; r += s)
29
+ o[r](
30
+ o[r + 1],
31
+ o[r + 2],
32
+ o[r + 3]
30
33
  );
31
- i.length = 0;
34
+ o.length = 0;
32
35
  }
33
36
  },
34
37
  /* It will be called on last listener unsubscribing.
@@ -46,8 +49,8 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
46
49
  value: a
47
50
  };
48
51
  return t;
49
- }, b = /* @__NO_SIDE_EFFECTS__ */ (a = {}) => {
50
- let e = /* @__PURE__ */ d(a);
52
+ }, E = /* @__NO_SIDE_EFFECTS__ */ (a = {}) => {
53
+ let e = /* @__PURE__ */ p(a);
51
54
  return e.setKey = function(t, n) {
52
55
  let l = e.value;
53
56
  typeof n > "u" && t in e.value ? (e.value = { ...e.value }, delete e.value[t], e.notify(l, t)) : e.value[t] !== n && (e.value = {
@@ -55,20 +58,20 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
55
58
  [t]: n
56
59
  }, e.notify(l, t));
57
60
  }, e;
58
- }, y = (a) => [(e) => (...t) => (a && s.emit(a?.type, a), e ? e(t) : null)], h = (a) => {
61
+ }, w = (a) => [(e) => (...t) => (a && u.emit(a?.type, a), e ? e(t) : null)], x = (a) => {
59
62
  const e = a.target;
60
- e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && s.emit("poll", {
63
+ e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && u.emit("poll", {
61
64
  action: "navigated",
62
65
  payload: {}
63
- }), e instanceof Element && e.getAttribute("data-a") === "intr" && s.emit("interactions", {
66
+ }), e instanceof Element && e.getAttribute("data-a") === "intr" && u.emit("interactions", {
64
67
  action: "tap",
65
68
  payload: {}
66
69
  });
67
- }, A = (a, e) => {
68
- const t = window.innerWidth < v.xl;
69
- c(() => {
70
- const n = t && e.useDomNode ? document : a.current, l = (o) => {
71
- e.listener(o, a);
70
+ }, L = (a, e) => {
71
+ const t = window.innerWidth < m.xl;
72
+ v(() => {
73
+ const n = t && e.useDomNode ? document : a.current, l = (i) => {
74
+ e.listener(i, a);
72
75
  };
73
76
  return e.enabled && n?.addEventListener(e.event, l), () => {
74
77
  n?.removeEventListener(e.event, l);
@@ -76,9 +79,10 @@ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
76
79
  }, [t, e.enabled, e.listener]);
77
80
  };
78
81
  export {
79
- A,
80
- h as a,
81
- d as b,
82
- b as f,
83
- y as u
82
+ L as A,
83
+ x as a,
84
+ p as b,
85
+ A as c,
86
+ E as f,
87
+ w as u
84
88
  };
package/lib/es/auth.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useEffect as o } from "react";
2
- import { Y as f } from "./hooks-n9ax4LRT.js";
2
+ import { w as f } from "./hooks-42q2i9Iw.js";
3
3
  const p = ({ token: t, schema: i }) => {
4
4
  const r = f();
5
5
  return o(() => {
@@ -3,7 +3,7 @@ import { e as i } from "./index3.js";
3
3
  import { useEffect as n } from "react";
4
4
  import "./feature.js";
5
5
  import { D as c } from "./index4.js";
6
- import { Y as m } from "./hooks-n9ax4LRT.js";
6
+ import { w as m } from "./hooks-42q2i9Iw.js";
7
7
  const r = (t) => {
8
8
  const e = t.target;
9
9
  e instanceof Element && e.getAttribute("data-a") === "intr" && i.emit("interactions", {
package/lib/es/feature.js CHANGED
@@ -1,23 +1,27 @@
1
1
  import y, { forwardRef as A, createElement as O } from "react";
2
- import { listenKeys as _ } from "nanostores";
3
- import { pino as M } from "pino";
4
- import { S as g } from "./useStreamLayerApp2.js";
2
+ import { e as _, S as g } from "./useStreamLayerApp2.js";
3
+ function M(e, t, n) {
4
+ let r = new Set(t).add(void 0);
5
+ return e.listen((o, a, c) => {
6
+ r.has(c) && n(o, a, c);
7
+ });
8
+ }
5
9
  var B = function() {
6
10
  const t = Array.prototype.slice.call(arguments).filter(Boolean), n = {}, r = [];
7
11
  t.forEach((a) => {
8
- (a ? a.split(" ") : []).forEach((c) => {
9
- if (c.startsWith("atm_")) {
10
- const [, p] = c.split("_");
11
- n[p] = c;
12
+ (a ? a.split(" ") : []).forEach((u) => {
13
+ if (u.startsWith("atm_")) {
14
+ const [, p] = u.split("_");
15
+ n[p] = u;
12
16
  } else
13
- r.push(c);
17
+ r.push(u);
14
18
  });
15
19
  });
16
20
  const o = [];
17
21
  for (const a in n)
18
22
  Object.prototype.hasOwnProperty.call(n, a) && o.push(n[a]);
19
23
  return o.push(...r), o.join(" ");
20
- }, R = B;
24
+ }, T = B;
21
25
  function D(e) {
22
26
  var t = /* @__PURE__ */ Object.create(null);
23
27
  return function(n) {
@@ -50,31 +54,31 @@ var V = (e, t) => {
50
54
  function F(e) {
51
55
  let t = "";
52
56
  return (n) => {
53
- const r = (a, d) => {
54
- const { as: c = e, class: p = t } = a, v = n.propsAsIs === void 0 ? !(typeof c == "string" && c.indexOf("-") === -1 && !j(c[0])) : n.propsAsIs, u = z(v, a, [
57
+ const r = (a, c) => {
58
+ const { as: u = e, class: p = t } = a, v = n.propsAsIs === void 0 ? !(typeof u == "string" && u.indexOf("-") === -1 && !j(u[0])) : n.propsAsIs, d = z(v, a, [
55
59
  "as",
56
60
  "class"
57
61
  ]);
58
- u.ref = d, u.className = n.atomic ? R(n.class, u.className || p) : R(u.className || p, n.class);
59
- const { vars: i } = n;
60
- if (i) {
61
- const s = {};
62
- for (const l in i) {
63
- const h = i[l], S = h[0], N = h[1] || "", b = typeof S == "function" ? S(a) : S;
64
- V(b, n.name), s[`--${l}`] = `${b}${N}`;
62
+ d.ref = c, d.className = n.atomic ? T(n.class, d.className || p) : T(d.className || p, n.class);
63
+ const { vars: s } = n;
64
+ if (s) {
65
+ const i = {};
66
+ for (const l in s) {
67
+ const h = s[l], S = h[0], N = h[1] || "", b = typeof S == "function" ? S(a) : S;
68
+ V(b, n.name), i[`--${l}`] = `${b}${N}`;
65
69
  }
66
- const f = u.style || {}, m = Object.keys(f);
70
+ const f = d.style || {}, m = Object.keys(f);
67
71
  m.length > 0 && m.forEach((l) => {
68
- s[l] = f[l];
69
- }), u.style = s;
72
+ i[l] = f[l];
73
+ }), d.style = i;
70
74
  }
71
- return e.__wyw_meta && e !== c ? (u.as = c, O(e, u)) : O(c, u);
75
+ return e.__wyw_meta && e !== u ? (d.as = u, O(e, d)) : O(u, d);
72
76
  }, o = A ? A(r) : (
73
77
  // React.forwardRef won't available on older React versions and in Preact
74
78
  // Fallback to a innerRef prop in that case
75
79
  ((a) => {
76
- const d = U(a, ["innerRef"]);
77
- return r(d, a.innerRef);
80
+ const c = U(a, ["innerRef"]);
81
+ return r(c, a.innerRef);
78
82
  })
79
83
  );
80
84
  return o.displayName = n.name, o.__wyw_meta = {
@@ -83,47 +87,47 @@ function F(e) {
83
87
  }, o;
84
88
  };
85
89
  }
86
- var ae = F, E = { exports: {} }, k = {};
87
- var T;
90
+ var ne = F, E = { exports: {} }, k = {};
91
+ var R;
88
92
  function G() {
89
- if (T) return k;
90
- T = 1;
93
+ if (R) return k;
94
+ R = 1;
91
95
  var e = y;
92
- function t(i, s) {
93
- return i === s && (i !== 0 || 1 / i === 1 / s) || i !== i && s !== s;
96
+ function t(s, i) {
97
+ return s === i && (s !== 0 || 1 / s === 1 / i) || s !== s && i !== i;
94
98
  }
95
- var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, a = e.useLayoutEffect, d = e.useDebugValue;
96
- function c(i, s) {
97
- var f = s(), m = r({ inst: { value: f, getSnapshot: s } }), l = m[0].inst, h = m[1];
99
+ var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, a = e.useLayoutEffect, c = e.useDebugValue;
100
+ function u(s, i) {
101
+ var f = i(), m = r({ inst: { value: f, getSnapshot: i } }), l = m[0].inst, h = m[1];
98
102
  return a(
99
103
  function() {
100
- l.value = f, l.getSnapshot = s, p(l) && h({ inst: l });
104
+ l.value = f, l.getSnapshot = i, p(l) && h({ inst: l });
101
105
  },
102
- [i, f, s]
106
+ [s, f, i]
103
107
  ), o(
104
108
  function() {
105
- return p(l) && h({ inst: l }), i(function() {
109
+ return p(l) && h({ inst: l }), s(function() {
106
110
  p(l) && h({ inst: l });
107
111
  });
108
112
  },
109
- [i]
110
- ), d(f), f;
113
+ [s]
114
+ ), c(f), f;
111
115
  }
112
- function p(i) {
113
- var s = i.getSnapshot;
114
- i = i.value;
116
+ function p(s) {
117
+ var i = s.getSnapshot;
118
+ s = s.value;
115
119
  try {
116
- var f = s();
117
- return !n(i, f);
120
+ var f = i();
121
+ return !n(s, f);
118
122
  } catch {
119
123
  return !0;
120
124
  }
121
125
  }
122
- function v(i, s) {
123
- return s();
126
+ function v(s, i) {
127
+ return i();
124
128
  }
125
- var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : c;
126
- return k.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u, k;
129
+ var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : u;
130
+ return k.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : d, k;
127
131
  }
128
132
  var C;
129
133
  function W() {
@@ -136,15 +140,15 @@ const w = (e, t) => (n) => {
136
140
  function X(e, { keys: t, deps: n = [e, t] } = {}) {
137
141
  const r = y.useRef();
138
142
  r.current = e.get();
139
- const o = y.useCallback((d) => (w(r, d)(e.value), t?.length > 0 ? _(e, t, w(r, d)) : e.listen(w(r, d))), n), a = () => r.current;
143
+ const o = y.useCallback((c) => (w(r, c)(e.value), t?.length > 0 ? M(e, t, w(r, c)) : e.listen(w(r, c))), n), a = () => r.current;
140
144
  return y.useSyncExternalStore ? y.useSyncExternalStore(o, a, a) : $.useSyncExternalStore(o, a, a);
141
145
  }
142
- const ie = X, K = () => [
146
+ const re = X, K = () => [
143
147
  !1,
144
148
  (e) => {
145
149
  window.requestAnimationFrame(() => e());
146
150
  }
147
- ], se = y.useTransition || K, Y = M({
151
+ ], ae = y.useTransition || K, Y = _.pino({
148
152
  level: "trace",
149
153
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
150
154
  browser: {
@@ -160,7 +164,7 @@ class Z extends Event {
160
164
  }
161
165
  }
162
166
  const J = Q("event-bus");
163
- class oe {
167
+ class se {
164
168
  name;
165
169
  listeners;
166
170
  constructor(t = "sl-event-bus") {
@@ -199,12 +203,12 @@ var L;
199
203
  e.Ready = "ready", e.Suspended = "suspended";
200
204
  })(L || (L = {}));
201
205
  export {
202
- oe as E,
206
+ se as E,
203
207
  L as F,
204
208
  I as N,
205
209
  Q as a,
206
- se as b,
207
- R as c,
208
- ae as s,
209
- ie as u
210
+ ae as b,
211
+ T as c,
212
+ ne as s,
213
+ re as u
210
214
  };
@@ -1,6 +1,6 @@
1
- import { useRef as w, useMemo as A, useEffect as r, useContext as l, useState as b, createContext as N } from "react";
1
+ import { useRef as A, useMemo as N, useEffect as r, useContext as l, useState as b, createContext as L } from "react";
2
2
  import { jsxs as O, jsx as T } from "react/jsx-runtime";
3
- import { z as L } from "./useStreamLayerApp2.js";
3
+ import { B } from "./useStreamLayerApp2.js";
4
4
  const x = ({
5
5
  event: e,
6
6
  internal: i
@@ -14,13 +14,13 @@ var M = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] =
14
14
  const H = {
15
15
  status: 0,
16
16
  sdk: null
17
- }, d = N(H), F = ({
17
+ }, d = L(H), F = ({
18
18
  sdkKey: e,
19
19
  theme: i,
20
20
  themeMode: o,
21
21
  plugins: n,
22
22
  children: h,
23
- event: v,
23
+ event: k,
24
24
  production: y = !0,
25
25
  autoEnable: f = !0,
26
26
  withAdNotification: C,
@@ -32,11 +32,12 @@ const H = {
32
32
  onDeepLinkHandled: s,
33
33
  videoPlayerController: a,
34
34
  onContentActivate: g,
35
- containerId: k,
36
- webOS: D,
37
- gamification: K
35
+ mobileBreakpoint: D,
36
+ containerId: m,
37
+ webOS: K,
38
+ gamification: P
38
39
  }) => {
39
- const t = L({
40
+ const t = B({
40
41
  sdkKey: e,
41
42
  plugins: n,
42
43
  production: y,
@@ -50,12 +51,13 @@ const H = {
50
51
  withAd: E,
51
52
  friendsTab: p,
52
53
  betPack: u,
53
- webOS: D,
54
- gamification: K
55
- }), m = w(""), P = A(() => t ? { sdk: t, status: 2, event: m } : { status: 1, sdk: null, event: m }, [t]);
54
+ webOS: K,
55
+ gamification: P,
56
+ mobileBreakpoint: D
57
+ }), v = A(""), w = N(() => t ? { sdk: t, status: 2, event: v } : { status: 1, sdk: null, event: v }, [t]);
56
58
  return r(() => {
57
- t && (t.options.setKey("friendsTab", p), t.options.setKey("theme", i), t.options.setKey("themeMode", o), t.options.setKey("skipOnboarding", c), t.options.setKey("betPack", u), t.options.setKey("containerId", k));
58
- }, [t, p, i, o, c, u, k]), r(() => () => {
59
+ t && (t.options.setKey("friendsTab", p), t.options.setKey("theme", i), t.options.setKey("themeMode", o), t.options.setKey("skipOnboarding", c), t.options.setKey("betPack", u), t.options.setKey("containerId", m));
60
+ }, [t, p, i, o, c, u, m]), r(() => () => {
59
61
  s && t?.removeDeepLinkHandler(s), a && t?.removeVideoPlayerController(a);
60
62
  }, [t]), r(() => {
61
63
  localStorage.getItem("SL_DEBUG") && console.log("StreamLayerProvider mounted with props:", {
@@ -63,8 +65,8 @@ const H = {
63
65
  onDeepLinkHandled: !!s,
64
66
  videoPlayerController: !!a
65
67
  });
66
- }, [e, s, a]), /* @__PURE__ */ O(d.Provider, { value: P, children: [
67
- v !== void 0 && /* @__PURE__ */ T(x, { event: v }),
68
+ }, [e, s, a]), /* @__PURE__ */ O(d.Provider, { value: w, children: [
69
+ k !== void 0 && /* @__PURE__ */ T(x, { event: k }),
68
70
  h
69
71
  ] });
70
72
  }, j = () => {
@@ -73,13 +75,13 @@ const H = {
73
75
  }, I = () => {
74
76
  const { event: e } = l(d);
75
77
  return e;
76
- }, V = () => {
78
+ }, _ = () => {
77
79
  const { sdk: e } = l(d), [i, o] = b({});
78
80
  return r(() => e?.options ? e?.options?.subscribe((n) => {
79
81
  o({ theme: n.theme, themeMode: n.themeMode });
80
82
  }) : () => {
81
83
  }, [e?.options]), i;
82
- }, _ = () => {
84
+ }, q = () => {
83
85
  const { sdk: e } = l(d), [i, o] = b({});
84
86
  return r(() => e?.uiState ? e?.uiState.subscribe((n) => {
85
87
  o({ ...n });
@@ -87,11 +89,11 @@ const H = {
87
89
  }, [e?.uiState]), i;
88
90
  };
89
91
  export {
90
- F as V,
91
- j as Y,
92
- V as _,
93
- x as g,
92
+ F as _,
94
93
  d as i,
95
- M as j,
96
- _ as q
94
+ x as j,
95
+ M as k,
96
+ _ as q,
97
+ j as w,
98
+ q as z
97
99
  };
@@ -1,4 +1,4 @@
1
- import { u as ir } from "./masters.js";
1
+ import { T as ir } from "./useStreamLayerApp2.js";
2
2
  function sr(A, S) {
3
3
  for (var G = 0; G < S.length; G++) {
4
4
  const X = S[G];
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { h as a } from "./index7.js";
2
2
  import { D as m } from "./index2.js";
3
3
  import { StreamLayerSDKNotification as S, StreamLayerSDKNotificationUI as s } from "./notification.js";
4
- import { V as L, g as i, Y as f, _ as D, q as p } from "./hooks-n9ax4LRT.js";
4
+ import { _ as L, j as i, w as f, q as D, z as p } from "./hooks-42q2i9Iw.js";
5
5
  export {
6
6
  L as StreamLayerProvider,
7
7
  i as StreamLayerSDKEvent,
package/lib/es/index10.js CHANGED
@@ -1,11 +1,185 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { s as l } from "./feature.js";
3
- const i = /* @__PURE__ */ l("div")({
1
+ import { s as a } from "./feature.js";
2
+ import { Q as i } from "./useStreamLayerApp2.js";
3
+ import { jsxs as t, jsx as s, Fragment as U } from "react/jsx-runtime";
4
+ import { memo as $, useMemo as w } from "react";
5
+ import { V as y } from "./index14.js";
6
+ import { M as T } from "./index5.js";
7
+ const G = {
8
+ [i.TWEET]: { label: "Insight", iconName: "icon-insight" },
9
+ [i.PROMOTION]: { label: "Insight", iconName: "icon-insight" },
10
+ [i.UNSET]: void 0,
11
+ [i.FACTOID]: { label: "Insight", iconName: "icon-insight" },
12
+ [i.POLL]: { label: "Poll", iconName: "icon-poll" },
13
+ [i.TRIVIA]: { label: "Trivia", iconName: "icon-trivia" },
14
+ [i.PREDICTION]: { label: "Prediction", iconName: "icon-prediction" }
15
+ }, J = {
16
+ [i.TWEET]: "Learn more",
17
+ [i.FACTOID]: "Learn more",
18
+ [i.POLL]: "Answer",
19
+ [i.TRIVIA]: "Answer",
20
+ [i.PREDICTION]: "Answer",
21
+ [i.PROMOTION]: "",
22
+ [i.UNSET]: ""
23
+ }, K = (r) => r.split(/\s+/).map((n) => n[0]).join("").toUpperCase(), X = (r) => r ? r.toLocaleString("en-US") : "0", L = (r) => {
24
+ const n = new Date(r);
25
+ if (!n)
26
+ return "";
27
+ const c = /* @__PURE__ */ new Date(), o = Math.floor(c.getTime() - n.getTime());
28
+ return o < 6e4 ? `${Math.floor(o / 1e3)}s` : o < 36e5 ? `${Math.floor(o / 6e4)}m` : o < 864e5 ? `${Math.floor(o / 36e5)}h` : n.getFullYear() === c.getFullYear() ? `${n.toLocaleDateString("en-US", {
29
+ month: "short",
30
+ day: "numeric"
31
+ })}` : `${n.toLocaleDateString("en-US", {
32
+ month: "2-digit",
33
+ day: "2-digit",
34
+ year: "2-digit"
35
+ })}`;
36
+ }, D = /* @__PURE__ */ a("div")({
4
37
  name: "Container",
5
- class: "cqg02m",
38
+ class: "cjq447q",
6
39
  propsAsIs: !1
7
- }), a = ({ children: s, style: e, loading: o }) => o ? /* @__PURE__ */ t(i, { style: e, children: s }) : s;
40
+ }), H = /* @__PURE__ */ a("div")({
41
+ name: "ImageContainer",
42
+ class: "i14egogb",
43
+ propsAsIs: !1
44
+ }), S = /* @__PURE__ */ a("img")({
45
+ name: "Image",
46
+ class: "i2g9g4l",
47
+ propsAsIs: !1
48
+ }), O = () => T, E = /* @__PURE__ */ a(O())({
49
+ name: "TwitterIcon",
50
+ class: "t1c454nm",
51
+ propsAsIs: !0
52
+ }), b = /* @__PURE__ */ a("div")({
53
+ name: "Details",
54
+ class: "d11nigc3",
55
+ propsAsIs: !1
56
+ }), x = /* @__PURE__ */ a("div")({
57
+ name: "Name",
58
+ class: "nrxa4k8",
59
+ propsAsIs: !1
60
+ }), C = /* @__PURE__ */ a("div")({
61
+ name: "UserNameAndDate",
62
+ class: "u1p051g3",
63
+ propsAsIs: !1
64
+ }), M = ({ image: r, name: n, userName: c, verified: o, createdTweet: p }) => {
65
+ const m = p && L(p);
66
+ return /* @__PURE__ */ t(D, { children: [
67
+ r && /* @__PURE__ */ t(H, { children: [
68
+ /* @__PURE__ */ s(S, { className: "SL_AccountImage", src: r }),
69
+ /* @__PURE__ */ s(E, { name: "twitter" })
70
+ ] }),
71
+ /* @__PURE__ */ t(b, { children: [
72
+ n && /* @__PURE__ */ t(x, { className: "SL_TweetAccountName", children: [
73
+ n,
74
+ " ",
75
+ o && /* @__PURE__ */ s(T, { name: "icon-twitter-verified" })
76
+ ] }),
77
+ c && /* @__PURE__ */ t(C, { className: "SL_TweetAccountUserName", children: [
78
+ "@",
79
+ c,
80
+ " ",
81
+ m && `・ ${m}`
82
+ ] })
83
+ ] })
84
+ ] });
85
+ }, P = /* @__PURE__ */ a("div")({
86
+ name: "Container",
87
+ class: "c1kzqw87",
88
+ propsAsIs: !1
89
+ }), R = /* @__PURE__ */ a("div")({
90
+ name: "Details",
91
+ class: "d9r1hf9",
92
+ propsAsIs: !1
93
+ }), V = /* @__PURE__ */ a("div")({
94
+ name: "Body",
95
+ class: "bezygt5",
96
+ propsAsIs: !1
97
+ }), d = /* @__PURE__ */ a("div")({
98
+ name: "ImagesContainer",
99
+ class: "i1y8f7ym",
100
+ propsAsIs: !1
101
+ }), h = /* @__PURE__ */ a("div")({
102
+ name: "ImagesBlock",
103
+ class: "i18gwonx",
104
+ propsAsIs: !1
105
+ }), N = /* @__PURE__ */ a("img")({
106
+ name: "Image",
107
+ class: "i3g0xjd",
108
+ propsAsIs: !1
109
+ }), j = () => N, l = /* @__PURE__ */ a(j())({
110
+ name: "ImageFullSize",
111
+ class: "io8rt7p",
112
+ propsAsIs: !0
113
+ }), F = () => N, f = /* @__PURE__ */ a(F())({
114
+ name: "ImageHalfSize",
115
+ class: "i4hn3ox",
116
+ propsAsIs: !0
117
+ }), _ = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), z = (r) => r?.replace(_, ""), Z = $(
118
+ ({ image: r, body: n, muted: c, account: o, accountVerified: p, tweet: m, isDetail: u, controlVideo: v }) => {
119
+ const e = m?.meta?.extendedEntities?.media, g = e?.find(
120
+ ({ type: I }) => I === "photo"
121
+ /* PHOTO */
122
+ ), A = w(() => e?.[0]?.videoInfo?.variants?.findLast(
123
+ ({ contentType: I }) => I === "video/mp4"
124
+ /* VIDEO */
125
+ )?.url, [e]);
126
+ return /* @__PURE__ */ t(P, { children: [
127
+ /* @__PURE__ */ t(R, { children: [
128
+ /* @__PURE__ */ s(
129
+ M,
130
+ {
131
+ image: r,
132
+ name: m?.meta?.accountName,
133
+ userName: o,
134
+ verified: p,
135
+ createdTweet: m?.date
136
+ }
137
+ ),
138
+ /* @__PURE__ */ s(V, { children: z(n) }),
139
+ !u && g && /* @__PURE__ */ s(d, { children: /* @__PURE__ */ s(l, { src: e?.[0].mediaUrlHttps }) }),
140
+ u && g && /* @__PURE__ */ t(U, { children: [
141
+ e?.length === 1 && /* @__PURE__ */ s(d, { children: /* @__PURE__ */ s(l, { src: e[0].mediaUrlHttps }) }),
142
+ e?.length === 2 && /* @__PURE__ */ t(d, { children: [
143
+ /* @__PURE__ */ s(f, { src: e[0].mediaUrlHttps }),
144
+ /* @__PURE__ */ s(f, { src: e[1].mediaUrlHttps })
145
+ ] }),
146
+ e?.length === 3 && /* @__PURE__ */ t(d, { children: [
147
+ /* @__PURE__ */ s(f, { src: e[0].mediaUrlHttps }),
148
+ /* @__PURE__ */ t(h, { children: [
149
+ /* @__PURE__ */ s(l, { src: e[1].mediaUrlHttps }),
150
+ /* @__PURE__ */ s(l, { src: e[2].mediaUrlHttps })
151
+ ] })
152
+ ] }),
153
+ e?.length === 4 && /* @__PURE__ */ t(d, { children: [
154
+ /* @__PURE__ */ t(h, { children: [
155
+ /* @__PURE__ */ s(l, { src: e[0].mediaUrlHttps }),
156
+ /* @__PURE__ */ s(l, { src: e[1].mediaUrlHttps })
157
+ ] }),
158
+ /* @__PURE__ */ t(h, { children: [
159
+ /* @__PURE__ */ s(l, { src: e[2].mediaUrlHttps }),
160
+ /* @__PURE__ */ s(l, { src: e[3].mediaUrlHttps })
161
+ ] })
162
+ ] })
163
+ ] })
164
+ ] }),
165
+ !g && (e?.[0]?.type === "video" || e?.[0]?.type === "animated_gif") && A && /* @__PURE__ */ s(
166
+ y,
167
+ {
168
+ muted: c,
169
+ source: A,
170
+ poster: e[0].mediaUrlHttps,
171
+ controlVideo: v
172
+ }
173
+ )
174
+ ] });
175
+ }
176
+ );
8
177
  export {
9
- i as e,
10
- a as i
178
+ M as D,
179
+ K as I,
180
+ Z as N,
181
+ G as e,
182
+ z as j,
183
+ J as o,
184
+ X as s
11
185
  };