@linktr.ee/messaging-react 1.30.0 → 1.30.1-rc-1776660256

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.
@@ -1,6 +1,6 @@
1
- import { jsxs as z, jsx as n } from "react/jsx-runtime";
2
- import { FileIcon as H, ImageIcon as Y, SpeakerHighIcon as Z, VideoCameraIcon as J, FileMdIcon as Q, FileTextIcon as ee, FileZipIcon as te, FilePptIcon as ne, FileCsvIcon as ae, FileXlsIcon as ie, FileDocIcon as re, FilePdfIcon as oe, CircleNotchIcon as se, PlayIcon as $, PauseIcon as le } from "@phosphor-icons/react";
3
- import ce, { useState as s, useRef as M, useEffect as x, useCallback as C } from "react";
1
+ import { jsxs as C, jsx as n } from "react/jsx-runtime";
2
+ import { FileIcon as _, ImageIcon as Y, SpeakerHighIcon as Z, VideoCameraIcon as J, FileMdIcon as Q, FileTextIcon as ee, FileZipIcon as te, FilePptIcon as ne, FileCsvIcon as ae, FileXlsIcon as ie, FileDocIcon as re, FilePdfIcon as oe, CircleNotchIcon as se, PlayIcon as H, PauseIcon as le } from "@phosphor-icons/react";
3
+ import ce, { useState as s, useRef as L, useEffect as x, useCallback as D } from "react";
4
4
  const ue = [
5
5
  [/pdf/, "pdf"],
6
6
  [/wordprocessingml|msword|\.doc/, "doc"],
@@ -11,7 +11,7 @@ const ue = [
11
11
  [/plain|rtf/, "text"],
12
12
  [/markdown/, "markdown"]
13
13
  ];
14
- function _(a) {
14
+ function X(a) {
15
15
  return a.startsWith("video/") ? "video" : a.startsWith("audio/") ? "audio" : a.startsWith("image/") ? "image" : "document";
16
16
  }
17
17
  function de(a) {
@@ -24,7 +24,7 @@ const fe = {
24
24
  video: J,
25
25
  audio: Z,
26
26
  image: Y,
27
- document: H
27
+ document: _
28
28
  }, me = {
29
29
  pdf: oe,
30
30
  doc: re,
@@ -34,16 +34,16 @@ const fe = {
34
34
  zip: te,
35
35
  text: ee,
36
36
  markdown: Q,
37
- generic: H
37
+ generic: _
38
38
  };
39
39
  function he(a) {
40
- const i = _(a);
40
+ const i = X(a);
41
41
  return i !== "document" ? fe[i] : me[de(a)];
42
42
  }
43
- function ve(a, i) {
43
+ function pe(a, i) {
44
44
  return ce.createElement(he(a), i);
45
45
  }
46
- const pe = (a, i) => a === "audio" && !i ? "bg-black/5" : "bg-black";
46
+ const ve = (a, i) => a === "audio" && !i ? "bg-black/5" : "bg-black";
47
47
  function we(a) {
48
48
  var i, r;
49
49
  return "touches" in a ? ((i = a.touches[0]) == null ? void 0 : i.clientX) ?? ((r = a.changedTouches[0]) == null ? void 0 : r.clientX) ?? 0 : a.clientX;
@@ -52,21 +52,21 @@ const xe = ({
52
52
  source: a,
53
53
  mimeType: i,
54
54
  poster: r,
55
- autoPlay: X = !1,
55
+ autoPlay: q = !1,
56
56
  playing: u,
57
57
  loop: k = !1,
58
- controls: p = !0,
59
- showProgress: q = !1,
58
+ controls: v = !0,
59
+ showProgress: K = !1,
60
60
  onContainerClick: N,
61
- muted: D = !1
61
+ muted: R = !1
62
62
  }) => {
63
- const R = _(i), [d, o] = s(X), A = M(u);
63
+ const I = X(i), [d, o] = s(q), A = L(u);
64
64
  x(() => {
65
65
  u !== void 0 && u !== A.current && (A.current = u, o(u));
66
66
  }, [u]);
67
- const [w, g] = s(0), [f, S] = s(!1), [j, O] = s(!1), [L, K] = s(null), [B, m] = s(!1), [U, T] = s(!0), [I, b] = s(!1), h = M(null), F = M(null), l = M(null);
67
+ const [w, g] = s(0), [f, S] = s(!1), [j, O] = s(!1), [T, B] = s(null), [U, m] = s(!1), [W, F] = s(!0), [P, b] = s(!1), h = L(null), z = L(null), l = L(null);
68
68
  x(() => {
69
- b(!1), T(!0);
69
+ b(!1), F(!0);
70
70
  }, [a]), x(() => {
71
71
  if (!d) {
72
72
  l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
@@ -85,64 +85,64 @@ const xe = ({
85
85
  o(!1), b(!0);
86
86
  }) : e.pause());
87
87
  }, [d]);
88
- const W = C(() => {
88
+ const $ = D(() => {
89
89
  b(!1), o(!0);
90
- }, []), P = C(
90
+ }, []), E = D(
91
91
  (e) => {
92
- const t = F.current;
92
+ const t = z.current;
93
93
  if (!t) return 0;
94
- const v = t.getBoundingClientRect();
94
+ const p = t.getBoundingClientRect();
95
95
  return Math.max(
96
96
  0,
97
- Math.min(1, (we(e) - v.left) / v.width)
97
+ Math.min(1, (we(e) - p.left) / p.width)
98
98
  );
99
99
  },
100
100
  []
101
- ), c = C((e) => {
101
+ ), c = D((e) => {
102
102
  const t = h.current;
103
103
  t && t.duration && (t.currentTime = e * t.duration);
104
- }, []), E = (e) => {
104
+ }, []), M = (e) => {
105
105
  e.stopPropagation(), S(!0);
106
- const t = P(e);
106
+ const t = E(e);
107
107
  g(t), c(t);
108
108
  };
109
109
  x(() => {
110
110
  if (!f) return;
111
- const e = (v) => g(P(v)), t = (v) => {
112
- S(!1), c(P(v));
111
+ const e = (p) => g(E(p)), t = (p) => {
112
+ S(!1), c(E(p));
113
113
  };
114
114
  return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", e, { passive: !0 }), window.addEventListener("touchend", t), () => {
115
115
  window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", e), window.removeEventListener("touchend", t);
116
116
  };
117
- }, [f, P, c]);
118
- const V = L ? { aspectRatio: String(L) } : void 0, G = L ? "" : " aspect-video", y = Math.round(w * 100);
119
- return /* @__PURE__ */ z(
117
+ }, [f, E, c]);
118
+ const V = T ? { aspectRatio: String(T) } : void 0, G = T ? "" : " aspect-video", y = Math.round(w * 100);
119
+ return /* @__PURE__ */ C(
120
120
  "div",
121
121
  {
122
122
  role: "button",
123
123
  tabIndex: 0,
124
- className: `relative cursor-pointer overflow-hidden ${pe(R, r)}${G}`,
124
+ className: `relative cursor-pointer overflow-hidden ${ve(I, r)}${G}`,
125
125
  style: V,
126
126
  onClick: () => {
127
- if (!I) {
127
+ if (!P) {
128
128
  if (N) {
129
129
  N();
130
130
  return;
131
131
  }
132
- p && o((e) => !e);
132
+ v && o((e) => !e);
133
133
  }
134
134
  },
135
135
  onKeyDown: (e) => {
136
- if (!(e.key !== "Enter" && e.key !== " ") && (e.preventDefault(), !I)) {
136
+ if (!(e.key !== "Enter" && e.key !== " ") && (e.preventDefault(), !P)) {
137
137
  if (N) {
138
138
  N();
139
139
  return;
140
140
  }
141
- p && o((t) => !t);
141
+ v && o((t) => !t);
142
142
  }
143
143
  },
144
144
  children: [
145
- r && /* @__PURE__ */ n(
145
+ r && (I === "audio" || W) && /* @__PURE__ */ n(
146
146
  "img",
147
147
  {
148
148
  src: r,
@@ -150,22 +150,21 @@ const xe = ({
150
150
  className: "absolute inset-0 h-full w-full object-cover"
151
151
  }
152
152
  ),
153
- !r && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ve(i, {
153
+ !r && (I === "audio" || W) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: pe(i, {
154
154
  className: "size-12 text-black/20",
155
155
  weight: "regular"
156
156
  }) }),
157
- U && r && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-20", children: /* @__PURE__ */ n("img", { src: r, alt: "", className: "h-full w-full object-cover" }) }),
158
- /* @__PURE__ */ n("div", { className: "absolute inset-0", children: R === "audio" ? /* @__PURE__ */ n(
157
+ /* @__PURE__ */ n("div", { className: "absolute inset-0", children: I === "audio" ? /* @__PURE__ */ n(
159
158
  "audio",
160
159
  {
161
160
  ref: h,
162
161
  src: a,
163
162
  loop: k,
164
- muted: D,
163
+ muted: R,
165
164
  style: { width: "100%", height: "100%" },
166
165
  onLoadStart: () => m(!0),
167
166
  onCanPlay: () => {
168
- m(!1), T(!1);
167
+ m(!1), F(!1);
169
168
  },
170
169
  onWaiting: () => m(!0),
171
170
  onPlay: () => b(!1),
@@ -179,20 +178,19 @@ const xe = ({
179
178
  {
180
179
  ref: h,
181
180
  src: a,
182
- poster: r,
183
181
  loop: k,
184
- muted: D,
182
+ muted: R,
185
183
  playsInline: !0,
186
184
  style: { width: "100%", height: "100%" },
187
185
  onLoadStart: () => m(!0),
188
186
  onCanPlay: () => {
189
- m(!1), T(!1);
187
+ m(!1), F(!1);
190
188
  },
191
189
  onWaiting: () => m(!0),
192
190
  onPlay: () => b(!1),
193
191
  onLoadedMetadata: () => {
194
192
  const e = h.current;
195
- e instanceof HTMLVideoElement && e.videoWidth && e.videoHeight && K(e.videoWidth / e.videoHeight);
193
+ e instanceof HTMLVideoElement && e.videoWidth && e.videoHeight && B(e.videoWidth / e.videoHeight);
196
194
  },
197
195
  onEnded: () => {
198
196
  k || (o(!1), g(0));
@@ -200,14 +198,14 @@ const xe = ({
200
198
  children: /* @__PURE__ */ n("track", { kind: "captions" })
201
199
  }
202
200
  ) }),
203
- B && !I && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
201
+ U && !P && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
204
202
  se,
205
203
  {
206
204
  className: "size-8 animate-spin text-white/80",
207
205
  weight: "bold"
208
206
  }
209
207
  ) }),
210
- I && !p && /* @__PURE__ */ n(
208
+ P && !v && /* @__PURE__ */ n(
211
209
  "div",
212
210
  {
213
211
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
@@ -215,15 +213,15 @@ const xe = ({
215
213
  tabIndex: 0,
216
214
  "aria-label": "Play preview",
217
215
  onClick: (e) => {
218
- e.stopPropagation(), W();
216
+ e.stopPropagation(), $();
219
217
  },
220
218
  onKeyDown: (e) => {
221
- e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), W());
219
+ e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), $());
222
220
  },
223
- children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n($, { className: "size-9 translate-x-0.5", weight: "fill" }) })
221
+ children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(H, { className: "size-9 translate-x-0.5", weight: "fill" }) })
224
222
  }
225
223
  ),
226
- q && !p && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
224
+ K && !v && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
227
225
  "div",
228
226
  {
229
227
  role: "slider",
@@ -232,10 +230,10 @@ const xe = ({
232
230
  "aria-valuemin": 0,
233
231
  "aria-valuemax": 100,
234
232
  tabIndex: 0,
235
- ref: F,
233
+ ref: z,
236
234
  className: "relative flex h-4 w-full cursor-pointer items-center",
237
- onMouseDown: E,
238
- onTouchStart: E,
235
+ onMouseDown: M,
236
+ onTouchStart: M,
239
237
  onClick: (e) => e.stopPropagation(),
240
238
  onKeyDown: (e) => {
241
239
  e.key === "ArrowRight" && c(Math.min(1, w + 0.05)), e.key === "ArrowLeft" && c(Math.max(0, w - 0.05));
@@ -249,7 +247,7 @@ const xe = ({
249
247
  ) })
250
248
  }
251
249
  ) }),
252
- p && /* @__PURE__ */ z("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
250
+ v && /* @__PURE__ */ C("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
253
251
  /* @__PURE__ */ n(
254
252
  "button",
255
253
  {
@@ -259,10 +257,10 @@ const xe = ({
259
257
  },
260
258
  className: "shrink-0 text-white",
261
259
  "aria-label": d ? "Pause" : "Play",
262
- children: d ? /* @__PURE__ */ n(le, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n($, { className: "size-5 translate-x-px", weight: "fill" })
260
+ children: d ? /* @__PURE__ */ n(le, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(H, { className: "size-5 translate-x-px", weight: "fill" })
263
261
  }
264
262
  ),
265
- /* @__PURE__ */ z(
263
+ /* @__PURE__ */ C(
266
264
  "div",
267
265
  {
268
266
  role: "slider",
@@ -271,10 +269,10 @@ const xe = ({
271
269
  "aria-valuemin": 0,
272
270
  "aria-valuemax": 100,
273
271
  tabIndex: 0,
274
- ref: F,
272
+ ref: z,
275
273
  className: "relative flex h-4 w-full cursor-pointer items-center",
276
- onMouseDown: E,
277
- onTouchStart: E,
274
+ onMouseDown: M,
275
+ onTouchStart: M,
278
276
  onClick: (e) => e.stopPropagation(),
279
277
  onMouseEnter: () => O(!0),
280
278
  onMouseLeave: () => O(!1),
@@ -312,7 +310,7 @@ const xe = ({
312
310
  };
313
311
  export {
314
312
  xe as M,
315
- _ as g,
316
- ve as r
313
+ X as g,
314
+ pe as r
317
315
  };
318
- //# sourceMappingURL=MediaPlayer-Bf-xPB8Z.js.map
316
+ //# sourceMappingURL=MediaPlayer-dT6eJALR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaPlayer-dT6eJALR.js","sources":["../src/components/LockedAttachment/utils/mimeType.ts","../src/components/LockedAttachment/utils/icons.ts","../src/components/LockedAttachment/components/MediaPlayer.tsx"],"sourcesContent":["export type AttachmentSourceType = 'image' | 'audio' | 'video' | 'document'\n\nexport type DocumentIconType =\n | 'pdf'\n | 'doc'\n | 'xls'\n | 'csv'\n | 'ppt'\n | 'zip'\n | 'text'\n | 'markdown'\n | 'generic'\n\nconst DOCUMENT_ICON_PATTERNS: Array<[RegExp, DocumentIconType]> = [\n [/pdf/, 'pdf'],\n [/wordprocessingml|msword|\\.doc/, 'doc'],\n [/spreadsheetml|ms-excel|\\.xls/, 'xls'],\n [/csv/, 'csv'],\n [/presentationml|ms-powerpoint|\\.ppt/, 'ppt'],\n [/zip|x-rar|x-7z|x-tar|x-gzip/, 'zip'],\n [/plain|rtf/, 'text'],\n [/markdown/, 'markdown'],\n]\n\nexport function getSourceType(mimeType: string): AttachmentSourceType {\n if (mimeType.startsWith('video/')) return 'video'\n if (mimeType.startsWith('audio/')) return 'audio'\n if (mimeType.startsWith('image/')) return 'image'\n return 'document'\n}\n\nexport function getDocumentIconType(mimeType: string): DocumentIconType {\n const match = DOCUMENT_ICON_PATTERNS.find(([pattern]) =>\n pattern.test(mimeType)\n )\n return match ? match[1] : 'generic'\n}\n","import {\n FileIcon,\n FileCsvIcon,\n FileDocIcon,\n FileMdIcon,\n FilePdfIcon,\n FilePptIcon,\n FileTextIcon,\n FileXlsIcon,\n FileZipIcon,\n ImageIcon,\n SpeakerHighIcon,\n VideoCameraIcon,\n IconProps,\n} from '@phosphor-icons/react'\nimport React from 'react'\n\nimport { getDocumentIconType, getSourceType } from './mimeType'\nimport type { AttachmentSourceType } from './mimeType'\n\nexport const MEDIA_TYPE_ICON: Record<AttachmentSourceType, React.ElementType> =\n {\n video: VideoCameraIcon,\n audio: SpeakerHighIcon,\n image: ImageIcon,\n document: FileIcon,\n }\n\nconst DOCUMENT_ICON_COMPONENT = {\n pdf: FilePdfIcon,\n doc: FileDocIcon,\n xls: FileXlsIcon,\n csv: FileCsvIcon,\n ppt: FilePptIcon,\n zip: FileZipIcon,\n text: FileTextIcon,\n markdown: FileMdIcon,\n generic: FileIcon,\n} as const\n\nexport function getTypeIcon(mimeType: string): React.ElementType {\n const sourceType = getSourceType(mimeType)\n if (sourceType !== 'document') return MEDIA_TYPE_ICON[sourceType]\n return DOCUMENT_ICON_COMPONENT[getDocumentIconType(mimeType)]\n}\n\n/** Use instead of `<TypeIcon />` where TypeIcon = getTypeIcon(mime) to satisfy react-hooks/static-components. */\nexport function renderTypeIcon(\n mimeType: string,\n props: IconProps\n): React.ReactElement {\n return React.createElement(getTypeIcon(mimeType), props)\n}\n","import { CircleNotchIcon, PauseIcon, PlayIcon } from '@phosphor-icons/react'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\n\nimport { isDevBuild } from '../../../utils/isDevBuild'\nimport { renderTypeIcon } from '../utils/icons'\nimport { getSourceType, type AttachmentSourceType } from '../utils/mimeType'\n\nconst getPlayerBg = (sourceType: AttachmentSourceType, poster?: string) =>\n sourceType === 'audio' && !poster ? 'bg-black/5' : 'bg-black'\n\nfunction getClientXFromEvent(\n e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent\n): number {\n if ('touches' in e) {\n return e.touches[0]?.clientX ?? e.changedTouches[0]?.clientX ?? 0\n }\n return e.clientX\n}\n\nexport interface MediaPlayerProps {\n source: string\n mimeType: string\n poster?: string\n autoPlay?: boolean\n /** Controlled playing state. When provided, syncs to internal play/pause. */\n playing?: boolean\n loop?: boolean\n controls?: boolean\n showProgress?: boolean\n onContainerClick?: () => void\n /** When true, requests muted playback (helps autoplay policies on video). */\n muted?: boolean\n}\n\nconst MediaPlayer: React.FC<MediaPlayerProps> = ({\n source,\n mimeType,\n poster,\n autoPlay = false,\n playing: playingProp,\n loop = false,\n controls = true,\n showProgress = false,\n onContainerClick,\n muted = false,\n}) => {\n const sourceType = getSourceType(mimeType)\n const [playing, setPlaying] = useState(autoPlay)\n\n // Sync controlled playing prop to internal state\n const prevPlayingPropRef = useRef(playingProp)\n useEffect(() => {\n if (\n playingProp !== undefined &&\n playingProp !== prevPlayingPropRef.current\n ) {\n prevPlayingPropRef.current = playingProp\n setPlaying(playingProp)\n }\n }, [playingProp])\n const [played, setPlayed] = useState(0)\n const [seeking, setSeeking] = useState(false)\n const [scrubberHovered, setScrubberHovered] = useState(false)\n const [videoAspect, setVideoAspect] = useState<number | null>(null)\n const [buffering, setBuffering] = useState(false)\n /** True until the first canPlay fires for the current source — hides controls/spinner behind poster. */\n const [initialLoad, setInitialLoad] = useState(true)\n /** Set when autoplay/play() was rejected so user can start via gesture (no controls UI). */\n const [manualPlayRequired, setManualPlayRequired] = useState(false)\n const playerRef = useRef<HTMLMediaElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const rafRef = useRef<number | null>(null)\n\n useEffect(() => {\n setManualPlayRequired(false)\n setInitialLoad(true)\n }, [source])\n\n useEffect(() => {\n if (!playing) {\n if (rafRef.current !== null) {\n cancelAnimationFrame(rafRef.current)\n rafRef.current = null\n }\n return\n }\n const tick = () => {\n const el = playerRef.current\n if (el && el.duration && !seeking) setPlayed(el.currentTime / el.duration)\n rafRef.current = requestAnimationFrame(tick)\n }\n rafRef.current = requestAnimationFrame(tick)\n return () => {\n if (rafRef.current !== null) cancelAnimationFrame(rafRef.current)\n }\n }, [playing, seeking])\n\n // ReactPlayer v3 uses native HTML media elements and does not support a\n // declarative `playing` prop — playback must be driven imperatively.\n useEffect(() => {\n const el = playerRef.current\n if (!el) return\n if (playing) {\n void el.play().catch((err) => {\n setPlaying(false)\n setManualPlayRequired(true)\n if (isDevBuild()) {\n console.debug('[MediaPlayer] play() failed', err)\n }\n })\n } else {\n el.pause()\n }\n }, [playing])\n\n const startPlaybackFromGesture = useCallback(() => {\n setManualPlayRequired(false)\n setPlaying(true)\n }, [])\n\n const getFraction = useCallback(\n (e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent) => {\n const track = trackRef.current\n if (!track) return 0\n const rect = track.getBoundingClientRect()\n return Math.max(\n 0,\n Math.min(1, (getClientXFromEvent(e) - rect.left) / rect.width)\n )\n },\n []\n )\n\n const seekTo = useCallback((fraction: number) => {\n const el = playerRef.current\n if (el && el.duration) el.currentTime = fraction * el.duration\n }, [])\n\n const handleTrackPointerDown = (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n e.stopPropagation()\n setSeeking(true)\n const fraction = getFraction(e)\n setPlayed(fraction)\n seekTo(fraction)\n }\n\n useEffect(() => {\n if (!seeking) return\n const onMove = (e: MouseEvent | TouchEvent) => setPlayed(getFraction(e))\n const onUp = (e: MouseEvent | TouchEvent) => {\n setSeeking(false)\n seekTo(getFraction(e))\n }\n window.addEventListener('mousemove', onMove)\n window.addEventListener('mouseup', onUp)\n window.addEventListener('touchmove', onMove, { passive: true })\n window.addEventListener('touchend', onUp)\n return () => {\n window.removeEventListener('mousemove', onMove)\n window.removeEventListener('mouseup', onUp)\n window.removeEventListener('touchmove', onMove)\n window.removeEventListener('touchend', onUp)\n }\n }, [seeking, getFraction, seekTo])\n\n // Use natural aspect ratio once metadata loads, fall back to 16:9 before then.\n const aspectStyle = videoAspect\n ? { aspectRatio: String(videoAspect) }\n : undefined\n const aspectClass = !videoAspect ? ' aspect-video' : ''\n const scrubberPercent = Math.round(played * 100)\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n className={`relative cursor-pointer overflow-hidden ${getPlayerBg(sourceType, poster)}${aspectClass}`}\n style={aspectStyle}\n onClick={() => {\n if (manualPlayRequired) return\n if (onContainerClick) {\n onContainerClick()\n return\n }\n if (controls) setPlaying((p) => !p)\n }}\n onKeyDown={(e) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n if (manualPlayRequired) return\n if (onContainerClick) {\n onContainerClick()\n return\n }\n if (controls) setPlaying((p) => !p)\n }}\n >\n {/* For audio, poster persists as a visual background. For video, hide once loaded. */}\n {poster && (sourceType === 'audio' || initialLoad) && (\n <img\n src={poster}\n alt=\"\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n )}\n {!poster && (sourceType === 'audio' || initialLoad) && (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n <div className=\"absolute inset-0\">\n {sourceType === 'audio' ? (\n <audio\n ref={playerRef as React.RefObject<HTMLAudioElement>}\n src={source}\n loop={loop}\n muted={muted}\n style={{ width: '100%', height: '100%' }}\n onLoadStart={() => setBuffering(true)}\n onCanPlay={() => { setBuffering(false); setInitialLoad(false) }}\n onWaiting={() => setBuffering(true)}\n onPlay={() => setManualPlayRequired(false)}\n onEnded={() => {\n if (!loop) {\n setPlaying(false)\n setPlayed(0)\n }\n }}\n >\n <track kind=\"captions\" />\n </audio>\n ) : (\n <video\n ref={playerRef as React.RefObject<HTMLVideoElement>}\n src={source}\n loop={loop}\n muted={muted}\n playsInline\n style={{ width: '100%', height: '100%' }}\n onLoadStart={() => setBuffering(true)}\n onCanPlay={() => { setBuffering(false); setInitialLoad(false) }}\n onWaiting={() => setBuffering(true)}\n onPlay={() => setManualPlayRequired(false)}\n onLoadedMetadata={() => {\n const el = playerRef.current\n if (el instanceof HTMLVideoElement && el.videoWidth && el.videoHeight) {\n setVideoAspect(el.videoWidth / el.videoHeight)\n }\n }}\n onEnded={() => {\n if (!loop) {\n setPlaying(false)\n setPlayed(0)\n }\n }}\n >\n <track kind=\"captions\" />\n </video>\n )}\n </div>\n\n {buffering && !manualPlayRequired && (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n <CircleNotchIcon\n className=\"size-8 animate-spin text-white/80\"\n weight=\"bold\"\n />\n </div>\n )}\n\n {manualPlayRequired && !controls && (\n <div\n className=\"absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35\"\n role=\"button\"\n tabIndex={0}\n aria-label=\"Play preview\"\n onClick={(e) => {\n e.stopPropagation()\n startPlaybackFromGesture()\n }}\n onKeyDown={(e) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n e.stopPropagation()\n startPlaybackFromGesture()\n }}\n >\n <span className=\"flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm\">\n <PlayIcon className=\"size-9 translate-x-0.5\" weight=\"fill\" />\n </span>\n </div>\n )}\n\n {showProgress && !controls && (\n <div className=\"absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent\">\n <div\n role=\"slider\"\n aria-label=\"Playback position\"\n aria-valuenow={scrubberPercent}\n aria-valuemin={0}\n aria-valuemax={100}\n tabIndex={0}\n ref={trackRef}\n className=\"relative flex h-4 w-full cursor-pointer items-center\"\n onMouseDown={handleTrackPointerDown}\n onTouchStart={handleTrackPointerDown}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight') seekTo(Math.min(1, played + 0.05))\n if (e.key === 'ArrowLeft') seekTo(Math.max(0, played - 0.05))\n }}\n >\n <div className=\"w-full overflow-hidden rounded-full bg-white/30 h-1\">\n <div\n className=\"h-full rounded-full bg-white\"\n style={{ width: `${scrubberPercent}%` }}\n />\n </div>\n </div>\n </div>\n )}\n\n {controls && (\n <div className=\"absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200\">\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n setPlaying((p) => !p)\n }}\n className=\"shrink-0 text-white\"\n aria-label={playing ? 'Pause' : 'Play'}\n >\n {playing ? (\n <PauseIcon className=\"size-5\" weight=\"fill\" />\n ) : (\n <PlayIcon className=\"size-5 translate-x-px\" weight=\"fill\" />\n )}\n </button>\n\n <div\n role=\"slider\"\n aria-label=\"Playback position\"\n aria-valuenow={scrubberPercent}\n aria-valuemin={0}\n aria-valuemax={100}\n tabIndex={0}\n ref={trackRef}\n className=\"relative flex h-4 w-full cursor-pointer items-center\"\n onMouseDown={handleTrackPointerDown}\n onTouchStart={handleTrackPointerDown}\n onClick={(e) => e.stopPropagation()}\n onMouseEnter={() => setScrubberHovered(true)}\n onMouseLeave={() => setScrubberHovered(false)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight') seekTo(Math.min(1, played + 0.05))\n if (e.key === 'ArrowLeft') seekTo(Math.max(0, played - 0.05))\n }}\n >\n <div\n className={`w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${scrubberHovered || seeking ? 'h-1.5' : 'h-1'}`}\n >\n <div\n className=\"h-full rounded-full bg-white\"\n style={{ width: `${scrubberPercent}%` }}\n />\n </div>\n <div\n className={`absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${scrubberHovered || seeking ? 'scale-100 opacity-100' : 'scale-0 opacity-0'}`}\n style={{ left: `${scrubberPercent}%` }}\n />\n </div>\n </div>\n )}\n </div>\n )\n}\n\nexport default MediaPlayer\n"],"names":["DOCUMENT_ICON_PATTERNS","getSourceType","mimeType","getDocumentIconType","match","pattern","MEDIA_TYPE_ICON","VideoCameraIcon","SpeakerHighIcon","ImageIcon","FileIcon","DOCUMENT_ICON_COMPONENT","FilePdfIcon","FileDocIcon","FileXlsIcon","FileCsvIcon","FilePptIcon","FileZipIcon","FileTextIcon","FileMdIcon","getTypeIcon","sourceType","renderTypeIcon","props","React","getPlayerBg","poster","getClientXFromEvent","e","_a","_b","MediaPlayer","source","autoPlay","playingProp","loop","controls","showProgress","onContainerClick","muted","playing","setPlaying","useState","prevPlayingPropRef","useRef","useEffect","played","setPlayed","seeking","setSeeking","scrubberHovered","setScrubberHovered","videoAspect","setVideoAspect","buffering","setBuffering","initialLoad","setInitialLoad","manualPlayRequired","setManualPlayRequired","playerRef","trackRef","rafRef","tick","el","err","startPlaybackFromGesture","useCallback","getFraction","track","rect","seekTo","fraction","handleTrackPointerDown","onMove","onUp","aspectStyle","aspectClass","scrubberPercent","jsxs","p","jsx","CircleNotchIcon","PlayIcon","PauseIcon"],"mappings":";;;AAaA,MAAMA,KAA4D;AAAA,EAChE,CAAC,OAAO,KAAK;AAAA,EACb,CAAC,iCAAiC,KAAK;AAAA,EACvC,CAAC,gCAAgC,KAAK;AAAA,EACtC,CAAC,OAAO,KAAK;AAAA,EACb,CAAC,sCAAsC,KAAK;AAAA,EAC5C,CAAC,+BAA+B,KAAK;AAAA,EACrC,CAAC,aAAa,MAAM;AAAA,EACpB,CAAC,YAAY,UAAU;AACzB;AAEO,SAASC,EAAcC,GAAwC;AACpE,SAAIA,EAAS,WAAW,QAAQ,I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