@linktr.ee/messaging-react 3.5.0-rc-1782480113 → 3.5.0-rc-1782792958

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{Card-Dy1Qj3MR.js → Card-BWWBaNKF.js} +2 -2
  2. package/dist/{Card-Dy1Qj3MR.js.map → Card-BWWBaNKF.js.map} +1 -1
  3. package/dist/{Card-DhAhEetQ.cjs → Card-Bj4YaHav.cjs} +2 -2
  4. package/dist/{Card-DhAhEetQ.cjs.map → Card-Bj4YaHav.cjs.map} +1 -1
  5. package/dist/{Card-D34G7gvm.js → Card-BnGeMt4f.js} +2 -2
  6. package/dist/{Card-D34G7gvm.js.map → Card-BnGeMt4f.js.map} +1 -1
  7. package/dist/{Card-DVDoFfkP.js → Card-DkXzpFLA.js} +3 -3
  8. package/dist/{Card-DVDoFfkP.js.map → Card-DkXzpFLA.js.map} +1 -1
  9. package/dist/{Card-DIFgYVKx.cjs → Card-DpCwDviq.cjs} +2 -2
  10. package/dist/{Card-DIFgYVKx.cjs.map → Card-DpCwDviq.cjs.map} +1 -1
  11. package/dist/{Card-yHlBBfOt.cjs → Card-qrDaFHtJ.cjs} +2 -2
  12. package/dist/{Card-yHlBBfOt.cjs.map → Card-qrDaFHtJ.cjs.map} +1 -1
  13. package/dist/{LockedThumbnail-1S_Rjelj.js → LockedThumbnail-DJR--PAi.js} +2 -2
  14. package/dist/{LockedThumbnail-1S_Rjelj.js.map → LockedThumbnail-DJR--PAi.js.map} +1 -1
  15. package/dist/{LockedThumbnail-P2BVsLli.cjs → LockedThumbnail-DhXEk-NX.cjs} +2 -2
  16. package/dist/{LockedThumbnail-P2BVsLli.cjs.map → LockedThumbnail-DhXEk-NX.cjs.map} +1 -1
  17. package/dist/index-DzOA7Yu8.cjs +2 -0
  18. package/dist/index-DzOA7Yu8.cjs.map +1 -0
  19. package/dist/{index-CgczmQkU.js → index-ubCRSgQk.js} +1161 -1074
  20. package/dist/index-ubCRSgQk.js.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +15 -15
  23. package/dist/index.js +17 -18
  24. package/package.json +2 -2
  25. package/src/components/ChannelList/ChannelList.stories.tsx +42 -3
  26. package/src/components/ChannelList/CustomChannelPreview.stories.tsx +64 -1
  27. package/src/components/ChannelList/CustomChannelPreview.test.tsx +58 -46
  28. package/src/components/ChannelList/CustomChannelPreview.tsx +12 -13
  29. package/src/components/ChannelList/index.test.tsx +25 -2
  30. package/src/components/ChannelList/index.tsx +2 -1
  31. package/src/components/ChannelView.stories.tsx +45 -12
  32. package/src/components/ChannelView.test.tsx +64 -62
  33. package/src/components/ChannelView.tsx +118 -68
  34. package/src/components/CustomMessage/index.tsx +1 -0
  35. package/src/components/CustomMessageInput/index.tsx +4 -1
  36. package/src/components/MediaMessage/index.tsx +13 -5
  37. package/src/components/ParticipantBadges.tsx +42 -0
  38. package/src/hooks/useChannelStar.ts +9 -6
  39. package/src/index.ts +0 -2
  40. package/src/stories/mocks.tsx +30 -5
  41. package/src/stream-custom-data.ts +12 -5
  42. package/src/types.ts +9 -1
  43. package/dist/index-BZjaMDgI.cjs +0 -2
  44. package/dist/index-BZjaMDgI.cjs.map +0 -1
  45. package/dist/index-CgczmQkU.js.map +0 -1
  46. package/src/components/VerifiedBadge/index.tsx +0 -25
@@ -1,12 +1,12 @@
1
- import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
2
- import V, { createContext as We, useContext as _e, useCallback as Z, useState as z, useRef as H, useEffect as K, useId as In, useMemo as se, Suspense as Xe } from "react";
1
+ import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
2
+ import j, { createContext as We, useContext as _e, useCallback as J, useState as $, useRef as Y, useEffect as K, useId as Sn, useMemo as re, Suspense as Xe } from "react";
3
3
  import { StreamChatService as Tn } from "@linktr.ee/messaging-core";
4
4
  import { StreamChat as An, LinkPreviewsManager as Lt } from "stream-chat";
5
- import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as Ht, Attachment as Pn, EditMessageModal as On, MessageBlocked as zn, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Vn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Dt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as Ne, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as Oe, AIStates as ze, useTypingContext as is, useAIState as os, Channel as ls, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
6
- import { StarIcon as Ue, DotsThreeIcon as fs, SpinnerGapIcon as Ie, SignOutIcon as gs, ProhibitInsetIcon as Pt, FlagIcon as Yt, FileIcon as qt, ImageIcon as bs, SpeakerHighIcon as ps, VideoCameraIcon as Wt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as _s, FileCsvIcon as Ns, FileXlsIcon as ys, FileDocIcon as Cs, FilePdfIcon as ks, CircleNotchIcon as xe, PlayIcon as je, PauseIcon as Es, LinkIcon as Ss, DownloadSimpleIcon as we, GiftIcon as Is, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Le, ArrowUpIcon as Rs, SparkleIcon as Ge, ProhibitIcon as Ls, SealCheckIcon as Ds, ArrowLeftIcon as Ot, CaretRightIcon as He, PencilSimpleIcon as Ps, CaretLeftIcon as Os } from "@phosphor-icons/react";
7
- import k from "classnames";
8
- import { MessageActions as zs, DefaultDropdownActionButton as Xt } from "stream-chat-react/experimental";
9
- const Kt = We({
5
+ import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as Gt, Attachment as zn, EditMessageModal as Pn, MessageBlocked as On, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Un, ReminderNotification as jn, StreamedMessageText as Vn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Dt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as ye, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as Fe, AIStates as Be, useTypingContext as is, useAIState as ls, Channel as os, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
6
+ import { StarIcon as Me, DotsThreeIcon as fs, SpinnerGapIcon as Te, SignOutIcon as gs, ProhibitInsetIcon as zt, FlagIcon as Ht, FileIcon as Yt, ImageIcon as bs, SpeakerHighIcon as ps, VideoCameraIcon as qt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as Ns, FileCsvIcon as _s, FileXlsIcon as ys, FileDocIcon as ks, FilePdfIcon as Cs, CircleNotchIcon as we, PlayIcon as He, PauseIcon as Es, LinkIcon as Is, DownloadSimpleIcon as Ne, GiftIcon as Ss, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Pe, ArrowUpIcon as Rs, SparkleIcon as pe, ProhibitIcon as Ls, CurrencyDollarIcon as Ds, ArrowLeftIcon as Pt, CaretRightIcon as ve, PencilSimpleIcon as zs, CaretLeftIcon as Ps } from "@phosphor-icons/react";
7
+ import y from "classnames";
8
+ import { MessageActions as Os, DefaultDropdownActionButton as Wt } from "stream-chat-react/experimental";
9
+ const Xt = We({
10
10
  service: null,
11
11
  client: null,
12
12
  isConnected: !1,
@@ -16,7 +16,7 @@ const Kt = We({
16
16
  refreshConnection: async () => {
17
17
  },
18
18
  debug: !1
19
- }), Je = () => _e(Kt), Ci = ({
19
+ }), Je = () => _e(Xt), ki = ({
20
20
  children: e,
21
21
  user: t,
22
22
  serviceConfig: s,
@@ -24,10 +24,10 @@ const Kt = We({
24
24
  capabilities: r = {},
25
25
  debug: i = !1
26
26
  }) => {
27
- var A, y;
28
- const l = Z(
29
- (E, ...C) => {
30
- i && console.log(`🔥 [MessagingProvider] ${E}`, ...C);
27
+ var M, S;
28
+ const l = J(
29
+ (k, ...T) => {
30
+ i && console.log(`🔥 [MessagingProvider] ${k}`, ...T);
31
31
  },
32
32
  [i]
33
33
  );
@@ -37,77 +37,77 @@ const Kt = We({
37
37
  serviceConfig: !!s,
38
38
  capabilities: Object.keys(r)
39
39
  });
40
- const [o, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, w] = z(!1), [b, _] = z(null), v = H(!1), p = H(null), I = H(s);
41
- I.current = s;
42
- const M = H(i);
43
- M.current = i;
44
- const R = H({
40
+ const [o, d] = $(null), [m, g] = $(null), [u, f] = $(!1), [c, b] = $(!1), [N, w] = $(null), p = Y(!1), v = Y(null), A = Y(s);
41
+ A.current = s;
42
+ const E = Y(i);
43
+ E.current = i;
44
+ const I = Y({
45
45
  userId: t == null ? void 0 : t.id,
46
46
  apiKey: a,
47
47
  serviceConfig: s,
48
48
  capabilities: r
49
- }), T = H(0);
50
- T.current++, l("📊 RENDER INFO", {
51
- renderCount: T.current,
49
+ }), P = Y(0);
50
+ P.current++, l("📊 RENDER INFO", {
51
+ renderCount: P.current,
52
52
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
53
53
  propChanges: {
54
- userChanged: R.current.userId !== (t == null ? void 0 : t.id),
55
- apiKeyChanged: R.current.apiKey !== a,
56
- serviceConfigChanged: R.current.serviceConfig !== s,
57
- capabilitiesChanged: R.current.capabilities !== r
54
+ userChanged: I.current.userId !== (t == null ? void 0 : t.id),
55
+ apiKeyChanged: I.current.apiKey !== a,
56
+ serviceConfigChanged: I.current.serviceConfig !== s,
57
+ capabilitiesChanged: I.current.capabilities !== r
58
58
  }
59
- }), R.current = {
59
+ }), I.current = {
60
60
  userId: t == null ? void 0 : t.id,
61
61
  apiKey: a,
62
62
  serviceConfig: s,
63
63
  capabilities: r
64
64
  };
65
- const L = H(null);
66
- a && ((A = L.current) == null ? void 0 : A.apiKey) !== a && (L.current = { apiKey: a, client: new An(a) });
67
- const D = a ? ((y = L.current) == null ? void 0 : y.client) ?? null : null;
65
+ const L = Y(null);
66
+ a && ((M = L.current) == null ? void 0 : M.apiKey) !== a && (L.current = { apiKey: a, client: new An(a) });
67
+ const _ = a ? ((S = L.current) == null ? void 0 : S.client) ?? null : null;
68
68
  K(() => {
69
- const E = T.current, C = I.current;
70
- if (!a || !D || !C) {
69
+ const k = P.current, T = A.current;
70
+ if (!a || !_ || !T) {
71
71
  l("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: E,
72
+ renderCount: k,
73
73
  reason: "Missing apiKey, client, or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  l("🚀 CREATING SERVICE", {
78
- renderCount: E,
78
+ renderCount: k,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
80
80
  });
81
- const $ = new Tn({
82
- ...C,
81
+ const O = new Tn({
82
+ ...T,
83
83
  apiKey: a,
84
- debug: M.current,
85
- client: D
84
+ debug: E.current,
85
+ client: _
86
86
  });
87
- p.current = $, d($), l("✅ SERVICE SET", {
88
- renderCount: E,
89
- serviceInstance: !!$
87
+ v.current = O, d(O), l("✅ SERVICE SET", {
88
+ renderCount: k,
89
+ serviceInstance: !!O
90
90
  });
91
- }, [a, D]);
92
- const U = H(null);
91
+ }, [a, _]);
92
+ const z = Y(null);
93
93
  K(() => {
94
- var C, $;
94
+ var T, O;
95
95
  if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
96
96
  hasService: !!o,
97
97
  hasUser: !!t,
98
98
  userId: t == null ? void 0 : t.id,
99
- isConnecting: v.current,
99
+ isConnecting: p.current,
100
100
  isConnected: u,
101
101
  dependencies: { service: !!o, userId: t == null ? void 0 : t.id }
102
102
  }), !o || !t) {
103
103
  l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
104
104
  return;
105
105
  }
106
- if (v.current) {
106
+ if (p.current) {
107
107
  l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
108
108
  return;
109
109
  }
110
- if (((C = U.current) == null ? void 0 : C.serviceId) === o && (($ = U.current) == null ? void 0 : $.userId) === t.id) {
110
+ if (((T = z.current) == null ? void 0 : T.serviceId) === o && ((O = z.current) == null ? void 0 : O.userId) === t.id) {
111
111
  l(
112
112
  "⚠️ USER CONNECTION SKIPPED",
113
113
  "Already connected this user with this service"
@@ -115,35 +115,35 @@ const Kt = We({
115
115
  return;
116
116
  }
117
117
  (async () => {
118
- l("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, w(!0), _(null);
118
+ l("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, b(!0), w(null);
119
119
  try {
120
120
  l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
121
- const P = await o.connectUser(t);
122
- g(P), f(!0), U.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
121
+ const F = await o.connectUser(t);
122
+ g(F), f(!0), z.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
123
123
  userId: t.id,
124
- clientId: P.userID
124
+ clientId: F.userID
125
125
  });
126
- } catch (P) {
127
- const j = P instanceof Error ? P.message : "Connection failed";
128
- _(j), l("❌ USER CONNECTION ERROR", {
126
+ } catch (F) {
127
+ const V = F instanceof Error ? F.message : "Connection failed";
128
+ w(V), l("❌ USER CONNECTION ERROR", {
129
129
  userId: t.id,
130
- error: j
130
+ error: V
131
131
  });
132
132
  } finally {
133
- w(!1), v.current = !1, l("🔄 USER CONNECTION FINISHED", {
133
+ b(!1), p.current = !1, l("🔄 USER CONNECTION FINISHED", {
134
134
  userId: t.id,
135
135
  isConnected: u
136
136
  });
137
137
  }
138
138
  })();
139
139
  }, [o, t, l, u]), K(() => {
140
- const E = D;
140
+ const k = _;
141
141
  return () => {
142
- var C;
143
- E && (U.current = null, (C = p.current) == null || C.disconnectUser().catch(console.error));
142
+ var T;
143
+ k && (z.current = null, (T = v.current) == null || T.disconnectUser().catch(console.error));
144
144
  };
145
- }, [D]);
146
- const O = Z(async () => {
145
+ }, [_]);
146
+ const R = J(async () => {
147
147
  if (l("🔄 REFRESH CONNECTION CALLED", {
148
148
  hasService: !!o,
149
149
  hasUser: !!t
@@ -151,93 +151,92 @@ const Kt = We({
151
151
  l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
152
152
  return;
153
153
  }
154
- l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
154
+ l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
155
155
  try {
156
156
  l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
157
- const E = await o.connectUser(t);
158
- g(E), f(!0), _(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
159
- } catch (E) {
160
- const C = E instanceof Error ? E.message : "Refresh failed";
161
- _(C), l("❌ CONNECTION REFRESH ERROR", {
157
+ const k = await o.connectUser(t);
158
+ g(k), f(!0), w(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
159
+ } catch (k) {
160
+ const T = k instanceof Error ? k.message : "Refresh failed";
161
+ w(T), l("❌ CONNECTION REFRESH ERROR", {
162
162
  userId: t.id,
163
- error: C
163
+ error: T
164
164
  });
165
165
  } finally {
166
- w(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
166
+ b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
167
167
  }
168
- }, [o, t, l]), N = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
168
+ }, [o, t, l]), D = j.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
169
169
  hasService: !!o,
170
170
  hasClient: !!m,
171
171
  isConnected: u,
172
172
  isLoading: c,
173
- hasError: !!b,
173
+ hasError: !!N,
174
174
  capabilitiesKeys: Object.keys(r)
175
175
  }), {
176
176
  service: o,
177
177
  client: m,
178
178
  isConnected: u,
179
179
  isLoading: c,
180
- error: b,
180
+ error: N,
181
181
  capabilities: r,
182
- refreshConnection: O,
182
+ refreshConnection: R,
183
183
  debug: i
184
184
  }), [
185
185
  o,
186
186
  m,
187
187
  u,
188
188
  c,
189
- b,
189
+ N,
190
190
  r,
191
- O,
191
+ R,
192
192
  i,
193
193
  l
194
194
  ]);
195
195
  return l("🔄 RENDER END", {
196
- renderCount: T.current,
197
- willRenderChat: !!D,
198
- contextValueReady: !!N
199
- }), /* @__PURE__ */ n(Kt.Provider, { value: N, children: D ? /* @__PURE__ */ n(
196
+ renderCount: P.current,
197
+ willRenderChat: !!_,
198
+ contextValueReady: !!D
199
+ }), /* @__PURE__ */ n(Xt.Provider, { value: D, children: _ ? /* @__PURE__ */ n(
200
200
  Mn,
201
201
  {
202
- client: D,
202
+ client: _,
203
203
  customClasses: {
204
204
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
205
205
  },
206
206
  children: e
207
207
  }
208
208
  ) : e });
209
- }, $s = () => Je(), Jt = (e) => {
209
+ }, $s = () => Je(), Kt = (e) => {
210
210
  var a, r;
211
- const [t, s] = z(
211
+ const [t, s] = $(
212
212
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
213
213
  );
214
214
  return K(() => {
215
- var l;
215
+ var o;
216
216
  if (!e) {
217
217
  s(!1);
218
218
  return;
219
219
  }
220
- s(!!((l = e.state.membership) != null && l.pinned_at));
221
- const i = (o) => {
222
- var d;
223
- s(
224
- o != null && o.member ? !!o.member.pinned_at : !!((d = e.state.membership) != null && d.pinned_at)
225
- );
226
- };
227
- return e.on("member.updated", i), () => {
228
- e.off("member.updated", i);
220
+ s(!!((o = e.state.membership) != null && o.pinned_at));
221
+ const i = (d) => {
222
+ var u, f, c, b, N;
223
+ const m = (u = e._client) == null ? void 0 : u.userID, g = ((f = d.member) == null ? void 0 : f.user_id) ?? ((b = (c = d.member) == null ? void 0 : c.user) == null ? void 0 : b.id);
224
+ !m || g !== m || s(!!((N = d.member) != null && N.pinned_at));
225
+ }, l = e.on("member.updated", i);
226
+ return () => {
227
+ l.unsubscribe();
229
228
  };
230
229
  }, [e]), t;
231
230
  }, Fs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
232
231
  function Bs(e) {
233
232
  return Fs.test(e.trim());
234
233
  }
235
- function zt(e, t) {
234
+ function Ot(e, t) {
236
235
  const s = e == null ? void 0 : e.trim();
237
236
  return !s || t && s === t ? !1 : !Bs(s);
238
237
  }
239
- function Zt(e) {
240
- return zt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : zt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
238
+ function Jt(e) {
239
+ return Ot(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Ot(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
241
240
  }
242
241
  const $t = [
243
242
  "🍎",
@@ -267,7 +266,7 @@ const $t = [
267
266
  "🍈"
268
267
  // Melon
269
268
  ];
270
- function Vs(e) {
269
+ function Us(e) {
271
270
  let t = 0;
272
271
  for (let s = 0; s < e.length; s++) {
273
272
  const a = e.charCodeAt(s);
@@ -275,11 +274,11 @@ function Vs(e) {
275
274
  }
276
275
  return Math.abs(t);
277
276
  }
278
- function Us(e) {
279
- const s = Vs(e) % $t.length;
277
+ function js(e) {
278
+ const s = Us(e) % $t.length;
280
279
  return $t[s];
281
280
  }
282
- const oe = ({
281
+ const ne = ({
283
282
  id: e,
284
283
  image: t,
285
284
  size: s = 40,
@@ -288,7 +287,7 @@ const oe = ({
288
287
  shape: i = "squircle",
289
288
  dmAgentEnabled: l = !1
290
289
  }) => {
291
- const o = Us(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
290
+ const o = js(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
292
291
  "img",
293
292
  {
294
293
  src: t,
@@ -299,7 +298,7 @@ const oe = ({
299
298
  "div",
300
299
  {
301
300
  "aria-hidden": "true",
302
- className: k(
301
+ className: y(
303
302
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
304
303
  m
305
304
  ),
@@ -309,7 +308,7 @@ const oe = ({
309
308
  return /* @__PURE__ */ h(
310
309
  "div",
311
310
  {
312
- className: k(
311
+ className: y(
313
312
  "relative flex-shrink-0 !bg-transparent",
314
313
  a
315
314
  ),
@@ -324,14 +323,14 @@ const oe = ({
324
323
  {
325
324
  "aria-hidden": "true",
326
325
  className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
327
- children: /* @__PURE__ */ n(Ue, { className: "size-3 text-yellow-600", weight: "duotone" })
326
+ children: /* @__PURE__ */ n(Me, { className: "size-3 text-yellow-600", weight: "duotone" })
328
327
  }
329
328
  ),
330
329
  /* @__PURE__ */ n(
331
330
  "div",
332
331
  {
333
332
  "data-testid": "avatar-ring",
334
- className: k(
333
+ className: y(
335
334
  "h-full w-full",
336
335
  "bg-transparent"
337
336
  ),
@@ -350,7 +349,7 @@ const oe = ({
350
349
  ]
351
350
  }
352
351
  );
353
- }, js = "https://linktr.ee/s/about/trust-center/report", Gs = ({
352
+ }, Vs = "https://linktr.ee/s/about/trust-center/report", Gs = ({
354
353
  channel: e,
355
354
  participant: t,
356
355
  showBlockParticipant: s = !0,
@@ -363,78 +362,78 @@ const oe = ({
363
362
  onActionComplete: m,
364
363
  logLabel: g = "useChannelModerationActions"
365
364
  }) => {
366
- var A;
367
- const { service: u, debug: f } = Je(), c = (A = t == null ? void 0 : t.user) == null ? void 0 : A.id, w = !!(a && s && u && c), [b, _] = z(!1), [v, p] = z(null), [I, M] = z(!1), [R, T] = z(!1), L = w && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
365
+ var M;
366
+ const { service: u, debug: f } = Je(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.id, b = !!(a && s && u && c), [N, w] = $(!1), [p, v] = $(null), [A, E] = $(!1), [I, P] = $(!1), L = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
368
367
  return K(() => {
369
- if (!w || !u || !c) {
370
- _(!1), p(null);
368
+ if (!b || !u || !c) {
369
+ w(!1), v(null);
371
370
  return;
372
371
  }
373
- let y = !1;
372
+ let S = !1;
374
373
  return (async () => {
375
374
  try {
376
- const E = await u.getBlockedUsers();
377
- if (y) return;
378
- _(
379
- E.some(
380
- (C) => C.blocked_user_id === c
375
+ const k = await u.getBlockedUsers();
376
+ if (S) return;
377
+ w(
378
+ k.some(
379
+ (T) => T.blocked_user_id === c
381
380
  )
382
381
  );
383
- } catch (E) {
384
- y || console.error(`[${g}] Failed to check blocked status:`, E);
382
+ } catch (k) {
383
+ S || console.error(`[${g}] Failed to check blocked status:`, k);
385
384
  } finally {
386
- y || p({ participantId: c, service: u });
385
+ S || v({ participantId: c, service: u });
387
386
  }
388
387
  })(), () => {
389
- y = !0;
388
+ S = !0;
390
389
  };
391
- }, [w, u, c, g]), {
392
- isParticipantBlocked: b,
390
+ }, [b, u, c, g]), {
391
+ isParticipantBlocked: N,
393
392
  isCheckingBlockedStatus: L,
394
- isLeaving: I,
395
- isUpdatingBlockStatus: R,
393
+ isLeaving: A,
394
+ isUpdatingBlockStatus: I,
396
395
  handleLeaveConversation: async () => {
397
- var y;
398
- if (!I) {
399
- l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), M(!0);
396
+ var S;
397
+ if (!A) {
398
+ l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), E(!0);
400
399
  try {
401
- const E = ((y = e._client) == null ? void 0 : y.userID) ?? null;
402
- await e.hide(E, !1), r && await r(e), m == null || m();
403
- } catch (E) {
404
- console.error(`[${g}] Failed to leave conversation`, E);
400
+ const k = ((S = e._client) == null ? void 0 : S.userID) ?? null;
401
+ await e.hide(k, !1), r && await r(e), m == null || m();
402
+ } catch (k) {
403
+ console.error(`[${g}] Failed to leave conversation`, k);
405
404
  } finally {
406
- M(!1);
405
+ E(!1);
407
406
  }
408
407
  }
409
408
  },
410
409
  handleBlockUser: async () => {
411
- var y, E, C;
412
- if (!(R || !u)) {
413
- o == null || o(), f && console.log(`[${g}] Block member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), T(!0);
410
+ var S, k, T;
411
+ if (!(I || !u)) {
412
+ o == null || o(), f && console.log(`[${g}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), P(!0);
414
413
  try {
415
- await u.blockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
416
- } catch ($) {
417
- console.error(`[${g}] Failed to block member`, $);
414
+ await u.blockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), m == null || m();
415
+ } catch (O) {
416
+ console.error(`[${g}] Failed to block member`, O);
418
417
  } finally {
419
- T(!1);
418
+ P(!1);
420
419
  }
421
420
  }
422
421
  },
423
422
  handleUnblockUser: async () => {
424
- var y, E, C;
425
- if (!(R || !u)) {
426
- o == null || o(), f && console.log(`[${g}] Unblock member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), T(!0);
423
+ var S, k, T;
424
+ if (!(I || !u)) {
425
+ o == null || o(), f && console.log(`[${g}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), P(!0);
427
426
  try {
428
- await u.unBlockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
429
- } catch ($) {
430
- console.error(`[${g}] Failed to unblock member`, $);
427
+ await u.unBlockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), m == null || m();
428
+ } catch (O) {
429
+ console.error(`[${g}] Failed to unblock member`, O);
431
430
  } finally {
432
- T(!1);
431
+ P(!1);
433
432
  }
434
433
  }
435
434
  },
436
435
  handleReportUser: () => {
437
- d == null || d(), m == null || m(), window.open(js, "_blank", "noopener,noreferrer");
436
+ d == null || d(), m == null || m(), window.open(Vs, "_blank", "noopener,noreferrer");
438
437
  }
439
438
  };
440
439
  }, be = ({
@@ -446,7 +445,7 @@ const oe = ({
446
445
  "button",
447
446
  {
448
447
  type: "button",
449
- className: k(
448
+ className: y(
450
449
  "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",
451
450
  e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
452
451
  t
@@ -468,15 +467,15 @@ const oe = ({
468
467
  customChannelActions: g,
469
468
  triggerClassName: u
470
469
  }) => {
471
- const [f, c] = z(!1), w = H(null), b = In(), _ = Z(() => c(!1), []), {
472
- isParticipantBlocked: v,
473
- isCheckingBlockedStatus: p,
474
- isLeaving: I,
475
- isUpdatingBlockStatus: M,
476
- handleLeaveConversation: R,
477
- handleBlockUser: T,
470
+ const [f, c] = $(!1), b = Y(null), N = Sn(), w = J(() => c(!1), []), {
471
+ isParticipantBlocked: p,
472
+ isCheckingBlockedStatus: v,
473
+ isLeaving: A,
474
+ isUpdatingBlockStatus: E,
475
+ handleLeaveConversation: I,
476
+ handleBlockUser: P,
478
477
  handleUnblockUser: L,
479
- handleReportUser: D
478
+ handleReportUser: _
480
479
  } = Gs({
481
480
  channel: e,
482
481
  participant: t,
@@ -487,20 +486,20 @@ const oe = ({
487
486
  onDeleteConversationClick: o,
488
487
  onBlockParticipantClick: d,
489
488
  onReportParticipantClick: m,
490
- onActionComplete: _,
489
+ onActionComplete: w,
491
490
  logLabel: "ChannelActionsMenu"
492
491
  });
493
492
  return K(() => {
494
493
  if (!f) return;
495
- const O = (A) => {
496
- w.current && !w.current.contains(A.target) && c(!1);
497
- }, N = (A) => {
498
- A.key === "Escape" && c(!1);
494
+ const R = (M) => {
495
+ b.current && !b.current.contains(M.target) && c(!1);
496
+ }, D = (M) => {
497
+ M.key === "Escape" && c(!1);
499
498
  };
500
- return document.addEventListener("mousedown", O), document.addEventListener("keydown", N), () => {
501
- document.removeEventListener("mousedown", O), document.removeEventListener("keydown", N);
499
+ return document.addEventListener("mousedown", R), document.addEventListener("keydown", D), () => {
500
+ document.removeEventListener("mousedown", R), document.removeEventListener("keydown", D);
502
501
  };
503
- }, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: w, className: "relative", children: [
502
+ }, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
504
503
  /* @__PURE__ */ h(
505
504
  "button",
506
505
  {
@@ -508,8 +507,8 @@ const oe = ({
508
507
  type: "button",
509
508
  "aria-haspopup": "true",
510
509
  "aria-expanded": f,
511
- "aria-controls": f ? b : void 0,
512
- onClick: () => c((O) => !O),
510
+ "aria-controls": f ? N : void 0,
511
+ onClick: () => c((R) => !R),
513
512
  children: [
514
513
  /* @__PURE__ */ n(fs, { className: "size-5 text-black/90" }),
515
514
  /* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
@@ -519,9 +518,9 @@ const oe = ({
519
518
  f && /* @__PURE__ */ n(
520
519
  "div",
521
520
  {
522
- id: b,
521
+ id: N,
523
522
  "aria-label": "Conversation options",
524
- className: k(
523
+ className: y(
525
524
  "absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
526
525
  "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
527
526
  ),
@@ -529,47 +528,47 @@ const oe = ({
529
528
  s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
530
529
  be,
531
530
  {
532
- onClick: R,
533
- disabled: I,
534
- "aria-busy": I,
531
+ onClick: I,
532
+ disabled: A,
533
+ "aria-busy": A,
535
534
  children: [
536
- I ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
535
+ A ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
537
536
  /* @__PURE__ */ n("span", { children: "Delete Conversation" })
538
537
  ]
539
538
  }
540
539
  ) }),
541
- a && /* @__PURE__ */ n("li", { children: p ? (
540
+ a && /* @__PURE__ */ n("li", { children: v ? (
542
541
  // Block status not yet resolved — show a disabled placeholder
543
542
  // so a premature click can't act on a stale block state.
544
543
  /* @__PURE__ */ h(be, { disabled: !0, "aria-busy": !0, children: [
545
- /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }),
544
+ /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }),
546
545
  /* @__PURE__ */ n("span", { children: "Block" })
547
546
  ] })
548
- ) : v ? /* @__PURE__ */ h(
547
+ ) : p ? /* @__PURE__ */ h(
549
548
  be,
550
549
  {
551
550
  onClick: L,
552
- disabled: M,
553
- "aria-busy": M,
551
+ disabled: E,
552
+ "aria-busy": E,
554
553
  children: [
555
- M ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Pt, { className: "h-5 w-5" }),
554
+ E ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(zt, { className: "h-5 w-5" }),
556
555
  /* @__PURE__ */ n("span", { children: "Unblock" })
557
556
  ]
558
557
  }
559
558
  ) : /* @__PURE__ */ h(
560
559
  be,
561
560
  {
562
- onClick: T,
563
- disabled: M,
564
- "aria-busy": M,
561
+ onClick: P,
562
+ disabled: E,
563
+ "aria-busy": E,
565
564
  children: [
566
- M ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Pt, { className: "h-5 w-5" }),
565
+ E ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(zt, { className: "h-5 w-5" }),
567
566
  /* @__PURE__ */ n("span", { children: "Block" })
568
567
  ]
569
568
  }
570
569
  ) }),
571
- r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(be, { variant: "danger", onClick: D, children: [
572
- /* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
570
+ r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(be, { variant: "danger", onClick: _, children: [
571
+ /* @__PURE__ */ n(Ht, { className: "h-5 w-5" }),
573
572
  /* @__PURE__ */ n("span", { children: "Report" })
574
573
  ] }) }),
575
574
  g
@@ -582,10 +581,10 @@ function Ys(e) {
582
581
  return e != null && e.length ? e.some((t) => t.type === qe) ? "down" : e.some((t) => t.type === Ye) ? "up" : null : null;
583
582
  }
584
583
  function qs(e) {
585
- const { channel: t } = de(), { client: s } = Ke("useMessageVote"), a = se(
584
+ const { channel: t } = de(), { client: s } = Ke("useMessageVote"), a = re(
586
585
  () => Ys(e.own_reactions),
587
586
  [e.own_reactions]
588
- ), r = Z(async () => {
587
+ ), r = J(async () => {
589
588
  if (s != null && s.userID)
590
589
  try {
591
590
  a === "up" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
@@ -595,7 +594,7 @@ function qs(e) {
595
594
  );
596
595
  } catch {
597
596
  }
598
- }, [t, s == null ? void 0 : s.userID, e.id, a]), i = Z(async () => {
597
+ }, [t, s == null ? void 0 : s.userID, e.id, a]), i = J(async () => {
599
598
  if (s != null && s.userID)
600
599
  try {
601
600
  a === "down" ? await t.deleteReaction(e.id, qe) : await t.sendReaction(
@@ -611,7 +610,7 @@ function qs(e) {
611
610
  function Ws(e) {
612
611
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
613
612
  }
614
- function Qt({
613
+ function Zt({
615
614
  message: e,
616
615
  viewerLanguage: t
617
616
  }) {
@@ -619,13 +618,13 @@ function Qt({
619
618
  const s = e == null ? void 0 : e.text, a = Ws(t);
620
619
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
621
620
  }
622
- const Xs = V.lazy(() => import("./Card-Dy1Qj3MR.js")), Ks = V.lazy(() => import("./Card-D34G7gvm.js")), Js = V.lazy(() => import("./Card-DVDoFfkP.js")), Ze = () => /* @__PURE__ */ n(
621
+ const Xs = j.lazy(() => import("./Card-BWWBaNKF.js")), Ks = j.lazy(() => import("./Card-BnGeMt4f.js")), Js = j.lazy(() => import("./Card-DkXzpFLA.js")), Ze = () => /* @__PURE__ */ n(
623
622
  "div",
624
623
  {
625
624
  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)]",
626
625
  "aria-hidden": !0
627
626
  }
628
- ), Zs = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), en = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), tn = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), Qs = en, ea = tn, Bt = { Composer: Zs, Sent: en, Received: tn, Creator: Qs, Visitor: ea }, ta = [
627
+ ), Zs = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Qt = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), en = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), Qs = Qt, ea = en, Bt = { Composer: Zs, Sent: Qt, Received: en, Creator: Qs, Visitor: ea }, ta = [
629
628
  [/pdf/, "pdf"],
630
629
  [/wordprocessingml|msword|\.doc/, "doc"],
631
630
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -635,37 +634,37 @@ const Xs = V.lazy(() => import("./Card-Dy1Qj3MR.js")), Ks = V.lazy(() => import(
635
634
  [/plain|rtf/, "text"],
636
635
  [/markdown/, "markdown"]
637
636
  ];
638
- function re(e) {
637
+ function ie(e) {
639
638
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
640
639
  }
641
- function nn(e) {
640
+ function tn(e) {
642
641
  const t = ta.find(
643
642
  ([s]) => s.test(e)
644
643
  );
645
644
  return t ? t[1] : "generic";
646
645
  }
647
646
  const na = {
648
- video: Wt,
647
+ video: qt,
649
648
  audio: ps,
650
649
  image: bs,
651
- document: qt
650
+ document: Yt
652
651
  }, sa = {
653
- pdf: ks,
654
- doc: Cs,
652
+ pdf: Cs,
653
+ doc: ks,
655
654
  xls: ys,
656
- csv: Ns,
657
- ppt: _s,
655
+ csv: _s,
656
+ ppt: Ns,
658
657
  zip: ws,
659
658
  text: xs,
660
659
  markdown: vs,
661
- generic: qt
660
+ generic: Yt
662
661
  };
663
662
  function aa(e) {
664
- const t = re(e);
665
- return t !== "document" ? na[t] : sa[nn(e)];
663
+ const t = ie(e);
664
+ return t !== "document" ? na[t] : sa[tn(e)];
666
665
  }
667
666
  function ce(e, t) {
668
- return V.createElement(aa(e), t);
667
+ return j.createElement(aa(e), t);
669
668
  }
670
669
  const ra = (e) => {
671
670
  var t, s;
@@ -682,66 +681,66 @@ const ra = (e) => {
682
681
  muted: d = !1,
683
682
  onContainerClick: m
684
683
  }) => {
685
- const g = re(t), u = H(null), f = H(null), c = H(null), w = H(r), [b, _] = z(a), [v, p] = z(0), [I, M] = z(!1), [R, T] = z(!1), [L, D] = z(!1), [U, O] = z(!1), [N, A] = z(!0), [y, E] = z(null), C = Z(() => {
686
- D(!1), _(!0);
687
- }, []), $ = Z((x) => {
688
- const S = f.current;
689
- if (!S) return 0;
690
- const B = S.getBoundingClientRect();
684
+ const g = ie(t), u = Y(null), f = Y(null), c = Y(null), b = Y(r), [N, w] = $(a), [p, v] = $(0), [A, E] = $(!1), [I, P] = $(!1), [L, _] = $(!1), [z, R] = $(!1), [D, M] = $(!0), [S, k] = $(null), T = J(() => {
685
+ _(!1), w(!0);
686
+ }, []), O = J((x) => {
687
+ const C = f.current;
688
+ if (!C) return 0;
689
+ const U = C.getBoundingClientRect();
691
690
  return Math.max(
692
691
  0,
693
- Math.min(1, (ra(x) - B.left) / B.width)
692
+ Math.min(1, (ra(x) - U.left) / U.width)
694
693
  );
695
- }, []), P = Z((x) => {
696
- const S = u.current;
697
- S && S.duration && (S.currentTime = x * S.duration);
698
- }, []), j = (x) => {
699
- x.stopPropagation(), M(!0);
700
- const S = $(x);
701
- p(S), P(S);
694
+ }, []), F = J((x) => {
695
+ const C = u.current;
696
+ C && C.duration && (C.currentTime = x * C.duration);
697
+ }, []), V = (x) => {
698
+ x.stopPropagation(), E(!0);
699
+ const C = O(x);
700
+ v(C), F(C);
702
701
  };
703
702
  K(() => {
704
- r !== void 0 && r !== w.current && (w.current = r, _(r));
703
+ r !== void 0 && r !== b.current && (b.current = r, w(r));
705
704
  }, [r]), K(() => {
706
- if (!b) {
705
+ if (!N) {
707
706
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
708
707
  return;
709
708
  }
710
709
  const x = () => {
711
- const S = u.current;
712
- S && S.duration && !I && p(S.currentTime / S.duration), c.current = requestAnimationFrame(x);
710
+ const C = u.current;
711
+ C && C.duration && !A && v(C.currentTime / C.duration), c.current = requestAnimationFrame(x);
713
712
  };
714
713
  return c.current = requestAnimationFrame(x), () => {
715
714
  c.current !== null && cancelAnimationFrame(c.current);
716
715
  };
717
- }, [b, I]), K(() => {
716
+ }, [N, A]), K(() => {
718
717
  const x = u.current;
719
- x && (b ? x.play().catch((S) => {
720
- _(!1), D(!0);
718
+ x && (N ? x.play().catch((C) => {
719
+ w(!1), _(!0);
721
720
  }) : x.pause());
722
- }, [b]), K(() => {
723
- if (!I) return;
724
- const x = (B) => p($(B)), S = (B) => {
725
- M(!1), P($(B));
721
+ }, [N]), K(() => {
722
+ if (!A) return;
723
+ const x = (U) => v(O(U)), C = (U) => {
724
+ E(!1), F(O(U));
726
725
  };
727
- return window.addEventListener("mousemove", x), window.addEventListener("mouseup", S), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", S), () => {
728
- window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", S), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", S);
726
+ return window.addEventListener("mousemove", x), window.addEventListener("mouseup", C), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", C), () => {
727
+ window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", C);
729
728
  };
730
- }, [I, $, P]);
731
- const J = y ? { aspectRatio: String(y) } : void 0, Q = y ? "" : " aspect-video", Y = Math.round(v * 100);
729
+ }, [A, O, F]);
730
+ const ee = S ? { aspectRatio: String(S) } : void 0, Z = S ? "" : " aspect-video", G = Math.round(p * 100);
732
731
  return /* @__PURE__ */ h(
733
732
  "div",
734
733
  {
735
734
  role: "button",
736
735
  tabIndex: 0,
737
- className: `relative cursor-pointer overflow-hidden bg-black ${Q}`,
738
- style: J,
736
+ className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
737
+ style: ee,
739
738
  onClick: (x) => {
740
739
  if (m) {
741
740
  m(x);
742
741
  return;
743
742
  }
744
- L || l && _((S) => !S);
743
+ L || l && w((C) => !C);
745
744
  },
746
745
  onKeyDown: (x) => {
747
746
  if (!(x.key !== "Enter" && x.key !== " ")) {
@@ -749,11 +748,11 @@ const ra = (e) => {
749
748
  m(x);
750
749
  return;
751
750
  }
752
- L || l && _((S) => !S);
751
+ L || l && w((C) => !C);
753
752
  }
754
753
  },
755
754
  children: [
756
- s && (g === "audio" || N) && /* @__PURE__ */ n(
755
+ s && (g === "audio" || D) && /* @__PURE__ */ n(
757
756
  "img",
758
757
  {
759
758
  src: s,
@@ -761,7 +760,7 @@ const ra = (e) => {
761
760
  className: "absolute inset-0 h-full w-full object-cover"
762
761
  }
763
762
  ),
764
- !s && (g === "audio" || N) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
763
+ !s && (g === "audio" || D) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
765
764
  className: "size-12 text-black/20",
766
765
  weight: "regular"
767
766
  }) }),
@@ -773,14 +772,14 @@ const ra = (e) => {
773
772
  loop: i,
774
773
  muted: d,
775
774
  style: { width: "100%", height: "100%" },
776
- onLoadStart: () => O(!0),
775
+ onLoadStart: () => R(!0),
777
776
  onCanPlay: () => {
778
- O(!1), A(!1);
777
+ R(!1), M(!1);
779
778
  },
780
- onWaiting: () => O(!0),
781
- onPlay: () => D(!1),
779
+ onWaiting: () => R(!0),
780
+ onPlay: () => _(!1),
782
781
  onEnded: () => {
783
- i || (_(!1), p(0));
782
+ i || (w(!1), v(0));
784
783
  },
785
784
  children: /* @__PURE__ */ n("track", { kind: "captions" })
786
785
  }
@@ -793,24 +792,24 @@ const ra = (e) => {
793
792
  muted: d,
794
793
  playsInline: !0,
795
794
  style: { width: "100%", height: "100%" },
796
- onLoadStart: () => O(!0),
795
+ onLoadStart: () => R(!0),
797
796
  onCanPlay: () => {
798
- O(!1), A(!1);
797
+ R(!1), M(!1);
799
798
  },
800
- onWaiting: () => O(!0),
801
- onPlay: () => D(!1),
799
+ onWaiting: () => R(!0),
800
+ onPlay: () => _(!1),
802
801
  onLoadedMetadata: () => {
803
802
  const x = u.current;
804
- x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && E(x.videoWidth / x.videoHeight);
803
+ x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && k(x.videoWidth / x.videoHeight);
805
804
  },
806
805
  onEnded: () => {
807
- i || (_(!1), p(0));
806
+ i || (w(!1), v(0));
808
807
  },
809
808
  children: /* @__PURE__ */ n("track", { kind: "captions" })
810
809
  }
811
810
  ) }),
812
- U && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
813
- xe,
811
+ z && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
812
+ we,
814
813
  {
815
814
  className: "size-8 animate-spin text-white/80",
816
815
  weight: "bold"
@@ -824,12 +823,12 @@ const ra = (e) => {
824
823
  tabIndex: 0,
825
824
  "aria-label": "Play preview",
826
825
  onClick: (x) => {
827
- x.stopPropagation(), C();
826
+ x.stopPropagation(), T();
828
827
  },
829
828
  onKeyDown: (x) => {
830
- x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), C());
829
+ x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), T());
831
830
  },
832
- children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
831
+ children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(He, { className: "size-9 translate-x-0.5", weight: "fill" }) })
833
832
  }
834
833
  ),
835
834
  o && !l && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
@@ -837,23 +836,23 @@ const ra = (e) => {
837
836
  {
838
837
  role: "slider",
839
838
  "aria-label": "Playback position",
840
- "aria-valuenow": Y,
839
+ "aria-valuenow": G,
841
840
  "aria-valuemin": 0,
842
841
  "aria-valuemax": 100,
843
842
  tabIndex: 0,
844
843
  ref: f,
845
844
  className: "relative flex h-4 w-full cursor-pointer items-center",
846
- onMouseDown: j,
847
- onTouchStart: j,
845
+ onMouseDown: V,
846
+ onTouchStart: V,
848
847
  onClick: (x) => x.stopPropagation(),
849
848
  onKeyDown: (x) => {
850
- x.key === "ArrowRight" && P(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, v - 0.05));
849
+ x.key === "ArrowRight" && F(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
851
850
  },
852
851
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
853
852
  "div",
854
853
  {
855
854
  className: "h-full rounded-full bg-white",
856
- style: { width: `${Y}%` }
855
+ style: { width: `${G}%` }
857
856
  }
858
857
  ) })
859
858
  }
@@ -864,11 +863,11 @@ const ra = (e) => {
864
863
  {
865
864
  type: "button",
866
865
  onClick: (x) => {
867
- x.stopPropagation(), _((S) => !S);
866
+ x.stopPropagation(), w((C) => !C);
868
867
  },
869
868
  className: "shrink-0 text-white",
870
- "aria-label": b ? "Pause" : "Play",
871
- children: b ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(je, { className: "size-5 translate-x-px", weight: "fill" })
869
+ "aria-label": N ? "Pause" : "Play",
870
+ children: N ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(He, { className: "size-5 translate-x-px", weight: "fill" })
872
871
  }
873
872
  ),
874
873
  /* @__PURE__ */ h(
@@ -876,30 +875,30 @@ const ra = (e) => {
876
875
  {
877
876
  role: "slider",
878
877
  "aria-label": "Playback position",
879
- "aria-valuenow": Y,
878
+ "aria-valuenow": G,
880
879
  "aria-valuemin": 0,
881
880
  "aria-valuemax": 100,
882
881
  tabIndex: 0,
883
882
  ref: f,
884
883
  className: "relative flex h-4 w-full cursor-pointer items-center",
885
- onMouseDown: j,
886
- onTouchStart: j,
884
+ onMouseDown: V,
885
+ onTouchStart: V,
887
886
  onClick: (x) => x.stopPropagation(),
888
- onMouseEnter: () => T(!0),
889
- onMouseLeave: () => T(!1),
887
+ onMouseEnter: () => P(!0),
888
+ onMouseLeave: () => P(!1),
890
889
  onKeyDown: (x) => {
891
- x.key === "ArrowRight" && P(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, v - 0.05));
890
+ x.key === "ArrowRight" && F(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
892
891
  },
893
892
  children: [
894
893
  /* @__PURE__ */ n(
895
894
  "div",
896
895
  {
897
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${R || I ? "h-1.5" : "h-1"}`,
896
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${I || A ? "h-1.5" : "h-1"}`,
898
897
  children: /* @__PURE__ */ n(
899
898
  "div",
900
899
  {
901
900
  className: "h-full rounded-full bg-white",
902
- style: { width: `${Y}%` }
901
+ style: { width: `${G}%` }
903
902
  }
904
903
  )
905
904
  }
@@ -907,8 +906,8 @@ const ra = (e) => {
907
906
  /* @__PURE__ */ n(
908
907
  "div",
909
908
  {
910
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${R || I ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
911
- style: { left: `${Y}%` }
909
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${I || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
910
+ style: { left: `${G}%` }
912
911
  }
913
912
  )
914
913
  ]
@@ -918,7 +917,7 @@ const ra = (e) => {
918
917
  ]
919
918
  }
920
919
  );
921
- }, Vt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", oa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", sn = ({
920
+ }, Ut = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", la = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", nn = ({
922
921
  mimeType: e,
923
922
  sourceUrl: t,
924
923
  thumbnailUrl: s,
@@ -927,7 +926,7 @@ const ra = (e) => {
927
926
  mediaPlayerProps: i,
928
927
  containedImage: l = !1
929
928
  }) => {
930
- const o = re(e), [d, m] = z(!1);
929
+ const o = ie(e), [d, m] = $(!1);
931
930
  return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
932
931
  ia,
933
932
  {
@@ -976,11 +975,11 @@ const ra = (e) => {
976
975
  {
977
976
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
978
977
  children: ce(e, {
979
- className: Vt(r),
978
+ className: Ut(r),
980
979
  weight: "regular"
981
980
  })
982
981
  }
983
- ) : s ? /* @__PURE__ */ n("div", { className: `relative ${oa(r)}`, children: /* @__PURE__ */ n(
982
+ ) : s ? /* @__PURE__ */ n("div", { className: `relative ${la(r)}`, children: /* @__PURE__ */ n(
984
983
  "img",
985
984
  {
986
985
  src: s,
@@ -993,12 +992,12 @@ const ra = (e) => {
993
992
  {
994
993
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
995
994
  children: ce(e, {
996
- className: Vt(r),
995
+ className: Ut(r),
997
996
  weight: "regular"
998
997
  })
999
998
  }
1000
999
  );
1001
- }, an = ({
1000
+ }, sn = ({
1002
1001
  variant: e,
1003
1002
  thumbnail: t,
1004
1003
  title: s,
@@ -1012,13 +1011,13 @@ const ra = (e) => {
1012
1011
  rootRef: g,
1013
1012
  "data-testid": u
1014
1013
  }) => {
1015
- const f = e === "dark", c = f ? s ?? a : s ?? "", w = f && !s;
1014
+ const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
1016
1015
  return /* @__PURE__ */ h(
1017
1016
  "div",
1018
1017
  {
1019
1018
  ref: g,
1020
1019
  "data-testid": u,
1021
- className: k(
1020
+ className: y(
1022
1021
  "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)]",
1023
1022
  f ? "bg-[#121110]" : "bg-white"
1024
1023
  ),
@@ -1030,17 +1029,17 @@ const ra = (e) => {
1030
1029
  c.trim() !== "" && /* @__PURE__ */ n(
1031
1030
  "p",
1032
1031
  {
1033
- className: k("mb-0.5 truncate text-base font-medium", {
1032
+ className: y("mb-0.5 truncate text-base font-medium", {
1034
1033
  "text-black": !f,
1035
- "text-white/30": f && w,
1036
- "text-white": f && !w
1034
+ "text-white/30": f && b,
1035
+ "text-white": f && !b
1037
1036
  }),
1038
1037
  children: c
1039
1038
  }
1040
1039
  ),
1041
1040
  /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
1042
1041
  ce(r, {
1043
- className: k(
1042
+ className: y(
1044
1043
  "size-5 shrink-0",
1045
1044
  f ? "text-white/55" : "text-black/55"
1046
1045
  ),
@@ -1049,7 +1048,7 @@ const ra = (e) => {
1049
1048
  i != null && i !== "" && /* @__PURE__ */ n(
1050
1049
  "span",
1051
1050
  {
1052
- className: k(
1051
+ className: y(
1053
1052
  "text-xs font-medium",
1054
1053
  f ? "text-white/55" : "text-black/55"
1055
1054
  ),
@@ -1064,13 +1063,13 @@ const ra = (e) => {
1064
1063
  }
1065
1064
  );
1066
1065
  };
1067
- function rn(e) {
1066
+ function an(e) {
1068
1067
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1069
1068
  }
1070
1069
  function Qe(e) {
1071
1070
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
1072
1071
  }
1073
- function la(e) {
1072
+ function oa(e) {
1074
1073
  return e ? "bg-white/10" : "bg-black/5";
1075
1074
  }
1076
1075
  function ca(e) {
@@ -1086,7 +1085,7 @@ function ma(e) {
1086
1085
  return e ? "text-white/20" : "text-black/20";
1087
1086
  }
1088
1087
  const et = ({ attachment: e, isMyMessage: t }) => {
1089
- const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, m = /* @__PURE__ */ h(V.Fragment, { children: [
1088
+ const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, m = /* @__PURE__ */ h(j.Fragment, { children: [
1090
1089
  /* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
1091
1090
  "img",
1092
1091
  {
@@ -1097,8 +1096,8 @@ const et = ({ attachment: e, isMyMessage: t }) => {
1097
1096
  ) : /* @__PURE__ */ n(
1098
1097
  "div",
1099
1098
  {
1100
- className: `aspect-video w-full rounded-[20px] ${la(t)} flex items-center justify-center`,
1101
- children: /* @__PURE__ */ n(Ss, { className: `size-12 ${ma(t)}` })
1099
+ className: `aspect-video w-full rounded-[20px] ${oa(t)} flex items-center justify-center`,
1100
+ children: /* @__PURE__ */ n(Is, { className: `size-12 ${ma(t)}` })
1102
1101
  }
1103
1102
  ) }),
1104
1103
  /* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
@@ -1109,12 +1108,12 @@ const et = ({ attachment: e, isMyMessage: t }) => {
1109
1108
  ] });
1110
1109
  return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
1111
1110
  };
1112
- function on(e) {
1111
+ function rn(e) {
1113
1112
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1114
1113
  }
1115
1114
  function tt(e) {
1116
1115
  var t;
1117
- return (t = e.attachments) == null ? void 0 : t.find(on);
1116
+ return (t = e.attachments) == null ? void 0 : t.find(rn);
1118
1117
  }
1119
1118
  async function ha(e, t) {
1120
1119
  let s;
@@ -1132,7 +1131,7 @@ const fa = ({
1132
1131
  url: e,
1133
1132
  filename: t
1134
1133
  }) => {
1135
- const [s, a] = z(!1);
1134
+ const [s, a] = $(!1);
1136
1135
  return /* @__PURE__ */ n(
1137
1136
  "button",
1138
1137
  {
@@ -1148,23 +1147,23 @@ const fa = ({
1148
1147
  },
1149
1148
  disabled: s,
1150
1149
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
1151
- children: s ? /* @__PURE__ */ n(xe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(V.Fragment, { children: [
1152
- /* @__PURE__ */ n(we, { className: "size-4 text-white", weight: "bold" }),
1150
+ children: s ? /* @__PURE__ */ n(we, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
1151
+ /* @__PURE__ */ n(Ne, { className: "size-4 text-white", weight: "bold" }),
1153
1152
  "Download"
1154
1153
  ] })
1155
1154
  }
1156
1155
  );
1157
1156
  };
1158
1157
  function nt(e) {
1159
- var u, f, c, w;
1158
+ var u, f, c, b;
1160
1159
  const t = (u = e.attachments) == null ? void 0 : u.find(
1161
- (b) => b.type === "video" && b.asset_url
1160
+ (N) => N.type === "video" && N.asset_url
1162
1161
  ), s = (f = e.attachments) == null ? void 0 : f.find(
1163
- (b) => b.type === "image" && b.image_url
1162
+ (N) => N.type === "image" && N.image_url
1164
1163
  ), a = (c = e.attachments) == null ? void 0 : c.find(
1165
- (b) => b.type === "audio" && b.asset_url
1166
- ), r = (w = e.attachments) == null ? void 0 : w.find(
1167
- (b) => b.type === "file" && b.asset_url
1164
+ (N) => N.type === "audio" && N.asset_url
1165
+ ), r = (b = e.attachments) == null ? void 0 : b.find(
1166
+ (N) => N.type === "file" && N.asset_url
1168
1167
  ), i = t ?? s ?? a ?? r, l = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
1169
1168
  if (!l) return null;
1170
1169
  const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
@@ -1183,9 +1182,9 @@ const ln = ({
1183
1182
  fileSize: a,
1184
1183
  thumbnailUrl: r
1185
1184
  }) => {
1186
- const i = a !== void 0 ? rn(a) : void 0;
1185
+ const i = a !== void 0 ? an(a) : void 0;
1187
1186
  return /* @__PURE__ */ n(
1188
- an,
1187
+ sn,
1189
1188
  {
1190
1189
  variant: "dark",
1191
1190
  title: s,
@@ -1193,7 +1192,7 @@ const ln = ({
1193
1192
  mimeType: t,
1194
1193
  detail: i,
1195
1194
  thumbnail: /* @__PURE__ */ n(
1196
- sn,
1195
+ nn,
1197
1196
  {
1198
1197
  mimeType: t,
1199
1198
  sourceUrl: e,
@@ -1204,23 +1203,23 @@ const ln = ({
1204
1203
  )
1205
1204
  }
1206
1205
  );
1207
- }, cn = ({
1206
+ }, on = ({
1208
1207
  resolvedUrl: e,
1209
1208
  resolvedType: t,
1210
1209
  title: s,
1211
1210
  fileSize: a,
1212
1211
  thumbnailUrl: r
1213
1212
  }) => {
1214
- const i = re(t), l = a !== void 0 ? rn(a) : void 0;
1213
+ const i = ie(t), l = a !== void 0 ? an(a) : void 0;
1215
1214
  return /* @__PURE__ */ n(
1216
- an,
1215
+ sn,
1217
1216
  {
1218
1217
  variant: "light",
1219
1218
  title: s,
1220
1219
  mimeType: t,
1221
1220
  detail: l,
1222
1221
  thumbnail: /* @__PURE__ */ n(
1223
- sn,
1222
+ nn,
1224
1223
  {
1225
1224
  mimeType: t,
1226
1225
  sourceUrl: e,
@@ -1238,9 +1237,9 @@ const ln = ({
1238
1237
  isMyMessage: t = !1
1239
1238
  }) => {
1240
1239
  const s = tt(e), a = nt(e);
1241
- return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
1240
+ return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
1242
1241
  !t && e.user && /* @__PURE__ */ n(
1243
- oe,
1242
+ ne,
1244
1243
  {
1245
1244
  className: "str-chat__avatar str-chat__message-sender-avatar",
1246
1245
  id: e.user.id,
@@ -1258,7 +1257,7 @@ const ln = ({
1258
1257
  {
1259
1258
  className: "str-chat__message-bubble",
1260
1259
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1261
- children: s ? /* @__PURE__ */ n("div", { className: Qe(t), children: /* @__PURE__ */ n(et, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(ln, { ...a }) : /* @__PURE__ */ n(cn, { ...a })
1260
+ children: s ? /* @__PURE__ */ n("div", { className: Qe(t), children: /* @__PURE__ */ n(et, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(ln, { ...a }) : /* @__PURE__ */ n(on, { ...a })
1262
1261
  }
1263
1262
  ) })
1264
1263
  }
@@ -1269,29 +1268,29 @@ const ln = ({
1269
1268
  }) => {
1270
1269
  const t = tt(e);
1271
1270
  if (t)
1272
- return /* @__PURE__ */ n("div", { className: Qe(!0), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !0 }) });
1271
+ return /* @__PURE__ */ n("div", { className: Qe(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !0 }) });
1273
1272
  const s = nt(e);
1274
- return s ? /* @__PURE__ */ n(ln, { ...s }) : null;
1273
+ return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(ln, { ...s }) }) : null;
1275
1274
  }, pa = ({
1276
1275
  message: e
1277
1276
  }) => {
1278
1277
  const t = tt(e);
1279
1278
  if (t)
1280
- return /* @__PURE__ */ n("div", { className: Qe(!1), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !1 }) });
1279
+ return /* @__PURE__ */ n("div", { className: Qe(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !1 }) });
1281
1280
  const s = nt(e);
1282
- return s ? /* @__PURE__ */ n(cn, { ...s }) : null;
1283
- }, ki = Object.assign(ga, {
1281
+ return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(on, { ...s }) }) : null;
1282
+ }, Ci = Object.assign(ga, {
1284
1283
  Creator: ba,
1285
1284
  Visitor: pa
1286
1285
  }), va = {
1287
1286
  isUnlocking: () => !1
1288
1287
  }, xa = {
1289
1288
  LockedAttachment: va
1290
- }, dn = We({}), Ei = dn.Provider;
1289
+ }, cn = We({}), Ei = cn.Provider;
1291
1290
  function wa(e) {
1292
- return _e(dn)[e] ?? xa[e];
1291
+ return _e(cn)[e] ?? xa[e];
1293
1292
  }
1294
- const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1293
+ const Na = ({ size: e = 15 }) => /* @__PURE__ */ n(
1295
1294
  "svg",
1296
1295
  {
1297
1296
  width: e,
@@ -1308,49 +1307,49 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1308
1307
  }
1309
1308
  )
1310
1309
  }
1311
- ), Na = (e) => {
1310
+ ), _a = (e) => {
1312
1311
  var t;
1313
1312
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
1314
1313
  }, ya = (e) => {
1315
1314
  var t;
1316
1315
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
1317
- }, Te = (e) => {
1316
+ }, Re = (e) => {
1318
1317
  var t;
1319
1318
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
1320
- }, Ca = (e) => {
1319
+ }, ka = (e) => {
1321
1320
  var t;
1322
1321
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
1323
- }, un = (e) => Na(e) || ya(e), ka = (e) => {
1322
+ }, dn = (e) => _a(e) || ya(e), Ca = (e) => {
1324
1323
  var t;
1325
- return un(e) && !((t = e.text) != null && t.trim());
1326
- }, $e = ({
1324
+ return dn(e) && !((t = e.text) != null && t.trim());
1325
+ }, Ue = ({
1327
1326
  message: e,
1328
1327
  standalone: t = !1,
1329
1328
  isMyMessage: s = !1,
1330
1329
  hasAttachment: a = !1
1331
1330
  }) => {
1332
1331
  var u;
1333
- const r = un(e), i = Te(e);
1332
+ const r = dn(e), i = Re(e);
1334
1333
  if (!r && !i)
1335
1334
  return null;
1336
1335
  if (r) {
1337
1336
  const f = (u = e.metadata) == null ? void 0 : u.amount_text;
1338
1337
  if (!f) return null;
1339
- const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", w = t ? `${f} tip` : `Delivered with ${f} tip`;
1338
+ const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
1340
1339
  return /* @__PURE__ */ h("div", { className: c, children: [
1341
- /* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
1342
- /* @__PURE__ */ n("span", { children: w })
1340
+ /* @__PURE__ */ n(Ss, { size: t ? 14 : 12 }),
1341
+ /* @__PURE__ */ n("span", { children: b })
1343
1342
  ] });
1344
1343
  }
1345
1344
  const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
1346
1345
  "message-chatbot-indicator",
1347
1346
  s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
1348
1347
  l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
1349
- ].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(_a, { size: l ? 12 : 15 }) });
1350
- return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(ae, { children: [
1348
+ ].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(Na, { size: l ? 12 : 15 }) });
1349
+ return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(se, { children: [
1351
1350
  m,
1352
1351
  g
1353
- ] }) : /* @__PURE__ */ h(ae, { children: [
1352
+ ] }) : /* @__PURE__ */ h(se, { children: [
1354
1353
  g,
1355
1354
  m
1356
1355
  ] }) });
@@ -1363,7 +1362,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1363
1362
  "button",
1364
1363
  {
1365
1364
  type: "button",
1366
- className: k("message-vote-button focus-ring", {
1365
+ className: y("message-vote-button focus-ring", {
1367
1366
  "message-vote-button--selected": e === "up"
1368
1367
  }),
1369
1368
  onClick: t,
@@ -1377,7 +1376,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1377
1376
  "button",
1378
1377
  {
1379
1378
  type: "button",
1380
- className: k("message-vote-button focus-ring", {
1379
+ className: y("message-vote-button focus-ring", {
1381
1380
  "message-vote-button--selected": e === "down"
1382
1381
  }),
1383
1382
  onClick: s,
@@ -1387,8 +1386,8 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1387
1386
  children: /* @__PURE__ */ n(As, { size: 16, weight: e === "down" ? "fill" : "regular" })
1388
1387
  }
1389
1388
  )
1390
- ] }), Sa = (e) => {
1391
- var pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St, It, Tt, At;
1389
+ ] }), Ia = (e) => {
1390
+ var pt, vt, xt, wt, Nt, _t, yt, kt, Ct, Et, It, St, Tt, At;
1392
1391
  const {
1393
1392
  additionalMessageInputProps: t,
1394
1393
  chatbotVotingEnabled: s,
@@ -1403,63 +1402,63 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1403
1402
  isMessageAIGenerated: u,
1404
1403
  isMyMessage: f,
1405
1404
  message: c,
1406
- renderText: w,
1407
- threadList: b,
1408
- viewerLanguage: _
1409
- } = e, { client: v } = Ke("CustomMessage"), { channel: p } = de("CustomMessage"), { isUnlocking: I, onUnlockClick: M, onFetchSource: R, onDownloadClick: T } = wa("LockedAttachment"), [L, D] = z(!1), U = Dn(c.id), { selected: O, voteUp: N, voteDown: A } = qs(c), {
1410
- Attachment: y = Pn,
1411
- EditMessageModal: E = On,
1412
- MessageActions: C,
1413
- MessageBlocked: $ = zn,
1414
- MessageBouncePrompt: P = $n,
1415
- MessageDeleted: j = Fn,
1416
- MessageIsThreadReplyInChannelButtonIndicator: J = Bn,
1417
- MessageRepliesCountButton: Q = Vn,
1418
- ReminderNotification: Y = Un,
1419
- StreamedMessageText: x = jn,
1420
- PinIndicator: S
1421
- } = Ht("CustomMessage"), B = Gn(c), G = Hn(c), q = se(
1405
+ renderText: b,
1406
+ threadList: N,
1407
+ viewerLanguage: w
1408
+ } = e, { client: p } = Ke("CustomMessage"), { channel: v } = de("CustomMessage"), { isUnlocking: A, onUnlockClick: E, onFetchSource: I, onDownloadClick: P } = wa("LockedAttachment"), [L, _] = $(!1), z = Dn(c.id), { selected: R, voteUp: D, voteDown: M } = qs(c), {
1409
+ Attachment: S = zn,
1410
+ EditMessageModal: k = Pn,
1411
+ MessageActions: T,
1412
+ MessageBlocked: O = On,
1413
+ MessageBouncePrompt: F = $n,
1414
+ MessageDeleted: V = Fn,
1415
+ MessageIsThreadReplyInChannelButtonIndicator: ee = Bn,
1416
+ MessageRepliesCountButton: Z = Un,
1417
+ ReminderNotification: G = jn,
1418
+ StreamedMessageText: x = Vn,
1419
+ PinIndicator: C
1420
+ } = Gt("CustomMessage"), U = Gn(c), H = Hn(c), q = re(
1422
1421
  () => u == null ? void 0 : u(c),
1423
1422
  [u, c]
1424
- ), F = se(() => {
1423
+ ), B = re(() => {
1425
1424
  const ge = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...ge] : ge;
1426
- if (!Te(c)) return Se;
1427
- const Mt = Se.filter((Rt) => !("type" in Rt) || !on(Rt));
1425
+ if (!Re(c)) return Se;
1426
+ const Mt = Se.filter((Rt) => !("type" in Rt) || !rn(Rt));
1428
1427
  return Mt.length === Se.length ? Se : Mt;
1429
- }, [c]), W = se(() => {
1430
- const ge = Qt({ message: c, viewerLanguage: _ });
1428
+ }, [c]), W = re(() => {
1429
+ const ge = Zt({ message: c, viewerLanguage: w });
1431
1430
  return ge === c.text ? c : { ...c, text: ge };
1432
- }, [c, _]);
1431
+ }, [c, w]);
1433
1432
  if (Yn(c))
1434
1433
  return null;
1435
1434
  if (c.deleted_at || c.type === "deleted")
1436
- return /* @__PURE__ */ n(j, { message: c });
1435
+ return /* @__PURE__ */ n(V, { message: c });
1437
1436
  if (qn(c))
1438
- return /* @__PURE__ */ n($, {});
1439
- const X = !b && !!c.reply_count, ue = !b && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((pt = c.error) == null ? void 0 : pt.status) !== 403, he = Wn(c);
1440
- let ee;
1441
- me ? ee = () => m(c) : he && (ee = () => D(!0));
1442
- const te = f(), ie = k(
1437
+ return /* @__PURE__ */ n(O, {});
1438
+ const X = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((pt = c.error) == null ? void 0 : pt.status) !== 403, he = Wn(c);
1439
+ let Q;
1440
+ me ? Q = () => m(c) : he && (Q = () => _(!0));
1441
+ const te = f(), le = y(
1443
1442
  "str-chat__message str-chat__message-simple",
1444
1443
  `str-chat__message--${c.type}`,
1445
1444
  `str-chat__message--${c.status}`,
1446
1445
  te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1447
1446
  c.text ? "str-chat__message--has-text" : "has-no-text",
1448
1447
  {
1449
- "str-chat__message--has-attachment": B,
1448
+ "str-chat__message--has-attachment": U,
1450
1449
  "str-chat__message--highlighted": g,
1451
1450
  "str-chat__message--pinned pinned-message": c.pinned,
1452
- "str-chat__message--with-reactions": G,
1451
+ "str-chat__message--with-reactions": H,
1453
1452
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((vt = c == null ? void 0 : c.error) == null ? void 0 : vt.status) !== 403,
1454
1453
  "str-chat__message-with-thread-link": X || ue,
1455
1454
  "str-chat__virtual-message__wrapper--end": r,
1456
1455
  "str-chat__virtual-message__wrapper--first": i,
1457
1456
  "str-chat__virtual-message__wrapper--group": l
1458
1457
  }
1459
- ), ht = c.poll_id && v.polls.fromState(c.poll_id), ft = ka(c), fe = Te(c), gt = Ca(c), Pe = !!(F != null && F.length && !c.quoted_message), bt = fe && te && Pe;
1460
- return /* @__PURE__ */ h(ae, { children: [
1458
+ ), ht = c.poll_id && p.polls.fromState(c.poll_id), ft = Ca(c), fe = Re(c), gt = ka(c), $e = !!(B != null && B.length && !c.quoted_message), bt = fe && te && $e;
1459
+ return /* @__PURE__ */ h(se, { children: [
1461
1460
  a && /* @__PURE__ */ n(
1462
- E,
1461
+ k,
1463
1462
  {
1464
1463
  additionalMessageInputProps: t
1465
1464
  }
@@ -1467,21 +1466,22 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1467
1466
  L && /* @__PURE__ */ n(
1468
1467
  Xn,
1469
1468
  {
1470
- MessageBouncePrompt: P,
1471
- onClose: () => D(!1),
1469
+ MessageBouncePrompt: F,
1470
+ onClose: () => _(!1),
1472
1471
  open: L
1473
1472
  }
1474
1473
  ),
1475
1474
  /* @__PURE__ */ h(
1476
1475
  "div",
1477
1476
  {
1478
- className: ie,
1477
+ className: le,
1479
1478
  "data-message-id": c.id,
1479
+ "data-dd-privacy": "mask",
1480
1480
  children: [
1481
- S && /* @__PURE__ */ n(S, {}),
1482
- !!U && /* @__PURE__ */ n(Y, { reminder: U }),
1481
+ C && /* @__PURE__ */ n(C, {}),
1482
+ !!z && /* @__PURE__ */ n(G, { reminder: z }),
1483
1483
  c.user && /* @__PURE__ */ n(
1484
- oe,
1484
+ ne,
1485
1485
  {
1486
1486
  className: "str-chat__avatar str-chat__message-sender-avatar",
1487
1487
  id: c.user.id,
@@ -1495,14 +1495,14 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1495
1495
  /* @__PURE__ */ n(
1496
1496
  "div",
1497
1497
  {
1498
- className: k("str-chat__message-inner", {
1498
+ className: y("str-chat__message-inner", {
1499
1499
  "str-chat__simple-message--error-failed": me || he
1500
1500
  }),
1501
1501
  "data-testid": "message-inner",
1502
- onClick: ee,
1503
- onKeyDown: ee,
1504
- role: ee ? "button" : void 0,
1505
- tabIndex: ee ? 0 : void 0,
1502
+ onClick: Q,
1503
+ onKeyDown: Q,
1504
+ role: Q ? "button" : void 0,
1505
+ tabIndex: Q ? 0 : void 0,
1506
1506
  style: {
1507
1507
  // Force margins to 0 to prevent hover layout shift
1508
1508
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
@@ -1511,76 +1511,76 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1511
1511
  },
1512
1512
  children: gt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1513
1513
  te ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1514
- C && /* @__PURE__ */ n(C, {}),
1514
+ T && /* @__PURE__ */ n(T, {}),
1515
1515
  /* @__PURE__ */ n(
1516
1516
  Bt.Sent,
1517
1517
  {
1518
1518
  title: (xt = c.metadata) == null ? void 0 : xt.attachment_title,
1519
1519
  mimeType: (wt = c.metadata) == null ? void 0 : wt.attachment_mime_type,
1520
- thumbnailUrl: (_t = c.metadata) == null ? void 0 : _t.attachment_thumbnail,
1521
- amountText: (Nt = c.metadata) == null ? void 0 : Nt.amount_text,
1520
+ thumbnailUrl: (Nt = c.metadata) == null ? void 0 : Nt.attachment_thumbnail,
1521
+ amountText: (_t = c.metadata) == null ? void 0 : _t.amount_text,
1522
1522
  detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
1523
- paymentStatus: (Ct = c.metadata) == null ? void 0 : Ct.payment_status,
1524
- onPreviewClick: () => M == null ? void 0 : M(c, p),
1525
- onFetchSource: async () => await (R == null ? void 0 : R(c, p))
1523
+ paymentStatus: (kt = c.metadata) == null ? void 0 : kt.payment_status,
1524
+ onPreviewClick: () => E == null ? void 0 : E(c, v),
1525
+ onFetchSource: async () => await (I == null ? void 0 : I(c, v))
1526
1526
  }
1527
1527
  )
1528
1528
  ] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1529
1529
  /* @__PURE__ */ n(
1530
1530
  Bt.Received,
1531
1531
  {
1532
- title: (kt = c.metadata) == null ? void 0 : kt.attachment_title,
1532
+ title: (Ct = c.metadata) == null ? void 0 : Ct.attachment_title,
1533
1533
  mimeType: (Et = c.metadata) == null ? void 0 : Et.attachment_mime_type,
1534
- thumbnailUrl: (St = c.metadata) == null ? void 0 : St.attachment_thumbnail,
1535
- amountText: (It = c.metadata) == null ? void 0 : It.amount_text,
1534
+ thumbnailUrl: (It = c.metadata) == null ? void 0 : It.attachment_thumbnail,
1535
+ amountText: (St = c.metadata) == null ? void 0 : St.amount_text,
1536
1536
  detail: (Tt = c.metadata) == null ? void 0 : Tt.attachment_detail,
1537
1537
  paymentStatus: (At = c.metadata) == null ? void 0 : At.payment_status,
1538
- isUnlocking: I(c.id),
1539
- onUnlockClick: () => M == null ? void 0 : M(c, p),
1540
- onFetchSource: async () => await (R == null ? void 0 : R(c, p)),
1541
- onDownloadClick: () => T == null ? void 0 : T(c, p)
1538
+ isUnlocking: A(c.id),
1539
+ onUnlockClick: () => E == null ? void 0 : E(c, v),
1540
+ onFetchSource: async () => await (I == null ? void 0 : I(c, v)),
1541
+ onDownloadClick: () => P == null ? void 0 : P(c, v)
1542
1542
  }
1543
1543
  ),
1544
- C && /* @__PURE__ */ n(C, {})
1544
+ T && /* @__PURE__ */ n(T, {})
1545
1545
  ] }),
1546
1546
  c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
1547
1547
  Dt,
1548
1548
  {
1549
1549
  message: W,
1550
- renderText: w
1550
+ renderText: b
1551
1551
  }
1552
1552
  ) })
1553
1553
  ] }) : ft ? (
1554
1554
  /* Tip-only messages render as a standalone bubble */
1555
- /* @__PURE__ */ n($e, { message: c, standalone: !0 })
1555
+ /* @__PURE__ */ n(Ue, { message: c, standalone: !0 })
1556
1556
  ) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
1557
1557
  fe && !bt && /* @__PURE__ */ n(
1558
- $e,
1558
+ Ue,
1559
1559
  {
1560
1560
  message: c,
1561
- hasAttachment: Pe,
1561
+ hasAttachment: $e,
1562
1562
  isMyMessage: te
1563
1563
  }
1564
1564
  ),
1565
1565
  ht && /* @__PURE__ */ n(Kn, { poll: ht }),
1566
- F != null && F.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
- y,
1566
+ B != null && B.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
+ S,
1568
1568
  {
1569
1569
  actionHandler: o,
1570
- attachments: F
1570
+ attachments: B
1571
1571
  }
1572
1572
  ) : null,
1573
1573
  q ? /* @__PURE__ */ n(
1574
1574
  x,
1575
1575
  {
1576
1576
  message: W,
1577
- renderText: w
1577
+ renderText: b
1578
1578
  }
1579
1579
  ) : /* @__PURE__ */ n(
1580
1580
  Dt,
1581
1581
  {
1582
1582
  message: W,
1583
- renderText: w
1583
+ renderText: b
1584
1584
  }
1585
1585
  ),
1586
1586
  /* @__PURE__ */ n(Jn, {})
@@ -1589,46 +1589,46 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1589
1589
  ),
1590
1590
  !gt && !ft && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
1591
1591
  (!fe || bt) && /* @__PURE__ */ n(
1592
- $e,
1592
+ Ue,
1593
1593
  {
1594
1594
  message: c,
1595
- hasAttachment: Pe,
1595
+ hasAttachment: $e,
1596
1596
  isMyMessage: te
1597
1597
  }
1598
1598
  ),
1599
1599
  s && fe && /* @__PURE__ */ n(
1600
1600
  Ea,
1601
1601
  {
1602
- selected: O,
1603
- onVoteUp: N,
1604
- onVoteDown: A
1602
+ selected: R,
1603
+ onVoteUp: D,
1604
+ onVoteDown: M
1605
1605
  }
1606
1606
  )
1607
1607
  ] }),
1608
1608
  X && /* @__PURE__ */ n(
1609
- Q,
1609
+ Z,
1610
1610
  {
1611
1611
  onClick: d,
1612
1612
  reply_count: c.reply_count
1613
1613
  }
1614
1614
  ),
1615
- ue && /* @__PURE__ */ n(J, {})
1615
+ ue && /* @__PURE__ */ n(ee, {})
1616
1616
  ]
1617
1617
  },
1618
1618
  c.id
1619
1619
  )
1620
1620
  ] });
1621
- }, Ia = V.memo(
1622
- Sa,
1621
+ }, Sa = j.memo(
1622
+ Ia,
1623
1623
  (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ln(e, t)
1624
1624
  ), Ta = (e) => {
1625
- const t = Ne("CustomMessage");
1626
- return /* @__PURE__ */ n(Ia, { ...t, ...e });
1625
+ const t = ye("CustomMessage");
1626
+ return /* @__PURE__ */ n(Sa, { ...t, ...e });
1627
1627
  }, Aa = () => {
1628
1628
  var s;
1629
- const { handleDelete: e, message: t } = Ne("CustomMessageActions");
1629
+ const { handleDelete: e, message: t } = ye("CustomMessageActions");
1630
1630
  return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
1631
- Xt,
1631
+ Wt,
1632
1632
  {
1633
1633
  onClick: e,
1634
1634
  "aria-label": "Delete",
@@ -1638,22 +1638,22 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1638
1638
  }
1639
1639
  );
1640
1640
  }, Ma = () => {
1641
- const { handleFlag: e } = Ne("CustomMessageActions");
1641
+ const { handleFlag: e } = ye("CustomMessageActions");
1642
1642
  return /* @__PURE__ */ n(
1643
- Xt,
1643
+ Wt,
1644
1644
  {
1645
1645
  onClick: e,
1646
1646
  "aria-label": "Report",
1647
1647
  title: "Report",
1648
1648
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
1649
- children: /* @__PURE__ */ n(Yt, { size: 16, weight: "light", "aria-hidden": !0 })
1649
+ children: /* @__PURE__ */ n(Ht, { size: 16, weight: "light", "aria-hidden": !0 })
1650
1650
  }
1651
1651
  );
1652
1652
  }, Ra = () => {
1653
1653
  var t;
1654
- const { message: e } = Ne("CustomMessageActions");
1654
+ const { message: e } = ye("CustomMessageActions");
1655
1655
  return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
1656
- zs,
1656
+ Os,
1657
1657
  {
1658
1658
  messageActionSet: [
1659
1659
  { Component: Aa, placement: "quick", type: "delete" },
@@ -1691,7 +1691,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1691
1691
  },
1692
1692
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
1693
1693
  "aria-label": "Close link preview",
1694
- children: /* @__PURE__ */ n(Le, { className: "size-4 text-black/90" })
1694
+ children: /* @__PURE__ */ n(Pe, { className: "size-4 text-black/90" })
1695
1695
  }
1696
1696
  ),
1697
1697
  /* @__PURE__ */ h("div", { className: "p-2", children: [
@@ -1705,7 +1705,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1705
1705
  linkPreviews: Array.from(e.previews.values()).filter(
1706
1706
  (t) => Lt.previewIsLoaded(t) || Lt.previewIsLoading(t)
1707
1707
  )
1708
- }), Pa = () => {
1708
+ }), za = () => {
1709
1709
  const { linkPreviewsManager: e } = Zn(), { linkPreviews: t } = Qn(
1710
1710
  e.state,
1711
1711
  Da
@@ -1720,7 +1720,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1720
1720
  },
1721
1721
  r.og_scrape_url
1722
1722
  )) }) : null;
1723
- }, st = V.createContext(!1), Si = () => _e(st), Oa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1723
+ }, st = j.createContext(!1), Ii = () => _e(st), Pa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1724
1724
  "button",
1725
1725
  {
1726
1726
  ...s,
@@ -1730,40 +1730,47 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1730
1730
  onClick: e,
1731
1731
  children: /* @__PURE__ */ n(Rs, { weight: "bold", className: "size-4" })
1732
1732
  }
1733
- ), za = () => {
1733
+ ), Oa = () => {
1734
1734
  const e = _e(st), { handleSubmit: t } = ts(), s = ns(), a = e || !s, {
1735
- SendButton: r = Oa,
1735
+ SendButton: r = Pa,
1736
1736
  AttachmentPreviewList: i = ss
1737
- } = Ht("CustomMessageInput");
1738
- return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full 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)]", children: [
1739
- /* @__PURE__ */ n(as, {}),
1740
- /* @__PURE__ */ n(Pa, {}),
1741
- /* @__PURE__ */ n(i, {}),
1742
- /* @__PURE__ */ h("div", { className: "flex", children: [
1743
- /* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
1744
- rs,
1745
- {
1746
- "aria-disabled": e || void 0,
1747
- className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
1748
- autoFocus: !e,
1749
- maxRows: 4,
1750
- readOnly: e,
1751
- tabIndex: e ? -1 : void 0
1752
- }
1753
- ) }),
1754
- /* @__PURE__ */ n(
1755
- r,
1756
- {
1757
- sendMessage: t,
1758
- "aria-label": "Send",
1759
- className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
1760
- "data-testid": "send-button",
1761
- disabled: a,
1762
- type: "button"
1763
- }
1764
- )
1765
- ] })
1766
- ] });
1737
+ } = Gt("CustomMessageInput");
1738
+ return /* @__PURE__ */ h(
1739
+ "div",
1740
+ {
1741
+ className: "central-container flex flex-col gap-2 min-w-0 w-full 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)]",
1742
+ "data-dd-privacy": "mask",
1743
+ children: [
1744
+ /* @__PURE__ */ n(as, {}),
1745
+ /* @__PURE__ */ n(za, {}),
1746
+ /* @__PURE__ */ n(i, {}),
1747
+ /* @__PURE__ */ h("div", { className: "flex", children: [
1748
+ /* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
1749
+ rs,
1750
+ {
1751
+ "aria-disabled": e || void 0,
1752
+ className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
1753
+ autoFocus: !e,
1754
+ maxRows: 4,
1755
+ readOnly: e,
1756
+ tabIndex: e ? -1 : void 0
1757
+ }
1758
+ ) }),
1759
+ /* @__PURE__ */ n(
1760
+ r,
1761
+ {
1762
+ sendMessage: t,
1763
+ "aria-label": "Send",
1764
+ className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
1765
+ "data-testid": "send-button",
1766
+ disabled: a,
1767
+ type: "button"
1768
+ }
1769
+ )
1770
+ ] })
1771
+ ]
1772
+ }
1773
+ );
1767
1774
  }, $a = ({
1768
1775
  renderActions: e,
1769
1776
  renderFooter: t,
@@ -1773,7 +1780,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1773
1780
  }) => {
1774
1781
  var o;
1775
1782
  const { channel: i } = de(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
1776
- return s ? /* @__PURE__ */ h(ae, { children: [
1783
+ return s ? /* @__PURE__ */ h(se, { children: [
1777
1784
  /* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
1778
1785
  t == null ? void 0 : t()
1779
1786
  ] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
@@ -1785,7 +1792,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1785
1792
  className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
1786
1793
  children: [
1787
1794
  e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
1788
- /* @__PURE__ */ n(st.Provider, { value: l, children: /* @__PURE__ */ n(es, { Input: r ?? za }) })
1795
+ /* @__PURE__ */ n(st.Provider, { value: l, children: /* @__PURE__ */ n(es, { Input: r ?? Oa }) })
1789
1796
  ]
1790
1797
  }
1791
1798
  ),
@@ -1797,14 +1804,14 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1797
1804
  ], Ba = {
1798
1805
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1799
1806
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1800
- }, Va = [
1807
+ }, Ua = [
1801
1808
  "SYSTEM_AGE_SAFETY_BLOCKED"
1802
- ], Ua = {
1809
+ ], ja = {
1803
1810
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1804
- }, Fe = "age safety guidelines.", ja = "https://linktr.ee/s/about/contact", Ut = (e) => Fa.includes(e), Ga = (e) => Va.includes(e), Ha = (e) => {
1811
+ }, je = "age safety guidelines.", Va = "https://linktr.ee/s/about/contact", jt = (e) => Fa.includes(e), Ga = (e) => Ua.includes(e), Ha = (e) => {
1805
1812
  var a;
1806
1813
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
1807
- if (Ut(t))
1814
+ if (jt(t))
1808
1815
  return {
1809
1816
  kind: "dm-agent",
1810
1817
  type: t
@@ -1815,26 +1822,26 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1815
1822
  type: t
1816
1823
  };
1817
1824
  const s = e.dm_agent_system_type;
1818
- if (Ut(s))
1825
+ if (jt(s))
1819
1826
  return {
1820
1827
  kind: "dm-agent",
1821
1828
  type: s
1822
1829
  };
1823
1830
  }, Ya = (e) => {
1824
- const t = e.indexOf(Fe);
1831
+ const t = e.indexOf(je);
1825
1832
  if (t === -1)
1826
1833
  return e;
1827
- const s = t + Fe.length;
1828
- return /* @__PURE__ */ h(ae, { children: [
1834
+ const s = t + je.length;
1835
+ return /* @__PURE__ */ h(se, { children: [
1829
1836
  e.slice(0, t),
1830
1837
  /* @__PURE__ */ n(
1831
1838
  "a",
1832
1839
  {
1833
- href: ja,
1840
+ href: Va,
1834
1841
  target: "_blank",
1835
1842
  rel: "noopener noreferrer",
1836
1843
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1837
- children: Fe
1844
+ children: je
1838
1845
  }
1839
1846
  ),
1840
1847
  e.slice(s)
@@ -1855,7 +1862,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1855
1862
  "data-dm-agent-system-type": s.type,
1856
1863
  children: [
1857
1864
  /* @__PURE__ */ n(
1858
- Ge,
1865
+ pe,
1859
1866
  {
1860
1867
  size: 16,
1861
1868
  weight: "regular",
@@ -1867,11 +1874,11 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1867
1874
  ]
1868
1875
  }
1869
1876
  ),
1870
- !t && /* @__PURE__ */ n(Oe, { message: e.message })
1877
+ !t && /* @__PURE__ */ n(Fe, { message: e.message })
1871
1878
  ] });
1872
1879
  }
1873
1880
  if ((s == null ? void 0 : s.kind) === "age-safety") {
1874
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ua[s.type];
1881
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || ja[s.type];
1875
1882
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1876
1883
  /* @__PURE__ */ h(
1877
1884
  "div",
@@ -1894,7 +1901,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1894
1901
  ]
1895
1902
  }
1896
1903
  ),
1897
- !t && /* @__PURE__ */ n(Oe, { message: e.message })
1904
+ !t && /* @__PURE__ */ n(Fe, { message: e.message })
1898
1905
  ] });
1899
1906
  }
1900
1907
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1903,9 +1910,9 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1903
1910
  /* @__PURE__ */ n("p", { children: e.message.text }),
1904
1911
  /* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
1905
1912
  ] }),
1906
- !t && /* @__PURE__ */ n(Oe, { message: e.message })
1913
+ !t && /* @__PURE__ */ n(Fe, { message: e.message })
1907
1914
  ] });
1908
- }, mn = We(!1), Be = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
1915
+ }, un = We(!1), Ve = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
1909
1916
  "animateTransform",
1910
1917
  {
1911
1918
  attributeName: "transform",
@@ -1916,20 +1923,20 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1916
1923
  repeatCount: "indefinite"
1917
1924
  }
1918
1925
  ) }), Wa = /* @__PURE__ */ new Set([
1919
- ze.Thinking,
1920
- ze.Generating,
1921
- ze.ExternalSources
1926
+ Be.Thinking,
1927
+ Be.Generating,
1928
+ Be.ExternalSources
1922
1929
  ]), Xa = ({ threadList: e }) => {
1923
- var w, b;
1924
- const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = is(), { aiState: l } = os(t), o = _e(mn);
1930
+ var b, N;
1931
+ const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = is(), { aiState: l } = ls(t), o = _e(un);
1925
1932
  if (!e && o && Wa.has(l)) {
1926
- const _ = Ka(t, (w = r.user) == null ? void 0 : w.id);
1933
+ const w = Ka(t, (b = r.user) == null ? void 0 : b.id);
1927
1934
  return /* @__PURE__ */ n(
1928
- jt,
1935
+ Vt,
1929
1936
  {
1930
- avatarId: (_ == null ? void 0 : _.id) ?? "ai-agent",
1931
- avatarName: (_ == null ? void 0 : _.name) ?? (_ == null ? void 0 : _.id) ?? "Agent",
1932
- avatarImage: _ == null ? void 0 : _.image,
1937
+ avatarId: (w == null ? void 0 : w.id) ?? "ai-agent",
1938
+ avatarName: (w == null ? void 0 : w.name) ?? (w == null ? void 0 : w.id) ?? "Agent",
1939
+ avatarImage: w == null ? void 0 : w.image,
1933
1940
  testId: "typing-indicator-ai"
1934
1941
  }
1935
1942
  );
@@ -1937,21 +1944,21 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1937
1944
  if ((s == null ? void 0 : s.typing_events) === !1)
1938
1945
  return null;
1939
1946
  const m = e ? [] : Object.values(i).filter(
1940
- ({ parent_id: _, user: v }) => {
1941
- var p;
1942
- return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && !_;
1947
+ ({ parent_id: w, user: p }) => {
1948
+ var v;
1949
+ return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && !w;
1943
1950
  }
1944
1951
  ), g = e ? Object.values(i).filter(
1945
- ({ parent_id: _, user: v }) => {
1946
- var p;
1947
- return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && _ === (a == null ? void 0 : a.id);
1952
+ ({ parent_id: w, user: p }) => {
1953
+ var v;
1954
+ return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && w === (a == null ? void 0 : a.id);
1948
1955
  }
1949
1956
  ) : [], u = e ? g : m;
1950
1957
  if (!u.length)
1951
1958
  return null;
1952
- const f = (b = u[0]) == null ? void 0 : b.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1959
+ const f = (N = u[0]) == null ? void 0 : N.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1953
1960
  return /* @__PURE__ */ n(
1954
- jt,
1961
+ Vt,
1955
1962
  {
1956
1963
  avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
1957
1964
  avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
@@ -1959,7 +1966,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1959
1966
  testId: "typing-indicator"
1960
1967
  }
1961
1968
  );
1962
- }, jt = ({
1969
+ }, Vt = ({
1963
1970
  avatarId: e,
1964
1971
  avatarName: t,
1965
1972
  avatarImage: s,
@@ -1974,7 +1981,7 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1974
1981
  },
1975
1982
  children: /* @__PURE__ */ h("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
1976
1983
  /* @__PURE__ */ n(
1977
- oe,
1984
+ ne,
1978
1985
  {
1979
1986
  className: "str-chat__avatar str-chat__message-sender-avatar",
1980
1987
  id: e,
@@ -1994,9 +2001,9 @@ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1994
2001
  height: "13",
1995
2002
  overflow: "visible",
1996
2003
  children: [
1997
- /* @__PURE__ */ n(Be, { cx: "4", index: 0 }),
1998
- /* @__PURE__ */ n(Be, { cx: "16", index: 1 }),
1999
- /* @__PURE__ */ n(Be, { cx: "28", index: 2 })
2004
+ /* @__PURE__ */ n(Ve, { cx: "4", index: 0 }),
2005
+ /* @__PURE__ */ n(Ve, { cx: "16", index: 1 }),
2006
+ /* @__PURE__ */ n(Ve, { cx: "28", index: 2 })
2000
2007
  ]
2001
2008
  }
2002
2009
  ) }) }) }) }) })
@@ -2015,7 +2022,7 @@ function Ka(e, t) {
2015
2022
  const Ja = () => null, Za = ({ className: e, message: t }) => /* @__PURE__ */ h(
2016
2023
  "div",
2017
2024
  {
2018
- className: k("flex items-center justify-center h-full", e),
2025
+ className: y("flex items-center justify-center h-full", e),
2019
2026
  children: [
2020
2027
  /* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
2021
2028
  /* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
@@ -2055,24 +2062,41 @@ const Ja = () => null, Za = ({ className: e, message: t }) => /* @__PURE__ */ h(
2055
2062
  t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
2056
2063
  ]
2057
2064
  }
2058
- ), Ae = V.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2065
+ ), Le = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2059
2066
  /* @__PURE__ */ n(Za, { className: "w-6 h-6" }),
2060
2067
  /* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
2061
2068
  ] }) }));
2062
- Ae.displayName = "LoadingState";
2063
- const pe = ({
2064
- className: e,
2065
- size: t = 16
2066
- }) => /* @__PURE__ */ n(
2067
- Ds,
2068
- {
2069
- weight: "fill",
2070
- size: t,
2071
- className: k("shrink-0 text-[#1D9BF0]", e),
2072
- "aria-label": "Verified",
2073
- role: "img"
2074
- }
2075
- ), le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Gt = "Replies instantly with AI assistant", Qa = ({
2069
+ Le.displayName = "LoadingState";
2070
+ const mn = ({ channel: e, participant: t }) => {
2071
+ const s = (t == null ? void 0 : t.customer) === !0, a = Kt(e);
2072
+ return !s && !a ? null : /* @__PURE__ */ h("span", { className: "inline-flex shrink-0 items-center gap-1", children: [
2073
+ s && /* @__PURE__ */ n(
2074
+ "span",
2075
+ {
2076
+ role: "img",
2077
+ "aria-label": "Customer",
2078
+ className: "inline-flex size-4 items-center justify-center rounded-full bg-[#22C55E] text-white",
2079
+ children: /* @__PURE__ */ n(
2080
+ Ds,
2081
+ {
2082
+ "aria-hidden": "true",
2083
+ className: "size-3",
2084
+ weight: "bold"
2085
+ }
2086
+ )
2087
+ }
2088
+ ),
2089
+ a && /* @__PURE__ */ n(
2090
+ "span",
2091
+ {
2092
+ role: "img",
2093
+ "aria-label": "Starred conversation",
2094
+ className: "inline-flex size-4 items-center justify-center rounded-full bg-[#F6C343] text-white",
2095
+ children: /* @__PURE__ */ n(Me, { "aria-hidden": "true", className: "size-3", weight: "fill" })
2096
+ }
2097
+ )
2098
+ ] });
2099
+ }, oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ae = "Replies instantly with AI assistant", Qa = ({
2076
2100
  onBack: e,
2077
2101
  showBackButton: t,
2078
2102
  showStarButton: s = !1,
@@ -2087,30 +2111,34 @@ const pe = ({
2087
2111
  onReportParticipantClick: u,
2088
2112
  customChannelActions: f,
2089
2113
  renderChannelActions: c,
2090
- showChannelInfo: w = !0,
2091
- onParticipantNameClick: b,
2092
- renderHeaderTitleBadges: _
2114
+ showChannelInfo: b = !0,
2115
+ onParticipantNameClick: N,
2116
+ renderHeaderTitleBadges: w
2093
2117
  }) => {
2094
- var U, O, N, A, y, E;
2095
- const { channel: v } = de(), p = V.useMemo(() => {
2096
- var P, j;
2097
- const C = (P = v._client) == null ? void 0 : P.userID;
2098
- return C ? Object.values(((j = v.state) == null ? void 0 : j.members) || {}).find(
2099
- (J) => {
2100
- var Q;
2101
- return ((Q = J.user) == null ? void 0 : Q.id) && J.user.id !== C;
2118
+ var D, M, S, k, T, O, F;
2119
+ const { channel: p } = de(), v = j.useMemo(() => {
2120
+ var Z, G;
2121
+ const V = (Z = p._client) == null ? void 0 : Z.userID;
2122
+ return V ? Object.values(((G = p.state) == null ? void 0 : G.members) || {}).find(
2123
+ (x) => {
2124
+ var C;
2125
+ return ((C = x.user) == null ? void 0 : C.id) && x.user.id !== V;
2102
2126
  }
2103
2127
  ) : void 0;
2104
- }, [(U = v._client) == null ? void 0 : U.userID, (O = v.state) == null ? void 0 : O.members]), I = Zt(p == null ? void 0 : p.user), M = (N = p == null ? void 0 : p.user) == null ? void 0 : N.image, R = ((A = p == null ? void 0 : p.user) == null ? void 0 : A.is_verified) === !0, T = Jt(v), L = _ == null ? void 0 : _({
2105
- channel: v,
2106
- participant: p
2107
- }), D = async () => {
2128
+ }, [(D = p._client) == null ? void 0 : D.userID, (M = p.state) == null ? void 0 : M.members]), A = Jt(v == null ? void 0 : v.user), E = (S = v == null ? void 0 : v.user) == null ? void 0 : S.image, I = Kt(p), P = w == null ? void 0 : w({
2129
+ channel: p,
2130
+ participant: v
2131
+ }), L = "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", _ = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ h(se, { children: [
2132
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2133
+ /* @__PURE__ */ n(mn, { channel: p, participant: v }),
2134
+ P && /* @__PURE__ */ n("span", { className: "shrink-0", children: P })
2135
+ ] }), R = async () => {
2108
2136
  try {
2109
- T ? await v.unpin() : await v.pin();
2110
- } catch (C) {
2137
+ I ? await p.unpin() : await p.pin();
2138
+ } catch (V) {
2111
2139
  console.error(
2112
2140
  "[CustomChannelHeader] Failed to update pinned status:",
2113
- C
2141
+ V
2114
2142
  );
2115
2143
  }
2116
2144
  };
@@ -2119,78 +2147,106 @@ const pe = ({
2119
2147
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
2120
2148
  "button",
2121
2149
  {
2122
- className: k(
2123
- le,
2150
+ className: y(
2151
+ oe,
2124
2152
  "messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
2125
2153
  ),
2126
2154
  onClick: e || (() => {
2127
2155
  }),
2128
2156
  type: "button",
2129
2157
  "aria-label": "Back to conversations",
2130
- children: /* @__PURE__ */ n(Ot, { className: "size-5 text-black/90" })
2158
+ children: /* @__PURE__ */ n(Pt, { className: "size-5 text-black/90" })
2131
2159
  }
2132
2160
  ) }),
2133
- /* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
2134
- /* @__PURE__ */ n(
2135
- oe,
2136
- {
2137
- id: ((y = p == null ? void 0 : p.user) == null ? void 0 : y.id) || v.id || "unknown",
2138
- name: I,
2139
- image: M,
2140
- starred: s && T,
2141
- dmAgentEnabled: a,
2142
- size: 48
2143
- }
2144
- ),
2145
- b ? /* @__PURE__ */ h(
2146
- "button",
2147
- {
2148
- type: "button",
2149
- onClick: b,
2150
- "aria-label": `View details for ${I}`,
2151
- className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
2152
- children: [
2153
- /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
2154
- R && /* @__PURE__ */ n(pe, {}),
2155
- L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L }),
2156
- /* @__PURE__ */ n(He, { className: "size-3 shrink-0", weight: "bold" })
2157
- ]
2158
- }
2159
- ) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
2160
- /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
2161
- R && /* @__PURE__ */ n(pe, {}),
2162
- L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
2163
- ] }),
2164
- a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2165
- /* @__PURE__ */ n(Ge, { className: "size-3 shrink-0 text-black/55" }),
2166
- /* @__PURE__ */ n("span", { children: Gt })
2167
- ] })
2168
- ] }),
2161
+ /* @__PURE__ */ n(
2162
+ "div",
2163
+ {
2164
+ className: "flex flex-col gap-1 items-center",
2165
+ "data-dd-privacy": "mask",
2166
+ children: N ? /* @__PURE__ */ h(
2167
+ "button",
2168
+ {
2169
+ type: "button",
2170
+ onClick: N,
2171
+ "aria-label": `View details for ${A}`,
2172
+ className: y(
2173
+ L,
2174
+ "appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
2175
+ ),
2176
+ children: [
2177
+ /* @__PURE__ */ n(
2178
+ ne,
2179
+ {
2180
+ id: ((k = v == null ? void 0 : v.user) == null ? void 0 : k.id) || p.id || "unknown",
2181
+ name: A,
2182
+ image: E,
2183
+ dmAgentEnabled: a,
2184
+ size: 48
2185
+ }
2186
+ ),
2187
+ /* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
2188
+ z,
2189
+ /* @__PURE__ */ n(ve, { className: "size-3 shrink-0", weight: "bold" })
2190
+ ] }),
2191
+ a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2192
+ /* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
2193
+ /* @__PURE__ */ n("span", { children: Ae })
2194
+ ] })
2195
+ ]
2196
+ }
2197
+ ) : /* @__PURE__ */ h("div", { className: L, children: [
2198
+ /* @__PURE__ */ n(
2199
+ ne,
2200
+ {
2201
+ id: ((T = v == null ? void 0 : v.user) == null ? void 0 : T.id) || p.id || "unknown",
2202
+ name: A,
2203
+ image: E,
2204
+ dmAgentEnabled: a,
2205
+ size: 48
2206
+ }
2207
+ ),
2208
+ /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
2209
+ z,
2210
+ /* @__PURE__ */ n(
2211
+ ve,
2212
+ {
2213
+ className: "invisible size-3 shrink-0",
2214
+ weight: "bold"
2215
+ }
2216
+ )
2217
+ ] }),
2218
+ a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2219
+ /* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
2220
+ /* @__PURE__ */ n("span", { children: Ae })
2221
+ ] })
2222
+ ] })
2223
+ }
2224
+ ),
2169
2225
  /* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
2170
2226
  s && /* @__PURE__ */ n(
2171
2227
  "button",
2172
2228
  {
2173
- className: le,
2174
- onClick: D,
2229
+ className: oe,
2230
+ onClick: R,
2175
2231
  type: "button",
2176
- "aria-label": T ? "Unstar conversation" : "Star conversation",
2232
+ "aria-label": I ? "Unstar conversation" : "Star conversation",
2177
2233
  children: /* @__PURE__ */ n(
2178
- Ue,
2234
+ Me,
2179
2235
  {
2180
- className: k("size-5", {
2181
- "text-yellow-600": T,
2182
- "text-black/90": !T
2236
+ className: y("size-5", {
2237
+ "text-yellow-600": I,
2238
+ "text-black/90": !I
2183
2239
  }),
2184
- weight: T ? "duotone" : "regular"
2240
+ weight: I ? "duotone" : "regular"
2185
2241
  }
2186
2242
  )
2187
2243
  }
2188
2244
  ),
2189
- w && (c !== void 0 ? c : /* @__PURE__ */ n(
2245
+ b && (c !== void 0 ? c : /* @__PURE__ */ n(
2190
2246
  Ft,
2191
2247
  {
2192
- channel: v,
2193
- participant: p,
2248
+ channel: p,
2249
+ participant: v,
2194
2250
  showDeleteConversation: l,
2195
2251
  showBlockParticipant: o,
2196
2252
  showReportParticipant: d,
@@ -2200,60 +2256,85 @@ const pe = ({
2200
2256
  onBlockParticipantClick: g,
2201
2257
  onReportParticipantClick: u,
2202
2258
  customChannelActions: f,
2203
- triggerClassName: k(le, "bg-[#F1F0EE]")
2259
+ triggerClassName: y(oe, "bg-[#F1F0EE]")
2204
2260
  }
2205
2261
  ))
2206
2262
  ] })
2207
2263
  ] }),
2208
2264
  /* @__PURE__ */ h("div", { className: "px-6 py-3 hidden @lg:flex items-center justify-between gap-3 min-h-12 border-b border-b-black/[0.08]", children: [
2209
- /* @__PURE__ */ h("div", { className: "flex items-center gap-4 min-w-0", children: [
2265
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-4 min-w-0", "data-dd-privacy": "mask", children: [
2210
2266
  t && e && /* @__PURE__ */ n(
2211
2267
  "button",
2212
2268
  {
2213
- className: k(
2214
- le,
2269
+ className: y(
2270
+ oe,
2215
2271
  "messaging-channel-view-back-button-desktop"
2216
2272
  ),
2217
2273
  type: "button",
2218
2274
  onClick: e,
2219
2275
  "aria-label": "Back to conversations",
2220
- children: /* @__PURE__ */ n(Ot, { className: "size-5 text-black/90" })
2276
+ children: /* @__PURE__ */ n(Pt, { className: "size-5 text-black/90" })
2221
2277
  }
2222
2278
  ),
2223
- /* @__PURE__ */ n(
2224
- oe,
2279
+ N ? /* @__PURE__ */ h(
2280
+ "button",
2225
2281
  {
2226
- id: ((E = p == null ? void 0 : p.user) == null ? void 0 : E.id) || v.id || "unknown",
2227
- name: I,
2228
- image: M,
2229
- starred: s && T,
2230
- dmAgentEnabled: a,
2231
- size: 48
2282
+ type: "button",
2283
+ onClick: N,
2284
+ "aria-label": `View details for ${A}`,
2285
+ className: y(
2286
+ _,
2287
+ "appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
2288
+ ),
2289
+ children: [
2290
+ /* @__PURE__ */ n(
2291
+ ne,
2292
+ {
2293
+ id: ((O = v == null ? void 0 : v.user) == null ? void 0 : O.id) || p.id || "unknown",
2294
+ name: A,
2295
+ image: E,
2296
+ dmAgentEnabled: a,
2297
+ size: 48
2298
+ }
2299
+ ),
2300
+ /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2301
+ /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
2302
+ z,
2303
+ /* @__PURE__ */ n(ve, { className: "size-4 shrink-0", weight: "bold" })
2304
+ ] }),
2305
+ a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2306
+ /* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
2307
+ /* @__PURE__ */ n("span", { className: "truncate", children: Ae })
2308
+ ] })
2309
+ ] })
2310
+ ]
2232
2311
  }
2233
- ),
2234
- /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2235
- b ? /* @__PURE__ */ h(
2236
- "button",
2312
+ ) : /* @__PURE__ */ h("div", { className: _, children: [
2313
+ /* @__PURE__ */ n(
2314
+ ne,
2237
2315
  {
2238
- type: "button",
2239
- onClick: b,
2240
- "aria-label": `View details for ${I}`,
2241
- className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
2242
- children: [
2243
- /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
2244
- R && /* @__PURE__ */ n(pe, {}),
2245
- L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L }),
2246
- /* @__PURE__ */ n(He, { className: "size-4 shrink-0", weight: "bold" })
2247
- ]
2316
+ id: ((F = v == null ? void 0 : v.user) == null ? void 0 : F.id) || p.id || "unknown",
2317
+ name: A,
2318
+ image: E,
2319
+ dmAgentEnabled: a,
2320
+ size: 48
2248
2321
  }
2249
- ) : /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
2250
- /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
2251
- R && /* @__PURE__ */ n(pe, {}),
2252
- L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
2253
- ] }),
2254
- a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2255
- /* @__PURE__ */ n(Ge, { className: "size-3 shrink-0 text-black/55" }),
2256
- /* @__PURE__ */ n("span", { className: "truncate", children: Gt })
2322
+ ),
2323
+ /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2324
+ /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
2325
+ z,
2326
+ /* @__PURE__ */ n(
2327
+ ve,
2328
+ {
2329
+ className: "invisible size-4 shrink-0",
2330
+ weight: "bold"
2331
+ }
2332
+ )
2333
+ ] }),
2334
+ a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2335
+ /* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
2336
+ /* @__PURE__ */ n("span", { className: "truncate", children: Ae })
2337
+ ] })
2257
2338
  ] })
2258
2339
  ] })
2259
2340
  ] }),
@@ -2261,27 +2342,27 @@ const pe = ({
2261
2342
  s && /* @__PURE__ */ n(
2262
2343
  "button",
2263
2344
  {
2264
- className: le,
2265
- onClick: D,
2345
+ className: oe,
2346
+ onClick: R,
2266
2347
  type: "button",
2267
- "aria-label": T ? "Unstar conversation" : "Star conversation",
2348
+ "aria-label": I ? "Unstar conversation" : "Star conversation",
2268
2349
  children: /* @__PURE__ */ n(
2269
- Ue,
2350
+ Me,
2270
2351
  {
2271
- className: k("size-6", {
2272
- "text-yellow-600": T,
2273
- "text-black/90": !T
2352
+ className: y("size-6", {
2353
+ "text-yellow-600": I,
2354
+ "text-black/90": !I
2274
2355
  }),
2275
- weight: T ? "duotone" : "regular"
2356
+ weight: I ? "duotone" : "regular"
2276
2357
  }
2277
2358
  )
2278
2359
  }
2279
2360
  ),
2280
- w && (c !== void 0 ? c : /* @__PURE__ */ n(
2361
+ b && (c !== void 0 ? c : /* @__PURE__ */ n(
2281
2362
  Ft,
2282
2363
  {
2283
- channel: v,
2284
- participant: p,
2364
+ channel: p,
2365
+ participant: v,
2285
2366
  showDeleteConversation: l,
2286
2367
  showBlockParticipant: o,
2287
2368
  showReportParticipant: d,
@@ -2291,7 +2372,7 @@ const pe = ({
2291
2372
  onBlockParticipantClick: g,
2292
2373
  onReportParticipantClick: u,
2293
2374
  customChannelActions: f,
2294
- triggerClassName: le
2375
+ triggerClassName: oe
2295
2376
  }
2296
2377
  ))
2297
2378
  ] })
@@ -2312,56 +2393,56 @@ const pe = ({
2312
2393
  showBlockParticipant: u = !0,
2313
2394
  showReportParticipant: f = !0,
2314
2395
  composerDisabled: c = !1,
2315
- composerDisabledReason: w,
2316
- showStarButton: b = !1,
2317
- chatbotVotingEnabled: _ = !1,
2318
- renderChannelBanner: v,
2319
- renderHeaderTitleBadges: p,
2320
- customChannelActions: I,
2321
- renderChannelActions: M,
2322
- renderMessage: R,
2323
- dmAgentEnabled: T = !1,
2396
+ composerDisabledReason: b,
2397
+ showStarButton: N = !1,
2398
+ chatbotVotingEnabled: w = !1,
2399
+ renderChannelBanner: p,
2400
+ renderHeaderTitleBadges: v,
2401
+ customChannelActions: A,
2402
+ renderChannelActions: E,
2403
+ renderMessage: I,
2404
+ dmAgentEnabled: P = !1,
2324
2405
  viewerLanguage: L,
2325
- showChannelInfo: D = !0,
2326
- onParticipantNameClick: U,
2327
- composerInput: O
2406
+ showChannelInfo: _ = !0,
2407
+ onParticipantNameClick: z,
2408
+ composerInput: R
2328
2409
  }) => {
2329
- var j, J, Q, Y, x, S;
2330
- const { channel: N } = de(), A = V.useMemo(() => {
2331
- var q, F;
2332
- const B = (q = N._client) == null ? void 0 : q.userID;
2333
- return B ? Object.values(((F = N.state) == null ? void 0 : F.members) || {}).find(
2410
+ var V, ee, Z, G, x, C;
2411
+ const { channel: D } = de(), M = j.useMemo(() => {
2412
+ var q, B;
2413
+ const U = (q = D._client) == null ? void 0 : q.userID;
2414
+ return U ? Object.values(((B = D.state) == null ? void 0 : B.members) || {}).find(
2334
2415
  (W) => {
2335
2416
  var X;
2336
- return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== B;
2417
+ return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== U;
2337
2418
  }
2338
2419
  ) : void 0;
2339
- }, [(j = N._client) == null ? void 0 : j.userID, (J = N.state) == null ? void 0 : J.members]), y = V.useMemo(() => {
2340
- var q, F;
2341
- const B = (q = N._client) == null ? void 0 : q.userID;
2342
- return B ? Object.values(((F = N.state) == null ? void 0 : F.members) || {}).find((W) => {
2420
+ }, [(V = D._client) == null ? void 0 : V.userID, (ee = D.state) == null ? void 0 : ee.members]), S = j.useMemo(() => {
2421
+ var q, B;
2422
+ const U = (q = D._client) == null ? void 0 : q.userID;
2423
+ return U ? Object.values(((B = D.state) == null ? void 0 : B.members) || {}).find((W) => {
2343
2424
  var X;
2344
- return ((X = W.user) == null ? void 0 : X.id) === B;
2425
+ return ((X = W.user) == null ? void 0 : X.id) === U;
2345
2426
  }) : void 0;
2346
- }, [(Q = N._client) == null ? void 0 : Q.userID, (Y = N.state) == null ? void 0 : Y.members]), E = ((x = y == null ? void 0 : y.user) == null ? void 0 : x.is_account) ?? (y == null ? void 0 : y.is_account), C = ((S = A == null ? void 0 : A.user) == null ? void 0 : S.is_account) ?? (A == null ? void 0 : A.is_account), $ = T && E === !1 && C === !0, P = Z(
2347
- (B) => {
2348
- const { message: G } = Ne("ChannelView"), q = /* @__PURE__ */ n(
2427
+ }, [(Z = D._client) == null ? void 0 : Z.userID, (G = D.state) == null ? void 0 : G.members]), k = ((x = S == null ? void 0 : S.user) == null ? void 0 : x.is_account) ?? (S == null ? void 0 : S.is_account), T = ((C = M == null ? void 0 : M.user) == null ? void 0 : C.is_account) ?? (M == null ? void 0 : M.is_account), O = P && k === !1 && T === !0, F = J(
2428
+ (U) => {
2429
+ const { message: H } = ye("ChannelView"), q = /* @__PURE__ */ n(
2349
2430
  Ta,
2350
2431
  {
2351
- ...B,
2352
- chatbotVotingEnabled: _,
2432
+ ...U,
2433
+ chatbotVotingEnabled: w,
2353
2434
  viewerLanguage: L
2354
2435
  }
2355
2436
  );
2356
- return !R || !G ? q : R(q, G);
2437
+ return !I || !H ? q : I(q, H);
2357
2438
  },
2358
- [_, R, L]
2439
+ [w, I, L]
2359
2440
  );
2360
- return /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(
2441
+ return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
2361
2442
  cs,
2362
2443
  {
2363
2444
  overrides: {
2364
- Message: P,
2445
+ Message: F,
2365
2446
  MessageActions: Ra
2366
2447
  },
2367
2448
  children: /* @__PURE__ */ h(ds, { children: [
@@ -2370,9 +2451,9 @@ const pe = ({
2370
2451
  {
2371
2452
  onBack: e,
2372
2453
  showBackButton: t,
2373
- showChannelInfo: D,
2374
- showStarButton: b,
2375
- dmAgentEnabled: $,
2454
+ showChannelInfo: _,
2455
+ showStarButton: N,
2456
+ dmAgentEnabled: O,
2376
2457
  onLeaveConversation: i,
2377
2458
  onBlockParticipant: l,
2378
2459
  showDeleteConversation: o,
@@ -2381,13 +2462,13 @@ const pe = ({
2381
2462
  onDeleteConversationClick: d,
2382
2463
  onBlockParticipantClick: m,
2383
2464
  onReportParticipantClick: g,
2384
- customChannelActions: I,
2385
- renderChannelActions: M,
2386
- onParticipantNameClick: U,
2387
- renderHeaderTitleBadges: p
2465
+ customChannelActions: A,
2466
+ renderChannelActions: E,
2467
+ onParticipantNameClick: z,
2468
+ renderHeaderTitleBadges: v
2388
2469
  }
2389
2470
  ) }, "lt-channel-header"),
2390
- v ? /* @__PURE__ */ n(V.Fragment, { children: v() }, "lt-channel-banner") : null,
2471
+ p ? /* @__PURE__ */ n(j.Fragment, { children: p() }, "lt-channel-banner") : null,
2391
2472
  /* @__PURE__ */ n(
2392
2473
  "div",
2393
2474
  {
@@ -2396,24 +2477,24 @@ const pe = ({
2396
2477
  },
2397
2478
  "lt-channel-message-list"
2398
2479
  ),
2399
- r ? /* @__PURE__ */ n(V.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
2480
+ r ? /* @__PURE__ */ n(j.Fragment, { children: r(D) }, "lt-channel-conversation-footer") : null,
2400
2481
  /* @__PURE__ */ n(
2401
2482
  $a,
2402
2483
  {
2403
2484
  ...s && {
2404
- renderActions: () => s == null ? void 0 : s(N)
2485
+ renderActions: () => s == null ? void 0 : s(D)
2405
2486
  },
2406
- renderFooter: () => a == null ? void 0 : a(N),
2487
+ renderFooter: () => a == null ? void 0 : a(D),
2407
2488
  disabled: c,
2408
- disabledReason: w,
2409
- composerInput: O
2489
+ disabledReason: b,
2490
+ composerInput: R
2410
2491
  },
2411
2492
  "lt-channel-message-input"
2412
2493
  )
2413
2494
  ] })
2414
2495
  }
2415
2496
  ) });
2416
- }, hn = V.memo(
2497
+ }, hn = j.memo(
2417
2498
  ({
2418
2499
  channel: e,
2419
2500
  onBack: t,
@@ -2429,79 +2510,79 @@ const pe = ({
2429
2510
  onDeleteConversationClick: u,
2430
2511
  onBlockParticipantClick: f,
2431
2512
  onReportParticipantClick: c,
2432
- showBlockParticipant: w = !0,
2433
- showReportParticipant: b = !0,
2434
- composerDisabled: _ = !1,
2435
- composerDisabledReason: v,
2436
- dmAgentEnabled: p,
2437
- messageMetadata: I,
2438
- onMessageSent: M,
2439
- showStarButton: R = !1,
2440
- chatbotVotingEnabled: T = !1,
2513
+ showBlockParticipant: b = !0,
2514
+ showReportParticipant: N = !0,
2515
+ composerDisabled: w = !1,
2516
+ composerDisabledReason: p,
2517
+ dmAgentEnabled: v,
2518
+ messageMetadata: A,
2519
+ onMessageSent: E,
2520
+ showStarButton: I = !1,
2521
+ chatbotVotingEnabled: P = !1,
2441
2522
  renderChannelBanner: L,
2442
- renderHeaderTitleBadges: D,
2443
- customChannelActions: U,
2444
- renderChannelActions: O,
2445
- renderMessage: N,
2446
- onMessageLinkClick: A,
2447
- sendButton: y,
2448
- attachmentPreviewList: E,
2449
- viewerLanguage: C,
2450
- showChannelInfo: $ = !0,
2451
- onParticipantNameClick: P,
2452
- composerInput: j
2523
+ renderHeaderTitleBadges: _,
2524
+ customChannelActions: z,
2525
+ renderChannelActions: R,
2526
+ renderMessage: D,
2527
+ onMessageLinkClick: M,
2528
+ sendButton: S,
2529
+ attachmentPreviewList: k,
2530
+ viewerLanguage: T,
2531
+ showChannelInfo: O = !0,
2532
+ onParticipantNameClick: F,
2533
+ composerInput: V
2453
2534
  }) => {
2454
- const J = Z(
2455
- async (Y, x, S) => {
2535
+ const ee = J(
2536
+ async (G, x, C) => {
2456
2537
  var X;
2457
- const B = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0, G = p && !B, q = {
2538
+ const U = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0, H = v && !U, q = {
2458
2539
  ...x,
2459
- ...G && { silent: !0 },
2460
- ...I && {
2540
+ ...H && { silent: !0 },
2541
+ ...A && {
2461
2542
  metadata: {
2462
2543
  ...x.metadata ?? {},
2463
- ...I
2544
+ ...A
2464
2545
  }
2465
2546
  }
2466
- }, F = {
2467
- ...S,
2468
- ...G && { skip_push: !0 }
2469
- }, W = await e.sendMessage(q, F);
2470
- return M == null || M(W), W;
2547
+ }, B = {
2548
+ ...C,
2549
+ ...H && { skip_push: !0 }
2550
+ }, W = await e.sendMessage(q, B);
2551
+ return E == null || E(W), W;
2471
2552
  },
2472
- [e, p, I, M]
2473
- ), Q = H(null);
2553
+ [e, v, A, E]
2554
+ ), Z = Y(null);
2474
2555
  return K(() => {
2475
- if (!A) return;
2476
- const Y = Q.current;
2477
- if (!Y) return;
2478
- const x = (S) => {
2479
- const B = S.target, G = B == null ? void 0 : B.closest("a[href]"), q = G == null ? void 0 : G.getAttribute("href");
2556
+ if (!M) return;
2557
+ const G = Z.current;
2558
+ if (!G) return;
2559
+ const x = (C) => {
2560
+ const U = C.target, H = U == null ? void 0 : U.closest("a[href]"), q = H == null ? void 0 : H.getAttribute("href");
2480
2561
  if (!q) return;
2481
- const F = G == null ? void 0 : G.closest("[data-message-id]"), W = F == null ? void 0 : F.getAttribute("data-message-id"), X = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
2482
- A(q, X);
2562
+ const B = H == null ? void 0 : H.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), X = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
2563
+ M(q, X);
2483
2564
  };
2484
- return Y.addEventListener("click", x), () => Y.removeEventListener("click", x);
2485
- }, [A, e]), /* @__PURE__ */ n(
2565
+ return G.addEventListener("click", x), () => G.removeEventListener("click", x);
2566
+ }, [M, e]), /* @__PURE__ */ n(
2486
2567
  "div",
2487
2568
  {
2488
- ref: Q,
2489
- className: k(
2569
+ ref: Z,
2570
+ className: y(
2490
2571
  "messaging-channel-view h-full flex flex-col",
2491
2572
  d
2492
2573
  ),
2493
- children: /* @__PURE__ */ n(mn.Provider, { value: p ?? !1, children: /* @__PURE__ */ n(
2494
- ls,
2574
+ children: /* @__PURE__ */ n(un.Provider, { value: v ?? !1, children: /* @__PURE__ */ n(
2575
+ os,
2495
2576
  {
2496
2577
  channel: e,
2497
2578
  MessageSystem: qa,
2498
2579
  EmptyStateIndicator: m,
2499
- LoadingIndicator: Ae,
2580
+ LoadingIndicator: Le,
2500
2581
  DateSeparator: Hs,
2501
2582
  TypingIndicator: Xa,
2502
- doSendMessageRequest: J,
2503
- ...y ? { SendButton: y } : {},
2504
- ...E ? { AttachmentPreviewList: E } : {},
2583
+ doSendMessageRequest: ee,
2584
+ ...S ? { SendButton: S } : {},
2585
+ ...k ? { AttachmentPreviewList: k } : {},
2505
2586
  children: /* @__PURE__ */ n(
2506
2587
  er,
2507
2588
  {
@@ -2517,22 +2598,22 @@ const pe = ({
2517
2598
  onDeleteConversationClick: u,
2518
2599
  onBlockParticipantClick: f,
2519
2600
  onReportParticipantClick: c,
2520
- showBlockParticipant: w,
2521
- showReportParticipant: b,
2522
- composerDisabled: _,
2523
- composerDisabledReason: v,
2524
- showStarButton: R,
2525
- dmAgentEnabled: p,
2526
- chatbotVotingEnabled: T,
2601
+ showBlockParticipant: b,
2602
+ showReportParticipant: N,
2603
+ composerDisabled: w,
2604
+ composerDisabledReason: p,
2605
+ showStarButton: I,
2606
+ dmAgentEnabled: v,
2607
+ chatbotVotingEnabled: P,
2527
2608
  renderChannelBanner: L,
2528
- renderHeaderTitleBadges: D,
2529
- customChannelActions: U,
2530
- renderChannelActions: O,
2531
- renderMessage: N,
2532
- viewerLanguage: C,
2533
- showChannelInfo: $,
2534
- onParticipantNameClick: P,
2535
- composerInput: j
2609
+ renderHeaderTitleBadges: _,
2610
+ customChannelActions: z,
2611
+ renderChannelActions: R,
2612
+ renderMessage: D,
2613
+ viewerLanguage: T,
2614
+ showChannelInfo: O,
2615
+ onParticipantNameClick: F,
2616
+ composerInput: V
2536
2617
  }
2537
2618
  )
2538
2619
  }
@@ -2542,7 +2623,7 @@ const pe = ({
2542
2623
  }
2543
2624
  );
2544
2625
  hn.displayName = "ChannelView";
2545
- const ve = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
2626
+ const xe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
2546
2627
  /* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
2547
2628
  /* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2548
2629
  /* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
@@ -2556,8 +2637,8 @@ const ve = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
2556
2637
  }
2557
2638
  )
2558
2639
  ] }) }));
2559
- ve.displayName = "ErrorState";
2560
- const Ii = ({
2640
+ xe.displayName = "ErrorState";
2641
+ const Si = ({
2561
2642
  capabilities: e = {},
2562
2643
  renderMessageInputActions: t,
2563
2644
  renderConversationFooter: s,
@@ -2572,135 +2653,135 @@ const Ii = ({
2572
2653
  onMessageSent: u,
2573
2654
  chatbotVotingEnabled: f = !1,
2574
2655
  viewerLanguage: c,
2575
- renderHeaderTitleBadges: w,
2576
- renderChannelBanner: b,
2577
- customChannelActions: _,
2578
- renderChannelActions: v,
2579
- onParticipantNameClick: p,
2580
- renderMessage: I,
2581
- onMessageLinkClick: M,
2582
- showChannelInfo: R,
2583
- composerInput: T
2656
+ renderHeaderTitleBadges: b,
2657
+ renderChannelBanner: N,
2658
+ customChannelActions: w,
2659
+ renderChannelActions: p,
2660
+ onParticipantNameClick: v,
2661
+ renderMessage: A,
2662
+ onMessageLinkClick: E,
2663
+ showChannelInfo: I,
2664
+ composerInput: P
2584
2665
  }) => {
2585
2666
  const {
2586
2667
  client: L,
2587
- isConnected: D,
2588
- isLoading: U,
2589
- error: O,
2590
- refreshConnection: N,
2591
- service: A,
2592
- debug: y
2593
- } = $s(), [E, C] = z(null), [$, P] = z(null), [j, J] = z(!1), { showDeleteConversation: Q = !0 } = e, Y = H(l);
2594
- Y.current = l;
2595
- const x = H(a);
2668
+ isConnected: _,
2669
+ isLoading: z,
2670
+ error: R,
2671
+ refreshConnection: D,
2672
+ service: M,
2673
+ debug: S
2674
+ } = $s(), [k, T] = $(null), [O, F] = $(null), [V, ee] = $(!1), { showDeleteConversation: Z = !0 } = e, G = Y(l);
2675
+ G.current = l;
2676
+ const x = Y(a);
2596
2677
  x.current = a;
2597
- const S = H(null), B = H(null);
2678
+ const C = Y(null), U = Y(null);
2598
2679
  K(() => {
2599
- B.current = E;
2600
- }, [E]), K(() => {
2601
- if (!L || !D) return;
2602
- const F = L.userID;
2603
- if (!F) return;
2604
- const W = `${F}::${i}`;
2605
- if (S.current === W) return;
2606
- S.current = W;
2680
+ U.current = k;
2681
+ }, [k]), K(() => {
2682
+ if (!L || !_) return;
2683
+ const B = L.userID;
2684
+ if (!B) return;
2685
+ const W = `${B}::${i}`;
2686
+ if (C.current === W) return;
2687
+ C.current = W;
2607
2688
  const X = () => {
2608
- S.current === W && (S.current = null);
2689
+ C.current === W && (C.current = null);
2609
2690
  };
2610
2691
  (async () => {
2611
2692
  var me, he;
2612
2693
  try {
2613
- y && console.log(
2694
+ S && console.log(
2614
2695
  "[MessagingShell] Loading initial conversation with:",
2615
2696
  i
2616
2697
  );
2617
- const ee = await L.queryChannels(
2698
+ const Q = await L.queryChannels(
2618
2699
  {
2619
2700
  type: "messaging",
2620
- members: { $eq: [F, i] }
2701
+ members: { $eq: [B, i] }
2621
2702
  },
2622
2703
  {},
2623
2704
  { limit: 1 }
2624
2705
  );
2625
- if (ee.length > 0) {
2626
- C(ee[0]), P(null), (me = x.current) == null || me.call(x, ee[0]), y && console.log(
2706
+ if (Q.length > 0) {
2707
+ T(Q[0]), F(null), (me = x.current) == null || me.call(x, Q[0]), S && console.log(
2627
2708
  "[MessagingShell] Initial conversation loaded:",
2628
- ee[0].id
2709
+ Q[0].id
2629
2710
  );
2630
2711
  return;
2631
2712
  }
2632
- const te = Y.current;
2633
- if (!te || !A) {
2634
- X(), P("No conversation found with this account"), y && console.log(
2713
+ const te = G.current;
2714
+ if (!te || !M) {
2715
+ X(), F("No conversation found with this account"), S && console.log(
2635
2716
  "[MessagingShell] No conversation found for:",
2636
2717
  i
2637
2718
  );
2638
2719
  return;
2639
2720
  }
2640
2721
  try {
2641
- const ie = await A.startChannelWithParticipant({
2722
+ const le = await M.startChannelWithParticipant({
2642
2723
  id: te.id,
2643
2724
  name: te.name,
2644
2725
  phone: te.phone
2645
2726
  });
2646
- C(ie), P(null), (he = x.current) == null || he.call(x, ie), y && console.log(
2727
+ T(le), F(null), (he = x.current) == null || he.call(x, le), S && console.log(
2647
2728
  "[MessagingShell] Channel created and loaded:",
2648
- ie.id
2729
+ le.id
2649
2730
  );
2650
- } catch (ie) {
2731
+ } catch (le) {
2651
2732
  console.error(
2652
2733
  "[MessagingShell] Failed to create conversation:",
2653
- ie
2654
- ), X(), P("Failed to create conversation");
2734
+ le
2735
+ ), X(), F("Failed to create conversation");
2655
2736
  }
2656
- } catch (ee) {
2737
+ } catch (Q) {
2657
2738
  console.error(
2658
2739
  "[MessagingShell] Failed to load initial conversation:",
2659
- ee
2660
- ), X(), B.current || P("Failed to load conversation");
2740
+ Q
2741
+ ), X(), U.current || F("Failed to load conversation");
2661
2742
  }
2662
2743
  })();
2663
- }, [i, L, D, A, y]);
2664
- const G = H(r);
2665
- G.current = r;
2666
- const q = Z(() => {
2667
- var F;
2668
- C(null), J(!0), (F = G.current) == null || F.call(G);
2744
+ }, [i, L, _, M, S]);
2745
+ const H = Y(r);
2746
+ H.current = r;
2747
+ const q = J(() => {
2748
+ var B;
2749
+ T(null), ee(!0), (B = H.current) == null || B.call(H);
2669
2750
  }, []);
2670
- return U ? /* @__PURE__ */ n(Ae, {}) : O ? /* @__PURE__ */ n(ve, { message: O, onBack: N }) : !D || !L ? /* @__PURE__ */ n(
2671
- ve,
2751
+ return z ? /* @__PURE__ */ n(Le, {}) : R ? /* @__PURE__ */ n(xe, { message: R, onBack: D }) : !_ || !L ? /* @__PURE__ */ n(
2752
+ xe,
2672
2753
  {
2673
2754
  message: "Not connected to messaging service",
2674
- onBack: N
2755
+ onBack: D
2675
2756
  }
2676
- ) : $ ? /* @__PURE__ */ n(ve, { message: $ }) : j && !E ? /* @__PURE__ */ n(ve, { message: "Conversation ended" }) : E ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
2757
+ ) : O ? /* @__PURE__ */ n(xe, { message: O }) : V && !k ? /* @__PURE__ */ n(xe, { message: "Conversation ended" }) : k ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
2677
2758
  hn,
2678
2759
  {
2679
- channel: E,
2760
+ channel: k,
2680
2761
  renderMessageInputActions: t,
2681
2762
  renderConversationFooter: s,
2682
- renderChannelBanner: b,
2763
+ renderChannelBanner: N,
2683
2764
  onLeaveConversation: q,
2684
2765
  onBlockParticipant: q,
2685
2766
  CustomChannelEmptyState: o,
2686
- showDeleteConversation: Q,
2767
+ showDeleteConversation: Z,
2687
2768
  onBlockParticipantClick: d,
2688
2769
  onReportParticipantClick: m,
2689
2770
  dmAgentEnabled: g,
2690
2771
  onMessageSent: u,
2691
2772
  chatbotVotingEnabled: f,
2692
2773
  viewerLanguage: c,
2693
- renderHeaderTitleBadges: w,
2694
- customChannelActions: _,
2695
- renderChannelActions: v,
2696
- onParticipantNameClick: p,
2697
- renderMessage: I,
2698
- onMessageLinkClick: M,
2699
- showChannelInfo: R,
2700
- composerInput: T
2774
+ renderHeaderTitleBadges: b,
2775
+ customChannelActions: w,
2776
+ renderChannelActions: p,
2777
+ onParticipantNameClick: v,
2778
+ renderMessage: A,
2779
+ onMessageLinkClick: E,
2780
+ showChannelInfo: I,
2781
+ composerInput: P
2701
2782
  },
2702
- E.id
2703
- ) }) }) : /* @__PURE__ */ n(Ae, {});
2783
+ k.id
2784
+ ) }) }) : /* @__PURE__ */ n(Le, {});
2704
2785
  };
2705
2786
  function tr(e) {
2706
2787
  const t = e.state.pending_messages;
@@ -2708,14 +2789,14 @@ function tr(e) {
2708
2789
  for (const s of t)
2709
2790
  e.state.addMessageSorted(s.message);
2710
2791
  }
2711
- const fn = V.createContext({
2792
+ const fn = j.createContext({
2712
2793
  selectedChannel: void 0,
2713
2794
  onChannelSelect: () => {
2714
2795
  },
2715
2796
  debug: !1,
2716
2797
  renderMessagePreview: void 0,
2717
2798
  viewerLanguage: void 0
2718
- }), nr = fn.Provider, sr = () => V.useContext(fn), ar = (e, t) => {
2799
+ }), nr = fn.Provider, sr = () => j.useContext(fn), ar = (e, t) => {
2719
2800
  const s = new Date(
2720
2801
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
2721
2802
  ), r = new Date(
@@ -2736,9 +2817,9 @@ const fn = V.createContext({
2736
2817
  day: "numeric",
2737
2818
  year: "2-digit"
2738
2819
  });
2739
- }, gn = V.memo(
2820
+ }, gn = j.memo(
2740
2821
  ({ channel: e, unread: t }) => {
2741
- var L, D, U, O;
2822
+ var I, P, L;
2742
2823
  const {
2743
2824
  selectedChannel: s,
2744
2825
  onChannelSelect: a,
@@ -2747,39 +2828,40 @@ const fn = V.createContext({
2747
2828
  viewerLanguage: l
2748
2829
  } = sr(), o = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2749
2830
  e && a(e);
2750
- }, m = (N) => {
2751
- const A = N.key === "Enter" || N.key === " ", y = N.repeat;
2752
- !A || y || (N.preventDefault(), d());
2753
- }, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
2754
- (N) => {
2755
- var A, y;
2756
- return ((A = N.user) == null ? void 0 : A.id) && N.user.id !== ((y = e == null ? void 0 : e._client) == null ? void 0 : y.userID);
2831
+ }, m = (_) => {
2832
+ const z = _.key === "Enter" || _.key === " ", R = _.repeat;
2833
+ !z || R || (_.preventDefault(), d());
2834
+ }, u = Object.values(((I = e == null ? void 0 : e.state) == null ? void 0 : I.members) || {}).find(
2835
+ (_) => {
2836
+ var z, R;
2837
+ return ((z = _.user) == null ? void 0 : z.id) && _.user.id !== ((R = e == null ? void 0 : e._client) == null ? void 0 : R.userID);
2757
2838
  }
2758
- ), f = Zt(u == null ? void 0 : u.user), c = (D = u == null ? void 0 : u.user) == null ? void 0 : D.image, w = ((U = u == null ? void 0 : u.user) == null ? void 0 : U.is_verified) === !0, b = (() => {
2759
- var A;
2760
- const N = (A = e == null ? void 0 : e.state) == null ? void 0 : A.messages;
2761
- if (N != null && N.length) {
2762
- for (let y = N.length - 1; y >= 0; y--)
2763
- if (N[y].type !== "system") return N[y];
2839
+ ), f = Jt(u == null ? void 0 : u.user), c = (P = u == null ? void 0 : u.user) == null ? void 0 : P.image, b = (() => {
2840
+ var z;
2841
+ const _ = (z = e == null ? void 0 : e.state) == null ? void 0 : z.messages;
2842
+ if (_ != null && _.length) {
2843
+ for (let R = _.length - 1; R >= 0; R--)
2844
+ if (_[R].type !== "system") return _[R];
2764
2845
  }
2765
- })(), v = (() => {
2766
- var $, P, j, J;
2767
- const N = Qt({
2846
+ })(), w = (() => {
2847
+ var S, k, T, O;
2848
+ const _ = Zt({
2768
2849
  message: b,
2769
2850
  viewerLanguage: l
2770
2851
  });
2771
- if ((($ = b == null ? void 0 : b.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
2772
- if (((P = b == null ? void 0 : b.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
2773
- if (((j = b == null ? void 0 : b.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
2774
- if (N) return N;
2775
- const C = (J = b == null ? void 0 : b.attachments) == null ? void 0 : J[0];
2776
- return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2777
- })(), p = b != null && b.created_at ? rr(new Date(b.created_at)) : "", I = b ? Te(b) : !1, M = i ? i(b, v) : `${I ? " " : ""}${v}`, R = Jt(e), T = t ?? 0;
2852
+ if (((S = b == null ? void 0 : b.metadata) == null ? void 0 : S.custom_type) === "MESSAGE_TIP") return _ ? `💵 ${_}` : "💵 Sent a tip";
2853
+ if (((k = b == null ? void 0 : b.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_PAID") return _ ? `💰 ${_}` : "💰 Sent a message";
2854
+ if (((T = b == null ? void 0 : b.metadata) == null ? void 0 : T.custom_type) === "MESSAGE_ATTACHMENT")
2855
+ return _ ? `📎 ${_}` : "📎 Sent an attachment";
2856
+ if (_) return _;
2857
+ const M = (O = b == null ? void 0 : b.attachments) == null ? void 0 : O[0];
2858
+ return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2859
+ })(), p = b != null && b.created_at ? rr(new Date(b.created_at)) : "", v = b ? Re(b) : !1, A = i ? i(b, w) : `${v ? "✨ " : ""}${w}`, E = t ?? 0;
2778
2860
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
2779
2861
  channelId: e == null ? void 0 : e.id,
2780
2862
  isSelected: o,
2781
2863
  participantName: f,
2782
- unreadCount: T,
2864
+ unreadCount: E,
2783
2865
  hasTimestamp: !!p
2784
2866
  }), /* @__PURE__ */ n(
2785
2867
  "div",
@@ -2788,36 +2870,41 @@ const fn = V.createContext({
2788
2870
  tabIndex: 0,
2789
2871
  onClick: d,
2790
2872
  onKeyDown: m,
2791
- className: k(
2873
+ className: y(
2792
2874
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
2793
2875
  {
2794
2876
  "bg-black/[0.04]": o,
2795
2877
  "hover:bg-black/[0.02]": !o
2796
2878
  }
2797
2879
  ),
2880
+ "data-dd-privacy": "mask",
2798
2881
  children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
2799
2882
  /* @__PURE__ */ n(
2800
- oe,
2883
+ ne,
2801
2884
  {
2802
- id: ((O = u == null ? void 0 : u.user) == null ? void 0 : O.id) || e.id || "unknown",
2885
+ id: ((L = u == null ? void 0 : u.user) == null ? void 0 : L.id) || e.id || "unknown",
2803
2886
  name: f,
2804
2887
  image: c,
2805
- size: 48,
2806
- starred: R
2888
+ size: 48
2807
2889
  }
2808
2890
  ),
2809
2891
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
2810
2892
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2", children: [
2811
2893
  /* @__PURE__ */ h("h3", { className: "flex min-w-0 items-center gap-1 text-sm font-medium text-[#191918]", children: [
2812
- R && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2813
2894
  /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: f }),
2814
- w && /* @__PURE__ */ n(pe, {})
2895
+ /* @__PURE__ */ n(
2896
+ mn,
2897
+ {
2898
+ channel: e,
2899
+ participant: u
2900
+ }
2901
+ )
2815
2902
  ] }),
2816
2903
  p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
2817
2904
  ] }),
2818
2905
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
2819
- /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
2820
- T > 0 && /* @__PURE__ */ n("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: T > 99 ? "99+" : T })
2906
+ /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
2907
+ E > 0 && /* @__PURE__ */ n("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: E > 99 ? "99+" : E })
2821
2908
  ] })
2822
2909
  ] })
2823
2910
  ] })
@@ -2826,7 +2913,7 @@ const fn = V.createContext({
2826
2913
  }
2827
2914
  );
2828
2915
  gn.displayName = "CustomChannelPreview";
2829
- const ir = { last_message_at: -1 }, or = V.memo(
2916
+ const ir = { last_message_at: -1 }, lr = j.memo(
2830
2917
  ({
2831
2918
  onChannelSelect: e,
2832
2919
  selectedChannel: t,
@@ -2836,57 +2923,58 @@ const ir = { last_message_at: -1 }, or = V.memo(
2836
2923
  sort: i = ir,
2837
2924
  className: l,
2838
2925
  customEmptyStateIndicator: o,
2839
- renderMessagePreview: d,
2840
- viewerLanguage: m
2926
+ channelPreview: d,
2927
+ renderMessagePreview: m,
2928
+ viewerLanguage: g
2841
2929
  }) => {
2842
- const g = V.useRef(0);
2843
- g.current++;
2844
- const { debug: u = !1 } = Je(), f = V.useCallback(
2845
- (w) => {
2846
- for (const b of w)
2847
- tr(b);
2848
- return r ? r(w) : w;
2930
+ const u = j.useRef(0);
2931
+ u.current++;
2932
+ const { debug: f = !1 } = Je(), c = j.useCallback(
2933
+ (N) => {
2934
+ for (const w of N)
2935
+ tr(w);
2936
+ return r ? r(N) : N;
2849
2937
  },
2850
2938
  [r]
2851
2939
  );
2852
- u && console.log("📺 [ChannelList] 🔄 RENDER START", {
2853
- renderCount: g.current,
2940
+ f && console.log("📺 [ChannelList] 🔄 RENDER START", {
2941
+ renderCount: u.current,
2854
2942
  selectedChannelId: t == null ? void 0 : t.id,
2855
2943
  filters: s
2856
2944
  });
2857
- const c = V.useMemo(
2945
+ const b = j.useMemo(
2858
2946
  () => ({
2859
2947
  selectedChannel: t,
2860
2948
  onChannelSelect: e,
2861
- debug: u,
2862
- renderMessagePreview: d,
2863
- viewerLanguage: m
2949
+ debug: f,
2950
+ renderMessagePreview: m,
2951
+ viewerLanguage: g
2864
2952
  }),
2865
2953
  [
2866
2954
  t,
2867
2955
  e,
2868
- u,
2869
- d,
2870
- m
2956
+ f,
2957
+ m,
2958
+ g
2871
2959
  ]
2872
2960
  );
2873
2961
  return /* @__PURE__ */ n(
2874
2962
  "div",
2875
2963
  {
2876
- className: k(
2964
+ className: y(
2877
2965
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
2878
2966
  l
2879
2967
  ),
2880
- children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(nr, { value: c, children: /* @__PURE__ */ n(
2968
+ children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(nr, { value: b, children: /* @__PURE__ */ n(
2881
2969
  ms,
2882
2970
  {
2883
2971
  filters: s,
2884
2972
  sort: i,
2885
2973
  options: { limit: 30 },
2886
2974
  allowNewMessagesFromUnfilteredChannels: a,
2887
- channelRenderFilterFn: f,
2975
+ channelRenderFilterFn: c,
2888
2976
  Paginator: hs,
2889
- Preview: gn,
2977
+ Preview: d ?? gn,
2890
2978
  EmptyStateIndicator: o
2891
2979
  },
2892
2980
  `${JSON.stringify(s)}:${JSON.stringify(i)}`
@@ -2895,13 +2983,13 @@ const ir = { last_message_at: -1 }, or = V.memo(
2895
2983
  );
2896
2984
  }
2897
2985
  );
2898
- or.displayName = "ChannelList";
2899
- const lr = /^([a-z][a-z0-9+.-]*):/i, cr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2986
+ lr.displayName = "ChannelList";
2987
+ const or = /^([a-z][a-z0-9+.-]*):/i, cr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2900
2988
  function at(e) {
2901
2989
  if (typeof e != "string") return;
2902
2990
  const t = e.trim();
2903
2991
  if (t === "") return;
2904
- const s = lr.exec(t);
2992
+ const s = or.exec(t);
2905
2993
  if (s) {
2906
2994
  const a = s[1].toLowerCase();
2907
2995
  return cr.has(a) ? t : void 0;
@@ -2912,7 +3000,7 @@ const dr = {
2912
3000
  dark: "bg-white text-[#121110] hover:bg-white/90",
2913
3001
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2914
3002
  }, ur = ({ variant: e, cta: t }) => {
2915
- const s = k(
3003
+ const s = y(
2916
3004
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2917
3005
  dr[e]
2918
3006
  ), a = at(t.href);
@@ -2957,12 +3045,12 @@ const dr = {
2957
3045
  cta: l,
2958
3046
  trailingAction: o
2959
3047
  }) => {
2960
- const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", w = l != null;
2961
- if (!g && !u && !c && !w) return null;
2962
- const _ = k(
3048
+ const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = l != null;
3049
+ if (!g && !u && !c && !b) return null;
3050
+ const w = y(
2963
3051
  "truncate text-base font-medium leading-6",
2964
3052
  d && !t ? hr : mr[e]
2965
- ), v = k(
3053
+ ), p = y(
2966
3054
  "truncate text-xs leading-4",
2967
3055
  fr[e]
2968
3056
  );
@@ -2972,24 +3060,24 @@ const dr = {
2972
3060
  /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
2973
3061
  g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
2974
3062
  i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
2975
- /* @__PURE__ */ n("p", { className: k("min-w-0", _), children: m })
3063
+ /* @__PURE__ */ n("p", { className: y("min-w-0", w), children: m })
2976
3064
  ] }),
2977
- u && /* @__PURE__ */ n("p", { className: v, children: a })
3065
+ u && /* @__PURE__ */ n("p", { className: p, children: a })
2978
3066
  ] }),
2979
- !w && c && /* @__PURE__ */ n("p", { className: v, children: f })
3067
+ !b && c && /* @__PURE__ */ n("p", { className: p, children: f })
2980
3068
  ] }),
2981
3069
  o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
2982
3070
  ] }),
2983
3071
  l && /* @__PURE__ */ n(ur, { variant: e, cta: l })
2984
3072
  ] });
2985
- }, gr = k(
3073
+ }, gr = y(
2986
3074
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2987
3075
  // 1px hairline border that sits flush with the card chrome — matches
2988
3076
  // the messaging design system's "small border around link attachments"
2989
3077
  // treatment from the mobile spec. The drop shadow remains for depth.
2990
3078
  "border border-black/[0.08]",
2991
3079
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2992
- ), Me = ({
3080
+ ), De = ({
2993
3081
  variant: e,
2994
3082
  children: t,
2995
3083
  href: s,
@@ -3000,7 +3088,7 @@ const dr = {
3000
3088
  bgClassName: o,
3001
3089
  "data-testid": d
3002
3090
  }) => {
3003
- const m = s != null || a != null, g = k(
3091
+ const m = s != null || a != null, g = y(
3004
3092
  gr,
3005
3093
  o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
3006
3094
  // `focus-ring` is a design-system utility from the component-library
@@ -3031,7 +3119,7 @@ const dr = {
3031
3119
  onClick: a,
3032
3120
  "aria-label": r,
3033
3121
  "data-testid": d,
3034
- className: k(g, "text-left"),
3122
+ className: y(g, "text-left"),
3035
3123
  children: [
3036
3124
  t,
3037
3125
  u
@@ -3055,11 +3143,11 @@ const dr = {
3055
3143
  }, pr = {
3056
3144
  dark: "size-16 text-white/25",
3057
3145
  light: "size-16 text-black/25"
3058
- }, De = (e, t) => !!t && !!e && re(e) === "audio", bn = (e, t) => {
3146
+ }, Oe = (e, t) => !!t && !!e && ie(e) === "audio", bn = (e, t) => {
3059
3147
  if (!t || !e) return !1;
3060
- const s = re(e);
3148
+ const s = ie(e);
3061
3149
  return s === "video" || s === "audio";
3062
- }, it = "bg-[#F2F3F4]", Re = ({
3150
+ }, it = "bg-[#F2F3F4]", ze = ({
3063
3151
  variant: e,
3064
3152
  thumbnailUrl: t,
3065
3153
  sourceUrl: s,
@@ -3068,8 +3156,8 @@ const dr = {
3068
3156
  topLeft: i,
3069
3157
  topRight: l
3070
3158
  }) => {
3071
- const o = re(r), d = !!s && o === "video";
3072
- return De(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
3159
+ const o = ie(r), d = !!s && o === "video";
3160
+ return Oe(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
3073
3161
  "audio",
3074
3162
  {
3075
3163
  src: s,
@@ -3081,7 +3169,7 @@ const dr = {
3081
3169
  ) }) : /* @__PURE__ */ h(
3082
3170
  "div",
3083
3171
  {
3084
- className: k(
3172
+ className: y(
3085
3173
  "relative h-[180px] w-full overflow-hidden",
3086
3174
  d && "bg-black"
3087
3175
  ),
@@ -3108,7 +3196,7 @@ const dr = {
3108
3196
  ) : /* @__PURE__ */ n(
3109
3197
  "div",
3110
3198
  {
3111
- className: k(
3199
+ className: y(
3112
3200
  "flex h-full w-full items-center justify-center",
3113
3201
  br[e]
3114
3202
  ),
@@ -3137,28 +3225,28 @@ const dr = {
3137
3225
  onDismiss: g,
3138
3226
  onEditClick: u
3139
3227
  }) => {
3140
- const f = o === "classic", c = De(r, l), w = g ? /* @__PURE__ */ n(
3228
+ const f = o === "classic", c = Oe(r, l), b = g ? /* @__PURE__ */ n(
3141
3229
  "button",
3142
3230
  {
3143
3231
  type: "button",
3144
3232
  onClick: g,
3145
3233
  "aria-label": "Dismiss attachment",
3146
3234
  className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
3147
- children: /* @__PURE__ */ n(Le, { className: "size-3", weight: "bold" })
3235
+ children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
3148
3236
  }
3149
- ) : void 0, b = u ? /* @__PURE__ */ n(
3237
+ ) : void 0, N = u ? /* @__PURE__ */ n(
3150
3238
  "button",
3151
3239
  {
3152
3240
  type: "button",
3153
3241
  onClick: u,
3154
3242
  "aria-label": "Edit attachment",
3155
3243
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
3156
- children: /* @__PURE__ */ n(Ps, { className: "size-5", weight: "regular" })
3244
+ children: /* @__PURE__ */ n(zs, { className: "size-5", weight: "regular" })
3157
3245
  }
3158
3246
  ) : void 0;
3159
- return c ? /* @__PURE__ */ n(Me, { variant: "dark", bgClassName: it, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3247
+ return c ? /* @__PURE__ */ n(De, { variant: "dark", bgClassName: it, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3160
3248
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
3161
- Re,
3249
+ ze,
3162
3250
  {
3163
3251
  variant: "dark",
3164
3252
  sourceUrl: l,
@@ -3166,22 +3254,22 @@ const dr = {
3166
3254
  mimeType: r
3167
3255
  }
3168
3256
  ) }),
3169
- w && /* @__PURE__ */ n("div", { className: "shrink-0", children: w })
3257
+ b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
3170
3258
  ] }) }) : /* @__PURE__ */ h(
3171
- Me,
3259
+ De,
3172
3260
  {
3173
3261
  variant: "dark",
3174
- topRight: f ? w : void 0,
3262
+ topRight: f ? b : void 0,
3175
3263
  children: [
3176
3264
  !f && /* @__PURE__ */ n(
3177
- Re,
3265
+ ze,
3178
3266
  {
3179
3267
  variant: "dark",
3180
3268
  thumbnailUrl: i,
3181
3269
  sourceUrl: l,
3182
3270
  title: e,
3183
3271
  mimeType: r,
3184
- topRight: w
3272
+ topRight: b
3185
3273
  }
3186
3274
  ),
3187
3275
  /* @__PURE__ */ n(
@@ -3194,7 +3282,7 @@ const dr = {
3194
3282
  url: a,
3195
3283
  appIcon: d,
3196
3284
  cta: m,
3197
- trailingAction: b
3285
+ trailingAction: N
3198
3286
  }
3199
3287
  )
3200
3288
  ]
@@ -3212,25 +3300,25 @@ const dr = {
3212
3300
  cta: d,
3213
3301
  onClick: m
3214
3302
  }) => {
3215
- const g = bn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, w = De(a, i) ? it : void 0, b = d && m ? {
3303
+ const g = bn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Oe(a, i) ? it : void 0, N = d && m ? {
3216
3304
  ...d,
3217
3305
  onClick: () => {
3218
- var _;
3219
- m(), (_ = d.onClick) == null || _.call(d);
3306
+ var w;
3307
+ m(), (w = d.onClick) == null || w.call(d);
3220
3308
  }
3221
3309
  } : d;
3222
3310
  return /* @__PURE__ */ h(
3223
- Me,
3311
+ De,
3224
3312
  {
3225
3313
  variant: "light",
3226
3314
  href: f,
3227
3315
  onClick: c,
3228
3316
  ariaLabel: e ?? "Open attachment preview",
3229
- bgClassName: w,
3317
+ bgClassName: b,
3230
3318
  "data-testid": "link-attachment",
3231
3319
  children: [
3232
3320
  l === "featured" && /* @__PURE__ */ n(
3233
- Re,
3321
+ ze,
3234
3322
  {
3235
3323
  variant: "light",
3236
3324
  thumbnailUrl: r,
@@ -3247,7 +3335,7 @@ const dr = {
3247
3335
  description: t,
3248
3336
  url: s,
3249
3337
  appIcon: o,
3250
- cta: b
3338
+ cta: N
3251
3339
  }
3252
3340
  )
3253
3341
  ]
@@ -3266,17 +3354,17 @@ const dr = {
3266
3354
  cta: m,
3267
3355
  onClick: g
3268
3356
  }) => {
3269
- const u = bn(r, l), f = at(a), c = m == null && f != null && !u ? f : void 0, w = m == null && !u && c != null ? g : void 0;
3357
+ const u = bn(r, l), f = at(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
3270
3358
  return /* @__PURE__ */ h(
3271
- Me,
3359
+ De,
3272
3360
  {
3273
3361
  variant: "dark",
3274
3362
  href: c,
3275
- onClick: w,
3276
- bgClassName: De(r, l) ? it : void 0,
3363
+ onClick: b,
3364
+ bgClassName: Oe(r, l) ? it : void 0,
3277
3365
  children: [
3278
3366
  o === "featured" && /* @__PURE__ */ n(
3279
- Re,
3367
+ ze,
3280
3368
  {
3281
3369
  variant: "dark",
3282
3370
  thumbnailUrl: i,
@@ -3304,16 +3392,16 @@ const dr = {
3304
3392
  Composer: vr,
3305
3393
  Sent: wr,
3306
3394
  Received: xr
3307
- }, _r = {
3395
+ }, Nr = {
3308
3396
  dark: "bg-[#121110]",
3309
3397
  light: "bg-[#e9eaed]"
3310
- }, Nr = {
3398
+ }, _r = {
3311
3399
  dark: "text-white",
3312
3400
  light: "text-[#080707]"
3313
3401
  }, yr = {
3314
3402
  dark: "border-white/[0.08]",
3315
3403
  light: "border-black/[0.08]"
3316
- }, Cr = (e) => e === "dark" ? "sender" : "receiver", kr = {
3404
+ }, kr = (e) => e === "dark" ? "sender" : "receiver", Cr = {
3317
3405
  sender: {
3318
3406
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
3319
3407
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -3326,7 +3414,7 @@ const dr = {
3326
3414
  middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
3327
3415
  end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
3328
3416
  }
3329
- }, ye = ({
3417
+ }, ke = ({
3330
3418
  variant: e,
3331
3419
  text: t,
3332
3420
  bordered: s = !0,
@@ -3335,13 +3423,13 @@ const dr = {
3335
3423
  children: i,
3336
3424
  "data-testid": l
3337
3425
  }) => {
3338
- const o = t != null && t !== "", d = kr[Cr(e)][a];
3426
+ const o = t != null && t !== "", d = Cr[kr(e)][a];
3339
3427
  return /* @__PURE__ */ h(
3340
3428
  "div",
3341
3429
  {
3342
3430
  "data-testid": l,
3343
3431
  "data-group-position": a,
3344
- className: k(
3432
+ className: y(
3345
3433
  // 280px-wide bubble — matches the mobile chat attachment width
3346
3434
  // and keeps the document / image / audio bubbles visually
3347
3435
  // consistent inside the conversation timeline. The 8px / 16px
@@ -3350,8 +3438,8 @@ const dr = {
3350
3438
  // as the surrounding `CustomMessage` text bubbles.
3351
3439
  "relative w-[280px] overflow-hidden px-2 py-2",
3352
3440
  d,
3353
- _r[e],
3354
3441
  Nr[e],
3442
+ _r[e],
3355
3443
  s && "border",
3356
3444
  s && yr[e],
3357
3445
  r
@@ -3361,7 +3449,7 @@ const dr = {
3361
3449
  o ? /* @__PURE__ */ n(
3362
3450
  "p",
3363
3451
  {
3364
- className: k(
3452
+ className: y(
3365
3453
  // No `text-*` / `font-*` overrides here — caption inherits
3366
3454
  // the same font family + size as `.str-chat__message-text`
3367
3455
  // so it matches the surrounding `CustomMessage` bubbles.
@@ -3390,13 +3478,13 @@ const dr = {
3390
3478
  a.stopPropagation(), e();
3391
3479
  },
3392
3480
  "aria-label": s,
3393
- className: k(
3481
+ className: y(
3394
3482
  "flex size-6 items-center justify-center rounded-full text-white",
3395
3483
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
3396
3484
  ),
3397
- children: /* @__PURE__ */ n(Le, { className: "size-3", weight: "bold" })
3485
+ children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
3398
3486
  }
3399
- ), ke = (e) => e === "received" ? "light" : "dark", Ai = ({
3487
+ ), Ee = (e) => e === "received" ? "light" : "dark", Ai = ({
3400
3488
  firstOfGroup: e,
3401
3489
  endOfGroup: t,
3402
3490
  groupedByUser: s
@@ -3405,7 +3493,7 @@ const dr = {
3405
3493
  mimeType: t,
3406
3494
  filename: s,
3407
3495
  items: a
3408
- }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Sr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3496
+ }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Ir = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3409
3497
  /* @__PURE__ */ n(
3410
3498
  "audio",
3411
3499
  {
@@ -3417,7 +3505,7 @@ const dr = {
3417
3505
  }
3418
3506
  ),
3419
3507
  s ?? null
3420
- ] }), ot = ({
3508
+ ] }), lt = ({
3421
3509
  state: e,
3422
3510
  src: t,
3423
3511
  mimeType: s,
@@ -3428,34 +3516,34 @@ const dr = {
3428
3516
  preload: o,
3429
3517
  onDismiss: d
3430
3518
  }) => {
3431
- const m = ke(e), g = e === "composer" && !!d, u = Er({ src: t, mimeType: s, filename: a, items: r });
3519
+ const m = Ee(e), g = e === "composer" && !!d, u = Er({ src: t, mimeType: s, filename: a, items: r });
3432
3520
  if (u.length === 0)
3433
3521
  return null;
3434
3522
  const f = o ?? (u.length > 1 ? "none" : "metadata");
3435
3523
  return /* @__PURE__ */ n(
3436
- ye,
3524
+ ke,
3437
3525
  {
3438
3526
  variant: m,
3439
3527
  text: i,
3440
3528
  groupPosition: l,
3441
3529
  "data-testid": "audio-attachment",
3442
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, w) => /* @__PURE__ */ n(
3443
- Sr,
3530
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
3531
+ Ir,
3444
3532
  {
3445
3533
  item: c,
3446
3534
  preload: f,
3447
3535
  trailingAction: (
3448
3536
  // Composer only supports a single attachment, so the
3449
3537
  // dismiss control sits on the only player.
3450
- g && w === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
3538
+ g && b === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
3451
3539
  )
3452
3540
  },
3453
- `${c.src}-${w}`
3541
+ `${c.src}-${b}`
3454
3542
  )) })
3455
3543
  }
3456
3544
  );
3457
- }, Ir = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), Tr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Ar = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), Mr = {
3458
- Composer: Ir,
3545
+ }, Sr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Tr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), Ar = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), Mr = {
3546
+ Composer: Sr,
3459
3547
  Sent: Tr,
3460
3548
  Received: Ar
3461
3549
  };
@@ -3481,8 +3569,8 @@ function Dr(e, t) {
3481
3569
  }
3482
3570
  }
3483
3571
  if (!e) return;
3484
- if (re(e) === "document") {
3485
- const r = nn(e), i = Lr[r];
3572
+ if (ie(e) === "document") {
3573
+ const r = tn(e), i = Lr[r];
3486
3574
  if (i) return i;
3487
3575
  if (e === "application/octet-stream") return;
3488
3576
  }
@@ -3490,11 +3578,11 @@ function Dr(e, t) {
3490
3578
  if (!(!a || a === "*"))
3491
3579
  return a.toUpperCase();
3492
3580
  }
3493
- function Pr(e, t, s) {
3581
+ function zr(e, t, s) {
3494
3582
  const a = Dr(e, t), r = typeof s == "number" && s > 0 ? Rr(s) : void 0;
3495
3583
  return [a, r].filter(Boolean).join(" · ") || void 0;
3496
3584
  }
3497
- function ne(e) {
3585
+ function ae(e) {
3498
3586
  try {
3499
3587
  const s = new URL(e).pathname.split("/").pop();
3500
3588
  return s && s.length > 0 ? decodeURIComponent(s) : "download";
@@ -3502,10 +3590,10 @@ function ne(e) {
3502
3590
  return "download";
3503
3591
  }
3504
3592
  }
3505
- const Or = {
3593
+ const Pr = {
3506
3594
  dark: "text-white/55",
3507
3595
  light: "text-black/65"
3508
- }, zr = {
3596
+ }, Or = {
3509
3597
  dark: "bg-white/10",
3510
3598
  light: "bg-black/5"
3511
3599
  }, $r = {
@@ -3521,16 +3609,16 @@ const Or = {
3521
3609
  activateLabel: l,
3522
3610
  trailingAction: o
3523
3611
  }) => {
3524
- const d = s ?? t ?? "File", m = Pr(a, t, r), g = /* @__PURE__ */ n(
3612
+ const d = s ?? t ?? "File", m = zr(a, t, r), g = /* @__PURE__ */ n(
3525
3613
  "div",
3526
3614
  {
3527
- className: k(
3615
+ className: y(
3528
3616
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
3529
- zr[e]
3617
+ Or[e]
3530
3618
  ),
3531
3619
  "aria-hidden": !0,
3532
3620
  children: ce(a, {
3533
- className: k("size-6", $r[e]),
3621
+ className: y("size-6", $r[e]),
3534
3622
  weight: "regular"
3535
3623
  })
3536
3624
  }
@@ -3539,9 +3627,9 @@ const Or = {
3539
3627
  m ? /* @__PURE__ */ n(
3540
3628
  "p",
3541
3629
  {
3542
- className: k(
3630
+ className: y(
3543
3631
  "truncate text-xs leading-4",
3544
- Or[e]
3632
+ Pr[e]
3545
3633
  ),
3546
3634
  children: m
3547
3635
  }
@@ -3552,7 +3640,7 @@ const Or = {
3552
3640
  type: "button",
3553
3641
  onClick: i,
3554
3642
  "aria-label": l,
3555
- className: k(
3643
+ className: y(
3556
3644
  "flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
3557
3645
  e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
3558
3646
  ),
@@ -3561,7 +3649,7 @@ const Or = {
3561
3649
  u
3562
3650
  ]
3563
3651
  }
3564
- ) : /* @__PURE__ */ h(ae, { children: [
3652
+ ) : /* @__PURE__ */ h(se, { children: [
3565
3653
  g,
3566
3654
  u
3567
3655
  ] });
@@ -3571,7 +3659,7 @@ const Or = {
3571
3659
  ] });
3572
3660
  };
3573
3661
  async function vn(e, t) {
3574
- const s = t ?? ne(e);
3662
+ const s = t ?? ae(e);
3575
3663
  try {
3576
3664
  const a = await fetch(e, { mode: "cors" });
3577
3665
  if (!a.ok) throw new Error(`HTTP ${a.status}`);
@@ -3598,7 +3686,7 @@ const Fr = ({
3598
3686
  onActivate: a,
3599
3687
  trailingAction: r
3600
3688
  }) => {
3601
- const i = t.filename ?? ne(t.src);
3689
+ const i = t.filename ?? ae(t.src);
3602
3690
  return /* @__PURE__ */ n(
3603
3691
  pn,
3604
3692
  {
@@ -3612,7 +3700,7 @@ const Fr = ({
3612
3700
  trailingAction: r
3613
3701
  }
3614
3702
  );
3615
- }, lt = ({
3703
+ }, ot = ({
3616
3704
  state: e,
3617
3705
  src: t,
3618
3706
  filename: s,
@@ -3625,63 +3713,63 @@ const Fr = ({
3625
3713
  onClick: m,
3626
3714
  onDismiss: g
3627
3715
  }) => {
3628
- const u = ke(e), f = e === "composer" && !!g, c = Fr({
3716
+ const u = Ee(e), f = e === "composer" && !!g, c = Fr({
3629
3717
  src: t,
3630
3718
  filename: s,
3631
3719
  fileSize: a,
3632
3720
  mimeType: r,
3633
3721
  title: i,
3634
3722
  items: l
3635
- }), w = (_) => {
3636
- if ((m == null ? void 0 : m(_)) === !1) return;
3637
- const v = c[_];
3638
- if (!v) return;
3639
- const p = v.filename ?? ne(v.src);
3640
- vn(v.src, p);
3723
+ }), b = (w) => {
3724
+ if ((m == null ? void 0 : m(w)) === !1) return;
3725
+ const p = c[w];
3726
+ if (!p) return;
3727
+ const v = p.filename ?? ae(p.src);
3728
+ vn(p.src, v);
3641
3729
  };
3642
3730
  if (c.length === 0)
3643
3731
  return null;
3644
- const b = /* @__PURE__ */ n(
3732
+ const N = /* @__PURE__ */ n(
3645
3733
  "span",
3646
3734
  {
3647
- className: k(
3735
+ className: y(
3648
3736
  "flex size-8 items-center justify-center rounded-full",
3649
3737
  u === "dark" ? "text-white/70" : "text-black/70"
3650
3738
  ),
3651
3739
  "aria-hidden": !0,
3652
- children: /* @__PURE__ */ n(we, { className: "size-5", weight: "bold" })
3740
+ children: /* @__PURE__ */ n(Ne, { className: "size-5", weight: "bold" })
3653
3741
  }
3654
3742
  );
3655
3743
  return /* @__PURE__ */ n(
3656
- ye,
3744
+ ke,
3657
3745
  {
3658
3746
  variant: u,
3659
3747
  text: o,
3660
3748
  groupPosition: d,
3661
3749
  "data-testid": "file-attachment",
3662
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((_, v) => /* @__PURE__ */ n(
3750
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w, p) => /* @__PURE__ */ n(
3663
3751
  Br,
3664
3752
  {
3665
3753
  variant: u,
3666
- item: _,
3667
- index: v,
3668
- onActivate: w,
3669
- trailingAction: f && v === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : b
3754
+ item: w,
3755
+ index: p,
3756
+ onActivate: b,
3757
+ trailingAction: f && p === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : N
3670
3758
  },
3671
- `${_.src}-${v}`
3759
+ `${w.src}-${p}`
3672
3760
  )) })
3673
3761
  }
3674
3762
  );
3675
- }, Vr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Ur = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), jr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), Gr = {
3676
- Composer: Vr,
3677
- Sent: Ur,
3678
- Received: jr
3763
+ }, Ur = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), jr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Vr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), Gr = {
3764
+ Composer: Ur,
3765
+ Sent: jr,
3766
+ Received: Vr
3679
3767
  }, ct = ({
3680
3768
  onPrev: e,
3681
3769
  onNext: t,
3682
3770
  prevLabel: s = "Previous",
3683
3771
  nextLabel: a = "Next"
3684
- }) => /* @__PURE__ */ h(ae, { children: [
3772
+ }) => /* @__PURE__ */ h(se, { children: [
3685
3773
  /* @__PURE__ */ n(
3686
3774
  "button",
3687
3775
  {
@@ -3689,7 +3777,7 @@ const Fr = ({
3689
3777
  onClick: e,
3690
3778
  "aria-label": s,
3691
3779
  className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
3692
- children: /* @__PURE__ */ n(Os, { size: 20, weight: "bold", "aria-hidden": !0 })
3780
+ children: /* @__PURE__ */ n(Ps, { size: 20, weight: "bold", "aria-hidden": !0 })
3693
3781
  }
3694
3782
  ),
3695
3783
  /* @__PURE__ */ n(
@@ -3699,7 +3787,7 @@ const Fr = ({
3699
3787
  onClick: t,
3700
3788
  "aria-label": a,
3701
3789
  className: "mes-media-viewer__nav mes-media-viewer__nav--next",
3702
- children: /* @__PURE__ */ n(He, { size: 20, weight: "bold", "aria-hidden": !0 })
3790
+ children: /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
3703
3791
  }
3704
3792
  )
3705
3793
  ] }), xn = ({
@@ -3711,7 +3799,7 @@ const Fr = ({
3711
3799
  tone: i = "dark",
3712
3800
  onTriggered: l
3713
3801
  }) => {
3714
- const [o, d] = z(!1), m = Z(
3802
+ const [o, d] = $(!1), m = J(
3715
3803
  (c) => {
3716
3804
  c.stopPropagation(), !o && (d(!0), vn(e, t).catch(() => {
3717
3805
  }).finally(() => {
@@ -3719,7 +3807,7 @@ const Fr = ({
3719
3807
  }));
3720
3808
  },
3721
3809
  [o, e, t, l]
3722
- ), g = r ?? s !== "pill", f = { className: k(
3810
+ ), g = r ?? s !== "pill", f = { className: y(
3723
3811
  s === "pill" ? "size-4" : "size-5",
3724
3812
  "shrink-0"
3725
3813
  ), weight: "bold" };
@@ -3730,7 +3818,7 @@ const Fr = ({
3730
3818
  onClick: m,
3731
3819
  disabled: o,
3732
3820
  "aria-label": a,
3733
- className: k(
3821
+ className: y(
3734
3822
  "flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
3735
3823
  {
3736
3824
  dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
@@ -3738,14 +3826,14 @@ const Fr = ({
3738
3826
  }[i]
3739
3827
  ),
3740
3828
  children: o ? /* @__PURE__ */ n(
3741
- xe,
3829
+ we,
3742
3830
  {
3743
3831
  className: "size-4 animate-spin",
3744
3832
  weight: "bold",
3745
3833
  "aria-hidden": !0
3746
3834
  }
3747
3835
  ) : /* @__PURE__ */ n(
3748
- we,
3836
+ Ne,
3749
3837
  {
3750
3838
  className: "size-5 shrink-0",
3751
3839
  weight: "bold",
@@ -3761,7 +3849,7 @@ const Fr = ({
3761
3849
  disabled: o,
3762
3850
  "aria-label": a,
3763
3851
  className: "mes-media-viewer__action",
3764
- children: o ? /* @__PURE__ */ n(xe, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 })
3852
+ children: o ? /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Ne, { size: 20, weight: "bold", "aria-hidden": !0 })
3765
3853
  }
3766
3854
  ) : /* @__PURE__ */ h(
3767
3855
  "button",
@@ -3770,37 +3858,37 @@ const Fr = ({
3770
3858
  onClick: m,
3771
3859
  disabled: o,
3772
3860
  "aria-label": g ? a : void 0,
3773
- className: k(
3861
+ className: y(
3774
3862
  "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",
3775
3863
  i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
3776
3864
  ),
3777
3865
  children: [
3778
3866
  o ? /* @__PURE__ */ n(
3779
- xe,
3867
+ we,
3780
3868
  {
3781
3869
  className: "size-4 animate-spin",
3782
3870
  weight: "bold",
3783
3871
  "aria-hidden": !0
3784
3872
  }
3785
- ) : /* @__PURE__ */ n(we, { ...f, "aria-hidden": !0 }),
3873
+ ) : /* @__PURE__ */ n(Ne, { ...f, "aria-hidden": !0 }),
3786
3874
  g ? null : a
3787
3875
  ]
3788
3876
  }
3789
3877
  );
3790
- }, Ve = (e, t, s) => Math.min(Math.max(e, t), s), dt = ({
3878
+ }, Ge = (e, t, s) => Math.min(Math.max(e, t), s), dt = ({
3791
3879
  length: e,
3792
3880
  initialIndex: t,
3793
3881
  open: s
3794
3882
  }) => {
3795
- const a = Ve(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
3883
+ const a = Ge(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
3796
3884
  K(() => {
3797
- s && i(Ve(t, 0, Math.max(e - 1, 0)));
3885
+ s && i(Ge(t, 0, Math.max(e - 1, 0)));
3798
3886
  }, [s, t, e]), K(() => {
3799
- i((d) => Ve(d, 0, Math.max(e - 1, 0)));
3887
+ i((d) => Ge(d, 0, Math.max(e - 1, 0)));
3800
3888
  }, [e]);
3801
- const l = Z(() => {
3889
+ const l = J(() => {
3802
3890
  e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
3803
- }, [e]), o = Z(() => {
3891
+ }, [e]), o = J(() => {
3804
3892
  e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
3805
3893
  }, [e]);
3806
3894
  return K(() => {
@@ -3821,7 +3909,7 @@ const Fr = ({
3821
3909
  children: i,
3822
3910
  "data-testid": l
3823
3911
  }) => {
3824
- const o = H(null), d = H(null);
3912
+ const o = Y(null), d = Y(null);
3825
3913
  return K(() => {
3826
3914
  var f;
3827
3915
  const u = o.current;
@@ -3893,7 +3981,7 @@ const Fr = ({
3893
3981
  onClick: t,
3894
3982
  "aria-label": "Close viewer",
3895
3983
  className: "mes-media-viewer__action",
3896
- children: /* @__PURE__ */ n(Le, { size: 20, weight: "bold", "aria-hidden": !0 })
3984
+ children: /* @__PURE__ */ n(Pe, { size: 20, weight: "bold", "aria-hidden": !0 })
3897
3985
  }
3898
3986
  )
3899
3987
  ] })
@@ -3912,8 +4000,8 @@ const Fr = ({
3912
4000
  length: t.length,
3913
4001
  initialIndex: s,
3914
4002
  open: e
3915
- }), o = t[r], d = se(
3916
- () => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "image"),
4003
+ }), o = t[r], d = re(
4004
+ () => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "image"),
3917
4005
  [o]
3918
4006
  );
3919
4007
  return o ? /* @__PURE__ */ h(
@@ -3958,7 +4046,7 @@ const Fr = ({
3958
4046
  ]
3959
4047
  }
3960
4048
  ) : null;
3961
- }, Hr = "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", _n = ({
4049
+ }, Hr = "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", Nn = ({
3962
4050
  tiles: e,
3963
4051
  onTileActivate: t,
3964
4052
  maxVisible: s = 4,
@@ -3967,14 +4055,14 @@ const Fr = ({
3967
4055
  const r = e.length;
3968
4056
  if (r === 0) return null;
3969
4057
  const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, m, g) => {
3970
- const u = k(Hr, "h-full w-full");
4058
+ const u = y(Hr, "h-full w-full");
3971
4059
  return t ? /* @__PURE__ */ h(
3972
4060
  "button",
3973
4061
  {
3974
4062
  type: "button",
3975
4063
  onClick: () => t(m),
3976
4064
  "aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
3977
- className: k(u, "cursor-zoom-in"),
4065
+ className: y(u, "cursor-zoom-in"),
3978
4066
  children: [
3979
4067
  d.content,
3980
4068
  g
@@ -3986,10 +4074,10 @@ const Fr = ({
3986
4074
  g
3987
4075
  ] }, m);
3988
4076
  };
3989
- return i.length === 1 ? /* @__PURE__ */ n("div", { className: k("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
4077
+ return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
3990
4078
  "div",
3991
4079
  {
3992
- className: k(
4080
+ className: y(
3993
4081
  "grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
3994
4082
  a
3995
4083
  ),
@@ -3998,7 +4086,7 @@ const Fr = ({
3998
4086
  ) : i.length === 3 ? /* @__PURE__ */ h(
3999
4087
  "div",
4000
4088
  {
4001
- className: k(
4089
+ className: y(
4002
4090
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
4003
4091
  a
4004
4092
  ),
@@ -4011,7 +4099,7 @@ const Fr = ({
4011
4099
  ) : /* @__PURE__ */ n(
4012
4100
  "div",
4013
4101
  {
4014
- className: k(
4102
+ className: y(
4015
4103
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
4016
4104
  a
4017
4105
  ),
@@ -4028,13 +4116,13 @@ const Fr = ({
4028
4116
  })
4029
4117
  }
4030
4118
  );
4031
- }, Ee = (e) => {
4032
- const [t, s] = z(!1), [a, r] = z(0), i = Z(
4119
+ }, Ie = (e) => {
4120
+ const [t, s] = $(!1), [a, r] = $(0), i = J(
4033
4121
  (o) => {
4034
4122
  (e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
4035
4123
  },
4036
4124
  [e]
4037
- ), l = Z(() => s(!1), []);
4125
+ ), l = J(() => s(!1), []);
4038
4126
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
4039
4127
  }, Yr = (e, t, s, a) => ({
4040
4128
  ariaLabel: `Open image ${t + 1} of ${s}`,
@@ -4055,12 +4143,12 @@ const Fr = ({
4055
4143
  src: e,
4056
4144
  alt: t,
4057
4145
  items: s
4058
- }) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], Nn = (e, t) => e.map((s, a) => ({
4146
+ }) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], _n = (e, t) => e.map((s, a) => ({
4059
4147
  src: s.src,
4060
4148
  alt: s.alt,
4061
4149
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
4062
4150
  })), Wr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
4063
- const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Ee(
4151
+ const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Ie(
4064
4152
  r
4065
4153
  );
4066
4154
  return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
@@ -4089,7 +4177,7 @@ const Fr = ({
4089
4177
  wn,
4090
4178
  {
4091
4179
  open: l,
4092
- items: Nn([{ src: e, alt: t }], s),
4180
+ items: _n([{ src: e, alt: t }], s),
4093
4181
  initialIndex: o,
4094
4182
  onClose: m
4095
4183
  }
@@ -4106,30 +4194,30 @@ const Fr = ({
4106
4194
  loading: o = "lazy",
4107
4195
  onClick: d
4108
4196
  }) => {
4109
- const m = qr({ src: t, alt: s, items: r }), g = ke(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: w } = Ee(
4197
+ const m = qr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ie(
4110
4198
  d
4111
4199
  );
4112
4200
  if (m.length === 0)
4113
4201
  return null;
4114
- const b = m.map(
4115
- (_, v) => Yr(_, v, m.length, o)
4202
+ const N = m.map(
4203
+ (w, p) => Yr(w, p, m.length, o)
4116
4204
  );
4117
4205
  return /* @__PURE__ */ h(
4118
- ye,
4206
+ ke,
4119
4207
  {
4120
4208
  variant: g,
4121
4209
  text: i,
4122
4210
  groupPosition: l,
4123
4211
  "data-testid": "image-attachment",
4124
4212
  children: [
4125
- /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(_n, { tiles: b, onTileActivate: c }) }),
4213
+ /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(Nn, { tiles: N, onTileActivate: c }) }),
4126
4214
  /* @__PURE__ */ n(
4127
4215
  wn,
4128
4216
  {
4129
4217
  open: u,
4130
- items: Nn(m, a),
4218
+ items: _n(m, a),
4131
4219
  initialIndex: f,
4132
- onClose: w
4220
+ onClose: b
4133
4221
  }
4134
4222
  )
4135
4223
  ]
@@ -4149,10 +4237,10 @@ const Fr = ({
4149
4237
  length: t.length,
4150
4238
  initialIndex: s,
4151
4239
  open: e
4152
- }), o = t[r], d = se(
4153
- () => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "document"),
4240
+ }), o = t[r], d = re(
4241
+ () => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "document"),
4154
4242
  [o]
4155
- ), m = se(
4243
+ ), m = re(
4156
4244
  () => o ? ei(o.src) : void 0,
4157
4245
  [o]
4158
4246
  );
@@ -4203,7 +4291,7 @@ const Fr = ({
4203
4291
  onActivate: a,
4204
4292
  trailingAction: r
4205
4293
  }) => {
4206
- const i = t.filename ?? ne(t.src);
4294
+ const i = t.filename ?? ae(t.src);
4207
4295
  return /* @__PURE__ */ n(
4208
4296
  pn,
4209
4297
  {
@@ -4229,31 +4317,31 @@ const Fr = ({
4229
4317
  onClick: d,
4230
4318
  onDismiss: m
4231
4319
  }) => {
4232
- const g = ke(e), u = ti({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: w, closeViewer: b } = Ee(
4320
+ const g = Ee(e), u = ti({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ie(
4233
4321
  d
4234
- ), _ = e === "composer" && !!m;
4322
+ ), w = e === "composer" && !!m;
4235
4323
  if (u.length === 0)
4236
4324
  return null;
4237
- const v = u.map((p) => ({
4238
- src: p.src,
4239
- filename: p.filename ?? ne(p.src)
4325
+ const p = u.map((v) => ({
4326
+ src: v.src,
4327
+ filename: v.filename ?? ae(v.src)
4240
4328
  }));
4241
4329
  return /* @__PURE__ */ h(
4242
- ye,
4330
+ ke,
4243
4331
  {
4244
4332
  variant: g,
4245
4333
  text: l,
4246
4334
  groupPosition: o,
4247
4335
  "data-testid": "pdf-attachment",
4248
4336
  children: [
4249
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((p, I) => {
4250
- const M = p.filename ?? ne(p.src), R = _ && I === 0 ? /* @__PURE__ */ n(Ce, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4337
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((v, A) => {
4338
+ const E = v.filename ?? ae(v.src), I = w && A === 0 ? /* @__PURE__ */ n(Ce, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4251
4339
  xn,
4252
4340
  {
4253
- url: p.src,
4254
- filename: M,
4341
+ url: v.src,
4342
+ filename: E,
4255
4343
  variant: "inline",
4256
- label: `Download ${M}`,
4344
+ label: `Download ${E}`,
4257
4345
  tone: g
4258
4346
  }
4259
4347
  );
@@ -4261,21 +4349,21 @@ const Fr = ({
4261
4349
  ni,
4262
4350
  {
4263
4351
  variant: g,
4264
- item: p,
4265
- index: I,
4266
- onActivate: w,
4267
- trailingAction: R
4352
+ item: v,
4353
+ index: A,
4354
+ onActivate: b,
4355
+ trailingAction: I
4268
4356
  },
4269
- `${p.src}-${I}`
4357
+ `${v.src}-${A}`
4270
4358
  );
4271
4359
  }) }),
4272
4360
  /* @__PURE__ */ n(
4273
4361
  Qr,
4274
4362
  {
4275
4363
  open: f,
4276
- items: v,
4364
+ items: p,
4277
4365
  initialIndex: c,
4278
- onClose: b
4366
+ onClose: N
4279
4367
  }
4280
4368
  )
4281
4369
  ]
@@ -4285,7 +4373,7 @@ const Fr = ({
4285
4373
  Composer: si,
4286
4374
  Sent: ai,
4287
4375
  Received: ri
4288
- }, Cn = ({
4376
+ }, kn = ({
4289
4377
  open: e,
4290
4378
  items: t,
4291
4379
  initialIndex: s = 0,
@@ -4295,8 +4383,8 @@ const Fr = ({
4295
4383
  length: t.length,
4296
4384
  initialIndex: s,
4297
4385
  open: e
4298
- }), o = t[r], d = se(
4299
- () => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "video"),
4386
+ }), o = t[r], d = re(
4387
+ () => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "video"),
4300
4388
  [o]
4301
4389
  );
4302
4390
  return o ? /* @__PURE__ */ h(
@@ -4335,7 +4423,7 @@ const Fr = ({
4335
4423
  ]
4336
4424
  }
4337
4425
  ) : null;
4338
- }, oi = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), kn = ({
4426
+ }, li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(He, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Cn = ({
4339
4427
  item: e,
4340
4428
  index: t
4341
4429
  }) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -4350,17 +4438,17 @@ const Fr = ({
4350
4438
  className: "absolute inset-0 size-full rounded-md object-cover"
4351
4439
  }
4352
4440
  ) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
4353
- Wt,
4441
+ qt,
4354
4442
  {
4355
4443
  className: "size-16 rounded-md text-white/30",
4356
4444
  weight: "regular",
4357
4445
  "aria-hidden": !0
4358
4446
  }
4359
4447
  ) }),
4360
- /* @__PURE__ */ n(oi, {})
4361
- ] }), li = (e, t, s) => ({
4448
+ /* @__PURE__ */ n(li, {})
4449
+ ] }), oi = (e, t, s) => ({
4362
4450
  ariaLabel: `Play video ${t + 1} of ${s}`,
4363
- content: /* @__PURE__ */ n(kn, { item: e, index: t })
4451
+ content: /* @__PURE__ */ n(Cn, { item: e, index: t })
4364
4452
  }), ci = ({
4365
4453
  src: e,
4366
4454
  poster: t,
@@ -4374,7 +4462,7 @@ const Fr = ({
4374
4462
  preload: s.preload,
4375
4463
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
4376
4464
  })), di = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
4377
- const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } = Ee(
4465
+ const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } = Ie(
4378
4466
  i
4379
4467
  );
4380
4468
  return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
@@ -4385,12 +4473,12 @@ const Fr = ({
4385
4473
  onClick: () => m(0),
4386
4474
  "aria-label": "Play video",
4387
4475
  className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
4388
- children: /* @__PURE__ */ n(kn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
4476
+ children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
4389
4477
  }
4390
4478
  ),
4391
4479
  l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: l }) }) : null,
4392
4480
  /* @__PURE__ */ n(
4393
- Cn,
4481
+ kn,
4394
4482
  {
4395
4483
  open: o,
4396
4484
  items: En(
@@ -4402,7 +4490,7 @@ const Fr = ({
4402
4490
  }
4403
4491
  )
4404
4492
  ] });
4405
- }, Sn = ({
4493
+ }, In = ({
4406
4494
  state: e,
4407
4495
  src: t,
4408
4496
  poster: s,
@@ -4414,16 +4502,16 @@ const Fr = ({
4414
4502
  preload: d,
4415
4503
  onClick: m
4416
4504
  }) => {
4417
- const g = ci({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = ke(e), { viewerOpen: f, viewerIndex: c, handleActivate: w, closeViewer: b } = Ee(
4505
+ const g = ci({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ie(
4418
4506
  m
4419
4507
  );
4420
4508
  if (g.length === 0)
4421
4509
  return null;
4422
- const _ = g.map(
4423
- (v, p) => li(v, p, g.length)
4510
+ const w = g.map(
4511
+ (p, v) => oi(p, v, g.length)
4424
4512
  );
4425
4513
  return /* @__PURE__ */ h(
4426
- ye,
4514
+ ke,
4427
4515
  {
4428
4516
  variant: u,
4429
4517
  text: l,
@@ -4431,26 +4519,26 @@ const Fr = ({
4431
4519
  "data-testid": "video-attachment",
4432
4520
  children: [
4433
4521
  /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
4434
- _n,
4522
+ Nn,
4435
4523
  {
4436
- tiles: _,
4437
- onTileActivate: w,
4524
+ tiles: w,
4525
+ onTileActivate: b,
4438
4526
  className: "overflow-hidden rounded-md"
4439
4527
  }
4440
4528
  ) }),
4441
4529
  /* @__PURE__ */ n(
4442
- Cn,
4530
+ kn,
4443
4531
  {
4444
4532
  open: f,
4445
4533
  items: En(g, r),
4446
4534
  initialIndex: c,
4447
- onClose: b
4535
+ onClose: N
4448
4536
  }
4449
4537
  )
4450
4538
  ]
4451
4539
  }
4452
4540
  );
4453
- }, ui = (e) => /* @__PURE__ */ n(di, { ...e }), mi = (e) => /* @__PURE__ */ n(Sn, { ...e, state: "sent" }), hi = (e) => /* @__PURE__ */ n(Sn, { ...e, state: "received" }), fi = {
4541
+ }, ui = (e) => /* @__PURE__ */ n(di, { ...e }), mi = (e) => /* @__PURE__ */ n(In, { ...e, state: "sent" }), hi = (e) => /* @__PURE__ */ n(In, { ...e, state: "received" }), fi = {
4454
4542
  Composer: ui,
4455
4543
  Sent: mi,
4456
4544
  Received: hi
@@ -4472,7 +4560,7 @@ const Fr = ({
4472
4560
  onClick: t,
4473
4561
  disabled: s,
4474
4562
  style: { backgroundColor: "#E6E5E3" },
4475
- className: k(
4563
+ className: y(
4476
4564
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
4477
4565
  {
4478
4566
  "hover:brightness-95 active:brightness-90": !s,
@@ -4494,7 +4582,7 @@ const Fr = ({
4494
4582
  const o = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
4495
4583
  return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
4496
4584
  (i || l) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
4497
- oe,
4585
+ ne,
4498
4586
  {
4499
4587
  id: l || "account",
4500
4588
  name: l || "Account",
@@ -4525,40 +4613,39 @@ const Fr = ({
4525
4613
  ] }) });
4526
4614
  };
4527
4615
  export {
4528
- sn as A,
4616
+ nn as A,
4529
4617
  wa as B,
4530
4618
  Ja as C,
4531
4619
  qs as D,
4532
4620
  $s as E,
4533
4621
  Ri as F,
4534
4622
  Ti as L,
4535
- ki as M,
4536
- pe as V,
4623
+ Ci as M,
4537
4624
  be as a,
4538
- oe as b,
4539
- or as c,
4625
+ ne as b,
4626
+ lr as c,
4540
4627
  hn as d,
4541
4628
  Ei as e,
4542
4629
  gi as f,
4543
- re as g,
4630
+ ie as g,
4544
4631
  Bt as h,
4545
4632
  Mi as i,
4546
4633
  Ea as j,
4547
- Ci as k,
4548
- Ii as l,
4549
- Pr as m,
4634
+ ki as k,
4635
+ Si as l,
4636
+ zr as m,
4550
4637
  Rr as n,
4551
4638
  rr as o,
4552
4639
  Dr as p,
4553
- Qt as q,
4640
+ Zt as q,
4554
4641
  ce as r,
4555
- on as s,
4642
+ rn as s,
4556
4643
  Bs as t,
4557
4644
  Ai as u,
4558
4645
  Ws as v,
4559
4646
  tt as w,
4560
4647
  nt as x,
4561
- Zt as y,
4562
- Si as z
4648
+ Jt as y,
4649
+ Ii as z
4563
4650
  };
4564
- //# sourceMappingURL=index-CgczmQkU.js.map
4651
+ //# sourceMappingURL=index-ubCRSgQk.js.map