strataplayer 1.2.19 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/core/StrataCore.d.ts +10 -2
- package/dist/strataplayer.cjs.js +17 -9
- package/dist/strataplayer.cjs.js.map +1 -1
- package/dist/strataplayer.es.js +1412 -1258
- package/dist/strataplayer.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/ui/Icons.d.ts +6 -0
- package/dist/ui/components/SubtitleOverlay.d.ts +1 -1
- package/package.json +1 -1
package/dist/strataplayer.es.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { createRoot as
|
|
6
|
-
import { jsxs as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
class
|
|
1
|
+
var Si = Object.defineProperty;
|
|
2
|
+
var Ci = (s, t, i) => t in s ? Si(s, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[t] = i;
|
|
3
|
+
var F = (s, t, i) => Ci(s, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import Me, { useState as M, useEffect as ee, useRef as W, useLayoutEffect as Be, useMemo as Ce, useSyncExternalStore as Ni, useCallback as Ve } from "react";
|
|
5
|
+
import { createRoot as Mi } from "react-dom/client";
|
|
6
|
+
import { jsxs as c, jsx as e, Fragment as Q } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as Ti } from "react-dom";
|
|
8
|
+
class zi {
|
|
9
9
|
constructor() {
|
|
10
|
-
|
|
10
|
+
F(this, "events");
|
|
11
11
|
this.events = /* @__PURE__ */ new Map();
|
|
12
12
|
}
|
|
13
|
-
on(t,
|
|
13
|
+
on(t, i) {
|
|
14
14
|
var o;
|
|
15
|
-
return this.events.has(t) || this.events.set(t, []), (o = this.events.get(t)) == null || o.push(
|
|
15
|
+
return this.events.has(t) || this.events.set(t, []), (o = this.events.get(t)) == null || o.push(i), () => this.off(t, i);
|
|
16
16
|
}
|
|
17
|
-
off(t,
|
|
17
|
+
off(t, i) {
|
|
18
18
|
const o = this.events.get(t);
|
|
19
19
|
o && this.events.set(
|
|
20
20
|
t,
|
|
21
|
-
o.filter((
|
|
21
|
+
o.filter((a) => a !== i)
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
-
emit(t,
|
|
24
|
+
emit(t, i) {
|
|
25
25
|
const o = this.events.get(t);
|
|
26
|
-
o && o.forEach((
|
|
26
|
+
o && o.forEach((a) => a(i));
|
|
27
27
|
}
|
|
28
28
|
destroy() {
|
|
29
29
|
this.events.clear();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
class
|
|
32
|
+
class Ii {
|
|
33
33
|
constructor(t) {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
F(this, "state");
|
|
35
|
+
F(this, "listeners");
|
|
36
36
|
this.state = t, this.listeners = /* @__PURE__ */ new Set();
|
|
37
37
|
}
|
|
38
38
|
get() {
|
|
39
39
|
return this.state;
|
|
40
40
|
}
|
|
41
41
|
setState(t) {
|
|
42
|
-
const
|
|
43
|
-
this.state = { ...
|
|
42
|
+
const i = this.state, o = typeof t == "function" ? t(i) : t;
|
|
43
|
+
this.state = { ...i, ...o }, this.listeners.forEach((a) => a(this.state, i));
|
|
44
44
|
}
|
|
45
45
|
subscribe(t) {
|
|
46
46
|
return this.listeners.add(t), () => this.listeners.delete(t);
|
|
@@ -49,13 +49,13 @@ class wi {
|
|
|
49
49
|
this.listeners.clear();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class Ri {
|
|
53
53
|
constructor(t) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
F(this, "context", null);
|
|
55
|
+
F(this, "source", null);
|
|
56
|
+
F(this, "gainNode", null);
|
|
57
|
+
F(this, "video");
|
|
58
|
+
F(this, "isInitialized", !1);
|
|
59
59
|
this.video = t;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -66,8 +66,8 @@ class yi {
|
|
|
66
66
|
this.context = new AudioContext(), this.gainNode = this.context.createGain();
|
|
67
67
|
try {
|
|
68
68
|
this.source = this.context.createMediaElementSource(this.video), this.source.connect(this.gainNode), this.gainNode.connect(this.context.destination), this.isInitialized = !0;
|
|
69
|
-
} catch (
|
|
70
|
-
console.warn("StrataPlayer: Failed to initialize AudioEngine",
|
|
69
|
+
} catch (i) {
|
|
70
|
+
console.warn("StrataPlayer: Failed to initialize AudioEngine", i);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -78,67 +78,67 @@ class yi {
|
|
|
78
78
|
this.context && this.context.close(), this.isInitialized = !1;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
if (isNaN(
|
|
83
|
-
const t = Math.floor(
|
|
84
|
-
return t > 0 ? `${t}:${
|
|
85
|
-
},
|
|
81
|
+
const it = (s) => {
|
|
82
|
+
if (isNaN(s)) return "00:00";
|
|
83
|
+
const t = Math.floor(s / 3600), i = Math.floor(s % 3600 / 60), o = Math.floor(s % 60);
|
|
84
|
+
return t > 0 ? `${t}:${i.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}` : `${i}:${o.toString().padStart(2, "0")}`;
|
|
85
|
+
}, Pi = async (s, t = 3, i = 2e4) => {
|
|
86
86
|
for (let o = 0; o < t; o++) {
|
|
87
|
-
const
|
|
87
|
+
const a = new AbortController(), u = setTimeout(() => a.abort(), i);
|
|
88
88
|
try {
|
|
89
|
-
const
|
|
90
|
-
if (clearTimeout(
|
|
91
|
-
return await
|
|
92
|
-
} catch (
|
|
93
|
-
if (clearTimeout(
|
|
94
|
-
await new Promise((
|
|
89
|
+
const h = await fetch(s, { signal: a.signal });
|
|
90
|
+
if (clearTimeout(u), !h.ok) throw new Error(`HTTP ${h.status}`);
|
|
91
|
+
return await h.text();
|
|
92
|
+
} catch (h) {
|
|
93
|
+
if (clearTimeout(u), o === t - 1) throw h;
|
|
94
|
+
await new Promise((f) => setTimeout(f, 1e3));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
throw new Error("Failed");
|
|
98
|
-
},
|
|
98
|
+
}, Li = async (s, t, i = 2e4) => {
|
|
99
99
|
try {
|
|
100
|
-
const
|
|
101
|
-
`),
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
let
|
|
106
|
-
return
|
|
100
|
+
const a = (await Pi(s, 3, i)).split(`
|
|
101
|
+
`), u = [];
|
|
102
|
+
let h = null, f = null;
|
|
103
|
+
const x = s.substring(0, s.lastIndexOf("/") + 1), b = (m) => {
|
|
104
|
+
const v = m.split(":");
|
|
105
|
+
let p = 0;
|
|
106
|
+
return v.length === 3 ? (p += parseFloat(v[0]) * 3600, p += parseFloat(v[1]) * 60, p += parseFloat(v[2])) : (p += parseFloat(v[0]) * 60, p += parseFloat(v[1])), p;
|
|
107
107
|
};
|
|
108
|
-
for (let
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
} else if (
|
|
113
|
-
let [
|
|
114
|
-
!
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
108
|
+
for (let m of a)
|
|
109
|
+
if (m = m.trim(), m.includes("-->")) {
|
|
110
|
+
const v = m.split("-->");
|
|
111
|
+
h = b(v[0].trim()), f = b(v[1].trim());
|
|
112
|
+
} else if (h !== null && f !== null && m.length > 0) {
|
|
113
|
+
let [v, p] = m.split("#");
|
|
114
|
+
!v.match(/^https?:\/\//) && !v.startsWith("data:") && (v = x + v);
|
|
115
|
+
let S = 0, $ = 0, U = 0, H = 0;
|
|
116
|
+
if (p && p.startsWith("xywh=")) {
|
|
117
|
+
const q = p.replace("xywh=", "").split(",");
|
|
118
|
+
q.length === 4 && (S = parseInt(q[0]), $ = parseInt(q[1]), U = parseInt(q[2]), H = parseInt(q[3]));
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
U > 0 && H > 0 && u.push({ start: h, end: f, url: v, x: S, y: $, w: U, h: H }), h = null, f = null;
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return u;
|
|
123
123
|
} catch {
|
|
124
124
|
return t({ type: "warning", message: "Failed to load thumbnails", duration: 4e3 }), [];
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, Fi = () => {
|
|
127
127
|
if (!(typeof document > "u")) {
|
|
128
128
|
if (!document.getElementById("strata-fonts")) {
|
|
129
|
-
const
|
|
130
|
-
|
|
129
|
+
const s = document.createElement("link");
|
|
130
|
+
s.rel = "preconnect", s.href = "https://fonts.googleapis.com", document.head.appendChild(s);
|
|
131
131
|
const t = document.createElement("link");
|
|
132
132
|
t.rel = "preconnect", t.href = "https://fonts.gstatic.com", t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
133
|
-
const
|
|
134
|
-
|
|
133
|
+
const i = document.createElement("link");
|
|
134
|
+
i.id = "strata-fonts", i.rel = "stylesheet", i.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Press+Start+2P&family=Cinzel:wght@400;600;700&display=swap", document.head.appendChild(i);
|
|
135
135
|
}
|
|
136
136
|
if (!document.querySelector('script[src*="cast_sender.js"]') && !window.cast) {
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
const s = document.createElement("script");
|
|
138
|
+
s.src = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1", document.head.appendChild(s);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
},
|
|
141
|
+
}, rt = {
|
|
142
142
|
useNative: !1,
|
|
143
143
|
fixCapitalization: !1,
|
|
144
144
|
backgroundOpacity: 50,
|
|
@@ -149,7 +149,7 @@ const _e = (i) => {
|
|
|
149
149
|
isBold: !1,
|
|
150
150
|
textColor: "#ffffff",
|
|
151
151
|
verticalOffset: 40
|
|
152
|
-
},
|
|
152
|
+
}, Jt = "strata-settings", K = {
|
|
153
153
|
isPlaying: !1,
|
|
154
154
|
isBuffering: !1,
|
|
155
155
|
isLive: !1,
|
|
@@ -171,7 +171,7 @@ const _e = (i) => {
|
|
|
171
171
|
subtitleTracks: [],
|
|
172
172
|
currentSubtitle: -1,
|
|
173
173
|
subtitleOffset: 0,
|
|
174
|
-
subtitleSettings:
|
|
174
|
+
subtitleSettings: rt,
|
|
175
175
|
activeCues: [],
|
|
176
176
|
viewMode: "normal",
|
|
177
177
|
notifications: [],
|
|
@@ -185,92 +185,98 @@ const _e = (i) => {
|
|
|
185
185
|
isLocked: !1,
|
|
186
186
|
flipState: { horizontal: !1, vertical: !1 },
|
|
187
187
|
aspectRatio: "default",
|
|
188
|
+
videoFit: "contain",
|
|
189
|
+
brightness: 1,
|
|
188
190
|
isAutoSized: !1,
|
|
189
191
|
isLooping: !1,
|
|
190
192
|
controlsVisible: !0
|
|
191
|
-
},
|
|
193
|
+
}, Kt = (s = {}) => {
|
|
192
194
|
let t = {};
|
|
193
|
-
if (!
|
|
195
|
+
if (!s.disablePersistence && typeof window < "u")
|
|
194
196
|
try {
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
+
const a = localStorage.getItem(Jt);
|
|
198
|
+
a && (t = JSON.parse(a));
|
|
197
199
|
} catch {
|
|
198
200
|
}
|
|
199
|
-
const
|
|
200
|
-
...
|
|
201
|
+
const i = {
|
|
202
|
+
...rt,
|
|
201
203
|
...t.subtitleSettings || {},
|
|
202
|
-
...
|
|
203
|
-
};
|
|
204
|
+
...s.subtitleSettings || {}
|
|
205
|
+
}, o = s.videoFit ?? (s.autoSize ? "cover" : void 0) ?? t.videoFit ?? K.videoFit;
|
|
204
206
|
return {
|
|
205
|
-
...
|
|
207
|
+
...K,
|
|
206
208
|
...t,
|
|
207
209
|
// Load saved first
|
|
208
210
|
// Override with config if present (not undefined)
|
|
209
|
-
volume:
|
|
210
|
-
isMuted:
|
|
211
|
-
playbackRate:
|
|
212
|
-
audioGain:
|
|
213
|
-
theme:
|
|
214
|
-
themeColor:
|
|
215
|
-
iconSize:
|
|
216
|
-
subtitleSettings:
|
|
211
|
+
volume: s.volume ?? t.volume ?? K.volume,
|
|
212
|
+
isMuted: s.muted ?? t.isMuted ?? K.isMuted,
|
|
213
|
+
playbackRate: s.playbackRate ?? t.playbackRate ?? K.playbackRate,
|
|
214
|
+
audioGain: s.audioGain ?? t.audioGain ?? K.audioGain,
|
|
215
|
+
theme: s.theme ?? t.theme ?? K.theme,
|
|
216
|
+
themeColor: s.themeColor ?? t.themeColor ?? K.themeColor,
|
|
217
|
+
iconSize: s.iconSize ?? t.iconSize ?? K.iconSize,
|
|
218
|
+
subtitleSettings: i,
|
|
217
219
|
// Config overrides state for these visual modes
|
|
218
|
-
isAutoSized:
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
isAutoSized: s.autoSize ?? K.isAutoSized,
|
|
221
|
+
videoFit: o,
|
|
222
|
+
brightness: s.brightness ?? t.brightness ?? K.brightness,
|
|
223
|
+
isLive: s.isLive ?? t.isLive ?? K.isLive,
|
|
224
|
+
isLooping: s.loop ?? t.isLooping ?? K.isLooping,
|
|
221
225
|
sourceStatuses: {}
|
|
222
226
|
// Never persist statuses
|
|
223
227
|
};
|
|
224
228
|
};
|
|
225
|
-
class
|
|
226
|
-
constructor(t = {},
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
class $i {
|
|
230
|
+
constructor(t = {}, i) {
|
|
231
|
+
F(this, "video");
|
|
232
|
+
F(this, "container", null);
|
|
233
|
+
F(this, "events");
|
|
234
|
+
F(this, "store");
|
|
235
|
+
F(this, "plugins", /* @__PURE__ */ new Map());
|
|
236
|
+
F(this, "audioEngine");
|
|
237
|
+
F(this, "config");
|
|
238
|
+
F(this, "resizeObserver", null);
|
|
235
239
|
// Retry Logic
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
F(this, "retryCount", 0);
|
|
241
|
+
F(this, "maxRetries", 5);
|
|
242
|
+
F(this, "retryTimer", null);
|
|
243
|
+
F(this, "currentSource", null);
|
|
244
|
+
F(this, "currentSrc", "");
|
|
241
245
|
// Track configs from setSources are stored here to lazy load
|
|
242
|
-
|
|
246
|
+
F(this, "trackConfigs", []);
|
|
243
247
|
// Download Control
|
|
244
|
-
|
|
248
|
+
F(this, "activeDownloads", /* @__PURE__ */ new Map());
|
|
245
249
|
// Cast
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
const o =
|
|
251
|
-
this.store = new
|
|
252
|
-
const
|
|
253
|
-
if (this.store.setState({ isFullscreen:
|
|
254
|
-
const
|
|
250
|
+
F(this, "castInitialized", !1);
|
|
251
|
+
F(this, "boundCueChange");
|
|
252
|
+
F(this, "boundFullscreenChange");
|
|
253
|
+
Fi(), this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", this.video.preload = "auto", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new zi();
|
|
254
|
+
const o = Kt(t);
|
|
255
|
+
this.store = new Ii(o), this.audioEngine = new Ri(this.video), this.boundCueChange = this.handleCueChange.bind(this), this.boundFullscreenChange = () => {
|
|
256
|
+
const a = !!document.fullscreenElement;
|
|
257
|
+
if (this.store.setState({ isFullscreen: a }), this.emit("resize"), this.emit(a ? "fullscreen" : "fullscreen_exit"), a && this.config.autoOrientation && screen.orientation && "lock" in screen.orientation) {
|
|
258
|
+
const h = this.video.videoWidth > this.video.videoHeight ? "landscape" : "portrait";
|
|
255
259
|
try {
|
|
256
|
-
screen.orientation.lock(
|
|
260
|
+
screen.orientation.lock(h).catch(() => {
|
|
257
261
|
});
|
|
258
262
|
} catch {
|
|
259
263
|
}
|
|
260
|
-
} else !
|
|
261
|
-
}, this.video.volume = o.volume, this.video.muted = o.isMuted, this.video.playbackRate = o.playbackRate, this.video.loop = o.isLooping, o.audioGain > 1 && this.audioEngine.setGain(o.audioGain),
|
|
262
|
-
const
|
|
263
|
-
volume:
|
|
264
|
-
isMuted:
|
|
265
|
-
playbackRate:
|
|
266
|
-
subtitleSettings:
|
|
267
|
-
iconSize:
|
|
268
|
-
themeColor:
|
|
269
|
-
theme:
|
|
270
|
-
isLive:
|
|
271
|
-
isLooping:
|
|
264
|
+
} else !a && screen.orientation && "unlock" in screen.orientation && screen.orientation.unlock();
|
|
265
|
+
}, this.video.volume = o.volume, this.video.muted = o.isMuted, this.video.playbackRate = o.playbackRate, this.video.loop = o.isLooping, this.video.style.filter = `brightness(${o.brightness})`, o.audioGain > 1 && this.audioEngine.setGain(o.audioGain), this.video.style.objectFit = o.videoFit, this.initVideoListeners(), this.initMediaSession(), this.initCast(), t.disablePersistence || this.store.subscribe((a) => {
|
|
266
|
+
const u = {
|
|
267
|
+
volume: a.volume,
|
|
268
|
+
isMuted: a.isMuted,
|
|
269
|
+
playbackRate: a.playbackRate,
|
|
270
|
+
subtitleSettings: a.subtitleSettings,
|
|
271
|
+
iconSize: a.iconSize,
|
|
272
|
+
themeColor: a.themeColor,
|
|
273
|
+
theme: a.theme,
|
|
274
|
+
isLive: a.isLive,
|
|
275
|
+
isLooping: a.isLooping,
|
|
276
|
+
brightness: a.brightness,
|
|
277
|
+
videoFit: a.videoFit
|
|
272
278
|
};
|
|
273
|
-
localStorage.setItem(
|
|
279
|
+
localStorage.setItem(Jt, JSON.stringify(u));
|
|
274
280
|
});
|
|
275
281
|
}
|
|
276
282
|
// --- Instance Properties ---
|
|
@@ -321,14 +327,14 @@ class Ni {
|
|
|
321
327
|
this.skip(-t);
|
|
322
328
|
}
|
|
323
329
|
// --- Event API ---
|
|
324
|
-
on(t,
|
|
325
|
-
return this.events.on(t,
|
|
330
|
+
on(t, i) {
|
|
331
|
+
return this.events.on(t, i);
|
|
326
332
|
}
|
|
327
|
-
off(t,
|
|
328
|
-
return this.events.off(t,
|
|
333
|
+
off(t, i) {
|
|
334
|
+
return this.events.off(t, i);
|
|
329
335
|
}
|
|
330
|
-
emit(t,
|
|
331
|
-
return this.events.emit(t,
|
|
336
|
+
emit(t, i) {
|
|
337
|
+
return this.events.emit(t, i);
|
|
332
338
|
}
|
|
333
339
|
initVideoListeners() {
|
|
334
340
|
const t = (o) => this.store.setState(o);
|
|
@@ -356,8 +362,8 @@ class Ni {
|
|
|
356
362
|
"volumechange",
|
|
357
363
|
"waiting"
|
|
358
364
|
].forEach((o) => {
|
|
359
|
-
this.video.addEventListener(o, (
|
|
360
|
-
switch (this.emit(`video:${o}`,
|
|
365
|
+
this.video.addEventListener(o, (a) => {
|
|
366
|
+
switch (this.emit(`video:${o}`, a), o === "play" && this.emit("play"), o === "pause" && this.emit("pause"), o === "ended" && this.emit("ended"), o === "error" && this.emit("error", this.video.error), o === "seeked" && this.emit("seek"), o) {
|
|
361
367
|
case "play":
|
|
362
368
|
t({ isPlaying: !0 }), "mediaSession" in navigator && (navigator.mediaSession.playbackState = "playing"), this.updateMediaSessionPosition();
|
|
363
369
|
break;
|
|
@@ -418,157 +424,170 @@ class Ni {
|
|
|
418
424
|
}), document.addEventListener("fullscreenchange", this.boundFullscreenChange);
|
|
419
425
|
}
|
|
420
426
|
updateSourceStatus(t) {
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
sourceStatuses: { ...o.sourceStatuses, [
|
|
427
|
+
const i = this.store.get().currentSourceIndex;
|
|
428
|
+
i !== -1 && this.store.setState((o) => ({
|
|
429
|
+
sourceStatuses: { ...o.sourceStatuses, [i]: t }
|
|
424
430
|
}));
|
|
425
431
|
}
|
|
426
432
|
// --- Media Session API ---
|
|
427
433
|
initMediaSession() {
|
|
428
434
|
if (!("mediaSession" in navigator)) return;
|
|
429
435
|
const t = navigator.mediaSession;
|
|
430
|
-
t.setActionHandler("play", () => this.play()), t.setActionHandler("pause", () => this.pause()), t.setActionHandler("seekbackward", (
|
|
431
|
-
|
|
436
|
+
t.setActionHandler("play", () => this.play()), t.setActionHandler("pause", () => this.pause()), t.setActionHandler("seekbackward", (i) => this.skip(i.seekOffset ? -i.seekOffset : -10)), t.setActionHandler("seekforward", (i) => this.skip(i.seekOffset || 10)), t.setActionHandler("seekto", (i) => {
|
|
437
|
+
i.seekTime !== void 0 && this.seek(i.seekTime);
|
|
432
438
|
}), t.setActionHandler("stop", () => {
|
|
433
439
|
this.pause(), this.seek(0);
|
|
434
440
|
}), t.setActionHandler("previoustrack", () => {
|
|
435
|
-
const
|
|
436
|
-
|
|
441
|
+
const i = this.store.get().currentSourceIndex;
|
|
442
|
+
i > 0 && this.switchSource(i - 1);
|
|
437
443
|
}), t.setActionHandler("nexttrack", () => {
|
|
438
|
-
const
|
|
439
|
-
|
|
444
|
+
const i = this.store.get().currentSourceIndex, o = this.store.get().sources.length;
|
|
445
|
+
i < o - 1 && this.switchSource(i + 1);
|
|
440
446
|
});
|
|
441
447
|
}
|
|
442
448
|
updateMediaSessionMetadata() {
|
|
443
|
-
var o,
|
|
449
|
+
var o, a;
|
|
444
450
|
if (!("mediaSession" in navigator)) return;
|
|
445
|
-
const t = ((o = this.currentSource) == null ? void 0 : o.name) || ((
|
|
446
|
-
this.config.poster &&
|
|
451
|
+
const t = ((o = this.currentSource) == null ? void 0 : o.name) || ((a = this.currentSource) == null ? void 0 : a.url.split("/").pop()) || "Video", i = [];
|
|
452
|
+
this.config.poster && i.push({ src: this.config.poster, sizes: "512x512", type: "image/jpeg" }), i.push({ src: "logo.png", sizes: "512x512", type: "image/png" }), navigator.mediaSession.metadata = new MediaMetadata({
|
|
447
453
|
title: t,
|
|
448
454
|
artist: "StrataPlayer",
|
|
449
|
-
artwork:
|
|
455
|
+
artwork: i
|
|
450
456
|
});
|
|
451
457
|
}
|
|
452
458
|
updateMediaSessionPosition() {
|
|
453
459
|
if (!("mediaSession" in navigator)) return;
|
|
454
|
-
const t = this.video.duration,
|
|
455
|
-
if (!isNaN(t) && isFinite(t) && !isNaN(
|
|
460
|
+
const t = this.video.duration, i = this.video.currentTime, o = this.video.playbackRate;
|
|
461
|
+
if (!isNaN(t) && isFinite(t) && !isNaN(i))
|
|
456
462
|
try {
|
|
457
463
|
navigator.mediaSession.setPositionState({
|
|
458
464
|
duration: Math.max(0, t),
|
|
459
465
|
playbackRate: o,
|
|
460
|
-
position: Math.max(0, Math.min(
|
|
466
|
+
position: Math.max(0, Math.min(i, t))
|
|
461
467
|
// Ensure within [0, duration]
|
|
462
468
|
});
|
|
463
|
-
} catch (
|
|
464
|
-
console.warn("MediaSession Position Error:",
|
|
469
|
+
} catch (a) {
|
|
470
|
+
console.warn("MediaSession Position Error:", a);
|
|
465
471
|
}
|
|
466
472
|
}
|
|
467
|
-
triggerError(t,
|
|
468
|
-
|
|
473
|
+
triggerError(t, i = !1) {
|
|
474
|
+
i ? this.handleError(t) : this.notify({ type: "warning", message: `Warning: ${t}`, duration: 5e3 });
|
|
469
475
|
}
|
|
470
476
|
handleError(t) {
|
|
471
|
-
const
|
|
472
|
-
if (this.removeNotification("retry"), this.emit("video:error",
|
|
477
|
+
const i = this.video.error, o = t || (i == null ? void 0 : i.message) || (i ? `Code ${i.code}` : "Unknown Error");
|
|
478
|
+
if (this.removeNotification("retry"), this.emit("video:error", i), this.retryCount < this.maxRetries) {
|
|
473
479
|
this.retryCount++;
|
|
474
|
-
const
|
|
480
|
+
const a = Math.pow(2, this.retryCount - 1) * 1500;
|
|
475
481
|
this.notify({
|
|
476
482
|
id: "retry",
|
|
477
483
|
type: "loading",
|
|
478
|
-
|
|
479
|
-
|
|
484
|
+
// Cleaned up formatting with newline
|
|
485
|
+
message: `Error: ${o}.
|
|
486
|
+
Retrying (${this.retryCount}/${this.maxRetries})`
|
|
487
|
+
}), console.warn(`[StrataPlayer] Error: ${o}. Retrying in ${a}ms...`), this.retryTimer && clearTimeout(this.retryTimer), this.retryTimer = setTimeout(() => {
|
|
480
488
|
if (this.currentSource) {
|
|
481
489
|
this.load(this.currentSource, this.trackConfigs, !0);
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
484
|
-
const
|
|
485
|
-
this.video.currentTime =
|
|
490
|
+
const u = this.store.get().currentTime;
|
|
491
|
+
if (u > 0) {
|
|
492
|
+
const h = () => {
|
|
493
|
+
this.video.currentTime = u, this.video.removeEventListener("canplay", h);
|
|
486
494
|
};
|
|
487
|
-
this.video.addEventListener("canplay",
|
|
495
|
+
this.video.addEventListener("canplay", h);
|
|
488
496
|
}
|
|
489
497
|
}
|
|
490
|
-
},
|
|
498
|
+
}, a);
|
|
491
499
|
} else {
|
|
492
500
|
this.removeNotification("retry");
|
|
493
|
-
const
|
|
494
|
-
this.store.setState({ error:
|
|
501
|
+
const a = `Failed to play after ${this.maxRetries} attempts: ${o}`;
|
|
502
|
+
this.store.setState({ error: a }), this.emit("error", a), this.updateSourceStatus("error");
|
|
495
503
|
}
|
|
496
504
|
}
|
|
497
505
|
updateBuffer() {
|
|
498
506
|
const t = [];
|
|
499
|
-
for (let
|
|
507
|
+
for (let i = 0; i < this.video.buffered.length; i++)
|
|
500
508
|
t.push({
|
|
501
|
-
start: this.video.buffered.start(
|
|
502
|
-
end: this.video.buffered.end(
|
|
509
|
+
start: this.video.buffered.start(i),
|
|
510
|
+
end: this.video.buffered.end(i)
|
|
503
511
|
});
|
|
504
512
|
this.store.setState({ buffered: t });
|
|
505
513
|
}
|
|
506
|
-
updateSubtitleTrackState(t,
|
|
514
|
+
updateSubtitleTrackState(t, i) {
|
|
507
515
|
this.store.setState((o) => {
|
|
508
|
-
const
|
|
509
|
-
return
|
|
516
|
+
const a = [...o.subtitleTracks];
|
|
517
|
+
return a[t] && (a[t] = { ...a[t], ...i }), { subtitleTracks: a };
|
|
510
518
|
});
|
|
511
519
|
}
|
|
512
520
|
// --- Utility ---
|
|
513
|
-
async fetchWithRetry(t,
|
|
514
|
-
const
|
|
515
|
-
for (let
|
|
516
|
-
const
|
|
521
|
+
async fetchWithRetry(t, i = 3, o, a) {
|
|
522
|
+
const u = o ?? this.config.fetchTimeout ?? 3e4;
|
|
523
|
+
for (let h = 0; h < i; h++) {
|
|
524
|
+
const f = a ? null : new AbortController(), x = a || (f == null ? void 0 : f.signal), b = setTimeout(() => f == null ? void 0 : f.abort(), u);
|
|
517
525
|
try {
|
|
518
|
-
const
|
|
519
|
-
if (clearTimeout(
|
|
520
|
-
return
|
|
521
|
-
} catch (
|
|
522
|
-
if (clearTimeout(
|
|
523
|
-
if (
|
|
524
|
-
if (
|
|
525
|
-
if (
|
|
526
|
-
console.warn(`Fetch timeout (${
|
|
526
|
+
const m = await fetch(t, { signal: x });
|
|
527
|
+
if (clearTimeout(b), !m.ok) throw new Error(`HTTP ${m.status}`);
|
|
528
|
+
return m;
|
|
529
|
+
} catch (m) {
|
|
530
|
+
if (clearTimeout(b), a != null && a.aborted) throw new Error("Aborted");
|
|
531
|
+
if (h === i - 1) throw m;
|
|
532
|
+
if (m.name === "AbortError") {
|
|
533
|
+
if (a != null && a.aborted) throw m;
|
|
534
|
+
console.warn(`Fetch timeout (${u}ms) for ${t}`);
|
|
527
535
|
}
|
|
528
|
-
await new Promise((
|
|
536
|
+
await new Promise((v) => setTimeout(v, 1e3 * Math.pow(2, h)));
|
|
529
537
|
}
|
|
530
538
|
}
|
|
531
539
|
throw new Error("Fetch failed");
|
|
532
540
|
}
|
|
533
541
|
// Helper to ensure subtitle content is VTT
|
|
534
542
|
convertToVTT(t) {
|
|
535
|
-
|
|
543
|
+
let i = t.trim();
|
|
544
|
+
if (!i.startsWith("WEBVTT")) {
|
|
545
|
+
let o = i.replace(/(\d+:\d{2}:\d{2}),(\d{3})/g, "$1.$2");
|
|
546
|
+
return o = o.replace(/(\d{2}:\d{2}),(\d{3})/g, "$1.$2"), `WEBVTT
|
|
536
547
|
|
|
537
|
-
` +
|
|
548
|
+
` + o;
|
|
549
|
+
}
|
|
550
|
+
return i;
|
|
551
|
+
}
|
|
552
|
+
// Enhanced Format Duration: Days, Hours, Minutes, Seconds
|
|
553
|
+
formatDuration(t) {
|
|
554
|
+
if (!isFinite(t) || t <= 0) return "";
|
|
555
|
+
const i = Math.floor(t / 1e3), o = Math.floor(i / (3600 * 24)), a = Math.floor(i % (3600 * 24) / 3600), u = Math.floor(i % 3600 / 60), h = i % 60, f = [];
|
|
556
|
+
return o > 0 && f.push(`${o}d`), a > 0 && f.push(`${a}h`), u > 0 && f.push(`${u}m`), f.push(`${h}s`), f.join(" ");
|
|
538
557
|
}
|
|
539
558
|
// --- Core Methods ---
|
|
540
559
|
attach(t) {
|
|
541
|
-
this.resizeObserver && this.resizeObserver.disconnect(), this.container = t, this.container.appendChild(this.video), this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = this.store.get().
|
|
542
|
-
for (const o of
|
|
560
|
+
this.resizeObserver && this.resizeObserver.disconnect(), this.container = t, this.container.appendChild(this.video), this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = this.store.get().videoFit, this.video.style.backgroundColor = "black", this.updateAspectRatio(), this.resizeObserver = new ResizeObserver((i) => {
|
|
561
|
+
for (const o of i)
|
|
543
562
|
this.emit("resize", { width: o.contentRect.width, height: o.contentRect.height }), this.updateAspectRatio();
|
|
544
563
|
}), this.resizeObserver.observe(this.container), this.emit("ready");
|
|
545
564
|
}
|
|
546
565
|
use(t) {
|
|
547
566
|
this.plugins.has(t.name) || (t.init(this), this.plugins.set(t.name, t));
|
|
548
567
|
}
|
|
549
|
-
setSources(t,
|
|
550
|
-
this.store.setState({ sources: t }), this.trackConfigs =
|
|
568
|
+
setSources(t, i = []) {
|
|
569
|
+
this.store.setState({ sources: t }), this.trackConfigs = i, t.length > 0 && this.load(t[0], i);
|
|
551
570
|
}
|
|
552
571
|
switchSource(t) {
|
|
553
|
-
const
|
|
554
|
-
if (t >= 0 && t <
|
|
555
|
-
const o = this.video.currentTime,
|
|
556
|
-
this.load(
|
|
557
|
-
const
|
|
558
|
-
this.video.currentTime = o,
|
|
572
|
+
const i = this.store.get().sources;
|
|
573
|
+
if (t >= 0 && t < i.length) {
|
|
574
|
+
const o = this.video.currentTime, a = !this.video.paused;
|
|
575
|
+
this.load(i[t], this.trackConfigs);
|
|
576
|
+
const u = () => {
|
|
577
|
+
this.video.currentTime = o, a && this.video.play(), this.video.removeEventListener("canplay", u);
|
|
559
578
|
};
|
|
560
|
-
this.video.addEventListener("canplay",
|
|
579
|
+
this.video.addEventListener("canplay", u);
|
|
561
580
|
}
|
|
562
581
|
}
|
|
563
|
-
load(t,
|
|
582
|
+
load(t, i = [], o = !1) {
|
|
564
583
|
this.retryTimer && clearTimeout(this.retryTimer);
|
|
565
|
-
const
|
|
566
|
-
o || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc =
|
|
567
|
-
const
|
|
568
|
-
...
|
|
569
|
-
index:
|
|
584
|
+
const a = typeof t == "string" ? { url: t, type: "auto" } : t;
|
|
585
|
+
o || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc = a.url, this.currentSource = a, this.trackConfigs = i;
|
|
586
|
+
const h = this.store.get().sources.findIndex((v) => v.url === a.url), f = i.map((v, p) => ({
|
|
587
|
+
...v,
|
|
588
|
+
index: p,
|
|
570
589
|
status: "idle",
|
|
571
|
-
isDefault: !!
|
|
590
|
+
isDefault: !!v.default
|
|
572
591
|
}));
|
|
573
592
|
this.store.setState({
|
|
574
593
|
isBuffering: !0,
|
|
@@ -578,23 +597,23 @@ class Ni {
|
|
|
578
597
|
audioTracks: [],
|
|
579
598
|
currentAudioTrack: -1,
|
|
580
599
|
// Reset audio track
|
|
581
|
-
subtitleTracks:
|
|
600
|
+
subtitleTracks: f,
|
|
582
601
|
currentSubtitle: -1,
|
|
583
|
-
currentSourceIndex:
|
|
602
|
+
currentSourceIndex: h
|
|
584
603
|
}), this.updateMediaSessionMetadata();
|
|
585
|
-
let
|
|
586
|
-
|
|
587
|
-
const
|
|
588
|
-
for (;
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
|
|
604
|
+
let x = a.type || "auto";
|
|
605
|
+
x === "auto" && (a.url.includes(".m3u8") ? x = "hls" : a.url.includes(".mpd") ? x = "dash" : a.url.includes(".flv") || a.url.includes(".ts") ? x = "mpegts" : a.url.startsWith("magnet:") || a.url.includes(".torrent") ? x = "webtorrent" : x = "mp4"), this.events.emit("load", { url: a.url, type: x });
|
|
606
|
+
const b = this.video.getElementsByTagName("track");
|
|
607
|
+
for (; b.length > 0; )
|
|
608
|
+
b[0].remove();
|
|
609
|
+
const m = f.findIndex((v) => v.default);
|
|
610
|
+
m !== -1 && this.setSubtitle(m), (x === "mp4" || x === "webm" || x === "ogg") && (this.video.src = a.url);
|
|
592
611
|
}
|
|
593
612
|
// Wrapper for external subtitle API
|
|
594
|
-
loadSubtitle(t,
|
|
595
|
-
const o = this.store.get().subtitleTracks.length,
|
|
613
|
+
loadSubtitle(t, i = "Subtitle") {
|
|
614
|
+
const o = this.store.get().subtitleTracks.length, a = {
|
|
596
615
|
src: t,
|
|
597
|
-
label:
|
|
616
|
+
label: i,
|
|
598
617
|
srcLang: "user",
|
|
599
618
|
default: !0,
|
|
600
619
|
kind: "subtitles",
|
|
@@ -602,26 +621,26 @@ class Ni {
|
|
|
602
621
|
status: "idle",
|
|
603
622
|
isDefault: !0
|
|
604
623
|
};
|
|
605
|
-
this.store.setState((
|
|
606
|
-
subtitleTracks: [...
|
|
624
|
+
this.store.setState((u) => ({
|
|
625
|
+
subtitleTracks: [...u.subtitleTracks, a]
|
|
607
626
|
})), this.setSubtitle(o);
|
|
608
627
|
}
|
|
609
|
-
addTextTrack(t,
|
|
628
|
+
addTextTrack(t, i) {
|
|
610
629
|
const o = new FileReader();
|
|
611
|
-
o.onload = (
|
|
612
|
-
var
|
|
613
|
-
if (!((
|
|
614
|
-
let
|
|
615
|
-
|
|
616
|
-
const
|
|
617
|
-
this.loadSubtitle(
|
|
630
|
+
o.onload = (a) => {
|
|
631
|
+
var x;
|
|
632
|
+
if (!((x = a.target) != null && x.result)) return;
|
|
633
|
+
let u = a.target.result;
|
|
634
|
+
u = this.convertToVTT(u);
|
|
635
|
+
const h = new Blob([u], { type: "text/vtt" }), f = URL.createObjectURL(h);
|
|
636
|
+
this.loadSubtitle(f, i), this.notify({ type: "success", message: "Subtitle uploaded", duration: 3e3 });
|
|
618
637
|
}, o.onerror = () => {
|
|
619
638
|
this.notify({ type: "error", message: "Failed to read file", duration: 3e3 });
|
|
620
639
|
}, o.readAsText(t);
|
|
621
640
|
}
|
|
622
|
-
addTextTrackInternal(t,
|
|
623
|
-
const
|
|
624
|
-
|
|
641
|
+
addTextTrackInternal(t, i, o = "", a = !1) {
|
|
642
|
+
const u = document.createElement("track");
|
|
643
|
+
u.kind = "subtitles", u.label = i, u.src = t, u.srclang = o, a && (u.default = !0), this.video.appendChild(u);
|
|
625
644
|
}
|
|
626
645
|
play() {
|
|
627
646
|
return this.video.play();
|
|
@@ -634,15 +653,15 @@ class Ni {
|
|
|
634
653
|
}
|
|
635
654
|
seek(t) {
|
|
636
655
|
if (isNaN(t)) return;
|
|
637
|
-
const
|
|
638
|
-
this.store.setState({ currentTime:
|
|
656
|
+
const i = Math.max(0, Math.min(t, this.video.duration));
|
|
657
|
+
this.store.setState({ currentTime: i }), this.video.currentTime = i;
|
|
639
658
|
}
|
|
640
659
|
skip(t) {
|
|
641
660
|
this.seek(this.video.currentTime + t);
|
|
642
661
|
}
|
|
643
662
|
setVolume(t) {
|
|
644
|
-
const
|
|
645
|
-
this.video.volume =
|
|
663
|
+
const i = Math.max(0, Math.min(t, 1));
|
|
664
|
+
this.video.volume = i, i > 0 && this.video.muted && (this.video.muted = !1), i === 0 && (this.video.muted = !0);
|
|
646
665
|
}
|
|
647
666
|
toggleMute() {
|
|
648
667
|
this.video.muted = !this.video.muted;
|
|
@@ -681,8 +700,8 @@ class Ni {
|
|
|
681
700
|
const t = this.store.get().isWebFullscreen;
|
|
682
701
|
document.fullscreenElement && document.exitFullscreen().catch(() => {
|
|
683
702
|
});
|
|
684
|
-
const
|
|
685
|
-
this.store.setState({ isWebFullscreen:
|
|
703
|
+
const i = !t;
|
|
704
|
+
this.store.setState({ isWebFullscreen: i }), typeof document < "u" && (document.body.style.overflow = i ? "hidden" : ""), this.emit("webfullscreen", i);
|
|
686
705
|
}
|
|
687
706
|
togglePip() {
|
|
688
707
|
document.pictureInPictureElement ? document.exitPictureInPicture() : this.video !== document.pictureInPictureElement && this.video.requestPictureInPicture && this.video.requestPictureInPicture();
|
|
@@ -690,12 +709,12 @@ class Ni {
|
|
|
690
709
|
screenshot() {
|
|
691
710
|
const t = document.createElement("canvas");
|
|
692
711
|
t.width = this.video.videoWidth, t.height = this.video.videoHeight;
|
|
693
|
-
const
|
|
694
|
-
if (
|
|
695
|
-
|
|
712
|
+
const i = t.getContext("2d");
|
|
713
|
+
if (i) {
|
|
714
|
+
i.drawImage(this.video, 0, 0, t.width, t.height);
|
|
696
715
|
try {
|
|
697
|
-
const o = t.toDataURL("image/png"),
|
|
698
|
-
|
|
716
|
+
const o = t.toDataURL("image/png"), a = document.createElement("a");
|
|
717
|
+
a.download = `screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`, a.href = o, a.click(), this.notify({ type: "success", message: "Screenshot saved", duration: 2e3 });
|
|
699
718
|
} catch {
|
|
700
719
|
this.notify({ type: "error", message: "Failed to take screenshot", duration: 3e3 });
|
|
701
720
|
}
|
|
@@ -708,34 +727,41 @@ class Ni {
|
|
|
708
727
|
this.video.loop = !this.video.loop, this.store.setState({ isLooping: this.video.loop }), this.notify({ type: "info", message: `Loop: ${this.video.loop ? "On" : "Off"}`, duration: 1500 });
|
|
709
728
|
}
|
|
710
729
|
setFlip(t) {
|
|
711
|
-
const
|
|
712
|
-
...
|
|
713
|
-
[t]: !
|
|
730
|
+
const i = this.store.get().flipState, o = {
|
|
731
|
+
...i,
|
|
732
|
+
[t]: !i[t]
|
|
714
733
|
};
|
|
715
734
|
this.store.setState({ flipState: o });
|
|
716
|
-
const
|
|
717
|
-
this.video.style.transform = `scale(${
|
|
735
|
+
const a = o.horizontal ? -1 : 1, u = o.vertical ? -1 : 1;
|
|
736
|
+
this.video.style.transform = `scale(${a}, ${u})`;
|
|
718
737
|
}
|
|
719
738
|
setAspectRatio(t) {
|
|
720
739
|
this.store.setState({ aspectRatio: t }), this.updateAspectRatio(), t !== "default" && this.notify({ type: "info", message: `Aspect Ratio: ${t}`, duration: 2e3 });
|
|
721
740
|
}
|
|
741
|
+
setVideoFit(t) {
|
|
742
|
+
this.store.setState({ videoFit: t }), this.video.style.objectFit = t, this.updateAspectRatio();
|
|
743
|
+
}
|
|
744
|
+
setBrightness(t) {
|
|
745
|
+
const i = Math.max(0, Math.min(t, 2));
|
|
746
|
+
this.store.setState({ brightness: i }), this.video.style.filter = `brightness(${i})`;
|
|
747
|
+
}
|
|
722
748
|
updateAspectRatio() {
|
|
723
749
|
if (!this.container) return;
|
|
724
|
-
const { aspectRatio: t,
|
|
750
|
+
const { aspectRatio: t, videoFit: i } = this.store.get();
|
|
725
751
|
if (t === "default") {
|
|
726
|
-
this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit =
|
|
752
|
+
this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = i;
|
|
727
753
|
return;
|
|
728
754
|
}
|
|
729
|
-
const [o,
|
|
730
|
-
if (!o || !
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
const
|
|
734
|
-
let
|
|
735
|
-
|
|
755
|
+
const [o, a] = t.split(":").map(Number);
|
|
756
|
+
if (!o || !a) return;
|
|
757
|
+
const u = o / a, h = this.container.getBoundingClientRect();
|
|
758
|
+
if (h.width === 0 || h.height === 0) return;
|
|
759
|
+
const f = h.width / h.height;
|
|
760
|
+
let x, b;
|
|
761
|
+
f > u ? (b = h.height, x = b * u) : (x = h.width, b = x / u), this.video.style.width = `${x}px`, this.video.style.height = `${b}px`, this.video.style.objectFit = "fill";
|
|
736
762
|
}
|
|
737
763
|
initCast() {
|
|
738
|
-
const t = window,
|
|
764
|
+
const t = window, i = () => {
|
|
739
765
|
if (!this.castInitialized)
|
|
740
766
|
try {
|
|
741
767
|
t.cast && t.cast.framework && t.chrome && t.chrome.cast && (t.cast.framework.CastContext.getInstance().setOptions({
|
|
@@ -746,8 +772,8 @@ class Ni {
|
|
|
746
772
|
console.warn("Cast Init Error or already initialized", o);
|
|
747
773
|
}
|
|
748
774
|
};
|
|
749
|
-
t.cast && t.cast.framework ?
|
|
750
|
-
o &&
|
|
775
|
+
t.cast && t.cast.framework ? i() : t.__onGCastApiAvailable = (o) => {
|
|
776
|
+
o && i();
|
|
751
777
|
};
|
|
752
778
|
}
|
|
753
779
|
requestCast() {
|
|
@@ -756,8 +782,8 @@ class Ni {
|
|
|
756
782
|
try {
|
|
757
783
|
this.castInitialized || this.initCast(), t.cast.framework.CastContext.getInstance().requestSession().then(() => {
|
|
758
784
|
this.loadMediaToCast();
|
|
759
|
-
}).catch((
|
|
760
|
-
|
|
785
|
+
}).catch((i) => {
|
|
786
|
+
i !== "cancel" && this.notify({ type: "error", message: "Cast failed: " + i, duration: 3e3 });
|
|
761
787
|
});
|
|
762
788
|
} catch {
|
|
763
789
|
this.notify({ type: "warning", message: "Cast not available yet", duration: 3e3 });
|
|
@@ -768,14 +794,14 @@ class Ni {
|
|
|
768
794
|
loadMediaToCast() {
|
|
769
795
|
const t = window;
|
|
770
796
|
try {
|
|
771
|
-
const
|
|
772
|
-
if (!
|
|
773
|
-
const o = new t.chrome.cast.media.MediaInfo(this.currentSrc, this.currentSrc.includes(".m3u8") ? "application/x-mpegurl" : "video/mp4"),
|
|
774
|
-
|
|
797
|
+
const i = t.cast.framework.CastContext.getInstance().getCurrentSession();
|
|
798
|
+
if (!i) return;
|
|
799
|
+
const o = new t.chrome.cast.media.MediaInfo(this.currentSrc, this.currentSrc.includes(".m3u8") ? "application/x-mpegurl" : "video/mp4"), a = new t.chrome.cast.media.LoadRequest(o);
|
|
800
|
+
i.loadMedia(a).then(() => {
|
|
775
801
|
this.notify({ type: "success", message: "Casting...", duration: 3e3 });
|
|
776
|
-
}).catch((
|
|
777
|
-
} catch (
|
|
778
|
-
console.error("Failed to load media into Cast session",
|
|
802
|
+
}).catch((u) => console.error("Cast load error", u));
|
|
803
|
+
} catch (i) {
|
|
804
|
+
console.error("Failed to load media into Cast session", i);
|
|
779
805
|
}
|
|
780
806
|
}
|
|
781
807
|
handleCueChange() {
|
|
@@ -783,317 +809,372 @@ class Ni {
|
|
|
783
809
|
this.store.setState({ activeCues: [] });
|
|
784
810
|
return;
|
|
785
811
|
}
|
|
786
|
-
const o = Array.from(this.video.textTracks).filter((
|
|
812
|
+
const o = Array.from(this.video.textTracks).filter((a) => a.kind === "subtitles" || a.kind === "captions").find((a) => a.mode === "showing" || a.mode === "hidden");
|
|
787
813
|
if (o && o.activeCues) {
|
|
788
|
-
const
|
|
789
|
-
this.store.setState({ activeCues:
|
|
814
|
+
const a = Array.from(o.activeCues).map((u) => u.text);
|
|
815
|
+
this.store.setState({ activeCues: a });
|
|
790
816
|
} else
|
|
791
817
|
this.store.setState({ activeCues: [] });
|
|
792
818
|
}
|
|
793
819
|
async setSubtitle(t) {
|
|
794
820
|
const o = this.store.get().subtitleTracks[t];
|
|
795
|
-
if (Array.from(this.video.textTracks).forEach((
|
|
796
|
-
|
|
821
|
+
if (Array.from(this.video.textTracks).forEach((h) => {
|
|
822
|
+
h.removeEventListener("cuechange", this.boundCueChange), h.mode = "disabled";
|
|
797
823
|
}), this.store.setState({ currentSubtitle: t, subtitleOffset: 0, activeCues: [] }), t === -1 || !o) return;
|
|
798
824
|
if (o.status === "idle" || o.status === "error") {
|
|
799
825
|
this.updateSubtitleTrackState(t, { status: "loading" });
|
|
800
826
|
try {
|
|
801
|
-
let
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
this.addTextTrackInternal(
|
|
805
|
-
} catch (
|
|
806
|
-
this.updateSubtitleTrackState(t, { status: "error" }), console.error("Failed to load subtitle",
|
|
827
|
+
let f = await (await this.fetchWithRetry(o.src)).text();
|
|
828
|
+
f = this.convertToVTT(f);
|
|
829
|
+
const x = new Blob([f], { type: "text/vtt" }), b = URL.createObjectURL(x);
|
|
830
|
+
this.addTextTrackInternal(b, o.label, o.srcLang, !1), this.updateSubtitleTrackState(t, { status: "success" });
|
|
831
|
+
} catch (h) {
|
|
832
|
+
this.updateSubtitleTrackState(t, { status: "error" }), console.error("Failed to load subtitle", h);
|
|
807
833
|
return;
|
|
808
834
|
}
|
|
809
835
|
}
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
h
|
|
836
|
+
const a = Array.from(this.video.textTracks);
|
|
837
|
+
let u = a.find((h) => h.label === o.label && h.language === o.srcLang);
|
|
838
|
+
if (u || (u = a.find((h) => h.label === o.label)), u) {
|
|
839
|
+
const h = this.store.get().subtitleSettings;
|
|
840
|
+
u.mode = h.useNative ? "showing" : "hidden", u.addEventListener("cuechange", this.boundCueChange), this.handleCueChange();
|
|
814
841
|
}
|
|
815
842
|
}
|
|
816
843
|
updateSubtitleSettings(t) {
|
|
817
844
|
const o = { ...this.store.get().subtitleSettings, ...t };
|
|
818
845
|
if (this.store.setState({ subtitleSettings: o }), t.useNative !== void 0) {
|
|
819
|
-
const
|
|
820
|
-
if (
|
|
821
|
-
const
|
|
822
|
-
|
|
846
|
+
const a = this.store.get().currentSubtitle;
|
|
847
|
+
if (a !== -1) {
|
|
848
|
+
const h = this.store.get().subtitleTracks[a], f = Array.from(this.video.textTracks).find((x) => x.label === h.label && x.language === h.srcLang);
|
|
849
|
+
f && (f.mode = t.useNative ? "showing" : "hidden");
|
|
823
850
|
}
|
|
824
851
|
}
|
|
825
852
|
}
|
|
826
853
|
resetSubtitleSettings() {
|
|
827
|
-
this.store.setState({ subtitleSettings:
|
|
854
|
+
this.store.setState({ subtitleSettings: rt }), this.updateSubtitleSettings({ useNative: !1 });
|
|
828
855
|
}
|
|
829
856
|
setSubtitleOffset(t) {
|
|
830
|
-
const
|
|
831
|
-
Math.abs(o) < 1e-3 || (Array.from(this.video.textTracks).forEach((
|
|
832
|
-
(
|
|
833
|
-
|
|
857
|
+
const i = this.store.get().subtitleOffset, o = t - i;
|
|
858
|
+
Math.abs(o) < 1e-3 || (Array.from(this.video.textTracks).forEach((a) => {
|
|
859
|
+
(a.mode === "showing" || a.mode === "hidden") && a.cues && Array.from(a.cues).forEach((u) => {
|
|
860
|
+
u.startTime += o, u.endTime += o;
|
|
834
861
|
});
|
|
835
862
|
}), this.store.setState({ subtitleOffset: t }), this.notify({ type: "info", message: `Subtitle Offset: ${t > 0 ? "+" : ""}${t.toFixed(1)}s`, duration: 1500 }));
|
|
836
863
|
}
|
|
837
|
-
cancelDownload() {
|
|
838
|
-
|
|
864
|
+
cancelDownload(t) {
|
|
865
|
+
var i;
|
|
866
|
+
t && this.activeDownloads.has(t) ? ((i = this.activeDownloads.get(t)) == null || i.abort(), this.activeDownloads.delete(t), this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }), this.removeNotification(t)) : t || this.activeDownloads.size > 0 && (this.activeDownloads.forEach((o) => o.abort()), this.activeDownloads.clear(), this.notify({ type: "info", message: "All downloads cancelled", duration: 2e3 }));
|
|
839
867
|
}
|
|
840
868
|
async download(t = {}) {
|
|
841
|
-
var h,
|
|
842
|
-
const
|
|
843
|
-
if (!
|
|
844
|
-
if (
|
|
845
|
-
this.downloadHls(
|
|
869
|
+
var h, f, x;
|
|
870
|
+
const i = ((h = this.currentSource) == null ? void 0 : h.url) || this.video.src;
|
|
871
|
+
if (!i) return;
|
|
872
|
+
if (i.includes(".m3u8") || ((f = this.currentSource) == null ? void 0 : f.type) === "hls") {
|
|
873
|
+
this.downloadHls(i, t.format || "ts");
|
|
846
874
|
return;
|
|
847
875
|
}
|
|
848
|
-
if (
|
|
876
|
+
if (i.startsWith("blob:")) {
|
|
849
877
|
this.notify({ type: "warning", message: "Stream download not supported in browser.", duration: 4e3 });
|
|
850
878
|
return;
|
|
851
879
|
}
|
|
852
|
-
|
|
853
|
-
|
|
880
|
+
const o = Math.random().toString(36).substr(2, 9), a = new AbortController();
|
|
881
|
+
this.activeDownloads.set(o, a);
|
|
882
|
+
const u = a.signal;
|
|
883
|
+
this.notify({
|
|
884
|
+
id: o,
|
|
854
885
|
type: "loading",
|
|
855
|
-
message: "Preparing download
|
|
886
|
+
message: "Preparing download",
|
|
856
887
|
progress: 0,
|
|
857
888
|
action: {
|
|
858
889
|
label: "Cancel",
|
|
859
|
-
onClick: () => this.cancelDownload()
|
|
890
|
+
onClick: () => this.cancelDownload(o)
|
|
860
891
|
}
|
|
861
892
|
});
|
|
862
893
|
try {
|
|
863
|
-
const
|
|
864
|
-
if (!
|
|
865
|
-
const
|
|
866
|
-
let
|
|
867
|
-
const
|
|
894
|
+
const b = await this.fetchWithRetry(i, 3, void 0, u);
|
|
895
|
+
if (!b.body) throw new Error("No body");
|
|
896
|
+
const m = b.body.getReader(), v = b.headers.get("Content-Length"), p = v ? parseInt(v, 10) : 0;
|
|
897
|
+
let S = 0;
|
|
898
|
+
const $ = [], U = Date.now(), H = [];
|
|
899
|
+
let q = 0;
|
|
868
900
|
for (; ; ) {
|
|
869
|
-
const { done:
|
|
870
|
-
if (
|
|
871
|
-
if (
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
901
|
+
const { done: fe, value: k } = await m.read();
|
|
902
|
+
if (fe) break;
|
|
903
|
+
if ($.push(k), S += k.length, p) {
|
|
904
|
+
const j = Date.now();
|
|
905
|
+
if (j - q > 800 || S === p) {
|
|
906
|
+
q = j;
|
|
907
|
+
const D = Math.round(S / p * 100);
|
|
908
|
+
for (H.push({ time: j, loaded: S }); H.length > 0 && j - H[0].time > 5e3; )
|
|
909
|
+
H.shift();
|
|
910
|
+
let T = "", n = 0;
|
|
911
|
+
if (H.length > 1) {
|
|
912
|
+
const X = H[0], _ = H[H.length - 1], ne = _.time - X.time, re = _.loaded - X.loaded;
|
|
913
|
+
ne > 0 && (n = re / ne);
|
|
914
|
+
} else {
|
|
915
|
+
const X = j - U;
|
|
916
|
+
X > 0 && (n = S / X);
|
|
881
917
|
}
|
|
882
|
-
|
|
918
|
+
if (n > 0) {
|
|
919
|
+
const _ = (p - S) / n;
|
|
920
|
+
T = `
|
|
921
|
+
${this.formatDuration(_)} remaining`;
|
|
922
|
+
}
|
|
923
|
+
this.notify({
|
|
924
|
+
id: o,
|
|
925
|
+
type: "loading",
|
|
926
|
+
// Cleaned string
|
|
927
|
+
message: `${T}`,
|
|
928
|
+
progress: D,
|
|
929
|
+
action: {
|
|
930
|
+
label: "Cancel",
|
|
931
|
+
onClick: () => this.cancelDownload(o)
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
883
935
|
}
|
|
884
936
|
}
|
|
885
|
-
const
|
|
886
|
-
|
|
937
|
+
const g = new Blob($), Y = window.URL.createObjectURL(g), G = document.createElement("a");
|
|
938
|
+
G.style.display = "none", G.href = Y, G.download = ((x = i.split("/").pop()) == null ? void 0 : x.split("?")[0]) || "video.mp4", document.body.appendChild(G), G.click(), window.URL.revokeObjectURL(Y), document.body.removeChild(G), this.notify({ id: o, type: "success", message: "Saved!", duration: 3e3 });
|
|
887
939
|
} catch {
|
|
888
|
-
|
|
940
|
+
u.aborted ? this.removeNotification(o) : (this.notify({ id: o, type: "error", message: "Download failed.", duration: 4e3 }), window.open(i, "_blank"));
|
|
889
941
|
} finally {
|
|
890
|
-
this.
|
|
942
|
+
this.activeDownloads.delete(o);
|
|
891
943
|
}
|
|
892
944
|
}
|
|
893
|
-
async downloadHls(t,
|
|
945
|
+
async downloadHls(t, i) {
|
|
894
946
|
var h;
|
|
895
|
-
|
|
896
|
-
|
|
947
|
+
const o = Math.random().toString(36).substr(2, 9), a = new AbortController();
|
|
948
|
+
this.activeDownloads.set(o, a);
|
|
949
|
+
const u = a.signal;
|
|
950
|
+
this.notify({
|
|
951
|
+
id: o,
|
|
897
952
|
type: "loading",
|
|
898
|
-
message: "Analyzing HLS stream
|
|
953
|
+
message: "Analyzing HLS stream",
|
|
899
954
|
progress: 0,
|
|
900
|
-
action: { label: "Cancel", onClick: () => this.cancelDownload() }
|
|
955
|
+
action: { label: "Cancel", onClick: () => this.cancelDownload(o) }
|
|
901
956
|
});
|
|
902
957
|
try {
|
|
903
|
-
let
|
|
904
|
-
if (
|
|
905
|
-
this.notify({ id:
|
|
906
|
-
const
|
|
958
|
+
let f = await this.fetchWithRetry(t, 3, void 0, u), x = await f.text(), b = t.substring(0, t.lastIndexOf("/") + 1);
|
|
959
|
+
if (x.includes("#EXT-X-STREAM-INF")) {
|
|
960
|
+
this.notify({ id: o, type: "loading", message: "Selecting best quality", progress: 0 });
|
|
961
|
+
const k = x.split(`
|
|
907
962
|
`);
|
|
908
|
-
let
|
|
909
|
-
for (let
|
|
910
|
-
if (
|
|
911
|
-
const
|
|
912
|
-
if (
|
|
913
|
-
const
|
|
914
|
-
let
|
|
915
|
-
|
|
963
|
+
let j = 0, D = "";
|
|
964
|
+
for (let T = 0; T < k.length; T++)
|
|
965
|
+
if (k[T].includes("#EXT-X-STREAM-INF")) {
|
|
966
|
+
const n = k[T].match(/BANDWIDTH=(\d+)/);
|
|
967
|
+
if (n) {
|
|
968
|
+
const X = parseInt(n[1]);
|
|
969
|
+
let _ = (h = k[T + 1]) == null ? void 0 : h.trim();
|
|
970
|
+
_ && !_.startsWith("#") && X > j && (j = X, D = _);
|
|
916
971
|
}
|
|
917
972
|
}
|
|
918
|
-
|
|
973
|
+
D && (D.startsWith("http") || (D = b + D), f = await this.fetchWithRetry(D, 3, void 0, u), x = await f.text(), b = D.substring(0, D.lastIndexOf("/") + 1));
|
|
919
974
|
}
|
|
920
|
-
if (
|
|
975
|
+
if (x.includes("#EXT-X-KEY"))
|
|
921
976
|
throw new Error("Encrypted HLS streams are not supported for download.");
|
|
922
|
-
const
|
|
923
|
-
`),
|
|
924
|
-
for (let
|
|
925
|
-
|
|
926
|
-
if (
|
|
927
|
-
let
|
|
977
|
+
const m = x.split(`
|
|
978
|
+
`), v = [];
|
|
979
|
+
for (let k of m)
|
|
980
|
+
k = k.trim(), k && !k.startsWith("#") && (k.startsWith("http") ? v.push(k) : v.push(b + k));
|
|
981
|
+
if (v.length === 0) throw new Error("No segments found.");
|
|
982
|
+
let p = i === "mp4" ? "mp4" : "ts", S = i === "mp4" ? "video/mp4" : "video/mp2t", $ = null, U = null, H = [];
|
|
928
983
|
if ("showSaveFilePicker" in window)
|
|
929
984
|
try {
|
|
930
|
-
|
|
931
|
-
suggestedName: `video.${
|
|
985
|
+
$ = await window.showSaveFilePicker({
|
|
986
|
+
suggestedName: `video.${p}`,
|
|
932
987
|
types: [{
|
|
933
|
-
description:
|
|
934
|
-
accept: { [
|
|
988
|
+
description: i === "mp4" ? "MPEG-4 Video" : "MPEG Transport Stream",
|
|
989
|
+
accept: { [S]: [`.${p}`] }
|
|
935
990
|
}]
|
|
936
|
-
}),
|
|
937
|
-
} catch (
|
|
938
|
-
|
|
991
|
+
}), U = await $.createWritable();
|
|
992
|
+
} catch (k) {
|
|
993
|
+
if (k.name === "AbortError") {
|
|
994
|
+
this.removeNotification(o), this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }), this.activeDownloads.delete(o);
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
console.warn("File System API cancelled or failed, falling back to memory", k);
|
|
939
998
|
}
|
|
940
|
-
let
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
999
|
+
let g = !1;
|
|
1000
|
+
const Y = Date.now(), G = [];
|
|
1001
|
+
let fe = 0;
|
|
1002
|
+
for (let k = 0; k < v.length && !u.aborted; k++) {
|
|
1003
|
+
const j = Date.now();
|
|
1004
|
+
if (j - fe > 800 || k === 0 || k === v.length - 1) {
|
|
1005
|
+
fe = j;
|
|
1006
|
+
const X = Math.round((k + 1) / v.length * 100);
|
|
1007
|
+
for (G.push({ time: j, count: k + 1 }); G.length > 0 && j - G[0].time > 5e3; )
|
|
1008
|
+
G.shift();
|
|
1009
|
+
let _ = "";
|
|
1010
|
+
if (G.length > 1) {
|
|
1011
|
+
const ne = G[0], re = G[G.length - 1], be = re.time - ne.time, ge = re.count - ne.count;
|
|
1012
|
+
if (be > 0 && ge > 0) {
|
|
1013
|
+
const Te = be / ge, je = (v.length - (k + 1)) * Te;
|
|
1014
|
+
_ = `
|
|
1015
|
+
${this.formatDuration(je)} remaining`;
|
|
1016
|
+
}
|
|
1017
|
+
} else if (k > 0) {
|
|
1018
|
+
const re = (j - Y) / k, ge = (v.length - k) * re;
|
|
1019
|
+
_ = `
|
|
1020
|
+
${this.formatDuration(ge)} remaining`;
|
|
1021
|
+
}
|
|
1022
|
+
this.notify({
|
|
1023
|
+
id: o,
|
|
1024
|
+
type: "loading",
|
|
1025
|
+
// Cleaned string
|
|
1026
|
+
message: `Downloading segment ${k + 1}/${v.length}${_}`,
|
|
1027
|
+
progress: X,
|
|
1028
|
+
action: { label: "Cancel", onClick: () => this.cancelDownload(o) }
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
const T = await (await this.fetchWithRetry(v[k], 3, void 0, u)).arrayBuffer();
|
|
1032
|
+
k === 0 && new Uint8Array(T.slice(0, 4))[0] === 71 && (g = !0, i === "mp4" && (this.notify({
|
|
952
1033
|
type: "info",
|
|
953
1034
|
message: "Stream is MPEG-TS. Downloading as .ts to prevent corruption.",
|
|
954
1035
|
duration: 5e3
|
|
955
|
-
}),
|
|
956
|
-
const
|
|
957
|
-
|
|
1036
|
+
}), p = "ts", S = "video/mp2t"));
|
|
1037
|
+
const n = new Blob([T]);
|
|
1038
|
+
U ? await U.write(n) : H.push(n);
|
|
958
1039
|
}
|
|
959
|
-
if (
|
|
960
|
-
throw
|
|
961
|
-
if (
|
|
962
|
-
await
|
|
1040
|
+
if (u.aborted)
|
|
1041
|
+
throw U && await U.abort(), new Error("Aborted");
|
|
1042
|
+
if (U)
|
|
1043
|
+
await U.close(), this.notify({ id: o, type: "success", message: "Download complete!", duration: 3e3 });
|
|
963
1044
|
else {
|
|
964
|
-
this.notify({ id:
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
const
|
|
968
|
-
|
|
1045
|
+
this.notify({ id: o, type: "loading", message: "Stitching video", progress: 100 });
|
|
1046
|
+
const k = new Blob(H, { type: S }), j = window.URL.createObjectURL(k), D = document.createElement("a");
|
|
1047
|
+
D.style.display = "none", D.href = j;
|
|
1048
|
+
const T = i === "mp4" && g ? "ts" : p;
|
|
1049
|
+
D.download = `video.${T}`, document.body.appendChild(D), D.click(), window.URL.revokeObjectURL(j), document.body.removeChild(D), this.notify({ id: o, type: "success", message: "Saved!", duration: 3e3 });
|
|
969
1050
|
}
|
|
970
|
-
} catch (
|
|
971
|
-
|
|
1051
|
+
} catch (f) {
|
|
1052
|
+
u.aborted ? this.removeNotification(o) : this.notify({ id: o, type: "error", message: `Download failed: ${f.message}`, duration: 4e3 });
|
|
972
1053
|
} finally {
|
|
973
|
-
this.
|
|
1054
|
+
this.activeDownloads.delete(o);
|
|
974
1055
|
}
|
|
975
1056
|
}
|
|
976
1057
|
notify(t) {
|
|
977
|
-
const
|
|
978
|
-
return this.store.setState((
|
|
1058
|
+
const i = t.id || Math.random().toString(36).substr(2, 9), o = { ...t, id: i };
|
|
1059
|
+
return this.store.setState((a) => a.notifications.find((h) => h.id === i) ? { notifications: a.notifications.map((h) => h.id === i ? o : h) } : { notifications: [...a.notifications, o] }), t.duration && setTimeout(() => this.removeNotification(i), t.duration), i;
|
|
979
1060
|
}
|
|
980
1061
|
removeNotification(t) {
|
|
981
|
-
const
|
|
982
|
-
this.store.setState({ notifications:
|
|
1062
|
+
const i = this.store.get().notifications;
|
|
1063
|
+
this.store.setState({ notifications: i.filter((o) => o.id !== t) });
|
|
983
1064
|
}
|
|
984
1065
|
setAppearance(t) {
|
|
985
|
-
this.store.setState((
|
|
986
|
-
...
|
|
1066
|
+
this.store.setState((i) => ({
|
|
1067
|
+
...i,
|
|
987
1068
|
...t
|
|
988
1069
|
}));
|
|
989
1070
|
}
|
|
990
1071
|
destroy() {
|
|
991
|
-
this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.
|
|
1072
|
+
this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.activeDownloads.forEach((i) => i.abort()), this.activeDownloads.clear(), this.store.get().isWebFullscreen && typeof document < "u" && (document.body.style.overflow = ""), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
|
|
992
1073
|
const t = this.video.getElementsByTagName("track");
|
|
993
1074
|
for (; t.length > 0; ) t[0].remove();
|
|
994
|
-
this.emit("destroy"), this.events.destroy(), this.store.destroy(), this.plugins.forEach((
|
|
1075
|
+
this.emit("destroy"), this.events.destroy(), this.store.destroy(), this.plugins.forEach((i) => i.destroy && i.destroy()), this.plugins.clear(), this.video.remove(), this.audioEngine.destroy();
|
|
995
1076
|
}
|
|
996
1077
|
}
|
|
997
|
-
const
|
|
998
|
-
const [
|
|
999
|
-
return
|
|
1000
|
-
if (
|
|
1078
|
+
const st = (s, t = 200) => {
|
|
1079
|
+
const [i, o] = M(s), [a, u] = M(!1);
|
|
1080
|
+
return ee(() => {
|
|
1081
|
+
if (s)
|
|
1001
1082
|
o(!0), requestAnimationFrame(() => {
|
|
1002
1083
|
requestAnimationFrame(() => {
|
|
1003
|
-
|
|
1084
|
+
u(!0);
|
|
1004
1085
|
});
|
|
1005
1086
|
});
|
|
1006
1087
|
else {
|
|
1007
|
-
|
|
1008
|
-
const
|
|
1088
|
+
u(!1);
|
|
1089
|
+
const h = setTimeout(() => {
|
|
1009
1090
|
o(!1);
|
|
1010
1091
|
}, t);
|
|
1011
|
-
return () => clearTimeout(
|
|
1092
|
+
return () => clearTimeout(h);
|
|
1012
1093
|
}
|
|
1013
|
-
}, [
|
|
1094
|
+
}, [s, t]), { isMounted: i, isVisible: a };
|
|
1014
1095
|
}, y = ({
|
|
1015
|
-
className:
|
|
1096
|
+
className: s,
|
|
1016
1097
|
children: t,
|
|
1017
|
-
fill:
|
|
1098
|
+
fill: i = "none",
|
|
1018
1099
|
strokeWidth: o = 2,
|
|
1019
|
-
viewBox:
|
|
1100
|
+
viewBox: a = "0 0 24 24"
|
|
1020
1101
|
}) => /* @__PURE__ */ e(
|
|
1021
1102
|
"svg",
|
|
1022
1103
|
{
|
|
1023
1104
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1024
|
-
viewBox:
|
|
1025
|
-
fill:
|
|
1105
|
+
viewBox: a,
|
|
1106
|
+
fill: i,
|
|
1026
1107
|
stroke: "currentColor",
|
|
1027
1108
|
strokeWidth: o,
|
|
1028
1109
|
strokeLinecap: "round",
|
|
1029
1110
|
strokeLinejoin: "round",
|
|
1030
|
-
className:
|
|
1111
|
+
className: s,
|
|
1031
1112
|
children: t
|
|
1032
1113
|
}
|
|
1033
|
-
),
|
|
1114
|
+
), Ht = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }), Wt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1034
1115
|
/* @__PURE__ */ e("rect", { width: "4", height: "16", x: "6", y: "4", rx: "1" }),
|
|
1035
1116
|
/* @__PURE__ */ e("rect", { width: "4", height: "16", x: "14", y: "4", rx: "1" })
|
|
1036
|
-
] }),
|
|
1117
|
+
] }), jt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1037
1118
|
/* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1038
1119
|
/* @__PURE__ */ e("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1039
1120
|
/* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1040
|
-
] }),
|
|
1121
|
+
] }), Ei = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1041
1122
|
/* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1042
1123
|
/* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1043
|
-
] }),
|
|
1124
|
+
] }), Ut = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1044
1125
|
/* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1045
1126
|
/* @__PURE__ */ e("line", { x1: "23", x2: "17", y1: "9", y2: "15" }),
|
|
1046
1127
|
/* @__PURE__ */ e("line", { x1: "17", x2: "23", y1: "9", y2: "15" })
|
|
1047
|
-
] }),
|
|
1128
|
+
] }), Ai = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1048
1129
|
/* @__PURE__ */ e("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
|
|
1049
1130
|
/* @__PURE__ */ e("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
|
|
1050
1131
|
/* @__PURE__ */ e("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
|
|
1051
1132
|
/* @__PURE__ */ e("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
1052
|
-
] }),
|
|
1133
|
+
] }), Vi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1053
1134
|
/* @__PURE__ */ e("path", { d: "M8 3v3a2 2 0 0 1-2 2H3" }),
|
|
1054
1135
|
/* @__PURE__ */ e("path", { d: "M21 8h-3a2 2 0 0 1-2-2V3" }),
|
|
1055
1136
|
/* @__PURE__ */ e("path", { d: "M3 16h3a2 2 0 0 1 2 2v3" }),
|
|
1056
1137
|
/* @__PURE__ */ e("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
|
|
1057
|
-
] }),
|
|
1138
|
+
] }), Bi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1058
1139
|
/* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.47a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
1059
1140
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
1060
|
-
] }),
|
|
1141
|
+
] }), He = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }), Di = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1061
1142
|
/* @__PURE__ */ e("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }),
|
|
1062
1143
|
/* @__PURE__ */ e("rect", { x: "12", y: "13", width: "10", height: "7", rx: "2" })
|
|
1063
|
-
] }),
|
|
1144
|
+
] }), Oi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1064
1145
|
/* @__PURE__ */ e("rect", { width: "18", height: "14", x: "3", y: "5", rx: "2", ry: "2" }),
|
|
1065
1146
|
/* @__PURE__ */ e("path", { d: "M7 15h4" }),
|
|
1066
1147
|
/* @__PURE__ */ e("path", { d: "M15 15h2" }),
|
|
1067
1148
|
/* @__PURE__ */ e("path", { d: "M7 11h2" }),
|
|
1068
1149
|
/* @__PURE__ */ e("path", { d: "M13 11h4" })
|
|
1069
|
-
] }),
|
|
1150
|
+
] }), ot = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1070
1151
|
/* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1071
1152
|
/* @__PURE__ */ e("polyline", { points: "7 10 12 15 17 10" }),
|
|
1072
1153
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
1073
|
-
] }),
|
|
1154
|
+
] }), Hi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1074
1155
|
/* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1075
1156
|
/* @__PURE__ */ e("polyline", { points: "17 8 12 3 7 8" }),
|
|
1076
1157
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
|
|
1077
|
-
] }),
|
|
1158
|
+
] }), Wi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1078
1159
|
/* @__PURE__ */ e("path", { d: "m12 19-7-7 7-7" }),
|
|
1079
1160
|
/* @__PURE__ */ e("path", { d: "M19 12H5" })
|
|
1080
|
-
] }),
|
|
1161
|
+
] }), De = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }), ji = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1081
1162
|
/* @__PURE__ */ e("path", { d: "M2 16.1A5 5 0 0 1 5.9 20" }),
|
|
1082
1163
|
/* @__PURE__ */ e("path", { d: "M2 12.05A9 9 0 0 1 9.95 20" }),
|
|
1083
1164
|
/* @__PURE__ */ e("path", { d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6" }),
|
|
1084
1165
|
/* @__PURE__ */ e("line", { x1: "2", x2: "2.01", y1: "20", y2: "20" })
|
|
1085
|
-
] }),
|
|
1166
|
+
] }), Ui = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1086
1167
|
/* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
|
|
1087
1168
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
|
|
1088
1169
|
/* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
|
|
1089
1170
|
/* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
|
|
1090
|
-
] }),
|
|
1171
|
+
] }), Gi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1091
1172
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1092
1173
|
/* @__PURE__ */ e("polyline", { points: "12 6 12 12 16 14" })
|
|
1093
|
-
] }),
|
|
1174
|
+
] }), _i = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M5 12h14" }) }), qi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1094
1175
|
/* @__PURE__ */ e("path", { d: "M5 12h14" }),
|
|
1095
1176
|
/* @__PURE__ */ e("path", { d: "M12 5v14" })
|
|
1096
|
-
] }),
|
|
1177
|
+
] }), Zt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1097
1178
|
/* @__PURE__ */ e("path", { d: "M4 21v-7" }),
|
|
1098
1179
|
/* @__PURE__ */ e("path", { d: "M4 10V3" }),
|
|
1099
1180
|
/* @__PURE__ */ e("path", { d: "M12 21v-9" }),
|
|
@@ -1103,143 +1184,157 @@ const qe = (i, t = 200) => {
|
|
|
1103
1184
|
/* @__PURE__ */ e("path", { d: "M1 14h6" }),
|
|
1104
1185
|
/* @__PURE__ */ e("path", { d: "M9 8h6" }),
|
|
1105
1186
|
/* @__PURE__ */ e("path", { d: "M17 16h6" })
|
|
1106
|
-
] }),
|
|
1187
|
+
] }), Xi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1107
1188
|
/* @__PURE__ */ e("polyline", { points: "4 7 4 4 20 4 20 7" }),
|
|
1108
1189
|
/* @__PURE__ */ e("line", { x1: "9", x2: "15", y1: "20", y2: "20" }),
|
|
1109
1190
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "4", y2: "20" })
|
|
1110
|
-
] }),
|
|
1191
|
+
] }), ei = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1111
1192
|
/* @__PURE__ */ e("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }),
|
|
1112
1193
|
/* @__PURE__ */ e("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }),
|
|
1113
1194
|
/* @__PURE__ */ e("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" }),
|
|
1114
1195
|
/* @__PURE__ */ e("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }),
|
|
1115
1196
|
/* @__PURE__ */ e("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })
|
|
1116
|
-
] }),
|
|
1197
|
+
] }), Qi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1117
1198
|
/* @__PURE__ */ e("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
1118
1199
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
1119
|
-
] }),
|
|
1200
|
+
] }), Yi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1120
1201
|
/* @__PURE__ */ e("polyline", { points: "8 18 12 22 16 18" }),
|
|
1121
1202
|
/* @__PURE__ */ e("polyline", { points: "8 6 12 2 16 6" }),
|
|
1122
1203
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "2", y2: "22" })
|
|
1123
|
-
] }),
|
|
1204
|
+
] }), Ji = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1124
1205
|
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
1125
1206
|
/* @__PURE__ */ e("path", { d: "M3 3v5h5" })
|
|
1126
|
-
] }),
|
|
1207
|
+
] }), Ki = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1127
1208
|
/* @__PURE__ */ e("path", { d: "M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" }),
|
|
1128
1209
|
/* @__PURE__ */ e("path", { d: "M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" })
|
|
1129
|
-
] }),
|
|
1210
|
+
] }), Zi = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1130
1211
|
/* @__PURE__ */ e("path", { d: "m3 17 4-10 4 10" }),
|
|
1131
1212
|
/* @__PURE__ */ e("path", { d: "M4 13h6" }),
|
|
1132
1213
|
/* @__PURE__ */ e("path", { d: "M15 12h4.5a2.5 2.5 0 0 1 0 5H15V7h4a2.5 2.5 0 0 1 0 5h-4" })
|
|
1133
|
-
] }),
|
|
1214
|
+
] }), es = ({ className: s }) => /* @__PURE__ */ e(y, { className: s, children: /* @__PURE__ */ e("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) }), ts = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1134
1215
|
/* @__PURE__ */ e("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }),
|
|
1135
1216
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "13", r: "3" })
|
|
1136
|
-
] }),
|
|
1217
|
+
] }), is = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1137
1218
|
/* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
1138
1219
|
/* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
1139
|
-
] }),
|
|
1220
|
+
] }), ss = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1140
1221
|
/* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
1141
1222
|
/* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })
|
|
1142
|
-
] }),
|
|
1223
|
+
] }), ns = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1143
1224
|
/* @__PURE__ */ e("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
|
|
1144
1225
|
/* @__PURE__ */ e("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
|
|
1145
1226
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
|
|
1146
|
-
] }),
|
|
1227
|
+
] }), os = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1147
1228
|
/* @__PURE__ */ e("polygon", { points: "13 19 22 12 13 5 13 19" }),
|
|
1148
1229
|
/* @__PURE__ */ e("polygon", { points: "2 19 11 12 2 5 2 19" })
|
|
1149
|
-
] }),
|
|
1230
|
+
] }), ti = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1150
1231
|
/* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
|
|
1151
1232
|
/* @__PURE__ */ e("path", { d: "m6 6 12 12" })
|
|
1152
|
-
] }),
|
|
1233
|
+
] }), as = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1153
1234
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1154
1235
|
/* @__PURE__ */ e("path", { d: "M12 16v-4" }),
|
|
1155
1236
|
/* @__PURE__ */ e("path", { d: "M12 8h.01" })
|
|
1156
|
-
] }),
|
|
1237
|
+
] }), rs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1157
1238
|
/* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2" }),
|
|
1158
1239
|
/* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2" }),
|
|
1159
1240
|
/* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
|
|
1160
1241
|
/* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
|
|
1161
|
-
] }),
|
|
1242
|
+
] }), ls = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1162
1243
|
/* @__PURE__ */ e("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }),
|
|
1163
1244
|
/* @__PURE__ */ e("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })
|
|
1164
|
-
] }),
|
|
1245
|
+
] }), cs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1165
1246
|
/* @__PURE__ */ e("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2" }),
|
|
1166
1247
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "14", r: "4" }),
|
|
1167
1248
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "6", y2: "6" })
|
|
1168
|
-
] }),
|
|
1249
|
+
] }), ds = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1169
1250
|
/* @__PURE__ */ e("path", { d: "m12 14 4-4" }),
|
|
1170
1251
|
/* @__PURE__ */ e("path", { d: "M3.34 19a10 10 0 1 1 17.32 0" })
|
|
1171
|
-
] }),
|
|
1252
|
+
] }), us = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1172
1253
|
/* @__PURE__ */ e("path", { d: "M9 18V5l12-2v13" }),
|
|
1173
1254
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "18", r: "3" }),
|
|
1174
1255
|
/* @__PURE__ */ e("circle", { cx: "18", cy: "16", r: "3" })
|
|
1175
|
-
] }),
|
|
1256
|
+
] }), hs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1176
1257
|
/* @__PURE__ */ e("path", { d: "M5 12.55a11 11 0 0 1 14.08 0" }),
|
|
1177
1258
|
/* @__PURE__ */ e("path", { d: "M1.42 9a16 16 0 0 1 21.16 0" }),
|
|
1178
1259
|
/* @__PURE__ */ e("path", { d: "M8.53 16.11a6 6 0 0 1 6.95 0" }),
|
|
1179
1260
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "20", y2: "20" })
|
|
1180
|
-
] }),
|
|
1261
|
+
] }), at = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1181
1262
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1182
1263
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "8", y2: "12" }),
|
|
1183
1264
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "16", y2: "16" })
|
|
1184
|
-
] }),
|
|
1265
|
+
] }), ms = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1185
1266
|
/* @__PURE__ */ e("path", { d: "M2 20h.01" }),
|
|
1186
1267
|
/* @__PURE__ */ e("path", { d: "M7 20v-4" }),
|
|
1187
1268
|
/* @__PURE__ */ e("path", { d: "M12 20v-8" }),
|
|
1188
1269
|
/* @__PURE__ */ e("path", { d: "M17 20V8" }),
|
|
1189
1270
|
/* @__PURE__ */ e("path", { d: "M22 20V4" })
|
|
1190
|
-
] }),
|
|
1271
|
+
] }), ps = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1191
1272
|
/* @__PURE__ */ e("path", { d: "M21 7v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
|
|
1192
1273
|
/* @__PURE__ */ e("path", { d: "M16 2v4" }),
|
|
1193
1274
|
/* @__PURE__ */ e("path", { d: "M8 2v4" }),
|
|
1194
1275
|
/* @__PURE__ */ e("path", { d: "M3 12h18" })
|
|
1195
|
-
] }),
|
|
1276
|
+
] }), fs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1196
1277
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1197
1278
|
/* @__PURE__ */ e("path", { d: "m21 21-4.3-4.3" })
|
|
1198
|
-
] }),
|
|
1279
|
+
] }), ii = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1199
1280
|
/* @__PURE__ */ e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
1200
1281
|
/* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" }),
|
|
1201
1282
|
/* @__PURE__ */ e("path", { d: "m9 15 2 2 4-4" })
|
|
1202
|
-
] }),
|
|
1283
|
+
] }), bs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1203
1284
|
/* @__PURE__ */ e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
1204
1285
|
/* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" }),
|
|
1205
1286
|
/* @__PURE__ */ e("path", { d: "M12 18h.01" }),
|
|
1206
1287
|
/* @__PURE__ */ e("path", { d: "M12 12v4" })
|
|
1207
|
-
] }),
|
|
1208
|
-
/* @__PURE__ */
|
|
1288
|
+
] }), Gt = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1289
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "5" }),
|
|
1290
|
+
/* @__PURE__ */ e("path", { d: "M12 1v2" }),
|
|
1291
|
+
/* @__PURE__ */ e("path", { d: "M12 21v2" }),
|
|
1292
|
+
/* @__PURE__ */ e("path", { d: "M4.22 4.22l1.42 1.42" }),
|
|
1293
|
+
/* @__PURE__ */ e("path", { d: "M18.36 18.36l1.42 1.42" }),
|
|
1294
|
+
/* @__PURE__ */ e("path", { d: "M1 12h2" }),
|
|
1295
|
+
/* @__PURE__ */ e("path", { d: "M21 12h2" }),
|
|
1296
|
+
/* @__PURE__ */ e("path", { d: "M4.22 19.78l1.42-1.42" }),
|
|
1297
|
+
/* @__PURE__ */ e("path", { d: "M18.36 5.64l1.42-1.42" })
|
|
1298
|
+
] }), gs = ({ className: s }) => /* @__PURE__ */ c(y, { className: s, children: [
|
|
1299
|
+
/* @__PURE__ */ e("rect", { width: "18", height: "7", x: "3", y: "3", rx: "1" }),
|
|
1300
|
+
/* @__PURE__ */ e("rect", { width: "9", height: "7", x: "3", y: "14", rx: "1" }),
|
|
1301
|
+
/* @__PURE__ */ e("rect", { width: "5", height: "7", x: "16", y: "14", rx: "1" })
|
|
1302
|
+
] }), _t = ({ className: s }) => /* @__PURE__ */ c("div", { className: `relative flex items-center justify-center ${s}`, children: [
|
|
1303
|
+
/* @__PURE__ */ c(y, { className: "w-full h-full", children: [
|
|
1209
1304
|
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
1210
1305
|
/* @__PURE__ */ e("path", { d: "M3 3v5h5" })
|
|
1211
1306
|
] }),
|
|
1212
1307
|
/* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
|
|
1213
|
-
] }),
|
|
1214
|
-
/* @__PURE__ */
|
|
1308
|
+
] }), qt = ({ className: s }) => /* @__PURE__ */ c("div", { className: `relative flex items-center justify-center ${s}`, children: [
|
|
1309
|
+
/* @__PURE__ */ c(y, { className: "w-full h-full", children: [
|
|
1215
1310
|
/* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
1216
1311
|
/* @__PURE__ */ e("path", { d: "M21 3v5h-5" })
|
|
1217
1312
|
] }),
|
|
1218
1313
|
/* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
|
|
1219
|
-
] }),
|
|
1220
|
-
notifications:
|
|
1221
|
-
}) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[280px]", children:
|
|
1222
|
-
const
|
|
1314
|
+
] }), vs = ({
|
|
1315
|
+
notifications: s
|
|
1316
|
+
}) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[280px]", children: s.map((t) => {
|
|
1317
|
+
const i = typeof t.progress == "number";
|
|
1223
1318
|
return /* @__PURE__ */ e(
|
|
1224
1319
|
"div",
|
|
1225
1320
|
{
|
|
1226
1321
|
className: `
|
|
1227
1322
|
relative overflow-hidden bg-zinc-950/80 backdrop-blur-xl border border-white/10 text-zinc-100 shadow-2xl rounded-lg pointer-events-auto
|
|
1228
1323
|
animate-in slide-in-from-left-4 fade-in duration-300
|
|
1229
|
-
${
|
|
1324
|
+
${i ? "w-64" : "w-auto max-w-full px-3 py-2.5"}
|
|
1230
1325
|
`,
|
|
1231
1326
|
style: { borderRadius: "var(--radius)" },
|
|
1232
|
-
children:
|
|
1233
|
-
/* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-[var(--accent)] shrink-0", children: /* @__PURE__ */ e(
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1327
|
+
children: i ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
|
|
1328
|
+
/* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-[var(--accent)] shrink-0", children: /* @__PURE__ */ e(ot, { className: "w-3.5 h-3.5" }) }),
|
|
1329
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0 pt-0.5", children: [
|
|
1330
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-baseline mb-1", children: [
|
|
1236
1331
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-white tracking-tight", children: "Downloading" }),
|
|
1237
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ c("span", { className: "text-[10px] font-mono text-zinc-400", children: [
|
|
1238
1333
|
t.progress,
|
|
1239
1334
|
"%"
|
|
1240
1335
|
] })
|
|
1241
1336
|
] }),
|
|
1242
|
-
/* @__PURE__ */ e("p", { className: "text-[10px] text-zinc-400
|
|
1337
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] text-zinc-400 mb-2 leading-tight whitespace-pre-wrap", children: t.message.replace(/Downloading\.\.\. \d+%/, "").trim() || "Processing..." }),
|
|
1243
1338
|
/* @__PURE__ */ e("div", { className: "h-0.5 w-full bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
|
|
1244
1339
|
"div",
|
|
1245
1340
|
{
|
|
@@ -1252,28 +1347,28 @@ const qe = (i, t = 200) => {
|
|
|
1252
1347
|
"button",
|
|
1253
1348
|
{
|
|
1254
1349
|
onClick: (o) => {
|
|
1255
|
-
var
|
|
1256
|
-
o.stopPropagation(), (
|
|
1350
|
+
var a;
|
|
1351
|
+
o.stopPropagation(), (a = t.action) == null || a.onClick();
|
|
1257
1352
|
},
|
|
1258
1353
|
className: "text-zinc-500 hover:text-zinc-200 transition-colors p-1 -mt-1.5 -mr-1.5",
|
|
1259
1354
|
title: t.action.label,
|
|
1260
|
-
children: /* @__PURE__ */ e(
|
|
1355
|
+
children: /* @__PURE__ */ e(ti, { className: "w-3.5 h-3.5" })
|
|
1261
1356
|
}
|
|
1262
1357
|
)
|
|
1263
|
-
] }) }) : /* @__PURE__ */
|
|
1264
|
-
t.type === "loading" && /* @__PURE__ */ e(
|
|
1265
|
-
t.type === "success" && /* @__PURE__ */ e(
|
|
1266
|
-
t.type === "error" && /* @__PURE__ */ e(
|
|
1267
|
-
t.type === "warning" && /* @__PURE__ */ e(
|
|
1358
|
+
] }) }) : /* @__PURE__ */ c("div", { className: "flex items-start gap-2.5", children: [
|
|
1359
|
+
t.type === "loading" && /* @__PURE__ */ e(De, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
|
|
1360
|
+
t.type === "success" && /* @__PURE__ */ e(He, { className: "w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5" }),
|
|
1361
|
+
t.type === "error" && /* @__PURE__ */ e(at, { className: "w-3.5 h-3.5 text-red-500 shrink-0 mt-0.5" }),
|
|
1362
|
+
t.type === "warning" && /* @__PURE__ */ e(at, { className: "w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5" }),
|
|
1268
1363
|
t.type === "info" && /* @__PURE__ */ e("div", { className: "w-1.5 h-1.5 rounded-full bg-[var(--accent)] mt-1.5 shrink-0" }),
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-medium leading-snug break-words text-zinc-200", children: t.message }),
|
|
1364
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
|
|
1365
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-medium leading-snug break-words text-zinc-200 whitespace-pre-wrap", children: t.message }),
|
|
1271
1366
|
t.action && /* @__PURE__ */ e(
|
|
1272
1367
|
"button",
|
|
1273
1368
|
{
|
|
1274
1369
|
onClick: (o) => {
|
|
1275
|
-
var
|
|
1276
|
-
o.stopPropagation(), (
|
|
1370
|
+
var a;
|
|
1371
|
+
o.stopPropagation(), (a = t.action) == null || a.onClick();
|
|
1277
1372
|
},
|
|
1278
1373
|
className: "mt-1 self-start text-[10px] font-bold text-[var(--accent)] hover:text-white transition-colors uppercase tracking-wider",
|
|
1279
1374
|
children: t.action.label
|
|
@@ -1284,9 +1379,12 @@ const qe = (i, t = 200) => {
|
|
|
1284
1379
|
},
|
|
1285
1380
|
t.id
|
|
1286
1381
|
);
|
|
1287
|
-
}) }),
|
|
1288
|
-
|
|
1289
|
-
|
|
1382
|
+
}) }), xs = ({
|
|
1383
|
+
cues: s,
|
|
1384
|
+
settings: t
|
|
1385
|
+
}) => {
|
|
1386
|
+
if (t.useNative || s.length === 0) return null;
|
|
1387
|
+
const i = () => {
|
|
1290
1388
|
switch (t.textStyle) {
|
|
1291
1389
|
case "outline":
|
|
1292
1390
|
return "0px 0px 4px black, 0px 0px 4px black";
|
|
@@ -1303,11 +1401,11 @@ const qe = (i, t = 200) => {
|
|
|
1303
1401
|
return /* @__PURE__ */ e(
|
|
1304
1402
|
"div",
|
|
1305
1403
|
{
|
|
1306
|
-
className: "absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200",
|
|
1404
|
+
className: "absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200 strata-subtitle-overlay",
|
|
1307
1405
|
style: {
|
|
1308
1406
|
bottom: `${t.verticalOffset}px`
|
|
1309
1407
|
},
|
|
1310
|
-
children:
|
|
1408
|
+
children: s.map((o, a) => /* @__PURE__ */ e(
|
|
1311
1409
|
"div",
|
|
1312
1410
|
{
|
|
1313
1411
|
className: "mb-1 inline-block max-w-[80%]",
|
|
@@ -1316,8 +1414,9 @@ const qe = (i, t = 200) => {
|
|
|
1316
1414
|
color: t.textColor,
|
|
1317
1415
|
fontWeight: t.isBold ? "bold" : "normal",
|
|
1318
1416
|
textTransform: t.fixCapitalization ? "capitalize" : "none",
|
|
1319
|
-
textShadow:
|
|
1320
|
-
lineHeight: 1.4
|
|
1417
|
+
textShadow: i(),
|
|
1418
|
+
lineHeight: 1.4,
|
|
1419
|
+
whiteSpace: "pre-line"
|
|
1321
1420
|
},
|
|
1322
1421
|
children: /* @__PURE__ */ e(
|
|
1323
1422
|
"span",
|
|
@@ -1331,27 +1430,27 @@ const qe = (i, t = 200) => {
|
|
|
1331
1430
|
}
|
|
1332
1431
|
)
|
|
1333
1432
|
},
|
|
1334
|
-
|
|
1433
|
+
a
|
|
1335
1434
|
))
|
|
1336
1435
|
}
|
|
1337
1436
|
);
|
|
1338
|
-
},
|
|
1437
|
+
}, Oe = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(Q, { children: s }), le = ({ label: s, checked: t, onChange: i, icon: o, tooltip: a }) => /* @__PURE__ */ c(
|
|
1339
1438
|
"div",
|
|
1340
1439
|
{
|
|
1341
1440
|
className: "flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
1342
1441
|
style: { borderRadius: "var(--radius)" },
|
|
1343
1442
|
children: [
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
o && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ e(
|
|
1348
|
-
|
|
1443
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
|
|
1444
|
+
o && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Oe, { content: o }) }),
|
|
1445
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
1446
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ e(Oe, { content: s }) }),
|
|
1447
|
+
a && /* @__PURE__ */ e("span", { className: "text-[10px] text-zinc-500", children: a })
|
|
1349
1448
|
] })
|
|
1350
1449
|
] }),
|
|
1351
1450
|
/* @__PURE__ */ e(
|
|
1352
1451
|
"button",
|
|
1353
1452
|
{
|
|
1354
|
-
onClick: () =>
|
|
1453
|
+
onClick: () => i(!t),
|
|
1355
1454
|
className: `w-11 h-6 shrink-0 transition-colors relative focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 ${t ? "bg-[var(--accent)]" : "bg-zinc-700"}`,
|
|
1356
1455
|
style: {
|
|
1357
1456
|
"--tw-ring-color": "var(--accent)",
|
|
@@ -1373,40 +1472,40 @@ const qe = (i, t = 200) => {
|
|
|
1373
1472
|
)
|
|
1374
1473
|
]
|
|
1375
1474
|
}
|
|
1376
|
-
),
|
|
1475
|
+
), xe = ({ label: s, value: t, min: i, max: o, step: a, onChange: u, formatValue: h, icon: f }) => /* @__PURE__ */ c(
|
|
1377
1476
|
"div",
|
|
1378
1477
|
{
|
|
1379
1478
|
className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
1380
1479
|
style: { borderRadius: "var(--radius)" },
|
|
1381
1480
|
children: [
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
|
|
1385
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children:
|
|
1481
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-2", children: [
|
|
1482
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
|
|
1483
|
+
f && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Oe, { content: f }) }),
|
|
1484
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: s })
|
|
1386
1485
|
] }),
|
|
1387
1486
|
/* @__PURE__ */ e(
|
|
1388
1487
|
"span",
|
|
1389
1488
|
{
|
|
1390
1489
|
className: "text-[10px] font-mono font-medium text-zinc-300 bg-white/10 px-1.5 py-0.5 tabular-nums",
|
|
1391
1490
|
style: { borderRadius: "var(--radius-sm)" },
|
|
1392
|
-
children:
|
|
1491
|
+
children: h ? h(t) : t
|
|
1393
1492
|
}
|
|
1394
1493
|
)
|
|
1395
1494
|
] }),
|
|
1396
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ c("div", { className: "relative h-4 flex items-center px-1", children: [
|
|
1397
1496
|
/* @__PURE__ */ e(
|
|
1398
1497
|
"input",
|
|
1399
1498
|
{
|
|
1400
1499
|
type: "range",
|
|
1401
|
-
min:
|
|
1500
|
+
min: i,
|
|
1402
1501
|
max: o,
|
|
1403
|
-
step:
|
|
1502
|
+
step: a,
|
|
1404
1503
|
value: t,
|
|
1405
|
-
onChange: (
|
|
1504
|
+
onChange: (x) => u(parseFloat(x.target.value)),
|
|
1406
1505
|
className: "w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",
|
|
1407
1506
|
style: {
|
|
1408
1507
|
borderRadius: "var(--radius-full)",
|
|
1409
|
-
background: `linear-gradient(to right, var(--accent) 0%, var(--accent) ${(t -
|
|
1508
|
+
background: `linear-gradient(to right, var(--accent) 0%, var(--accent) ${(t - i) / (o - i) * 100}%, #3f3f46 ${(t - i) / (o - i) * 100}%, #3f3f46 100%)`,
|
|
1410
1509
|
"--tw-ring-color": "var(--accent)"
|
|
1411
1510
|
}
|
|
1412
1511
|
}
|
|
@@ -1431,236 +1530,236 @@ const qe = (i, t = 200) => {
|
|
|
1431
1530
|
] })
|
|
1432
1531
|
]
|
|
1433
1532
|
}
|
|
1434
|
-
),
|
|
1533
|
+
), ws = ({ label: s, value: t, options: i, onChange: o, icon: a }) => /* @__PURE__ */ c(
|
|
1435
1534
|
"div",
|
|
1436
1535
|
{
|
|
1437
1536
|
className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
1438
1537
|
style: { borderRadius: "var(--radius)" },
|
|
1439
1538
|
children: [
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
|
|
1442
|
-
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children:
|
|
1539
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
1540
|
+
a && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Oe, { content: a }) }),
|
|
1541
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: s })
|
|
1443
1542
|
] }),
|
|
1444
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1445
1544
|
/* @__PURE__ */ e(
|
|
1446
1545
|
"select",
|
|
1447
1546
|
{
|
|
1448
1547
|
value: t,
|
|
1449
|
-
onChange: (
|
|
1548
|
+
onChange: (u) => o(u.target.value),
|
|
1450
1549
|
className: "w-full bg-zinc-800 border-[length:var(--border-width)] border-white/10 px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-2 appearance-none hover:bg-zinc-700 transition-colors cursor-pointer",
|
|
1451
1550
|
style: { "--tw-ring-color": "var(--accent)", borderRadius: "var(--radius)" },
|
|
1452
|
-
children:
|
|
1551
|
+
children: i.map((u) => /* @__PURE__ */ e("option", { value: u.value, children: u.label }, u.value))
|
|
1453
1552
|
}
|
|
1454
1553
|
),
|
|
1455
1554
|
/* @__PURE__ */ e("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400", children: /* @__PURE__ */ e("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M1 1L5 5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
1456
1555
|
] })
|
|
1457
1556
|
]
|
|
1458
1557
|
}
|
|
1459
|
-
),
|
|
1460
|
-
|
|
1558
|
+
), pe = ({ title: s, children: t }) => /* @__PURE__ */ c("div", { className: "py-2", children: [
|
|
1559
|
+
s && /* @__PURE__ */ e("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: s }),
|
|
1461
1560
|
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t })
|
|
1462
|
-
] }),
|
|
1463
|
-
children:
|
|
1561
|
+
] }), lt = ({
|
|
1562
|
+
children: s,
|
|
1464
1563
|
onClose: t,
|
|
1465
|
-
align:
|
|
1564
|
+
align: i = "right",
|
|
1466
1565
|
maxHeight: o,
|
|
1467
|
-
className:
|
|
1566
|
+
className: a
|
|
1468
1567
|
}) => {
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
if (!
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
},
|
|
1475
|
-
return
|
|
1568
|
+
const u = W(null), h = W(null), [f, x] = M("auto"), b = i === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right";
|
|
1569
|
+
Be(() => {
|
|
1570
|
+
if (!h.current) return;
|
|
1571
|
+
const v = () => {
|
|
1572
|
+
h.current && x(h.current.offsetHeight);
|
|
1573
|
+
}, p = new ResizeObserver(v);
|
|
1574
|
+
return p.observe(h.current), v(), () => p.disconnect();
|
|
1476
1575
|
}, []);
|
|
1477
|
-
const
|
|
1478
|
-
height:
|
|
1576
|
+
const m = {
|
|
1577
|
+
height: f === "auto" ? "auto" : `${f + 14}px`,
|
|
1479
1578
|
// + padding
|
|
1480
1579
|
maxHeight: o ? `${o}px` : void 0
|
|
1481
1580
|
};
|
|
1482
1581
|
return /* @__PURE__ */ e(
|
|
1483
1582
|
"div",
|
|
1484
1583
|
{
|
|
1485
|
-
ref:
|
|
1486
|
-
className: `absolute bottom-full mb-4 ${
|
|
1487
|
-
style: { ...
|
|
1488
|
-
onClick: (
|
|
1489
|
-
onMouseDown: (
|
|
1490
|
-
onTouchStart: (
|
|
1584
|
+
ref: u,
|
|
1585
|
+
className: `absolute bottom-full mb-4 ${b} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-[height,opacity,transform] duration-300 ease-out ${a}`,
|
|
1586
|
+
style: { ...m, borderRadius: "var(--radius-lg)" },
|
|
1587
|
+
onClick: (v) => v.stopPropagation(),
|
|
1588
|
+
onMouseDown: (v) => v.stopPropagation(),
|
|
1589
|
+
onTouchStart: (v) => v.stopPropagation(),
|
|
1491
1590
|
children: /* @__PURE__ */ e(
|
|
1492
1591
|
"div",
|
|
1493
1592
|
{
|
|
1494
1593
|
className: "overflow-y-auto hide-scrollbar flex-1",
|
|
1495
1594
|
style: { borderRadius: "var(--radius)" },
|
|
1496
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
1595
|
+
children: /* @__PURE__ */ e("div", { ref: h, children: s })
|
|
1497
1596
|
}
|
|
1498
1597
|
)
|
|
1499
1598
|
}
|
|
1500
1599
|
);
|
|
1501
|
-
},
|
|
1502
|
-
content:
|
|
1600
|
+
}, Ne = ({
|
|
1601
|
+
content: s,
|
|
1503
1602
|
className: t
|
|
1504
|
-
}) => typeof
|
|
1603
|
+
}) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e(
|
|
1505
1604
|
"span",
|
|
1506
1605
|
{
|
|
1507
1606
|
className: t,
|
|
1508
|
-
dangerouslySetInnerHTML: { __html:
|
|
1607
|
+
dangerouslySetInnerHTML: { __html: s }
|
|
1509
1608
|
}
|
|
1510
|
-
) : /* @__PURE__ */ e("span", { className: t, children:
|
|
1511
|
-
label:
|
|
1609
|
+
) : /* @__PURE__ */ e("span", { className: t, children: s }) : /* @__PURE__ */ e("span", { className: t, children: s }), L = ({
|
|
1610
|
+
label: s,
|
|
1512
1611
|
value: t,
|
|
1513
|
-
active:
|
|
1612
|
+
active: i,
|
|
1514
1613
|
onClick: o,
|
|
1515
|
-
hasSubmenu:
|
|
1516
|
-
icon:
|
|
1517
|
-
rightIcon:
|
|
1518
|
-
}) => /* @__PURE__ */
|
|
1614
|
+
hasSubmenu: a,
|
|
1615
|
+
icon: u,
|
|
1616
|
+
rightIcon: h
|
|
1617
|
+
}) => /* @__PURE__ */ c(
|
|
1519
1618
|
"button",
|
|
1520
1619
|
{
|
|
1521
1620
|
onClick: o,
|
|
1522
1621
|
className: "w-full flex items-center justify-between px-3 py-2.5 hover:bg-white/10 transition-colors text-left text-zinc-200 active:bg-white/5 focus:outline-none focus:bg-white/10 group overflow-hidden my-0.5",
|
|
1523
1622
|
style: { borderRadius: "var(--radius)" },
|
|
1524
1623
|
children: [
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
|
|
1624
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
1625
|
+
u && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ne, { content: u }) }),
|
|
1527
1626
|
/* @__PURE__ */ e(
|
|
1528
1627
|
"span",
|
|
1529
1628
|
{
|
|
1530
|
-
className: `font-medium truncate text-sm flex items-center ${
|
|
1531
|
-
title: typeof
|
|
1532
|
-
children: /* @__PURE__ */ e(
|
|
1629
|
+
className: `font-medium truncate text-sm flex items-center ${i ? "text-[var(--accent)]" : ""}`,
|
|
1630
|
+
title: typeof s == "string" ? s : void 0,
|
|
1631
|
+
children: /* @__PURE__ */ e(Ne, { content: s })
|
|
1533
1632
|
}
|
|
1534
1633
|
)
|
|
1535
1634
|
] }),
|
|
1536
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 text-zinc-400 shrink-0", children: [
|
|
1537
1636
|
t && /* @__PURE__ */ e(
|
|
1538
1637
|
"span",
|
|
1539
1638
|
{
|
|
1540
1639
|
className: "text-xs font-medium truncate max-w-[60px]",
|
|
1541
1640
|
title: t,
|
|
1542
|
-
children: /* @__PURE__ */ e(
|
|
1641
|
+
children: /* @__PURE__ */ e(Ne, { content: t })
|
|
1543
1642
|
}
|
|
1544
1643
|
),
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1644
|
+
h,
|
|
1645
|
+
i && /* @__PURE__ */ e(He, { className: "w-4 h-4 text-[var(--accent)] shrink-0" }),
|
|
1646
|
+
a && /* @__PURE__ */ e("span", { className: "text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0", children: "›" })
|
|
1548
1647
|
] })
|
|
1549
1648
|
]
|
|
1550
1649
|
}
|
|
1551
|
-
),
|
|
1552
|
-
label:
|
|
1650
|
+
), Z = ({
|
|
1651
|
+
label: s,
|
|
1553
1652
|
onBack: t,
|
|
1554
|
-
rightAction:
|
|
1555
|
-
}) => /* @__PURE__ */
|
|
1653
|
+
rightAction: i
|
|
1654
|
+
}) => /* @__PURE__ */ c(
|
|
1556
1655
|
"div",
|
|
1557
1656
|
{
|
|
1558
1657
|
className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",
|
|
1559
1658
|
style: { borderRadius: "var(--radius)" },
|
|
1560
1659
|
children: [
|
|
1561
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ c(
|
|
1562
1661
|
"button",
|
|
1563
1662
|
{
|
|
1564
1663
|
className: "flex items-center gap-2 hover:text-white transition-colors focus:outline-none",
|
|
1565
1664
|
onClick: t,
|
|
1566
1665
|
children: [
|
|
1567
|
-
/* @__PURE__ */ e(
|
|
1568
|
-
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
1666
|
+
/* @__PURE__ */ e(Wi, { className: "w-3 h-3" }),
|
|
1667
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Ne, { content: s }) })
|
|
1569
1668
|
]
|
|
1570
1669
|
}
|
|
1571
1670
|
),
|
|
1572
|
-
|
|
1671
|
+
i
|
|
1573
1672
|
]
|
|
1574
1673
|
}
|
|
1575
|
-
),
|
|
1576
|
-
items:
|
|
1674
|
+
), me = () => /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }), Xt = ({
|
|
1675
|
+
items: s,
|
|
1577
1676
|
onClose: t,
|
|
1578
|
-
title:
|
|
1677
|
+
title: i,
|
|
1579
1678
|
maxHeight: o,
|
|
1580
|
-
className:
|
|
1679
|
+
className: a
|
|
1581
1680
|
}) => {
|
|
1582
|
-
const [
|
|
1583
|
-
|
|
1584
|
-
},
|
|
1585
|
-
|
|
1681
|
+
const [u, h] = M([]), f = u.length > 0 ? u[u.length - 1] : null, x = f ? f.children || [] : s, b = f ? f.html : i || "Menu", m = () => {
|
|
1682
|
+
h((p) => p.slice(0, -1));
|
|
1683
|
+
}, v = (p) => {
|
|
1684
|
+
p.children && h((S) => [...S, p]);
|
|
1586
1685
|
};
|
|
1587
|
-
return /* @__PURE__ */ e(
|
|
1588
|
-
|
|
1686
|
+
return /* @__PURE__ */ e(lt, { onClose: t, maxHeight: o, className: a, children: /* @__PURE__ */ c("div", { className: "animate-in fade-in slide-in-from-right-4 duration-200", children: [
|
|
1687
|
+
u.length > 0 ? /* @__PURE__ */ e(Z, { label: b || "Menu", onBack: m }) : i && /* @__PURE__ */ e(
|
|
1589
1688
|
"div",
|
|
1590
1689
|
{
|
|
1591
1690
|
className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",
|
|
1592
1691
|
style: { borderRadius: "var(--radius)" },
|
|
1593
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
1692
|
+
children: /* @__PURE__ */ e("span", { children: i })
|
|
1594
1693
|
}
|
|
1595
1694
|
),
|
|
1596
|
-
/* @__PURE__ */ e("div", { className: "pb-1", children:
|
|
1695
|
+
/* @__PURE__ */ e("div", { className: "pb-1", children: x.map((p, S) => p.separator ? /* @__PURE__ */ e(me, {}, S) : p.isLabel ? /* @__PURE__ */ e(
|
|
1597
1696
|
"div",
|
|
1598
1697
|
{
|
|
1599
1698
|
className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none",
|
|
1600
|
-
children: /* @__PURE__ */ e(
|
|
1699
|
+
children: /* @__PURE__ */ e(Ne, { content: p.html || "" })
|
|
1601
1700
|
},
|
|
1602
|
-
|
|
1603
|
-
) :
|
|
1604
|
-
|
|
1701
|
+
S
|
|
1702
|
+
) : p.range ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
|
|
1703
|
+
xe,
|
|
1605
1704
|
{
|
|
1606
|
-
label:
|
|
1607
|
-
icon:
|
|
1608
|
-
value:
|
|
1609
|
-
min:
|
|
1610
|
-
max:
|
|
1611
|
-
step:
|
|
1612
|
-
onChange: (
|
|
1613
|
-
formatValue:
|
|
1705
|
+
label: p.html,
|
|
1706
|
+
icon: p.icon,
|
|
1707
|
+
value: p.value ?? p.min ?? 0,
|
|
1708
|
+
min: p.min ?? 0,
|
|
1709
|
+
max: p.max ?? 100,
|
|
1710
|
+
step: p.step ?? 1,
|
|
1711
|
+
onChange: ($) => p.onRange && p.onRange($),
|
|
1712
|
+
formatValue: p.formatValue
|
|
1614
1713
|
}
|
|
1615
|
-
) },
|
|
1616
|
-
|
|
1714
|
+
) }, S) : p.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
|
|
1715
|
+
le,
|
|
1617
1716
|
{
|
|
1618
|
-
label:
|
|
1619
|
-
icon:
|
|
1620
|
-
checked:
|
|
1621
|
-
tooltip:
|
|
1622
|
-
onChange: (
|
|
1717
|
+
label: p.html,
|
|
1718
|
+
icon: p.icon,
|
|
1719
|
+
checked: p.switch,
|
|
1720
|
+
tooltip: p.tooltip,
|
|
1721
|
+
onChange: ($) => p.onSwitch && p.onSwitch(p, $)
|
|
1623
1722
|
}
|
|
1624
|
-
) },
|
|
1625
|
-
|
|
1723
|
+
) }, S) : /* @__PURE__ */ e(Me.Fragment, { children: /* @__PURE__ */ e(
|
|
1724
|
+
L,
|
|
1626
1725
|
{
|
|
1627
|
-
label:
|
|
1628
|
-
icon:
|
|
1629
|
-
value:
|
|
1630
|
-
active:
|
|
1631
|
-
hasSubmenu: !!
|
|
1726
|
+
label: p.html,
|
|
1727
|
+
icon: p.icon,
|
|
1728
|
+
value: p.currentLabel || p.value,
|
|
1729
|
+
active: p.active,
|
|
1730
|
+
hasSubmenu: !!p.children,
|
|
1632
1731
|
onClick: () => {
|
|
1633
|
-
|
|
1732
|
+
p.children ? v(p) : p.onClick ? (p.onClick(p), !p.switch && !p.range && t()) : p.click && (p.click(p), t());
|
|
1634
1733
|
}
|
|
1635
1734
|
}
|
|
1636
|
-
) },
|
|
1735
|
+
) }, S)) })
|
|
1637
1736
|
] }) });
|
|
1638
|
-
},
|
|
1639
|
-
tracks:
|
|
1737
|
+
}, ys = ({
|
|
1738
|
+
tracks: s,
|
|
1640
1739
|
current: t,
|
|
1641
|
-
onSelect:
|
|
1740
|
+
onSelect: i,
|
|
1642
1741
|
onUpload: o,
|
|
1643
|
-
onClose:
|
|
1644
|
-
settings:
|
|
1645
|
-
onSettingsChange:
|
|
1646
|
-
onReset:
|
|
1647
|
-
offset:
|
|
1648
|
-
onOffsetChange:
|
|
1649
|
-
maxHeight:
|
|
1650
|
-
animationClass:
|
|
1742
|
+
onClose: a,
|
|
1743
|
+
settings: u,
|
|
1744
|
+
onSettingsChange: h,
|
|
1745
|
+
onReset: f,
|
|
1746
|
+
offset: x,
|
|
1747
|
+
onOffsetChange: b,
|
|
1748
|
+
maxHeight: m,
|
|
1749
|
+
animationClass: v
|
|
1651
1750
|
}) => {
|
|
1652
|
-
const [
|
|
1653
|
-
(
|
|
1654
|
-
) :
|
|
1655
|
-
return /* @__PURE__ */
|
|
1656
|
-
|
|
1751
|
+
const [p, S] = M("main"), [$, U] = M(""), H = W(null), q = Ce(() => $ ? s.filter(
|
|
1752
|
+
(g) => g.label.toLowerCase().includes($.toLowerCase()) || g.srcLang && g.srcLang.toLowerCase().includes($.toLowerCase())
|
|
1753
|
+
) : s, [s, $]);
|
|
1754
|
+
return /* @__PURE__ */ c(
|
|
1755
|
+
lt,
|
|
1657
1756
|
{
|
|
1658
|
-
onClose:
|
|
1757
|
+
onClose: a,
|
|
1659
1758
|
align: "right",
|
|
1660
|
-
maxHeight:
|
|
1661
|
-
className:
|
|
1759
|
+
maxHeight: m,
|
|
1760
|
+
className: v,
|
|
1662
1761
|
children: [
|
|
1663
|
-
|
|
1762
|
+
p === "main" && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200 flex flex-col h-full", children: [
|
|
1664
1763
|
/* @__PURE__ */ e(
|
|
1665
1764
|
"div",
|
|
1666
1765
|
{
|
|
@@ -1669,15 +1768,15 @@ const qe = (i, t = 200) => {
|
|
|
1669
1768
|
children: /* @__PURE__ */ e("span", { children: "Subtitles" })
|
|
1670
1769
|
}
|
|
1671
1770
|
),
|
|
1672
|
-
/* @__PURE__ */
|
|
1771
|
+
/* @__PURE__ */ c("div", { className: "px-1.5 pb-2 shrink-0", children: [
|
|
1673
1772
|
/* @__PURE__ */ e(
|
|
1674
|
-
|
|
1773
|
+
L,
|
|
1675
1774
|
{
|
|
1676
1775
|
label: "Upload Subtitle",
|
|
1677
|
-
icon: /* @__PURE__ */ e(
|
|
1776
|
+
icon: /* @__PURE__ */ e(Hi, { className: "w-4 h-4" }),
|
|
1678
1777
|
onClick: () => {
|
|
1679
|
-
var
|
|
1680
|
-
return (
|
|
1778
|
+
var g;
|
|
1779
|
+
return (g = H.current) == null ? void 0 : g.click();
|
|
1681
1780
|
}
|
|
1682
1781
|
}
|
|
1683
1782
|
),
|
|
@@ -1686,159 +1785,159 @@ const qe = (i, t = 200) => {
|
|
|
1686
1785
|
{
|
|
1687
1786
|
type: "file",
|
|
1688
1787
|
accept: ".vtt,.srt",
|
|
1689
|
-
ref:
|
|
1788
|
+
ref: H,
|
|
1690
1789
|
className: "hidden",
|
|
1691
|
-
onChange: (
|
|
1692
|
-
var
|
|
1693
|
-
(
|
|
1790
|
+
onChange: (g) => {
|
|
1791
|
+
var Y;
|
|
1792
|
+
(Y = g.target.files) != null && Y[0] && o(g.target.files[0]);
|
|
1694
1793
|
}
|
|
1695
1794
|
}
|
|
1696
1795
|
),
|
|
1697
1796
|
/* @__PURE__ */ e(
|
|
1698
|
-
|
|
1797
|
+
L,
|
|
1699
1798
|
{
|
|
1700
1799
|
label: "Customize",
|
|
1701
|
-
icon: /* @__PURE__ */ e(
|
|
1702
|
-
onClick: () =>
|
|
1800
|
+
icon: /* @__PURE__ */ e(Zt, { className: "w-4 h-4" }),
|
|
1801
|
+
onClick: () => S("customize"),
|
|
1703
1802
|
hasSubmenu: !0
|
|
1704
1803
|
}
|
|
1705
1804
|
),
|
|
1706
1805
|
/* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }),
|
|
1707
1806
|
/* @__PURE__ */ e(
|
|
1708
|
-
|
|
1807
|
+
L,
|
|
1709
1808
|
{
|
|
1710
1809
|
label: "Off",
|
|
1711
1810
|
active: t === -1,
|
|
1712
1811
|
onClick: () => {
|
|
1713
|
-
|
|
1812
|
+
i(-1), a();
|
|
1714
1813
|
}
|
|
1715
1814
|
}
|
|
1716
1815
|
),
|
|
1717
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ c("div", { className: "relative mt-2", children: [
|
|
1718
1817
|
/* @__PURE__ */ e(
|
|
1719
1818
|
"input",
|
|
1720
1819
|
{
|
|
1721
1820
|
type: "text",
|
|
1722
1821
|
placeholder: "Search subtitles...",
|
|
1723
|
-
value:
|
|
1724
|
-
onChange: (
|
|
1822
|
+
value: $,
|
|
1823
|
+
onChange: (g) => U(g.target.value),
|
|
1725
1824
|
className: "w-full bg-zinc-800/50 border border-white/10 rounded-md py-1.5 pl-8 pr-3 text-xs text-zinc-200 focus:outline-none focus:border-white/20 transition-colors"
|
|
1726
1825
|
}
|
|
1727
1826
|
),
|
|
1728
|
-
/* @__PURE__ */ e(
|
|
1827
|
+
/* @__PURE__ */ e(fs, { className: "w-3.5 h-3.5 text-zinc-500 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
1729
1828
|
] })
|
|
1730
1829
|
] }),
|
|
1731
|
-
/* @__PURE__ */
|
|
1732
|
-
|
|
1733
|
-
let
|
|
1734
|
-
return
|
|
1735
|
-
|
|
1830
|
+
/* @__PURE__ */ c("div", { className: "overflow-y-auto hide-scrollbar flex-1", children: [
|
|
1831
|
+
q.map((g) => {
|
|
1832
|
+
let Y = null;
|
|
1833
|
+
return g.status === "loading" ? Y = /* @__PURE__ */ e(De, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)]" }) : g.status === "error" ? Y = /* @__PURE__ */ e(bs, { className: "w-3.5 h-3.5 text-red-500" }) : g.status === "success" && (Y = /* @__PURE__ */ e(ii, { className: "w-3.5 h-3.5 text-emerald-500" })), /* @__PURE__ */ e(
|
|
1834
|
+
L,
|
|
1736
1835
|
{
|
|
1737
|
-
label:
|
|
1738
|
-
value:
|
|
1739
|
-
active: t ===
|
|
1740
|
-
rightIcon:
|
|
1836
|
+
label: g.label,
|
|
1837
|
+
value: g.srcLang,
|
|
1838
|
+
active: t === g.index,
|
|
1839
|
+
rightIcon: Y,
|
|
1741
1840
|
onClick: () => {
|
|
1742
|
-
|
|
1841
|
+
i(g.index), a();
|
|
1743
1842
|
}
|
|
1744
1843
|
},
|
|
1745
|
-
|
|
1844
|
+
g.index
|
|
1746
1845
|
);
|
|
1747
1846
|
}),
|
|
1748
|
-
|
|
1847
|
+
q.length === 0 && $ && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-center text-xs text-zinc-500", children: "No results found" })
|
|
1749
1848
|
] })
|
|
1750
1849
|
] }),
|
|
1751
|
-
|
|
1850
|
+
p === "customize" && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
1752
1851
|
/* @__PURE__ */ e(
|
|
1753
|
-
|
|
1852
|
+
Z,
|
|
1754
1853
|
{
|
|
1755
1854
|
label: "Customize",
|
|
1756
|
-
onBack: () =>
|
|
1855
|
+
onBack: () => S("main"),
|
|
1757
1856
|
rightAction: /* @__PURE__ */ e(
|
|
1758
1857
|
"button",
|
|
1759
1858
|
{
|
|
1760
|
-
onClick:
|
|
1859
|
+
onClick: f,
|
|
1761
1860
|
className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10",
|
|
1762
1861
|
title: "Reset All",
|
|
1763
|
-
children: /* @__PURE__ */ e(
|
|
1862
|
+
children: /* @__PURE__ */ e(Ji, { className: "w-4 h-4" })
|
|
1764
1863
|
}
|
|
1765
1864
|
)
|
|
1766
1865
|
}
|
|
1767
1866
|
),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */ e(
|
|
1770
|
-
|
|
1867
|
+
/* @__PURE__ */ c("div", { className: "pb-1", children: [
|
|
1868
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
1869
|
+
le,
|
|
1771
1870
|
{
|
|
1772
1871
|
label: "Native Video Subtitle",
|
|
1773
|
-
checked:
|
|
1774
|
-
onChange: (
|
|
1872
|
+
checked: u.useNative,
|
|
1873
|
+
onChange: (g) => h({ useNative: g })
|
|
1775
1874
|
}
|
|
1776
1875
|
) }),
|
|
1777
|
-
!
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */ e("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */ e(
|
|
1876
|
+
!u.useNative && /* @__PURE__ */ c(Q, { children: [
|
|
1877
|
+
/* @__PURE__ */ c(pe, { title: "Sync & Position", children: [
|
|
1878
|
+
/* @__PURE__ */ c("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
|
|
1879
|
+
/* @__PURE__ */ e("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
|
|
1880
|
+
/* @__PURE__ */ e(Gi, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
|
|
1782
1881
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Sync Offset" })
|
|
1783
1882
|
] }) }),
|
|
1784
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1785
1884
|
/* @__PURE__ */ e(
|
|
1786
1885
|
"button",
|
|
1787
1886
|
{
|
|
1788
|
-
onClick: () =>
|
|
1887
|
+
onClick: () => b(Math.round((x - 0.1) * 10) / 10),
|
|
1789
1888
|
className: "w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",
|
|
1790
|
-
children: /* @__PURE__ */ e(
|
|
1889
|
+
children: /* @__PURE__ */ e(_i, { className: "w-4 h-4" })
|
|
1791
1890
|
}
|
|
1792
1891
|
),
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
|
|
1795
|
-
(
|
|
1892
|
+
/* @__PURE__ */ c("div", { className: "flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]", children: [
|
|
1893
|
+
x > 0 ? "+" : "",
|
|
1894
|
+
(x == null ? void 0 : x.toFixed(1)) || "0.0",
|
|
1796
1895
|
"s"
|
|
1797
1896
|
] }),
|
|
1798
1897
|
/* @__PURE__ */ e(
|
|
1799
1898
|
"button",
|
|
1800
1899
|
{
|
|
1801
|
-
onClick: () =>
|
|
1900
|
+
onClick: () => b(Math.round((x + 0.1) * 10) / 10),
|
|
1802
1901
|
className: "w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",
|
|
1803
|
-
children: /* @__PURE__ */ e(
|
|
1902
|
+
children: /* @__PURE__ */ e(qi, { className: "w-4 h-4" })
|
|
1804
1903
|
}
|
|
1805
1904
|
)
|
|
1806
1905
|
] })
|
|
1807
1906
|
] }),
|
|
1808
1907
|
/* @__PURE__ */ e(
|
|
1809
|
-
|
|
1908
|
+
xe,
|
|
1810
1909
|
{
|
|
1811
1910
|
label: "Vertical Position",
|
|
1812
|
-
icon: /* @__PURE__ */ e(
|
|
1813
|
-
value:
|
|
1911
|
+
icon: /* @__PURE__ */ e(Yi, { className: "w-4 h-4" }),
|
|
1912
|
+
value: u.verticalOffset,
|
|
1814
1913
|
min: 0,
|
|
1815
1914
|
max: 200,
|
|
1816
1915
|
step: 5,
|
|
1817
|
-
onChange: (
|
|
1818
|
-
formatValue: (
|
|
1916
|
+
onChange: (g) => h({ verticalOffset: g }),
|
|
1917
|
+
formatValue: (g) => `${g}px`
|
|
1819
1918
|
}
|
|
1820
1919
|
)
|
|
1821
1920
|
] }),
|
|
1822
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ c(pe, { title: "Appearance", children: [
|
|
1823
1922
|
/* @__PURE__ */ e(
|
|
1824
|
-
|
|
1923
|
+
xe,
|
|
1825
1924
|
{
|
|
1826
1925
|
label: "Text Size",
|
|
1827
|
-
icon: /* @__PURE__ */ e(
|
|
1828
|
-
value:
|
|
1926
|
+
icon: /* @__PURE__ */ e(Xi, { className: "w-4 h-4" }),
|
|
1927
|
+
value: u.textSize,
|
|
1829
1928
|
min: 50,
|
|
1830
1929
|
max: 200,
|
|
1831
1930
|
step: 10,
|
|
1832
|
-
onChange: (
|
|
1833
|
-
formatValue: (
|
|
1931
|
+
onChange: (g) => h({ textSize: g }),
|
|
1932
|
+
formatValue: (g) => `${g}%`
|
|
1834
1933
|
}
|
|
1835
1934
|
),
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */ e(
|
|
1935
|
+
/* @__PURE__ */ c("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
|
|
1936
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
1937
|
+
/* @__PURE__ */ e(ei, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
|
|
1839
1938
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Text Color" })
|
|
1840
1939
|
] }),
|
|
1841
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg", children: [
|
|
1842
1941
|
[
|
|
1843
1942
|
"#ffffff",
|
|
1844
1943
|
"#ffff00",
|
|
@@ -1846,35 +1945,35 @@ const qe = (i, t = 200) => {
|
|
|
1846
1945
|
"#ff00ff",
|
|
1847
1946
|
"#ff0000",
|
|
1848
1947
|
"#00ff00"
|
|
1849
|
-
].map((
|
|
1948
|
+
].map((g) => /* @__PURE__ */ e(
|
|
1850
1949
|
"button",
|
|
1851
1950
|
{
|
|
1852
|
-
onClick: () =>
|
|
1853
|
-
className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${
|
|
1951
|
+
onClick: () => h({ textColor: g }),
|
|
1952
|
+
className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${u.textColor === g ? "ring-2 scale-110" : ""}`,
|
|
1854
1953
|
style: {
|
|
1855
|
-
backgroundColor:
|
|
1954
|
+
backgroundColor: g,
|
|
1856
1955
|
"--tw-ring-color": "var(--accent)"
|
|
1857
1956
|
}
|
|
1858
1957
|
},
|
|
1859
|
-
|
|
1958
|
+
g
|
|
1860
1959
|
)),
|
|
1861
1960
|
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/10 mx-1" }),
|
|
1862
1961
|
/* @__PURE__ */ e("div", { className: "relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer", children: /* @__PURE__ */ e(
|
|
1863
1962
|
"input",
|
|
1864
1963
|
{
|
|
1865
1964
|
type: "color",
|
|
1866
|
-
value:
|
|
1867
|
-
onChange: (
|
|
1965
|
+
value: u.textColor,
|
|
1966
|
+
onChange: (g) => h({ textColor: g.target.value }),
|
|
1868
1967
|
className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"
|
|
1869
1968
|
}
|
|
1870
1969
|
) })
|
|
1871
1970
|
] })
|
|
1872
1971
|
] }),
|
|
1873
1972
|
/* @__PURE__ */ e(
|
|
1874
|
-
|
|
1973
|
+
ws,
|
|
1875
1974
|
{
|
|
1876
1975
|
label: "Text Style",
|
|
1877
|
-
value:
|
|
1976
|
+
value: u.textStyle,
|
|
1878
1977
|
options: [
|
|
1879
1978
|
{ label: "None", value: "none" },
|
|
1880
1979
|
{ label: "Outline", value: "outline" },
|
|
@@ -1882,65 +1981,65 @@ const qe = (i, t = 200) => {
|
|
|
1882
1981
|
{ label: "Depressed", value: "depressed" },
|
|
1883
1982
|
{ label: "Drop Shadow", value: "shadow" }
|
|
1884
1983
|
],
|
|
1885
|
-
onChange: (
|
|
1886
|
-
textStyle:
|
|
1984
|
+
onChange: (g) => h({
|
|
1985
|
+
textStyle: g
|
|
1887
1986
|
})
|
|
1888
1987
|
}
|
|
1889
1988
|
),
|
|
1890
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-2 mt-1 px-1", children: [
|
|
1891
1990
|
/* @__PURE__ */ e(
|
|
1892
|
-
|
|
1991
|
+
le,
|
|
1893
1992
|
{
|
|
1894
1993
|
label: "Bold",
|
|
1895
|
-
icon: /* @__PURE__ */ e(
|
|
1896
|
-
checked:
|
|
1897
|
-
onChange: (
|
|
1994
|
+
icon: /* @__PURE__ */ e(Ki, { className: "w-4 h-4" }),
|
|
1995
|
+
checked: u.isBold,
|
|
1996
|
+
onChange: (g) => h({ isBold: g })
|
|
1898
1997
|
}
|
|
1899
1998
|
),
|
|
1900
1999
|
/* @__PURE__ */ e(
|
|
1901
|
-
|
|
2000
|
+
le,
|
|
1902
2001
|
{
|
|
1903
2002
|
label: "Fix Caps",
|
|
1904
|
-
icon: /* @__PURE__ */ e(
|
|
1905
|
-
checked:
|
|
1906
|
-
onChange: (
|
|
2003
|
+
icon: /* @__PURE__ */ e(Zi, { className: "w-4 h-4" }),
|
|
2004
|
+
checked: u.fixCapitalization,
|
|
2005
|
+
onChange: (g) => h({ fixCapitalization: g })
|
|
1907
2006
|
}
|
|
1908
2007
|
)
|
|
1909
2008
|
] })
|
|
1910
2009
|
] }),
|
|
1911
|
-
/* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ c(pe, { title: "Background", children: [
|
|
1912
2011
|
/* @__PURE__ */ e(
|
|
1913
|
-
|
|
2012
|
+
xe,
|
|
1914
2013
|
{
|
|
1915
2014
|
label: "Opacity",
|
|
1916
|
-
icon: /* @__PURE__ */ e(
|
|
1917
|
-
value:
|
|
2015
|
+
icon: /* @__PURE__ */ e(Qi, { className: "w-4 h-4" }),
|
|
2016
|
+
value: u.backgroundOpacity,
|
|
1918
2017
|
min: 0,
|
|
1919
2018
|
max: 100,
|
|
1920
2019
|
step: 5,
|
|
1921
|
-
onChange: (
|
|
1922
|
-
formatValue: (
|
|
2020
|
+
onChange: (g) => h({ backgroundOpacity: g }),
|
|
2021
|
+
formatValue: (g) => `${g}%`
|
|
1923
2022
|
}
|
|
1924
2023
|
),
|
|
1925
2024
|
/* @__PURE__ */ e(
|
|
1926
|
-
|
|
2025
|
+
le,
|
|
1927
2026
|
{
|
|
1928
2027
|
label: "Blur Background",
|
|
1929
|
-
icon: /* @__PURE__ */ e(
|
|
1930
|
-
checked:
|
|
1931
|
-
onChange: (
|
|
2028
|
+
icon: /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
|
|
2029
|
+
checked: u.backgroundBlur,
|
|
2030
|
+
onChange: (g) => h({ backgroundBlur: g })
|
|
1932
2031
|
}
|
|
1933
2032
|
),
|
|
1934
|
-
|
|
1935
|
-
|
|
2033
|
+
u.backgroundBlur && /* @__PURE__ */ e(
|
|
2034
|
+
xe,
|
|
1936
2035
|
{
|
|
1937
2036
|
label: "Blur Intensity",
|
|
1938
|
-
value:
|
|
2037
|
+
value: u.backgroundBlurAmount,
|
|
1939
2038
|
min: 0,
|
|
1940
2039
|
max: 20,
|
|
1941
2040
|
step: 1,
|
|
1942
|
-
onChange: (
|
|
1943
|
-
formatValue: (
|
|
2041
|
+
onChange: (g) => h({ backgroundBlurAmount: g }),
|
|
2042
|
+
formatValue: (g) => `${g}px`
|
|
1944
2043
|
}
|
|
1945
2044
|
)
|
|
1946
2045
|
] })
|
|
@@ -1950,336 +2049,345 @@ const qe = (i, t = 200) => {
|
|
|
1950
2049
|
]
|
|
1951
2050
|
}
|
|
1952
2051
|
);
|
|
1953
|
-
},
|
|
1954
|
-
const
|
|
2052
|
+
}, nt = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(Q, { children: s }), ks = ({ x: s, y: t, items: i, onClose: o, containerWidth: a, containerHeight: u }) => {
|
|
2053
|
+
const h = W(null), [f, x] = M({
|
|
1955
2054
|
top: t,
|
|
1956
|
-
left:
|
|
2055
|
+
left: s,
|
|
1957
2056
|
opacity: 0
|
|
1958
2057
|
});
|
|
1959
|
-
return
|
|
1960
|
-
if (!
|
|
1961
|
-
const
|
|
1962
|
-
let
|
|
1963
|
-
|
|
1964
|
-
let
|
|
1965
|
-
|
|
1966
|
-
top:
|
|
1967
|
-
left:
|
|
1968
|
-
maxHeight:
|
|
2058
|
+
return Be(() => {
|
|
2059
|
+
if (!h.current) return;
|
|
2060
|
+
const b = h.current.getBoundingClientRect(), m = b.width, v = b.height;
|
|
2061
|
+
let p = s, S = t;
|
|
2062
|
+
s + m > a - 10 && (p = s - m), p < 10 && (p = 10), p + m > a && (p = Math.max(10, a - m - 10)), t + v > u - 10 && (S = t - v);
|
|
2063
|
+
let $ = u - 20;
|
|
2064
|
+
S < 10 && (S = 10), S + v > u - 10 && (S = Math.max(10, u - v - 10)), x({
|
|
2065
|
+
top: S,
|
|
2066
|
+
left: p,
|
|
2067
|
+
maxHeight: $,
|
|
1969
2068
|
opacity: 1
|
|
1970
2069
|
});
|
|
1971
|
-
}, [
|
|
1972
|
-
const
|
|
1973
|
-
|
|
2070
|
+
}, [s, t, i, a, u]), ee(() => {
|
|
2071
|
+
const b = (m) => {
|
|
2072
|
+
h.current && !h.current.contains(m.target) && o();
|
|
1974
2073
|
};
|
|
1975
|
-
return document.addEventListener("mousedown",
|
|
2074
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
1976
2075
|
}, [o]), /* @__PURE__ */ e(
|
|
1977
2076
|
"div",
|
|
1978
2077
|
{
|
|
1979
|
-
ref:
|
|
2078
|
+
ref: h,
|
|
1980
2079
|
className: "absolute z-50 min-w-[200px] bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl p-1.5 font-[family-name:var(--font-main)] overflow-y-auto hide-scrollbar flex flex-col",
|
|
1981
2080
|
style: {
|
|
1982
|
-
top:
|
|
1983
|
-
left:
|
|
1984
|
-
maxHeight:
|
|
1985
|
-
opacity:
|
|
2081
|
+
top: f.top,
|
|
2082
|
+
left: f.left,
|
|
2083
|
+
maxHeight: f.maxHeight,
|
|
2084
|
+
opacity: f.opacity,
|
|
1986
2085
|
borderRadius: "var(--radius-lg)"
|
|
1987
2086
|
},
|
|
1988
|
-
onClick: (
|
|
1989
|
-
onMouseDown: (
|
|
1990
|
-
onTouchStart: (
|
|
1991
|
-
children:
|
|
1992
|
-
/* @__PURE__ */
|
|
2087
|
+
onClick: (b) => b.stopPropagation(),
|
|
2088
|
+
onMouseDown: (b) => b.stopPropagation(),
|
|
2089
|
+
onTouchStart: (b) => b.stopPropagation(),
|
|
2090
|
+
children: i.map((b, m) => b.separator ? /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1.5" }, m) : b.isLabel ? /* @__PURE__ */ e("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none", children: /* @__PURE__ */ e(nt, { content: b.html || "" }) }, m) : /* @__PURE__ */ c(Me.Fragment, { children: [
|
|
2091
|
+
/* @__PURE__ */ c(
|
|
1993
2092
|
"button",
|
|
1994
2093
|
{
|
|
1995
2094
|
onClick: () => {
|
|
1996
|
-
|
|
2095
|
+
b.disabled || (b.click ? b.click(o) : b.onClick && b.onClick(o));
|
|
1997
2096
|
},
|
|
1998
|
-
disabled:
|
|
2097
|
+
disabled: b.disabled,
|
|
1999
2098
|
className: "w-full text-left px-3 py-2.5 flex items-center justify-between hover:bg-white/10 focus:bg-white/10 focus:outline-none transition-colors text-sm text-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed group my-0.5",
|
|
2000
2099
|
style: { borderRadius: "var(--radius)" },
|
|
2001
2100
|
children: [
|
|
2002
|
-
/* @__PURE__ */
|
|
2003
|
-
|
|
2004
|
-
/* @__PURE__ */ e("span", { className: `flex items-center font-medium truncate ${
|
|
2101
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
2102
|
+
b.icon && /* @__PURE__ */ e("span", { className: "text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors", children: /* @__PURE__ */ e(nt, { content: b.icon }) }),
|
|
2103
|
+
/* @__PURE__ */ e("span", { className: `flex items-center font-medium truncate ${b.checked ? "text-[var(--accent)]" : ""}`, children: /* @__PURE__ */ e(nt, { content: b.html || "" }) })
|
|
2005
2104
|
] }),
|
|
2006
|
-
|
|
2105
|
+
b.checked && /* @__PURE__ */ e(He, { className: "w-4 h-4 text-[var(--accent)] shrink-0 ml-2" })
|
|
2007
2106
|
]
|
|
2008
2107
|
}
|
|
2009
2108
|
),
|
|
2010
|
-
|
|
2011
|
-
] },
|
|
2109
|
+
b.showBorder && /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1" })
|
|
2110
|
+
] }, m))
|
|
2012
2111
|
}
|
|
2013
2112
|
);
|
|
2014
|
-
},
|
|
2015
|
-
const [
|
|
2016
|
-
return
|
|
2017
|
-
const
|
|
2018
|
-
var
|
|
2019
|
-
if (!
|
|
2020
|
-
const
|
|
2113
|
+
}, Ss = ({ player: s, onClose: t }) => {
|
|
2114
|
+
const [i, o] = M({});
|
|
2115
|
+
return ee(() => {
|
|
2116
|
+
const a = () => {
|
|
2117
|
+
var x;
|
|
2118
|
+
if (!s.video) return;
|
|
2119
|
+
const h = s.video, f = h.getVideoPlaybackQuality ? h.getVideoPlaybackQuality() : null;
|
|
2021
2120
|
o({
|
|
2022
|
-
"Player Size": `${
|
|
2023
|
-
"Video Resolution": `${
|
|
2024
|
-
"Current Time": `${
|
|
2025
|
-
Duration: `${
|
|
2026
|
-
Volume: `${Math.round(
|
|
2027
|
-
"Dropped Frames":
|
|
2028
|
-
Buffer:
|
|
2029
|
-
Engine: ((
|
|
2030
|
-
URL:
|
|
2121
|
+
"Player Size": `${h.offsetWidth} x ${h.offsetHeight}`,
|
|
2122
|
+
"Video Resolution": `${h.videoWidth} x ${h.videoHeight}`,
|
|
2123
|
+
"Current Time": `${h.currentTime.toFixed(3)}s`,
|
|
2124
|
+
Duration: `${h.duration.toFixed(3)}s`,
|
|
2125
|
+
Volume: `${Math.round(h.volume * 100)}%`,
|
|
2126
|
+
"Dropped Frames": f ? f.droppedVideoFrames : "N/A",
|
|
2127
|
+
Buffer: h.buffered.length > 0 ? `${(h.buffered.end(h.buffered.length - 1) - h.currentTime).toFixed(2)}s` : "0s",
|
|
2128
|
+
Engine: ((x = s.store.get().sources[s.store.get().currentSourceIndex]) == null ? void 0 : x.type) || "native",
|
|
2129
|
+
URL: h.currentSrc
|
|
2031
2130
|
});
|
|
2032
2131
|
};
|
|
2033
|
-
|
|
2034
|
-
const
|
|
2035
|
-
return () => clearInterval(
|
|
2036
|
-
}, [
|
|
2132
|
+
a();
|
|
2133
|
+
const u = setInterval(a, 1e3);
|
|
2134
|
+
return () => clearInterval(u);
|
|
2135
|
+
}, [s]), /* @__PURE__ */ e("div", { className: "absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ c(
|
|
2037
2136
|
"div",
|
|
2038
2137
|
{
|
|
2039
2138
|
className: "bg-[var(--bg-panel)] border border-white/10 rounded-xl w-full max-w-md shadow-2xl relative font-mono text-xs text-zinc-300 flex flex-col",
|
|
2040
2139
|
style: { borderRadius: "var(--radius)", maxHeight: "90%" },
|
|
2041
2140
|
children: [
|
|
2042
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ c("div", { className: "p-5 pb-0 flex-shrink-0 relative", children: [
|
|
2043
2142
|
/* @__PURE__ */ e(
|
|
2044
2143
|
"button",
|
|
2045
2144
|
{
|
|
2046
|
-
onClick: (
|
|
2047
|
-
|
|
2145
|
+
onClick: (a) => {
|
|
2146
|
+
a.stopPropagation(), t();
|
|
2048
2147
|
},
|
|
2049
2148
|
className: "absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",
|
|
2050
|
-
children: /* @__PURE__ */ e(
|
|
2149
|
+
children: /* @__PURE__ */ e(ti, { className: "w-4 h-4" })
|
|
2051
2150
|
}
|
|
2052
2151
|
),
|
|
2053
2152
|
/* @__PURE__ */ e("h3", { className: "text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2", children: "Video Statistics" })
|
|
2054
2153
|
] }),
|
|
2055
|
-
/* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0", children: Object.entries(
|
|
2056
|
-
/* @__PURE__ */ e("span", { className: "text-zinc-500 font-bold shrink-0", children:
|
|
2057
|
-
/* @__PURE__ */ e("span", { className: "text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right", title: String(
|
|
2058
|
-
] },
|
|
2154
|
+
/* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0", children: Object.entries(i).map(([a, u]) => /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1", children: [
|
|
2155
|
+
/* @__PURE__ */ e("span", { className: "text-zinc-500 font-bold shrink-0", children: a }),
|
|
2156
|
+
/* @__PURE__ */ e("span", { className: "text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right", title: String(u), children: String(u) })
|
|
2157
|
+
] }, a)) })
|
|
2059
2158
|
]
|
|
2060
2159
|
}
|
|
2061
2160
|
) });
|
|
2062
2161
|
};
|
|
2063
|
-
function
|
|
2064
|
-
if (!
|
|
2065
|
-
|
|
2066
|
-
const t = parseInt(
|
|
2067
|
-
return (t * 299 +
|
|
2162
|
+
function Cs(s) {
|
|
2163
|
+
if (!s) return "#ffffff";
|
|
2164
|
+
s = s.replace("#", ""), s.length === 3 && (s = s.split("").map((u) => u + u).join(""));
|
|
2165
|
+
const t = parseInt(s.substring(0, 2), 16), i = parseInt(s.substring(2, 4), 16), o = parseInt(s.substring(4, 6), 16);
|
|
2166
|
+
return (t * 299 + i * 587 + o * 114) / 1e3 >= 128 ? "#000000" : "#ffffff";
|
|
2068
2167
|
}
|
|
2069
|
-
const
|
|
2168
|
+
const Ns = [
|
|
2070
2169
|
{ label: "Strata", value: "#6366f1" },
|
|
2071
2170
|
{ label: "Emerald", value: "#10b981" },
|
|
2072
2171
|
{ label: "Rose", value: "#f43f5e" },
|
|
2073
2172
|
{ label: "Amber", value: "#f59e0b" },
|
|
2074
2173
|
{ label: "Sky", value: "#0ea5e9" },
|
|
2075
2174
|
{ label: "Violet", value: "#8b5cf6" }
|
|
2076
|
-
],
|
|
2175
|
+
], Ms = [
|
|
2077
2176
|
{ label: "Default", value: "default", color: "#6366f1" },
|
|
2078
2177
|
{ label: "Pixel", value: "pixel", color: "#ef4444" },
|
|
2079
2178
|
{ label: "Game", value: "game", color: "#eab308" },
|
|
2080
2179
|
{ label: "Hacker", value: "hacker", color: "#22c55e" }
|
|
2081
|
-
],
|
|
2082
|
-
var
|
|
2083
|
-
const { src: t, type:
|
|
2084
|
-
|
|
2085
|
-
const
|
|
2086
|
-
|
|
2087
|
-
}, [
|
|
2088
|
-
() =>
|
|
2089
|
-
() =>
|
|
2090
|
-
),
|
|
2091
|
-
|
|
2092
|
-
const [
|
|
2093
|
-
(
|
|
2094
|
-
}, [
|
|
2095
|
-
|
|
2096
|
-
const
|
|
2097
|
-
(
|
|
2180
|
+
], Qt = ({ content: s, className: t, style: i }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("div", { className: t, style: i, dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("div", { className: t, style: i, children: s }) : /* @__PURE__ */ e("div", { className: t, style: i, children: s }), Yt = (s) => {
|
|
2181
|
+
var Dt, Ot;
|
|
2182
|
+
const { src: t, type: i, sources: o, poster: a, autoPlay: u, thumbnails: h, textTracks: f, plugins: x, onGetInstance: b, ...m } = s, v = m.screenshot ?? !1, p = m.pip ?? !0, S = m.setting ?? !0, $ = m.fullscreen ?? !0, U = m.fullscreenWeb ?? !1, H = m.lock ?? !1, q = m.fastForward ?? !0, g = m.flip ?? !0, Y = m.aspectRatio ?? !0, G = m.hotKey ?? !0, fe = m.backdrop ?? !0, k = m.gestureSeek ?? !1, j = m.centerControls ?? !0, D = m.fetchTimeout ?? 3e4;
|
|
2183
|
+
m.autoOrientation;
|
|
2184
|
+
const T = W(null), [n, X] = M(null), [_, ne] = M(!1), [re, be] = M(0), [ge, Te] = M(0), [We, je] = M(!1), ct = Ce(() => Kt(m), []), r = Ni(
|
|
2185
|
+
Ve((d) => n ? n.store.subscribe(d) : () => {
|
|
2186
|
+
}, [n]),
|
|
2187
|
+
() => n ? n.store.get() : ct,
|
|
2188
|
+
() => ct
|
|
2189
|
+
), si = Ce(() => Cs(r.themeColor), [r.themeColor]), [V, dt] = M(!1), [B, ut] = M(!1), [J, A] = M("main"), [E, Ue] = M(null), Ge = W(null);
|
|
2190
|
+
E && (Ge.current = E);
|
|
2191
|
+
const [oe, ht] = M({ x: 0, y: 0, visible: !1 }), [ni, mt] = M(!1), pt = st(V, 300), ft = st(B, 300), ze = st(!!E, 300), z = Ve(() => {
|
|
2192
|
+
(V || B || E || oe.visible) && (dt(!1), ut(!1), Ue(null), ht((d) => ({ ...d, visible: !1 })));
|
|
2193
|
+
}, [V, B, E, oe.visible]);
|
|
2194
|
+
ee(() => {
|
|
2195
|
+
const d = (w) => {
|
|
2196
|
+
(V || B || E || oe.visible) && z();
|
|
2098
2197
|
};
|
|
2099
|
-
return (
|
|
2100
|
-
document.removeEventListener("click",
|
|
2198
|
+
return (V || B || E || oe.visible) && (document.addEventListener("click", d), document.addEventListener("touchstart", d)), () => {
|
|
2199
|
+
document.removeEventListener("click", d), document.removeEventListener("touchstart", d);
|
|
2101
2200
|
};
|
|
2102
|
-
}, [
|
|
2103
|
-
const [
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
}, [
|
|
2107
|
-
if (!
|
|
2201
|
+
}, [V, B, E, oe.visible, z]);
|
|
2202
|
+
const [_e, Ie] = M(!1), [Re, qe] = M(0), [oi, bt] = M(!1), [ai, gt] = M(!1), [Pe, ve] = M(!1), [vt, Xe] = M(!1), [xt, wt] = M([]), [yt, kt] = M(null), [ri, li] = M(0), [ce, St] = M(null), [ue, Le] = M(null), [Ts, Ct] = M(null), [Qe, Nt] = M(!1), Ye = W(null), Mt = W(1), we = W(null), Fe = W(null), Tt = W(0), zt = W(0), It = W(0), te = W(null), ye = W(!1), ke = W(null), de = W(null), Je = W(null), Ke = W(null), Se = W(null);
|
|
2203
|
+
Be(() => {
|
|
2204
|
+
n && T.current && n.attach(T.current);
|
|
2205
|
+
}, [n, r.isWebFullscreen]), Be(() => {
|
|
2206
|
+
if (!T.current) return;
|
|
2108
2207
|
(() => {
|
|
2109
|
-
|
|
2208
|
+
T.current && (be(T.current.clientHeight), Te(T.current.clientWidth));
|
|
2110
2209
|
})();
|
|
2111
|
-
const
|
|
2112
|
-
for (const N of
|
|
2113
|
-
|
|
2210
|
+
const w = new ResizeObserver((C) => {
|
|
2211
|
+
for (const N of C)
|
|
2212
|
+
be(N.contentRect.height), Te(N.contentRect.width);
|
|
2114
2213
|
});
|
|
2115
|
-
return
|
|
2116
|
-
|
|
2214
|
+
return w.observe(T.current), () => {
|
|
2215
|
+
w.disconnect();
|
|
2117
2216
|
};
|
|
2118
|
-
}, [
|
|
2119
|
-
if (
|
|
2120
|
-
const
|
|
2121
|
-
return
|
|
2122
|
-
|
|
2217
|
+
}, [r.isWebFullscreen]), ee(() => {
|
|
2218
|
+
if (je("ontouchstart" in window || navigator.maxTouchPoints > 0), !T.current) return;
|
|
2219
|
+
const d = new $i({ ...m, poster: a });
|
|
2220
|
+
return x && x.length > 0 && x.forEach((w) => d.use(w)), d.attach(T.current), X(d), b && b(d), () => {
|
|
2221
|
+
d.destroy(), X(null);
|
|
2123
2222
|
};
|
|
2124
|
-
}, []),
|
|
2125
|
-
if (!
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2128
|
-
}, [
|
|
2129
|
-
if (!
|
|
2130
|
-
const
|
|
2131
|
-
o && o.length > 0 ? (
|
|
2132
|
-
}, [t,
|
|
2133
|
-
|
|
2134
|
-
|
|
2223
|
+
}, []), ee(() => {
|
|
2224
|
+
if (!n) return;
|
|
2225
|
+
const d = {};
|
|
2226
|
+
m.theme !== void 0 && m.theme !== r.theme && (d.theme = m.theme), m.themeColor !== void 0 && m.themeColor !== r.themeColor && (d.themeColor = m.themeColor), m.iconSize !== void 0 && m.iconSize !== r.iconSize && (d.iconSize = m.iconSize), m.brightness !== void 0 && Math.abs(m.brightness - r.brightness) > 0.05 && n.setBrightness(m.brightness), m.videoFit !== void 0 && m.videoFit !== r.videoFit && n.setVideoFit(m.videoFit), Object.keys(d).length > 0 && n.setAppearance(d), m.volume !== void 0 && Math.abs(m.volume - r.volume) > 0.01 && n.setVolume(m.volume), m.muted !== void 0 && m.muted !== r.isMuted && (m.muted ? n.video.muted = !0 : n.video.muted = !1);
|
|
2227
|
+
}, [n, m.theme, m.themeColor, m.iconSize, m.volume, m.muted, m.brightness, m.videoFit]), ee(() => {
|
|
2228
|
+
if (!n) return;
|
|
2229
|
+
const d = f || [];
|
|
2230
|
+
o && o.length > 0 ? (ne(!1), n.setSources(o, d)) : t && (ne(!1), n.setSources([{ url: t, type: i || "auto" }], d));
|
|
2231
|
+
}, [t, i, o, f, n]), ee(() => {
|
|
2232
|
+
n && u && n.play().catch(() => {
|
|
2233
|
+
n.pause(), n.store.setState({ isPlaying: !1, isBuffering: !1 }), n.notify({ type: "warning", message: "Autoplay blocked by browser. Click play to start.", duration: 5e3 });
|
|
2135
2234
|
});
|
|
2136
|
-
}, [
|
|
2137
|
-
|
|
2138
|
-
}, [
|
|
2139
|
-
|
|
2140
|
-
}, [
|
|
2141
|
-
|
|
2235
|
+
}, [n, u]), ee(() => {
|
|
2236
|
+
r.isPlaying && !_ && ne(!0);
|
|
2237
|
+
}, [r.isPlaying, _]), ee(() => {
|
|
2238
|
+
h && n ? Li(h, n.notify.bind(n), D).then((d) => wt(d)) : wt([]);
|
|
2239
|
+
}, [h, n, D]), ee(() => (ue && (Se.current && clearTimeout(Se.current), Se.current = setTimeout(() => {
|
|
2240
|
+
Le(null);
|
|
2142
2241
|
}, 600)), () => {
|
|
2143
|
-
|
|
2144
|
-
}), [
|
|
2145
|
-
const
|
|
2242
|
+
Se.current && clearTimeout(Se.current);
|
|
2243
|
+
}), [ue]), ee(() => {
|
|
2244
|
+
const d = (w) => {
|
|
2146
2245
|
var N;
|
|
2147
|
-
if (!
|
|
2148
|
-
switch (
|
|
2246
|
+
if (!n || !G || ((N = document.activeElement) == null ? void 0 : N.tagName) === "INPUT") return;
|
|
2247
|
+
switch (w.key.toLowerCase()) {
|
|
2149
2248
|
case " ":
|
|
2150
2249
|
case "k":
|
|
2151
|
-
|
|
2250
|
+
w.preventDefault(), n.togglePlay();
|
|
2152
2251
|
break;
|
|
2153
2252
|
case "arrowright":
|
|
2154
|
-
|
|
2253
|
+
w.preventDefault(), n.skip(5);
|
|
2155
2254
|
break;
|
|
2156
2255
|
case "arrowleft":
|
|
2157
|
-
|
|
2256
|
+
w.preventDefault(), n.skip(-5);
|
|
2158
2257
|
break;
|
|
2159
2258
|
case "arrowup":
|
|
2160
|
-
|
|
2259
|
+
w.preventDefault(), n.setVolume(n.video.volume + 0.1);
|
|
2161
2260
|
break;
|
|
2162
2261
|
case "arrowdown":
|
|
2163
|
-
|
|
2262
|
+
w.preventDefault(), n.setVolume(n.video.volume - 0.1);
|
|
2164
2263
|
break;
|
|
2165
2264
|
case "f":
|
|
2166
|
-
|
|
2265
|
+
w.preventDefault(), n.toggleFullscreen();
|
|
2167
2266
|
break;
|
|
2168
2267
|
case "m":
|
|
2169
|
-
|
|
2268
|
+
w.preventDefault(), n.toggleMute();
|
|
2170
2269
|
break;
|
|
2171
2270
|
case "escape":
|
|
2172
|
-
|
|
2271
|
+
n.store.get().isWebFullscreen && (w.preventDefault(), n.toggleWebFullscreen());
|
|
2173
2272
|
break;
|
|
2174
2273
|
}
|
|
2175
2274
|
};
|
|
2176
|
-
return window.addEventListener("keydown",
|
|
2177
|
-
}, [
|
|
2178
|
-
const
|
|
2179
|
-
|
|
2180
|
-
!
|
|
2275
|
+
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
2276
|
+
}, [n, G]);
|
|
2277
|
+
const Rt = () => {
|
|
2278
|
+
n && (n.setControlsVisible(!0), de.current && clearTimeout(de.current), !(V || B || E) && (de.current = setTimeout(() => {
|
|
2279
|
+
!r.isPlaying || V || B || E || n.setControlsVisible(!1);
|
|
2181
2280
|
}, 2500)));
|
|
2182
2281
|
};
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
}, [
|
|
2186
|
-
const
|
|
2187
|
-
if (!(!
|
|
2188
|
-
if (
|
|
2189
|
-
|
|
2282
|
+
ee(() => {
|
|
2283
|
+
n && (!V && !B && !E && r.isPlaying ? Rt() : (V || B || E) && (n.setControlsVisible(!0), de.current && clearTimeout(de.current)));
|
|
2284
|
+
}, [V, B, E, r.isPlaying, n]);
|
|
2285
|
+
const Pt = Ve(() => {
|
|
2286
|
+
if (!(!q || !n || !r.isPlaying || r.isLocked)) {
|
|
2287
|
+
if (V || B || E) {
|
|
2288
|
+
z();
|
|
2190
2289
|
return;
|
|
2191
2290
|
}
|
|
2192
|
-
|
|
2193
|
-
|
|
2291
|
+
Mt.current = n.video.playbackRate, Ye.current = setTimeout(() => {
|
|
2292
|
+
n.video.playbackRate = 2, Nt(!0);
|
|
2194
2293
|
}, 500);
|
|
2195
2294
|
}
|
|
2196
|
-
}, [
|
|
2197
|
-
|
|
2198
|
-
}, [
|
|
2199
|
-
if (
|
|
2200
|
-
|
|
2295
|
+
}, [q, n, r.isPlaying, r.isLocked, V, B, E]), Ze = Ve(() => {
|
|
2296
|
+
Ye.current && clearTimeout(Ye.current), Qe && n && (n.video.playbackRate = Mt.current, Nt(!1));
|
|
2297
|
+
}, [Qe, n]), ci = (d) => {
|
|
2298
|
+
if (Pt(), V || B || E) {
|
|
2299
|
+
z();
|
|
2201
2300
|
return;
|
|
2202
2301
|
}
|
|
2203
|
-
|
|
2204
|
-
},
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2302
|
+
r.isLocked || (we.current = d.touches[0].clientX, Fe.current = d.touches[0].clientY, Tt.current = r.currentTime, zt.current = r.volume, It.current = r.brightness, ye.current = !1, te.current = null);
|
|
2303
|
+
}, di = (d) => {
|
|
2304
|
+
var ae, l;
|
|
2305
|
+
if (r.isLocked || !n || we.current === null || Fe.current === null) return;
|
|
2306
|
+
const w = d.touches[0].clientX, C = d.touches[0].clientY, N = w - we.current, P = C - Fe.current;
|
|
2307
|
+
if (!te.current && (Math.abs(N) > 10 || Math.abs(P) > 10))
|
|
2308
|
+
if (ye.current = !0, Ze(), Math.abs(N) > Math.abs(P))
|
|
2309
|
+
k && (te.current = "seek", Ie(!0));
|
|
2310
|
+
else {
|
|
2311
|
+
const R = T.current ? T.current.clientWidth / 2 : window.innerWidth / 2;
|
|
2312
|
+
we.current < R ? (te.current = "brightness", Xe(!0)) : (te.current = "volume", ve(!0));
|
|
2210
2313
|
}
|
|
2314
|
+
if (te.current === "seek" && T.current && r.duration) {
|
|
2315
|
+
const R = T.current.getBoundingClientRect(), O = N / R.width, I = Math.max(0, Math.min(r.duration, Tt.current + O * r.duration));
|
|
2316
|
+
qe(I);
|
|
2317
|
+
} else if (te.current === "volume") {
|
|
2318
|
+
const O = -(P / (((ae = T.current) == null ? void 0 : ae.clientHeight) || 300)) * 1.5;
|
|
2319
|
+
n.setVolume(Math.max(0, Math.min(1, zt.current + O)));
|
|
2320
|
+
} else if (te.current === "brightness") {
|
|
2321
|
+
const O = -(P / (((l = T.current) == null ? void 0 : l.clientHeight) || 300)) * 1.5;
|
|
2322
|
+
n.setBrightness(Math.max(0, Math.min(2, It.current + O)));
|
|
2211
2323
|
}
|
|
2212
|
-
},
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
},
|
|
2219
|
-
if (
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
if (c.stopPropagation(), a.isLocked) return;
|
|
2224
|
-
(E || F || P) && S(), we(!0), Ve(Ue(c));
|
|
2225
|
-
const v = (N) => Ve(Ue(N)), k = (N) => {
|
|
2226
|
-
s == null || s.seek(Ue(N)), we(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", k), document.removeEventListener("touchend", k);
|
|
2324
|
+
}, ui = (d) => {
|
|
2325
|
+
Ze(), te.current === "seek" ? (n == null || n.seek(Re), Ie(!1)) : te.current === "volume" ? ve(!1) : te.current === "brightness" && Xe(!1), ye.current = !1, te.current = null, we.current = null, Fe.current = null;
|
|
2326
|
+
}, et = (d) => {
|
|
2327
|
+
if (!Je.current || !r.duration) return 0;
|
|
2328
|
+
const w = Je.current.getBoundingClientRect(), C = "touches" in d ? d.touches[0].clientX : d.clientX;
|
|
2329
|
+
return Math.max(0, Math.min(1, (C - w.left) / w.width)) * r.duration;
|
|
2330
|
+
}, Lt = (d) => {
|
|
2331
|
+
if (d.stopPropagation(), r.isLocked) return;
|
|
2332
|
+
(V || B || E) && z(), Ie(!0), qe(et(d));
|
|
2333
|
+
const w = (N) => qe(et(N)), C = (N) => {
|
|
2334
|
+
n == null || n.seek(et(N)), Ie(!1), document.removeEventListener("mousemove", w), document.removeEventListener("touchmove", w), document.removeEventListener("mouseup", C), document.removeEventListener("touchend", C);
|
|
2227
2335
|
};
|
|
2228
|
-
document.addEventListener("mousemove",
|
|
2229
|
-
},
|
|
2230
|
-
if (!
|
|
2231
|
-
const
|
|
2232
|
-
return Math.max(0, Math.min(1, (
|
|
2233
|
-
},
|
|
2234
|
-
if (
|
|
2235
|
-
|
|
2236
|
-
const
|
|
2237
|
-
|
|
2336
|
+
document.addEventListener("mousemove", w), document.addEventListener("touchmove", w), document.addEventListener("mouseup", C), document.addEventListener("touchend", C);
|
|
2337
|
+
}, Ft = (d) => {
|
|
2338
|
+
if (!Ke.current) return 0;
|
|
2339
|
+
const w = Ke.current.getBoundingClientRect(), C = "touches" in d ? d.touches[0].clientX : d.clientX;
|
|
2340
|
+
return Math.max(0, Math.min(1, (C - w.left) / w.width));
|
|
2341
|
+
}, $t = (d) => {
|
|
2342
|
+
if (d.stopPropagation(), !n || r.isLocked) return;
|
|
2343
|
+
bt(!0), n.setVolume(Ft(d));
|
|
2344
|
+
const w = (N) => n.setVolume(Ft(N)), C = () => {
|
|
2345
|
+
bt(!1), document.removeEventListener("mousemove", w), document.removeEventListener("touchmove", w), document.removeEventListener("mouseup", C), document.removeEventListener("touchend", C);
|
|
2238
2346
|
};
|
|
2239
|
-
document.addEventListener("mousemove",
|
|
2240
|
-
},
|
|
2241
|
-
if (!
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
},
|
|
2245
|
-
!
|
|
2246
|
-
},
|
|
2247
|
-
if (!
|
|
2248
|
-
if (
|
|
2249
|
-
|
|
2347
|
+
document.addEventListener("mousemove", w), document.addEventListener("touchmove", w), document.addEventListener("mouseup", C), document.addEventListener("touchend", C);
|
|
2348
|
+
}, hi = (d) => {
|
|
2349
|
+
if (!r.duration || r.isLive) return;
|
|
2350
|
+
const w = d.currentTarget.getBoundingClientRect(), C = (d.clientX - w.left) / w.width, N = C * r.duration;
|
|
2351
|
+
li(C * 100), kt(N), xt.length > 0 && St(xt.find((P) => N >= P.start && N < P.end) || null);
|
|
2352
|
+
}, $e = (d) => {
|
|
2353
|
+
!n || r.isLocked || (n.skip(d === "forward" ? 10 : -10), Ct(d), setTimeout(() => Ct(null), 300));
|
|
2354
|
+
}, mi = (d) => {
|
|
2355
|
+
if (!n) return;
|
|
2356
|
+
if (ye.current) {
|
|
2357
|
+
ye.current = !1;
|
|
2250
2358
|
return;
|
|
2251
2359
|
}
|
|
2252
|
-
if (
|
|
2253
|
-
|
|
2360
|
+
if (V || B || E || oe.visible) {
|
|
2361
|
+
z();
|
|
2254
2362
|
return;
|
|
2255
2363
|
}
|
|
2256
|
-
if (
|
|
2257
|
-
!
|
|
2258
|
-
}, 2500),
|
|
2259
|
-
const
|
|
2260
|
-
|
|
2261
|
-
|
|
2364
|
+
if (Pe && ve(!1), vt && Xe(!1), n.setControlsVisible(!0), de.current && clearTimeout(de.current), de.current = setTimeout(() => {
|
|
2365
|
+
!r.isPlaying || V || B || E || n.setControlsVisible(!1);
|
|
2366
|
+
}, 2500), r.isLocked) return;
|
|
2367
|
+
const w = d.currentTarget.getBoundingClientRect(), C = d.clientX - w.left, N = w.width, P = Date.now();
|
|
2368
|
+
ke.current ? (clearTimeout(ke.current), ke.current = null, C < N * 0.35 ? ($e("rewind"), Le({ type: "rewind", id: P })) : C > N * 0.65 ? ($e("forward"), Le({ type: "forward", id: P })) : n.toggleFullscreen()) : ke.current = setTimeout(() => {
|
|
2369
|
+
n.togglePlay(), ke.current = null;
|
|
2262
2370
|
}, 250);
|
|
2263
|
-
},
|
|
2264
|
-
var
|
|
2265
|
-
if (
|
|
2266
|
-
|
|
2267
|
-
const
|
|
2268
|
-
|
|
2269
|
-
|
|
2371
|
+
}, pi = (d) => {
|
|
2372
|
+
var C;
|
|
2373
|
+
if (d.preventDefault(), d.stopPropagation(), r.isLocked) return;
|
|
2374
|
+
z();
|
|
2375
|
+
const w = (C = T.current) == null ? void 0 : C.getBoundingClientRect();
|
|
2376
|
+
w && requestAnimationFrame(() => {
|
|
2377
|
+
ht({
|
|
2270
2378
|
visible: !0,
|
|
2271
|
-
x:
|
|
2272
|
-
y:
|
|
2379
|
+
x: d.clientX - w.left,
|
|
2380
|
+
y: d.clientY - w.top
|
|
2273
2381
|
});
|
|
2274
2382
|
});
|
|
2275
|
-
},
|
|
2276
|
-
if (
|
|
2277
|
-
|
|
2383
|
+
}, fi = (d) => {
|
|
2384
|
+
if (d.stopPropagation(), z(), Pe) {
|
|
2385
|
+
ve(!1);
|
|
2278
2386
|
return;
|
|
2279
2387
|
}
|
|
2280
|
-
|
|
2281
|
-
},
|
|
2282
|
-
switch (
|
|
2388
|
+
We ? ve(!0) : n == null || n.toggleMute();
|
|
2389
|
+
}, bi = r.isMuted || r.volume === 0 ? Ut : r.volume < 0.5 ? Ei : jt, Ee = Math.max(100, re - 120), gi = () => {
|
|
2390
|
+
switch (r.iconSize) {
|
|
2283
2391
|
case "small":
|
|
2284
2392
|
return "w-4 h-4";
|
|
2285
2393
|
case "large":
|
|
@@ -2287,8 +2395,8 @@ const vn = [
|
|
|
2287
2395
|
default:
|
|
2288
2396
|
return "w-5 h-5";
|
|
2289
2397
|
}
|
|
2290
|
-
},
|
|
2291
|
-
switch (
|
|
2398
|
+
}, vi = () => {
|
|
2399
|
+
switch (r.iconSize) {
|
|
2292
2400
|
case "small":
|
|
2293
2401
|
return "p-2 min-w-[32px] min-h-[32px]";
|
|
2294
2402
|
case "large":
|
|
@@ -2296,8 +2404,8 @@ const vn = [
|
|
|
2296
2404
|
default:
|
|
2297
2405
|
return "p-2.5 min-w-[36px] min-h-[36px]";
|
|
2298
2406
|
}
|
|
2299
|
-
},
|
|
2300
|
-
switch (
|
|
2407
|
+
}, ie = gi(), se = vi(), he = (() => {
|
|
2408
|
+
switch (r.iconSize) {
|
|
2301
2409
|
case "small":
|
|
2302
2410
|
return {
|
|
2303
2411
|
playBtn: "w-14 h-14",
|
|
@@ -2320,8 +2428,8 @@ const vn = [
|
|
|
2320
2428
|
skipIcon: "w-6 h-6"
|
|
2321
2429
|
};
|
|
2322
2430
|
}
|
|
2323
|
-
})(),
|
|
2324
|
-
const
|
|
2431
|
+
})(), xi = !r.isLocked && (r.controlsVisible || !r.isPlaying || V || B || E || oe.visible), Et = ai || oi || Pe, Ae = fe ? "backdrop-blur-xl bg-black/80" : "bg-black/95", At = Ce(() => {
|
|
2432
|
+
const d = [
|
|
2325
2433
|
{ id: "play", position: "left", index: 10, isBuiltIn: !0 },
|
|
2326
2434
|
{ id: "volume", position: "left", index: 20, isBuiltIn: !0 },
|
|
2327
2435
|
{ id: "time", position: "left", index: 30, isBuiltIn: !0 },
|
|
@@ -2333,304 +2441,325 @@ const vn = [
|
|
|
2333
2441
|
{ id: "fullscreenWeb", position: "right", index: 110, isBuiltIn: !0 },
|
|
2334
2442
|
{ id: "fullscreen", position: "right", index: 120, isBuiltIn: !0 }
|
|
2335
2443
|
];
|
|
2336
|
-
|
|
2337
|
-
const
|
|
2338
|
-
|
|
2444
|
+
m.controls && m.controls.forEach((P) => {
|
|
2445
|
+
const ae = d.find((l) => l.id === P.id);
|
|
2446
|
+
ae ? Object.assign(ae, P) : d.push(P);
|
|
2339
2447
|
});
|
|
2340
|
-
const
|
|
2341
|
-
return N && (
|
|
2448
|
+
const w = r.sources[r.currentSourceIndex] || { url: t || "", type: i || "auto" }, C = w.type === "hls" || w.url.includes(".m3u8"), N = d.find((P) => P.id === "download");
|
|
2449
|
+
return N && (C ? (N.children = [
|
|
2342
2450
|
{ html: "Download Format", isLabel: !0 },
|
|
2343
2451
|
{
|
|
2344
2452
|
html: "MPEG-TS",
|
|
2345
2453
|
value: "Original Stream",
|
|
2346
|
-
icon: /* @__PURE__ */ e(
|
|
2347
|
-
onClick: () =>
|
|
2454
|
+
icon: /* @__PURE__ */ e(ii, { className: "w-3.5 h-3.5" }),
|
|
2455
|
+
onClick: () => n == null ? void 0 : n.download({ format: "ts" })
|
|
2348
2456
|
},
|
|
2349
2457
|
{
|
|
2350
2458
|
html: "MP4",
|
|
2351
2459
|
value: "Converted",
|
|
2352
|
-
icon: /* @__PURE__ */ e(
|
|
2353
|
-
onClick: () =>
|
|
2460
|
+
icon: /* @__PURE__ */ e(Zt, { className: "w-3.5 h-3.5" }),
|
|
2461
|
+
onClick: () => n == null ? void 0 : n.download({ format: "mp4" })
|
|
2354
2462
|
}
|
|
2355
|
-
], N.onClick = void 0) : (N.children = void 0, N.onClick = (
|
|
2356
|
-
}, [
|
|
2357
|
-
var
|
|
2358
|
-
if (!
|
|
2359
|
-
const l =
|
|
2360
|
-
return /* @__PURE__ */
|
|
2463
|
+
], N.onClick = void 0) : (N.children = void 0, N.onClick = (P) => P.download())), d.filter((P) => !(P.id === "screenshot" && !v || P.id === "pip" && !p || P.id === "settings" && !S || P.id === "fullscreen" && !$ || P.id === "fullscreenWeb" && !U)).sort((P, ae) => P.index - ae.index);
|
|
2464
|
+
}, [m.controls, v, p, S, $, U, r.currentSourceIndex, r.sources, t, i]), Vt = (d) => {
|
|
2465
|
+
var w, C, N, P, ae;
|
|
2466
|
+
if (!d.isBuiltIn) {
|
|
2467
|
+
const l = d.id || `ctrl-${d.index}`, R = E === l, O = R || ze.isMounted && Ge.current === l;
|
|
2468
|
+
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2361
2469
|
/* @__PURE__ */ e(
|
|
2362
2470
|
"button",
|
|
2363
2471
|
{
|
|
2364
|
-
onMouseDown: (
|
|
2365
|
-
onTouchStart: (
|
|
2366
|
-
onClick: (
|
|
2367
|
-
if (
|
|
2368
|
-
const
|
|
2369
|
-
|
|
2472
|
+
onMouseDown: (I) => I.stopPropagation(),
|
|
2473
|
+
onTouchStart: (I) => I.stopPropagation(),
|
|
2474
|
+
onClick: (I) => {
|
|
2475
|
+
if (I.stopPropagation(), d.children) {
|
|
2476
|
+
const tt = R;
|
|
2477
|
+
z(), tt || Ue(l);
|
|
2370
2478
|
} else
|
|
2371
|
-
|
|
2479
|
+
z(), d.click ? d.click(n) : d.onClick && d.onClick(n);
|
|
2372
2480
|
},
|
|
2373
|
-
className: `strata-control-btn transition-colors focus:outline-none flex items-center justify-center ${
|
|
2374
|
-
style: { borderRadius: "var(--radius)", ...
|
|
2375
|
-
title:
|
|
2376
|
-
children: /* @__PURE__ */ e(
|
|
2481
|
+
className: `strata-control-btn transition-colors focus:outline-none flex items-center justify-center ${se} ${R ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"} ${d.className || ""}`,
|
|
2482
|
+
style: { borderRadius: "var(--radius)", ...d.style },
|
|
2483
|
+
title: d.tooltip,
|
|
2484
|
+
children: /* @__PURE__ */ e(Qt, { content: d.html || "" })
|
|
2377
2485
|
}
|
|
2378
2486
|
),
|
|
2379
|
-
|
|
2380
|
-
|
|
2487
|
+
d.children && O && /* @__PURE__ */ e(
|
|
2488
|
+
Xt,
|
|
2381
2489
|
{
|
|
2382
|
-
items:
|
|
2383
|
-
onClose:
|
|
2384
|
-
maxHeight:
|
|
2385
|
-
className: `strata-backdrop ${
|
|
2490
|
+
items: d.children,
|
|
2491
|
+
onClose: z,
|
|
2492
|
+
maxHeight: Ee,
|
|
2493
|
+
className: `strata-backdrop ${Ae} ${ze.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
|
|
2386
2494
|
}
|
|
2387
2495
|
)
|
|
2388
|
-
] },
|
|
2496
|
+
] }, d.index);
|
|
2389
2497
|
}
|
|
2390
|
-
switch (
|
|
2498
|
+
switch (d.id) {
|
|
2391
2499
|
case "play":
|
|
2392
2500
|
return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2393
|
-
l.stopPropagation(),
|
|
2394
|
-
}, className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${
|
|
2501
|
+
l.stopPropagation(), z(), n == null || n.togglePlay();
|
|
2502
|
+
}, className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: r.isPlaying ? /* @__PURE__ */ e(Wt, { className: `${ie} fill-current` }) : /* @__PURE__ */ e(Ht, { className: `${ie} fill-current` }) }, "play");
|
|
2395
2503
|
case "volume":
|
|
2396
|
-
return /* @__PURE__ */
|
|
2504
|
+
return /* @__PURE__ */ c(
|
|
2397
2505
|
"div",
|
|
2398
2506
|
{
|
|
2399
2507
|
className: "flex items-center gap-2 group/vol relative",
|
|
2400
2508
|
onMouseEnter: () => {
|
|
2401
|
-
window.matchMedia("(hover: hover)").matches &&
|
|
2509
|
+
window.matchMedia("(hover: hover)").matches && gt(!0);
|
|
2402
2510
|
},
|
|
2403
2511
|
onMouseLeave: () => {
|
|
2404
|
-
window.matchMedia("(hover: hover)").matches &&
|
|
2512
|
+
window.matchMedia("(hover: hover)").matches && gt(!1);
|
|
2405
2513
|
},
|
|
2406
2514
|
children: [
|
|
2407
|
-
/* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick:
|
|
2408
|
-
/* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${
|
|
2409
|
-
/* @__PURE__ */ e("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("div", { className: "h-full bg-white", style: { width: `${(
|
|
2410
|
-
/* @__PURE__ */ e("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(
|
|
2515
|
+
/* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: fi, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(bi, { className: ie }) }),
|
|
2516
|
+
/* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${Et ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ c("div", { ref: Ke, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: $t, onTouchStart: $t, children: [
|
|
2517
|
+
/* @__PURE__ */ e("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("div", { className: "h-full bg-white", style: { width: `${(r.isMuted ? 0 : r.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
|
|
2518
|
+
/* @__PURE__ */ e("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(r.isMuted ? 0 : r.volume) * 100}% * 0.85 + 4px)`, borderRadius: "var(--radius-full)" } })
|
|
2411
2519
|
] }) }),
|
|
2412
|
-
|
|
2520
|
+
Et && /* @__PURE__ */ e("div", { className: "strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2", style: { left: `calc(52px + ${(r.isMuted ? 0 : r.volume) * 80}px)` }, children: r.isMuted ? "0%" : `${Math.round(r.volume * 100)}%` })
|
|
2413
2521
|
]
|
|
2414
2522
|
},
|
|
2415
2523
|
"volume"
|
|
2416
2524
|
);
|
|
2417
2525
|
case "time":
|
|
2418
|
-
return
|
|
2419
|
-
/* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full animate-pulse", style: { backgroundColor:
|
|
2420
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-bold tracking-wider", style: { color:
|
|
2421
|
-
] }, "live") : /* @__PURE__ */
|
|
2422
|
-
_e
|
|
2526
|
+
return m.isLive ? /* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-2 py-0.5 rounded-md border border-white/10", style: { backgroundColor: `${r.themeColor}1a`, borderColor: `${r.themeColor}33` }, children: [
|
|
2527
|
+
/* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full animate-pulse", style: { backgroundColor: r.themeColor } }),
|
|
2528
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-bold tracking-wider", style: { color: r.themeColor }, children: "LIVE" })
|
|
2529
|
+
] }, "live") : /* @__PURE__ */ c("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
|
|
2530
|
+
it(_e ? Re : r.currentTime),
|
|
2423
2531
|
" ",
|
|
2424
2532
|
/* @__PURE__ */ e("span", { className: "text-zinc-600", children: "/" }),
|
|
2425
2533
|
" ",
|
|
2426
|
-
|
|
2534
|
+
it(r.duration)
|
|
2427
2535
|
] }, "time");
|
|
2428
2536
|
case "subtitle":
|
|
2429
|
-
return /* @__PURE__ */
|
|
2537
|
+
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2430
2538
|
/* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2431
2539
|
l.stopPropagation();
|
|
2432
|
-
const
|
|
2433
|
-
|
|
2434
|
-
}, className: `strata-control-btn transition-colors focus:outline-none ${
|
|
2435
|
-
|
|
2436
|
-
|
|
2540
|
+
const R = B;
|
|
2541
|
+
z(), R || ut(!0);
|
|
2542
|
+
}, className: `strata-control-btn transition-colors focus:outline-none ${se} ${B ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Oi, { className: ie }) }),
|
|
2543
|
+
ft.isMounted && /* @__PURE__ */ e(
|
|
2544
|
+
ys,
|
|
2437
2545
|
{
|
|
2438
|
-
tracks:
|
|
2439
|
-
current:
|
|
2440
|
-
onSelect: (l) =>
|
|
2441
|
-
onUpload: (l) =>
|
|
2442
|
-
onClose:
|
|
2443
|
-
settings:
|
|
2444
|
-
onSettingsChange: (l) =>
|
|
2445
|
-
onReset: () =>
|
|
2446
|
-
offset:
|
|
2447
|
-
onOffsetChange: (l) =>
|
|
2448
|
-
maxHeight:
|
|
2449
|
-
animationClass: `strata-backdrop ${
|
|
2546
|
+
tracks: r.subtitleTracks,
|
|
2547
|
+
current: r.currentSubtitle,
|
|
2548
|
+
onSelect: (l) => n == null ? void 0 : n.setSubtitle(l),
|
|
2549
|
+
onUpload: (l) => n == null ? void 0 : n.addTextTrack(l, l.name),
|
|
2550
|
+
onClose: z,
|
|
2551
|
+
settings: r.subtitleSettings,
|
|
2552
|
+
onSettingsChange: (l) => n == null ? void 0 : n.updateSubtitleSettings(l),
|
|
2553
|
+
onReset: () => n == null ? void 0 : n.resetSubtitleSettings(),
|
|
2554
|
+
offset: r.subtitleOffset,
|
|
2555
|
+
onOffsetChange: (l) => n == null ? void 0 : n.setSubtitleOffset(l),
|
|
2556
|
+
maxHeight: Ee,
|
|
2557
|
+
animationClass: `strata-backdrop ${Ae} ${ft.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
|
|
2450
2558
|
}
|
|
2451
2559
|
)
|
|
2452
2560
|
] }, "subtitle");
|
|
2453
2561
|
case "screenshot":
|
|
2454
2562
|
return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2455
|
-
l.stopPropagation(),
|
|
2456
|
-
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${
|
|
2563
|
+
l.stopPropagation(), z(), n == null || n.screenshot();
|
|
2564
|
+
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(ts, { className: ie }) }, "ss");
|
|
2457
2565
|
case "pip":
|
|
2458
2566
|
return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2459
|
-
l.stopPropagation(),
|
|
2460
|
-
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${
|
|
2567
|
+
l.stopPropagation(), z(), n == null || n.togglePip();
|
|
2568
|
+
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Di, { className: ie }) }, "pip");
|
|
2461
2569
|
case "download":
|
|
2462
|
-
if (
|
|
2463
|
-
const l =
|
|
2464
|
-
return /* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */ e("button", { onMouseDown: (
|
|
2466
|
-
|
|
2467
|
-
const
|
|
2468
|
-
|
|
2469
|
-
}, className: `strata-control-btn transition-colors hidden sm:block focus:outline-none ${
|
|
2470
|
-
|
|
2471
|
-
|
|
2570
|
+
if (d.children) {
|
|
2571
|
+
const l = E === "download-menu", R = l || ze.isMounted && Ge.current === "download-menu";
|
|
2572
|
+
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2573
|
+
/* @__PURE__ */ e("button", { onMouseDown: (O) => O.stopPropagation(), onTouchStart: (O) => O.stopPropagation(), onClick: (O) => {
|
|
2574
|
+
O.stopPropagation();
|
|
2575
|
+
const I = l;
|
|
2576
|
+
z(), I || Ue("download-menu");
|
|
2577
|
+
}, className: `strata-control-btn transition-colors hidden sm:block focus:outline-none ${se} ${l ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ot, { className: ie }) }),
|
|
2578
|
+
R && /* @__PURE__ */ e(
|
|
2579
|
+
Xt,
|
|
2472
2580
|
{
|
|
2473
|
-
items:
|
|
2474
|
-
onClose:
|
|
2475
|
-
maxHeight:
|
|
2476
|
-
className: `strata-backdrop ${
|
|
2581
|
+
items: d.children,
|
|
2582
|
+
onClose: z,
|
|
2583
|
+
maxHeight: Ee,
|
|
2584
|
+
className: `strata-backdrop ${Ae} ${ze.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
|
|
2477
2585
|
}
|
|
2478
2586
|
)
|
|
2479
2587
|
] }, "dl");
|
|
2480
2588
|
}
|
|
2481
2589
|
return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2482
|
-
l.stopPropagation(),
|
|
2483
|
-
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${
|
|
2590
|
+
l.stopPropagation(), z(), n == null || n.download();
|
|
2591
|
+
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ot, { className: ie }) }, "dl");
|
|
2484
2592
|
case "fullscreen":
|
|
2485
2593
|
return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2486
|
-
l.stopPropagation(),
|
|
2487
|
-
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${
|
|
2594
|
+
l.stopPropagation(), z(), n == null || n.toggleFullscreen();
|
|
2595
|
+
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${se}`, style: { borderRadius: "var(--radius)" }, children: r.isFullscreen || r.isWebFullscreen ? /* @__PURE__ */ e(Vi, { className: ie }) : /* @__PURE__ */ e(Ai, { className: ie }) }, "fs");
|
|
2488
2596
|
case "fullscreenWeb":
|
|
2489
2597
|
return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2490
|
-
l.stopPropagation(),
|
|
2491
|
-
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${
|
|
2598
|
+
l.stopPropagation(), z(), n == null || n.toggleWebFullscreen();
|
|
2599
|
+
}, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${se} ${r.isWebFullscreen ? "text-[var(--accent)]" : ""}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(ns, { className: ie }) }, "fsw");
|
|
2492
2600
|
case "settings":
|
|
2493
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2494
2602
|
/* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
|
|
2495
2603
|
l.stopPropagation();
|
|
2496
|
-
const
|
|
2497
|
-
|
|
2498
|
-
}, className: `strata-control-btn transition-all duration-300 focus:outline-none ${
|
|
2499
|
-
|
|
2500
|
-
|
|
2604
|
+
const R = V;
|
|
2605
|
+
z(), R || (dt(!0), A("main"));
|
|
2606
|
+
}, className: `strata-control-btn transition-all duration-300 focus:outline-none ${se} ${V ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Bi, { className: ie }) }),
|
|
2607
|
+
pt.isMounted && /* @__PURE__ */ e(lt, { onClose: z, align: "right", maxHeight: Ee, className: `strata-backdrop ${Ae} ${pt.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`, children: /* @__PURE__ */ c("div", { className: "w-full", children: [
|
|
2608
|
+
J === "main" && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
|
|
2501
2609
|
/* @__PURE__ */ e("div", { className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("span", { children: "Settings" }) }),
|
|
2502
|
-
|
|
2503
|
-
/* @__PURE__ */ e(
|
|
2504
|
-
/* @__PURE__ */ e(
|
|
2610
|
+
r.sources.length > 1 && /* @__PURE__ */ c(Q, { children: [
|
|
2611
|
+
/* @__PURE__ */ e(L, { label: "Source", icon: /* @__PURE__ */ e(rs, { className: "w-4 h-4" }), value: ((w = r.sources[r.currentSourceIndex]) == null ? void 0 : w.name) || `Source ${r.currentSourceIndex + 1}`, onClick: () => A("sources"), hasSubmenu: !0 }),
|
|
2612
|
+
/* @__PURE__ */ e(me, {})
|
|
2505
2613
|
] }),
|
|
2506
|
-
/* @__PURE__ */ e(
|
|
2507
|
-
/* @__PURE__ */ e(
|
|
2508
|
-
/* @__PURE__ */ e(
|
|
2509
|
-
/* @__PURE__ */ e(
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
/* @__PURE__ */ e(
|
|
2513
|
-
/* @__PURE__ */ e(
|
|
2514
|
-
/* @__PURE__ */ e(
|
|
2515
|
-
/* @__PURE__ */ e(
|
|
2516
|
-
|
|
2614
|
+
/* @__PURE__ */ e(L, { label: "Quality", icon: /* @__PURE__ */ e(ms, { className: "w-4 h-4" }), value: r.currentQuality === -1 ? "Auto" : `${(C = r.qualityLevels[r.currentQuality]) == null ? void 0 : C.height}p`, onClick: () => A("quality"), hasSubmenu: !0 }),
|
|
2615
|
+
/* @__PURE__ */ e(L, { label: "Speed", icon: /* @__PURE__ */ e(ds, { className: "w-4 h-4" }), value: `${r.playbackRate}x`, onClick: () => A("speed"), hasSubmenu: !0 }),
|
|
2616
|
+
/* @__PURE__ */ e(L, { label: "Audio", icon: /* @__PURE__ */ e(us, { className: "w-4 h-4" }), value: ((N = r.audioTracks[r.currentAudioTrack]) == null ? void 0 : N.label) || "Default", onClick: () => A("audio"), hasSubmenu: !0 }),
|
|
2617
|
+
/* @__PURE__ */ e(me, {}),
|
|
2618
|
+
/* @__PURE__ */ e(L, { label: "Video Fit", icon: /* @__PURE__ */ e(gs, { className: "w-4 h-4" }), value: r.videoFit === "none" ? "Default" : r.videoFit.charAt(0).toUpperCase() + r.videoFit.slice(1), onClick: () => A("videofit"), hasSubmenu: !0 }),
|
|
2619
|
+
Y && /* @__PURE__ */ e(L, { label: "Aspect Ratio", icon: /* @__PURE__ */ e(ls, { className: "w-4 h-4" }), value: r.aspectRatio, onClick: () => A("ratio"), hasSubmenu: !0 }),
|
|
2620
|
+
g && /* @__PURE__ */ e(L, { label: "Flip", icon: /* @__PURE__ */ e(ps, { className: "w-4 h-4" }), value: r.flipState.horizontal ? "H" : r.flipState.vertical ? "V" : "Normal", onClick: () => A("flip"), hasSubmenu: !0 }),
|
|
2621
|
+
/* @__PURE__ */ e(L, { label: "Audio Boost", icon: /* @__PURE__ */ e(cs, { className: "w-4 h-4" }), value: r.audioGain > 1 ? `${r.audioGain}x` : "Off", onClick: () => A("boost"), hasSubmenu: !0 }),
|
|
2622
|
+
/* @__PURE__ */ e(me, {}),
|
|
2623
|
+
/* @__PURE__ */ e(L, { label: "Watch Party", icon: /* @__PURE__ */ e(Ui, { className: "w-4 h-4" }), onClick: () => A("party"), hasSubmenu: !0 }),
|
|
2624
|
+
/* @__PURE__ */ e(L, { label: "Cast to Device", icon: /* @__PURE__ */ e(ji, { className: "w-4 h-4" }), onClick: () => {
|
|
2625
|
+
n == null || n.requestCast(), z();
|
|
2517
2626
|
} }),
|
|
2518
|
-
|
|
2519
|
-
(
|
|
2520
|
-
|
|
2627
|
+
m.settings && m.settings.length > 0 && /* @__PURE__ */ e(me, {}),
|
|
2628
|
+
(P = m.settings) == null ? void 0 : P.map((l, R) => l.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
|
|
2629
|
+
le,
|
|
2521
2630
|
{
|
|
2522
2631
|
label: l.html,
|
|
2523
2632
|
icon: l.icon,
|
|
2524
2633
|
checked: l.switch,
|
|
2525
2634
|
tooltip: l.tooltip,
|
|
2526
|
-
onChange: (
|
|
2527
|
-
l.onSwitch && l.onSwitch(l,
|
|
2635
|
+
onChange: (O) => {
|
|
2636
|
+
l.onSwitch && l.onSwitch(l, O);
|
|
2528
2637
|
}
|
|
2529
2638
|
}
|
|
2530
|
-
) }, `cust-${
|
|
2531
|
-
|
|
2639
|
+
) }, `cust-${R}`) : /* @__PURE__ */ e(
|
|
2640
|
+
L,
|
|
2532
2641
|
{
|
|
2533
2642
|
label: l.html,
|
|
2534
2643
|
icon: l.icon,
|
|
2535
2644
|
value: l.currentLabel || l.value,
|
|
2536
2645
|
hasSubmenu: !!l.children,
|
|
2537
2646
|
onClick: () => {
|
|
2538
|
-
l.children ? A(`custom-${
|
|
2647
|
+
l.children ? A(`custom-${R}`) : (l.click ? l.click(l) : l.onClick && l.onClick(l), z());
|
|
2539
2648
|
}
|
|
2540
2649
|
},
|
|
2541
|
-
`cust-${
|
|
2650
|
+
`cust-${R}`
|
|
2542
2651
|
)),
|
|
2543
|
-
/* @__PURE__ */ e(
|
|
2544
|
-
/* @__PURE__ */ e(
|
|
2652
|
+
/* @__PURE__ */ e(me, {}),
|
|
2653
|
+
/* @__PURE__ */ e(L, { label: "Appearance", icon: /* @__PURE__ */ e(ei, { className: "w-4 h-4" }), onClick: () => A("appearance"), hasSubmenu: !0 })
|
|
2545
2654
|
] }),
|
|
2546
|
-
|
|
2547
|
-
var
|
|
2548
|
-
const l = parseInt(
|
|
2549
|
-
return !
|
|
2550
|
-
/* @__PURE__ */ e(
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
!
|
|
2555
|
-
|
|
2655
|
+
J.startsWith("custom-") && (() => {
|
|
2656
|
+
var O;
|
|
2657
|
+
const l = parseInt(J.split("-")[1]), R = (O = m.settings) == null ? void 0 : O[l];
|
|
2658
|
+
return !R || !R.children ? null : /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
2659
|
+
/* @__PURE__ */ e(Z, { label: R.html || "Menu", onBack: () => A("main") }),
|
|
2660
|
+
R.children.map((I, tt) => /* @__PURE__ */ c(Me.Fragment, { children: [
|
|
2661
|
+
I.separator && /* @__PURE__ */ e(me, {}),
|
|
2662
|
+
I.switch !== void 0 && /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(le, { label: I.html, checked: I.switch, onChange: (ki) => I.onSwitch && I.onSwitch(I, ki) }) }),
|
|
2663
|
+
!I.separator && I.switch === void 0 && /* @__PURE__ */ e(
|
|
2664
|
+
L,
|
|
2556
2665
|
{
|
|
2557
|
-
label:
|
|
2558
|
-
icon:
|
|
2559
|
-
value:
|
|
2560
|
-
active:
|
|
2666
|
+
label: I.html,
|
|
2667
|
+
icon: I.icon,
|
|
2668
|
+
value: I.value,
|
|
2669
|
+
active: I.active,
|
|
2561
2670
|
onClick: () => {
|
|
2562
|
-
|
|
2671
|
+
I.onClick ? I.onClick(I) : I.click && I.click(I), z();
|
|
2563
2672
|
}
|
|
2564
2673
|
}
|
|
2565
2674
|
)
|
|
2566
|
-
] },
|
|
2675
|
+
] }, tt))
|
|
2567
2676
|
] });
|
|
2568
2677
|
})(),
|
|
2569
|
-
["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(
|
|
2570
|
-
|
|
2571
|
-
/* @__PURE__ */ e(
|
|
2572
|
-
|
|
2573
|
-
const
|
|
2678
|
+
["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio", "videofit"].includes(J) && /* @__PURE__ */ c("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
2679
|
+
J === "sources" && /* @__PURE__ */ c(Q, { children: [
|
|
2680
|
+
/* @__PURE__ */ e(Z, { label: "Select Source", onBack: () => A("main") }),
|
|
2681
|
+
r.sources.map((l, R) => {
|
|
2682
|
+
const O = r.sourceStatuses[R], I = O === "success" ? /* @__PURE__ */ e(hs, { className: "w-3.5 h-3.5 text-emerald-500" }) : O === "error" ? /* @__PURE__ */ e(at, { className: "w-3.5 h-3.5 text-red-500" }) : null;
|
|
2574
2683
|
return /* @__PURE__ */ e(
|
|
2575
|
-
|
|
2684
|
+
L,
|
|
2576
2685
|
{
|
|
2577
|
-
label: l.name || `Source ${
|
|
2686
|
+
label: l.name || `Source ${R + 1}`,
|
|
2578
2687
|
value: l.type,
|
|
2579
|
-
active:
|
|
2580
|
-
rightIcon:
|
|
2581
|
-
onClick: () =>
|
|
2688
|
+
active: r.currentSourceIndex === R,
|
|
2689
|
+
rightIcon: I,
|
|
2690
|
+
onClick: () => n == null ? void 0 : n.switchSource(R)
|
|
2582
2691
|
},
|
|
2583
|
-
|
|
2692
|
+
R
|
|
2584
2693
|
);
|
|
2585
2694
|
})
|
|
2586
2695
|
] }),
|
|
2587
|
-
|
|
2588
|
-
/* @__PURE__ */ e(
|
|
2589
|
-
[0.5, 1, 1.5, 2].map((l) => /* @__PURE__ */ e(
|
|
2696
|
+
J === "speed" && /* @__PURE__ */ c(Q, { children: [
|
|
2697
|
+
/* @__PURE__ */ e(Z, { label: "Speed", onBack: () => A("main") }),
|
|
2698
|
+
[0.5, 1, 1.5, 2].map((l) => /* @__PURE__ */ e(L, { label: `${l}x`, active: r.playbackRate === l, onClick: () => n.video.playbackRate = l }, l))
|
|
2590
2699
|
] }),
|
|
2591
|
-
|
|
2592
|
-
/* @__PURE__ */ e(
|
|
2593
|
-
/* @__PURE__ */ e(
|
|
2594
|
-
|
|
2700
|
+
J === "quality" && /* @__PURE__ */ c(Q, { children: [
|
|
2701
|
+
/* @__PURE__ */ e(Z, { label: "Quality", onBack: () => A("main") }),
|
|
2702
|
+
/* @__PURE__ */ e(L, { label: "Auto", active: r.currentQuality === -1, onClick: () => n == null ? void 0 : n.setQuality(-1) }),
|
|
2703
|
+
r.qualityLevels.map((l) => /* @__PURE__ */ e(L, { label: `${l.height}p`, value: `${Math.round(l.bitrate / 1e3)}k`, active: r.currentQuality === l.index, onClick: () => n == null ? void 0 : n.setQuality(l.index) }, l.index))
|
|
2595
2704
|
] }),
|
|
2596
|
-
|
|
2597
|
-
/* @__PURE__ */ e(
|
|
2598
|
-
|
|
2599
|
-
|
|
2705
|
+
J === "audio" && /* @__PURE__ */ c(Q, { children: [
|
|
2706
|
+
/* @__PURE__ */ e(Z, { label: "Audio Track", onBack: () => A("main") }),
|
|
2707
|
+
r.audioTracks.length === 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
|
|
2708
|
+
r.audioTracks.map((l) => /* @__PURE__ */ e(L, { label: l.label, value: l.language, active: r.currentAudioTrack === l.index, onClick: () => n == null ? void 0 : n.setAudioTrack(l.index) }, l.index))
|
|
2600
2709
|
] }),
|
|
2601
|
-
|
|
2602
|
-
/* @__PURE__ */ e(
|
|
2603
|
-
[1, 1.5, 2, 3].map((l) => /* @__PURE__ */ e(
|
|
2710
|
+
J === "boost" && /* @__PURE__ */ c(Q, { children: [
|
|
2711
|
+
/* @__PURE__ */ e(Z, { label: "Audio Boost", onBack: () => A("main") }),
|
|
2712
|
+
[1, 1.5, 2, 3].map((l) => /* @__PURE__ */ e(L, { label: l === 1 ? "Off" : `${l}x`, active: r.audioGain === l, onClick: () => n == null ? void 0 : n.setAudioGain(l) }, l))
|
|
2604
2713
|
] }),
|
|
2605
|
-
|
|
2606
|
-
/* @__PURE__ */ e(
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */ e(
|
|
2609
|
-
/* @__PURE__ */ e(
|
|
2714
|
+
J === "flip" && /* @__PURE__ */ c(Q, { children: [
|
|
2715
|
+
/* @__PURE__ */ e(Z, { label: "Video Flip", onBack: () => A("main") }),
|
|
2716
|
+
/* @__PURE__ */ c("div", { className: "p-2 space-y-1", children: [
|
|
2717
|
+
/* @__PURE__ */ e(le, { label: "Horizontal Flip", checked: r.flipState.horizontal, onChange: () => n == null ? void 0 : n.setFlip("horizontal") }),
|
|
2718
|
+
/* @__PURE__ */ e(le, { label: "Vertical Flip", checked: r.flipState.vertical, onChange: () => n == null ? void 0 : n.setFlip("vertical") })
|
|
2610
2719
|
] })
|
|
2611
2720
|
] }),
|
|
2612
|
-
|
|
2613
|
-
/* @__PURE__ */ e(
|
|
2614
|
-
["default", "16:9", "4:3"].map((l) => /* @__PURE__ */ e(
|
|
2721
|
+
J === "ratio" && /* @__PURE__ */ c(Q, { children: [
|
|
2722
|
+
/* @__PURE__ */ e(Z, { label: "Aspect Ratio", onBack: () => A("main") }),
|
|
2723
|
+
/* @__PURE__ */ e("div", { className: "max-h-[250px] overflow-y-auto hide-scrollbar", children: ["default", "16:9", "4:3", "21:9", "18:9", "1:1", "9:16"].map((l) => /* @__PURE__ */ e(L, { label: l === "default" ? "Default" : l.replace(":", " : "), active: r.aspectRatio === l, onClick: () => n == null ? void 0 : n.setAspectRatio(l) }, l)) })
|
|
2615
2724
|
] }),
|
|
2616
|
-
|
|
2617
|
-
/* @__PURE__ */ e(
|
|
2618
|
-
/* @__PURE__ */
|
|
2725
|
+
J === "videofit" && /* @__PURE__ */ c(Q, { children: [
|
|
2726
|
+
/* @__PURE__ */ e(Z, { label: "Video Fit", onBack: () => A("main") }),
|
|
2727
|
+
/* @__PURE__ */ e(L, { label: "Contain (Default)", value: "Fit", active: r.videoFit === "contain", onClick: () => n == null ? void 0 : n.setVideoFit("contain") }),
|
|
2728
|
+
/* @__PURE__ */ e(L, { label: "Cover", value: "Zoom", active: r.videoFit === "cover", onClick: () => n == null ? void 0 : n.setVideoFit("cover") }),
|
|
2729
|
+
/* @__PURE__ */ e(L, { label: "Fill", value: "Stretch", active: r.videoFit === "fill", onClick: () => n == null ? void 0 : n.setVideoFit("fill") }),
|
|
2730
|
+
/* @__PURE__ */ e(L, { label: "None", value: "Original", active: r.videoFit === "none", onClick: () => n == null ? void 0 : n.setVideoFit("none") })
|
|
2731
|
+
] }),
|
|
2732
|
+
J === "party" && /* @__PURE__ */ c(Q, { children: [
|
|
2733
|
+
/* @__PURE__ */ e(Z, { label: "Watch Party", onBack: () => A("main") }),
|
|
2734
|
+
/* @__PURE__ */ c("div", { className: "p-4 space-y-3", children: [
|
|
2619
2735
|
/* @__PURE__ */ e("p", { className: "text-xs text-zinc-400 leading-relaxed", children: "Create a synchronized room on WatchParty.me to watch together." }),
|
|
2620
|
-
/* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((
|
|
2736
|
+
/* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((ae = r.sources[r.currentSourceIndex]) == null ? void 0 : ae.url) || t || "")}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs", style: { borderRadius: "var(--radius)" }, children: "Create Room" })
|
|
2621
2737
|
] })
|
|
2622
2738
|
] }),
|
|
2623
|
-
|
|
2624
|
-
/* @__PURE__ */ e(
|
|
2625
|
-
/* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */ e(
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2739
|
+
J === "appearance" && /* @__PURE__ */ c(Q, { children: [
|
|
2740
|
+
/* @__PURE__ */ e(Z, { label: "Appearance", onBack: () => A("main") }),
|
|
2741
|
+
/* @__PURE__ */ c("div", { className: "pb-1", children: [
|
|
2742
|
+
/* @__PURE__ */ e("div", { className: "px-1 pt-1", children: /* @__PURE__ */ e(
|
|
2743
|
+
xe,
|
|
2744
|
+
{
|
|
2745
|
+
label: "Brightness",
|
|
2746
|
+
icon: /* @__PURE__ */ e(Gt, { className: "w-4 h-4" }),
|
|
2747
|
+
value: r.brightness,
|
|
2748
|
+
min: 0,
|
|
2749
|
+
max: 2,
|
|
2750
|
+
step: 0.1,
|
|
2751
|
+
onChange: (l) => n == null ? void 0 : n.setBrightness(l),
|
|
2752
|
+
formatValue: (l) => `${Math.round(l * 100)}%`
|
|
2753
|
+
}
|
|
2754
|
+
) }),
|
|
2755
|
+
/* @__PURE__ */ e(pe, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children: Ms.map((l) => /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.setAppearance({ theme: l.value, themeColor: l.color }), className: `py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${r.theme === l.value ? "bg-[var(--accent)] text-white" : "bg-white/5 text-zinc-400 hover:text-white"}`, style: { borderRadius: "var(--radius)" }, children: l.label }, l.value)) }) }),
|
|
2756
|
+
/* @__PURE__ */ e(pe, { title: "Icon Size", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((l) => /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.setAppearance({ iconSize: l }), className: `py-1.5 text-xs font-medium transition-colors ${r.iconSize === l ? "bg-white text-black" : "bg-white/5 text-zinc-400 hover:text-zinc-200"}`, style: { borderRadius: "var(--radius)" }, children: l.charAt(0).toUpperCase() + l.slice(1) }, l)) }) }),
|
|
2757
|
+
/* @__PURE__ */ c(pe, { title: "Theme Color", children: [
|
|
2758
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children: Ns.map((l) => /* @__PURE__ */ e("button", { title: l.label, onClick: () => n == null ? void 0 : n.setAppearance({ themeColor: l.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${r.themeColor === l.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: l.value, borderRadius: "var(--radius-full)" }, children: r.themeColor === l.value && /* @__PURE__ */ e(He, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, l.value)) }),
|
|
2759
|
+
/* @__PURE__ */ e("div", { className: "px-3 pt-4", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group", style: { borderRadius: "var(--radius)" }, children: [
|
|
2760
|
+
/* @__PURE__ */ e("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("input", { type: "color", value: r.themeColor, onChange: (l) => n == null ? void 0 : n.setAppearance({ themeColor: l.target.value }), className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0" }) }),
|
|
2632
2761
|
/* @__PURE__ */ e("span", { className: "text-xs text-zinc-400 font-medium group-hover:text-zinc-200", children: "Custom Color" }),
|
|
2633
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-mono text-zinc-500 ml-auto uppercase", children:
|
|
2762
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-mono text-zinc-500 ml-auto uppercase", children: r.themeColor })
|
|
2634
2763
|
] }) })
|
|
2635
2764
|
] })
|
|
2636
2765
|
] })
|
|
@@ -2641,68 +2770,73 @@ const vn = [
|
|
|
2641
2770
|
default:
|
|
2642
2771
|
return null;
|
|
2643
2772
|
}
|
|
2644
|
-
},
|
|
2645
|
-
const
|
|
2773
|
+
}, wi = Ce(() => {
|
|
2774
|
+
const d = [
|
|
2646
2775
|
// Loop (Playback Group)
|
|
2647
2776
|
{ html: "Playback", isLabel: !0 },
|
|
2648
2777
|
{
|
|
2649
2778
|
html: "Loop",
|
|
2650
|
-
checked:
|
|
2651
|
-
onClick: () =>
|
|
2779
|
+
checked: r.isLooping,
|
|
2780
|
+
onClick: () => n == null ? void 0 : n.toggleLoop()
|
|
2652
2781
|
},
|
|
2653
2782
|
{ separator: !0 },
|
|
2654
2783
|
// Flip (Transform Group)
|
|
2655
2784
|
{ html: "Transform", isLabel: !0 },
|
|
2656
|
-
{ html: "Flip Horizontal", onClick: () =>
|
|
2657
|
-
{ html: "Flip Vertical", onClick: () =>
|
|
2785
|
+
{ html: "Flip Horizontal", onClick: () => n == null ? void 0 : n.setFlip("horizontal") },
|
|
2786
|
+
{ html: "Flip Vertical", onClick: () => n == null ? void 0 : n.setFlip("vertical") },
|
|
2658
2787
|
{ separator: !0 },
|
|
2659
2788
|
// Aspect Ratio Group
|
|
2660
2789
|
{ html: "Aspect Ratio", isLabel: !0 },
|
|
2661
|
-
{ html: "Default", checked:
|
|
2662
|
-
{ html: "16:9", checked:
|
|
2663
|
-
{ html: "
|
|
2790
|
+
{ html: "Default", checked: r.aspectRatio === "default", onClick: () => n == null ? void 0 : n.setAspectRatio("default") },
|
|
2791
|
+
{ html: "16:9", checked: r.aspectRatio === "16:9", onClick: () => n == null ? void 0 : n.setAspectRatio("16:9") },
|
|
2792
|
+
{ html: "21:9", checked: r.aspectRatio === "21:9", onClick: () => n == null ? void 0 : n.setAspectRatio("21:9") },
|
|
2793
|
+
{ separator: !0 },
|
|
2794
|
+
// Video Fit Group
|
|
2795
|
+
{ html: "Video Fit", isLabel: !0 },
|
|
2796
|
+
{ html: "Contain", checked: r.videoFit === "contain", onClick: () => n == null ? void 0 : n.setVideoFit("contain") },
|
|
2797
|
+
{ html: "Cover", checked: r.videoFit === "cover", onClick: () => n == null ? void 0 : n.setVideoFit("cover") },
|
|
2664
2798
|
{ separator: !0 },
|
|
2665
2799
|
// Stats
|
|
2666
2800
|
{
|
|
2667
2801
|
html: "Video Info",
|
|
2668
|
-
icon: /* @__PURE__ */ e(
|
|
2669
|
-
onClick: () =>
|
|
2802
|
+
icon: /* @__PURE__ */ e(as, { className: "w-3.5 h-3.5" }),
|
|
2803
|
+
onClick: () => mt(!0)
|
|
2670
2804
|
},
|
|
2671
2805
|
{ separator: !0 }
|
|
2672
2806
|
];
|
|
2673
|
-
return
|
|
2807
|
+
return m.contextmenu && d.push(...m.contextmenu), d.push({
|
|
2674
2808
|
html: /* @__PURE__ */ e("span", { className: "text-zinc-500 text-xs font-semibold tracking-wide", children: "StrataPlayer" }),
|
|
2675
2809
|
disabled: !0
|
|
2676
|
-
}),
|
|
2810
|
+
}), d.push({
|
|
2677
2811
|
html: "Close",
|
|
2678
|
-
onClick: (
|
|
2812
|
+
onClick: (w) => w(),
|
|
2679
2813
|
// Wrapper handles close
|
|
2680
|
-
icon: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */
|
|
2814
|
+
icon: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ c("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2681
2815
|
/* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
|
|
2682
2816
|
/* @__PURE__ */ e("path", { d: "m6 6 12 12" })
|
|
2683
2817
|
] }) })
|
|
2684
|
-
}),
|
|
2685
|
-
}, [
|
|
2818
|
+
}), d;
|
|
2819
|
+
}, [m.contextmenu, r.aspectRatio, r.isLooping, r.videoFit, n]), yi = r.isWebFullscreen, Bt = /* @__PURE__ */ c(
|
|
2686
2820
|
"div",
|
|
2687
2821
|
{
|
|
2688
|
-
id:
|
|
2689
|
-
ref:
|
|
2690
|
-
className: `group bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none text-zinc-100 strata-player-reset flex items-center justify-center ${
|
|
2691
|
-
style: { touchAction: "manipulation", "--accent":
|
|
2692
|
-
onMouseMove:
|
|
2822
|
+
id: m.id,
|
|
2823
|
+
ref: T,
|
|
2824
|
+
className: `group bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none text-zinc-100 strata-player-reset flex items-center justify-center ${yi ? "fixed inset-0 z-[2147483647] w-screen h-screen rounded-none" : "relative w-full h-full rounded-[var(--radius-player)]"} ${m.container || ""}`,
|
|
2825
|
+
style: { touchAction: "manipulation", "--accent": r.themeColor, "--accent-contrast": si },
|
|
2826
|
+
onMouseMove: Rt,
|
|
2693
2827
|
onMouseLeave: () => {
|
|
2694
|
-
|
|
2828
|
+
r.isPlaying && !V && !B && !E && n && n.setControlsVisible(!1);
|
|
2695
2829
|
},
|
|
2696
|
-
onMouseDown:
|
|
2697
|
-
onMouseUp:
|
|
2698
|
-
onTouchStart:
|
|
2699
|
-
onTouchMove:
|
|
2700
|
-
onTouchEnd:
|
|
2701
|
-
onContextMenu:
|
|
2830
|
+
onMouseDown: Pt,
|
|
2831
|
+
onMouseUp: Ze,
|
|
2832
|
+
onTouchStart: ci,
|
|
2833
|
+
onTouchMove: di,
|
|
2834
|
+
onTouchEnd: ui,
|
|
2835
|
+
onContextMenu: pi,
|
|
2702
2836
|
tabIndex: 0,
|
|
2703
2837
|
role: "region",
|
|
2704
2838
|
"aria-label": "Video Player",
|
|
2705
|
-
"data-theme":
|
|
2839
|
+
"data-theme": r.theme,
|
|
2706
2840
|
children: [
|
|
2707
2841
|
/* @__PURE__ */ e("style", { children: `
|
|
2708
2842
|
[data-theme="default"] {
|
|
@@ -2710,6 +2844,7 @@ const vn = [
|
|
|
2710
2844
|
--radius-lg: 0.75rem;
|
|
2711
2845
|
--radius-sm: 0.375rem;
|
|
2712
2846
|
--radius-full: 9999px;
|
|
2847
|
+
--radius-player: 0.25rem;
|
|
2713
2848
|
--font-main: "Inter", sans-serif;
|
|
2714
2849
|
--border-width: 0px;
|
|
2715
2850
|
--bg-panel: rgba(9, 9, 11, 0.95);
|
|
@@ -2722,6 +2857,7 @@ const vn = [
|
|
|
2722
2857
|
--radius-lg: 0px;
|
|
2723
2858
|
--radius-sm: 0px;
|
|
2724
2859
|
--radius-full: 0px;
|
|
2860
|
+
--radius-player: 0px;
|
|
2725
2861
|
--font-main: "Press Start 2P", cursive;
|
|
2726
2862
|
--border-width: 2px;
|
|
2727
2863
|
--bg-panel: #000000;
|
|
@@ -2735,6 +2871,7 @@ const vn = [
|
|
|
2735
2871
|
--radius-lg: 6px;
|
|
2736
2872
|
--radius-sm: 2px;
|
|
2737
2873
|
--radius-full: 4px;
|
|
2874
|
+
--radius-player: 4px;
|
|
2738
2875
|
--font-main: "Cinzel", serif;
|
|
2739
2876
|
--border-width: 1px;
|
|
2740
2877
|
--bg-panel: #0a0a0a;
|
|
@@ -2747,6 +2884,7 @@ const vn = [
|
|
|
2747
2884
|
--radius-lg: 0px;
|
|
2748
2885
|
--radius-sm: 0px;
|
|
2749
2886
|
--radius-full: 0px;
|
|
2887
|
+
--radius-player: 0px;
|
|
2750
2888
|
--font-main: "JetBrains Mono", monospace;
|
|
2751
2889
|
--border-width: 1px;
|
|
2752
2890
|
--bg-panel: #000000;
|
|
@@ -2798,136 +2936,152 @@ const vn = [
|
|
|
2798
2936
|
[data-theme="pixel"] .strata-backdrop { backdrop-filter: none; background: #000; }
|
|
2799
2937
|
[data-theme="hacker"] .strata-backdrop { backdrop-filter: none; background: #000; }
|
|
2800
2938
|
` }),
|
|
2801
|
-
|
|
2802
|
-
!
|
|
2803
|
-
|
|
2804
|
-
(
|
|
2939
|
+
r.theme === "hacker" && /* @__PURE__ */ e("div", { className: "strata-scanlines" }),
|
|
2940
|
+
!n && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ e(De, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
|
|
2941
|
+
n && /* @__PURE__ */ c(Q, { children: [
|
|
2942
|
+
(Dt = m.layers) == null ? void 0 : Dt.map((d, w) => /* @__PURE__ */ e(
|
|
2805
2943
|
"div",
|
|
2806
2944
|
{
|
|
2807
|
-
className: `absolute inset-0 pointer-events-none z-10 ${
|
|
2808
|
-
style:
|
|
2809
|
-
children: /* @__PURE__ */ e(
|
|
2945
|
+
className: `absolute inset-0 pointer-events-none z-10 ${d.className || ""}`,
|
|
2946
|
+
style: d.style,
|
|
2947
|
+
children: /* @__PURE__ */ e(Qt, { content: d.html || "", className: "w-full h-full" })
|
|
2810
2948
|
},
|
|
2811
|
-
|
|
2949
|
+
w
|
|
2812
2950
|
)),
|
|
2813
|
-
/* @__PURE__ */ e(
|
|
2814
|
-
/* @__PURE__ */ e(
|
|
2951
|
+
/* @__PURE__ */ e(vs, { notifications: r.notifications }),
|
|
2952
|
+
/* @__PURE__ */ e(xs, { cues: r.activeCues, settings: r.subtitleSettings }),
|
|
2815
2953
|
/* @__PURE__ */ e(
|
|
2816
2954
|
"div",
|
|
2817
2955
|
{
|
|
2818
2956
|
className: "absolute inset-0 z-[1] cursor-pointer",
|
|
2819
|
-
onClick:
|
|
2957
|
+
onClick: mi,
|
|
2820
2958
|
"aria-hidden": "true",
|
|
2821
2959
|
role: "button",
|
|
2822
2960
|
tabIndex: -1
|
|
2823
2961
|
}
|
|
2824
2962
|
),
|
|
2825
|
-
|
|
2963
|
+
a && !_ && /* @__PURE__ */ e(
|
|
2826
2964
|
"div",
|
|
2827
2965
|
{
|
|
2828
2966
|
className: "absolute inset-0 bg-cover bg-center z-[5] pointer-events-none strata-poster",
|
|
2829
|
-
style: { backgroundImage: `url(${
|
|
2967
|
+
style: { backgroundImage: `url(${a})` }
|
|
2830
2968
|
}
|
|
2831
2969
|
),
|
|
2832
|
-
|
|
2833
|
-
|
|
2970
|
+
oe.visible && /* @__PURE__ */ e(
|
|
2971
|
+
ks,
|
|
2834
2972
|
{
|
|
2835
|
-
x:
|
|
2836
|
-
y:
|
|
2837
|
-
items:
|
|
2838
|
-
onClose:
|
|
2839
|
-
containerWidth:
|
|
2840
|
-
containerHeight:
|
|
2973
|
+
x: oe.x,
|
|
2974
|
+
y: oe.y,
|
|
2975
|
+
items: wi,
|
|
2976
|
+
onClose: z,
|
|
2977
|
+
containerWidth: ge,
|
|
2978
|
+
containerHeight: re
|
|
2841
2979
|
}
|
|
2842
2980
|
),
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
/* @__PURE__ */ e(
|
|
2981
|
+
ni && n && /* @__PURE__ */ e(Ss, { player: n, onClose: () => mt(!1) }),
|
|
2982
|
+
Qe && /* @__PURE__ */ c("div", { className: "absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
|
|
2983
|
+
/* @__PURE__ */ e(os, { className: "w-4 h-4 text-[var(--accent)] fill-current" }),
|
|
2846
2984
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold tracking-wider", children: "2x Speed" })
|
|
2847
2985
|
] }),
|
|
2848
|
-
|
|
2986
|
+
Pe && /* @__PURE__ */ c("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black/60 backdrop-blur-md p-6 rounded-2xl flex flex-col items-center gap-4 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
|
|
2987
|
+
r.isMuted || r.volume === 0 ? /* @__PURE__ */ e(Ut, { className: "w-10 h-10 text-white/80" }) : /* @__PURE__ */ e(jt, { className: "w-10 h-10 text-white/80" }),
|
|
2988
|
+
/* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-white/20 rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full bg-[var(--accent)]", style: { width: `${r.isMuted ? 0 : r.volume * 100}%` } }) }),
|
|
2989
|
+
/* @__PURE__ */ c("span", { className: "text-xl font-bold font-mono", children: [
|
|
2990
|
+
Math.round(r.volume * 100),
|
|
2991
|
+
"%"
|
|
2992
|
+
] })
|
|
2993
|
+
] }),
|
|
2994
|
+
vt && /* @__PURE__ */ c("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black/60 backdrop-blur-md p-6 rounded-2xl flex flex-col items-center gap-4 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
|
|
2995
|
+
/* @__PURE__ */ e(Gt, { className: "w-10 h-10 text-white/80" }),
|
|
2996
|
+
/* @__PURE__ */ e("div", { className: "w-32 h-1.5 bg-white/20 rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full bg-[var(--accent)]", style: { width: `${Math.min(100, r.brightness * 100)}%` } }) }),
|
|
2997
|
+
/* @__PURE__ */ c("span", { className: "text-xl font-bold font-mono", children: [
|
|
2998
|
+
Math.round(r.brightness * 100),
|
|
2999
|
+
"%"
|
|
3000
|
+
] })
|
|
3001
|
+
] }),
|
|
3002
|
+
H && We && r.controlsVisible && /* @__PURE__ */ e(
|
|
2849
3003
|
"button",
|
|
2850
3004
|
{
|
|
2851
|
-
onMouseDown: (
|
|
2852
|
-
onTouchStart: (
|
|
2853
|
-
onClick: (
|
|
2854
|
-
|
|
3005
|
+
onMouseDown: (d) => d.stopPropagation(),
|
|
3006
|
+
onTouchStart: (d) => d.stopPropagation(),
|
|
3007
|
+
onClick: (d) => {
|
|
3008
|
+
d.stopPropagation(), n.toggleLock();
|
|
2855
3009
|
},
|
|
2856
|
-
className: `absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${
|
|
2857
|
-
children:
|
|
3010
|
+
className: `absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${r.isLocked ? "text-[var(--accent)] bg-white/10" : "hover:bg-white/10"}`,
|
|
3011
|
+
children: r.isLocked ? /* @__PURE__ */ e(is, { className: "w-5 h-5" }) : /* @__PURE__ */ e(ss, { className: "w-5 h-5" })
|
|
2858
3012
|
}
|
|
2859
3013
|
),
|
|
2860
|
-
|
|
3014
|
+
ue && /* @__PURE__ */ e(
|
|
2861
3015
|
"div",
|
|
2862
3016
|
{
|
|
2863
|
-
className: `absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards pointer-events-none ${
|
|
2864
|
-
onAnimationEnd: () =>
|
|
2865
|
-
children: /* @__PURE__ */
|
|
2866
|
-
|
|
2867
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children:
|
|
3017
|
+
className: `absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards pointer-events-none ${ue.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
|
|
3018
|
+
onAnimationEnd: () => Le(null),
|
|
3019
|
+
children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center text-white drop-shadow-lg", children: [
|
|
3020
|
+
ue.type === "rewind" ? /* @__PURE__ */ e(_t, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ e(qt, { className: "w-12 h-12 animate-pulse" }),
|
|
3021
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children: ue.type === "rewind" ? "-10s" : "+10s" })
|
|
2868
3022
|
] })
|
|
2869
3023
|
},
|
|
2870
|
-
|
|
3024
|
+
ue.id
|
|
2871
3025
|
),
|
|
2872
|
-
|
|
2873
|
-
|
|
3026
|
+
r.isBuffering && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-20 pointer-events-none", children: /* @__PURE__ */ e(De, { className: "w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg" }) }),
|
|
3027
|
+
r.error && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center", children: [
|
|
2874
3028
|
/* @__PURE__ */ e("span", { className: "text-5xl mb-2", children: "⚠️" }),
|
|
2875
3029
|
/* @__PURE__ */ e("h3", { className: "text-xl font-bold text-white", children: "Playback Error" }),
|
|
2876
|
-
/* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children:
|
|
2877
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
3030
|
+
/* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: r.error }),
|
|
3031
|
+
/* @__PURE__ */ e("button", { onClick: () => n.load(n.store.get().sources[n.store.get().currentSourceIndex] || { url: t || "", type: i || "auto" }, f), className: "px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg", children: "Try Again" })
|
|
2878
3032
|
] }) }),
|
|
2879
|
-
|
|
3033
|
+
j && !r.isLocked && (!r.isPlaying && !r.isBuffering && !r.error || r.controlsVisible) && !r.isBuffering ? /* @__PURE__ */ e(
|
|
2880
3034
|
"div",
|
|
2881
3035
|
{
|
|
2882
|
-
className: `absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${
|
|
2883
|
-
children: /* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */ e("button", { onMouseDown: (
|
|
2885
|
-
|
|
2886
|
-
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${
|
|
2887
|
-
/* @__PURE__ */ e("button", { onMouseDown: (
|
|
2888
|
-
|
|
2889
|
-
}, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${
|
|
2890
|
-
/* @__PURE__ */ e("button", { onMouseDown: (
|
|
2891
|
-
|
|
2892
|
-
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${
|
|
3036
|
+
className: `absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${r.controlsVisible || !r.isPlaying ? "opacity-100" : "opacity-0"}`,
|
|
3037
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-8 md:gap-16 pointer-events-auto", children: [
|
|
3038
|
+
/* @__PURE__ */ e("button", { onMouseDown: (d) => d.stopPropagation(), onTouchStart: (d) => d.stopPropagation(), onClick: (d) => {
|
|
3039
|
+
d.stopPropagation(), z(), $e("rewind");
|
|
3040
|
+
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${he.skipBtn}`, children: /* @__PURE__ */ e(_t, { className: he.skipIcon }) }),
|
|
3041
|
+
/* @__PURE__ */ e("button", { onMouseDown: (d) => d.stopPropagation(), onTouchStart: (d) => d.stopPropagation(), onClick: (d) => {
|
|
3042
|
+
d.stopPropagation(), z(), n.togglePlay();
|
|
3043
|
+
}, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${he.playBtn}`, children: r.isPlaying ? /* @__PURE__ */ e(Wt, { className: `${he.playIcon} text-white fill-current` }) : /* @__PURE__ */ e(Ht, { className: `${he.playIcon} text-white ml-1 fill-current` }) }),
|
|
3044
|
+
/* @__PURE__ */ e("button", { onMouseDown: (d) => d.stopPropagation(), onTouchStart: (d) => d.stopPropagation(), onClick: (d) => {
|
|
3045
|
+
d.stopPropagation(), z(), $e("forward");
|
|
3046
|
+
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${he.skipBtn}`, children: /* @__PURE__ */ e(qt, { className: he.skipIcon }) })
|
|
2893
3047
|
] })
|
|
2894
3048
|
}
|
|
2895
3049
|
) : null,
|
|
2896
|
-
/* @__PURE__ */
|
|
3050
|
+
/* @__PURE__ */ c(
|
|
2897
3051
|
"div",
|
|
2898
3052
|
{
|
|
2899
|
-
className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${
|
|
2900
|
-
onClick: (
|
|
2901
|
-
(
|
|
3053
|
+
className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${xi ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4 pointer-events-none"}`,
|
|
3054
|
+
onClick: (d) => {
|
|
3055
|
+
(V || B || E) && z(), d.target === d.currentTarget && ve(!1), d.stopPropagation();
|
|
2902
3056
|
},
|
|
2903
3057
|
children: [
|
|
2904
|
-
!
|
|
3058
|
+
!m.isLive && /* @__PURE__ */ c(
|
|
2905
3059
|
"div",
|
|
2906
3060
|
{
|
|
2907
|
-
ref:
|
|
3061
|
+
ref: Je,
|
|
2908
3062
|
className: "relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",
|
|
2909
|
-
onMouseMove:
|
|
3063
|
+
onMouseMove: hi,
|
|
2910
3064
|
onMouseLeave: () => {
|
|
2911
|
-
|
|
3065
|
+
kt(null), St(null);
|
|
2912
3066
|
},
|
|
2913
|
-
onMouseDown:
|
|
2914
|
-
onTouchStart:
|
|
3067
|
+
onMouseDown: Lt,
|
|
3068
|
+
onTouchStart: Lt,
|
|
2915
3069
|
children: [
|
|
2916
|
-
(
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
/* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children:
|
|
3070
|
+
(Ot = m.highlight) == null ? void 0 : Ot.map((d, w) => /* @__PURE__ */ e("div", { className: "absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none", style: { left: `${d.time / r.duration * 100}%` }, title: d.text }, w)),
|
|
3071
|
+
yt !== null && /* @__PURE__ */ c("div", { className: "absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150", style: { left: `clamp(70px, ${ri}%, calc(100% - 70px))` }, children: [
|
|
3072
|
+
ce && /* @__PURE__ */ e("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${ce.w * 0.5}px`, height: `${ce.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { style: { backgroundImage: `url("${ce.url}")`, width: `${ce.w}px`, height: `${ce.h}px`, backgroundPosition: `-${ce.x}px -${ce.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
|
|
3073
|
+
/* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: it(yt) })
|
|
2920
3074
|
] }),
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
|
|
2923
|
-
/* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(
|
|
3075
|
+
/* @__PURE__ */ c("div", { className: "w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10", style: { borderRadius: "var(--radius-full)" }, children: [
|
|
3076
|
+
r.duration > 0 && r.buffered.map((d, w) => /* @__PURE__ */ e("div", { className: "absolute top-0 bottom-0 bg-white/20", style: { left: `${d.start / r.duration * 100}%`, width: `${(d.end - d.start) / r.duration * 100}%` } }, w)),
|
|
3077
|
+
/* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(_e ? Re : r.currentTime) / r.duration * 100}%` } })
|
|
2924
3078
|
] }),
|
|
2925
3079
|
/* @__PURE__ */ e(
|
|
2926
3080
|
"div",
|
|
2927
3081
|
{
|
|
2928
3082
|
className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-white shadow-md scale-0 group-hover/slider:scale-100 transition-transform duration-100 z-10",
|
|
2929
3083
|
style: {
|
|
2930
|
-
left: `${(
|
|
3084
|
+
left: `${(_e ? Re : r.currentTime) / r.duration * 100}%`,
|
|
2931
3085
|
borderRadius: "var(--radius-full)"
|
|
2932
3086
|
}
|
|
2933
3087
|
}
|
|
@@ -2935,9 +3089,9 @@ const vn = [
|
|
|
2935
3089
|
]
|
|
2936
3090
|
}
|
|
2937
3091
|
),
|
|
2938
|
-
/* @__PURE__ */
|
|
2939
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children:
|
|
2940
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children:
|
|
3092
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between pointer-events-auto", children: [
|
|
3093
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: At.filter((d) => d.position === "left" || d.position === "center").map(Vt) }),
|
|
3094
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: At.filter((d) => d.position === "right").map(Vt) })
|
|
2941
3095
|
] })
|
|
2942
3096
|
]
|
|
2943
3097
|
}
|
|
@@ -2946,21 +3100,21 @@ const vn = [
|
|
|
2946
3100
|
]
|
|
2947
3101
|
}
|
|
2948
3102
|
);
|
|
2949
|
-
return
|
|
2950
|
-
},
|
|
2951
|
-
const
|
|
2952
|
-
return
|
|
3103
|
+
return r.isWebFullscreen && typeof document < "u" ? Ti(Bt, document.body) : Bt;
|
|
3104
|
+
}, $s = (s, t) => {
|
|
3105
|
+
const i = Mi(s);
|
|
3106
|
+
return i.render(Me.createElement(Yt, t)), {
|
|
2953
3107
|
unmount: () => {
|
|
2954
|
-
|
|
3108
|
+
i.unmount();
|
|
2955
3109
|
},
|
|
2956
3110
|
update: (o) => {
|
|
2957
|
-
|
|
3111
|
+
i.render(Me.createElement(Yt, { ...t, ...o }));
|
|
2958
3112
|
}
|
|
2959
3113
|
};
|
|
2960
3114
|
};
|
|
2961
3115
|
export {
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3116
|
+
$i as StrataCore,
|
|
3117
|
+
Yt as StrataPlayer,
|
|
3118
|
+
$s as mountStrataPlayer
|
|
2965
3119
|
};
|
|
2966
3120
|
//# sourceMappingURL=strataplayer.es.js.map
|