@streamlayer/react 1.23.1 → 1.23.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.
Files changed (159) hide show
  1. package/lib/cjs/Question.js +1 -1
  2. package/lib/cjs/advertisement.js +28 -223
  3. package/lib/cjs/analytics.js +1 -1
  4. package/lib/cjs/auth.js +1 -1
  5. package/lib/cjs/bet-pack.js +1 -1
  6. package/lib/cjs/feature.js +1 -1
  7. package/lib/cjs/gamification-feature.js +1 -1
  8. package/lib/cjs/gamification-feature2.js +1 -1
  9. package/lib/cjs/hooks-WfHlJH12.js +1 -1
  10. package/lib/cjs/index-eShKGO10.js +1 -5
  11. package/lib/cjs/index.js +1 -1
  12. package/lib/cjs/index10.js +1 -1
  13. package/lib/cjs/index11.js +3 -4
  14. package/lib/cjs/index12.js +1 -1
  15. package/lib/cjs/index13.js +3 -1
  16. package/lib/cjs/index14.js +1 -1
  17. package/lib/cjs/index15.js +1 -1
  18. package/lib/cjs/index16.js +3 -5
  19. package/lib/cjs/index2.js +1 -1
  20. package/lib/cjs/index3.js +1 -1
  21. package/lib/cjs/index4.js +3 -5
  22. package/lib/cjs/index5.js +1 -1
  23. package/lib/cjs/index6.js +1 -1
  24. package/lib/cjs/index7.js +1 -1
  25. package/lib/cjs/index8.js +1 -1
  26. package/lib/cjs/index9.js +1 -1
  27. package/lib/cjs/insight.js +1 -1
  28. package/lib/cjs/masters.js +1 -1
  29. package/lib/cjs/masters2.js +1 -13
  30. package/lib/cjs/notification.js +1 -1
  31. package/lib/cjs/pause-ad.js +1 -1
  32. package/lib/cjs/points.js +1 -1
  33. package/lib/cjs/polymarket.js +5 -15
  34. package/lib/cjs/sl-types.js +1 -15
  35. package/lib/cjs/storage.js +1 -1
  36. package/lib/cjs/style.css +1 -0
  37. package/lib/cjs/theme.js +1 -17
  38. package/lib/cjs/useStreamLayerApp.js +1 -1
  39. package/lib/cjs/useStreamLayerApp2.js +3 -17
  40. package/lib/cjs/utils.js +1 -47
  41. package/lib/classic/cjs/Question.js +1 -1
  42. package/lib/classic/cjs/advertisement.js +28 -223
  43. package/lib/classic/cjs/analytics.js +1 -1
  44. package/lib/classic/cjs/auth.js +1 -1
  45. package/lib/classic/cjs/bet-pack.js +3 -5
  46. package/lib/classic/cjs/feature.js +1 -1
  47. package/lib/classic/cjs/gamification-feature.js +1 -1
  48. package/lib/classic/cjs/hooks-WfHlJH12.js +1 -1
  49. package/lib/classic/cjs/index-eShKGO10.js +1 -5
  50. package/lib/classic/cjs/index.js +1 -1
  51. package/lib/classic/cjs/index10.js +1 -1
  52. package/lib/classic/cjs/index11.js +1 -1
  53. package/lib/classic/cjs/index12.js +1 -1
  54. package/lib/classic/cjs/index13.js +3 -4
  55. package/lib/classic/cjs/index2.js +3 -5
  56. package/lib/classic/cjs/index3.js +1 -1
  57. package/lib/classic/cjs/index4.js +1 -1
  58. package/lib/classic/cjs/index5.js +1 -1
  59. package/lib/classic/cjs/index6.js +1 -1
  60. package/lib/classic/cjs/index7.js +1 -1
  61. package/lib/classic/cjs/index8.js +1 -1
  62. package/lib/classic/cjs/index9.js +3 -1
  63. package/lib/classic/cjs/insight.js +1 -1
  64. package/lib/classic/cjs/notification.js +1 -1
  65. package/lib/classic/cjs/notification2.js +1 -1
  66. package/lib/classic/cjs/pause-ad.js +1 -1
  67. package/lib/classic/cjs/points.js +1 -1
  68. package/lib/classic/cjs/polymarket.js +5 -15
  69. package/lib/classic/cjs/sl-types.js +1 -15
  70. package/lib/classic/cjs/style.css +1 -0
  71. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  72. package/lib/classic/cjs/useStreamLayerApp2.js +3 -17
  73. package/lib/classic/cjs/utils.js +1 -47
  74. package/lib/classic/es/Question.js +277 -264
  75. package/lib/classic/es/advertisement.js +34990 -18881
  76. package/lib/classic/es/analytics.js +58 -56
  77. package/lib/classic/es/auth.js +14 -8
  78. package/lib/classic/es/bet-pack.js +2448 -2419
  79. package/lib/classic/es/feature.js +93 -48
  80. package/lib/classic/es/gamification-feature.js +2 -2
  81. package/lib/classic/es/hooks-WfHlJH12.js +78 -78
  82. package/lib/classic/es/index-eShKGO10.js +948 -948
  83. package/lib/classic/es/index.js +13 -13
  84. package/lib/classic/es/index10.js +68 -67
  85. package/lib/classic/es/index11.js +2903 -2159
  86. package/lib/classic/es/index12.js +124 -119
  87. package/lib/classic/es/index13.js +581 -566
  88. package/lib/classic/es/index2.js +2098 -1763
  89. package/lib/classic/es/index3.js +11 -11
  90. package/lib/classic/es/index4.js +127 -127
  91. package/lib/classic/es/index5.js +3 -4
  92. package/lib/classic/es/index6.js +8 -3
  93. package/lib/classic/es/index7.js +6 -5
  94. package/lib/classic/es/index8.js +8 -7
  95. package/lib/classic/es/index9.js +225 -223
  96. package/lib/classic/es/insight.js +58 -53
  97. package/lib/classic/es/notification.js +3 -3
  98. package/lib/classic/es/notification2.js +764 -722
  99. package/lib/classic/es/pause-ad.js +190 -167
  100. package/lib/classic/es/points.js +55 -48
  101. package/lib/classic/es/polymarket.js +4209 -4031
  102. package/lib/classic/es/sl-types.js +193 -125
  103. package/lib/classic/es/useStreamLayerApp.js +2 -2
  104. package/lib/classic/es/useStreamLayerApp2.js +9714 -7603
  105. package/lib/classic/es/utils.js +28 -28
  106. package/lib/classic/index.d.ts +1 -0
  107. package/lib/classic/style.css +1 -0
  108. package/lib/dist/cjs/gamification-feature.js +1 -1
  109. package/lib/dist/cjs/index-eShKGO10.js +1 -5
  110. package/lib/dist/cjs/index.js +1 -1
  111. package/lib/dist/cjs/masters.js +3 -77
  112. package/lib/dist/es/gamification-feature.js +2 -2
  113. package/lib/dist/es/index-eShKGO10.js +948 -948
  114. package/lib/dist/es/index.js +7 -8
  115. package/lib/dist/es/masters.js +18197 -14750
  116. package/lib/dist/index.d.ts +12 -2
  117. package/lib/dist/style.css +1 -1
  118. package/lib/es/Question.js +108 -106
  119. package/lib/es/advertisement.js +34990 -18881
  120. package/lib/es/analytics.js +58 -56
  121. package/lib/es/auth.js +14 -8
  122. package/lib/es/bet-pack.js +29 -17
  123. package/lib/es/feature.js +93 -48
  124. package/lib/es/gamification-feature.js +2 -2
  125. package/lib/es/gamification-feature2.js +2 -2
  126. package/lib/es/hooks-WfHlJH12.js +78 -78
  127. package/lib/es/index-eShKGO10.js +948 -948
  128. package/lib/es/index.js +14 -13
  129. package/lib/es/index10.js +176 -166
  130. package/lib/es/index11.js +581 -566
  131. package/lib/es/index12.js +124 -119
  132. package/lib/es/index13.js +225 -223
  133. package/lib/es/index14.js +68 -67
  134. package/lib/es/index15.js +2903 -2159
  135. package/lib/es/index16.js +1005 -806
  136. package/lib/es/index2.js +1117 -984
  137. package/lib/es/index3.js +3 -4
  138. package/lib/es/index4.js +2424 -2407
  139. package/lib/es/index5.js +11 -11
  140. package/lib/es/index6.js +127 -127
  141. package/lib/es/index7.js +8 -3
  142. package/lib/es/index8.js +5 -5
  143. package/lib/es/index9.js +8 -7
  144. package/lib/es/insight.js +58 -53
  145. package/lib/es/masters.js +6 -5
  146. package/lib/es/masters2.js +696 -559
  147. package/lib/es/notification.js +696 -655
  148. package/lib/es/pause-ad.js +190 -167
  149. package/lib/es/points.js +56 -49
  150. package/lib/es/polymarket.js +4209 -4031
  151. package/lib/es/sl-types.js +200 -132
  152. package/lib/es/storage.js +75 -74
  153. package/lib/es/theme.js +177 -31
  154. package/lib/es/useStreamLayerApp.js +2 -2
  155. package/lib/es/useStreamLayerApp2.js +9714 -7603
  156. package/lib/es/utils.js +28 -28
  157. package/lib/index.d.ts +1 -0
  158. package/lib/style.css +1 -1
  159. package/package.json +23 -20
package/lib/es/index13.js CHANGED
@@ -1,319 +1,321 @@
1
- import { jsxs as S, jsx as e, Fragment as re } from "react/jsx-runtime";
2
- import { s as o, c as X } from "./sl-types.js";
3
- import { useState as I, useEffect as b, useCallback as w, forwardRef as ce, useRef as L } from "react";
4
- import { B as f } from "./index6.js";
5
- import { G as ie, d as ue, O as de } from "./index14.js";
6
- import { C as pe } from "./useStreamLayerApp2.js";
7
- const me = /* @__PURE__ */ o("div")({
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { s as styled_default, c as cx_default } from "./sl-types.js";
3
+ import { useState, useEffect, useCallback, forwardRef, useRef } from "react";
4
+ import { B as B1 } from "./index6.js";
5
+ import { G, d as d$1, O as O$1 } from "./index14.js";
6
+ import { C as CloseTimerAuto } from "./useStreamLayerApp2.js";
7
+ const g = /* @__PURE__ */ styled_default("div")({
8
8
  name: "CloseIconWrap",
9
9
  class: "c3v6bv6",
10
- propsAsIs: !1
11
- }), ye = /* @__PURE__ */ o("div")({
10
+ propsAsIs: false
11
+ }), h = /* @__PURE__ */ styled_default("div")({
12
12
  name: "TimerWrap",
13
13
  class: "teuhmro",
14
- propsAsIs: !1
15
- }), he = () => f, fe = /* @__PURE__ */ o(he())({
14
+ propsAsIs: false
15
+ }), A$1 = () => B1, C$1 = /* @__PURE__ */ styled_default(A$1())({
16
16
  name: "Icon",
17
17
  class: "i17rfxv5",
18
- propsAsIs: !0
19
- }), Ye = ({
20
- close: n,
21
- className: a,
22
- timerClassName: s,
23
- skipIcon: l,
24
- isPlaying: u = !0,
25
- duration: i = 0,
26
- autoClose: d
18
+ propsAsIs: true
19
+ }), y$1 = ({
20
+ close: r2,
21
+ className: a2,
22
+ timerClassName: m,
23
+ skipIcon: o2,
24
+ isPlaying: c2 = true,
25
+ duration: e2 = 0,
26
+ autoClose: n2
27
27
  }) => {
28
- const [p, m] = I(i === 0);
29
- b(() => {
30
- m(!i);
31
- }, [i]);
32
- const P = w(() => {
33
- d === pe.ENABLED ? n == null || n() : m(!0);
34
- }, [d, n]);
35
- return p ? /* @__PURE__ */ S(me, {
28
+ const [p2, i2] = useState(e2 === 0);
29
+ useEffect(() => {
30
+ i2(!e2);
31
+ }, [e2]);
32
+ const l2 = useCallback(() => {
33
+ n2 === CloseTimerAuto.ENABLED ? r2 == null || r2() : i2(true);
34
+ }, [n2, r2]);
35
+ return p2 ? /* @__PURE__ */ jsxs(g, {
36
36
  "data-a": "intr",
37
- onClick: n,
38
- className: a,
39
- style: l ? {
37
+ onClick: r2,
38
+ className: a2,
39
+ style: o2 ? {
40
40
  width: "auto"
41
41
  } : {},
42
- children: [l && /* @__PURE__ */ e("span", {
42
+ children: [o2 && /* @__PURE__ */ jsx("span", {
43
43
  "data-a": "intr",
44
44
  children: "Skip"
45
- }), /* @__PURE__ */ e(fe, {
45
+ }), /* @__PURE__ */ jsx(C$1, {
46
46
  "data-a": "intr",
47
- name: l ? "iconSkip" : "icon-cross"
47
+ name: o2 ? "iconSkip" : "icon-cross"
48
48
  })]
49
- }) : /* @__PURE__ */ e(ye, {
50
- children: /* @__PURE__ */ e(ie, {
51
- className: s,
52
- isPlaying: u,
53
- duration: i,
54
- onTimerExpired: P
49
+ }) : /* @__PURE__ */ jsx(h, {
50
+ children: /* @__PURE__ */ jsx(G, {
51
+ className: m,
52
+ isPlaying: c2,
53
+ duration: e2,
54
+ onTimerExpired: l2
55
55
  })
56
56
  });
57
- }, ge = /* @__PURE__ */ o("div")({
57
+ };
58
+ const i = /* @__PURE__ */ styled_default("div")({
58
59
  name: "Container",
59
60
  class: "c1bgb86j",
60
- propsAsIs: !1
61
- }), Ie = /* @__PURE__ */ o("video")({
61
+ propsAsIs: false
62
+ }), A = /* @__PURE__ */ styled_default("video")({
62
63
  name: "Player",
63
64
  class: "p6703cq",
64
- propsAsIs: !1
65
- }), be = /* @__PURE__ */ o("img")({
65
+ propsAsIs: false
66
+ }), b = /* @__PURE__ */ styled_default("img")({
66
67
  name: "Poster",
67
68
  class: "p12ow7zo",
68
- propsAsIs: !1
69
- }), R = /* @__PURE__ */ o("div")({
69
+ propsAsIs: false
70
+ }), B = /* @__PURE__ */ styled_default("div")({
70
71
  name: "Control",
71
72
  class: "cdpal9o",
72
- propsAsIs: !1
73
- }), Pe = "t1xke4ml", ve = "h1yzxv57", Ae = /* @__PURE__ */ o("div")({
73
+ propsAsIs: false
74
+ }), x = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ styled_default("div")({
74
75
  name: "VideoControls",
75
76
  class: "vxo8xch",
76
- propsAsIs: !1
77
- }), $ = /* @__PURE__ */ o("button")({
77
+ propsAsIs: false
78
+ }), n = /* @__PURE__ */ styled_default("button")({
78
79
  name: "ControlBtn",
79
80
  class: "coyuzu0",
80
- propsAsIs: !1
81
- }), Ce = () => $, we = /* @__PURE__ */ o(Ce())({
81
+ propsAsIs: false
82
+ }), t = () => n, O = /* @__PURE__ */ styled_default(t())({
82
83
  name: "MuteIcon",
83
84
  class: "musmi9a",
84
- propsAsIs: !0
85
- }), Me = () => $, ke = /* @__PURE__ */ o(Me())({
85
+ propsAsIs: true
86
+ }), e = () => n, S = /* @__PURE__ */ styled_default(e())({
86
87
  name: "PauseIcon",
87
88
  class: "p1qe7rum",
88
- propsAsIs: !0
89
- }), Ee = () => $, xe = /* @__PURE__ */ o(Ee())({
89
+ propsAsIs: true
90
+ }), c = () => n, W = /* @__PURE__ */ styled_default(c())({
90
91
  name: "PlayIcon",
91
92
  class: "psevery",
92
- propsAsIs: !0
93
- }), Y = /* @__PURE__ */ o("button")({
93
+ propsAsIs: true
94
+ }), a = /* @__PURE__ */ styled_default("button")({
94
95
  name: "WebOSIconButton",
95
96
  class: "w1q3u7py",
96
- propsAsIs: !1
97
- }), Be = () => Y, T = /* @__PURE__ */ o(Be())({
97
+ propsAsIs: false
98
+ }), p = () => a, o = /* @__PURE__ */ styled_default(p())({
98
99
  name: "WebOSIconButtonAnimation",
99
100
  class: "wdlqvum",
100
- propsAsIs: !0
101
- }), Oe = () => T, We = /* @__PURE__ */ o(Oe())({
101
+ propsAsIs: true
102
+ }), l = () => o, d = /* @__PURE__ */ styled_default(l())({
102
103
  name: "WebOSIconButtonPlay",
103
104
  class: "w1ylz9ea",
104
- propsAsIs: !0
105
- }), Ne = () => T, Ve = /* @__PURE__ */ o(Ne())({
105
+ propsAsIs: true
106
+ }), r = () => o, C = /* @__PURE__ */ styled_default(r())({
106
107
  name: "WebOSIconButtonPause",
107
108
  class: "w1iylt55",
108
- propsAsIs: !0
109
- }), Le = () => T, Re = /* @__PURE__ */ o(Le())({
109
+ propsAsIs: true
110
+ }), u = () => o, f = /* @__PURE__ */ styled_default(u())({
110
111
  name: "WebOSIconButtonMute",
111
112
  class: "w8h4h7",
112
- propsAsIs: !0
113
- }), Se = () => T, Te = /* @__PURE__ */ o(Se())({
113
+ propsAsIs: true
114
+ }), I = () => o, v = /* @__PURE__ */ styled_default(I())({
114
115
  name: "WebOSIconButtonUnmute",
115
116
  class: "w12l12kt",
116
- propsAsIs: !0
117
- }), Ue = (n) => {
118
- for (const a of n)
119
- a.isIntersecting ? a.target instanceof HTMLVideoElement && a.target.autoplay && a.target.play() : a.target instanceof HTMLVideoElement && !a.target.paused && a.target.pause();
120
- }, Z = new IntersectionObserver(Ue, { threshold: 0.5 }), D = /* @__PURE__ */ new Set(), je = (n) => {
121
- Z.observe(n), D.add(n);
122
- }, qe = (n) => {
123
- Z.unobserve(n), D.delete(n);
124
- }, ze = () => {
125
- for (const n of D)
126
- n instanceof HTMLVideoElement && !n.paused && n.pause();
117
+ propsAsIs: true
118
+ });
119
+ const It = (r2) => {
120
+ for (const s of r2)
121
+ s.isIntersecting ? s.target instanceof HTMLVideoElement && s.target.autoplay && s.target.play() : s.target instanceof HTMLVideoElement && !s.target.paused && s.target.pause();
122
+ }, $ = new IntersectionObserver(It, { threshold: 0.5 }), D = /* @__PURE__ */ new Set(), Bt = (r2) => {
123
+ $.observe(r2), D.add(r2);
124
+ }, Ot = (r2) => {
125
+ $.unobserve(r2), D.delete(r2);
126
+ }, wt = () => {
127
+ for (const r2 of D)
128
+ r2 instanceof HTMLVideoElement && !r2.paused && r2.pause();
127
129
  };
128
- function He(...n) {
129
- return w(
130
+ function yt(...r2) {
131
+ return useCallback(
130
132
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
- (a) => {
132
- for (const s of n)
133
- s !== null && (typeof s == "function" ? s(a) : s && (s.current = a));
133
+ (s) => {
134
+ for (const c2 of r2)
135
+ c2 !== null && (typeof c2 == "function" ? c2(s) : c2 && (c2.current = s));
134
136
  },
135
137
  // Re-run the callback if the array of refs changes
136
138
  // eslint-disable-next-line react-hooks/exhaustive-deps
137
- [...n]
139
+ [...r2]
138
140
  );
139
141
  }
140
- const $e = de(ge), De = ({ loading: n, autoPlay: a, played: s, playing: l, isMuted: u, unmute: i, mute: d, togglePlaying: p }) => !n && !a && !s ? /* @__PURE__ */ e(R, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : s ? /* @__PURE__ */ S(Ae, { children: [
141
- l ? /* @__PURE__ */ e(ke, { onClick: p }) : /* @__PURE__ */ e(xe, { onClick: p }),
142
- /* @__PURE__ */ e(we, { className: X(!u && "muted"), onClick: u ? i : d })
143
- ] }) : null, Fe = ({
144
- loading: n,
145
- autoPlay: a,
146
- playMuted: s,
147
- playing: l,
148
- played: u,
149
- unmute: i,
150
- mute: d,
151
- isMuted: p,
152
- hasNotPausedVideo: m,
153
- hasInteractedWithAudio: P
154
- }) => /* @__PURE__ */ S(re, { children: [
155
- !n && !(a && s) && /* @__PURE__ */ e(R, { "data-control-btn": "true", children: l ? m ? null : /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : u ? /* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Y, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
- !n && a && s && P && /* @__PURE__ */ e(R, { children: p ? /* @__PURE__ */ e(Re, { onClick: i, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Te, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
157
- ] }), Ze = ce(
142
+ const Lt = O$1(i), Pt = ({ loading: r2, autoPlay: s, played: c2, playing: i2, isMuted: f2, unmute: d2, mute: h2, togglePlaying: l2 }) => !r2 && !s && !c2 ? /* @__PURE__ */ jsx(B, { children: i2 ? /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) : /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : c2 ? /* @__PURE__ */ jsxs(P, { children: [
143
+ i2 ? /* @__PURE__ */ jsx(S, { onClick: l2 }) : /* @__PURE__ */ jsx(W, { onClick: l2 }),
144
+ /* @__PURE__ */ jsx(O, { className: cx_default(!f2 && "muted"), onClick: f2 ? d2 : h2 })
145
+ ] }) : null, Tt = ({
146
+ loading: r2,
147
+ autoPlay: s,
148
+ playMuted: c2,
149
+ playing: i2,
150
+ played: f$1,
151
+ unmute: d$12,
152
+ mute: h2,
153
+ isMuted: l2,
154
+ hasNotPausedVideo: p2,
155
+ hasInteractedWithAudio: w
156
+ }) => /* @__PURE__ */ jsxs(Fragment, { children: [
157
+ !r2 && !(s && c2) && /* @__PURE__ */ jsx(B, { "data-control-btn": "true", children: i2 ? p2 ? null : /* @__PURE__ */ jsx(d, { children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : f$1 ? /* @__PURE__ */ jsx(C, { children: /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) }) : /* @__PURE__ */ jsx(a, { "data-control-icon": "true", children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) }),
158
+ !r2 && s && c2 && w && /* @__PURE__ */ jsx(B, { children: l2 ? /* @__PURE__ */ jsx(f, { onClick: d$12, children: /* @__PURE__ */ jsx(B1, { name: "iconMute" }) }) : /* @__PURE__ */ jsx(v, { onClick: h2, children: /* @__PURE__ */ jsx(B1, { name: "iconUnMute" }) }) })
159
+ ] }), Et = forwardRef(
158
160
  ({
159
- poster: n,
160
- source: a,
161
- aspectRatio: s,
162
- controlVideo: l,
163
- onReplay: u,
164
- onPlay: i,
165
- onPause: d,
166
- onEnd: p,
167
- onRender: m,
168
- onMute: P,
169
- onQuartile: v,
170
- autoPlay: M,
171
- playMuted: k,
172
- className: ee,
173
- muted: E,
174
- webos: B,
175
- hasNotPausedVideo: ne
176
- }, te) => {
177
- const c = L(null), ae = He(c, te), U = L(!1), j = L(!1), y = L(/* @__PURE__ */ new Set()), [F, G] = I(!1), [O, W] = I(!1), [q, Q] = I(!1), [_, N] = I(!0), [z, V] = I(k), [H, oe] = I(!1);
178
- b(() => {
179
- a && (V(k), G(!1));
180
- }, [a]);
181
- const A = w(() => {
182
- l == null || l({ muted: !1 });
183
- }, [l]), J = w(() => {
184
- l == null || l({ muted: !0 });
185
- }, [l]), C = w((t) => {
186
- t == null || t.stopPropagation(), c.current && (c.current.muted = !0), V(!0);
187
- }, []), x = w(
188
- (t) => {
189
- t == null || t.stopPropagation(), c.current && (c.current.muted = !1), V(!1), H || oe(!0);
161
+ poster: r2,
162
+ source: s,
163
+ aspectRatio: c2,
164
+ controlVideo: i2,
165
+ onReplay: f2,
166
+ onPlay: d2,
167
+ onPause: h2,
168
+ onEnd: l2,
169
+ onRender: p2,
170
+ onMute: w,
171
+ onQuartile: u2,
172
+ autoPlay: v2,
173
+ playMuted: S2,
174
+ className: K,
175
+ muted: y$12,
176
+ webos: T,
177
+ hasNotPausedVideo: V
178
+ }, R) => {
179
+ const n2 = useRef(null), Q = yt(n2, R), x$1 = useRef(false), E = useRef(false), m = useRef(/* @__PURE__ */ new Set()), [z, G2] = useState(false), [W2, k] = useState(false), [j, J] = useState(false), [X, H] = useState(true), [A$12, U] = useState(S2), [q, tt] = useState(false);
180
+ useEffect(() => {
181
+ s && (U(S2), G2(false));
182
+ }, [s]);
183
+ const C2 = useCallback(() => {
184
+ i2 == null || i2({ muted: false });
185
+ }, [i2]), Y = useCallback(() => {
186
+ i2 == null || i2({ muted: true });
187
+ }, [i2]), I2 = useCallback((t2) => {
188
+ t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = true), U(true);
189
+ }, []), L = useCallback(
190
+ (t2) => {
191
+ t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = false), U(false), q || tt(true);
190
192
  },
191
- [H]
193
+ [q]
192
194
  );
193
- b(() => {
194
- E !== void 0 && (E ? C() : x());
195
- }, [C, E, x]);
196
- const K = (t) => {
197
- var r;
198
- (r = t.stopPropagation) == null || r.call(t);
199
- const g = c == null ? void 0 : c.current;
200
- if (g)
201
- if (O)
202
- g.pause();
195
+ useEffect(() => {
196
+ y$12 !== void 0 && (y$12 ? I2() : L());
197
+ }, [I2, y$12, L]);
198
+ const Z = (t2) => {
199
+ var b2;
200
+ (b2 = t2.stopPropagation) == null || b2.call(t2);
201
+ const o2 = n2 == null ? void 0 : n2.current;
202
+ if (o2)
203
+ if (W2)
204
+ o2.pause();
203
205
  else {
204
- const h = c == null ? void 0 : c.current;
205
- if (!h)
206
+ const a2 = n2 == null ? void 0 : n2.current;
207
+ if (!a2)
206
208
  return;
207
- ze(), h.play().catch((le) => console.log(le)), N(!1);
209
+ wt(), a2.play().catch((rt) => console.log(rt)), H(false);
208
210
  }
209
- }, se = () => {
210
- var t;
211
- (t = c == null ? void 0 : c.current) == null || t.load(), N(!0);
211
+ }, et = () => {
212
+ var t2;
213
+ (t2 = n2 == null ? void 0 : n2.current) == null || t2.load(), H(true);
212
214
  };
213
- return b(() => () => {
214
- A();
215
- }, [A]), b(() => {
216
- const t = c.current;
217
- return t ? (j.current = t.muted, V(t.muted), je(t), () => {
218
- qe(t);
215
+ return useEffect(() => () => {
216
+ C2();
217
+ }, [C2]), useEffect(() => {
218
+ const t2 = n2.current;
219
+ return t2 ? (E.current = t2.muted, U(t2.muted), Bt(t2), () => {
220
+ Ot(t2);
219
221
  }) : () => {
220
222
  };
221
- }, []), b(() => {
222
- m == null || m();
223
- }, [m]), b(() => {
224
- y.current.clear(), U.current = !1;
225
- }, [a]), /* @__PURE__ */ S(
226
- $e,
223
+ }, []), useEffect(() => {
224
+ p2 == null || p2();
225
+ }, [p2]), useEffect(() => {
226
+ m.current.clear(), x$1.current = false;
227
+ }, [s]), /* @__PURE__ */ jsxs(
228
+ Lt,
227
229
  {
228
- webos: B,
229
- onClick: M && k ? z ? x : C : K,
230
+ webos: T,
231
+ onClick: v2 && S2 ? A$12 ? L : I2 : Z,
230
232
  "data-a": "intr",
231
- autoFocus: !0,
233
+ autoFocus: true,
232
234
  options: { focusKey: "video-play-btn" },
233
- className: X(O && !B && Pe, M && ve, ee),
234
- style: s ? { aspectRatio: s } : {},
235
+ className: cx_default(W2 && !T && x, v2 && y, K),
236
+ style: c2 ? { aspectRatio: c2 } : {},
235
237
  children: [
236
- /* @__PURE__ */ e(
237
- Ie,
238
+ /* @__PURE__ */ jsx(
239
+ A,
238
240
  {
239
- ref: ae,
240
- src: a,
241
- autoPlay: M,
241
+ ref: Q,
242
+ src: s,
243
+ autoPlay: v2,
242
244
  onPlay: () => {
243
- G(!0), U.current && (u == null || u(), y.current.clear()), W(!0), N(!1), i == null || i(), k ? C() : J();
245
+ G2(true), x$1.current && (f2 == null || f2(), m.current.clear()), k(true), H(false), d2 == null || d2(), S2 ? I2() : Y();
244
246
  },
245
- onTimeUpdate: (t) => {
246
- const r = t.target.duration, g = t.target.currentTime;
247
- if (r && g) {
248
- const h = Math.floor(g / r * 100);
249
- h >= 25 && h < 50 && !y.current.has(25) ? (v == null || v(25), y.current.add(25)) : h >= 50 && h < 75 && !y.current.has(50) ? (v == null || v(50), y.current.add(50)) : h >= 75 && !y.current.has(75) && (v == null || v(75), y.current.add(75));
247
+ onTimeUpdate: (t2) => {
248
+ const o2 = t2.target.duration, b2 = t2.target.currentTime;
249
+ if (o2 && b2) {
250
+ const a2 = Math.floor(b2 / o2 * 100);
251
+ a2 >= 25 && a2 < 50 && !m.current.has(25) ? (u2 == null || u2(25), m.current.add(25)) : a2 >= 50 && a2 < 75 && !m.current.has(50) ? (u2 == null || u2(50), m.current.add(50)) : a2 >= 75 && !m.current.has(75) && (u2 == null || u2(75), m.current.add(75));
250
252
  }
251
253
  },
252
- onVolumeChange: (t) => {
253
- const r = t.target.muted;
254
- j.current !== r && (P == null || P(r), j.current = r, (r !== E || E === void 0) && (r ? A() : J()));
254
+ onVolumeChange: (t2) => {
255
+ const o2 = t2.target.muted;
256
+ E.current !== o2 && (w == null || w(o2), E.current = o2, (o2 !== y$12 || y$12 === void 0) && (o2 ? C2() : Y()));
255
257
  },
256
- onError: async (t) => {
258
+ onError: async (t2) => {
257
259
  try {
258
- if (t.target instanceof HTMLVideoElement) {
259
- Q(!0);
260
- const r = await (await fetch(t.target.src)).blob(), g = URL.createObjectURL(r);
261
- t.target.src = g;
260
+ if (t2.target instanceof HTMLVideoElement) {
261
+ J(true);
262
+ const b2 = await (await fetch(t2.target.src)).blob(), a2 = URL.createObjectURL(b2);
263
+ t2.target.src = a2;
262
264
  }
263
- } catch (r) {
264
- console.error("video fallback fetch failed", r), W(!0), N(!0);
265
+ } catch (o2) {
266
+ console.error("video fallback fetch failed", o2), k(true), H(true);
265
267
  } finally {
266
- Q(!1), A();
268
+ J(false), C2();
267
269
  }
268
270
  },
269
271
  onPause: () => {
270
- W(!1), d == null || d(), A();
272
+ k(false), h2 == null || h2(), C2();
271
273
  },
272
274
  onEnded: () => {
273
- W(!1), U.current = !0, se(), p == null || p(), A();
275
+ k(false), x$1.current = true, et(), l2 == null || l2(), C2();
274
276
  },
275
- style: { visibility: _ ? "hidden" : "visible" },
276
- controls: !1,
277
- playsInline: !0
277
+ style: { visibility: X ? "hidden" : "visible" },
278
+ controls: false,
279
+ playsInline: true
278
280
  }
279
281
  ),
280
- /* @__PURE__ */ e(be, { src: n, style: { visibility: _ ? "visible" : "hidden" } }),
281
- !B && /* @__PURE__ */ e(
282
- De,
282
+ /* @__PURE__ */ jsx(b, { src: r2, style: { visibility: X ? "visible" : "hidden" } }),
283
+ !T && /* @__PURE__ */ jsx(
284
+ Pt,
283
285
  {
284
- loading: q,
285
- autoPlay: M,
286
- played: F,
287
- playing: O,
288
- isMuted: z,
289
- unmute: x,
290
- mute: C,
291
- togglePlaying: K
286
+ loading: j,
287
+ autoPlay: v2,
288
+ played: z,
289
+ playing: W2,
290
+ isMuted: A$12,
291
+ unmute: L,
292
+ mute: I2,
293
+ togglePlaying: Z
292
294
  }
293
295
  ),
294
- B && /* @__PURE__ */ e(
295
- Fe,
296
+ T && /* @__PURE__ */ jsx(
297
+ Tt,
296
298
  {
297
- loading: q,
298
- autoPlay: M,
299
- playMuted: k,
300
- playing: O,
301
- played: F,
302
- unmute: x,
303
- mute: C,
304
- isMuted: z,
305
- hasNotPausedVideo: ne,
306
- hasInteractedWithAudio: H
299
+ loading: j,
300
+ autoPlay: v2,
301
+ playMuted: S2,
302
+ playing: W2,
303
+ played: z,
304
+ unmute: L,
305
+ mute: I2,
306
+ isMuted: A$12,
307
+ hasNotPausedVideo: V,
308
+ hasInteractedWithAudio: q
307
309
  }
308
310
  ),
309
- q && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ue, {}) })
311
+ j && /* @__PURE__ */ jsx(B, { children: /* @__PURE__ */ jsx(d$1, {}) })
310
312
  ]
311
313
  }
312
314
  );
313
315
  }
314
316
  );
315
317
  export {
316
- Ze as E,
317
- ze as w,
318
- Ye as y
318
+ Et as E,
319
+ wt as w,
320
+ y$1 as y
319
321
  };