@devix-technologies/react-gjirafa-vp-player 1.0.30 → 1.0.31-beta.0

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 (43) hide show
  1. package/README.md +95 -707
  2. package/dist/index.d.ts +897 -9
  3. package/dist/react-gjirafa-vp-player.es.js +1138 -1380
  4. package/dist/react-gjirafa-vp-player.umd.js +12 -11
  5. package/package.json +19 -24
  6. package/dist/App.d.ts +0 -2
  7. package/dist/components/Feedback.d.ts +0 -25
  8. package/dist/components/VPPlayer/index.d.ts +0 -2
  9. package/dist/components/VPPlayer/ui/index.d.ts +0 -1
  10. package/dist/components/VPPlayer/ui/styled.d.ts +0 -42
  11. package/dist/config/index.d.ts +0 -1
  12. package/dist/config/vpPlayerConfig.d.ts +0 -9
  13. package/dist/constants/configs.d.ts +0 -22
  14. package/dist/constants/index.d.ts +0 -1
  15. package/dist/constants/storybook.d.ts +0 -9
  16. package/dist/constants/styles.d.ts +0 -11
  17. package/dist/constants/urls.d.ts +0 -18
  18. package/dist/constants/vpPlayer.d.ts +0 -47
  19. package/dist/contexts/VPPlayerContext.d.ts +0 -52
  20. package/dist/contexts/index.d.ts +0 -1
  21. package/dist/features/VPPlayer.d.ts +0 -41
  22. package/dist/features/stories/ads/Ads.stories.d.ts +0 -20
  23. package/dist/features/stories/context/Context.stories.d.ts +0 -10
  24. package/dist/features/stories/index.d.ts +0 -3
  25. package/dist/features/stories/playback/Playback.stories.d.ts +0 -38
  26. package/dist/fixtures/index.d.ts +0 -1
  27. package/dist/fixtures/playlist.d.ts +0 -11
  28. package/dist/hooks/index.d.ts +0 -4
  29. package/dist/hooks/useVPPlayerEvents.d.ts +0 -24
  30. package/dist/hooks/useVPPlayerLogic.d.ts +0 -22
  31. package/dist/hooks/useVPPlayerScript.d.ts +0 -13
  32. package/dist/hooks/useVideoData.d.ts +0 -19
  33. package/dist/interfaces/config.d.ts +0 -314
  34. package/dist/interfaces/index.d.ts +0 -3
  35. package/dist/interfaces/instance.d.ts +0 -73
  36. package/dist/interfaces/props.d.ts +0 -77
  37. package/dist/main.d.ts +0 -0
  38. package/dist/types/api.types.d.ts +0 -81
  39. package/dist/types/index.d.ts +0 -2
  40. package/dist/types/playerEvents.types.d.ts +0 -67
  41. package/dist/utils/index.d.ts +0 -2
  42. package/dist/utils/vpPlayerConfigBuilder.d.ts +0 -30
  43. package/dist/utils/vpPlayerUtils.d.ts +0 -8
@@ -1,6 +1,6 @@
1
- import * as xe from "react";
2
- import Nr, { forwardRef as Fr, useContext as Er, useState as de, useEffect as Se, useRef as K, useMemo as Pr, createContext as Dr, useCallback as ur } from "react";
3
- var Me = { exports: {} }, Oe = {};
1
+ import * as ne from "react";
2
+ import xr, { forwardRef as Pr, useContext as ar, useState as ce, useEffect as Fe, useRef as he, useId as _r, useMemo as ir, createContext as wr, useCallback as qe } from "react";
3
+ var Ee = { exports: {} }, ye = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var Me = { exports: {} }, Oe = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var dr;
14
- function Mr() {
15
- if (dr) return Oe;
16
- dr = 1;
13
+ var Ye;
14
+ function Er() {
15
+ if (Ye) return ye;
16
+ Ye = 1;
17
17
  var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
18
- function n(i, a, t) {
18
+ function t(n, a, i) {
19
19
  var s = null;
20
- if (t !== void 0 && (s = "" + t), a.key !== void 0 && (s = "" + a.key), "key" in a) {
21
- t = {};
20
+ if (i !== void 0 && (s = "" + i), a.key !== void 0 && (s = "" + a.key), "key" in a) {
21
+ i = {};
22
22
  for (var c in a)
23
- c !== "key" && (t[c] = a[c]);
24
- } else t = a;
25
- return a = t.ref, {
23
+ c !== "key" && (i[c] = a[c]);
24
+ } else i = a;
25
+ return a = i.ref, {
26
26
  $$typeof: e,
27
- type: i,
27
+ type: n,
28
28
  key: s,
29
29
  ref: a !== void 0 ? a : null,
30
- props: t
30
+ props: i
31
31
  };
32
32
  }
33
- return Oe.Fragment = r, Oe.jsx = n, Oe.jsxs = n, Oe;
33
+ return ye.Fragment = r, ye.jsx = t, ye.jsxs = t, ye;
34
34
  }
35
- var Ve = {};
35
+ var me = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,47 +42,47 @@ var Ve = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var fr;
46
- function zr() {
47
- return fr || (fr = 1, process.env.NODE_ENV !== "production" && (function() {
45
+ var Ge;
46
+ function kr() {
47
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && (function() {
48
48
  function e(o) {
49
49
  if (o == null) return null;
50
50
  if (typeof o == "function")
51
- return o.$$typeof === y ? null : o.displayName || o.name || null;
51
+ return o.$$typeof === T ? null : o.displayName || o.name || null;
52
52
  if (typeof o == "string") return o;
53
53
  switch (o) {
54
- case v:
54
+ case m:
55
55
  return "Fragment";
56
- case b:
56
+ case x:
57
57
  return "Profiler";
58
- case w:
58
+ case v:
59
59
  return "StrictMode";
60
- case I:
60
+ case A:
61
61
  return "Suspense";
62
- case _:
62
+ case g:
63
63
  return "SuspenseList";
64
- case P:
64
+ case q:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof o == "object")
68
68
  switch (typeof o.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
70
  ), o.$$typeof) {
71
- case h:
71
+ case y:
72
72
  return "Portal";
73
- case F:
73
+ case z:
74
74
  return o.displayName || "Context";
75
- case L:
75
+ case O:
76
76
  return (o._context.displayName || "Context") + ".Consumer";
77
- case k:
78
- var l = o.render;
79
- return o = o.displayName, o || (o = l.displayName || l.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
80
- case J:
81
- return l = o.displayName || null, l !== null ? l : e(o.type) || "Memo";
82
- case Y:
83
- l = o._payload, o = o._init;
77
+ case N:
78
+ var p = o.render;
79
+ return o = o.displayName, o || (o = p.displayName || p.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
80
+ case K:
81
+ return p = o.displayName || null, p !== null ? p : e(o.type) || "Memo";
82
+ case M:
83
+ p = o._payload, o = o._init;
84
84
  try {
85
- return e(o(l));
85
+ return e(o(p));
86
86
  } catch {
87
87
  }
88
88
  }
@@ -91,75 +91,75 @@ function zr() {
91
91
  function r(o) {
92
92
  return "" + o;
93
93
  }
94
- function n(o) {
94
+ function t(o) {
95
95
  try {
96
96
  r(o);
97
- var l = !1;
97
+ var p = !1;
98
98
  } catch {
99
- l = !0;
99
+ p = !0;
100
100
  }
101
- if (l) {
102
- l = console;
103
- var d = l.error, $ = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
104
- return d.call(
105
- l,
101
+ if (p) {
102
+ p = console;
103
+ var R = p.error, P = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
104
+ return R.call(
105
+ p,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- $
107
+ P
108
108
  ), r(o);
109
109
  }
110
110
  }
111
- function i(o) {
112
- if (o === v) return "<>";
113
- if (typeof o == "object" && o !== null && o.$$typeof === Y)
111
+ function n(o) {
112
+ if (o === m) return "<>";
113
+ if (typeof o == "object" && o !== null && o.$$typeof === M)
114
114
  return "<...>";
115
115
  try {
116
- var l = e(o);
117
- return l ? "<" + l + ">" : "<...>";
116
+ var p = e(o);
117
+ return p ? "<" + p + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function a() {
123
- var o = S.A;
123
+ var o = j.A;
124
124
  return o === null ? null : o.getOwner();
125
125
  }
126
- function t() {
126
+ function i() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
129
  function s(o) {
130
- if (B.call(o, "key")) {
131
- var l = Object.getOwnPropertyDescriptor(o, "key").get;
132
- if (l && l.isReactWarning) return !1;
130
+ if (S.call(o, "key")) {
131
+ var p = Object.getOwnPropertyDescriptor(o, "key").get;
132
+ if (p && p.isReactWarning) return !1;
133
133
  }
134
134
  return o.key !== void 0;
135
135
  }
136
- function c(o, l) {
137
- function d() {
138
- j || (j = !0, console.error(
136
+ function c(o, p) {
137
+ function R() {
138
+ ae || (ae = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
- l
140
+ p
141
141
  ));
142
142
  }
143
- d.isReactWarning = !0, Object.defineProperty(o, "key", {
144
- get: d,
143
+ R.isReactWarning = !0, Object.defineProperty(o, "key", {
144
+ get: R,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
148
  function f() {
149
149
  var o = e(this.type);
150
- return z[o] || (z[o] = !0, console.error(
150
+ return H[o] || (H[o] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
152
  )), o = this.props.ref, o !== void 0 ? o : null;
153
153
  }
154
- function m(o, l, d, $, H, fe) {
155
- var V = d.ref;
154
+ function u(o, p, R, P, Y, Z) {
155
+ var I = R.ref;
156
156
  return o = {
157
- $$typeof: E,
157
+ $$typeof: k,
158
158
  type: o,
159
- key: l,
160
- props: d,
161
- _owner: $
162
- }, (V !== void 0 ? V : null) !== null ? Object.defineProperty(o, "ref", {
159
+ key: p,
160
+ props: R,
161
+ _owner: P
162
+ }, (I !== void 0 ? I : null) !== null ? Object.defineProperty(o, "ref", {
163
163
  enumerable: !1,
164
164
  get: f
165
165
  }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
@@ -176,217 +176,217 @@ function zr() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: H
179
+ value: Y
180
180
  }), Object.defineProperty(o, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: fe
184
+ value: Z
185
185
  }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
186
186
  }
187
- function u(o, l, d, $, H, fe) {
188
- var V = l.children;
189
- if (V !== void 0)
190
- if ($)
191
- if (U(V)) {
192
- for ($ = 0; $ < V.length; $++)
193
- p(V[$]);
194
- Object.freeze && Object.freeze(V);
187
+ function d(o, p, R, P, Y, Z) {
188
+ var I = p.children;
189
+ if (I !== void 0)
190
+ if (P)
191
+ if (G(I)) {
192
+ for (P = 0; P < I.length; P++)
193
+ h(I[P]);
194
+ Object.freeze && Object.freeze(I);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else p(V);
200
- if (B.call(l, "key")) {
201
- V = e(o);
202
- var ee = Object.keys(l).filter(function(ne) {
203
- return ne !== "key";
199
+ else h(I);
200
+ if (S.call(p, "key")) {
201
+ I = e(o);
202
+ var b = Object.keys(p).filter(function($) {
203
+ return $ !== "key";
204
204
  });
205
- $ = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[V + $] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ P = 0 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", ie[I + P] || (b = 0 < b.length ? "{" + b.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
211
  <%s key={someKey} {...props} />`,
212
- $,
213
- V,
214
- ee,
215
- V
216
- ), q[V + $] = !0);
212
+ P,
213
+ I,
214
+ b,
215
+ I
216
+ ), ie[I + P] = !0);
217
217
  }
218
- if (V = null, d !== void 0 && (n(d), V = "" + d), s(l) && (n(l.key), V = "" + l.key), "key" in l) {
219
- d = {};
220
- for (var pe in l)
221
- pe !== "key" && (d[pe] = l[pe]);
222
- } else d = l;
223
- return V && c(
224
- d,
218
+ if (I = null, R !== void 0 && (t(R), I = "" + R), s(p) && (t(p.key), I = "" + p.key), "key" in p) {
219
+ R = {};
220
+ for (var oe in p)
221
+ oe !== "key" && (R[oe] = p[oe]);
222
+ } else R = p;
223
+ return I && c(
224
+ R,
225
225
  typeof o == "function" ? o.displayName || o.name || "Unknown" : o
226
- ), m(
226
+ ), u(
227
227
  o,
228
- V,
229
- d,
228
+ I,
229
+ R,
230
230
  a(),
231
- H,
232
- fe
231
+ Y,
232
+ Z
233
233
  );
234
234
  }
235
- function p(o) {
236
- x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === Y && (o._payload.status === "fulfilled" ? x(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
235
+ function h(o) {
236
+ C(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === M && (o._payload.status === "fulfilled" ? C(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
237
237
  }
238
- function x(o) {
239
- return typeof o == "object" && o !== null && o.$$typeof === E;
238
+ function C(o) {
239
+ return typeof o == "object" && o !== null && o.$$typeof === k;
240
240
  }
241
- var g = Nr, E = Symbol.for("react.transitional.element"), h = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), L = Symbol.for("react.consumer"), F = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), J = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), S = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, U = Array.isArray, M = console.createTask ? console.createTask : function() {
241
+ var E = xr, k = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), O = Symbol.for("react.consumer"), z = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), T = Symbol.for("react.client.reference"), j = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, G = Array.isArray, V = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- g = {
244
+ E = {
245
245
  react_stack_bottom_frame: function(o) {
246
246
  return o();
247
247
  }
248
248
  };
249
- var j, z = {}, O = g.react_stack_bottom_frame.bind(
250
- g,
251
- t
252
- )(), Q = M(i(t)), q = {};
253
- Ve.Fragment = v, Ve.jsx = function(o, l, d) {
254
- var $ = 1e4 > S.recentlyCreatedOwnerStacks++;
255
- return u(
249
+ var ae, H = {}, U = E.react_stack_bottom_frame.bind(
250
+ E,
251
+ i
252
+ )(), J = V(n(i)), ie = {};
253
+ me.Fragment = m, me.jsx = function(o, p, R) {
254
+ var P = 1e4 > j.recentlyCreatedOwnerStacks++;
255
+ return d(
256
256
  o,
257
- l,
258
- d,
257
+ p,
258
+ R,
259
259
  !1,
260
- $ ? Error("react-stack-top-frame") : O,
261
- $ ? M(i(o)) : Q
260
+ P ? Error("react-stack-top-frame") : U,
261
+ P ? V(n(o)) : J
262
262
  );
263
- }, Ve.jsxs = function(o, l, d) {
264
- var $ = 1e4 > S.recentlyCreatedOwnerStacks++;
265
- return u(
263
+ }, me.jsxs = function(o, p, R) {
264
+ var P = 1e4 > j.recentlyCreatedOwnerStacks++;
265
+ return d(
266
266
  o,
267
- l,
268
- d,
267
+ p,
268
+ R,
269
269
  !0,
270
- $ ? Error("react-stack-top-frame") : O,
271
- $ ? M(i(o)) : Q
270
+ P ? Error("react-stack-top-frame") : U,
271
+ P ? V(n(o)) : J
272
272
  );
273
273
  };
274
- })()), Ve;
274
+ })()), me;
275
275
  }
276
- var pr;
277
- function Br() {
278
- return pr || (pr = 1, process.env.NODE_ENV === "production" ? Me.exports = Mr() : Me.exports = zr()), Me.exports;
276
+ var He;
277
+ function Sr() {
278
+ return He || (He = 1, process.env.NODE_ENV === "production" ? Ee.exports = Er() : Ee.exports = kr()), Ee.exports;
279
279
  }
280
- var Z = Br();
281
- function tr() {
282
- return tr = Object.assign ? Object.assign.bind() : function(e) {
280
+ var L = Sr();
281
+ function Me() {
282
+ return Me = Object.assign ? Object.assign.bind() : function(e) {
283
283
  for (var r = 1; r < arguments.length; r++) {
284
- var n = arguments[r];
285
- for (var i in n) ({}).hasOwnProperty.call(n, i) && (e[i] = n[i]);
284
+ var t = arguments[r];
285
+ for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
286
286
  }
287
287
  return e;
288
- }, tr.apply(null, arguments);
288
+ }, Me.apply(null, arguments);
289
289
  }
290
- function Ur(e) {
290
+ function Rr(e) {
291
291
  if (e.sheet)
292
292
  return e.sheet;
293
293
  for (var r = 0; r < document.styleSheets.length; r++)
294
294
  if (document.styleSheets[r].ownerNode === e)
295
295
  return document.styleSheets[r];
296
296
  }
297
- function qr(e) {
297
+ function Cr(e) {
298
298
  var r = document.createElement("style");
299
299
  return r.setAttribute("data-emotion", e.key), e.nonce !== void 0 && r.setAttribute("nonce", e.nonce), r.appendChild(document.createTextNode("")), r.setAttribute("data-s", ""), r;
300
300
  }
301
- var Wr = /* @__PURE__ */ (function() {
302
- function e(n) {
303
- var i = this;
301
+ var Ar = /* @__PURE__ */ (function() {
302
+ function e(t) {
303
+ var n = this;
304
304
  this._insertTag = function(a) {
305
- var t;
306
- i.tags.length === 0 ? i.insertionPoint ? t = i.insertionPoint.nextSibling : i.prepend ? t = i.container.firstChild : t = i.before : t = i.tags[i.tags.length - 1].nextSibling, i.container.insertBefore(a, t), i.tags.push(a);
307
- }, this.isSpeedy = n.speedy === void 0 ? !0 : n.speedy, this.tags = [], this.ctr = 0, this.nonce = n.nonce, this.key = n.key, this.container = n.container, this.prepend = n.prepend, this.insertionPoint = n.insertionPoint, this.before = null;
305
+ var i;
306
+ n.tags.length === 0 ? n.insertionPoint ? i = n.insertionPoint.nextSibling : n.prepend ? i = n.container.firstChild : i = n.before : i = n.tags[n.tags.length - 1].nextSibling, n.container.insertBefore(a, i), n.tags.push(a);
307
+ }, this.isSpeedy = t.speedy === void 0 ? !0 : t.speedy, this.tags = [], this.ctr = 0, this.nonce = t.nonce, this.key = t.key, this.container = t.container, this.prepend = t.prepend, this.insertionPoint = t.insertionPoint, this.before = null;
308
308
  }
309
309
  var r = e.prototype;
310
- return r.hydrate = function(i) {
311
- i.forEach(this._insertTag);
312
- }, r.insert = function(i) {
313
- this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(qr(this));
310
+ return r.hydrate = function(n) {
311
+ n.forEach(this._insertTag);
312
+ }, r.insert = function(n) {
313
+ this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(Cr(this));
314
314
  var a = this.tags[this.tags.length - 1];
315
315
  if (this.isSpeedy) {
316
- var t = Ur(a);
316
+ var i = Rr(a);
317
317
  try {
318
- t.insertRule(i, t.cssRules.length);
318
+ i.insertRule(n, i.cssRules.length);
319
319
  } catch {
320
320
  }
321
321
  } else
322
- a.appendChild(document.createTextNode(i));
322
+ a.appendChild(document.createTextNode(n));
323
323
  this.ctr++;
324
324
  }, r.flush = function() {
325
- this.tags.forEach(function(i) {
325
+ this.tags.forEach(function(n) {
326
326
  var a;
327
- return (a = i.parentNode) == null ? void 0 : a.removeChild(i);
327
+ return (a = n.parentNode) == null ? void 0 : a.removeChild(n);
328
328
  }), this.tags = [], this.ctr = 0;
329
329
  }, e;
330
- })(), ie = "-ms-", Ye = "-moz-", A = "-webkit-", Ir = "comm", or = "rule", sr = "decl", Yr = "@import", Sr = "@keyframes", Hr = "@layer", Gr = Math.abs, He = String.fromCharCode, Xr = Object.assign;
331
- function Jr(e, r) {
332
- return te(e, 0) ^ 45 ? (((r << 2 ^ te(e, 0)) << 2 ^ te(e, 1)) << 2 ^ te(e, 2)) << 2 ^ te(e, 3) : 0;
330
+ })(), W = "-ms-", Oe = "-moz-", _ = "-webkit-", or = "comm", Be = "rule", Ue = "decl", Tr = "@import", sr = "@keyframes", Ir = "@layer", Or = Math.abs, je = String.fromCharCode, jr = Object.assign;
331
+ function $r(e, r) {
332
+ return B(e, 0) ^ 45 ? (((r << 2 ^ B(e, 0)) << 2 ^ B(e, 1)) << 2 ^ B(e, 2)) << 2 ^ B(e, 3) : 0;
333
333
  }
334
- function Rr(e) {
334
+ function cr(e) {
335
335
  return e.trim();
336
336
  }
337
- function Qr(e, r) {
337
+ function Lr(e, r) {
338
338
  return (e = r.exec(e)) ? e[0] : e;
339
339
  }
340
- function C(e, r, n) {
341
- return e.replace(r, n);
340
+ function w(e, r, t) {
341
+ return e.replace(r, t);
342
342
  }
343
- function nr(e, r) {
343
+ function Ve(e, r) {
344
344
  return e.indexOf(r);
345
345
  }
346
- function te(e, r) {
346
+ function B(e, r) {
347
347
  return e.charCodeAt(r) | 0;
348
348
  }
349
- function je(e, r, n) {
350
- return e.slice(r, n);
349
+ function ge(e, r, t) {
350
+ return e.slice(r, t);
351
351
  }
352
- function he(e) {
352
+ function ee(e) {
353
353
  return e.length;
354
354
  }
355
- function lr(e) {
355
+ function We(e) {
356
356
  return e.length;
357
357
  }
358
- function ze(e, r) {
358
+ function ke(e, r) {
359
359
  return r.push(e), e;
360
360
  }
361
- function Kr(e, r) {
361
+ function zr(e, r) {
362
362
  return e.map(r).join("");
363
363
  }
364
- var Ge = 1, Te = 1, Tr = 0, le = 0, X = 0, Ce = "";
365
- function Xe(e, r, n, i, a, t, s) {
366
- return { value: e, root: r, parent: n, type: i, props: a, children: t, line: Ge, column: Te, length: s, return: "" };
364
+ var $e = 1, ue = 1, lr = 0, X = 0, F = 0, fe = "";
365
+ function Le(e, r, t, n, a, i, s) {
366
+ return { value: e, root: r, parent: t, type: n, props: a, children: i, line: $e, column: ue, length: s, return: "" };
367
367
  }
368
- function Le(e, r) {
369
- return Xr(Xe("", null, null, "", null, null, 0), e, { length: -e.length }, r);
368
+ function ve(e, r) {
369
+ return jr(Le("", null, null, "", null, null, 0), e, { length: -e.length }, r);
370
370
  }
371
- function Zr() {
372
- return X;
371
+ function Nr() {
372
+ return F;
373
373
  }
374
- function et() {
375
- return X = le > 0 ? te(Ce, --le) : 0, Te--, X === 10 && (Te = 1, Ge--), X;
374
+ function Fr() {
375
+ return F = X > 0 ? B(fe, --X) : 0, ue--, F === 10 && (ue = 1, $e--), F;
376
376
  }
377
- function ue() {
378
- return X = le < Tr ? te(Ce, le++) : 0, Te++, X === 10 && (Te = 1, Ge++), X;
377
+ function Q() {
378
+ return F = X < lr ? B(fe, X++) : 0, ue++, F === 10 && (ue = 1, $e++), F;
379
379
  }
380
- function ye() {
381
- return te(Ce, le);
380
+ function te() {
381
+ return B(fe, X);
382
382
  }
383
- function Ue() {
384
- return le;
383
+ function Ce() {
384
+ return X;
385
385
  }
386
- function Fe(e, r) {
387
- return je(Ce, e, r);
386
+ function Pe(e, r) {
387
+ return ge(fe, e, r);
388
388
  }
389
- function $e(e) {
389
+ function be(e) {
390
390
  switch (e) {
391
391
  // \0 \t \n \r \s whitespace token
392
392
  case 0:
@@ -424,272 +424,272 @@ function $e(e) {
424
424
  }
425
425
  return 0;
426
426
  }
427
- function Ar(e) {
428
- return Ge = Te = 1, Tr = he(Ce = e), le = 0, [];
427
+ function ur(e) {
428
+ return $e = ue = 1, lr = ee(fe = e), X = 0, [];
429
429
  }
430
- function Cr(e) {
431
- return Ce = "", e;
430
+ function dr(e) {
431
+ return fe = "", e;
432
432
  }
433
- function qe(e) {
434
- return Rr(Fe(le - 1, ir(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
433
+ function Ae(e) {
434
+ return cr(Pe(X - 1, De(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
435
435
  }
436
- function rt(e) {
437
- for (; (X = ye()) && X < 33; )
438
- ue();
439
- return $e(e) > 2 || $e(X) > 3 ? "" : " ";
436
+ function Mr(e) {
437
+ for (; (F = te()) && F < 33; )
438
+ Q();
439
+ return be(e) > 2 || be(F) > 3 ? "" : " ";
440
440
  }
441
- function tt(e, r) {
442
- for (; --r && ue() && !(X < 48 || X > 102 || X > 57 && X < 65 || X > 70 && X < 97); )
441
+ function Vr(e, r) {
442
+ for (; --r && Q() && !(F < 48 || F > 102 || F > 57 && F < 65 || F > 70 && F < 97); )
443
443
  ;
444
- return Fe(e, Ue() + (r < 6 && ye() == 32 && ue() == 32));
444
+ return Pe(e, Ce() + (r < 6 && te() == 32 && Q() == 32));
445
445
  }
446
- function ir(e) {
447
- for (; ue(); )
448
- switch (X) {
446
+ function De(e) {
447
+ for (; Q(); )
448
+ switch (F) {
449
449
  // ] ) " '
450
450
  case e:
451
- return le;
451
+ return X;
452
452
  // " '
453
453
  case 34:
454
454
  case 39:
455
- e !== 34 && e !== 39 && ir(X);
455
+ e !== 34 && e !== 39 && De(F);
456
456
  break;
457
457
  // (
458
458
  case 40:
459
- e === 41 && ir(e);
459
+ e === 41 && De(e);
460
460
  break;
461
461
  // \
462
462
  case 92:
463
- ue();
463
+ Q();
464
464
  break;
465
465
  }
466
- return le;
466
+ return X;
467
467
  }
468
- function nt(e, r) {
469
- for (; ue() && e + X !== 57; )
470
- if (e + X === 84 && ye() === 47)
468
+ function Dr(e, r) {
469
+ for (; Q() && e + F !== 57; )
470
+ if (e + F === 84 && te() === 47)
471
471
  break;
472
- return "/*" + Fe(r, le - 1) + "*" + He(e === 47 ? e : ue());
472
+ return "/*" + Pe(r, X - 1) + "*" + je(e === 47 ? e : Q());
473
473
  }
474
- function it(e) {
475
- for (; !$e(ye()); )
476
- ue();
477
- return Fe(e, le);
474
+ function Br(e) {
475
+ for (; !be(te()); )
476
+ Q();
477
+ return Pe(e, X);
478
478
  }
479
- function at(e) {
480
- return Cr(We("", null, null, null, [""], e = Ar(e), 0, [0], e));
479
+ function Ur(e) {
480
+ return dr(Te("", null, null, null, [""], e = ur(e), 0, [0], e));
481
481
  }
482
- function We(e, r, n, i, a, t, s, c, f) {
483
- for (var m = 0, u = 0, p = s, x = 0, g = 0, E = 0, h = 1, v = 1, w = 1, b = 0, L = "", F = a, k = t, I = i, _ = L; v; )
484
- switch (E = b, b = ue()) {
482
+ function Te(e, r, t, n, a, i, s, c, f) {
483
+ for (var u = 0, d = 0, h = s, C = 0, E = 0, k = 0, y = 1, m = 1, v = 1, x = 0, O = "", z = a, N = i, A = n, g = O; m; )
484
+ switch (k = x, x = Q()) {
485
485
  // (
486
486
  case 40:
487
- if (E != 108 && te(_, p - 1) == 58) {
488
- nr(_ += C(qe(b), "&", "&\f"), "&\f") != -1 && (w = -1);
487
+ if (k != 108 && B(g, h - 1) == 58) {
488
+ Ve(g += w(Ae(x), "&", "&\f"), "&\f") != -1 && (v = -1);
489
489
  break;
490
490
  }
491
491
  // " ' [
492
492
  case 34:
493
493
  case 39:
494
494
  case 91:
495
- _ += qe(b);
495
+ g += Ae(x);
496
496
  break;
497
497
  // \t \n \r \s
498
498
  case 9:
499
499
  case 10:
500
500
  case 13:
501
501
  case 32:
502
- _ += rt(E);
502
+ g += Mr(k);
503
503
  break;
504
504
  // \
505
505
  case 92:
506
- _ += tt(Ue() - 1, 7);
506
+ g += Vr(Ce() - 1, 7);
507
507
  continue;
508
508
  // /
509
509
  case 47:
510
- switch (ye()) {
510
+ switch (te()) {
511
511
  case 42:
512
512
  case 47:
513
- ze(ot(nt(ue(), Ue()), r, n), f);
513
+ ke(Wr(Dr(Q(), Ce()), r, t), f);
514
514
  break;
515
515
  default:
516
- _ += "/";
516
+ g += "/";
517
517
  }
518
518
  break;
519
519
  // {
520
- case 123 * h:
521
- c[m++] = he(_) * w;
520
+ case 123 * y:
521
+ c[u++] = ee(g) * v;
522
522
  // } ; \0
523
- case 125 * h:
523
+ case 125 * y:
524
524
  case 59:
525
525
  case 0:
526
- switch (b) {
526
+ switch (x) {
527
527
  // \0 }
528
528
  case 0:
529
529
  case 125:
530
- v = 0;
530
+ m = 0;
531
531
  // ;
532
- case 59 + u:
533
- w == -1 && (_ = C(_, /\f/g, "")), g > 0 && he(_) - p && ze(g > 32 ? mr(_ + ";", i, n, p - 1) : mr(C(_, " ", "") + ";", i, n, p - 2), f);
532
+ case 59 + d:
533
+ v == -1 && (g = w(g, /\f/g, "")), E > 0 && ee(g) - h && ke(E > 32 ? Je(g + ";", n, t, h - 1) : Je(w(g, " ", "") + ";", n, t, h - 2), f);
534
534
  break;
535
535
  // @ ;
536
536
  case 59:
537
- _ += ";";
537
+ g += ";";
538
538
  // { rule/at-rule
539
539
  default:
540
- if (ze(I = hr(_, r, n, m, u, a, c, L, F = [], k = [], p), t), b === 123)
541
- if (u === 0)
542
- We(_, r, I, I, F, t, p, c, k);
540
+ if (ke(A = Xe(g, r, t, u, d, a, c, O, z = [], N = [], h), i), x === 123)
541
+ if (d === 0)
542
+ Te(g, r, A, A, z, i, h, c, N);
543
543
  else
544
- switch (x === 99 && te(_, 3) === 110 ? 100 : x) {
544
+ switch (C === 99 && B(g, 3) === 110 ? 100 : C) {
545
545
  // d l m s
546
546
  case 100:
547
547
  case 108:
548
548
  case 109:
549
549
  case 115:
550
- We(e, I, I, i && ze(hr(e, I, I, 0, 0, a, c, L, a, F = [], p), k), a, k, p, c, i ? F : k);
550
+ Te(e, A, A, n && ke(Xe(e, A, A, 0, 0, a, c, O, a, z = [], h), N), a, N, h, c, n ? z : N);
551
551
  break;
552
552
  default:
553
- We(_, I, I, I, [""], k, 0, c, k);
553
+ Te(g, A, A, A, [""], N, 0, c, N);
554
554
  }
555
555
  }
556
- m = u = g = 0, h = w = 1, L = _ = "", p = s;
556
+ u = d = E = 0, y = v = 1, O = g = "", h = s;
557
557
  break;
558
558
  // :
559
559
  case 58:
560
- p = 1 + he(_), g = E;
560
+ h = 1 + ee(g), E = k;
561
561
  default:
562
- if (h < 1) {
563
- if (b == 123)
564
- --h;
565
- else if (b == 125 && h++ == 0 && et() == 125)
562
+ if (y < 1) {
563
+ if (x == 123)
564
+ --y;
565
+ else if (x == 125 && y++ == 0 && Fr() == 125)
566
566
  continue;
567
567
  }
568
- switch (_ += He(b), b * h) {
568
+ switch (g += je(x), x * y) {
569
569
  // &
570
570
  case 38:
571
- w = u > 0 ? 1 : (_ += "\f", -1);
571
+ v = d > 0 ? 1 : (g += "\f", -1);
572
572
  break;
573
573
  // ,
574
574
  case 44:
575
- c[m++] = (he(_) - 1) * w, w = 1;
575
+ c[u++] = (ee(g) - 1) * v, v = 1;
576
576
  break;
577
577
  // @
578
578
  case 64:
579
- ye() === 45 && (_ += qe(ue())), x = ye(), u = p = he(L = _ += it(Ue())), b++;
579
+ te() === 45 && (g += Ae(Q())), C = te(), d = h = ee(O = g += Br(Ce())), x++;
580
580
  break;
581
581
  // -
582
582
  case 45:
583
- E === 45 && he(_) == 2 && (h = 0);
583
+ k === 45 && ee(g) == 2 && (y = 0);
584
584
  }
585
585
  }
586
- return t;
586
+ return i;
587
587
  }
588
- function hr(e, r, n, i, a, t, s, c, f, m, u) {
589
- for (var p = a - 1, x = a === 0 ? t : [""], g = lr(x), E = 0, h = 0, v = 0; E < i; ++E)
590
- for (var w = 0, b = je(e, p + 1, p = Gr(h = s[E])), L = e; w < g; ++w)
591
- (L = Rr(h > 0 ? x[w] + " " + b : C(b, /&\f/g, x[w]))) && (f[v++] = L);
592
- return Xe(e, r, n, a === 0 ? or : c, f, m, u);
588
+ function Xe(e, r, t, n, a, i, s, c, f, u, d) {
589
+ for (var h = a - 1, C = a === 0 ? i : [""], E = We(C), k = 0, y = 0, m = 0; k < n; ++k)
590
+ for (var v = 0, x = ge(e, h + 1, h = Or(y = s[k])), O = e; v < E; ++v)
591
+ (O = cr(y > 0 ? C[v] + " " + x : w(x, /&\f/g, C[v]))) && (f[m++] = O);
592
+ return Le(e, r, t, a === 0 ? Be : c, f, u, d);
593
593
  }
594
- function ot(e, r, n) {
595
- return Xe(e, r, n, Ir, He(Zr()), je(e, 2, -2), 0);
594
+ function Wr(e, r, t) {
595
+ return Le(e, r, t, or, je(Nr()), ge(e, 2, -2), 0);
596
596
  }
597
- function mr(e, r, n, i) {
598
- return Xe(e, r, n, sr, je(e, 0, i), je(e, i + 1, -1), i);
597
+ function Je(e, r, t, n) {
598
+ return Le(e, r, t, Ue, ge(e, 0, n), ge(e, n + 1, -1), n);
599
599
  }
600
- function Re(e, r) {
601
- for (var n = "", i = lr(e), a = 0; a < i; a++)
602
- n += r(e[a], a, e, r) || "";
603
- return n;
600
+ function le(e, r) {
601
+ for (var t = "", n = We(e), a = 0; a < n; a++)
602
+ t += r(e[a], a, e, r) || "";
603
+ return t;
604
604
  }
605
- function st(e, r, n, i) {
605
+ function qr(e, r, t, n) {
606
606
  switch (e.type) {
607
- case Hr:
607
+ case Ir:
608
608
  if (e.children.length) break;
609
- case Yr:
610
- case sr:
609
+ case Tr:
610
+ case Ue:
611
611
  return e.return = e.return || e.value;
612
- case Ir:
613
- return "";
614
- case Sr:
615
- return e.return = e.value + "{" + Re(e.children, i) + "}";
616
612
  case or:
613
+ return "";
614
+ case sr:
615
+ return e.return = e.value + "{" + le(e.children, n) + "}";
616
+ case Be:
617
617
  e.value = e.props.join(",");
618
618
  }
619
- return he(n = Re(e.children, i)) ? e.return = e.value + "{" + n + "}" : "";
619
+ return ee(t = le(e.children, n)) ? e.return = e.value + "{" + t + "}" : "";
620
620
  }
621
- function lt(e) {
622
- var r = lr(e);
623
- return function(n, i, a, t) {
621
+ function Yr(e) {
622
+ var r = We(e);
623
+ return function(t, n, a, i) {
624
624
  for (var s = "", c = 0; c < r; c++)
625
- s += e[c](n, i, a, t) || "";
625
+ s += e[c](t, n, a, i) || "";
626
626
  return s;
627
627
  };
628
628
  }
629
- function ct(e) {
629
+ function Gr(e) {
630
630
  return function(r) {
631
631
  r.root || (r = r.return) && e(r);
632
632
  };
633
633
  }
634
- function kr(e) {
634
+ function fr(e) {
635
635
  var r = /* @__PURE__ */ Object.create(null);
636
- return function(n) {
637
- return r[n] === void 0 && (r[n] = e(n)), r[n];
636
+ return function(t) {
637
+ return r[t] === void 0 && (r[t] = e(t)), r[t];
638
638
  };
639
639
  }
640
- var ut = function(r, n, i) {
641
- for (var a = 0, t = 0; a = t, t = ye(), a === 38 && t === 12 && (n[i] = 1), !$e(t); )
642
- ue();
643
- return Fe(r, le);
644
- }, dt = function(r, n) {
645
- var i = -1, a = 44;
640
+ var Hr = function(r, t, n) {
641
+ for (var a = 0, i = 0; a = i, i = te(), a === 38 && i === 12 && (t[n] = 1), !be(i); )
642
+ Q();
643
+ return Pe(r, X);
644
+ }, Xr = function(r, t) {
645
+ var n = -1, a = 44;
646
646
  do
647
- switch ($e(a)) {
647
+ switch (be(a)) {
648
648
  case 0:
649
- a === 38 && ye() === 12 && (n[i] = 1), r[i] += ut(le - 1, n, i);
649
+ a === 38 && te() === 12 && (t[n] = 1), r[n] += Hr(X - 1, t, n);
650
650
  break;
651
651
  case 2:
652
- r[i] += qe(a);
652
+ r[n] += Ae(a);
653
653
  break;
654
654
  case 4:
655
655
  if (a === 44) {
656
- r[++i] = ye() === 58 ? "&\f" : "", n[i] = r[i].length;
656
+ r[++n] = te() === 58 ? "&\f" : "", t[n] = r[n].length;
657
657
  break;
658
658
  }
659
659
  // fallthrough
660
660
  default:
661
- r[i] += He(a);
661
+ r[n] += je(a);
662
662
  }
663
- while (a = ue());
663
+ while (a = Q());
664
664
  return r;
665
- }, ft = function(r, n) {
666
- return Cr(dt(Ar(r), n));
667
- }, yr = /* @__PURE__ */ new WeakMap(), pt = function(r) {
665
+ }, Jr = function(r, t) {
666
+ return dr(Xr(ur(r), t));
667
+ }, Qe = /* @__PURE__ */ new WeakMap(), Qr = function(r) {
668
668
  if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo
669
669
  // negative .length indicates that this rule has been already prefixed
670
670
  r.length < 1)) {
671
- for (var n = r.value, i = r.parent, a = r.column === i.column && r.line === i.line; i.type !== "rule"; )
672
- if (i = i.parent, !i) return;
673
- if (!(r.props.length === 1 && n.charCodeAt(0) !== 58 && !yr.get(i)) && !a) {
674
- yr.set(r, !0);
675
- for (var t = [], s = ft(n, t), c = i.props, f = 0, m = 0; f < s.length; f++)
676
- for (var u = 0; u < c.length; u++, m++)
677
- r.props[m] = t[f] ? s[f].replace(/&\f/g, c[u]) : c[u] + " " + s[f];
671
+ for (var t = r.value, n = r.parent, a = r.column === n.column && r.line === n.line; n.type !== "rule"; )
672
+ if (n = n.parent, !n) return;
673
+ if (!(r.props.length === 1 && t.charCodeAt(0) !== 58 && !Qe.get(n)) && !a) {
674
+ Qe.set(r, !0);
675
+ for (var i = [], s = Jr(t, i), c = n.props, f = 0, u = 0; f < s.length; f++)
676
+ for (var d = 0; d < c.length; d++, u++)
677
+ r.props[u] = i[f] ? s[f].replace(/&\f/g, c[d]) : c[d] + " " + s[f];
678
678
  }
679
679
  }
680
- }, ht = function(r) {
680
+ }, Kr = function(r) {
681
681
  if (r.type === "decl") {
682
- var n = r.value;
682
+ var t = r.value;
683
683
  // charcode for l
684
- n.charCodeAt(0) === 108 && // charcode for b
685
- n.charCodeAt(2) === 98 && (r.return = "", r.value = "");
684
+ t.charCodeAt(0) === 108 && // charcode for b
685
+ t.charCodeAt(2) === 98 && (r.return = "", r.value = "");
686
686
  }
687
687
  };
688
- function Or(e, r) {
689
- switch (Jr(e, r)) {
688
+ function pr(e, r) {
689
+ switch ($r(e, r)) {
690
690
  // color-adjust
691
691
  case 5103:
692
- return A + "print-" + e + e;
692
+ return _ + "print-" + e + e;
693
693
  // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
694
694
  case 5737:
695
695
  case 4201:
@@ -719,58 +719,58 @@ function Or(e, r) {
719
719
  case 5365:
720
720
  case 5621:
721
721
  case 3829:
722
- return A + e + e;
722
+ return _ + e + e;
723
723
  // appearance, user-select, transform, hyphens, text-size-adjust
724
724
  case 5349:
725
725
  case 4246:
726
726
  case 4810:
727
727
  case 6968:
728
728
  case 2756:
729
- return A + e + Ye + e + ie + e + e;
729
+ return _ + e + Oe + e + W + e + e;
730
730
  // flex, flex-direction
731
731
  case 6828:
732
732
  case 4268:
733
- return A + e + ie + e + e;
733
+ return _ + e + W + e + e;
734
734
  // order
735
735
  case 6165:
736
- return A + e + ie + "flex-" + e + e;
736
+ return _ + e + W + "flex-" + e + e;
737
737
  // align-items
738
738
  case 5187:
739
- return A + e + C(e, /(\w+).+(:[^]+)/, A + "box-$1$2" + ie + "flex-$1$2") + e;
739
+ return _ + e + w(e, /(\w+).+(:[^]+)/, _ + "box-$1$2" + W + "flex-$1$2") + e;
740
740
  // align-self
741
741
  case 5443:
742
- return A + e + ie + "flex-item-" + C(e, /flex-|-self/, "") + e;
742
+ return _ + e + W + "flex-item-" + w(e, /flex-|-self/, "") + e;
743
743
  // align-content
744
744
  case 4675:
745
- return A + e + ie + "flex-line-pack" + C(e, /align-content|flex-|-self/, "") + e;
745
+ return _ + e + W + "flex-line-pack" + w(e, /align-content|flex-|-self/, "") + e;
746
746
  // flex-shrink
747
747
  case 5548:
748
- return A + e + ie + C(e, "shrink", "negative") + e;
748
+ return _ + e + W + w(e, "shrink", "negative") + e;
749
749
  // flex-basis
750
750
  case 5292:
751
- return A + e + ie + C(e, "basis", "preferred-size") + e;
751
+ return _ + e + W + w(e, "basis", "preferred-size") + e;
752
752
  // flex-grow
753
753
  case 6060:
754
- return A + "box-" + C(e, "-grow", "") + A + e + ie + C(e, "grow", "positive") + e;
754
+ return _ + "box-" + w(e, "-grow", "") + _ + e + W + w(e, "grow", "positive") + e;
755
755
  // transition
756
756
  case 4554:
757
- return A + C(e, /([^-])(transform)/g, "$1" + A + "$2") + e;
757
+ return _ + w(e, /([^-])(transform)/g, "$1" + _ + "$2") + e;
758
758
  // cursor
759
759
  case 6187:
760
- return C(C(C(e, /(zoom-|grab)/, A + "$1"), /(image-set)/, A + "$1"), e, "") + e;
760
+ return w(w(w(e, /(zoom-|grab)/, _ + "$1"), /(image-set)/, _ + "$1"), e, "") + e;
761
761
  // background, background-image
762
762
  case 5495:
763
763
  case 3959:
764
- return C(e, /(image-set\([^]*)/, A + "$1$`$1");
764
+ return w(e, /(image-set\([^]*)/, _ + "$1$`$1");
765
765
  // justify-content
766
766
  case 4968:
767
- return C(C(e, /(.+:)(flex-)?(.*)/, A + "box-pack:$3" + ie + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + A + e + e;
767
+ return w(w(e, /(.+:)(flex-)?(.*)/, _ + "box-pack:$3" + W + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + _ + e + e;
768
768
  // (margin|padding)-inline-(start|end)
769
769
  case 4095:
770
770
  case 3583:
771
771
  case 4068:
772
772
  case 2532:
773
- return C(e, /(.+)-inline(.+)/, A + "$1$2") + e;
773
+ return w(e, /(.+)-inline(.+)/, _ + "$1$2") + e;
774
774
  // (min|max)?(width|height|inline-size|block-size)
775
775
  case 8116:
776
776
  case 7059:
@@ -784,115 +784,115 @@ function Or(e, r) {
784
784
  case 5789:
785
785
  case 5021:
786
786
  case 4765:
787
- if (he(e) - 1 - r > 6) switch (te(e, r + 1)) {
787
+ if (ee(e) - 1 - r > 6) switch (B(e, r + 1)) {
788
788
  // (m)ax-content, (m)in-content
789
789
  case 109:
790
- if (te(e, r + 4) !== 45) break;
790
+ if (B(e, r + 4) !== 45) break;
791
791
  // (f)ill-available, (f)it-content
792
792
  case 102:
793
- return C(e, /(.+:)(.+)-([^]+)/, "$1" + A + "$2-$3$1" + Ye + (te(e, r + 3) == 108 ? "$3" : "$2-$3")) + e;
793
+ return w(e, /(.+:)(.+)-([^]+)/, "$1" + _ + "$2-$3$1" + Oe + (B(e, r + 3) == 108 ? "$3" : "$2-$3")) + e;
794
794
  // (s)tretch
795
795
  case 115:
796
- return ~nr(e, "stretch") ? Or(C(e, "stretch", "fill-available"), r) + e : e;
796
+ return ~Ve(e, "stretch") ? pr(w(e, "stretch", "fill-available"), r) + e : e;
797
797
  }
798
798
  break;
799
799
  // position: sticky
800
800
  case 4949:
801
- if (te(e, r + 1) !== 115) break;
801
+ if (B(e, r + 1) !== 115) break;
802
802
  // display: (flex|inline-flex)
803
803
  case 6444:
804
- switch (te(e, he(e) - 3 - (~nr(e, "!important") && 10))) {
804
+ switch (B(e, ee(e) - 3 - (~Ve(e, "!important") && 10))) {
805
805
  // stic(k)y
806
806
  case 107:
807
- return C(e, ":", ":" + A) + e;
807
+ return w(e, ":", ":" + _) + e;
808
808
  // (inline-)?fl(e)x
809
809
  case 101:
810
- return C(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + A + (te(e, 14) === 45 ? "inline-" : "") + "box$3$1" + A + "$2$3$1" + ie + "$2box$3") + e;
810
+ return w(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + _ + (B(e, 14) === 45 ? "inline-" : "") + "box$3$1" + _ + "$2$3$1" + W + "$2box$3") + e;
811
811
  }
812
812
  break;
813
813
  // writing-mode
814
814
  case 5936:
815
- switch (te(e, r + 11)) {
815
+ switch (B(e, r + 11)) {
816
816
  // vertical-l(r)
817
817
  case 114:
818
- return A + e + ie + C(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
818
+ return _ + e + W + w(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
819
819
  // vertical-r(l)
820
820
  case 108:
821
- return A + e + ie + C(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
821
+ return _ + e + W + w(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
822
822
  // horizontal(-)tb
823
823
  case 45:
824
- return A + e + ie + C(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
824
+ return _ + e + W + w(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
825
825
  }
826
- return A + e + ie + e + e;
826
+ return _ + e + W + e + e;
827
827
  }
828
828
  return e;
829
829
  }
830
- var mt = function(r, n, i, a) {
830
+ var Zr = function(r, t, n, a) {
831
831
  if (r.length > -1 && !r.return) switch (r.type) {
832
- case sr:
833
- r.return = Or(r.value, r.length);
832
+ case Ue:
833
+ r.return = pr(r.value, r.length);
834
834
  break;
835
- case Sr:
836
- return Re([Le(r, {
837
- value: C(r.value, "@", "@" + A)
835
+ case sr:
836
+ return le([ve(r, {
837
+ value: w(r.value, "@", "@" + _)
838
838
  })], a);
839
- case or:
840
- if (r.length) return Kr(r.props, function(t) {
841
- switch (Qr(t, /(::plac\w+|:read-\w+)/)) {
839
+ case Be:
840
+ if (r.length) return zr(r.props, function(i) {
841
+ switch (Lr(i, /(::plac\w+|:read-\w+)/)) {
842
842
  // :read-(only|write)
843
843
  case ":read-only":
844
844
  case ":read-write":
845
- return Re([Le(r, {
846
- props: [C(t, /:(read-\w+)/, ":" + Ye + "$1")]
845
+ return le([ve(r, {
846
+ props: [w(i, /:(read-\w+)/, ":" + Oe + "$1")]
847
847
  })], a);
848
848
  // :placeholder
849
849
  case "::placeholder":
850
- return Re([Le(r, {
851
- props: [C(t, /:(plac\w+)/, ":" + A + "input-$1")]
852
- }), Le(r, {
853
- props: [C(t, /:(plac\w+)/, ":" + Ye + "$1")]
854
- }), Le(r, {
855
- props: [C(t, /:(plac\w+)/, ie + "input-$1")]
850
+ return le([ve(r, {
851
+ props: [w(i, /:(plac\w+)/, ":" + _ + "input-$1")]
852
+ }), ve(r, {
853
+ props: [w(i, /:(plac\w+)/, ":" + Oe + "$1")]
854
+ }), ve(r, {
855
+ props: [w(i, /:(plac\w+)/, W + "input-$1")]
856
856
  })], a);
857
857
  }
858
858
  return "";
859
859
  });
860
860
  }
861
- }, yt = [mt], vt = function(r) {
862
- var n = r.key;
863
- if (n === "css") {
864
- var i = document.querySelectorAll("style[data-emotion]:not([data-s])");
865
- Array.prototype.forEach.call(i, function(h) {
866
- var v = h.getAttribute("data-emotion");
867
- v.indexOf(" ") !== -1 && (document.head.appendChild(h), h.setAttribute("data-s", ""));
861
+ }, et = [Zr], rt = function(r) {
862
+ var t = r.key;
863
+ if (t === "css") {
864
+ var n = document.querySelectorAll("style[data-emotion]:not([data-s])");
865
+ Array.prototype.forEach.call(n, function(y) {
866
+ var m = y.getAttribute("data-emotion");
867
+ m.indexOf(" ") !== -1 && (document.head.appendChild(y), y.setAttribute("data-s", ""));
868
868
  });
869
869
  }
870
- var a = r.stylisPlugins || yt, t = {}, s, c = [];
870
+ var a = r.stylisPlugins || et, i = {}, s, c = [];
871
871
  s = r.container || document.head, Array.prototype.forEach.call(
872
872
  // this means we will ignore elements which don't have a space in them which
873
873
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
874
- document.querySelectorAll('style[data-emotion^="' + n + ' "]'),
875
- function(h) {
876
- for (var v = h.getAttribute("data-emotion").split(" "), w = 1; w < v.length; w++)
877
- t[v[w]] = !0;
878
- c.push(h);
874
+ document.querySelectorAll('style[data-emotion^="' + t + ' "]'),
875
+ function(y) {
876
+ for (var m = y.getAttribute("data-emotion").split(" "), v = 1; v < m.length; v++)
877
+ i[m[v]] = !0;
878
+ c.push(y);
879
879
  }
880
880
  );
881
- var f, m = [pt, ht];
881
+ var f, u = [Qr, Kr];
882
882
  {
883
- var u, p = [st, ct(function(h) {
884
- u.insert(h);
885
- })], x = lt(m.concat(a, p)), g = function(v) {
886
- return Re(at(v), x);
883
+ var d, h = [qr, Gr(function(y) {
884
+ d.insert(y);
885
+ })], C = Yr(u.concat(a, h)), E = function(m) {
886
+ return le(Ur(m), C);
887
887
  };
888
- f = function(v, w, b, L) {
889
- u = b, g(v ? v + "{" + w.styles + "}" : w.styles), L && (E.inserted[w.name] = !0);
888
+ f = function(m, v, x, O) {
889
+ d = x, E(m ? m + "{" + v.styles + "}" : v.styles), O && (k.inserted[v.name] = !0);
890
890
  };
891
891
  }
892
- var E = {
893
- key: n,
894
- sheet: new Wr({
895
- key: n,
892
+ var k = {
893
+ key: t,
894
+ sheet: new Ar({
895
+ key: t,
896
896
  container: s,
897
897
  nonce: r.nonce,
898
898
  speedy: r.speedy,
@@ -900,60 +900,60 @@ var mt = function(r, n, i, a) {
900
900
  insertionPoint: r.insertionPoint
901
901
  }),
902
902
  nonce: r.nonce,
903
- inserted: t,
903
+ inserted: i,
904
904
  registered: {},
905
905
  insert: f
906
906
  };
907
- return E.sheet.hydrate(c), E;
908
- }, gt = !0;
909
- function xt(e, r, n) {
910
- var i = "";
911
- return n.split(" ").forEach(function(a) {
912
- e[a] !== void 0 ? r.push(e[a] + ";") : a && (i += a + " ");
913
- }), i;
907
+ return k.sheet.hydrate(c), k;
908
+ }, tt = !0;
909
+ function nt(e, r, t) {
910
+ var n = "";
911
+ return t.split(" ").forEach(function(a) {
912
+ e[a] !== void 0 ? r.push(e[a] + ";") : a && (n += a + " ");
913
+ }), n;
914
914
  }
915
- var Vr = function(r, n, i) {
916
- var a = r.key + "-" + n.name;
915
+ var hr = function(r, t, n) {
916
+ var a = r.key + "-" + t.name;
917
917
  // we only need to add the styles to the registered cache if the
918
918
  // class name could be used further down
919
919
  // the tree but if it's a string tag, we know it won't
920
920
  // so we don't have to add it to registered cache.
921
921
  // this improves memory usage since we can avoid storing the whole style string
922
- (i === !1 || // we need to always store it if we're in compat mode and
922
+ (n === !1 || // we need to always store it if we're in compat mode and
923
923
  // in node since emotion-server relies on whether a style is in
924
924
  // the registered cache to know whether a style is global or not
925
925
  // also, note that this check will be dead code eliminated in the browser
926
- gt === !1) && r.registered[a] === void 0 && (r.registered[a] = n.styles);
927
- }, wt = function(r, n, i) {
928
- Vr(r, n, i);
929
- var a = r.key + "-" + n.name;
930
- if (r.inserted[n.name] === void 0) {
931
- var t = n;
926
+ tt === !1) && r.registered[a] === void 0 && (r.registered[a] = t.styles);
927
+ }, at = function(r, t, n) {
928
+ hr(r, t, n);
929
+ var a = r.key + "-" + t.name;
930
+ if (r.inserted[t.name] === void 0) {
931
+ var i = t;
932
932
  do
933
- r.insert(n === t ? "." + a : "", t, r.sheet, !0), t = t.next;
934
- while (t !== void 0);
933
+ r.insert(t === i ? "." + a : "", i, r.sheet, !0), i = i.next;
934
+ while (i !== void 0);
935
935
  }
936
936
  };
937
- function bt(e) {
938
- for (var r = 0, n, i = 0, a = e.length; a >= 4; ++i, a -= 4)
939
- n = e.charCodeAt(i) & 255 | (e.charCodeAt(++i) & 255) << 8 | (e.charCodeAt(++i) & 255) << 16 | (e.charCodeAt(++i) & 255) << 24, n = /* Math.imul(k, m): */
940
- (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
941
- n >>> 24, r = /* Math.imul(k, m): */
942
- (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
937
+ function it(e) {
938
+ for (var r = 0, t, n = 0, a = e.length; a >= 4; ++n, a -= 4)
939
+ t = e.charCodeAt(n) & 255 | (e.charCodeAt(++n) & 255) << 8 | (e.charCodeAt(++n) & 255) << 16 | (e.charCodeAt(++n) & 255) << 24, t = /* Math.imul(k, m): */
940
+ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), t ^= /* k >>> r: */
941
+ t >>> 24, r = /* Math.imul(k, m): */
942
+ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
943
943
  (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16);
944
944
  switch (a) {
945
945
  case 3:
946
- r ^= (e.charCodeAt(i + 2) & 255) << 16;
946
+ r ^= (e.charCodeAt(n + 2) & 255) << 16;
947
947
  case 2:
948
- r ^= (e.charCodeAt(i + 1) & 255) << 8;
948
+ r ^= (e.charCodeAt(n + 1) & 255) << 8;
949
949
  case 1:
950
- r ^= e.charCodeAt(i) & 255, r = /* Math.imul(h, m): */
950
+ r ^= e.charCodeAt(n) & 255, r = /* Math.imul(h, m): */
951
951
  (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16);
952
952
  }
953
953
  return r ^= r >>> 13, r = /* Math.imul(h, m): */
954
954
  (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36);
955
955
  }
956
- var _t = {
956
+ var ot = {
957
957
  animationIterationCount: 1,
958
958
  aspectRatio: 1,
959
959
  borderImageOutset: 1,
@@ -1002,221 +1002,221 @@ var _t = {
1002
1002
  strokeMiterlimit: 1,
1003
1003
  strokeOpacity: 1,
1004
1004
  strokeWidth: 1
1005
- }, Et = /[A-Z]|^ms/g, Pt = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Lr = function(r) {
1005
+ }, st = /[A-Z]|^ms/g, ct = /_EMO_([^_]+?)_([^]*?)_EMO_/g, yr = function(r) {
1006
1006
  return r.charCodeAt(1) === 45;
1007
- }, vr = function(r) {
1007
+ }, Ke = function(r) {
1008
1008
  return r != null && typeof r != "boolean";
1009
- }, Ke = /* @__PURE__ */ kr(function(e) {
1010
- return Lr(e) ? e : e.replace(Et, "-$&").toLowerCase();
1011
- }), gr = function(r, n) {
1009
+ }, ze = /* @__PURE__ */ fr(function(e) {
1010
+ return yr(e) ? e : e.replace(st, "-$&").toLowerCase();
1011
+ }), Ze = function(r, t) {
1012
1012
  switch (r) {
1013
1013
  case "animation":
1014
1014
  case "animationName":
1015
- if (typeof n == "string")
1016
- return n.replace(Pt, function(i, a, t) {
1017
- return me = {
1015
+ if (typeof t == "string")
1016
+ return t.replace(ct, function(n, a, i) {
1017
+ return re = {
1018
1018
  name: a,
1019
- styles: t,
1020
- next: me
1019
+ styles: i,
1020
+ next: re
1021
1021
  }, a;
1022
1022
  });
1023
1023
  }
1024
- return _t[r] !== 1 && !Lr(r) && typeof n == "number" && n !== 0 ? n + "px" : n;
1024
+ return ot[r] !== 1 && !yr(r) && typeof t == "number" && t !== 0 ? t + "px" : t;
1025
1025
  };
1026
- function Ne(e, r, n) {
1027
- if (n == null)
1026
+ function xe(e, r, t) {
1027
+ if (t == null)
1028
1028
  return "";
1029
- var i = n;
1030
- if (i.__emotion_styles !== void 0)
1031
- return i;
1032
- switch (typeof n) {
1029
+ var n = t;
1030
+ if (n.__emotion_styles !== void 0)
1031
+ return n;
1032
+ switch (typeof t) {
1033
1033
  case "boolean":
1034
1034
  return "";
1035
1035
  case "object": {
1036
- var a = n;
1036
+ var a = t;
1037
1037
  if (a.anim === 1)
1038
- return me = {
1038
+ return re = {
1039
1039
  name: a.name,
1040
1040
  styles: a.styles,
1041
- next: me
1041
+ next: re
1042
1042
  }, a.name;
1043
- var t = n;
1044
- if (t.styles !== void 0) {
1045
- var s = t.next;
1043
+ var i = t;
1044
+ if (i.styles !== void 0) {
1045
+ var s = i.next;
1046
1046
  if (s !== void 0)
1047
1047
  for (; s !== void 0; )
1048
- me = {
1048
+ re = {
1049
1049
  name: s.name,
1050
1050
  styles: s.styles,
1051
- next: me
1051
+ next: re
1052
1052
  }, s = s.next;
1053
- var c = t.styles + ";";
1053
+ var c = i.styles + ";";
1054
1054
  return c;
1055
1055
  }
1056
- return It(e, r, n);
1056
+ return lt(e, r, t);
1057
1057
  }
1058
1058
  case "function": {
1059
1059
  if (e !== void 0) {
1060
- var f = me, m = n(e);
1061
- return me = f, Ne(e, r, m);
1060
+ var f = re, u = t(e);
1061
+ return re = f, xe(e, r, u);
1062
1062
  }
1063
1063
  break;
1064
1064
  }
1065
1065
  }
1066
- var u = n;
1066
+ var d = t;
1067
1067
  if (r == null)
1068
- return u;
1069
- var p = r[u];
1070
- return p !== void 0 ? p : u;
1068
+ return d;
1069
+ var h = r[d];
1070
+ return h !== void 0 ? h : d;
1071
1071
  }
1072
- function It(e, r, n) {
1073
- var i = "";
1074
- if (Array.isArray(n))
1075
- for (var a = 0; a < n.length; a++)
1076
- i += Ne(e, r, n[a]) + ";";
1072
+ function lt(e, r, t) {
1073
+ var n = "";
1074
+ if (Array.isArray(t))
1075
+ for (var a = 0; a < t.length; a++)
1076
+ n += xe(e, r, t[a]) + ";";
1077
1077
  else
1078
- for (var t in n) {
1079
- var s = n[t];
1078
+ for (var i in t) {
1079
+ var s = t[i];
1080
1080
  if (typeof s != "object") {
1081
1081
  var c = s;
1082
- r != null && r[c] !== void 0 ? i += t + "{" + r[c] + "}" : vr(c) && (i += Ke(t) + ":" + gr(t, c) + ";");
1082
+ r != null && r[c] !== void 0 ? n += i + "{" + r[c] + "}" : Ke(c) && (n += ze(i) + ":" + Ze(i, c) + ";");
1083
1083
  } else if (Array.isArray(s) && typeof s[0] == "string" && (r == null || r[s[0]] === void 0))
1084
1084
  for (var f = 0; f < s.length; f++)
1085
- vr(s[f]) && (i += Ke(t) + ":" + gr(t, s[f]) + ";");
1085
+ Ke(s[f]) && (n += ze(i) + ":" + Ze(i, s[f]) + ";");
1086
1086
  else {
1087
- var m = Ne(e, r, s);
1088
- switch (t) {
1087
+ var u = xe(e, r, s);
1088
+ switch (i) {
1089
1089
  case "animation":
1090
1090
  case "animationName": {
1091
- i += Ke(t) + ":" + m + ";";
1091
+ n += ze(i) + ":" + u + ";";
1092
1092
  break;
1093
1093
  }
1094
1094
  default:
1095
- i += t + "{" + m + "}";
1095
+ n += i + "{" + u + "}";
1096
1096
  }
1097
1097
  }
1098
1098
  }
1099
- return i;
1099
+ return n;
1100
1100
  }
1101
- var xr = /label:\s*([^\s;{]+)\s*(;|$)/g, me;
1102
- function St(e, r, n) {
1101
+ var er = /label:\s*([^\s;{]+)\s*(;|$)/g, re;
1102
+ function ut(e, r, t) {
1103
1103
  if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0)
1104
1104
  return e[0];
1105
- var i = !0, a = "";
1106
- me = void 0;
1107
- var t = e[0];
1108
- if (t == null || t.raw === void 0)
1109
- i = !1, a += Ne(n, r, t);
1105
+ var n = !0, a = "";
1106
+ re = void 0;
1107
+ var i = e[0];
1108
+ if (i == null || i.raw === void 0)
1109
+ n = !1, a += xe(t, r, i);
1110
1110
  else {
1111
- var s = t;
1111
+ var s = i;
1112
1112
  a += s[0];
1113
1113
  }
1114
1114
  for (var c = 1; c < e.length; c++)
1115
- if (a += Ne(n, r, e[c]), i) {
1116
- var f = t;
1115
+ if (a += xe(t, r, e[c]), n) {
1116
+ var f = i;
1117
1117
  a += f[c];
1118
1118
  }
1119
- xr.lastIndex = 0;
1120
- for (var m = "", u; (u = xr.exec(a)) !== null; )
1121
- m += "-" + u[1];
1122
- var p = bt(a) + m;
1119
+ er.lastIndex = 0;
1120
+ for (var u = "", d; (d = er.exec(a)) !== null; )
1121
+ u += "-" + d[1];
1122
+ var h = it(a) + u;
1123
1123
  return {
1124
- name: p,
1124
+ name: h,
1125
1125
  styles: a,
1126
- next: me
1126
+ next: re
1127
1127
  };
1128
1128
  }
1129
- var Rt = function(r) {
1129
+ var dt = function(r) {
1130
1130
  return r();
1131
- }, Tt = xe.useInsertionEffect ? xe.useInsertionEffect : !1, At = Tt || Rt, jr = /* @__PURE__ */ xe.createContext(
1131
+ }, ft = ne.useInsertionEffect ? ne.useInsertionEffect : !1, pt = ft || dt, mr = /* @__PURE__ */ ne.createContext(
1132
1132
  // we're doing this to avoid preconstruct's dead code elimination in this one case
1133
1133
  // because this module is primarily intended for the browser and node
1134
1134
  // but it's also required in react native and similar environments sometimes
1135
1135
  // and we could have a special build just for that
1136
1136
  // but this is much easier and the native packages
1137
1137
  // might use a different theme context in the future anyway
1138
- typeof HTMLElement < "u" ? /* @__PURE__ */ vt({
1138
+ typeof HTMLElement < "u" ? /* @__PURE__ */ rt({
1139
1139
  key: "css"
1140
1140
  }) : null
1141
1141
  );
1142
- jr.Provider;
1143
- var Ct = function(r) {
1144
- return /* @__PURE__ */ Fr(function(n, i) {
1145
- var a = Er(jr);
1146
- return r(n, a, i);
1142
+ mr.Provider;
1143
+ var ht = function(r) {
1144
+ return /* @__PURE__ */ Pr(function(t, n) {
1145
+ var a = ar(mr);
1146
+ return r(t, a, n);
1147
1147
  });
1148
- }, kt = /* @__PURE__ */ xe.createContext({}), Ot = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, Vt = /* @__PURE__ */ kr(
1148
+ }, yt = /* @__PURE__ */ ne.createContext({}), mt = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, vt = /* @__PURE__ */ fr(
1149
1149
  function(e) {
1150
- return Ot.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
1150
+ return mt.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
1151
1151
  }
1152
1152
  /* Z+1 */
1153
- ), Lt = Vt, jt = function(r) {
1153
+ ), gt = vt, bt = function(r) {
1154
1154
  return r !== "theme";
1155
- }, wr = function(r) {
1155
+ }, rr = function(r) {
1156
1156
  return typeof r == "string" && // 96 is one less than the char code
1157
1157
  // for "a" so this is checking that
1158
1158
  // it's a lowercase character
1159
- r.charCodeAt(0) > 96 ? Lt : jt;
1160
- }, br = function(r, n, i) {
1159
+ r.charCodeAt(0) > 96 ? gt : bt;
1160
+ }, tr = function(r, t, n) {
1161
1161
  var a;
1162
- if (n) {
1163
- var t = n.shouldForwardProp;
1164
- a = r.__emotion_forwardProp && t ? function(s) {
1165
- return r.__emotion_forwardProp(s) && t(s);
1166
- } : t;
1162
+ if (t) {
1163
+ var i = t.shouldForwardProp;
1164
+ a = r.__emotion_forwardProp && i ? function(s) {
1165
+ return r.__emotion_forwardProp(s) && i(s);
1166
+ } : i;
1167
1167
  }
1168
- return typeof a != "function" && i && (a = r.__emotion_forwardProp), a;
1169
- }, $t = function(r) {
1170
- var n = r.cache, i = r.serialized, a = r.isStringTag;
1171
- return Vr(n, i, a), At(function() {
1172
- return wt(n, i, a);
1168
+ return typeof a != "function" && n && (a = r.__emotion_forwardProp), a;
1169
+ }, xt = function(r) {
1170
+ var t = r.cache, n = r.serialized, a = r.isStringTag;
1171
+ return hr(t, n, a), pt(function() {
1172
+ return at(t, n, a);
1173
1173
  }), null;
1174
- }, Nt = function e(r, n) {
1175
- var i = r.__emotion_real === r, a = i && r.__emotion_base || r, t, s;
1176
- n !== void 0 && (t = n.label, s = n.target);
1177
- var c = br(r, n, i), f = c || wr(a), m = !f("as");
1174
+ }, Pt = function e(r, t) {
1175
+ var n = r.__emotion_real === r, a = n && r.__emotion_base || r, i, s;
1176
+ t !== void 0 && (i = t.label, s = t.target);
1177
+ var c = tr(r, t, n), f = c || rr(a), u = !f("as");
1178
1178
  return function() {
1179
- var u = arguments, p = i && r.__emotion_styles !== void 0 ? r.__emotion_styles.slice(0) : [];
1180
- if (t !== void 0 && p.push("label:" + t + ";"), u[0] == null || u[0].raw === void 0)
1181
- p.push.apply(p, u);
1179
+ var d = arguments, h = n && r.__emotion_styles !== void 0 ? r.__emotion_styles.slice(0) : [];
1180
+ if (i !== void 0 && h.push("label:" + i + ";"), d[0] == null || d[0].raw === void 0)
1181
+ h.push.apply(h, d);
1182
1182
  else {
1183
- var x = u[0];
1184
- p.push(x[0]);
1185
- for (var g = u.length, E = 1; E < g; E++)
1186
- p.push(u[E], x[E]);
1183
+ var C = d[0];
1184
+ h.push(C[0]);
1185
+ for (var E = d.length, k = 1; k < E; k++)
1186
+ h.push(d[k], C[k]);
1187
1187
  }
1188
- var h = Ct(function(v, w, b) {
1189
- var L = m && v.as || a, F = "", k = [], I = v;
1190
- if (v.theme == null) {
1191
- I = {};
1192
- for (var _ in v)
1193
- I[_] = v[_];
1194
- I.theme = xe.useContext(kt);
1188
+ var y = ht(function(m, v, x) {
1189
+ var O = u && m.as || a, z = "", N = [], A = m;
1190
+ if (m.theme == null) {
1191
+ A = {};
1192
+ for (var g in m)
1193
+ A[g] = m[g];
1194
+ A.theme = ne.useContext(yt);
1195
1195
  }
1196
- typeof v.className == "string" ? F = xt(w.registered, k, v.className) : v.className != null && (F = v.className + " ");
1197
- var J = St(p.concat(k), w.registered, I);
1198
- F += w.key + "-" + J.name, s !== void 0 && (F += " " + s);
1199
- var Y = m && c === void 0 ? wr(L) : f, P = {};
1200
- for (var y in v)
1201
- m && y === "as" || Y(y) && (P[y] = v[y]);
1202
- return P.className = F, b && (P.ref = b), /* @__PURE__ */ xe.createElement(xe.Fragment, null, /* @__PURE__ */ xe.createElement($t, {
1203
- cache: w,
1204
- serialized: J,
1205
- isStringTag: typeof L == "string"
1206
- }), /* @__PURE__ */ xe.createElement(L, P));
1196
+ typeof m.className == "string" ? z = nt(v.registered, N, m.className) : m.className != null && (z = m.className + " ");
1197
+ var K = ut(h.concat(N), v.registered, A);
1198
+ z += v.key + "-" + K.name, s !== void 0 && (z += " " + s);
1199
+ var M = u && c === void 0 ? rr(O) : f, q = {};
1200
+ for (var T in m)
1201
+ u && T === "as" || M(T) && (q[T] = m[T]);
1202
+ return q.className = z, x && (q.ref = x), /* @__PURE__ */ ne.createElement(ne.Fragment, null, /* @__PURE__ */ ne.createElement(xt, {
1203
+ cache: v,
1204
+ serialized: K,
1205
+ isStringTag: typeof O == "string"
1206
+ }), /* @__PURE__ */ ne.createElement(O, q));
1207
1207
  });
1208
- return h.displayName = t !== void 0 ? t : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", h.defaultProps = r.defaultProps, h.__emotion_real = h, h.__emotion_base = a, h.__emotion_styles = p, h.__emotion_forwardProp = c, Object.defineProperty(h, "toString", {
1208
+ return y.displayName = i !== void 0 ? i : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", y.defaultProps = r.defaultProps, y.__emotion_real = y, y.__emotion_base = a, y.__emotion_styles = h, y.__emotion_forwardProp = c, Object.defineProperty(y, "toString", {
1209
1209
  value: function() {
1210
1210
  return "." + s;
1211
1211
  }
1212
- }), h.withComponent = function(v, w) {
1213
- var b = e(v, tr({}, n, w, {
1214
- shouldForwardProp: br(h, w, !0)
1212
+ }), y.withComponent = function(m, v) {
1213
+ var x = e(m, Me({}, t, v, {
1214
+ shouldForwardProp: tr(y, v, !0)
1215
1215
  }));
1216
- return b.apply(void 0, p);
1217
- }, h;
1216
+ return x.apply(void 0, h);
1217
+ }, y;
1218
1218
  };
1219
- }, Ft = [
1219
+ }, _t = [
1220
1220
  "a",
1221
1221
  "abbr",
1222
1222
  "address",
@@ -1352,11 +1352,11 @@ var Ct = function(r) {
1352
1352
  "svg",
1353
1353
  "text",
1354
1354
  "tspan"
1355
- ], Ae = Nt.bind(null);
1356
- Ft.forEach(function(e) {
1357
- Ae[e] = Ae(e);
1355
+ ], de = Pt.bind(null);
1356
+ _t.forEach(function(e) {
1357
+ de[e] = de(e);
1358
1358
  });
1359
- const Dt = Ae.div`
1359
+ const wt = de.div`
1360
1360
  display: flex;
1361
1361
  align-items: center;
1362
1362
  justify-content: center;
@@ -1397,11 +1397,11 @@ const Dt = Ae.div`
1397
1397
  return "";
1398
1398
  }
1399
1399
  }}
1400
- `, ar = ({ type: e, children: r, className: n, icon: i, action: a }) => /* @__PURE__ */ Z.jsxs(Dt, { type: e, className: n, children: [
1401
- i && /* @__PURE__ */ Z.jsx("span", { children: i }),
1402
- /* @__PURE__ */ Z.jsx("span", { children: r }),
1403
- a && /* @__PURE__ */ Z.jsx("span", { children: a })
1404
- ] }), _r = Ae.div`
1400
+ `, Ie = ({ type: e, children: r, className: t, icon: n, action: a }) => /* @__PURE__ */ L.jsxs(wt, { type: e, className: t, children: [
1401
+ n && /* @__PURE__ */ L.jsx("span", { children: n }),
1402
+ /* @__PURE__ */ L.jsx("span", { children: r }),
1403
+ a && /* @__PURE__ */ L.jsx("span", { children: a })
1404
+ ] }), nr = de.div`
1405
1405
  width: ${({ width: e }) => e || "100%"};
1406
1406
  height: ${({ height: e }) => e || "100%"};
1407
1407
  border-radius: 0px !important; /* Force remove rounded corners on container */
@@ -1413,7 +1413,7 @@ const Dt = Ae.div`
1413
1413
 
1414
1414
  /* Hide specific elements inside the player */
1415
1415
  ${({ $hiddenClasses: e }) => (e == null ? void 0 : e.length) && e.map((r) => `.${r} { display: none !important; }`).join("")}
1416
- `, Mt = Ae.div`
1416
+ `, Et = de.div`
1417
1417
  position: fixed;
1418
1418
  top: 0;
1419
1419
  left: 0;
@@ -1425,949 +1425,709 @@ const Dt = Ae.div`
1425
1425
  align-items: center;
1426
1426
  z-index: 1000;
1427
1427
  pointer-events: auto;
1428
- `, zt = Ae.div`
1428
+ `, kt = de.div`
1429
1429
  position: relative;
1430
- max-width: 100vw;
1430
+ height: 80vh;
1431
+ width: auto;
1431
1432
  aspect-ratio: 9 / 16;
1432
- height: auto;
1433
+ max-width: 90vw;
1434
+ max-height: 90vh;
1433
1435
  z-index: 1001;
1434
- max-height: 100vh;
1435
- `, Bt = (e, r) => `https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${r}`, Ut = (e) => `https://host.vpplayer.tech/playlist/${e}`, qt = (e) => `https://host.vpplayer.tech/player/${e}/vpplayer.js`, cr = (e, r) => `vp-player-${e || "default"}-${r || ""}`, Ze = /* @__PURE__ */ new Map(), Wt = (e, r) => {
1436
- const [n, i] = de(!1), [a, t] = de(null);
1437
- return Se(() => {
1438
- let s = null, c, f = 0;
1439
- const m = 3;
1440
- let u;
1436
+ `, vr = "https://host.vpplayer.tech", St = (e) => `${vr}/player/${e}/vpplayer.js`, gr = (e, r) => e ? `vp-player-${e}` : r ? `vp-player-default-${r}` : "vp-player-default", Se = /* @__PURE__ */ new Map(), Rt = (e, r) => {
1437
+ const [t, n] = ce(!1), [a, i] = ce(null);
1438
+ return Fe(() => {
1439
+ let s;
1441
1440
  try {
1442
- u = r || qt(e || "latest");
1443
- } catch (g) {
1444
- const E = g instanceof Error ? g.message : String(g);
1445
- t(`Failed to resolve script URL: ${E}`), i(!1);
1446
- return;
1447
- }
1448
- if (Ze.get(u)) {
1449
- i(!0), t(null);
1450
- return;
1451
- }
1452
- if (document.querySelector(`script[src="${u}"]`)) {
1453
- Ze.set(u, !0), i(!0), t(null);
1441
+ s = r || St(e || "latest");
1442
+ } catch (u) {
1443
+ const d = u instanceof Error ? u.message : String(u);
1444
+ i(`Failed to resolve script URL: ${d}`);
1454
1445
  return;
1455
1446
  }
1456
- const x = () => {
1457
- s = document.createElement("script"), s.src = u, s.async = !0, c = window.setTimeout(() => {
1458
- i(!1), t(`Loading script timed out: ${u}`);
1459
- }, 1e4), s.onload = () => {
1460
- clearTimeout(c), Ze.set(u, !0), i(!0), t(null);
1461
- }, s.onerror = () => {
1462
- clearTimeout(c), f++, f < m ? setTimeout(x, 1e3 * f) : (i(!1), t(`Failed to load VP Player script after ${m} attempts: ${u}`));
1463
- }, document.body.appendChild(s);
1464
- };
1465
- return x(), () => {
1466
- clearTimeout(c), s && document.body.contains(s) && document.body.removeChild(s);
1467
- };
1468
- }, [e, r]), { isLoaded: n, error: a };
1469
- }, Be = /* @__PURE__ */ new Map(), Yt = 3e4, er = 5, Ht = ({
1470
- projectId: e,
1471
- videoId: r,
1472
- playlistId: n,
1473
- videoUrl: i
1474
- }) => {
1475
- const [a, t] = de(null), [s, c] = de(null), [f, m] = de(!1), [u, p] = de(null);
1476
- return Se(() => {
1477
- const x = r ? `video:${r}` : n ? `playlist:${n}` : null;
1478
- if (i || !r && !n) {
1479
- t(i || null), c(null), m(!1), p(null);
1480
- return;
1481
- }
1482
- if (r && !e) {
1483
- m(!1), p("projectId is required for single video fetch");
1484
- return;
1485
- }
1486
- if (x && Be.has(x)) {
1487
- const b = Be.get(x);
1488
- t(b.url), c(b.playlist), m(!1), p(null);
1489
- return;
1490
- }
1491
- let g = !0;
1492
- const E = new AbortController(), h = E.signal, w = setTimeout(async () => {
1493
- var L, F;
1494
- if (!g)
1495
- return;
1496
- m(!0), p(null);
1497
- let b = 0;
1498
- for (; b < er && g; )
1499
- try {
1500
- const k = r && !n ? Bt(e, r) : Ut(n), I = setTimeout(() => E.abort(), Yt), J = await fetch(k, {
1501
- method: "GET",
1502
- headers: {
1503
- Accept: "application/json",
1504
- "Cache-Control": "no-cache"
1505
- },
1506
- signal: h
1507
- });
1508
- if (clearTimeout(I), !J.ok)
1509
- throw new Error(`Fetch failed with status ${J.status}`);
1510
- const Y = await J.json();
1511
- if (!g)
1512
- return;
1513
- if (r && !n) {
1514
- const P = (F = (L = Y.result) == null ? void 0 : L.items) == null ? void 0 : F.find((y) => y.mediaId === r);
1515
- if (!(P != null && P.playbackUrl)) throw new Error("Invalid video data");
1516
- t(P.playbackUrl), c(null), x && Be.set(x, { url: P.playbackUrl, playlist: null });
1517
- } else {
1518
- const P = Y.videos;
1519
- if (!Array.isArray(P))
1520
- throw new Error("Invalid playlist format");
1521
- c(P), t(null), x && Be.set(x, { url: null, playlist: P });
1522
- }
1523
- break;
1524
- } catch (k) {
1525
- if (h.aborted) {
1526
- g && p("Request timed out");
1527
- break;
1528
- }
1529
- if (b++, b >= er) {
1530
- const I = k instanceof Error ? k.message : String(k);
1531
- g && p(`Failed after ${er} attempts: ${I}`);
1532
- } else
1533
- await new Promise((I) => setTimeout(I, 2e3));
1534
- }
1535
- g && m(!1);
1536
- }, 100);
1537
- return () => {
1538
- g = !1, clearTimeout(w), E.abort();
1539
- };
1540
- }, [e, r, n, i]), { fetchedPlaybackUrl: a, fetchedPlaylist: s, isLoading: f, error: u };
1541
- }, Gt = ({
1542
- playerId: e,
1543
- playerInstanceRef: r,
1544
- playerRef: n,
1545
- videoData: i,
1546
- trackingMetadata: a,
1547
- callbacks: t
1548
- }) => {
1549
- const s = K(!1), c = K(!1), f = K(!1), m = K(0), u = K({}), p = K(null), x = K(null), g = K(null), E = K(null), h = K(!1), v = K(!1);
1550
- Se(() => {
1551
- if (!(t && (t.onPlayerStart || t.onPlayerPlay || t.onPlayerPause || t.onPlayerResume || t.onPlayerEnd || t.onPlayerProgressEvery10Seconds || t.onPlayerProgressAt20Seconds || t.onPlayerQuartile25 || t.onPlayerQuartile50 || t.onPlayerQuartile75 || t.onPlayerNext || t.onPlayerPrevious || t.onPlayerEvent)))
1552
- return;
1553
- const b = () => {
1554
- s.current = !1, c.current = !1, f.current = !1, m.current = 0, u.current = {};
1555
- }, L = () => {
1556
- var B;
1557
- const y = document.getElementById(e);
1558
- if (!y) return null;
1559
- if (y.querySelectorAll("video").length > 1 && r.current) {
1560
- const U = r.current, M = U.videoIndex ?? ((B = U.playlist) == null ? void 0 : B.playlistVideoIndex) ?? 0, j = y.querySelector(`video[id="${M}"]`);
1561
- if (j)
1562
- return j;
1563
- const z = y.querySelector("video.active");
1564
- if (z)
1565
- return z;
1566
- }
1567
- return y.querySelector("video");
1568
- }, F = () => {
1569
- const y = L();
1570
- if (!y)
1571
- return !1;
1572
- const S = (l, d) => {
1573
- var H, fe, V, ee, pe, ne, _e, De, ce, we, ve, Je, Qe, ke;
1574
- const $ = Date.now();
1575
- if (!(l === "player_start" && s.current)) {
1576
- switch (E.current = { type: l, time: $ }, l) {
1577
- case "player_start":
1578
- (H = t.onPlayerStart) == null || H.call(t, l);
1579
- break;
1580
- case "player_play":
1581
- (fe = t.onPlayerPlay) == null || fe.call(t, l);
1582
- break;
1583
- case "player_pause":
1584
- (V = t.onPlayerPause) == null || V.call(t, l);
1585
- break;
1586
- case "player_resume":
1587
- (ee = t.onPlayerResume) == null || ee.call(t, l);
1588
- break;
1589
- case "player_end":
1590
- (pe = t.onPlayerEnd) == null || pe.call(t, l);
1591
- break;
1592
- case "player_progress_every_10_seconds":
1593
- d !== void 0 && ((ne = t.onPlayerProgressEvery10Seconds) == null || ne.call(t, l, d));
1594
- break;
1595
- case "player_progress_at_20_seconds":
1596
- d !== void 0 && ((_e = t.onPlayerProgressAt20Seconds) == null || _e.call(t, l, d));
1597
- break;
1598
- case "player_quartile_25":
1599
- d !== void 0 && ((De = t.onPlayerQuartile25) == null || De.call(t, l, d));
1600
- break;
1601
- case "player_quartile_50":
1602
- d !== void 0 && ((ce = t.onPlayerQuartile50) == null || ce.call(t, l, d));
1603
- break;
1604
- case "player_quartile_75":
1605
- d !== void 0 && ((we = t.onPlayerQuartile75) == null || we.call(t, l, d));
1606
- break;
1607
- case "player_next":
1608
- (ve = t.onPlayerNext) == null || ve.call(t, l);
1609
- break;
1610
- case "player_previous":
1611
- (Je = t.onPlayerPrevious) == null || Je.call(t, l);
1612
- break;
1613
- }
1614
- d !== void 0 && (l === "player_progress_every_10_seconds" || l === "player_progress_at_20_seconds" || l === "player_quartile_25" || l === "player_quartile_50" || l === "player_quartile_75") ? (Qe = t.onPlayerEvent) == null || Qe.call(t, l, d) : (ke = t.onPlayerEvent) == null || ke.call(t, l);
1615
- }
1616
- }, B = () => L() === y, U = () => {
1617
- h.current || B() && (s.current || (S("player_start"), s.current = !0));
1618
- }, M = () => {
1619
- h.current || B() && (s.current || (S("player_start"), s.current = !0), f.current ? S("player_resume") : c.current && v.current ? (S("player_play"), v.current = !1) : c.current || (S("player_play"), c.current = !0), f.current = !1);
1620
- }, j = () => {
1621
- y.ended || h.current || setTimeout(() => {
1622
- var l;
1623
- if (!h.current) {
1624
- if (r.current && x.current !== null) {
1625
- const d = r.current;
1626
- if ((d.videoIndex ?? ((l = d.playlist) == null ? void 0 : l.playlistVideoIndex) ?? 0) !== x.current)
1627
- return;
1628
- }
1629
- S("player_pause"), f.current = !0;
1630
- }
1631
- }, 200);
1632
- }, z = () => {
1633
- S("player_end");
1634
- }, O = () => {
1635
- if (h.current) return;
1636
- const l = y.duration > 0 ? y.currentTime / y.duration * 100 : 0, d = Math.floor(y.currentTime);
1637
- d - m.current >= 10 && (m.current = d, S("player_progress_every_10_seconds", d)), d >= 20 && !u.current[20] && (u.current[20] = !0, S("player_progress_at_20_seconds", d)), l >= 25 && !u.current[25] && (u.current[25] = !0, S("player_quartile_25", d)), l >= 50 && !u.current[50] && (u.current[50] = !0, S("player_quartile_50", d)), l >= 75 && !u.current[75] && (u.current[75] = !0, S("player_quartile_75", d));
1638
- }, Q = () => {
1639
- v.current = !0;
1640
- };
1641
- if (g.current && g.current !== y) {
1642
- const l = g.current;
1643
- l.removeEventListener("loadedmetadata", U), l.removeEventListener("play", M), l.removeEventListener("pause", j), l.removeEventListener("ended", z), l.removeEventListener("timeupdate", O), l.removeEventListener("seeking", Q);
1447
+ if (!Se.has(s))
1448
+ if (document.querySelector(
1449
+ `script[src="${s}"]`
1450
+ ))
1451
+ Se.set(s, Promise.resolve());
1452
+ else {
1453
+ const d = new Promise((h, C) => {
1454
+ const E = document.createElement("script");
1455
+ E.src = s, E.async = !0, E.onload = () => h(), E.onerror = () => C(new Error(`Failed to load script: ${s}`)), document.body.appendChild(E);
1456
+ });
1457
+ Se.set(s, d);
1644
1458
  }
1645
- g.current = y, y.addEventListener("loadedmetadata", U), y.addEventListener("play", M), y.addEventListener("pause", j), y.addEventListener("ended", z), y.addEventListener("timeupdate", O), y.addEventListener("seeking", Q), y.readyState >= 1 && U(), !y.paused && y.currentTime > 0 && !c.current && (s.current || U(), M());
1646
- const q = document.getElementById(e), o = (l) => {
1647
- const d = l.target;
1648
- (d.closest(".vp-next") || d.closest(".vrt-icon-down") || d.closest(".vrt-arrow.vrt-icon-down")) && (h.current = !0, S("player_next"), b(), setTimeout(() => {
1649
- h.current = !1;
1650
- }, 500)), (d.closest(".vp-prev") || d.closest(".vp-previous") || d.closest(".vrt-icon-up") || d.closest(".vrt-arrow.vrt-icon-up")) && (h.current = !0, S("player_previous"), b(), setTimeout(() => {
1651
- h.current = !1;
1652
- }, 500));
1653
- };
1654
- return q && q.addEventListener("click", o, !0), p.current = () => {
1655
- const l = g.current || y;
1656
- l.removeEventListener("loadedmetadata", U), l.removeEventListener("play", M), l.removeEventListener("pause", j), l.removeEventListener("ended", z), l.removeEventListener("timeupdate", O), l.removeEventListener("seeking", Q), q == null || q.removeEventListener("click", o, !0), g.current = null;
1657
- }, !0;
1658
- };
1659
- let k = null, I = !1;
1660
- const _ = () => {
1661
- if (!r.current) return;
1662
- const y = r.current, S = document.getElementById(e), B = S == null ? void 0 : S.querySelectorAll("video");
1663
- B && B.length > 1 && y.videoIndex !== void 0 && (k = window.setInterval(() => {
1664
- var M, j, z, O;
1665
- try {
1666
- const Q = y.videoIndex ?? ((M = y.playlist) == null ? void 0 : M.playlistVideoIndex) ?? 0;
1667
- if (x.current !== null && Q !== x.current) {
1668
- const q = Q > x.current, o = q ? "player_next" : "player_previous";
1669
- t && !h.current && (q ? (j = t.onPlayerNext) == null || j.call(t, o) : (z = t.onPlayerPrevious) == null || z.call(t, o), (O = t.onPlayerEvent) == null || O.call(t, o)), h.current = !0, p.current && (p.current(), p.current = null), s.current = !1, c.current = !1, f.current = !1, m.current = 0, u.current = {}, g.current = null, v.current = !1, setTimeout(() => {
1670
- F(), setTimeout(() => {
1671
- h.current = !1;
1672
- }, 200);
1673
- }, 100);
1674
- }
1675
- x.current = Q;
1676
- } catch {
1677
- }
1678
- }, 500));
1679
- };
1680
- let J = 0;
1681
- const Y = 20, P = setInterval(() => {
1682
- J++, F() && !I ? (I = !0, clearInterval(P), setTimeout(() => {
1683
- _();
1684
- }, 1e3)) : J >= Y && clearInterval(P);
1685
- }, 500);
1686
- return () => {
1687
- clearInterval(P), k !== null && (clearInterval(k), k = null), p.current && (p.current(), p.current = null);
1459
+ let c = !0;
1460
+ const f = Se.get(s);
1461
+ return f && f.then(() => {
1462
+ c && (n(!0), i(null));
1463
+ }).catch((u) => {
1464
+ c && (n(!1), i(u instanceof Error ? u.message : String(u)));
1465
+ }), () => {
1466
+ c = !1;
1688
1467
  };
1689
- }, [
1690
- e,
1691
- i,
1692
- a,
1693
- t,
1694
- r,
1695
- n
1696
- ]);
1697
- }, Xt = {
1698
- projectId: "vp-player-projectId",
1699
- // this is used only if prop projectId is not provided
1468
+ }, [e, r]), { isLoaded: t, error: a };
1469
+ }, Re = {
1470
+ projectId: void 0,
1471
+ // Set via props or config
1700
1472
  video: {
1701
- file: "",
1702
- // Will be set dynamically if no playlist
1703
- playlist: {
1704
- state: !0,
1705
- // Enable playlist by default
1706
- // If we have a playlist, we start with the first video, if any issue check value, should
1707
- playlistVideoIndex: 0,
1708
- // Start with the first video
1709
- videos: []
1710
- // Empty by default, populated via props
1711
- }
1473
+ // NOTE: Do NOT set file: '' here - it interferes with managed mode
1474
+ // where the SDK resolves the video URL from videoId + projectId
1712
1475
  },
1713
1476
  config: {
1714
1477
  autoplay: !0,
1715
1478
  // Start playing automatically
1716
1479
  muted: !0,
1717
- // Start muted
1480
+ // Start muted (required for browser autoplay policy)
1718
1481
  loop: !1,
1719
1482
  // No loop by default
1720
1483
  size: {
1721
1484
  width: "100%",
1722
- // Width
1723
1485
  height: "30vh"
1724
- // Height
1725
- },
1726
- controls: {
1727
- settingsButton: !0,
1728
- // Settings button
1729
- chromecastButton: !1,
1730
- // Chromecast button, false by default
1731
- nextButton: !0,
1732
- // False by default (single video, no playlist)
1733
- fullscreenButton: !0,
1734
- // Fullscreen option
1735
- airplayButton: !1,
1736
- // False by default
1737
- bigPlayButton: !1,
1738
- // False by default
1739
- autopausePlayButton: !0,
1740
- // Basic play/pause control enabled
1741
- pictureInPictureButton: !1,
1742
- // False by default
1743
- relatedButton: !1,
1744
- // False by default (single video)
1745
- volumeButton: !0,
1746
- // Volume control
1747
- shareButton: !0
1748
- // Enabled by default
1749
1486
  }
1487
+ // NOTE: Do NOT set controls here - let the SDK/managed script
1488
+ // use what's configured in the Gjirafa admin panel (projectId config)
1750
1489
  }
1751
- }, Ie = "vp-player-project", Jt = ({
1490
+ }, Ct = (e) => e ? {
1491
+ play: e.bigPlayButton ?? e.autopausePlayButton ?? !0,
1492
+ fullscreen: e.fullscreenButton ?? !0,
1493
+ share: e.shareButton ?? !0,
1494
+ seekbar: !0,
1495
+ settings: e.settingsButton ?? !0,
1496
+ time: !0
1497
+ } : {
1498
+ play: !0,
1499
+ fullscreen: !0,
1500
+ share: !0,
1501
+ seekbar: !0,
1502
+ settings: !0,
1503
+ time: !0
1504
+ }, At = ({
1752
1505
  videoUrl: e,
1753
- fetchedPlaybackUrl: r,
1754
- fetchedPlaylist: n,
1755
- projectId: i,
1756
- config: a = {},
1757
- isVerticalPlayer: t
1758
- // Distinguish between VP Player types
1506
+ projectId: r,
1507
+ config: t = {},
1508
+ isVerticalPlayer: n = !1
1759
1509
  }) => {
1760
- var u, p, x, g, E, h, v, w, b, L, F, k, I, _, J, Y, P, y, S, B, U, M;
1761
- const s = { ...Xt, ...a }, c = { ...s.config, ...a.config };
1762
- if (e)
1510
+ var h, C, E, k, y, m, v, x, O, z, N, A, g, K, M, q, T;
1511
+ const a = { ...Re };
1512
+ a.video = { ...Re.video, ...t.video };
1513
+ let i = {
1514
+ ...Re.config,
1515
+ ...t.config,
1516
+ // Only include controls if explicitly provided by user config
1517
+ // Otherwise, let SDK use what's configured in the admin panel (projectId config)
1518
+ ...((h = t.config) == null ? void 0 : h.controls) && {
1519
+ controls: t.config.controls
1520
+ },
1521
+ // Ensure size is merged
1522
+ size: {
1523
+ ...Re.config.size,
1524
+ ...(C = t.config) == null ? void 0 : C.size
1525
+ }
1526
+ };
1527
+ if (r && (a.projectId = r), t.projectId && (a.projectId = t.projectId), n && i.controls) {
1528
+ const j = Ct(
1529
+ i.controls
1530
+ );
1531
+ i = {
1532
+ ...i,
1533
+ controls: j
1534
+ };
1535
+ }
1536
+ const s = !!((k = (E = t == null ? void 0 : t.video) == null ? void 0 : E.playlist) != null && k.playlistId), c = !!((v = (m = (y = t == null ? void 0 : t.video) == null ? void 0 : y.playlist) == null ? void 0 : m.videos) != null && v.length), f = s || c, u = (x = t == null ? void 0 : t.video) == null ? void 0 : x.playlist;
1537
+ if (n && f) {
1538
+ const j = Number((u == null ? void 0 : u.playlistVideoIndex) || 0);
1539
+ if ((O = u == null ? void 0 : u.videos) != null && O.length) {
1540
+ const S = u.videos[j] || u.videos[0], G = e || ((z = t == null ? void 0 : t.video) == null ? void 0 : z.file) || (S == null ? void 0 : S.file) || (S == null ? void 0 : S.hlsUrl), V = u.videos.map((H) => {
1541
+ const U = H;
1542
+ return {
1543
+ videoId: U.videoId || "",
1544
+ title: U.title || "",
1545
+ file: U.file || U.hlsUrl || "",
1546
+ thumbnailUrl: U.thumbnailUrl || U.thumbnail || "",
1547
+ duration: U.duration || 0
1548
+ };
1549
+ });
1550
+ return {
1551
+ ...a,
1552
+ projectId: r || t.projectId || "",
1553
+ // Use top-level projectId if available
1554
+ video: {
1555
+ ...a.video,
1556
+ videoId: (S == null ? void 0 : S.videoId) || "",
1557
+ file: G,
1558
+ title: ((N = t.video) == null ? void 0 : N.title) || (S == null ? void 0 : S.title),
1559
+ thumbnail: ((A = t.video) == null ? void 0 : A.thumbnail) || (S == null ? void 0 : S.thumbnailUrl),
1560
+ playlist: {
1561
+ state: !0,
1562
+ playlistId: "",
1563
+ // Empty string - required for manual playlist mode
1564
+ playlistVideoIndex: j,
1565
+ videos: V
1566
+ }
1567
+ },
1568
+ config: i
1569
+ };
1570
+ }
1763
1571
  return {
1764
- ...s,
1765
- projectId: i || Ie,
1572
+ ...a,
1573
+ projectId: r || t.projectId || "",
1574
+ // Use top-level projectId if available
1766
1575
  video: {
1767
- ...s.video,
1768
- file: e,
1769
- playlist: void 0
1576
+ ...a.video,
1577
+ file: e || ((g = t.video) == null ? void 0 : g.file),
1578
+ // Use provided videoUrl as fallback/primary file
1579
+ playlist: {
1580
+ state: !0,
1581
+ playlistId: u == null ? void 0 : u.playlistId,
1582
+ playlistVideoIndex: j
1583
+ }
1770
1584
  },
1771
- config: c
1585
+ config: i
1772
1586
  };
1773
- if (r)
1587
+ }
1588
+ if (e && !f)
1774
1589
  return {
1775
- ...s,
1776
- projectId: i || Ie,
1590
+ ...a,
1777
1591
  video: {
1778
- ...s.video,
1779
- file: r,
1592
+ ...a.video,
1593
+ ...t.video,
1594
+ file: e,
1780
1595
  playlist: void 0
1781
1596
  },
1782
- config: c
1597
+ config: i
1783
1598
  };
1784
- if (n && n.length > 0) {
1785
- const j = ((p = (u = a == null ? void 0 : a.video) == null ? void 0 : u.playlist) == null ? void 0 : p.playlistVideoIndex) ?? ((x = a == null ? void 0 : a.config) == null ? void 0 : x.playlistVideoIndex) ?? 0;
1786
- return t ? {
1787
- ...s,
1788
- projectId: i || Ie,
1599
+ if (f && u)
1600
+ return {
1601
+ ...a,
1789
1602
  video: {
1790
- ...s.video,
1791
- // Set first video file (index 0) to avoid VP Player duplication
1792
- videoId: (g = n[0]) == null ? void 0 : g.mediaId,
1793
- // Add videoId for tracking
1794
- file: (E = n[0]) == null ? void 0 : E.hlsUrl,
1795
- title: (h = n[0]) == null ? void 0 : h.title,
1796
- // thumbnail: fetchedPlaylist[0]?.thumbnailUrl,
1603
+ ...a.video,
1604
+ ...t.video,
1605
+ // For horizontal player, file can be omitted - SDK handles it
1606
+ file: (K = t.video) == null ? void 0 : K.file,
1797
1607
  playlist: {
1608
+ ...a.video.playlist,
1609
+ ...u,
1798
1610
  state: !0,
1799
- playlistId: "",
1800
- // Will be set by API
1801
- // Use original playlistVideoIndex - VP Player will navigate to it
1802
- playlistVideoIndex: Number(j),
1803
- // Remove first video from playlist to avoid duplication (already in file)
1804
- videos: n.slice(1).map((O, Q) => ({
1805
- videoId: O.mediaId || String(Q + 1),
1806
- // Use mediaId if available
1807
- title: O.title,
1808
- file: O.hlsUrl,
1809
- thumbnailUrl: O.thumbnailUrl,
1810
- duration: O.duration
1811
- }))
1611
+ playlistVideoIndex: Number(u.playlistVideoIndex || 0)
1812
1612
  }
1813
1613
  },
1814
- config: c
1815
- } : {
1816
- ...s,
1817
- projectId: i || Ie,
1614
+ config: i
1615
+ };
1616
+ const d = ((M = t == null ? void 0 : t.video) == null ? void 0 : M.videoId) || (t == null ? void 0 : t.videoId);
1617
+ if (d) {
1618
+ const j = (q = t.video) == null ? void 0 : q.file, S = j && j.trim() !== "", G = r || t.projectId || a.projectId;
1619
+ let V;
1620
+ return S ? V = j : G && d && (V = `https://cdn.vpplayer.tech/${G}/encode/${d}/hls/master_file.m3u8`), {
1621
+ projectId: G,
1622
+ videoId: d,
1818
1623
  video: {
1819
- ...s.video,
1820
- videoId: ((v = n[Number(j)]) == null ? void 0 : v.mediaId) || ((w = n[0]) == null ? void 0 : w.mediaId),
1821
- // Add videoId for tracking
1822
- file: ((b = n[Number(j)]) == null ? void 0 : b.hlsUrl) || ((L = n[0]) == null ? void 0 : L.hlsUrl) || "",
1823
- title: ((F = n[Number(j)]) == null ? void 0 : F.title) || ((k = n[0]) == null ? void 0 : k.title),
1824
- thumbnail: ((I = n[Number(j)]) == null ? void 0 : I.thumbnailUrl) || ((_ = n[0]) == null ? void 0 : _.thumbnailUrl),
1825
- playlist: {
1826
- state: !0,
1827
- // playlistVideoIndex: String(userPlaylistVideoIndex), this has been bug, fixed, now int
1828
- playlistVideoIndex: Number(j),
1829
- videos: n.map((O, Q) => ({
1830
- videoId: O.mediaId || String(Q),
1831
- // Use mediaId if available
1832
- title: O.title,
1833
- file: O.hlsUrl,
1834
- thumbnailUrl: O.thumbnailUrl,
1835
- duration: O.duration
1836
- }))
1837
- }
1624
+ ...t.video,
1625
+ // Only user's explicit video config
1626
+ videoId: d,
1627
+ file: V
1838
1628
  },
1839
- config: c
1629
+ // Only include config if user explicitly provided overrides
1630
+ ...t.config && { config: t.config }
1840
1631
  };
1841
1632
  }
1842
- const f = ((J = a == null ? void 0 : a.video) == null ? void 0 : J.playlist) || s.video.playlist, m = (Y = a == null ? void 0 : a.video) == null ? void 0 : Y.file;
1843
- if (m)
1633
+ if ((T = t == null ? void 0 : t.video) != null && T.file)
1844
1634
  return {
1845
- ...s,
1846
- projectId: i || Ie,
1635
+ ...a,
1847
1636
  video: {
1848
- ...s.video,
1849
- file: m,
1637
+ ...a.video,
1638
+ ...t.video,
1639
+ file: t.video.file,
1850
1640
  playlist: void 0
1851
- // No playlist, just one video
1852
- },
1853
- config: c
1854
- };
1855
- if (f != null && f.videos && f.videos.length > 0) {
1856
- const j = ((y = (P = a == null ? void 0 : a.video) == null ? void 0 : P.playlist) == null ? void 0 : y.playlistVideoIndex) ?? ((S = a == null ? void 0 : a.config) == null ? void 0 : S.playlistVideoIndex) ?? 0;
1857
- return {
1858
- ...s,
1859
- projectId: i || Ie,
1860
- video: {
1861
- ...s.video,
1862
- videoId: (B = f.videos[0]) == null ? void 0 : B.videoId,
1863
- file: ((U = f.videos[0]) == null ? void 0 : U.file) || "",
1864
- title: (M = f.videos[0]) == null ? void 0 : M.title,
1865
- playlist: {
1866
- state: !0,
1867
- playlistId: "",
1868
- playlistVideoIndex: Number(j),
1869
- videos: f.videos
1870
- }
1871
1641
  },
1872
- config: c
1642
+ config: i
1873
1643
  };
1874
- }
1875
1644
  throw new Error(
1876
1645
  "No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist."
1877
1646
  );
1878
- }, Qt = (e) => {
1879
- if (!e) return;
1880
- const r = /https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/, n = e.match(r);
1881
- return n ? n[2] : void 0;
1882
- }, Kt = ({
1647
+ }, Tt = (e) => {
1648
+ if (!e || e.includes("vertical-player") || e.includes("vpverticalplayer"))
1649
+ return;
1650
+ const r = vr.replace(
1651
+ /[.*+?^${}()|[\]\\]/g,
1652
+ "\\$&"
1653
+ ), t = new RegExp(
1654
+ `${r}\\/player\\/([^/]+)\\/([^/]+)(?:\\/[^/]+)?\\.js`
1655
+ ), n = e.match(t);
1656
+ if (n)
1657
+ return n[2];
1658
+ }, It = ({
1883
1659
  playerId: e,
1884
1660
  videoId: r,
1885
- version: n,
1886
- videoUrl: i,
1661
+ version: t,
1662
+ videoUrl: n,
1887
1663
  projectId: a,
1888
- playlistId: t,
1664
+ playlistId: i,
1889
1665
  scriptUrl: s,
1890
1666
  config: c = {},
1891
1667
  isReels: f = !1,
1892
- onPlaylistData: m,
1893
- onVideoStarted: u,
1894
- trackingMetadata: p,
1895
- onPlayerStart: x,
1896
- onPlayerPlay: g,
1668
+ onPlaylistData: u,
1669
+ onVideoStarted: d,
1670
+ onPlayerStart: h,
1671
+ onPlayerPlay: C,
1897
1672
  onPlayerPause: E,
1898
- onPlayerResume: h,
1899
- onPlayerEnd: v,
1900
- onPlayerProgressEvery10Seconds: w,
1901
- onPlayerProgressAt20Seconds: b,
1902
- onPlayerQuartile25: L,
1903
- onPlayerQuartile50: F,
1904
- onPlayerQuartile75: k,
1905
- onPlayerNext: I,
1906
- onPlayerPrevious: _,
1907
- onPlayerEvent: J
1673
+ onPlayerResume: k,
1674
+ onPlayerEnd: y,
1675
+ onPlayerProgressEvery10Seconds: m,
1676
+ onPlayerProgressAt20Seconds: v,
1677
+ onPlayerQuartile25: x,
1678
+ onPlayerQuartile50: O,
1679
+ onPlayerQuartile75: z,
1680
+ onPlayerNext: N,
1681
+ onPlayerPrevious: A,
1682
+ onPlayerEvent: g
1908
1683
  }) => {
1909
- const Y = K(null), P = K(null), y = K(!1), S = K(""), B = K([]), U = K([]), M = K(null), { isLoaded: j, error: z } = Wt(
1910
- n,
1911
- s
1912
- ), O = r || Qt(s), [Q, q] = de(null), {
1913
- fetchedPlaybackUrl: o,
1914
- fetchedPlaylist: l,
1915
- isLoading: d,
1916
- error: $
1917
- } = Ht({
1918
- projectId: a,
1919
- videoId: O,
1920
- playlistId: t,
1921
- videoUrl: i
1922
- }), H = cr(e, O), [fe, V] = de(void 0);
1923
- Se(() => {
1924
- l && m && m(l);
1925
- }, [l, m]), Gt({
1926
- playerId: H,
1927
- playerInstanceRef: P,
1928
- playerRef: Y,
1929
- videoData: fe,
1930
- trackingMetadata: p,
1931
- callbacks: {
1932
- onPlayerStart: x,
1933
- onPlayerPlay: g,
1684
+ var o;
1685
+ const K = he(null), M = he(null), q = he(!1), T = he({
1686
+ onVideoStarted: d,
1687
+ onPlaylistData: u,
1688
+ onPlayerStart: h,
1689
+ onPlayerPlay: C,
1690
+ onPlayerPause: E,
1691
+ onPlayerResume: k,
1692
+ onPlayerEnd: y,
1693
+ onPlayerProgressEvery10Seconds: m,
1694
+ onPlayerProgressAt20Seconds: v,
1695
+ onPlayerQuartile25: x,
1696
+ onPlayerQuartile50: O,
1697
+ onPlayerQuartile75: z,
1698
+ onPlayerNext: N,
1699
+ onPlayerPrevious: A,
1700
+ onPlayerEvent: g
1701
+ });
1702
+ Fe(() => {
1703
+ T.current = {
1704
+ onVideoStarted: d,
1705
+ onPlaylistData: u,
1706
+ onPlayerStart: h,
1707
+ onPlayerPlay: C,
1934
1708
  onPlayerPause: E,
1935
- onPlayerResume: h,
1936
- onPlayerEnd: v,
1937
- onPlayerProgressEvery10Seconds: w,
1938
- onPlayerProgressAt20Seconds: b,
1939
- onPlayerQuartile25: L,
1940
- onPlayerQuartile50: F,
1941
- onPlayerQuartile75: k,
1942
- onPlayerNext: I,
1943
- onPlayerPrevious: _,
1944
- onPlayerEvent: J
1945
- }
1709
+ onPlayerResume: k,
1710
+ onPlayerEnd: y,
1711
+ onPlayerProgressEvery10Seconds: m,
1712
+ onPlayerProgressAt20Seconds: v,
1713
+ onPlayerQuartile25: x,
1714
+ onPlayerQuartile50: O,
1715
+ onPlayerQuartile75: z,
1716
+ onPlayerNext: N,
1717
+ onPlayerPrevious: A,
1718
+ onPlayerEvent: g
1719
+ };
1946
1720
  });
1947
- const pe = Pr(() => {
1948
- const ne = c.config || {}, _e = f && !ne.size ? { sizeType: "RESPONSIVE", aspectRatio: "9:16" } : ne.size || { sizeType: "FIXED", width: "100%" };
1721
+ const j = he(!1), { isLoaded: S, error: G } = Rt(
1722
+ t,
1723
+ s
1724
+ ), V = r || Tt(s) || ((o = c == null ? void 0 : c.video) == null ? void 0 : o.videoId), [ae, H] = ce(null), U = _r().replace(/:/g, ""), J = gr(
1725
+ e || `auto-${U}`,
1726
+ V
1727
+ ), ie = ir(() => {
1728
+ var P;
1729
+ const p = c.config || {}, R = f && !p.size ? { sizeType: "RESPONSIVE", aspectRatio: "9:16" } : p.size || { sizeType: "FIXED", width: "100%" };
1949
1730
  return {
1950
1731
  ...c,
1732
+ video: {
1733
+ ...c.video,
1734
+ videoId: V,
1735
+ playlist: i ? {
1736
+ playlistId: i,
1737
+ state: !0,
1738
+ playlistVideoIndex: 0
1739
+ } : (P = c.video) == null ? void 0 : P.playlist
1740
+ },
1951
1741
  config: {
1952
- ...ne,
1953
- size: _e
1742
+ ...p,
1743
+ size: R
1954
1744
  }
1955
1745
  };
1956
- }, [c, f]);
1957
- return Se(() => {
1958
- if (z) {
1959
- q(z);
1746
+ }, [c, f, V, i]);
1747
+ return Fe(() => {
1748
+ if (G) {
1749
+ H(G);
1960
1750
  return;
1961
1751
  }
1962
- if (!j || d && !i) return;
1963
- let ne = !0;
1964
- const De = setTimeout(async () => {
1752
+ if (!S) return;
1753
+ let p = !0;
1754
+ return (async () => {
1755
+ var P;
1965
1756
  try {
1966
- B.current.forEach(
1967
- (oe) => clearInterval(oe)
1968
- ), B.current = [], U.current.forEach((oe) => clearTimeout(oe)), U.current = [], M.current = null;
1969
- const ce = (l == null ? void 0 : l.length) ?? 0, we = JSON.stringify({
1970
- playerId: H,
1971
- videoId: r || O,
1972
- playlistId: t,
1973
- videoUrl: i,
1974
- fetchedPlaybackUrl: o,
1975
- scriptUrl: s,
1976
- isReels: f,
1977
- projectId: a,
1978
- playlistLength: ce
1979
- });
1980
- if (y.current && P.current && S.current === we)
1981
- return;
1982
- S.current !== we && (y.current = !1, S.current = we);
1983
- const ve = s == null ? void 0 : s.includes("vertical-player");
1984
- if (document.querySelectorAll('[id*="player"]').forEach((oe) => {
1985
- var Pe, T;
1986
- const be = oe.id;
1987
- if (be !== H)
1988
- try {
1989
- const R = ve ? (Pe = window.vpVerticalPlayer) == null ? void 0 : Pe.call(window, be) : (T = window.vpPlayer) == null ? void 0 : T.call(window, be);
1990
- R != null && R.destroy && R.destroy();
1991
- } catch (R) {
1992
- console.warn(
1993
- `Failed to destroy existing player ${be}:`,
1994
- R
1995
- );
1996
- }
1997
- }), await new Promise((oe) => setTimeout(oe, 100)), !ne || !Y.current) return;
1998
- if (!document.getElementById(H)) {
1999
- q("DOM element not found after cleanup.");
1757
+ const Y = (s == null ? void 0 : s.includes("vertical-player")) || (s == null ? void 0 : s.includes("vpverticalplayer")) || f, Z = Y ? window.vpVerticalPlayer : window.vpPlayer;
1758
+ if (!Z) {
1759
+ H("VP Player script loaded but global function not found.");
2000
1760
  return;
2001
1761
  }
2002
- if (!window.vpPlayer && !window.vpVerticalPlayer) {
2003
- q("VP Player script not loaded.");
2004
- return;
2005
- }
2006
- const ke = ve ? window.vpVerticalPlayer : window.vpPlayer;
2007
- if (!ke) {
2008
- q(
2009
- `VP ${ve ? "Vertical " : ""}Player script not loaded.`
2010
- );
1762
+ M.current = null, K.current;
1763
+ const I = At({
1764
+ videoUrl: n,
1765
+ projectId: a,
1766
+ config: ie,
1767
+ isVerticalPlayer: Y
1768
+ }), b = Z(J);
1769
+ if (!b) {
1770
+ H("Failed to create player instance.");
2011
1771
  return;
2012
1772
  }
2013
- const ge = Jt({
2014
- videoUrl: i,
2015
- fetchedPlaybackUrl: o ?? void 0,
2016
- fetchedPlaylist: l ?? void 0,
2017
- projectId: a,
2018
- config: pe,
2019
- isVerticalPlayer: ve
2020
- // Pass player type to config builder
2021
- }), G = ke(H);
2022
- if (!G) {
2023
- q(
2024
- `Failed to create VP ${ve ? "Vertical " : ""}Player instance.`
1773
+ if (await new Promise(($) => setTimeout($, 0)), !document.getElementById(J)) {
1774
+ console.error(
1775
+ `VP Player: Container element with ID '${J}' not found in DOM.`
2025
1776
  );
2026
1777
  return;
2027
1778
  }
2028
- if (ne && Y.current && (G.setup(ge), P.current = G, y.current = !0, q(null), u && G.on)) {
2029
- const oe = () => {
2030
- var R, N, ae;
2031
- const T = {};
2032
- if ((N = (R = ge.video) == null ? void 0 : R.playlist) != null && N.videos && ge.video.playlist.videos.length > 0) {
2033
- const D = G.videoIndex ?? ((ae = G.playlist) == null ? void 0 : ae.playlistVideoIndex) ?? 0, W = ge.video.playlist.videos[D];
2034
- W && (T.title = W.title, T.file = W.file || W.hlsUrl, T.hlsUrl = W.file || W.hlsUrl, T.thumbnailUrl = W.thumbnailUrl, T.duration = W.duration, T.videoIndex = D, T.playlistVideoIndex = D, T.videoId = W.videoId || W.mediaId, T.mediaId = W.mediaId || W.videoId);
2035
- } else ge.video && (T.title = ge.video.title, T.file = ge.video.file, T.hlsUrl = ge.video.file, T.thumbnailUrl = ge.video.thumbnail, T.videoId = r || O, T.videoIndex = 0, T.playlistVideoIndex = 0, G.getDuration && (T.duration = G.getDuration()));
2036
- return T;
2037
- };
2038
- let be = null;
2039
- const Pe = async () => {
2040
- var T;
2041
- try {
2042
- be && clearTimeout(be), await new Promise((D) => setTimeout(D, 100));
2043
- let R = oe();
2044
- const N = R.videoId || R.mediaId;
2045
- if (N && N === M.current)
2046
- return;
2047
- if (be = window.setTimeout(() => {
2048
- M.current = null;
2049
- }, 500), (s == null ? void 0 : s.includes("vertical-player")) && N)
2050
- try {
2051
- const Ee = `https://host.vpplayer.tech/player/ptkzurnx/${N}.json`, W = await fetch(Ee);
2052
- if (W.ok) {
2053
- const re = await W.json();
2054
- re != null && re.video && (R = {
2055
- ...R,
2056
- title: re.video.title || R.title,
2057
- description: re.video.description,
2058
- publishDate: re.video.publishDate,
2059
- projectId: re.projectId || R.projectId,
2060
- premium: ((T = re.video.videoLocking) == null ? void 0 : T.isEnabled) || !1,
2061
- author: re.video.author,
2062
- tags: re.video.tags || []
2063
- });
2064
- }
2065
- } catch {
2066
- }
2067
- M.current = N || null, V(R), u(R);
2068
- } catch (R) {
2069
- console.warn("Error in video-started handler:", R);
2070
- }
2071
- };
2072
- if (ve) {
2073
- let T = !1, R = -1;
2074
- const N = () => {
2075
- if (!T) {
2076
- T = !0;
2077
- try {
2078
- G.on && G.on("vp-video-started", Pe), setTimeout(() => {
2079
- Pe(), R = G.videoIndex ?? 0;
2080
- }, 500);
2081
- } catch (W) {
2082
- console.error("Error setting up event listeners:", W);
2083
- }
2084
- }
2085
- };
2086
- let ae = 0;
2087
- const D = 15, Ee = setInterval(() => {
1779
+ if (p) {
1780
+ try {
1781
+ if (!document.getElementById(J))
1782
+ return;
1783
+ b.setup(I);
1784
+ } catch ($) {
1785
+ const _e = $ instanceof Error ? $.message : String($);
1786
+ if (_e.includes("already initialized")) {
1787
+ console.warn(
1788
+ "VP Player: Player already initialized, attempting to destroy and retry."
1789
+ );
2088
1790
  try {
2089
- const W = G.videoIndex !== void 0 || G.playlist;
2090
- if (!T)
2091
- ae++, (W || ae >= D) && N();
2092
- else {
2093
- const re = G.videoIndex ?? 0;
2094
- re !== R && R !== -1 && (R = re, Pe());
2095
- }
2096
- } catch {
1791
+ (P = b.destroy) == null || P.call(b), await new Promise((l) => setTimeout(l, 50)), p && document.getElementById(J) && b.setup(I);
1792
+ } catch (l) {
1793
+ console.error(
1794
+ "VP Player: Failed to recover from initialization error",
1795
+ l
1796
+ );
2097
1797
  }
2098
- }, 200);
2099
- B.current.push(Ee);
1798
+ } else
1799
+ console.error("VP Player: Setup error", $), H(`Player setup failed: ${_e}`);
1800
+ }
1801
+ if (M.current = b, q.current = !0, H(null), j.current = !1, b.on) {
1802
+ const $ = b.on.bind(b), _e = () => {
1803
+ $("ready", () => {
1804
+ const l = T.current;
1805
+ l.onPlayerStart && l.onPlayerStart("player_start"), l.onPlayerEvent && l.onPlayerEvent("player_start");
1806
+ }), $("play", () => {
1807
+ const l = T.current;
1808
+ l.onPlayerPlay && l.onPlayerPlay("player_play"), l.onPlayerEvent && l.onPlayerEvent("player_play");
1809
+ }), $("video-started", (l) => {
1810
+ const D = T.current;
1811
+ D.onVideoStarted && D.onVideoStarted(l);
1812
+ }), $("resume", () => {
1813
+ const l = T.current;
1814
+ l.onPlayerResume && l.onPlayerResume("player_resume"), l.onPlayerEvent && l.onPlayerEvent("player_resume");
1815
+ }), $("pause", () => {
1816
+ const l = T.current;
1817
+ l.onPlayerPause && l.onPlayerPause("player_pause"), l.onPlayerEvent && l.onPlayerEvent("player_pause");
1818
+ }), $("complete", () => {
1819
+ const l = T.current;
1820
+ l.onPlayerEnd && l.onPlayerEnd("player_end"), l.onPlayerEvent && l.onPlayerEvent("player_end"), j.current = !1;
1821
+ }), $("firstQuartile", () => {
1822
+ const l = T.current;
1823
+ l.onPlayerQuartile25 && l.onPlayerQuartile25("player_quartile_25", 0), l.onPlayerEvent && l.onPlayerEvent("player_quartile_25", 0);
1824
+ }), $("secondQuartile", () => {
1825
+ const l = T.current;
1826
+ l.onPlayerQuartile50 && l.onPlayerQuartile50("player_quartile_50", 0), l.onPlayerEvent && l.onPlayerEvent("player_quartile_50", 0);
1827
+ }), $("thirdQuartile", () => {
1828
+ const l = T.current;
1829
+ l.onPlayerQuartile75 && l.onPlayerQuartile75("player_quartile_75", 0), l.onPlayerEvent && l.onPlayerEvent("player_quartile_75", 0);
1830
+ }), $("video-state", (l) => {
1831
+ var pe;
1832
+ const D = ((pe = b.getPosition) == null ? void 0 : pe.call(b)) ?? (l == null ? void 0 : l.position) ?? 0, se = T.current;
1833
+ se.onPlayerProgressEvery10Seconds && se.onPlayerProgressEvery10Seconds(
1834
+ "player_progress_every_10_seconds",
1835
+ Math.floor(D)
1836
+ ), se.onPlayerEvent && se.onPlayerEvent(
1837
+ "player_progress_every_10_seconds",
1838
+ Math.floor(D)
1839
+ );
1840
+ }), $("time", (l) => {
1841
+ var se;
1842
+ if (j.current) return;
1843
+ let D = 0;
1844
+ if (typeof l == "number" ? D = l : l && typeof l == "object" && "position" in l ? D = l.position : D = ((se = b.getPosition) == null ? void 0 : se.call(b)) ?? 0, D >= 20) {
1845
+ j.current = !0;
1846
+ const pe = Math.floor(D), we = T.current;
1847
+ we.onPlayerProgressAt20Seconds && we.onPlayerProgressAt20Seconds(
1848
+ "player_progress_at_20_seconds",
1849
+ pe
1850
+ ), we.onPlayerEvent && we.onPlayerEvent("player_progress_at_20_seconds", pe);
1851
+ }
1852
+ }), $("playlistItem", (l) => {
1853
+ const D = T.current;
1854
+ D.onPlayerNext && D.onPlayerNext("player_next"), D.onPlayerEvent && D.onPlayerEvent("player_next"), D.onPlaylistData, j.current = !1;
1855
+ });
1856
+ };
2100
1857
  try {
2101
- G.on && G.on("vp-listen-ready", N);
2102
- } catch {
1858
+ _e();
1859
+ } catch (l) {
1860
+ console.warn("VP Player: Failed to attach event listeners", l);
2103
1861
  }
2104
- } else {
2105
- const T = async (R) => {
2106
- var N, ae;
2107
- try {
2108
- const D = s == null ? void 0 : s.match(/player\/([^/.]+)/), Ee = D == null ? void 0 : D[1];
2109
- if (!Ee || !R)
2110
- return oe();
2111
- const W = `https://host.vpplayer.tech/player/${Ee}/${R}.json`, re = await fetch(W);
2112
- if (!re.ok)
2113
- return console.warn(
2114
- "Failed to fetch full video config:",
2115
- re.status
2116
- ), oe();
2117
- const se = await re.json();
2118
- return se != null && se.video ? {
2119
- videoId: R,
2120
- title: se.video.title,
2121
- description: se.video.description,
2122
- file: se.video.file,
2123
- hlsUrl: se.video.file,
2124
- thumbnailUrl: se.video.thumbnail,
2125
- duration: se.video.duration,
2126
- publishDate: se.video.publishDate,
2127
- projectId: se.projectId,
2128
- premium: ((N = se.video.videoLocking) == null ? void 0 : N.isEnabled) || !1,
2129
- author: se.video.author,
2130
- tags: se.video.tags || [],
2131
- videoIndex: G.videoIndex ?? 0,
2132
- playlistVideoIndex: ((ae = G.playlist) == null ? void 0 : ae.playlistVideoIndex) ?? 0
2133
- } : oe();
2134
- } catch (D) {
2135
- return console.warn("Error fetching full video data:", D), oe();
2136
- }
2137
- };
2138
- G.on("ready", async (R) => {
2139
- try {
2140
- const N = R, ae = (N == null ? void 0 : N.id) || r || O;
2141
- if (ae) {
2142
- const D = await T(ae);
2143
- V(D), u(D);
2144
- } else {
2145
- const D = oe();
2146
- (D.title || D.file) && (V(D), u(D));
2147
- }
2148
- } catch (N) {
2149
- console.warn("Error in ready handler:", N);
2150
- }
2151
- }), G.on("playlistItem", async (R) => {
1862
+ }
1863
+ !n && b.play && setTimeout(() => {
1864
+ if (p && b.play)
2152
1865
  try {
2153
- const N = R, ae = N == null ? void 0 : N.id;
2154
- if (ae) {
2155
- const D = await T(ae);
2156
- V(D), u(D);
2157
- }
2158
- } catch (N) {
2159
- console.warn("Error in playlistItem handler:", N);
1866
+ b.play();
1867
+ } catch {
2160
1868
  }
2161
- });
2162
- }
1869
+ }, 100);
2163
1870
  }
2164
- } catch (ce) {
2165
- if (ne) {
2166
- const we = ce instanceof Error ? ce.message : String(ce);
2167
- q(we), console.error("VP Player initialization error:", ce);
1871
+ } catch (Y) {
1872
+ if (p) {
1873
+ const Z = Y instanceof Error ? Y.message : String(Y);
1874
+ H(Z), console.error("VP Player initialization error:", Y);
2168
1875
  }
2169
1876
  }
2170
- }, 150);
2171
- return () => {
2172
- ne = !1, clearTimeout(De), B.current.forEach((ce) => clearInterval(ce)), B.current = [], U.current.forEach((ce) => clearTimeout(ce)), U.current = [], y.current = !1;
2173
- };
2174
- }, [j, d, H, z, s]), Se(() => () => {
2175
- if (P.current) {
2176
- try {
2177
- P.current.destroy && P.current.destroy();
2178
- } catch (_e) {
2179
- console.warn(`Failed to destroy player ${H}:`, _e);
1877
+ })(), () => {
1878
+ var P;
1879
+ if (p = !1, (P = M.current) != null && P.destroy) {
1880
+ try {
1881
+ M.current.destroy();
1882
+ } catch {
1883
+ }
1884
+ M.current = null;
2180
1885
  }
2181
- P.current = null;
2182
- }
2183
- y.current = !1;
2184
- const ne = document.getElementById(H);
2185
- ne && (ne.innerHTML = "");
2186
- }, [H]), {
2187
- playerRef: Y,
2188
- playerInstanceRef: P,
2189
- isScriptLoaded: j,
2190
- isLoading: d,
2191
- error: $ || Q || z
1886
+ q.current = !1;
1887
+ };
1888
+ }, [
1889
+ S,
1890
+ J,
1891
+ G,
1892
+ s,
1893
+ V,
1894
+ i,
1895
+ n,
1896
+ a,
1897
+ ie,
1898
+ f
1899
+ ]), {
1900
+ playerRef: K,
1901
+ playerInstanceRef: M,
1902
+ isScriptLoaded: S,
1903
+ isLoading: !S && !q.current,
1904
+ error: ae,
1905
+ generatedPlayerId: J
2192
1906
  };
2193
- }, Zt = ({
1907
+ }, Ot = ({
2194
1908
  playerId: e,
2195
1909
  videoId: r,
2196
- version: n,
2197
- videoUrl: i,
1910
+ version: t,
1911
+ videoUrl: n,
2198
1912
  projectId: a,
2199
- playlistId: t,
1913
+ playlistId: i,
2200
1914
  scriptUrl: s,
2201
1915
  config: c = {},
2202
1916
  isReels: f = !1,
2203
- hiddenClasses: m = [],
2204
- onClose: u,
2205
- className: p,
2206
- onPlaylistData: x,
2207
- onVideoStarted: g,
2208
- trackingMetadata: E,
2209
- onPlayerStart: h,
2210
- onPlayerPlay: v,
2211
- onPlayerPause: w,
2212
- onPlayerResume: b,
2213
- onPlayerEnd: L,
2214
- onPlayerProgressEvery10Seconds: F,
2215
- onPlayerProgressAt20Seconds: k,
2216
- onPlayerQuartile25: I,
2217
- onPlayerQuartile50: _,
2218
- onPlayerQuartile75: J,
2219
- onPlayerNext: Y,
2220
- onPlayerPrevious: P,
2221
- onPlayerEvent: y
1917
+ hiddenClasses: u = [],
1918
+ onClose: d,
1919
+ className: h,
1920
+ onPlaylistData: C,
1921
+ onVideoStarted: E,
1922
+ trackingMetadata: k,
1923
+ onPlayerStart: y,
1924
+ onPlayerPlay: m,
1925
+ onPlayerPause: v,
1926
+ onPlayerResume: x,
1927
+ onPlayerEnd: O,
1928
+ onPlayerProgressEvery10Seconds: z,
1929
+ onPlayerProgressAt20Seconds: N,
1930
+ onPlayerQuartile25: A,
1931
+ onPlayerQuartile50: g,
1932
+ onPlayerQuartile75: K,
1933
+ onPlayerNext: M,
1934
+ onPlayerPrevious: q,
1935
+ onPlayerEvent: T
2222
1936
  }) => {
2223
- var $, H, fe, V;
2224
- const { playerRef: S, playerInstanceRef: B, isScriptLoaded: U, isLoading: M, error: j } = Kt({
1937
+ var P, Y, Z, I;
1938
+ const {
1939
+ playerRef: j,
1940
+ playerInstanceRef: S,
1941
+ isScriptLoaded: G,
1942
+ isLoading: V,
1943
+ error: ae,
1944
+ generatedPlayerId: H
1945
+ } = It({
2225
1946
  playerId: e,
2226
1947
  videoId: r,
2227
- version: n,
2228
- videoUrl: i,
1948
+ version: t,
1949
+ videoUrl: n,
2229
1950
  projectId: a,
2230
- playlistId: t,
1951
+ playlistId: i,
2231
1952
  scriptUrl: s,
2232
1953
  config: c,
2233
1954
  isReels: f,
2234
- onPlaylistData: x,
2235
- onVideoStarted: g,
2236
- trackingMetadata: E,
2237
- onPlayerStart: h,
2238
- onPlayerPlay: v,
2239
- onPlayerPause: w,
2240
- onPlayerResume: b,
2241
- onPlayerEnd: L,
2242
- onPlayerProgressEvery10Seconds: F,
2243
- onPlayerProgressAt20Seconds: k,
2244
- onPlayerQuartile25: I,
2245
- onPlayerQuartile50: _,
2246
- onPlayerQuartile75: J,
2247
- onPlayerNext: Y,
2248
- onPlayerPrevious: P,
2249
- onPlayerEvent: y
2250
- }), [z, O] = de(!0), Q = () => f && O(!0), q = () => {
2251
- var ee, pe;
2252
- O(!1), (pe = (ee = B.current) == null ? void 0 : ee.play) == null || pe.call(ee), u == null || u();
2253
- }, o = (H = ($ = c == null ? void 0 : c.config) == null ? void 0 : $.size) != null && H.width ? typeof c.config.size.width == "number" ? `${c.config.size.width}px` : c.config.size.width : void 0, l = (V = (fe = c == null ? void 0 : c.config) == null ? void 0 : fe.size) != null && V.height ? typeof c.config.size.height == "number" ? `${c.config.size.height}px` : c.config.size.height : void 0, d = cr(e, r);
2254
- return j ? /* @__PURE__ */ Z.jsxs(ar, { type: "error", children: [
1955
+ onPlaylistData: C,
1956
+ onVideoStarted: E,
1957
+ onPlayerStart: y,
1958
+ onPlayerPlay: m,
1959
+ onPlayerPause: v,
1960
+ onPlayerResume: x,
1961
+ onPlayerEnd: O,
1962
+ onPlayerProgressEvery10Seconds: z,
1963
+ onPlayerProgressAt20Seconds: N,
1964
+ onPlayerQuartile25: A,
1965
+ onPlayerQuartile50: g,
1966
+ onPlayerQuartile75: K,
1967
+ onPlayerNext: M,
1968
+ onPlayerPrevious: q,
1969
+ onPlayerEvent: T
1970
+ }), [U, J] = ce(!0), ie = () => f && J(!0), o = () => {
1971
+ var b, oe;
1972
+ !f || !U || (J(!1), (oe = (b = S.current) == null ? void 0 : b.pause) == null || oe.call(b), d == null || d());
1973
+ }, p = (Y = (P = c == null ? void 0 : c.config) == null ? void 0 : P.size) != null && Y.width ? typeof c.config.size.width == "number" ? `${c.config.size.width}px` : c.config.size.width : void 0, R = (I = (Z = c == null ? void 0 : c.config) == null ? void 0 : Z.size) != null && I.height ? typeof c.config.size.height == "number" ? `${c.config.size.height}px` : c.config.size.height : void 0;
1974
+ return ae ? /* @__PURE__ */ L.jsxs(Ie, { type: "error", children: [
2255
1975
  "An error occurred: ",
2256
- j
2257
- ] }) : M || !U ? /* @__PURE__ */ Z.jsx(ar, { type: "loading", children: "Loading..." }) : /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
2258
- f && !z ? /* @__PURE__ */ Z.jsx("div", { onClick: Q }) : null,
2259
- !f && /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsx(
2260
- _r,
1976
+ ae
1977
+ ] }) : /* @__PURE__ */ L.jsxs(L.Fragment, { children: [
1978
+ f && !U ? /* @__PURE__ */ L.jsx(
1979
+ "div",
2261
1980
  {
2262
- id: d,
2263
- ref: S,
2264
- width: o || "100%",
2265
- height: l || "auto",
2266
- $hiddenClasses: m,
2267
- className: p
1981
+ onClick: ie,
1982
+ style: { cursor: "pointer", width: "100%", height: "100%" }
2268
1983
  }
2269
- ) }, d),
2270
- f && z && /* @__PURE__ */ Z.jsx(Mt, { onClick: q, className: p, children: /* @__PURE__ */ Z.jsx(zt, { className: p, onClick: (ee) => ee.stopPropagation(), children: /* @__PURE__ */ Z.jsx("div", { children: /* @__PURE__ */ Z.jsx(
2271
- _r,
1984
+ ) : null,
1985
+ !f && /* @__PURE__ */ L.jsxs("div", { style: { position: "relative" }, children: [
1986
+ /* @__PURE__ */ L.jsx(
1987
+ nr,
1988
+ {
1989
+ id: H,
1990
+ ref: j,
1991
+ width: p || "100%",
1992
+ height: R || "auto",
1993
+ $hiddenClasses: u,
1994
+ className: h
1995
+ }
1996
+ ),
1997
+ (V || !G) && /* @__PURE__ */ L.jsx(
1998
+ "div",
1999
+ {
2000
+ style: {
2001
+ position: "absolute",
2002
+ top: 0,
2003
+ left: 0,
2004
+ right: 0,
2005
+ bottom: 0,
2006
+ display: "flex",
2007
+ alignItems: "center",
2008
+ justifyContent: "center",
2009
+ background: "rgba(0,0,0,0.8)",
2010
+ zIndex: 10
2011
+ },
2012
+ children: /* @__PURE__ */ L.jsx(Ie, { type: "loading", children: "Loading..." })
2013
+ }
2014
+ )
2015
+ ] }),
2016
+ f && U && /* @__PURE__ */ L.jsx(Et, { onClick: o, className: h, children: /* @__PURE__ */ L.jsx(
2017
+ kt,
2272
2018
  {
2273
- id: d,
2274
- ref: S,
2275
- width: "100%",
2276
- height: "auto",
2277
- $hiddenClasses: m,
2278
- className: p
2019
+ className: h,
2020
+ onClick: (b) => {
2021
+ b.stopPropagation();
2022
+ },
2023
+ children: /* @__PURE__ */ L.jsxs("div", { style: { position: "relative" }, children: [
2024
+ /* @__PURE__ */ L.jsx(
2025
+ nr,
2026
+ {
2027
+ id: H,
2028
+ ref: j,
2029
+ width: "100%",
2030
+ height: "100%",
2031
+ $hiddenClasses: u,
2032
+ className: h
2033
+ }
2034
+ ),
2035
+ (V || !G) && /* @__PURE__ */ L.jsx(
2036
+ "div",
2037
+ {
2038
+ style: {
2039
+ position: "absolute",
2040
+ top: 0,
2041
+ left: 0,
2042
+ right: 0,
2043
+ bottom: 0,
2044
+ display: "flex",
2045
+ alignItems: "center",
2046
+ justifyContent: "center",
2047
+ background: "rgba(0,0,0,0.8)",
2048
+ zIndex: 10
2049
+ },
2050
+ children: /* @__PURE__ */ L.jsx(Ie, { type: "loading", children: "Loading..." })
2051
+ }
2052
+ )
2053
+ ] })
2279
2054
  }
2280
- ) }, d) }) })
2055
+ ) })
2281
2056
  ] });
2282
- }, $r = Dr(void 0), rn = ({ children: e }) => {
2283
- const [r, n] = de(!1), [i, a] = de(null), [t, s] = de(null), c = ur((u) => {
2057
+ }, br = wr(void 0), $t = ({ children: e }) => {
2058
+ const [r, t] = ce(!1), [n, a] = ce(null), [i, s] = ce(null), c = qe((d) => {
2284
2059
  try {
2285
- const p = cr(u.playerId, u.videoId);
2286
- a({ ...u, playerId: p }), n(!0), s(null);
2060
+ const h = gr(d.playerId, d.videoId);
2061
+ a({ ...d, playerId: h }), t(!0), s(null);
2287
2062
  } catch {
2288
2063
  s("Failed to show player.");
2289
2064
  }
2290
- }, []), f = ur(() => {
2291
- n(!1), a(null), s(null);
2292
- }, []), m = Pr(
2065
+ }, []), f = qe(() => {
2066
+ t(!1), a(null), s(null);
2067
+ }, []), u = ir(
2293
2068
  () => ({
2294
2069
  showPlayer: c,
2295
2070
  hidePlayer: f,
2296
2071
  isPlayerVisible: r,
2297
- playerParams: i
2072
+ playerParams: n
2298
2073
  }),
2299
- [c, f, r, i]
2074
+ [c, f, r, n]
2300
2075
  );
2301
- return /* @__PURE__ */ Z.jsxs($r.Provider, { value: m, children: [
2076
+ return /* @__PURE__ */ L.jsxs(br.Provider, { value: u, children: [
2302
2077
  e,
2303
- t && /* @__PURE__ */ Z.jsx(ar, { type: "error", children: t }),
2304
- r && (i == null ? void 0 : i.playerId) && /* @__PURE__ */ Z.jsx(
2305
- Zt,
2078
+ i && /* @__PURE__ */ L.jsx(Ie, { type: "error", children: i }),
2079
+ r && (n == null ? void 0 : n.playerId) && /* @__PURE__ */ L.jsx(
2080
+ Ot,
2306
2081
  {
2307
- playerId: i.playerId,
2308
- videoId: i.videoId,
2309
- projectId: i.projectId,
2310
- videoUrl: i.videoUrl,
2311
- version: i.version,
2312
- playlistId: i.playlistId,
2313
- scriptUrl: i.scriptUrl,
2314
- config: i.config,
2315
- isReels: i.isReels,
2316
- thumbnailUrl: i.thumbnailUrl,
2082
+ playerId: n.playerId,
2083
+ videoId: n.videoId,
2084
+ projectId: n.projectId,
2085
+ videoUrl: n.videoUrl,
2086
+ version: n.version,
2087
+ playlistId: n.playlistId,
2088
+ scriptUrl: n.scriptUrl,
2089
+ config: n.config,
2090
+ isReels: n.isReels,
2091
+ thumbnailUrl: n.thumbnailUrl,
2317
2092
  onClose: f,
2318
- hiddenClasses: i.hiddenClasses || [],
2319
- className: i.className
2093
+ hiddenClasses: n.hiddenClasses || [],
2094
+ className: n.className
2320
2095
  }
2321
2096
  )
2322
2097
  ] });
2323
- }, tn = () => {
2324
- const e = Er($r);
2098
+ }, Lt = () => {
2099
+ const e = ar(br);
2325
2100
  if (!e) throw new Error("useVPPlayer must be used within a VPPlayerProvider");
2326
2101
  return e;
2327
- }, nn = {
2328
- projectId: "vp-player-projectId",
2102
+ }, zt = {
2103
+ projectId: void 0,
2329
2104
  video: {
2330
- file: "",
2331
- playlist: {
2332
- state: !0,
2333
- playlistVideoIndex: 0,
2334
- videos: []
2335
- }
2105
+ // NOTE: Do NOT set file: '' here - it interferes with managed mode
2106
+ // where the SDK resolves the video URL from videoId + projectId
2336
2107
  },
2337
2108
  config: {
2338
2109
  autoplay: !0,
2339
- pauseOtherVideos: !0,
2340
- focusOnAutostart: !1,
2341
2110
  muted: !0,
2111
+ // Required for browser autoplay policy
2342
2112
  loop: !1,
2343
2113
  size: {
2344
- width: "100%"
2345
- },
2346
- controls: {
2347
- settingsButton: !0,
2348
- chromecastButton: !1,
2349
- nextButton: !1,
2350
- fullscreenButton: !0,
2351
- airplayButton: !1,
2352
- bigPlayButton: !1,
2353
- autopausePlayButton: !0,
2354
- pictureInPictureButton: !1,
2355
- relatedButton: !1,
2356
- volumeButton: !0,
2357
- shareButton: !0
2114
+ width: "100%",
2115
+ height: "30vh"
2358
2116
  }
2117
+ // NOTE: Do NOT set controls here - let the SDK/managed script
2118
+ // use what's configured in the Gjirafa admin panel (projectId config)
2359
2119
  }
2360
- }, an = {
2120
+ }, Nt = {
2361
2121
  config: {
2362
2122
  autostartOnLoad: { state: !0, onMobile: !0, onData: !0 },
2363
2123
  muted: !0
2364
2124
  }
2365
- }, on = {
2125
+ }, Ft = {
2366
2126
  config: {
2367
2127
  autoplay: !0,
2368
2128
  muted: !0
2369
2129
  }
2370
- }, rr = {
2130
+ }, Ne = {
2371
2131
  video: {
2372
2132
  advertising: !0,
2373
2133
  ads: {
@@ -2378,48 +2138,46 @@ const Dt = Ae.div`
2378
2138
  adAnnouncement: { state: !0, timeBeforeAd: 5 },
2379
2139
  adsRequireInteraction: !1
2380
2140
  }
2381
- }, sn = (e, r, n = "time", i = 0) => {
2141
+ }, Mt = (e, r, t = "time", n = 0) => {
2382
2142
  var a;
2383
2143
  return {
2384
- ...rr,
2144
+ ...Ne,
2385
2145
  video: {
2386
- ...rr.video,
2146
+ ...Ne.video,
2387
2147
  ads: {
2388
- ...(a = rr.video) == null ? void 0 : a.ads,
2148
+ ...(a = Ne.video) == null ? void 0 : a.ads,
2389
2149
  adBreaks: [
2390
2150
  {
2391
2151
  adTagUrl: r,
2392
2152
  breakType: e,
2393
- breakTimingType: n,
2394
- breakTimingValue: i
2153
+ breakTimingType: t,
2154
+ breakTimingValue: n
2395
2155
  }
2396
2156
  ]
2397
2157
  }
2398
2158
  }
2399
2159
  };
2400
- }, ln = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", cn = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", un = "https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4", dn = "https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600", fn = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=", pn = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";
2160
+ }, Vt = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", Dt = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", Bt = "https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4", Ut = "https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600", Wt = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=", qt = "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";
2401
2161
  export {
2402
- fn as AD_TAG_LINEAR_URL,
2403
- pn as AD_TAG_SKIPPABLE_LINEAR_URL,
2404
- ln as BIG_BUCK_BUNNY_URL,
2405
- cn as ELEPHANTS_DREAM_URL,
2406
- Mt as Overlay,
2407
- dn as PEXELS_THUMBNAIL_URL,
2408
- un as PEXELS_VERTICAL_VIDEO_URL,
2409
- _r as PlayerContainer,
2410
- zt as PlayerWrapper,
2411
- Zt as VPPlayer,
2412
- rn as VPPlayerProvider,
2413
- an as baseConfig,
2414
- rr as baseConfigWithAds,
2415
- on as baseConfigWithAutoplay,
2416
- Jt as buildVPPlayerConfig,
2417
- nn as defaultVPPlayerConfig,
2418
- Qt as extractVideoId,
2419
- sn as getAdConfig,
2420
- tn as useVPPlayer,
2421
- Gt as useVPPlayerEvents,
2422
- Kt as useVPPlayerLogic,
2423
- Wt as useVPPlayerScript,
2424
- Ht as useVideoData
2162
+ Wt as AD_TAG_LINEAR_URL,
2163
+ qt as AD_TAG_SKIPPABLE_LINEAR_URL,
2164
+ Vt as BIG_BUCK_BUNNY_URL,
2165
+ Dt as ELEPHANTS_DREAM_URL,
2166
+ Et as Overlay,
2167
+ Ut as PEXELS_THUMBNAIL_URL,
2168
+ Bt as PEXELS_VERTICAL_VIDEO_URL,
2169
+ nr as PlayerContainer,
2170
+ kt as PlayerWrapper,
2171
+ Ot as VPPlayer,
2172
+ $t as VPPlayerProvider,
2173
+ Nt as baseConfig,
2174
+ Ne as baseConfigWithAds,
2175
+ Ft as baseConfigWithAutoplay,
2176
+ At as buildVPPlayerConfig,
2177
+ zt as defaultVPPlayerConfig,
2178
+ Tt as extractVideoId,
2179
+ Mt as getAdConfig,
2180
+ Lt as useVPPlayer,
2181
+ It as useVPPlayerLogic,
2182
+ Rt as useVPPlayerScript
2425
2183
  };