@linktr.ee/messaging-react 3.12.3-rc-1784034329 → 3.12.3-rc-1784036626

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,12 +1,12 @@
1
1
  import { jsx as s, jsxs as u, Fragment as se } from "react/jsx-runtime";
2
- import V, { createContext as ct, useContext as Te, useCallback as J, useState as U, useRef as G, useEffect as K, useId as js, useMemo as re, Suspense as Vs } from "react";
3
- import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
4
- import { StreamChat as Hs, LinkPreviewsManager as Yt } from "stream-chat";
5
- import { Chat as Ys, useChannelStateContext as oe, useChatContext as fe, DateSeparator as qs, MessageStatus as Ws, useMessageContext as Ne, MessageErrorIcon as nt, MessageText as $e, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as as, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as ln, messageHasReactions as on, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as pn, useMessageInputContext as bn, useMessageComposerHasSendableData as vn, AttachmentPreviewList as xn, QuotedMessagePreview as wn, TextareaComposer as _n, MessageTimestamp as Xe, AIStates as Ke, useTypingContext as Nn, useAIState as yn, Channel as kn, WithComponents as Cn, Window as Sn, MessageList as En, ChannelList as In, InfiniteScroll as Tn } from "stream-chat-react";
6
- import { StarIcon as Ie, DotsThreeIcon as Mn, SpinnerGapIcon as Fe, SignOutIcon as An, ProhibitInsetIcon as qt, FlagIcon as rs, ArrowLeftIcon as at, CurrencyDollarIcon as Rn, CaretRightIcon as xe, SparkleIcon as we, FileIcon as is, ImageIcon as Ln, SpeakerHighIcon as Dn, VideoCameraIcon as ls, FileMdIcon as zn, FileTextIcon as Fn, FileZipIcon as Pn, FilePptIcon as On, FileCsvIcon as $n, FileXlsIcon as Bn, FileDocIcon as Un, FilePdfIcon as jn, CircleNotchIcon as Se, PlayIcon as rt, PauseIcon as Vn, LinkIcon as Gn, DownloadSimpleIcon as Ee, XIcon as Ge, CaretLeftIcon as Hn, GiftIcon as Yn, ThumbsUpIcon as qn, ThumbsDownIcon as Wn, ChecksIcon as Xn, PencilSimpleIcon as Kn, TrashSimpleIcon as Zn, ArrowUpIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
7
- import y from "classnames";
8
- import { MessageActions as ea, DefaultDropdownActionButton as os } from "stream-chat-react/experimental";
9
- const cs = ct({
2
+ import V, { createContext as ct, useContext as Te, useCallback as J, useState as B, useRef as G, useEffect as K, useId as Vs, useMemo as re, Suspense as Gs } from "react";
3
+ import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
4
+ import { StreamChat as Ys, LinkPreviewsManager as Yt } from "stream-chat";
5
+ import { Chat as qs, useChannelStateContext as oe, useChatContext as fe, DateSeparator as Ws, MessageStatus as Xs, useMessageContext as Ne, MessageErrorIcon as nt, MessageText as $e, areMessageUIPropsEqual as Ks, useMessageReminder as Zs, useComponentContext as rs, Attachment as Js, EditMessageModal as Qs, MessageBlocked as en, MessageBouncePrompt as tn, MessageDeleted as sn, MessageIsThreadReplyInChannelButtonIndicator as nn, MessageRepliesCountButton as an, ReminderNotification as rn, StreamedMessageText as ln, messageHasAttachments as on, messageHasReactions as cn, isDateSeparatorMessage as dn, isMessageBlocked as un, isMessageBounced as mn, MessageBounceModal as hn, Poll as fn, useMessageComposer as gn, useStateStore as pn, MessageInput as bn, useMessageInputContext as vn, useMessageComposerHasSendableData as xn, AttachmentPreviewList as wn, QuotedMessagePreview as _n, TextareaComposer as Nn, MessageTimestamp as Xe, AIStates as Ke, useTypingContext as yn, useAIState as kn, Channel as Cn, WithComponents as Sn, Window as En, MessageList as In, ChannelList as Tn, InfiniteScroll as Mn } from "stream-chat-react";
6
+ import { StarIcon as Ie, DotsThreeIcon as An, SpinnerGapIcon as Fe, SignOutIcon as Rn, ProhibitInsetIcon as qt, FlagIcon as is, ArrowLeftIcon as at, CurrencyDollarIcon as Ln, CaretRightIcon as xe, SparkleIcon as we, FileIcon as ls, ImageIcon as Dn, SpeakerHighIcon as zn, VideoCameraIcon as os, FileMdIcon as Fn, FileTextIcon as Pn, FileZipIcon as On, FilePptIcon as $n, FileCsvIcon as Un, FileXlsIcon as Bn, FileDocIcon as jn, FilePdfIcon as Vn, CircleNotchIcon as Se, PlayIcon as rt, PauseIcon as Gn, LinkIcon as Hn, DownloadSimpleIcon as Ee, XIcon as Ge, CaretLeftIcon as Yn, GiftIcon as qn, ThumbsUpIcon as Wn, ThumbsDownIcon as Xn, ChecksIcon as Kn, PencilSimpleIcon as Zn, TrashSimpleIcon as Jn, ArrowUpIcon as Qn, ProhibitIcon as ea } from "@phosphor-icons/react";
7
+ import k from "classnames";
8
+ import { MessageActions as ta, DefaultDropdownActionButton as cs } from "stream-chat-react/experimental";
9
+ const ds = ct({
10
10
  service: null,
11
11
  client: null,
12
12
  isConnected: !1,
@@ -16,7 +16,7 @@ const cs = ct({
16
16
  refreshConnection: async () => {
17
17
  },
18
18
  debug: !1
19
- }), dt = () => Te(cs), hl = ({
19
+ }), dt = () => Te(ds), ml = ({
20
20
  children: e,
21
21
  user: t,
22
22
  serviceConfig: n,
@@ -25,7 +25,7 @@ const cs = ct({
25
25
  debug: i = !1,
26
26
  client: o
27
27
  }) => {
28
- var I, T;
28
+ var y, T;
29
29
  const l = J(
30
30
  (M, ...P) => {
31
31
  i && console.log(`🔥 [MessagingProvider] ${M}`, ...P);
@@ -38,11 +38,11 @@ const cs = ct({
38
38
  serviceConfig: !!n,
39
39
  capabilities: Object.keys(r)
40
40
  });
41
- const [d, m] = U(null), [f, h] = U(null), [g, c] = U(!1), [b, v] = U(!1), [x, p] = U(null), _ = G(!1), w = G(null), k = G(n);
42
- k.current = n;
41
+ const [d, m] = B(null), [f, h] = B(null), [g, c] = B(!1), [b, v] = B(!1), [x, p] = B(null), _ = G(!1), w = G(null), C = G(n);
42
+ C.current = n;
43
43
  const D = G(i);
44
44
  D.current = i;
45
- const S = G({
45
+ const E = G({
46
46
  userId: t == null ? void 0 : t.id,
47
47
  apiKey: a,
48
48
  serviceConfig: n,
@@ -52,22 +52,22 @@ const cs = ct({
52
52
  renderCount: R.current,
53
53
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
54
54
  propChanges: {
55
- userChanged: S.current.userId !== (t == null ? void 0 : t.id),
56
- apiKeyChanged: S.current.apiKey !== a,
57
- serviceConfigChanged: S.current.serviceConfig !== n,
58
- capabilitiesChanged: S.current.capabilities !== r
55
+ userChanged: E.current.userId !== (t == null ? void 0 : t.id),
56
+ apiKeyChanged: E.current.apiKey !== a,
57
+ serviceConfigChanged: E.current.serviceConfig !== n,
58
+ capabilitiesChanged: E.current.capabilities !== r
59
59
  }
60
- }), S.current = {
60
+ }), E.current = {
61
61
  userId: t == null ? void 0 : t.id,
62
62
  apiKey: a,
63
63
  serviceConfig: n,
64
64
  capabilities: r
65
65
  };
66
66
  const O = G(null);
67
- !o && a && ((I = O.current) == null ? void 0 : I.apiKey) !== a && (O.current = { apiKey: a, client: new Hs(a) });
67
+ !o && a && ((y = O.current) == null ? void 0 : y.apiKey) !== a && (O.current = { apiKey: a, client: new Ys(a) });
68
68
  const F = o || (a ? ((T = O.current) == null ? void 0 : T.client) ?? null : null);
69
69
  K(() => {
70
- const M = R.current, P = k.current;
70
+ const M = R.current, P = C.current;
71
71
  if (o) {
72
72
  w.current = null, m(null), h(null), c(!1), p(null), v(!1);
73
73
  return;
@@ -83,7 +83,7 @@ const cs = ct({
83
83
  renderCount: M,
84
84
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
85
85
  });
86
- const $ = new Gs({
86
+ const $ = new Hs({
87
87
  ...P,
88
88
  apiKey: a,
89
89
  debug: D.current,
@@ -150,7 +150,7 @@ const cs = ct({
150
150
  M && (L.current = null, (P = w.current) == null || P.disconnectUser().catch(console.error));
151
151
  };
152
152
  }, [F]);
153
- const C = J(async () => {
153
+ const S = J(async () => {
154
154
  if (l("🔄 REFRESH CONNECTION CALLED", {
155
155
  hasService: !!d,
156
156
  hasUser: !!t
@@ -174,7 +174,7 @@ const cs = ct({
174
174
  v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
175
175
  }
176
176
  }
177
- }, [d, t, l, o]), E = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
177
+ }, [d, t, l, o]), I = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
178
178
  hasService: !!d,
179
179
  hasClient: !!f,
180
180
  isConnected: g,
@@ -196,7 +196,7 @@ const cs = ct({
196
196
  isLoading: o ? !1 : b,
197
197
  error: o ? null : x,
198
198
  capabilities: r,
199
- refreshConnection: C,
199
+ refreshConnection: S,
200
200
  debug: i
201
201
  }), [
202
202
  d,
@@ -206,16 +206,16 @@ const cs = ct({
206
206
  b,
207
207
  x,
208
208
  r,
209
- C,
209
+ S,
210
210
  i,
211
211
  l
212
212
  ]);
213
213
  return l("🔄 RENDER END", {
214
214
  renderCount: R.current,
215
215
  willRenderChat: !!F,
216
- contextValueReady: !!E
217
- }), /* @__PURE__ */ s(cs.Provider, { value: E, children: F ? /* @__PURE__ */ s(
218
- Ys,
216
+ contextValueReady: !!I
217
+ }), /* @__PURE__ */ s(ds.Provider, { value: I, children: F ? /* @__PURE__ */ s(
218
+ qs,
219
219
  {
220
220
  client: F,
221
221
  customClasses: {
@@ -224,9 +224,9 @@ const cs = ct({
224
224
  children: e
225
225
  }
226
226
  ) : e });
227
- }, ta = () => dt(), ut = (e) => {
227
+ }, sa = () => dt(), ut = (e) => {
228
228
  var a, r;
229
- const [t, n] = U(
229
+ const [t, n] = B(
230
230
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
231
231
  );
232
232
  return K(() => {
@@ -246,14 +246,14 @@ const cs = ct({
246
246
  e.off("member.updated", i);
247
247
  };
248
248
  }, [e]), t;
249
- }, sa = "linktree-official", na = "linktree-official-sender";
249
+ }, na = "linktree-official", aa = "linktree-official-sender";
250
250
  function He(e, t, n) {
251
251
  const a = Object.values(e || {});
252
- if (n === sa) {
252
+ if (n === na) {
253
253
  const r = a.find(
254
254
  (i) => {
255
255
  var o;
256
- return ((o = i.user) == null ? void 0 : o.id) === na;
256
+ return ((o = i.user) == null ? void 0 : o.id) === aa;
257
257
  }
258
258
  );
259
259
  if (r) return r;
@@ -265,13 +265,13 @@ function He(e, t, n) {
265
265
  }
266
266
  );
267
267
  }
268
- const aa = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
269
- function ra(e) {
270
- return aa.test(e.trim());
268
+ const ra = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
269
+ function ia(e) {
270
+ return ra.test(e.trim());
271
271
  }
272
272
  function Wt(e, t) {
273
273
  const n = e == null ? void 0 : e.trim();
274
- return !n || t && n === t ? !1 : !ra(n);
274
+ return !n || t && n === t ? !1 : !ia(n);
275
275
  }
276
276
  function mt(e) {
277
277
  return Wt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Wt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
@@ -304,7 +304,7 @@ const Xt = [
304
304
  { emoji: "🍈", bgColor: "#D9F7E1" }
305
305
  // Melon
306
306
  ];
307
- function ia(e) {
307
+ function la(e) {
308
308
  let t = 0;
309
309
  for (let n = 0; n < e.length; n++) {
310
310
  const a = e.charCodeAt(n);
@@ -312,14 +312,14 @@ function ia(e) {
312
312
  }
313
313
  return Math.abs(t);
314
314
  }
315
- function ds(e) {
316
- return Xt[ia(e) % Xt.length];
317
- }
318
- function la(e) {
319
- return ds(e).emoji;
315
+ function us(e) {
316
+ return Xt[la(e) % Xt.length];
320
317
  }
321
318
  function oa(e) {
322
- return ds(e).bgColor;
319
+ return us(e).emoji;
320
+ }
321
+ function ca(e) {
322
+ return us(e).bgColor;
323
323
  }
324
324
  const ne = ({
325
325
  id: e,
@@ -330,7 +330,7 @@ const ne = ({
330
330
  shape: i = "squircle",
331
331
  dmAgentEnabled: o = !1
332
332
  }) => {
333
- const l = la(e), d = oa(e), m = 0.45, h = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
333
+ const l = oa(e), d = ca(e), m = 0.45, h = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
334
334
  "img",
335
335
  {
336
336
  src: t,
@@ -341,7 +341,7 @@ const ne = ({
341
341
  "div",
342
342
  {
343
343
  "aria-hidden": "true",
344
- className: y(
344
+ className: k(
345
345
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"
346
346
  ),
347
347
  style: { fontSize: h, lineHeight: 1 },
@@ -351,7 +351,7 @@ const ne = ({
351
351
  return /* @__PURE__ */ u(
352
352
  "div",
353
353
  {
354
- className: y(
354
+ className: k(
355
355
  "relative flex-shrink-0",
356
356
  a
357
357
  ),
@@ -375,7 +375,7 @@ const ne = ({
375
375
  "div",
376
376
  {
377
377
  "data-testid": "avatar-ring",
378
- className: y(
378
+ className: k(
379
379
  "h-full w-full",
380
380
  "bg-transparent"
381
381
  ),
@@ -394,7 +394,7 @@ const ne = ({
394
394
  ]
395
395
  }
396
396
  );
397
- }, ca = "https://linktr.ee/s/about/trust-center/report", da = ({
397
+ }, da = "https://linktr.ee/s/about/trust-center/report", ua = ({
398
398
  channel: e,
399
399
  participant: t,
400
400
  showBlockParticipant: n = !0,
@@ -407,30 +407,30 @@ const ne = ({
407
407
  onActionComplete: m,
408
408
  logLabel: f = "useChannelModerationActions"
409
409
  }) => {
410
- var E;
411
- const { service: h, debug: g } = dt(), c = (E = t == null ? void 0 : t.user) == null ? void 0 : E.id, b = !!(a && n && h && c), [v, x] = U(!1), [p, _] = U(null), [w, k] = U(!1), [D, S] = U(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
410
+ var I;
411
+ const { service: h, debug: g } = dt(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, b = !!(a && n && h && c), [v, x] = B(!1), [p, _] = B(null), [w, C] = B(!1), [D, E] = B(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
412
412
  return K(() => {
413
413
  if (!b || !h || !c) {
414
414
  x(!1), _(null);
415
415
  return;
416
416
  }
417
- let I = !1;
417
+ let y = !1;
418
418
  return (async () => {
419
419
  try {
420
420
  const T = await h.getBlockedUsers();
421
- if (I) return;
421
+ if (y) return;
422
422
  x(
423
423
  T.some(
424
424
  (M) => M.blocked_user_id === c
425
425
  )
426
426
  );
427
427
  } catch (T) {
428
- I || console.error(`[${f}] Failed to check blocked status:`, T);
428
+ y || console.error(`[${f}] Failed to check blocked status:`, T);
429
429
  } finally {
430
- I || _({ participantId: c, service: h });
430
+ y || _({ participantId: c, service: h });
431
431
  }
432
432
  })(), () => {
433
- I = !0;
433
+ y = !0;
434
434
  };
435
435
  }, [b, h, c, f]), {
436
436
  isParticipantBlocked: v,
@@ -438,47 +438,47 @@ const ne = ({
438
438
  isLeaving: w,
439
439
  isUpdatingBlockStatus: D,
440
440
  handleLeaveConversation: async () => {
441
- var I;
441
+ var y;
442
442
  if (!w) {
443
- o == null || o(), g && console.log(`[${f}] Leave conversation`, e.cid), k(!0);
443
+ o == null || o(), g && console.log(`[${f}] Leave conversation`, e.cid), C(!0);
444
444
  try {
445
- const T = ((I = e._client) == null ? void 0 : I.userID) ?? null;
445
+ const T = ((y = e._client) == null ? void 0 : y.userID) ?? null;
446
446
  await e.hide(T, !1), r && await r(e), m == null || m();
447
447
  } catch (T) {
448
448
  console.error(`[${f}] Failed to leave conversation`, T);
449
449
  } finally {
450
- k(!1);
450
+ C(!1);
451
451
  }
452
452
  }
453
453
  },
454
454
  handleBlockUser: async () => {
455
- var I, T, M;
455
+ var y, T, M;
456
456
  if (!(D || !h)) {
457
- l == null || l(), g && console.log(`[${f}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), S(!0);
457
+ l == null || l(), g && console.log(`[${f}] Block member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), E(!0);
458
458
  try {
459
459
  await h.blockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
460
460
  } catch (P) {
461
461
  console.error(`[${f}] Failed to block member`, P);
462
462
  } finally {
463
- S(!1);
463
+ E(!1);
464
464
  }
465
465
  }
466
466
  },
467
467
  handleUnblockUser: async () => {
468
- var I, T, M;
468
+ var y, T, M;
469
469
  if (!(D || !h)) {
470
- l == null || l(), g && console.log(`[${f}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), S(!0);
470
+ l == null || l(), g && console.log(`[${f}] Unblock member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), E(!0);
471
471
  try {
472
472
  await h.unBlockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
473
473
  } catch (P) {
474
474
  console.error(`[${f}] Failed to unblock member`, P);
475
475
  } finally {
476
- S(!1);
476
+ E(!1);
477
477
  }
478
478
  }
479
479
  },
480
480
  handleReportUser: () => {
481
- d == null || d(), m == null || m(), window.open(ca, "_blank", "noopener,noreferrer");
481
+ d == null || d(), m == null || m(), window.open(da, "_blank", "noopener,noreferrer");
482
482
  }
483
483
  };
484
484
  }, ye = ({
@@ -490,7 +490,7 @@ const ne = ({
490
490
  "button",
491
491
  {
492
492
  type: "button",
493
- className: y(
493
+ className: k(
494
494
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
495
495
  e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
496
496
  t
@@ -512,16 +512,16 @@ const ne = ({
512
512
  customChannelActions: f,
513
513
  triggerClassName: h
514
514
  }) => {
515
- const [g, c] = U(!1), b = G(null), v = js(), x = J(() => c(!1), []), {
515
+ const [g, c] = B(!1), b = G(null), v = Vs(), x = J(() => c(!1), []), {
516
516
  isParticipantBlocked: p,
517
517
  isCheckingBlockedStatus: _,
518
518
  isLeaving: w,
519
- isUpdatingBlockStatus: k,
519
+ isUpdatingBlockStatus: C,
520
520
  handleLeaveConversation: D,
521
- handleBlockUser: S,
521
+ handleBlockUser: E,
522
522
  handleUnblockUser: R,
523
523
  handleReportUser: O
524
- } = da({
524
+ } = ua({
525
525
  channel: e,
526
526
  participant: t,
527
527
  showBlockParticipant: a,
@@ -536,13 +536,13 @@ const ne = ({
536
536
  });
537
537
  return K(() => {
538
538
  if (!g) return;
539
- const L = (E) => {
540
- b.current && !b.current.contains(E.target) && c(!1);
541
- }, C = (E) => {
542
- E.key === "Escape" && c(!1);
539
+ const L = (I) => {
540
+ b.current && !b.current.contains(I.target) && c(!1);
541
+ }, S = (I) => {
542
+ I.key === "Escape" && c(!1);
543
543
  };
544
- return document.addEventListener("mousedown", L), document.addEventListener("keydown", C), () => {
545
- document.removeEventListener("mousedown", L), document.removeEventListener("keydown", C);
544
+ return document.addEventListener("mousedown", L), document.addEventListener("keydown", S), () => {
545
+ document.removeEventListener("mousedown", L), document.removeEventListener("keydown", S);
546
546
  };
547
547
  }, [g]), !t || !(n || a || r || !!f) ? null : /* @__PURE__ */ u("div", { ref: b, className: "relative", children: [
548
548
  /* @__PURE__ */ u(
@@ -555,7 +555,7 @@ const ne = ({
555
555
  "aria-controls": g ? v : void 0,
556
556
  onClick: () => c((L) => !L),
557
557
  children: [
558
- /* @__PURE__ */ s(Mn, { className: "size-5 text-black/90" }),
558
+ /* @__PURE__ */ s(An, { className: "size-5 text-black/90" }),
559
559
  /* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
560
560
  ]
561
561
  }
@@ -565,7 +565,7 @@ const ne = ({
565
565
  {
566
566
  id: v,
567
567
  "aria-label": "Conversation options",
568
- className: y(
568
+ className: k(
569
569
  "absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
570
570
  "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
571
571
  ),
@@ -577,7 +577,7 @@ const ne = ({
577
577
  disabled: w,
578
578
  "aria-busy": w,
579
579
  children: [
580
- w ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(An, { className: "h-5 w-5" }),
580
+ w ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Rn, { className: "h-5 w-5" }),
581
581
  /* @__PURE__ */ s("span", { children: "Delete Conversation" })
582
582
  ]
583
583
  }
@@ -593,27 +593,27 @@ const ne = ({
593
593
  ye,
594
594
  {
595
595
  onClick: R,
596
- disabled: k,
597
- "aria-busy": k,
596
+ disabled: C,
597
+ "aria-busy": C,
598
598
  children: [
599
- k ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
599
+ C ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
600
600
  /* @__PURE__ */ s("span", { children: "Unblock" })
601
601
  ]
602
602
  }
603
603
  ) : /* @__PURE__ */ u(
604
604
  ye,
605
605
  {
606
- onClick: S,
607
- disabled: k,
608
- "aria-busy": k,
606
+ onClick: E,
607
+ disabled: C,
608
+ "aria-busy": C,
609
609
  children: [
610
- k ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
610
+ C ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
611
611
  /* @__PURE__ */ s("span", { children: "Block" })
612
612
  ]
613
613
  }
614
614
  ) }),
615
615
  r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ u(ye, { variant: "danger", onClick: O, children: [
616
- /* @__PURE__ */ s(rs, { className: "h-5 w-5" }),
616
+ /* @__PURE__ */ s(is, { className: "h-5 w-5" }),
617
617
  /* @__PURE__ */ s("span", { children: "Report" })
618
618
  ] }) }),
619
619
  f
@@ -621,10 +621,7 @@ const ne = ({
621
621
  }
622
622
  )
623
623
  ] });
624
- }, Ze = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", ua = "CUSTOMER_PAID", ma = "Replies instantly with AI assistant", ha = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ua, fa = (e) => {
625
- const t = e;
626
- return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(ha);
627
- }, ga = ({
624
+ }, Ze = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", ma = "CUSTOMER_PAID", ha = "Replies instantly with AI assistant", fa = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ma, ga = ({
628
625
  className: e,
629
626
  onBack: t,
630
627
  showBackButton: n,
@@ -643,31 +640,31 @@ const ne = ({
643
640
  showChannelInfo: v = !0,
644
641
  onParticipantNameClick: x
645
642
  }) => {
646
- var F, L, C;
643
+ var F, L, S, I;
647
644
  const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
648
645
  () => {
649
- var E;
646
+ var y;
650
647
  return He(
651
- (E = p.state) == null ? void 0 : E.members,
648
+ (y = p.state) == null ? void 0 : y.members,
652
649
  _ == null ? void 0 : _.userID,
653
650
  p.type
654
651
  );
655
652
  },
656
653
  [(F = p.state) == null ? void 0 : F.members, _ == null ? void 0 : _.userID, p.type]
657
- ), k = mt(w == null ? void 0 : w.user), D = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, S = ut(p), R = fa(w), O = async () => {
654
+ ), C = mt(w == null ? void 0 : w.user), D = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, E = ut(p), R = fa((S = p.data) == null ? void 0 : S.customer_tag) && (w == null ? void 0 : w.is_follower) === !0, O = async () => {
658
655
  try {
659
- S ? await p.unpin() : await p.pin();
660
- } catch (E) {
656
+ E ? await p.unpin() : await p.pin();
657
+ } catch (y) {
661
658
  console.error(
662
659
  "[ChannelHeaderRedesign] Failed to update pinned status:",
663
- E
660
+ y
664
661
  );
665
662
  }
666
663
  };
667
664
  return /* @__PURE__ */ s(
668
665
  "div",
669
666
  {
670
- className: y(
667
+ className: k(
671
668
  "@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]",
672
669
  e
673
670
  ),
@@ -675,7 +672,7 @@ const ne = ({
675
672
  /* @__PURE__ */ s("div", { className: "flex items-start", children: n && /* @__PURE__ */ s(
676
673
  "button",
677
674
  {
678
- className: y(
675
+ className: k(
679
676
  Ze,
680
677
  "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
681
678
  ),
@@ -691,14 +688,14 @@ const ne = ({
691
688
  {
692
689
  type: "button",
693
690
  onClick: x,
694
- "aria-label": `View details for ${k}`,
691
+ "aria-label": `View details for ${C}`,
695
692
  className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
696
693
  children: [
697
694
  /* @__PURE__ */ s(
698
695
  ne,
699
696
  {
700
- id: ((C = w == null ? void 0 : w.user) == null ? void 0 : C.id) || p.id || "unknown",
701
- name: k,
697
+ id: ((I = w == null ? void 0 : w.user) == null ? void 0 : I.id) || p.id || "unknown",
698
+ name: C,
702
699
  image: D,
703
700
  dmAgentEnabled: r,
704
701
  shape: "circle",
@@ -708,17 +705,17 @@ const ne = ({
708
705
  ),
709
706
  /* @__PURE__ */ u("span", { className: "relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 pl-3 pr-2 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-filter duration-150 group-hover:brightness-95", children: [
710
707
  /* @__PURE__ */ u("span", { className: "flex max-w-full items-center justify-center", children: [
711
- /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: k }),
708
+ /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: C }),
712
709
  /* @__PURE__ */ u("span", { className: "ml-2 flex gap-1", children: [
713
710
  R && /* @__PURE__ */ s(
714
711
  "span",
715
712
  {
716
713
  "aria-label": "Paid customer",
717
714
  className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
718
- children: /* @__PURE__ */ s(Rn, { className: "size-2.5", weight: "bold" })
715
+ children: /* @__PURE__ */ s(Ln, { className: "size-2.5", weight: "bold" })
719
716
  }
720
717
  ),
721
- a && S && /* @__PURE__ */ s(
718
+ a && E && /* @__PURE__ */ s(
722
719
  "span",
723
720
  {
724
721
  "aria-label": "Starred conversation",
@@ -738,7 +735,7 @@ const ne = ({
738
735
  ] }),
739
736
  r && /* @__PURE__ */ u("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
740
737
  /* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
741
- /* @__PURE__ */ s("span", { children: ma })
738
+ /* @__PURE__ */ s("span", { children: ha })
742
739
  ] })
743
740
  ] })
744
741
  ]
@@ -751,16 +748,16 @@ const ne = ({
751
748
  className: Ze,
752
749
  onClick: O,
753
750
  type: "button",
754
- "aria-pressed": S,
755
- "aria-label": S ? "Unstar conversation" : "Star conversation",
751
+ "aria-pressed": E,
752
+ "aria-label": E ? "Unstar conversation" : "Star conversation",
756
753
  children: /* @__PURE__ */ s(
757
754
  Ie,
758
755
  {
759
- className: y("size-5", {
760
- "text-[#FFD60A]": S,
761
- "text-black/90": !S
756
+ className: k("size-5", {
757
+ "text-[#FFD60A]": E,
758
+ "text-black/90": !E
762
759
  }),
763
- weight: S ? "fill" : "regular"
760
+ weight: E ? "fill" : "regular"
764
761
  }
765
762
  )
766
763
  }
@@ -786,7 +783,7 @@ const ne = ({
786
783
  ] })
787
784
  }
788
785
  );
789
- }, pa = (e) => /* @__PURE__ */ s(qs, { ...e, position: "center" }), lt = "vote_up", ot = "vote_down";
786
+ }, pa = (e) => /* @__PURE__ */ s(Ws, { ...e, position: "center" }), lt = "vote_up", ot = "vote_down";
790
787
  function ba(e) {
791
788
  return e != null && e.length ? e.some((t) => t.type === ot) ? "down" : e.some((t) => t.type === lt) ? "up" : null : null;
792
789
  }
@@ -820,7 +817,7 @@ function va(e) {
820
817
  function xa(e) {
821
818
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
822
819
  }
823
- function us({
820
+ function ms({
824
821
  message: e,
825
822
  viewerLanguage: t
826
823
  }) {
@@ -828,15 +825,15 @@ function us({
828
825
  const n = e == null ? void 0 : e.text, a = xa(t);
829
826
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
830
827
  }
831
- const wa = ["linktr.ee"], _a = "messaging-attachment-v1_0";
832
- function Na(e) {
828
+ const wa = ["linktr.ee"], Kt = "messaging-attachment-v1_0";
829
+ function _a(e) {
833
830
  try {
834
831
  return new URL(e).hostname.toLowerCase();
835
832
  } catch {
836
833
  return null;
837
834
  }
838
835
  }
839
- function ya(e) {
836
+ function Na(e) {
840
837
  return wa.some(
841
838
  (t) => e === t || e.endsWith(`.${t}`)
842
839
  );
@@ -844,13 +841,12 @@ function ya(e) {
844
841
  function he(e) {
845
842
  const t = e == null ? void 0 : e.trim();
846
843
  if (!t) return;
847
- const n = Na(t);
848
- if (!n || !ya(n) || /[?&]io=true(?:&|$)/.test(t) && /[?&]size=/.test(t))
849
- return t;
850
- const a = t.includes("?") ? "&" : "?";
851
- return `${t}${a}io=true&size=${_a}`;
844
+ const n = _a(t);
845
+ if (!n || !Na(n)) return t;
846
+ const a = new URL(t);
847
+ return a.searchParams.get("io") === "true" && a.searchParams.get("size") === Kt ? t : (a.searchParams.set("io", "true"), a.searchParams.set("size", Kt), a.toString());
852
848
  }
853
- const ka = [
849
+ const ya = [
854
850
  [/pdf/, "pdf"],
855
851
  [/wordprocessingml|msword|\.doc/, "doc"],
856
852
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -863,39 +859,39 @@ const ka = [
863
859
  function ce(e) {
864
860
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
865
861
  }
866
- function ms(e) {
867
- const t = ka.find(
862
+ function hs(e) {
863
+ const t = ya.find(
868
864
  ([n]) => n.test(e)
869
865
  );
870
866
  return t ? t[1] : "generic";
871
867
  }
872
- const Ca = {
873
- video: ls,
874
- audio: Dn,
875
- image: Ln,
876
- document: is
877
- }, Sa = {
878
- pdf: jn,
879
- doc: Un,
868
+ const ka = {
869
+ video: os,
870
+ audio: zn,
871
+ image: Dn,
872
+ document: ls
873
+ }, Ca = {
874
+ pdf: Vn,
875
+ doc: jn,
880
876
  xls: Bn,
881
- csv: $n,
882
- ppt: On,
883
- zip: Pn,
884
- text: Fn,
885
- markdown: zn,
886
- generic: is
877
+ csv: Un,
878
+ ppt: $n,
879
+ zip: On,
880
+ text: Pn,
881
+ markdown: Fn,
882
+ generic: ls
887
883
  };
888
- function Ea(e) {
884
+ function Sa(e) {
889
885
  const t = ce(e);
890
- return t !== "document" ? Ca[t] : Sa[ms(e)];
886
+ return t !== "document" ? ka[t] : Ca[hs(e)];
891
887
  }
892
888
  function _e(e, t) {
893
- return V.createElement(Ea(e), t);
889
+ return V.createElement(Sa(e), t);
894
890
  }
895
- const Ia = (e) => {
891
+ const Ea = (e) => {
896
892
  var t, n;
897
893
  return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
898
- }, Ta = ({
894
+ }, Ia = ({
899
895
  source: e,
900
896
  mimeType: t,
901
897
  poster: n,
@@ -907,7 +903,7 @@ const Ia = (e) => {
907
903
  muted: d = !1,
908
904
  onContainerClick: m
909
905
  }) => {
910
- const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = U(a), [p, _] = U(0), [w, k] = U(!1), [D, S] = U(!1), [R, O] = U(!1), [F, L] = U(!1), [C, E] = U(!0), [I, T] = U(null), M = J(() => {
906
+ const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = B(a), [p, _] = B(0), [w, C] = B(!1), [D, E] = B(!1), [R, O] = B(!1), [F, L] = B(!1), [S, I] = B(!0), [y, T] = B(null), M = J(() => {
911
907
  O(!1), x(!0);
912
908
  }, []), P = J((N) => {
913
909
  const A = g.current;
@@ -915,13 +911,13 @@ const Ia = (e) => {
915
911
  const H = A.getBoundingClientRect();
916
912
  return Math.max(
917
913
  0,
918
- Math.min(1, (Ia(N) - H.left) / H.width)
914
+ Math.min(1, (Ea(N) - H.left) / H.width)
919
915
  );
920
916
  }, []), $ = J((N) => {
921
917
  const A = h.current;
922
918
  A && A.duration && (A.currentTime = N * A.duration);
923
919
  }, []), j = (N) => {
924
- N.stopPropagation(), k(!0);
920
+ N.stopPropagation(), C(!0);
925
921
  const A = P(N);
926
922
  _(A), $(A);
927
923
  };
@@ -947,13 +943,13 @@ const Ia = (e) => {
947
943
  }, [v]), K(() => {
948
944
  if (!w) return;
949
945
  const N = (H) => _(P(H)), A = (H) => {
950
- k(!1), $(P(H));
946
+ C(!1), $(P(H));
951
947
  };
952
948
  return window.addEventListener("mousemove", N), window.addEventListener("mouseup", A), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", A), () => {
953
949
  window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", A), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", A);
954
950
  };
955
951
  }, [w, P, $]);
956
- const Q = I ? { aspectRatio: String(I) } : void 0, ee = I ? "" : " aspect-video", X = Math.round(p * 100);
952
+ const Q = y ? { aspectRatio: String(y) } : void 0, ee = y ? "" : " aspect-video", X = Math.round(p * 100);
957
953
  return /* @__PURE__ */ u(
958
954
  "div",
959
955
  {
@@ -978,7 +974,7 @@ const Ia = (e) => {
978
974
  }
979
975
  },
980
976
  children: [
981
- n && (f === "audio" || C) && /* @__PURE__ */ s(
977
+ n && (f === "audio" || S) && /* @__PURE__ */ s(
982
978
  "img",
983
979
  {
984
980
  src: n,
@@ -986,7 +982,7 @@ const Ia = (e) => {
986
982
  className: "absolute inset-0 h-full w-full object-cover"
987
983
  }
988
984
  ),
989
- !n && (f === "audio" || C) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: _e(t, {
985
+ !n && (f === "audio" || S) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: _e(t, {
990
986
  className: "size-12 text-black/20",
991
987
  weight: "regular"
992
988
  }) }),
@@ -1000,7 +996,7 @@ const Ia = (e) => {
1000
996
  style: { width: "100%", height: "100%" },
1001
997
  onLoadStart: () => L(!0),
1002
998
  onCanPlay: () => {
1003
- L(!1), E(!1);
999
+ L(!1), I(!1);
1004
1000
  },
1005
1001
  onWaiting: () => L(!0),
1006
1002
  onPlay: () => O(!1),
@@ -1020,7 +1016,7 @@ const Ia = (e) => {
1020
1016
  style: { width: "100%", height: "100%" },
1021
1017
  onLoadStart: () => L(!0),
1022
1018
  onCanPlay: () => {
1023
- L(!1), E(!1);
1019
+ L(!1), I(!1);
1024
1020
  },
1025
1021
  onWaiting: () => L(!0),
1026
1022
  onPlay: () => O(!1),
@@ -1093,7 +1089,7 @@ const Ia = (e) => {
1093
1089
  },
1094
1090
  className: "shrink-0 text-white",
1095
1091
  "aria-label": v ? "Pause" : "Play",
1096
- children: v ? /* @__PURE__ */ s(Vn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(rt, { className: "size-5 translate-x-px", weight: "fill" })
1092
+ children: v ? /* @__PURE__ */ s(Gn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(rt, { className: "size-5 translate-x-px", weight: "fill" })
1097
1093
  }
1098
1094
  ),
1099
1095
  /* @__PURE__ */ u(
@@ -1110,8 +1106,8 @@ const Ia = (e) => {
1110
1106
  onMouseDown: j,
1111
1107
  onTouchStart: j,
1112
1108
  onClick: (N) => N.stopPropagation(),
1113
- onMouseEnter: () => S(!0),
1114
- onMouseLeave: () => S(!1),
1109
+ onMouseEnter: () => E(!0),
1110
+ onMouseLeave: () => E(!1),
1115
1111
  onKeyDown: (N) => {
1116
1112
  N.key === "ArrowRight" && $(Math.min(1, p + 0.05)), N.key === "ArrowLeft" && $(Math.max(0, p - 0.05));
1117
1113
  },
@@ -1143,7 +1139,7 @@ const Ia = (e) => {
1143
1139
  ]
1144
1140
  }
1145
1141
  );
1146
- }, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ma = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", hs = ({
1142
+ }, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ta = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", fs = ({
1147
1143
  mimeType: e,
1148
1144
  sourceUrl: t,
1149
1145
  thumbnailUrl: n,
@@ -1152,9 +1148,9 @@ const Ia = (e) => {
1152
1148
  mediaPlayerProps: i,
1153
1149
  containedImage: o = !1
1154
1150
  }) => {
1155
- const l = ce(e), [d, m] = U(!1), f = he(t), h = he(n);
1151
+ const l = ce(e), [d, m] = B(!1), f = he(t), h = he(n);
1156
1152
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
1157
- Ta,
1153
+ Ia,
1158
1154
  {
1159
1155
  source: t,
1160
1156
  mimeType: e,
@@ -1201,11 +1197,11 @@ const Ia = (e) => {
1201
1197
  {
1202
1198
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1203
1199
  children: _e(e, {
1204
- className: Kt(r),
1200
+ className: Zt(r),
1205
1201
  weight: "regular"
1206
1202
  })
1207
1203
  }
1208
- ) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ma(r)}`, children: /* @__PURE__ */ s(
1204
+ ) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ta(r)}`, children: /* @__PURE__ */ s(
1209
1205
  "img",
1210
1206
  {
1211
1207
  src: h ?? n,
@@ -1218,12 +1214,12 @@ const Ia = (e) => {
1218
1214
  {
1219
1215
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1220
1216
  children: _e(e, {
1221
- className: Kt(r),
1217
+ className: Zt(r),
1222
1218
  weight: "regular"
1223
1219
  })
1224
1220
  }
1225
1221
  );
1226
- }, fs = ({
1222
+ }, gs = ({
1227
1223
  variant: e,
1228
1224
  thumbnail: t,
1229
1225
  title: n,
@@ -1243,7 +1239,7 @@ const Ia = (e) => {
1243
1239
  {
1244
1240
  ref: f,
1245
1241
  "data-testid": h,
1246
- className: y(
1242
+ className: k(
1247
1243
  "relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
1248
1244
  g ? "bg-[#1e2330]" : "bg-white"
1249
1245
  ),
@@ -1255,7 +1251,7 @@ const Ia = (e) => {
1255
1251
  c.trim() !== "" && /* @__PURE__ */ s(
1256
1252
  "p",
1257
1253
  {
1258
- className: y("mb-0.5 truncate text-base font-medium", {
1254
+ className: k("mb-0.5 truncate text-base font-medium", {
1259
1255
  "text-black": !g,
1260
1256
  "text-white/30": g && b,
1261
1257
  "text-white": g && !b
@@ -1265,7 +1261,7 @@ const Ia = (e) => {
1265
1261
  ),
1266
1262
  /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-1", children: [
1267
1263
  _e(r, {
1268
- className: y(
1264
+ className: k(
1269
1265
  "size-5 shrink-0",
1270
1266
  g ? "text-white/55" : "text-black/55"
1271
1267
  ),
@@ -1274,7 +1270,7 @@ const Ia = (e) => {
1274
1270
  i != null && i !== "" && /* @__PURE__ */ s(
1275
1271
  "span",
1276
1272
  {
1277
- className: y(
1273
+ className: k(
1278
1274
  "text-xs font-medium",
1279
1275
  g ? "text-white/55" : "text-black/55"
1280
1276
  ),
@@ -1289,25 +1285,25 @@ const Ia = (e) => {
1289
1285
  }
1290
1286
  );
1291
1287
  };
1292
- function gs(e) {
1288
+ function ps(e) {
1293
1289
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1294
1290
  }
1295
1291
  function ht(e) {
1296
1292
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#1e2330]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
1297
1293
  }
1298
- function Aa(e) {
1294
+ function Ma(e) {
1299
1295
  return e ? "bg-white/10" : "bg-black/5";
1300
1296
  }
1301
- function Ra(e) {
1297
+ function Aa(e) {
1302
1298
  return e ? "text-white" : "text-black";
1303
1299
  }
1304
- function La(e) {
1300
+ function Ra(e) {
1305
1301
  return e ? "text-white/55" : "text-black/55";
1306
1302
  }
1307
- function Da(e) {
1303
+ function La(e) {
1308
1304
  return e ? "text-white/40" : "text-black/40";
1309
1305
  }
1310
- function za(e) {
1306
+ function Da(e) {
1311
1307
  return e ? "text-white/20" : "text-black/20";
1312
1308
  }
1313
1309
  const ft = ({ attachment: e, isMyMessage: t }) => {
@@ -1322,26 +1318,26 @@ const ft = ({ attachment: e, isMyMessage: t }) => {
1322
1318
  ) : /* @__PURE__ */ s(
1323
1319
  "div",
1324
1320
  {
1325
- className: `aspect-video w-full rounded-[20px] ${Aa(t)} flex items-center justify-center`,
1326
- children: /* @__PURE__ */ s(Gn, { className: `size-12 ${za(t)}` })
1321
+ className: `aspect-video w-full rounded-[20px] ${Ma(t)} flex items-center justify-center`,
1322
+ children: /* @__PURE__ */ s(Hn, { className: `size-12 ${Da(t)}` })
1327
1323
  }
1328
1324
  ) }),
1329
1325
  /* @__PURE__ */ u("div", { className: "px-3 pb-3", children: [
1330
- n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Ra(t)}`, children: n }),
1331
- a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${La(t)}`, children: a }),
1332
- d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Da(t)}`, children: d })
1326
+ n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Aa(t)}`, children: n }),
1327
+ a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Ra(t)}`, children: a }),
1328
+ d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${La(t)}`, children: d })
1333
1329
  ] })
1334
1330
  ] });
1335
1331
  return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
1336
1332
  };
1337
- function ps(e) {
1333
+ function bs(e) {
1338
1334
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1339
1335
  }
1340
1336
  function gt(e) {
1341
1337
  var t;
1342
- return (t = e.attachments) == null ? void 0 : t.find(ps);
1338
+ return (t = e.attachments) == null ? void 0 : t.find(bs);
1343
1339
  }
1344
- async function Fa(e, t) {
1340
+ async function za(e, t) {
1345
1341
  let n;
1346
1342
  try {
1347
1343
  n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
@@ -1353,11 +1349,11 @@ async function Fa(e, t) {
1353
1349
  const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
1354
1350
  o.href = i, o.download = n, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
1355
1351
  }
1356
- const Pa = ({
1352
+ const Fa = ({
1357
1353
  url: e,
1358
1354
  filename: t
1359
1355
  }) => {
1360
- const [n, a] = U(!1);
1356
+ const [n, a] = B(!1);
1361
1357
  return /* @__PURE__ */ s(
1362
1358
  "button",
1363
1359
  {
@@ -1365,7 +1361,7 @@ const Pa = ({
1365
1361
  onClick: (i) => {
1366
1362
  i.stopPropagation();
1367
1363
  const o = window.open("", "_blank", "noopener,noreferrer");
1368
- a(!0), Fa(e, t).then(() => {
1364
+ a(!0), za(e, t).then(() => {
1369
1365
  o == null || o.close();
1370
1366
  }).catch(() => {
1371
1367
  o && (o.location.href = e);
@@ -1401,16 +1397,16 @@ function pt(e) {
1401
1397
  thumbnailUrl: f
1402
1398
  };
1403
1399
  }
1404
- const bs = ({
1400
+ const vs = ({
1405
1401
  resolvedUrl: e,
1406
1402
  resolvedType: t,
1407
1403
  title: n,
1408
1404
  fileSize: a,
1409
1405
  thumbnailUrl: r
1410
1406
  }) => {
1411
- const i = a !== void 0 ? gs(a) : void 0;
1407
+ const i = a !== void 0 ? ps(a) : void 0;
1412
1408
  return /* @__PURE__ */ s(
1413
- fs,
1409
+ gs,
1414
1410
  {
1415
1411
  variant: "dark",
1416
1412
  title: n,
@@ -1418,7 +1414,7 @@ const bs = ({
1418
1414
  mimeType: t,
1419
1415
  detail: i,
1420
1416
  thumbnail: /* @__PURE__ */ s(
1421
- hs,
1417
+ fs,
1422
1418
  {
1423
1419
  mimeType: t,
1424
1420
  sourceUrl: e,
@@ -1429,23 +1425,23 @@ const bs = ({
1429
1425
  )
1430
1426
  }
1431
1427
  );
1432
- }, vs = ({
1428
+ }, xs = ({
1433
1429
  resolvedUrl: e,
1434
1430
  resolvedType: t,
1435
1431
  title: n,
1436
1432
  fileSize: a,
1437
1433
  thumbnailUrl: r
1438
1434
  }) => {
1439
- const i = ce(t), o = a !== void 0 ? gs(a) : void 0;
1435
+ const i = ce(t), o = a !== void 0 ? ps(a) : void 0;
1440
1436
  return /* @__PURE__ */ s(
1441
- fs,
1437
+ gs,
1442
1438
  {
1443
1439
  variant: "light",
1444
1440
  title: n,
1445
1441
  mimeType: t,
1446
1442
  detail: o,
1447
1443
  thumbnail: /* @__PURE__ */ s(
1448
- hs,
1444
+ fs,
1449
1445
  {
1450
1446
  mimeType: t,
1451
1447
  sourceUrl: e,
@@ -1455,10 +1451,10 @@ const bs = ({
1455
1451
  containedImage: i === "image" || i === "document"
1456
1452
  }
1457
1453
  ),
1458
- action: /* @__PURE__ */ s(Pa, { url: e, filename: n })
1454
+ action: /* @__PURE__ */ s(Fa, { url: e, filename: n })
1459
1455
  }
1460
1456
  );
1461
- }, Oa = ({
1457
+ }, Pa = ({
1462
1458
  message: e,
1463
1459
  isMyMessage: t = !1
1464
1460
  }) => {
@@ -1484,41 +1480,41 @@ const bs = ({
1484
1480
  className: "str-chat__message-bubble",
1485
1481
  "data-attachment-bubble": "true",
1486
1482
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1487
- children: n ? /* @__PURE__ */ s("div", { className: ht(t), children: /* @__PURE__ */ s(ft, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(bs, { ...a }) : /* @__PURE__ */ s(vs, { ...a })
1483
+ children: n ? /* @__PURE__ */ s("div", { className: ht(t), children: /* @__PURE__ */ s(ft, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(vs, { ...a }) : /* @__PURE__ */ s(xs, { ...a })
1488
1484
  }
1489
1485
  ) })
1490
1486
  }
1491
1487
  )
1492
1488
  ] });
1493
- }, $a = ({
1489
+ }, Oa = ({
1494
1490
  message: e
1495
1491
  }) => {
1496
1492
  const t = gt(e);
1497
1493
  if (t)
1498
1494
  return /* @__PURE__ */ s("div", { className: ht(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !0 }) });
1499
1495
  const n = pt(e);
1500
- return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(bs, { ...n }) }) : null;
1501
- }, Ba = ({
1496
+ return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
1497
+ }, $a = ({
1502
1498
  message: e
1503
1499
  }) => {
1504
1500
  const t = gt(e);
1505
1501
  if (t)
1506
1502
  return /* @__PURE__ */ s("div", { className: ht(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !1 }) });
1507
1503
  const n = pt(e);
1508
- return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
1509
- }, fl = Object.assign(Oa, {
1510
- Creator: $a,
1511
- Visitor: Ba
1504
+ return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(xs, { ...n }) }) : null;
1505
+ }, hl = Object.assign(Pa, {
1506
+ Creator: Oa,
1507
+ Visitor: $a
1512
1508
  }), Ua = {
1513
1509
  dark: "bg-[#1e2330]",
1514
1510
  light: "bg-[#f2f1ef]"
1515
- }, ja = {
1511
+ }, Ba = {
1516
1512
  dark: "text-white",
1517
1513
  light: "text-[#000000]"
1518
- }, Va = {
1514
+ }, ja = {
1519
1515
  dark: "border-white/[0.08]",
1520
1516
  light: "border-black/[0.08]"
1521
- }, Ga = (e) => e === "dark" ? "sender" : "receiver", Ha = {
1517
+ }, Va = (e) => e === "dark" ? "sender" : "receiver", Ga = {
1522
1518
  sender: {
1523
1519
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
1524
1520
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -1540,13 +1536,13 @@ const bs = ({
1540
1536
  children: i,
1541
1537
  "data-testid": o
1542
1538
  }) => {
1543
- const l = t != null && t !== "", d = Ha[Ga(e)][a];
1539
+ const l = t != null && t !== "", d = Ga[Va(e)][a];
1544
1540
  return /* @__PURE__ */ u(
1545
1541
  "div",
1546
1542
  {
1547
1543
  "data-testid": o,
1548
1544
  "data-group-position": a,
1549
- className: y(
1545
+ className: k(
1550
1546
  // 280px-wide bubble — matches the mobile chat attachment width
1551
1547
  // and keeps the document / image / audio bubbles visually
1552
1548
  // consistent inside the conversation timeline. The 8px / 16px
@@ -1556,9 +1552,9 @@ const bs = ({
1556
1552
  "relative w-[280px] overflow-hidden px-2 py-2",
1557
1553
  d,
1558
1554
  Ua[e],
1559
- ja[e],
1555
+ Ba[e],
1560
1556
  n && "border",
1561
- n && Va[e],
1557
+ n && ja[e],
1562
1558
  r
1563
1559
  ),
1564
1560
  children: [
@@ -1566,7 +1562,7 @@ const bs = ({
1566
1562
  l ? /* @__PURE__ */ s(
1567
1563
  "p",
1568
1564
  {
1569
- className: y(
1565
+ className: k(
1570
1566
  // No `text-*` / `font-*` overrides here — caption inherits
1571
1567
  // the same font family + size as `.str-chat__message-text`
1572
1568
  // so it matches the surrounding `CustomMessage` bubbles.
@@ -1595,22 +1591,22 @@ const bs = ({
1595
1591
  a.stopPropagation(), e();
1596
1592
  },
1597
1593
  "aria-label": n,
1598
- className: y(
1594
+ className: k(
1599
1595
  "flex size-6 items-center justify-center rounded-full text-white",
1600
1596
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
1601
1597
  ),
1602
1598
  children: /* @__PURE__ */ s(Ge, { className: "size-3", weight: "bold" })
1603
1599
  }
1604
- ), Re = (e) => e === "received" ? "light" : "dark", Ya = ({
1600
+ ), Re = (e) => e === "received" ? "light" : "dark", Ha = ({
1605
1601
  firstOfGroup: e,
1606
1602
  endOfGroup: t,
1607
1603
  groupedByUser: n
1608
- }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", qa = ({
1604
+ }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ya = ({
1609
1605
  src: e,
1610
1606
  mimeType: t,
1611
1607
  filename: n,
1612
1608
  items: a
1613
- }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Wa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
1609
+ }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], qa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
1614
1610
  /* @__PURE__ */ s(
1615
1611
  "audio",
1616
1612
  {
@@ -1633,7 +1629,7 @@ const bs = ({
1633
1629
  preload: l,
1634
1630
  onDismiss: d
1635
1631
  }) => {
1636
- const m = Re(e), f = e === "composer" && !!d, h = qa({ src: t, mimeType: n, filename: a, items: r });
1632
+ const m = Re(e), f = e === "composer" && !!d, h = Ya({ src: t, mimeType: n, filename: a, items: r });
1637
1633
  if (h.length === 0)
1638
1634
  return null;
1639
1635
  const g = l ?? (h.length > 1 ? "none" : "metadata");
@@ -1645,7 +1641,7 @@ const bs = ({
1645
1641
  groupPosition: o,
1646
1642
  "data-testid": "audio-attachment",
1647
1643
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, b) => /* @__PURE__ */ s(
1648
- Wa,
1644
+ qa,
1649
1645
  {
1650
1646
  item: c,
1651
1647
  preload: g,
@@ -1659,15 +1655,15 @@ const bs = ({
1659
1655
  )) })
1660
1656
  }
1661
1657
  );
1662
- }, Xa = (e) => /* @__PURE__ */ s(bt, { ...e, state: "composer" }), Ka = (e) => /* @__PURE__ */ s(bt, { ...e, state: "sent" }), Za = (e) => /* @__PURE__ */ s(bt, { ...e, state: "received" }), Ja = {
1663
- Composer: Xa,
1664
- Sent: Ka,
1665
- Received: Za
1658
+ }, Wa = (e) => /* @__PURE__ */ s(bt, { ...e, state: "composer" }), Xa = (e) => /* @__PURE__ */ s(bt, { ...e, state: "sent" }), Ka = (e) => /* @__PURE__ */ s(bt, { ...e, state: "received" }), Za = {
1659
+ Composer: Wa,
1660
+ Sent: Xa,
1661
+ Received: Ka
1666
1662
  };
1667
- function Qa(e) {
1663
+ function Ja(e) {
1668
1664
  return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
1669
1665
  }
1670
- const er = {
1666
+ const Qa = {
1671
1667
  pdf: "PDF",
1672
1668
  doc: "DOC",
1673
1669
  xls: "XLS",
@@ -1677,7 +1673,7 @@ const er = {
1677
1673
  text: "TXT",
1678
1674
  markdown: "MD"
1679
1675
  };
1680
- function tr(e, t) {
1676
+ function er(e, t) {
1681
1677
  if (t) {
1682
1678
  const r = t.lastIndexOf(".");
1683
1679
  if (r > 0 && r < t.length - 1) {
@@ -1687,7 +1683,7 @@ function tr(e, t) {
1687
1683
  }
1688
1684
  if (!e) return;
1689
1685
  if (ce(e) === "document") {
1690
- const r = ms(e), i = er[r];
1686
+ const r = hs(e), i = Qa[r];
1691
1687
  if (i) return i;
1692
1688
  if (e === "application/octet-stream") return;
1693
1689
  }
@@ -1695,8 +1691,8 @@ function tr(e, t) {
1695
1691
  if (!(!a || a === "*"))
1696
1692
  return a.toUpperCase();
1697
1693
  }
1698
- function sr(e, t, n) {
1699
- const a = tr(e, t), r = typeof n == "number" && n > 0 ? Qa(n) : void 0;
1694
+ function tr(e, t, n) {
1695
+ const a = er(e, t), r = typeof n == "number" && n > 0 ? Ja(n) : void 0;
1700
1696
  return [a, r].filter(Boolean).join(" · ") || void 0;
1701
1697
  }
1702
1698
  function ie(e) {
@@ -1707,16 +1703,16 @@ function ie(e) {
1707
1703
  return "download";
1708
1704
  }
1709
1705
  }
1710
- const nr = {
1706
+ const sr = {
1711
1707
  dark: "text-white/55",
1712
1708
  light: "text-black/65"
1713
- }, ar = {
1709
+ }, nr = {
1714
1710
  dark: "bg-white/10",
1715
1711
  light: "bg-black/5"
1716
- }, rr = {
1712
+ }, ar = {
1717
1713
  dark: "text-white/85",
1718
1714
  light: "text-black/85"
1719
- }, xs = ({
1715
+ }, ws = ({
1720
1716
  variant: e,
1721
1717
  filename: t,
1722
1718
  title: n,
@@ -1726,16 +1722,16 @@ const nr = {
1726
1722
  activateLabel: o,
1727
1723
  trailingAction: l
1728
1724
  }) => {
1729
- const d = n ?? t ?? "File", m = sr(a, t, r), f = /* @__PURE__ */ s(
1725
+ const d = n ?? t ?? "File", m = tr(a, t, r), f = /* @__PURE__ */ s(
1730
1726
  "div",
1731
1727
  {
1732
- className: y(
1728
+ className: k(
1733
1729
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
1734
- ar[e]
1730
+ nr[e]
1735
1731
  ),
1736
1732
  "aria-hidden": !0,
1737
1733
  children: _e(a, {
1738
- className: y("size-6", rr[e]),
1734
+ className: k("size-6", ar[e]),
1739
1735
  weight: "regular"
1740
1736
  })
1741
1737
  }
@@ -1744,9 +1740,9 @@ const nr = {
1744
1740
  m ? /* @__PURE__ */ s(
1745
1741
  "p",
1746
1742
  {
1747
- className: y(
1743
+ className: k(
1748
1744
  "truncate text-xs leading-4",
1749
- nr[e]
1745
+ sr[e]
1750
1746
  ),
1751
1747
  children: m
1752
1748
  }
@@ -1757,7 +1753,7 @@ const nr = {
1757
1753
  type: "button",
1758
1754
  onClick: i,
1759
1755
  "aria-label": o,
1760
- className: y(
1756
+ className: k(
1761
1757
  "flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
1762
1758
  e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
1763
1759
  ),
@@ -1775,7 +1771,7 @@ const nr = {
1775
1771
  l ? /* @__PURE__ */ s("div", { className: "shrink-0", children: l }) : null
1776
1772
  ] });
1777
1773
  };
1778
- async function ws(e, t) {
1774
+ async function _s(e, t) {
1779
1775
  const n = t ?? ie(e);
1780
1776
  try {
1781
1777
  const a = await fetch(e, { mode: "cors" });
@@ -1789,14 +1785,14 @@ async function ws(e, t) {
1789
1785
  }
1790
1786
  }
1791
1787
  }
1792
- const ir = ({
1788
+ const rr = ({
1793
1789
  src: e,
1794
1790
  filename: t,
1795
1791
  fileSize: n,
1796
1792
  mimeType: a,
1797
1793
  title: r,
1798
1794
  items: i
1799
- }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], lr = ({
1795
+ }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], ir = ({
1800
1796
  variant: e,
1801
1797
  item: t,
1802
1798
  index: n,
@@ -1805,7 +1801,7 @@ const ir = ({
1805
1801
  }) => {
1806
1802
  const i = t.filename ?? ie(t.src);
1807
1803
  return /* @__PURE__ */ s(
1808
- xs,
1804
+ ws,
1809
1805
  {
1810
1806
  variant: e,
1811
1807
  filename: i,
@@ -1830,7 +1826,7 @@ const ir = ({
1830
1826
  onClick: m,
1831
1827
  onDismiss: f
1832
1828
  }) => {
1833
- const h = Re(e), g = e === "composer" && !!f, c = ir({
1829
+ const h = Re(e), g = e === "composer" && !!f, c = rr({
1834
1830
  src: t,
1835
1831
  filename: n,
1836
1832
  fileSize: a,
@@ -1842,14 +1838,14 @@ const ir = ({
1842
1838
  const p = c[x];
1843
1839
  if (!p) return;
1844
1840
  const _ = p.filename ?? ie(p.src);
1845
- ws(p.src, _);
1841
+ _s(p.src, _);
1846
1842
  };
1847
1843
  if (c.length === 0)
1848
1844
  return null;
1849
1845
  const v = /* @__PURE__ */ s(
1850
1846
  "span",
1851
1847
  {
1852
- className: y(
1848
+ className: k(
1853
1849
  "flex size-8 items-center justify-center rounded-full",
1854
1850
  h === "dark" ? "text-white/70" : "text-black/70"
1855
1851
  ),
@@ -1865,7 +1861,7 @@ const ir = ({
1865
1861
  groupPosition: d,
1866
1862
  "data-testid": "file-attachment",
1867
1863
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((x, p) => /* @__PURE__ */ s(
1868
- lr,
1864
+ ir,
1869
1865
  {
1870
1866
  variant: h,
1871
1867
  item: x,
@@ -1877,10 +1873,10 @@ const ir = ({
1877
1873
  )) })
1878
1874
  }
1879
1875
  );
1880
- }, or = (e) => /* @__PURE__ */ s(vt, { ...e, state: "composer" }), cr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "sent" }), dr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "received" }), ur = {
1881
- Composer: or,
1882
- Sent: cr,
1883
- Received: dr
1876
+ }, lr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "composer" }), or = (e) => /* @__PURE__ */ s(vt, { ...e, state: "sent" }), cr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "received" }), dr = {
1877
+ Composer: lr,
1878
+ Sent: or,
1879
+ Received: cr
1884
1880
  }, xt = ({
1885
1881
  onPrev: e,
1886
1882
  onNext: t,
@@ -1894,7 +1890,7 @@ const ir = ({
1894
1890
  onClick: e,
1895
1891
  "aria-label": n,
1896
1892
  className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
1897
- children: /* @__PURE__ */ s(Hn, { size: 20, weight: "bold", "aria-hidden": !0 })
1893
+ children: /* @__PURE__ */ s(Yn, { size: 20, weight: "bold", "aria-hidden": !0 })
1898
1894
  }
1899
1895
  ),
1900
1896
  /* @__PURE__ */ s(
@@ -1907,7 +1903,7 @@ const ir = ({
1907
1903
  children: /* @__PURE__ */ s(xe, { size: 20, weight: "bold", "aria-hidden": !0 })
1908
1904
  }
1909
1905
  )
1910
- ] }), _s = ({
1906
+ ] }), Ns = ({
1911
1907
  url: e,
1912
1908
  filename: t,
1913
1909
  variant: n = "pill",
@@ -1916,15 +1912,15 @@ const ir = ({
1916
1912
  tone: i = "dark",
1917
1913
  onTriggered: o
1918
1914
  }) => {
1919
- const [l, d] = U(!1), m = J(
1915
+ const [l, d] = B(!1), m = J(
1920
1916
  (c) => {
1921
- c.stopPropagation(), !l && (d(!0), ws(e, t).catch(() => {
1917
+ c.stopPropagation(), !l && (d(!0), _s(e, t).catch(() => {
1922
1918
  }).finally(() => {
1923
1919
  d(!1), o == null || o();
1924
1920
  }));
1925
1921
  },
1926
1922
  [l, e, t, o]
1927
- ), f = r ?? n !== "pill", g = { className: y(
1923
+ ), f = r ?? n !== "pill", g = { className: k(
1928
1924
  n === "pill" ? "size-4" : "size-5",
1929
1925
  "shrink-0"
1930
1926
  ), weight: "bold" };
@@ -1935,7 +1931,7 @@ const ir = ({
1935
1931
  onClick: m,
1936
1932
  disabled: l,
1937
1933
  "aria-label": a,
1938
- className: y(
1934
+ className: k(
1939
1935
  "flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
1940
1936
  {
1941
1937
  dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
@@ -1975,7 +1971,7 @@ const ir = ({
1975
1971
  onClick: m,
1976
1972
  disabled: l,
1977
1973
  "aria-label": f ? a : void 0,
1978
- className: y(
1974
+ className: k(
1979
1975
  "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
1980
1976
  i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
1981
1977
  ),
@@ -1997,7 +1993,7 @@ const ir = ({
1997
1993
  initialIndex: t,
1998
1994
  open: n
1999
1995
  }) => {
2000
- const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = U(a);
1996
+ const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
2001
1997
  K(() => {
2002
1998
  n && i(Je(t, 0, Math.max(e - 1, 0)));
2003
1999
  }, [n, t, e]), K(() => {
@@ -2107,7 +2103,7 @@ const ir = ({
2107
2103
  ]
2108
2104
  }
2109
2105
  );
2110
- }, Ns = ({
2106
+ }, ys = ({
2111
2107
  open: e,
2112
2108
  items: t,
2113
2109
  initialIndex: n = 0,
@@ -2129,7 +2125,7 @@ const ir = ({
2129
2125
  ariaLabel: d,
2130
2126
  counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
2131
2127
  actions: /* @__PURE__ */ s(
2132
- _s,
2128
+ Ns,
2133
2129
  {
2134
2130
  url: l.src,
2135
2131
  filename: d,
@@ -2163,7 +2159,7 @@ const ir = ({
2163
2159
  ]
2164
2160
  }
2165
2161
  ) : null;
2166
- }, mr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", ys = ({
2162
+ }, ur = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", ks = ({
2167
2163
  tiles: e,
2168
2164
  onTileActivate: t,
2169
2165
  maxVisible: n = 4,
@@ -2172,14 +2168,14 @@ const ir = ({
2172
2168
  const r = e.length;
2173
2169
  if (r === 0) return null;
2174
2170
  const i = e.slice(0, Math.min(r, n)), o = r - i.length, l = (d, m, f) => {
2175
- const h = y(mr, "h-full w-full");
2171
+ const h = k(ur, "h-full w-full");
2176
2172
  return t ? /* @__PURE__ */ u(
2177
2173
  "button",
2178
2174
  {
2179
2175
  type: "button",
2180
2176
  onClick: () => t(m),
2181
2177
  "aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
2182
- className: y(h, "cursor-zoom-in"),
2178
+ className: k(h, "cursor-zoom-in"),
2183
2179
  children: [
2184
2180
  d.content,
2185
2181
  f
@@ -2191,10 +2187,10 @@ const ir = ({
2191
2187
  f
2192
2188
  ] }, m);
2193
2189
  };
2194
- return i.length === 1 ? /* @__PURE__ */ s("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ s(
2190
+ return i.length === 1 ? /* @__PURE__ */ s("div", { className: k("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ s(
2195
2191
  "div",
2196
2192
  {
2197
- className: y(
2193
+ className: k(
2198
2194
  "grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
2199
2195
  a
2200
2196
  ),
@@ -2203,7 +2199,7 @@ const ir = ({
2203
2199
  ) : i.length === 3 ? /* @__PURE__ */ u(
2204
2200
  "div",
2205
2201
  {
2206
- className: y(
2202
+ className: k(
2207
2203
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
2208
2204
  a
2209
2205
  ),
@@ -2216,7 +2212,7 @@ const ir = ({
2216
2212
  ) : /* @__PURE__ */ s(
2217
2213
  "div",
2218
2214
  {
2219
- className: y(
2215
+ className: k(
2220
2216
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
2221
2217
  a
2222
2218
  ),
@@ -2234,14 +2230,14 @@ const ir = ({
2234
2230
  }
2235
2231
  );
2236
2232
  }, Le = (e) => {
2237
- const [t, n] = U(!1), [a, r] = U(0), i = J(
2233
+ const [t, n] = B(!1), [a, r] = B(0), i = J(
2238
2234
  (l) => {
2239
2235
  (e == null ? void 0 : e(l)) !== !1 && (r(l), n(!0));
2240
2236
  },
2241
2237
  [e]
2242
2238
  ), o = J(() => n(!1), []);
2243
2239
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
2244
- }, hr = (e, t, n, a) => ({
2240
+ }, mr = (e, t, n, a) => ({
2245
2241
  ariaLabel: `Open image ${t + 1} of ${n}`,
2246
2242
  content: /* @__PURE__ */ s(
2247
2243
  "img",
@@ -2256,15 +2252,15 @@ const ir = ({
2256
2252
  className: "absolute inset-0 size-full rounded-md object-cover"
2257
2253
  }
2258
2254
  )
2259
- }), fr = ({
2255
+ }), hr = ({
2260
2256
  src: e,
2261
2257
  alt: t,
2262
2258
  items: n
2263
- }) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], ks = (e, t) => e.map((n, a) => ({
2259
+ }) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Cs = (e, t) => e.map((n, a) => ({
2264
2260
  src: n.src,
2265
2261
  alt: n.alt,
2266
2262
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2267
- })), gr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2263
+ })), fr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2268
2264
  const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Le(
2269
2265
  r
2270
2266
  );
@@ -2291,16 +2287,16 @@ const ir = ({
2291
2287
  ),
2292
2288
  i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
2293
2289
  /* @__PURE__ */ s(
2294
- Ns,
2290
+ ys,
2295
2291
  {
2296
2292
  open: o,
2297
- items: ks([{ src: e, alt: t }], n),
2293
+ items: Cs([{ src: e, alt: t }], n),
2298
2294
  initialIndex: l,
2299
2295
  onClose: m
2300
2296
  }
2301
2297
  )
2302
2298
  ] });
2303
- }, Cs = ({
2299
+ }, Ss = ({
2304
2300
  state: e,
2305
2301
  src: t,
2306
2302
  alt: n,
@@ -2311,13 +2307,13 @@ const ir = ({
2311
2307
  loading: l = "lazy",
2312
2308
  onClick: d
2313
2309
  }) => {
2314
- const m = fr({ src: t, alt: n, items: r }), f = Re(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: b } = Le(
2310
+ const m = hr({ src: t, alt: n, items: r }), f = Re(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: b } = Le(
2315
2311
  d
2316
2312
  );
2317
2313
  if (m.length === 0)
2318
2314
  return null;
2319
2315
  const v = m.map(
2320
- (x, p) => hr(x, p, m.length, l)
2316
+ (x, p) => mr(x, p, m.length, l)
2321
2317
  );
2322
2318
  return /* @__PURE__ */ u(
2323
2319
  Me,
@@ -2327,12 +2323,12 @@ const ir = ({
2327
2323
  groupPosition: o,
2328
2324
  "data-testid": "image-attachment",
2329
2325
  children: [
2330
- /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(ys, { tiles: v, onTileActivate: c }) }),
2326
+ /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(ks, { tiles: v, onTileActivate: c }) }),
2331
2327
  /* @__PURE__ */ s(
2332
- Ns,
2328
+ ys,
2333
2329
  {
2334
2330
  open: h,
2335
- items: ks(m, a),
2331
+ items: Cs(m, a),
2336
2332
  initialIndex: g,
2337
2333
  onClose: b
2338
2334
  }
@@ -2340,11 +2336,11 @@ const ir = ({
2340
2336
  ]
2341
2337
  }
2342
2338
  );
2343
- }, pr = (e) => /* @__PURE__ */ s(gr, { ...e }), br = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "sent" }), vr = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "received" }), xr = {
2344
- Composer: pr,
2345
- Sent: br,
2346
- Received: vr
2347
- }, wr = ({
2339
+ }, gr = (e) => /* @__PURE__ */ s(fr, { ...e }), pr = (e) => /* @__PURE__ */ s(Ss, { ...e, state: "sent" }), br = (e) => /* @__PURE__ */ s(Ss, { ...e, state: "received" }), vr = {
2340
+ Composer: gr,
2341
+ Sent: pr,
2342
+ Received: br
2343
+ }, xr = ({
2348
2344
  open: e,
2349
2345
  items: t,
2350
2346
  initialIndex: n = 0,
@@ -2358,7 +2354,7 @@ const ir = ({
2358
2354
  () => (l == null ? void 0 : l.filename) ?? (l ? ie(l.src) : "document"),
2359
2355
  [l]
2360
2356
  ), m = re(
2361
- () => l ? _r(l.src) : void 0,
2357
+ () => l ? wr(l.src) : void 0,
2362
2358
  [l]
2363
2359
  );
2364
2360
  return !l || !m ? null : /* @__PURE__ */ u(
@@ -2392,16 +2388,16 @@ const ir = ({
2392
2388
  ]
2393
2389
  }
2394
2390
  );
2395
- }, _r = (e) => {
2391
+ }, wr = (e) => {
2396
2392
  const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
2397
2393
  return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
2398
- }, Nr = ({
2394
+ }, _r = ({
2399
2395
  src: e,
2400
2396
  filename: t,
2401
2397
  fileSize: n,
2402
2398
  title: a,
2403
2399
  items: r
2404
- }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], yr = ({
2400
+ }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], Nr = ({
2405
2401
  variant: e,
2406
2402
  item: t,
2407
2403
  index: n,
@@ -2410,7 +2406,7 @@ const ir = ({
2410
2406
  }) => {
2411
2407
  const i = t.filename ?? ie(t.src);
2412
2408
  return /* @__PURE__ */ s(
2413
- xs,
2409
+ ws,
2414
2410
  {
2415
2411
  variant: e,
2416
2412
  filename: i,
@@ -2434,7 +2430,7 @@ const ir = ({
2434
2430
  onClick: d,
2435
2431
  onDismiss: m
2436
2432
  }) => {
2437
- const f = Re(e), h = Nr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
2433
+ const f = Re(e), h = _r({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
2438
2434
  d
2439
2435
  ), x = e === "composer" && !!m;
2440
2436
  if (h.length === 0)
@@ -2452,18 +2448,18 @@ const ir = ({
2452
2448
  "data-testid": "pdf-attachment",
2453
2449
  children: [
2454
2450
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((_, w) => {
2455
- const k = _.filename ?? ie(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2456
- _s,
2451
+ const C = _.filename ?? ie(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2452
+ Ns,
2457
2453
  {
2458
2454
  url: _.src,
2459
- filename: k,
2455
+ filename: C,
2460
2456
  variant: "inline",
2461
- label: `Download ${k}`,
2457
+ label: `Download ${C}`,
2462
2458
  tone: f
2463
2459
  }
2464
2460
  );
2465
2461
  return /* @__PURE__ */ s(
2466
- yr,
2462
+ Nr,
2467
2463
  {
2468
2464
  variant: f,
2469
2465
  item: _,
@@ -2475,7 +2471,7 @@ const ir = ({
2475
2471
  );
2476
2472
  }) }),
2477
2473
  /* @__PURE__ */ s(
2478
- wr,
2474
+ xr,
2479
2475
  {
2480
2476
  open: g,
2481
2477
  items: p,
@@ -2486,11 +2482,11 @@ const ir = ({
2486
2482
  ]
2487
2483
  }
2488
2484
  );
2489
- }, kr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "composer" }), Cr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "received" }), Er = {
2490
- Composer: kr,
2491
- Sent: Cr,
2492
- Received: Sr
2493
- }, Ss = ({
2485
+ }, yr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "composer" }), kr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "sent" }), Cr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "received" }), Sr = {
2486
+ Composer: yr,
2487
+ Sent: kr,
2488
+ Received: Cr
2489
+ }, Es = ({
2494
2490
  open: e,
2495
2491
  items: t,
2496
2492
  initialIndex: n = 0,
@@ -2540,7 +2536,7 @@ const ir = ({
2540
2536
  ]
2541
2537
  }
2542
2538
  ) : null;
2543
- }, Ir = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(rt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Es = ({
2539
+ }, Er = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(rt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Is = ({
2544
2540
  item: e,
2545
2541
  index: t
2546
2542
  }) => /* @__PURE__ */ u("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -2555,30 +2551,30 @@ const ir = ({
2555
2551
  className: "absolute inset-0 size-full rounded-md object-cover"
2556
2552
  }
2557
2553
  ) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
2558
- ls,
2554
+ os,
2559
2555
  {
2560
2556
  className: "size-16 rounded-md text-white/30",
2561
2557
  weight: "regular",
2562
2558
  "aria-hidden": !0
2563
2559
  }
2564
2560
  ) }),
2565
- /* @__PURE__ */ s(Ir, {})
2566
- ] }), Tr = (e, t, n) => ({
2561
+ /* @__PURE__ */ s(Er, {})
2562
+ ] }), Ir = (e, t, n) => ({
2567
2563
  ariaLabel: `Play video ${t + 1} of ${n}`,
2568
- content: /* @__PURE__ */ s(Es, { item: e, index: t })
2569
- }), Mr = ({
2564
+ content: /* @__PURE__ */ s(Is, { item: e, index: t })
2565
+ }), Tr = ({
2570
2566
  src: e,
2571
2567
  poster: t,
2572
2568
  mimeType: n,
2573
2569
  preload: a,
2574
2570
  items: r
2575
- }) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Is = (e, t) => e.map((n, a) => ({
2571
+ }) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Ts = (e, t) => e.map((n, a) => ({
2576
2572
  src: n.src,
2577
2573
  poster: n.poster,
2578
2574
  mimeType: n.mimeType,
2579
2575
  preload: n.preload,
2580
2576
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2581
- })), Ar = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: o }) => {
2577
+ })), Mr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: o }) => {
2582
2578
  const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: f } = Le(
2583
2579
  i
2584
2580
  );
@@ -2590,15 +2586,15 @@ const ir = ({
2590
2586
  onClick: () => m(0),
2591
2587
  "aria-label": "Play video",
2592
2588
  className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
2593
- children: /* @__PURE__ */ s(Es, { item: { src: e, poster: t, mimeType: n }, index: 0 })
2589
+ children: /* @__PURE__ */ s(Is, { item: { src: e, poster: t, mimeType: n }, index: 0 })
2594
2590
  }
2595
2591
  ),
2596
2592
  o ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: o }) }) : null,
2597
2593
  /* @__PURE__ */ s(
2598
- Ss,
2594
+ Es,
2599
2595
  {
2600
2596
  open: l,
2601
- items: Is(
2597
+ items: Ts(
2602
2598
  [{ src: e, poster: t, mimeType: n, preload: r }],
2603
2599
  a
2604
2600
  ),
@@ -2607,7 +2603,7 @@ const ir = ({
2607
2603
  }
2608
2604
  )
2609
2605
  ] });
2610
- }, Ts = ({
2606
+ }, Ms = ({
2611
2607
  state: e,
2612
2608
  src: t,
2613
2609
  poster: n,
@@ -2619,13 +2615,13 @@ const ir = ({
2619
2615
  preload: d,
2620
2616
  onClick: m
2621
2617
  }) => {
2622
- const f = Mr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Re(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
2618
+ const f = Tr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Re(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
2623
2619
  m
2624
2620
  );
2625
2621
  if (f.length === 0)
2626
2622
  return null;
2627
2623
  const x = f.map(
2628
- (p, _) => Tr(p, _, f.length)
2624
+ (p, _) => Ir(p, _, f.length)
2629
2625
  );
2630
2626
  return /* @__PURE__ */ u(
2631
2627
  Me,
@@ -2636,7 +2632,7 @@ const ir = ({
2636
2632
  "data-testid": "video-attachment",
2637
2633
  children: [
2638
2634
  /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
2639
- ys,
2635
+ ks,
2640
2636
  {
2641
2637
  tiles: x,
2642
2638
  onTileActivate: b,
@@ -2644,10 +2640,10 @@ const ir = ({
2644
2640
  }
2645
2641
  ) }),
2646
2642
  /* @__PURE__ */ s(
2647
- Ss,
2643
+ Es,
2648
2644
  {
2649
2645
  open: g,
2650
- items: Is(f, r),
2646
+ items: Ts(f, r),
2651
2647
  initialIndex: c,
2652
2648
  onClose: v
2653
2649
  }
@@ -2655,31 +2651,31 @@ const ir = ({
2655
2651
  ]
2656
2652
  }
2657
2653
  );
2658
- }, Rr = (e) => /* @__PURE__ */ s(Ar, { ...e }), Lr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "sent" }), Dr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "received" }), zr = {
2659
- Composer: Rr,
2660
- Sent: Lr,
2661
- Received: Dr
2654
+ }, Ar = (e) => /* @__PURE__ */ s(Mr, { ...e }), Rr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "sent" }), Lr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "received" }), Dr = {
2655
+ Composer: Ar,
2656
+ Sent: Rr,
2657
+ Received: Lr
2662
2658
  }, ke = {
2663
- Image: xr,
2664
- Video: zr,
2665
- Audio: Ja,
2666
- Pdf: Er,
2667
- File: ur
2668
- }, Fr = {
2659
+ Image: vr,
2660
+ Video: Dr,
2661
+ Audio: Za,
2662
+ Pdf: Sr,
2663
+ File: dr
2664
+ }, zr = {
2669
2665
  isUnlocking: () => !1
2670
- }, Pr = {
2671
- LockedAttachment: Fr
2672
- }, Ms = ct({}), gl = Ms.Provider;
2673
- function Or(e) {
2674
- return Te(Ms)[e] ?? Pr[e];
2666
+ }, Fr = {
2667
+ LockedAttachment: zr
2668
+ }, As = ct({}), fl = As.Provider;
2669
+ function Pr(e) {
2670
+ return Te(As)[e] ?? Fr[e];
2675
2671
  }
2676
- const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import("./Card-dFpcKsyN.js")), Ur = () => /* @__PURE__ */ s(
2672
+ const Or = V.lazy(() => import("./Card-qS17qnN0.js")), $r = V.lazy(() => import("./Card-B-Sn9hc8.js")), Ur = () => /* @__PURE__ */ s(
2677
2673
  "div",
2678
2674
  {
2679
2675
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
2680
2676
  "aria-hidden": !0
2681
2677
  }
2682
- ), Pe = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Ur, {}), children: e.contentType === "text" ? /* @__PURE__ */ s($r, { ...e }) : /* @__PURE__ */ s(Br, { ...e }) }), jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
2678
+ ), Pe = (e) => /* @__PURE__ */ s(Gs, { fallback: /* @__PURE__ */ s(Ur, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Or, { ...e }) : /* @__PURE__ */ s($r, { ...e }) }), Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
2683
2679
  "svg",
2684
2680
  {
2685
2681
  width: e,
@@ -2696,27 +2692,27 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2696
2692
  }
2697
2693
  )
2698
2694
  }
2699
- ), Vr = (e) => {
2695
+ ), jr = (e) => {
2700
2696
  var t;
2701
2697
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
2702
- }, Gr = (e) => {
2698
+ }, Vr = (e) => {
2703
2699
  var t;
2704
2700
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
2705
- }, Be = (e) => {
2701
+ }, Ue = (e) => {
2706
2702
  var t;
2707
2703
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
2708
2704
  }, yt = (e) => {
2709
2705
  var t;
2710
2706
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
2711
- }, Hr = (e) => {
2707
+ }, Gr = (e) => {
2712
2708
  var t;
2713
2709
  return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
2714
- }, Yr = (e) => {
2710
+ }, Hr = (e) => {
2715
2711
  var t;
2716
2712
  return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
2717
- }, As = (e) => Vr(e) || Gr(e), qr = (e) => {
2713
+ }, Rs = (e) => jr(e) || Vr(e), Yr = (e) => {
2718
2714
  var t;
2719
- return As(e) && !((t = e.text) != null && t.trim());
2715
+ return Rs(e) && !((t = e.text) != null && t.trim());
2720
2716
  }, Qe = ({
2721
2717
  message: e,
2722
2718
  standalone: t = !1,
@@ -2724,7 +2720,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2724
2720
  hasAttachment: a = !1
2725
2721
  }) => {
2726
2722
  var h;
2727
- const r = As(e), i = Be(e);
2723
+ const r = Rs(e), i = Ue(e);
2728
2724
  if (!r && !i)
2729
2725
  return null;
2730
2726
  if (r) {
@@ -2732,7 +2728,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2732
2728
  if (!g) return null;
2733
2729
  const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${g} tip` : `Delivered with ${g} tip`;
2734
2730
  return /* @__PURE__ */ u("div", { className: c, children: [
2735
- /* @__PURE__ */ s(Yn, { size: t ? 14 : 12 }),
2731
+ /* @__PURE__ */ s(qn, { size: t ? 14 : 12 }),
2736
2732
  /* @__PURE__ */ s("span", { children: b })
2737
2733
  ] });
2738
2734
  }
@@ -2740,7 +2736,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2740
2736
  "message-chatbot-indicator",
2741
2737
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
2742
2738
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
2743
- ].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(jr, { size: o ? 12 : 15 }) });
2739
+ ].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(Br, { size: o ? 12 : 15 }) });
2744
2740
  return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ u(se, { children: [
2745
2741
  m,
2746
2742
  f
@@ -2748,7 +2744,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2748
2744
  f,
2749
2745
  m
2750
2746
  ] }) });
2751
- }, Wr = ({
2747
+ }, qr = ({
2752
2748
  selected: e,
2753
2749
  onVoteUp: t,
2754
2750
  onVoteDown: n
@@ -2757,28 +2753,28 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2757
2753
  "button",
2758
2754
  {
2759
2755
  type: "button",
2760
- className: y("message-vote-button focus-ring", {
2756
+ className: k("message-vote-button focus-ring", {
2761
2757
  "message-vote-button--selected": e === "up"
2762
2758
  }),
2763
2759
  onClick: t,
2764
2760
  "aria-label": "Good response",
2765
2761
  "aria-pressed": e === "up",
2766
2762
  "data-tooltip": "Good response",
2767
- children: /* @__PURE__ */ s(qn, { size: 16, weight: e === "up" ? "fill" : "regular" })
2763
+ children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "up" ? "fill" : "regular" })
2768
2764
  }
2769
2765
  ),
2770
2766
  /* @__PURE__ */ s(
2771
2767
  "button",
2772
2768
  {
2773
2769
  type: "button",
2774
- className: y("message-vote-button focus-ring", {
2770
+ className: k("message-vote-button focus-ring", {
2775
2771
  "message-vote-button--selected": e === "down"
2776
2772
  }),
2777
2773
  onClick: n,
2778
2774
  "aria-label": "Bad response",
2779
2775
  "aria-pressed": e === "down",
2780
2776
  "data-tooltip": "Bad response",
2781
- children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "down" ? "fill" : "regular" })
2777
+ children: /* @__PURE__ */ s(Xn, { size: 16, weight: e === "down" ? "fill" : "regular" })
2782
2778
  }
2783
2779
  )
2784
2780
  ] }), et = () => {
@@ -2791,36 +2787,36 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2791
2787
  }
2792
2788
  })();
2793
2789
  return e.id !== n ? null : /* @__PURE__ */ u(se, { children: [
2794
- /* @__PURE__ */ s(Xn, { weight: "bold", "aria-hidden": "true" }),
2790
+ /* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
2795
2791
  /* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
2796
2792
  ] });
2797
- }, Xr = () => null, Kr = () => /* @__PURE__ */ s(
2798
- Ws,
2793
+ }, Wr = () => null, Xr = () => /* @__PURE__ */ s(
2794
+ Xs,
2799
2795
  {
2800
2796
  MessageSentStatus: et,
2801
2797
  MessageDeliveredStatus: et,
2802
2798
  MessageReadStatus: et,
2803
- MessageSendingStatus: Xr
2799
+ MessageSendingStatus: Wr
2804
2800
  }
2805
- ), Zr = /^([a-z][a-z0-9+.-]*):/i, Jr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2801
+ ), Kr = /^([a-z][a-z0-9+.-]*):/i, Zr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2806
2802
  function kt(e) {
2807
2803
  if (typeof e != "string") return;
2808
2804
  const t = e.trim();
2809
2805
  if (t === "") return;
2810
- const n = Zr.exec(t);
2806
+ const n = Kr.exec(t);
2811
2807
  if (n) {
2812
2808
  const a = n[1].toLowerCase();
2813
- return Jr.has(a) ? t : void 0;
2809
+ return Zr.has(a) ? t : void 0;
2814
2810
  }
2815
2811
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
2816
2812
  }
2817
- const Qr = {
2813
+ const Jr = {
2818
2814
  dark: "bg-white text-[#121110] hover:bg-white/90",
2819
2815
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2820
- }, ei = ({ variant: e, cta: t }) => {
2821
- const n = y(
2816
+ }, Qr = ({ variant: e, cta: t }) => {
2817
+ const n = k(
2822
2818
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2823
- Qr[e]
2819
+ Jr[e]
2824
2820
  ), a = kt(t.href);
2825
2821
  return a ? /* @__PURE__ */ s(
2826
2822
  "a",
@@ -2847,10 +2843,10 @@ const Qr = {
2847
2843
  children: t.label
2848
2844
  }
2849
2845
  );
2850
- }, ti = {
2846
+ }, ei = {
2851
2847
  dark: "text-white",
2852
2848
  light: "text-black/90"
2853
- }, si = "text-white/30", ni = {
2849
+ }, ti = "text-white/30", si = {
2854
2850
  dark: "text-white/55",
2855
2851
  light: "text-black/55"
2856
2852
  }, Ct = ({
@@ -2865,12 +2861,12 @@ const Qr = {
2865
2861
  }) => {
2866
2862
  const d = e === "dark", m = t ?? (d ? n : void 0) ?? "", f = m.trim() !== "", h = a != null && a.trim() !== "", g = typeof r == "string" ? r.trim() : "", c = g !== "", b = o != null;
2867
2863
  if (!f && !h && !c && !b) return null;
2868
- const x = y(
2864
+ const x = k(
2869
2865
  "truncate text-base font-medium leading-6",
2870
- d && !t ? si : ti[e]
2871
- ), p = y(
2866
+ d && !t ? ti : ei[e]
2867
+ ), p = k(
2872
2868
  "truncate text-xs leading-4",
2873
- ni[e]
2869
+ si[e]
2874
2870
  );
2875
2871
  return /* @__PURE__ */ u("div", { className: "px-4 py-3", children: [
2876
2872
  /* @__PURE__ */ u("div", { className: "flex items-end gap-3", children: [
@@ -2878,7 +2874,7 @@ const Qr = {
2878
2874
  /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-col gap-1", children: [
2879
2875
  f && /* @__PURE__ */ u("div", { className: "flex min-w-0 items-center gap-2", children: [
2880
2876
  i ? /* @__PURE__ */ s("span", { className: "shrink-0", children: i }) : null,
2881
- /* @__PURE__ */ s("p", { className: y("min-w-0", x), children: m })
2877
+ /* @__PURE__ */ s("p", { className: k("min-w-0", x), children: m })
2882
2878
  ] }),
2883
2879
  h && /* @__PURE__ */ s("p", { className: p, children: a })
2884
2880
  ] }),
@@ -2886,16 +2882,16 @@ const Qr = {
2886
2882
  ] }),
2887
2883
  l && /* @__PURE__ */ s("div", { className: "shrink-0", children: l })
2888
2884
  ] }),
2889
- o && /* @__PURE__ */ s(ei, { variant: e, cta: o })
2885
+ o && /* @__PURE__ */ s(Qr, { variant: e, cta: o })
2890
2886
  ] });
2891
- }, ai = y(
2887
+ }, ni = k(
2892
2888
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2893
2889
  // 1px hairline border that sits flush with the card chrome — matches
2894
2890
  // the messaging design system's "small border around link attachments"
2895
2891
  // treatment from the mobile spec. The drop shadow remains for depth.
2896
2892
  "border border-black/[0.08]",
2897
2893
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2898
- ), Ue = ({
2894
+ ), Be = ({
2899
2895
  variant: e,
2900
2896
  children: t,
2901
2897
  href: n,
@@ -2906,8 +2902,8 @@ const Qr = {
2906
2902
  bgClassName: l,
2907
2903
  "data-testid": d
2908
2904
  }) => {
2909
- const m = n != null || a != null, f = y(
2910
- ai,
2905
+ const m = n != null || a != null, f = k(
2906
+ ni,
2911
2907
  l ?? (e === "dark" ? "bg-[#1e2330]" : "bg-white"),
2912
2908
  // `focus-ring` is a design-system utility from the component-library
2913
2909
  // tailwind preset — outline-none + a black 2px focus-visible ring
@@ -2937,7 +2933,7 @@ const Qr = {
2937
2933
  onClick: a,
2938
2934
  "aria-label": r,
2939
2935
  "data-testid": d,
2940
- className: y(f, "text-left"),
2936
+ className: k(f, "text-left"),
2941
2937
  children: [
2942
2938
  t,
2943
2939
  h
@@ -2955,10 +2951,10 @@ const Qr = {
2955
2951
  ]
2956
2952
  }
2957
2953
  );
2958
- }, ri = {
2954
+ }, ai = {
2959
2955
  dark: "bg-white/10",
2960
2956
  light: "bg-black/5"
2961
- }, ii = {
2957
+ }, ri = {
2962
2958
  dark: "size-16 text-white/25",
2963
2959
  light: "size-16 text-black/25"
2964
2960
  }, Ye = (e, t) => !!t && !!e && ce(e) === "audio", St = (e, t) => {
@@ -2987,7 +2983,7 @@ const Qr = {
2987
2983
  ) }) : /* @__PURE__ */ u(
2988
2984
  "div",
2989
2985
  {
2990
- className: y(
2986
+ className: k(
2991
2987
  "relative h-[180px] w-full overflow-hidden",
2992
2988
  d && "bg-black"
2993
2989
  ),
@@ -3014,12 +3010,12 @@ const Qr = {
3014
3010
  ) : /* @__PURE__ */ s(
3015
3011
  "div",
3016
3012
  {
3017
- className: y(
3013
+ className: k(
3018
3014
  "flex h-full w-full items-center justify-center",
3019
- ri[e]
3015
+ ai[e]
3020
3016
  ),
3021
3017
  children: _e(r, {
3022
- className: ii[e],
3018
+ className: ri[e],
3023
3019
  weight: "regular"
3024
3020
  })
3025
3021
  }
@@ -3029,7 +3025,7 @@ const Qr = {
3029
3025
  ]
3030
3026
  }
3031
3027
  );
3032
- }, li = ({
3028
+ }, ii = ({
3033
3029
  title: e,
3034
3030
  placeholderTitle: t,
3035
3031
  description: n,
@@ -3059,10 +3055,10 @@ const Qr = {
3059
3055
  onClick: h,
3060
3056
  "aria-label": "Edit attachment",
3061
3057
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
3062
- children: /* @__PURE__ */ s(Kn, { className: "size-5", weight: "regular" })
3058
+ children: /* @__PURE__ */ s(Zn, { className: "size-5", weight: "regular" })
3063
3059
  }
3064
3060
  ) : void 0;
3065
- return c ? /* @__PURE__ */ s(Ue, { variant: "dark", bgClassName: Et, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
3061
+ return c ? /* @__PURE__ */ s(Be, { variant: "dark", bgClassName: Et, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
3066
3062
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
3067
3063
  je,
3068
3064
  {
@@ -3074,7 +3070,7 @@ const Qr = {
3074
3070
  ) }),
3075
3071
  b && /* @__PURE__ */ s("div", { className: "shrink-0", children: b })
3076
3072
  ] }) }) : /* @__PURE__ */ u(
3077
- Ue,
3073
+ Be,
3078
3074
  {
3079
3075
  variant: "dark",
3080
3076
  topRight: g ? b : void 0,
@@ -3106,7 +3102,7 @@ const Qr = {
3106
3102
  ]
3107
3103
  }
3108
3104
  );
3109
- }, oi = ({
3105
+ }, li = ({
3110
3106
  title: e,
3111
3107
  description: t,
3112
3108
  url: n,
@@ -3126,7 +3122,7 @@ const Qr = {
3126
3122
  }
3127
3123
  } : d;
3128
3124
  return /* @__PURE__ */ u(
3129
- Ue,
3125
+ Be,
3130
3126
  {
3131
3127
  variant: "light",
3132
3128
  href: g,
@@ -3159,7 +3155,7 @@ const Qr = {
3159
3155
  ]
3160
3156
  }
3161
3157
  );
3162
- }, ci = ({
3158
+ }, oi = ({
3163
3159
  title: e,
3164
3160
  placeholderTitle: t,
3165
3161
  description: n,
@@ -3174,7 +3170,7 @@ const Qr = {
3174
3170
  }) => {
3175
3171
  const h = St(r, o), g = kt(a), c = m == null && g != null && !h ? g : void 0, b = m == null && !h && c != null ? f : void 0;
3176
3172
  return /* @__PURE__ */ u(
3177
- Ue,
3173
+ Be,
3178
3174
  {
3179
3175
  variant: "dark",
3180
3176
  href: c,
@@ -3206,22 +3202,22 @@ const Qr = {
3206
3202
  ]
3207
3203
  }
3208
3204
  );
3209
- }, Zt = {
3210
- Composer: li,
3211
- Sent: ci,
3212
- Received: oi
3205
+ }, Jt = {
3206
+ Composer: ii,
3207
+ Sent: oi,
3208
+ Received: li
3213
3209
  };
3214
3210
  function z(e) {
3215
3211
  const t = e == null ? void 0 : e.trim();
3216
3212
  return t || void 0;
3217
3213
  }
3218
- function Jt(e) {
3214
+ function Qt(e) {
3219
3215
  return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
3220
3216
  }
3221
- function di(e, t) {
3217
+ function ci(e, t) {
3222
3218
  if (!(e != null && e.trim()) || !(t != null && t.trim()))
3223
3219
  return !1;
3224
- const n = Jt(e), a = Jt(t);
3220
+ const n = Qt(e), a = Qt(t);
3225
3221
  if (n === a)
3226
3222
  return !0;
3227
3223
  if (!n.includes(a))
@@ -3229,7 +3225,7 @@ function di(e, t) {
3229
3225
  const r = n.split(a).join("");
3230
3226
  return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
3231
3227
  }
3232
- function Qt(e) {
3228
+ function es(e) {
3233
3229
  const t = z(e.og_scrape_url) ?? z(e.title_link), n = z(e.image_url) ?? z(e.thumb_url), a = z(e.asset_url), r = z(e.mime_type);
3234
3230
  return {
3235
3231
  title: z(e.title),
@@ -3243,15 +3239,15 @@ function Qt(e) {
3243
3239
  mimeType: r
3244
3240
  };
3245
3241
  }
3246
- function ui(e) {
3242
+ function di(e) {
3247
3243
  var t;
3248
- return Rs(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
3244
+ return Ls(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
3249
3245
  }
3250
- function Rs(e) {
3246
+ function Ls(e) {
3251
3247
  const t = z(e.og_scrape_url);
3252
3248
  return e.type === "link" || !!t && !e.asset_url;
3253
3249
  }
3254
- function Ls(e) {
3250
+ function Ds(e) {
3255
3251
  if (!(e != null && e.length)) return [];
3256
3252
  const t = [], n = (r, i) => {
3257
3253
  const o = t[t.length - 1];
@@ -3269,25 +3265,25 @@ function Ls(e) {
3269
3265
  t.push({ type: "link", attachments: [r] });
3270
3266
  };
3271
3267
  for (const r of e) {
3272
- if (Rs(r)) {
3268
+ if (Ls(r)) {
3273
3269
  a(r);
3274
3270
  continue;
3275
3271
  }
3276
- const i = ui(r);
3272
+ const i = di(r);
3277
3273
  i && n(i, r);
3278
3274
  }
3279
3275
  return t;
3280
3276
  }
3281
- function mi(e) {
3277
+ function ui(e) {
3282
3278
  return e.filter((t) => t.type === "media").length;
3283
3279
  }
3284
- function hi(e, t, n) {
3280
+ function mi(e, t, n) {
3285
3281
  return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
3286
3282
  }
3287
- function es(e) {
3283
+ function ts(e) {
3288
3284
  return z(e.image_url) ?? z(e.asset_url) ?? "";
3289
3285
  }
3290
- function fi(e) {
3286
+ function hi(e) {
3291
3287
  switch (e) {
3292
3288
  case "image":
3293
3289
  return ke.Image;
@@ -3301,13 +3297,13 @@ function fi(e) {
3301
3297
  return ke.File;
3302
3298
  }
3303
3299
  }
3304
- function gi(e, t) {
3300
+ function fi(e, t) {
3305
3301
  if (t.length > 1)
3306
3302
  switch (e) {
3307
3303
  case "image":
3308
3304
  return {
3309
3305
  items: t.map((a) => ({
3310
- src: es(a),
3306
+ src: ts(a),
3311
3307
  alt: z(a.title)
3312
3308
  }))
3313
3309
  };
@@ -3358,7 +3354,7 @@ function gi(e, t) {
3358
3354
  switch (e) {
3359
3355
  case "image":
3360
3356
  return {
3361
- src: es(n),
3357
+ src: ts(n),
3362
3358
  alt: z(n.title)
3363
3359
  };
3364
3360
  case "video":
@@ -3388,42 +3384,42 @@ function gi(e, t) {
3388
3384
  };
3389
3385
  }
3390
3386
  }
3391
- function pi({
3387
+ function gi({
3392
3388
  groupPosition: e,
3393
3389
  isMyMessage: t,
3394
3390
  segment: n
3395
3391
  }) {
3396
- const a = fi(n.kind), r = {
3397
- ...gi(n.kind, n.attachments),
3392
+ const a = hi(n.kind), r = {
3393
+ ...fi(n.kind, n.attachments),
3398
3394
  groupPosition: e
3399
3395
  };
3400
3396
  return t ? /* @__PURE__ */ s(a.Sent, { ...r }) : /* @__PURE__ */ s(a.Received, { ...r });
3401
3397
  }
3402
- const bi = ({
3398
+ const pi = ({
3403
3399
  groupPosition: e,
3404
3400
  isMyMessage: t,
3405
3401
  message: n,
3406
3402
  renderText: a
3407
3403
  }) => {
3408
3404
  var b;
3409
- const r = Ls(n.attachments);
3405
+ const r = Ds(n.attachments);
3410
3406
  if (r.length === 0) return null;
3411
- const i = mi(r), o = (b = n.text) == null ? void 0 : b.trim(), l = r.find((v) => v.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? Qt(l.attachments[0] ?? {}).url : void 0, m = o && di(o, d) ? void 0 : o;
3407
+ const i = ui(r), o = (b = n.text) == null ? void 0 : b.trim(), l = r.find((v) => v.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? es(l.attachments[0] ?? {}).url : void 0, m = o && ci(o, d) ? void 0 : o;
3412
3408
  let f = 0;
3413
3409
  const h = [], g = (v, x) => {
3414
- const p = t ? Zt.Sent : Zt.Received;
3410
+ const p = t ? Jt.Sent : Jt.Received;
3415
3411
  h.push(
3416
- /* @__PURE__ */ s(p, { ...Qt(v) }, x)
3412
+ /* @__PURE__ */ s(p, { ...es(v) }, x)
3417
3413
  );
3418
3414
  }, c = (v, x) => {
3419
- const p = hi(
3415
+ const p = mi(
3420
3416
  f,
3421
3417
  i,
3422
3418
  e
3423
3419
  );
3424
3420
  f += 1, h.push(
3425
3421
  /* @__PURE__ */ s(
3426
- pi,
3422
+ gi,
3427
3423
  {
3428
3424
  groupPosition: p,
3429
3425
  isMyMessage: t,
@@ -3470,8 +3466,8 @@ const bi = ({
3470
3466
  /* @__PURE__ */ s(nt, {})
3471
3467
  ] }) : null
3472
3468
  ] });
3473
- }, vi = (e) => {
3474
- var Dt, zt, Ft, Pt, Ot, $t, Bt, Ut, jt, Vt;
3469
+ }, bi = (e) => {
3470
+ var Dt, zt, Ft, Pt, Ot, $t, Ut, Bt, jt, Vt;
3475
3471
  const {
3476
3472
  additionalMessageInputProps: t,
3477
3473
  chatbotVotingEnabled: n,
@@ -3489,50 +3485,50 @@ const bi = ({
3489
3485
  renderText: b,
3490
3486
  threadList: v,
3491
3487
  viewerLanguage: x
3492
- } = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: k, onFetchSource: D, onDownloadClick: S } = Or("LockedAttachment"), [R, O] = U(!1), F = Ks(c.id), { selected: L, voteUp: C, voteDown: E } = va(c), {
3493
- Attachment: I = Zs,
3494
- EditMessageModal: T = Js,
3488
+ } = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: C, onFetchSource: D, onDownloadClick: E } = Pr("LockedAttachment"), [R, O] = B(!1), F = Zs(c.id), { selected: L, voteUp: S, voteDown: I } = va(c), {
3489
+ Attachment: y = Js,
3490
+ EditMessageModal: T = Qs,
3495
3491
  MessageActions: M,
3496
- MessageBlocked: P = Qs,
3497
- MessageBouncePrompt: $ = en,
3498
- MessageDeleted: j = tn,
3499
- MessageIsThreadReplyInChannelButtonIndicator: Q = sn,
3500
- MessageRepliesCountButton: ee = nn,
3501
- ReminderNotification: X = an,
3502
- StreamedMessageText: N = rn,
3492
+ MessageBlocked: P = en,
3493
+ MessageBouncePrompt: $ = tn,
3494
+ MessageDeleted: j = sn,
3495
+ MessageIsThreadReplyInChannelButtonIndicator: Q = nn,
3496
+ MessageRepliesCountButton: ee = an,
3497
+ ReminderNotification: X = rn,
3498
+ StreamedMessageText: N = ln,
3503
3499
  PinIndicator: A
3504
- } = as("CustomMessage"), H = ln(c), q = on(c), Y = re(
3500
+ } = rs("CustomMessage"), H = on(c), q = cn(c), Y = re(
3505
3501
  () => h == null ? void 0 : h(c),
3506
3502
  [h, c]
3507
- ), B = re(() => {
3503
+ ), U = re(() => {
3508
3504
  const me = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...me] : me;
3509
- if (!Be(c)) return be;
3510
- const Gt = be.filter((Ht) => !("type" in Ht) || !ps(Ht));
3505
+ if (!Ue(c)) return be;
3506
+ const Gt = be.filter((Ht) => !("type" in Ht) || !bs(Ht));
3511
3507
  return Gt.length === be.length ? be : Gt;
3512
3508
  }, [c]), W = re(
3513
- () => Ls(B),
3514
- [B]
3509
+ () => Ds(U),
3510
+ [U]
3515
3511
  ), Z = re(() => {
3516
- const me = us({ message: c, viewerLanguage: x });
3512
+ const me = ms({ message: c, viewerLanguage: x });
3517
3513
  return me === c.text ? c : { ...c, text: me };
3518
3514
  }, [c, x]), de = W.length > 0, De = W.reduce(
3519
3515
  (me, be) => me + be.attachments.length,
3520
3516
  0
3521
- ) === ((B == null ? void 0 : B.length) ?? 0), ze = Ya({
3517
+ ) === ((U == null ? void 0 : U.length) ?? 0), ze = Ha({
3522
3518
  endOfGroup: r,
3523
3519
  firstOfGroup: i,
3524
3520
  groupedByUser: o
3525
3521
  });
3526
- if (cn(c))
3522
+ if (dn(c))
3527
3523
  return null;
3528
3524
  if (c.deleted_at || c.type === "deleted")
3529
3525
  return /* @__PURE__ */ s(j, { message: c });
3530
- if (dn(c))
3526
+ if (un(c))
3531
3527
  return /* @__PURE__ */ s(P, {});
3532
- const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = un(c);
3528
+ const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = mn(c);
3533
3529
  let ge;
3534
3530
  le ? ge = () => m(c) : Tt && (ge = () => O(!0));
3535
- const te = g(), $s = y(
3531
+ const te = g(), Us = k(
3536
3532
  "str-chat__message str-chat__message-simple",
3537
3533
  `str-chat__message--${c.type}`,
3538
3534
  `str-chat__message--${c.status}`,
@@ -3549,7 +3545,7 @@ const bi = ({
3549
3545
  "str-chat__virtual-message__wrapper--first": i,
3550
3546
  "str-chat__virtual-message__wrapper--group": o
3551
3547
  }
3552
- ), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(c), pe = Be(c), Bs = yt(c), We = !!(B != null && B.length && !c.quoted_message), At = pe && te && We, Us = de && De && !c.quoted_message && !qe && !Y && !pe, Rt = {
3548
+ ), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = Yr(c), pe = Ue(c), Bs = yt(c), We = !!(U != null && U.length && !c.quoted_message), At = pe && te && We, js = de && De && !c.quoted_message && !qe && !Y && !pe, Rt = {
3553
3549
  contentType: "text",
3554
3550
  amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
3555
3551
  paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
@@ -3558,8 +3554,8 @@ const bi = ({
3558
3554
  contentType: "media",
3559
3555
  title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
3560
3556
  mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
3561
- thumbnailUrl: (Bt = c.metadata) == null ? void 0 : Bt.attachment_thumbnail,
3562
- amountText: (Ut = c.metadata) == null ? void 0 : Ut.amount_text,
3557
+ thumbnailUrl: (Ut = c.metadata) == null ? void 0 : Ut.attachment_thumbnail,
3558
+ amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
3563
3559
  detail: (jt = c.metadata) == null ? void 0 : jt.attachment_detail,
3564
3560
  paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
3565
3561
  onFetchSource: D ? () => D(c, _) : void 0
@@ -3572,7 +3568,7 @@ const bi = ({
3572
3568
  }
3573
3569
  ),
3574
3570
  R && /* @__PURE__ */ s(
3575
- mn,
3571
+ hn,
3576
3572
  {
3577
3573
  MessageBouncePrompt: $,
3578
3574
  onClose: () => O(!1),
@@ -3582,7 +3578,7 @@ const bi = ({
3582
3578
  /* @__PURE__ */ u(
3583
3579
  "div",
3584
3580
  {
3585
- className: $s,
3581
+ className: Us,
3586
3582
  "data-message-id": c.id,
3587
3583
  "data-dd-privacy": "mask",
3588
3584
  children: [
@@ -3603,7 +3599,7 @@ const bi = ({
3603
3599
  /* @__PURE__ */ s(
3604
3600
  "div",
3605
3601
  {
3606
- className: y("str-chat__message-inner", {
3602
+ className: k("str-chat__message-inner", {
3607
3603
  "str-chat__simple-message--error-failed": le || Tt
3608
3604
  }),
3609
3605
  "data-testid": "message-inner",
@@ -3617,7 +3613,7 @@ const bi = ({
3617
3613
  marginInlineEnd: 0,
3618
3614
  marginInlineStart: 0
3619
3615
  },
3620
- children: Mt ? /* @__PURE__ */ s(Qe, { message: c, standalone: !0 }) : Hr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3616
+ children: Mt ? /* @__PURE__ */ s(Qe, { message: c, standalone: !0 }) : Gr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3621
3617
  te && M && /* @__PURE__ */ s(M, {}),
3622
3618
  te ? /* @__PURE__ */ s(
3623
3619
  Pe,
@@ -3631,11 +3627,11 @@ const bi = ({
3631
3627
  ...Rt,
3632
3628
  isMine: !1,
3633
3629
  isUnlocking: w(c.id),
3634
- onUnlockClick: () => k == null ? void 0 : k(c, _)
3630
+ onUnlockClick: () => C == null ? void 0 : C(c, _)
3635
3631
  }
3636
3632
  ),
3637
3633
  !te && M && /* @__PURE__ */ s(M, {})
3638
- ] }) }) : Yr(c) ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
3634
+ ] }) }) : Hr(c) ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
3639
3635
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3640
3636
  te && M && /* @__PURE__ */ s(M, {}),
3641
3637
  te ? /* @__PURE__ */ s(
@@ -3643,7 +3639,7 @@ const bi = ({
3643
3639
  {
3644
3640
  ...Lt,
3645
3641
  isMine: !0,
3646
- onPreviewClick: () => k ? k(c, _) : void 0
3642
+ onPreviewClick: () => C ? C(c, _) : void 0
3647
3643
  }
3648
3644
  ) : /* @__PURE__ */ s(
3649
3645
  Pe,
@@ -3651,8 +3647,8 @@ const bi = ({
3651
3647
  ...Lt,
3652
3648
  isMine: !1,
3653
3649
  isUnlocking: w(c.id),
3654
- onUnlockClick: () => k ? k(c, _) : void 0,
3655
- onDownloadClick: () => S ? S(c, _) : void 0
3650
+ onUnlockClick: () => C ? C(c, _) : void 0,
3651
+ onDownloadClick: () => E ? E(c, _) : void 0
3656
3652
  }
3657
3653
  ),
3658
3654
  !te && M && /* @__PURE__ */ s(M, {})
@@ -3664,14 +3660,14 @@ const bi = ({
3664
3660
  renderText: b
3665
3661
  }
3666
3662
  ) })
3667
- ] }) : Us ? /* @__PURE__ */ s(
3668
- bi,
3663
+ ] }) : js ? /* @__PURE__ */ s(
3664
+ pi,
3669
3665
  {
3670
3666
  groupPosition: ze,
3671
3667
  isMyMessage: te,
3672
3668
  message: {
3673
3669
  ...Z,
3674
- attachments: B,
3670
+ attachments: U,
3675
3671
  // MessageText prefers message.i18n[userLanguage_text] from
3676
3672
  // Stream's TranslationContext over message.text. Drop i18n so
3677
3673
  // the caption uses displayMessage.text from viewerLanguage.
@@ -3688,12 +3684,12 @@ const bi = ({
3688
3684
  isMyMessage: te
3689
3685
  }
3690
3686
  ),
3691
- qe && /* @__PURE__ */ s(hn, { poll: qe }),
3692
- B != null && B.length && !c.quoted_message ? /* @__PURE__ */ s(
3693
- I,
3687
+ qe && /* @__PURE__ */ s(fn, { poll: qe }),
3688
+ U != null && U.length && !c.quoted_message ? /* @__PURE__ */ s(
3689
+ y,
3694
3690
  {
3695
3691
  actionHandler: l,
3696
- attachments: B
3692
+ attachments: U
3697
3693
  }
3698
3694
  ) : null,
3699
3695
  Y ? /* @__PURE__ */ s(
@@ -3723,15 +3719,15 @@ const bi = ({
3723
3719
  }
3724
3720
  ),
3725
3721
  n && pe && /* @__PURE__ */ s(
3726
- Wr,
3722
+ qr,
3727
3723
  {
3728
3724
  selected: L,
3729
- onVoteUp: C,
3730
- onVoteDown: E
3725
+ onVoteUp: S,
3726
+ onVoteDown: I
3731
3727
  }
3732
3728
  )
3733
3729
  ] }),
3734
- /* @__PURE__ */ s(Kr, {}),
3730
+ /* @__PURE__ */ s(Xr, {}),
3735
3731
  ae && /* @__PURE__ */ s(
3736
3732
  ee,
3737
3733
  {
@@ -3745,50 +3741,50 @@ const bi = ({
3745
3741
  c.id
3746
3742
  )
3747
3743
  ] });
3748
- }, xi = V.memo(
3749
- vi,
3750
- (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Xs(e, t)
3751
- ), wi = (e) => {
3744
+ }, vi = V.memo(
3745
+ bi,
3746
+ (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ks(e, t)
3747
+ ), xi = (e) => {
3752
3748
  const t = Ne("CustomMessage");
3753
- return /* @__PURE__ */ s(xi, { ...t, ...e });
3754
- }, _i = () => {
3749
+ return /* @__PURE__ */ s(vi, { ...t, ...e });
3750
+ }, wi = () => {
3755
3751
  var n;
3756
3752
  const { handleDelete: e, message: t } = Ne("CustomMessageActions");
3757
3753
  return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
3758
- os,
3754
+ cs,
3759
3755
  {
3760
3756
  onClick: e,
3761
3757
  "aria-label": "Delete",
3762
3758
  title: "Delete",
3763
3759
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
3764
- children: /* @__PURE__ */ s(Zn, { size: 16, weight: "light", "aria-hidden": !0 })
3760
+ children: /* @__PURE__ */ s(Jn, { size: 16, weight: "light", "aria-hidden": !0 })
3765
3761
  }
3766
3762
  );
3767
- }, Ni = () => {
3763
+ }, _i = () => {
3768
3764
  const { handleFlag: e } = Ne("CustomMessageActions");
3769
3765
  return /* @__PURE__ */ s(
3770
- os,
3766
+ cs,
3771
3767
  {
3772
3768
  onClick: e,
3773
3769
  "aria-label": "Report",
3774
3770
  title: "Report",
3775
3771
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
3776
- children: /* @__PURE__ */ s(rs, { size: 16, weight: "light", "aria-hidden": !0 })
3772
+ children: /* @__PURE__ */ s(is, { size: 16, weight: "light", "aria-hidden": !0 })
3777
3773
  }
3778
3774
  );
3779
- }, yi = () => {
3775
+ }, Ni = () => {
3780
3776
  var t;
3781
3777
  const { message: e } = Ne("CustomMessageActions");
3782
3778
  return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
3783
- ea,
3779
+ ta,
3784
3780
  {
3785
3781
  messageActionSet: [
3786
- { Component: _i, placement: "quick", type: "delete" },
3787
- { Component: Ni, placement: "quick", type: "flag" }
3782
+ { Component: wi, placement: "quick", type: "delete" },
3783
+ { Component: _i, placement: "quick", type: "flag" }
3788
3784
  ]
3789
3785
  }
3790
3786
  );
3791
- }, ki = ({
3787
+ }, yi = ({
3792
3788
  link: e,
3793
3789
  onDismiss: t
3794
3790
  }) => {
@@ -3828,14 +3824,14 @@ const bi = ({
3828
3824
  ]
3829
3825
  }
3830
3826
  );
3831
- }, Ci = (e) => ({
3827
+ }, ki = (e) => ({
3832
3828
  linkPreviews: Array.from(e.previews.values()).filter(
3833
3829
  (t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
3834
3830
  )
3835
- }), Si = () => {
3836
- const { linkPreviewsManager: e } = fn(), { linkPreviews: t } = gn(
3831
+ }), Ci = () => {
3832
+ const { linkPreviewsManager: e } = gn(), { linkPreviews: t } = pn(
3837
3833
  e.state,
3838
- Ci
3834
+ ki
3839
3835
  ), n = (r) => {
3840
3836
  e.dismissPreview(r);
3841
3837
  };
@@ -3848,9 +3844,9 @@ const bi = ({
3848
3844
  // block so it keeps its intrinsic height and the container scrolls — a
3849
3845
  // bare flex-column child would be shrunk on the column axis and its
3850
3846
  // fixed-height hero would spill out of the collapsed card box.
3851
- /* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(ki, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
3847
+ /* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(yi, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
3852
3848
  ) : null;
3853
- }, It = V.createContext(!1), pl = () => Te(It), Ei = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
3849
+ }, It = V.createContext(!1), gl = () => Te(It), Si = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
3854
3850
  "button",
3855
3851
  {
3856
3852
  ...n,
@@ -3858,13 +3854,13 @@ const bi = ({
3858
3854
  "aria-label": "Send",
3859
3855
  disabled: t,
3860
3856
  onClick: e,
3861
- children: /* @__PURE__ */ s(Jn, { weight: "bold", className: "size-4" })
3857
+ children: /* @__PURE__ */ s(Qn, { weight: "bold", className: "size-4" })
3862
3858
  }
3863
- ), Ii = () => {
3864
- const e = Te(It), { handleSubmit: t } = bn(), n = vn(), a = e || !n, {
3865
- SendButton: r = Ei,
3866
- AttachmentPreviewList: i = xn
3867
- } = as("CustomMessageInput");
3859
+ ), Ei = () => {
3860
+ const e = Te(It), { handleSubmit: t } = vn(), n = xn(), a = e || !n, {
3861
+ SendButton: r = Si,
3862
+ AttachmentPreviewList: i = wn
3863
+ } = rs("CustomMessageInput");
3868
3864
  return (
3869
3865
  // min-h-0 lets the composer shrink under keyboard squeeze (the link
3870
3866
  // preview list inside is the scrollable region); the textarea + send row
@@ -3880,12 +3876,12 @@ const bi = ({
3880
3876
  className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
3881
3877
  "data-dd-privacy": "mask",
3882
3878
  children: [
3883
- /* @__PURE__ */ s(wn, {}),
3884
- /* @__PURE__ */ s(Si, {}),
3879
+ /* @__PURE__ */ s(_n, {}),
3880
+ /* @__PURE__ */ s(Ci, {}),
3885
3881
  /* @__PURE__ */ s(i, {}),
3886
3882
  /* @__PURE__ */ u("div", { className: "flex shrink-0", children: [
3887
3883
  /* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
3888
- _n,
3884
+ Nn,
3889
3885
  {
3890
3886
  "aria-disabled": e || void 0,
3891
3887
  className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
@@ -3912,7 +3908,7 @@ const bi = ({
3912
3908
  }
3913
3909
  )
3914
3910
  );
3915
- }, Ti = ({
3911
+ }, Ii = ({
3916
3912
  renderActions: e,
3917
3913
  renderFooter: t,
3918
3914
  disabled: n = !1,
@@ -3933,42 +3929,42 @@ const bi = ({
3933
3929
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
3934
3930
  children: [
3935
3931
  e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
3936
- /* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(pn, { Input: r ?? Ii }) })
3932
+ /* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(bn, { Input: r ?? Ei }) })
3937
3933
  ]
3938
3934
  }
3939
3935
  ),
3940
3936
  t == null ? void 0 : t()
3941
3937
  ] });
3942
- }, Mi = [
3938
+ }, Ti = [
3943
3939
  "SYSTEM_DM_AGENT_PAUSED",
3944
3940
  "SYSTEM_DM_AGENT_RESUMED"
3945
- ], Ai = {
3941
+ ], Mi = {
3946
3942
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
3947
3943
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
3948
- }, Ri = [
3944
+ }, Ai = [
3949
3945
  "SYSTEM_AGE_SAFETY_BLOCKED"
3950
- ], Li = {
3946
+ ], Ri = {
3951
3947
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
3952
- }, tt = "age safety guidelines.", Di = "https://linktr.ee/s/about/contact", ts = (e) => Mi.includes(e), zi = (e) => Ri.includes(e), Fi = (e) => {
3948
+ }, tt = "age safety guidelines.", Li = "https://linktr.ee/s/about/contact", ss = (e) => Ti.includes(e), Di = (e) => Ai.includes(e), zi = (e) => {
3953
3949
  var a;
3954
3950
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
3955
- if (ts(t))
3951
+ if (ss(t))
3956
3952
  return {
3957
3953
  kind: "dm-agent",
3958
3954
  type: t
3959
3955
  };
3960
- if (zi(t))
3956
+ if (Di(t))
3961
3957
  return {
3962
3958
  kind: "age-safety",
3963
3959
  type: t
3964
3960
  };
3965
3961
  const n = e.dm_agent_system_type;
3966
- if (ts(n))
3962
+ if (ss(n))
3967
3963
  return {
3968
3964
  kind: "dm-agent",
3969
3965
  type: n
3970
3966
  };
3971
- }, Pi = (e) => {
3967
+ }, Fi = (e) => {
3972
3968
  const t = e.indexOf(tt);
3973
3969
  if (t === -1)
3974
3970
  return e;
@@ -3978,7 +3974,7 @@ const bi = ({
3978
3974
  /* @__PURE__ */ s(
3979
3975
  "a",
3980
3976
  {
3981
- href: Di,
3977
+ href: Li,
3982
3978
  target: "_blank",
3983
3979
  rel: "noopener noreferrer",
3984
3980
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
@@ -3987,13 +3983,13 @@ const bi = ({
3987
3983
  ),
3988
3984
  e.slice(n)
3989
3985
  ] });
3990
- }, Oi = (e) => {
3986
+ }, Pi = (e) => {
3991
3987
  var a, r;
3992
- const t = e.message.hide_date === !0, n = Fi(
3988
+ const t = e.message.hide_date === !0, n = zi(
3993
3989
  e.message
3994
3990
  );
3995
3991
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
3996
- const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ai[n.type];
3992
+ const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Mi[n.type];
3997
3993
  return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
3998
3994
  /* @__PURE__ */ u(
3999
3995
  "div",
@@ -4019,7 +4015,7 @@ const bi = ({
4019
4015
  ] });
4020
4016
  }
4021
4017
  if ((n == null ? void 0 : n.kind) === "age-safety") {
4022
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Li[n.type];
4018
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ri[n.type];
4023
4019
  return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
4024
4020
  /* @__PURE__ */ u(
4025
4021
  "div",
@@ -4029,7 +4025,7 @@ const bi = ({
4029
4025
  "data-age-safety-system-type": n.type,
4030
4026
  children: [
4031
4027
  /* @__PURE__ */ s(
4032
- Qn,
4028
+ ea,
4033
4029
  {
4034
4030
  size: 24,
4035
4031
  weight: "duotone",
@@ -4038,7 +4034,7 @@ const bi = ({
4038
4034
  "data-testid": "age-safety-system-message-icon"
4039
4035
  }
4040
4036
  ),
4041
- /* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Pi(i) }) })
4037
+ /* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Fi(i) }) })
4042
4038
  ]
4043
4039
  }
4044
4040
  ),
@@ -4053,7 +4049,7 @@ const bi = ({
4053
4049
  ] }),
4054
4050
  !t && /* @__PURE__ */ s(Xe, { message: e.message })
4055
4051
  ] });
4056
- }, Ds = ct(!1), st = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
4052
+ }, zs = ct(!1), st = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
4057
4053
  "animateTransform",
4058
4054
  {
4059
4055
  attributeName: "transform",
@@ -4063,17 +4059,17 @@ const bi = ({
4063
4059
  begin: `${120 * t}ms`,
4064
4060
  repeatCount: "indefinite"
4065
4061
  }
4066
- ) }), $i = /* @__PURE__ */ new Set([
4062
+ ) }), Oi = /* @__PURE__ */ new Set([
4067
4063
  Ke.Thinking,
4068
4064
  Ke.Generating,
4069
4065
  Ke.ExternalSources
4070
- ]), Bi = ({ threadList: e }) => {
4066
+ ]), $i = ({ threadList: e }) => {
4071
4067
  var b, v;
4072
- const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = Nn(), { aiState: o } = yn(t), l = Te(Ds);
4073
- if (!e && l && $i.has(o)) {
4068
+ const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = yn(), { aiState: o } = kn(t), l = Te(zs);
4069
+ if (!e && l && Oi.has(o)) {
4074
4070
  const x = Ui(t, (b = r.user) == null ? void 0 : b.id);
4075
4071
  return /* @__PURE__ */ s(
4076
- ss,
4072
+ ns,
4077
4073
  {
4078
4074
  avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
4079
4075
  avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
@@ -4099,7 +4095,7 @@ const bi = ({
4099
4095
  return null;
4100
4096
  const g = (v = h[0]) == null ? void 0 : v.user, c = g != null && g.id && t.state.members[g.id] ? t.state.members[g.id].user : void 0;
4101
4097
  return /* @__PURE__ */ s(
4102
- ss,
4098
+ ns,
4103
4099
  {
4104
4100
  avatarId: (g == null ? void 0 : g.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
4105
4101
  avatarName: (g == null ? void 0 : g.name) ?? (c == null ? void 0 : c.name) ?? (g == null ? void 0 : g.id) ?? "Typing user",
@@ -4107,7 +4103,7 @@ const bi = ({
4107
4103
  testId: "typing-indicator"
4108
4104
  }
4109
4105
  );
4110
- }, ss = ({
4106
+ }, ns = ({
4111
4107
  avatarId: e,
4112
4108
  avatarName: t,
4113
4109
  avatarImage: n,
@@ -4160,10 +4156,10 @@ function Ui(e, t) {
4160
4156
  return i;
4161
4157
  }
4162
4158
  }
4163
- const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ u(
4159
+ const Bi = () => null, ji = ({ className: e, message: t }) => /* @__PURE__ */ u(
4164
4160
  "div",
4165
4161
  {
4166
- className: y("flex items-center justify-center h-full", e),
4162
+ className: k("flex items-center justify-center h-full", e),
4167
4163
  children: [
4168
4164
  /* @__PURE__ */ u("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
4169
4165
  /* @__PURE__ */ s("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ s(
@@ -4204,11 +4200,11 @@ const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ u(
4204
4200
  ]
4205
4201
  }
4206
4202
  ), Ve = V.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ u("div", { className: "flex items-center", children: [
4207
- /* @__PURE__ */ s(Vi, { className: "w-6 h-6" }),
4203
+ /* @__PURE__ */ s(ji, { className: "w-6 h-6" }),
4208
4204
  /* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
4209
4205
  ] }) }));
4210
4206
  Ve.displayName = "LoadingState";
4211
- const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Oe = "Replies instantly with AI assistant", Gi = ({
4207
+ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Oe = "Replies instantly with AI assistant", Vi = ({
4212
4208
  onBack: e,
4213
4209
  showBackButton: t,
4214
4210
  showStarButton: n = !1,
@@ -4227,7 +4223,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4227
4223
  onParticipantNameClick: v,
4228
4224
  renderHeaderTitleBadges: x
4229
4225
  }) => {
4230
- var E, I, T, M, P, $;
4226
+ var I, y, T, M, P, $;
4231
4227
  const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
4232
4228
  () => {
4233
4229
  var j;
@@ -4237,16 +4233,16 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4237
4233
  p.type
4238
4234
  );
4239
4235
  },
4240
- [(E = p.state) == null ? void 0 : E.members, _ == null ? void 0 : _.userID, p.type]
4241
- ), k = mt(w == null ? void 0 : w.user), D = (I = w == null ? void 0 : w.user) == null ? void 0 : I.image, S = ut(p), R = x == null ? void 0 : x({
4236
+ [(I = p.state) == null ? void 0 : I.members, _ == null ? void 0 : _.userID, p.type]
4237
+ ), C = mt(w == null ? void 0 : w.user), D = (y = w == null ? void 0 : w.user) == null ? void 0 : y.image, E = ut(p), R = x == null ? void 0 : x({
4242
4238
  channel: p,
4243
4239
  participant: w
4244
4240
  }), O = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", F = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", L = /* @__PURE__ */ u(se, { children: [
4245
- /* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: k }),
4241
+ /* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: C }),
4246
4242
  R && /* @__PURE__ */ s("span", { className: "shrink-0", children: R })
4247
- ] }), C = async () => {
4243
+ ] }), S = async () => {
4248
4244
  try {
4249
- S ? await p.unpin() : await p.pin();
4245
+ E ? await p.unpin() : await p.pin();
4250
4246
  } catch (j) {
4251
4247
  console.error(
4252
4248
  "[CustomChannelHeader] Failed to update pinned status:",
@@ -4259,7 +4255,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4259
4255
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ s(
4260
4256
  "button",
4261
4257
  {
4262
- className: y(
4258
+ className: k(
4263
4259
  ve,
4264
4260
  "messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
4265
4261
  ),
@@ -4280,8 +4276,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4280
4276
  {
4281
4277
  type: "button",
4282
4278
  onClick: v,
4283
- "aria-label": `View details for ${k}`,
4284
- className: y(
4279
+ "aria-label": `View details for ${C}`,
4280
+ className: k(
4285
4281
  O,
4286
4282
  "appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
4287
4283
  ),
@@ -4290,9 +4286,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4290
4286
  ne,
4291
4287
  {
4292
4288
  id: ((T = w == null ? void 0 : w.user) == null ? void 0 : T.id) || p.id || "unknown",
4293
- name: k,
4289
+ name: C,
4294
4290
  image: D,
4295
- starred: n && S,
4291
+ starred: n && E,
4296
4292
  dmAgentEnabled: a,
4297
4293
  size: 48
4298
4294
  }
@@ -4312,9 +4308,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4312
4308
  ne,
4313
4309
  {
4314
4310
  id: ((M = w == null ? void 0 : w.user) == null ? void 0 : M.id) || p.id || "unknown",
4315
- name: k,
4311
+ name: C,
4316
4312
  image: D,
4317
- starred: n && S,
4313
+ starred: n && E,
4318
4314
  dmAgentEnabled: a,
4319
4315
  size: 48
4320
4316
  }
@@ -4341,17 +4337,17 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4341
4337
  "button",
4342
4338
  {
4343
4339
  className: ve,
4344
- onClick: C,
4340
+ onClick: S,
4345
4341
  type: "button",
4346
- "aria-label": S ? "Unstar conversation" : "Star conversation",
4342
+ "aria-label": E ? "Unstar conversation" : "Star conversation",
4347
4343
  children: /* @__PURE__ */ s(
4348
4344
  Ie,
4349
4345
  {
4350
- className: y("size-5", {
4351
- "text-yellow-600": S,
4352
- "text-black/90": !S
4346
+ className: k("size-5", {
4347
+ "text-yellow-600": E,
4348
+ "text-black/90": !E
4353
4349
  }),
4354
- weight: S ? "duotone" : "regular"
4350
+ weight: E ? "duotone" : "regular"
4355
4351
  }
4356
4352
  )
4357
4353
  }
@@ -4370,7 +4366,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4370
4366
  onBlockParticipantClick: f,
4371
4367
  onReportParticipantClick: h,
4372
4368
  customChannelActions: g,
4373
- triggerClassName: y(ve, "bg-[#F1F0EE]")
4369
+ triggerClassName: k(ve, "bg-[#F1F0EE]")
4374
4370
  }
4375
4371
  ))
4376
4372
  ] })
@@ -4380,7 +4376,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4380
4376
  t && e && /* @__PURE__ */ s(
4381
4377
  "button",
4382
4378
  {
4383
- className: y(
4379
+ className: k(
4384
4380
  ve,
4385
4381
  "messaging-channel-view-back-button-desktop"
4386
4382
  ),
@@ -4395,8 +4391,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4395
4391
  {
4396
4392
  type: "button",
4397
4393
  onClick: v,
4398
- "aria-label": `View details for ${k}`,
4399
- className: y(
4394
+ "aria-label": `View details for ${C}`,
4395
+ className: k(
4400
4396
  F,
4401
4397
  "appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
4402
4398
  ),
@@ -4405,9 +4401,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4405
4401
  ne,
4406
4402
  {
4407
4403
  id: ((P = w == null ? void 0 : w.user) == null ? void 0 : P.id) || p.id || "unknown",
4408
- name: k,
4404
+ name: C,
4409
4405
  image: D,
4410
- starred: n && S,
4406
+ starred: n && E,
4411
4407
  dmAgentEnabled: a,
4412
4408
  size: 48
4413
4409
  }
@@ -4429,9 +4425,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4429
4425
  ne,
4430
4426
  {
4431
4427
  id: (($ = w == null ? void 0 : w.user) == null ? void 0 : $.id) || p.id || "unknown",
4432
- name: k,
4428
+ name: C,
4433
4429
  image: D,
4434
- starred: n && S,
4430
+ starred: n && E,
4435
4431
  dmAgentEnabled: a,
4436
4432
  size: 48
4437
4433
  }
@@ -4459,17 +4455,17 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4459
4455
  "button",
4460
4456
  {
4461
4457
  className: ve,
4462
- onClick: C,
4458
+ onClick: S,
4463
4459
  type: "button",
4464
- "aria-label": S ? "Unstar conversation" : "Star conversation",
4460
+ "aria-label": E ? "Unstar conversation" : "Star conversation",
4465
4461
  children: /* @__PURE__ */ s(
4466
4462
  Ie,
4467
4463
  {
4468
- className: y("size-6", {
4469
- "text-yellow-600": S,
4470
- "text-black/90": !S
4464
+ className: k("size-6", {
4465
+ "text-yellow-600": E,
4466
+ "text-black/90": !E
4471
4467
  }),
4472
- weight: S ? "duotone" : "regular"
4468
+ weight: E ? "duotone" : "regular"
4473
4469
  }
4474
4470
  )
4475
4471
  }
@@ -4494,7 +4490,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4494
4490
  ] })
4495
4491
  ] })
4496
4492
  ] });
4497
- }, Hi = ({
4493
+ }, Gi = ({
4498
4494
  onBack: e,
4499
4495
  showBackButton: t,
4500
4496
  renderMessageInputActions: n,
@@ -4515,33 +4511,33 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4515
4511
  renderChannelBanner: p,
4516
4512
  renderHeaderTitleBadges: _,
4517
4513
  customChannelActions: w,
4518
- renderChannelActions: k,
4514
+ renderChannelActions: C,
4519
4515
  renderMessage: D,
4520
- dmAgentEnabled: S = !1,
4516
+ dmAgentEnabled: E = !1,
4521
4517
  viewerLanguage: R,
4522
4518
  showChannelInfo: O = !0,
4523
4519
  onParticipantNameClick: F,
4524
4520
  composerInput: L
4525
4521
  }) => {
4526
4522
  var N, A, H, q;
4527
- const { channel: C } = oe(), { client: E } = fe(), I = V.useMemo(
4523
+ const { channel: S } = oe(), { client: I } = fe(), y = V.useMemo(
4528
4524
  () => {
4529
4525
  var Y;
4530
4526
  return He(
4531
- (Y = C.state) == null ? void 0 : Y.members,
4532
- E == null ? void 0 : E.userID,
4533
- C.type
4527
+ (Y = S.state) == null ? void 0 : Y.members,
4528
+ I == null ? void 0 : I.userID,
4529
+ S.type
4534
4530
  );
4535
4531
  },
4536
- [(N = C.state) == null ? void 0 : N.members, E == null ? void 0 : E.userID, C.type]
4532
+ [(N = S.state) == null ? void 0 : N.members, I == null ? void 0 : I.userID, S.type]
4537
4533
  ), T = V.useMemo(() => {
4538
4534
  var W;
4539
- const Y = E == null ? void 0 : E.userID;
4540
- return Y ? Object.values(((W = C.state) == null ? void 0 : W.members) || {}).find((Z) => {
4535
+ const Y = I == null ? void 0 : I.userID;
4536
+ return Y ? Object.values(((W = S.state) == null ? void 0 : W.members) || {}).find((Z) => {
4541
4537
  var de;
4542
4538
  return ((de = Z.user) == null ? void 0 : de.id) === Y;
4543
4539
  }) : void 0;
4544
- }, [E == null ? void 0 : E.userID, (A = C.state) == null ? void 0 : A.members]), M = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), P = ((q = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), $ = S && M === !1 && P === !0, j = C.state.messages.some(
4540
+ }, [I == null ? void 0 : I.userID, (A = S.state) == null ? void 0 : A.members]), M = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), P = ((q = y == null ? void 0 : y.user) == null ? void 0 : q.is_account) ?? (y == null ? void 0 : y.is_account), $ = E && M === !1 && P === !0, j = S.state.messages.some(
4545
4541
  (Y) => Y.type !== "deleted"
4546
4542
  ), Q = p ? /* @__PURE__ */ s(V.Fragment, { children: p() }, "lt-channel-banner") : null, ee = F ? /* @__PURE__ */ s(
4547
4543
  ga,
@@ -4561,35 +4557,35 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4561
4557
  onBlockParticipantClick: m,
4562
4558
  onReportParticipantClick: f,
4563
4559
  customChannelActions: w,
4564
- renderChannelActions: k,
4560
+ renderChannelActions: C,
4565
4561
  onParticipantNameClick: F
4566
4562
  }
4567
4563
  ) : null, X = J(
4568
4564
  (Y) => {
4569
- const { message: B } = Ne("ChannelView"), W = /* @__PURE__ */ s(
4570
- wi,
4565
+ const { message: U } = Ne("ChannelView"), W = /* @__PURE__ */ s(
4566
+ xi,
4571
4567
  {
4572
4568
  ...Y,
4573
4569
  chatbotVotingEnabled: x,
4574
4570
  viewerLanguage: R
4575
4571
  }
4576
4572
  );
4577
- return !D || !B ? W : D(W, B);
4573
+ return !D || !U ? W : D(W, U);
4578
4574
  },
4579
4575
  [x, D, R]
4580
4576
  );
4581
4577
  return /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(
4582
- Cn,
4578
+ Sn,
4583
4579
  {
4584
4580
  overrides: {
4585
4581
  Message: X,
4586
- MessageActions: yi,
4582
+ MessageActions: Ni,
4587
4583
  UnreadMessagesSeparator: () => null
4588
4584
  },
4589
- children: /* @__PURE__ */ u(Sn, { children: [
4585
+ children: /* @__PURE__ */ u(En, { children: [
4590
4586
  !F && /* @__PURE__ */ u(se, { children: [
4591
4587
  /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
4592
- Gi,
4588
+ Vi,
4593
4589
  {
4594
4590
  onBack: e,
4595
4591
  showBackButton: t,
@@ -4605,7 +4601,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4605
4601
  onBlockParticipantClick: m,
4606
4602
  onReportParticipantClick: f,
4607
4603
  customChannelActions: w,
4608
- renderChannelActions: k,
4604
+ renderChannelActions: C,
4609
4605
  renderHeaderTitleBadges: _
4610
4606
  }
4611
4607
  ) }, "lt-channel-header"),
@@ -4621,7 +4617,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4621
4617
  Q
4622
4618
  ] }) }),
4623
4619
  /* @__PURE__ */ s(
4624
- En,
4620
+ In,
4625
4621
  {
4626
4622
  head: F && j ? /* @__PURE__ */ u("div", { className: "sticky top-0 z-10", children: [
4627
4623
  ee,
@@ -4635,14 +4631,14 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4635
4631
  },
4636
4632
  "lt-channel-message-list"
4637
4633
  ),
4638
- r ? /* @__PURE__ */ s(V.Fragment, { children: r(C) }, "lt-channel-conversation-footer") : null,
4634
+ r ? /* @__PURE__ */ s(V.Fragment, { children: r(S) }, "lt-channel-conversation-footer") : null,
4639
4635
  /* @__PURE__ */ s(
4640
- Ti,
4636
+ Ii,
4641
4637
  {
4642
4638
  ...n && {
4643
- renderActions: () => n == null ? void 0 : n(C)
4639
+ renderActions: () => n == null ? void 0 : n(S)
4644
4640
  },
4645
- renderFooter: () => a == null ? void 0 : a(C),
4641
+ renderFooter: () => a == null ? void 0 : a(S),
4646
4642
  disabled: c,
4647
4643
  disabledReason: b,
4648
4644
  composerInput: L
@@ -4652,7 +4648,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4652
4648
  ] })
4653
4649
  }
4654
4650
  ) });
4655
- }, zs = V.memo(
4651
+ }, Fs = V.memo(
4656
4652
  ({
4657
4653
  channel: e,
4658
4654
  onBack: t,
@@ -4663,7 +4659,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4663
4659
  onLeaveConversation: o,
4664
4660
  onBlockParticipant: l,
4665
4661
  className: d,
4666
- CustomChannelEmptyState: m = ji,
4662
+ CustomChannelEmptyState: m = Bi,
4667
4663
  showDeleteConversation: f = !0,
4668
4664
  onDeleteConversationClick: h,
4669
4665
  onBlockParticipantClick: g,
@@ -4674,16 +4670,16 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4674
4670
  composerDisabledReason: p,
4675
4671
  dmAgentEnabled: _,
4676
4672
  messageMetadata: w,
4677
- onMessageSent: k,
4673
+ onMessageSent: C,
4678
4674
  showStarButton: D = !1,
4679
- chatbotVotingEnabled: S = !1,
4675
+ chatbotVotingEnabled: E = !1,
4680
4676
  renderChannelBanner: R,
4681
4677
  renderHeaderTitleBadges: O,
4682
4678
  customChannelActions: F,
4683
4679
  renderChannelActions: L,
4684
- renderMessage: C,
4685
- onMessageLinkClick: E,
4686
- sendButton: I,
4680
+ renderMessage: S,
4681
+ onMessageLinkClick: I,
4682
+ sendButton: y,
4687
4683
  attachmentPreviewList: T,
4688
4684
  viewerLanguage: M,
4689
4685
  showChannelInfo: P = !0,
@@ -4702,47 +4698,47 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4702
4698
  ...w
4703
4699
  }
4704
4700
  }
4705
- }, B = {
4701
+ }, U = {
4706
4702
  ...A,
4707
4703
  ...q && { skip_push: !0 }
4708
- }, W = await e.sendMessage(Y, B);
4709
- return k == null || k(W), W;
4704
+ }, W = await e.sendMessage(Y, U);
4705
+ return C == null || C(W), W;
4710
4706
  },
4711
- [e, _, w, k]
4707
+ [e, _, w, C]
4712
4708
  ), ee = G(null);
4713
4709
  return K(() => {
4714
- if (!E) return;
4710
+ if (!I) return;
4715
4711
  const X = ee.current;
4716
4712
  if (!X) return;
4717
4713
  const N = (A) => {
4718
4714
  const H = A.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
4719
4715
  if (!Y) return;
4720
- const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), Z = W ? e.state.messages.find((de) => de.id === W) : void 0;
4721
- E(Y, Z);
4716
+ const U = q == null ? void 0 : q.closest("[data-message-id]"), W = U == null ? void 0 : U.getAttribute("data-message-id"), Z = W ? e.state.messages.find((de) => de.id === W) : void 0;
4717
+ I(Y, Z);
4722
4718
  };
4723
4719
  return X.addEventListener("click", N), () => X.removeEventListener("click", N);
4724
- }, [E, e]), /* @__PURE__ */ s(
4720
+ }, [I, e]), /* @__PURE__ */ s(
4725
4721
  "div",
4726
4722
  {
4727
4723
  ref: ee,
4728
- className: y(
4724
+ className: k(
4729
4725
  "messaging-channel-view h-full flex flex-col",
4730
4726
  d
4731
4727
  ),
4732
- children: /* @__PURE__ */ s(Ds.Provider, { value: _ ?? !1, children: /* @__PURE__ */ s(
4733
- kn,
4728
+ children: /* @__PURE__ */ s(zs.Provider, { value: _ ?? !1, children: /* @__PURE__ */ s(
4729
+ Cn,
4734
4730
  {
4735
4731
  channel: e,
4736
- MessageSystem: Oi,
4732
+ MessageSystem: Pi,
4737
4733
  EmptyStateIndicator: m,
4738
4734
  LoadingIndicator: Ve,
4739
4735
  DateSeparator: pa,
4740
- TypingIndicator: Bi,
4736
+ TypingIndicator: $i,
4741
4737
  doSendMessageRequest: Q,
4742
- ...I ? { SendButton: I } : {},
4738
+ ...y ? { SendButton: y } : {},
4743
4739
  ...T ? { AttachmentPreviewList: T } : {},
4744
4740
  children: /* @__PURE__ */ s(
4745
- Hi,
4741
+ Gi,
4746
4742
  {
4747
4743
  onBack: t,
4748
4744
  showBackButton: n,
@@ -4762,12 +4758,12 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4762
4758
  composerDisabledReason: p,
4763
4759
  showStarButton: D,
4764
4760
  dmAgentEnabled: _,
4765
- chatbotVotingEnabled: S,
4761
+ chatbotVotingEnabled: E,
4766
4762
  renderChannelBanner: R,
4767
4763
  renderHeaderTitleBadges: O,
4768
4764
  customChannelActions: F,
4769
4765
  renderChannelActions: L,
4770
- renderMessage: C,
4766
+ renderMessage: S,
4771
4767
  viewerLanguage: M,
4772
4768
  showChannelInfo: P,
4773
4769
  onParticipantNameClick: $,
@@ -4780,7 +4776,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4780
4776
  );
4781
4777
  }
4782
4778
  );
4783
- zs.displayName = "ChannelView";
4779
+ Fs.displayName = "ChannelView";
4784
4780
  const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
4785
4781
  /* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
4786
4782
  /* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
@@ -4796,7 +4792,7 @@ const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
4796
4792
  )
4797
4793
  ] }) }));
4798
4794
  Ce.displayName = "ErrorState";
4799
- const bl = ({
4795
+ const pl = ({
4800
4796
  capabilities: e = {},
4801
4797
  renderMessageInputActions: t,
4802
4798
  renderConversationFooter: n,
@@ -4817,19 +4813,19 @@ const bl = ({
4817
4813
  renderChannelActions: p,
4818
4814
  onParticipantNameClick: _,
4819
4815
  renderMessage: w,
4820
- onMessageLinkClick: k,
4816
+ onMessageLinkClick: C,
4821
4817
  showChannelInfo: D,
4822
- composerInput: S
4818
+ composerInput: E
4823
4819
  }) => {
4824
4820
  const {
4825
4821
  client: R,
4826
4822
  isConnected: O,
4827
4823
  isLoading: F,
4828
4824
  error: L,
4829
- refreshConnection: C,
4830
- service: E,
4831
- debug: I
4832
- } = ta(), [T, M] = U(null), [P, $] = U(null), [j, Q] = U(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
4825
+ refreshConnection: S,
4826
+ service: I,
4827
+ debug: y
4828
+ } = sa(), [T, M] = B(null), [P, $] = B(null), [j, Q] = B(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
4833
4829
  X.current = o;
4834
4830
  const N = G(a);
4835
4831
  N.current = a;
@@ -4838,9 +4834,9 @@ const bl = ({
4838
4834
  H.current = T;
4839
4835
  }, [T]), K(() => {
4840
4836
  if (!R || !O) return;
4841
- const B = R.userID;
4842
- if (!B) return;
4843
- const W = `${B}::${i}`;
4837
+ const U = R.userID;
4838
+ if (!U) return;
4839
+ const W = `${U}::${i}`;
4844
4840
  if (A.current === W) return;
4845
4841
  A.current = W;
4846
4842
  const Z = () => {
@@ -4849,40 +4845,40 @@ const bl = ({
4849
4845
  (async () => {
4850
4846
  var De, ze;
4851
4847
  try {
4852
- I && console.log(
4848
+ y && console.log(
4853
4849
  "[MessagingShell] Loading initial conversation with:",
4854
4850
  i
4855
4851
  );
4856
4852
  const ae = await R.queryChannels(
4857
4853
  {
4858
4854
  type: "messaging",
4859
- members: { $eq: [B, i] }
4855
+ members: { $eq: [U, i] }
4860
4856
  },
4861
4857
  {},
4862
4858
  { limit: 1 }
4863
4859
  );
4864
4860
  if (ae.length > 0) {
4865
- M(ae[0]), $(null), (De = N.current) == null || De.call(N, ae[0]), I && console.log(
4861
+ M(ae[0]), $(null), (De = N.current) == null || De.call(N, ae[0]), y && console.log(
4866
4862
  "[MessagingShell] Initial conversation loaded:",
4867
4863
  ae[0].id
4868
4864
  );
4869
4865
  return;
4870
4866
  }
4871
4867
  const ue = X.current;
4872
- if (!ue || !E) {
4873
- Z(), $("No conversation found with this account"), I && console.log(
4868
+ if (!ue || !I) {
4869
+ Z(), $("No conversation found with this account"), y && console.log(
4874
4870
  "[MessagingShell] No conversation found for:",
4875
4871
  i
4876
4872
  );
4877
4873
  return;
4878
4874
  }
4879
4875
  try {
4880
- const le = await E.startChannelWithParticipant({
4876
+ const le = await I.startChannelWithParticipant({
4881
4877
  id: ue.id,
4882
4878
  name: ue.name,
4883
4879
  phone: ue.phone
4884
4880
  });
4885
- M(le), $(null), (ze = N.current) == null || ze.call(N, le), I && console.log(
4881
+ M(le), $(null), (ze = N.current) == null || ze.call(N, le), y && console.log(
4886
4882
  "[MessagingShell] Channel created and loaded:",
4887
4883
  le.id
4888
4884
  );
@@ -4899,21 +4895,21 @@ const bl = ({
4899
4895
  ), Z(), H.current || $("Failed to load conversation");
4900
4896
  }
4901
4897
  })();
4902
- }, [i, R, O, E, I]);
4898
+ }, [i, R, O, I, y]);
4903
4899
  const q = G(r);
4904
4900
  q.current = r;
4905
4901
  const Y = J(() => {
4906
- var B;
4907
- M(null), Q(!0), (B = q.current) == null || B.call(q);
4902
+ var U;
4903
+ M(null), Q(!0), (U = q.current) == null || U.call(q);
4908
4904
  }, []);
4909
- return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: C }) : !O || !R ? /* @__PURE__ */ s(
4905
+ return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: S }) : !O || !R ? /* @__PURE__ */ s(
4910
4906
  Ce,
4911
4907
  {
4912
4908
  message: "Not connected to messaging service",
4913
- onBack: C
4909
+ onBack: S
4914
4910
  }
4915
4911
  ) : P ? /* @__PURE__ */ s(Ce, { message: P }) : j && !T ? /* @__PURE__ */ s(Ce, { message: "Conversation ended" }) : T ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
4916
- zs,
4912
+ Fs,
4917
4913
  {
4918
4914
  channel: T,
4919
4915
  renderMessageInputActions: t,
@@ -4934,20 +4930,20 @@ const bl = ({
4934
4930
  renderChannelActions: p,
4935
4931
  onParticipantNameClick: _,
4936
4932
  renderMessage: w,
4937
- onMessageLinkClick: k,
4933
+ onMessageLinkClick: C,
4938
4934
  showChannelInfo: D,
4939
- composerInput: S
4935
+ composerInput: E
4940
4936
  },
4941
4937
  T.id
4942
4938
  ) }) }) : /* @__PURE__ */ s(Ve, {});
4943
4939
  };
4944
- function Yi(e) {
4940
+ function Hi(e) {
4945
4941
  const t = e.state.pending_messages;
4946
4942
  if (t != null && t.length)
4947
4943
  for (const n of t)
4948
4944
  e.state.addMessageSorted(n.message);
4949
4945
  }
4950
- const Fs = V.createContext({
4946
+ const Ps = V.createContext({
4951
4947
  selectedChannel: void 0,
4952
4948
  onChannelSelect: () => {
4953
4949
  },
@@ -4955,18 +4951,18 @@ const Fs = V.createContext({
4955
4951
  renderMessagePreview: void 0,
4956
4952
  channelPreview: void 0,
4957
4953
  viewerLanguage: void 0
4958
- }), qi = Fs.Provider, Wi = () => V.useContext(Fs), Xi = (e, t) => {
4954
+ }), Yi = Ps.Provider, qi = () => V.useContext(Ps), Wi = (e, t) => {
4959
4955
  const n = new Date(
4960
4956
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
4961
4957
  ), r = new Date(
4962
4958
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
4963
4959
  ).getTime() - n.getTime();
4964
4960
  return Math.floor(r / (1e3 * 60 * 60 * 24));
4965
- }, Ki = (e) => {
4961
+ }, Xi = (e) => {
4966
4962
  const t = /* @__PURE__ */ new Date();
4967
4963
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
4968
4964
  return "Just now";
4969
- const a = Xi(e, t);
4965
+ const a = Wi(e, t);
4970
4966
  return a === 0 ? e.toLocaleTimeString([], {
4971
4967
  hour: "numeric",
4972
4968
  minute: "2-digit",
@@ -4976,7 +4972,7 @@ const Fs = V.createContext({
4976
4972
  day: "numeric",
4977
4973
  year: "2-digit"
4978
4974
  });
4979
- }, Ps = V.memo(
4975
+ }, Os = V.memo(
4980
4976
  (e) => {
4981
4977
  var O, F, L;
4982
4978
  const { channel: t, unread: n } = e, {
@@ -4986,7 +4982,7 @@ const Fs = V.createContext({
4986
4982
  channelPreview: o,
4987
4983
  renderMessagePreview: l,
4988
4984
  viewerLanguage: d
4989
- } = Wi(), { client: m } = fe(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = ut(t);
4985
+ } = qi(), { client: m } = fe(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = ut(t);
4990
4986
  if (o)
4991
4987
  return /* @__PURE__ */ s(
4992
4988
  o,
@@ -5000,46 +4996,46 @@ const Fs = V.createContext({
5000
4996
  );
5001
4997
  const g = () => {
5002
4998
  t && r(t);
5003
- }, c = (C) => {
5004
- const E = C.key === "Enter" || C.key === " ", I = C.repeat;
5005
- !E || I || (C.preventDefault(), g());
4999
+ }, c = (S) => {
5000
+ const I = S.key === "Enter" || S.key === " ", y = S.repeat;
5001
+ !I || y || (S.preventDefault(), g());
5006
5002
  }, b = He(
5007
5003
  (O = t == null ? void 0 : t.state) == null ? void 0 : O.members,
5008
5004
  m == null ? void 0 : m.userID,
5009
5005
  t == null ? void 0 : t.type
5010
5006
  ), v = mt(b == null ? void 0 : b.user), x = (F = b == null ? void 0 : b.user) == null ? void 0 : F.image, p = (() => {
5011
- var E;
5012
- const C = (E = t == null ? void 0 : t.state) == null ? void 0 : E.messages;
5013
- if (C != null && C.length) {
5014
- for (let I = C.length - 1; I >= 0; I--)
5015
- if (C[I].type !== "system") return C[I];
5007
+ var I;
5008
+ const S = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
5009
+ if (S != null && S.length) {
5010
+ for (let y = S.length - 1; y >= 0; y--)
5011
+ if (S[y].type !== "system") return S[y];
5016
5012
  }
5017
5013
  })(), w = (() => {
5018
5014
  var M;
5019
- const C = us({
5015
+ const S = ms({
5020
5016
  message: p,
5021
5017
  viewerLanguage: d
5022
- }), { custom_type: E, attachment_content_type: I } = (p == null ? void 0 : p.metadata) || {};
5023
- if (E === "MESSAGE_TIP")
5024
- return C || "Sent a tip";
5025
- if (E === "MESSAGE_PAID")
5026
- return C || "Sent a message";
5027
- if (E === "MESSAGE_ATTACHMENT") {
5028
- if (I === "text")
5018
+ }), { custom_type: I, attachment_content_type: y } = (p == null ? void 0 : p.metadata) || {};
5019
+ if (I === "MESSAGE_TIP")
5020
+ return S || "Sent a tip";
5021
+ if (I === "MESSAGE_PAID")
5022
+ return S || "Sent a message";
5023
+ if (I === "MESSAGE_ATTACHMENT") {
5024
+ if (y === "text")
5029
5025
  return "🔒 Sent a locked message";
5030
- if (I === "media")
5026
+ if (y === "media")
5031
5027
  return "🔒 Sent a locked attachment";
5032
5028
  }
5033
- if (C) return C;
5029
+ if (S) return S;
5034
5030
  const T = (M = p == null ? void 0 : p.attachments) == null ? void 0 : M[0];
5035
5031
  return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
5036
- })(), k = p != null && p.created_at ? Ki(new Date(p.created_at)) : "", D = p ? Be(p) : !1, S = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
5032
+ })(), C = p != null && p.created_at ? Xi(new Date(p.created_at)) : "", D = p ? Ue(p) : !1, E = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
5037
5033
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
5038
5034
  channelId: t == null ? void 0 : t.id,
5039
5035
  isSelected: f,
5040
5036
  participantName: v,
5041
5037
  unreadCount: R,
5042
- hasTimestamp: !!k
5038
+ hasTimestamp: !!C
5043
5039
  }), /* @__PURE__ */ s(
5044
5040
  "div",
5045
5041
  {
@@ -5047,7 +5043,7 @@ const Fs = V.createContext({
5047
5043
  tabIndex: 0,
5048
5044
  onClick: g,
5049
5045
  onKeyDown: c,
5050
- className: y(
5046
+ className: k(
5051
5047
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
5052
5048
  {
5053
5049
  "bg-black/[0.04]": f,
@@ -5071,7 +5067,7 @@ const Fs = V.createContext({
5071
5067
  /* @__PURE__ */ u(
5072
5068
  "h3",
5073
5069
  {
5074
- className: y(
5070
+ className: k(
5075
5071
  "text-sm font-medium truncate text-[#191918]"
5076
5072
  ),
5077
5073
  children: [
@@ -5080,10 +5076,10 @@ const Fs = V.createContext({
5080
5076
  ]
5081
5077
  }
5082
5078
  ),
5083
- k && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: k })
5079
+ C && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: C })
5084
5080
  ] }),
5085
5081
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
5086
- /* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: S }),
5082
+ /* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: E }),
5087
5083
  R > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: R > 99 ? "99+" : R })
5088
5084
  ] })
5089
5085
  ] })
@@ -5092,18 +5088,18 @@ const Fs = V.createContext({
5092
5088
  );
5093
5089
  }
5094
5090
  );
5095
- Ps.displayName = "CustomChannelPreview";
5096
- const Zi = { last_message_at: -1 }, Ji = V.memo(
5091
+ Os.displayName = "CustomChannelPreview";
5092
+ const Ki = { last_message_at: -1 }, Zi = V.memo(
5097
5093
  ({
5098
5094
  onChannelSelect: e,
5099
5095
  selectedChannel: t,
5100
5096
  filters: n,
5101
5097
  allowNewMessagesFromUnfilteredChannels: a = !1,
5102
5098
  channelRenderFilterFn: r,
5103
- sort: i = Zi,
5099
+ sort: i = Ki,
5104
5100
  className: o,
5105
5101
  customEmptyStateIndicator: l,
5106
- channelListPaginator: d = Tn,
5102
+ channelListPaginator: d = Mn,
5107
5103
  channelPreview: m,
5108
5104
  renderMessagePreview: f,
5109
5105
  viewerLanguage: h,
@@ -5116,11 +5112,11 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
5116
5112
  }) => {
5117
5113
  const _ = V.useRef(0);
5118
5114
  _.current++;
5119
- const { debug: w = !1 } = dt(), k = V.useCallback(
5120
- (S) => {
5121
- for (const R of S)
5122
- Yi(R);
5123
- return r ? r(S) : S;
5115
+ const { debug: w = !1 } = dt(), C = V.useCallback(
5116
+ (E) => {
5117
+ for (const R of E)
5118
+ Hi(R);
5119
+ return r ? r(E) : E;
5124
5120
  },
5125
5121
  [r]
5126
5122
  );
@@ -5150,18 +5146,18 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
5150
5146
  return /* @__PURE__ */ s(
5151
5147
  "div",
5152
5148
  {
5153
- className: y(
5149
+ className: k(
5154
5150
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
5155
5151
  o
5156
5152
  ),
5157
- children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(qi, { value: D, children: /* @__PURE__ */ s(
5158
- In,
5153
+ children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Yi, { value: D, children: /* @__PURE__ */ s(
5154
+ Tn,
5159
5155
  {
5160
5156
  filters: n,
5161
5157
  sort: i,
5162
5158
  options: { limit: 30 },
5163
5159
  allowNewMessagesFromUnfilteredChannels: a,
5164
- channelRenderFilterFn: k,
5160
+ channelRenderFilterFn: C,
5165
5161
  lockChannelOrder: g,
5166
5162
  onMessageNewHandler: c,
5167
5163
  onMessageNew: b,
@@ -5169,7 +5165,7 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
5169
5165
  onAddedToChannel: x,
5170
5166
  onChannelUpdated: p,
5171
5167
  Paginator: d,
5172
- Preview: Ps,
5168
+ Preview: Os,
5173
5169
  EmptyStateIndicator: l
5174
5170
  },
5175
5171
  `${JSON.stringify(n)}:${JSON.stringify(i)}`
@@ -5178,11 +5174,11 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
5178
5174
  );
5179
5175
  }
5180
5176
  );
5181
- Ji.displayName = "ChannelList";
5182
- const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, Qi = {
5177
+ Zi.displayName = "ChannelList";
5178
+ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, Ji = {
5183
5179
  sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5184
5180
  received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
5185
- }, el = ({ variant: e }) => /* @__PURE__ */ s(
5181
+ }, Qi = ({ variant: e }) => /* @__PURE__ */ s(
5186
5182
  "span",
5187
5183
  {
5188
5184
  "aria-hidden": "true",
@@ -5192,12 +5188,12 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5192
5188
  insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
5193
5189
  transform: e === "received" ? "scaleX(-1)" : void 0,
5194
5190
  transformOrigin: "center",
5195
- backgroundColor: Qi[e],
5196
- WebkitMask: ns,
5197
- mask: ns
5191
+ backgroundColor: Ji[e],
5192
+ WebkitMask: as,
5193
+ mask: as
5198
5194
  }
5199
5195
  }
5200
- ), tl = {
5196
+ ), el = {
5201
5197
  sent: {
5202
5198
  backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5203
5199
  color: "var(--str-chat__own-message-bubble-color, #fff)"
@@ -5206,7 +5202,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5206
5202
  backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
5207
5203
  color: "var(--str-chat__message-bubble-color, #000000)"
5208
5204
  }
5209
- }, Os = ({
5205
+ }, $s = ({
5210
5206
  variant: e,
5211
5207
  text: t,
5212
5208
  tail: n = !0,
@@ -5216,29 +5212,29 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5216
5212
  "div",
5217
5213
  {
5218
5214
  "data-dd-privacy": "mask",
5219
- className: y(
5215
+ className: k(
5220
5216
  "relative px-4 py-3",
5221
5217
  "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]",
5222
5218
  r
5223
5219
  ),
5224
5220
  style: {
5225
- ...tl[e],
5221
+ ...el[e],
5226
5222
  borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
5227
5223
  isolation: "isolate"
5228
5224
  },
5229
5225
  children: [
5230
5226
  a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
5231
5227
  /* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
5232
- n && /* @__PURE__ */ s(el, { variant: e })
5228
+ n && /* @__PURE__ */ s(Qi, { variant: e })
5233
5229
  ]
5234
5230
  }
5235
- ), sl = ({
5231
+ ), tl = ({
5236
5232
  text: e,
5237
5233
  tail: t,
5238
5234
  header: n,
5239
5235
  className: a
5240
5236
  }) => /* @__PURE__ */ s(
5241
- Os,
5237
+ $s,
5242
5238
  {
5243
5239
  variant: "received",
5244
5240
  text: e,
@@ -5246,10 +5242,10 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5246
5242
  header: n,
5247
5243
  className: a
5248
5244
  }
5249
- ), nl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Os, { variant: "sent", text: e, tail: t, className: n }), vl = {
5250
- Sent: nl,
5251
- Received: sl
5252
- }, al = ({
5245
+ ), sl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s($s, { variant: "sent", text: e, tail: t, className: n }), bl = {
5246
+ Sent: sl,
5247
+ Received: tl
5248
+ }, nl = ({
5253
5249
  question: e,
5254
5250
  onClick: t,
5255
5251
  loading: n = !1,
@@ -5261,7 +5257,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5261
5257
  onClick: t,
5262
5258
  disabled: n,
5263
5259
  style: { backgroundColor: "#E6E5E3" },
5264
- className: y(
5260
+ className: k(
5265
5261
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
5266
5262
  {
5267
5263
  "hover:brightness-95 active:brightness-90": !n,
@@ -5271,7 +5267,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5271
5267
  ),
5272
5268
  children: e
5273
5269
  }
5274
- ), xl = ({
5270
+ ), vl = ({
5275
5271
  faqs: e,
5276
5272
  onFaqClick: t,
5277
5273
  loadingFaqId: n,
@@ -5300,7 +5296,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5300
5296
  children: [
5301
5297
  a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
5302
5298
  l.map((d) => /* @__PURE__ */ s(
5303
- al,
5299
+ nl,
5304
5300
  {
5305
5301
  question: d.question,
5306
5302
  onClick: () => t(d.id),
@@ -5314,42 +5310,42 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5314
5310
  ] }) });
5315
5311
  };
5316
5312
  export {
5317
- hs as A,
5313
+ fs as A,
5318
5314
  pt as B,
5319
- ji as C,
5315
+ Bi as C,
5320
5316
  mt as D,
5321
- pl as E,
5322
- xl as F,
5323
- Or as G,
5317
+ gl as E,
5318
+ vl as F,
5319
+ Pr as G,
5324
5320
  va as H,
5325
- ta as I,
5326
- Zt as L,
5327
- fl as M,
5321
+ sa as I,
5322
+ Jt as L,
5323
+ hl as M,
5328
5324
  ye as a,
5329
5325
  ne as b,
5330
- Ji as c,
5331
- zs as d,
5332
- gl as e,
5333
- al as f,
5326
+ Zi as c,
5327
+ Fs as d,
5328
+ fl as e,
5329
+ nl as f,
5334
5330
  ce as g,
5335
5331
  Pe as h,
5336
5332
  ke as i,
5337
- vl as j,
5338
- Wr as k,
5339
- hl as l,
5340
- bl as m,
5341
- sr as n,
5333
+ bl as j,
5334
+ qr as k,
5335
+ ml as l,
5336
+ pl as m,
5337
+ tr as n,
5342
5338
  he as o,
5343
- Qa as p,
5344
- Ki as q,
5339
+ Ja as p,
5340
+ Xi as q,
5345
5341
  _e as r,
5346
- tr as s,
5347
- us as t,
5348
- ps as u,
5349
- ra as v,
5350
- Ya as w,
5342
+ er as s,
5343
+ ms as t,
5344
+ bs as u,
5345
+ ia as v,
5346
+ Ha as w,
5351
5347
  xa as x,
5352
5348
  He as y,
5353
5349
  gt as z
5354
5350
  };
5355
- //# sourceMappingURL=index-BvuCjzqJ.js.map
5351
+ //# sourceMappingURL=index-5kR8BcYv.js.map