@softistx/material 3.248.0 → 3.249.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/CHANGELOG.md +24 -0
- package/README.md +6 -2
- package/dist/adopt-styles-C3MfGnxE.js +20 -0
- package/dist/{async-slice-C5HfFq1M.js → async-slice-DdEr7vFx.js} +1 -1
- package/dist/{audio-player-2kKst8lH.js → audio-player-DMYszRGT.js} +3 -3
- package/dist/{audio-player-viewer-D9DsYBcy.js → audio-player-viewer-z13yCjo4.js} +2 -2
- package/dist/{autocomplete-JuRCjl48.js → autocomplete-Bgf_AJ6U.js} +11 -11
- package/dist/{avatar-CvvdaBu4.js → avatar-WvTropuJ.js} +1 -1
- package/dist/blank-placeholder-DZIFJ0DG.js +17 -0
- package/dist/{breadcrumb-DacRqg91.js → breadcrumb-DYa6pVsq.js} +5 -5
- package/dist/{button-CpUMPIdk.js → button-RsWgka2v.js} +1 -1
- package/dist/{calculator-BYgFgWHL.js → calculator-DPHCuAZy.js} +11 -11
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-DCHWZy6b.js → calculator-segment-Ckn9Fua9.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/canvas-BShNj4yp.js +144 -0
- package/dist/capture-outputs-qcYUPW6K.js +174 -0
- package/dist/capture-toolbar.css +2 -0
- package/dist/capture-toolbar.js +858 -0
- package/dist/capture.js +53 -139
- package/dist/charts.js +3 -3
- package/dist/{chip-CjJPmAYO.js → chip-tyDM0lpO.js} +2 -2
- package/dist/{code-editor-nNcxtslA.js → code-editor-gHHXEwF-.js} +6 -6
- package/dist/code-editor.js +6 -6
- package/dist/{code-file-viewer-CcESl49v.js → code-file-viewer-CYQcskvt.js} +4 -4
- package/dist/{code-language-items-CW8_Si05.js → code-language-items-DDFuDf_E.js} +2 -2
- package/dist/{components-BdMaUeOm.js → components-BbAylWQW.js} +16711 -20831
- package/dist/components.js +83 -79
- package/dist/{confirm-dialog-B2eonW2X.js → confirm-dialog-IHvPA3O2.js} +4 -4
- package/dist/{conversion-variant-DZm_xgUK.js → conversion-variant-MWTjnFnG.js} +5 -5
- package/dist/{currency-field-UIkYAlvP.js → currency-field-Bd9od1Ee.js} +5 -5
- package/dist/{detail-panel-header-CL2_tUG0.js → detail-panel-header-D2a63Sk3.js} +1 -1
- package/dist/{details-content-CPzj3vUr.js → details-content-CnN_ukTA.js} +6 -6
- package/dist/{details-header-band-D-CyB_Xx.js → details-header-band-wcgmC7qC.js} +5 -5
- package/dist/{details-host-BvYgFIWx.js → details-host-DKEaGH4P.js} +1 -1
- package/dist/{details-sheet-D4PTV_jR.js → details-sheet-CtNM4oDU.js} +2 -2
- package/dist/{details-shell-D4XoPRBu.js → details-shell-DZ80h6mN.js} +1 -1
- package/dist/{dialog-CleLsHkZ.js → dialog-DwUxG2-o.js} +1 -1
- package/dist/{dialog-app-bar-CLC990e6.js → dialog-app-bar-BsJ4UwKb.js} +2 -2
- package/dist/dist-Cb17ixQs.js +16 -0
- package/dist/dist-CyqFzDZ6.js +11 -0
- package/dist/dnd.js +1 -1
- package/dist/draw.js +1 -1
- package/dist/{drop-overlay-BTkVfscF.js → drop-overlay-B26hx0-T.js} +2 -2
- package/dist/{dropdown-menu-BoJC2DEH.js → dropdown-menu-D-PRbHaP.js} +1 -1
- package/dist/{editable-section-CTRGfbLJ.js → editable-section-DPmF1flG.js} +3 -3
- package/dist/editor.js +14 -14
- package/dist/embed-chunks/{avatar-GlGqPU7B.js → avatar-CSDtFCum.js} +1 -1
- package/dist/embed-chunks/{dist-BrYZYfsJ.js → dist-C-lAK_LC.js} +2 -2
- package/dist/embed-chunks/{emoji-picker-BSYBi_C8.js → emoji-picker-BWDQFdQu.js} +4 -4
- package/dist/embed-chunks/{mention-list-NW43QcRq.js → mention-list-CdUr0h3X.js} +3 -3
- package/dist/embed-chunks/{nxgt-theme-provider-B1aeqDja.js → nxgt-theme-provider-DdDsiEPj.js} +2 -2
- package/dist/embed-chunks/{switch-control-ChcowM3u.js → switch-control-B95ZWvna.js} +1 -1
- package/dist/embed-chunks/{tabs-root-CY-uLp1C.js → tabs-root-MF9lEHbq.js} +2 -2
- package/dist/embed-chunks/{use-shape-morph-NrJQMv7i.js → use-shape-morph-D1MOoQ4T.js} +110 -2
- package/dist/embed-chunks/{useLatest-B57qw3XH.js → useLatest-RGIW0nya.js} +1 -1
- package/dist/embed.js +626 -613
- package/dist/{emoji-picker-DZbTd3Fr.js → emoji-picker-DabgsEVQ.js} +7 -7
- package/dist/{empty-state-DBSJDLKL.js → empty-state-BylD7RYH.js} +1 -1
- package/dist/{error-state-kauz4If4.js → error-state-BTe_NzTC.js} +2 -2
- package/dist/fab-DUnGwNE7.js +41 -0
- package/dist/fab-dock-By2pLVh7.js +49 -0
- package/dist/{feature-popup-CcXMGFES.js → feature-popup-CW7VS2fx.js} +1 -1
- package/dist/{blank-placeholder-DeDn5Xor.js → field-box-BXN-uyrv.js} +1 -16
- package/dist/{field-group-BpV74Ttu.js → field-group-B2Ozd5Jn.js} +1 -1
- package/dist/{file-dialogs-CbdvmY__.js → file-dialogs-CgEXaCev.js} +7 -7
- package/dist/{file-manager-shell-DLaJ5Z_L.js → file-manager-shell-Tqduf5lh.js} +21 -21
- package/dist/{file-preview-host-RhZvGGqC.js → file-preview-host-CM4pV3ZD.js} +2367 -2384
- package/dist/{file-viewer-body-DM3RkXGn.js → file-viewer-body-DrWFmnp4.js} +3 -3
- package/dist/{file-viewer-dialog-impl-ei5EYj8k.js → file-viewer-dialog-impl-DZpuZZ7x.js} +2 -2
- package/dist/files-drop.js +1 -1
- package/dist/files-picker.js +8 -8
- package/dist/files.js +3 -3
- package/dist/{financial-variant-BNdOqzA5.js → financial-variant-ljdP0JL4.js} +5 -5
- package/dist/{flow-diagram-BBB6r8--.js → flow-diagram-DwUnyl0u.js} +1 -1
- package/dist/{gallery-CIIJHpmj.js → gallery-DfN2KE4Y.js} +11 -11
- package/dist/{gallery-file-viewer-DkshswFr.js → gallery-file-viewer-BfFWfLIF.js} +3 -3
- package/dist/{gl-markers-abqcNuYT.js → gl-markers-CBNFeWIk.js} +3 -3
- package/dist/{hooks-D6lOSXA5.js → hooks-DiAhgchz.js} +3 -3
- package/dist/hooks.js +3 -3
- package/dist/i18n.js +3 -3
- package/dist/{icon-button-GKYj7uC4.js → icon-button-D-gi4Plg.js} +1 -1
- package/dist/image-editor-mmhbsqs-.js +4423 -0
- package/dist/image-editor.css +1 -1
- package/dist/image-editor.js +1124 -848
- package/dist/image-markup-editor-D-QkZWKf.js +24 -0
- package/dist/input-CWf3Apid.js +18 -0
- package/dist/input-box-moFuoMt0.js +15 -0
- package/dist/{input-group-CKO68Pyi.js → input-group-Bb8sAFRF.js} +3 -2
- package/dist/{item-details-l_-rk3Hj.js → item-details-BWdHMfsS.js} +7 -7
- package/dist/keypad.js +2 -2
- package/dist/lib/capture/engine/canvas.d.ts +17 -0
- package/dist/lib/capture/engine/capture.d.ts +19 -0
- package/dist/lib/capture/engine/filters.d.ts +27 -0
- package/dist/lib/capture/engine/rect.d.ts +26 -0
- package/dist/lib/capture/engine/types.d.ts +66 -0
- package/dist/lib/capture/index.d.ts +16 -0
- package/dist/lib/capture/modes/capture-mode.d.ts +24 -0
- package/dist/lib/capture/modes/countdown.d.ts +16 -0
- package/dist/lib/capture/modes/full-page.d.ts +14 -0
- package/dist/lib/capture/modes/pick-element.d.ts +22 -0
- package/dist/lib/capture/modes/scroller.d.ts +13 -0
- package/dist/lib/capture/modes/visible.d.ts +3 -0
- package/dist/lib/capture-toolbar/index.d.ts +25 -0
- package/dist/lib/capture-toolbar/lazy-capture-outputs.d.ts +2 -0
- package/dist/lib/capture-toolbar/outputs-encode.d.ts +25 -0
- package/dist/lib/capture-toolbar/outputs.d.ts +38 -0
- package/dist/lib/capture-toolbar/partials/capture-editor.d.ts +11 -0
- package/dist/lib/capture-toolbar/partials/capture-outputs.d.ts +16 -0
- package/dist/lib/capture-toolbar/region-overlay.d.ts +15 -0
- package/dist/lib/capture-toolbar/screen-capture-toolbar.d.ts +31 -0
- package/dist/lib/capture-toolbar/types.d.ts +117 -0
- package/dist/lib/capture-toolbar/use-screen-capture.d.ts +16 -0
- package/dist/lib/components/ui/media/attachment-list/attachment-list.d.ts +2 -2
- package/dist/lib/components/ui/media/image-editor/image-markup-editor.d.ts +11 -3
- package/dist/lib/components/ui/media/image-editor/types-edits.d.ts +7 -0
- package/dist/lib/components/ui/media/image-editor/types-session.d.ts +1 -1
- package/dist/lib/components/ui/media/image-editor/types.d.ts +8 -0
- package/dist/lib/embed/index.d.ts +2 -0
- package/dist/lib/i18n/resources/resources.d.ts +108 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/image-editor/index.d.ts +1 -1
- package/dist/lib.js +38 -56
- package/dist/{list-sheet-D22J9I-K.js → list-sheet-CejfrKJr.js} +1 -1
- package/dist/{loading-indicator-sDzxZg8f.js → loading-indicator-BBjOF25N.js} +1 -1
- package/dist/main.js +103 -98
- package/dist/{map-draw-DfbfT0eJ.js → map-draw-DyRy9SSV.js} +2 -2
- package/dist/map-draw.js +5 -5
- package/dist/map-static.js +1 -1
- package/dist/{map-view-DAx2zvV-.js → map-view-YfuYD3zS.js} +9 -9
- package/dist/map-zone-events.js +1 -1
- package/dist/map-zone-field.js +7 -7
- package/dist/map.js +10 -10
- package/dist/{marker-button-D7hEvEZD.js → marker-button-CXBaToHp.js} +1 -1
- package/dist/{marker-count-image-CWS3G-k8.js → marker-count-image-DHuzSev9.js} +1 -1
- package/dist/material.css +1 -1
- package/dist/{measure-manual-Bfvu8B_R.js → measure-manual-CcESmV1d.js} +3 -3
- package/dist/{measurement-B-OeWv7j.js → measurement-D2or6yM_.js} +1 -1
- package/dist/{media-player-DGXmWK7W.js → media-player-qW9RXFuO.js} +451 -567
- package/dist/{media-player-viewer-C3vXYcd8.js → media-player-viewer-DozPiF6T.js} +2 -2
- package/dist/{media-surface-BySonDjv.js → media-surface-BJsdNynm.js} +6 -6
- package/dist/{mention-list-BpoZHwO6.js → mention-list-z1wnlJgs.js} +2 -2
- package/dist/{native-select-Dg4bc7aC.js → native-select-BnDOVnER.js} +1 -1
- package/dist/{nxgt-theme-Ob-uFqU_.js → nxgt-theme-EYZ5aFHi.js} +6 -15
- package/dist/nxgt-theme-provider-BPXd3h82.js +40 -0
- package/dist/outputs-DF-aVqUO.js +81 -0
- package/dist/passkey.js +1 -1
- package/dist/{pdf-form-filler-DgH52W2Q.js → pdf-form-filler-Ct4eexhZ.js} +34 -34
- package/dist/pdf-form.js +2 -2
- package/dist/{pdf-reader-Bilz5foK.js → pdf-reader-khpMMEjU.js} +16 -16
- package/dist/{pdf-reader-viewer-DwQP2IpV.js → pdf-reader-viewer-B3_TdFOn.js} +2 -2
- package/dist/pdf-reader.js +2 -2
- package/dist/{percent-field-Ldc7K2wC.js → percent-field-Bu-PmCNR.js} +2 -2
- package/dist/{picker-surface-DZQbBgvA.js → picker-surface-THexE1OU.js} +3 -3
- package/dist/{popover-DwsaHFrK.js → popover-osl5duoA.js} +1 -1
- package/dist/portal-container-provider-fZFUk-ZB.js +11 -0
- package/dist/{pos-types-CKDG7pZA.js → pos-types-BPPae99i.js} +1 -1
- package/dist/{pos-variant-9nhz-ZzW.js → pos-variant-D6bDUqwV.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-BzwfeMGC.js → programmer-variant-CDlFE24o.js} +2 -2
- package/dist/{progress-BBfp7sMi.js → progress-DjHnanxA.js} +2 -2
- package/dist/{progress-linear-BOJbHnzd.js → progress-linear-CTJ_U6kY.js} +1 -1
- package/dist/{public-I8nb8pCC.js → public-u9u2Osmx.js} +6 -6
- package/dist/{rendition-stage-A1nHXYrA.js → rendition-stage-BXjQpfKK.js} +2 -2
- package/dist/{rich-code-block-BJERY3N3.js → rich-code-block-DWSzyQRw.js} +5 -5
- package/dist/{scientific-variant-st2NBm1K.js → scientific-variant-DCgApH87.js} +2 -2
- package/dist/{scroll-area-B3XstZU2.js → scroll-area-BxKiT4Dn.js} +155 -164
- package/dist/{search-field-D3AOJr7s.js → search-field-Cgqa2bQf.js} +2 -2
- package/dist/{select-DhfzCkun.js → select-BGhRlBh4.js} +166 -179
- package/dist/{sheet-B8cO1T5K.js → sheet-BvNVroog.js} +1 -1
- package/dist/{signature-dialog-BNLMPgao.js → signature-dialog-x--_QWRB.js} +5 -5
- package/dist/signature.js +1 -1
- package/dist/{site-footer-cta-Cx7zsvkq.js → site-footer-cta-B3Kfqpep.js} +4 -4
- package/dist/{site-footer-link-Di8IMIw0.js → site-footer-link-SFHrO4ld.js} +1 -1
- package/dist/{size-slot-D1cKqb09.js → size-slot-Cb-W2Zm4.js} +1 -1
- package/dist/{sortable-provider-DrLnoygf.js → sortable-provider-KRScvvYx.js} +2 -2
- package/dist/{spinner-BpH9tE8R.js → spinner-DpB6XvJJ.js} +1 -1
- package/dist/switch-c_6OtXzW.js +125 -0
- package/dist/{tabs-root-BUnIfDah.js → tabs-root-C2n3K_Yv.js} +1 -1
- package/dist/{tags-form-BwqR4UVj.js → tags-form-BKB9fP03.js} +5 -5
- package/dist/{text-field-CFCHo07X.js → text-field-Dl7xTxZe.js} +2 -2
- package/dist/{textarea-B_iMDYgM.js → textarea-C3BGZELU.js} +1 -1
- package/dist/{textarea-field-DIOGxyUd.js → textarea-field-mqWhhbis.js} +2 -2
- package/dist/theme-picker.js +5 -4
- package/dist/{theme-toggle-CsBe64lm.js → theme-toggle-K-n5eq0T.js} +3 -3
- package/dist/theme-value-CD2nDrj_.js +12 -0
- package/dist/themes.js +15 -48
- package/dist/{toasts-McZnLRHP.js → toasts-DFLecXh0.js} +5 -5
- package/dist/{toggle-group-DKN1XLBS.js → toggle-group-DMDjNJWx.js} +1 -1
- package/dist/{toolbar-group-BmzGP_JO.js → toolbar-group-bttMdvg4.js} +1 -1
- package/dist/{toolbar-item-slot-BnqQLkVd.js → toolbar-item-slot-CBn3YjeE.js} +1 -1
- package/dist/{toolbar-items-C9uasXZ2.js → toolbar-items-zL5TYLf2.js} +4 -4
- package/dist/{toolbar-keep-focus-Vc5V-dX2.js → toolbar-keep-focus-C6bnzvpE.js} +2 -2
- package/dist/{tracked-layer-CjCXB_O6.js → tracked-layer-CYdLWRK-.js} +4 -4
- package/dist/{translate-material-C-qVvGLn.js → translate-material-DZNgWjYu.js} +1 -1
- package/dist/{translator-BrzI307E.js → translator-CrIFDzAz.js} +110 -2
- package/dist/{tree-DOAs456A.js → tree-CFXDccIe.js} +1 -1
- package/dist/{upload-host-ZpSSql8v.js → upload-host-DDktVohu.js} +9 -8
- package/dist/{use-calculator-keyboard-Ss25SRoM.js → use-calculator-keyboard-BWkYuIw5.js} +1 -1
- package/dist/{use-chat-composer-DopDN-zP.js → use-chat-composer-C1Qlnw2i.js} +20 -20
- package/dist/{use-file-meta-DyJX0JVs.js → use-file-meta-DcfQCh52.js} +1 -1
- package/dist/{use-heading-spy-CA2IAqMe.js → use-heading-spy-B9xEMHbZ.js} +2 -2
- package/dist/use-image-preview-BNq_RQm5.js +20 -0
- package/dist/{use-item-entries-CYbS5otl.js → use-item-entries-BKQHcWFx.js} +1 -1
- package/dist/{use-material-translation-eYySryw3.js → use-material-translation-ZEUtduro.js} +1 -1
- package/dist/{use-media-viewer-DoNdrzhN.js → use-media-viewer-DViJNx75.js} +1 -1
- package/dist/{use-text-preview-BQE4U9cT.js → use-text-preview-Ci97JKKo.js} +2 -2
- package/dist/{use-unsaved-guard-CSfDvdxd.js → use-unsaved-guard-CWlHEvjN.js} +2 -2
- package/dist/{viewer-CXF1dAv0.js → viewer-DDPJOxBt.js} +5 -5
- package/dist/{viewer-stage-class-CpyA8o-M.js → viewer-stage-class-DJ1uod4l.js} +4 -4
- package/dist/{viewer-states-BXyCdNhE.js → viewer-states-DkaPBkK4.js} +3 -3
- package/dist/{virtual-layer-rows-DHy8vAup.js → virtual-layer-rows-DKejQ_Jd.js} +1 -1
- package/dist/visible-B-IFZ4Nv.js +475 -0
- package/docs/components/media-and-files.md +1 -1
- package/docs/guides/capture.md +248 -0
- package/docs/guides/csp.md +1 -1
- package/docs/guides/embed.md +50 -2
- package/docs/roadmap.md +2 -1
- package/docs/troubleshooting.md +56 -0
- package/package.json +18 -1
- package/dist/fab-dock-DqwbI-5n.js +0 -86
- package/dist/input-BaBE_MR_.js +0 -27
- /package/dist/{dist-B1qFabLJ.js → dist-B1qFabLJ2.js} +0 -0
|
@@ -1,199 +1,83 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { c as t, d as n, f as r, i, n as a, o, t as s, u as c } from "./dropdown-menu-
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { t as h } from "./
|
|
7
|
-
import { t as g } from "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { debounce as Ge } from "@softistx/material-core/debounce";
|
|
18
|
-
import { INITIAL_TAP_STATE as Ke, activeCues as qe, chapterAt as B, chapterMarkers as Je, classifyTap as Ye, cueStartIndex as Xe, flushTap as Ze, formatClock as V, nextRepeatMode as Qe, parseThumbnails as H, parseWebVtt as $e, searchTranscript as et, thumbnailAt as tt, transcriptLines as nt } from "@softistx/material-core/media";
|
|
19
|
-
//#region lib/components/ui/fields/switch/partials/switch-row.tsx
|
|
20
|
-
function rt({ id: t, rowTextId: n, text: r, isChecked: i, error: a, variant: o = "box", className: s, readOnly: c, children: l }) {
|
|
21
|
-
return /* @__PURE__ */ z("div", {
|
|
22
|
-
"data-checked": i,
|
|
23
|
-
"data-filled": i,
|
|
24
|
-
"data-invalid": a || void 0,
|
|
25
|
-
className: e(o === "plain" ? "flex w-full min-w-0 items-start gap-2 min-h-11 py-[5px]" : b, o !== "plain" && "h-auto min-h-11 items-start py-[5px]", s),
|
|
26
|
-
children: [/* @__PURE__ */ R("label", {
|
|
27
|
-
id: n,
|
|
28
|
-
htmlFor: t,
|
|
29
|
-
className: e(v(), "my-1.5 min-w-0 flex-1 break-words", c ? "cursor-default" : "cursor-pointer", "pointer-coarse:py-3 pointer-coarse:-my-1.5", { "text-primary-text": i }),
|
|
30
|
-
children: r
|
|
31
|
-
}), l]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region lib/components/ui/fields/switch/switch.utils.ts
|
|
36
|
-
function it({ id: e, label: t, placeholder: n, helperText: r, props: i }) {
|
|
37
|
-
let a = `${e}-label`, o = r ? `${e}-helper` : void 0, s = !!(t && n), c = s ? `${e}-text` : void 0, l = [
|
|
38
|
-
c,
|
|
39
|
-
o,
|
|
40
|
-
i["aria-describedby"]
|
|
41
|
-
].filter(Boolean).join(" ") || void 0, u = !!(i["aria-label"] || i["aria-labelledby"]);
|
|
42
|
-
return {
|
|
43
|
-
labelId: a,
|
|
44
|
-
rowTextId: c,
|
|
45
|
-
helperId: o,
|
|
46
|
-
nameProps: {
|
|
47
|
-
...s && !u ? { "aria-labelledby": a } : {},
|
|
48
|
-
...l ? { "aria-describedby": l } : {}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region lib/components/ui/fields/switch/use-switch-checked.ts
|
|
54
|
-
function at(e) {
|
|
55
|
-
let [t, n] = L(e.defaultChecked ?? !1);
|
|
56
|
-
return {
|
|
57
|
-
isChecked: e.checked ?? t,
|
|
58
|
-
onCheckedChange: (t) => {
|
|
59
|
-
e.checked === void 0 && n(t), e.onCheckedChange?.(t);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region lib/components/ui/fields/switch/use-switch-state.ts
|
|
65
|
-
function ot({ label: e, placeholder: t, helperText: n, props: r }) {
|
|
66
|
-
let i = _(), a = !!(t || e), o = P(), s = r.id ?? o, c = it({
|
|
67
|
-
id: s,
|
|
68
|
-
label: e,
|
|
69
|
-
placeholder: t,
|
|
70
|
-
helperText: n,
|
|
71
|
-
props: r
|
|
72
|
-
}), { isChecked: l, onCheckedChange: u } = at(r);
|
|
73
|
-
return {
|
|
74
|
-
blurRoot: i,
|
|
75
|
-
hasRow: a,
|
|
76
|
-
id: s,
|
|
77
|
-
...c,
|
|
78
|
-
isChecked: l,
|
|
79
|
-
onCheckedChange: u
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region lib/components/ui/fields/switch/switch.tsx
|
|
84
|
-
function U({ error: t, helperText: n, label: r, placeholder: i, variant: a = "box", className: o, ...s }) {
|
|
85
|
-
let c = ot({
|
|
86
|
-
label: r,
|
|
87
|
-
placeholder: i,
|
|
88
|
-
helperText: n,
|
|
89
|
-
props: s
|
|
90
|
-
}), { id: d } = c, f = !(i || n), p = f ? o : void 0, m = c.hasRow && f && a === "box", h = {
|
|
91
|
-
"aria-invalid": t || void 0,
|
|
92
|
-
...s,
|
|
93
|
-
...c.nameProps,
|
|
94
|
-
id: d,
|
|
95
|
-
onCheckedChange: c.onCheckedChange
|
|
96
|
-
}, g = c.hasRow ? /* @__PURE__ */ R(rt, {
|
|
97
|
-
className: e(m && "self-end", p),
|
|
98
|
-
id: d,
|
|
99
|
-
rowTextId: c.rowTextId,
|
|
100
|
-
text: i || r,
|
|
101
|
-
isChecked: c.isChecked,
|
|
102
|
-
error: t,
|
|
103
|
-
variant: a,
|
|
104
|
-
readOnly: s.readOnly,
|
|
105
|
-
children: /* @__PURE__ */ R(u, {
|
|
106
|
-
...h,
|
|
107
|
-
className: "cursor-pointer"
|
|
108
|
-
})
|
|
109
|
-
}) : /* @__PURE__ */ R(u, {
|
|
110
|
-
...h,
|
|
111
|
-
className: e("cursor-pointer", p)
|
|
112
|
-
});
|
|
113
|
-
return /* @__PURE__ */ z("div", {
|
|
114
|
-
ref: c.blurRoot,
|
|
115
|
-
"data-slot": "switch-field",
|
|
116
|
-
className: f ? "contents" : e("grid min-w-0 content-start gap-1.5", c.hasRow && "w-full", o),
|
|
117
|
-
children: [r && i && /* @__PURE__ */ R(l, {
|
|
118
|
-
id: c.labelId,
|
|
119
|
-
htmlFor: d,
|
|
120
|
-
withAsterisk: s.required,
|
|
121
|
-
children: r
|
|
122
|
-
}), /* @__PURE__ */ z("div", {
|
|
123
|
-
className: f ? "contents" : "flex min-w-0 flex-col gap-0.5",
|
|
124
|
-
children: [g, n ? /* @__PURE__ */ R(y, {
|
|
125
|
-
id: c.helperId,
|
|
126
|
-
error: t,
|
|
127
|
-
children: n
|
|
128
|
-
}) : null]
|
|
129
|
-
})]
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
var st = U, ct = {
|
|
2
|
+
import { c as t, d as n, f as r, i, n as a, o, t as s, u as c } from "./dropdown-menu-D-PRbHaP.js";
|
|
3
|
+
import { D as l, c as u, n as d, t as f } from "./tabs-root-C2n3K_Yv.js";
|
|
4
|
+
import { t as p } from "./use-material-translation-ZEUtduro.js";
|
|
5
|
+
import { t as m } from "./icon-button-D-gi4Plg.js";
|
|
6
|
+
import { t as h } from "./input-CWf3Apid.js";
|
|
7
|
+
import { t as g } from "./switch-c_6OtXzW.js";
|
|
8
|
+
import { B as _, D as v, E as y, F as b, H as ee, I as te, J as x, O as S, T as C, U as ne, V as w, b as re, c as ie, d as T, f as E, g as D, h as O, i as ae, l as oe, m as k, n as se, o as ce, p as le, s as ue, t as de, u as fe, y as A } from "./media-surface-BJsdNynm.js";
|
|
9
|
+
import { Fragment as pe, createContext as me, useCallback as j, useContext as M, useEffect as N, useId as P, useLayoutEffect as F, useMemo as I, useRef as L, useState as R, useSyncExternalStore as he } from "react";
|
|
10
|
+
import { Fragment as ge, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
11
|
+
import { Captions as _e, CaptionsOff as ve, ChevronDown as ye, ChevronUp as be, ChevronsLeft as xe, ChevronsRight as Se, CircleAlert as Ce, Film as we, ListVideo as Te, LoaderCircle as Ee, Maximize as De, Minimize as Oe, Music as ke, Repeat as Ae, Repeat1 as je, ScrollText as Me, Settings as Ne, Shuffle as Pe, SkipBack as Fe, SkipForward as Ie, X as Le } from "lucide-react";
|
|
12
|
+
import { matchRanges as Re } from "@softistx/material-core/text-match";
|
|
13
|
+
import { debounce as ze } from "@softistx/material-core/debounce";
|
|
14
|
+
import { INITIAL_TAP_STATE as Be, activeCues as Ve, chapterAt as V, chapterMarkers as He, classifyTap as Ue, cueStartIndex as We, flushTap as Ge, formatClock as H, nextRepeatMode as Ke, parseThumbnails as U, parseWebVtt as qe, searchTranscript as Je, thumbnailAt as Ye, transcriptLines as Xe } from "@softistx/material-core/media";
|
|
15
|
+
//#region lib/components/ui/media/media-player/partials/aspect-ratio.ts
|
|
16
|
+
var Ze = {
|
|
133
17
|
"16/9": "aspect-video",
|
|
134
18
|
"4/3": "aspect-4/3",
|
|
135
19
|
"1/1": "aspect-square",
|
|
136
20
|
"9/16": "aspect-9/16",
|
|
137
21
|
"21/9": "aspect-21/9"
|
|
138
|
-
},
|
|
22
|
+
}, Qe = { "9/16": "mx-auto max-w-sm" };
|
|
139
23
|
//#endregion
|
|
140
24
|
//#region lib/components/ui/media/media-player/partials/atoms/captions-menu.tsx
|
|
141
|
-
function
|
|
142
|
-
let { state: e, actions: t, track: i } =
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
value:
|
|
25
|
+
function $e() {
|
|
26
|
+
let { state: e, actions: t, track: i } = x("CaptionsMenu"), { t: a } = p(), o = i?.captions ?? [];
|
|
27
|
+
return /* @__PURE__ */ B(n, {
|
|
28
|
+
value: v(e, i),
|
|
145
29
|
onValueChange: (e) => t.setCaptions(e === "off" ? null : e),
|
|
146
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ z(r, {
|
|
147
31
|
value: "off",
|
|
148
32
|
children: a("material.media-player.captions-off", "Off")
|
|
149
|
-
}), o.map((e) => /* @__PURE__ */
|
|
33
|
+
}), o.map((e) => /* @__PURE__ */ z(r, {
|
|
150
34
|
value: e.srclang,
|
|
151
35
|
children: e.label
|
|
152
36
|
}, `${e.kind ?? "subtitles"}:${e.srclang}`))]
|
|
153
37
|
});
|
|
154
38
|
}
|
|
155
|
-
function
|
|
156
|
-
let { state: o, track: c } =
|
|
39
|
+
function et({ tone: n = "surface", className: r }) {
|
|
40
|
+
let { state: o, track: c } = x("CaptionsMenu"), { t: l } = p(), u = A();
|
|
157
41
|
if ((c?.captions ?? []).length === 0) return null;
|
|
158
|
-
let d =
|
|
159
|
-
return /* @__PURE__ */
|
|
42
|
+
let d = v(o, c), f = l("material.media-player.captions", "Captions"), h = d === "off" ? ve : _e;
|
|
43
|
+
return /* @__PURE__ */ B(s, { children: [/* @__PURE__ */ z(t, {
|
|
160
44
|
asChild: !0,
|
|
161
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ z(m, {
|
|
162
46
|
variant: "ghost",
|
|
163
47
|
"data-slot": "media-captions-menu",
|
|
164
48
|
"data-captions": d === "off" ? "off" : "on",
|
|
165
|
-
className: e(
|
|
49
|
+
className: e(w[n], r),
|
|
166
50
|
"aria-label": f,
|
|
167
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ z(h, { className: "size-5" })
|
|
168
52
|
})
|
|
169
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ B(a, {
|
|
170
54
|
align: "end",
|
|
171
55
|
container: u,
|
|
172
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ z(i, { children: f }), /* @__PURE__ */ z($e, {})]
|
|
173
57
|
})] });
|
|
174
58
|
}
|
|
175
59
|
//#endregion
|
|
176
60
|
//#region lib/components/ui/media/media-player/partials/atoms/chapter-items.tsx
|
|
177
|
-
var
|
|
61
|
+
var tt = "relative data-[current]:bg-primary/10 data-[current]:font-medium data-[current]:before:absolute data-[current]:before:inset-y-1 data-[current]:before:start-0 data-[current]:before:w-0.5 data-[current]:before:rounded-none data-[current]:before:bg-primary-text";
|
|
178
62
|
function W() {
|
|
179
|
-
let { state: e, track: t, actions: n, timeStore: r } =
|
|
63
|
+
let { state: e, track: t, actions: n, timeStore: r } = x("ChaptersMenu"), i = k(t, e.duration || t?.duration);
|
|
180
64
|
return {
|
|
181
65
|
chapters: i,
|
|
182
|
-
current:
|
|
66
|
+
current: V(i, C(r)),
|
|
183
67
|
seek: n.seek
|
|
184
68
|
};
|
|
185
69
|
}
|
|
186
|
-
function
|
|
70
|
+
function nt() {
|
|
187
71
|
let { chapters: e, current: t, seek: n } = W();
|
|
188
|
-
return e.map((e, r) => /* @__PURE__ */
|
|
72
|
+
return e.map((e, r) => /* @__PURE__ */ B(c, {
|
|
189
73
|
"aria-current": r === t ? "true" : void 0,
|
|
190
74
|
"data-current": r === t ? "" : void 0,
|
|
191
75
|
onSelect: () => n(e.start),
|
|
192
|
-
className: `items-baseline gap-3 px-3 ${
|
|
193
|
-
children: [/* @__PURE__ */
|
|
76
|
+
className: `items-baseline gap-3 px-3 ${tt}`,
|
|
77
|
+
children: [/* @__PURE__ */ z("span", {
|
|
194
78
|
className: "w-12 shrink-0 text-xs tabular-nums text-muted-foreground",
|
|
195
|
-
children:
|
|
196
|
-
}), /* @__PURE__ */
|
|
79
|
+
children: H(e.start)
|
|
80
|
+
}), /* @__PURE__ */ z("span", {
|
|
197
81
|
className: "min-w-0 flex-1 wrap-anywhere",
|
|
198
82
|
children: e.title
|
|
199
83
|
})]
|
|
@@ -201,84 +85,84 @@ function pt() {
|
|
|
201
85
|
}
|
|
202
86
|
//#endregion
|
|
203
87
|
//#region lib/components/ui/media/media-player/partials/atoms/chapters-menu.tsx
|
|
204
|
-
function
|
|
205
|
-
let { state: o, track: c } =
|
|
206
|
-
if (
|
|
88
|
+
function rt({ tone: n = "surface", className: r }) {
|
|
89
|
+
let { state: o, track: c } = x("ChaptersMenu"), { t: l } = p(), u = A();
|
|
90
|
+
if (k(c, o.duration || c?.duration).length === 0) return null;
|
|
207
91
|
let d = l("material.media-player.chapters", "Chapters");
|
|
208
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ B(s, { children: [/* @__PURE__ */ z(t, {
|
|
209
93
|
asChild: !0,
|
|
210
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ z(m, {
|
|
211
95
|
variant: "ghost",
|
|
212
96
|
"data-slot": "media-chapters-menu",
|
|
213
|
-
className: e(
|
|
97
|
+
className: e(w[n], r),
|
|
214
98
|
"aria-label": d,
|
|
215
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ z(Te, { className: "size-5" })
|
|
216
100
|
})
|
|
217
|
-
}), /* @__PURE__ */
|
|
101
|
+
}), /* @__PURE__ */ B(a, {
|
|
218
102
|
align: "end",
|
|
219
103
|
collisionPadding: 8,
|
|
220
104
|
container: u,
|
|
221
105
|
className: "max-h-80 w-72 max-w-[calc(100vw-1rem)] overflow-y-auto",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ z(i, { children: d }), /* @__PURE__ */ z(nt, {})]
|
|
223
107
|
})] });
|
|
224
108
|
}
|
|
225
109
|
//#endregion
|
|
226
110
|
//#region lib/components/ui/media/media-player/partials/atoms/fullscreen-button.tsx
|
|
227
|
-
function
|
|
228
|
-
let { state: r, actions: i, track: a } =
|
|
111
|
+
function it({ tone: t = "surface", className: n }) {
|
|
112
|
+
let { state: r, actions: i, track: a } = x("FullscreenButton"), { t: o } = p();
|
|
229
113
|
if (a?.kind !== "video") return null;
|
|
230
114
|
let s = r.fullscreen ? o("material.media-player.exit-fullscreen", "Exit fullscreen") : o("material.media-player.fullscreen", "Fullscreen");
|
|
231
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ z(m, {
|
|
232
116
|
variant: "ghost",
|
|
233
117
|
"data-slot": "media-fullscreen-button",
|
|
234
|
-
className: e(
|
|
118
|
+
className: e(w[t], n),
|
|
235
119
|
tooltip: s,
|
|
236
120
|
onClick: i.toggleFullscreen,
|
|
237
|
-
children: r.fullscreen ? /* @__PURE__ */
|
|
121
|
+
children: r.fullscreen ? /* @__PURE__ */ z(Oe, { className: "size-5" }) : /* @__PURE__ */ z(De, { className: "size-5" })
|
|
238
122
|
});
|
|
239
123
|
}
|
|
240
124
|
//#endregion
|
|
241
125
|
//#region lib/components/ui/media/media-player/partials/atoms/mode-toggles.tsx
|
|
242
|
-
function
|
|
243
|
-
return e ? /* @__PURE__ */
|
|
126
|
+
function at({ on: e }) {
|
|
127
|
+
return e ? /* @__PURE__ */ z("span", {
|
|
244
128
|
"aria-hidden": !0,
|
|
245
129
|
className: "absolute bottom-1 left-1/2 size-1 -translate-x-1/2 rounded-full bg-current"
|
|
246
130
|
}) : null;
|
|
247
131
|
}
|
|
248
|
-
var
|
|
132
|
+
var ot = "bg-primary/15 text-primary-text", st = "bg-white/20";
|
|
249
133
|
function G({ tone: t = "surface", className: n }) {
|
|
250
|
-
let { state: r, tracks: i, actions: a } =
|
|
134
|
+
let { state: r, tracks: i, actions: a } = x("ShuffleToggle"), { t: o } = p();
|
|
251
135
|
if (i.length < 2) return null;
|
|
252
136
|
let s = r.shuffle.on;
|
|
253
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ z(m, {
|
|
254
138
|
variant: "ghost",
|
|
255
139
|
"data-slot": "media-shuffle-toggle",
|
|
256
140
|
"aria-pressed": s,
|
|
257
|
-
className: e(
|
|
141
|
+
className: e(w[t], n),
|
|
258
142
|
tooltip: o("material.media-player.shuffle", "Shuffle"),
|
|
259
143
|
onClick: a.toggleShuffle,
|
|
260
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ z(Pe, { className: "size-5" })
|
|
261
145
|
});
|
|
262
146
|
}
|
|
263
147
|
function K({ tone: t = "surface", className: n }) {
|
|
264
|
-
let { state: r, actions: i } =
|
|
148
|
+
let { state: r, actions: i } = x("RepeatToggle"), { t: a } = p(), o = r.repeat, s = {
|
|
265
149
|
off: a("material.media-player.repeat-off", "Repeat off"),
|
|
266
150
|
all: a("material.media-player.repeat-all", "Repeat all"),
|
|
267
151
|
one: a("material.media-player.repeat-one", "Repeat one")
|
|
268
|
-
}[o], c = o === "one" ?
|
|
269
|
-
return /* @__PURE__ */
|
|
152
|
+
}[o], c = o === "one" ? je : Ae;
|
|
153
|
+
return /* @__PURE__ */ B(m, {
|
|
270
154
|
variant: "ghost",
|
|
271
155
|
"data-slot": "media-repeat-toggle",
|
|
272
156
|
"data-repeat": o,
|
|
273
|
-
className: e("relative",
|
|
157
|
+
className: e("relative", w[t], o !== "off" && (t === "overlay" ? st : ot), n),
|
|
274
158
|
tooltip: s,
|
|
275
|
-
onClick: () => i.setRepeat(
|
|
276
|
-
children: [/* @__PURE__ */
|
|
159
|
+
onClick: () => i.setRepeat(Ke(o)),
|
|
160
|
+
children: [/* @__PURE__ */ z(c, { className: "size-5" }), /* @__PURE__ */ z(at, { on: o !== "off" })]
|
|
277
161
|
});
|
|
278
162
|
}
|
|
279
163
|
//#endregion
|
|
280
164
|
//#region lib/components/ui/media/media-player/partials/atoms/quality-entries.ts
|
|
281
|
-
function
|
|
165
|
+
function ct(e, t) {
|
|
282
166
|
let n = e.qualities.find((e) => e.id === "auto"), r = {
|
|
283
167
|
id: "auto",
|
|
284
168
|
label: n?.detail ? t("material.media-player.quality-auto-active", "Auto · {level}", { level: n.detail }) : t("material.media-player.quality-auto", "Auto")
|
|
@@ -290,26 +174,26 @@ function yt(e, t) {
|
|
|
290
174
|
}
|
|
291
175
|
//#endregion
|
|
292
176
|
//#region lib/components/ui/media/media-player/partials/atoms/quality-menu.tsx
|
|
293
|
-
function
|
|
294
|
-
let { state: l, actions: u } =
|
|
177
|
+
function lt({ tone: o = "surface", className: c }) {
|
|
178
|
+
let { state: l, actions: u } = x("QualityMenu"), { t: d } = p(), f = A();
|
|
295
179
|
if (l.qualities.length === 0) return null;
|
|
296
|
-
let { entries:
|
|
297
|
-
return /* @__PURE__ */
|
|
180
|
+
let { entries: h, current: g } = ct(l, d), _ = d("material.media-player.quality", "Quality");
|
|
181
|
+
return /* @__PURE__ */ B(s, { children: [/* @__PURE__ */ z(t, {
|
|
298
182
|
asChild: !0,
|
|
299
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ z(m, {
|
|
300
184
|
variant: "ghost",
|
|
301
185
|
"data-slot": "media-quality-menu",
|
|
302
|
-
className: e(
|
|
303
|
-
"aria-label": d("material.media-player.quality-value", "Quality {label}", { label:
|
|
304
|
-
children:
|
|
186
|
+
className: e(ee[o], "aspect-auto w-auto min-w-9 px-2 text-xs font-semibold tabular-nums pointer-coarse:h-11 pointer-coarse:min-w-11", c),
|
|
187
|
+
"aria-label": d("material.media-player.quality-value", "Quality {label}", { label: g.label }),
|
|
188
|
+
children: g.label
|
|
305
189
|
})
|
|
306
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ B(a, {
|
|
307
191
|
align: "end",
|
|
308
192
|
container: f,
|
|
309
|
-
children: [/* @__PURE__ */
|
|
310
|
-
value:
|
|
193
|
+
children: [/* @__PURE__ */ z(i, { children: _ }), /* @__PURE__ */ z(n, {
|
|
194
|
+
value: g.id,
|
|
311
195
|
onValueChange: (e) => u.setQuality(e),
|
|
312
|
-
children:
|
|
196
|
+
children: h.map((e) => /* @__PURE__ */ z(r, {
|
|
313
197
|
value: e.id,
|
|
314
198
|
children: e.label
|
|
315
199
|
}, e.id))
|
|
@@ -318,59 +202,59 @@ function bt({ tone: o = "surface", className: c }) {
|
|
|
318
202
|
}
|
|
319
203
|
//#endregion
|
|
320
204
|
//#region lib/components/ui/media/media-player/partials/atoms/settings-menu.tsx
|
|
321
|
-
function
|
|
322
|
-
let { state: e, actions: t } =
|
|
323
|
-
return /* @__PURE__ */
|
|
205
|
+
function ut() {
|
|
206
|
+
let { state: e, actions: t } = x("SettingsMenu"), { t: i } = p(), { entries: a, current: o } = ct(e, i);
|
|
207
|
+
return /* @__PURE__ */ z(n, {
|
|
324
208
|
value: o.id,
|
|
325
209
|
onValueChange: t.setQuality,
|
|
326
|
-
children: a.map((e) => /* @__PURE__ */
|
|
210
|
+
children: a.map((e) => /* @__PURE__ */ z(r, {
|
|
327
211
|
value: e.id,
|
|
328
212
|
children: e.label
|
|
329
213
|
}, e.id))
|
|
330
214
|
});
|
|
331
215
|
}
|
|
332
|
-
function
|
|
216
|
+
function dt(e, t) {
|
|
333
217
|
return [
|
|
334
218
|
"speed",
|
|
335
219
|
...e?.captions?.length ? ["captions"] : [],
|
|
336
220
|
...t.qualities.length > 0 ? ["quality"] : []
|
|
337
221
|
];
|
|
338
222
|
}
|
|
339
|
-
function
|
|
340
|
-
let { state: l, track: u, sliceActions: d } =
|
|
223
|
+
function ft({ tone: n = "surface", className: r }) {
|
|
224
|
+
let { state: l, track: u, sliceActions: d } = x("SettingsMenu"), { t: f } = p(), h = A(), g = f("material.media-player.settings", "Settings"), _ = {
|
|
341
225
|
speed: f("material.media-player.playback-rate", "Playback speed"),
|
|
342
226
|
captions: f("material.media-player.captions", "Captions"),
|
|
343
227
|
quality: f("material.media-player.quality", "Quality")
|
|
344
228
|
}, v = {
|
|
345
|
-
speed: /* @__PURE__ */
|
|
346
|
-
captions: /* @__PURE__ */
|
|
347
|
-
quality: /* @__PURE__ */
|
|
348
|
-
}, y =
|
|
229
|
+
speed: /* @__PURE__ */ z(E, {}),
|
|
230
|
+
captions: /* @__PURE__ */ z($e, {}),
|
|
231
|
+
quality: /* @__PURE__ */ z(ut, {})
|
|
232
|
+
}, y = dt(u, l).map((e) => ({
|
|
349
233
|
key: e,
|
|
350
234
|
label: _[e],
|
|
351
235
|
options: v[e]
|
|
352
236
|
}));
|
|
353
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ B(s, { children: [/* @__PURE__ */ z(t, {
|
|
354
238
|
asChild: !0,
|
|
355
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ z(m, {
|
|
356
240
|
variant: "ghost",
|
|
357
241
|
"data-slot": "media-settings-menu",
|
|
358
242
|
disabled: !u,
|
|
359
|
-
className: e(
|
|
360
|
-
"aria-label":
|
|
361
|
-
children: /* @__PURE__ */
|
|
243
|
+
className: e(w[n], r),
|
|
244
|
+
"aria-label": g,
|
|
245
|
+
children: /* @__PURE__ */ z(Ne, { className: "size-5" })
|
|
362
246
|
})
|
|
363
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ B(a, {
|
|
364
248
|
align: "end",
|
|
365
|
-
container:
|
|
249
|
+
container: h,
|
|
366
250
|
children: [
|
|
367
|
-
y.map((e, t) => /* @__PURE__ */
|
|
368
|
-
t > 0 && /* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
251
|
+
y.map((e, t) => /* @__PURE__ */ B(pe, { children: [
|
|
252
|
+
t > 0 && /* @__PURE__ */ z(o, {}),
|
|
253
|
+
/* @__PURE__ */ z(i, { children: e.label }),
|
|
370
254
|
e.options
|
|
371
255
|
] }, e.key)),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ z(o, {}),
|
|
257
|
+
/* @__PURE__ */ z(c, {
|
|
374
258
|
onSelect: () => d.setHelpOpen(!0),
|
|
375
259
|
children: f("material.media-player.shortcut.title", "Keyboard shortcuts")
|
|
376
260
|
})
|
|
@@ -380,22 +264,22 @@ function Ct({ tone: n = "surface", className: r }) {
|
|
|
380
264
|
//#endregion
|
|
381
265
|
//#region lib/components/ui/media/media-player/partials/atoms/skip-button.tsx
|
|
382
266
|
function q({ direction: t, tone: n = "surface", className: r }) {
|
|
383
|
-
let { tracks: i, actions: a, canNext: o } =
|
|
267
|
+
let { tracks: i, actions: a, canNext: o } = x("SkipButton"), { t: s } = p();
|
|
384
268
|
if (i.length < 2) return null;
|
|
385
|
-
let c = t === "next", l = c ?
|
|
386
|
-
return /* @__PURE__ */
|
|
269
|
+
let c = t === "next", l = c ? Ie : Fe, u = c ? s("material.media-player.next", "Next track") : s("material.media-player.previous", "Previous track");
|
|
270
|
+
return /* @__PURE__ */ z(m, {
|
|
387
271
|
variant: "ghost",
|
|
388
272
|
"data-slot": `media-${t}-button`,
|
|
389
|
-
className: e(
|
|
273
|
+
className: e(w[n], "aria-disabled:pointer-events-none aria-disabled:opacity-50", r),
|
|
390
274
|
"aria-disabled": c && !o ? !0 : void 0,
|
|
391
275
|
tooltip: u,
|
|
392
276
|
onClick: c ? a.next : a.prev,
|
|
393
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ z(l, { className: "size-5 fill-current" })
|
|
394
278
|
});
|
|
395
279
|
}
|
|
396
280
|
//#endregion
|
|
397
281
|
//#region lib/components/ui/media/media-player/partials/panels/use-transcript.ts
|
|
398
|
-
function
|
|
282
|
+
function pt(e, t) {
|
|
399
283
|
if (!e) return {};
|
|
400
284
|
if (e.transcript) return { source: e.transcript };
|
|
401
285
|
let n = e.captions ?? [], r = n.find((e) => t !== null && e.srclang === t) ?? n.find((e) => e.kind === "captions") ?? n[0];
|
|
@@ -404,8 +288,8 @@ function wt(e, t) {
|
|
|
404
288
|
lang: r.srclang
|
|
405
289
|
} : {};
|
|
406
290
|
}
|
|
407
|
-
function
|
|
408
|
-
let { source: n, lang: r } =
|
|
291
|
+
function mt(e, t) {
|
|
292
|
+
let { source: n, lang: r } = pt(e, t), i = typeof n == "string" && !O(n) ? n : void 0, a = D(i), o = I(() => n ? Xe(typeof n == "string" ? i ? a.cues : qe(n).cues : n) : [], [
|
|
409
293
|
n,
|
|
410
294
|
i,
|
|
411
295
|
a.cues
|
|
@@ -423,14 +307,14 @@ function Tt(e, t) {
|
|
|
423
307
|
}
|
|
424
308
|
//#endregion
|
|
425
309
|
//#region lib/components/ui/media/media-player/partials/panels/panel-kinds.tsx
|
|
426
|
-
function
|
|
310
|
+
function ht(e, t, n) {
|
|
427
311
|
if (!t || e === !1) return [];
|
|
428
|
-
let r = Array.isArray(t.chapters) ? t.chapters.length > 0 : !!t.chapters, i = !!
|
|
312
|
+
let r = Array.isArray(t.chapters) ? t.chapters.length > 0 : !!t.chapters, i = !!pt(t, n).source, a = [];
|
|
429
313
|
return typeof e == "object" ? ((e.chapters ?? r) && a.push("chapters"), (e.transcript ?? i) && a.push("transcript"), a) : e !== !0 && !r && !t.transcript ? [] : (r && a.push("chapters"), i && a.push("transcript"), a);
|
|
430
314
|
}
|
|
431
|
-
var
|
|
432
|
-
function
|
|
433
|
-
let { track: n, state: r, actions: i, panelKinds: a } =
|
|
315
|
+
var gt = me([]);
|
|
316
|
+
function _t({ panels: e, children: t }) {
|
|
317
|
+
let { track: n, state: r, actions: i, panelKinds: a } = x("MediaPlayer"), o = r.captions.enabled ? r.captions.lang : null, s = I(() => ht(e, n, o), [
|
|
434
318
|
e,
|
|
435
319
|
n,
|
|
436
320
|
o
|
|
@@ -442,17 +326,17 @@ function Ot({ panels: e, children: t }) {
|
|
|
442
326
|
a,
|
|
443
327
|
r.panel,
|
|
444
328
|
i
|
|
445
|
-
]), /* @__PURE__ */
|
|
329
|
+
]), /* @__PURE__ */ z(gt, {
|
|
446
330
|
value: s,
|
|
447
331
|
children: t
|
|
448
332
|
});
|
|
449
333
|
}
|
|
450
334
|
function J() {
|
|
451
|
-
return M(
|
|
335
|
+
return M(gt);
|
|
452
336
|
}
|
|
453
337
|
//#endregion
|
|
454
338
|
//#region lib/components/ui/media/media-player/partials/panels/panel-surface.ts
|
|
455
|
-
var Y =
|
|
339
|
+
var Y = me("page"), vt = `${tt} flex w-full items-baseline gap-3 px-3 py-2 text-start text-sm leading-snug outline-offset-[-2px] hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring pointer-coarse:min-h-11`, yt = "w-12 shrink-0 text-xs tabular-nums text-muted-foreground", bt = /* @__PURE__ */ new Set([
|
|
456
340
|
"PageUp",
|
|
457
341
|
"PageDown",
|
|
458
342
|
"Home",
|
|
@@ -461,14 +345,14 @@ var Y = ye("page"), kt = `${ft} flex w-full items-baseline gap-3 px-3 py-2 text-
|
|
|
461
345
|
"ArrowDown",
|
|
462
346
|
"Tab"
|
|
463
347
|
]);
|
|
464
|
-
function
|
|
348
|
+
function xt(e, t) {
|
|
465
349
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = r.top - n.top, a = e.clientHeight * .25;
|
|
466
350
|
i >= a && i + r.height <= e.clientHeight - a || (e.scrollTop += i - (e.clientHeight - r.height) / 2);
|
|
467
351
|
}
|
|
468
|
-
function
|
|
469
|
-
let r =
|
|
352
|
+
function St({ follow: e, current: t, onUserScroll: n }) {
|
|
353
|
+
let r = L(null), i = j((e) => {
|
|
470
354
|
let t = r.current, n = t?.querySelector(`[data-line="${e}"]`);
|
|
471
|
-
t && n &&
|
|
355
|
+
t && n && xt(t, n);
|
|
472
356
|
}, []);
|
|
473
357
|
return N(() => {
|
|
474
358
|
e && t >= 0 && i(t);
|
|
@@ -486,36 +370,36 @@ function Nt({ follow: e, current: t, onUserScroll: n }) {
|
|
|
486
370
|
e.target === e.currentTarget && n();
|
|
487
371
|
},
|
|
488
372
|
onKeyDown: (e) => {
|
|
489
|
-
|
|
373
|
+
bt.has(e.key) && n();
|
|
490
374
|
}
|
|
491
375
|
}
|
|
492
376
|
};
|
|
493
377
|
}
|
|
494
378
|
//#endregion
|
|
495
379
|
//#region lib/components/ui/media/media-player/partials/panels/chapter-list.tsx
|
|
496
|
-
function
|
|
497
|
-
let { chapters: e, current: t, seek: n } = W(), { t: r } =
|
|
380
|
+
function Ct() {
|
|
381
|
+
let { chapters: e, current: t, seek: n } = W(), { t: r } = p(), i = L(null);
|
|
498
382
|
return N(() => {
|
|
499
383
|
let e = i.current?.querySelector("[data-current]");
|
|
500
|
-
i.current && e &&
|
|
501
|
-
}, [t]), e.length === 0 ? /* @__PURE__ */
|
|
384
|
+
i.current && e && xt(i.current, e);
|
|
385
|
+
}, [t]), e.length === 0 ? /* @__PURE__ */ z("p", {
|
|
502
386
|
className: "px-3 py-4 text-sm text-muted-foreground",
|
|
503
387
|
children: r("material.media-player.panels.no-chapters", "No chapters")
|
|
504
|
-
}) : /* @__PURE__ */
|
|
388
|
+
}) : /* @__PURE__ */ z("div", {
|
|
505
389
|
ref: i,
|
|
506
390
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
507
|
-
children: /* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ z("ol", {
|
|
508
392
|
"data-slot": "media-chapter-list",
|
|
509
|
-
children: e.map((e, r) => /* @__PURE__ */
|
|
393
|
+
children: e.map((e, r) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {
|
|
510
394
|
type: "button",
|
|
511
395
|
"aria-current": r === t ? "true" : void 0,
|
|
512
396
|
"data-current": r === t ? "" : void 0,
|
|
513
397
|
onClick: () => n(e.start),
|
|
514
|
-
className:
|
|
515
|
-
children: [/* @__PURE__ */
|
|
516
|
-
className:
|
|
517
|
-
children:
|
|
518
|
-
}), /* @__PURE__ */
|
|
398
|
+
className: vt,
|
|
399
|
+
children: [/* @__PURE__ */ z("span", {
|
|
400
|
+
className: yt,
|
|
401
|
+
children: H(e.start)
|
|
402
|
+
}), /* @__PURE__ */ z("span", {
|
|
519
403
|
className: "min-w-0 flex-1 wrap-anywhere",
|
|
520
404
|
children: e.title
|
|
521
405
|
})]
|
|
@@ -525,15 +409,15 @@ function Pt() {
|
|
|
525
409
|
}
|
|
526
410
|
//#endregion
|
|
527
411
|
//#region lib/components/ui/media/media-player/partials/panels/transcript-follow.tsx
|
|
528
|
-
function
|
|
529
|
-
let { t: n } =
|
|
530
|
-
return /* @__PURE__ */
|
|
412
|
+
function wt({ following: e, onChange: t }) {
|
|
413
|
+
let { t: n } = p(), r = P();
|
|
414
|
+
return /* @__PURE__ */ B("div", {
|
|
531
415
|
className: "flex items-center justify-between gap-3 ps-1 pointer-coarse:min-h-11",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ z("label", {
|
|
533
417
|
htmlFor: r,
|
|
534
418
|
className: "text-sm",
|
|
535
419
|
children: n("material.media-player.panels.follow", "Follow playback")
|
|
536
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ z(g, {
|
|
537
421
|
id: r,
|
|
538
422
|
checked: e,
|
|
539
423
|
onCheckedChange: t
|
|
@@ -542,52 +426,52 @@ function Ft({ following: e, onChange: t }) {
|
|
|
542
426
|
}
|
|
543
427
|
//#endregion
|
|
544
428
|
//#region lib/components/ui/media/media-player/partials/panels/highlighted-text.tsx
|
|
545
|
-
function
|
|
546
|
-
let i =
|
|
429
|
+
function Tt({ text: e, query: t, active: n, locale: r }) {
|
|
430
|
+
let i = Re(e, t, r);
|
|
547
431
|
if (i.length === 0) return e;
|
|
548
432
|
let a = [], o = 0;
|
|
549
433
|
return i.forEach(([t, r], i) => {
|
|
550
|
-
t > o && a.push(e.slice(o, t)), a.push(/* @__PURE__ */
|
|
434
|
+
t > o && a.push(e.slice(o, t)), a.push(/* @__PURE__ */ z("mark", {
|
|
551
435
|
"data-active": n && i === 0 ? "" : void 0,
|
|
552
436
|
className: "rounded-sm bg-primary/25 px-px text-inherit data-[active]:bg-primary data-[active]:text-primary-foreground",
|
|
553
437
|
children: e.slice(t, r)
|
|
554
438
|
}, t)), o = r;
|
|
555
|
-
}), o < e.length && a.push(e.slice(o)), a.map((e, t) => /* @__PURE__ */
|
|
439
|
+
}), o < e.length && a.push(e.slice(o)), a.map((e, t) => /* @__PURE__ */ z(pe, { children: e }, t));
|
|
556
440
|
}
|
|
557
441
|
//#endregion
|
|
558
442
|
//#region lib/components/ui/media/media-player/partials/panels/transcript-list.tsx
|
|
559
|
-
function
|
|
560
|
-
let { t: l } =
|
|
561
|
-
return /* @__PURE__ */
|
|
443
|
+
function Et({ lines: e, current: t, query: n, activeLine: r, lang: i, locale: a, listRef: o, handlers: s, onSeek: c }) {
|
|
444
|
+
let { t: l } = p();
|
|
445
|
+
return /* @__PURE__ */ z("div", {
|
|
562
446
|
ref: o,
|
|
563
447
|
...s,
|
|
564
448
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
565
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ z("ol", {
|
|
566
450
|
"data-slot": "media-transcript-list",
|
|
567
451
|
"aria-label": l("material.media-player.panels.transcript", "Transcript"),
|
|
568
452
|
lang: i,
|
|
569
|
-
children: e.map((e, i) => /* @__PURE__ */
|
|
453
|
+
children: e.map((e, i) => /* @__PURE__ */ z("li", {
|
|
570
454
|
"data-line": i,
|
|
571
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ B("button", {
|
|
572
456
|
type: "button",
|
|
573
457
|
"aria-current": i === t ? "true" : void 0,
|
|
574
458
|
"data-current": i === t ? "" : void 0,
|
|
575
459
|
onClick: () => c(e.start),
|
|
576
|
-
className:
|
|
577
|
-
children: [/* @__PURE__ */
|
|
578
|
-
className:
|
|
579
|
-
children:
|
|
580
|
-
}), /* @__PURE__ */
|
|
460
|
+
className: vt,
|
|
461
|
+
children: [/* @__PURE__ */ z("span", {
|
|
462
|
+
className: yt,
|
|
463
|
+
children: H(e.start)
|
|
464
|
+
}), /* @__PURE__ */ B("span", {
|
|
581
465
|
className: "min-w-0 flex-1 wrap-anywhere",
|
|
582
|
-
children: [e.speaker && /* @__PURE__ */
|
|
466
|
+
children: [e.speaker && /* @__PURE__ */ z("b", {
|
|
583
467
|
className: "me-1.5 font-semibold",
|
|
584
|
-
children: /* @__PURE__ */
|
|
468
|
+
children: /* @__PURE__ */ z(Tt, {
|
|
585
469
|
text: e.speaker,
|
|
586
470
|
query: n,
|
|
587
471
|
active: !1,
|
|
588
472
|
locale: a
|
|
589
473
|
})
|
|
590
|
-
}), /* @__PURE__ */
|
|
474
|
+
}), /* @__PURE__ */ z(Tt, {
|
|
591
475
|
text: e.text,
|
|
592
476
|
query: n,
|
|
593
477
|
active: i === r,
|
|
@@ -601,9 +485,9 @@ function Lt({ lines: e, current: t, query: n, activeLine: r, lang: i, locale: a,
|
|
|
601
485
|
}
|
|
602
486
|
//#endregion
|
|
603
487
|
//#region lib/components/ui/media/media-player/partials/panels/transcript-notice.tsx
|
|
604
|
-
function
|
|
605
|
-
let { t } =
|
|
606
|
-
return /* @__PURE__ */
|
|
488
|
+
function Dt({ status: e }) {
|
|
489
|
+
let { t } = p();
|
|
490
|
+
return /* @__PURE__ */ z("p", {
|
|
607
491
|
role: "status",
|
|
608
492
|
className: "px-3 py-4 text-sm text-muted-foreground",
|
|
609
493
|
children: e === "loading" ? t("material.media-player.panels.loading", "Loading the transcript…") : e === "error" ? t("material.media-player.panels.unavailable", "Transcript unavailable") : t("material.media-player.panels.no-transcript", "No transcript for this track")
|
|
@@ -611,9 +495,9 @@ function Rt({ status: e }) {
|
|
|
611
495
|
}
|
|
612
496
|
//#endregion
|
|
613
497
|
//#region lib/components/ui/media/media-player/partials/panels/use-search-announcement.ts
|
|
614
|
-
var
|
|
615
|
-
function
|
|
616
|
-
let [n, r] =
|
|
498
|
+
var Ot = 500;
|
|
499
|
+
function kt(e, t) {
|
|
500
|
+
let [n, r] = R(""), i = I(() => ze(r, Ot), []);
|
|
617
501
|
return N(() => {
|
|
618
502
|
t || !e ? (i.cancel(), r(e)) : i(e);
|
|
619
503
|
}, [
|
|
@@ -622,22 +506,22 @@ function Bt(e, t) {
|
|
|
622
506
|
i
|
|
623
507
|
]), N(() => () => i.cancel(), [i]), n;
|
|
624
508
|
}
|
|
625
|
-
function
|
|
626
|
-
let { t: r } =
|
|
627
|
-
return
|
|
509
|
+
function At({ query: e, matches: t, active: n }) {
|
|
510
|
+
let { t: r } = p(), i = t.length;
|
|
511
|
+
return kt(e.trim() ? i === 0 ? r("material.media-player.panels.search-none", "No matches") : n >= 0 ? r("material.media-player.panels.search-position", "Match {position} of {count}", {
|
|
628
512
|
position: n + 1,
|
|
629
513
|
count: i
|
|
630
514
|
}) : r("material.media-player.panels.search-count", "{count, plural, one {# match} other {# matches}}", { count: i }) : "", n >= 0);
|
|
631
515
|
}
|
|
632
516
|
//#endregion
|
|
633
517
|
//#region lib/components/ui/media/media-player/partials/panels/transcript-search.tsx
|
|
634
|
-
function
|
|
635
|
-
let { t: n } =
|
|
636
|
-
return /* @__PURE__ */
|
|
518
|
+
function jt({ search: e, onStep: t }) {
|
|
519
|
+
let { t: n } = p(), { query: r, matches: i, active: a } = e, o = i.length, s = n("material.media-player.panels.search-prev", "Previous match"), c = n("material.media-player.panels.search-next", "Next match"), l = At(e);
|
|
520
|
+
return /* @__PURE__ */ B("div", {
|
|
637
521
|
"data-slot": "media-transcript-search",
|
|
638
522
|
className: "flex items-center gap-1",
|
|
639
523
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ z(h, {
|
|
641
525
|
type: "search",
|
|
642
526
|
value: r,
|
|
643
527
|
onChange: (t) => e.setQuery(t.target.value),
|
|
@@ -648,28 +532,28 @@ function Ht({ search: e, onStep: t }) {
|
|
|
648
532
|
placeholder: n("material.media-player.panels.search-placeholder", "Search"),
|
|
649
533
|
className: "h-9 w-auto min-w-0 flex-1 pointer-coarse:h-11"
|
|
650
534
|
}),
|
|
651
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ z("span", {
|
|
652
536
|
"aria-hidden": !0,
|
|
653
537
|
className: "min-w-12 text-center text-xs tabular-nums text-muted-foreground",
|
|
654
538
|
children: r.trim() ? a >= 0 ? `${a + 1}/${o}` : o : ""
|
|
655
539
|
}),
|
|
656
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ z(m, {
|
|
657
541
|
variant: "ghost",
|
|
658
542
|
tooltip: s,
|
|
659
543
|
disabled: o === 0,
|
|
660
544
|
onClick: () => t(-1),
|
|
661
545
|
className: "pointer-coarse:size-11",
|
|
662
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ z(be, { className: "size-4" })
|
|
663
547
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ z(m, {
|
|
665
549
|
variant: "ghost",
|
|
666
550
|
tooltip: c,
|
|
667
551
|
disabled: o === 0,
|
|
668
552
|
onClick: () => t(1),
|
|
669
553
|
className: "pointer-coarse:size-11",
|
|
670
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ z(ye, { className: "size-4" })
|
|
671
555
|
}),
|
|
672
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ z("p", {
|
|
673
557
|
role: "status",
|
|
674
558
|
"aria-live": "polite",
|
|
675
559
|
className: "sr-only",
|
|
@@ -680,17 +564,17 @@ function Ht({ search: e, onStep: t }) {
|
|
|
680
564
|
}
|
|
681
565
|
//#endregion
|
|
682
566
|
//#region lib/components/ui/media/media-player/partials/panels/use-current-line.ts
|
|
683
|
-
function
|
|
684
|
-
let n = j(() =>
|
|
685
|
-
return
|
|
567
|
+
function Mt(e, t) {
|
|
568
|
+
let n = j(() => We(t, e.getSnapshot()), [t, e]);
|
|
569
|
+
return he(e.subscribe, n, () => -1);
|
|
686
570
|
}
|
|
687
571
|
//#endregion
|
|
688
572
|
//#region lib/components/ui/media/media-player/partials/panels/use-transcript-search.ts
|
|
689
|
-
function
|
|
573
|
+
function Nt(e, t, n) {
|
|
690
574
|
return e < 0 ? n === 1 ? 0 : t - 1 : (e + n + t) % t;
|
|
691
575
|
}
|
|
692
|
-
function
|
|
693
|
-
let [n, r] =
|
|
576
|
+
function Pt(e, t) {
|
|
577
|
+
let [n, r] = R(""), [i, a] = R(-1), o = I(() => n.trim() ? Je(e, n, t) : [], [
|
|
694
578
|
e,
|
|
695
579
|
n,
|
|
696
580
|
t
|
|
@@ -705,45 +589,45 @@ function Gt(e, t) {
|
|
|
705
589
|
activeLine: c >= 0 ? o[c] : -1,
|
|
706
590
|
step: (e) => {
|
|
707
591
|
if (o.length === 0) return -1;
|
|
708
|
-
let t =
|
|
592
|
+
let t = Nt(c, o.length, e);
|
|
709
593
|
return a(t), o[t];
|
|
710
594
|
}
|
|
711
595
|
};
|
|
712
596
|
}
|
|
713
597
|
//#endregion
|
|
714
598
|
//#region lib/components/ui/media/media-player/partials/panels/transcript-panel.tsx
|
|
715
|
-
function
|
|
716
|
-
let { state: r, track: i, actions: a, timeStore: o } =
|
|
599
|
+
function Ft({ searchable: e = !0, follow: t, onFollowChange: n }) {
|
|
600
|
+
let { state: r, track: i, actions: a, timeStore: o } = x("MediaTranscript"), { language: s } = p(), c = mt(i, r.captions.enabled ? r.captions.lang : null), l = Pt(c.lines, c.lang ?? s), u = Mt(o, c.lines), d = t ?? r.transcriptFollow, f = (e) => {
|
|
717
601
|
n?.(e), t === void 0 && a.setTranscriptFollow(e);
|
|
718
|
-
},
|
|
602
|
+
}, m = St({
|
|
719
603
|
follow: d,
|
|
720
604
|
current: u,
|
|
721
605
|
onUserScroll: () => d && f(!1)
|
|
722
606
|
});
|
|
723
|
-
return c.status !== "ready" || c.lines.length === 0 ? /* @__PURE__ */
|
|
607
|
+
return c.status !== "ready" || c.lines.length === 0 ? /* @__PURE__ */ z(Dt, { status: c.status }) : /* @__PURE__ */ B("div", {
|
|
724
608
|
"data-slot": "media-transcript",
|
|
725
609
|
className: "flex min-h-0 flex-1 flex-col",
|
|
726
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ B("div", {
|
|
727
611
|
className: "flex flex-col gap-2 px-3 pb-2",
|
|
728
|
-
children: [e && /* @__PURE__ */
|
|
612
|
+
children: [e && /* @__PURE__ */ z(jt, {
|
|
729
613
|
search: l,
|
|
730
614
|
onStep: (e) => {
|
|
731
615
|
let t = l.step(e);
|
|
732
|
-
t < 0 || (f(!1),
|
|
616
|
+
t < 0 || (f(!1), m.reveal(t));
|
|
733
617
|
}
|
|
734
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ z(wt, {
|
|
735
619
|
following: d,
|
|
736
620
|
onChange: f
|
|
737
621
|
})]
|
|
738
|
-
}), /* @__PURE__ */
|
|
622
|
+
}), /* @__PURE__ */ z(Et, {
|
|
739
623
|
lines: c.lines,
|
|
740
624
|
current: u,
|
|
741
625
|
query: l.query,
|
|
742
626
|
activeLine: l.activeLine,
|
|
743
627
|
lang: c.lang,
|
|
744
628
|
locale: c.lang ?? s,
|
|
745
|
-
listRef:
|
|
746
|
-
handlers:
|
|
629
|
+
listRef: m.list,
|
|
630
|
+
handlers: m.handlers,
|
|
747
631
|
onSeek: a.seek
|
|
748
632
|
})]
|
|
749
633
|
});
|
|
@@ -751,38 +635,38 @@ function Kt({ searchable: e = !0, follow: t, onFollowChange: n }) {
|
|
|
751
635
|
//#endregion
|
|
752
636
|
//#region lib/components/ui/media/media-player/partials/panels/panel-tabs.tsx
|
|
753
637
|
var X = (e) => e.includes("transcript") ? "transcript" : e[0] ?? "chapters";
|
|
754
|
-
function
|
|
755
|
-
let { t: i } =
|
|
638
|
+
function It({ kinds: e, value: t, onValueChange: n, trailing: r }) {
|
|
639
|
+
let { t: i } = p(), a = {
|
|
756
640
|
chapters: i("material.media-player.chapters", "Chapters"),
|
|
757
641
|
transcript: i("material.media-player.panels.transcript", "Transcript")
|
|
758
642
|
}, o = {
|
|
759
|
-
chapters: /* @__PURE__ */
|
|
760
|
-
transcript: /* @__PURE__ */
|
|
643
|
+
chapters: /* @__PURE__ */ z(Ct, {}),
|
|
644
|
+
transcript: /* @__PURE__ */ z(Ft, {})
|
|
761
645
|
}, s = e.length === 1 ? e[0] : void 0;
|
|
762
|
-
return s ? /* @__PURE__ */
|
|
646
|
+
return s ? /* @__PURE__ */ B("div", {
|
|
763
647
|
className: "flex min-h-0 flex-1 flex-col gap-1",
|
|
764
|
-
children: [/* @__PURE__ */
|
|
648
|
+
children: [/* @__PURE__ */ B("div", {
|
|
765
649
|
className: "flex items-center gap-1 pe-1",
|
|
766
|
-
children: [/* @__PURE__ */
|
|
650
|
+
children: [/* @__PURE__ */ z("h2", {
|
|
767
651
|
className: "flex-1 px-3 py-2 text-sm font-semibold",
|
|
768
652
|
children: a[s]
|
|
769
653
|
}), r]
|
|
770
654
|
}), o[s]]
|
|
771
|
-
}) : /* @__PURE__ */
|
|
655
|
+
}) : /* @__PURE__ */ B(f, {
|
|
772
656
|
value: t,
|
|
773
657
|
defaultValue: X(e),
|
|
774
658
|
onValueChange: (e) => n?.(e),
|
|
775
659
|
className: "min-h-0 flex-1 gap-1",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
660
|
+
children: [/* @__PURE__ */ B("div", {
|
|
777
661
|
className: "flex items-center gap-1 pe-1",
|
|
778
|
-
children: [/* @__PURE__ */
|
|
662
|
+
children: [/* @__PURE__ */ z(u, {
|
|
779
663
|
className: "flex-1",
|
|
780
|
-
children: e.map((e) => /* @__PURE__ */
|
|
664
|
+
children: e.map((e) => /* @__PURE__ */ z(d, {
|
|
781
665
|
value: e,
|
|
782
666
|
children: a[e]
|
|
783
667
|
}, e))
|
|
784
668
|
}), r]
|
|
785
|
-
}), e.map((e) => /* @__PURE__ */
|
|
669
|
+
}), e.map((e) => /* @__PURE__ */ z(l, {
|
|
786
670
|
value: e,
|
|
787
671
|
className: "flex min-h-0 flex-1 flex-col",
|
|
788
672
|
children: o[e]
|
|
@@ -791,156 +675,156 @@ function qt({ kinds: e, value: t, onValueChange: n, trailing: r }) {
|
|
|
791
675
|
}
|
|
792
676
|
//#endregion
|
|
793
677
|
//#region lib/components/ui/media/media-player/partials/panels/panel-button.tsx
|
|
794
|
-
function
|
|
795
|
-
let { state: r, actions: i } =
|
|
678
|
+
function Lt({ tone: t = "surface", className: n }) {
|
|
679
|
+
let { state: r, actions: i } = x("PanelButton"), a = J(), { t: o } = p(), s = M(Y) === "lightbox";
|
|
796
680
|
if (a.length === 0 || !(r.fullscreen || s)) return null;
|
|
797
681
|
let c = r.panel !== null, l = o("material.media-player.panels.toggle", "Chapters and transcript");
|
|
798
|
-
return /* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ z(m, {
|
|
799
683
|
variant: "ghost",
|
|
800
684
|
"data-slot": "media-panel-button",
|
|
801
685
|
"aria-pressed": c,
|
|
802
|
-
className: e(
|
|
686
|
+
className: e(w[t], n),
|
|
803
687
|
tooltip: l,
|
|
804
688
|
onClick: () => i.openPanel(c ? null : X(a)),
|
|
805
|
-
children: /* @__PURE__ */
|
|
689
|
+
children: /* @__PURE__ */ z(Me, { className: "size-5" })
|
|
806
690
|
});
|
|
807
691
|
}
|
|
808
692
|
//#endregion
|
|
809
693
|
//#region lib/components/ui/media/media-player/partials/controls-row.tsx
|
|
810
|
-
var Z = "hidden @[32rem]:inline-flex",
|
|
694
|
+
var Z = "hidden @[32rem]:inline-flex", Rt = "@[32rem]:hidden", zt = "hidden @[26rem]:inline-flex";
|
|
811
695
|
function Q({ tone: t, className: n }) {
|
|
812
|
-
let { t: r } =
|
|
813
|
-
return /* @__PURE__ */
|
|
696
|
+
let { t: r } = p();
|
|
697
|
+
return /* @__PURE__ */ B("div", {
|
|
814
698
|
role: "group",
|
|
815
699
|
"aria-label": r("material.media-player.controls", "Player controls"),
|
|
816
700
|
"data-slot": "media-controls",
|
|
817
701
|
className: e("flex min-w-0 items-center gap-0.5 px-2 py-1.5", n),
|
|
818
702
|
children: [
|
|
819
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ z(q, {
|
|
820
704
|
direction: "prev",
|
|
821
705
|
tone: t
|
|
822
706
|
}),
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ z(_, { tone: t }),
|
|
708
|
+
/* @__PURE__ */ z(q, {
|
|
825
709
|
direction: "next",
|
|
826
710
|
tone: t
|
|
827
711
|
}),
|
|
828
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ z(le, {
|
|
829
713
|
direction: "back",
|
|
830
714
|
tone: t,
|
|
831
|
-
className:
|
|
715
|
+
className: zt
|
|
832
716
|
}),
|
|
833
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ z(le, {
|
|
834
718
|
direction: "forward",
|
|
835
719
|
tone: t,
|
|
836
|
-
className:
|
|
720
|
+
className: zt
|
|
837
721
|
}),
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ z(oe, { tone: t }),
|
|
723
|
+
/* @__PURE__ */ z(fe, { tone: t }),
|
|
724
|
+
/* @__PURE__ */ z("span", { className: "flex-1" }),
|
|
725
|
+
/* @__PURE__ */ z(G, {
|
|
842
726
|
tone: t,
|
|
843
727
|
className: Z
|
|
844
728
|
}),
|
|
845
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ z(K, {
|
|
846
730
|
tone: t,
|
|
847
731
|
className: Z
|
|
848
732
|
}),
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ z(Lt, { tone: t }),
|
|
734
|
+
/* @__PURE__ */ z(rt, { tone: t }),
|
|
735
|
+
/* @__PURE__ */ z(lt, {
|
|
852
736
|
tone: t,
|
|
853
737
|
className: Z
|
|
854
738
|
}),
|
|
855
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ z(T, {
|
|
856
740
|
tone: t,
|
|
857
741
|
className: Z
|
|
858
742
|
}),
|
|
859
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ z(et, {
|
|
860
744
|
tone: t,
|
|
861
745
|
className: Z
|
|
862
746
|
}),
|
|
863
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ z(ft, {
|
|
864
748
|
tone: t,
|
|
865
|
-
className:
|
|
749
|
+
className: Rt
|
|
866
750
|
}),
|
|
867
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ z(it, { tone: t })
|
|
868
752
|
]
|
|
869
753
|
});
|
|
870
754
|
}
|
|
871
755
|
//#endregion
|
|
872
756
|
//#region lib/components/ui/media/media-player/partials/timeline/chapter-markers.tsx
|
|
873
|
-
var
|
|
757
|
+
var Bt = {
|
|
874
758
|
overlay: "bg-white ring-1 ring-[rgb(8_10_20/0.6)]",
|
|
875
759
|
surface: "bg-foreground ring-1 ring-card"
|
|
876
760
|
};
|
|
877
|
-
function
|
|
878
|
-
let r =
|
|
879
|
-
return
|
|
761
|
+
function Vt({ at: t, tone: n }) {
|
|
762
|
+
let r = L(null);
|
|
763
|
+
return F(() => {
|
|
880
764
|
r.current?.style.setProperty("--media-chapter", `${(t * 100).toFixed(3)}%`);
|
|
881
|
-
}, [t]), /* @__PURE__ */
|
|
765
|
+
}, [t]), /* @__PURE__ */ z("span", {
|
|
882
766
|
ref: r,
|
|
883
767
|
"aria-hidden": !0,
|
|
884
768
|
"data-slot": "media-timeline-chapter",
|
|
885
|
-
className: e("absolute -inset-y-[3px] start-(--media-chapter) z-10 w-0.5 -translate-x-1/2 rounded-full rtl:translate-x-1/2",
|
|
769
|
+
className: e("absolute -inset-y-[3px] start-(--media-chapter) z-10 w-0.5 -translate-x-1/2 rounded-full rtl:translate-x-1/2", Bt[n])
|
|
886
770
|
});
|
|
887
771
|
}
|
|
888
|
-
function
|
|
889
|
-
return
|
|
772
|
+
function Ht({ chapters: e, duration: t, tone: n }) {
|
|
773
|
+
return He(e, t).map((e) => /* @__PURE__ */ z(Vt, {
|
|
890
774
|
at: e,
|
|
891
775
|
tone: n
|
|
892
776
|
}, e));
|
|
893
777
|
}
|
|
894
778
|
//#endregion
|
|
895
779
|
//#region lib/components/ui/media/media-player/partials/timeline/preview-offset.ts
|
|
896
|
-
function
|
|
780
|
+
function Ut(e, t, n, r) {
|
|
897
781
|
let i = n / 2, a = i - r, o = Math.max(a, t - i + r);
|
|
898
782
|
return Math.min(Math.max(e, a), o);
|
|
899
783
|
}
|
|
900
784
|
//#endregion
|
|
901
785
|
//#region lib/components/ui/media/media-player/partials/timeline/timeline-preview.tsx
|
|
902
|
-
var
|
|
903
|
-
function
|
|
786
|
+
var Wt = 8;
|
|
787
|
+
function Gt(e, t) {
|
|
904
788
|
let n = e.closest("[data-slot=\"media-player\"]");
|
|
905
789
|
if (!n) return 0;
|
|
906
790
|
let r = n.getBoundingClientRect();
|
|
907
|
-
return Math.max(0, Math.min(t.left - r.left, r.right - t.right) -
|
|
791
|
+
return Math.max(0, Math.min(t.left - r.left, r.right - t.right) - Wt);
|
|
908
792
|
}
|
|
909
|
-
function
|
|
793
|
+
function Kt(e, t) {
|
|
910
794
|
let n = (t, n) => e.style.setProperty(`--media-thumb-${t}`, n);
|
|
911
795
|
if (!t) return;
|
|
912
796
|
let r = t.width === 0, i = new URL(t.url, document.baseURI).href;
|
|
913
797
|
n("url", `url("${i.replace(/["\\\n\r]/g, encodeURIComponent)}")`), n("x", `${-t.x}px`), n("y", `${-t.y}px`), n("w", r ? "160px" : `${t.width}px`), n("h", r ? "90px" : `${t.height}px`);
|
|
914
798
|
}
|
|
915
|
-
function
|
|
916
|
-
let a =
|
|
917
|
-
return
|
|
799
|
+
function qt({ time: e, duration: t, chapters: n, thumbnails: r, trackRef: i }) {
|
|
800
|
+
let a = L(null), o = Ye(r, e), s = n[V(n, e)];
|
|
801
|
+
return F(() => {
|
|
918
802
|
let n = a.current, r = i.current?.getBoundingClientRect();
|
|
919
803
|
if (!n || !r) return;
|
|
920
|
-
|
|
921
|
-
let s =
|
|
804
|
+
Kt(n, o);
|
|
805
|
+
let s = Gt(n, r), c = Ut(t > 0 ? e / t * r.width : 0, r.width, n.offsetWidth, s);
|
|
922
806
|
n.style.setProperty("--media-preview-x", `${c.toFixed(1)}px`);
|
|
923
807
|
}, [
|
|
924
808
|
e,
|
|
925
809
|
t,
|
|
926
810
|
o,
|
|
927
811
|
i
|
|
928
|
-
]), /* @__PURE__ */
|
|
812
|
+
]), /* @__PURE__ */ B("div", {
|
|
929
813
|
ref: a,
|
|
930
814
|
"aria-hidden": !0,
|
|
931
815
|
"data-slot": "media-timeline-preview",
|
|
932
816
|
className: "pointer-events-none absolute bottom-full z-30 mb-3 w-max max-w-[min(14rem,80cqw)] start-(--media-preview-x) -translate-x-1/2 rounded-xl bg-[rgb(8_10_20/0.9)] p-1.5 text-center text-white shadow-lg ring-1 ring-white/15 rtl:translate-x-1/2",
|
|
933
817
|
children: [
|
|
934
|
-
o && /* @__PURE__ */
|
|
818
|
+
o && /* @__PURE__ */ z("div", {
|
|
935
819
|
"data-slot": "media-timeline-thumbnail",
|
|
936
820
|
className: "mx-auto hidden h-(--media-thumb-h) w-(--media-thumb-w) max-w-full rounded-md bg-(image:--media-thumb-url) bg-no-repeat @[26rem]:block [background-position:var(--media-thumb-x)_var(--media-thumb-y)]"
|
|
937
821
|
}),
|
|
938
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ z("b", {
|
|
939
823
|
"data-slot": "media-timeline-preview-time",
|
|
940
824
|
className: "mt-1 block text-xs font-semibold tabular-nums",
|
|
941
|
-
children:
|
|
825
|
+
children: H(e)
|
|
942
826
|
}),
|
|
943
|
-
s && /* @__PURE__ */
|
|
827
|
+
s && /* @__PURE__ */ z("span", {
|
|
944
828
|
"data-slot": "media-timeline-preview-chapter",
|
|
945
829
|
className: "block px-1 pb-0.5 text-[0.7rem] leading-tight text-white/90",
|
|
946
830
|
children: s.title
|
|
@@ -950,9 +834,9 @@ function an({ time: e, duration: t, chapters: n, thumbnails: r, trackRef: i }) {
|
|
|
950
834
|
}
|
|
951
835
|
//#endregion
|
|
952
836
|
//#region lib/components/ui/media/media-player/engine/use-track-thumbnails.ts
|
|
953
|
-
function
|
|
954
|
-
let t = e?.thumbnails, n = t && !
|
|
955
|
-
return
|
|
837
|
+
function Jt(e) {
|
|
838
|
+
let t = e?.thumbnails, n = t && !O(t) ? t : void 0, { cues: r } = D(n);
|
|
839
|
+
return I(() => t ? n ? U(r, n) : U(qe(t).cues) : [], [
|
|
956
840
|
t,
|
|
957
841
|
n,
|
|
958
842
|
r
|
|
@@ -960,17 +844,17 @@ function on(e) {
|
|
|
960
844
|
}
|
|
961
845
|
//#endregion
|
|
962
846
|
//#region lib/components/ui/media/media-player/partials/timeline/use-timeline-hover.ts
|
|
963
|
-
function
|
|
847
|
+
function Yt(e, { disabled: t, duration: n, rtl: r, box: i }) {
|
|
964
848
|
let a = i();
|
|
965
|
-
return t || !a || e.pointerType === "touch" ? null :
|
|
849
|
+
return t || !a || e.pointerType === "touch" ? null : ie(a, e.clientX, r()) * n;
|
|
966
850
|
}
|
|
967
|
-
function
|
|
968
|
-
let { disabled: t, duration: n, box: r, rtl: i } = e, [a, o] =
|
|
851
|
+
function Xt(e) {
|
|
852
|
+
let { disabled: t, duration: n, box: r, rtl: i } = e, [a, o] = R(null);
|
|
969
853
|
N(() => {
|
|
970
854
|
t && o(null);
|
|
971
855
|
}, [t]);
|
|
972
856
|
let s = j((e) => {
|
|
973
|
-
let a =
|
|
857
|
+
let a = Yt(e, {
|
|
974
858
|
disabled: t,
|
|
975
859
|
duration: n,
|
|
976
860
|
box: r,
|
|
@@ -994,20 +878,20 @@ function cn(e) {
|
|
|
994
878
|
}
|
|
995
879
|
//#endregion
|
|
996
880
|
//#region lib/components/ui/media/media-player/partials/timeline/use-track-geometry.ts
|
|
997
|
-
var
|
|
998
|
-
function
|
|
999
|
-
let r =
|
|
1000
|
-
return
|
|
881
|
+
var Zt = (e, t) => t > 0 ? `${Math.min(100, Math.max(0, e / t * 100)).toFixed(2)}%` : "0%";
|
|
882
|
+
function Qt(e, t, n) {
|
|
883
|
+
let r = L(null), i = L(null);
|
|
884
|
+
return $t(r, e, t, n), {
|
|
1001
885
|
rootRef: r,
|
|
1002
886
|
trackRef: i,
|
|
1003
|
-
rtl:
|
|
1004
|
-
box:
|
|
887
|
+
rtl: I(() => () => i.current ? getComputedStyle(i.current).direction === "rtl" : !1, []),
|
|
888
|
+
box: I(() => () => i.current?.getBoundingClientRect() ?? null, [])
|
|
1005
889
|
};
|
|
1006
890
|
}
|
|
1007
|
-
function
|
|
891
|
+
function $t(e, t, n, r) {
|
|
1008
892
|
N(() => {
|
|
1009
893
|
let i = e.current;
|
|
1010
|
-
i && (i.style.setProperty("--media-progress",
|
|
894
|
+
i && (i.style.setProperty("--media-progress", Zt(t, n)), i.style.setProperty("--media-buffered", Zt(r, n)));
|
|
1011
895
|
}, [
|
|
1012
896
|
e,
|
|
1013
897
|
t,
|
|
@@ -1017,25 +901,25 @@ function dn(e, t, n, r) {
|
|
|
1017
901
|
}
|
|
1018
902
|
//#endregion
|
|
1019
903
|
//#region lib/components/ui/media/media-player/partials/timeline/use-value-text.ts
|
|
1020
|
-
function
|
|
904
|
+
function en(e, t, n, r) {
|
|
1021
905
|
let i = r("material.media-player.timeline-value", "{current} of {duration}", {
|
|
1022
|
-
current:
|
|
1023
|
-
duration:
|
|
1024
|
-
}), a =
|
|
906
|
+
current: ce(e, r),
|
|
907
|
+
duration: ce(t, r)
|
|
908
|
+
}), a = V(n, e), o = n[a];
|
|
1025
909
|
return o ? r("material.media-player.timeline-value-chapter", "{value}, chapter {index}: {title}", {
|
|
1026
910
|
value: i,
|
|
1027
911
|
index: a + 1,
|
|
1028
912
|
title: o.title
|
|
1029
913
|
}) : i;
|
|
1030
914
|
}
|
|
1031
|
-
function
|
|
1032
|
-
let { t: r } =
|
|
1033
|
-
return
|
|
915
|
+
function tn(e, t, n) {
|
|
916
|
+
let { t: r } = p();
|
|
917
|
+
return en(e, t, n, r);
|
|
1034
918
|
}
|
|
1035
919
|
//#endregion
|
|
1036
920
|
//#region lib/components/ui/media/media-player/partials/timeline/use-timeline.ts
|
|
1037
|
-
function
|
|
1038
|
-
let { state: e, track: t, actions: n, timeStore: r } =
|
|
921
|
+
function nn() {
|
|
922
|
+
let { state: e, track: t, actions: n, timeStore: r } = x("Timeline"), i = C(r), [a, o] = R(null), s = e.duration || t?.duration || 0, c = a ?? i, l = !y(e) || e.status === "error", u = k(t, s), d = Jt(t), f = Qt(c, s, e.bufferedEnd), { rtl: p, box: m } = f, { seek: h } = n, g = e.duration, _ = I(() => ue({
|
|
1039
923
|
disabled: l,
|
|
1040
924
|
duration: g,
|
|
1041
925
|
rtl: p,
|
|
@@ -1050,7 +934,7 @@ function mn() {
|
|
|
1050
934
|
r,
|
|
1051
935
|
p,
|
|
1052
936
|
m
|
|
1053
|
-
]), { hover: v, handlers:
|
|
937
|
+
]), { hover: v, handlers: b } = Xt({
|
|
1054
938
|
disabled: l,
|
|
1055
939
|
duration: s,
|
|
1056
940
|
box: m,
|
|
@@ -1064,21 +948,21 @@ function mn() {
|
|
|
1064
948
|
disabled: l,
|
|
1065
949
|
chapters: u,
|
|
1066
950
|
thumbnails: d,
|
|
1067
|
-
valueText:
|
|
951
|
+
valueText: tn(c, s, u),
|
|
1068
952
|
previewTime: a ?? v,
|
|
1069
953
|
handlers: {
|
|
1070
954
|
..._,
|
|
1071
|
-
onPointerEnter:
|
|
1072
|
-
onPointerLeave:
|
|
955
|
+
onPointerEnter: b.onPointerEnter,
|
|
956
|
+
onPointerLeave: b.onPointerLeave,
|
|
1073
957
|
onPointerMove: (e) => {
|
|
1074
|
-
_.onPointerMove(e),
|
|
958
|
+
_.onPointerMove(e), b.onPointerMove(e);
|
|
1075
959
|
}
|
|
1076
960
|
}
|
|
1077
961
|
};
|
|
1078
962
|
}
|
|
1079
963
|
//#endregion
|
|
1080
964
|
//#region lib/components/ui/media/media-player/partials/timeline/timeline.tsx
|
|
1081
|
-
var
|
|
965
|
+
var rn = {
|
|
1082
966
|
overlay: {
|
|
1083
967
|
track: "bg-white/30",
|
|
1084
968
|
buffered: "bg-white/45",
|
|
@@ -1095,8 +979,8 @@ var hn = {
|
|
|
1095
979
|
}
|
|
1096
980
|
};
|
|
1097
981
|
function $({ tone: t = "surface", className: n }) {
|
|
1098
|
-
let { t: r } =
|
|
1099
|
-
return /* @__PURE__ */
|
|
982
|
+
let { t: r } = p(), i = nn(), a = rn[t], o = Math.floor(Math.min(i.time, i.duration));
|
|
983
|
+
return /* @__PURE__ */ B("div", {
|
|
1100
984
|
ref: i.rootRef,
|
|
1101
985
|
role: "slider",
|
|
1102
986
|
tabIndex: i.disabled ? -1 : 0,
|
|
@@ -1110,32 +994,32 @@ function $({ tone: t = "surface", className: n }) {
|
|
|
1110
994
|
"data-slot": "media-timeline",
|
|
1111
995
|
...i.handlers,
|
|
1112
996
|
className: e("group/timeline relative flex h-6 w-full cursor-pointer touch-none items-center rounded-sm outline-offset-2 focus-visible:outline-2 pointer-coarse:h-11 aria-disabled:cursor-default", a.ring, n),
|
|
1113
|
-
children: [/* @__PURE__ */
|
|
997
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1114
998
|
ref: i.trackRef,
|
|
1115
999
|
className: e("relative h-1 w-full rounded-full transition-[height] group-hover/timeline:h-1.5 motion-reduce:transition-none", a.track),
|
|
1116
1000
|
children: [
|
|
1117
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ z("span", {
|
|
1118
1002
|
"aria-hidden": !0,
|
|
1119
1003
|
"data-slot": "media-timeline-buffered",
|
|
1120
1004
|
className: e("absolute inset-y-0 start-0 w-(--media-buffered) rounded-full", a.buffered)
|
|
1121
1005
|
}),
|
|
1122
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ z("span", {
|
|
1123
1007
|
"aria-hidden": !0,
|
|
1124
1008
|
"data-slot": "media-timeline-fill",
|
|
1125
1009
|
className: e("absolute -inset-y-px start-0 w-(--media-progress) rounded-full", a.fill)
|
|
1126
1010
|
}),
|
|
1127
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ z(Ht, {
|
|
1128
1012
|
chapters: i.chapters,
|
|
1129
1013
|
duration: i.duration,
|
|
1130
1014
|
tone: t
|
|
1131
1015
|
}),
|
|
1132
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ z("span", {
|
|
1133
1017
|
"aria-hidden": !0,
|
|
1134
1018
|
"data-slot": "media-timeline-thumb",
|
|
1135
1019
|
className: e("absolute top-1/2 start-(--media-progress) z-20 size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full group-aria-disabled/timeline:hidden rtl:translate-x-1/2", a.thumb)
|
|
1136
1020
|
})
|
|
1137
1021
|
]
|
|
1138
|
-
}), i.previewTime !== null && /* @__PURE__ */
|
|
1022
|
+
}), i.previewTime !== null && /* @__PURE__ */ z(qt, {
|
|
1139
1023
|
time: i.previewTime,
|
|
1140
1024
|
duration: i.duration,
|
|
1141
1025
|
chapters: i.chapters,
|
|
@@ -1146,49 +1030,49 @@ function $({ tone: t = "surface", className: n }) {
|
|
|
1146
1030
|
}
|
|
1147
1031
|
//#endregion
|
|
1148
1032
|
//#region lib/components/ui/media/media-player/partials/controls-below.tsx
|
|
1149
|
-
function
|
|
1150
|
-
return /* @__PURE__ */
|
|
1033
|
+
function an() {
|
|
1034
|
+
return /* @__PURE__ */ B("div", {
|
|
1151
1035
|
"data-slot": "media-controls-below",
|
|
1152
1036
|
className: "border-t bg-card px-1 pt-1 pb-1 text-card-foreground",
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1037
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1154
1038
|
className: "px-3",
|
|
1155
|
-
children: /* @__PURE__ */
|
|
1156
|
-
}), /* @__PURE__ */
|
|
1039
|
+
children: /* @__PURE__ */ z($, { tone: "surface" })
|
|
1040
|
+
}), /* @__PURE__ */ z(Q, { tone: "surface" })]
|
|
1157
1041
|
});
|
|
1158
1042
|
}
|
|
1159
1043
|
//#endregion
|
|
1160
1044
|
//#region lib/components/ui/media/media-player/partials/panels/glass-drawer.tsx
|
|
1161
|
-
function
|
|
1162
|
-
let { state: e, actions: t, rootRef: n } =
|
|
1045
|
+
function on() {
|
|
1046
|
+
let { state: e, actions: t, rootRef: n } = x("GlassDrawer"), r = J(), { t: i } = p(), a = L(null), o = i("material.media-player.panels.toggle", "Chapters and transcript");
|
|
1163
1047
|
return N(() => {
|
|
1164
1048
|
(a.current?.querySelector("[role=\"tab\"][data-state=\"active\"]") ?? a.current?.querySelector("button"))?.focus();
|
|
1165
1049
|
let e = n.current;
|
|
1166
1050
|
return () => {
|
|
1167
1051
|
(e?.querySelector("[data-slot=\"media-panel-button\"]") ?? e?.querySelector("[data-slot=\"media-fullscreen-button\"]"))?.focus();
|
|
1168
1052
|
};
|
|
1169
|
-
}, [n]), e.panel ? /* @__PURE__ */
|
|
1053
|
+
}, [n]), e.panel ? /* @__PURE__ */ z("div", {
|
|
1170
1054
|
ref: a,
|
|
1171
1055
|
role: "group",
|
|
1172
1056
|
"aria-label": o,
|
|
1173
1057
|
"data-slot": "media-panel-drawer",
|
|
1174
1058
|
className: "dark absolute inset-x-0 bottom-0 z-30 flex h-[62%] flex-col rounded-t-2xl border-t border-white/15 bg-background/80 pt-1 pb-[env(safe-area-inset-bottom)] text-foreground shadow-2xl backdrop-blur-xl @[40rem]:inset-y-0 @[40rem]:end-0 @[40rem]:inset-x-auto @[40rem]:h-auto @[40rem]:w-96 @[40rem]:rounded-none @[40rem]:border-t-0 @[40rem]:border-s",
|
|
1175
|
-
children: /* @__PURE__ */
|
|
1059
|
+
children: /* @__PURE__ */ z(It, {
|
|
1176
1060
|
kinds: r,
|
|
1177
1061
|
value: r.includes(e.panel) ? e.panel : X(r),
|
|
1178
1062
|
onValueChange: t.openPanel,
|
|
1179
|
-
trailing: /* @__PURE__ */
|
|
1063
|
+
trailing: /* @__PURE__ */ z(m, {
|
|
1180
1064
|
variant: "ghost",
|
|
1181
1065
|
tooltip: i("material.media-player.panels.close", "Close panel"),
|
|
1182
1066
|
onClick: () => t.openPanel(null),
|
|
1183
1067
|
className: "pointer-coarse:size-11",
|
|
1184
|
-
children: /* @__PURE__ */
|
|
1068
|
+
children: /* @__PURE__ */ z(Le, { className: "size-5" })
|
|
1185
1069
|
})
|
|
1186
1070
|
})
|
|
1187
1071
|
}) : null;
|
|
1188
1072
|
}
|
|
1189
1073
|
//#endregion
|
|
1190
1074
|
//#region lib/components/ui/media/media-player/partials/panels/panel-layout.tsx
|
|
1191
|
-
var
|
|
1075
|
+
var sn = {
|
|
1192
1076
|
auto: {
|
|
1193
1077
|
grid: "@[64rem]:grid @[64rem]:grid-cols-[minmax(0,1fr)_22rem]",
|
|
1194
1078
|
panel: "border-t @[64rem]:border-t-0 @[64rem]:border-s",
|
|
@@ -1205,73 +1089,73 @@ var vn = {
|
|
|
1205
1089
|
inner: "h-80"
|
|
1206
1090
|
}
|
|
1207
1091
|
};
|
|
1208
|
-
function
|
|
1209
|
-
let r = J(), { state: i } =
|
|
1210
|
-
return /* @__PURE__ */
|
|
1092
|
+
function cn({ placement: t = "auto", children: n }) {
|
|
1093
|
+
let r = J(), { state: i } = x("MediaPlayer"), a = sn[t], o = M(Y) === "lightbox", s = r.length > 0, c = s && !o;
|
|
1094
|
+
return /* @__PURE__ */ B("div", {
|
|
1211
1095
|
"data-slot": "media-panel-layout",
|
|
1212
1096
|
className: e(c && a.grid, "group-data-fullscreen/media-player:contents!"),
|
|
1213
1097
|
children: [
|
|
1214
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ z("div", {
|
|
1215
1099
|
className: "min-w-0 group-data-fullscreen/media-player:contents",
|
|
1216
1100
|
children: n
|
|
1217
1101
|
}),
|
|
1218
|
-
c && !i.fullscreen && /* @__PURE__ */
|
|
1102
|
+
c && !i.fullscreen && /* @__PURE__ */ z("div", {
|
|
1219
1103
|
"data-slot": "media-panel",
|
|
1220
1104
|
className: e("relative bg-card text-card-foreground", a.panel),
|
|
1221
|
-
children: /* @__PURE__ */
|
|
1105
|
+
children: /* @__PURE__ */ z("div", {
|
|
1222
1106
|
className: e("flex flex-col py-1", a.inner),
|
|
1223
|
-
children: /* @__PURE__ */
|
|
1107
|
+
children: /* @__PURE__ */ z(It, { kinds: r })
|
|
1224
1108
|
})
|
|
1225
1109
|
}),
|
|
1226
|
-
s && i.fullscreen && i.panel && /* @__PURE__ */
|
|
1110
|
+
s && i.fullscreen && i.panel && /* @__PURE__ */ z(on, {})
|
|
1227
1111
|
]
|
|
1228
1112
|
});
|
|
1229
1113
|
}
|
|
1230
1114
|
//#endregion
|
|
1231
1115
|
//#region lib/components/ui/media/media-player/partials/playlist-item.tsx
|
|
1232
|
-
var
|
|
1116
|
+
var ln = {
|
|
1233
1117
|
overlay: "text-white hover:bg-white/10 focus-visible:outline-white aria-[current=true]:bg-white/10 before:bg-white",
|
|
1234
1118
|
surface: "text-foreground hover:bg-accent focus-visible:outline-ring aria-[current=true]:bg-primary-text/10 before:bg-primary-text"
|
|
1235
|
-
},
|
|
1119
|
+
}, un = {
|
|
1236
1120
|
overlay: "text-white/85",
|
|
1237
1121
|
surface: "text-muted-foreground"
|
|
1238
|
-
},
|
|
1122
|
+
}, dn = {
|
|
1239
1123
|
overlay: "bg-white/10 text-white",
|
|
1240
1124
|
surface: "bg-muted text-muted-foreground"
|
|
1241
1125
|
};
|
|
1242
|
-
function
|
|
1243
|
-
let r = t.artwork ?? t.poster, i = t.kind === "audio" ?
|
|
1244
|
-
return /* @__PURE__ */
|
|
1126
|
+
function fn({ track: t, tone: n }) {
|
|
1127
|
+
let r = t.artwork ?? t.poster, i = t.kind === "audio" ? ke : we;
|
|
1128
|
+
return /* @__PURE__ */ z("span", {
|
|
1245
1129
|
"aria-hidden": !0,
|
|
1246
|
-
className: e("flex aspect-video w-[4.5rem] shrink-0 items-center justify-center overflow-hidden rounded-md",
|
|
1247
|
-
children: r ? /* @__PURE__ */
|
|
1130
|
+
className: e("flex aspect-video w-[4.5rem] shrink-0 items-center justify-center overflow-hidden rounded-md", dn[n]),
|
|
1131
|
+
children: r ? /* @__PURE__ */ z("img", {
|
|
1248
1132
|
src: r,
|
|
1249
1133
|
alt: "",
|
|
1250
1134
|
loading: "lazy",
|
|
1251
1135
|
decoding: "async",
|
|
1252
1136
|
className: "size-full object-cover"
|
|
1253
|
-
}) : /* @__PURE__ */
|
|
1137
|
+
}) : /* @__PURE__ */ z(i, { className: "size-5" })
|
|
1254
1138
|
});
|
|
1255
1139
|
}
|
|
1256
|
-
function
|
|
1257
|
-
let o = r && i || t.duration, s = [t.artist, o ?
|
|
1258
|
-
return /* @__PURE__ */
|
|
1140
|
+
function pn({ track: t, tone: n, current: r, duration: i, onPlay: a }) {
|
|
1141
|
+
let o = r && i || t.duration, s = [t.artist, o ? H(o) : null].filter(Boolean).join(" · ");
|
|
1142
|
+
return /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {
|
|
1259
1143
|
type: "button",
|
|
1260
1144
|
"data-slot": "media-playlist-item",
|
|
1261
1145
|
"aria-current": r ? "true" : void 0,
|
|
1262
1146
|
onClick: a,
|
|
1263
|
-
className: e("relative flex w-full items-center gap-3 px-4 py-2 text-start outline-offset-[-2px] focus-visible:outline-2 pointer-coarse:min-h-11", "before:absolute before:inset-y-1.5 before:start-0 before:hidden before:w-0.5 before:rounded-none before:content-[''] aria-[current=true]:before:block",
|
|
1264
|
-
children: [/* @__PURE__ */
|
|
1147
|
+
className: e("relative flex w-full items-center gap-3 px-4 py-2 text-start outline-offset-[-2px] focus-visible:outline-2 pointer-coarse:min-h-11", "before:absolute before:inset-y-1.5 before:start-0 before:hidden before:w-0.5 before:rounded-none before:content-[''] aria-[current=true]:before:block", ln[n]),
|
|
1148
|
+
children: [/* @__PURE__ */ z(fn, {
|
|
1265
1149
|
track: t,
|
|
1266
1150
|
tone: n
|
|
1267
|
-
}), /* @__PURE__ */
|
|
1151
|
+
}), /* @__PURE__ */ B("span", {
|
|
1268
1152
|
className: "min-w-0 flex-1",
|
|
1269
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1270
1154
|
"data-slot": "media-playlist-title",
|
|
1271
1155
|
className: e("block truncate text-sm", r ? "font-semibold" : "font-medium"),
|
|
1272
1156
|
children: t.title
|
|
1273
|
-
}), s && /* @__PURE__ */
|
|
1274
|
-
className: e("block truncate text-xs tabular-nums",
|
|
1157
|
+
}), s && /* @__PURE__ */ z("span", {
|
|
1158
|
+
className: e("block truncate text-xs tabular-nums", un[n]),
|
|
1275
1159
|
children: s
|
|
1276
1160
|
})]
|
|
1277
1161
|
})]
|
|
@@ -1279,9 +1163,9 @@ function wn({ track: t, tone: n, current: r, duration: i, onPlay: a }) {
|
|
|
1279
1163
|
}
|
|
1280
1164
|
//#endregion
|
|
1281
1165
|
//#region lib/components/ui/media/media-player/partials/playlist-list.tsx
|
|
1282
|
-
var
|
|
1283
|
-
function
|
|
1284
|
-
let t =
|
|
1166
|
+
var mn = "@[32rem]:hidden";
|
|
1167
|
+
function hn(e) {
|
|
1168
|
+
let t = L(null);
|
|
1285
1169
|
return N(() => {
|
|
1286
1170
|
let e = t.current, n = e?.querySelector("[aria-current=\"true\"]");
|
|
1287
1171
|
if (!e || !n) return;
|
|
@@ -1289,33 +1173,33 @@ function En(e) {
|
|
|
1289
1173
|
(r < e.scrollTop || r + n.offsetHeight > e.scrollTop + e.clientHeight) && (e.scrollTop = r - (e.clientHeight - n.offsetHeight) / 2);
|
|
1290
1174
|
}, [e]), t;
|
|
1291
1175
|
}
|
|
1292
|
-
function
|
|
1293
|
-
let { tracks: a, state: o, actions: s } =
|
|
1294
|
-
return /* @__PURE__ */
|
|
1176
|
+
function gn({ tone: t, heading: n, className: r, listClassName: i }) {
|
|
1177
|
+
let { tracks: a, state: o, actions: s } = x("PlaylistList"), { t: c } = p(), l = P(), u = hn(o.index);
|
|
1178
|
+
return /* @__PURE__ */ B("div", {
|
|
1295
1179
|
"data-slot": "media-playlist",
|
|
1296
1180
|
className: e("border-t group-data-fullscreen/media-player:hidden", t === "overlay" ? "border-white/15" : "border-border", r),
|
|
1297
|
-
children: [/* @__PURE__ */
|
|
1181
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1298
1182
|
className: "flex min-h-10 items-center gap-1 ps-4 pe-2",
|
|
1299
1183
|
children: [
|
|
1300
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ z("p", {
|
|
1301
1185
|
id: l,
|
|
1302
|
-
className: e("flex-1 text-sm font-medium",
|
|
1186
|
+
className: e("flex-1 text-sm font-medium", ne[t]),
|
|
1303
1187
|
children: n ?? c("material.media-player.playlist", "Playlist")
|
|
1304
1188
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ z(G, {
|
|
1306
1190
|
tone: t,
|
|
1307
|
-
className:
|
|
1191
|
+
className: mn
|
|
1308
1192
|
}),
|
|
1309
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ z(K, {
|
|
1310
1194
|
tone: t,
|
|
1311
|
-
className:
|
|
1195
|
+
className: mn
|
|
1312
1196
|
})
|
|
1313
1197
|
]
|
|
1314
|
-
}), /* @__PURE__ */
|
|
1198
|
+
}), /* @__PURE__ */ z("ul", {
|
|
1315
1199
|
ref: u,
|
|
1316
1200
|
"aria-labelledby": l,
|
|
1317
1201
|
className: e("relative max-h-72 overflow-y-auto pb-1", i),
|
|
1318
|
-
children: a.map((e, n) => /* @__PURE__ */
|
|
1202
|
+
children: a.map((e, n) => /* @__PURE__ */ z(pn, {
|
|
1319
1203
|
track: e,
|
|
1320
1204
|
tone: t,
|
|
1321
1205
|
current: n === o.index,
|
|
@@ -1327,7 +1211,7 @@ function Dn({ tone: t, heading: n, className: r, listClassName: i }) {
|
|
|
1327
1211
|
}
|
|
1328
1212
|
//#endregion
|
|
1329
1213
|
//#region lib/components/ui/media/media-player/partials/status-text.ts
|
|
1330
|
-
function
|
|
1214
|
+
function _n(e, t) {
|
|
1331
1215
|
switch (e?.code) {
|
|
1332
1216
|
case 1: return t("material.media-player.error.aborted", "Playback was interrupted.");
|
|
1333
1217
|
case 2: return t("material.media-player.error.network", "A network error stopped the download. Check your connection and try again.");
|
|
@@ -1338,8 +1222,8 @@ function On(e, t) {
|
|
|
1338
1222
|
}
|
|
1339
1223
|
//#endregion
|
|
1340
1224
|
//#region lib/components/ui/media/media-player/partials/idle-timer.ts
|
|
1341
|
-
var
|
|
1342
|
-
function
|
|
1225
|
+
var vn = 3e3;
|
|
1226
|
+
function yn(e, t, n = vn) {
|
|
1343
1227
|
let r = null, i = () => {
|
|
1344
1228
|
r && clearTimeout(r), r = null;
|
|
1345
1229
|
}, a = () => {
|
|
@@ -1352,20 +1236,20 @@ function An(e, t, n = kn) {
|
|
|
1352
1236
|
clear: i
|
|
1353
1237
|
};
|
|
1354
1238
|
}
|
|
1355
|
-
function
|
|
1239
|
+
function bn(e) {
|
|
1356
1240
|
return !e.running || e.idle || e.held ? "wake" : "hide";
|
|
1357
1241
|
}
|
|
1358
|
-
function
|
|
1242
|
+
function xn(e, t) {
|
|
1359
1243
|
return !(e === "touch" && t);
|
|
1360
1244
|
}
|
|
1361
1245
|
//#endregion
|
|
1362
1246
|
//#region lib/components/ui/media/media-player/partials/use-controls-visibility.ts
|
|
1363
|
-
function
|
|
1247
|
+
function Sn(e) {
|
|
1364
1248
|
return e ? e.matches(":has(:focus-visible)") || e.querySelector("[aria-expanded=\"true\"]") !== null : !1;
|
|
1365
1249
|
}
|
|
1366
|
-
function
|
|
1367
|
-
let [r, i] =
|
|
1368
|
-
a.current ??=
|
|
1250
|
+
function Cn(e, t, n) {
|
|
1251
|
+
let [r, i] = R(!1), a = L(null);
|
|
1252
|
+
a.current ??= yn(() => i(!0), () => Sn(e.current));
|
|
1369
1253
|
let o = n && t, s = j(() => {
|
|
1370
1254
|
i(!1), o && a.current?.arm();
|
|
1371
1255
|
}, [o]);
|
|
@@ -1374,10 +1258,10 @@ function Pn(e, t, n) {
|
|
|
1374
1258
|
return o ? e?.arm() : (e?.clear(), i(!1)), () => e?.clear();
|
|
1375
1259
|
}, [o]);
|
|
1376
1260
|
let c = j(() => {
|
|
1377
|
-
if (
|
|
1261
|
+
if (bn({
|
|
1378
1262
|
running: o,
|
|
1379
1263
|
idle: r,
|
|
1380
|
-
held:
|
|
1264
|
+
held: Sn(e.current)
|
|
1381
1265
|
}) === "wake") return s();
|
|
1382
1266
|
a.current?.clear(), i(!0);
|
|
1383
1267
|
}, [
|
|
@@ -1394,8 +1278,8 @@ function Pn(e, t, n) {
|
|
|
1394
1278
|
}
|
|
1395
1279
|
//#endregion
|
|
1396
1280
|
//#region lib/components/ui/media/media-player/partials/use-frame-handlers.ts
|
|
1397
|
-
function
|
|
1398
|
-
let { rootRef: n, state: r, actions: i } =
|
|
1281
|
+
function wn(e, t) {
|
|
1282
|
+
let { rootRef: n, state: r, actions: i } = x("MediaPlayer"), a = Cn(n, r.isPlaying, e);
|
|
1399
1283
|
return {
|
|
1400
1284
|
controlsState: e ? a.hidden ? "hidden" : "visible" : "static",
|
|
1401
1285
|
onTouchTap: a.tap,
|
|
@@ -1406,74 +1290,74 @@ function Fn(e, t) {
|
|
|
1406
1290
|
a.wake(), t.onKeyDown?.(e);
|
|
1407
1291
|
},
|
|
1408
1292
|
onPointerMove(e) {
|
|
1409
|
-
t.onPointerMove?.(e),
|
|
1293
|
+
t.onPointerMove?.(e), xn(e.pointerType, !1) && a.wake();
|
|
1410
1294
|
},
|
|
1411
1295
|
onPointerDown(e) {
|
|
1412
1296
|
t.onPointerDown?.(e);
|
|
1413
1297
|
let n = e.target.dataset.slot === "media-surface";
|
|
1414
|
-
|
|
1298
|
+
xn(e.pointerType, n) && a.wake();
|
|
1415
1299
|
}
|
|
1416
1300
|
};
|
|
1417
1301
|
}
|
|
1418
1302
|
//#endregion
|
|
1419
1303
|
//#region lib/components/ui/media/media-player/partials/caption-overlay.tsx
|
|
1420
|
-
function
|
|
1421
|
-
return
|
|
1304
|
+
function Tn(e, t) {
|
|
1305
|
+
return Ve(e, t).flatMap((e) => e.text.split("\n"));
|
|
1422
1306
|
}
|
|
1423
|
-
function
|
|
1424
|
-
let { state: e, track: t, timeStore: n } =
|
|
1425
|
-
return r ? /* @__PURE__ */
|
|
1307
|
+
function En() {
|
|
1308
|
+
let { state: e, track: t, timeStore: n } = x("CaptionOverlay"), r = S(e, t), { cues: i } = D(r?.src), a = C(n), o = I(() => Tn(i, a), [i, a]);
|
|
1309
|
+
return r ? /* @__PURE__ */ z("div", {
|
|
1426
1310
|
lang: r.srclang,
|
|
1427
1311
|
"data-slot": "media-captions",
|
|
1428
1312
|
className: "pointer-events-none absolute inset-x-0 z-10 flex justify-center px-4 text-center",
|
|
1429
|
-
children: o.length > 0 && /* @__PURE__ */
|
|
1313
|
+
children: o.length > 0 && /* @__PURE__ */ z("p", {
|
|
1430
1314
|
className: "max-w-[88%] text-balance font-medium text-sm text-white leading-relaxed @[32rem]:text-lg @[56rem]:text-xl group-data-fullscreen/media-player:text-2xl",
|
|
1431
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
1315
|
+
children: o.map((e, t) => /* @__PURE__ */ B("span", {
|
|
1432
1316
|
className: "box-decoration-clone rounded-sm bg-black/82 px-2 py-0.5",
|
|
1433
|
-
children: [e, t < o.length - 1 && /* @__PURE__ */
|
|
1317
|
+
children: [e, t < o.length - 1 && /* @__PURE__ */ z("br", {})]
|
|
1434
1318
|
}, t))
|
|
1435
1319
|
})
|
|
1436
1320
|
}) : null;
|
|
1437
1321
|
}
|
|
1438
1322
|
//#endregion
|
|
1439
1323
|
//#region lib/components/ui/media/media-player/partials/controls-overlay.tsx
|
|
1440
|
-
function
|
|
1441
|
-
return /* @__PURE__ */
|
|
1324
|
+
function Dn() {
|
|
1325
|
+
return /* @__PURE__ */ B("div", {
|
|
1442
1326
|
"data-slot": "media-overlay-controls",
|
|
1443
1327
|
className: "absolute inset-x-0 bottom-0 z-20 px-1 pt-2 text-white",
|
|
1444
|
-
children: [/* @__PURE__ */
|
|
1328
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1445
1329
|
className: "px-3",
|
|
1446
|
-
children: /* @__PURE__ */
|
|
1447
|
-
}), /* @__PURE__ */
|
|
1330
|
+
children: /* @__PURE__ */ z($, { tone: "overlay" })
|
|
1331
|
+
}), /* @__PURE__ */ z(Q, { tone: "overlay" })]
|
|
1448
1332
|
});
|
|
1449
1333
|
}
|
|
1450
1334
|
//#endregion
|
|
1451
1335
|
//#region lib/components/ui/media/media-player/partials/status-overlay.tsx
|
|
1452
|
-
function
|
|
1453
|
-
let { state: e } =
|
|
1454
|
-
return e.status === "error" ? /* @__PURE__ */
|
|
1336
|
+
function On() {
|
|
1337
|
+
let { state: e } = x("StatusOverlay"), { t } = p();
|
|
1338
|
+
return e.status === "error" ? /* @__PURE__ */ B("div", {
|
|
1455
1339
|
role: "alert",
|
|
1456
1340
|
"data-slot": "media-error",
|
|
1457
1341
|
className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-1 bg-[rgb(8_10_20/0.9)] p-4 pb-[5.5rem] text-center text-white forced-colors:bg-[Canvas] forced-colors:text-[CanvasText] pointer-coarse:pb-[7.5rem] @[32rem]:gap-2",
|
|
1458
1342
|
children: [
|
|
1459
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ z(Ce, {
|
|
1460
1344
|
"aria-hidden": !0,
|
|
1461
1345
|
className: "hidden size-8 shrink-0 @[32rem]:block"
|
|
1462
1346
|
}),
|
|
1463
|
-
/* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ z("p", {
|
|
1464
1348
|
className: "font-semibold text-white",
|
|
1465
1349
|
children: t("material.media-player.error.title", "This media cannot be played")
|
|
1466
1350
|
}),
|
|
1467
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ z("p", {
|
|
1468
1352
|
className: "max-w-[28rem] text-balance text-white text-xs @[32rem]:text-sm",
|
|
1469
|
-
children:
|
|
1353
|
+
children: _n(e.error, t)
|
|
1470
1354
|
})
|
|
1471
1355
|
]
|
|
1472
|
-
}) : e.status === "buffering" || e.status === "loading" && e.isPlaying ? /* @__PURE__ */
|
|
1356
|
+
}) : e.status === "buffering" || e.status === "loading" && e.isPlaying ? /* @__PURE__ */ z("div", {
|
|
1473
1357
|
"aria-hidden": !0,
|
|
1474
1358
|
"data-slot": "media-buffering",
|
|
1475
1359
|
className: "pointer-events-none absolute inset-0 z-10 grid place-items-center text-white",
|
|
1476
|
-
children: /* @__PURE__ */
|
|
1360
|
+
children: /* @__PURE__ */ z(Ee, {
|
|
1477
1361
|
"aria-hidden": !0,
|
|
1478
1362
|
className: "size-10 animate-spin drop-shadow-[0_0_6px_rgb(0_0_0/0.6)]"
|
|
1479
1363
|
})
|
|
@@ -1481,14 +1365,14 @@ function zn() {
|
|
|
1481
1365
|
}
|
|
1482
1366
|
//#endregion
|
|
1483
1367
|
//#region lib/components/ui/media/media-player/partials/tap-ripple.tsx
|
|
1484
|
-
function
|
|
1485
|
-
let { t: r } =
|
|
1486
|
-
return /* @__PURE__ */
|
|
1368
|
+
function kn({ side: t, seconds: n }) {
|
|
1369
|
+
let { t: r } = p(), i = t === "left" ? xe : Se;
|
|
1370
|
+
return /* @__PURE__ */ B("div", {
|
|
1487
1371
|
"aria-hidden": !0,
|
|
1488
1372
|
"data-slot": "media-ripple",
|
|
1489
1373
|
"data-side": t,
|
|
1490
1374
|
className: e("pointer-events-none absolute inset-y-0 z-30 flex w-1/3 flex-col items-center justify-center gap-1 bg-[rgb(8_10_20/0.72)] text-white", t === "left" ? "left-0 rounded-r-[60%]" : "right-0 rounded-l-[60%]"),
|
|
1491
|
-
children: [/* @__PURE__ */
|
|
1375
|
+
children: [/* @__PURE__ */ z(i, { className: "size-7" }), /* @__PURE__ */ z("span", {
|
|
1492
1376
|
className: "text-sm font-semibold tabular-nums",
|
|
1493
1377
|
children: r("material.media-player.gesture.seconds", "{seconds} s", { seconds: n })
|
|
1494
1378
|
})]
|
|
@@ -1496,17 +1380,17 @@ function Bn({ side: t, seconds: n }) {
|
|
|
1496
1380
|
}
|
|
1497
1381
|
//#endregion
|
|
1498
1382
|
//#region lib/components/ui/media/media-player/partials/tap-controller.ts
|
|
1499
|
-
function
|
|
1500
|
-
let n =
|
|
1383
|
+
function An(e, t = () => performance.now()) {
|
|
1384
|
+
let n = Be, r = null, i = () => {
|
|
1501
1385
|
r && clearTimeout(r), r = null;
|
|
1502
1386
|
}, a = () => {
|
|
1503
1387
|
r = null;
|
|
1504
|
-
let i =
|
|
1388
|
+
let i = Ge(n, t());
|
|
1505
1389
|
n = i.state, i.action.type === "toggle-controls" && e().onSingleTap();
|
|
1506
1390
|
};
|
|
1507
1391
|
return {
|
|
1508
1392
|
tap(t) {
|
|
1509
|
-
let o =
|
|
1393
|
+
let o = Ue(n, t);
|
|
1510
1394
|
n = o.state, i(), o.action.type === "seek" && e().onSeek(o.action.delta), o.state && (r = setTimeout(a, 301));
|
|
1511
1395
|
},
|
|
1512
1396
|
dispose: i
|
|
@@ -1514,9 +1398,9 @@ function Vn(e, t = () => performance.now()) {
|
|
|
1514
1398
|
}
|
|
1515
1399
|
//#endregion
|
|
1516
1400
|
//#region lib/components/ui/media/media-player/partials/use-tap-gestures.ts
|
|
1517
|
-
var
|
|
1518
|
-
function
|
|
1519
|
-
let { actions: t, timeStore: n, state: r, announce: i } =
|
|
1401
|
+
var jn = 700, Mn = 10;
|
|
1402
|
+
function Nn(e) {
|
|
1403
|
+
let { actions: t, timeStore: n, state: r, announce: i } = x("VideoStage"), [a, o] = R(null), s = L(null), c = L({
|
|
1520
1404
|
onSingleTap: e,
|
|
1521
1405
|
duration: r.duration
|
|
1522
1406
|
});
|
|
@@ -1534,13 +1418,13 @@ function Wn(e) {
|
|
|
1534
1418
|
let l = e < 0 ? "left" : "right";
|
|
1535
1419
|
o((e) => ({
|
|
1536
1420
|
side: l,
|
|
1537
|
-
seconds: e?.side === l ? e.seconds +
|
|
1538
|
-
})), s.current && clearTimeout(s.current), s.current = setTimeout(() => o(null),
|
|
1421
|
+
seconds: e?.side === l ? e.seconds + Mn : Mn
|
|
1422
|
+
})), s.current && clearTimeout(s.current), s.current = setTimeout(() => o(null), jn);
|
|
1539
1423
|
}, [
|
|
1540
1424
|
t,
|
|
1541
1425
|
i,
|
|
1542
1426
|
n
|
|
1543
|
-
]), u =
|
|
1427
|
+
]), u = L({
|
|
1544
1428
|
onSeek: l,
|
|
1545
1429
|
onSingleTap: () => c.current.onSingleTap()
|
|
1546
1430
|
});
|
|
@@ -1548,7 +1432,7 @@ function Wn(e) {
|
|
|
1548
1432
|
onSeek: l,
|
|
1549
1433
|
onSingleTap: () => c.current.onSingleTap()
|
|
1550
1434
|
};
|
|
1551
|
-
let [d] =
|
|
1435
|
+
let [d] = R(() => An(() => u.current));
|
|
1552
1436
|
return N(() => () => {
|
|
1553
1437
|
d.dispose(), s.current && clearTimeout(s.current);
|
|
1554
1438
|
}, [d]), {
|
|
@@ -1566,56 +1450,56 @@ function Wn(e) {
|
|
|
1566
1450
|
}
|
|
1567
1451
|
//#endregion
|
|
1568
1452
|
//#region lib/components/ui/media/media-player/partials/video-stage.tsx
|
|
1569
|
-
function
|
|
1570
|
-
let { track: a, gestures: o } =
|
|
1571
|
-
return /* @__PURE__ */
|
|
1453
|
+
function Pn({ aspectRatio: t, overlay: n, onTouchTap: r, onPress: i }) {
|
|
1454
|
+
let { track: a, gestures: o } = x("VideoStage"), s = Nn(n ? r : i);
|
|
1455
|
+
return /* @__PURE__ */ B("div", {
|
|
1572
1456
|
"data-slot": "media-stage",
|
|
1573
|
-
className: e("relative touch-manipulation overflow-hidden",
|
|
1457
|
+
className: e("relative touch-manipulation overflow-hidden", Ze[t], "group-data-fullscreen/media-player:aspect-auto group-data-fullscreen/media-player:min-h-0 group-data-fullscreen/media-player:flex-1"),
|
|
1574
1458
|
children: [
|
|
1575
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ z(de, { onPointerUp: (e) => {
|
|
1576
1460
|
if (e.button !== 0) return;
|
|
1577
1461
|
let t = e.pointerType === "touch";
|
|
1578
1462
|
t && o ? s.onTap(e) : n && t ? r() : a && i();
|
|
1579
1463
|
} }),
|
|
1580
|
-
s.ripple && /* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
n && /* @__PURE__ */
|
|
1464
|
+
s.ripple && /* @__PURE__ */ z(kn, { ...s.ripple }),
|
|
1465
|
+
/* @__PURE__ */ z(En, {}),
|
|
1466
|
+
/* @__PURE__ */ z(ae, {}),
|
|
1467
|
+
/* @__PURE__ */ z(On, {}),
|
|
1468
|
+
n && /* @__PURE__ */ z(Dn, {})
|
|
1585
1469
|
]
|
|
1586
1470
|
});
|
|
1587
1471
|
}
|
|
1588
1472
|
//#endregion
|
|
1589
1473
|
//#region lib/components/ui/media/media-player/partials/media-player-frame.tsx
|
|
1590
|
-
function
|
|
1591
|
-
let { track: e } =
|
|
1592
|
-
return e ? /* @__PURE__ */
|
|
1474
|
+
function Fn() {
|
|
1475
|
+
let { track: e } = x("MediaPlayer");
|
|
1476
|
+
return e ? /* @__PURE__ */ B("div", {
|
|
1593
1477
|
className: "min-w-0 px-4 pt-3",
|
|
1594
|
-
children: [/* @__PURE__ */
|
|
1478
|
+
children: [/* @__PURE__ */ z("p", {
|
|
1595
1479
|
className: "truncate font-medium",
|
|
1596
1480
|
children: e.title
|
|
1597
|
-
}), e.artist && /* @__PURE__ */
|
|
1481
|
+
}), e.artist && /* @__PURE__ */ z("p", {
|
|
1598
1482
|
className: "truncate text-sm text-muted-foreground",
|
|
1599
1483
|
children: e.artist
|
|
1600
1484
|
})]
|
|
1601
1485
|
}) : null;
|
|
1602
1486
|
}
|
|
1603
|
-
function
|
|
1604
|
-
let { state: e } =
|
|
1605
|
-
return e.status === "error" ? /* @__PURE__ */
|
|
1487
|
+
function In() {
|
|
1488
|
+
let { state: e } = x("MediaPlayer"), { t } = p();
|
|
1489
|
+
return e.status === "error" ? /* @__PURE__ */ z("p", {
|
|
1606
1490
|
role: "alert",
|
|
1607
1491
|
"data-slot": "media-error",
|
|
1608
1492
|
className: "px-4 pt-1 text-sm text-error",
|
|
1609
|
-
children:
|
|
1493
|
+
children: _n(e.error, t)
|
|
1610
1494
|
}) : null;
|
|
1611
1495
|
}
|
|
1612
|
-
function
|
|
1613
|
-
let u =
|
|
1496
|
+
function Ln({ controls: t = "overlay", aspectRatio: n = "16/9", playlist: r = !1, panels: i, panelPlacement: a, className: o, ref: s, onKeyDown: c, ...l }) {
|
|
1497
|
+
let u = x("MediaPlayer"), { track: d } = u, f = d?.kind === "audio", p = !f && t === "overlay", m = wn(p, {
|
|
1614
1498
|
onKeyDown: c,
|
|
1615
1499
|
onPointerMove: l.onPointerMove,
|
|
1616
1500
|
onPointerDown: l.onPointerDown
|
|
1617
1501
|
});
|
|
1618
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ z(se, {
|
|
1619
1503
|
...l,
|
|
1620
1504
|
ref: s,
|
|
1621
1505
|
kind: f ? "audio" : "video",
|
|
@@ -1623,29 +1507,29 @@ function Jn({ controls: t = "overlay", aspectRatio: n = "16/9", playlist: r = !1
|
|
|
1623
1507
|
onPointerMove: m.onPointerMove,
|
|
1624
1508
|
onPointerDown: m.onPointerDown,
|
|
1625
1509
|
"data-controls": m.controlsState,
|
|
1626
|
-
className: e("data-fullscreen:flex data-fullscreen:h-full data-fullscreen:flex-col data-fullscreen:rounded-none", f || t === "below" ? "border bg-card text-card-foreground" : "bg-black text-white", !f &&
|
|
1627
|
-
children: /* @__PURE__ */
|
|
1510
|
+
className: e("data-fullscreen:flex data-fullscreen:h-full data-fullscreen:flex-col data-fullscreen:rounded-none", f || t === "below" ? "border bg-card text-card-foreground" : "bg-black text-white", !f && Qe[n], o),
|
|
1511
|
+
children: /* @__PURE__ */ z(_t, {
|
|
1628
1512
|
panels: i,
|
|
1629
|
-
children: /* @__PURE__ */
|
|
1513
|
+
children: /* @__PURE__ */ B(cn, {
|
|
1630
1514
|
placement: a,
|
|
1631
1515
|
children: [
|
|
1632
|
-
f ? /* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1516
|
+
f ? /* @__PURE__ */ B(ge, { children: [
|
|
1517
|
+
/* @__PURE__ */ z(de, {}),
|
|
1518
|
+
/* @__PURE__ */ z(Fn, {}),
|
|
1519
|
+
/* @__PURE__ */ z(In, {}),
|
|
1520
|
+
/* @__PURE__ */ z("div", {
|
|
1637
1521
|
className: "px-4 pt-1",
|
|
1638
|
-
children: /* @__PURE__ */
|
|
1522
|
+
children: /* @__PURE__ */ z($, { tone: "surface" })
|
|
1639
1523
|
}),
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
] }) : /* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ z(Q, { tone: "surface" })
|
|
1525
|
+
] }) : /* @__PURE__ */ z(Pn, {
|
|
1642
1526
|
aspectRatio: n,
|
|
1643
1527
|
overlay: p,
|
|
1644
1528
|
onTouchTap: m.onTouchTap,
|
|
1645
1529
|
onPress: m.onPress
|
|
1646
1530
|
}),
|
|
1647
|
-
!f && !p && /* @__PURE__ */
|
|
1648
|
-
(r === !0 || r === "auto" && u.tracks.length > 1) && /* @__PURE__ */
|
|
1531
|
+
!f && !p && /* @__PURE__ */ z(an, {}),
|
|
1532
|
+
(r === !0 || r === "auto" && u.tracks.length > 1) && /* @__PURE__ */ z(gn, { tone: p ? "overlay" : "surface" })
|
|
1649
1533
|
]
|
|
1650
1534
|
})
|
|
1651
1535
|
})
|
|
@@ -1653,8 +1537,8 @@ function Jn({ controls: t = "overlay", aspectRatio: n = "16/9", playlist: r = !1
|
|
|
1653
1537
|
}
|
|
1654
1538
|
//#endregion
|
|
1655
1539
|
//#region lib/components/ui/media/media-player/media-player.tsx
|
|
1656
|
-
function
|
|
1657
|
-
return /* @__PURE__ */
|
|
1540
|
+
function Rn({ tracks: e, index: t, defaultIndex: n, onIndexChange: r, autoPlay: i, playbackRates: a, defaultPlaybackRate: o, streaming: s, crossOrigin: c, keyboard: l, persist: u, floatOnScroll: d, resume: f, gestures: p, wakeLock: m, controls: h, aspectRatio: g, playlist: _, repeat: v, defaultRepeat: y, onRepeatChange: ee, shuffle: x, defaultShuffle: S, onShuffleChange: C, onPlay: ne, onPause: w, onEnded: ie, onError: T, ...E }) {
|
|
1541
|
+
return /* @__PURE__ */ B(re, {
|
|
1658
1542
|
tracks: e,
|
|
1659
1543
|
index: t,
|
|
1660
1544
|
defaultIndex: n,
|
|
@@ -1672,21 +1556,21 @@ function Yn({ tracks: e, index: t, defaultIndex: n, onIndexChange: r, autoPlay:
|
|
|
1672
1556
|
wakeLock: m,
|
|
1673
1557
|
repeat: v,
|
|
1674
1558
|
defaultRepeat: y,
|
|
1675
|
-
onRepeatChange:
|
|
1559
|
+
onRepeatChange: ee,
|
|
1676
1560
|
shuffle: x,
|
|
1677
|
-
defaultShuffle:
|
|
1678
|
-
onShuffleChange:
|
|
1679
|
-
onPlay:
|
|
1680
|
-
onPause:
|
|
1681
|
-
onEnded:
|
|
1682
|
-
onError:
|
|
1683
|
-
children: [/* @__PURE__ */
|
|
1561
|
+
defaultShuffle: S,
|
|
1562
|
+
onShuffleChange: C,
|
|
1563
|
+
onPlay: ne,
|
|
1564
|
+
onPause: w,
|
|
1565
|
+
onEnded: ie,
|
|
1566
|
+
onError: T,
|
|
1567
|
+
children: [/* @__PURE__ */ z(Ln, {
|
|
1684
1568
|
controls: h,
|
|
1685
1569
|
aspectRatio: g,
|
|
1686
1570
|
playlist: _,
|
|
1687
|
-
...
|
|
1688
|
-
}), d && /* @__PURE__ */
|
|
1571
|
+
...E
|
|
1572
|
+
}), d && /* @__PURE__ */ z(b, { ...te(d) })]
|
|
1689
1573
|
});
|
|
1690
1574
|
}
|
|
1691
1575
|
//#endregion
|
|
1692
|
-
export { $ as a, Y as c, K as d, G as f,
|
|
1576
|
+
export { $ as a, Y as c, K as d, G as f, on as i, _t as l, Ln as n, Jt as o, gn as r, Ft as s, Rn as t, q as u };
|