@ethora/chat-component 26.10.7 → 26.10.9

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 (78) hide show
  1. package/README.md +88 -3
  2. package/dist/ChatProfileModal-BspGrTF_.js +2298 -0
  3. package/dist/{FilePreviewModal-DlOjnYzv.js → FilePreviewModal-DEb--AKO.js} +130 -130
  4. package/dist/{ManageDataModal-BZLGJZze.js → ManageDataModal-B3AvV0ZK.js} +14 -14
  5. package/dist/{MarkdownBody-CtArwCDa.js → MarkdownBody-M-Tzn12K.js} +1 -1
  6. package/dist/{MessageSearchModal-CcUnfZlU.js → MessageSearchModal-aeBm31-J.js} +32 -32
  7. package/dist/{PublicChatsModal-BWn0NXVo.js → PublicChatsModal-CSxFQNuC.js} +19 -19
  8. package/dist/{SideDrawer-CqZl9sxK.js → SideDrawer-DQc3Dz7-.js} +28 -28
  9. package/dist/{UserProfileModal-D0JZ3-uy.js → UserProfileModal-BwXpXfkw.js} +124 -120
  10. package/dist/{UserSettingsModal-OvykYDsT.js → UserSettingsModal-BxWFLCst.js} +2 -2
  11. package/dist/{VideoCallOverlay-DrvO2v_g.js → VideoCallOverlay-BO_2G3ys.js} +5908 -4168
  12. package/dist/{VisibilityModal-pOF9-UXR.js → VisibilityModal-WY5EkrT1.js} +7 -7
  13. package/dist/assets/icons.d.ts +4 -0
  14. package/dist/calls/callDisplay.d.ts +22 -0
  15. package/dist/calls/callMode.d.ts +105 -0
  16. package/dist/calls/openScheduledCall.d.ts +20 -0
  17. package/dist/calls/p2p/P2PCallController.d.ts +160 -0
  18. package/dist/calls/p2p/icePolicy.d.ts +36 -0
  19. package/dist/calls/p2p/negotiator.d.ts +56 -0
  20. package/dist/calls/p2p/p2pRuntime.d.ts +35 -0
  21. package/dist/calls/p2p/signalInbox.d.ts +34 -0
  22. package/dist/calls/p2p/signalStanza.d.ts +51 -0
  23. package/dist/calls/placeCall.d.ts +20 -0
  24. package/dist/calls/scheduledCall.d.ts +101 -0
  25. package/dist/calls/scheduledCallActions.d.ts +12 -0
  26. package/dist/calls/scheduledCallFormat.d.ts +13 -0
  27. package/dist/calls/scheduledCallsConfig.d.ts +27 -0
  28. package/dist/calls/senderTrust.d.ts +7 -0
  29. package/dist/calls/startCall.d.ts +16 -0
  30. package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
  31. package/dist/components/MainComponents/LoginWrapper.d.ts +1 -0
  32. package/dist/components/MainComponents/ProfileImagePlaceholder.d.ts +1 -0
  33. package/dist/components/MainComponents/ReduxWrapper.d.ts +6 -0
  34. package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
  35. package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +27 -0
  36. package/dist/components/Modals/styledModalComponents.d.ts +21 -0
  37. package/dist/components/ScheduledCalls/ScheduleCallModal.d.ts +3 -0
  38. package/dist/components/ScheduledCalls/ScheduledCallCancelConfirm.d.ts +8 -0
  39. package/dist/components/ScheduledCalls/ScheduledCallCard.d.ts +7 -0
  40. package/dist/components/ScheduledCalls/ScheduledCallLayer.d.ts +15 -0
  41. package/dist/components/ScheduledCalls/ScheduledCallPreJoin.d.ts +3 -0
  42. package/dist/components/VideoCalls/P2PCallRunner.d.ts +1 -0
  43. package/dist/components/VideoCalls/P2PCallSession.d.ts +14 -0
  44. package/dist/components/VideoCalls/VideoCallSession.d.ts +37 -0
  45. package/dist/{handleCopyClick-BUbVvd2G.js → handleCopyClick-B5hswNPZ.js} +1 -1
  46. package/dist/helpers/callPush.d.ts +2 -0
  47. package/dist/helpers/canLeaveRoom.d.ts +3 -0
  48. package/dist/helpers/chatComponentConfigEvents.d.ts +16 -0
  49. package/dist/helpers/liveConfig.d.ts +46 -0
  50. package/dist/helpers/reportRoom.d.ts +18 -0
  51. package/dist/helpers/scheduledCallMessage.d.ts +23 -0
  52. package/dist/helpers/storeConsole.d.ts +1 -0
  53. package/dist/hooks/useNow.d.ts +6 -0
  54. package/dist/hooks/useRemoteAppearance.d.ts +21 -0
  55. package/dist/hooks/useTypography.d.ts +4 -0
  56. package/dist/{main-CpHMnydn.js → main-BNjPaiYs.js} +15479 -12971
  57. package/dist/main.d.ts +6 -2
  58. package/dist/main.js +25 -21
  59. package/dist/networking/api-requests/callState.api.d.ts +24 -0
  60. package/dist/networking/api-requests/push.api.d.ts +4 -5
  61. package/dist/networking/api-requests/remoteAppearance.api.d.ts +20 -0
  62. package/dist/networking/api-requests/rooms.api.d.ts +2 -1
  63. package/dist/networking/api-requests/scheduledCalls.api.d.ts +19 -0
  64. package/dist/networking/ethoraEvents.d.ts +14 -1
  65. package/dist/networking/xmpp/getRoomAccess.xmpp.d.ts +7 -0
  66. package/dist/networking/xmpp/notifyXmppEvent.d.ts +6 -0
  67. package/dist/networking/xmppClient.d.ts +2 -0
  68. package/dist/roomStore/callSlice.d.ts +23 -1
  69. package/dist/roomStore/chatSettingsSlice.d.ts +9 -1
  70. package/dist/roomStore/index.d.ts +4 -0
  71. package/dist/roomStore/scheduledCallSlice.d.ts +47 -0
  72. package/dist/types/models/config.model.d.ts +71 -1
  73. package/dist/types/models/message.model.d.ts +2 -0
  74. package/dist/types/models/room.model.d.ts +2 -0
  75. package/dist/types/models/scheduledCall.model.d.ts +116 -0
  76. package/dist/types/models/xmpp.model.d.ts +2 -0
  77. package/package.json +1 -1
  78. package/dist/ChatProfileModal-BDZvd0rm.js +0 -2168
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { bh as et, bi as tt, U as f, bj as yt, M as Pe, f as Et, bk as kt, bl as nt, bm as rt, bn as ot, bo as Le, bp as Te, bq as Ce, aY as $e, Z as Ae, br as Ue, bs as Pt, X as ke, bt as St, bu as it, a as Rt, bd as Lt, u as le, aq as _e, bv as Tt, bw as Ct, bx as Se, by as Mt, aL as ue, bz as Be, bA as It, bB as $t, bC as At, bD as Dt, bE as Ot, aX as Ne, S as zt, bF as Ut } from "./main-CpHMnydn.js";
2
+ import { bt as et, bu as tt, a4 as f, bv as yt, Z as Pe, b as Et, bw as kt, bx as nt, by as rt, bz as ot, bA as Le, bB as Te, bC as Ce, b8 as $e, a8 as Ae, bD as Ue, bE as Pt, a6 as ke, bF as Rt, bG as it, a as St, bp as Lt, u as le, aC as _e, bH as Tt, bI as Ct, bJ as Re, bK as Mt, aW as ue, bL as Be, bM as It, bN as $t, bO as At, bP as Ot, bQ as Dt, b7 as Ne, a2 as zt, bR as Ut } from "./main-BNjPaiYs.js";
3
3
  import Me, { useState as F, useRef as U, useEffect as M, useMemo as te, useCallback as B, useLayoutEffect as _t } from "react";
4
4
  const at = (t, o, i) => {
5
5
  const g = document.createElement("a");
@@ -12,7 +12,7 @@ const at = (t, o, i) => {
12
12
  URL.revokeObjectURL(i);
13
13
  }
14
14
  }, Nt = (t, o) => at(t, o, !0);
15
- async function Xt(t, o, i = {}) {
15
+ async function Wt(t, o, i = {}) {
16
16
  const g = i.fetchImpl ?? fetch, E = i.saveBlob ?? Bt, l = i.saveUrl ?? Nt;
17
17
  let w;
18
18
  try {
@@ -22,13 +22,13 @@ async function Xt(t, o, i = {}) {
22
22
  }
23
23
  return w.ok ? (E(new Blob([await w.arrayBuffer()]), o), "blob") : (et(t) && (w.status === 401 || w.status === 403) && tt(), "http-error");
24
24
  }
25
- function Xe(t, o) {
25
+ function We(t, o) {
26
26
  let i;
27
27
  return (...g) => {
28
28
  window.clearTimeout(i), i = window.setTimeout(() => t(...g), o);
29
29
  };
30
30
  }
31
- function Wt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
31
+ function Xt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
32
32
  const E = i || (typeof window > "u" ? class {
33
33
  } : window.ResizeObserver);
34
34
  if (!E) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
@@ -36,15 +36,15 @@ function Wt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce:
36
36
  M(() => (v.current = !0, () => {
37
37
  v.current = !1;
38
38
  }));
39
- const [N, S, x] = te(() => {
39
+ const [N, R, x] = te(() => {
40
40
  const k = () => {
41
41
  if (!c.current.element) return;
42
- const { left: X, top: V, width: I, height: D, bottom: j, right: R, x: P, y: C } = c.current.element.getBoundingClientRect(), $ = { left: X, top: V, width: I, height: D, bottom: j, right: R, x: P, y: C };
42
+ const { left: W, top: V, width: I, height: O, bottom: j, right: S, x: P, y: C } = c.current.element.getBoundingClientRect(), $ = { left: W, top: V, width: I, height: O, bottom: j, right: S, x: P, y: C };
43
43
  c.current.element instanceof HTMLElement && g && ($.height = c.current.element.offsetHeight, $.width = c.current.element.offsetWidth), Object.freeze($), v.current && !jt(c.current.lastBounds, $) && w(c.current.lastBounds = $);
44
44
  };
45
- return [k, m ? Xe(k, m) : k, T ? Xe(k, T) : k];
45
+ return [k, m ? We(k, m) : k, T ? We(k, T) : k];
46
46
  }, [w, g, T, m]);
47
- function O() {
47
+ function D() {
48
48
  c.current.scrollContainers && (c.current.scrollContainers.forEach((k) => k.removeEventListener("scroll", x, !0)), c.current.scrollContainers = null), c.current.resizeObserver && (c.current.resizeObserver.disconnect(), c.current.resizeObserver = null), c.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", c.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", c.current.orientationHandler));
49
49
  }
50
50
  function A() {
@@ -53,11 +53,11 @@ function Wt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce:
53
53
  }, "orientation" in screen && "addEventListener" in screen.orientation ? screen.orientation.addEventListener("change", c.current.orientationHandler) : "onorientationchange" in window && window.addEventListener("orientationchange", c.current.orientationHandler));
54
54
  }
55
55
  const H = (k) => {
56
- !k || k === c.current.element || (O(), c.current.element = k, c.current.scrollContainers = st(k), A());
56
+ !k || k === c.current.element || (D(), c.current.element = k, c.current.scrollContainers = st(k), A());
57
57
  };
58
- return Yt(x, !!o), Ft(S), M(() => {
59
- O(), A();
60
- }, [o, x, S]), M(() => O, []), [H, l, N];
58
+ return Yt(x, !!o), Ft(R), M(() => {
59
+ D(), A();
60
+ }, [o, x, R]), M(() => D, []), [H, l, N];
61
61
  }
62
62
  function Ft(t) {
63
63
  M(() => {
@@ -83,7 +83,7 @@ function st(t) {
83
83
  const { overflow: i, overflowX: g, overflowY: E } = window.getComputedStyle(t);
84
84
  return [i, g, E].some((l) => l === "auto" || l === "scroll") && o.push(t), [...o, ...st(t.parentElement)];
85
85
  }
86
- const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt = (t, o) => Ht.every((i) => t[i] === o[i]), We = 0.5, Fe = 3, xe = 1.25, Vt = 2e-3, Ye = 12, He = 16, je = 16, Gt = 72, Ve = 320, Zt = 150, Ge = 4, Kt = 7, qt = "800px 0px", Jt = 2, Qt = 0.9, Ze = { width: 612, height: 792 }, en = f.div`
86
+ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt = (t, o) => Ht.every((i) => t[i] === o[i]), Xe = 0.5, Fe = 3, xe = 1.25, Vt = 2e-3, Ye = 12, He = 16, je = 16, Gt = 72, Ve = 320, Zt = 150, Ge = 4, Kt = 7, qt = "800px 0px", Jt = 2, Qt = 0.9, Ze = { width: 612, height: 792 }, en = f.div`
87
87
  display: flex;
88
88
  flex-direction: column;
89
89
  align-items: center;
@@ -158,7 +158,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
158
158
  min-width: 44px;
159
159
  text-align: center;
160
160
  font-size: 12px;
161
- `, Re = f.button`
161
+ `, Se = f.button`
162
162
  display: inline-flex;
163
163
  align-items: center;
164
164
  justify-content: center;
@@ -225,29 +225,29 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
225
225
  }) {
226
226
  const T = U(null), m = U(null), [v, N] = F(!1);
227
227
  return M(() => {
228
- const S = T.current;
229
- if (!S) return;
228
+ const R = T.current;
229
+ if (!R) return;
230
230
  if (!c || g <= 0) {
231
- m.current?.cancel(), m.current = null, S.width = 0, S.height = 0, N(!1);
231
+ m.current?.cancel(), m.current = null, R.width = 0, R.height = 0, N(!1);
232
232
  return;
233
233
  }
234
234
  let x = !1;
235
235
  return (async () => {
236
236
  try {
237
- const O = await o.getPage(i);
237
+ const D = await o.getPage(i);
238
238
  if (x) {
239
- O.cleanup();
239
+ D.cleanup();
240
240
  return;
241
241
  }
242
- const A = O.getViewport({ scale: 1 }), H = Math.min(window.devicePixelRatio || 1, Jt), k = O.getViewport({
242
+ const A = D.getViewport({ scale: 1 }), H = Math.min(window.devicePixelRatio || 1, Jt), k = D.getViewport({
243
243
  scale: A.width ? g / A.width * H : H
244
- }), X = S.getContext("2d");
245
- if (!X) return;
246
- S.width = Math.max(1, Math.floor(k.width)), S.height = Math.max(1, Math.floor(k.height)), m.current?.cancel();
247
- const V = O.render({ canvasContext: X, viewport: k });
248
- m.current = V, await V.promise, x || N(!0), O.cleanup();
249
- } catch (O) {
250
- x || console.warn("[Ethora] PDF page render failed:", O);
244
+ }), W = R.getContext("2d");
245
+ if (!W) return;
246
+ R.width = Math.max(1, Math.floor(k.width)), R.height = Math.max(1, Math.floor(k.height)), m.current?.cancel();
247
+ const V = D.render({ canvasContext: W, viewport: k });
248
+ m.current = V, await V.promise, x || N(!0), D.cleanup();
249
+ } catch (D) {
250
+ x || console.warn("[Ethora] PDF page render failed:", D);
251
251
  }
252
252
  })(), () => {
253
253
  x = !0, m.current?.cancel(), m.current = null;
@@ -262,15 +262,15 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
262
262
  }
263
263
  );
264
264
  }), pn = ({ pdfUrl: t }) => {
265
- const o = Pe(), { config: i } = Et(), [g, E] = Wt(), l = U(null), w = B(
265
+ const o = Pe(), { config: i } = Et(), [g, E] = Xt(), l = U(null), w = B(
266
266
  (d) => {
267
267
  l.current = d, g(d);
268
268
  },
269
269
  [g]
270
- ), [c, T] = F("loading"), [m, v] = F(null), [N, S] = F([]), [x, O] = F(1), A = U(1), [H, k] = F(0), [X, V] = F(1), I = U(1), [D, j] = F(() => /* @__PURE__ */ new Set()), R = U(null), P = U(null), C = U(null), $ = H > 0 ? H : Ve, Y = m?.numPages ?? 0;
270
+ ), [c, T] = F("loading"), [m, v] = F(null), [N, R] = F([]), [x, D] = F(1), A = U(1), [H, k] = F(0), [W, V] = F(1), I = U(1), [O, j] = F(() => /* @__PURE__ */ new Set()), S = U(null), P = U(null), C = U(null), $ = H > 0 ? H : Ve, Y = m?.numPages ?? 0;
271
271
  M(() => {
272
272
  let d = !1, n = null, e;
273
- return T("loading"), v(null), S([]), j(/* @__PURE__ */ new Set()), I.current = 1, V(1), (async () => {
273
+ return T("loading"), v(null), R([]), j(/* @__PURE__ */ new Set()), I.current = 1, V(1), (async () => {
274
274
  const a = await kt(i?.pdfPreview?.workerSrc, i?.pdfPreview?.libUrl);
275
275
  if (!d) {
276
276
  if (!a || !t) {
@@ -289,7 +289,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
289
289
  T("error");
290
290
  return;
291
291
  }
292
- S(Array.from({ length: s.numPages }, () => Ze)), v(s), T("ready");
292
+ R(Array.from({ length: s.numPages }, () => Ze)), v(s), T("ready");
293
293
  } catch (s) {
294
294
  d || (console.warn("[Ethora] PDF open failed:", s), T("error"));
295
295
  }
@@ -307,10 +307,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
307
307
  const n = m.numPages, e = await m.getPage(1), a = e.getViewport({ scale: 1 });
308
308
  if (e.cleanup(), d || !a.width) return;
309
309
  const s = { width: a.width, height: a.height };
310
- S(Array.from({ length: n }, () => s));
310
+ R(Array.from({ length: n }, () => s));
311
311
  for (let u = 2; u <= n; u += Ge) {
312
312
  const y = Math.min(n, u + Ge - 1), z = await Promise.all(
313
- Array.from({ length: y - u + 1 }, async (W, J) => {
313
+ Array.from({ length: y - u + 1 }, async (X, J) => {
314
314
  const Q = u + J, se = await m.getPage(Q), pe = se.getViewport({ scale: 1 });
315
315
  return se.cleanup(), {
316
316
  pageNumber: Q,
@@ -319,9 +319,9 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
319
319
  })
320
320
  );
321
321
  if (d) return;
322
- S((W) => {
323
- if (W.length !== n) return W;
324
- const J = W.slice();
322
+ R((X) => {
323
+ if (X.length !== n) return X;
324
+ const J = X.slice();
325
325
  return z.forEach(({ pageNumber: Q, size: se }) => {
326
326
  J[Q - 1] = se;
327
327
  }), J;
@@ -338,8 +338,8 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
338
338
  const d = N.length > 0 ? N : [Ze], n = Math.max(1, $ - He * 2) * x, e = Math.max($, n + He * 2), a = [], s = [];
339
339
  let u = je;
340
340
  d.forEach((z) => {
341
- const W = n * z.height / (z.width || 1);
342
- a.push(u), s.push(W), u += W + Ye;
341
+ const X = n * z.height / (z.width || 1);
342
+ a.push(u), s.push(X), u += X + Ye;
343
343
  });
344
344
  const y = u - Ye;
345
345
  return {
@@ -354,8 +354,8 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
354
354
  P.current = L, _t(() => {
355
355
  const d = l.current;
356
356
  if (!d) return;
357
- const n = R.current;
358
- n && (R.current = null, d.scrollLeft = n.fx * d.scrollWidth - n.cx, d.scrollTop = n.fy * d.scrollHeight - n.cy);
357
+ const n = S.current;
358
+ n && (S.current = null, d.scrollLeft = n.fx * d.scrollWidth - n.cx, d.scrollTop = n.fy * d.scrollHeight - n.cy);
359
359
  const e = Ke(
360
360
  d.scrollTop,
361
361
  d.clientHeight,
@@ -368,11 +368,11 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
368
368
  const e = l.current;
369
369
  if (!e || !e.scrollHeight || !e.scrollWidth) return;
370
370
  if (e.scrollTop <= 0 && e.scrollLeft <= 0) {
371
- R.current = null;
371
+ S.current = null;
372
372
  return;
373
373
  }
374
374
  const a = d ?? e.clientWidth / 2, s = n ?? e.clientHeight / 2;
375
- R.current = {
375
+ S.current = {
376
376
  fx: (e.scrollLeft + a) / e.scrollWidth,
377
377
  fy: (e.scrollTop + s) / e.scrollHeight,
378
378
  cx: a,
@@ -380,8 +380,8 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
380
380
  };
381
381
  }, []), _ = B(
382
382
  (d, n, e) => {
383
- const a = un(d, We, Fe);
384
- a !== A.current && (K(n, e), A.current = a, O(a));
383
+ const a = un(d, Xe, Fe);
384
+ a !== A.current && (K(n, e), A.current = a, D(a));
385
385
  },
386
386
  [K]
387
387
  ), ee = Math.max(Ve, Math.floor(E.width || 0));
@@ -401,10 +401,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
401
401
  !m || ne || j(
402
402
  qe(
403
403
  Array.from({ length: m.numPages }, (d, n) => n + 1),
404
- X
404
+ W
405
405
  )
406
406
  );
407
- }, [m, X, ne]), M(() => {
407
+ }, [m, W, ne]), M(() => {
408
408
  const d = l.current;
409
409
  if (!m || !d || typeof IntersectionObserver > "u")
410
410
  return;
@@ -523,7 +523,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
523
523
  height: L.heights[n],
524
524
  top: L.tops[n],
525
525
  left: L.left,
526
- active: D.has(e)
526
+ active: O.has(e)
527
527
  },
528
528
  e
529
529
  );
@@ -544,17 +544,17 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
544
544
  ),
545
545
  c === "ready" && /* @__PURE__ */ b(an, { children: [
546
546
  /* @__PURE__ */ b(sn, { children: [
547
- X,
547
+ W,
548
548
  " / ",
549
549
  Y
550
550
  ] }),
551
551
  /* @__PURE__ */ b(ln, { children: [
552
552
  /* @__PURE__ */ r(
553
- Re,
553
+ Se,
554
554
  {
555
555
  type: "button",
556
556
  onClick: () => _(A.current / xe),
557
- disabled: x <= We,
557
+ disabled: x <= Xe,
558
558
  "aria-label": o("modal.filePreview.zoomOut"),
559
559
  children: /* @__PURE__ */ r(nt, { color: "currentColor" })
560
560
  }
@@ -564,7 +564,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
564
564
  "%"
565
565
  ] }),
566
566
  /* @__PURE__ */ r(
567
- Re,
567
+ Se,
568
568
  {
569
569
  type: "button",
570
570
  onClick: () => _(A.current * xe),
@@ -574,7 +574,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
574
574
  }
575
575
  ),
576
576
  /* @__PURE__ */ r(
577
- Re,
577
+ Se,
578
578
  {
579
579
  type: "button",
580
580
  onClick: () => _(1),
@@ -671,27 +671,27 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
671
671
  onError: w,
672
672
  onScaleChange: c
673
673
  }, T) => {
674
- const m = U(null), v = U(null), [N, S] = F(!1), [x, O] = F(G), [A, H] = F({ x: 0, y: 0 }), [k, X] = F(!1), [V, I] = F(!1), D = U({ scale: G, offset: { x: 0, y: 0 } });
675
- D.current = { scale: x, offset: A };
676
- const j = U(null), R = U(null), P = U(
674
+ const m = U(null), v = U(null), [N, R] = F(!1), [x, D] = F(G), [A, H] = F({ x: 0, y: 0 }), [k, W] = F(!1), [V, I] = F(!1), O = U({ scale: G, offset: { x: 0, y: 0 } });
675
+ O.current = { scale: x, offset: A };
676
+ const j = U(null), S = U(null), P = U(
677
677
  null
678
678
  ), C = B((n) => {
679
679
  const e = m.current, a = v.current;
680
680
  if (!e) return { x: 0, y: 0 };
681
681
  const s = e.clientWidth, u = e.clientHeight, y = a?.naturalWidth || 0, z = a?.naturalHeight || 0;
682
- let W = s, J = u;
682
+ let X = s, J = u;
683
683
  if (y > 0 && z > 0 && s > 0 && u > 0) {
684
684
  const Q = Math.min(s / y, u / z);
685
- W = y * Q, J = z * Q;
685
+ X = y * Q, J = z * Q;
686
686
  }
687
687
  return {
688
- x: Math.max(0, (W * n - s) / 2),
688
+ x: Math.max(0, (X * n - s) / 2),
689
689
  y: Math.max(0, (J * n - u) / 2)
690
690
  };
691
691
  }, []), $ = B(
692
692
  (n, e, a) => {
693
693
  const s = ve(n, G, Ie), u = C(s);
694
- X(a), O(s), H({
694
+ W(a), D(s), H({
695
695
  x: ve(e.x, -u.x, u.x),
696
696
  y: ve(e.y, -u.y, u.y)
697
697
  });
@@ -699,7 +699,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
699
699
  [C]
700
700
  ), Y = B(
701
701
  (n, e, a, s) => {
702
- const u = D.current, y = ve(n, G, Ie), z = y / u.scale;
702
+ const u = O.current, y = ve(n, G, Ie), z = y / u.scale;
703
703
  $(
704
704
  y,
705
705
  {
@@ -714,7 +714,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
714
714
  $(G, { x: 0, y: 0 }, !0);
715
715
  }, [$]), K = B(
716
716
  (n) => {
717
- Y(D.current.scale * n, 0, 0, !0);
717
+ Y(O.current.scale * n, 0, 0, !0);
718
718
  },
719
719
  [Y]
720
720
  );
@@ -727,10 +727,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
727
727
  }),
728
728
  [K, L]
729
729
  ), M(() => {
730
- X(!1), O(G), H({ x: 0, y: 0 });
730
+ W(!1), D(G), H({ x: 0, y: 0 });
731
731
  }, [t]), M(() => {
732
732
  const n = v.current;
733
- S(!!(n?.complete && n.naturalWidth > 0));
733
+ R(!!(n?.complete && n.naturalWidth > 0));
734
734
  }, [t]), M(() => {
735
735
  c?.(x);
736
736
  }, [x, c]), M(() => {
@@ -739,7 +739,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
739
739
  const e = (a) => {
740
740
  a.preventDefault();
741
741
  const s = n.getBoundingClientRect(), u = a.clientX - s.left - s.width / 2, y = a.clientY - s.top - s.height / 2, z = Math.exp(-a.deltaY * wn);
742
- Y(D.current.scale * z, u, y, !1);
742
+ Y(O.current.scale * z, u, y, !1);
743
743
  };
744
744
  return n.addEventListener("wheel", e, { passive: !1 }), () => n.removeEventListener("wheel", e);
745
745
  }, [Y]);
@@ -747,7 +747,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
747
747
  (n, e) => {
748
748
  const a = m.current;
749
749
  if (!a) return;
750
- if (D.current.scale > G) {
750
+ if (O.current.scale > G) {
751
751
  L();
752
752
  return;
753
753
  }
@@ -761,14 +761,14 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
761
761
  },
762
762
  [L, Y]
763
763
  ), ee = B((n) => {
764
- n.button === 0 && (D.current.scale <= G || (n.preventDefault(), j.current = { x: n.clientX, y: n.clientY }, I(!0)));
764
+ n.button === 0 && (O.current.scale <= G || (n.preventDefault(), j.current = { x: n.clientX, y: n.clientY }, I(!0)));
765
765
  }, []);
766
766
  M(() => {
767
767
  if (!V || typeof window > "u") return;
768
768
  const n = (a) => {
769
769
  const s = j.current;
770
770
  if (!s) return;
771
- const u = D.current;
771
+ const u = O.current;
772
772
  $(
773
773
  u.scale,
774
774
  {
@@ -787,7 +787,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
787
787
  const ne = B((n) => {
788
788
  if (n.touches.length === 2) {
789
789
  const [a, s] = [n.touches[0], n.touches[1]];
790
- R.current = {
790
+ S.current = {
791
791
  startX: 0,
792
792
  startY: 0,
793
793
  lastX: 0,
@@ -796,26 +796,26 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
796
796
  a.clientX - s.clientX,
797
797
  a.clientY - s.clientY
798
798
  ),
799
- pinchScale: D.current.scale,
799
+ pinchScale: O.current.scale,
800
800
  panning: !1,
801
801
  moved: !1
802
802
  };
803
803
  return;
804
804
  }
805
805
  const e = n.touches[0];
806
- e && (R.current = {
806
+ e && (S.current = {
807
807
  startX: e.clientX,
808
808
  startY: e.clientY,
809
809
  lastX: e.clientX,
810
810
  lastY: e.clientY,
811
811
  pinchDistance: 0,
812
- pinchScale: D.current.scale,
813
- panning: D.current.scale > G,
812
+ pinchScale: O.current.scale,
813
+ panning: O.current.scale > G,
814
814
  moved: !1
815
815
  });
816
816
  }, []), de = B(
817
817
  (n) => {
818
- const e = R.current;
818
+ const e = S.current;
819
819
  if (!e) return;
820
820
  if (n.touches.length === 2 && e.pinchDistance > 0) {
821
821
  const [s, u] = [n.touches[0], n.touches[1]], y = Math.hypot(
@@ -823,7 +823,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
823
823
  s.clientY - u.clientY
824
824
  ), z = m.current;
825
825
  if (!z || y <= 0) return;
826
- const W = z.getBoundingClientRect(), J = (s.clientX + u.clientX) / 2 - W.left - W.width / 2, Q = (s.clientY + u.clientY) / 2 - W.top - W.height / 2;
826
+ const X = z.getBoundingClientRect(), J = (s.clientX + u.clientX) / 2 - X.left - X.width / 2, Q = (s.clientY + u.clientY) / 2 - X.top - X.height / 2;
827
827
  e.moved = !0, Y(
828
828
  e.pinchScale * y / e.pinchDistance,
829
829
  J,
@@ -835,7 +835,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
835
835
  const a = n.touches[0];
836
836
  if (a) {
837
837
  if ((Math.abs(a.clientX - e.startX) > 6 || Math.abs(a.clientY - e.startY) > 6) && (e.moved = !0), e.panning) {
838
- const s = D.current;
838
+ const s = O.current;
839
839
  $(
840
840
  s.scale,
841
841
  {
@@ -851,9 +851,9 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
851
851
  [$, Y]
852
852
  ), re = B(
853
853
  (n) => {
854
- const e = R.current;
854
+ const e = S.current;
855
855
  if (!e || n.touches.length > 0) return;
856
- if (R.current = null, !e.moved && e.pinchDistance === 0) {
856
+ if (S.current = null, !e.moved && e.pinchDistance === 0) {
857
857
  const u = Date.now(), y = P.current;
858
858
  if (y && u - y.time < bn && Math.abs(y.x - e.startX) < Je && Math.abs(y.y - e.startY) < Je) {
859
859
  P.current = null, _(e.startX, e.startY);
@@ -866,7 +866,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
866
866
  };
867
867
  return;
868
868
  }
869
- if (e.panning || e.pinchDistance > 0 || D.current.scale > G) return;
869
+ if (e.panning || e.pinchDistance > 0 || O.current.scale > G) return;
870
870
  const a = e.lastX - e.startX, s = e.lastY - e.startY;
871
871
  Math.abs(a) < mn || Math.abs(a) <= Math.abs(s) || (a < 0 ? E?.() : l?.());
872
872
  },
@@ -953,7 +953,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
953
953
  src: Le(t),
954
954
  alt: o,
955
955
  draggable: !1,
956
- onLoad: () => S(!0),
956
+ onLoad: () => R(!0),
957
957
  onError: w,
958
958
  $grabbing: V,
959
959
  $pannable: x > G,
@@ -980,10 +980,10 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
980
980
  if (!t) return { name: "" };
981
981
  const E = [t.username, t.id].map((v) => Ue(ie(v))).filter(Boolean), l = E.map((v) => o?.[v]).find((v) => v && (ye(v) || v.profileImage)), w = Ue(ie(i?.xmppUsername)), c = !!w && E.includes(w), T = ye(t) || Ee(t.name) || ye(l) || (c ? ye(i) || Ee(i?.name) : "") || E.map(Ee).find(Boolean) || Ee(g) || "", m = ie(t.photo) || ie(l?.profileImage) || (c ? ie(i?.profileImage) : "") || void 0;
982
982
  return { name: T, photo: m };
983
- }, Z = "#f5f7fa", ut = "rgba(245, 247, 250, 0.68)", fe = "rgba(255, 255, 255, 0.08)", ft = "rgba(255, 255, 255, 0.18)", ht = "var(--ethora-color-primary, #0052cd)", Sn = Ae`
983
+ }, Z = "#f5f7fa", ut = "rgba(245, 247, 250, 0.68)", fe = "rgba(255, 255, 255, 0.08)", ft = "rgba(255, 255, 255, 0.18)", ht = "var(--ethora-color-primary, #0052cd)", Rn = Ae`
984
984
  from { opacity: 0; transform: scale(0.98); }
985
985
  to { opacity: 1; transform: scale(1); }
986
- `, Rn = Ae`
986
+ `, Sn = Ae`
987
987
  from { opacity: 1; transform: scale(1); }
988
988
  to { opacity: 0; transform: scale(0.98); }
989
989
  `, Ln = f.div`
@@ -1000,7 +1000,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1000
1000
  background-color: rgba(10, 12, 18, 0.92);
1001
1001
  -webkit-backdrop-filter: blur(8px);
1002
1002
  backdrop-filter: blur(8px);
1003
- animation: ${({ $closing: t }) => t ? ke`${Rn} 160ms ease-in forwards` : ke`${Sn} 160ms ease-out both`};
1003
+ animation: ${({ $closing: t }) => t ? ke`${Sn} 160ms ease-in forwards` : ke`${Rn} 160ms ease-out both`};
1004
1004
  ${$e}
1005
1005
 
1006
1006
  /* Without backdrop-filter the translucent colour would sit over the chat
@@ -1074,7 +1074,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1074
1074
  opacity: 0.35;
1075
1075
  cursor: default;
1076
1076
  }
1077
- `, Dn = f.div`
1077
+ `, On = f.div`
1078
1078
  position: relative;
1079
1079
  display: flex;
1080
1080
  flex: 1 1 0;
@@ -1083,7 +1083,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1083
1083
  min-height: 0;
1084
1084
  min-width: 0;
1085
1085
  overflow: hidden;
1086
- `, On = f.div`
1086
+ `, Dn = f.div`
1087
1087
  position: relative;
1088
1088
  display: flex;
1089
1089
  align-items: center;
@@ -1201,7 +1201,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1201
1201
  },
1202
1202
  children: /* @__PURE__ */ r("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ r("path", { d: "M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z" }) })
1203
1203
  }
1204
- ), Xn = () => /* @__PURE__ */ r(
1204
+ ), Wn = () => /* @__PURE__ */ r(
1205
1205
  "span",
1206
1206
  {
1207
1207
  "aria-hidden": "true",
@@ -1212,7 +1212,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1212
1212
  background: "linear-gradient(135deg, #2a3350, #151a2b)"
1213
1213
  }
1214
1214
  }
1215
- ), Wn = f.div`
1215
+ ), Xn = f.div`
1216
1216
  display: grid;
1217
1217
  grid-template-columns: 1fr auto 1fr;
1218
1218
  align-items: center;
@@ -1231,7 +1231,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1231
1231
  display: flex;
1232
1232
  align-items: center;
1233
1233
  gap: 6px;
1234
- `, De = f.div`
1234
+ `, Oe = f.div`
1235
1235
  display: flex;
1236
1236
  flex-direction: column;
1237
1237
  align-items: center;
@@ -1244,7 +1244,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1244
1244
  border-radius: 16px;
1245
1245
  background-color: rgba(255, 255, 255, 0.05);
1246
1246
  color: ${Z};
1247
- `, Oe = f.h2`
1247
+ `, De = f.h2`
1248
1248
  margin: 0;
1249
1249
  font-size: 18px;
1250
1250
  font-weight: 600;
@@ -1309,9 +1309,9 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1309
1309
  onDownload: o
1310
1310
  }) => {
1311
1311
  const i = Pe();
1312
- return /* @__PURE__ */ b(De, { role: "alert", "data-testid": "file-viewer-error", children: [
1313
- /* @__PURE__ */ r(Gn, { children: /* @__PURE__ */ r(St, { size: 88 }) }),
1314
- /* @__PURE__ */ r(Oe, { children: i("modal.filePreview.unavailable") }),
1312
+ return /* @__PURE__ */ b(Oe, { role: "alert", "data-testid": "file-viewer-error", children: [
1313
+ /* @__PURE__ */ r(Gn, { children: /* @__PURE__ */ r(Rt, { size: 88 }) }),
1314
+ /* @__PURE__ */ r(De, { children: i("modal.filePreview.unavailable") }),
1315
1315
  /* @__PURE__ */ b(jn, { children: [
1316
1316
  /* @__PURE__ */ b(Vn, { type: "button", onClick: t, children: [
1317
1317
  /* @__PURE__ */ r(er, {}),
@@ -1329,21 +1329,21 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1329
1329
  onDownload: i
1330
1330
  }) => {
1331
1331
  const g = Pe(), E = it(t).toUpperCase();
1332
- return /* @__PURE__ */ b(De, { "data-testid": "file-viewer-file-card", children: [
1332
+ return /* @__PURE__ */ b(Oe, { "data-testid": "file-viewer-file-card", children: [
1333
1333
  /* @__PURE__ */ b(mt, { "aria-hidden": "true", children: [
1334
1334
  /* @__PURE__ */ r(tr, {}),
1335
1335
  E && /* @__PURE__ */ r(Jn, { children: E })
1336
1336
  ] }),
1337
- /* @__PURE__ */ r(Oe, { style: { overflowWrap: "anywhere" }, children: t || g("modal.filePreview.fileLabel") }),
1337
+ /* @__PURE__ */ r(De, { style: { overflowWrap: "anywhere" }, children: t || g("modal.filePreview.fileLabel") }),
1338
1338
  /* @__PURE__ */ r(Hn, { children: o }),
1339
1339
  /* @__PURE__ */ b(gt, { type: "button", onClick: i, children: [
1340
1340
  /* @__PURE__ */ r(bt, {}),
1341
1341
  g("modal.filePreview.download")
1342
1342
  ] })
1343
1343
  ] });
1344
- }, qn = ({ fileName: t, src: o }) => /* @__PURE__ */ b(De, { "data-testid": "file-viewer-audio-card", children: [
1344
+ }, qn = ({ fileName: t, src: o }) => /* @__PURE__ */ b(Oe, { "data-testid": "file-viewer-audio-card", children: [
1345
1345
  /* @__PURE__ */ r(mt, { "aria-hidden": "true", children: /* @__PURE__ */ r(nr, {}) }),
1346
- /* @__PURE__ */ r(Oe, { style: { overflowWrap: "anywhere" }, children: t }),
1346
+ /* @__PURE__ */ r(De, { style: { overflowWrap: "anywhere" }, children: t }),
1347
1347
  /* @__PURE__ */ r(
1348
1348
  "audio",
1349
1349
  {
@@ -1423,7 +1423,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1423
1423
  }, ar = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, sr = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', ur = ({
1424
1424
  handleCloseModal: t
1425
1425
  }) => {
1426
- const o = Rt(), i = Pe(), g = Lt(), { activeFile: E } = le(
1426
+ const o = St(), i = Pe(), g = Lt(), { activeFile: E } = le(
1427
1427
  (h) => h.chatSettingStore
1428
1428
  ), l = te(
1429
1429
  () => E ?? { fileName: "", fileURL: "", mimetype: "" },
@@ -1435,16 +1435,16 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1435
1435
  ), T = le((h) => h.rooms.usersSet), m = le((h) => h.chatSettingStore.user), v = le((h) => {
1436
1436
  const p = _e(h);
1437
1437
  return p?.type === "private" ? String(p?.title || p?.name || "") : "";
1438
- }), N = U(null), S = U(null), x = U([]), [O, A] = F(G), [H, k] = F(null), [X, V] = F(
1438
+ }), N = U(null), R = U(null), x = U([]), [D, A] = F(G), [H, k] = F(null), [W, V] = F(
1439
1439
  null
1440
- ), I = Tt(l?.mimetype, l?.fileName), D = te(() => Ct(c), [c]), j = l.siblings, R = te(() => {
1441
- if (Se(D, l) >= 0) return D;
1440
+ ), I = Tt(l?.mimetype, l?.fileName), O = te(() => Ct(c), [c]), j = l.siblings, S = te(() => {
1441
+ if (Re(O, l) >= 0) return O;
1442
1442
  const h = Mt(j);
1443
- return Se(h, l) >= 0 ? h : D;
1444
- }, [D, j, l]), P = te(
1445
- () => I === "image" || I === "video" ? Se(R, l) : -1,
1446
- [R, l, I]
1447
- ), C = P >= 0 && R.length > 1, $ = C && P > 0, Y = C && P < R.length - 1, L = P >= 0 ? R[P] : void 0, K = L?.fileName || l.fileName, _ = L?.sender ?? l.sender, ee = te(
1443
+ return Re(h, l) >= 0 ? h : O;
1444
+ }, [O, j, l]), P = te(
1445
+ () => I === "image" || I === "video" ? Re(S, l) : -1,
1446
+ [S, l, I]
1447
+ ), C = P >= 0 && S.length > 1, $ = C && P > 0, Y = C && P < S.length - 1, L = P >= 0 ? S[P] : void 0, K = L?.fileName || l.fileName, _ = L?.sender ?? l.sender, ee = te(
1448
1448
  () => Pn({
1449
1449
  sender: _,
1450
1450
  usersSet: T,
@@ -1454,10 +1454,10 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1454
1454
  [_, T, m, v]
1455
1455
  ), ne = ee.name, de = rr(L?.date ?? l.date), re = !!l.fileURL, oe = I === "image" && (!re || H === l.fileURL), d = te(() => {
1456
1456
  const h = ue(l.fileURL, w);
1457
- return X?.url === l.fileURL ? or(h, X.count) : h;
1458
- }, [l.fileURL, w, X]), n = L?.previewURL ? ue(L.previewURL, w) : void 0, e = B(
1457
+ return W?.url === l.fileURL ? or(h, W.count) : h;
1458
+ }, [l.fileURL, w, W]), n = L?.previewURL ? ue(L.previewURL, w) : void 0, e = B(
1459
1459
  (h) => {
1460
- const p = R[h];
1460
+ const p = S[h];
1461
1461
  p && o(
1462
1462
  Be({
1463
1463
  fileName: p.fileName,
@@ -1468,7 +1468,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1468
1468
  })
1469
1469
  );
1470
1470
  },
1471
- [o, R, j]
1471
+ [o, S, j]
1472
1472
  ), a = B(() => {
1473
1473
  $ && e(P - 1);
1474
1474
  }, [e, $, P]), s = B(() => {
@@ -1476,12 +1476,12 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1476
1476
  }, [e, Y, P]);
1477
1477
  M(() => {
1478
1478
  !C || typeof Image > "u" || [P - 1, P + 1].forEach((h) => {
1479
- const p = R[h];
1479
+ const p = S[h];
1480
1480
  if (!p || p.kind !== "image") return;
1481
1481
  const q = ue(p.fileURL, w);
1482
1482
  q && (new Image().src = q);
1483
1483
  });
1484
- }, [C, P, R, w]), M(() => {
1484
+ }, [C, P, S, w]), M(() => {
1485
1485
  if (!C) return;
1486
1486
  x.current[P]?.scrollIntoView?.({
1487
1487
  block: "nearest",
@@ -1505,14 +1505,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1505
1505
  p.preventDefault(), p.key === "ArrowLeft" ? a() : s();
1506
1506
  return;
1507
1507
  }
1508
- I !== "image" || oe || (p.key === "+" || p.key === "=" ? (p.preventDefault(), S.current?.zoomIn()) : p.key === "-" || p.key === "_" ? (p.preventDefault(), S.current?.zoomOut()) : p.key === "0" && (p.preventDefault(), S.current?.reset()));
1508
+ I !== "image" || oe || (p.key === "+" || p.key === "=" ? (p.preventDefault(), R.current?.zoomIn()) : p.key === "-" || p.key === "_" ? (p.preventDefault(), R.current?.zoomOut()) : p.key === "0" && (p.preventDefault(), R.current?.reset()));
1509
1509
  }
1510
1510
  };
1511
1511
  return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
1512
1512
  }, [C, a, s, I, oe]);
1513
1513
  const u = () => {
1514
1514
  const q = !!it(l.fileName) ? l.fileName : `MEDIA-ETHORA.${I === "image" ? "png" : I === "video" ? "mp4" : "bin"}`;
1515
- Xt(Ne(l.fileURL), q).catch((be) => {
1515
+ Wt(Ne(l.fileURL), q).catch((be) => {
1516
1516
  zt.log(be);
1517
1517
  });
1518
1518
  }, y = () => {
@@ -1523,14 +1523,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1523
1523
  );
1524
1524
  }, z = () => {
1525
1525
  o(Be(void 0)), t?.();
1526
- }, W = (h) => {
1526
+ }, X = (h) => {
1527
1527
  h.target === h.currentTarget && z();
1528
1528
  }, J = () => {
1529
1529
  et(l.fileURL) && tt(), k(l.fileURL);
1530
1530
  }, Q = () => {
1531
1531
  V({
1532
1532
  url: l.fileURL,
1533
- count: (X?.url === l.fileURL ? X.count : 0) + 1
1533
+ count: (W?.url === l.fileURL ? W.count : 0) + 1
1534
1534
  }), k(null);
1535
1535
  }, se = (h) => {
1536
1536
  if (h.key !== "Tab" || !N.current) return;
@@ -1550,7 +1550,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1550
1550
  ae = /* @__PURE__ */ r(
1551
1551
  dt,
1552
1552
  {
1553
- ref: S,
1553
+ ref: R,
1554
1554
  src: d,
1555
1555
  previewSrc: n,
1556
1556
  alt: pe,
@@ -1649,7 +1649,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1649
1649
  )
1650
1650
  ] })
1651
1651
  ] }),
1652
- /* @__PURE__ */ b(Dn, { onClick: W, "data-testid": "file-viewer-stage", children: [
1652
+ /* @__PURE__ */ b(On, { onClick: X, "data-testid": "file-viewer-stage", children: [
1653
1653
  C && /* @__PURE__ */ r(
1654
1654
  Qe,
1655
1655
  {
@@ -1658,10 +1658,10 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1658
1658
  onClick: a,
1659
1659
  disabled: !$,
1660
1660
  "aria-label": i("modal.filePreview.previousItem"),
1661
- children: /* @__PURE__ */ r(Dt, { color: "currentColor" })
1661
+ children: /* @__PURE__ */ r(Ot, { color: "currentColor" })
1662
1662
  }
1663
1663
  ),
1664
- /* @__PURE__ */ r(On, { $fit: me, children: ae }),
1664
+ /* @__PURE__ */ r(Dn, { $fit: me, children: ae }),
1665
1665
  C && /* @__PURE__ */ r(
1666
1666
  Qe,
1667
1667
  {
@@ -1670,7 +1670,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1670
1670
  onClick: s,
1671
1671
  disabled: !Y,
1672
1672
  "aria-label": i("modal.filePreview.nextItem"),
1673
- children: /* @__PURE__ */ r(Ot, { color: "currentColor" })
1673
+ children: /* @__PURE__ */ r(Dt, { color: "currentColor" })
1674
1674
  }
1675
1675
  )
1676
1676
  ] }),
@@ -1681,7 +1681,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1681
1681
  role: "group",
1682
1682
  "aria-label": i("modal.filePreview.thumbnails"),
1683
1683
  "data-testid": "file-viewer-thumbnails",
1684
- children: R.map((h, p) => /* @__PURE__ */ b(
1684
+ children: S.map((h, p) => /* @__PURE__ */ b(
1685
1685
  _n,
1686
1686
  {
1687
1687
  ref: (q) => {
@@ -1691,12 +1691,12 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1691
1691
  $active: p === P,
1692
1692
  "aria-label": i("modal.filePreview.showItem", {
1693
1693
  current: p + 1,
1694
- total: R.length
1694
+ total: S.length
1695
1695
  }),
1696
1696
  "aria-current": p === P ? "true" : void 0,
1697
1697
  onClick: () => e(p),
1698
1698
  children: [
1699
- h.kind === "video" && !h.previewURL ? /* @__PURE__ */ r(Xn, {}) : /* @__PURE__ */ r(
1699
+ h.kind === "video" && !h.previewURL ? /* @__PURE__ */ r(Wn, {}) : /* @__PURE__ */ r(
1700
1700
  Bn,
1701
1701
  {
1702
1702
  src: Le(
@@ -1714,19 +1714,19 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1714
1714
  ))
1715
1715
  }
1716
1716
  ),
1717
- /* @__PURE__ */ b(Wn, { children: [
1717
+ /* @__PURE__ */ b(Xn, { children: [
1718
1718
  /* @__PURE__ */ r("span", {}),
1719
1719
  C ? /* @__PURE__ */ r(Fn, { "data-testid": "lightbox-position", "aria-live": "polite", children: i("modal.filePreview.position", {
1720
1720
  current: P + 1,
1721
- total: R.length
1721
+ total: S.length
1722
1722
  }) }) : /* @__PURE__ */ r("span", {}),
1723
1723
  xt ? /* @__PURE__ */ b(Yn, { children: [
1724
1724
  /* @__PURE__ */ r(
1725
1725
  ce,
1726
1726
  {
1727
1727
  type: "button",
1728
- onClick: () => S.current?.zoomOut(),
1729
- disabled: O <= G,
1728
+ onClick: () => R.current?.zoomOut(),
1729
+ disabled: D <= G,
1730
1730
  "aria-label": i("modal.filePreview.zoomOut"),
1731
1731
  children: /* @__PURE__ */ r(nt, { color: "currentColor" })
1732
1732
  }
@@ -1735,8 +1735,8 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1735
1735
  ce,
1736
1736
  {
1737
1737
  type: "button",
1738
- onClick: () => S.current?.zoomIn(),
1739
- disabled: O >= Ie,
1738
+ onClick: () => R.current?.zoomIn(),
1739
+ disabled: D >= Ie,
1740
1740
  "aria-label": i("modal.filePreview.zoomIn"),
1741
1741
  children: /* @__PURE__ */ r(rt, { color: "currentColor" })
1742
1742
  }
@@ -1745,8 +1745,8 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1745
1745
  ce,
1746
1746
  {
1747
1747
  type: "button",
1748
- onClick: () => S.current?.reset(),
1749
- disabled: O <= G,
1748
+ onClick: () => R.current?.reset(),
1749
+ disabled: D <= G,
1750
1750
  "aria-label": i("modal.filePreview.resetZoom"),
1751
1751
  children: /* @__PURE__ */ r(ot, { color: "currentColor" })
1752
1752
  }