@factorialco/f0-react 12.10.0 → 12.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ArchiveThumbnail-b34U-zTc.js +70 -0
- package/dist/ArchiveViewer-BpmryW7A.js +172 -0
- package/dist/{ChatPostComposerDialog-DcmLrQk6.js → ChatPostComposerDialog-Cr207fXs.js} +4 -4
- package/dist/{CoachmarkProvider-XfLjB3dH.js → CoachmarkProvider-CsytVD-X.js} +29764 -29935
- package/dist/CodeThumbnail-8NiQ3uzU.js +31 -0
- package/dist/CodeViewer-BNZqt-5s.js +98 -0
- package/dist/DocumentToolbar-DUe9R1rU.js +74 -0
- package/dist/{DocxThumbnail-kHTNnwW0.js → DocxThumbnail-CK9vFoTB.js} +2 -2
- package/dist/{DocxViewer-CqHgSExq.js → DocxViewer-BUMy2iL7.js} +25 -23
- package/dist/ExternalLink-RdKU698E.js +22 -0
- package/dist/{F0AiProcessingOverlay-H23WHd7F.js → F0AiProcessingOverlay-CiUTeBwG.js} +1388 -1384
- package/dist/F0Alert-Ca8sBfXN.js +102 -0
- package/dist/F0AudioPlayer-BefDLQA2.js +1083 -0
- package/dist/F0AudioPlayer-CNb4kXOk.js +3 -0
- package/dist/{popover-BjrPOMeQ.js → F0Button-d91IgOnc.js} +3164 -8587
- package/dist/{F0CanvasPanel--hLKeQvg.js → F0CanvasPanel-BOo_mxBl.js} +10286 -9593
- package/dist/F0DocumentViewer-CaYAO9ok.js +3 -0
- package/dist/F0DocumentViewer-h0XY5tgT.js +90 -0
- package/dist/F0Icon-DmCBV0gK.js +202 -0
- package/dist/{F0Map-hvgCUGk8.js → F0Map-b1uYlF_H.js} +614 -613
- package/dist/F0SegmentedControl-DXoAzTmH.js +103 -0
- package/dist/{F0Select-B-ZxVjXG.js → F0Select-BZ20yXKy.js} +9172 -9251
- package/dist/{F0VideoPlayer-CNp5hXgp.js → F0VideoPlayer-D85XCpqh.js} +390 -430
- package/dist/F0VideoPlayer-_zLFiEIp.js +1 -0
- package/dist/HtmlThumbnail-BJuJkuvu.js +60 -0
- package/dist/HtmlViewer-DxOnMV30.js +208 -0
- package/dist/LayoutGroup-BGb5jMxE.js +57 -0
- package/dist/LockLocked-gdodYvT_.js +41 -0
- package/dist/{Map-eIXVKc1x.js → Map-BOMgctnS.js} +55 -52
- package/dist/{PdfThumbnail-CCSmwxQU.js → PdfThumbnail-98PDy4ud.js} +5 -5
- package/dist/PdfViewer-nBnKrTYD.js +296 -0
- package/dist/SandboxedHtmlFrame-B95lWsIP.js +309 -0
- package/dist/{SheetViewer-BN5UYkEZ.js → SheetViewer-CD9SHbXJ.js} +36 -26
- package/dist/TextThumbnail-DKNxh344.js +15 -0
- package/dist/{TextViewer-Bt0_dYB-.js → TextViewer-DxRBCXzV.js} +44 -41
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/bash-BcZBmoDA.js +169 -0
- package/dist/c-Dv-5_kUQ.js +187 -0
- package/dist/component-status.js +2 -2
- package/dist/core-C0MCmPil.js +842 -0
- package/dist/cpp-CMQhucZt.js +236 -0
- package/dist/csharp-CuDKSCf2.js +260 -0
- package/dist/css-Dta7Q4Li.js +145 -0
- package/dist/dart-po7Eq73d.js +134 -0
- package/dist/diff-IgsQP-8T.js +39 -0
- package/dist/dist-CFY0KELA.js +55 -0
- package/dist/dist-DtILhk4w.js +253 -0
- package/dist/dist-zvwuNflP.js +59 -0
- package/dist/dockerfile-B4Bz9I5u.js +34 -0
- package/dist/dos-1TcyLtUq.js +57 -0
- package/dist/elixir-BnEjyLGa.js +189 -0
- package/dist/erlang-tgri7ZSv.js +218 -0
- package/dist/experimental.d.ts +24 -4
- package/dist/experimental.js +5957 -5752
- package/dist/{exports-BByQBwpi.d.ts → exports-cxvNeHfV.d.ts} +1 -1
- package/dist/f0.d.ts +130 -8
- package/dist/f0.js +1969 -3034
- package/dist/fetchText-o_GOtiv3.js +54 -0
- package/dist/go-CEVmppuo.js +144 -0
- package/dist/graphql-BWwc-u8d.js +67 -0
- package/dist/groovy-BELuqtd6.js +127 -0
- package/dist/haskell-Cxh7aaFM.js +138 -0
- package/dist/highlight-CqFL-_MG.js +114 -0
- package/dist/i18n-provider-Bdgo-LeP.js +150 -0
- package/dist/{i18n-provider-defaults-p0UGTA_k.js → i18n-provider-defaults-B9vdZZeS.js} +35 -1
- package/dist/{i18n-provider-defaults-DQxuUMpU.d.ts → i18n-provider-defaults-DyPn8R7T.d.ts} +34 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-D3nEDg8x.d.ts → index-DF8ubeg6.d.ts} +1 -1
- package/dist/ini-DA-F0rRr.js +88 -0
- package/dist/java-Bujnoc_f.js +174 -0
- package/dist/javascript-BeEhpXRE.js +431 -0
- package/dist/json-CxvE7tEw.js +42 -0
- package/dist/kotlin-DOwDGI_m.js +206 -0
- package/dist/less-DWlR-e-o.js +196 -0
- package/dist/localized-BrUgGMzm.js +46 -0
- package/dist/lua-BlZiakwh.js +46 -0
- package/dist/makefile-D3841Yg4.js +57 -0
- package/dist/{maplibre-Bywi9z2G.js → maplibre-Ip4Qe9dM.js} +1 -1
- package/dist/markdown-D1wNG79U.js +178 -0
- package/dist/objectivec-DxtRzTBy.js +117 -0
- package/dist/ownValue-D4uSXt0d.js +4 -0
- package/dist/{pdfWorker-CKgxOaCl.js → pdfWorker-DMjHHAyP.js} +12 -9
- package/dist/pdfWorkerConfig-BwllKt1K.js +8 -0
- package/dist/perl-BWRmkuyz.js +192 -0
- package/dist/php-CjwybYSP.js +300 -0
- package/dist/popover-ics24JxK.js +4486 -0
- package/dist/{posts-DGtDUrKT.js → posts-BHRBUAYJ.js} +2 -0
- package/dist/powershell-CgKcNA5Q.js +188 -0
- package/dist/properties-Bc45MTzW.js +38 -0
- package/dist/protobuf-Bv_xSUaI.js +61 -0
- package/dist/purify.es-ZpfdAuNV.js +545 -0
- package/dist/python-D8PdGjgy.js +238 -0
- package/dist/r-DA-9ZIdU.js +140 -0
- package/dist/{renderDocx-_UmnE-yc.js → renderDocx-BW-uDyaZ.js} +2 -0
- package/dist/ruby-Bqr16BpN.js +262 -0
- package/dist/rust-BCvJMwk8.js +182 -0
- package/dist/scala-Du8mOD2z.js +162 -0
- package/dist/scrollarea-cxaFAWG5.js +691 -0
- package/dist/scss-AMxHqh46.js +155 -0
- package/dist/skeleton-AC0Fb8zj.js +72 -0
- package/dist/sql-BbYSgcOA.js +118 -0
- package/dist/styles.css +1 -1
- package/dist/swift-DRKtalPn.js +575 -0
- package/dist/toolbarStyles-lTj_42zD.js +52 -0
- package/dist/{types-UMYBr8Mi.d.ts → types-geibVrTM.d.ts} +3 -95
- package/dist/typescript-Bv8uKU6V.js +516 -0
- package/dist/{useData-B7LYSzh0.js → useData-BYkiGUHX.js} +4734 -5375
- package/dist/useFetchedText-BR3_KLXx.js +38 -0
- package/dist/useThumbnailText-DwXQvLIe.js +22 -0
- package/dist/xml-BVpP05uE.js +162 -0
- package/dist/yaml-BNe2WG-i.js +144 -0
- package/dist/zipTree-B2zUYl6b.js +247 -0
- package/package.json +2 -1
- package/dist/DocumentToolbar-CqbY6eID.js +0 -70
- package/dist/F0DocumentViewer-BN-2IVgz.js +0 -400
- package/dist/F0DocumentViewer-D1G3M2J_.js +0 -3
- package/dist/F0Text-D92NWQRd.js +0 -81
- package/dist/F0VideoPlayer-D4bZBBLK.js +0 -1
- package/dist/TextThumbnail-X04JgaNI.js +0 -26
- package/dist/dist-DvxtFKDL.js +0 -78
|
@@ -1,55 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (e !== void 0) {
|
|
14
|
-
if (!L(e)) return e;
|
|
15
|
-
if (e.length !== 0) return ((t ? e.find((e) => e.locale === t) : void 0) ?? e[0]).value;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function z(...e) {
|
|
19
|
-
let t = /* @__PURE__ */ new Map();
|
|
20
|
-
for (let n of e) if (L(n)) for (let e of n) {
|
|
21
|
-
let n = t.get(e.locale);
|
|
22
|
-
n ? !n.label && e.label && (n.label = e.label) : t.set(e.locale, {
|
|
23
|
-
locale: e.locale,
|
|
24
|
-
label: e.label
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return Array.from(t.values());
|
|
28
|
-
}
|
|
29
|
-
function B(e, t) {
|
|
30
|
-
if (e.label) return e.label;
|
|
31
|
-
try {
|
|
32
|
-
let n = t ?? e.locale, r = new Intl.DisplayNames([n], { type: "language" }).of(e.locale) ?? e.locale;
|
|
33
|
-
return r.charAt(0).toLocaleUpperCase(n) + r.slice(1);
|
|
34
|
-
} catch {
|
|
35
|
-
return e.locale;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function V(e, t) {
|
|
39
|
-
if (e.length === 0) return;
|
|
40
|
-
let n = e.map((e) => e.locale), r = (e) => e.split("-")[0], i = (e) => n.find((t) => t === e) ?? n.find((t) => r(t) === r(e));
|
|
41
|
-
if (t) {
|
|
42
|
-
let e = i(t);
|
|
43
|
-
if (e) return e;
|
|
44
|
-
}
|
|
45
|
-
let a = typeof navigator < "u" ? navigator.language : void 0;
|
|
46
|
-
if (a) {
|
|
47
|
-
let e = i(a);
|
|
48
|
-
if (e) return e;
|
|
49
|
-
}
|
|
50
|
-
return n[0];
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
1
|
+
import { a as e, r as t } from "./i18n-provider-Bdgo-LeP.js";
|
|
2
|
+
import { n } from "./skeleton-AC0Fb8zj.js";
|
|
3
|
+
import { L as r, R as i } from "./tooltip-BX4dSfeL.js";
|
|
4
|
+
import { t as a } from "./F0Button-d91IgOnc.js";
|
|
5
|
+
import { $o as o, Ja as s, Ko as c, Ms as l, Ya as u, go as d, gs as f, ho as p, qa as m, yo as h } from "./F0CanvasPanel-BOo_mxBl.js";
|
|
6
|
+
import { n as g, t as _ } from "./F0Icon-DmCBV0gK.js";
|
|
7
|
+
import { t as v } from "./Check-DAp9gCRh.js";
|
|
8
|
+
import { A as y, B as b, F as x, H as S, I as C, P as ee, R as w, a as T, i as E, k as D, t as te, z as O } from "./popover-ics24JxK.js";
|
|
9
|
+
import { i as k, n as A, r as j, t as M } from "./localized-BrUgGMzm.js";
|
|
10
|
+
import { t as ne } from "./useFullscreen-CNwpzjpz.js";
|
|
11
|
+
import { forwardRef as N, useCallback as P, useEffect as F, useId as I, useMemo as L, useRef as R, useState as z } from "react";
|
|
12
|
+
import { jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
53
13
|
//#region src/blocks/F0VideoPlayer/utils.ts
|
|
54
14
|
var H = [
|
|
55
15
|
.5,
|
|
@@ -57,23 +17,23 @@ var H = [
|
|
|
57
17
|
1,
|
|
58
18
|
1.25,
|
|
59
19
|
1.5
|
|
60
|
-
], U = .1,
|
|
20
|
+
], U = .1, re = [
|
|
61
21
|
25,
|
|
62
22
|
50,
|
|
63
23
|
75
|
|
64
|
-
],
|
|
65
|
-
function
|
|
24
|
+
], W = 3e5, G = .03;
|
|
25
|
+
function K(e) {
|
|
66
26
|
return !Number.isFinite(e) || e < 0 ? "0:00" : `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
67
27
|
}
|
|
68
|
-
function
|
|
28
|
+
function q(e) {
|
|
69
29
|
return `${e}x`;
|
|
70
30
|
}
|
|
71
|
-
function
|
|
31
|
+
function J(e) {
|
|
72
32
|
return H.includes(e);
|
|
73
33
|
}
|
|
74
34
|
//#endregion
|
|
75
35
|
//#region src/blocks/F0VideoPlayer/components/AudioDescriptionToggleIcons.tsx
|
|
76
|
-
var
|
|
36
|
+
var Y = {
|
|
77
37
|
x: 12,
|
|
78
38
|
y: 15,
|
|
79
39
|
textAnchor: "middle",
|
|
@@ -81,14 +41,14 @@ var X = {
|
|
|
81
41
|
fontWeight: 700,
|
|
82
42
|
fontFamily: "inherit",
|
|
83
43
|
letterSpacing: -.4
|
|
84
|
-
},
|
|
44
|
+
}, X = N(({ animate: e, ...t }, n) => /* @__PURE__ */ V("svg", {
|
|
85
45
|
xmlns: "http://www.w3.org/2000/svg",
|
|
86
46
|
viewBox: "0 0 24 24",
|
|
87
47
|
fill: "none",
|
|
88
48
|
ref: n,
|
|
89
49
|
...t,
|
|
90
50
|
"aria-hidden": "true",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ B("rect", {
|
|
92
52
|
x: 3.5,
|
|
93
53
|
y: 6.5,
|
|
94
54
|
width: 17,
|
|
@@ -96,38 +56,38 @@ var X = {
|
|
|
96
56
|
rx: 2.5,
|
|
97
57
|
stroke: "currentColor",
|
|
98
58
|
vectorEffect: "non-scaling-stroke"
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
-
...
|
|
59
|
+
}), /* @__PURE__ */ B("text", {
|
|
60
|
+
...Y,
|
|
101
61
|
fill: "currentColor",
|
|
102
62
|
children: "AD"
|
|
103
63
|
})]
|
|
104
64
|
}));
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
let r = `ad-mask-${
|
|
108
|
-
return /* @__PURE__ */
|
|
65
|
+
X.displayName = "AudioDescriptionLineIcon";
|
|
66
|
+
var Z = N(({ animate: e, ...t }, n) => {
|
|
67
|
+
let r = `ad-mask-${I().replace(/:/g, "")}`;
|
|
68
|
+
return /* @__PURE__ */ V("svg", {
|
|
109
69
|
xmlns: "http://www.w3.org/2000/svg",
|
|
110
70
|
viewBox: "0 0 24 24",
|
|
111
71
|
fill: "none",
|
|
112
72
|
ref: n,
|
|
113
73
|
...t,
|
|
114
74
|
"aria-hidden": "true",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ V("mask", {
|
|
116
76
|
id: r,
|
|
117
77
|
maskUnits: "userSpaceOnUse",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ B("rect", {
|
|
119
79
|
x: 3,
|
|
120
80
|
y: 6,
|
|
121
81
|
width: 18,
|
|
122
82
|
height: 12,
|
|
123
83
|
rx: 3,
|
|
124
84
|
fill: "white"
|
|
125
|
-
}), /* @__PURE__ */
|
|
126
|
-
...
|
|
85
|
+
}), /* @__PURE__ */ B("text", {
|
|
86
|
+
...Y,
|
|
127
87
|
fill: "black",
|
|
128
88
|
children: "AD"
|
|
129
89
|
})]
|
|
130
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ B("rect", {
|
|
131
91
|
x: 3,
|
|
132
92
|
y: 6,
|
|
133
93
|
width: 18,
|
|
@@ -138,17 +98,17 @@ var ie = O(({ animate: e, ...t }, n) => {
|
|
|
138
98
|
})]
|
|
139
99
|
});
|
|
140
100
|
});
|
|
141
|
-
|
|
101
|
+
Z.displayName = "AudioDescriptionFilledIcon";
|
|
142
102
|
//#endregion
|
|
143
103
|
//#region src/blocks/F0VideoPlayer/components/CaptionsToggleIcons.tsx
|
|
144
|
-
var Q =
|
|
104
|
+
var Q = N(({ animate: e, ...t }, n) => /* @__PURE__ */ V("svg", {
|
|
145
105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
146
106
|
fill: "none",
|
|
147
107
|
viewBox: "0 0 24 24",
|
|
148
108
|
ref: n,
|
|
149
109
|
...t,
|
|
150
110
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ B("rect", {
|
|
152
112
|
x: 3.5,
|
|
153
113
|
y: 6.5,
|
|
154
114
|
width: 17,
|
|
@@ -157,13 +117,13 @@ var Q = O(({ animate: e, ...t }, n) => /* @__PURE__ */ I("svg", {
|
|
|
157
117
|
stroke: "currentColor",
|
|
158
118
|
vectorEffect: "non-scaling-stroke"
|
|
159
119
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ B("path", {
|
|
161
121
|
stroke: "currentColor",
|
|
162
122
|
strokeLinecap: "round",
|
|
163
123
|
d: "M7 10.75h8",
|
|
164
124
|
vectorEffect: "non-scaling-stroke"
|
|
165
125
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ B("path", {
|
|
167
127
|
stroke: "currentColor",
|
|
168
128
|
strokeLinecap: "round",
|
|
169
129
|
d: "M7 13.75h4.5",
|
|
@@ -172,13 +132,13 @@ var Q = O(({ animate: e, ...t }, n) => /* @__PURE__ */ I("svg", {
|
|
|
172
132
|
]
|
|
173
133
|
}));
|
|
174
134
|
Q.displayName = "CaptionsLineIcon";
|
|
175
|
-
var
|
|
135
|
+
var ie = N(({ animate: e, ...t }, n) => /* @__PURE__ */ B("svg", {
|
|
176
136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
177
137
|
fill: "none",
|
|
178
138
|
viewBox: "0 0 24 24",
|
|
179
139
|
ref: n,
|
|
180
140
|
...t,
|
|
181
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ B("path", {
|
|
182
142
|
fill: "currentColor",
|
|
183
143
|
fillRule: "evenodd",
|
|
184
144
|
clipRule: "evenodd",
|
|
@@ -186,30 +146,30 @@ var ae = O(({ animate: e, ...t }, n) => /* @__PURE__ */ F("svg", {
|
|
|
186
146
|
vectorEffect: "non-scaling-stroke"
|
|
187
147
|
})
|
|
188
148
|
}));
|
|
189
|
-
|
|
149
|
+
ie.displayName = "CaptionsFilledIcon";
|
|
190
150
|
//#endregion
|
|
191
151
|
//#region src/blocks/F0VideoPlayer/components/PlaybackRateMenu.tsx
|
|
192
|
-
function
|
|
193
|
-
let { t:
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
open:
|
|
196
|
-
onOpenChange:
|
|
197
|
-
children: [/* @__PURE__ */
|
|
152
|
+
function ae({ value: e, onChange: n, containerRef: i }) {
|
|
153
|
+
let { t: o } = t(), [s, c] = z(!1);
|
|
154
|
+
return /* @__PURE__ */ V(te, {
|
|
155
|
+
open: s,
|
|
156
|
+
onOpenChange: c,
|
|
157
|
+
children: [/* @__PURE__ */ B(T, {
|
|
198
158
|
asChild: !0,
|
|
199
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ B(a, {
|
|
200
160
|
variant: "ghost",
|
|
201
161
|
size: "sm",
|
|
202
|
-
label:
|
|
203
|
-
"aria-label":
|
|
162
|
+
label: q(e),
|
|
163
|
+
"aria-label": o("videoPlayer.playbackSpeed", { rate: q(e) })
|
|
204
164
|
})
|
|
205
|
-
}), /* @__PURE__ */
|
|
206
|
-
container:
|
|
165
|
+
}), /* @__PURE__ */ B(E, {
|
|
166
|
+
container: i.current,
|
|
207
167
|
side: "top",
|
|
208
168
|
align: "end",
|
|
209
169
|
sideOffset: 8,
|
|
210
|
-
className:
|
|
170
|
+
className: r("flex w-auto min-w-[7rem] flex-col gap-0.5 rounded-md border", "border-solid border-f1-border-secondary bg-f1-background p-1 shadow-md"),
|
|
211
171
|
role: "menu",
|
|
212
|
-
"aria-label":
|
|
172
|
+
"aria-label": o("videoPlayer.playbackSpeedLabel"),
|
|
213
173
|
onKeyDown: (e) => {
|
|
214
174
|
let t = Array.from(e.currentTarget.querySelectorAll("[role=\"menuitemradio\"]"));
|
|
215
175
|
if (t.length === 0) return;
|
|
@@ -231,389 +191,389 @@ function oe({ value: e, onChange: t, containerRef: n }) {
|
|
|
231
191
|
}
|
|
232
192
|
e.preventDefault(), t[r]?.focus();
|
|
233
193
|
},
|
|
234
|
-
children: H.map((
|
|
235
|
-
let
|
|
236
|
-
return /* @__PURE__ */
|
|
194
|
+
children: H.map((t) => {
|
|
195
|
+
let i = t === e;
|
|
196
|
+
return /* @__PURE__ */ V("button", {
|
|
237
197
|
type: "button",
|
|
238
198
|
role: "menuitemradio",
|
|
239
|
-
"aria-checked":
|
|
240
|
-
className:
|
|
199
|
+
"aria-checked": i,
|
|
200
|
+
className: r("relative flex items-center rounded-xs py-1.5 pl-8 pr-3", "cursor-pointer border-none bg-transparent text-left text-sm font-medium tabular-nums", "text-f1-foreground transition-colors hover:bg-f1-background-secondary", "focus-visible:bg-f1-background-secondary focus-visible:outline-none", "[&_svg]:h-3.5 [&_svg]:w-3.5"),
|
|
241
201
|
onClick: () => {
|
|
242
|
-
t
|
|
202
|
+
n(t), c(!1);
|
|
243
203
|
},
|
|
244
|
-
children: [
|
|
204
|
+
children: [i ? /* @__PURE__ */ B("span", {
|
|
245
205
|
className: "absolute left-2.5 inline-flex items-center",
|
|
246
|
-
children: /* @__PURE__ */
|
|
247
|
-
}) : null,
|
|
248
|
-
},
|
|
206
|
+
children: /* @__PURE__ */ B(v, {})
|
|
207
|
+
}) : null, q(t)]
|
|
208
|
+
}, t);
|
|
249
209
|
})
|
|
250
210
|
})]
|
|
251
211
|
});
|
|
252
212
|
}
|
|
253
213
|
//#endregion
|
|
254
214
|
//#region src/blocks/F0VideoPlayer/components/Seekbar.tsx
|
|
255
|
-
function
|
|
256
|
-
let { t:
|
|
257
|
-
let t =
|
|
215
|
+
function oe({ currentTime: e, duration: n, markerTime: a, blockSeekPastMarker: o = !1, onSeek: s }) {
|
|
216
|
+
let { t: c } = t(), l = R(null), [u, d] = z(!1), [f, p] = z(null), m = n > 0 ? Math.min(1, e / n) : 0, h = a !== void 0 && n > 0 ? Math.min(1, a / n) : 0, g = a !== void 0 && n > 0 && a > 0 && a < n - .25 && e < a - .25, _ = (e) => {
|
|
217
|
+
let t = l.current;
|
|
258
218
|
if (!t) return 0;
|
|
259
219
|
let n = t.getBoundingClientRect();
|
|
260
220
|
return Math.max(0, Math.min(1, (e - n.left) / n.width));
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
},
|
|
264
|
-
|
|
221
|
+
}, v = (e) => {
|
|
222
|
+
n && s(_(e) * n);
|
|
223
|
+
}, y = (e) => {
|
|
224
|
+
n && (e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), d(!0), v(e.clientX));
|
|
265
225
|
}, b = (e) => {
|
|
266
|
-
|
|
226
|
+
n && (p(_(e.clientX)), u && v(e.clientX));
|
|
267
227
|
}, x = (e) => {
|
|
268
|
-
|
|
269
|
-
}, S =
|
|
270
|
-
return /* @__PURE__ */
|
|
271
|
-
ref:
|
|
272
|
-
className:
|
|
228
|
+
u && (d(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
229
|
+
}, S = f !== null && o && a !== void 0 && f > h;
|
|
230
|
+
return /* @__PURE__ */ V("div", {
|
|
231
|
+
ref: l,
|
|
232
|
+
className: r("relative flex h-4 flex-1 items-center rounded-sm", "cursor-pointer touch-none", i()),
|
|
273
233
|
role: "slider",
|
|
274
234
|
tabIndex: 0,
|
|
275
|
-
"aria-label":
|
|
235
|
+
"aria-label": c("videoPlayer.seekLabel"),
|
|
276
236
|
"aria-valuemin": 0,
|
|
277
|
-
"aria-valuemax":
|
|
237
|
+
"aria-valuemax": n || 0,
|
|
278
238
|
"aria-valuenow": e,
|
|
279
|
-
"aria-valuetext":
|
|
280
|
-
current:
|
|
281
|
-
total:
|
|
239
|
+
"aria-valuetext": c("videoPlayer.timeProgress", {
|
|
240
|
+
current: K(e),
|
|
241
|
+
total: K(n)
|
|
282
242
|
}),
|
|
283
|
-
onPointerDown:
|
|
243
|
+
onPointerDown: y,
|
|
284
244
|
onPointerMove: b,
|
|
285
245
|
onPointerUp: x,
|
|
286
246
|
onPointerCancel: x,
|
|
287
|
-
onLostPointerCapture: () =>
|
|
288
|
-
onPointerLeave: () =>
|
|
289
|
-
onKeyDown: (
|
|
290
|
-
if (!
|
|
247
|
+
onLostPointerCapture: () => d(!1),
|
|
248
|
+
onPointerLeave: () => p(null),
|
|
249
|
+
onKeyDown: (t) => {
|
|
250
|
+
if (!n) return;
|
|
291
251
|
let r = null;
|
|
292
|
-
switch (
|
|
252
|
+
switch (t.key) {
|
|
293
253
|
case "ArrowLeft":
|
|
294
254
|
r = Math.max(0, e - 5);
|
|
295
255
|
break;
|
|
296
256
|
case "ArrowRight":
|
|
297
|
-
r = Math.min(
|
|
257
|
+
r = Math.min(n, e + 5);
|
|
298
258
|
break;
|
|
299
259
|
case "Home":
|
|
300
260
|
r = 0;
|
|
301
261
|
break;
|
|
302
262
|
case "End":
|
|
303
|
-
r =
|
|
263
|
+
r = n;
|
|
304
264
|
break;
|
|
305
265
|
default: return;
|
|
306
266
|
}
|
|
307
|
-
|
|
267
|
+
t.preventDefault(), t.stopPropagation(), s(r);
|
|
308
268
|
},
|
|
309
269
|
children: [
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ B("div", { className: "absolute inset-x-0 h-1 rounded-sm bg-f1-foreground/30" }),
|
|
271
|
+
/* @__PURE__ */ B("div", {
|
|
312
272
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
313
|
-
style: { width: `${
|
|
273
|
+
style: { width: `${m * 100}%` }
|
|
314
274
|
}),
|
|
315
|
-
|
|
275
|
+
g ? /* @__PURE__ */ B("div", {
|
|
316
276
|
className: "pointer-events-none absolute z-[1] h-2.5 w-0.5 -translate-x-px bg-f1-foreground/95",
|
|
317
|
-
style: { left: `${
|
|
277
|
+
style: { left: `${h * 100}%` },
|
|
318
278
|
"aria-hidden": "true"
|
|
319
279
|
}) : null,
|
|
320
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ B("div", {
|
|
321
281
|
className: "pointer-events-none absolute z-[2] h-3 w-3 -translate-x-1/2 rounded-full bg-f1-foreground shadow-[0_0_4px_rgba(0,0,0,0.4)]",
|
|
322
|
-
style: { left: `${
|
|
282
|
+
style: { left: `${m * 100}%` }
|
|
323
283
|
}),
|
|
324
|
-
S ? /* @__PURE__ */
|
|
284
|
+
S ? /* @__PURE__ */ B("div", { className: "absolute inset-0 cursor-not-allowed" }) : null
|
|
325
285
|
]
|
|
326
286
|
});
|
|
327
287
|
}
|
|
328
288
|
//#endregion
|
|
329
289
|
//#region src/blocks/F0VideoPlayer/components/SettingsMenu.tsx
|
|
330
|
-
var
|
|
331
|
-
function
|
|
332
|
-
let
|
|
333
|
-
return /* @__PURE__ */
|
|
290
|
+
var se = "off", ce = "py-2 pr-4 text-base font-medium", le = "gap-2 py-2 pl-3 pr-2 text-base font-medium", ue = "max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[13rem] overflow-y-auto p-1";
|
|
291
|
+
function $({ icon: e, label: t, container: n, options: r, value: i, onLanguageChange: a, on: o, onOff: s, offLabel: c }) {
|
|
292
|
+
let l = s !== void 0, u = r.find((e) => e.locale === i), d = l && !o ? c : u ? j(u) : c;
|
|
293
|
+
return /* @__PURE__ */ V(w, { children: [/* @__PURE__ */ V(b, {
|
|
334
294
|
className: le,
|
|
335
295
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ B(g, { icon: e }),
|
|
297
|
+
/* @__PURE__ */ B("span", {
|
|
338
298
|
className: "flex-1",
|
|
339
|
-
children:
|
|
299
|
+
children: t
|
|
340
300
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ B("span", {
|
|
342
302
|
className: "text-f1-foreground-secondary",
|
|
343
|
-
children:
|
|
303
|
+
children: d
|
|
344
304
|
})
|
|
345
305
|
]
|
|
346
|
-
}), /* @__PURE__ */
|
|
347
|
-
container:
|
|
348
|
-
children: /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ B(ee, {
|
|
307
|
+
container: n ?? void 0,
|
|
308
|
+
children: /* @__PURE__ */ B(O, {
|
|
349
309
|
className: ue,
|
|
350
|
-
children: /* @__PURE__ */
|
|
351
|
-
value:
|
|
352
|
-
onValueChange: (e) =>
|
|
353
|
-
children: [
|
|
310
|
+
children: /* @__PURE__ */ V(x, {
|
|
311
|
+
value: l ? o ? i : se : i,
|
|
312
|
+
onValueChange: (e) => l && e === se ? s() : a(e),
|
|
313
|
+
children: [r.map((e) => /* @__PURE__ */ B(C, {
|
|
354
314
|
value: e.locale,
|
|
355
315
|
className: ce,
|
|
356
|
-
children:
|
|
357
|
-
}, e.locale)),
|
|
358
|
-
value:
|
|
316
|
+
children: j(e)
|
|
317
|
+
}, e.locale)), l ? /* @__PURE__ */ B(C, {
|
|
318
|
+
value: se,
|
|
359
319
|
className: ce,
|
|
360
|
-
children:
|
|
320
|
+
children: c
|
|
361
321
|
}) : null]
|
|
362
322
|
})
|
|
363
323
|
})
|
|
364
324
|
})] });
|
|
365
325
|
}
|
|
366
|
-
function
|
|
367
|
-
let { t:
|
|
368
|
-
return /* @__PURE__ */
|
|
326
|
+
function de({ containerRef: e, audioLanguages: n, audioLanguage: r, onAudioLanguageChange: i, captionLanguages: o, captionLanguage: s, captionsOn: c, onCaptionLanguageChange: l, onCaptionsOff: u, audioDescriptionLanguages: d, audioDescriptionLanguage: p, audioDescriptionOn: m, onAudioDescriptionLanguageChange: g, onAudioDescriptionOff: _ }) {
|
|
327
|
+
let { t: v } = t(), b = e.current, x = v("videoPlayer.off");
|
|
328
|
+
return /* @__PURE__ */ V(D, { children: [/* @__PURE__ */ B(S, {
|
|
369
329
|
asChild: !0,
|
|
370
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ B(a, {
|
|
371
331
|
variant: "ghost",
|
|
372
332
|
size: "sm",
|
|
373
333
|
hideLabel: !0,
|
|
374
|
-
icon:
|
|
375
|
-
label:
|
|
334
|
+
icon: h,
|
|
335
|
+
label: v("videoPlayer.settings")
|
|
376
336
|
})
|
|
377
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ V(y, {
|
|
378
338
|
container: b,
|
|
379
339
|
side: "top",
|
|
380
340
|
align: "end",
|
|
381
341
|
className: ue,
|
|
382
342
|
children: [
|
|
383
|
-
n.length > 1 ? /* @__PURE__ */
|
|
384
|
-
icon:
|
|
385
|
-
label:
|
|
343
|
+
n.length > 1 ? /* @__PURE__ */ B($, {
|
|
344
|
+
icon: f,
|
|
345
|
+
label: v("videoPlayer.audio"),
|
|
386
346
|
container: b,
|
|
387
347
|
options: n,
|
|
388
348
|
value: r,
|
|
389
349
|
onLanguageChange: i,
|
|
390
350
|
offLabel: x
|
|
391
351
|
}) : null,
|
|
392
|
-
o.length > 1 ? /* @__PURE__ */
|
|
352
|
+
o.length > 1 ? /* @__PURE__ */ B($, {
|
|
393
353
|
icon: Q,
|
|
394
|
-
label:
|
|
354
|
+
label: v("videoPlayer.subtitles"),
|
|
395
355
|
container: b,
|
|
396
356
|
options: o,
|
|
397
357
|
value: s,
|
|
398
358
|
on: c,
|
|
399
359
|
onLanguageChange: l,
|
|
400
|
-
onOff:
|
|
360
|
+
onOff: u,
|
|
401
361
|
offLabel: x
|
|
402
362
|
}) : null,
|
|
403
|
-
|
|
404
|
-
icon:
|
|
405
|
-
label:
|
|
363
|
+
d.length > 1 ? /* @__PURE__ */ B($, {
|
|
364
|
+
icon: X,
|
|
365
|
+
label: v("videoPlayer.audioDescription"),
|
|
406
366
|
container: b,
|
|
407
|
-
options:
|
|
408
|
-
value:
|
|
409
|
-
on:
|
|
410
|
-
onLanguageChange:
|
|
411
|
-
onOff:
|
|
367
|
+
options: d,
|
|
368
|
+
value: p,
|
|
369
|
+
on: m,
|
|
370
|
+
onLanguageChange: g,
|
|
371
|
+
onOff: _,
|
|
412
372
|
offLabel: x
|
|
413
373
|
}) : null
|
|
414
374
|
]
|
|
415
375
|
})] });
|
|
416
376
|
}
|
|
417
|
-
function
|
|
377
|
+
function fe(e) {
|
|
418
378
|
return e.audioLanguages > 1 || e.captionLanguages > 1 || e.audioDescriptionLanguages > 1;
|
|
419
379
|
}
|
|
420
380
|
//#endregion
|
|
421
381
|
//#region src/blocks/F0VideoPlayer/components/VolumeControl.tsx
|
|
422
|
-
function
|
|
423
|
-
return t || e === 0 ?
|
|
382
|
+
function pe(e, t) {
|
|
383
|
+
return t || e === 0 ? m : e <= .5 ? s : u;
|
|
424
384
|
}
|
|
425
|
-
function
|
|
426
|
-
let { t:
|
|
427
|
-
return
|
|
385
|
+
function me({ volume: e, isMuted: n, onToggleMute: r, onVolumeChange: i, silent: o = !1 }) {
|
|
386
|
+
let { t: s } = t(), c = n || e === 0;
|
|
387
|
+
return o ? /* @__PURE__ */ B(a, {
|
|
428
388
|
variant: "ghost",
|
|
429
389
|
size: "sm",
|
|
430
390
|
hideLabel: !0,
|
|
431
391
|
disabled: !0,
|
|
432
|
-
icon:
|
|
433
|
-
label:
|
|
434
|
-
}) : /* @__PURE__ */
|
|
392
|
+
icon: m,
|
|
393
|
+
label: s("videoPlayer.noAudio")
|
|
394
|
+
}) : /* @__PURE__ */ V("div", {
|
|
435
395
|
className: "flex items-center gap-1",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ B(a, {
|
|
437
397
|
variant: "ghost",
|
|
438
398
|
size: "sm",
|
|
439
399
|
hideLabel: !0,
|
|
440
|
-
icon:
|
|
441
|
-
label:
|
|
442
|
-
onClick:
|
|
443
|
-
}), /* @__PURE__ */
|
|
444
|
-
value:
|
|
445
|
-
onChange:
|
|
400
|
+
icon: pe(e, c),
|
|
401
|
+
label: s(c ? "videoPlayer.unmute" : "videoPlayer.mute"),
|
|
402
|
+
onClick: r
|
|
403
|
+
}), /* @__PURE__ */ B(he, {
|
|
404
|
+
value: c ? 0 : e,
|
|
405
|
+
onChange: i
|
|
446
406
|
})]
|
|
447
407
|
});
|
|
448
408
|
}
|
|
449
|
-
function
|
|
450
|
-
let { t:
|
|
451
|
-
let t =
|
|
409
|
+
function he({ value: e, onChange: n }) {
|
|
410
|
+
let { t: a } = t(), o = R(null), [s, c] = z(!1), l = Math.max(0, Math.min(1, e)), u = (e) => {
|
|
411
|
+
let t = o.current;
|
|
452
412
|
if (!t) return 0;
|
|
453
|
-
let n = t.getBoundingClientRect(),
|
|
454
|
-
return
|
|
455
|
-
},
|
|
456
|
-
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId),
|
|
457
|
-
},
|
|
458
|
-
|
|
459
|
-
},
|
|
460
|
-
|
|
413
|
+
let n = t.getBoundingClientRect(), r = n.width - 12;
|
|
414
|
+
return r <= 0 ? 0 : Math.max(0, Math.min(1, (e - n.left - 6) / r));
|
|
415
|
+
}, d = (e) => {
|
|
416
|
+
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), c(!0), n(u(e.clientX));
|
|
417
|
+
}, f = (e) => {
|
|
418
|
+
s && n(u(e.clientX));
|
|
419
|
+
}, p = (e) => {
|
|
420
|
+
s && (c(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
461
421
|
};
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
-
ref:
|
|
464
|
-
className:
|
|
422
|
+
return /* @__PURE__ */ V("div", {
|
|
423
|
+
ref: o,
|
|
424
|
+
className: r("relative flex h-4 w-[60px] items-center rounded-sm", "cursor-pointer touch-none", i()),
|
|
465
425
|
role: "slider",
|
|
466
426
|
tabIndex: 0,
|
|
467
|
-
"aria-label":
|
|
427
|
+
"aria-label": a("videoPlayer.volume"),
|
|
468
428
|
"aria-valuemin": 0,
|
|
469
429
|
"aria-valuemax": 1,
|
|
470
|
-
"aria-valuenow": Number(
|
|
471
|
-
"aria-valuetext": `${Math.round(
|
|
472
|
-
onPointerDown:
|
|
473
|
-
onPointerMove:
|
|
474
|
-
onPointerUp:
|
|
475
|
-
onPointerCancel:
|
|
476
|
-
onLostPointerCapture: () =>
|
|
430
|
+
"aria-valuenow": Number(l.toFixed(2)),
|
|
431
|
+
"aria-valuetext": `${Math.round(l * 100)}%`,
|
|
432
|
+
onPointerDown: d,
|
|
433
|
+
onPointerMove: f,
|
|
434
|
+
onPointerUp: p,
|
|
435
|
+
onPointerCancel: p,
|
|
436
|
+
onLostPointerCapture: () => c(!1),
|
|
477
437
|
onKeyDown: (e) => {
|
|
478
|
-
let
|
|
438
|
+
let t = null;
|
|
479
439
|
switch (e.key) {
|
|
480
440
|
case "ArrowRight":
|
|
481
441
|
case "ArrowUp":
|
|
482
|
-
|
|
442
|
+
t = Math.min(1, l + U);
|
|
483
443
|
break;
|
|
484
444
|
case "ArrowLeft":
|
|
485
445
|
case "ArrowDown":
|
|
486
|
-
|
|
446
|
+
t = Math.max(0, l - U);
|
|
487
447
|
break;
|
|
488
448
|
case "Home":
|
|
489
|
-
|
|
449
|
+
t = 0;
|
|
490
450
|
break;
|
|
491
451
|
case "End":
|
|
492
|
-
|
|
452
|
+
t = 1;
|
|
493
453
|
break;
|
|
494
454
|
default: return;
|
|
495
455
|
}
|
|
496
|
-
e.preventDefault(), e.stopPropagation(), t
|
|
456
|
+
e.preventDefault(), e.stopPropagation(), n(t);
|
|
497
457
|
},
|
|
498
458
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ B("div", { className: "absolute inset-x-0 h-1 rounded-sm bg-f1-foreground/30" }),
|
|
460
|
+
/* @__PURE__ */ B("div", {
|
|
501
461
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
502
|
-
style: { width: `calc(12px + (100% - 12px) * ${
|
|
462
|
+
style: { width: `calc(12px + (100% - 12px) * ${l})` }
|
|
503
463
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ B("div", {
|
|
505
465
|
className: "pointer-events-none absolute h-3 w-3 -translate-x-1/2 rounded-full bg-f1-foreground shadow-[0_0_4px_rgba(0,0,0,0.4)]",
|
|
506
|
-
style: { left: `calc(6px + (100% - 12px) * ${
|
|
466
|
+
style: { left: `calc(6px + (100% - 12px) * ${l})` }
|
|
507
467
|
})
|
|
508
468
|
]
|
|
509
469
|
});
|
|
510
470
|
}
|
|
511
471
|
//#endregion
|
|
512
472
|
//#region src/blocks/F0VideoPlayer/components/Controls.tsx
|
|
513
|
-
function
|
|
514
|
-
let { t:
|
|
515
|
-
audioLanguages:
|
|
516
|
-
captionLanguages:
|
|
517
|
-
audioDescriptionLanguages:
|
|
473
|
+
function ge({ isPlaying: e, currentTime: n, duration: i, volume: s, isMuted: u, playbackRate: f, isFullscreen: m, markerTime: h, blockSeekPastMarker: g, containerRef: _, captionsAvailable: v, captionsOn: y, audioDescriptionAvailable: b, audioDescriptionOn: x, silent: S, persist: C, audioLanguages: ee, audioLanguage: w, onAudioLanguageChange: T, captionLanguages: E, captionLanguage: D, onCaptionLanguageChange: te, onCaptionsOff: O, audioDescriptionLanguages: k, audioDescriptionLanguage: A, onAudioDescriptionLanguageChange: j, onAudioDescriptionOff: M, onTogglePlay: ne, onToggleMute: N, onVolumeChange: P, onPlaybackRateChange: F, onToggleFullscreen: I, onToggleCaptions: L, onToggleAudioDescription: R, onSeek: z, download: H }) {
|
|
474
|
+
let { t: U } = t(), re = v && E.length <= 1, W = b && k.length <= 1, G = fe({
|
|
475
|
+
audioLanguages: ee.length,
|
|
476
|
+
captionLanguages: E.length,
|
|
477
|
+
audioDescriptionLanguages: k.length
|
|
518
478
|
});
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
-
className:
|
|
479
|
+
return /* @__PURE__ */ V("div", {
|
|
480
|
+
className: r("dark absolute inset-x-0 bottom-0 z-[2] flex select-none items-center gap-2", "rounded-b-[inherit] bg-gradient-to-t from-[#000000f2] via-[#000000b3] to-transparent px-3 py-3", "[text-shadow:0_1px_2px_rgba(0,0,0,0.55)] [&_svg]:drop-shadow-[0_1px_2px_rgba(0,0,0,0.55)]", "transition-opacity duration-200 motion-reduce:transition-none", !e || C ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),
|
|
521
481
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ B(a, {
|
|
523
483
|
variant: "ghost",
|
|
524
484
|
size: "sm",
|
|
525
485
|
hideLabel: !0,
|
|
526
|
-
icon: e ?
|
|
527
|
-
label:
|
|
528
|
-
onClick:
|
|
486
|
+
icon: e ? d : p,
|
|
487
|
+
label: U(e ? "videoPlayer.pause" : "videoPlayer.play"),
|
|
488
|
+
onClick: ne
|
|
529
489
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
currentTime:
|
|
532
|
-
duration:
|
|
533
|
-
markerTime:
|
|
534
|
-
blockSeekPastMarker:
|
|
535
|
-
onSeek:
|
|
490
|
+
/* @__PURE__ */ B(oe, {
|
|
491
|
+
currentTime: n,
|
|
492
|
+
duration: i,
|
|
493
|
+
markerTime: h,
|
|
494
|
+
blockSeekPastMarker: g,
|
|
495
|
+
onSeek: z
|
|
536
496
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ V("span", {
|
|
538
498
|
className: "min-w-[80px] whitespace-nowrap text-center text-base font-medium tabular-nums text-f1-foreground",
|
|
539
499
|
children: [
|
|
540
|
-
|
|
500
|
+
K(n),
|
|
541
501
|
" / ",
|
|
542
|
-
|
|
502
|
+
K(i)
|
|
543
503
|
]
|
|
544
504
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
volume:
|
|
547
|
-
isMuted:
|
|
548
|
-
onToggleMute:
|
|
549
|
-
onVolumeChange:
|
|
550
|
-
silent:
|
|
505
|
+
/* @__PURE__ */ B(me, {
|
|
506
|
+
volume: s,
|
|
507
|
+
isMuted: u,
|
|
508
|
+
onToggleMute: N,
|
|
509
|
+
onVolumeChange: P,
|
|
510
|
+
silent: S
|
|
551
511
|
}),
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
value:
|
|
554
|
-
onChange:
|
|
555
|
-
containerRef:
|
|
512
|
+
/* @__PURE__ */ B(ae, {
|
|
513
|
+
value: f,
|
|
514
|
+
onChange: F,
|
|
515
|
+
containerRef: _
|
|
556
516
|
}),
|
|
557
|
-
|
|
517
|
+
re ? /* @__PURE__ */ B(a, {
|
|
558
518
|
variant: "ghost",
|
|
559
519
|
size: "sm",
|
|
560
520
|
hideLabel: !0,
|
|
561
|
-
icon:
|
|
562
|
-
label:
|
|
563
|
-
"aria-pressed":
|
|
564
|
-
onClick:
|
|
521
|
+
icon: y ? ie : Q,
|
|
522
|
+
label: U("videoPlayer.captions"),
|
|
523
|
+
"aria-pressed": y,
|
|
524
|
+
onClick: L
|
|
565
525
|
}) : null,
|
|
566
|
-
W ? /* @__PURE__ */
|
|
526
|
+
W ? /* @__PURE__ */ B(a, {
|
|
567
527
|
variant: "ghost",
|
|
568
528
|
size: "sm",
|
|
569
529
|
hideLabel: !0,
|
|
570
|
-
icon:
|
|
571
|
-
label:
|
|
572
|
-
"aria-pressed":
|
|
573
|
-
onClick:
|
|
530
|
+
icon: x ? Z : X,
|
|
531
|
+
label: U("videoPlayer.audioDescription"),
|
|
532
|
+
"aria-pressed": x,
|
|
533
|
+
onClick: R
|
|
574
534
|
}) : null,
|
|
575
|
-
G ? /* @__PURE__ */
|
|
576
|
-
containerRef:
|
|
577
|
-
audioLanguages:
|
|
578
|
-
audioLanguage:
|
|
579
|
-
onAudioLanguageChange:
|
|
580
|
-
captionLanguages:
|
|
581
|
-
captionLanguage:
|
|
582
|
-
captionsOn:
|
|
583
|
-
onCaptionLanguageChange:
|
|
584
|
-
onCaptionsOff:
|
|
585
|
-
audioDescriptionLanguages:
|
|
586
|
-
audioDescriptionLanguage:
|
|
587
|
-
audioDescriptionOn:
|
|
588
|
-
onAudioDescriptionLanguageChange:
|
|
589
|
-
onAudioDescriptionOff:
|
|
535
|
+
G ? /* @__PURE__ */ B(de, {
|
|
536
|
+
containerRef: _,
|
|
537
|
+
audioLanguages: ee,
|
|
538
|
+
audioLanguage: w,
|
|
539
|
+
onAudioLanguageChange: T,
|
|
540
|
+
captionLanguages: E,
|
|
541
|
+
captionLanguage: D,
|
|
542
|
+
captionsOn: y,
|
|
543
|
+
onCaptionLanguageChange: te,
|
|
544
|
+
onCaptionsOff: O,
|
|
545
|
+
audioDescriptionLanguages: k,
|
|
546
|
+
audioDescriptionLanguage: A,
|
|
547
|
+
audioDescriptionOn: x,
|
|
548
|
+
onAudioDescriptionLanguageChange: j,
|
|
549
|
+
onAudioDescriptionOff: M
|
|
590
550
|
}) : null,
|
|
591
|
-
|
|
551
|
+
H ? /* @__PURE__ */ B(a, {
|
|
592
552
|
variant: "ghost",
|
|
593
553
|
size: "sm",
|
|
594
554
|
hideLabel: !0,
|
|
595
|
-
icon:
|
|
596
|
-
label:
|
|
597
|
-
onClick:
|
|
555
|
+
icon: l,
|
|
556
|
+
label: H.label,
|
|
557
|
+
onClick: H.onClick
|
|
598
558
|
}) : null,
|
|
599
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ B(a, {
|
|
600
560
|
variant: "ghost",
|
|
601
561
|
size: "sm",
|
|
602
562
|
hideLabel: !0,
|
|
603
|
-
icon:
|
|
604
|
-
label:
|
|
605
|
-
onClick:
|
|
563
|
+
icon: m ? c : o,
|
|
564
|
+
label: U(m ? "videoPlayer.exitFullscreen" : "videoPlayer.enterFullscreen"),
|
|
565
|
+
onClick: I
|
|
606
566
|
})
|
|
607
567
|
]
|
|
608
568
|
});
|
|
609
569
|
}
|
|
610
570
|
//#endregion
|
|
611
571
|
//#region src/blocks/F0VideoPlayer/hooks/useVttSource.ts
|
|
612
|
-
var
|
|
613
|
-
function
|
|
614
|
-
let t = e !== void 0 &&
|
|
615
|
-
return
|
|
616
|
-
if (e === void 0 || !
|
|
572
|
+
var _e = (e) => e.trimStart().startsWith("WEBVTT");
|
|
573
|
+
function ve(e) {
|
|
574
|
+
let t = e !== void 0 && _e(e), [n, r] = z();
|
|
575
|
+
return F(() => {
|
|
576
|
+
if (e === void 0 || !_e(e)) {
|
|
617
577
|
r(void 0);
|
|
618
578
|
return;
|
|
619
579
|
}
|
|
@@ -626,10 +586,10 @@ function ye(e) {
|
|
|
626
586
|
}
|
|
627
587
|
//#endregion
|
|
628
588
|
//#region src/blocks/F0VideoPlayer/hooks/useAudioDescription.ts
|
|
629
|
-
var
|
|
630
|
-
function
|
|
631
|
-
let i = n !== void 0, { trackSrc: a, needsCrossOrigin: o } =
|
|
632
|
-
return
|
|
589
|
+
var ye = "descriptions";
|
|
590
|
+
function be(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
591
|
+
let i = n !== void 0, { trackSrc: a, needsCrossOrigin: o } = ve(r), [s, c] = z(!1), l = i || r !== void 0 || s, [u, d] = z(), f = R(!1);
|
|
592
|
+
return F(() => {
|
|
633
593
|
if (!e) return;
|
|
634
594
|
let n = e.textTracks, a = typeof window < "u" && "speechSynthesis" in window, o = t && !i && a, s = () => {
|
|
635
595
|
f.current && (f.current = !1, e.play().catch(() => {}));
|
|
@@ -638,7 +598,7 @@ function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
638
598
|
let t = new SpeechSynthesisUtterance(e);
|
|
639
599
|
t.onend = s, t.onerror = s, window.speechSynthesis.speak(t);
|
|
640
600
|
}, u = /* @__PURE__ */ new WeakSet(), p = [], m = (t) => {
|
|
641
|
-
if (t.kind !==
|
|
601
|
+
if (t.kind !== ye || (t.mode = "hidden", u.has(t)) || typeof t.addEventListener != "function") return;
|
|
642
602
|
u.add(t);
|
|
643
603
|
let n = () => {
|
|
644
604
|
let n = t.activeCues?.[0]?.text || void 0;
|
|
@@ -647,7 +607,7 @@ function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
647
607
|
t.addEventListener("cuechange", n), p.push(() => t.removeEventListener("cuechange", n));
|
|
648
608
|
}, h = () => {
|
|
649
609
|
let e = !1;
|
|
650
|
-
for (let t of Array.from(n)) t.kind ===
|
|
610
|
+
for (let t of Array.from(n)) t.kind === ye && (r === void 0 && (e = !0), m(t));
|
|
651
611
|
c(e);
|
|
652
612
|
};
|
|
653
613
|
h();
|
|
@@ -661,7 +621,7 @@ function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
661
621
|
i,
|
|
662
622
|
r,
|
|
663
623
|
a
|
|
664
|
-
]),
|
|
624
|
+
]), L(() => ({
|
|
665
625
|
trackSrc: a,
|
|
666
626
|
needsCrossOrigin: o,
|
|
667
627
|
available: l,
|
|
@@ -675,8 +635,8 @@ function xe(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
675
635
|
}
|
|
676
636
|
//#endregion
|
|
677
637
|
//#region src/blocks/F0VideoPlayer/hooks/useKeyboardShortcuts.ts
|
|
678
|
-
function
|
|
679
|
-
return
|
|
638
|
+
function xe({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscreen: i, setVolume: a }) {
|
|
639
|
+
return P((o) => {
|
|
680
640
|
let s = o.target;
|
|
681
641
|
if (s instanceof HTMLElement && (s.closest("button, a, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]") || s.closest("[role=\"menu\"], [role^=\"menuitem\"]") || s.getAttribute("role") === "slider")) return;
|
|
682
642
|
let c = e.current;
|
|
@@ -718,13 +678,13 @@ function Se({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscre
|
|
|
718
678
|
}
|
|
719
679
|
//#endregion
|
|
720
680
|
//#region src/blocks/F0VideoPlayer/hooks/useRestrictForwardSeek.ts
|
|
721
|
-
function
|
|
722
|
-
let r =
|
|
681
|
+
function Se({ video: e, enabled: t, resetKey: n }) {
|
|
682
|
+
let r = R(0), i = R(0), a = R(t);
|
|
723
683
|
a.current = t;
|
|
724
|
-
let [o, s] =
|
|
725
|
-
return
|
|
684
|
+
let [o, s] = z(0);
|
|
685
|
+
return F(() => {
|
|
726
686
|
r.current = 0, i.current = 0, s(0);
|
|
727
|
-
}, [n]),
|
|
687
|
+
}, [n]), F(() => {
|
|
728
688
|
if (!e) return;
|
|
729
689
|
let t = () => {
|
|
730
690
|
a.current && e.currentTime > r.current + .25 && (e.currentTime = r.current);
|
|
@@ -746,24 +706,24 @@ function Ce({ video: e, enabled: t, resetKey: n }) {
|
|
|
746
706
|
};
|
|
747
707
|
}, [e]), {
|
|
748
708
|
maxWatchedTime: o,
|
|
749
|
-
clampSeek:
|
|
709
|
+
clampSeek: P((e) => a.current ? Math.min(e, r.current) : e, [])
|
|
750
710
|
};
|
|
751
711
|
}
|
|
752
712
|
//#endregion
|
|
753
713
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoCaptions.ts
|
|
754
|
-
var
|
|
755
|
-
function
|
|
756
|
-
let { trackSrc: n, needsCrossOrigin: r } =
|
|
757
|
-
return
|
|
714
|
+
var Ce = /* @__PURE__ */ new Set(["captions", "subtitles"]), we = 2, Te = 3;
|
|
715
|
+
function Ee(e, t) {
|
|
716
|
+
let { trackSrc: n, needsCrossOrigin: r } = ve(t), [i, a] = z(!1), [o, s] = z(!1), [c, l] = z(!1), u = o || t !== void 0 && !c;
|
|
717
|
+
return F(() => {
|
|
758
718
|
l(!1), s(!1);
|
|
759
|
-
}, [n]),
|
|
719
|
+
}, [n]), F(() => {
|
|
760
720
|
if (!e) return;
|
|
761
721
|
let t = e.textTracks, n = e.querySelector("track[kind=\"captions\"]"), r = () => {
|
|
762
722
|
let e = !1;
|
|
763
|
-
for (let n of Array.from(t))
|
|
723
|
+
for (let n of Array.from(t)) Ce.has(n.kind) && (n.mode = i ? "showing" : "hidden", n.cues && n.cues.length > 0 && (e = !0));
|
|
764
724
|
if (s(e), n) {
|
|
765
|
-
if (n.readyState ===
|
|
766
|
-
else if (n.readyState ===
|
|
725
|
+
if (n.readyState === Te) l(!0);
|
|
726
|
+
else if (n.readyState === we) {
|
|
767
727
|
let e = n.track?.cues;
|
|
768
728
|
l(!e || e.length === 0);
|
|
769
729
|
}
|
|
@@ -778,7 +738,7 @@ function De(e, t) {
|
|
|
778
738
|
});
|
|
779
739
|
}
|
|
780
740
|
for (let e of Array.from(t)) {
|
|
781
|
-
if (!
|
|
741
|
+
if (!Ce.has(e.kind) || typeof e.addEventListener != "function") continue;
|
|
782
742
|
let t = () => r();
|
|
783
743
|
e.addEventListener("cuechange", t), a.push(() => e.removeEventListener("cuechange", t));
|
|
784
744
|
}
|
|
@@ -791,7 +751,7 @@ function De(e, t) {
|
|
|
791
751
|
t,
|
|
792
752
|
i,
|
|
793
753
|
n
|
|
794
|
-
]),
|
|
754
|
+
]), L(() => ({
|
|
795
755
|
trackSrc: n,
|
|
796
756
|
needsCrossOrigin: r,
|
|
797
757
|
available: u,
|
|
@@ -806,19 +766,19 @@ function De(e, t) {
|
|
|
806
766
|
}
|
|
807
767
|
//#endregion
|
|
808
768
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoCompletion.ts
|
|
809
|
-
function
|
|
810
|
-
return e - Math.min(10, e *
|
|
769
|
+
function De(e) {
|
|
770
|
+
return e - Math.min(10, e * G);
|
|
811
771
|
}
|
|
812
|
-
function
|
|
813
|
-
let r =
|
|
772
|
+
function Oe({ video: e, onComplete: t, resetKey: n }) {
|
|
773
|
+
let r = R(t);
|
|
814
774
|
r.current = t;
|
|
815
|
-
let i =
|
|
816
|
-
|
|
775
|
+
let i = R(!1), a = !!t;
|
|
776
|
+
F(() => {
|
|
817
777
|
i.current = !1;
|
|
818
|
-
}, [n]),
|
|
778
|
+
}, [n]), F(() => {
|
|
819
779
|
if (!e || !a) return;
|
|
820
780
|
let t = () => {
|
|
821
|
-
!i.current && e.duration && e.currentTime >=
|
|
781
|
+
!i.current && e.duration && e.currentTime >= De(e.duration) && (i.current = !0, r.current?.(e));
|
|
822
782
|
};
|
|
823
783
|
return e.addEventListener("timeupdate", t), e.addEventListener("ended", t), () => {
|
|
824
784
|
e.removeEventListener("timeupdate", t), e.removeEventListener("ended", t);
|
|
@@ -827,18 +787,18 @@ function ke({ video: e, onComplete: t, resetKey: n }) {
|
|
|
827
787
|
}
|
|
828
788
|
//#endregion
|
|
829
789
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoMilestones.ts
|
|
830
|
-
function
|
|
831
|
-
let r =
|
|
790
|
+
function ke({ video: e, onMilestone: t, resetKey: n }) {
|
|
791
|
+
let r = R(t);
|
|
832
792
|
r.current = t;
|
|
833
|
-
let i =
|
|
834
|
-
|
|
793
|
+
let i = R(/* @__PURE__ */ new Set()), a = !!t;
|
|
794
|
+
F(() => {
|
|
835
795
|
i.current.clear();
|
|
836
|
-
}, [n]),
|
|
796
|
+
}, [n]), F(() => {
|
|
837
797
|
if (!e || !a) return;
|
|
838
798
|
let t = () => {
|
|
839
799
|
if (!e.duration) return;
|
|
840
800
|
let t = Math.round(e.currentTime / e.duration * 100);
|
|
841
|
-
for (let n of
|
|
801
|
+
for (let n of re) i.current.has(n) || t >= n && (i.current.add(n), r.current?.(n, e));
|
|
842
802
|
};
|
|
843
803
|
return e.addEventListener("timeupdate", t), () => {
|
|
844
804
|
e.removeEventListener("timeupdate", t);
|
|
@@ -847,19 +807,19 @@ function Ae({ video: e, onMilestone: t, resetKey: n }) {
|
|
|
847
807
|
}
|
|
848
808
|
//#endregion
|
|
849
809
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoState.ts
|
|
850
|
-
function
|
|
851
|
-
let t =
|
|
810
|
+
function Ae(e) {
|
|
811
|
+
let t = R(null), [n, r] = z(null), i = R(0), a = P((e) => {
|
|
852
812
|
t.current = e, r(e);
|
|
853
|
-
}, []), [o, s] =
|
|
854
|
-
return
|
|
813
|
+
}, []), [o, s] = z(!1), [c, l] = z(!1), [u, d] = z(0), [f, p] = z(0), [m, h] = z(1), [g, _] = z(!1), [v, y] = z(1);
|
|
814
|
+
return F(() => {
|
|
855
815
|
i.current = 0, t.current && (t.current.playbackRate = 1), s(!1), l(!1), d(0), p(0), y(1);
|
|
856
|
-
}, [e]),
|
|
816
|
+
}, [e]), F(() => {
|
|
857
817
|
let e = n;
|
|
858
818
|
if (!e) return;
|
|
859
819
|
let t = () => l(!0), r = () => l(!1), a = () => l(!1), o = () => {
|
|
860
820
|
h(e.volume), _(e.muted);
|
|
861
821
|
}, s = () => p(e.duration || 0), c = () => {
|
|
862
|
-
|
|
822
|
+
J(e.playbackRate) && y(e.playbackRate);
|
|
863
823
|
}, u = () => {
|
|
864
824
|
let t = performance.now();
|
|
865
825
|
t - i.current >= 250 && (i.current = t, d(e.currentTime));
|
|
@@ -879,25 +839,25 @@ function je(e) {
|
|
|
879
839
|
isMuted: g,
|
|
880
840
|
playbackRate: v,
|
|
881
841
|
setVideoLoaded: s,
|
|
882
|
-
togglePlay:
|
|
842
|
+
togglePlay: P(() => {
|
|
883
843
|
let e = t.current;
|
|
884
844
|
e && (e.paused || e.ended ? e.play().catch(() => {}) : e.pause());
|
|
885
845
|
}, []),
|
|
886
|
-
toggleMute:
|
|
846
|
+
toggleMute: P(() => {
|
|
887
847
|
let e = t.current;
|
|
888
848
|
e && (e.muted = !e.muted);
|
|
889
849
|
}, []),
|
|
890
|
-
setVolume:
|
|
850
|
+
setVolume: P((e) => {
|
|
891
851
|
let n = t.current;
|
|
892
852
|
if (!n) return;
|
|
893
853
|
let r = Math.max(0, Math.min(1, e));
|
|
894
854
|
n.volume = r, n.muted = r === 0;
|
|
895
855
|
}, []),
|
|
896
|
-
setPlaybackRate:
|
|
856
|
+
setPlaybackRate: P((e) => {
|
|
897
857
|
let n = t.current;
|
|
898
858
|
n && (n.playbackRate = e);
|
|
899
859
|
}, []),
|
|
900
|
-
seekTo:
|
|
860
|
+
seekTo: P((e) => {
|
|
901
861
|
let n = t.current;
|
|
902
862
|
if (!n) return;
|
|
903
863
|
let r = Math.max(0, Math.min(e, n.duration || e));
|
|
@@ -907,18 +867,18 @@ function je(e) {
|
|
|
907
867
|
}
|
|
908
868
|
//#endregion
|
|
909
869
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoTracking.ts
|
|
910
|
-
function
|
|
911
|
-
let n =
|
|
870
|
+
function je({ video: e, onTrackAction: t }) {
|
|
871
|
+
let n = R(t);
|
|
912
872
|
n.current = t;
|
|
913
873
|
let r = !!t;
|
|
914
|
-
|
|
874
|
+
F(() => {
|
|
915
875
|
if (!e || !r) return;
|
|
916
876
|
let t = null, i = () => {
|
|
917
877
|
t &&= (clearInterval(t), null);
|
|
918
878
|
}, a = () => {
|
|
919
879
|
n.current?.(), i(), t = setInterval(() => {
|
|
920
880
|
n.current?.();
|
|
921
|
-
},
|
|
881
|
+
}, W);
|
|
922
882
|
}, o = () => {
|
|
923
883
|
n.current?.(), i();
|
|
924
884
|
}, s = () => i();
|
|
@@ -929,143 +889,143 @@ function Me({ video: e, onTrackAction: t }) {
|
|
|
929
889
|
}
|
|
930
890
|
//#endregion
|
|
931
891
|
//#region src/blocks/F0VideoPlayer/internal.tsx
|
|
932
|
-
function
|
|
933
|
-
let { t:
|
|
892
|
+
function Me({ src: e, poster: n, ariaLabel: a, silent: o = !1, persistControls: s = !1, content: c, defaultLanguage: l, autoPlay: u = !1, autoFocus: d = !1, download: f, restrictForwardSeek: m = !1, onTrackAction: h, onMilestone: g, onComplete: v, ...y }) {
|
|
893
|
+
let { t: b } = t(), x = R(null), S = L(() => M(e), [e]), [C, ee] = z(() => A(S, l)), w = S.some((e) => e.locale === C) ? C : A(S, l), T = k(e, w) ?? "", E = L(() => M(c?.captions), [c?.captions]), [D, te] = z(() => A(E, l)), O = E.some((e) => e.locale === D) ? D : A(E, l), j = k(c?.captions, O), N = L(() => M(c?.descriptions, c?.describedSrc), [c?.descriptions, c?.describedSrc]), [I, H] = z(() => A(N, l)), U = N.some((e) => e.locale === I) ? I : A(N, l), re = k(c?.descriptions, U), W = k(c?.describedSrc, U), [G, K] = z(!1), q = G && W ? W : T, J = Ae(q), Y = Ee(J.videoElement, j), X = be(J.videoElement, {
|
|
934
894
|
enabled: G,
|
|
935
895
|
describedSrc: W,
|
|
936
|
-
descriptions:
|
|
937
|
-
}), Z =
|
|
896
|
+
descriptions: re
|
|
897
|
+
}), Z = P(() => {
|
|
938
898
|
let e = J.videoRef.current;
|
|
939
899
|
if (!e) return;
|
|
940
900
|
let t = e.currentTime, n = !e.paused, r = () => {
|
|
941
901
|
e.currentTime = t, n && e.play().catch(() => {}), e.removeEventListener("loadedmetadata", r);
|
|
942
902
|
};
|
|
943
903
|
e.addEventListener("loadedmetadata", r);
|
|
944
|
-
}, [J.videoRef]),
|
|
945
|
-
Z(),
|
|
946
|
-
}, [Z]),
|
|
904
|
+
}, [J.videoRef]), Q = P((e) => {
|
|
905
|
+
Z(), ee(e);
|
|
906
|
+
}, [Z]), ie = P(() => {
|
|
947
907
|
W && Z(), K((e) => !e);
|
|
948
|
-
}, [W, Z]), ae =
|
|
949
|
-
|
|
950
|
-
}, [Y]), oe =
|
|
908
|
+
}, [W, Z]), ae = P((e) => {
|
|
909
|
+
te(e), Y.showing || Y.toggle();
|
|
910
|
+
}, [Y]), oe = P(() => {
|
|
951
911
|
Y.showing && Y.toggle();
|
|
952
|
-
}, [Y]), se =
|
|
953
|
-
W && Z(),
|
|
954
|
-
}, [W, Z]),
|
|
912
|
+
}, [Y]), se = P((e) => {
|
|
913
|
+
W && Z(), H(e), K(!0);
|
|
914
|
+
}, [W, Z]), ce = P(() => {
|
|
955
915
|
W && Z(), K(!1);
|
|
956
916
|
}, [W, Z]);
|
|
957
|
-
|
|
958
|
-
video: J.videoElement,
|
|
959
|
-
onTrackAction: d
|
|
960
|
-
}), Ae({
|
|
917
|
+
je({
|
|
961
918
|
video: J.videoElement,
|
|
962
|
-
|
|
963
|
-
resetKey: w
|
|
919
|
+
onTrackAction: h
|
|
964
920
|
}), ke({
|
|
965
921
|
video: J.videoElement,
|
|
966
|
-
|
|
967
|
-
resetKey:
|
|
922
|
+
onMilestone: g,
|
|
923
|
+
resetKey: T
|
|
924
|
+
}), Oe({
|
|
925
|
+
video: J.videoElement,
|
|
926
|
+
onComplete: v,
|
|
927
|
+
resetKey: T
|
|
968
928
|
});
|
|
969
|
-
let { maxWatchedTime:
|
|
929
|
+
let { maxWatchedTime: le, clampSeek: ue } = Se({
|
|
970
930
|
video: J.videoElement,
|
|
971
|
-
enabled:
|
|
972
|
-
resetKey:
|
|
973
|
-
}),
|
|
974
|
-
|
|
931
|
+
enabled: m,
|
|
932
|
+
resetKey: T
|
|
933
|
+
}), $ = P((e) => J.seekTo(ue(e)), [J, ue]), { isFullscreen: de, toggleFullscreen: fe } = ne({ targetRef: x }), pe = P(() => {}, []), me = !!(G && W);
|
|
934
|
+
F(() => {
|
|
975
935
|
let e = J.videoRef.current;
|
|
976
|
-
|
|
936
|
+
o && e && (e.muted = !me);
|
|
977
937
|
}, [
|
|
978
|
-
|
|
938
|
+
o,
|
|
979
939
|
me,
|
|
980
940
|
J.videoElement,
|
|
981
941
|
J.videoRef
|
|
982
942
|
]);
|
|
983
|
-
let he =
|
|
943
|
+
let he = xe({
|
|
984
944
|
videoRef: J.videoRef,
|
|
985
|
-
seek:
|
|
945
|
+
seek: $,
|
|
986
946
|
togglePlay: J.togglePlay,
|
|
987
|
-
toggleMute:
|
|
947
|
+
toggleMute: o ? pe : J.toggleMute,
|
|
988
948
|
toggleFullscreen: fe,
|
|
989
|
-
setVolume:
|
|
949
|
+
setVolume: o ? pe : J.setVolume
|
|
990
950
|
});
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
}, [
|
|
994
|
-
let
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
-
ref:
|
|
997
|
-
className:
|
|
951
|
+
F(() => {
|
|
952
|
+
d && x.current?.focus({ preventScroll: !0 });
|
|
953
|
+
}, [d]);
|
|
954
|
+
let _e = (e) => e.preventDefault();
|
|
955
|
+
return /* @__PURE__ */ V("div", {
|
|
956
|
+
ref: x,
|
|
957
|
+
className: r("group relative h-full w-full overflow-hidden rounded-[inherit] bg-f1-foreground dark:bg-f1-background", "[&:fullscreen]:h-screen [&:fullscreen]:w-screen [&:fullscreen]:rounded-none", i()),
|
|
998
958
|
role: "region",
|
|
999
|
-
"aria-label":
|
|
959
|
+
"aria-label": a ?? b("videoPlayer.regionLabel"),
|
|
1000
960
|
tabIndex: 0,
|
|
1001
961
|
onKeyDown: he,
|
|
1002
|
-
"data-video-captions":
|
|
1003
|
-
...
|
|
962
|
+
"data-video-captions": o ? "no-audio" : Y.available ? "available" : "missing",
|
|
963
|
+
...y,
|
|
1004
964
|
children: [
|
|
1005
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ V("video", {
|
|
1006
966
|
ref: J.setVideoNode,
|
|
1007
|
-
autoPlay:
|
|
967
|
+
autoPlay: u,
|
|
1008
968
|
playsInline: !0,
|
|
1009
969
|
disablePictureInPicture: !0,
|
|
1010
970
|
disableRemotePlayback: !0,
|
|
1011
971
|
draggable: !1,
|
|
1012
|
-
onContextMenu:
|
|
972
|
+
onContextMenu: _e,
|
|
1013
973
|
onClick: J.togglePlay,
|
|
1014
974
|
src: q,
|
|
1015
|
-
poster:
|
|
975
|
+
poster: n,
|
|
1016
976
|
crossOrigin: Y.needsCrossOrigin || X.needsCrossOrigin ? "anonymous" : void 0,
|
|
1017
977
|
onLoadedData: () => J.setVideoLoaded(!0),
|
|
1018
|
-
className:
|
|
1019
|
-
style: { opacity: J.videoLoaded ||
|
|
1020
|
-
children: [Y.trackSrc ? /* @__PURE__ */
|
|
978
|
+
className: r("block h-full w-full cursor-pointer rounded-[inherit] object-contain transition-opacity duration-300", "[&::-webkit-media-text-track-container]:![transform:translateY(-3.5rem)]"),
|
|
979
|
+
style: { opacity: J.videoLoaded || n ? 1 : 0 },
|
|
980
|
+
children: [Y.trackSrc ? /* @__PURE__ */ B("track", {
|
|
1021
981
|
kind: "captions",
|
|
1022
982
|
src: Y.trackSrc,
|
|
1023
|
-
label:
|
|
983
|
+
label: b("videoPlayer.captions"),
|
|
1024
984
|
default: !1
|
|
1025
|
-
}) : null, X.trackSrc ? /* @__PURE__ */
|
|
985
|
+
}) : null, X.trackSrc ? /* @__PURE__ */ B("track", {
|
|
1026
986
|
kind: "descriptions",
|
|
1027
987
|
src: X.trackSrc,
|
|
1028
|
-
label:
|
|
988
|
+
label: b("videoPlayer.audioDescription"),
|
|
1029
989
|
default: !1
|
|
1030
990
|
}) : null]
|
|
1031
991
|
}),
|
|
1032
|
-
J.isPlaying ? null : /* @__PURE__ */
|
|
992
|
+
J.isPlaying ? null : /* @__PURE__ */ B("div", {
|
|
1033
993
|
"aria-hidden": !0,
|
|
1034
994
|
"data-video-play-overlay": !0,
|
|
1035
995
|
className: "pointer-events-none absolute inset-0 z-[1] flex items-center justify-center",
|
|
1036
|
-
children: /* @__PURE__ */
|
|
996
|
+
children: /* @__PURE__ */ B("button", {
|
|
1037
997
|
type: "button",
|
|
1038
998
|
tabIndex: -1,
|
|
1039
999
|
onClick: J.togglePlay,
|
|
1040
1000
|
className: "pointer-events-auto flex size-14 items-center justify-center rounded-full bg-f1-foreground/70 pl-0.5 shadow-[0_2px_8px_rgba(0,0,0,0.45)] transition-transform duration-150 hover:scale-105 motion-reduce:transition-none dark:bg-f1-background/70 [&_svg]:size-7",
|
|
1041
|
-
children: /* @__PURE__ */
|
|
1042
|
-
icon:
|
|
1001
|
+
children: /* @__PURE__ */ B(_, {
|
|
1002
|
+
icon: p,
|
|
1043
1003
|
size: "lg",
|
|
1044
1004
|
color: "#fff"
|
|
1045
1005
|
})
|
|
1046
1006
|
})
|
|
1047
1007
|
}),
|
|
1048
|
-
Y.showing && X.activeCue ? /* @__PURE__ */
|
|
1008
|
+
Y.showing && X.activeCue ? /* @__PURE__ */ B("div", {
|
|
1049
1009
|
"aria-hidden": !0,
|
|
1050
1010
|
className: "dark pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-center p-3",
|
|
1051
|
-
children: /* @__PURE__ */
|
|
1011
|
+
children: /* @__PURE__ */ V("p", {
|
|
1052
1012
|
className: "max-w-[90%] rounded-md bg-f1-background/70 px-2 py-1 text-center text-base italic text-f1-foreground [text-shadow:0_1px_2px_rgba(0,0,0,0.55)]",
|
|
1053
|
-
children: [/* @__PURE__ */
|
|
1013
|
+
children: [/* @__PURE__ */ V("span", {
|
|
1054
1014
|
className: "pr-1 font-medium not-italic opacity-70",
|
|
1055
1015
|
children: [
|
|
1056
1016
|
"[",
|
|
1057
|
-
|
|
1017
|
+
b("videoPlayer.audioDescription"),
|
|
1058
1018
|
"]"
|
|
1059
1019
|
]
|
|
1060
1020
|
}), X.activeCue]
|
|
1061
1021
|
})
|
|
1062
1022
|
}) : null,
|
|
1063
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ B("span", {
|
|
1064
1024
|
className: "sr-only",
|
|
1065
1025
|
"aria-live": "polite",
|
|
1066
|
-
children: J.isPlaying ?
|
|
1026
|
+
children: J.isPlaying ? b("videoPlayer.playing") : b("videoPlayer.paused")
|
|
1067
1027
|
}),
|
|
1068
|
-
J.videoLoaded ? /* @__PURE__ */
|
|
1028
|
+
J.videoLoaded ? /* @__PURE__ */ B(ge, {
|
|
1069
1029
|
isPlaying: J.isPlaying,
|
|
1070
1030
|
currentTime: J.currentTime,
|
|
1071
1031
|
duration: J.duration,
|
|
@@ -1073,41 +1033,41 @@ function Ne({ src: e, poster: t, ariaLabel: n, silent: r = !1, persistControls:
|
|
|
1073
1033
|
isMuted: J.isMuted,
|
|
1074
1034
|
playbackRate: J.playbackRate,
|
|
1075
1035
|
isFullscreen: de,
|
|
1076
|
-
markerTime:
|
|
1077
|
-
blockSeekPastMarker:
|
|
1078
|
-
containerRef:
|
|
1036
|
+
markerTime: m ? le : void 0,
|
|
1037
|
+
blockSeekPastMarker: m,
|
|
1038
|
+
containerRef: x,
|
|
1079
1039
|
captionsAvailable: Y.available,
|
|
1080
1040
|
captionsOn: Y.showing,
|
|
1081
1041
|
audioDescriptionAvailable: X.available,
|
|
1082
1042
|
audioDescriptionOn: G,
|
|
1083
|
-
silent:
|
|
1084
|
-
persist:
|
|
1085
|
-
audioLanguages:
|
|
1086
|
-
audioLanguage:
|
|
1087
|
-
onAudioLanguageChange:
|
|
1088
|
-
captionLanguages:
|
|
1089
|
-
captionLanguage:
|
|
1043
|
+
silent: o,
|
|
1044
|
+
persist: s,
|
|
1045
|
+
audioLanguages: S,
|
|
1046
|
+
audioLanguage: w,
|
|
1047
|
+
onAudioLanguageChange: Q,
|
|
1048
|
+
captionLanguages: E,
|
|
1049
|
+
captionLanguage: O,
|
|
1090
1050
|
onCaptionLanguageChange: ae,
|
|
1091
1051
|
onCaptionsOff: oe,
|
|
1092
|
-
audioDescriptionLanguages:
|
|
1093
|
-
audioDescriptionLanguage:
|
|
1052
|
+
audioDescriptionLanguages: N,
|
|
1053
|
+
audioDescriptionLanguage: U,
|
|
1094
1054
|
onAudioDescriptionLanguageChange: se,
|
|
1095
|
-
onAudioDescriptionOff:
|
|
1055
|
+
onAudioDescriptionOff: ce,
|
|
1096
1056
|
onTogglePlay: J.togglePlay,
|
|
1097
1057
|
onToggleMute: J.toggleMute,
|
|
1098
1058
|
onVolumeChange: J.setVolume,
|
|
1099
1059
|
onPlaybackRateChange: J.setPlaybackRate,
|
|
1100
1060
|
onToggleFullscreen: () => void fe(),
|
|
1101
1061
|
onToggleCaptions: Y.toggle,
|
|
1102
|
-
onToggleAudioDescription:
|
|
1103
|
-
onSeek:
|
|
1104
|
-
download:
|
|
1062
|
+
onToggleAudioDescription: ie,
|
|
1063
|
+
onSeek: $,
|
|
1064
|
+
download: f
|
|
1105
1065
|
}) : null
|
|
1106
1066
|
]
|
|
1107
1067
|
});
|
|
1108
1068
|
}
|
|
1109
1069
|
//#endregion
|
|
1110
1070
|
//#region src/blocks/F0VideoPlayer/F0VideoPlayer.tsx
|
|
1111
|
-
var
|
|
1071
|
+
var Ne = e(n("F0VideoPlayer", Me));
|
|
1112
1072
|
//#endregion
|
|
1113
|
-
export {
|
|
1073
|
+
export { Ne as t };
|