@bazza-ui/react 0.1.0-canary.4 → 0.1.0-canary.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/adapters/index.cjs.map +1 -1
  2. package/dist/adapters/index.d.cts +2 -1
  3. package/dist/adapters/index.d.ts +2 -1
  4. package/dist/chunk-BGJJC6GX.cjs.map +1 -1
  5. package/dist/chunk-FWWOE2SW.cjs.map +1 -1
  6. package/dist/chunk-JSPKF52O.cjs.map +1 -1
  7. package/dist/chunk-M4G6J7DP.cjs.map +1 -1
  8. package/dist/combobox/index.cjs.map +1 -1
  9. package/dist/combobox/index.d.cts +4 -3
  10. package/dist/combobox/index.d.ts +4 -3
  11. package/dist/context-menu/index.cjs.map +1 -1
  12. package/dist/context-menu/index.d.cts +9 -8
  13. package/dist/context-menu/index.d.ts +9 -8
  14. package/dist/{data-surface-B-eIGTBi.d.cts → data-surface-CvJ9KHPs.d.cts} +3 -2
  15. package/dist/{data-surface-D1OilMDu.d.ts → data-surface-wC_Jb6Rh.d.ts} +3 -2
  16. package/dist/dropdown-menu/index.cjs.map +1 -1
  17. package/dist/dropdown-menu/index.d.cts +11 -10
  18. package/dist/dropdown-menu/index.d.ts +11 -10
  19. package/dist/{input-DF7D8YzW.d.ts → input-CVeZtOCC.d.ts} +1 -1
  20. package/dist/{input-BoIK003I.d.cts → input-K7sWcc-E.d.cts} +1 -1
  21. package/dist/internal/listbox/index.cjs.map +1 -1
  22. package/dist/internal/popup-menu/index.cjs.map +1 -1
  23. package/dist/internal/popup-menu/index.d.cts +9 -8
  24. package/dist/internal/popup-menu/index.d.ts +9 -8
  25. package/dist/{loading-TsgH6v92.d.ts → loading-Bb7G_pQp.d.ts} +1 -1
  26. package/dist/{loading-DphSt8MY.d.cts → loading-CbSVZlwi.d.cts} +1 -1
  27. package/dist/select/index.cjs.map +1 -1
  28. package/dist/select/index.d.cts +6 -5
  29. package/dist/select/index.d.ts +6 -5
  30. package/dist/{separator-BmbUeeaT.d.cts → separator-BzYYn73e.d.cts} +2 -1
  31. package/dist/{separator-B4Ot84B0.d.ts → separator-C9c1Jo6A.d.ts} +2 -1
  32. package/dist/{types-9vS1uLIK.d.cts → types-Cggz7pEl.d.cts} +2 -35
  33. package/dist/types-DT4FOOa2.d.cts +51 -0
  34. package/dist/types-DT4FOOa2.d.ts +51 -0
  35. package/dist/{types-lQCIvWW8.d.ts → types-M2vBIhdB.d.ts} +2 -35
  36. package/dist/video-player/index.cjs +2 -2
  37. package/dist/video-player/index.cjs.map +1 -1
  38. package/dist/video-player/index.d.cts +25 -18
  39. package/dist/video-player/index.d.ts +25 -18
  40. package/dist/video-player/index.js +2 -2
  41. package/dist/video-player/index.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,16 +1,17 @@
1
1
  import { V as VirtualItem } from '../ListboxStore-BtcTXpzi.cjs';
2
2
  export { F as SelectFilterFn, I as SelectItemRegistration, b as SelectStore, L as SelectStoreContext, a as SelectStoreState } from '../ListboxStore-BtcTXpzi.cjs';
3
- import { i as PopupMenuPopup, R as PopupMenuPopupState, P as PopupMenuDebugOptions, a as PopupMenuRootActions, n as PopupMenuSurface, J as PopupMenuSurfaceProps, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuEmpty, e as PopupMenuGroup, f as PopupMenuGroupLabel, g as PopupMenuIcon, h as PopupMenuList, j as PopupMenuPortal, k as PopupMenuScrollDownArrow, l as PopupMenuScrollUpArrow, m as PopupMenuSeparator } from '../separator-BmbUeeaT.cjs';
4
- export { o as SelectArrowProps, p as SelectBackdropProps, q as SelectEmptyProps, r as SelectEmptyState, s as SelectGroupLabelProps, t as SelectGroupLabelState, u as SelectGroupProps, v as SelectGroupState, w as SelectIconProps, x as SelectIconState, y as SelectListChildrenState, L as SelectListCssVars, z as SelectListProps, A as SelectListState, C as SelectPortalProps, M as SelectPositionerCssVars, D as SelectScrollArrowProps, E as SelectScrollArrowState, F as SelectScrollDownArrowProps, G as SelectScrollUpArrowProps, H as SelectSeparatorProps, I as SelectSeparatorState, K as SelectSurfaceState } from '../separator-BmbUeeaT.cjs';
5
- import { P as PopupMenuInput } from '../input-BoIK003I.cjs';
6
- export { a as SelectInputProps, b as SelectInputState } from '../input-BoIK003I.cjs';
3
+ import { i as PopupMenuPopup, R as PopupMenuPopupState, P as PopupMenuDebugOptions, a as PopupMenuRootActions, n as PopupMenuSurface, J as PopupMenuSurfaceProps, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuEmpty, e as PopupMenuGroup, f as PopupMenuGroupLabel, g as PopupMenuIcon, h as PopupMenuList, j as PopupMenuPortal, k as PopupMenuScrollDownArrow, l as PopupMenuScrollUpArrow, m as PopupMenuSeparator } from '../separator-BzYYn73e.cjs';
4
+ export { o as SelectArrowProps, p as SelectBackdropProps, q as SelectEmptyProps, r as SelectEmptyState, s as SelectGroupLabelProps, t as SelectGroupLabelState, u as SelectGroupProps, v as SelectGroupState, w as SelectIconProps, x as SelectIconState, y as SelectListChildrenState, L as SelectListCssVars, z as SelectListProps, A as SelectListState, C as SelectPortalProps, M as SelectPositionerCssVars, D as SelectScrollArrowProps, E as SelectScrollArrowState, F as SelectScrollDownArrowProps, G as SelectScrollUpArrowProps, H as SelectSeparatorProps, I as SelectSeparatorState, K as SelectSurfaceState } from '../separator-BzYYn73e.cjs';
5
+ import { P as PopupMenuInput } from '../input-K7sWcc-E.cjs';
6
+ export { a as SelectInputProps, b as SelectInputState } from '../input-K7sWcc-E.cjs';
7
7
  import * as React from 'react';
8
- import { C as ComponentProps } from '../types-9vS1uLIK.cjs';
8
+ import { C as ComponentProps } from '../types-DT4FOOa2.cjs';
9
9
  import { PopoverPositionerProps, Popover, PopoverRootProps } from '@base-ui/react/popover';
10
10
  import { I as ItemEqualityComparer } from '../item-equality-B6TbXlBT.cjs';
11
11
  import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-BPr8sRGH.cjs';
12
12
  export { S as SurfaceContextValue, c as commandScore, d as defaultFilter, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../command-score-YjNr3ZWi.cjs';
13
13
  import '@base-ui/utils/store';
14
+ import '../types-Cggz7pEl.cjs';
14
15
 
15
16
  declare const SelectItemDataAttributes: {
16
17
  /**
@@ -1,16 +1,17 @@
1
1
  import { V as VirtualItem } from '../ListboxStore-DPqpLlAL.js';
2
2
  export { F as SelectFilterFn, I as SelectItemRegistration, b as SelectStore, L as SelectStoreContext, a as SelectStoreState } from '../ListboxStore-DPqpLlAL.js';
3
- import { i as PopupMenuPopup, R as PopupMenuPopupState, P as PopupMenuDebugOptions, a as PopupMenuRootActions, n as PopupMenuSurface, J as PopupMenuSurfaceProps, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuEmpty, e as PopupMenuGroup, f as PopupMenuGroupLabel, g as PopupMenuIcon, h as PopupMenuList, j as PopupMenuPortal, k as PopupMenuScrollDownArrow, l as PopupMenuScrollUpArrow, m as PopupMenuSeparator } from '../separator-B4Ot84B0.js';
4
- export { o as SelectArrowProps, p as SelectBackdropProps, q as SelectEmptyProps, r as SelectEmptyState, s as SelectGroupLabelProps, t as SelectGroupLabelState, u as SelectGroupProps, v as SelectGroupState, w as SelectIconProps, x as SelectIconState, y as SelectListChildrenState, L as SelectListCssVars, z as SelectListProps, A as SelectListState, C as SelectPortalProps, M as SelectPositionerCssVars, D as SelectScrollArrowProps, E as SelectScrollArrowState, F as SelectScrollDownArrowProps, G as SelectScrollUpArrowProps, H as SelectSeparatorProps, I as SelectSeparatorState, K as SelectSurfaceState } from '../separator-B4Ot84B0.js';
5
- import { P as PopupMenuInput } from '../input-DF7D8YzW.js';
6
- export { a as SelectInputProps, b as SelectInputState } from '../input-DF7D8YzW.js';
3
+ import { i as PopupMenuPopup, R as PopupMenuPopupState, P as PopupMenuDebugOptions, a as PopupMenuRootActions, n as PopupMenuSurface, J as PopupMenuSurfaceProps, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuEmpty, e as PopupMenuGroup, f as PopupMenuGroupLabel, g as PopupMenuIcon, h as PopupMenuList, j as PopupMenuPortal, k as PopupMenuScrollDownArrow, l as PopupMenuScrollUpArrow, m as PopupMenuSeparator } from '../separator-C9c1Jo6A.js';
4
+ export { o as SelectArrowProps, p as SelectBackdropProps, q as SelectEmptyProps, r as SelectEmptyState, s as SelectGroupLabelProps, t as SelectGroupLabelState, u as SelectGroupProps, v as SelectGroupState, w as SelectIconProps, x as SelectIconState, y as SelectListChildrenState, L as SelectListCssVars, z as SelectListProps, A as SelectListState, C as SelectPortalProps, M as SelectPositionerCssVars, D as SelectScrollArrowProps, E as SelectScrollArrowState, F as SelectScrollDownArrowProps, G as SelectScrollUpArrowProps, H as SelectSeparatorProps, I as SelectSeparatorState, K as SelectSurfaceState } from '../separator-C9c1Jo6A.js';
5
+ import { P as PopupMenuInput } from '../input-CVeZtOCC.js';
6
+ export { a as SelectInputProps, b as SelectInputState } from '../input-CVeZtOCC.js';
7
7
  import * as React from 'react';
8
- import { C as ComponentProps } from '../types-lQCIvWW8.js';
8
+ import { C as ComponentProps } from '../types-DT4FOOa2.js';
9
9
  import { PopoverPositionerProps, Popover, PopoverRootProps } from '@base-ui/react/popover';
10
10
  import { I as ItemEqualityComparer } from '../item-equality-B6TbXlBT.js';
11
11
  import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-BPr8sRGH.js';
12
12
  export { S as SurfaceContextValue, c as commandScore, d as defaultFilter, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../command-score-Dgo3ZS3Z.js';
13
13
  import '@base-ui/utils/store';
14
+ import '../types-M2vBIhdB.js';
14
15
 
15
16
  declare const SelectItemDataAttributes: {
16
17
  /**
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { P as PopupMenuOpenChangeReason, H as HighlightChangeEventDetails, C as ChangeEventDetails, G as GenericEventDetails } from './events-BPr8sRGH.cjs';
3
3
  import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-BtcTXpzi.cjs';
4
- import { G as GetQualifiedRowIdFn, av as ComponentRenderFn, C as ComponentProps } from './types-9vS1uLIK.cjs';
4
+ import { G as GetQualifiedRowIdFn } from './types-Cggz7pEl.cjs';
5
5
  import { ReactStore } from '@base-ui/utils/store';
6
6
  import { PopoverArrowProps, Popover, PopoverBackdropProps, PopoverPopupProps, PopoverPortalProps } from '@base-ui/react/popover';
7
+ import { a as ComponentRenderFn, C as ComponentProps } from './types-DT4FOOa2.cjs';
7
8
 
8
9
  interface FocusOwnerState {
9
10
  /** Which surface currently owns focus (surfaceId or null) */
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { P as PopupMenuOpenChangeReason, H as HighlightChangeEventDetails, C as ChangeEventDetails, G as GenericEventDetails } from './events-BPr8sRGH.js';
3
3
  import { b as ListboxStore, V as VirtualItem, F as FilterFn, S as SearchNormalizer } from './ListboxStore-DPqpLlAL.js';
4
- import { G as GetQualifiedRowIdFn, av as ComponentRenderFn, C as ComponentProps } from './types-lQCIvWW8.js';
4
+ import { G as GetQualifiedRowIdFn } from './types-M2vBIhdB.js';
5
5
  import { ReactStore } from '@base-ui/utils/store';
6
6
  import { PopoverArrowProps, Popover, PopoverBackdropProps, PopoverPopupProps, PopoverPortalProps } from '@base-ui/react/popover';
7
+ import { a as ComponentRenderFn, C as ComponentProps } from './types-DT4FOOa2.js';
7
8
 
8
9
  interface FocusOwnerState {
9
10
  /** Which surface currently owns focus (surfaceId or null) */
@@ -1,40 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { C as ComponentProps } from './types-DT4FOOa2.cjs';
2
3
  import { u as CheckedChangeEventDetails, r as RadioValueChangeEventDetails } from './events-BPr8sRGH.cjs';
3
4
 
4
- /**
5
- * Render function that receives props and state, returns a React element.
6
- */
7
- type ComponentRenderFn<Props, State> = (props: Props, state: State) => React.ReactElement<unknown>;
8
- /**
9
- * HTML props with ref support.
10
- */
11
- type HTMLProps<T = any> = React.HTMLAttributes<T> & {
12
- ref?: React.Ref<T> | undefined;
13
- };
14
- /**
15
- * Props shared by all Bazza UI components.
16
- * Includes className (string or state-based function), render prop, and style (object or state-based function).
17
- */
18
- type ComponentProps<ElementType extends React.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<React.ComponentPropsWithRef<ElementType>, 'className' | 'color' | 'defaultValue' | 'defaultChecked'> & {
19
- /**
20
- * CSS class applied to the element, or a function that
21
- * returns a class based on the component's state.
22
- */
23
- className?: string | ((state: State) => string | undefined);
24
- /**
25
- * Allows you to replace the component's HTML element
26
- * with a different tag, or compose it with another component.
27
- *
28
- * Accepts a `ReactElement` or a function that returns the element to render.
29
- */
30
- render?: ComponentRenderFn<RenderFunctionProps, State> | React.ReactElement;
31
- /**
32
- * Style applied to the element, or a function that
33
- * returns a style object based on the component's state.
34
- */
35
- style?: React.CSSProperties | ((state: State) => React.CSSProperties | undefined);
36
- };
37
-
38
5
  interface PopupMenuCheckboxItemState extends Record<string, unknown> {
39
6
  /**
40
7
  * Whether the item is highlighted (via keyboard or pointer).
@@ -1554,4 +1521,4 @@ interface DataSubpagesProps {
1554
1521
  children?: (state: DataSubpagesChildrenState) => React.ReactNode;
1555
1522
  }
1556
1523
 
1557
- export { type ItemRenderParams as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type ComponentProps as C, type CheckboxItemDef as D, type CheckboxItemRenderParams as E, type CheckboxItemRenderProps as F, type GetQualifiedRowIdFn as G, type DataListChildrenState as H, type DataListProps as I, type DataSubpagesChildrenState as J, type DataSubpagesProps as K, type DataSurfaceProps as L, type DeepSearchConfig as M, type DisplayGroupNode as N, type DisplayNode as O, PopupMenuCheckboxItem as P, type DisplayRadioGroupNode as Q, type DisplayRowNode as R, type DisplaySeparatorNode as S, type DisplaySubpageNode as T, type GroupBehavior as U, type GroupDef as V, type GroupRenderContext as W, type GroupRenderParams as X, type IncludeInDeepSearch as Y, type InitialQueryBehavior as Z, type ItemDef as _, PopupMenuItem as a, type ItemRenderProps as a0, type LoaderComponentProps as a1, type NodeDef as a2, type QueryAsyncNodesConfig as a3, type QueryDependentLoaderConfig as a4, type RadioGroupBehavior as a5, type RadioGroupDef as a6, type RadioGroupRenderParams as a7, type RadioGroupRenderProps as a8, type RadioItemDef as a9, type RadioItemRenderParams as aa, type RadioItemRenderProps as ab, type RowRenderContext as ac, type ScoredNode as ad, type SeparatorDef as ae, type SeparatorRenderParams as af, type StaticAsyncNodesConfig as ag, type StaticLoaderConfig as ah, type SubmenuDef as ai, type SubmenuRenderParams as aj, type SubmenuRenderProps as ak, type SubpageContentRenderParams as al, type SubpageDef as am, type SubpageTriggerRenderParams as an, type SubpageTriggerRenderProps as ao, defineRadioGroup as ap, isDisplayGroupNode as aq, isDisplayRadioGroupNode as ar, isDisplayRowNode as as, isDisplaySeparatorNode as at, type GetQualifiedRowIdContext as au, type ComponentRenderFn as av, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
1524
+ export { type ItemRenderProps as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type CheckboxItemDef as C, type CheckboxItemRenderParams as D, type CheckboxItemRenderProps as E, type DataListChildrenState as F, type GetQualifiedRowIdFn as G, type DataListProps as H, type DataSubpagesChildrenState as I, type DataSubpagesProps as J, type DataSurfaceProps as K, type DeepSearchConfig as L, type DisplayGroupNode as M, type DisplayNode as N, type DisplayRadioGroupNode as O, PopupMenuCheckboxItem as P, type DisplayRowNode as Q, type DisplaySeparatorNode as R, type DisplaySubpageNode as S, type GroupBehavior as T, type GroupDef as U, type GroupRenderContext as V, type GroupRenderParams as W, type IncludeInDeepSearch as X, type InitialQueryBehavior as Y, type ItemDef as Z, type ItemRenderParams as _, PopupMenuItem as a, type LoaderComponentProps as a0, type NodeDef as a1, type QueryAsyncNodesConfig as a2, type QueryDependentLoaderConfig as a3, type RadioGroupBehavior as a4, type RadioGroupDef as a5, type RadioGroupRenderParams as a6, type RadioGroupRenderProps as a7, type RadioItemDef as a8, type RadioItemRenderParams as a9, type RadioItemRenderProps as aa, type RowRenderContext as ab, type ScoredNode as ac, type SeparatorDef as ad, type SeparatorRenderParams as ae, type StaticAsyncNodesConfig as af, type StaticLoaderConfig as ag, type SubmenuDef as ah, type SubmenuRenderParams as ai, type SubmenuRenderProps as aj, type SubpageContentRenderParams as ak, type SubpageDef as al, type SubpageTriggerRenderParams as am, type SubpageTriggerRenderProps as an, defineRadioGroup as ao, isDisplayGroupNode as ap, isDisplayRadioGroupNode as aq, isDisplayRowNode as ar, isDisplaySeparatorNode as as, type GetQualifiedRowIdContext as at, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
@@ -0,0 +1,51 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Render function that receives props and state, returns a React element.
5
+ */
6
+ type ComponentRenderFn<Props, State> = (props: Props, state: State) => React.ReactElement<unknown>;
7
+ /**
8
+ * HTML props with ref support.
9
+ */
10
+ type HTMLProps<T = any> = React.HTMLAttributes<T> & {
11
+ ref?: React.Ref<T> | undefined;
12
+ };
13
+ /**
14
+ * React synthetic event augmented by Base UI's mergeProps utility.
15
+ */
16
+ type PreventableBaseHandlerEvent<E extends React.SyntheticEvent<Element, Event>> = E & {
17
+ preventBaseUIHandler: () => void;
18
+ readonly baseUIHandlerPrevented?: boolean;
19
+ };
20
+ type WithPreventableBaseHandler<T> = T extends (event: infer E) => infer R ? E extends React.SyntheticEvent<Element, Event> ? (event: PreventableBaseHandlerEvent<E>) => R : T : T;
21
+ /**
22
+ * Adds Base UI's preventBaseUIHandler event typing to React event handlers.
23
+ */
24
+ type WithPreventableBaseHandlers<T> = {
25
+ [K in keyof T]: WithPreventableBaseHandler<T[K]>;
26
+ };
27
+ /**
28
+ * Props shared by all Bazza UI components.
29
+ * Includes className (string or state-based function), render prop, and style (object or state-based function).
30
+ */
31
+ type ComponentProps<ElementType extends React.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<React.ComponentPropsWithRef<ElementType>, 'className' | 'color' | 'defaultValue' | 'defaultChecked'> & {
32
+ /**
33
+ * CSS class applied to the element, or a function that
34
+ * returns a class based on the component's state.
35
+ */
36
+ className?: string | ((state: State) => string | undefined);
37
+ /**
38
+ * Allows you to replace the component's HTML element
39
+ * with a different tag, or compose it with another component.
40
+ *
41
+ * Accepts a `ReactElement` or a function that returns the element to render.
42
+ */
43
+ render?: ComponentRenderFn<RenderFunctionProps, State> | React.ReactElement;
44
+ /**
45
+ * Style applied to the element, or a function that
46
+ * returns a style object based on the component's state.
47
+ */
48
+ style?: React.CSSProperties | ((state: State) => React.CSSProperties | undefined);
49
+ };
50
+
51
+ export type { ComponentProps as C, WithPreventableBaseHandlers as W, ComponentRenderFn as a };
@@ -0,0 +1,51 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Render function that receives props and state, returns a React element.
5
+ */
6
+ type ComponentRenderFn<Props, State> = (props: Props, state: State) => React.ReactElement<unknown>;
7
+ /**
8
+ * HTML props with ref support.
9
+ */
10
+ type HTMLProps<T = any> = React.HTMLAttributes<T> & {
11
+ ref?: React.Ref<T> | undefined;
12
+ };
13
+ /**
14
+ * React synthetic event augmented by Base UI's mergeProps utility.
15
+ */
16
+ type PreventableBaseHandlerEvent<E extends React.SyntheticEvent<Element, Event>> = E & {
17
+ preventBaseUIHandler: () => void;
18
+ readonly baseUIHandlerPrevented?: boolean;
19
+ };
20
+ type WithPreventableBaseHandler<T> = T extends (event: infer E) => infer R ? E extends React.SyntheticEvent<Element, Event> ? (event: PreventableBaseHandlerEvent<E>) => R : T : T;
21
+ /**
22
+ * Adds Base UI's preventBaseUIHandler event typing to React event handlers.
23
+ */
24
+ type WithPreventableBaseHandlers<T> = {
25
+ [K in keyof T]: WithPreventableBaseHandler<T[K]>;
26
+ };
27
+ /**
28
+ * Props shared by all Bazza UI components.
29
+ * Includes className (string or state-based function), render prop, and style (object or state-based function).
30
+ */
31
+ type ComponentProps<ElementType extends React.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<React.ComponentPropsWithRef<ElementType>, 'className' | 'color' | 'defaultValue' | 'defaultChecked'> & {
32
+ /**
33
+ * CSS class applied to the element, or a function that
34
+ * returns a class based on the component's state.
35
+ */
36
+ className?: string | ((state: State) => string | undefined);
37
+ /**
38
+ * Allows you to replace the component's HTML element
39
+ * with a different tag, or compose it with another component.
40
+ *
41
+ * Accepts a `ReactElement` or a function that returns the element to render.
42
+ */
43
+ render?: ComponentRenderFn<RenderFunctionProps, State> | React.ReactElement;
44
+ /**
45
+ * Style applied to the element, or a function that
46
+ * returns a style object based on the component's state.
47
+ */
48
+ style?: React.CSSProperties | ((state: State) => React.CSSProperties | undefined);
49
+ };
50
+
51
+ export type { ComponentProps as C, WithPreventableBaseHandlers as W, ComponentRenderFn as a };
@@ -1,40 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { C as ComponentProps } from './types-DT4FOOa2.js';
2
3
  import { u as CheckedChangeEventDetails, r as RadioValueChangeEventDetails } from './events-BPr8sRGH.js';
3
4
 
4
- /**
5
- * Render function that receives props and state, returns a React element.
6
- */
7
- type ComponentRenderFn<Props, State> = (props: Props, state: State) => React.ReactElement<unknown>;
8
- /**
9
- * HTML props with ref support.
10
- */
11
- type HTMLProps<T = any> = React.HTMLAttributes<T> & {
12
- ref?: React.Ref<T> | undefined;
13
- };
14
- /**
15
- * Props shared by all Bazza UI components.
16
- * Includes className (string or state-based function), render prop, and style (object or state-based function).
17
- */
18
- type ComponentProps<ElementType extends React.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<React.ComponentPropsWithRef<ElementType>, 'className' | 'color' | 'defaultValue' | 'defaultChecked'> & {
19
- /**
20
- * CSS class applied to the element, or a function that
21
- * returns a class based on the component's state.
22
- */
23
- className?: string | ((state: State) => string | undefined);
24
- /**
25
- * Allows you to replace the component's HTML element
26
- * with a different tag, or compose it with another component.
27
- *
28
- * Accepts a `ReactElement` or a function that returns the element to render.
29
- */
30
- render?: ComponentRenderFn<RenderFunctionProps, State> | React.ReactElement;
31
- /**
32
- * Style applied to the element, or a function that
33
- * returns a style object based on the component's state.
34
- */
35
- style?: React.CSSProperties | ((state: State) => React.CSSProperties | undefined);
36
- };
37
-
38
5
  interface PopupMenuCheckboxItemState extends Record<string, unknown> {
39
6
  /**
40
7
  * Whether the item is highlighted (via keyboard or pointer).
@@ -1554,4 +1521,4 @@ interface DataSubpagesProps {
1554
1521
  children?: (state: DataSubpagesChildrenState) => React.ReactNode;
1555
1522
  }
1556
1523
 
1557
- export { type ItemRenderParams as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type ComponentProps as C, type CheckboxItemDef as D, type CheckboxItemRenderParams as E, type CheckboxItemRenderProps as F, type GetQualifiedRowIdFn as G, type DataListChildrenState as H, type DataListProps as I, type DataSubpagesChildrenState as J, type DataSubpagesProps as K, type DataSurfaceProps as L, type DeepSearchConfig as M, type DisplayGroupNode as N, type DisplayNode as O, PopupMenuCheckboxItem as P, type DisplayRadioGroupNode as Q, type DisplayRowNode as R, type DisplaySeparatorNode as S, type DisplaySubpageNode as T, type GroupBehavior as U, type GroupDef as V, type GroupRenderContext as W, type GroupRenderParams as X, type IncludeInDeepSearch as Y, type InitialQueryBehavior as Z, type ItemDef as _, PopupMenuItem as a, type ItemRenderProps as a0, type LoaderComponentProps as a1, type NodeDef as a2, type QueryAsyncNodesConfig as a3, type QueryDependentLoaderConfig as a4, type RadioGroupBehavior as a5, type RadioGroupDef as a6, type RadioGroupRenderParams as a7, type RadioGroupRenderProps as a8, type RadioItemDef as a9, type RadioItemRenderParams as aa, type RadioItemRenderProps as ab, type RowRenderContext as ac, type ScoredNode as ad, type SeparatorDef as ae, type SeparatorRenderParams as af, type StaticAsyncNodesConfig as ag, type StaticLoaderConfig as ah, type SubmenuDef as ai, type SubmenuRenderParams as aj, type SubmenuRenderProps as ak, type SubpageContentRenderParams as al, type SubpageDef as am, type SubpageTriggerRenderParams as an, type SubpageTriggerRenderProps as ao, defineRadioGroup as ap, isDisplayGroupNode as aq, isDisplayRadioGroupNode as ar, isDisplayRowNode as as, isDisplaySeparatorNode as at, type GetQualifiedRowIdContext as au, type ComponentRenderFn as av, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
1524
+ export { type ItemRenderProps as $, type AsyncLoaderConfig as A, type BreadcrumbNode as B, type CheckboxItemDef as C, type CheckboxItemRenderParams as D, type CheckboxItemRenderProps as E, type DataListChildrenState as F, type GetQualifiedRowIdFn as G, type DataListProps as H, type DataSubpagesChildrenState as I, type DataSubpagesProps as J, type DataSurfaceProps as K, type DeepSearchConfig as L, type DisplayGroupNode as M, type DisplayNode as N, type DisplayRadioGroupNode as O, PopupMenuCheckboxItem as P, type DisplayRowNode as Q, type DisplaySeparatorNode as R, type DisplaySubpageNode as S, type GroupBehavior as T, type GroupDef as U, type GroupRenderContext as V, type GroupRenderParams as W, type IncludeInDeepSearch as X, type InitialQueryBehavior as Y, type ItemDef as Z, type ItemRenderParams as _, PopupMenuItem as a, type LoaderComponentProps as a0, type NodeDef as a1, type QueryAsyncNodesConfig as a2, type QueryDependentLoaderConfig as a3, type RadioGroupBehavior as a4, type RadioGroupDef as a5, type RadioGroupRenderParams as a6, type RadioGroupRenderProps as a7, type RadioItemDef as a8, type RadioItemRenderParams as a9, type RadioItemRenderProps as aa, type RowRenderContext as ab, type ScoredNode as ac, type SeparatorDef as ad, type SeparatorRenderParams as ae, type StaticAsyncNodesConfig as af, type StaticLoaderConfig as ag, type SubmenuDef as ah, type SubmenuRenderParams as ai, type SubmenuRenderProps as aj, type SubpageContentRenderParams as ak, type SubpageDef as al, type SubpageTriggerRenderParams as am, type SubpageTriggerRenderProps as an, defineRadioGroup as ao, isDisplayGroupNode as ap, isDisplayRadioGroupNode as aq, isDisplayRowNode as ar, isDisplaySeparatorNode as as, type GetQualifiedRowIdContext as at, PopupMenuRadioGroup as b, PopupMenuRadioItem as c, PopupMenuSubmenuTrigger as d, PopupMenuSubpageTrigger as e, type PopupMenuCheckboxItemProps as f, type PopupMenuCheckboxItemState as g, type PopupMenuItemProps as h, type PopupMenuItemState as i, type PopupMenuRadioGroupProps as j, type PopupMenuRadioGroupState as k, type PopupMenuRadioItemProps as l, type PopupMenuRadioItemState as m, type PopupMenuSubmenuTriggerProps as n, type PopupMenuSubmenuTriggerState as o, type PopupMenuSubpageTriggerProps as p, type PopupMenuSubpageTriggerState as q, type AsyncLoaderFetchStatus as r, type AsyncLoaderLoadingPhase as s, type AsyncLoaderResult as t, type AsyncLoaderSource as u, type AsyncLoaderStatus as v, type AsyncNodesConfig as w, type AsyncRenderState as x, type AsyncResultBehavior as y, type AsyncState as z };
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var _react = require('react'); var Ie = _interopRequireWildcard(_react); var He = _interopRequireWildcard(_react); var nr = _interopRequireWildcard(_react); var Oe = _interopRequireWildcard(_react); var ue = _interopRequireWildcard(_react); var ce = _interopRequireWildcard(_react); var q = _interopRequireWildcard(_react); var J = _interopRequireWildcard(_react); var Qe = _interopRequireWildcard(_react); var de = _interopRequireWildcard(_react); var Z = _interopRequireWildcard(_react); var Ne = _interopRequireWildcard(_react); var Ue = _interopRequireWildcard(_react); var pe = _interopRequireWildcard(_react); var _e = _interopRequireWildcard(_react); var je = _interopRequireWildcard(_react); var fe = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Ke = _interopRequireWildcard(_react); var k = _interopRequireWildcard(_react); var H = _interopRequireWildcard(_react); var ot = _interopRequireWildcard(_react); var _ = _interopRequireWildcard(_react); var ie = _interopRequireWildcard(_react); var I = _interopRequireWildcard(_react);var lt=Ie.createContext(null);function R(c){let e=Ie.useContext(lt);if(!e)throw new Error(`<VideoPlayer.${c}> must be used within <VideoPlayer.Root>`);return e}function ae(){return R("useVideoPlayer")}var Qr={};_chunkM4G6J7DPcjs.a.call(void 0, Qr,{BufferedIndicator:()=>tr,Captions:()=>or,CaptionsButton:()=>ar,CaptionsDataAttributes:()=>De,CaptionsMenu:()=>ir,CaptionsMenuItem:()=>Fe,Controls:()=>sr,ControlsDataAttributes:()=>We,FullscreenButton:()=>lr,MuteButton:()=>ur,Overlay:()=>cr,OverlayDataAttributes:()=>$e,PictureInPictureButton:()=>dr,PlayButton:()=>pr,PlaybackRateButton:()=>fr,PlaybackRateMenu:()=>mr,PlaybackRateMenuItem:()=>ct,Portal:()=>Pr,Poster:()=>Rr,QualityMenu:()=>yr,QualityMenuItem:()=>pt,Root:()=>br,RootDataAttributes:()=>qe,SeekSlider:()=>Tr,SeekSliderBuffered:()=>Er,SeekSliderControl:()=>xr,SeekSliderCssVars:()=>Ge,SeekSliderDataAttributes:()=>ze,SeekSliderHover:()=>wr,SeekSliderPreviewThumb:()=>Vr,SeekSliderPreviewThumbDataAttributes:()=>Je,SeekSliderPreviewTooltip:()=>me,SeekSliderPreviewTooltipPopup:()=>tt,SeekSliderPreviewTooltipPortal:()=>Ze,SeekSliderPreviewTooltipPositioner:()=>et,SeekSliderProgress:()=>Cr,SeekSliderThumb:()=>Mr,SeekSliderTrack:()=>hr,Thumbnail:()=>Br,ThumbnailDataAttributes:()=>rt,TimeDisplay:()=>Lr,TimeDisplayDataAttributes:()=>nt,Track:()=>Ir,Video:()=>Hr,VolumeSlider:()=>Dr,VolumeSliderControl:()=>Or,VolumeSliderCssVars:()=>at,VolumeSliderDataAttributes:()=>it,VolumeSliderRange:()=>Fr,VolumeSliderThumb:()=>Wr,VolumeSliderTrack:()=>Ar,useTransitionStatus:()=>K,useVideoPlayer:()=>ae});var _jsxruntime = require('react/jsx-runtime');var tr=He.forwardRef(function(e,o){let{render:s,...l}=e,u=R("BufferedIndicator"),r=He.useMemo(()=>{if(!u.buffered||u.buffered.length===0)return 0;for(let n=0;n<u.buffered.length;n++)if(u.buffered.start(n)<=u.currentTime&&u.currentTime<=u.buffered.end(n))return u.buffered.end(n);return u.buffered.end(0)},[u.buffered,u.currentTime]),a=u.duration>0?r/u.duration*100:0,t={buffered:u.buffered,duration:u.duration,bufferedPercentage:a,bufferedEnd:r},i={"--buffered-percentage":`${a}%`,"--buffered-end":r,...l.style},p={ref:o,style:i,"aria-hidden":!0};return s?s(p,t):_jsxruntime.jsx.call(void 0, "div",{ref:o,"aria-hidden":"true",...l,style:i})});var De=(e=>(e.active="data-active",e))(De||{});var or=nr.forwardRef(function(e,o){let{render:s,children:l,...u}=e,a=R("Captions").activeCues,t=a.map(f=>f.text).join(`
2
- `),i=a.length>0,p={active:i,cueText:t,cues:a},n={ref:o,"aria-live":"polite","aria-atomic":!0,role:"status",style:{pointerEvents:"none"},"data-active":i||void 0};return s?s(n,p):l?_jsxruntime.jsx.call(void 0, "div",{...n,...u,children:l}):_jsxruntime.jsx.call(void 0, "div",{...n,...u,children:t})});var ar=Oe.forwardRef(function(e,o){let{render:s,onClick:l,...u}=e,r=R("CaptionsButton"),a=r.registeredTracks.length>0,t=r.activeTextTrack!==null,i={active:t,available:a,trackCount:r.registeredTracks.length},p=Oe.useCallback(f=>{if(_optionalChain([l, 'optionalCall', _2 => _2(f)]),!f.defaultPrevented){if(t)r.setTextTrack(null);else if(r.registeredTracks.length>0){let S=r.registeredTracks[0];_optionalChain([S, 'optionalAccess', _3 => _3.textTrack])&&r.setTextTrack(S.textTrack)}}},[l,r,t]),n={ref:o,type:"button","aria-label":t?"Disable captions":"Enable captions","aria-pressed":t,disabled:!a,"data-active":t||void 0,"data-available":a||void 0,onClick:p};return s?s(n,i):_jsxruntime.jsx.call(void 0, "button",{...n,...u})});var ir=ue.forwardRef(function(e,o){let{render:s,children:l,...u}=e,r=R("CaptionsMenu"),a={registeredTracks:r.registeredTracks,activeTextTrack:r.activeTextTrack},t={ref:o,role:"menu","aria-label":"Captions","data-active":r.activeTextTrack!==null||void 0};return s?s(t,a):_jsxruntime.jsx.call(void 0, "div",{...t,...u,children:_nullishCoalesce(l, () => (_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Fe,{track:null,children:"Off"}),r.registeredTracks.map(i=>_jsxruntime.jsx.call(void 0, Fe,{track:i.textTrack,children:i.label},i.id))]})))})}),Fe=ue.forwardRef(function(e,o){let{track:s,onClick:l,children:u,...r}=e,a=R("CaptionsMenuItem"),t=a.activeTextTrack===s,i=ue.useCallback(p=>{_optionalChain([l, 'optionalCall', _4 => _4(p)]),p.defaultPrevented||a.setTextTrack(s)},[l,a,s]);return _jsxruntime.jsx.call(void 0, "button",{ref:o,type:"button",role:"menuitemradio","aria-checked":t,"data-active":t||void 0,...r,onClick:i,children:u})});var We=(t=>(t.open="data-open",t.closed="data-closed",t.idle="data-idle",t.playing="data-playing",t.paused="data-paused",t.ended="data-ended",t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t))(We||{});function Zr(c){let e=[...c.getAnimations(),...Array.from(c.querySelectorAll("*")).flatMap(o=>o.getAnimations())];return e.length===0?Promise.resolve():Promise.all(e.map(o=>o.finished)).then(()=>{}).catch(()=>{})}function K(c){let{open:e,keepMounted:o=!1}=c,[s,l]=q.useState(e||o),[u,r]=q.useState(e?"starting":void 0),a=q.useRef(null),t=q.useRef(!1);return q.useEffect(()=>{if(e){t.current=!1,l(!0),r("starting");let i=requestAnimationFrame(()=>{requestAnimationFrame(()=>{r(void 0)})});return()=>cancelAnimationFrame(i)}},[e]),q.useEffect(()=>{if(!e&&s&&!t.current){r("ending");let i=a.current;if(!i){r(void 0),o||l(!1);return}t.current=!0;let p=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Zr(i).then(()=>{t.current&&(t.current=!1,r(void 0),o||l(!1))})})});return()=>{cancelAnimationFrame(p)}}},[e,s,o]),q.useEffect(()=>{o&&!s&&!e&&l(!0)},[o,s,e]),{mounted:s||o,transitionStatus:u,elementRef:a}}var sr=ce.forwardRef(function(e,o){let{idleTimeout:s,keepMounted:l=!1,render:u,children:r,...a}=e,t=R("Controls"),p=(_nullishCoalesce(s, () => (t.idleTimeout)))===0||!t.idle,{mounted:n,transitionStatus:f,elementRef:S}=K({open:p,keepMounted:l}),y=ce.useCallback(E=>{S.current=E,typeof o=="function"?o(E):o&&(o.current=E)},[o,S]),{onClick:g,...m}=a,h=ce.useCallback(E=>{E.stopPropagation(),_optionalChain([g, 'optionalCall', _5 => _5(E)])},[g]),v={open:p,idle:t.idle,playing:t.playing,paused:t.paused,ended:t.ended},b={ref:y,onClick:h,"data-open":p||void 0,"data-closed":!p||void 0,"data-idle":t.idle||void 0,"data-playing":t.playing||void 0,"data-paused":t.paused||void 0,"data-ended":t.ended||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0};return n?u?u(b,v):_jsxruntime.jsx.call(void 0, "div",{...b,...m,children:r}):null});var lr=J.forwardRef(function(e,o){let{render:s,onClick:l,children:u,...r}=e,a=R("FullscreenButton"),[t,i]=J.useState(!1);J.useEffect(()=>{i("fullscreenEnabled"in document&&document.fullscreenEnabled)},[]);let p=J.useCallback(S=>{_optionalChain([l, 'optionalCall', _6 => _6(S)]),S.defaultPrevented||a.toggleFullscreen()},[l,a]),n={fullscreen:a.fullscreen,supported:t},f={ref:o,type:"button","aria-label":a.fullscreen?"Exit fullscreen":"Enter fullscreen","aria-pressed":a.fullscreen,disabled:!t,"data-fullscreen":a.fullscreen||void 0,"data-supported":t||void 0,onClick:p};return s?s(f,n):_jsxruntime.jsx.call(void 0, "button",{...f,...r,children:u})});var ur=Qe.forwardRef(function(e,o){let{render:s,onClick:l,...u}=e,r=R("MuteButton"),a={muted:r.muted,volume:r.volume},t=Qe.useCallback(m=>{_optionalChain([l, 'optionalCall', _7 => _7(m)]),m.defaultPrevented||r.toggleMute()},[l,r]),i=r.volume,p=r.muted,n=i===0||p,f=i>0&&!p,S=!p&&i>0&&i<.5,y=!p&&i>=.5,g={ref:o,type:"button","aria-label":r.muted?"Unmute":"Mute","aria-pressed":r.muted,"data-muted":p||void 0,"data-volume-off":n||void 0,"data-volume-on":f||void 0,"data-volume-low":S||void 0,"data-volume-high":y||void 0,onClick:t};return s?s(g,a):_jsxruntime.jsx.call(void 0, "button",{...g,...u})});var $e=(n=>(n.open="data-open",n.closed="data-closed",n.playing="data-playing",n.paused="data-paused",n.ended="data-ended",n.waiting="data-waiting",n.seeking="data-seeking",n.fullscreen="data-fullscreen",n.pip="data-pip",n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n))($e||{});var cr=de.forwardRef(function(e,o){let{idleTimeout:s,keepMounted:l=!1,render:u,onClick:r,children:a,...t}=e,i=R("Overlay"),n=(_nullishCoalesce(s, () => (i.idleTimeout)))===0||!i.idle,{mounted:f,transitionStatus:S,elementRef:y}=K({open:n,keepMounted:l}),g=de.useCallback(b=>{y.current=b,typeof o=="function"?o(b):o&&(o.current=b)},[o,y]),m=de.useCallback(b=>{_optionalChain([r, 'optionalCall', _8 => _8(b)]),b.defaultPrevented||i.toggle()},[r,i]),h={playing:i.playing,paused:i.paused,ended:i.ended,waiting:i.waiting,seeking:i.seeking,fullscreen:i.fullscreen,pictureInPicture:i.pictureInPicture,open:n},v={ref:g,onClick:m,"data-playing":i.playing||void 0,"data-paused":i.paused||void 0,"data-ended":i.ended||void 0,"data-waiting":i.waiting||void 0,"data-seeking":i.seeking||void 0,"data-fullscreen":i.fullscreen||void 0,"data-pip":i.pictureInPicture||void 0,"data-open":n||void 0,"data-closed":!n||void 0,"data-starting-style":S==="starting"||void 0,"data-ending-style":S==="ending"||void 0};return f?u?u(v,h):_jsxruntime.jsx.call(void 0, "div",{...v,...t,children:a}):null});var dr=Z.forwardRef(function(e,o){let{render:s,onClick:l,...u}=e,r=R("PictureInPictureButton"),[a,t]=Z.useState(!1);Z.useEffect(()=>{t("pictureInPictureEnabled"in document&&document.pictureInPictureEnabled)},[]);let i={pictureInPicture:r.pictureInPicture,supported:a},p=Z.useCallback(f=>{_optionalChain([l, 'optionalCall', _9 => _9(f)]),f.defaultPrevented||r.togglePictureInPicture()},[l,r]),n={ref:o,type:"button","aria-label":r.pictureInPicture?"Exit picture-in-picture":"Enter picture-in-picture","aria-pressed":r.pictureInPicture,disabled:!a,"data-pip":r.pictureInPicture||void 0,"data-supported":a||void 0,onClick:p};return s?s(n,i):_jsxruntime.jsx.call(void 0, "button",{...n,...u})});var pr=Ne.forwardRef(function(e,o){let{render:s,onClick:l,children:u,...r}=e,a=R("PlayButton"),t=Ne.useCallback(n=>{_optionalChain([l, 'optionalCall', _10 => _10(n)]),n.defaultPrevented||a.toggle()},[l,a]),i={playing:a.playing,paused:a.paused,ended:a.ended,waiting:a.waiting},p={ref:o,type:"button","aria-label":a.playing?"Pause":"Play","data-playing":a.playing||void 0,"data-paused":a.paused||void 0,"data-ended":a.ended||void 0,"data-waiting":a.waiting||void 0,onClick:t};return s?s(p,i):_jsxruntime.jsx.call(void 0, "button",{...p,...r,children:u})});var sn=[.25,.5,.75,1,1.25,1.5,1.75,2],fr=Ue.forwardRef(function(e,o){let{rates:s=sn,render:l,onClick:u,children:r,...a}=e,t=R("PlaybackRateButton"),i={playbackRate:t.playbackRate,rates:s},p=Ue.useCallback(f=>{if(_optionalChain([u, 'optionalCall', _11 => _11(f)]),!f.defaultPrevented){let y=(s.indexOf(t.playbackRate)+1)%s.length,g=_nullishCoalesce(_nullishCoalesce(s[y], () => (s[0])), () => (t.playbackRate));t.setPlaybackRate(g)}},[u,t,s]),n={ref:o,type:"button","aria-label":`Playback speed: ${t.playbackRate}x`,"data-rate":t.playbackRate,onClick:p};return l?l(n,i):_jsxruntime.jsx.call(void 0, "button",{...n,...a,children:_nullishCoalesce(r, () => (`${t.playbackRate}x`))})});var un=[.25,.5,.75,1,1.25,1.5,1.75,2],mr=pe.forwardRef(function(e,o){let{rates:s=un,render:l,children:u,...r}=e,a=R("PlaybackRateMenu"),t={playbackRate:a.playbackRate,rates:s},i={ref:o,role:"menu","aria-label":"Playback speed","data-rate":a.playbackRate};return l?l(i,t):_jsxruntime.jsx.call(void 0, "div",{...i,...r,children:_nullishCoalesce(u, () => (s.map(p=>_jsxruntime.jsx.call(void 0, ct,{rate:p},p))))})}),ct=pe.forwardRef(function(e,o){let{rate:s,onClick:l,children:u,...r}=e,a=R("PlaybackRateMenuItem"),t=a.playbackRate===s,i=pe.useCallback(p=>{_optionalChain([l, 'optionalCall', _12 => _12(p)]),p.defaultPrevented||a.setPlaybackRate(s)},[l,a,s]);return _jsxruntime.jsx.call(void 0, "button",{ref:o,type:"button",role:"menuitemradio","aria-checked":t,"data-active":t||void 0,...r,onClick:i,children:_nullishCoalesce(u, () => (`${s}x`))})});var _reactdom = require('react-dom'); var gr = _interopRequireWildcard(_reactdom);function Pr(c){let{children:e,container:o}=c,[s,l]=_e.useState(!1);if(_e.useEffect(()=>(l(!0),()=>l(!1)),[]),!s)return null;let u=_nullishCoalesce(o, () => ((typeof document<"u"?document.body:null)));return u?_reactdom.createPortal.call(void 0, e,u):null}var Rr=je.forwardRef(function(e,o){let{keepMounted:s=!1,render:l,children:u,...r}=e,a=R("Poster"),t=!a.canPlay,i=a.canPlay,{mounted:p,transitionStatus:n,elementRef:f}=K({open:t,keepMounted:s}),S=dn(o,f),y={loading:t,loaded:i,transitionStatus:n},g={ref:S,"aria-hidden":!0,"data-loading":t||void 0,"data-loaded":i||void 0,"data-starting-style":n==="starting"||void 0,"data-ending-style":n==="ending"||void 0};return p?l?l(g,y):_jsxruntime.jsx.call(void 0, "div",{...g,...r,children:u}):null});function dn(...c){return je.useCallback(e=>{for(let o of c)typeof o=="function"?o(e):o!=null&&(o.current=e)},c)}var yr=fe.forwardRef(function(e,o){let{render:s,children:l,...u}=e,r=R("QualityMenu"),a={qualities:r.qualities,activeQuality:r.activeQuality},t={ref:o,role:"menu","aria-label":"Video quality","data-quality":_nullishCoalesce(_optionalChain([r, 'access', _13 => _13.activeQuality, 'optionalAccess', _14 => _14.label]), () => (void 0))};return s?s(t,a):_jsxruntime.jsx.call(void 0, "div",{...t,...u,children:_nullishCoalesce(l, () => (r.qualities.map(i=>_jsxruntime.jsx.call(void 0, pt,{quality:i,children:i.label},i.label))))})}),pt=fe.forwardRef(function(e,o){let{quality:s,onClick:l,children:u,...r}=e,a=R("QualityMenuItem"),t=_optionalChain([a, 'access', _15 => _15.activeQuality, 'optionalAccess', _16 => _16.label])===s.label,i=fe.useCallback(p=>{_optionalChain([l, 'optionalCall', _17 => _17(p)]),p.defaultPrevented||a.setQuality(s)},[l,a,s]);return _jsxruntime.jsx.call(void 0, "button",{ref:o,type:"button",role:"menuitemradio","aria-checked":t,"data-active":t||void 0,...r,onClick:i,children:u})});var qe=(i=>(i.playing="data-playing",i.paused="data-paused",i.ended="data-ended",i.waiting="data-waiting",i.seeking="data-seeking",i.fullscreen="data-fullscreen",i.pip="data-pip",i.muted="data-muted",i.idle="data-idle",i))(qe||{});function fn(c,e){return!(c instanceof HTMLElement)||c instanceof HTMLInputElement&&c.type==="range"&&e===" "?!1:c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable}function mn(c){return c==="ArrowRight"||c==="ArrowLeft"}function Sr(c,e){let o=ae(),s=Ke.useRef(o);s.current=o,Ke.useEffect(()=>{if(e==="none")return;let l=a=>{if(fn(a.target,a.key))return;let t=s.current;switch(a.key){case" ":a.preventDefault(),t.toggle();break;case"f":case"F":a.preventDefault(),t.toggleFullscreen();break;case"ArrowUp":a.preventDefault(),t.setVolume(Math.min(t.volume+.1,1));break;case"ArrowDown":a.preventDefault(),t.setVolume(Math.max(t.volume-.1,0));break;case"ArrowRight":a.preventDefault(),t.beginSeekInteraction(),t.seek(Math.min(t.currentTime+5,t.duration));break;case"ArrowLeft":a.preventDefault(),t.beginSeekInteraction(),t.seek(Math.max(t.currentTime-5,0));break;default:return}t.resetIdle()},u=a=>{mn(a.key)&&s.current.endSeekInteraction()};if(e==="global")return window.addEventListener("keydown",l),window.addEventListener("keyup",u),()=>{window.removeEventListener("keydown",l),window.removeEventListener("keyup",u)};let r=c.current;if(r)return r.addEventListener("keydown",l),r.addEventListener("keyup",u),()=>{r.removeEventListener("keydown",l),r.removeEventListener("keyup",u)}},[e,c])}function Xe(c,e,o){let[s,l]=d.useState(e),u=c!==void 0,r=u?c:s,a=d.useCallback(t=>{let i=typeof t=="function"?t(r):t;u||l(i),_optionalChain([o, 'optionalCall', _18 => _18(i)])},[u,r,o]);return[r,a]}function Pn({rootRef:c,videoRef:e,actionsRef:o,defaultPlaying:s=!1,defaultVolume:l=1,defaultMuted:u=!1,defaultPlaybackRate:r=1,playing:a,onPlayingChange:t,volume:i,onVolumeChange:p,muted:n,onMutedChange:f,playbackRate:S,onPlaybackRateChange:y,currentTime:g,onCurrentTimeChange:m,idleTimeout:h=3e3,preventIdleWhenPaused:v=!1,idle:b,onIdleChange:E,onEnded:M,onWaiting:V,onSeeking:O,onSeeked:Y,onFullscreenChange:j,onPictureInPictureChange:T,children:Q}){let A=d.useRef(1),F=d.useRef(!1),G=d.useRef(!1),[w,L]=d.useState("paused"),[N,z]=d.useState(s?"play":"pause");d.useEffect(()=>{a!==void 0&&(z(a?"play":"pause"),w!=="waiting"&&L(a?"playing":"paused"))},[a,w]);let[x,D]=Xe(i,l,p),[U,se]=Xe(n,u,f),[Re,Pt]=Xe(S,r,y),[$r,te]=Xe(b,!0,E),re=d.useRef(null),ye=d.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),Rt=d.useCallback(()=>{h!==0&&(ye(),re.current=setTimeout(()=>{te(!0)},h))},[h,ye,te]),yt=d.useCallback(()=>{te(!1),Rt()},[te,Rt]),St=d.useCallback(()=>{ye(),te(!0)},[ye,te]);d.useEffect(()=>(h>0&&(re.current=setTimeout(()=>{te(!0)},h)),()=>{re.current&&clearTimeout(re.current)}),[]);let bt=v&&w!=="playing"?!1:$r,[kt,gt]=d.useState(0),[Se,vt]=d.useState(0),[Tt,Nr]=d.useState(null),[be,Ur]=d.useState(null),[xt,ht]=d.useState(!1),[Ct,le]=d.useState(!1),[ke,_r]=d.useState(!1),[ge,Mt]=d.useState(!1),[Et,st]=d.useState([]),[ne,jr]=d.useState(null),[Vt,ve]=d.useState([]),[wt,Ln]=d.useState([]),[Bt,qr]=d.useState(null);d.useEffect(()=>{g!==void 0&&e.current&&(e.current.currentTime=g)},[g,e]),d.useEffect(()=>{let P=()=>{let C=document.fullscreenElement===c.current;_r(C),_optionalChain([j, 'optionalCall', _19 => _19(C)])};return document.addEventListener("fullscreenchange",P),()=>document.removeEventListener("fullscreenchange",P)},[j,c]),d.useEffect(()=>{let P=e.current;if(!P)return;let C=()=>{Mt(!0),_optionalChain([T, 'optionalCall', _20 => _20(!0)])},W=()=>{Mt(!1),_optionalChain([T, 'optionalCall', _21 => _21(!1)])};return P.addEventListener("enterpictureinpicture",C),P.addEventListener("leavepictureinpicture",W),()=>{P.removeEventListener("enterpictureinpicture",C),P.removeEventListener("leavepictureinpicture",W)}},[T,e]);let Te=d.useCallback(async()=>{e.current&&(z("play"),await e.current.play(),L("playing"),_optionalChain([t, 'optionalCall', _22 => _22(!0)]))},[e,t]),xe=d.useCallback(()=>{e.current&&(z("pause"),e.current.pause(),L("paused"),_optionalChain([t, 'optionalCall', _23 => _23(!1)]))},[e,t]),he=d.useCallback(async()=>{w==="playing"?xe():await Te()},[w,Te,xe]),Ce=d.useCallback(P=>{e.current&&(e.current.currentTime=P,gt(P),_optionalChain([m, 'optionalCall', _24 => _24(P)]))},[m,e]),Lt=d.useCallback(()=>{let P=e.current;!P||F.current||(F.current=!0,G.current=N==="play",le(!0),G.current&&!P.paused&&P.pause())},[N,e]),It=d.useCallback(()=>{let P=e.current;if(!P||!F.current)return;let C=G.current&&N==="play";if(F.current=!1,G.current=!1,!C){le(!1);return}P.play().then(()=>{L("playing"),le(!1)}).catch(()=>{L("waiting"),le(!1)})},[N,e]),Me=d.useCallback(P=>{let C=Math.max(0,Math.min(1,P));e.current&&(e.current.volume=C),D(C)},[D,e]),Ht=d.useCallback(()=>{if(!(U||x===0))A.current=x,e.current&&(e.current.muted=!0),se(!0);else{let C=A.current>0?A.current:1;e.current&&(e.current.volume=C,e.current.muted=!1),D(C),se(!1)}},[U,x,se,D,e]),Ee=d.useCallback(async()=>{_optionalChain([c, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.requestFullscreen])&&await c.current.requestFullscreen()},[c]),Ve=d.useCallback(async()=>{document.exitFullscreen&&await document.exitFullscreen()},[]),we=d.useCallback(async()=>{ke?await Ve():await Ee()},[ke,Ee,Ve]),Be=d.useCallback(async()=>{_optionalChain([e, 'access', _27 => _27.current, 'optionalAccess', _28 => _28.requestPictureInPicture])&&await e.current.requestPictureInPicture()},[e]),Le=d.useCallback(async()=>{document.pictureInPictureElement&&await document.exitPictureInPicture()},[]),Dt=d.useCallback(async()=>{ge?await Le():await Be()},[ge,Be,Le]),Ot=d.useCallback(P=>{e.current&&(e.current.playbackRate=P),Pt(P)},[Pt,e]),At=d.useCallback(P=>{if(e.current){for(let C=0;C<e.current.textTracks.length;C++){let W=e.current.textTracks[C];W&&(W.mode="disabled")}P&&(P.mode="hidden")}jr(P),ve([])},[e]),Ft=d.useCallback(P=>{qr(P)},[]),Wt=d.useCallback(P=>{st(C=>C.some(W=>W.id===P.id)?C:[...C,P])},[]),Qt=d.useCallback(P=>{st(C=>C.filter(W=>W.id!==P))},[]),$t=d.useCallback((P,C)=>{st(W=>W.map(oe=>oe.id===P?{...oe,textTrack:C}:oe))},[]);d.useEffect(()=>{if(!ne){ve([]);return}let P=()=>{let C=ne.activeCues;if(!C){ve([]);return}let W=[];for(let oe=0;oe<C.length;oe++){let er=C[oe];er instanceof VTTCue&&W.push(er)}ve(W)};return P(),ne.addEventListener("cuechange",P),()=>{ne.removeEventListener("cuechange",P)}},[ne]),d.useImperativeHandle(o,()=>({toggle:he,seek:Ce,setVolume:Me,toggleFullscreen:we}),[he,Ce,Me,we]);let Nt=d.useCallback(()=>{if(e.current){let P=e.current.currentTime;gt(P),_optionalChain([m, 'optionalCall', _29 => _29(P)])}},[m,e]),Ut=d.useCallback(()=>{e.current&&vt(e.current.duration)},[e]),_t=d.useCallback(()=>{e.current&&Nr(e.current.buffered)},[e]),jt=d.useCallback(()=>{z("play"),L("playing"),_optionalChain([t, 'optionalCall', _30 => _30(!0)])},[t]),qt=d.useCallback(()=>{F.current||w!=="ended"&&(L("paused"),_optionalChain([t, 'optionalCall', _31 => _31(!1)]))},[w,t]),Kt=d.useCallback(()=>{z("pause"),L("ended"),_optionalChain([t, 'optionalCall', _32 => _32(!1)]),_optionalChain([M, 'optionalCall', _33 => _33()])},[t,M]),Xt=d.useCallback(()=>{F.current||(L("waiting"),_optionalChain([V, 'optionalCall', _34 => _34()]))},[V]),Yt=d.useCallback(()=>{if(F.current){ht(!0);return}if(w==="waiting"){let P=N==="play"?"playing":"paused";L(P),_optionalChain([t, 'optionalCall', _35 => _35(P==="playing")])}ht(!0)},[w,N,t]),Gt=d.useCallback(()=>{le(!0),w==="ended"&&L("paused"),_optionalChain([O, 'optionalCall', _36 => _36()])},[w,O]),zt=d.useCallback(()=>{if(le(!1),e.current){let{currentTime:P,duration:C}=e.current;C>0&&C-P<.01&&L("ended")}_optionalChain([Y, 'optionalCall', _37 => _37()])},[Y,e]),Jt=d.useCallback(()=>{e.current&&(D(e.current.volume),se(e.current.muted))},[D,se,e]),Zt=d.useCallback(()=>{e.current&&vt(e.current.duration)},[e]),Kr=d.useMemo(()=>({playbackStatus:w,playbackIntent:N,playing:w==="playing",paused:w==="paused",ended:w==="ended",waiting:w==="waiting",seeking:Ct,canPlay:xt,currentTime:kt,duration:Se,buffered:Tt,hoverTime:be,hoverProgress:be!==null&&Se>0?be/Se*100:null,volume:x,muted:U,fullscreen:ke,pictureInPicture:ge,idle:bt,idleTimeout:h,preventIdleWhenPaused:v,registeredTracks:Et,activeTextTrack:ne,activeCues:Vt,playbackRate:Re,qualities:wt,activeQuality:Bt,videoRef:e,rootRef:c,play:Te,pause:xe,toggle:he,seek:Ce,setVolume:Me,toggleMute:Ht,enterFullscreen:Ee,exitFullscreen:Ve,toggleFullscreen:we,enterPictureInPicture:Be,exitPictureInPicture:Le,togglePictureInPicture:Dt,setPlaybackRate:Ot,setTextTrack:At,setQuality:Ft,registerTrack:Wt,unregisterTrack:Qt,updateTrackRef:$t,resetIdle:yt,setHoverTime:Ur,beginSeekInteraction:Lt,endSeekInteraction:It,_handlers:{onTimeUpdate:Nt,onDurationChange:Ut,onProgress:_t,onPlay:jt,onPause:qt,onEnded:Kt,onWaiting:Xt,onCanPlay:Yt,onSeeking:Gt,onSeeked:zt,onVolumeChange:Jt,onLoadedMetadata:Zt,onRootMouseLeave:St}}),[w,N,Ct,xt,kt,Se,Tt,be,x,U,ke,ge,bt,h,v,Et,ne,Vt,Re,wt,Bt,e,c,Te,xe,he,Ce,Me,Ht,Ee,Ve,we,Be,Le,Dt,Ot,At,Ft,Wt,Qt,$t,yt,Lt,It,Nt,Ut,_t,jt,qt,Kt,Xt,Yt,Gt,zt,Jt,Zt,St]);return _jsxruntime.jsx.call(void 0, lt.Provider,{value:Kr,children:Q})}var br=d.forwardRef(function(e,o){let{actionsRef:s,keyboardShortcuts:l="focused",defaultPlaying:u,defaultVolume:r,defaultMuted:a,defaultPlaybackRate:t,playing:i,onPlayingChange:p,volume:n,onVolumeChange:f,muted:S,onMutedChange:y,playbackRate:g,onPlaybackRateChange:m,currentTime:h,onCurrentTimeChange:v,idleTimeout:b,preventIdleWhenPaused:E,hideCursorWhenIdle:M="fullscreen",idle:V,onIdleChange:O,onEnded:Y,onWaiting:j,onSeeking:T,onSeeked:Q,onFullscreenChange:A,onPictureInPictureChange:F,children:G,...w}=e,L=d.useRef(null),N=d.useRef(null);return _jsxruntime.jsx.call(void 0, Pn,{actionsRef:s,defaultPlaying:u,defaultVolume:r,defaultMuted:a,defaultPlaybackRate:t,playing:i,onPlayingChange:p,volume:n,onVolumeChange:f,muted:S,onMutedChange:y,playbackRate:g,onPlaybackRateChange:m,currentTime:h,onCurrentTimeChange:v,idleTimeout:b,preventIdleWhenPaused:E,idle:V,onIdleChange:O,onEnded:Y,onWaiting:j,onSeeking:T,onSeeked:Q,onFullscreenChange:A,onPictureInPictureChange:F,rootRef:L,videoRef:N,children:_jsxruntime.jsx.call(void 0, Rn,{ref:o,rootRef:L,keyboardShortcuts:l,hideCursorWhenIdle:M,...w,children:G})})}),Rn=d.forwardRef(function({rootRef:e,keyboardShortcuts:o,hideCursorWhenIdle:s,children:l,className:u,style:r,...a},t){let i=ae(),p=yn(t,e),n=d.useRef(null);Sr(e,o);let f=d.useCallback(b=>{let{clientX:E,clientY:M}=b,V=n.current;V&&V.x===E&&V.y===M||(n.current={x:E,y:M},i.resetIdle())},[i]),S=d.useCallback(b=>{let{clientX:E,clientY:M}=b,V=n.current;V&&V.x===E&&V.y===M||(n.current={x:E,y:M},i.resetIdle())},[i]),y=d.useCallback(()=>{i._handlers.onRootMouseLeave()},[i._handlers]),g=d.useCallback(()=>{i.resetIdle()},[i]),m={"data-playing":i.playing||void 0,"data-paused":i.paused||void 0,"data-ended":i.ended||void 0,"data-waiting":i.waiting||void 0,"data-seeking":i.seeking||void 0,"data-fullscreen":i.fullscreen||void 0,"data-pip":i.pictureInPicture||void 0,"data-muted":i.muted||void 0,"data-idle":i.idle||void 0},h=s!==!1&&i.idle&&(s==="always"||s==="fullscreen"&&i.fullscreen),v=d.useId();return _jsxruntime.jsxs.call(void 0, "div",{ref:p,tabIndex:o==="focused"?0:void 0,className:u,style:r,"data-video-player-scope":v,...m,...a,onMouseMove:f,onMouseEnter:S,onMouseLeave:y,onClick:g,children:[h&&_jsxruntime.jsx.call(void 0, "style",{children:`[data-video-player-scope="${v}"], [data-video-player-scope="${v}"] * { cursor: none !important; }`}),l]})});function yn(...c){return d.useCallback(e=>{for(let o of c)typeof o=="function"?o(e):o!=null&&(o.current=e)},c)}var Ge=(r=>(r.progress="--seek-progress",r.buffered="--seek-buffered",r.currentTime="--seek-current-time",r.duration="--seek-duration",r.hoverProgress="--seek-hover-progress",r.hoverTime="--seek-hover-time",r))(Ge||{});var ze=(l=>(l.seeking="data-seeking",l.hovering="data-hovering",l.pressing="data-pressing",l.dragging="data-dragging",l))(ze||{});var _slider = require('@base-ui/react/slider');var _react2 = require('@floating-ui/react');var Je=(l=>(l.open="data-open",l.closed="data-closed",l.startingStyle="data-starting-style",l.endingStyle="data-ending-style",l))(Je||{});var ft=k.createContext(null);function vr(c){let e=k.useContext(ft);if(!e)throw new Error(`${c} must be used within SeekSlider`);return e}function kr(c){return c==="ArrowRight"||c==="ArrowLeft"}var Tr=k.forwardRef(function(e,o){let{render:s,children:l,onPointerMove:u,onPointerLeave:r,onPointerDown:a,onKeyUp:t,onValueCommitted:i,...p}=e,n=R("SeekSlider"),f=k.useRef(null),[S,y]=k.useState(null),[g,m]=k.useState(!1),[h,v]=k.useState(!1),b=k.useRef(!1);k.useEffect(()=>{if(!g)return;let x=()=>{m(!1),v(!1),b.current=!1,n.endSeekInteraction()};return window.addEventListener("pointerup",x),()=>window.removeEventListener("pointerup",x)},[g,n]);let E=n.duration>0?n.currentTime/n.duration*100:0,M=k.useCallback((x,D)=>{let U=typeof x=="number"?x:x[0];U!==void 0&&(D.reason==="keyboard"&&n.beginSeekInteraction(),n.seek(U),n.resetIdle(),b.current&&v(!0))},[n]),V=k.useCallback(x=>{if(_optionalChain([u, 'optionalCall', _38 => _38(x)]),!f.current||n.duration===0)return;let D=f.current.getBoundingClientRect(),U=x.clientX-D.left,Re=Math.max(0,Math.min(1,U/D.width))*n.duration;n.setHoverTime(Re)},[u,n]),O=k.useCallback(x=>{_optionalChain([r, 'optionalCall', _39 => _39(x)]),n.setHoverTime(null)},[r,n]),Y=k.useCallback(x=>{_optionalChain([a, 'optionalCall', _40 => _40(x)]),m(!0),b.current=!0,n.beginSeekInteraction()},[a,n]),j=k.useCallback(x=>{_optionalChain([t, 'optionalCall', _41 => _41(x)]),kr(x.key)&&n.endSeekInteraction()},[t,n]),T=k.useCallback((x,D)=>{let U=typeof x=="number"?x:x[0];U!==void 0&&(_optionalChain([i, 'optionalCall', _42 => _42(U,D)]),m(!1),v(!1),b.current=!1,!(D.reason==="keyboard"&&kr(D.event.key))&&n.endSeekInteraction())},[i,n]),Q=k.useMemo(()=>{if(!n.buffered||n.buffered.length===0)return 0;for(let x=0;x<n.buffered.length;x++)if(n.buffered.start(x)<=n.currentTime&&n.currentTime<=n.buffered.end(x))return n.buffered.end(x);return n.buffered.end(0)},[n.buffered,n.currentTime]),A=n.duration>0?Q/n.duration*100:0;k.useLayoutEffect(()=>{typeof o=="function"?o(f.current):o&&(o.current=f.current)});let F={currentTime:n.currentTime,duration:n.duration,progress:E,seeking:n.seeking,pressing:g,dragging:h,hoverTime:n.hoverTime,hoverProgress:n.hoverProgress},G=n.hoverProgress!==null,w=_nullishCoalesce(n.hoverProgress, () => (0)),L=k.useMemo(()=>({sliderRef:f,previewThumbElement:S,setPreviewThumbElement:y,hoverProgress:w,open:G}),[f,S,y,w,G]),N={position:"relative","--seek-progress":`${E}%`,"--seek-buffered":`${A}%`,"--seek-current-time":n.currentTime,"--seek-duration":n.duration,"--seek-hover-progress":n.hoverProgress!==null?`${n.hoverProgress}%`:void 0,"--seek-hover-time":_nullishCoalesce(n.hoverTime, () => (void 0)),...p.style},z={"data-seeking":n.seeking||void 0,"data-hovering":n.hoverTime!==null||void 0,"data-pressing":g||void 0,"data-dragging":h||void 0,style:N};return s?_jsxruntime.jsx.call(void 0, ft.Provider,{value:L,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:n.duration||100,step:.1,value:n.currentTime,onValueChange:M,onValueCommitted:T,onPointerMove:V,onPointerLeave:O,onPointerDown:Y,onKeyUp:j,"aria-label":"Seek",render:x=>s({...x,...z,style:{...x.style,...z.style}},F)})}):_jsxruntime.jsx.call(void 0, ft.Provider,{value:L,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:n.duration||100,step:.1,value:n.currentTime,onValueChange:M,onValueCommitted:T,onPointerMove:V,onPointerLeave:O,onPointerDown:Y,onKeyUp:j,"aria-label":"Seek",...z,...p,children:_nullishCoalesce(l, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{style:{position:"relative"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${A}%`}}),_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})})}),xr=_slider.Slider.Control,hr=k.forwardRef(function(e,o){let{render:s,children:l,style:u,...r}=e,a={},t={position:"relative",...u},i={ref:o,style:t};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{render:p=>s({...p,...i},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:o,style:t,...r,children:l})}),Cr=k.forwardRef(function(e,o){let{render:s,children:l,style:u,...r}=e,a=R("SeekSliderProgress"),i={progress:a.duration>0?a.currentTime/a.duration*100:0},p={height:"100%",...u},n={ref:o,style:p};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{render:f=>s({...f,...n,style:{...f.style,...p}},i)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:o,style:p,...r,children:l})}),Mr=k.forwardRef(function(e,o){let{render:s,children:l,style:u,...r}=e,a={},t={ref:o,style:_nullishCoalesce(u, () => ({}))};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{render:i=>s({...i,...t,style:{...i.style,...u}},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:o,style:u,...r,children:l})}),Er=k.forwardRef(function(e,o){let{render:s,children:l,...u}=e,r=R("SeekSliderBuffered"),a=k.useMemo(()=>{if(!r.buffered||r.buffered.length===0)return 0;for(let f=0;f<r.buffered.length;f++)if(r.buffered.start(f)<=r.currentTime&&r.currentTime<=r.buffered.end(f))return r.buffered.end(f);return r.buffered.end(0)},[r.buffered,r.currentTime]),t=r.duration>0?a/r.duration*100:0,i={bufferedPercentage:t},p={position:"absolute",left:0,top:0,height:"100%",width:`${t}%`,...u.style},n={ref:o,style:p};return s?s(n,i):_jsxruntime.jsx.call(void 0, "div",{...n,...u,children:l})}),Vr=k.forwardRef(function(e,o){let{keepMounted:s=!1,render:l,children:u,...r}=e,a=R("SeekSliderPreviewThumb"),t=vr("SeekSliderPreviewThumb"),i=a.hoverProgress!==null,p=k.useRef(0);a.hoverProgress!==null&&(p.current=a.hoverProgress);let n=_nullishCoalesce(a.hoverProgress, () => (p.current)),{mounted:f,transitionStatus:S,elementRef:y}=K({open:i,keepMounted:s}),g=k.useCallback(b=>{y.current=b,t.setPreviewThumbElement(b),typeof o=="function"?o(b):o&&(o.current=b)},[o,y,t]),m={open:i,transitionStatus:S,hoverProgress:n},h={position:"absolute",left:`${n}%`,transform:"translateX(-50%)",pointerEvents:"none",...r.style},v={ref:g,style:h,"data-open":i||void 0,"data-closed":!i||void 0,"data-starting-style":S==="starting"||void 0,"data-ending-style":S==="ending"||void 0};return f?l?l(v,m):_jsxruntime.jsx.call(void 0, "span",{...v,...r,children:u}):null}),wr=k.forwardRef(function(e,o){let{render:s,children:l,style:u,...r}=e,a=R("SeekSliderHover"),t=a.hoverProgress!==null,i=_nullishCoalesce(a.hoverProgress, () => (0)),p={hovering:t,hoverProgress:a.hoverProgress,hoverTime:a.hoverTime},n={position:"absolute",left:0,top:0,height:"100%",width:`${i}%`,pointerEvents:"none",...u},f={ref:o,style:n,"data-hovering":t||void 0};return s?s(f,p):_jsxruntime.jsx.call(void 0, "div",{...f,...r,children:l})});function Ze({children:c,container:e}){let o=R("SeekSliderPreviewTooltipPortal"),[s,l]=k.useState(!1);if(k.useEffect(()=>{l(!0)},[]),!s)return null;let u=_nullishCoalesce(_nullishCoalesce(e, () => (o.rootRef.current)), () => (document.body));return gr.createPortal(c,u)}var et=k.forwardRef(function(e,o){let{sideOffset:s=8,collisionPadding:l=0,collisionBoundary:u,keepMounted:r=!1,children:a,style:t,...i}=e,p=vr("SeekSliderPreviewTooltipPositioner"),{previewThumbElement:n,open:f,hoverProgress:S}=p,[y,g]=k.useState(null),{refs:m,floatingStyles:h,update:v}=_react2.useFloating.call(void 0, {placement:"top",middleware:[_react2.offset.call(void 0, s),_react2.shift.call(void 0, {boundary:u,padding:l})]});k.useLayoutEffect(()=>{n&&m.setReference(n)},[n,m]),k.useEffect(()=>{if(f&&n&&y)return _react2.autoUpdate.call(void 0, n,y,v)},[f,n,y,v]),k.useLayoutEffect(()=>{f&&n&&y&&v()},[S,f,n,y,v]);let b=k.useCallback(M=>{m.setFloating(M),g(M),typeof o=="function"?o(M):o&&(o.current=M)},[m,o]);return(r||f)&&!!n?_jsxruntime.jsx.call(void 0, "div",{ref:b,style:{...h,...t},"data-seek-slider-preview-tooltip-positioner":!0,"data-open":f||void 0,"data-closed":!f||void 0,...i,children:a}):null}),tt=k.forwardRef(function(e,o){let{children:s,...l}=e;return _jsxruntime.jsx.call(void 0, "div",{ref:o,"data-seek-slider-preview-tooltip-popup":!0,...l,children:s})});function me({sideOffset:c,collisionPadding:e,collisionBoundary:o,keepMounted:s,container:l,children:u,...r}){return _jsxruntime.jsx.call(void 0, Ze,{container:l,children:_jsxruntime.jsx.call(void 0, et,{sideOffset:c,collisionPadding:e,collisionBoundary:o,keepMounted:s,children:_jsxruntime.jsx.call(void 0, tt,{...r,children:u})})})}me.Portal=Ze;me.Positioner=et;me.Popup=tt;var rt=(s=>(s.loading="data-loading",s.ready="data-ready",s.error="data-error",s))(rt||{});var Br=H.forwardRef(function(e,o){let{time:s,crossOrigin:l="anonymous",render:u,children:r,width:a,height:t,...i}=e,p=R("Thumbnail"),n=H.useRef(null),f=H.useRef(null),S=H.useRef(null),[y,g]=H.useState("idle"),[m,h]=H.useState({width:160,height:90}),v=s!==void 0?s:p.hoverTime,b=H.useMemo(()=>{let T=p.videoRef.current;return T?T.currentSrc||T.src:null},[p.videoRef]);H.useEffect(()=>{if(!b)return;let T=document.createElement("video");T.src=b,T.crossOrigin=l,T.preload="metadata",T.muted=!0,T.playsInline=!0;let Q=()=>{h({width:T.videoWidth,height:T.videoHeight})},A=()=>{g("error")};return T.addEventListener("loadedmetadata",Q),T.addEventListener("error",A),f.current=T,()=>{T.removeEventListener("loadedmetadata",Q),T.removeEventListener("error",A),T.src="",f.current=null}},[b,l]),H.useEffect(()=>{let T=f.current,Q=n.current;if(!T||!Q||v===null||v===void 0||S.current!==null&&Math.abs(S.current-v)<.1)return;g("loading");let A=()=>{let F=Q.getContext("2d");if(F)try{F.drawImage(T,0,0,Q.width,Q.height),S.current=v,g("ready")}catch (e2){g("error")}};return T.addEventListener("seeked",A,{once:!0}),T.currentTime=v,()=>{T.removeEventListener("seeked",A)}},[v]);let E=H.useCallback(T=>{n.current=T,typeof o=="function"?o(T):o&&(o.current=T)},[o]),M=m.width/m.height,V=_nullishCoalesce(a, () => (160)),O=_nullishCoalesce(t, () => (Math.round(V/M)));typeof V=="string"&&(V=160),typeof O=="string"&&(O=90);let Y={loading:y==="loading",ready:y==="ready",error:y==="error",time:v,videoWidth:m.width,videoHeight:m.height},j={ref:E,width:V,height:O,"data-loading":y==="loading"||void 0,"data-ready":y==="ready"||void 0,"data-error":y==="error"||void 0};return u?u(j,Y):_jsxruntime.jsx.call(void 0, "canvas",{...j,...i,children:r})});var nt=(e=>(e.hovering="data-hovering",e))(nt||{});var Lr=ot.forwardRef(function(e,o){let{format:s="current / duration",fixedWidth:l=!0,align:u="left",render:r,...a}=e,t=R("TimeDisplay"),i=ot.useRef(0);t.hoverTime!==null&&(i.current=t.hoverTime);let p=t.duration-t.currentTime,n=Pe(t.currentTime),f=Pe(t.duration),S=Pe(p),y=t.hoverTime!==null?Pe(t.hoverTime):Pe(i.current),g={currentTime:t.currentTime,duration:t.duration,remaining:p,hoverTime:t.hoverTime,hovering:t.hoverTime!==null,formattedCurrent:n,formattedDuration:f,formattedRemaining:S,formattedHover:y},m=()=>{switch(s){case"current":return n;case"duration":return f;case"remaining":return`-${S}`;case"current / duration":return`${n} / ${f}`;case"current / remaining":return`${n} / -${S}`;case"hover":return y;default:return`${n} / ${f}`}},h=()=>{let b=Cn(t.duration);switch(s){case"current":case"duration":case"hover":return b;case"remaining":return`-${b}`;case"current / duration":return`${b} / ${b}`;case"current / remaining":return`${b} / -${b}`;default:return`${b} / ${b}`}},v={ref:o,style:{position:l?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},"data-hovering":g.hovering||void 0};return r?r(v,g):_jsxruntime.jsx.call(void 0, "span",{ref:o,"data-hovering":g.hovering||void 0,...a,style:{position:l?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},children:l?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":!0,style:{visibility:"hidden"},children:h()}),_jsxruntime.jsx.call(void 0, "span",{style:hn(u),children:m()})]}):m()})});function hn(c){let e={position:"absolute"};switch(c){case"left":return{...e,left:0};case"right":return{...e,right:0};case"center":return{...e,left:"50%",transform:"translateX(-50%)"}}}function Pe(c){if(!Number.isFinite(c)||Number.isNaN(c))return"0:00";let e=Math.floor(c/3600),o=Math.floor(c%3600/60),s=Math.floor(c%60);return e>0?`${e}:${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${o}:${s.toString().padStart(2,"0")}`}function Cn(c){if(!Number.isFinite(c)||Number.isNaN(c)||c<=0)return"0:00";let e=Math.floor(c/3600),o=Math.floor(c%3600/60);if(e>0){let l=String(e).length;return`${"0".repeat(l)}:00:00`}let s=String(o).length;return`${"0".repeat(s)}:00`}var Ir=_.forwardRef(function(e,o){let{kind:s="captions",src:l,label:u,srcLang:r,default:a,...t}=e,{registerTrack:i,unregisterTrack:p,updateTrackRef:n,setTextTrack:f}=R("Track"),S=_.useRef(null),y=_.useId(),g=_.useCallback(m=>{typeof o=="function"?o(m):o&&(o.current=m),S.current=m},[o]);return _.useEffect(()=>(i({id:y,kind:s,label:u,srcLang:r,src:l,textTrack:null}),()=>{p(y)}),[y,s,u,r,l,i,p]),_.useEffect(()=>{let m=S.current;if(!m)return;let h=()=>{m.track&&(m.track.mode="disabled",n(y,m.track),a&&f(m.track))};return m.track&&h(),m.addEventListener("load",h),()=>{m.removeEventListener("load",h)}},[y,a,n,f]),_jsxruntime.jsx.call(void 0, "track",{ref:g,kind:s,src:l,label:u,srcLang:r,default:a,...t})});var Hr=ie.forwardRef(function(e,o){let{toggleOnClick:s=!0,onClick:l,...u}=e,r=R("Video"),a=ie.useRef(!1),t=ie.useCallback(n=>{typeof o=="function"?o(n):o&&(o.current=n),r.videoRef.current=n,n&&!a.current&&(a.current=!0,n.readyState>=1&&n.duration&&(r._handlers.onLoadedMetadata(),r._handlers.onDurationChange()),n.readyState>=3&&r._handlers.onCanPlay())},[o,r.videoRef,r._handlers]),i=ie.useCallback(n=>{_optionalChain([l, 'optionalCall', _43 => _43(n)]),!n.defaultPrevented&&s&&r.toggle()},[l,s,r]),p={"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-waiting":r.waiting||void 0,"data-seeking":r.seeking||void 0};return _jsxruntime.jsx.call(void 0, "video",{ref:t,preload:"metadata",...p,...u,onClick:i,onTimeUpdate:r._handlers.onTimeUpdate,onDurationChange:r._handlers.onDurationChange,onProgress:r._handlers.onProgress,onPlay:r._handlers.onPlay,onPause:r._handlers.onPause,onEnded:r._handlers.onEnded,onWaiting:r._handlers.onWaiting,onCanPlay:r._handlers.onCanPlay,onSeeking:r._handlers.onSeeking,onSeeked:r._handlers.onSeeked,onVolumeChange:r._handlers.onVolumeChange,onLoadedMetadata:r._handlers.onLoadedMetadata})});var at=(o=>(o.volume="--volume",o.volumePercentage="--volume-percentage",o))(at||{});var it=(l=>(l.muted="data-muted",l.volume="data-volume",l.pressing="data-pressing",l.dragging="data-dragging",l))(it||{});var Dr=I.forwardRef(function(e,o){let{render:s,children:l,onPointerDown:u,...r}=e,a=R("VolumeSlider"),t=I.useRef(null),[i,p]=I.useState(!1),[n,f]=I.useState(!1),S=I.useRef(!1);I.useEffect(()=>{if(!i)return;let M=()=>{p(!1),f(!1),S.current=!1};return window.addEventListener("pointerup",M),()=>window.removeEventListener("pointerup",M)},[i]),I.useLayoutEffect(()=>{typeof o=="function"?o(t.current):o&&(o.current=t.current)});let y=a.volume*100,g={volume:a.volume,muted:a.muted,percentage:y,pressing:i,dragging:n},m=I.useCallback(M=>{let V=typeof M=="number"?M:M[0];if(V!==void 0){if(a.muted){let O=a.videoRef.current;O&&(O.muted=!1)}a.setVolume(V),a.resetIdle(),S.current&&f(!0)}},[a]),h=I.useCallback(M=>{_optionalChain([u, 'optionalCall', _44 => _44(M)]),p(!0),S.current=!0},[u]),v={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":i||void 0,"data-dragging":n||void 0},b={position:"relative","--volume":a.volume,"--volume-percentage":`${y}%`,...r.style},E={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":i||void 0,"data-dragging":n||void 0,style:b};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:t,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:m,onPointerDown:h,"aria-label":"Volume",render:M=>s({...M,...E},g)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:t,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:m,onPointerDown:h,"aria-label":"Volume",...v,...r,style:b,children:_nullishCoalesce(l, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{children:[_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})}),Or=_slider.Slider.Control,Ar=I.forwardRef(function(e,o){let{style:s,...l}=e,u={position:"relative",...s};return _jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:o,style:u,...l})}),Fr=I.forwardRef(function(e,o){return _jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:o,...e})}),Wr=I.forwardRef(function(e,o){return _jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:o,...e})});exports.VideoPlayer = Qr; exports.useVideoPlayer = ae;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var _react = require('react'); var He = _interopRequireWildcard(_react); var Ie = _interopRequireWildcard(_react); var ar = _interopRequireWildcard(_react); var sr = _interopRequireWildcard(_react); var it = _interopRequireWildcard(_react); var fe = _interopRequireWildcard(_react); var X = _interopRequireWildcard(_react); var ue = _interopRequireWildcard(_react); var pr = _interopRequireWildcard(_react); var Qe = _interopRequireWildcard(_react); var ce = _interopRequireWildcard(_react); var yr = _interopRequireWildcard(_react); var Sr = _interopRequireWildcard(_react); var lt = _interopRequireWildcard(_react); var $e = _interopRequireWildcard(_react); var Ne = _interopRequireWildcard(_react); var dt = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Ue = _interopRequireWildcard(_react); var R = _interopRequireWildcard(_react); var F = _interopRequireWildcard(_react); var tt = _interopRequireWildcard(_react); var K = _interopRequireWildcard(_react); var de = _interopRequireWildcard(_react); var O = _interopRequireWildcard(_react);var at=He.createContext(null);function P(c){let e=He.useContext(at);if(!e)throw new Error(`<VideoPlayer.${c}> must be used within <VideoPlayer.Root>`);return e}function ie(){return P("useVideoPlayer")}var Kr={};_chunkM4G6J7DPcjs.a.call(void 0, Kr,{BufferedIndicator:()=>nr,Captions:()=>ir,CaptionsButton:()=>lr,CaptionsDataAttributes:()=>De,CaptionsMenu:()=>ur,CaptionsMenuItem:()=>Ae,Controls:()=>cr,ControlsDataAttributes:()=>We,FullscreenButton:()=>dr,MuteButton:()=>fr,Overlay:()=>mr,OverlayDataAttributes:()=>Fe,PictureInPictureButton:()=>Pr,PlayButton:()=>Rr,PlaybackRateButton:()=>br,PlaybackRateMenu:()=>kr,PlaybackRateMenuItem:()=>ut,Portal:()=>gr,Poster:()=>vr,QualityMenu:()=>Tr,QualityMenuItem:()=>pt,Root:()=>xr,RootDataAttributes:()=>je,SeekSlider:()=>Br,SeekSliderBuffered:()=>Ir,SeekSliderControl:()=>Vr,SeekSliderCssVars:()=>qe,SeekSliderDataAttributes:()=>Xe,SeekSliderHover:()=>Or,SeekSliderPreviewThumb:()=>Dr,SeekSliderPreviewThumbDataAttributes:()=>Ye,SeekSliderPreviewTooltip:()=>me,SeekSliderPreviewTooltipPopup:()=>Je,SeekSliderPreviewTooltipPortal:()=>Ge,SeekSliderPreviewTooltipPositioner:()=>ze,SeekSliderProgress:()=>Lr,SeekSliderThumb:()=>Hr,SeekSliderTrack:()=>wr,Thumbnail:()=>Ar,ThumbnailDataAttributes:()=>Ze,TimeDisplay:()=>Wr,TimeDisplayDataAttributes:()=>et,Track:()=>Fr,Video:()=>Qr,VolumeSlider:()=>$r,VolumeSliderControl:()=>Nr,VolumeSliderCssVars:()=>rt,VolumeSliderDataAttributes:()=>nt,VolumeSliderRange:()=>Ur,VolumeSliderThumb:()=>_r,VolumeSliderTrack:()=>jr,useTransitionStatus:()=>Y,useVideoPlayer:()=>ie});var _jsxruntime = require('react/jsx-runtime');var nr=Ie.forwardRef(function(e,t){let{render:s,...u}=e,n=P("BufferedIndicator"),o=Ie.useMemo(()=>{if(!n.buffered||n.buffered.length===0)return 0;for(let i=0;i<n.buffered.length;i++)if(n.buffered.start(i)<=n.currentTime&&n.currentTime<=n.buffered.end(i))return n.buffered.end(i);return n.buffered.end(0)},[n.buffered,n.currentTime]),a=n.duration>0?o/n.duration*100:0,r={buffered:n.buffered,duration:n.duration,bufferedPercentage:a,bufferedEnd:o},l={"--buffered-percentage":`${a}%`,"--buffered-end":o,...u.style},p={ref:t,style:l,"aria-hidden":!0};return s?s(p,r):_jsxruntime.jsx.call(void 0, "div",{ref:t,"aria-hidden":"true",...u,style:l})});var De=(e=>(e.active="data-active",e))(De||{});var ir=ar.forwardRef(function(e,t){let{render:s,children:u,...n}=e,a=P("Captions").activeCues,r=a.map(f=>f.text).join(`
2
+ `),l=a.length>0,p={active:l,cueText:r,cues:a},i={ref:t,"aria-live":"polite","aria-atomic":!0,role:"status",style:{pointerEvents:"none"},"data-active":l||void 0};return s?s(i,p):u?_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:u}):_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:r})});var _mergeprops = require('@base-ui/react/merge-props');function E(c,e){return _mergeprops.mergeProps.call(void 0, c,on(e))}function on(c){let e={...c};for(let t in e){let s=e[t];an(t,s)&&(e[t]=(u,...n)=>(_mergeprops.makeEventPreventable.call(void 0, u),s(u,...n)))}return e}function an(c,e){return c.charCodeAt(0)===111&&c.charCodeAt(1)===110&&c.charCodeAt(2)>=65&&c.charCodeAt(2)<=90&&typeof e=="function"}var lr=sr.forwardRef(function(e,t){let{render:s,...u}=e,n=P("CaptionsButton"),o=n.registeredTracks.length>0,a=n.activeTextTrack!==null,r={active:a,available:o,trackCount:n.registeredTracks.length},l=E({ref:t,type:"button","aria-label":a?"Disable captions":"Enable captions","aria-pressed":a,disabled:!o,"data-active":a||void 0,"data-available":o||void 0,onClick(){if(a)n.setTextTrack(null);else if(n.registeredTracks.length>0){let p=n.registeredTracks[0];_optionalChain([p, 'optionalAccess', _2 => _2.textTrack])&&n.setTextTrack(p.textTrack)}}},u);return s?s(l,r):_jsxruntime.jsx.call(void 0, "button",{...l})});var ur=it.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("CaptionsMenu"),a={registeredTracks:o.registeredTracks,activeTextTrack:o.activeTextTrack},r={ref:t,role:"menu","aria-label":"Captions","data-active":o.activeTextTrack!==null||void 0};return s?s(r,a):_jsxruntime.jsx.call(void 0, "div",{...r,...n,children:_nullishCoalesce(u, () => (_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Ae,{track:null,children:"Off"}),o.registeredTracks.map(l=>_jsxruntime.jsx.call(void 0, Ae,{track:l.textTrack,children:l.label},l.id))]})))})}),Ae=it.forwardRef(function(e,t){let{track:s,children:u,...n}=e,o=P("CaptionsMenuItem"),a=o.activeTextTrack===s,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setTextTrack(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var We=(r=>(r.open="data-open",r.closed="data-closed",r.idle="data-idle",r.playing="data-playing",r.paused="data-paused",r.ended="data-ended",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r))(We||{});function cn(c){let e=[...c.getAnimations(),...Array.from(c.querySelectorAll("*")).flatMap(t=>t.getAnimations())];return e.length===0?Promise.resolve():Promise.all(e.map(t=>t.finished)).then(()=>{}).catch(()=>{})}function Y(c){let{open:e,keepMounted:t=!1}=c,[s,u]=X.useState(e||t),[n,o]=X.useState(e?"starting":void 0),a=X.useRef(null),r=X.useRef(!1);return X.useEffect(()=>{if(e){r.current=!1,u(!0),o("starting");let l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(void 0)})});return()=>cancelAnimationFrame(l)}},[e]),X.useEffect(()=>{if(!e&&s&&!r.current){o("ending");let l=a.current;if(!l){o(void 0),t||u(!1);return}r.current=!0;let p=requestAnimationFrame(()=>{requestAnimationFrame(()=>{cn(l).then(()=>{r.current&&(r.current=!1,o(void 0),t||u(!1))})})});return()=>{cancelAnimationFrame(p)}}},[e,s,t]),X.useEffect(()=>{t&&!s&&!e&&u(!0)},[t,s,e]),{mounted:s||t,transitionStatus:n,elementRef:a}}var cr=fe.forwardRef(function(e,t){let{idleTimeout:s,keepMounted:u=!1,render:n,children:o,...a}=e,r=P("Controls"),p=(_nullishCoalesce(s, () => (r.idleTimeout)))===0||!r.idle,{mounted:i,transitionStatus:f,elementRef:b}=Y({open:p,keepMounted:u}),S=fe.useCallback(L=>{b.current=L,typeof t=="function"?t(L):t&&(t.current=L)},[t,b]),{onClick:T,...y}=a,x=fe.useCallback(L=>{L.stopPropagation(),_optionalChain([T, 'optionalCall', _3 => _3(L)])},[T]),v={open:p,idle:r.idle,playing:r.playing,paused:r.paused,ended:r.ended},k={ref:S,onClick:x,"data-open":p||void 0,"data-closed":!p||void 0,"data-idle":r.idle||void 0,"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0};return i?n?n(k,v):_jsxruntime.jsx.call(void 0, "div",{...k,...y,children:o}):null});var dr=ue.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("FullscreenButton"),[a,r]=ue.useState(!1);ue.useEffect(()=>{r("fullscreenEnabled"in document&&document.fullscreenEnabled)},[]);let l={fullscreen:o.fullscreen,supported:a},p=E({ref:t,type:"button","aria-label":o.fullscreen?"Exit fullscreen":"Enter fullscreen","aria-pressed":o.fullscreen,disabled:!a,"data-fullscreen":o.fullscreen||void 0,"data-supported":a||void 0,onClick(){o.toggleFullscreen()}},n);return s?s(p,l):_jsxruntime.jsx.call(void 0, "button",{...p,children:u})});var fr=pr.forwardRef(function(e,t){let{render:s,...u}=e,n=P("MuteButton"),o={muted:n.muted,volume:n.volume},a=n.volume,r=n.muted,l=a===0||r,p=a>0&&!r,i=!r&&a>0&&a<.5,f=!r&&a>=.5,b=E({ref:t,type:"button","aria-label":n.muted?"Unmute":"Mute","aria-pressed":n.muted,"data-muted":r||void 0,"data-volume-off":l||void 0,"data-volume-on":p||void 0,"data-volume-low":i||void 0,"data-volume-high":f||void 0,onClick(){n.toggleMute()}},u);return s?s(b,o):_jsxruntime.jsx.call(void 0, "button",{...b})});var Fe=(i=>(i.open="data-open",i.closed="data-closed",i.playing="data-playing",i.paused="data-paused",i.ended="data-ended",i.waiting="data-waiting",i.seeking="data-seeking",i.fullscreen="data-fullscreen",i.pip="data-pip",i.startingStyle="data-starting-style",i.endingStyle="data-ending-style",i))(Fe||{});var mr=Qe.forwardRef(function(e,t){let{idleTimeout:s,keepMounted:u=!1,render:n,children:o,...a}=e,r=P("Overlay"),p=(_nullishCoalesce(s, () => (r.idleTimeout)))===0||!r.idle,{mounted:i,transitionStatus:f,elementRef:b}=Y({open:p,keepMounted:u}),S=Qe.useCallback(x=>{b.current=x,typeof t=="function"?t(x):t&&(t.current=x)},[t,b]),T={playing:r.playing,paused:r.paused,ended:r.ended,waiting:r.waiting,seeking:r.seeking,fullscreen:r.fullscreen,pictureInPicture:r.pictureInPicture,open:p},y=E({ref:S,onClick(){r.toggle()},"data-playing":r.playing||void 0,"data-paused":r.paused||void 0,"data-ended":r.ended||void 0,"data-waiting":r.waiting||void 0,"data-seeking":r.seeking||void 0,"data-fullscreen":r.fullscreen||void 0,"data-pip":r.pictureInPicture||void 0,"data-open":p||void 0,"data-closed":!p||void 0,"data-starting-style":f==="starting"||void 0,"data-ending-style":f==="ending"||void 0},a);return i?n?n(y,T):_jsxruntime.jsx.call(void 0, "div",{...y,...a,children:o}):null});var Pr=ce.forwardRef(function(e,t){let{render:s,...u}=e,n=P("PictureInPictureButton"),[o,a]=ce.useState(!1);ce.useEffect(()=>{a("pictureInPictureEnabled"in document&&document.pictureInPictureEnabled)},[]);let r={pictureInPicture:n.pictureInPicture,supported:o},l=E({ref:t,type:"button","aria-label":n.pictureInPicture?"Exit picture-in-picture":"Enter picture-in-picture","aria-pressed":n.pictureInPicture,disabled:!o,"data-pip":n.pictureInPicture||void 0,"data-supported":o||void 0,onClick(){n.togglePictureInPicture()}},u);return s?s(l,r):_jsxruntime.jsx.call(void 0, "button",{...l})});var Rr=yr.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("PlayButton"),a={playing:o.playing,paused:o.paused,ended:o.ended,waiting:o.waiting},r=E({ref:t,type:"button","aria-label":o.playing?"Pause":"Play","data-playing":o.playing||void 0,"data-paused":o.paused||void 0,"data-ended":o.ended||void 0,"data-waiting":o.waiting||void 0,onClick(){o.toggle()}},n);return s?s(r,a):_jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var Rn=[.25,.5,.75,1,1.25,1.5,1.75,2],br=Sr.forwardRef(function(e,t){let{rates:s=Rn,render:u,children:n,...o}=e,a=P("PlaybackRateButton"),r={playbackRate:a.playbackRate,rates:s},l=E({ref:t,type:"button","aria-label":`Playback speed: ${a.playbackRate}x`,"data-rate":a.playbackRate,onClick(){let p=s.indexOf(a.playbackRate),i=_nullishCoalesce(_nullishCoalesce(s[(p+1)%s.length], () => (s[0])), () => (a.playbackRate));a.setPlaybackRate(i)}},o);return u?u(l,r):_jsxruntime.jsx.call(void 0, "button",{...l,children:_nullishCoalesce(n, () => (`${a.playbackRate}x`))})});var bn=[.25,.5,.75,1,1.25,1.5,1.75,2],kr=lt.forwardRef(function(e,t){let{rates:s=bn,render:u,children:n,...o}=e,a=P("PlaybackRateMenu"),r={playbackRate:a.playbackRate,rates:s},l={ref:t,role:"menu","aria-label":"Playback speed","data-rate":a.playbackRate};return u?u(l,r):_jsxruntime.jsx.call(void 0, "div",{...l,...o,children:_nullishCoalesce(n, () => (s.map(p=>_jsxruntime.jsx.call(void 0, ut,{rate:p},p))))})}),ut=lt.forwardRef(function(e,t){let{rate:s,children:u,...n}=e,o=P("PlaybackRateMenuItem"),a=o.playbackRate===s,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setPlaybackRate(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:_nullishCoalesce(u, () => (`${s}x`))})});var _reactdom = require('react-dom'); var Mr = _interopRequireWildcard(_reactdom);function gr(c){let{children:e,container:t}=c,[s,u]=$e.useState(!1);if($e.useEffect(()=>(u(!0),()=>u(!1)),[]),!s)return null;let n=_nullishCoalesce(t, () => ((typeof document<"u"?document.body:null)));return n?_reactdom.createPortal.call(void 0, e,n):null}var vr=Ne.forwardRef(function(e,t){let{keepMounted:s=!1,render:u,children:n,...o}=e,a=P("Poster"),r=!a.canPlay,l=a.canPlay,{mounted:p,transitionStatus:i,elementRef:f}=Y({open:r,keepMounted:s}),b=gn(t,f),S={loading:r,loaded:l,transitionStatus:i},T={ref:b,"aria-hidden":!0,"data-loading":r||void 0,"data-loaded":l||void 0,"data-starting-style":i==="starting"||void 0,"data-ending-style":i==="ending"||void 0};return p?u?u(T,S):_jsxruntime.jsx.call(void 0, "div",{...T,...o,children:n}):null});function gn(...c){return Ne.useCallback(e=>{for(let t of c)typeof t=="function"?t(e):t!=null&&(t.current=e)},c)}var Tr=dt.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("QualityMenu"),a={qualities:o.qualities,activeQuality:o.activeQuality},r={ref:t,role:"menu","aria-label":"Video quality","data-quality":_nullishCoalesce(_optionalChain([o, 'access', _4 => _4.activeQuality, 'optionalAccess', _5 => _5.label]), () => (void 0))};return s?s(r,a):_jsxruntime.jsx.call(void 0, "div",{...r,...n,children:_nullishCoalesce(u, () => (o.qualities.map(l=>_jsxruntime.jsx.call(void 0, pt,{quality:l,children:l.label},l.label))))})}),pt=dt.forwardRef(function(e,t){let{quality:s,children:u,...n}=e,o=P("QualityMenuItem"),a=_optionalChain([o, 'access', _6 => _6.activeQuality, 'optionalAccess', _7 => _7.label])===s.label,r=E({ref:t,type:"button",role:"menuitemradio","aria-checked":a,"data-active":a||void 0,onClick(){o.setQuality(s)}},n);return _jsxruntime.jsx.call(void 0, "button",{...r,children:u})});var je=(l=>(l.playing="data-playing",l.paused="data-paused",l.ended="data-ended",l.waiting="data-waiting",l.seeking="data-seeking",l.fullscreen="data-fullscreen",l.pip="data-pip",l.muted="data-muted",l.idle="data-idle",l))(je||{});function Tn(c,e){return!(c instanceof HTMLElement)||c instanceof HTMLInputElement&&c.type==="range"&&e===" "?!1:c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable}function hn(c){return c==="ArrowRight"||c==="ArrowLeft"}function hr(c,e){let t=ie(),s=Ue.useRef(t);s.current=t,Ue.useEffect(()=>{if(e==="none")return;let u=a=>{if(Tn(a.target,a.key))return;let r=s.current;switch(a.key){case" ":a.preventDefault(),r.toggle();break;case"f":case"F":a.preventDefault(),r.toggleFullscreen();break;case"ArrowUp":a.preventDefault(),r.setVolume(Math.min(r.volume+.1,1));break;case"ArrowDown":a.preventDefault(),r.setVolume(Math.max(r.volume-.1,0));break;case"ArrowRight":a.preventDefault(),r.beginSeekInteraction(),r.seek(Math.min(r.currentTime+5,r.duration));break;case"ArrowLeft":a.preventDefault(),r.beginSeekInteraction(),r.seek(Math.max(r.currentTime-5,0));break;default:return}r.resetIdle()},n=a=>{hn(a.key)&&s.current.endSeekInteraction()};if(e==="global")return window.addEventListener("keydown",u),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",u),window.removeEventListener("keyup",n)};let o=c.current;if(o)return o.addEventListener("keydown",u),o.addEventListener("keyup",n),()=>{o.removeEventListener("keydown",u),o.removeEventListener("keyup",n)}},[e,c])}function _e(c,e,t){let[s,u]=d.useState(e),n=c!==void 0,o=n?c:s,a=d.useCallback(r=>{let l=typeof r=="function"?r(o):r;n||u(l),_optionalChain([t, 'optionalCall', _8 => _8(l)])},[n,o,t]);return[o,a]}function xn({rootRef:c,videoRef:e,actionsRef:t,defaultPlaying:s=!1,autoPlay:u=!1,defaultVolume:n=1,defaultMuted:o=!1,defaultPlaybackRate:a=1,playing:r,onPlayingChange:l,volume:p,onVolumeChange:i,muted:f,onMutedChange:b,playbackRate:S,onPlaybackRateChange:T,currentTime:y,onCurrentTimeChange:x,idleTimeout:v=3e3,preventIdleWhenPaused:k=!1,idle:L,onIdleChange:M,onEnded:w,onWaiting:H,onSeeking:Q,onSeeked:D,onFullscreenChange:h,onPictureInPictureChange:$,children:U}){let q=d.useRef(1),_=d.useRef(!1),z=d.useRef(!1),Z=d.useRef(!1),[B,I]=d.useState("paused"),[g,A]=d.useState(s?"play":"pause");d.useEffect(()=>{r!==void 0&&(A(r?"play":"pause"),B!=="waiting"&&I(r?"playing":"paused"))},[r,B]);let[W,te]=_e(p,n,i),[J,pe]=_e(f,o,b),[Pt,yt]=_e(S,a,T),[qr,re]=_e(L,!0,M),ne=d.useRef(null),ye=d.useCallback(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null)},[]),Rt=d.useCallback(()=>{v!==0&&(ye(),ne.current=setTimeout(()=>{re(!0)},v))},[v,ye,re]),St=d.useCallback(()=>{re(!1),Rt()},[re,Rt]),bt=d.useCallback(()=>{ye(),re(!0)},[ye,re]);d.useEffect(()=>(v>0&&(ne.current=setTimeout(()=>{re(!0)},v)),()=>{ne.current&&clearTimeout(ne.current)}),[]);let kt=k&&B!=="playing"?!1:qr,se=d.useCallback(()=>{let m=e.current;m&&(m.muted!==J&&(m.muted=J),m.volume!==W&&(m.volume=W))},[J,e,W]),Re=d.useCallback(async()=>{let m=e.current;if(!(!u||!m||Z.current)){Z.current=!0,A("play"),se();try{await m.play(),I("playing"),_optionalChain([l, 'optionalCall', _9 => _9(!0)])}catch (e2){A("pause"),I("paused")}}},[u,l,se,e]);d.useEffect(()=>{if(!u){Z.current=!1;return}Re()},[u,Re]);let[gt,vt]=d.useState(0),[Se,Tt]=d.useState(0),[ht,Xr]=d.useState(null),[be,Yr]=d.useState(null),[xt,Ct]=d.useState(!1),[Mt,le]=d.useState(!1),[ke,Gr]=d.useState(!1),[ge,Et]=d.useState(!1),[Bt,ot]=d.useState([]),[oe,zr]=d.useState(null),[Vt,ve]=d.useState([]),[wt,Nn]=d.useState([]),[Lt,Jr]=d.useState(null);d.useEffect(()=>{y!==void 0&&e.current&&(e.current.currentTime=y)},[y,e]),d.useEffect(()=>{f===void 0&&p===void 0||se()},[f,p,se]),d.useEffect(()=>{let m=()=>{let C=document.fullscreenElement===c.current;Gr(C),_optionalChain([h, 'optionalCall', _10 => _10(C)])};return document.addEventListener("fullscreenchange",m),()=>document.removeEventListener("fullscreenchange",m)},[h,c]),d.useEffect(()=>{let m=e.current;if(!m)return;let C=()=>{Et(!0),_optionalChain([$, 'optionalCall', _11 => _11(!0)])},N=()=>{Et(!1),_optionalChain([$, 'optionalCall', _12 => _12(!1)])};return m.addEventListener("enterpictureinpicture",C),m.addEventListener("leavepictureinpicture",N),()=>{m.removeEventListener("enterpictureinpicture",C),m.removeEventListener("leavepictureinpicture",N)}},[$,e]);let Te=d.useCallback(async()=>{e.current&&(A("play"),await e.current.play(),I("playing"),_optionalChain([l, 'optionalCall', _13 => _13(!0)]))},[e,l]),he=d.useCallback(()=>{e.current&&(A("pause"),e.current.pause(),I("paused"),_optionalChain([l, 'optionalCall', _14 => _14(!1)]))},[e,l]),xe=d.useCallback(async()=>{B==="playing"?he():await Te()},[B,Te,he]),Ce=d.useCallback(m=>{e.current&&(e.current.currentTime=m,vt(m),_optionalChain([x, 'optionalCall', _15 => _15(m)]))},[x,e]),Ht=d.useCallback(()=>{let m=e.current;!m||_.current||(_.current=!0,z.current=g==="play",le(!0),z.current&&!m.paused&&m.pause())},[g,e]),It=d.useCallback(()=>{let m=e.current;if(!m||!_.current)return;let C=z.current&&g==="play";if(_.current=!1,z.current=!1,!C){le(!1);return}m.play().then(()=>{I("playing"),le(!1)}).catch(()=>{I("waiting"),le(!1)})},[g,e]),Me=d.useCallback(m=>{let C=Math.max(0,Math.min(1,m));e.current&&(e.current.volume=C),te(C)},[te,e]),Dt=d.useCallback(()=>{if(!(J||W===0))q.current=W,e.current&&(e.current.muted=!0),pe(!0);else{let C=q.current>0?q.current:1;e.current&&(e.current.volume=C,e.current.muted=!1),te(C),pe(!1)}},[J,W,pe,te,e]),Ee=d.useCallback(async()=>{_optionalChain([c, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.requestFullscreen])&&await c.current.requestFullscreen()},[c]),Be=d.useCallback(async()=>{document.exitFullscreen&&await document.exitFullscreen()},[]),Ve=d.useCallback(async()=>{ke?await Be():await Ee()},[ke,Ee,Be]),we=d.useCallback(async()=>{_optionalChain([e, 'access', _18 => _18.current, 'optionalAccess', _19 => _19.requestPictureInPicture])&&await e.current.requestPictureInPicture()},[e]),Le=d.useCallback(async()=>{document.pictureInPictureElement&&await document.exitPictureInPicture()},[]),Ot=d.useCallback(async()=>{ge?await Le():await we()},[ge,we,Le]),At=d.useCallback(m=>{e.current&&(e.current.playbackRate=m),yt(m)},[yt,e]),Wt=d.useCallback(m=>{if(e.current){for(let C=0;C<e.current.textTracks.length;C++){let N=e.current.textTracks[C];N&&(N.mode="disabled")}m&&(m.mode="hidden")}zr(m),ve([])},[e]),Ft=d.useCallback(m=>{Jr(m)},[]),Qt=d.useCallback(m=>{ot(C=>C.some(N=>N.id===m.id)?C:[...C,m])},[]),$t=d.useCallback(m=>{ot(C=>C.filter(N=>N.id!==m))},[]),Nt=d.useCallback((m,C)=>{ot(N=>N.map(ae=>ae.id===m?{...ae,textTrack:C}:ae))},[]);d.useEffect(()=>{if(!oe){ve([]);return}let m=()=>{let C=oe.activeCues;if(!C){ve([]);return}let N=[];for(let ae=0;ae<C.length;ae++){let rr=C[ae];rr instanceof VTTCue&&N.push(rr)}ve(N)};return m(),oe.addEventListener("cuechange",m),()=>{oe.removeEventListener("cuechange",m)}},[oe]),d.useImperativeHandle(t,()=>({toggle:xe,seek:Ce,setVolume:Me,toggleFullscreen:Ve}),[xe,Ce,Me,Ve]);let jt=d.useCallback(()=>{if(e.current){let m=e.current.currentTime;vt(m),_optionalChain([x, 'optionalCall', _20 => _20(m)])}},[x,e]),Ut=d.useCallback(()=>{e.current&&Tt(e.current.duration)},[e]),_t=d.useCallback(()=>{e.current&&Xr(e.current.buffered)},[e]),Kt=d.useCallback(()=>{A("play"),I("playing"),_optionalChain([l, 'optionalCall', _21 => _21(!0)])},[l]),qt=d.useCallback(()=>{_.current||B!=="ended"&&(I("paused"),_optionalChain([l, 'optionalCall', _22 => _22(!1)]))},[B,l]),Xt=d.useCallback(()=>{A("pause"),I("ended"),_optionalChain([l, 'optionalCall', _23 => _23(!1)]),_optionalChain([w, 'optionalCall', _24 => _24()])},[l,w]),Yt=d.useCallback(()=>{_.current||(I("waiting"),_optionalChain([H, 'optionalCall', _25 => _25()]))},[H]),Gt=d.useCallback(()=>{if(_.current){Ct(!0);return}if(B==="waiting"){let m=g==="play"?"playing":"paused";I(m),_optionalChain([l, 'optionalCall', _26 => _26(m==="playing")])}Ct(!0)},[B,g,l]),zt=d.useCallback(()=>{le(!0),B==="ended"&&I("paused"),_optionalChain([Q, 'optionalCall', _27 => _27()])},[B,Q]),Jt=d.useCallback(()=>{if(le(!1),e.current){let{currentTime:m,duration:C}=e.current;C>0&&C-m<.01&&I("ended")}_optionalChain([D, 'optionalCall', _28 => _28()])},[D,e]),Zt=d.useCallback(()=>{e.current&&(te(e.current.volume),pe(e.current.muted))},[te,pe,e]),er=d.useCallback(()=>{e.current&&Tt(e.current.duration)},[e]),tr=d.useCallback(()=>{se(),Re()},[Re,se]),Zr=d.useMemo(()=>({playbackStatus:B,playbackIntent:g,playing:B==="playing",paused:B==="paused",ended:B==="ended",waiting:B==="waiting",seeking:Mt,canPlay:xt,currentTime:gt,duration:Se,buffered:ht,hoverTime:be,hoverProgress:be!==null&&Se>0?be/Se*100:null,volume:W,muted:J,fullscreen:ke,pictureInPicture:ge,idle:kt,idleTimeout:v,preventIdleWhenPaused:k,registeredTracks:Bt,activeTextTrack:oe,activeCues:Vt,playbackRate:Pt,qualities:wt,activeQuality:Lt,videoRef:e,rootRef:c,play:Te,pause:he,toggle:xe,seek:Ce,setVolume:Me,toggleMute:Dt,enterFullscreen:Ee,exitFullscreen:Be,toggleFullscreen:Ve,enterPictureInPicture:we,exitPictureInPicture:Le,togglePictureInPicture:Ot,setPlaybackRate:At,setTextTrack:Wt,setQuality:Ft,registerTrack:Qt,unregisterTrack:$t,updateTrackRef:Nt,resetIdle:St,setHoverTime:Yr,beginSeekInteraction:Ht,endSeekInteraction:It,_handlers:{onTimeUpdate:jt,onDurationChange:Ut,onProgress:_t,onPlay:Kt,onPause:qt,onEnded:Xt,onWaiting:Yt,onCanPlay:Gt,onSeeking:zt,onSeeked:Jt,onVolumeChange:Zt,onLoadedMetadata:er,onVideoMount:tr,onRootMouseLeave:bt}}),[B,g,Mt,xt,gt,Se,ht,be,W,J,ke,ge,kt,v,k,Bt,oe,Vt,Pt,wt,Lt,e,c,Te,he,xe,Ce,Me,Dt,Ee,Be,Ve,we,Le,Ot,At,Wt,Ft,Qt,$t,Nt,St,Ht,It,jt,Ut,_t,Kt,qt,Xt,Yt,Gt,zt,Jt,Zt,er,tr,bt]);return _jsxruntime.jsx.call(void 0, at.Provider,{value:Zr,children:U})}var xr=d.forwardRef(function(e,t){let{actionsRef:s,keyboardShortcuts:u="focused",defaultPlaying:n,autoPlay:o,defaultVolume:a,defaultMuted:r,defaultPlaybackRate:l,playing:p,onPlayingChange:i,volume:f,onVolumeChange:b,muted:S,onMutedChange:T,playbackRate:y,onPlaybackRateChange:x,currentTime:v,onCurrentTimeChange:k,idleTimeout:L,preventIdleWhenPaused:M,hideCursorWhenIdle:w="fullscreen",idle:H,onIdleChange:Q,onEnded:D,onWaiting:h,onSeeking:$,onSeeked:U,onFullscreenChange:q,onPictureInPictureChange:_,children:z,...Z}=e,B=d.useRef(null),I=d.useRef(null);return _jsxruntime.jsx.call(void 0, xn,{actionsRef:s,defaultPlaying:n,autoPlay:o,defaultVolume:a,defaultMuted:r,defaultPlaybackRate:l,playing:p,onPlayingChange:i,volume:f,onVolumeChange:b,muted:S,onMutedChange:T,playbackRate:y,onPlaybackRateChange:x,currentTime:v,onCurrentTimeChange:k,idleTimeout:L,preventIdleWhenPaused:M,idle:H,onIdleChange:Q,onEnded:D,onWaiting:h,onSeeking:$,onSeeked:U,onFullscreenChange:q,onPictureInPictureChange:_,rootRef:B,videoRef:I,children:_jsxruntime.jsx.call(void 0, Cn,{ref:t,rootRef:B,keyboardShortcuts:u,hideCursorWhenIdle:w,...Z,children:z})})}),Cn=d.forwardRef(function({rootRef:e,keyboardShortcuts:t,hideCursorWhenIdle:s,children:u,className:n,style:o,...a},r){let l=ie(),p=Mn(r,e),i=d.useRef(null);hr(e,t);let f=d.useCallback(w=>{let{clientX:H,clientY:Q}=w,D=i.current;D&&D.x===H&&D.y===Q||(i.current={x:H,y:Q},l.resetIdle())},[l]),b=d.useCallback(w=>{let{clientX:H,clientY:Q}=w,D=i.current;D&&D.x===H&&D.y===Q||(i.current={x:H,y:Q},l.resetIdle())},[l]),S=d.useCallback(()=>{l._handlers.onRootMouseLeave()},[l._handlers]),T=d.useCallback(()=>{l.resetIdle()},[l]),y=d.useCallback(()=>{l.resetIdle()},[l]),x=d.useCallback(w=>{w.key==="Tab"&&l.resetIdle()},[l]),v=E({onMouseMove:f,onMouseEnter:b,onMouseLeave:S,onClick:T,onFocus:y,onKeyDown:x},a),k={"data-playing":l.playing||void 0,"data-paused":l.paused||void 0,"data-ended":l.ended||void 0,"data-waiting":l.waiting||void 0,"data-seeking":l.seeking||void 0,"data-fullscreen":l.fullscreen||void 0,"data-pip":l.pictureInPicture||void 0,"data-muted":l.muted||void 0,"data-idle":l.idle||void 0},L=s!==!1&&l.idle&&(s==="always"||s==="fullscreen"&&l.fullscreen),M=d.useId();return _jsxruntime.jsxs.call(void 0, "div",{...v,ref:p,tabIndex:t==="focused"?0:void 0,className:n,style:o,"data-video-player-scope":M,...k,children:[L&&_jsxruntime.jsx.call(void 0, "style",{children:`[data-video-player-scope="${M}"], [data-video-player-scope="${M}"] * { cursor: none !important; }`}),u]})});function Mn(...c){return d.useCallback(e=>{for(let t of c)typeof t=="function"?t(e):t!=null&&(t.current=e)},c)}var qe=(o=>(o.progress="--seek-progress",o.buffered="--seek-buffered",o.currentTime="--seek-current-time",o.duration="--seek-duration",o.hoverProgress="--seek-hover-progress",o.hoverTime="--seek-hover-time",o))(qe||{});var Xe=(u=>(u.seeking="data-seeking",u.hovering="data-hovering",u.pressing="data-pressing",u.dragging="data-dragging",u))(Xe||{});var _slider = require('@base-ui/react/slider');var _react2 = require('@floating-ui/react');var Ye=(u=>(u.open="data-open",u.closed="data-closed",u.startingStyle="data-starting-style",u.endingStyle="data-ending-style",u))(Ye||{});var ft=R.createContext(null);function Er(c){let e=R.useContext(ft);if(!e)throw new Error(`${c} must be used within SeekSlider`);return e}function Cr(c){return c==="ArrowRight"||c==="ArrowLeft"}var Br=R.forwardRef(function(e,t){let{render:s,children:u,onPointerMove:n,onPointerLeave:o,onPointerDown:a,onKeyUp:r,onValueCommitted:l,...p}=e,i=P("SeekSlider"),f=R.useRef(null),[b,S]=R.useState(null),[T,y]=R.useState(!1),[x,v]=R.useState(!1),k=R.useRef(!1);R.useEffect(()=>{if(!T)return;let g=()=>{y(!1),v(!1),k.current=!1,i.endSeekInteraction()};return window.addEventListener("pointerup",g),()=>window.removeEventListener("pointerup",g)},[T,i]);let L=i.duration>0?i.currentTime/i.duration*100:0,M=R.useCallback((g,A)=>{let W=typeof g=="number"?g:g[0];W!==void 0&&(A.reason==="keyboard"&&i.beginSeekInteraction(),i.seek(W),i.resetIdle(),k.current&&v(!0))},[i]),w=R.useCallback(g=>{if(_optionalChain([n, 'optionalCall', _29 => _29(g)]),!f.current||i.duration===0)return;let A=f.current.getBoundingClientRect(),W=g.clientX-A.left,J=Math.max(0,Math.min(1,W/A.width))*i.duration;i.setHoverTime(J)},[n,i]),H=R.useCallback(g=>{_optionalChain([o, 'optionalCall', _30 => _30(g)]),i.setHoverTime(null)},[o,i]),Q=R.useCallback(g=>{_optionalChain([a, 'optionalCall', _31 => _31(g)]),y(!0),k.current=!0,i.beginSeekInteraction()},[a,i]),D=R.useCallback(g=>{_optionalChain([r, 'optionalCall', _32 => _32(g)]),Cr(g.key)&&i.endSeekInteraction()},[r,i]),h=R.useCallback((g,A)=>{let W=typeof g=="number"?g:g[0];W!==void 0&&(_optionalChain([l, 'optionalCall', _33 => _33(W,A)]),y(!1),v(!1),k.current=!1,!(A.reason==="keyboard"&&Cr(A.event.key))&&i.endSeekInteraction())},[l,i]),$=R.useMemo(()=>{if(!i.buffered||i.buffered.length===0)return 0;for(let g=0;g<i.buffered.length;g++)if(i.buffered.start(g)<=i.currentTime&&i.currentTime<=i.buffered.end(g))return i.buffered.end(g);return i.buffered.end(0)},[i.buffered,i.currentTime]),U=i.duration>0?$/i.duration*100:0;R.useLayoutEffect(()=>{typeof t=="function"?t(f.current):t&&(t.current=f.current)});let q={currentTime:i.currentTime,duration:i.duration,progress:L,seeking:i.seeking,pressing:T,dragging:x,hoverTime:i.hoverTime,hoverProgress:i.hoverProgress},_=i.hoverProgress!==null,z=_nullishCoalesce(i.hoverProgress, () => (0)),Z=R.useMemo(()=>({sliderRef:f,previewThumbElement:b,setPreviewThumbElement:S,hoverProgress:z,open:_}),[f,b,S,z,_]),B={position:"relative","--seek-progress":`${L}%`,"--seek-buffered":`${U}%`,"--seek-current-time":i.currentTime,"--seek-duration":i.duration,"--seek-hover-progress":i.hoverProgress!==null?`${i.hoverProgress}%`:void 0,"--seek-hover-time":_nullishCoalesce(i.hoverTime, () => (void 0)),...p.style},I={"data-seeking":i.seeking||void 0,"data-hovering":i.hoverTime!==null||void 0,"data-pressing":T||void 0,"data-dragging":x||void 0,style:B};return s?_jsxruntime.jsx.call(void 0, ft.Provider,{value:Z,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:i.duration||100,step:.1,value:i.currentTime,onValueChange:M,onValueCommitted:h,onPointerMove:w,onPointerLeave:H,onPointerDown:Q,onKeyUp:D,"aria-label":"Seek",render:g=>s({...g,...I,style:{...g.style,...I.style}},q)})}):_jsxruntime.jsx.call(void 0, ft.Provider,{value:Z,children:_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:f,min:0,max:i.duration||100,step:.1,value:i.currentTime,onValueChange:M,onValueCommitted:h,onPointerMove:w,onPointerLeave:H,onPointerDown:Q,onKeyUp:D,"aria-label":"Seek",...I,...p,children:_nullishCoalesce(u, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{style:{position:"relative"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${U}%`}}),_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})})}),Vr=_slider.Slider.Control,wr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a={},r={position:"relative",...n},l={ref:t,style:r};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{render:p=>s({...p,...l},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:t,style:r,...o,children:u})}),Lr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a=P("SeekSliderProgress"),l={progress:a.duration>0?a.currentTime/a.duration*100:0},p={height:"100%",...n},i={ref:t,style:p};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{render:f=>s({...f,...i,style:{...f.style,...p}},l)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:t,style:p,...o,children:u})}),Hr=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a={},r={ref:t,style:_nullishCoalesce(n, () => ({}))};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{render:l=>s({...l,...r,style:{...l.style,...n}},a)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:t,style:n,...o,children:u})}),Ir=R.forwardRef(function(e,t){let{render:s,children:u,...n}=e,o=P("SeekSliderBuffered"),a=R.useMemo(()=>{if(!o.buffered||o.buffered.length===0)return 0;for(let f=0;f<o.buffered.length;f++)if(o.buffered.start(f)<=o.currentTime&&o.currentTime<=o.buffered.end(f))return o.buffered.end(f);return o.buffered.end(0)},[o.buffered,o.currentTime]),r=o.duration>0?a/o.duration*100:0,l={bufferedPercentage:r},p={position:"absolute",left:0,top:0,height:"100%",width:`${r}%`,...n.style},i={ref:t,style:p};return s?s(i,l):_jsxruntime.jsx.call(void 0, "div",{...i,...n,children:u})}),Dr=R.forwardRef(function(e,t){let{keepMounted:s=!1,render:u,children:n,...o}=e,a=P("SeekSliderPreviewThumb"),r=Er("SeekSliderPreviewThumb"),l=a.hoverProgress!==null,p=R.useRef(0);a.hoverProgress!==null&&(p.current=a.hoverProgress);let i=_nullishCoalesce(a.hoverProgress, () => (p.current)),{mounted:f,transitionStatus:b,elementRef:S}=Y({open:l,keepMounted:s}),T=R.useCallback(k=>{S.current=k,r.setPreviewThumbElement(k),typeof t=="function"?t(k):t&&(t.current=k)},[t,S,r]),y={open:l,transitionStatus:b,hoverProgress:i},x={position:"absolute",left:`${i}%`,transform:"translateX(-50%)",pointerEvents:"none",...o.style},v={ref:T,style:x,"data-open":l||void 0,"data-closed":!l||void 0,"data-starting-style":b==="starting"||void 0,"data-ending-style":b==="ending"||void 0};return f?u?u(v,y):_jsxruntime.jsx.call(void 0, "span",{...v,...o,children:n}):null}),Or=R.forwardRef(function(e,t){let{render:s,children:u,style:n,...o}=e,a=P("SeekSliderHover"),r=a.hoverProgress!==null,l=_nullishCoalesce(a.hoverProgress, () => (0)),p={hovering:r,hoverProgress:a.hoverProgress,hoverTime:a.hoverTime},i={position:"absolute",left:0,top:0,height:"100%",width:`${l}%`,pointerEvents:"none",...n},f={ref:t,style:i,"data-hovering":r||void 0};return s?s(f,p):_jsxruntime.jsx.call(void 0, "div",{...f,...o,children:u})});function Ge({children:c,container:e}){let t=P("SeekSliderPreviewTooltipPortal"),[s,u]=R.useState(!1);if(R.useEffect(()=>{u(!0)},[]),!s)return null;let n=_nullishCoalesce(_nullishCoalesce(e, () => (t.rootRef.current)), () => (document.body));return Mr.createPortal(c,n)}var ze=R.forwardRef(function(e,t){let{sideOffset:s=8,collisionPadding:u=0,collisionBoundary:n,keepMounted:o=!1,children:a,style:r,...l}=e,p=Er("SeekSliderPreviewTooltipPositioner"),{previewThumbElement:i,open:f,hoverProgress:b}=p,[S,T]=R.useState(null),{refs:y,floatingStyles:x,update:v}=_react2.useFloating.call(void 0, {placement:"top",middleware:[_react2.offset.call(void 0, s),_react2.shift.call(void 0, {boundary:n,padding:u})]});R.useLayoutEffect(()=>{i&&y.setReference(i)},[i,y]),R.useEffect(()=>{if(f&&i&&S)return _react2.autoUpdate.call(void 0, i,S,v)},[f,i,S,v]),R.useLayoutEffect(()=>{f&&i&&S&&v()},[b,f,i,S,v]);let k=R.useCallback(M=>{y.setFloating(M),T(M),typeof t=="function"?t(M):t&&(t.current=M)},[y,t]);return(o||f)&&!!i?_jsxruntime.jsx.call(void 0, "div",{ref:k,style:{...x,...r},"data-seek-slider-preview-tooltip-positioner":!0,"data-open":f||void 0,"data-closed":!f||void 0,...l,children:a}):null}),Je=R.forwardRef(function(e,t){let{children:s,...u}=e;return _jsxruntime.jsx.call(void 0, "div",{ref:t,"data-seek-slider-preview-tooltip-popup":!0,...u,children:s})});function me({sideOffset:c,collisionPadding:e,collisionBoundary:t,keepMounted:s,container:u,children:n,...o}){return _jsxruntime.jsx.call(void 0, Ge,{container:u,children:_jsxruntime.jsx.call(void 0, ze,{sideOffset:c,collisionPadding:e,collisionBoundary:t,keepMounted:s,children:_jsxruntime.jsx.call(void 0, Je,{...o,children:n})})})}me.Portal=Ge;me.Positioner=ze;me.Popup=Je;var Ze=(s=>(s.loading="data-loading",s.ready="data-ready",s.error="data-error",s))(Ze||{});var Ar=F.forwardRef(function(e,t){let{time:s,crossOrigin:u="anonymous",render:n,children:o,width:a,height:r,...l}=e,p=P("Thumbnail"),i=F.useRef(null),f=F.useRef(null),b=F.useRef(null),[S,T]=F.useState("idle"),[y,x]=F.useState({width:160,height:90}),v=s!==void 0?s:p.hoverTime,k=F.useMemo(()=>{let h=p.videoRef.current;return h?h.currentSrc||h.src:null},[p.videoRef]);F.useEffect(()=>{if(!k)return;let h=document.createElement("video");h.src=k,h.crossOrigin=u,h.preload="metadata",h.muted=!0,h.playsInline=!0;let $=()=>{x({width:h.videoWidth,height:h.videoHeight})},U=()=>{T("error")};return h.addEventListener("loadedmetadata",$),h.addEventListener("error",U),f.current=h,()=>{h.removeEventListener("loadedmetadata",$),h.removeEventListener("error",U),h.src="",f.current=null}},[k,u]),F.useEffect(()=>{let h=f.current,$=i.current;if(!h||!$||v===null||v===void 0||b.current!==null&&Math.abs(b.current-v)<.1)return;T("loading");let U=()=>{let q=$.getContext("2d");if(q)try{q.drawImage(h,0,0,$.width,$.height),b.current=v,T("ready")}catch (e3){T("error")}};return h.addEventListener("seeked",U,{once:!0}),h.currentTime=v,()=>{h.removeEventListener("seeked",U)}},[v]);let L=F.useCallback(h=>{i.current=h,typeof t=="function"?t(h):t&&(t.current=h)},[t]),M=y.width/y.height,w=_nullishCoalesce(a, () => (160)),H=_nullishCoalesce(r, () => (Math.round(w/M)));typeof w=="string"&&(w=160),typeof H=="string"&&(H=90);let Q={loading:S==="loading",ready:S==="ready",error:S==="error",time:v,videoWidth:y.width,videoHeight:y.height},D={ref:L,width:w,height:H,"data-loading":S==="loading"||void 0,"data-ready":S==="ready"||void 0,"data-error":S==="error"||void 0};return n?n(D,Q):_jsxruntime.jsx.call(void 0, "canvas",{...D,...l,children:o})});var et=(e=>(e.hovering="data-hovering",e))(et||{});var Wr=tt.forwardRef(function(e,t){let{format:s="current / duration",fixedWidth:u=!0,align:n="left",render:o,...a}=e,r=P("TimeDisplay"),l=tt.useRef(0);r.hoverTime!==null&&(l.current=r.hoverTime);let p=r.duration-r.currentTime,i=Pe(r.currentTime),f=Pe(r.duration),b=Pe(p),S=r.hoverTime!==null?Pe(r.hoverTime):Pe(l.current),T={currentTime:r.currentTime,duration:r.duration,remaining:p,hoverTime:r.hoverTime,hovering:r.hoverTime!==null,formattedCurrent:i,formattedDuration:f,formattedRemaining:b,formattedHover:S},y=()=>{switch(s){case"current":return i;case"duration":return f;case"remaining":return`-${b}`;case"current / duration":return`${i} / ${f}`;case"current / remaining":return`${i} / -${b}`;case"hover":return S;default:return`${i} / ${f}`}},x=()=>{let k=On(r.duration);switch(s){case"current":case"duration":case"hover":return k;case"remaining":return`-${k}`;case"current / duration":return`${k} / ${k}`;case"current / remaining":return`${k} / -${k}`;default:return`${k} / ${k}`}},v={ref:t,style:{position:u?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},"data-hovering":T.hovering||void 0};return o?o(v,T):_jsxruntime.jsx.call(void 0, "span",{ref:t,"data-hovering":T.hovering||void 0,...a,style:{position:u?"relative":void 0,userSelect:"none",fontVariantNumeric:"tabular-nums",...a.style},children:u?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":!0,style:{visibility:"hidden"},children:x()}),_jsxruntime.jsx.call(void 0, "span",{style:Dn(n),children:y()})]}):y()})});function Dn(c){let e={position:"absolute"};switch(c){case"left":return{...e,left:0};case"right":return{...e,right:0};case"center":return{...e,left:"50%",transform:"translateX(-50%)"}}}function Pe(c){if(!Number.isFinite(c)||Number.isNaN(c))return"0:00";let e=Math.floor(c/3600),t=Math.floor(c%3600/60),s=Math.floor(c%60);return e>0?`${e}:${t.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${t}:${s.toString().padStart(2,"0")}`}function On(c){if(!Number.isFinite(c)||Number.isNaN(c)||c<=0)return"0:00";let e=Math.floor(c/3600),t=Math.floor(c%3600/60);if(e>0){let u=String(e).length;return`${"0".repeat(u)}:00:00`}let s=String(t).length;return`${"0".repeat(s)}:00`}var Fr=K.forwardRef(function(e,t){let{kind:s="captions",src:u,label:n,srcLang:o,default:a,...r}=e,{registerTrack:l,unregisterTrack:p,updateTrackRef:i,setTextTrack:f}=P("Track"),b=K.useRef(null),S=K.useId(),T=K.useCallback(y=>{typeof t=="function"?t(y):t&&(t.current=y),b.current=y},[t]);return K.useEffect(()=>(l({id:S,kind:s,label:n,srcLang:o,src:u,textTrack:null}),()=>{p(S)}),[S,s,n,o,u,l,p]),K.useEffect(()=>{let y=b.current;if(!y)return;let x=()=>{y.track&&(y.track.mode="disabled",i(S,y.track),a&&f(y.track))};return y.track&&x(),y.addEventListener("load",x),()=>{y.removeEventListener("load",x)}},[S,a,i,f]),_jsxruntime.jsx.call(void 0, "track",{ref:T,kind:s,src:u,label:n,srcLang:o,default:a,...r})});var Qr=de.forwardRef(function(e,t){let{toggleOnClick:s=!0,...u}=e,n=P("Video"),o=de.useRef(!1),a=de.useCallback(p=>{typeof t=="function"?t(p):t&&(t.current=p),n.videoRef.current=p,p&&!o.current&&(o.current=!0,n._handlers.onVideoMount(),p.readyState>=1&&p.duration&&(n._handlers.onLoadedMetadata(),n._handlers.onDurationChange()),p.readyState>=3&&n._handlers.onCanPlay())},[t,n.videoRef,n._handlers]),r={"data-playing":n.playing||void 0,"data-paused":n.paused||void 0,"data-ended":n.ended||void 0,"data-waiting":n.waiting||void 0,"data-seeking":n.seeking||void 0},l=E({ref:a,preload:"metadata",...r,onClick(){s&&n.toggle()},onTimeUpdate:n._handlers.onTimeUpdate,onDurationChange:n._handlers.onDurationChange,onProgress:n._handlers.onProgress,onPlay:n._handlers.onPlay,onPause:n._handlers.onPause,onEnded:n._handlers.onEnded,onWaiting:n._handlers.onWaiting,onCanPlay:n._handlers.onCanPlay,onSeeking:n._handlers.onSeeking,onSeeked:n._handlers.onSeeked,onVolumeChange:n._handlers.onVolumeChange,onLoadedMetadata:n._handlers.onLoadedMetadata},u);return _jsxruntime.jsx.call(void 0, "video",{...l})});var rt=(t=>(t.volume="--volume",t.volumePercentage="--volume-percentage",t))(rt||{});var nt=(u=>(u.muted="data-muted",u.volume="data-volume",u.pressing="data-pressing",u.dragging="data-dragging",u))(nt||{});var $r=O.forwardRef(function(e,t){let{render:s,children:u,onPointerDown:n,...o}=e,a=P("VolumeSlider"),r=O.useRef(null),[l,p]=O.useState(!1),[i,f]=O.useState(!1),b=O.useRef(!1);O.useEffect(()=>{if(!l)return;let M=()=>{p(!1),f(!1),b.current=!1};return window.addEventListener("pointerup",M),()=>window.removeEventListener("pointerup",M)},[l]),O.useLayoutEffect(()=>{typeof t=="function"?t(r.current):t&&(t.current=r.current)});let S=a.volume*100,T={volume:a.volume,muted:a.muted,percentage:S,pressing:l,dragging:i},y=O.useCallback(M=>{let w=typeof M=="number"?M:M[0];if(w!==void 0){if(a.muted){let H=a.videoRef.current;H&&(H.muted=!1)}a.setVolume(w),a.resetIdle(),b.current&&f(!0)}},[a]),x=O.useCallback(M=>{_optionalChain([n, 'optionalCall', _34 => _34(M)]),p(!0),b.current=!0},[n]),v={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":l||void 0,"data-dragging":i||void 0},k={position:"relative","--volume":a.volume,"--volume-percentage":`${S}%`,...o.style},L={"data-muted":a.muted||void 0,"data-volume":a.volume,"data-pressing":l||void 0,"data-dragging":i||void 0,style:k};return s?_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:r,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:y,onPointerDown:x,"aria-label":"Volume",render:M=>s({...M,...L},T)}):_jsxruntime.jsx.call(void 0, _slider.Slider.Root,{ref:r,min:0,max:1,step:.01,value:a.muted?0:a.volume,onValueChange:y,onPointerDown:x,"aria-label":"Volume",...v,...o,style:k,children:_nullishCoalesce(u, () => (_jsxruntime.jsx.call(void 0, _slider.Slider.Control,{children:_jsxruntime.jsxs.call(void 0, _slider.Slider.Track,{children:[_jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{}),_jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{})]})})))})}),Nr=_slider.Slider.Control,jr=O.forwardRef(function(e,t){let{style:s,...u}=e,n={position:"relative",...s};return _jsxruntime.jsx.call(void 0, _slider.Slider.Track,{ref:t,style:n,...u})}),Ur=O.forwardRef(function(e,t){return _jsxruntime.jsx.call(void 0, _slider.Slider.Indicator,{ref:t,...e})}),_r=O.forwardRef(function(e,t){return _jsxruntime.jsx.call(void 0, _slider.Slider.Thumb,{ref:t,...e})});exports.VideoPlayer = Kr; exports.useVideoPlayer = ie;
3
3
  //# sourceMappingURL=index.cjs.map