@linktr.ee/messaging-react 1.30.0 → 1.31.0-rc-1776677746

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.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
2
2
  import A from "classnames";
3
- import F, { createContext as ft, useContext as gt, useCallback as U, useState as k, useRef as Q, useEffect as X, useMemo as Le, Suspense as $e } from "react";
4
- import { StreamChatService as xt } from "@linktr.ee/messaging-core";
5
- import { Chat as bt, ChannelList as Ct, DateSeparator as Nt, useChannelStateContext as Ie, useChatContext as Ke, areMessageUIPropsEqual as pt, useMessageReminder as yt, useComponentContext as vt, Attachment as wt, EditMessageModal as _t, MessageBlocked as Et, MessageBouncePrompt as St, MessageDeleted as It, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as kt, ReminderNotification as Tt, StreamedMessageText as Dt, messageHasAttachments as Rt, messageHasReactions as At, isDateSeparatorMessage as Lt, isMessageBlocked as Ut, isMessageBounced as Pt, MessageBounceModal as Ft, MessageText as ze, Poll as Ot, MessageErrorIcon as Bt, useMessageContext as Qe, useMessageComposer as Gt, useStateStore as jt, MessageInput as $t, useMessageInputContext as zt, useMessageComposerHasSendableData as Ht, SimpleAttachmentSelector as Vt, QuotedMessagePreview as Yt, AttachmentPreviewList as Wt, TextareaComposer as qt, MessageTimestamp as De, Channel as Zt, WithComponents as Jt, Window as Xt, MessageList as Kt } from "stream-chat-react";
6
- import { StarIcon as Ue, GiftIcon as Qt, XIcon as Oe, SpinnerGapIcon as _e, SignOutIcon as es, ProhibitInsetIcon as He, FlagIcon as ts, ArrowUpIcon as ss, SparkleIcon as ns, ProhibitIcon as as, ArrowLeftIcon as Ve, DotsThreeIcon as Ye, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as We } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as qe } from "stream-chat";
8
- const et = ft({
3
+ import F, { createContext as gt, useContext as xt, useCallback as U, useState as T, useRef as ee, useEffect as X, useMemo as Ue, Suspense as ze } from "react";
4
+ import { StreamChatService as bt } from "@linktr.ee/messaging-core";
5
+ import { Chat as Ct, ChannelList as Nt, DateSeparator as yt, useChannelStateContext as ke, useChatContext as Qe, areMessageUIPropsEqual as pt, useMessageReminder as vt, useComponentContext as wt, Attachment as _t, EditMessageModal as Et, MessageBlocked as St, MessageBouncePrompt as It, MessageDeleted as kt, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as Tt, ReminderNotification as Dt, StreamedMessageText as Rt, messageHasAttachments as At, messageHasReactions as Lt, isDateSeparatorMessage as Ut, isMessageBlocked as Pt, isMessageBounced as Ft, MessageBounceModal as Ot, MessageText as He, Poll as Bt, MessageErrorIcon as Gt, useMessageContext as et, useMessageComposer as jt, useStateStore as $t, MessageInput as zt, useMessageInputContext as Ht, useMessageComposerHasSendableData as Vt, SimpleAttachmentSelector as Yt, QuotedMessagePreview as Wt, AttachmentPreviewList as qt, TextareaComposer as Zt, MessageTimestamp as Re, Channel as Jt, WithComponents as Xt, Window as Kt, MessageList as Qt } from "stream-chat-react";
6
+ import { StarIcon as Pe, GiftIcon as es, XIcon as Be, SpinnerGapIcon as Ee, SignOutIcon as ts, ProhibitInsetIcon as Ve, FlagIcon as ss, ArrowUpIcon as ns, SparkleIcon as as, ProhibitIcon as rs, ArrowLeftIcon as Ye, DotsThreeIcon as We, MagnifyingGlassIcon as os, ChatCircleDotsIcon as qe } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as Ze } from "stream-chat";
8
+ const tt = gt({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const et = ft({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), Me = () => gt(et), cn = ({
18
+ }), Me = () => xt(tt), dn = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -24,8 +24,8 @@ const et = ft({
24
24
  debug: d = !1
25
25
  }) => {
26
26
  const a = U(
27
- (u, ...f) => {
28
- d && console.log(`🔥 [MessagingProvider] ${u}`, ...f);
27
+ (m, ...y) => {
28
+ d && console.log(`🔥 [MessagingProvider] ${m}`, ...y);
29
29
  },
30
30
  [d]
31
31
  );
@@ -35,68 +35,68 @@ const et = ft({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, g] = k(null), [h, b] = k(null), [C, S] = k(!1), [m, v] = k(!1), [r, p] = k(null), M = Q(!1), N = Q({
38
+ const [c, f] = T(null), [u, x] = T(null), [C, E] = T(!1), [h, p] = T(!1), [v, r] = T(null), M = ee(!1), S = ee({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), w = Q(0);
44
- w.current++, a("📊 RENDER INFO", {
45
- renderCount: w.current,
43
+ }), N = ee(0);
44
+ N.current++, a("📊 RENDER INFO", {
45
+ renderCount: N.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: N.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: N.current.apiKey !== o,
50
- serviceConfigChanged: N.current.serviceConfig !== n,
51
- capabilitiesChanged: N.current.capabilities !== l
48
+ userChanged: S.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: S.current.apiKey !== o,
50
+ serviceConfigChanged: S.current.serviceConfig !== n,
51
+ capabilitiesChanged: S.current.capabilities !== l
52
52
  }
53
- }), N.current = {
53
+ }), S.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
58
  }, X(() => {
59
- const u = w.current;
59
+ const m = N.current;
60
60
  if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: u,
61
+ renderCount: m,
62
62
  apiKey: !!o,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: N.current.serviceConfig === n,
68
- apiKeyStable: N.current.apiKey === o
67
+ serviceConfigStable: S.current.serviceConfig === n,
68
+ apiKeyStable: S.current.apiKey === o
69
69
  }
70
70
  }), !o || !n) {
71
71
  a("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: u,
72
+ renderCount: m,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  a("🚀 CREATING NEW SERVICE", {
78
- renderCount: u,
78
+ renderCount: m,
79
79
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
- serviceConfigChanged: N.current.serviceConfig !== n
80
+ serviceConfigChanged: S.current.serviceConfig !== n
81
81
  });
82
- const f = new xt({
82
+ const y = new bt({
83
83
  ...n,
84
84
  apiKey: o,
85
85
  debug: d
86
86
  });
87
- return g(f), a("✅ SERVICE SET", {
88
- renderCount: u,
89
- serviceInstance: !!f
87
+ return f(y), a("✅ SERVICE SET", {
88
+ renderCount: m,
89
+ serviceInstance: !!y
90
90
  }), () => {
91
91
  a("🧹 SERVICE CLEANUP", {
92
- renderCount: u,
92
+ renderCount: m,
93
93
  reason: "Effect cleanup"
94
- }), f.disconnectUser().catch(console.error);
94
+ }), y.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [o, n, d, a]);
97
- const _ = Q(null);
97
+ const w = ee(null);
98
98
  X(() => {
99
- var f, E;
99
+ var y, b;
100
100
  if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
@@ -112,7 +112,7 @@ const et = ft({
112
112
  a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((f = _.current) == null ? void 0 : f.serviceId) === c && ((E = _.current) == null ? void 0 : E.userId) === s.id) {
115
+ if (((y = w.current) == null ? void 0 : y.serviceId) === c && ((b = w.current) == null ? void 0 : b.userId) === s.id) {
116
116
  a(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,22 +120,22 @@ const et = ft({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, v(!0), p(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, p(!0), r(null);
124
124
  try {
125
125
  a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const y = await c.connectUser(s);
127
- b(y), S(!0), _.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
126
+ const _ = await c.connectUser(s);
127
+ x(_), E(!0), w.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: y.userID
129
+ clientId: _.userID
130
130
  });
131
- } catch (y) {
132
- const D = y instanceof Error ? y.message : "Connection failed";
133
- p(D), a("❌ USER CONNECTION ERROR", {
131
+ } catch (_) {
132
+ const k = _ instanceof Error ? _.message : "Connection failed";
133
+ r(k), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: D
135
+ error: k
136
136
  });
137
137
  } finally {
138
- v(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
138
+ p(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: C
141
141
  });
@@ -148,12 +148,12 @@ const et = ft({
148
148
  c && C ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), _.current = null, c.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
151
+ ), w.current = null, c.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!c,
153
153
  isConnected: C
154
154
  });
155
155
  }), [c, C, a]);
156
- const L = U(async () => {
156
+ const R = U(async () => {
157
157
  if (a("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
@@ -161,77 +161,77 @@ const et = ft({
161
161
  a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), p(!0);
165
165
  try {
166
166
  a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
- const u = await c.connectUser(s);
168
- b(u), S(!0), p(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (u) {
170
- const f = u instanceof Error ? u.message : "Refresh failed";
171
- p(f), a("❌ CONNECTION REFRESH ERROR", {
167
+ const m = await c.connectUser(s);
168
+ x(m), E(!0), r(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (m) {
170
+ const y = m instanceof Error ? m.message : "Refresh failed";
171
+ r(y), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: f
173
+ error: y
174
174
  });
175
175
  } finally {
176
- v(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ p(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, a]), x = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, a]), g = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
- hasClient: !!h,
180
+ hasClient: !!u,
181
181
  isConnected: C,
182
- isLoading: m,
183
- hasError: !!r,
182
+ isLoading: h,
183
+ hasError: !!v,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: c,
187
- client: h,
187
+ client: u,
188
188
  isConnected: C,
189
- isLoading: m,
190
- error: r,
189
+ isLoading: h,
190
+ error: v,
191
191
  capabilities: l,
192
- refreshConnection: L,
192
+ refreshConnection: R,
193
193
  debug: d
194
194
  }), [
195
195
  c,
196
- h,
196
+ u,
197
197
  C,
198
- m,
199
- r,
198
+ h,
199
+ v,
200
200
  l,
201
- L,
201
+ R,
202
202
  d,
203
203
  a
204
204
  ]);
205
205
  return a("🔄 RENDER END", {
206
- renderCount: w.current,
207
- willRenderChat: !!(h && C),
208
- contextValueReady: !!x
209
- }), /* @__PURE__ */ e(et.Provider, { value: x, children: h && C ? /* @__PURE__ */ e(
210
- bt,
206
+ renderCount: N.current,
207
+ willRenderChat: !!(u && C),
208
+ contextValueReady: !!g
209
+ }), /* @__PURE__ */ e(tt.Provider, { value: g, children: u && C ? /* @__PURE__ */ e(
210
+ Ct,
211
211
  {
212
- client: h,
212
+ client: u,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, os = () => Me();
220
- function ls(t) {
219
+ }, ls = () => Me();
220
+ function is(t) {
221
221
  const s = t.state.pending_messages;
222
222
  if (s != null && s.length)
223
223
  for (const n of s)
224
224
  t.state.addMessageSorted(n.message);
225
225
  }
226
- const tt = F.createContext({
226
+ const st = F.createContext({
227
227
  selectedChannel: void 0,
228
228
  onChannelSelect: () => {
229
229
  },
230
230
  debug: !1,
231
231
  renderMessagePreview: void 0
232
- }), is = tt.Provider, cs = () => F.useContext(tt), st = (t) => {
232
+ }), cs = st.Provider, ds = () => F.useContext(st), nt = (t) => {
233
233
  var o, l;
234
- const [s, n] = k(
234
+ const [s, n] = T(
235
235
  !!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
236
236
  );
237
237
  return X(() => {
@@ -242,27 +242,27 @@ const tt = F.createContext({
242
242
  }
243
243
  n(!!((a = t.state.membership) != null && a.pinned_at));
244
244
  const d = (c) => {
245
- var g;
245
+ var f;
246
246
  n(
247
- c != null && c.member ? !!c.member.pinned_at : !!((g = t.state.membership) != null && g.pinned_at)
247
+ c != null && c.member ? !!c.member.pinned_at : !!((f = t.state.membership) != null && f.pinned_at)
248
248
  );
249
249
  };
250
250
  return t.on("member.updated", d), () => {
251
251
  t.off("member.updated", d);
252
252
  };
253
253
  }, [t]), s;
254
- }, ds = (t, s) => {
254
+ }, ms = (t, s) => {
255
255
  const n = new Date(
256
256
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
257
257
  ), l = new Date(
258
258
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
259
259
  ).getTime() - n.getTime();
260
260
  return Math.floor(l / (1e3 * 60 * 60 * 24));
261
- }, ms = (t) => {
261
+ }, us = (t) => {
262
262
  const s = /* @__PURE__ */ new Date();
263
263
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
264
264
  return "Just now";
265
- const o = ds(t, s);
265
+ const o = ms(t, s);
266
266
  return o === 0 ? t.toLocaleTimeString([], {
267
267
  hour: "numeric",
268
268
  minute: "2-digit",
@@ -272,7 +272,7 @@ const tt = F.createContext({
272
272
  day: "numeric",
273
273
  year: "2-digit"
274
274
  });
275
- }, Ze = [
275
+ }, Je = [
276
276
  "🍎",
277
277
  // Apple
278
278
  "🍌",
@@ -300,7 +300,7 @@ const tt = F.createContext({
300
300
  "🍈"
301
301
  // Melon
302
302
  ];
303
- function us(t) {
303
+ function hs(t) {
304
304
  let s = 0;
305
305
  for (let n = 0; n < t.length; n++) {
306
306
  const o = t.charCodeAt(n);
@@ -308,11 +308,11 @@ function us(t) {
308
308
  }
309
309
  return Math.abs(s);
310
310
  }
311
- function hs(t) {
312
- const n = us(t) % Ze.length;
313
- return Ze[n];
311
+ function fs(t) {
312
+ const n = hs(t) % Je.length;
313
+ return Je[n];
314
314
  }
315
- const ie = ({
315
+ const ce = ({
316
316
  id: t,
317
317
  image: s,
318
318
  size: n = 40,
@@ -320,7 +320,7 @@ const ie = ({
320
320
  starred: l = !1,
321
321
  shape: d = "squircle"
322
322
  }) => {
323
- const a = hs(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
323
+ const a = fs(t), f = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", u = d === "circle" ? { borderRadius: "50%" } : {
324
324
  borderRadius: "33%",
325
325
  "corner-shape": "superellipse(1.3)"
326
326
  };
@@ -338,10 +338,10 @@ const ie = ({
338
338
  {
339
339
  "aria-hidden": "true",
340
340
  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)]",
341
- children: /* @__PURE__ */ e(Ue, { className: "size-3 text-yellow-600", weight: "duotone" })
341
+ children: /* @__PURE__ */ e(Pe, { className: "size-3 text-yellow-600", weight: "duotone" })
342
342
  }
343
343
  ),
344
- /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
344
+ /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: u, children: s ? /* @__PURE__ */ e(
345
345
  "img",
346
346
  {
347
347
  src: s,
@@ -354,7 +354,7 @@ const ie = ({
354
354
  "aria-hidden": "true",
355
355
  className: A(
356
356
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
357
- g
357
+ f
358
358
  ),
359
359
  children: a
360
360
  }
@@ -362,7 +362,7 @@ const ie = ({
362
362
  ]
363
363
  }
364
364
  );
365
- }, fs = ({ size: t = 15 }) => /* @__PURE__ */ e(
365
+ }, gs = ({ size: t = 15 }) => /* @__PURE__ */ e(
366
366
  "svg",
367
367
  {
368
368
  width: t,
@@ -379,92 +379,92 @@ const ie = ({
379
379
  }
380
380
  )
381
381
  }
382
- ), gs = (t) => {
382
+ ), xs = (t) => {
383
383
  var s;
384
384
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
385
- }, xs = (t) => {
385
+ }, bs = (t) => {
386
386
  var s;
387
387
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
388
- }, Be = (t) => {
388
+ }, Ge = (t) => {
389
389
  var s;
390
390
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
391
- }, bs = (t) => {
391
+ }, Cs = (t) => {
392
392
  var s;
393
393
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
394
- }, nt = (t) => gs(t) || xs(t), Cs = (t) => {
394
+ }, at = (t) => xs(t) || bs(t), Ns = (t) => {
395
395
  var s;
396
- return nt(t) && !((s = t.text) != null && s.trim());
397
- }, Re = ({
396
+ return at(t) && !((s = t.text) != null && s.trim());
397
+ }, Ae = ({
398
398
  message: t,
399
399
  standalone: s = !1,
400
400
  isMyMessage: n = !1,
401
401
  hasAttachment: o = !1
402
402
  }) => {
403
403
  var C;
404
- const l = nt(t), d = Be(t);
404
+ const l = at(t), d = Ge(t);
405
405
  if (!l && !d)
406
406
  return null;
407
407
  if (l) {
408
- const S = (C = t.metadata) == null ? void 0 : C.amount_text;
409
- if (!S) return null;
410
- const m = s ? "message-tip-standalone" : "message-tag message-tag--tip", v = s ? `${S} tip` : `Delivered with ${S} tip`;
411
- return /* @__PURE__ */ i("div", { className: m, children: [
412
- /* @__PURE__ */ e(Qt, { size: s ? 14 : 12 }),
413
- /* @__PURE__ */ e("span", { children: v })
408
+ const E = (C = t.metadata) == null ? void 0 : C.amount_text;
409
+ if (!E) return null;
410
+ const h = s ? "message-tip-standalone" : "message-tag message-tag--tip", p = s ? `${E} tip` : `Delivered with ${E} tip`;
411
+ return /* @__PURE__ */ i("div", { className: h, children: [
412
+ /* @__PURE__ */ e(es, { size: s ? 14 : 12 }),
413
+ /* @__PURE__ */ e("span", { children: p })
414
414
  ] });
415
415
  }
416
- const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
416
+ const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", f = [
417
417
  "message-chatbot-indicator",
418
418
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
419
419
  a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
420
- ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(fs, { size: a ? 12 : 15 }) });
421
- return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
422
- h,
423
- b
420
+ ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(gs, { size: a ? 12 : 15 }) });
421
+ return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
422
+ u,
423
+ x
424
424
  ] }) : /* @__PURE__ */ i(he, { children: [
425
- b,
426
- h
425
+ x,
426
+ u
427
427
  ] }) });
428
- }, at = F.memo(
428
+ }, rt = F.memo(
429
429
  ({ channel: t, unread: s }) => {
430
- var L, x, u, f;
431
- const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = cs(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
430
+ var R, g, m, y;
431
+ const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = ds(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
432
432
  t && o(t);
433
- }, g = (E) => {
434
- const y = E.key === "Enter" || E.key === " ", D = E.repeat;
435
- !y || D || (E.preventDefault(), c());
436
- }, b = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
437
- (E) => {
438
- var y, D;
439
- return ((y = E.user) == null ? void 0 : y.id) && E.user.id !== ((D = t == null ? void 0 : t._client) == null ? void 0 : D.userID);
433
+ }, f = (b) => {
434
+ const _ = b.key === "Enter" || b.key === " ", k = b.repeat;
435
+ !_ || k || (b.preventDefault(), c());
436
+ }, x = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
437
+ (b) => {
438
+ var _, k;
439
+ return ((_ = b.user) == null ? void 0 : _.id) && b.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
440
440
  }
441
- ), C = ((x = b == null ? void 0 : b.user) == null ? void 0 : x.name) || "Conversation", S = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, m = (() => {
442
- var y;
443
- const E = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
444
- if (E != null && E.length) {
445
- for (let D = E.length - 1; D >= 0; D--)
446
- if (E[D].type !== "system") return E[D];
441
+ ), C = ((g = x == null ? void 0 : x.user) == null ? void 0 : g.name) || "Conversation", E = (m = x == null ? void 0 : x.user) == null ? void 0 : m.image, h = (() => {
442
+ var _;
443
+ const b = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages;
444
+ if (b != null && b.length) {
445
+ for (let k = b.length - 1; k >= 0; k--)
446
+ if (b[k].type !== "system") return b[k];
447
447
  }
448
- })(), r = (() => {
449
- var D, G;
450
- if (m != null && m.text) return m.text;
451
- if (((D = m == null ? void 0 : m.metadata) == null ? void 0 : D.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
452
- const y = (G = m == null ? void 0 : m.attachments) == null ? void 0 : G[0];
453
- return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
454
- })(), p = m != null && m.created_at ? ms(new Date(m.created_at)) : "", M = m ? Be(m) : !1, N = d ? d(m, r) : `${M ? "✨ " : ""}${r}`, w = st(t), _ = s ?? 0;
448
+ })(), v = (() => {
449
+ var k, Y;
450
+ if (h != null && h.text) return h.text;
451
+ if (((k = h == null ? void 0 : h.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
452
+ const _ = (Y = h == null ? void 0 : h.attachments) == null ? void 0 : Y[0];
453
+ return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
454
+ })(), r = h != null && h.created_at ? us(new Date(h.created_at)) : "", M = h ? Ge(h) : !1, S = d ? d(h, v) : `${M ? "✨ " : ""}${v}`, N = nt(t), w = s ?? 0;
455
455
  return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
456
456
  channelId: t == null ? void 0 : t.id,
457
457
  isSelected: a,
458
458
  participantName: C,
459
- unreadCount: _,
460
- hasTimestamp: !!p
459
+ unreadCount: w,
460
+ hasTimestamp: !!r
461
461
  }), /* @__PURE__ */ e(
462
462
  "div",
463
463
  {
464
464
  role: "button",
465
465
  tabIndex: 0,
466
466
  onClick: c,
467
- onKeyDown: g,
467
+ onKeyDown: f,
468
468
  className: A(
469
469
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
470
470
  {
@@ -474,13 +474,13 @@ const ie = ({
474
474
  ),
475
475
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
476
476
  /* @__PURE__ */ e(
477
- ie,
477
+ ce,
478
478
  {
479
- id: ((f = b == null ? void 0 : b.user) == null ? void 0 : f.id) || t.id || "unknown",
479
+ id: ((y = x == null ? void 0 : x.user) == null ? void 0 : y.id) || t.id || "unknown",
480
480
  name: C,
481
- image: S,
481
+ image: E,
482
482
  size: 44,
483
- starred: w,
483
+ starred: N,
484
484
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
485
485
  }
486
486
  ),
@@ -494,16 +494,16 @@ const ie = ({
494
494
  a ? "text-primary" : "text-charcoal"
495
495
  ),
496
496
  children: [
497
- w && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
497
+ N && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
498
498
  C
499
499
  ]
500
500
  }
501
501
  ),
502
- p && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: p })
502
+ r && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: r })
503
503
  ] }),
504
504
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
505
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
506
- _ > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: _ > 99 ? "99+" : _ })
505
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
506
+ w > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: w > 99 ? "99+" : w })
507
507
  ] })
508
508
  ] })
509
509
  ] })
@@ -511,8 +511,8 @@ const ie = ({
511
511
  );
512
512
  }
513
513
  );
514
- at.displayName = "CustomChannelPreview";
515
- const Ns = { last_message_at: -1 }, rt = F.memo(
514
+ rt.displayName = "CustomChannelPreview";
515
+ const ys = { last_message_at: -1 }, ot = F.memo(
516
516
  ({
517
517
  onChannelSelect: t,
518
518
  selectedChannel: s,
@@ -521,44 +521,44 @@ const Ns = { last_message_at: -1 }, rt = F.memo(
521
521
  onMessageNew: l,
522
522
  onAddedToChannel: d,
523
523
  channelRenderFilterFn: a,
524
- sort: c = Ns,
525
- className: g,
526
- customEmptyStateIndicator: h,
527
- renderMessagePreview: b
524
+ sort: c = ys,
525
+ className: f,
526
+ customEmptyStateIndicator: u,
527
+ renderMessagePreview: x
528
528
  }) => {
529
529
  const C = F.useRef(0);
530
530
  C.current++;
531
- const { debug: S = !1 } = Me(), m = F.useCallback(
532
- (r) => {
533
- for (const p of r)
534
- ls(p);
535
- return a ? a(r) : r;
531
+ const { debug: E = !1 } = Me(), h = F.useCallback(
532
+ (v) => {
533
+ for (const r of v)
534
+ is(r);
535
+ return a ? a(v) : v;
536
536
  },
537
537
  [a]
538
538
  );
539
- S && console.log("📺 [ChannelList] 🔄 RENDER START", {
539
+ E && console.log("📺 [ChannelList] 🔄 RENDER START", {
540
540
  renderCount: C.current,
541
541
  selectedChannelId: s == null ? void 0 : s.id,
542
542
  filters: n
543
543
  });
544
- const v = F.useMemo(
544
+ const p = F.useMemo(
545
545
  () => ({
546
546
  selectedChannel: s,
547
547
  onChannelSelect: t,
548
- debug: S,
549
- renderMessagePreview: b
548
+ debug: E,
549
+ renderMessagePreview: x
550
550
  }),
551
- [s, t, S, b]
551
+ [s, t, E, x]
552
552
  );
553
553
  return /* @__PURE__ */ e(
554
554
  "div",
555
555
  {
556
556
  className: A(
557
557
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
558
- g
558
+ f
559
559
  ),
560
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(is, { value: v, children: /* @__PURE__ */ e(
561
- Ct,
560
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(cs, { value: p, children: /* @__PURE__ */ e(
561
+ Nt,
562
562
  {
563
563
  filters: n,
564
564
  sort: c,
@@ -566,9 +566,9 @@ const Ns = { last_message_at: -1 }, rt = F.memo(
566
566
  allowNewMessagesFromUnfilteredChannels: o,
567
567
  onMessageNew: l,
568
568
  onAddedToChannel: d,
569
- channelRenderFilterFn: m,
570
- Preview: at,
571
- EmptyStateIndicator: h
569
+ channelRenderFilterFn: h,
570
+ Preview: rt,
571
+ EmptyStateIndicator: u
572
572
  },
573
573
  `${JSON.stringify(n)}:${JSON.stringify(c)}`
574
574
  ) }) })
@@ -576,8 +576,8 @@ const Ns = { last_message_at: -1 }, rt = F.memo(
576
576
  );
577
577
  }
578
578
  );
579
- rt.displayName = "ChannelList";
580
- const we = ({
579
+ ot.displayName = "ChannelList";
580
+ const _e = ({
581
581
  variant: t = "default",
582
582
  className: s,
583
583
  children: n,
@@ -595,7 +595,7 @@ const we = ({
595
595
  children: n
596
596
  }
597
597
  );
598
- function ot({ label: t, className: s, children: n, ...o }) {
598
+ function lt({ label: t, className: s, children: n, ...o }) {
599
599
  return /* @__PURE__ */ i(
600
600
  "button",
601
601
  {
@@ -616,8 +616,8 @@ function ot({ label: t, className: s, children: n, ...o }) {
616
616
  }
617
617
  );
618
618
  }
619
- function lt({ onClick: t }) {
620
- return /* @__PURE__ */ e(ot, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
619
+ function it({ onClick: t }) {
620
+ return /* @__PURE__ */ e(lt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Be, { className: "h-5 w-5 text-stone", weight: "bold" }) });
621
621
  }
622
622
  const ps = ({
623
623
  dialogRef: t,
@@ -628,80 +628,80 @@ const ps = ({
628
628
  onLeaveConversation: d,
629
629
  onBlockParticipant: a,
630
630
  showDeleteConversation: c = !0,
631
- onDeleteConversationClick: g,
632
- onBlockParticipantClick: h,
633
- onReportParticipantClick: b,
631
+ onDeleteConversationClick: f,
632
+ onBlockParticipantClick: u,
633
+ onReportParticipantClick: x,
634
634
  customProfileContent: C,
635
- customChannelActions: S
635
+ customChannelActions: E
636
636
  }) => {
637
- var Z, J, P, V, z, ce, de;
638
- const { service: m, debug: v } = Me(), [r, p] = k(!1), [M, N] = k(!1), [w, _] = k(!1), L = U(async () => {
639
- var R;
640
- if (!(!m || !((R = n == null ? void 0 : n.user) != null && R.id)))
637
+ var te, Z, J, P, W, z, de;
638
+ const { service: h, debug: p } = Me(), [v, r] = T(!1), [M, S] = T(!1), [N, w] = T(!1), R = U(async () => {
639
+ var O;
640
+ if (!(!h || !((O = n == null ? void 0 : n.user) != null && O.id)))
641
641
  try {
642
- const Y = (await m.getBlockedUsers()).some(
643
- (W) => {
644
- var ne;
645
- return W.blocked_user_id === ((ne = n == null ? void 0 : n.user) == null ? void 0 : ne.id);
642
+ const H = (await h.getBlockedUsers()).some(
643
+ (K) => {
644
+ var se;
645
+ return K.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
646
646
  }
647
647
  );
648
- p(Y);
649
- } catch (O) {
648
+ r(H);
649
+ } catch (L) {
650
650
  console.error(
651
651
  "[ChannelInfoDialog] Failed to check blocked status:",
652
- O
652
+ L
653
653
  );
654
654
  }
655
- }, [m, (Z = n == null ? void 0 : n.user) == null ? void 0 : Z.id]);
655
+ }, [h, (te = n == null ? void 0 : n.user) == null ? void 0 : te.id]);
656
656
  X(() => {
657
- L();
658
- }, [L]);
659
- const x = async () => {
660
- var R;
657
+ R();
658
+ }, [R]);
659
+ const g = async () => {
660
+ var O;
661
661
  if (!M) {
662
- g == null || g(), v && console.log("[ChannelInfoDialog] Leave conversation", o.cid), N(!0);
662
+ f == null || f(), p && console.log("[ChannelInfoDialog] Leave conversation", o.cid), S(!0);
663
663
  try {
664
- const O = ((R = o._client) == null ? void 0 : R.userID) ?? null;
665
- await o.hide(O, !1), d && await d(o), s();
666
- } catch (O) {
667
- console.error("[ChannelInfoDialog] Failed to leave conversation", O);
664
+ const L = ((O = o._client) == null ? void 0 : O.userID) ?? null;
665
+ await o.hide(L, !1), d && await d(o), s();
666
+ } catch (L) {
667
+ console.error("[ChannelInfoDialog] Failed to leave conversation", L);
668
668
  } finally {
669
- N(!1);
669
+ S(!1);
670
670
  }
671
671
  }
672
- }, u = async () => {
673
- var R, O, Y;
674
- if (!(w || !m)) {
675
- h == null || h(), v && console.log("[ChannelInfoDialog] Block member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), _(!0);
672
+ }, m = async () => {
673
+ var O, L, H;
674
+ if (!(N || !h)) {
675
+ u == null || u(), p && console.log("[ChannelInfoDialog] Block member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
676
676
  try {
677
- await m.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id), s();
678
- } catch (W) {
679
- console.error("[ChannelInfoDialog] Failed to block member", W);
677
+ await h.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
678
+ } catch (K) {
679
+ console.error("[ChannelInfoDialog] Failed to block member", K);
680
680
  } finally {
681
- _(!1);
681
+ w(!1);
682
682
  }
683
683
  }
684
- }, f = async () => {
685
- var R, O, Y;
686
- if (!(w || !m)) {
687
- h == null || h(), v && console.log("[ChannelInfoDialog] Unblock member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), _(!0);
684
+ }, y = async () => {
685
+ var O, L, H;
686
+ if (!(N || !h)) {
687
+ u == null || u(), p && console.log("[ChannelInfoDialog] Unblock member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
688
688
  try {
689
- await m.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id), s();
690
- } catch (W) {
691
- console.error("[ChannelInfoDialog] Failed to unblock member", W);
689
+ await h.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
690
+ } catch (K) {
691
+ console.error("[ChannelInfoDialog] Failed to unblock member", K);
692
692
  } finally {
693
- _(!1);
693
+ w(!1);
694
694
  }
695
695
  }
696
- }, E = () => {
697
- b == null || b(), s(), window.open(
696
+ }, b = () => {
697
+ x == null || x(), s(), window.open(
698
698
  "https://linktr.ee/s/about/trust-center/report",
699
699
  "_blank",
700
700
  "noopener,noreferrer"
701
701
  );
702
702
  };
703
703
  if (!n) return null;
704
- const y = ((J = n.user) == null ? void 0 : J.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (ce = n.user) == null ? void 0 : ce.username, j = G || (T ? `linktr.ee/${T}` : void 0), se = ((de = n.user) == null ? void 0 : de.id) || "unknown";
704
+ const _ = ((Z = n.user) == null ? void 0 : Z.name) || ((J = n.user) == null ? void 0 : J.id) || "Unknown member", k = (P = n.user) == null ? void 0 : P.image, Y = (W = n.user) == null ? void 0 : W.email, G = (z = n.user) == null ? void 0 : z.username, D = Y || (G ? `linktr.ee/${G}` : void 0), j = ((de = n.user) == null ? void 0 : de.id) || "unknown";
705
705
  return (
706
706
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
707
707
  /* @__PURE__ */ e(
@@ -710,13 +710,13 @@ const ps = ({
710
710
  ref: t,
711
711
  className: "mes-dialog group",
712
712
  onClose: s,
713
- onClick: (R) => {
714
- R.target === t.current && s();
713
+ onClick: (O) => {
714
+ O.target === t.current && s();
715
715
  },
716
716
  children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
717
717
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
718
718
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
719
- /* @__PURE__ */ e(lt, { onClick: s })
719
+ /* @__PURE__ */ e(it, { onClick: s })
720
720
  ] }),
721
721
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
722
722
  /* @__PURE__ */ e(
@@ -726,18 +726,18 @@ const ps = ({
726
726
  style: { backgroundColor: "#FBFAF9" },
727
727
  children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
728
728
  /* @__PURE__ */ e(
729
- ie,
729
+ ce,
730
730
  {
731
- id: se,
732
- name: y,
733
- image: D,
731
+ id: j,
732
+ name: _,
733
+ image: k,
734
734
  size: 88,
735
735
  shape: "circle"
736
736
  }
737
737
  ),
738
738
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
739
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
740
- j && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: j }),
739
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
740
+ D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
741
741
  l && !C && /* @__PURE__ */ e(
742
742
  "span",
743
743
  {
@@ -759,65 +759,65 @@ const ps = ({
759
759
  ),
760
760
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
761
761
  c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
762
- we,
762
+ _e,
763
763
  {
764
- onClick: x,
764
+ onClick: g,
765
765
  disabled: M,
766
766
  "aria-busy": M,
767
767
  children: [
768
- M ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(es, { className: "h-5 w-5" }),
768
+ M ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
769
769
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
770
770
  ]
771
771
  }
772
772
  ) }),
773
- /* @__PURE__ */ e("li", { children: r ? /* @__PURE__ */ i(
774
- we,
773
+ /* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ i(
774
+ _e,
775
775
  {
776
- onClick: f,
777
- disabled: w,
778
- "aria-busy": w,
776
+ onClick: y,
777
+ disabled: N,
778
+ "aria-busy": N,
779
779
  children: [
780
- w ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
780
+ N ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
781
781
  /* @__PURE__ */ e("span", { children: "Unblock" })
782
782
  ]
783
783
  }
784
784
  ) : /* @__PURE__ */ i(
785
- we,
785
+ _e,
786
786
  {
787
- onClick: u,
788
- disabled: w,
789
- "aria-busy": w,
787
+ onClick: m,
788
+ disabled: N,
789
+ "aria-busy": N,
790
790
  children: [
791
- w ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
791
+ N ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
792
792
  /* @__PURE__ */ e("span", { children: "Block" })
793
793
  ]
794
794
  }
795
795
  ) }),
796
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(we, { variant: "danger", onClick: E, children: [
797
- /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
796
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(_e, { variant: "danger", onClick: b, children: [
797
+ /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
798
798
  /* @__PURE__ */ e("span", { children: "Report" })
799
799
  ] }) }),
800
- S
800
+ E
801
801
  ] })
802
802
  ] })
803
803
  ] })
804
804
  }
805
805
  )
806
806
  );
807
- }, ys = (t) => /* @__PURE__ */ e(Nt, { ...t, position: "center" }), Pe = "vote_up", Fe = "vote_down";
808
- function vs(t) {
809
- return t != null && t.length ? t.some((s) => s.type === Fe) ? "down" : t.some((s) => s.type === Pe) ? "up" : null : null;
810
- }
807
+ }, vs = (t) => /* @__PURE__ */ e(yt, { ...t, position: "center" }), Fe = "vote_up", Oe = "vote_down";
811
808
  function ws(t) {
812
- const { channel: s } = Ie(), { client: n } = Ke("useMessageVote"), o = Le(
813
- () => vs(t.own_reactions),
809
+ return t != null && t.length ? t.some((s) => s.type === Oe) ? "down" : t.some((s) => s.type === Fe) ? "up" : null : null;
810
+ }
811
+ function _s(t) {
812
+ const { channel: s } = ke(), { client: n } = Qe("useMessageVote"), o = Ue(
813
+ () => ws(t.own_reactions),
814
814
  [t.own_reactions]
815
815
  ), l = U(async () => {
816
816
  if (n != null && n.userID)
817
817
  try {
818
- o === "up" ? await s.deleteReaction(t.id, Pe) : await s.sendReaction(
818
+ o === "up" ? await s.deleteReaction(t.id, Fe) : await s.sendReaction(
819
819
  t.id,
820
- { type: Pe },
820
+ { type: Fe },
821
821
  { enforce_unique: !0, skip_push: !0 }
822
822
  );
823
823
  } catch {
@@ -825,9 +825,9 @@ function ws(t) {
825
825
  }, [s, n == null ? void 0 : n.userID, t.id, o]), d = U(async () => {
826
826
  if (n != null && n.userID)
827
827
  try {
828
- o === "down" ? await s.deleteReaction(t.id, Fe) : await s.sendReaction(
828
+ o === "down" ? await s.deleteReaction(t.id, Oe) : await s.sendReaction(
829
829
  t.id,
830
- { type: Fe },
830
+ { type: Oe },
831
831
  { enforce_unique: !0, skip_push: !0 }
832
832
  );
833
833
  } catch {
@@ -835,13 +835,13 @@ function ws(t) {
835
835
  }, [s, n == null ? void 0 : n.userID, t.id, o]);
836
836
  return { selected: o, voteUp: l, voteDown: d };
837
837
  }
838
- const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => import("./Visitor-C9HSYm3D.js")), Je = () => /* @__PURE__ */ e(
838
+ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => import("./Visitor-DyJTWB2_.js")), Xe = () => /* @__PURE__ */ e(
839
839
  "div",
840
840
  {
841
- className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04)]",
841
+ className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
842
842
  "aria-hidden": !0
843
843
  }
844
- ), Ss = (t) => t.onUnlock != null || t.onDownload != null ? /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(Es, { ...t }) }) : /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(_s, { ...t }) }), Is = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
844
+ ), Is = (t) => t.onUnlockClick != null || t.onDownloadClick != null || t.onUnlocked != null ? /* @__PURE__ */ e(ze, { fallback: /* @__PURE__ */ e(Xe, {}), children: /* @__PURE__ */ e(Ss, { ...t }) }) : /* @__PURE__ */ e(ze, { fallback: /* @__PURE__ */ e(Xe, {}), children: /* @__PURE__ */ e(Es, { ...t }) }), ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
845
845
  "path",
846
846
  {
847
847
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -861,7 +861,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
861
861
  strokeLinejoin: "round",
862
862
  fill: t ? "currentColor" : "none"
863
863
  }
864
- ) }), ks = ({
864
+ ) }), Ts = ({
865
865
  selected: t,
866
866
  onVoteUp: s,
867
867
  onVoteDown: n
@@ -874,7 +874,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
874
874
  onClick: s,
875
875
  "aria-label": "Helpful",
876
876
  "aria-pressed": t === "up",
877
- children: /* @__PURE__ */ e(Is, { filled: t === "up" })
877
+ children: /* @__PURE__ */ e(ks, { filled: t === "up" })
878
878
  }
879
879
  ),
880
880
  /* @__PURE__ */ e(
@@ -888,91 +888,92 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
888
888
  children: /* @__PURE__ */ e(Ms, { filled: t === "down" })
889
889
  }
890
890
  )
891
- ] }), Ts = (t) => {
892
- var ge, xe, be, le, K, Ce, Ne, pe;
891
+ ] }), Ds = (t) => {
892
+ var ge, be, Ce, ie, Q, Ne, ye, pe;
893
893
  const {
894
894
  additionalMessageInputProps: s,
895
895
  chatbotVotingEnabled: n,
896
- onAttachmentUnlock: o,
897
- onAttachmentDownload: l,
898
- editing: d,
899
- endOfGroup: a,
900
- firstOfGroup: c,
901
- groupedByUser: g,
902
- handleAction: h,
903
- handleOpenThread: b,
904
- handleRetry: C,
905
- highlighted: S,
906
- isMessageAIGenerated: m,
896
+ onAttachmentUnlockClick: o,
897
+ onAttachmentDownloadClick: l,
898
+ onAttachmentUnlocked: d,
899
+ editing: a,
900
+ endOfGroup: c,
901
+ firstOfGroup: f,
902
+ groupedByUser: u,
903
+ handleAction: x,
904
+ handleOpenThread: C,
905
+ handleRetry: E,
906
+ highlighted: h,
907
+ isMessageAIGenerated: p,
907
908
  isMyMessage: v,
908
909
  message: r,
909
- renderText: p,
910
- threadList: M
911
- } = t, { client: N } = Ke("CustomMessage"), { channel: w } = Ie("CustomMessage"), [_, L] = k(!1), x = yt(r.id), { selected: u, voteUp: f, voteDown: E } = ws(r), {
912
- Attachment: y = wt,
913
- EditMessageModal: D = _t,
914
- MessageBlocked: G = Et,
915
- MessageBouncePrompt: T = St,
916
- MessageDeleted: j = It,
917
- MessageIsThreadReplyInChannelButtonIndicator: se = Mt,
918
- MessageRepliesCountButton: Z = kt,
919
- ReminderNotification: J = Tt,
920
- StreamedMessageText: P = Dt,
921
- PinIndicator: V
922
- } = vt("CustomMessage"), z = Rt(r), ce = At(r), de = Le(
923
- () => m == null ? void 0 : m(r),
924
- [m, r]
925
- ), R = Le(
910
+ renderText: M,
911
+ threadList: S
912
+ } = t, { client: N } = Qe("CustomMessage"), { channel: w } = ke("CustomMessage"), [R, g] = T(!1), m = vt(r.id), { selected: y, voteUp: b, voteDown: _ } = _s(r), {
913
+ Attachment: k = _t,
914
+ EditMessageModal: Y = Et,
915
+ MessageBlocked: G = St,
916
+ MessageBouncePrompt: D = It,
917
+ MessageDeleted: j = kt,
918
+ MessageIsThreadReplyInChannelButtonIndicator: te = Mt,
919
+ MessageRepliesCountButton: Z = Tt,
920
+ ReminderNotification: J = Dt,
921
+ StreamedMessageText: P = Rt,
922
+ PinIndicator: W
923
+ } = wt("CustomMessage"), z = At(r), de = Lt(r), O = Ue(
924
+ () => p == null ? void 0 : p(r),
925
+ [p, r]
926
+ ), L = Ue(
926
927
  () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
927
928
  [r]
928
929
  );
929
- if (Lt(r))
930
+ if (Ut(r))
930
931
  return null;
931
932
  if (r.deleted_at || r.type === "deleted")
932
933
  return /* @__PURE__ */ e(j, { message: r });
933
- if (Ut(r))
934
+ if (Pt(r))
934
935
  return /* @__PURE__ */ e(G, {});
935
- const O = !M && !!r.reply_count, Y = !M && r.show_in_channel && r.parent_id, W = r.status === "failed" && ((ge = r.error) == null ? void 0 : ge.status) !== 403, ne = Pt(r);
936
- let ee;
937
- W ? ee = () => C(r) : ne && (ee = () => L(!0));
938
- const ae = v(), Ge = A(
936
+ const H = !S && !!r.reply_count, K = !S && r.show_in_channel && r.parent_id, se = r.status === "failed" && ((ge = r.error) == null ? void 0 : ge.status) !== 403, xe = Ft(r);
937
+ let ne;
938
+ se ? ne = () => E(r) : xe && (ne = () => g(!0));
939
+ const re = v(), je = A(
939
940
  "str-chat__message str-chat__message-simple",
940
941
  `str-chat__message--${r.type}`,
941
942
  `str-chat__message--${r.status}`,
942
- ae ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
943
+ re ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
943
944
  r.text ? "str-chat__message--has-text" : "has-no-text",
944
945
  {
945
946
  "str-chat__message--has-attachment": z,
946
- "str-chat__message--highlighted": S,
947
+ "str-chat__message--highlighted": h,
947
948
  "str-chat__message--pinned pinned-message": r.pinned,
948
- "str-chat__message--with-reactions": ce,
949
- "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((xe = r == null ? void 0 : r.error) == null ? void 0 : xe.status) !== 403,
950
- "str-chat__message-with-thread-link": O || Y,
951
- "str-chat__virtual-message__wrapper--end": a,
952
- "str-chat__virtual-message__wrapper--first": c,
953
- "str-chat__virtual-message__wrapper--group": g
949
+ "str-chat__message--with-reactions": de,
950
+ "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((be = r == null ? void 0 : r.error) == null ? void 0 : be.status) !== 403,
951
+ "str-chat__message-with-thread-link": H || K,
952
+ "str-chat__virtual-message__wrapper--end": c,
953
+ "str-chat__virtual-message__wrapper--first": f,
954
+ "str-chat__virtual-message__wrapper--group": u
954
955
  }
955
- ), q = r.poll_id && N.polls.fromState(r.poll_id), me = Cs(r), re = Be(r), oe = bs(r), te = !!(R != null && R.length && !r.quoted_message), fe = re && ae && te;
956
+ ), q = r.poll_id && N.polls.fromState(r.poll_id), me = Ns(r), oe = Ge(r), le = Cs(r), ae = !!(L != null && L.length && !r.quoted_message), fe = oe && re && ae;
956
957
  return /* @__PURE__ */ i(he, { children: [
957
- d && /* @__PURE__ */ e(
958
- D,
958
+ a && /* @__PURE__ */ e(
959
+ Y,
959
960
  {
960
961
  additionalMessageInputProps: s
961
962
  }
962
963
  ),
963
- _ && /* @__PURE__ */ e(
964
- Ft,
964
+ R && /* @__PURE__ */ e(
965
+ Ot,
965
966
  {
966
- MessageBouncePrompt: T,
967
- onClose: () => L(!1),
968
- open: _
967
+ MessageBouncePrompt: D,
968
+ onClose: () => g(!1),
969
+ open: R
969
970
  }
970
971
  ),
971
- /* @__PURE__ */ i("div", { className: Ge, children: [
972
- V && /* @__PURE__ */ e(V, {}),
973
- !!x && /* @__PURE__ */ e(J, { reminder: x }),
972
+ /* @__PURE__ */ i("div", { className: je, children: [
973
+ W && /* @__PURE__ */ e(W, {}),
974
+ !!m && /* @__PURE__ */ e(J, { reminder: m }),
974
975
  r.user && /* @__PURE__ */ e(
975
- ie,
976
+ ce,
976
977
  {
977
978
  className: "str-chat__avatar str-chat__message-sender-avatar",
978
979
  id: r.user.id,
@@ -984,104 +985,105 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
984
985
  "div",
985
986
  {
986
987
  className: A("str-chat__message-inner", {
987
- "str-chat__simple-message--error-failed": W || ne
988
+ "str-chat__simple-message--error-failed": se || xe
988
989
  }),
989
990
  "data-testid": "message-inner",
990
- onClick: ee,
991
- onKeyDown: ee,
992
- role: ee ? "button" : void 0,
993
- tabIndex: ee ? 0 : void 0,
991
+ onClick: ne,
992
+ onKeyDown: ne,
993
+ role: ne ? "button" : void 0,
994
+ tabIndex: ne ? 0 : void 0,
994
995
  style: {
995
996
  // Force margins to 0 to prevent hover layout shift
996
997
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
997
998
  marginInlineEnd: 0,
998
999
  marginInlineStart: 0
999
1000
  },
1000
- children: oe ? /* @__PURE__ */ i("div", { className: A("flex flex-col gap-1", ae ? "items-end" : "items-start"), children: [
1001
+ children: le ? /* @__PURE__ */ i("div", { className: A("flex flex-col gap-1", re ? "items-end" : "items-start"), children: [
1001
1002
  /* @__PURE__ */ e(
1002
- Ss,
1003
+ Is,
1003
1004
  {
1004
- title: (be = r.metadata) == null ? void 0 : be.attachment_title,
1005
- mimeType: (le = r.metadata) == null ? void 0 : le.attachment_mime_type,
1006
- thumbnail: (K = r.metadata) == null ? void 0 : K.attachment_thumbnail,
1007
- amountText: (Ce = r.metadata) == null ? void 0 : Ce.amount_text,
1008
- detail: (Ne = r.metadata) == null ? void 0 : Ne.attachment_detail,
1005
+ title: (Ce = r.metadata) == null ? void 0 : Ce.attachment_title,
1006
+ mimeType: ((ie = r.metadata) == null ? void 0 : ie.attachment_mime_type) ?? "application/octet-stream",
1007
+ thumbnailUrl: (Q = r.metadata) == null ? void 0 : Q.attachment_thumbnail,
1008
+ amountText: (Ne = r.metadata) == null ? void 0 : Ne.amount_text,
1009
+ detail: (ye = r.metadata) == null ? void 0 : ye.attachment_detail,
1009
1010
  paymentStatus: (pe = r.metadata) == null ? void 0 : pe.payment_status,
1010
- onUnlock: o ? () => o(r, w) : void 0,
1011
- onDownload: l ? () => l(r, w) : void 0
1011
+ onUnlockClick: o ? () => o(r, w) : void 0,
1012
+ onDownloadClick: l ? () => l(r, w) : void 0,
1013
+ onUnlocked: d ? () => d(r, w) : void 0
1012
1014
  }
1013
1015
  ),
1014
- r.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(ze, { message: r, renderText: p }) }) })
1016
+ r.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(He, { message: r, renderText: M }) }) })
1015
1017
  ] }) : me ? (
1016
1018
  /* Tip-only messages render as a standalone bubble */
1017
- /* @__PURE__ */ e(Re, { message: r, standalone: !0 })
1019
+ /* @__PURE__ */ e(Ae, { message: r, standalone: !0 })
1018
1020
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
1019
1021
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
1020
- re && !fe && /* @__PURE__ */ e(
1021
- Re,
1022
+ oe && !fe && /* @__PURE__ */ e(
1023
+ Ae,
1022
1024
  {
1023
1025
  message: r,
1024
- hasAttachment: te,
1025
- isMyMessage: ae
1026
+ hasAttachment: ae,
1027
+ isMyMessage: re
1026
1028
  }
1027
1029
  ),
1028
- q && /* @__PURE__ */ e(Ot, { poll: q }),
1029
- R != null && R.length && !r.quoted_message ? /* @__PURE__ */ e(
1030
- y,
1030
+ q && /* @__PURE__ */ e(Bt, { poll: q }),
1031
+ L != null && L.length && !r.quoted_message ? /* @__PURE__ */ e(
1032
+ k,
1031
1033
  {
1032
- actionHandler: h,
1033
- attachments: R
1034
+ actionHandler: x,
1035
+ attachments: L
1034
1036
  }
1035
1037
  ) : null,
1036
- de ? /* @__PURE__ */ e(
1038
+ O ? /* @__PURE__ */ e(
1037
1039
  P,
1038
1040
  {
1039
1041
  message: r,
1040
- renderText: p
1042
+ renderText: M
1041
1043
  }
1042
- ) : /* @__PURE__ */ e(ze, { message: r, renderText: p }),
1043
- /* @__PURE__ */ e(Bt, {})
1044
+ ) : /* @__PURE__ */ e(He, { message: r, renderText: M }),
1045
+ /* @__PURE__ */ e(Gt, {})
1044
1046
  ] }),
1045
- (!re || fe) && /* @__PURE__ */ e(
1046
- Re,
1047
+ (!oe || fe) && /* @__PURE__ */ e(
1048
+ Ae,
1047
1049
  {
1048
1050
  message: r,
1049
- hasAttachment: te,
1050
- isMyMessage: ae
1051
+ hasAttachment: ae,
1052
+ isMyMessage: re
1051
1053
  }
1052
1054
  ),
1053
- n && re && /* @__PURE__ */ e(
1054
- ks,
1055
+ n && oe && /* @__PURE__ */ e(
1056
+ Ts,
1055
1057
  {
1056
- selected: u,
1057
- onVoteUp: f,
1058
- onVoteDown: E
1058
+ selected: y,
1059
+ onVoteUp: b,
1060
+ onVoteDown: _
1059
1061
  }
1060
1062
  )
1061
1063
  ] })
1062
1064
  }
1063
1065
  ),
1064
- O && /* @__PURE__ */ e(
1066
+ H && /* @__PURE__ */ e(
1065
1067
  Z,
1066
1068
  {
1067
- onClick: b,
1069
+ onClick: C,
1068
1070
  reply_count: r.reply_count
1069
1071
  }
1070
1072
  ),
1071
- Y && /* @__PURE__ */ e(se, {})
1073
+ K && /* @__PURE__ */ e(te, {})
1072
1074
  ] }, r.id)
1073
1075
  ] });
1074
- }, Ds = F.memo(
1075
- Ts,
1076
- (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlock !== s.onAttachmentUnlock || t.onAttachmentDownload !== s.onAttachmentDownload ? !1 : pt(t, s)
1077
- ), Rs = (t) => {
1078
- const s = Qe("CustomMessage");
1079
- return /* @__PURE__ */ e(Ds, { ...s, ...t });
1080
- }, As = (t) => ({
1076
+ }, Rs = F.memo(
1077
+ Ds,
1078
+ (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlockClick !== s.onAttachmentUnlockClick || t.onAttachmentDownloadClick !== s.onAttachmentDownloadClick || t.onAttachmentUnlocked !== s.onAttachmentUnlocked ? !1 : pt(t, s)
1079
+ ), As = (t) => {
1080
+ const s = et("CustomMessage");
1081
+ return /* @__PURE__ */ e(Rs, { ...s, ...t });
1082
+ }, Ls = (t) => ({
1081
1083
  linkPreviews: Array.from(t.previews.values()).filter(
1082
- (s) => qe.previewIsLoaded(s) || qe.previewIsLoading(s)
1084
+ (s) => Ze.previewIsLoaded(s) || Ze.previewIsLoading(s)
1083
1085
  )
1084
- }), Ls = ({
1086
+ }), Us = ({
1085
1087
  link: t,
1086
1088
  onDismiss: s
1087
1089
  }) => {
@@ -1111,7 +1113,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1111
1113
  },
1112
1114
  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",
1113
1115
  "aria-label": "Close link preview",
1114
- children: /* @__PURE__ */ e(Oe, { className: "size-4 text-black/90" })
1116
+ children: /* @__PURE__ */ e(Be, { className: "size-4 text-black/90" })
1115
1117
  }
1116
1118
  ),
1117
1119
  /* @__PURE__ */ i("div", { className: "p-2", children: [
@@ -1121,32 +1123,32 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1121
1123
  ]
1122
1124
  }
1123
1125
  );
1124
- }, Us = () => {
1125
- const { linkPreviewsManager: t } = Gt(), { linkPreviews: s } = jt(
1126
+ }, Ps = () => {
1127
+ const { linkPreviewsManager: t } = jt(), { linkPreviews: s } = $t(
1126
1128
  t.state,
1127
- As
1129
+ Ls
1128
1130
  ), n = (l) => {
1129
1131
  t.dismissPreview(l);
1130
1132
  };
1131
1133
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
1132
- Ls,
1134
+ Us,
1133
1135
  {
1134
1136
  link: l,
1135
1137
  onDismiss: n
1136
1138
  },
1137
1139
  l.og_scrape_url
1138
1140
  )) }) : null;
1139
- }, Ps = () => {
1140
- const { handleSubmit: t } = zt(), s = Ht();
1141
+ }, Fs = () => {
1142
+ const { handleSubmit: t } = Ht(), s = Vt();
1141
1143
  return /* @__PURE__ */ i(he, { children: [
1142
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Vt, {}) }),
1144
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Yt, {}) }),
1143
1145
  /* @__PURE__ */ i("div", { className: "central-container 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: [
1144
- /* @__PURE__ */ e(Yt, {}),
1145
- /* @__PURE__ */ e(Us, {}),
1146
1146
  /* @__PURE__ */ e(Wt, {}),
1147
+ /* @__PURE__ */ e(Ps, {}),
1148
+ /* @__PURE__ */ e(qt, {}),
1147
1149
  /* @__PURE__ */ i("div", { className: "flex", children: [
1148
1150
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1149
- qt,
1151
+ Zt,
1150
1152
  {
1151
1153
  className: "w-full resize-none outline-none leading-6",
1152
1154
  autoFocus: !0,
@@ -1162,72 +1164,72 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1162
1164
  disabled: !s,
1163
1165
  onClick: t,
1164
1166
  type: "button",
1165
- children: /* @__PURE__ */ e(ss, { className: "size-4" })
1167
+ children: /* @__PURE__ */ e(ns, { className: "size-4" })
1166
1168
  }
1167
1169
  )
1168
1170
  ] })
1169
1171
  ] })
1170
1172
  ] });
1171
- }, Fs = ({
1173
+ }, Os = ({
1172
1174
  renderActions: t
1173
1175
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
1174
1176
  t && (t == null ? void 0 : t()),
1175
- /* @__PURE__ */ e($t, { Input: Ps })
1176
- ] }), Os = [
1177
+ /* @__PURE__ */ e(zt, { Input: Fs })
1178
+ ] }), Bs = [
1177
1179
  "SYSTEM_DM_AGENT_PAUSED",
1178
1180
  "SYSTEM_DM_AGENT_RESUMED"
1179
- ], Bs = {
1181
+ ], Gs = {
1180
1182
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1181
1183
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1182
- }, Gs = [
1184
+ }, js = [
1183
1185
  "SYSTEM_AGE_SAFETY_BLOCKED"
1184
- ], js = {
1186
+ ], $s = {
1185
1187
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1186
- }, Ae = "age safety guidelines.", $s = "https://linktr.ee/s/about/contact", Xe = (t) => Os.includes(t), zs = (t) => Gs.includes(t), Hs = (t) => {
1188
+ }, Le = "age safety guidelines.", zs = "https://linktr.ee/s/about/contact", Ke = (t) => Bs.includes(t), Hs = (t) => js.includes(t), Vs = (t) => {
1187
1189
  var o;
1188
1190
  const s = (o = t.metadata) == null ? void 0 : o.custom_type;
1189
- if (Xe(s))
1191
+ if (Ke(s))
1190
1192
  return {
1191
1193
  kind: "dm-agent",
1192
1194
  type: s
1193
1195
  };
1194
- if (zs(s))
1196
+ if (Hs(s))
1195
1197
  return {
1196
1198
  kind: "age-safety",
1197
1199
  type: s
1198
1200
  };
1199
1201
  const n = t.dm_agent_system_type;
1200
- if (Xe(n))
1202
+ if (Ke(n))
1201
1203
  return {
1202
1204
  kind: "dm-agent",
1203
1205
  type: n
1204
1206
  };
1205
- }, Vs = (t) => {
1206
- const s = t.indexOf(Ae);
1207
+ }, Ys = (t) => {
1208
+ const s = t.indexOf(Le);
1207
1209
  if (s === -1)
1208
1210
  return t;
1209
- const n = s + Ae.length;
1211
+ const n = s + Le.length;
1210
1212
  return /* @__PURE__ */ i(he, { children: [
1211
1213
  t.slice(0, s),
1212
1214
  /* @__PURE__ */ e(
1213
1215
  "a",
1214
1216
  {
1215
- href: $s,
1217
+ href: zs,
1216
1218
  target: "_blank",
1217
1219
  rel: "noopener noreferrer",
1218
1220
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1219
- children: Ae
1221
+ children: Le
1220
1222
  }
1221
1223
  ),
1222
1224
  t.slice(n)
1223
1225
  ] });
1224
- }, Ys = (t) => {
1226
+ }, Ws = (t) => {
1225
1227
  var o, l;
1226
- const s = t.message.hide_date === !0, n = Hs(
1228
+ const s = t.message.hide_date === !0, n = Vs(
1227
1229
  t.message
1228
1230
  );
1229
1231
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
1230
- const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Bs[n.type];
1232
+ const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Gs[n.type];
1231
1233
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1232
1234
  /* @__PURE__ */ i(
1233
1235
  "div",
@@ -1237,7 +1239,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1237
1239
  "data-dm-agent-system-type": n.type,
1238
1240
  children: [
1239
1241
  /* @__PURE__ */ e(
1240
- ns,
1242
+ as,
1241
1243
  {
1242
1244
  size: 16,
1243
1245
  weight: "regular",
@@ -1249,11 +1251,11 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1249
1251
  ]
1250
1252
  }
1251
1253
  ),
1252
- !s && /* @__PURE__ */ e(De, { message: t.message })
1254
+ !s && /* @__PURE__ */ e(Re, { message: t.message })
1253
1255
  ] });
1254
1256
  }
1255
1257
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1256
- const d = ((l = t.message.text) == null ? void 0 : l.trim()) || js[n.type];
1258
+ const d = ((l = t.message.text) == null ? void 0 : l.trim()) || $s[n.type];
1257
1259
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1258
1260
  /* @__PURE__ */ i(
1259
1261
  "div",
@@ -1263,7 +1265,7 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1263
1265
  "data-age-safety-system-type": n.type,
1264
1266
  children: [
1265
1267
  /* @__PURE__ */ e(
1266
- as,
1268
+ rs,
1267
1269
  {
1268
1270
  size: 24,
1269
1271
  weight: "duotone",
@@ -1272,11 +1274,11 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1272
1274
  "data-testid": "age-safety-system-message-icon"
1273
1275
  }
1274
1276
  ),
1275
- /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Vs(d) }) })
1277
+ /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ys(d) }) })
1276
1278
  ]
1277
1279
  }
1278
1280
  ),
1279
- !s && /* @__PURE__ */ e(De, { message: t.message })
1281
+ !s && /* @__PURE__ */ e(Re, { message: t.message })
1280
1282
  ] });
1281
1283
  }
1282
1284
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1285,9 +1287,9 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1285
1287
  /* @__PURE__ */ e("p", { children: t.message.text }),
1286
1288
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1287
1289
  ] }),
1288
- !s && /* @__PURE__ */ e(De, { message: t.message })
1290
+ !s && /* @__PURE__ */ e(Re, { message: t.message })
1289
1291
  ] });
1290
- }, Ws = () => null, qs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1292
+ }, qs = () => null, Zs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1291
1293
  "div",
1292
1294
  {
1293
1295
  className: A("flex items-center justify-center h-full", t),
@@ -1330,31 +1332,31 @@ const _s = F.lazy(() => import("./Creator-77XnrIxc.js")), Es = F.lazy(() => impo
1330
1332
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1331
1333
  ]
1332
1334
  }
1333
- ), Se = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1334
- /* @__PURE__ */ e(qs, { className: "w-6 h-6" }),
1335
+ ), Ie = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1336
+ /* @__PURE__ */ e(Zs, { className: "w-6 h-6" }),
1335
1337
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1336
1338
  ] }) }));
1337
- Se.displayName = "LoadingState";
1338
- const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Zs = ({
1339
+ Ie.displayName = "LoadingState";
1340
+ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Js = ({
1339
1341
  onBack: t,
1340
1342
  showBackButton: s,
1341
1343
  onShowInfo: n,
1342
1344
  canShowInfo: o,
1343
1345
  showStarButton: l = !1
1344
1346
  }) => {
1345
- var C, S, m, v, r;
1346
- const { channel: d } = Ie(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
1347
+ var C, E, h, p, v;
1348
+ const { channel: d } = ke(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
1347
1349
  (M) => {
1348
- var N;
1349
- return ((N = M.user) == null ? void 0 : N.id) && M.user.id !== d._client.userID;
1350
+ var S;
1351
+ return ((S = M.user) == null ? void 0 : S.id) && M.user.id !== d._client.userID;
1350
1352
  }
1351
- ), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((S = a == null ? void 0 : a.user) == null ? void 0 : S.id) || "Unknown member", g = (m = a == null ? void 0 : a.user) == null ? void 0 : m.image, h = st(d), b = async () => {
1353
+ ), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((E = a == null ? void 0 : a.user) == null ? void 0 : E.id) || "Unknown member", f = (h = a == null ? void 0 : a.user) == null ? void 0 : h.image, u = nt(d), x = async () => {
1352
1354
  try {
1353
- h ? await d.unpin() : await d.pin();
1354
- } catch (p) {
1355
+ u ? await d.unpin() : await d.pin();
1356
+ } catch (r) {
1355
1357
  console.error(
1356
1358
  "[CustomChannelHeader] Failed to update pinned status:",
1357
- p
1359
+ r
1358
1360
  );
1359
1361
  }
1360
1362
  };
@@ -1368,17 +1370,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1368
1370
  }),
1369
1371
  type: "button",
1370
1372
  "aria-label": "Back to conversations",
1371
- children: /* @__PURE__ */ e(Ve, { className: "size-5 text-black/90" })
1373
+ children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1372
1374
  }
1373
1375
  ) }),
1374
1376
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
1375
1377
  /* @__PURE__ */ e(
1376
- ie,
1378
+ ce,
1377
1379
  {
1378
- id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
1380
+ id: ((p = a == null ? void 0 : a.user) == null ? void 0 : p.id) || d.id || "unknown",
1379
1381
  name: c,
1380
- image: g,
1381
- starred: l && h,
1382
+ image: f,
1383
+ starred: l && u,
1382
1384
  size: 40
1383
1385
  }
1384
1386
  ),
@@ -1389,17 +1391,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1389
1391
  "button",
1390
1392
  {
1391
1393
  className: ue,
1392
- onClick: b,
1394
+ onClick: x,
1393
1395
  type: "button",
1394
- "aria-label": h ? "Unstar conversation" : "Star conversation",
1396
+ "aria-label": u ? "Unstar conversation" : "Star conversation",
1395
1397
  children: /* @__PURE__ */ e(
1396
- Ue,
1398
+ Pe,
1397
1399
  {
1398
1400
  className: A("size-5", {
1399
- "text-yellow-600": h,
1400
- "text-black/90": !h
1401
+ "text-yellow-600": u,
1402
+ "text-black/90": !u
1401
1403
  }),
1402
- weight: h ? "duotone" : "regular"
1404
+ weight: u ? "duotone" : "regular"
1403
1405
  }
1404
1406
  )
1405
1407
  }
@@ -1411,7 +1413,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1411
1413
  onClick: n,
1412
1414
  type: "button",
1413
1415
  "aria-label": "Show info",
1414
- children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1416
+ children: /* @__PURE__ */ e(We, { className: "size-5 text-black/90" })
1415
1417
  }
1416
1418
  )
1417
1419
  ] })
@@ -1425,16 +1427,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1425
1427
  onClick: t,
1426
1428
  className: ue,
1427
1429
  "aria-label": "Back to conversations",
1428
- children: /* @__PURE__ */ e(Ve, { className: "size-5 text-black/90" })
1430
+ children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1429
1431
  }
1430
1432
  ),
1431
1433
  /* @__PURE__ */ e(
1432
- ie,
1434
+ ce,
1433
1435
  {
1434
- id: ((r = a == null ? void 0 : a.user) == null ? void 0 : r.id) || d.id || "unknown",
1436
+ id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
1435
1437
  name: c,
1436
- image: g,
1437
- starred: l && h,
1438
+ image: f,
1439
+ starred: l && u,
1438
1440
  size: 40
1439
1441
  }
1440
1442
  ),
@@ -1445,17 +1447,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1445
1447
  "button",
1446
1448
  {
1447
1449
  className: ue,
1448
- onClick: b,
1450
+ onClick: x,
1449
1451
  type: "button",
1450
- "aria-label": h ? "Unstar conversation" : "Star conversation",
1452
+ "aria-label": u ? "Unstar conversation" : "Star conversation",
1451
1453
  children: /* @__PURE__ */ e(
1452
- Ue,
1454
+ Pe,
1453
1455
  {
1454
1456
  className: A("size-5", {
1455
- "text-yellow-600": h,
1456
- "text-black/90": !h
1457
+ "text-yellow-600": u,
1458
+ "text-black/90": !u
1457
1459
  }),
1458
- weight: h ? "duotone" : "regular"
1460
+ weight: u ? "duotone" : "regular"
1459
1461
  }
1460
1462
  )
1461
1463
  }
@@ -1467,13 +1469,13 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1467
1469
  onClick: n,
1468
1470
  type: "button",
1469
1471
  "aria-label": "Show info",
1470
- children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1472
+ children: /* @__PURE__ */ e(We, { className: "size-5 text-black/90" })
1471
1473
  }
1472
1474
  )
1473
1475
  ] })
1474
1476
  ] })
1475
1477
  ] });
1476
- }, Js = ({
1478
+ }, Xs = ({
1477
1479
  onBack: t,
1478
1480
  showBackButton: s,
1479
1481
  renderMessageInputActions: n,
@@ -1482,67 +1484,69 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1482
1484
  onBlockParticipant: d,
1483
1485
  showDeleteConversation: a = !0,
1484
1486
  onDeleteConversationClick: c,
1485
- onBlockParticipantClick: g,
1486
- onReportParticipantClick: h,
1487
- showStarButton: b = !1,
1487
+ onBlockParticipantClick: f,
1488
+ onReportParticipantClick: u,
1489
+ showStarButton: x = !1,
1488
1490
  chatbotVotingEnabled: C = !1,
1489
- onAttachmentUnlock: S,
1490
- onAttachmentDownload: m,
1491
+ onAttachmentUnlockClick: E,
1492
+ onAttachmentDownloadClick: h,
1493
+ onAttachmentUnlocked: p,
1491
1494
  renderChannelBanner: v,
1492
1495
  customProfileContent: r,
1493
- customChannelActions: p,
1494
- renderMessage: M
1496
+ customChannelActions: M,
1497
+ renderMessage: S
1495
1498
  }) => {
1496
- const { channel: N } = Ie(), w = Q(null), _ = F.useMemo(() => Object.values(N.state.members || {}).find(
1497
- (E) => {
1498
- var y;
1499
- return ((y = E.user) == null ? void 0 : y.id) && E.user.id !== N._client.userID;
1499
+ const { channel: N } = ke(), w = ee(null), R = F.useMemo(() => Object.values(N.state.members || {}).find(
1500
+ (_) => {
1501
+ var k;
1502
+ return ((k = _.user) == null ? void 0 : k.id) && _.user.id !== N._client.userID;
1500
1503
  }
1501
- ), [N._client.userID, N.state.members]), L = F.useMemo(() => {
1502
- const f = N.data ?? {};
1503
- if (f.followerStatus)
1504
- return String(f.followerStatus);
1505
- if (f.isFollower !== void 0)
1506
- return f.isFollower ? "Subscribed to you" : "Not subscribed";
1507
- }, [N.data]), x = U(() => {
1508
- var f;
1509
- (f = w.current) == null || f.showModal();
1510
- }, []), u = U(() => {
1511
- var f;
1512
- (f = w.current) == null || f.close();
1504
+ ), [N._client.userID, N.state.members]), g = F.useMemo(() => {
1505
+ const b = N.data ?? {};
1506
+ if (b.followerStatus)
1507
+ return String(b.followerStatus);
1508
+ if (b.isFollower !== void 0)
1509
+ return b.isFollower ? "Subscribed to you" : "Not subscribed";
1510
+ }, [N.data]), m = U(() => {
1511
+ var b;
1512
+ (b = w.current) == null || b.showModal();
1513
+ }, []), y = U(() => {
1514
+ var b;
1515
+ (b = w.current) == null || b.close();
1513
1516
  }, []);
1514
1517
  return /* @__PURE__ */ i(he, { children: [
1515
1518
  /* @__PURE__ */ e(
1516
- Jt,
1519
+ Xt,
1517
1520
  {
1518
1521
  overrides: {
1519
- Message: (f) => {
1520
- const { message: E } = Qe("ChannelView"), y = /* @__PURE__ */ e(
1521
- Rs,
1522
+ Message: (b) => {
1523
+ const { message: _ } = et("ChannelView"), k = /* @__PURE__ */ e(
1524
+ As,
1522
1525
  {
1523
- ...f,
1526
+ ...b,
1524
1527
  chatbotVotingEnabled: C,
1525
- onAttachmentUnlock: S,
1526
- onAttachmentDownload: m
1528
+ onAttachmentUnlockClick: E,
1529
+ onAttachmentDownloadClick: h,
1530
+ onAttachmentUnlocked: p
1527
1531
  }
1528
1532
  );
1529
- return !M || !E ? y : M(y, E);
1533
+ return !S || !_ ? k : S(k, _);
1530
1534
  }
1531
1535
  },
1532
- children: /* @__PURE__ */ i(Xt, { children: [
1536
+ children: /* @__PURE__ */ i(Kt, { children: [
1533
1537
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1534
- Zs,
1538
+ Js,
1535
1539
  {
1536
1540
  onBack: t,
1537
1541
  showBackButton: s,
1538
- onShowInfo: x,
1539
- canShowInfo: !!_,
1540
- showStarButton: b
1542
+ onShowInfo: m,
1543
+ canShowInfo: !!R,
1544
+ showStarButton: x
1541
1545
  }
1542
1546
  ) }),
1543
1547
  v == null ? void 0 : v(),
1544
1548
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1545
- Kt,
1549
+ Qt,
1546
1550
  {
1547
1551
  hideDeletedMessages: !0,
1548
1552
  hideNewMessageSeparator: !1,
@@ -1551,7 +1555,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1551
1555
  ) }),
1552
1556
  o == null ? void 0 : o(N),
1553
1557
  /* @__PURE__ */ e(
1554
- Fs,
1558
+ Os,
1555
1559
  {
1556
1560
  renderActions: () => n == null ? void 0 : n(N)
1557
1561
  }
@@ -1563,22 +1567,22 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1563
1567
  ps,
1564
1568
  {
1565
1569
  dialogRef: w,
1566
- onClose: u,
1567
- participant: _,
1570
+ onClose: y,
1571
+ participant: R,
1568
1572
  channel: N,
1569
- followerStatusLabel: L,
1573
+ followerStatusLabel: g,
1570
1574
  onLeaveConversation: l,
1571
1575
  onBlockParticipant: d,
1572
1576
  showDeleteConversation: a,
1573
1577
  onDeleteConversationClick: c,
1574
- onBlockParticipantClick: g,
1575
- onReportParticipantClick: h,
1578
+ onBlockParticipantClick: f,
1579
+ onReportParticipantClick: u,
1576
1580
  customProfileContent: r,
1577
- customChannelActions: p
1581
+ customChannelActions: M
1578
1582
  }
1579
1583
  )
1580
1584
  ] });
1581
- }, it = F.memo(
1585
+ }, ct = F.memo(
1582
1586
  ({
1583
1587
  channel: t,
1584
1588
  onBack: s,
@@ -1588,42 +1592,43 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1588
1592
  onLeaveConversation: d,
1589
1593
  onBlockParticipant: a,
1590
1594
  className: c,
1591
- CustomChannelEmptyState: g = Ws,
1592
- showDeleteConversation: h = !0,
1593
- onDeleteConversationClick: b,
1595
+ CustomChannelEmptyState: f = qs,
1596
+ showDeleteConversation: u = !0,
1597
+ onDeleteConversationClick: x,
1594
1598
  onBlockParticipantClick: C,
1595
- onReportParticipantClick: S,
1596
- dmAgentEnabled: m,
1597
- messageMetadata: v,
1598
- onMessageSent: r,
1599
- showStarButton: p = !1,
1599
+ onReportParticipantClick: E,
1600
+ dmAgentEnabled: h,
1601
+ messageMetadata: p,
1602
+ onMessageSent: v,
1603
+ showStarButton: r = !1,
1600
1604
  chatbotVotingEnabled: M = !1,
1601
- onAttachmentUnlock: N,
1602
- onAttachmentDownload: w,
1603
- renderChannelBanner: _,
1604
- customProfileContent: L,
1605
- customChannelActions: x,
1606
- renderMessage: u
1605
+ onAttachmentUnlockClick: S,
1606
+ onAttachmentDownloadClick: N,
1607
+ onAttachmentUnlocked: w,
1608
+ renderChannelBanner: R,
1609
+ customProfileContent: g,
1610
+ customChannelActions: m,
1611
+ renderMessage: y
1607
1612
  }) => {
1608
- const f = U(
1609
- async (E, y, D) => {
1613
+ const b = U(
1614
+ async (_, k, Y) => {
1610
1615
  var J;
1611
- const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, T = m && !G, j = {
1612
- ...y,
1613
- ...T && { silent: !0 },
1614
- ...v && {
1616
+ const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, D = h && !G, j = {
1617
+ ...k,
1618
+ ...D && { silent: !0 },
1619
+ ...p && {
1615
1620
  metadata: {
1616
- ...y.metadata ?? {},
1617
- ...v
1621
+ ...k.metadata ?? {},
1622
+ ...p
1618
1623
  }
1619
1624
  }
1620
- }, se = {
1621
- ...D,
1622
- ...T && { skip_push: !0 }
1623
- }, Z = await t.sendMessage(j, se);
1624
- return r == null || r(Z), Z;
1625
+ }, te = {
1626
+ ...Y,
1627
+ ...D && { skip_push: !0 }
1628
+ }, Z = await t.sendMessage(j, te);
1629
+ return v == null || v(Z), Z;
1625
1630
  },
1626
- [t, m, v, r]
1631
+ [t, h, p, v]
1627
1632
  );
1628
1633
  return /* @__PURE__ */ e(
1629
1634
  "div",
@@ -1633,16 +1638,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1633
1638
  c
1634
1639
  ),
1635
1640
  children: /* @__PURE__ */ e(
1636
- Zt,
1641
+ Jt,
1637
1642
  {
1638
1643
  channel: t,
1639
- MessageSystem: Ys,
1640
- EmptyStateIndicator: g,
1641
- LoadingIndicator: Se,
1642
- DateSeparator: ys,
1643
- doSendMessageRequest: f,
1644
+ MessageSystem: Ws,
1645
+ EmptyStateIndicator: f,
1646
+ LoadingIndicator: Ie,
1647
+ DateSeparator: vs,
1648
+ doSendMessageRequest: b,
1644
1649
  children: /* @__PURE__ */ e(
1645
- Js,
1650
+ Xs,
1646
1651
  {
1647
1652
  onBack: s,
1648
1653
  showBackButton: n,
@@ -1650,19 +1655,20 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1650
1655
  renderConversationFooter: l,
1651
1656
  onLeaveConversation: d,
1652
1657
  onBlockParticipant: a,
1653
- CustomChannelEmptyState: g,
1654
- showDeleteConversation: h,
1655
- onDeleteConversationClick: b,
1658
+ CustomChannelEmptyState: f,
1659
+ showDeleteConversation: u,
1660
+ onDeleteConversationClick: x,
1656
1661
  onBlockParticipantClick: C,
1657
- onReportParticipantClick: S,
1658
- showStarButton: p,
1662
+ onReportParticipantClick: E,
1663
+ showStarButton: r,
1659
1664
  chatbotVotingEnabled: M,
1660
- onAttachmentUnlock: N,
1661
- onAttachmentDownload: w,
1662
- renderChannelBanner: _,
1663
- customProfileContent: L,
1664
- customChannelActions: x,
1665
- renderMessage: u
1665
+ onAttachmentUnlockClick: S,
1666
+ onAttachmentDownloadClick: N,
1667
+ onAttachmentUnlocked: w,
1668
+ renderChannelBanner: R,
1669
+ customProfileContent: g,
1670
+ customChannelActions: m,
1671
+ renderMessage: y
1666
1672
  }
1667
1673
  )
1668
1674
  }
@@ -1671,16 +1677,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1671
1677
  );
1672
1678
  }
1673
1679
  );
1674
- it.displayName = "ChannelView";
1675
- function Xs({
1680
+ ct.displayName = "ChannelView";
1681
+ function Ks({
1676
1682
  searchQuery: t,
1677
1683
  setSearchQuery: s,
1678
1684
  placeholder: n
1679
1685
  }) {
1680
- const o = Q(null);
1686
+ const o = ee(null);
1681
1687
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1682
1688
  /* @__PURE__ */ e(
1683
- rs,
1689
+ os,
1684
1690
  {
1685
1691
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1686
1692
  weight: "bold"
@@ -1698,7 +1704,7 @@ function Xs({
1698
1704
  }
1699
1705
  ),
1700
1706
  t && /* @__PURE__ */ e(
1701
- ot,
1707
+ lt,
1702
1708
  {
1703
1709
  label: "Clear search",
1704
1710
  onClick: () => {
@@ -1706,12 +1712,12 @@ function Xs({
1706
1712
  s(""), (l = o.current) == null || l.focus();
1707
1713
  },
1708
1714
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1709
- children: /* @__PURE__ */ e(Oe, { className: "h-4 w-4", weight: "bold" })
1715
+ children: /* @__PURE__ */ e(Be, { className: "h-4 w-4", weight: "bold" })
1710
1716
  }
1711
1717
  )
1712
1718
  ] });
1713
1719
  }
1714
- const Ks = ({
1720
+ const Qs = ({
1715
1721
  participantSource: t,
1716
1722
  onSelectParticipant: s,
1717
1723
  onClose: n,
@@ -1720,11 +1726,11 @@ const Ks = ({
1720
1726
  searchPlaceholder: d = "Search participants...",
1721
1727
  className: a
1722
1728
  }) => {
1723
- const { debug: c } = Me(), [g, h] = k(""), [b, C] = k([]), [S, m] = k(!1), [v, r] = k(null), [p, M] = k(
1729
+ const { debug: c } = Me(), [f, u] = T(""), [x, C] = T([]), [E, h] = T(!1), [p, v] = T(null), [r, M] = T(
1724
1730
  null
1725
- ), N = Q(!1);
1731
+ ), S = ee(!1);
1726
1732
  X(() => {
1727
- N.current = !1;
1733
+ S.current = !1;
1728
1734
  }, [t]), X(() => {
1729
1735
  if (t.loading) {
1730
1736
  c && console.log(
@@ -1732,125 +1738,125 @@ const Ks = ({
1732
1738
  );
1733
1739
  return;
1734
1740
  }
1735
- if (N.current) return;
1741
+ if (S.current) return;
1736
1742
  (async () => {
1737
- c && console.log("[ParticipantPicker] Loading initial participants..."), m(!0), r(null);
1743
+ c && console.log("[ParticipantPicker] Loading initial participants..."), h(!0), v(null);
1738
1744
  try {
1739
- const u = await t.loadParticipants({
1745
+ const m = await t.loadParticipants({
1740
1746
  search: "",
1741
1747
  // Load all participants initially
1742
1748
  limit: 100
1743
1749
  });
1744
- C(u.participants), N.current = !0, c && console.log(
1750
+ C(m.participants), S.current = !0, c && console.log(
1745
1751
  "[ParticipantPicker] Participants loaded successfully:",
1746
- u.participants.length
1752
+ m.participants.length
1747
1753
  );
1748
- } catch (u) {
1749
- const f = u instanceof Error ? u.message : "Failed to load participants";
1750
- r(f), console.error("[ParticipantPicker] Failed to load participants:", u);
1754
+ } catch (m) {
1755
+ const y = m instanceof Error ? m.message : "Failed to load participants";
1756
+ v(y), console.error("[ParticipantPicker] Failed to load participants:", m);
1751
1757
  } finally {
1752
- m(!1);
1758
+ h(!1);
1753
1759
  }
1754
1760
  })();
1755
1761
  }, [t, c]);
1756
- const w = b.filter((x) => !o.has(x.id)).filter((x) => {
1757
- var f;
1758
- if (!g) return !0;
1759
- const u = g.toLowerCase();
1760
- return x.name.toLowerCase().includes(u) || ((f = x.email) == null ? void 0 : f.toLowerCase().includes(u)) || !1;
1761
- }), _ = U(
1762
- async (x) => {
1763
- if (!p) {
1764
- M(x.id);
1762
+ const N = x.filter((g) => !o.has(g.id)).filter((g) => {
1763
+ var y;
1764
+ if (!f) return !0;
1765
+ const m = f.toLowerCase();
1766
+ return g.name.toLowerCase().includes(m) || ((y = g.email) == null ? void 0 : y.toLowerCase().includes(m)) || !1;
1767
+ }), w = U(
1768
+ async (g) => {
1769
+ if (!r) {
1770
+ M(g.id);
1765
1771
  try {
1766
- await s(x);
1767
- } catch (u) {
1768
- console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
1772
+ await s(g);
1773
+ } catch (m) {
1774
+ console.error("[ParticipantPicker] Failed to start chat:", m), M(null);
1769
1775
  }
1770
1776
  }
1771
1777
  },
1772
- [s, p]
1773
- ), L = (x, u) => {
1774
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), _(u));
1778
+ [s, r]
1779
+ ), R = (g, m) => {
1780
+ (g.key === "Enter" || g.key === " ") && (g.preventDefault(), w(m));
1775
1781
  };
1776
1782
  return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", a), children: [
1777
1783
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1778
1784
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1779
1785
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1780
- /* @__PURE__ */ e(lt, { onClick: n })
1786
+ /* @__PURE__ */ e(it, { onClick: n })
1781
1787
  ] }),
1782
1788
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1783
1789
  "Select a ",
1784
1790
  l.slice(0, -1),
1785
1791
  " to start messaging (",
1786
- w.length,
1792
+ N.length,
1787
1793
  " available)",
1788
1794
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1789
1795
  ] }),
1790
1796
  /* @__PURE__ */ e(
1791
- Xs,
1797
+ Ks,
1792
1798
  {
1793
- searchQuery: g,
1794
- setSearchQuery: h,
1799
+ searchQuery: f,
1800
+ setSearchQuery: u,
1795
1801
  placeholder: d
1796
1802
  }
1797
1803
  )
1798
1804
  ] }),
1799
- v && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1805
+ p && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1800
1806
  "Error loading ",
1801
1807
  l,
1802
1808
  ": ",
1803
- v
1809
+ p
1804
1810
  ] }),
1805
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && w.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1811
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && N.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1806
1812
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1807
1813
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1808
1814
  "Loading ",
1809
1815
  l,
1810
1816
  "..."
1811
1817
  ] })
1812
- ] }) }) : w.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1813
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(We, { className: "h-8 w-8 text-charcoal" }) }),
1814
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1815
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1818
+ ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1819
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(qe, { className: "h-8 w-8 text-charcoal" }) }),
1820
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : x.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1821
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1816
1822
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1817
- w.map((x) => {
1818
- const u = x.name || x.email || x.id, f = x.email && x.name ? x.email : x.phone;
1823
+ N.map((g) => {
1824
+ const m = g.name || g.email || g.id, y = g.email && g.name ? g.email : g.phone;
1819
1825
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1820
1826
  "button",
1821
1827
  {
1822
1828
  type: "button",
1823
- onClick: () => _(x),
1824
- onKeyDown: (E) => L(E, x),
1829
+ onClick: () => w(g),
1830
+ onKeyDown: (b) => R(b, g),
1825
1831
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1826
1832
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1827
1833
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1828
1834
  /* @__PURE__ */ e(
1829
- ie,
1835
+ ce,
1830
1836
  {
1831
- id: x.id,
1832
- name: u,
1833
- image: x.image,
1837
+ id: g.id,
1838
+ name: m,
1839
+ image: g.image,
1834
1840
  size: 40
1835
1841
  }
1836
1842
  ),
1837
1843
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1838
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1839
- f && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: f })
1844
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1845
+ y && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: y })
1840
1846
  ] })
1841
1847
  ] }),
1842
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: p === x.id ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(We, { className: "h-5 w-5 text-stone" }) })
1848
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: r === g.id ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(qe, { className: "h-5 w-5 text-stone" }) })
1843
1849
  ] })
1844
1850
  }
1845
- ) }, x.id);
1851
+ ) }, g.id);
1846
1852
  }),
1847
- S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1853
+ E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1848
1854
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1849
1855
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1850
1856
  ] }) })
1851
1857
  ] }) })
1852
1858
  ] });
1853
- }, Qs = ({ className: t }) => /* @__PURE__ */ i(
1859
+ }, en = ({ className: t }) => /* @__PURE__ */ i(
1854
1860
  "svg",
1855
1861
  {
1856
1862
  width: "140",
@@ -1984,17 +1990,17 @@ const Ks = ({
1984
1990
  ] })
1985
1991
  ]
1986
1992
  }
1987
- ), ct = F.memo(
1993
+ ), dt = F.memo(
1988
1994
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1989
- /* @__PURE__ */ e(Qs, {}),
1995
+ /* @__PURE__ */ e(en, {}),
1990
1996
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1991
1997
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1992
1998
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1993
1999
  ] })
1994
2000
  ] }) })
1995
2001
  );
1996
- ct.displayName = "EmptyState";
1997
- const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
2002
+ dt.displayName = "EmptyState";
2003
+ const Se = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1998
2004
  /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
1999
2005
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2000
2006
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -2008,8 +2014,8 @@ const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
2008
2014
  }
2009
2015
  )
2010
2016
  ] }) }));
2011
- Ee.displayName = "ErrorState";
2012
- const dn = ({
2017
+ Se.displayName = "ErrorState";
2018
+ const mn = ({
2013
2019
  capabilities: t = {},
2014
2020
  className: s,
2015
2021
  renderMessageInputActions: n,
@@ -2018,41 +2024,42 @@ const dn = ({
2018
2024
  onParticipantSelect: d,
2019
2025
  initialParticipantFilter: a,
2020
2026
  initialParticipantData: c,
2021
- CustomChannelEmptyState: g,
2022
- showChannelList: h = !0,
2023
- filters: b,
2027
+ CustomChannelEmptyState: f,
2028
+ showChannelList: u = !0,
2029
+ filters: x,
2024
2030
  channelRenderFilterFn: C,
2025
- channelListCustomEmptyStateIndicator: S,
2026
- onDeleteConversationClick: m,
2027
- onBlockParticipantClick: v,
2028
- onReportParticipantClick: r,
2029
- dmAgentEnabled: p,
2031
+ channelListCustomEmptyStateIndicator: E,
2032
+ onDeleteConversationClick: h,
2033
+ onBlockParticipantClick: p,
2034
+ onReportParticipantClick: v,
2035
+ dmAgentEnabled: r,
2030
2036
  messageMetadata: M,
2031
- onMessageSent: N,
2032
- showStarButton: w = !1,
2033
- chatbotVotingEnabled: _ = !1,
2034
- renderMessagePreview: L,
2035
- renderChannelBanner: x,
2036
- customProfileContent: u,
2037
- customChannelActions: f,
2038
- renderMessage: E,
2039
- onAttachmentUnlock: y,
2040
- onAttachmentDownload: D
2037
+ onMessageSent: S,
2038
+ showStarButton: N = !1,
2039
+ chatbotVotingEnabled: w = !1,
2040
+ renderMessagePreview: R,
2041
+ renderChannelBanner: g,
2042
+ customProfileContent: m,
2043
+ customChannelActions: y,
2044
+ renderMessage: b,
2045
+ onAttachmentUnlockClick: _,
2046
+ onAttachmentDownloadClick: k,
2047
+ onAttachmentUnlocked: Y
2041
2048
  }) => {
2042
2049
  const {
2043
2050
  service: G,
2044
- client: T,
2051
+ client: D,
2045
2052
  isConnected: j,
2046
- isLoading: se,
2053
+ isLoading: te,
2047
2054
  error: Z,
2048
2055
  refreshConnection: J,
2049
2056
  debug: P
2050
- } = os(), [V, z] = k(null), [ce, de] = k(!1), [R, O] = k(!1), [Y, W] = k(!1), [ne, ee] = k(/* @__PURE__ */ new Set()), [ae, Ge] = k(0), [q, me] = k(!1), [re, oe] = k(null), te = Q(null), {
2057
+ } = ls(), [W, z] = T(null), [de, O] = T(!1), [L, H] = T(!1), [K, se] = T(!1), [xe, ne] = T(/* @__PURE__ */ new Set()), [re, je] = T(0), [q, me] = T(!1), [oe, le] = T(null), ae = ee(null), {
2051
2058
  participantSource: fe,
2052
2059
  participantLabel: ge = "participants",
2053
- showDeleteConversation: xe = !0
2054
- } = t, be = F.useMemo(() => {
2055
- const I = T == null ? void 0 : T.userID;
2060
+ showDeleteConversation: be = !0
2061
+ } = t, Ce = F.useMemo(() => {
2062
+ const I = D == null ? void 0 : D.userID;
2056
2063
  return {
2057
2064
  ...{
2058
2065
  type: "messaging",
@@ -2062,15 +2069,15 @@ const dn = ({
2062
2069
  hidden: !1
2063
2070
  }
2064
2071
  },
2065
- ...b
2072
+ ...x
2066
2073
  };
2067
- }, [b, T == null ? void 0 : T.userID]), le = Q(null), K = U(async () => {
2068
- if (!T || !j) return;
2069
- const I = T.userID;
2074
+ }, [x, D == null ? void 0 : D.userID]), ie = ee(null), Q = U(async () => {
2075
+ if (!D || !j) return;
2076
+ const I = D.userID;
2070
2077
  if (I)
2071
2078
  try {
2072
2079
  P && console.log("[MessagingShell] Syncing channels for user:", I);
2073
- const H = await T.queryChannels(
2080
+ const V = await D.queryChannels(
2074
2081
  {
2075
2082
  type: "messaging",
2076
2083
  members: { $in: [I] }
@@ -2078,45 +2085,45 @@ const dn = ({
2078
2085
  {},
2079
2086
  { limit: 100 }
2080
2087
  ), B = /* @__PURE__ */ new Set();
2081
- H.forEach(($) => {
2082
- const ke = $.state.members;
2083
- Object.values(ke).forEach((ht) => {
2084
- var je;
2085
- const Te = (je = ht.user) == null ? void 0 : je.id;
2086
- Te && Te !== I && B.add(Te);
2088
+ V.forEach(($) => {
2089
+ const Te = $.state.members;
2090
+ Object.values(Te).forEach((ft) => {
2091
+ var $e;
2092
+ const De = ($e = ft.user) == null ? void 0 : $e.id;
2093
+ De && De !== I && B.add(De);
2087
2094
  });
2088
- }), ee(($) => $.size === B.size && [...$].every((ke) => B.has(ke)) ? $ : B), de(H.length > 0), O(!0), le.current = I, P && console.log("[MessagingShell] Channels synced successfully:", {
2089
- channelCount: H.length,
2095
+ }), ne(($) => $.size === B.size && [...$].every((Te) => B.has(Te)) ? $ : B), O(V.length > 0), H(!0), ie.current = I, P && console.log("[MessagingShell] Channels synced successfully:", {
2096
+ channelCount: V.length,
2090
2097
  memberCount: B.size
2091
2098
  });
2092
- } catch (H) {
2093
- console.error("[MessagingShell] Failed to sync channels:", H);
2099
+ } catch (V) {
2100
+ console.error("[MessagingShell] Failed to sync channels:", V);
2094
2101
  }
2095
- }, [T, j, P]);
2102
+ }, [D, j, P]);
2096
2103
  X(() => {
2097
- if (!T || !j) return;
2098
- const I = T.userID;
2099
- I && le.current !== I && K();
2100
- }, [T, j, K]), X(() => {
2101
- if (!a || !T || !j) return;
2104
+ if (!D || !j) return;
2105
+ const I = D.userID;
2106
+ I && ie.current !== I && Q();
2107
+ }, [D, j, Q]), X(() => {
2108
+ if (!a || !D || !j) return;
2102
2109
  (async () => {
2103
- const H = T.userID;
2104
- if (H)
2110
+ const V = D.userID;
2111
+ if (V)
2105
2112
  try {
2106
2113
  P && console.log(
2107
2114
  "[MessagingShell] Loading initial conversation with:",
2108
2115
  a
2109
2116
  );
2110
- const B = await T.queryChannels(
2117
+ const B = await D.queryChannels(
2111
2118
  {
2112
2119
  type: "messaging",
2113
- members: { $eq: [H, a] }
2120
+ members: { $eq: [V, a] }
2114
2121
  },
2115
2122
  {},
2116
2123
  { limit: 1 }
2117
2124
  );
2118
2125
  if (B.length > 0)
2119
- z(B[0]), me(!0), oe(null), l && l(B[0]), P && console.log(
2126
+ z(B[0]), me(!0), le(null), l && l(B[0]), P && console.log(
2120
2127
  "[MessagingShell] Initial conversation loaded:",
2121
2128
  B[0].id
2122
2129
  );
@@ -2132,7 +2139,7 @@ const dn = ({
2132
2139
  email: c.email,
2133
2140
  phone: c.phone
2134
2141
  });
2135
- z($), me(!0), oe(null), l && l($), P && console.log(
2142
+ z($), me(!0), le(null), l && l($), P && console.log(
2136
2143
  "[MessagingShell] Channel created and loaded:",
2137
2144
  $.id
2138
2145
  );
@@ -2140,10 +2147,10 @@ const dn = ({
2140
2147
  console.error(
2141
2148
  "[MessagingShell] Failed to create conversation:",
2142
2149
  $
2143
- ), oe("Failed to create conversation");
2150
+ ), le("Failed to create conversation");
2144
2151
  }
2145
2152
  } else
2146
- oe(
2153
+ le(
2147
2154
  "No conversation found with this account"
2148
2155
  ), P && console.log(
2149
2156
  "[MessagingShell] No conversation found for:",
@@ -2153,28 +2160,28 @@ const dn = ({
2153
2160
  console.error(
2154
2161
  "[MessagingShell] Failed to load initial conversation:",
2155
2162
  B
2156
- ), oe("Failed to load conversation");
2163
+ ), le("Failed to load conversation");
2157
2164
  }
2158
2165
  })();
2159
2166
  }, [
2160
2167
  a,
2161
2168
  c,
2162
- T,
2169
+ D,
2163
2170
  j,
2164
2171
  G,
2165
2172
  P,
2166
2173
  l
2167
2174
  ]);
2168
- const Ce = U(
2175
+ const Ne = U(
2169
2176
  (I) => {
2170
2177
  z(I), l == null || l(I);
2171
2178
  },
2172
2179
  [l]
2173
- ), Ne = U(() => {
2180
+ ), ye = U(() => {
2174
2181
  q || z(null);
2175
2182
  }, [q]), pe = U(
2176
2183
  async (I) => {
2177
- var H;
2184
+ var V;
2178
2185
  if (G)
2179
2186
  try {
2180
2187
  P && console.log(
@@ -2192,38 +2199,38 @@ const dn = ({
2192
2199
  } catch ($) {
2193
2200
  console.warn("[MessagingShell] Failed to unhide channel:", $);
2194
2201
  }
2195
- z(B), W(!1), (H = te.current) == null || H.close(), d == null || d(I);
2202
+ z(B), se(!1), (V = ae.current) == null || V.close(), d == null || d(I);
2196
2203
  } catch (B) {
2197
2204
  console.error("[MessagingShell] Failed to start conversation:", B);
2198
2205
  }
2199
2206
  },
2200
2207
  [G, d, P]
2201
- ), ye = U(() => {
2208
+ ), ve = U(() => {
2202
2209
  var I;
2203
- W(!1), (I = te.current) == null || I.close();
2204
- }, []), dt = U(
2210
+ se(!1), (I = ae.current) == null || I.close();
2211
+ }, []), mt = U(
2205
2212
  (I) => {
2206
- I.target === te.current && ye();
2213
+ I.target === ae.current && ve();
2207
2214
  },
2208
- [ye]
2209
- ), mt = U(
2215
+ [ve]
2216
+ ), ut = U(
2210
2217
  async (I) => {
2211
- P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), le.current = null, await K();
2218
+ P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), ie.current = null, await Q();
2212
2219
  },
2213
- [K, P]
2214
- ), ut = U(
2220
+ [Q, P]
2221
+ ), ht = U(
2215
2222
  async (I) => {
2216
- P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), le.current = null, await K();
2223
+ P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), ie.current = null, await Q();
2217
2224
  },
2218
- [K, P]
2219
- ), ve = !!V;
2220
- return se ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : Z ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ee, { message: Z, onBack: J }) }) : !j || !T ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
2221
- Ee,
2225
+ [Q, P]
2226
+ ), we = !!W;
2227
+ return te ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, {}) }) : Z ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: Z, onBack: J }) }) : !j || !D ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
2228
+ Se,
2222
2229
  {
2223
2230
  message: "Not connected to messaging service",
2224
2231
  onBack: J
2225
2232
  }
2226
- ) }) : re ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ee, { message: re }) }) : /* @__PURE__ */ i(
2233
+ ) }) : oe ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: oe }) }) : /* @__PURE__ */ i(
2227
2234
  "div",
2228
2235
  {
2229
2236
  className: A(
@@ -2238,22 +2245,22 @@ const dn = ({
2238
2245
  className: A(
2239
2246
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2240
2247
  {
2241
- "!hidden": h === !1 || q,
2248
+ "!hidden": u === !1 || q,
2242
2249
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2243
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && ve,
2250
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !q && we,
2244
2251
  // Show on mobile when no channel selected, use same wide width on desktop
2245
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !ve
2252
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !q && !we
2246
2253
  }
2247
2254
  ),
2248
2255
  children: /* @__PURE__ */ e(
2249
- rt,
2256
+ ot,
2250
2257
  {
2251
- onChannelSelect: Ce,
2252
- selectedChannel: V || void 0,
2253
- filters: be,
2258
+ onChannelSelect: Ne,
2259
+ selectedChannel: W || void 0,
2260
+ filters: Ce,
2254
2261
  channelRenderFilterFn: C,
2255
- customEmptyStateIndicator: S,
2256
- renderMessagePreview: L
2262
+ customEmptyStateIndicator: E,
2263
+ renderMessagePreview: R
2257
2264
  }
2258
2265
  )
2259
2266
  }
@@ -2265,47 +2272,48 @@ const dn = ({
2265
2272
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2266
2273
  {
2267
2274
  // In direct conversation mode (or waiting for it), always show (full width)
2268
- flex: q || ve || a,
2275
+ flex: q || we || a,
2269
2276
  // Normal mode: hide on mobile when no channel selected
2270
- "hidden lg:flex": !q && !ve && !a
2277
+ "hidden lg:flex": !q && !we && !a
2271
2278
  }
2272
2279
  ),
2273
- children: V ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2274
- it,
2280
+ children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2281
+ ct,
2275
2282
  {
2276
- channel: V,
2277
- onBack: Ne,
2283
+ channel: W,
2284
+ onBack: ye,
2278
2285
  showBackButton: !q,
2279
2286
  renderMessageInputActions: n,
2280
2287
  renderConversationFooter: o,
2281
- renderChannelBanner: x,
2282
- onLeaveConversation: mt,
2283
- onBlockParticipant: ut,
2284
- CustomChannelEmptyState: g,
2285
- showDeleteConversation: xe,
2286
- onDeleteConversationClick: m,
2287
- onBlockParticipantClick: v,
2288
- onReportParticipantClick: r,
2289
- dmAgentEnabled: p,
2288
+ renderChannelBanner: g,
2289
+ onLeaveConversation: ut,
2290
+ onBlockParticipant: ht,
2291
+ CustomChannelEmptyState: f,
2292
+ showDeleteConversation: be,
2293
+ onDeleteConversationClick: h,
2294
+ onBlockParticipantClick: p,
2295
+ onReportParticipantClick: v,
2296
+ dmAgentEnabled: r,
2290
2297
  messageMetadata: M,
2291
- onMessageSent: N,
2292
- showStarButton: w,
2293
- chatbotVotingEnabled: _,
2294
- customProfileContent: u,
2295
- customChannelActions: f,
2296
- renderMessage: E,
2297
- onAttachmentUnlock: y,
2298
- onAttachmentDownload: D
2298
+ onMessageSent: S,
2299
+ showStarButton: N,
2300
+ chatbotVotingEnabled: w,
2301
+ customProfileContent: m,
2302
+ customChannelActions: y,
2303
+ renderMessage: b,
2304
+ onAttachmentUnlockClick: _,
2305
+ onAttachmentDownloadClick: k,
2306
+ onAttachmentUnlocked: Y
2299
2307
  },
2300
- V.id
2308
+ W.id
2301
2309
  ) }) : a ? (
2302
2310
  // Show loading while creating/loading direct conversation channel
2303
- /* @__PURE__ */ e(Se, {})
2311
+ /* @__PURE__ */ e(Ie, {})
2304
2312
  ) : /* @__PURE__ */ e(
2305
- ct,
2313
+ dt,
2306
2314
  {
2307
- hasChannels: ce,
2308
- channelsLoaded: R
2315
+ hasChannels: de,
2316
+ channelsLoaded: L
2309
2317
  }
2310
2318
  )
2311
2319
  }
@@ -2315,28 +2323,28 @@ const dn = ({
2315
2323
  /* @__PURE__ */ e(
2316
2324
  "dialog",
2317
2325
  {
2318
- ref: te,
2326
+ ref: ae,
2319
2327
  className: "mes-dialog",
2320
- onClick: dt,
2321
- onClose: ye,
2328
+ onClick: mt,
2329
+ onClose: ve,
2322
2330
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2323
- Ks,
2331
+ Qs,
2324
2332
  {
2325
2333
  participantSource: fe,
2326
2334
  onSelectParticipant: pe,
2327
- onClose: ye,
2328
- existingParticipantIds: ne,
2335
+ onClose: ve,
2336
+ existingParticipantIds: xe,
2329
2337
  participantLabel: ge,
2330
2338
  searchPlaceholder: `Search ${ge}...`
2331
2339
  },
2332
- ae
2340
+ re
2333
2341
  ) })
2334
2342
  }
2335
2343
  )
2336
2344
  ]
2337
2345
  }
2338
2346
  );
2339
- }, en = ({
2347
+ }, tn = ({
2340
2348
  question: t,
2341
2349
  onClick: s,
2342
2350
  loading: n = !1,
@@ -2358,7 +2366,7 @@ const dn = ({
2358
2366
  ),
2359
2367
  children: t
2360
2368
  }
2361
- ), mn = ({
2369
+ ), un = ({
2362
2370
  faqs: t,
2363
2371
  onFaqClick: s,
2364
2372
  loadingFaqId: n,
@@ -2367,10 +2375,10 @@ const dn = ({
2367
2375
  avatarImage: d,
2368
2376
  avatarName: a
2369
2377
  }) => {
2370
- const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
2378
+ const c = t.filter((f) => f.enabled).sort((f, u) => (f.order ?? 0) - (u.order ?? 0));
2371
2379
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2372
2380
  (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2373
- ie,
2381
+ ce,
2374
2382
  {
2375
2383
  id: a || "account",
2376
2384
  name: a || "Account",
@@ -2386,76 +2394,76 @@ const dn = ({
2386
2394
  style: { backgroundColor: "#F1F0EE" },
2387
2395
  children: [
2388
2396
  o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2389
- c.map((g) => /* @__PURE__ */ e(
2390
- en,
2397
+ c.map((f) => /* @__PURE__ */ e(
2398
+ tn,
2391
2399
  {
2392
- question: g.question,
2393
- onClick: () => s(g.id),
2394
- loading: n === g.id
2400
+ question: f.question,
2401
+ onClick: () => s(f.id),
2402
+ loading: n === f.id
2395
2403
  },
2396
- g.id
2404
+ f.id
2397
2405
  ))
2398
2406
  ]
2399
2407
  }
2400
2408
  )
2401
2409
  ] }) });
2402
- }, un = (t, s = {}) => {
2403
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = k([]), [a, c] = k(!1), [g, h] = k(null), [b, C] = k(n), [S, m] = k(!0), [v, r] = k(), p = U(async (_ = !1, L) => {
2410
+ }, hn = (t, s = {}) => {
2411
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = T([]), [a, c] = T(!1), [f, u] = T(null), [x, C] = T(n), [E, h] = T(!0), [p, v] = T(), r = U(async (w = !1, R) => {
2404
2412
  if (a) return;
2405
- const x = L !== void 0 ? L : b;
2406
- c(!0), h(null);
2413
+ const g = R !== void 0 ? R : x;
2414
+ c(!0), u(null);
2407
2415
  try {
2408
- const u = await t.loadParticipants({
2409
- search: x || void 0,
2416
+ const m = await t.loadParticipants({
2417
+ search: g || void 0,
2410
2418
  limit: o,
2411
- cursor: _ ? void 0 : v
2419
+ cursor: w ? void 0 : p
2412
2420
  });
2413
2421
  d(
2414
- (f) => _ ? u.participants : [...f, ...u.participants]
2415
- ), m(u.hasMore), r(u.nextCursor);
2416
- } catch (u) {
2417
- const f = u instanceof Error ? u.message : "Failed to load participants";
2418
- h(f), console.error("[useParticipants] Load error:", u);
2422
+ (y) => w ? m.participants : [...y, ...m.participants]
2423
+ ), h(m.hasMore), v(m.nextCursor);
2424
+ } catch (m) {
2425
+ const y = m instanceof Error ? m.message : "Failed to load participants";
2426
+ u(y), console.error("[useParticipants] Load error:", m);
2419
2427
  } finally {
2420
2428
  c(!1);
2421
2429
  }
2422
- }, [t, b, v, o, a]), M = U(() => {
2423
- S && !a && p(!1);
2424
- }, [S, a, p]), N = U((_) => {
2425
- C(_), r(void 0), p(!0, _);
2426
- }, [p]), w = U(() => {
2427
- r(void 0), p(!0);
2428
- }, [p]);
2430
+ }, [t, x, p, o, a]), M = U(() => {
2431
+ E && !a && r(!1);
2432
+ }, [E, a, r]), S = U((w) => {
2433
+ C(w), v(void 0), r(!0, w);
2434
+ }, [r]), N = U(() => {
2435
+ v(void 0), r(!0);
2436
+ }, [r]);
2429
2437
  return X(() => {
2430
- p(!0);
2438
+ r(!0);
2431
2439
  }, [t.loadParticipants]), {
2432
2440
  participants: l,
2433
2441
  loading: a,
2434
- error: g,
2435
- searchQuery: b,
2436
- hasMore: S,
2442
+ error: f,
2443
+ searchQuery: x,
2444
+ hasMore: E,
2437
2445
  totalCount: t.totalCount,
2438
2446
  loadMore: M,
2439
- search: N,
2440
- refresh: w
2447
+ search: S,
2448
+ refresh: N
2441
2449
  };
2442
2450
  };
2443
2451
  export {
2444
- we as ActionButton,
2445
- ie as Avatar,
2446
- Ws as ChannelEmptyState,
2447
- rt as ChannelList,
2448
- it as ChannelView,
2449
- mn as FaqList,
2450
- en as FaqListItem,
2451
- Ss as LockedAttachment,
2452
- ks as MessageVoteButtons,
2453
- cn as MessagingProvider,
2454
- dn as MessagingShell,
2455
- Ks as ParticipantPicker,
2456
- ms as formatRelativeTime,
2457
- ws as useMessageVote,
2458
- os as useMessaging,
2459
- un as useParticipants
2452
+ _e as ActionButton,
2453
+ ce as Avatar,
2454
+ qs as ChannelEmptyState,
2455
+ ot as ChannelList,
2456
+ ct as ChannelView,
2457
+ un as FaqList,
2458
+ tn as FaqListItem,
2459
+ Is as LockedAttachment,
2460
+ Ts as MessageVoteButtons,
2461
+ dn as MessagingProvider,
2462
+ mn as MessagingShell,
2463
+ Qs as ParticipantPicker,
2464
+ us as formatRelativeTime,
2465
+ _s as useMessageVote,
2466
+ ls as useMessaging,
2467
+ hn as useParticipants
2460
2468
  };
2461
2469
  //# sourceMappingURL=index.js.map