@linktr.ee/messaging-react 1.25.0 → 1.25.1

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
- import { jsx as e, jsxs as i, Fragment as me } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i, Fragment as ce } from "react/jsx-runtime";
2
2
  import R from "classnames";
3
- import B, { createContext as lt, useContext as it, useCallback as P, useState as T, useRef as Q, useEffect as X, useMemo as _e } from "react";
4
- import { StreamChatService as ct } from "@linktr.ee/messaging-core";
5
- import { Chat as dt, ChannelList as ut, DateSeparator as mt, useChannelStateContext as Me, useChatContext as $e, areMessageUIPropsEqual as ht, useMessageReminder as ft, useComponentContext as gt, Attachment as xt, EditMessageModal as bt, MessageBlocked as Ct, MessageBouncePrompt as Nt, MessageDeleted as vt, MessageIsThreadReplyInChannelButtonIndicator as wt, MessageRepliesCountButton as pt, ReminderNotification as yt, StreamedMessageText as _t, messageHasAttachments as Et, messageHasReactions as St, isDateSeparatorMessage as It, isMessageBlocked as Mt, isMessageBounced as kt, MessageBounceModal as Tt, Poll as Dt, MessageText as Rt, MessageErrorIcon as Lt, useMessageContext as je, useMessageComposer as Pt, useStateStore as Ut, MessageInput as Ot, useMessageInputContext as Ft, useMessageComposerHasSendableData as At, SimpleAttachmentSelector as Bt, QuotedMessagePreview as $t, AttachmentPreviewList as jt, TextareaComposer as Gt, MessageTimestamp as Re, Channel as zt, WithComponents as Vt, Window as Ht, MessageList as Wt } from "stream-chat-react";
6
- import { StarIcon as Ee, GiftIcon as qt, XIcon as ke, SpinnerGapIcon as be, SignOutIcon as Yt, ProhibitInsetIcon as Le, FlagIcon as Zt, ArrowUpIcon as Jt, SparkleIcon as Qt, ArrowLeftIcon as Pe, DotsThreeIcon as Ue, MagnifyingGlassIcon as Xt, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as Fe } from "stream-chat";
8
- const Ge = lt({
3
+ import B, { createContext as it, useContext as ct, useCallback as A, useState as T, useRef as X, useEffect as K, useMemo as Se } from "react";
4
+ import { StreamChatService as dt } from "@linktr.ee/messaging-core";
5
+ import { Chat as mt, ChannelList as ut, DateSeparator as ht, useChannelStateContext as Te, useChatContext as $e, areMessageUIPropsEqual as ft, useMessageReminder as gt, useComponentContext as xt, Attachment as bt, EditMessageModal as Ct, MessageBlocked as Nt, MessageBouncePrompt as vt, MessageDeleted as pt, MessageIsThreadReplyInChannelButtonIndicator as yt, MessageRepliesCountButton as wt, ReminderNotification as _t, StreamedMessageText as Et, messageHasAttachments as St, messageHasReactions as It, isDateSeparatorMessage as Mt, isMessageBlocked as kt, isMessageBounced as Tt, MessageBounceModal as Dt, Poll as Rt, MessageText as Lt, MessageErrorIcon as At, useMessageContext as je, useMessageComposer as Pt, useStateStore as Ft, MessageInput as Ot, useMessageInputContext as Ut, useMessageComposerHasSendableData as Bt, SimpleAttachmentSelector as Gt, QuotedMessagePreview as $t, AttachmentPreviewList as jt, TextareaComposer as zt, MessageTimestamp as we, Channel as Ht, WithComponents as Vt, Window as Yt, MessageList as Wt } from "stream-chat-react";
6
+ import { StarIcon as Ie, GiftIcon as qt, XIcon as De, SpinnerGapIcon as be, SignOutIcon as Zt, ProhibitInsetIcon as Ae, FlagIcon as Jt, ArrowUpIcon as Xt, SparkleIcon as Kt, ProhibitIcon as Qt, ArrowLeftIcon as Pe, DotsThreeIcon as Fe, MagnifyingGlassIcon as es, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as Ue } from "stream-chat";
8
+ const ze = it({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,19 +15,19 @@ const Ge = lt({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ve = () => it(Ge), Hs = ({
18
+ }), ve = () => ct(ze), Ks = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: o,
23
23
  capabilities: l = {},
24
- debug: m = !1
24
+ debug: d = !1
25
25
  }) => {
26
- const a = P(
26
+ const a = A(
27
27
  (u, ...N) => {
28
- m && console.log(`🔥 [MessagingProvider] ${u}`, ...N);
28
+ d && console.log(`🔥 [MessagingProvider] ${u}`, ...N);
29
29
  },
30
- [m]
30
+ [d]
31
31
  );
32
32
  a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
@@ -35,14 +35,14 @@ const Ge = lt({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, g] = T(null), [h, b] = T(null), [x, w] = T(!1), [r, y] = T(!1), [_, C] = T(null), M = Q(!1), E = Q({
38
+ const [c, g] = T(null), [h, b] = T(null), [x, p] = T(!1), [r, w] = T(!1), [_, C] = T(null), M = X(!1), E = X({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), p = Q(0);
44
- p.current++, a("📊 RENDER INFO", {
45
- renderCount: p.current,
43
+ }), y = X(0);
44
+ y.current++, a("📊 RENDER INFO", {
45
+ renderCount: y.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: E.current.userId !== (s == null ? void 0 : s.id),
@@ -55,8 +55,8 @@ const Ge = lt({
55
55
  apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
- }, X(() => {
59
- const u = p.current;
58
+ }, K(() => {
59
+ const u = y.current;
60
60
  if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
62
62
  apiKey: !!o,
@@ -79,10 +79,10 @@ const Ge = lt({
79
79
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: E.current.serviceConfig !== n
81
81
  });
82
- const N = new ct({
82
+ const N = new dt({
83
83
  ...n,
84
84
  apiKey: o,
85
- debug: m
85
+ debug: d
86
86
  });
87
87
  return g(N), a("✅ SERVICE SET", {
88
88
  renderCount: u,
@@ -93,9 +93,9 @@ const Ge = lt({
93
93
  reason: "Effect cleanup"
94
94
  }), N.disconnectUser().catch(console.error);
95
95
  };
96
- }, [o, n, m, a]);
97
- const S = Q(null);
98
- X(() => {
96
+ }, [o, n, d, a]);
97
+ const S = X(null);
98
+ K(() => {
99
99
  var N, v;
100
100
  if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
@@ -120,11 +120,11 @@ const Ge = lt({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, y(!0), C(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, w(!0), C(null);
124
124
  try {
125
125
  a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
126
  const f = await c.connectUser(s);
127
- b(f), w(!0), S.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
127
+ b(f), p(!0), S.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: f.userID
130
130
  });
@@ -135,13 +135,13 @@ const Ge = lt({
135
135
  error: k
136
136
  });
137
137
  } finally {
138
- y(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
138
+ w(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: x
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, a, x]), X(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, a, x]), K(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
146
  isConnected: x
147
147
  }), () => {
@@ -153,7 +153,7 @@ const Ge = lt({
153
153
  isConnected: x
154
154
  });
155
155
  }), [c, x, a]);
156
- const L = P(async () => {
156
+ const L = A(async () => {
157
157
  if (a("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
@@ -161,11 +161,11 @@ const Ge = lt({
161
161
  a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
165
165
  try {
166
166
  a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
167
  const u = await c.connectUser(s);
168
- b(u), w(!0), C(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ b(u), p(!0), C(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
170
  const N = u instanceof Error ? u.message : "Refresh failed";
171
171
  C(N), a("❌ CONNECTION REFRESH ERROR", {
@@ -173,9 +173,9 @@ const Ge = lt({
173
173
  error: N
174
174
  });
175
175
  } finally {
176
- y(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ w(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, a]), d = B.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, a]), m = B.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
180
  hasClient: !!h,
181
181
  isConnected: x,
@@ -190,7 +190,7 @@ const Ge = lt({
190
190
  error: _,
191
191
  capabilities: l,
192
192
  refreshConnection: L,
193
- debug: m
193
+ debug: d
194
194
  }), [
195
195
  c,
196
196
  h,
@@ -199,15 +199,15 @@ const Ge = lt({
199
199
  _,
200
200
  l,
201
201
  L,
202
- m,
202
+ d,
203
203
  a
204
204
  ]);
205
205
  return a("🔄 RENDER END", {
206
- renderCount: p.current,
206
+ renderCount: y.current,
207
207
  willRenderChat: !!(h && x),
208
- contextValueReady: !!d
209
- }), /* @__PURE__ */ e(Ge.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
210
- dt,
208
+ contextValueReady: !!m
209
+ }), /* @__PURE__ */ e(ze.Provider, { value: m, children: h && x ? /* @__PURE__ */ e(
210
+ mt,
211
211
  {
212
212
  client: h,
213
213
  customClasses: {
@@ -216,46 +216,46 @@ const Ge = lt({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, Kt = () => ve(), ze = B.createContext({
219
+ }, ts = () => ve(), He = B.createContext({
220
220
  selectedChannel: void 0,
221
221
  onChannelSelect: () => {
222
222
  },
223
223
  debug: !1,
224
224
  renderMessagePreview: void 0
225
- }), es = ze.Provider, ts = () => B.useContext(ze), Ve = (t) => {
225
+ }), ss = He.Provider, ns = () => B.useContext(He), Ve = (t) => {
226
226
  var o, l;
227
227
  const [s, n] = T(
228
228
  !!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
229
229
  );
230
- return X(() => {
230
+ return K(() => {
231
231
  var a;
232
232
  if (!t) {
233
233
  n(!1);
234
234
  return;
235
235
  }
236
236
  n(!!((a = t.state.membership) != null && a.pinned_at));
237
- const m = (c) => {
237
+ const d = (c) => {
238
238
  var g;
239
239
  n(
240
240
  c != null && c.member ? !!c.member.pinned_at : !!((g = t.state.membership) != null && g.pinned_at)
241
241
  );
242
242
  };
243
- return t.on("member.updated", m), () => {
244
- t.off("member.updated", m);
243
+ return t.on("member.updated", d), () => {
244
+ t.off("member.updated", d);
245
245
  };
246
246
  }, [t]), s;
247
- }, ss = (t, s) => {
247
+ }, as = (t, s) => {
248
248
  const n = new Date(
249
249
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
250
250
  ), l = new Date(
251
251
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
252
252
  ).getTime() - n.getTime();
253
253
  return Math.floor(l / (1e3 * 60 * 60 * 24));
254
- }, ns = (t) => {
254
+ }, rs = (t) => {
255
255
  const s = /* @__PURE__ */ new Date();
256
256
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
257
257
  return "Just now";
258
- const o = ss(t, s);
258
+ const o = as(t, s);
259
259
  return o === 0 ? t.toLocaleTimeString([], {
260
260
  hour: "numeric",
261
261
  minute: "2-digit",
@@ -265,7 +265,7 @@ const Ge = lt({
265
265
  day: "numeric",
266
266
  year: "2-digit"
267
267
  });
268
- }, Ae = [
268
+ }, Be = [
269
269
  "🍎",
270
270
  // Apple
271
271
  "🍌",
@@ -293,7 +293,7 @@ const Ge = lt({
293
293
  "🍈"
294
294
  // Melon
295
295
  ];
296
- function as(t) {
296
+ function os(t) {
297
297
  let s = 0;
298
298
  for (let n = 0; n < t.length; n++) {
299
299
  const o = t.charCodeAt(n);
@@ -301,9 +301,9 @@ function as(t) {
301
301
  }
302
302
  return Math.abs(s);
303
303
  }
304
- function rs(t) {
305
- const n = as(t) % Ae.length;
306
- return Ae[n];
304
+ function ls(t) {
305
+ const n = os(t) % Be.length;
306
+ return Be[n];
307
307
  }
308
308
  const se = ({
309
309
  id: t,
@@ -311,9 +311,9 @@ const se = ({
311
311
  size: n = 40,
312
312
  className: o,
313
313
  starred: l = !1,
314
- shape: m = "squircle"
314
+ shape: d = "squircle"
315
315
  }) => {
316
- const a = rs(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = m === "circle" ? { borderRadius: "50%" } : {
316
+ const a = ls(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
317
317
  borderRadius: "33%",
318
318
  "corner-shape": "superellipse(1.3)"
319
319
  };
@@ -331,7 +331,7 @@ const se = ({
331
331
  {
332
332
  "aria-hidden": "true",
333
333
  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)]",
334
- children: /* @__PURE__ */ e(Ee, { className: "size-3 text-yellow-600", weight: "duotone" })
334
+ children: /* @__PURE__ */ e(Ie, { className: "size-3 text-yellow-600", weight: "duotone" })
335
335
  }
336
336
  ),
337
337
  /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
@@ -355,7 +355,7 @@ const se = ({
355
355
  ]
356
356
  }
357
357
  );
358
- }, os = ({ size: t = 15 }) => /* @__PURE__ */ e(
358
+ }, is = ({ size: t = 15 }) => /* @__PURE__ */ e(
359
359
  "svg",
360
360
  {
361
361
  width: t,
@@ -372,53 +372,53 @@ const se = ({
372
372
  }
373
373
  )
374
374
  }
375
- ), ls = (t) => {
375
+ ), cs = (t) => {
376
376
  var s;
377
377
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
378
- }, is = (t) => {
378
+ }, ds = (t) => {
379
379
  var s;
380
380
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
381
- }, Te = (t) => {
381
+ }, Re = (t) => {
382
382
  var s;
383
383
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
384
- }, He = (t) => ls(t) || is(t), cs = (t) => {
384
+ }, Ye = (t) => cs(t) || ds(t), ms = (t) => {
385
385
  var s;
386
- return He(t) && !((s = t.text) != null && s.trim());
387
- }, ye = ({
386
+ return Ye(t) && !((s = t.text) != null && s.trim());
387
+ }, _e = ({
388
388
  message: t,
389
389
  standalone: s = !1,
390
390
  isMyMessage: n = !1,
391
391
  hasAttachment: o = !1
392
392
  }) => {
393
393
  var x;
394
- const l = He(t), m = Te(t);
395
- if (!l && !m)
394
+ const l = Ye(t), d = Re(t);
395
+ if (!l && !d)
396
396
  return null;
397
397
  if (l) {
398
- const w = (x = t.metadata) == null ? void 0 : x.amount_text;
399
- if (!w) return null;
400
- const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${w} tip` : `Delivered with ${w} tip`;
398
+ const p = (x = t.metadata) == null ? void 0 : x.amount_text;
399
+ if (!p) return null;
400
+ const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", w = s ? `${p} tip` : `Delivered with ${p} tip`;
401
401
  return /* @__PURE__ */ i("div", { className: r, children: [
402
402
  /* @__PURE__ */ e(qt, { size: s ? 14 : 12 }),
403
- /* @__PURE__ */ e("span", { children: y })
403
+ /* @__PURE__ */ e("span", { children: w })
404
404
  ] });
405
405
  }
406
406
  const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
407
407
  "message-chatbot-indicator",
408
408
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
409
409
  a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
410
- ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(os, { size: a ? 12 : 15 }) });
411
- return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(me, { children: [
410
+ ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(is, { size: a ? 12 : 15 }) });
411
+ return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(ce, { children: [
412
412
  h,
413
413
  b
414
- ] }) : /* @__PURE__ */ i(me, { children: [
414
+ ] }) : /* @__PURE__ */ i(ce, { children: [
415
415
  b,
416
416
  h
417
417
  ] }) });
418
418
  }, We = B.memo(
419
419
  ({ channel: t, unread: s }) => {
420
- var L, d, u, N;
421
- const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = ts(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
420
+ var L, m, u, N;
421
+ const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = ns(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
422
422
  t && o(t);
423
423
  }, g = (v) => {
424
424
  const f = v.key === "Enter" || v.key === " ", k = v.repeat;
@@ -428,7 +428,7 @@ const se = ({
428
428
  var f, k;
429
429
  return ((f = v.user) == null ? void 0 : f.id) && v.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
430
430
  }
431
- ), x = ((d = b == null ? void 0 : b.user) == null ? void 0 : d.name) || "Conversation", w = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, r = (() => {
431
+ ), x = ((m = b == null ? void 0 : b.user) == null ? void 0 : m.name) || "Conversation", p = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, r = (() => {
432
432
  var f;
433
433
  const v = (f = t == null ? void 0 : t.state) == null ? void 0 : f.messages;
434
434
  if (v != null && v.length) {
@@ -436,12 +436,12 @@ const se = ({
436
436
  if (v[k].type !== "system") return v[k];
437
437
  }
438
438
  })(), _ = (() => {
439
- var k, H;
439
+ var k, V;
440
440
  if (r != null && r.text) return r.text;
441
441
  if (((k = r == null ? void 0 : r.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
442
- const f = (H = r == null ? void 0 : r.attachments) == null ? void 0 : H[0];
442
+ const f = (V = r == null ? void 0 : r.attachments) == null ? void 0 : V[0];
443
443
  return f ? f.og_scrape_url ? f.og_scrape_url : f.type === "image" ? "📷 Sent an image" : f.type === "video" ? "🎥 Sent a video" : f.type === "audio" ? "🎵 Sent audio" : f.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
444
- })(), C = r != null && r.created_at ? ns(new Date(r.created_at)) : "", M = r ? Te(r) : !1, E = m ? m(r, _) : `${M ? "✨ " : ""}${_}`, p = Ve(t), S = s ?? 0;
444
+ })(), C = r != null && r.created_at ? rs(new Date(r.created_at)) : "", M = r ? Re(r) : !1, E = d ? d(r, _) : `${M ? "✨ " : ""}${_}`, y = Ve(t), S = s ?? 0;
445
445
  return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
446
446
  channelId: t == null ? void 0 : t.id,
447
447
  isSelected: a,
@@ -468,9 +468,9 @@ const se = ({
468
468
  {
469
469
  id: ((N = b == null ? void 0 : b.user) == null ? void 0 : N.id) || t.id || "unknown",
470
470
  name: x,
471
- image: w,
471
+ image: p,
472
472
  size: 44,
473
- starred: p,
473
+ starred: y,
474
474
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
475
475
  }
476
476
  ),
@@ -484,7 +484,7 @@ const se = ({
484
484
  a ? "text-primary" : "text-charcoal"
485
485
  ),
486
486
  children: [
487
- p && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
487
+ y && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
488
488
  x
489
489
  ]
490
490
  }
@@ -502,15 +502,15 @@ const se = ({
502
502
  }
503
503
  );
504
504
  We.displayName = "CustomChannelPreview";
505
- const ds = { last_message_at: -1 }, qe = B.memo(
505
+ const us = { last_message_at: -1 }, qe = B.memo(
506
506
  ({
507
507
  onChannelSelect: t,
508
508
  selectedChannel: s,
509
509
  filters: n,
510
510
  allowNewMessagesFromUnfilteredChannels: o = !1,
511
511
  onMessageNew: l,
512
- onAddedToChannel: m,
513
- sort: a = ds,
512
+ onAddedToChannel: d,
513
+ sort: a = us,
514
514
  className: c,
515
515
  customEmptyStateIndicator: g,
516
516
  renderMessagePreview: h
@@ -523,7 +523,7 @@ const ds = { last_message_at: -1 }, qe = B.memo(
523
523
  selectedChannelId: s == null ? void 0 : s.id,
524
524
  filters: n
525
525
  });
526
- const w = B.useMemo(
526
+ const p = B.useMemo(
527
527
  () => ({
528
528
  selectedChannel: s,
529
529
  onChannelSelect: t,
@@ -539,7 +539,7 @@ const ds = { last_message_at: -1 }, qe = B.memo(
539
539
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
540
540
  c
541
541
  ),
542
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(es, { value: w, children: /* @__PURE__ */ e(
542
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(ss, { value: p, children: /* @__PURE__ */ e(
543
543
  ut,
544
544
  {
545
545
  filters: n,
@@ -547,7 +547,7 @@ const ds = { last_message_at: -1 }, qe = B.memo(
547
547
  options: { limit: 30 },
548
548
  allowNewMessagesFromUnfilteredChannels: o,
549
549
  onMessageNew: l,
550
- onAddedToChannel: m,
550
+ onAddedToChannel: d,
551
551
  Preview: We,
552
552
  EmptyStateIndicator: g
553
553
  },
@@ -576,7 +576,7 @@ const xe = ({
576
576
  children: n
577
577
  }
578
578
  );
579
- function Ye({ label: t, className: s, children: n, ...o }) {
579
+ function Ze({ label: t, className: s, children: n, ...o }) {
580
580
  return /* @__PURE__ */ i(
581
581
  "button",
582
582
  {
@@ -597,65 +597,65 @@ function Ye({ label: t, className: s, children: n, ...o }) {
597
597
  }
598
598
  );
599
599
  }
600
- function Ze({ onClick: t }) {
601
- return /* @__PURE__ */ e(Ye, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone", weight: "bold" }) });
600
+ function Je({ onClick: t }) {
601
+ return /* @__PURE__ */ e(Ze, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(De, { className: "h-5 w-5 text-stone", weight: "bold" }) });
602
602
  }
603
- const us = ({
603
+ const hs = ({
604
604
  dialogRef: t,
605
605
  onClose: s,
606
606
  participant: n,
607
607
  channel: o,
608
608
  followerStatusLabel: l,
609
- onLeaveConversation: m,
609
+ onLeaveConversation: d,
610
610
  onBlockParticipant: a,
611
611
  showDeleteConversation: c = !0,
612
612
  onDeleteConversationClick: g,
613
613
  onBlockParticipantClick: h,
614
614
  onReportParticipantClick: b,
615
615
  customProfileContent: x,
616
- customChannelActions: w
616
+ customChannelActions: p
617
617
  }) => {
618
- var W, j, ne, ae, G, K, re;
619
- const { service: r, debug: y } = ve(), [_, C] = T(!1), [M, E] = T(!1), [p, S] = T(!1), L = P(async () => {
620
- var U;
621
- if (!(!r || !((U = n == null ? void 0 : n.user) != null && U.id)))
618
+ var Y, $, ne, ae, j, Q, re;
619
+ const { service: r, debug: w } = ve(), [_, C] = T(!1), [M, E] = T(!1), [y, S] = T(!1), L = A(async () => {
620
+ var P;
621
+ if (!(!r || !((P = n == null ? void 0 : n.user) != null && P.id)))
622
622
  try {
623
- const A = (await r.getBlockedUsers()).some(
623
+ const U = (await r.getBlockedUsers()).some(
624
624
  (z) => {
625
- var ce;
626
- return z.blocked_user_id === ((ce = n == null ? void 0 : n.user) == null ? void 0 : ce.id);
625
+ var de;
626
+ return z.blocked_user_id === ((de = n == null ? void 0 : n.user) == null ? void 0 : de.id);
627
627
  }
628
628
  );
629
- C(A);
630
- } catch (O) {
629
+ C(U);
630
+ } catch (F) {
631
631
  console.error(
632
632
  "[ChannelInfoDialog] Failed to check blocked status:",
633
- O
633
+ F
634
634
  );
635
635
  }
636
- }, [r, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
637
- X(() => {
636
+ }, [r, (Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id]);
637
+ K(() => {
638
638
  L();
639
639
  }, [L]);
640
- const d = async () => {
641
- var U;
640
+ const m = async () => {
641
+ var P;
642
642
  if (!M) {
643
- g == null || g(), y && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
643
+ g == null || g(), w && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
644
644
  try {
645
- const O = ((U = o._client) == null ? void 0 : U.userID) ?? null;
646
- await o.hide(O, !1), m && await m(o), s();
647
- } catch (O) {
648
- console.error("[ChannelInfoDialog] Failed to leave conversation", O);
645
+ const F = ((P = o._client) == null ? void 0 : P.userID) ?? null;
646
+ await o.hide(F, !1), d && await d(o), s();
647
+ } catch (F) {
648
+ console.error("[ChannelInfoDialog] Failed to leave conversation", F);
649
649
  } finally {
650
650
  E(!1);
651
651
  }
652
652
  }
653
653
  }, u = async () => {
654
- var U, O, A;
655
- if (!(p || !r)) {
656
- h == null || h(), y && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), S(!0);
654
+ var P, F, U;
655
+ if (!(y || !r)) {
656
+ h == null || h(), w && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), S(!0);
657
657
  try {
658
- await r.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
658
+ await r.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
659
659
  } catch (z) {
660
660
  console.error("[ChannelInfoDialog] Failed to block member", z);
661
661
  } finally {
@@ -663,11 +663,11 @@ const us = ({
663
663
  }
664
664
  }
665
665
  }, N = async () => {
666
- var U, O, A;
667
- if (!(p || !r)) {
668
- h == null || h(), y && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), S(!0);
666
+ var P, F, U;
667
+ if (!(y || !r)) {
668
+ h == null || h(), w && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), S(!0);
669
669
  try {
670
- await r.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
670
+ await r.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
671
671
  } catch (z) {
672
672
  console.error("[ChannelInfoDialog] Failed to unblock member", z);
673
673
  } finally {
@@ -682,7 +682,7 @@ const us = ({
682
682
  );
683
683
  };
684
684
  if (!n) return null;
685
- const f = ((j = n.user) == null ? void 0 : j.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", k = (ae = n.user) == null ? void 0 : ae.image, H = (G = n.user) == null ? void 0 : G.email, Z = (K = n.user) == null ? void 0 : K.username, Y = H || (Z ? `linktr.ee/${Z}` : void 0), D = ((re = n.user) == null ? void 0 : re.id) || "unknown";
685
+ const f = (($ = n.user) == null ? void 0 : $.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", k = (ae = n.user) == null ? void 0 : ae.image, V = (j = n.user) == null ? void 0 : j.email, Z = (Q = n.user) == null ? void 0 : Q.username, q = V || (Z ? `linktr.ee/${Z}` : void 0), D = ((re = n.user) == null ? void 0 : re.id) || "unknown";
686
686
  return (
687
687
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
688
688
  /* @__PURE__ */ e(
@@ -691,13 +691,13 @@ const us = ({
691
691
  ref: t,
692
692
  className: "mes-dialog group",
693
693
  onClose: s,
694
- onClick: (U) => {
695
- U.target === t.current && s();
694
+ onClick: (P) => {
695
+ P.target === t.current && s();
696
696
  },
697
697
  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: [
698
698
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
699
699
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
700
- /* @__PURE__ */ e(Ze, { onClick: s })
700
+ /* @__PURE__ */ e(Je, { onClick: s })
701
701
  ] }),
702
702
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
703
703
  /* @__PURE__ */ e(
@@ -718,7 +718,7 @@ const us = ({
718
718
  ),
719
719
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
720
720
  /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: f }),
721
- Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
721
+ q && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: q }),
722
722
  l && !x && /* @__PURE__ */ e(
723
723
  "span",
724
724
  {
@@ -742,11 +742,11 @@ const us = ({
742
742
  c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
743
743
  xe,
744
744
  {
745
- onClick: d,
745
+ onClick: m,
746
746
  disabled: M,
747
747
  "aria-busy": M,
748
748
  children: [
749
- M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
749
+ M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
750
750
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
751
751
  ]
752
752
  }
@@ -755,10 +755,10 @@ const us = ({
755
755
  xe,
756
756
  {
757
757
  onClick: N,
758
- disabled: p,
759
- "aria-busy": p,
758
+ disabled: y,
759
+ "aria-busy": y,
760
760
  children: [
761
- p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
761
+ y ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ae, { className: "h-5 w-5" }),
762
762
  /* @__PURE__ */ e("span", { children: "Unblock" })
763
763
  ]
764
764
  }
@@ -766,57 +766,57 @@ const us = ({
766
766
  xe,
767
767
  {
768
768
  onClick: u,
769
- disabled: p,
770
- "aria-busy": p,
769
+ disabled: y,
770
+ "aria-busy": y,
771
771
  children: [
772
- p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
772
+ y ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ae, { className: "h-5 w-5" }),
773
773
  /* @__PURE__ */ e("span", { children: "Block" })
774
774
  ]
775
775
  }
776
776
  ) }),
777
777
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: v, children: [
778
- /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
778
+ /* @__PURE__ */ e(Jt, { className: "h-5 w-5" }),
779
779
  /* @__PURE__ */ e("span", { children: "Report" })
780
780
  ] }) }),
781
- w
781
+ p
782
782
  ] })
783
783
  ] })
784
784
  ] })
785
785
  }
786
786
  )
787
787
  );
788
- }, ms = (t) => /* @__PURE__ */ e(mt, { ...t, position: "center" }), Se = "vote_up", Ie = "vote_down";
789
- function hs(t) {
790
- return t != null && t.length ? t.some((s) => s.type === Ie) ? "down" : t.some((s) => s.type === Se) ? "up" : null : null;
788
+ }, fs = (t) => /* @__PURE__ */ e(ht, { ...t, position: "center" }), Me = "vote_up", ke = "vote_down";
789
+ function gs(t) {
790
+ return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Me) ? "up" : null : null;
791
791
  }
792
- function fs(t) {
793
- const { channel: s } = Me(), { client: n } = $e("useMessageVote"), o = _e(
794
- () => hs(t.own_reactions),
792
+ function xs(t) {
793
+ const { channel: s } = Te(), { client: n } = $e("useMessageVote"), o = Se(
794
+ () => gs(t.own_reactions),
795
795
  [t.own_reactions]
796
- ), l = P(async () => {
796
+ ), l = A(async () => {
797
797
  if (n != null && n.userID)
798
798
  try {
799
- o === "up" ? await s.deleteReaction(t.id, Se) : await s.sendReaction(
799
+ o === "up" ? await s.deleteReaction(t.id, Me) : await s.sendReaction(
800
800
  t.id,
801
- { type: Se },
801
+ { type: Me },
802
802
  { enforce_unique: !0, skip_push: !0 }
803
803
  );
804
804
  } catch {
805
805
  }
806
- }, [s, n == null ? void 0 : n.userID, t.id, o]), m = P(async () => {
806
+ }, [s, n == null ? void 0 : n.userID, t.id, o]), d = A(async () => {
807
807
  if (n != null && n.userID)
808
808
  try {
809
- o === "down" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
809
+ o === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
810
810
  t.id,
811
- { type: Ie },
811
+ { type: ke },
812
812
  { enforce_unique: !0, skip_push: !0 }
813
813
  );
814
814
  } catch {
815
815
  }
816
816
  }, [s, n == null ? void 0 : n.userID, t.id, o]);
817
- return { selected: o, voteUp: l, voteDown: m };
817
+ return { selected: o, voteUp: l, voteDown: d };
818
818
  }
819
- const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
819
+ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
820
820
  "path",
821
821
  {
822
822
  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",
@@ -826,7 +826,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
826
826
  strokeLinejoin: "round",
827
827
  fill: t ? "currentColor" : "none"
828
828
  }
829
- ) }), xs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
829
+ ) }), Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
830
830
  "path",
831
831
  {
832
832
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -836,7 +836,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
836
836
  strokeLinejoin: "round",
837
837
  fill: t ? "currentColor" : "none"
838
838
  }
839
- ) }), bs = ({
839
+ ) }), Ns = ({
840
840
  selected: t,
841
841
  onVoteUp: s,
842
842
  onVoteDown: n
@@ -849,7 +849,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
849
849
  onClick: s,
850
850
  "aria-label": "Helpful",
851
851
  "aria-pressed": t === "up",
852
- children: /* @__PURE__ */ e(gs, { filled: t === "up" })
852
+ children: /* @__PURE__ */ e(bs, { filled: t === "up" })
853
853
  }
854
854
  ),
855
855
  /* @__PURE__ */ e(
@@ -860,73 +860,73 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
860
860
  onClick: n,
861
861
  "aria-label": "Not helpful",
862
862
  "aria-pressed": t === "down",
863
- children: /* @__PURE__ */ e(xs, { filled: t === "down" })
863
+ children: /* @__PURE__ */ e(Cs, { filled: t === "down" })
864
864
  }
865
865
  )
866
- ] }), Cs = (t) => {
867
- var de, ue;
866
+ ] }), vs = (t) => {
867
+ var me, ue;
868
868
  const {
869
869
  additionalMessageInputProps: s,
870
870
  chatbotVotingEnabled: n,
871
871
  editing: o,
872
872
  endOfGroup: l,
873
- firstOfGroup: m,
873
+ firstOfGroup: d,
874
874
  groupedByUser: a,
875
875
  handleAction: c,
876
876
  handleOpenThread: g,
877
877
  handleRetry: h,
878
878
  highlighted: b,
879
879
  isMessageAIGenerated: x,
880
- isMyMessage: w,
880
+ isMyMessage: p,
881
881
  message: r,
882
- renderText: y,
882
+ renderText: w,
883
883
  threadList: _
884
- } = t, { client: C } = $e("CustomMessage"), [M, E] = T(!1), p = ft(r.id), { selected: S, voteUp: L, voteDown: d } = fs(r), {
885
- Attachment: u = xt,
886
- EditMessageModal: N = bt,
887
- MessageBlocked: v = Ct,
888
- MessageBouncePrompt: f = Nt,
889
- MessageDeleted: k = vt,
890
- MessageIsThreadReplyInChannelButtonIndicator: H = wt,
891
- MessageRepliesCountButton: Z = pt,
892
- ReminderNotification: Y = yt,
893
- StreamedMessageText: D = _t,
894
- PinIndicator: W
895
- } = gt("CustomMessage"), j = Et(r), ne = St(r), ae = _e(
884
+ } = t, { client: C } = $e("CustomMessage"), [M, E] = T(!1), y = gt(r.id), { selected: S, voteUp: L, voteDown: m } = xs(r), {
885
+ Attachment: u = bt,
886
+ EditMessageModal: N = Ct,
887
+ MessageBlocked: v = Nt,
888
+ MessageBouncePrompt: f = vt,
889
+ MessageDeleted: k = pt,
890
+ MessageIsThreadReplyInChannelButtonIndicator: V = yt,
891
+ MessageRepliesCountButton: Z = wt,
892
+ ReminderNotification: q = _t,
893
+ StreamedMessageText: D = Et,
894
+ PinIndicator: Y
895
+ } = xt("CustomMessage"), $ = St(r), ne = It(r), ae = Se(
896
896
  () => x == null ? void 0 : x(r),
897
897
  [x, r]
898
- ), G = _e(
898
+ ), j = Se(
899
899
  () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
900
900
  [r]
901
901
  );
902
- if (It(r))
902
+ if (Mt(r))
903
903
  return null;
904
904
  if (r.deleted_at || r.type === "deleted")
905
905
  return /* @__PURE__ */ e(k, { message: r });
906
- if (Mt(r))
906
+ if (kt(r))
907
907
  return /* @__PURE__ */ e(v, {});
908
- const K = !_ && !!r.reply_count, re = !_ && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((de = r.error) == null ? void 0 : de.status) !== 403, O = kt(r);
909
- let A;
910
- U ? A = () => h(r) : O && (A = () => E(!0));
911
- const z = w(), ce = R(
908
+ const Q = !_ && !!r.reply_count, re = !_ && r.show_in_channel && r.parent_id, P = r.status === "failed" && ((me = r.error) == null ? void 0 : me.status) !== 403, F = Tt(r);
909
+ let U;
910
+ P ? U = () => h(r) : F && (U = () => E(!0));
911
+ const z = p(), de = R(
912
912
  "str-chat__message str-chat__message-simple",
913
913
  `str-chat__message--${r.type}`,
914
914
  `str-chat__message--${r.status}`,
915
915
  z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
916
916
  r.text ? "str-chat__message--has-text" : "has-no-text",
917
917
  {
918
- "str-chat__message--has-attachment": j,
918
+ "str-chat__message--has-attachment": $,
919
919
  "str-chat__message--highlighted": b,
920
920
  "str-chat__message--pinned pinned-message": r.pinned,
921
921
  "str-chat__message--with-reactions": ne,
922
922
  "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((ue = r == null ? void 0 : r.error) == null ? void 0 : ue.status) !== 403,
923
- "str-chat__message-with-thread-link": K || re,
923
+ "str-chat__message-with-thread-link": Q || re,
924
924
  "str-chat__virtual-message__wrapper--end": l,
925
- "str-chat__virtual-message__wrapper--first": m,
925
+ "str-chat__virtual-message__wrapper--first": d,
926
926
  "str-chat__virtual-message__wrapper--group": a
927
927
  }
928
- ), q = r.poll_id && C.polls.fromState(r.poll_id), oe = cs(r), ee = Te(r), J = !!(G != null && G.length && !r.quoted_message), te = ee && z && J;
929
- return /* @__PURE__ */ i(me, { children: [
928
+ ), W = r.poll_id && C.polls.fromState(r.poll_id), oe = ms(r), ee = Re(r), J = !!(j != null && j.length && !r.quoted_message), te = ee && z && J;
929
+ return /* @__PURE__ */ i(ce, { children: [
930
930
  o && /* @__PURE__ */ e(
931
931
  N,
932
932
  {
@@ -934,16 +934,16 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
934
934
  }
935
935
  ),
936
936
  M && /* @__PURE__ */ e(
937
- Tt,
937
+ Dt,
938
938
  {
939
939
  MessageBouncePrompt: f,
940
940
  onClose: () => E(!1),
941
941
  open: M
942
942
  }
943
943
  ),
944
- /* @__PURE__ */ i("div", { className: ce, children: [
945
- W && /* @__PURE__ */ e(W, {}),
946
- !!p && /* @__PURE__ */ e(Y, { reminder: p }),
944
+ /* @__PURE__ */ i("div", { className: de, children: [
945
+ Y && /* @__PURE__ */ e(Y, {}),
946
+ !!y && /* @__PURE__ */ e(q, { reminder: y }),
947
947
  r.user && /* @__PURE__ */ e(
948
948
  se,
949
949
  {
@@ -957,13 +957,13 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
957
957
  "div",
958
958
  {
959
959
  className: R("str-chat__message-inner", {
960
- "str-chat__simple-message--error-failed": U || O
960
+ "str-chat__simple-message--error-failed": P || F
961
961
  }),
962
962
  "data-testid": "message-inner",
963
- onClick: A,
964
- onKeyDown: A,
965
- role: A ? "button" : void 0,
966
- tabIndex: A ? 0 : void 0,
963
+ onClick: U,
964
+ onKeyDown: U,
965
+ role: U ? "button" : void 0,
966
+ tabIndex: U ? 0 : void 0,
967
967
  style: {
968
968
  // Force margins to 0 to prevent hover layout shift
969
969
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
@@ -972,36 +972,36 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
972
972
  },
973
973
  children: oe ? (
974
974
  /* Tip-only messages render as a standalone bubble */
975
- /* @__PURE__ */ e(ye, { message: r, standalone: !0 })
975
+ /* @__PURE__ */ e(_e, { message: r, standalone: !0 })
976
976
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
977
977
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
978
978
  ee && !te && /* @__PURE__ */ e(
979
- ye,
979
+ _e,
980
980
  {
981
981
  message: r,
982
982
  hasAttachment: J,
983
983
  isMyMessage: z
984
984
  }
985
985
  ),
986
- q && /* @__PURE__ */ e(Dt, { poll: q }),
987
- G != null && G.length && !r.quoted_message ? /* @__PURE__ */ e(
986
+ W && /* @__PURE__ */ e(Rt, { poll: W }),
987
+ j != null && j.length && !r.quoted_message ? /* @__PURE__ */ e(
988
988
  u,
989
989
  {
990
990
  actionHandler: c,
991
- attachments: G
991
+ attachments: j
992
992
  }
993
993
  ) : null,
994
994
  ae ? /* @__PURE__ */ e(
995
995
  D,
996
996
  {
997
997
  message: r,
998
- renderText: y
998
+ renderText: w
999
999
  }
1000
- ) : /* @__PURE__ */ e(Rt, { message: r, renderText: y }),
1001
- /* @__PURE__ */ e(Lt, {})
1000
+ ) : /* @__PURE__ */ e(Lt, { message: r, renderText: w }),
1001
+ /* @__PURE__ */ e(At, {})
1002
1002
  ] }),
1003
1003
  (!ee || te) && /* @__PURE__ */ e(
1004
- ye,
1004
+ _e,
1005
1005
  {
1006
1006
  message: r,
1007
1007
  hasAttachment: J,
@@ -1009,37 +1009,37 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1009
1009
  }
1010
1010
  ),
1011
1011
  n && ee && /* @__PURE__ */ e(
1012
- bs,
1012
+ Ns,
1013
1013
  {
1014
1014
  selected: S,
1015
1015
  onVoteUp: L,
1016
- onVoteDown: d
1016
+ onVoteDown: m
1017
1017
  }
1018
1018
  )
1019
1019
  ] })
1020
1020
  }
1021
1021
  ),
1022
- K && /* @__PURE__ */ e(
1022
+ Q && /* @__PURE__ */ e(
1023
1023
  Z,
1024
1024
  {
1025
1025
  onClick: g,
1026
1026
  reply_count: r.reply_count
1027
1027
  }
1028
1028
  ),
1029
- re && /* @__PURE__ */ e(H, {})
1029
+ re && /* @__PURE__ */ e(V, {})
1030
1030
  ] }, r.id)
1031
1031
  ] });
1032
- }, Ns = B.memo(
1033
- Cs,
1034
- ht
1035
- ), vs = (t) => {
1032
+ }, ps = B.memo(
1033
+ vs,
1034
+ ft
1035
+ ), ys = (t) => {
1036
1036
  const s = je("CustomMessage");
1037
- return /* @__PURE__ */ e(Ns, { ...s, ...t });
1037
+ return /* @__PURE__ */ e(ps, { ...s, ...t });
1038
1038
  }, ws = (t) => ({
1039
1039
  linkPreviews: Array.from(t.previews.values()).filter(
1040
- (s) => Fe.previewIsLoaded(s) || Fe.previewIsLoading(s)
1040
+ (s) => Ue.previewIsLoaded(s) || Ue.previewIsLoading(s)
1041
1041
  )
1042
- }), ps = ({
1042
+ }), _s = ({
1043
1043
  link: t,
1044
1044
  onDismiss: s
1045
1045
  }) => {
@@ -1069,7 +1069,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1069
1069
  },
1070
1070
  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",
1071
1071
  "aria-label": "Close link preview",
1072
- children: /* @__PURE__ */ e(ke, { className: "size-4 text-black/90" })
1072
+ children: /* @__PURE__ */ e(De, { className: "size-4 text-black/90" })
1073
1073
  }
1074
1074
  ),
1075
1075
  /* @__PURE__ */ i("div", { className: "p-2", children: [
@@ -1079,32 +1079,32 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1079
1079
  ]
1080
1080
  }
1081
1081
  );
1082
- }, ys = () => {
1083
- const { linkPreviewsManager: t } = Pt(), { linkPreviews: s } = Ut(
1082
+ }, Es = () => {
1083
+ const { linkPreviewsManager: t } = Pt(), { linkPreviews: s } = Ft(
1084
1084
  t.state,
1085
1085
  ws
1086
1086
  ), n = (l) => {
1087
1087
  t.dismissPreview(l);
1088
1088
  };
1089
1089
  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(
1090
- ps,
1090
+ _s,
1091
1091
  {
1092
1092
  link: l,
1093
1093
  onDismiss: n
1094
1094
  },
1095
1095
  l.og_scrape_url
1096
1096
  )) }) : null;
1097
- }, _s = () => {
1098
- const { handleSubmit: t } = Ft(), s = At();
1099
- return /* @__PURE__ */ i(me, { children: [
1100
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Bt, {}) }),
1097
+ }, Ss = () => {
1098
+ const { handleSubmit: t } = Ut(), s = Bt();
1099
+ return /* @__PURE__ */ i(ce, { children: [
1100
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Gt, {}) }),
1101
1101
  /* @__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: [
1102
1102
  /* @__PURE__ */ e($t, {}),
1103
- /* @__PURE__ */ e(ys, {}),
1103
+ /* @__PURE__ */ e(Es, {}),
1104
1104
  /* @__PURE__ */ e(jt, {}),
1105
1105
  /* @__PURE__ */ i("div", { className: "flex", children: [
1106
1106
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1107
- Gt,
1107
+ zt,
1108
1108
  {
1109
1109
  className: "w-full resize-none outline-none leading-6",
1110
1110
  autoFocus: !0,
@@ -1120,58 +1120,121 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1120
1120
  disabled: !s,
1121
1121
  onClick: t,
1122
1122
  type: "button",
1123
- children: /* @__PURE__ */ e(Jt, { className: "size-4" })
1123
+ children: /* @__PURE__ */ e(Xt, { className: "size-4" })
1124
1124
  }
1125
1125
  )
1126
1126
  ] })
1127
1127
  ] })
1128
1128
  ] });
1129
- }, Es = ({
1129
+ }, Is = ({
1130
1130
  renderActions: t
1131
1131
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
1132
1132
  t && (t == null ? void 0 : t()),
1133
- /* @__PURE__ */ e(Ot, { Input: _s })
1134
- ] }), Ss = [
1133
+ /* @__PURE__ */ e(Ot, { Input: Ss })
1134
+ ] }), Ms = [
1135
1135
  "SYSTEM_DM_AGENT_PAUSED",
1136
1136
  "SYSTEM_DM_AGENT_RESUMED"
1137
- ], Is = {
1137
+ ], ks = {
1138
1138
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1139
1139
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1140
- }, Be = (t) => Ss.includes(t), Ms = (t) => {
1140
+ }, Ts = [
1141
+ "SYSTEM_AGE_SAFETY_BLOCKED"
1142
+ ], Ds = {
1143
+ SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1144
+ }, Ee = "age safety guidelines.", Rs = "https://linktr.ee/s/about/contact", Ge = (t) => Ms.includes(t), Ls = (t) => Ts.includes(t), As = (t) => {
1141
1145
  var o;
1142
1146
  const s = (o = t.metadata) == null ? void 0 : o.custom_type;
1143
- if (Be(s))
1144
- return s;
1147
+ if (Ge(s))
1148
+ return {
1149
+ kind: "dm-agent",
1150
+ type: s
1151
+ };
1152
+ if (Ls(s))
1153
+ return {
1154
+ kind: "age-safety",
1155
+ type: s
1156
+ };
1145
1157
  const n = t.dm_agent_system_type;
1146
- if (Be(n))
1147
- return n;
1148
- }, ks = (t) => {
1149
- var o;
1150
- const s = t.message.hide_date === !0, n = Ms(t.message);
1151
- if (n) {
1152
- const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Is[n];
1158
+ if (Ge(n))
1159
+ return {
1160
+ kind: "dm-agent",
1161
+ type: n
1162
+ };
1163
+ }, Ps = (t) => {
1164
+ const s = t.indexOf(Ee);
1165
+ if (s === -1)
1166
+ return t;
1167
+ const n = s + Ee.length;
1168
+ return /* @__PURE__ */ i(ce, { children: [
1169
+ t.slice(0, s),
1170
+ /* @__PURE__ */ e(
1171
+ "a",
1172
+ {
1173
+ href: Rs,
1174
+ target: "_blank",
1175
+ rel: "noopener noreferrer",
1176
+ className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1177
+ children: Ee
1178
+ }
1179
+ ),
1180
+ t.slice(n)
1181
+ ] });
1182
+ }, Fs = (t) => {
1183
+ var o, l;
1184
+ const s = t.message.hide_date === !0, n = As(
1185
+ t.message
1186
+ );
1187
+ if ((n == null ? void 0 : n.kind) === "dm-agent") {
1188
+ const d = ((o = t.message.text) == null ? void 0 : o.trim()) || ks[n.type];
1153
1189
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1154
1190
  /* @__PURE__ */ i(
1155
1191
  "div",
1156
1192
  {
1157
- className: "mes-dm-agent-system-message",
1193
+ className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
1158
1194
  "data-testid": "dm-agent-system-message",
1159
- "data-dm-agent-system-type": n,
1195
+ "data-dm-agent-system-type": n.type,
1160
1196
  children: [
1161
1197
  /* @__PURE__ */ e(
1162
- Qt,
1198
+ Kt,
1163
1199
  {
1164
1200
  size: 16,
1165
1201
  weight: "regular",
1166
1202
  "aria-hidden": !0,
1167
- className: "mes-dm-agent-system-message__sparkle"
1203
+ className: "mes-dm-agent-system-message__sparkle shrink-0"
1168
1204
  }
1169
1205
  ),
1170
- /* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text", children: l })
1206
+ /* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: d })
1171
1207
  ]
1172
1208
  }
1173
1209
  ),
1174
- !s && /* @__PURE__ */ e(Re, { message: t.message })
1210
+ !s && /* @__PURE__ */ e(we, { message: t.message })
1211
+ ] });
1212
+ }
1213
+ if ((n == null ? void 0 : n.kind) === "age-safety") {
1214
+ const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Ds[n.type];
1215
+ return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1216
+ /* @__PURE__ */ i(
1217
+ "div",
1218
+ {
1219
+ className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
1220
+ "data-testid": "age-safety-system-message",
1221
+ "data-age-safety-system-type": n.type,
1222
+ children: [
1223
+ /* @__PURE__ */ e(
1224
+ Qt,
1225
+ {
1226
+ size: 24,
1227
+ weight: "duotone",
1228
+ "aria-hidden": !0,
1229
+ className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
1230
+ "data-testid": "age-safety-system-message-icon"
1231
+ }
1232
+ ),
1233
+ /* @__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: Ps(d) }) })
1234
+ ]
1235
+ }
1236
+ ),
1237
+ !s && /* @__PURE__ */ e(we, { message: t.message })
1175
1238
  ] });
1176
1239
  }
1177
1240
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1180,9 +1243,9 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1180
1243
  /* @__PURE__ */ e("p", { children: t.message.text }),
1181
1244
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1182
1245
  ] }),
1183
- !s && /* @__PURE__ */ e(Re, { message: t.message })
1246
+ !s && /* @__PURE__ */ e(we, { message: t.message })
1184
1247
  ] });
1185
- }, Ts = () => null, Ds = ({ className: t, message: s }) => /* @__PURE__ */ i(
1248
+ }, Os = () => null, Us = ({ className: t, message: s }) => /* @__PURE__ */ i(
1186
1249
  "div",
1187
1250
  {
1188
1251
  className: R("flex items-center justify-center h-full", t),
@@ -1226,26 +1289,26 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1226
1289
  ]
1227
1290
  }
1228
1291
  ), Ne = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1229
- /* @__PURE__ */ e(Ds, { className: "w-6 h-6" }),
1292
+ /* @__PURE__ */ e(Us, { className: "w-6 h-6" }),
1230
1293
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1231
1294
  ] }) }));
1232
1295
  Ne.displayName = "LoadingState";
1233
- const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Rs = ({
1296
+ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bs = ({
1234
1297
  onBack: t,
1235
1298
  showBackButton: s,
1236
1299
  onShowInfo: n,
1237
1300
  canShowInfo: o,
1238
1301
  showStarButton: l = !1
1239
1302
  }) => {
1240
- var x, w, r, y, _;
1241
- const { channel: m } = Me(), a = B.useMemo(() => Object.values(m.state.members || {}).find(
1303
+ var x, p, r, w, _;
1304
+ const { channel: d } = Te(), a = B.useMemo(() => Object.values(d.state.members || {}).find(
1242
1305
  (M) => {
1243
1306
  var E;
1244
- return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== m._client.userID;
1307
+ return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== d._client.userID;
1245
1308
  }
1246
- ), [m._client.userID, m.state.members]), c = ((x = a == null ? void 0 : a.user) == null ? void 0 : x.name) || ((w = a == null ? void 0 : a.user) == null ? void 0 : w.id) || "Unknown member", g = (r = a == null ? void 0 : a.user) == null ? void 0 : r.image, h = Ve(m), b = async () => {
1309
+ ), [d._client.userID, d.state.members]), c = ((x = a == null ? void 0 : a.user) == null ? void 0 : x.name) || ((p = a == null ? void 0 : a.user) == null ? void 0 : p.id) || "Unknown member", g = (r = a == null ? void 0 : a.user) == null ? void 0 : r.image, h = Ve(d), b = async () => {
1247
1310
  try {
1248
- h ? await m.unpin() : await m.pin();
1311
+ h ? await d.unpin() : await d.pin();
1249
1312
  } catch (C) {
1250
1313
  console.error(
1251
1314
  "[CustomChannelHeader] Failed to update pinned status:",
@@ -1270,7 +1333,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1270
1333
  /* @__PURE__ */ e(
1271
1334
  se,
1272
1335
  {
1273
- id: ((y = a == null ? void 0 : a.user) == null ? void 0 : y.id) || m.id || "unknown",
1336
+ id: ((w = a == null ? void 0 : a.user) == null ? void 0 : w.id) || d.id || "unknown",
1274
1337
  name: c,
1275
1338
  image: g,
1276
1339
  starred: h,
@@ -1288,7 +1351,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1288
1351
  type: "button",
1289
1352
  "aria-label": h ? "Unstar conversation" : "Star conversation",
1290
1353
  children: /* @__PURE__ */ e(
1291
- Ee,
1354
+ Ie,
1292
1355
  {
1293
1356
  className: R("size-5", {
1294
1357
  "text-yellow-600": h,
@@ -1306,7 +1369,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1306
1369
  onClick: n,
1307
1370
  type: "button",
1308
1371
  "aria-label": "Show info",
1309
- children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
1372
+ children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
1310
1373
  }
1311
1374
  )
1312
1375
  ] })
@@ -1326,7 +1389,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1326
1389
  /* @__PURE__ */ e(
1327
1390
  se,
1328
1391
  {
1329
- id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) || m.id || "unknown",
1392
+ id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) || d.id || "unknown",
1330
1393
  name: c,
1331
1394
  image: g,
1332
1395
  starred: h,
@@ -1344,7 +1407,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1344
1407
  type: "button",
1345
1408
  "aria-label": h ? "Unstar conversation" : "Star conversation",
1346
1409
  children: /* @__PURE__ */ e(
1347
- Ee,
1410
+ Ie,
1348
1411
  {
1349
1412
  className: R("size-5", {
1350
1413
  "text-yellow-600": h,
@@ -1362,67 +1425,67 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1362
1425
  onClick: n,
1363
1426
  type: "button",
1364
1427
  "aria-label": "Show info",
1365
- children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
1428
+ children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
1366
1429
  }
1367
1430
  )
1368
1431
  ] })
1369
1432
  ] })
1370
1433
  ] });
1371
- }, Ls = ({
1434
+ }, Gs = ({
1372
1435
  onBack: t,
1373
1436
  showBackButton: s,
1374
1437
  renderMessageInputActions: n,
1375
1438
  renderConversationFooter: o,
1376
1439
  onLeaveConversation: l,
1377
- onBlockParticipant: m,
1440
+ onBlockParticipant: d,
1378
1441
  showDeleteConversation: a = !0,
1379
1442
  onDeleteConversationClick: c,
1380
1443
  onBlockParticipantClick: g,
1381
1444
  onReportParticipantClick: h,
1382
1445
  showStarButton: b = !1,
1383
1446
  chatbotVotingEnabled: x = !1,
1384
- renderChannelBanner: w,
1447
+ renderChannelBanner: p,
1385
1448
  customProfileContent: r,
1386
- customChannelActions: y,
1449
+ customChannelActions: w,
1387
1450
  renderMessage: _
1388
1451
  }) => {
1389
- const { channel: C } = Me(), M = Q(null), E = B.useMemo(() => Object.values(C.state.members || {}).find(
1452
+ const { channel: C } = Te(), M = X(null), E = B.useMemo(() => Object.values(C.state.members || {}).find(
1390
1453
  (u) => {
1391
1454
  var N;
1392
1455
  return ((N = u.user) == null ? void 0 : N.id) && u.user.id !== C._client.userID;
1393
1456
  }
1394
- ), [C._client.userID, C.state.members]), p = B.useMemo(() => {
1395
- const d = C.data ?? {};
1396
- if (d.followerStatus)
1397
- return String(d.followerStatus);
1398
- if (d.isFollower !== void 0)
1399
- return d.isFollower ? "Subscribed to you" : "Not subscribed";
1400
- }, [C.data]), S = P(() => {
1401
- var d;
1402
- (d = M.current) == null || d.showModal();
1403
- }, []), L = P(() => {
1404
- var d;
1405
- (d = M.current) == null || d.close();
1457
+ ), [C._client.userID, C.state.members]), y = B.useMemo(() => {
1458
+ const m = C.data ?? {};
1459
+ if (m.followerStatus)
1460
+ return String(m.followerStatus);
1461
+ if (m.isFollower !== void 0)
1462
+ return m.isFollower ? "Subscribed to you" : "Not subscribed";
1463
+ }, [C.data]), S = A(() => {
1464
+ var m;
1465
+ (m = M.current) == null || m.showModal();
1466
+ }, []), L = A(() => {
1467
+ var m;
1468
+ (m = M.current) == null || m.close();
1406
1469
  }, []);
1407
- return /* @__PURE__ */ i(me, { children: [
1470
+ return /* @__PURE__ */ i(ce, { children: [
1408
1471
  /* @__PURE__ */ e(
1409
1472
  Vt,
1410
1473
  {
1411
1474
  overrides: {
1412
- Message: (d) => {
1475
+ Message: (m) => {
1413
1476
  const { message: u } = je("ChannelView"), N = /* @__PURE__ */ e(
1414
- vs,
1477
+ ys,
1415
1478
  {
1416
- ...d,
1479
+ ...m,
1417
1480
  chatbotVotingEnabled: x
1418
1481
  }
1419
1482
  );
1420
1483
  return !_ || !u ? N : _(N, u);
1421
1484
  }
1422
1485
  },
1423
- children: /* @__PURE__ */ i(Ht, { children: [
1486
+ children: /* @__PURE__ */ i(Yt, { children: [
1424
1487
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1425
- Rs,
1488
+ Bs,
1426
1489
  {
1427
1490
  onBack: t,
1428
1491
  showBackButton: s,
@@ -1431,7 +1494,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1431
1494
  showStarButton: b
1432
1495
  }
1433
1496
  ) }),
1434
- w == null ? void 0 : w(),
1497
+ p == null ? void 0 : p(),
1435
1498
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1436
1499
  Wt,
1437
1500
  {
@@ -1442,7 +1505,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1442
1505
  ) }),
1443
1506
  o == null ? void 0 : o(C),
1444
1507
  /* @__PURE__ */ e(
1445
- Es,
1508
+ Is,
1446
1509
  {
1447
1510
  renderActions: () => n == null ? void 0 : n(C)
1448
1511
  }
@@ -1451,68 +1514,68 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1451
1514
  }
1452
1515
  ),
1453
1516
  /* @__PURE__ */ e(
1454
- us,
1517
+ hs,
1455
1518
  {
1456
1519
  dialogRef: M,
1457
1520
  onClose: L,
1458
1521
  participant: E,
1459
1522
  channel: C,
1460
- followerStatusLabel: p,
1523
+ followerStatusLabel: y,
1461
1524
  onLeaveConversation: l,
1462
- onBlockParticipant: m,
1525
+ onBlockParticipant: d,
1463
1526
  showDeleteConversation: a,
1464
1527
  onDeleteConversationClick: c,
1465
1528
  onBlockParticipantClick: g,
1466
1529
  onReportParticipantClick: h,
1467
1530
  customProfileContent: r,
1468
- customChannelActions: y
1531
+ customChannelActions: w
1469
1532
  }
1470
1533
  )
1471
1534
  ] });
1472
- }, Je = B.memo(
1535
+ }, Xe = B.memo(
1473
1536
  ({
1474
1537
  channel: t,
1475
1538
  onBack: s,
1476
1539
  showBackButton: n = !1,
1477
1540
  renderMessageInputActions: o,
1478
1541
  renderConversationFooter: l,
1479
- onLeaveConversation: m,
1542
+ onLeaveConversation: d,
1480
1543
  onBlockParticipant: a,
1481
1544
  className: c,
1482
- CustomChannelEmptyState: g = Ts,
1545
+ CustomChannelEmptyState: g = Os,
1483
1546
  showDeleteConversation: h = !0,
1484
1547
  onDeleteConversationClick: b,
1485
1548
  onBlockParticipantClick: x,
1486
- onReportParticipantClick: w,
1549
+ onReportParticipantClick: p,
1487
1550
  dmAgentEnabled: r,
1488
- messageMetadata: y,
1551
+ messageMetadata: w,
1489
1552
  onMessageSent: _,
1490
1553
  showStarButton: C = !1,
1491
1554
  chatbotVotingEnabled: M = !1,
1492
1555
  renderChannelBanner: E,
1493
- customProfileContent: p,
1556
+ customProfileContent: y,
1494
1557
  customChannelActions: S,
1495
1558
  renderMessage: L
1496
1559
  }) => {
1497
- const d = P(
1560
+ const m = A(
1498
1561
  async (u, N, v) => {
1499
1562
  var D;
1500
- const f = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, k = r && !f, H = {
1563
+ const f = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, k = r && !f, V = {
1501
1564
  ...N,
1502
1565
  ...k && { silent: !0 },
1503
- ...y && {
1566
+ ...w && {
1504
1567
  metadata: {
1505
1568
  ...N.metadata ?? {},
1506
- ...y
1569
+ ...w
1507
1570
  }
1508
1571
  }
1509
1572
  }, Z = {
1510
1573
  ...v,
1511
1574
  ...k && { skip_push: !0 }
1512
- }, Y = await t.sendMessage(H, Z);
1513
- return _ == null || _(Y), Y;
1575
+ }, q = await t.sendMessage(V, Z);
1576
+ return _ == null || _(q), q;
1514
1577
  },
1515
- [t, r, y, _]
1578
+ [t, r, w, _]
1516
1579
  );
1517
1580
  return /* @__PURE__ */ e(
1518
1581
  "div",
@@ -1522,32 +1585,32 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1522
1585
  c
1523
1586
  ),
1524
1587
  children: /* @__PURE__ */ e(
1525
- zt,
1588
+ Ht,
1526
1589
  {
1527
1590
  channel: t,
1528
- MessageSystem: ks,
1591
+ MessageSystem: Fs,
1529
1592
  EmptyStateIndicator: g,
1530
1593
  LoadingIndicator: Ne,
1531
- DateSeparator: ms,
1532
- doSendMessageRequest: d,
1594
+ DateSeparator: fs,
1595
+ doSendMessageRequest: m,
1533
1596
  children: /* @__PURE__ */ e(
1534
- Ls,
1597
+ Gs,
1535
1598
  {
1536
1599
  onBack: s,
1537
1600
  showBackButton: n,
1538
1601
  renderMessageInputActions: o,
1539
1602
  renderConversationFooter: l,
1540
- onLeaveConversation: m,
1603
+ onLeaveConversation: d,
1541
1604
  onBlockParticipant: a,
1542
1605
  CustomChannelEmptyState: g,
1543
1606
  showDeleteConversation: h,
1544
1607
  onDeleteConversationClick: b,
1545
1608
  onBlockParticipantClick: x,
1546
- onReportParticipantClick: w,
1609
+ onReportParticipantClick: p,
1547
1610
  showStarButton: C,
1548
1611
  chatbotVotingEnabled: M,
1549
1612
  renderChannelBanner: E,
1550
- customProfileContent: p,
1613
+ customProfileContent: y,
1551
1614
  customChannelActions: S,
1552
1615
  renderMessage: L
1553
1616
  }
@@ -1558,16 +1621,16 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1558
1621
  );
1559
1622
  }
1560
1623
  );
1561
- Je.displayName = "ChannelView";
1562
- function Ps({
1624
+ Xe.displayName = "ChannelView";
1625
+ function $s({
1563
1626
  searchQuery: t,
1564
1627
  setSearchQuery: s,
1565
1628
  placeholder: n
1566
1629
  }) {
1567
- const o = Q(null);
1630
+ const o = X(null);
1568
1631
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1569
1632
  /* @__PURE__ */ e(
1570
- Xt,
1633
+ es,
1571
1634
  {
1572
1635
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1573
1636
  weight: "bold"
@@ -1585,7 +1648,7 @@ function Ps({
1585
1648
  }
1586
1649
  ),
1587
1650
  t && /* @__PURE__ */ e(
1588
- Ye,
1651
+ Ze,
1589
1652
  {
1590
1653
  label: "Clear search",
1591
1654
  onClick: () => {
@@ -1593,24 +1656,24 @@ function Ps({
1593
1656
  s(""), (l = o.current) == null || l.focus();
1594
1657
  },
1595
1658
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1596
- children: /* @__PURE__ */ e(ke, { className: "h-4 w-4", weight: "bold" })
1659
+ children: /* @__PURE__ */ e(De, { className: "h-4 w-4", weight: "bold" })
1597
1660
  }
1598
1661
  )
1599
1662
  ] });
1600
1663
  }
1601
- const Us = ({
1664
+ const js = ({
1602
1665
  participantSource: t,
1603
1666
  onSelectParticipant: s,
1604
1667
  onClose: n,
1605
1668
  existingParticipantIds: o = /* @__PURE__ */ new Set(),
1606
1669
  participantLabel: l = "participants",
1607
- searchPlaceholder: m = "Search participants...",
1670
+ searchPlaceholder: d = "Search participants...",
1608
1671
  className: a
1609
1672
  }) => {
1610
- const { debug: c } = ve(), [g, h] = T(""), [b, x] = T([]), [w, r] = T(!1), [y, _] = T(null), [C, M] = T(
1673
+ const { debug: c } = ve(), [g, h] = T(""), [b, x] = T([]), [p, r] = T(!1), [w, _] = T(null), [C, M] = T(
1611
1674
  null
1612
- ), E = Q(!1);
1613
- X(() => {
1675
+ ), E = X(!1);
1676
+ K(() => {
1614
1677
  if (t.loading) {
1615
1678
  c && console.log(
1616
1679
  "[ParticipantPicker] Waiting for participant source to finish loading..."
@@ -1638,84 +1701,84 @@ const Us = ({
1638
1701
  }
1639
1702
  })();
1640
1703
  }, [t.loading, c]);
1641
- const p = b.filter((d) => !o.has(d.id)).filter((d) => {
1704
+ const y = b.filter((m) => !o.has(m.id)).filter((m) => {
1642
1705
  var N;
1643
1706
  if (!g) return !0;
1644
1707
  const u = g.toLowerCase();
1645
- return d.name.toLowerCase().includes(u) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1646
- }), S = P(
1647
- async (d) => {
1708
+ return m.name.toLowerCase().includes(u) || ((N = m.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1709
+ }), S = A(
1710
+ async (m) => {
1648
1711
  if (!C) {
1649
- M(d.id);
1712
+ M(m.id);
1650
1713
  try {
1651
- await s(d);
1714
+ await s(m);
1652
1715
  } catch (u) {
1653
1716
  console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
1654
1717
  }
1655
1718
  }
1656
1719
  },
1657
1720
  [s, C]
1658
- ), L = (d, u) => {
1659
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), S(u));
1721
+ ), L = (m, u) => {
1722
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), S(u));
1660
1723
  };
1661
1724
  return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
1662
1725
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1663
1726
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1664
1727
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1665
- /* @__PURE__ */ e(Ze, { onClick: n })
1728
+ /* @__PURE__ */ e(Je, { onClick: n })
1666
1729
  ] }),
1667
1730
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1668
1731
  "Select a ",
1669
1732
  l.slice(0, -1),
1670
1733
  " to start messaging (",
1671
- p.length,
1734
+ y.length,
1672
1735
  " available)",
1673
1736
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1674
1737
  ] }),
1675
1738
  /* @__PURE__ */ e(
1676
- Ps,
1739
+ $s,
1677
1740
  {
1678
1741
  searchQuery: g,
1679
1742
  setSearchQuery: h,
1680
- placeholder: m
1743
+ placeholder: d
1681
1744
  }
1682
1745
  )
1683
1746
  ] }),
1684
- y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1747
+ w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1685
1748
  "Error loading ",
1686
1749
  l,
1687
1750
  ": ",
1688
- y
1751
+ w
1689
1752
  ] }),
1690
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: w && p.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: [
1753
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: p && y.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: [
1691
1754
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1692
1755
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1693
1756
  "Loading ",
1694
1757
  l,
1695
1758
  "..."
1696
1759
  ] })
1697
- ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1760
+ ] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1698
1761
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Oe, { className: "h-8 w-8 text-charcoal" }) }),
1699
1762
  /* @__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` }),
1700
1763
  /* @__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` })
1701
1764
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1702
- p.map((d) => {
1703
- const u = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
1765
+ y.map((m) => {
1766
+ const u = m.name || m.email || m.id, N = m.email && m.name ? m.email : m.phone;
1704
1767
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1705
1768
  "button",
1706
1769
  {
1707
1770
  type: "button",
1708
- onClick: () => S(d),
1709
- onKeyDown: (v) => L(v, d),
1771
+ onClick: () => S(m),
1772
+ onKeyDown: (v) => L(v, m),
1710
1773
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1711
1774
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1712
1775
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1713
1776
  /* @__PURE__ */ e(
1714
1777
  se,
1715
1778
  {
1716
- id: d.id,
1779
+ id: m.id,
1717
1780
  name: u,
1718
- image: d.image,
1781
+ image: m.image,
1719
1782
  size: 40
1720
1783
  }
1721
1784
  ),
@@ -1724,18 +1787,18 @@ const Us = ({
1724
1787
  N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1725
1788
  ] })
1726
1789
  ] }),
1727
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === d.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
1790
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === m.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
1728
1791
  ] })
1729
1792
  }
1730
- ) }, d.id);
1793
+ ) }, m.id);
1731
1794
  }),
1732
- w && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1795
+ p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1733
1796
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1734
1797
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1735
1798
  ] }) })
1736
1799
  ] }) })
1737
1800
  ] });
1738
- }, Os = ({ className: t }) => /* @__PURE__ */ i(
1801
+ }, zs = ({ className: t }) => /* @__PURE__ */ i(
1739
1802
  "svg",
1740
1803
  {
1741
1804
  width: "140",
@@ -1869,16 +1932,16 @@ const Us = ({
1869
1932
  ] })
1870
1933
  ]
1871
1934
  }
1872
- ), Qe = B.memo(
1935
+ ), Ke = B.memo(
1873
1936
  ({ 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: [
1874
- /* @__PURE__ */ e(Os, {}),
1937
+ /* @__PURE__ */ e(zs, {}),
1875
1938
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1876
1939
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1877
1940
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1878
1941
  ] })
1879
1942
  ] }) })
1880
1943
  );
1881
- Qe.displayName = "EmptyState";
1944
+ Ke.displayName = "EmptyState";
1882
1945
  const Ce = B.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: [
1883
1946
  /* @__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: "⚠️" }) }),
1884
1947
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
@@ -1894,30 +1957,30 @@ const Ce = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1894
1957
  )
1895
1958
  ] }) }));
1896
1959
  Ce.displayName = "ErrorState";
1897
- const Ws = ({
1960
+ const Qs = ({
1898
1961
  capabilities: t = {},
1899
1962
  className: s,
1900
1963
  renderMessageInputActions: n,
1901
1964
  renderConversationFooter: o,
1902
1965
  onChannelSelect: l,
1903
- onParticipantSelect: m,
1966
+ onParticipantSelect: d,
1904
1967
  initialParticipantFilter: a,
1905
1968
  initialParticipantData: c,
1906
1969
  CustomChannelEmptyState: g,
1907
1970
  showChannelList: h = !0,
1908
1971
  filters: b,
1909
1972
  channelListCustomEmptyStateIndicator: x,
1910
- onDeleteConversationClick: w,
1973
+ onDeleteConversationClick: p,
1911
1974
  onBlockParticipantClick: r,
1912
- onReportParticipantClick: y,
1975
+ onReportParticipantClick: w,
1913
1976
  dmAgentEnabled: _,
1914
1977
  messageMetadata: C,
1915
1978
  onMessageSent: M,
1916
1979
  showStarButton: E = !1,
1917
- chatbotVotingEnabled: p = !1,
1980
+ chatbotVotingEnabled: y = !1,
1918
1981
  renderMessagePreview: S,
1919
1982
  renderChannelBanner: L,
1920
- customProfileContent: d,
1983
+ customProfileContent: m,
1921
1984
  customChannelActions: u,
1922
1985
  renderMessage: N
1923
1986
  }) => {
@@ -1925,15 +1988,15 @@ const Ws = ({
1925
1988
  service: v,
1926
1989
  client: f,
1927
1990
  isConnected: k,
1928
- isLoading: H,
1991
+ isLoading: V,
1929
1992
  error: Z,
1930
- refreshConnection: Y,
1993
+ refreshConnection: q,
1931
1994
  debug: D
1932
- } = Kt(), [W, j] = T(null), [ne, ae] = T(!1), [G, K] = T(!1), [re, U] = T(!1), [O, A] = T(/* @__PURE__ */ new Set()), [z, ce] = T(0), [q, oe] = T(!1), [ee, J] = T(null), te = Q(null), {
1933
- participantSource: de,
1995
+ } = ts(), [Y, $] = T(null), [ne, ae] = T(!1), [j, Q] = T(!1), [re, P] = T(!1), [F, U] = T(/* @__PURE__ */ new Set()), [z, de] = T(0), [W, oe] = T(!1), [ee, J] = T(null), te = X(null), {
1996
+ participantSource: me,
1934
1997
  participantLabel: ue = "participants",
1935
- showDeleteConversation: Xe = !0
1936
- } = t, Ke = B.useMemo(() => {
1998
+ showDeleteConversation: Qe = !0
1999
+ } = t, et = B.useMemo(() => {
1937
2000
  const I = f == null ? void 0 : f.userID;
1938
2001
  return {
1939
2002
  ...{
@@ -1946,61 +2009,61 @@ const Ws = ({
1946
2009
  },
1947
2010
  ...b
1948
2011
  };
1949
- }, [b, f == null ? void 0 : f.userID]), he = Q(null), le = P(async () => {
2012
+ }, [b, f == null ? void 0 : f.userID]), he = X(null), le = A(async () => {
1950
2013
  if (!f || !k) return;
1951
2014
  const I = f.userID;
1952
2015
  if (I)
1953
2016
  try {
1954
2017
  D && console.log("[MessagingShell] Syncing channels for user:", I);
1955
- const V = await f.queryChannels(
2018
+ const H = await f.queryChannels(
1956
2019
  {
1957
2020
  type: "messaging",
1958
2021
  members: { $in: [I] }
1959
2022
  },
1960
2023
  {},
1961
2024
  { limit: 100 }
1962
- ), F = /* @__PURE__ */ new Set();
1963
- V.forEach(($) => {
1964
- const we = $.state.members;
1965
- Object.values(we).forEach((ot) => {
1966
- var De;
1967
- const pe = (De = ot.user) == null ? void 0 : De.id;
1968
- pe && pe !== I && F.add(pe);
2025
+ ), O = /* @__PURE__ */ new Set();
2026
+ H.forEach((G) => {
2027
+ const pe = G.state.members;
2028
+ Object.values(pe).forEach((lt) => {
2029
+ var Le;
2030
+ const ye = (Le = lt.user) == null ? void 0 : Le.id;
2031
+ ye && ye !== I && O.add(ye);
1969
2032
  });
1970
- }), A(($) => $.size === F.size && [...$].every((we) => F.has(we)) ? $ : F), ae(V.length > 0), K(!0), he.current = I, D && console.log("[MessagingShell] Channels synced successfully:", {
1971
- channelCount: V.length,
1972
- memberCount: F.size
2033
+ }), U((G) => G.size === O.size && [...G].every((pe) => O.has(pe)) ? G : O), ae(H.length > 0), Q(!0), he.current = I, D && console.log("[MessagingShell] Channels synced successfully:", {
2034
+ channelCount: H.length,
2035
+ memberCount: O.size
1973
2036
  });
1974
- } catch (V) {
1975
- console.error("[MessagingShell] Failed to sync channels:", V);
2037
+ } catch (H) {
2038
+ console.error("[MessagingShell] Failed to sync channels:", H);
1976
2039
  }
1977
2040
  }, [f, k, D]);
1978
- X(() => {
2041
+ K(() => {
1979
2042
  if (!f || !k) return;
1980
2043
  const I = f.userID;
1981
2044
  I && he.current !== I && le();
1982
- }, [f, k, le]), X(() => {
2045
+ }, [f, k, le]), K(() => {
1983
2046
  if (!a || !f || !k) return;
1984
2047
  (async () => {
1985
- const V = f.userID;
1986
- if (V)
2048
+ const H = f.userID;
2049
+ if (H)
1987
2050
  try {
1988
2051
  D && console.log(
1989
2052
  "[MessagingShell] Loading initial conversation with:",
1990
2053
  a
1991
2054
  );
1992
- const F = await f.queryChannels(
2055
+ const O = await f.queryChannels(
1993
2056
  {
1994
2057
  type: "messaging",
1995
- members: { $eq: [V, a] }
2058
+ members: { $eq: [H, a] }
1996
2059
  },
1997
2060
  {},
1998
2061
  { limit: 1 }
1999
2062
  );
2000
- if (F.length > 0)
2001
- j(F[0]), oe(!0), J(null), l && l(F[0]), D && console.log(
2063
+ if (O.length > 0)
2064
+ $(O[0]), oe(!0), J(null), l && l(O[0]), D && console.log(
2002
2065
  "[MessagingShell] Initial conversation loaded:",
2003
- F[0].id
2066
+ O[0].id
2004
2067
  );
2005
2068
  else if (c && v) {
2006
2069
  D && console.log(
@@ -2008,20 +2071,20 @@ const Ws = ({
2008
2071
  c
2009
2072
  );
2010
2073
  try {
2011
- const $ = await v.startChannelWithParticipant({
2074
+ const G = await v.startChannelWithParticipant({
2012
2075
  id: c.id,
2013
2076
  name: c.name,
2014
2077
  email: c.email,
2015
2078
  phone: c.phone
2016
2079
  });
2017
- j($), oe(!0), J(null), l && l($), D && console.log(
2080
+ $(G), oe(!0), J(null), l && l(G), D && console.log(
2018
2081
  "[MessagingShell] Channel created and loaded:",
2019
- $.id
2082
+ G.id
2020
2083
  );
2021
- } catch ($) {
2084
+ } catch (G) {
2022
2085
  console.error(
2023
2086
  "[MessagingShell] Failed to create conversation:",
2024
- $
2087
+ G
2025
2088
  ), J("Failed to create conversation");
2026
2089
  }
2027
2090
  } else
@@ -2031,10 +2094,10 @@ const Ws = ({
2031
2094
  "[MessagingShell] No conversation found for:",
2032
2095
  a
2033
2096
  );
2034
- } catch (F) {
2097
+ } catch (O) {
2035
2098
  console.error(
2036
2099
  "[MessagingShell] Failed to load initial conversation:",
2037
- F
2100
+ O
2038
2101
  ), J("Failed to load conversation");
2039
2102
  }
2040
2103
  })();
@@ -2047,63 +2110,63 @@ const Ws = ({
2047
2110
  D,
2048
2111
  l
2049
2112
  ]);
2050
- const et = P(
2113
+ const tt = A(
2051
2114
  (I) => {
2052
- j(I), l == null || l(I);
2115
+ $(I), l == null || l(I);
2053
2116
  },
2054
2117
  [l]
2055
- ), tt = P(() => {
2056
- q || j(null);
2057
- }, [q]), st = P(
2118
+ ), st = A(() => {
2119
+ W || $(null);
2120
+ }, [W]), nt = A(
2058
2121
  async (I) => {
2059
- var V;
2122
+ var H;
2060
2123
  if (v)
2061
2124
  try {
2062
2125
  D && console.log(
2063
2126
  "[MessagingShell] Starting conversation with:",
2064
2127
  I.id
2065
2128
  );
2066
- const F = await v.startChannelWithParticipant({
2129
+ const O = await v.startChannelWithParticipant({
2067
2130
  id: I.id,
2068
2131
  name: I.name,
2069
2132
  email: I.email,
2070
2133
  phone: I.phone
2071
2134
  });
2072
2135
  try {
2073
- await F.show();
2074
- } catch ($) {
2075
- console.warn("[MessagingShell] Failed to unhide channel:", $);
2136
+ await O.show();
2137
+ } catch (G) {
2138
+ console.warn("[MessagingShell] Failed to unhide channel:", G);
2076
2139
  }
2077
- j(F), U(!1), (V = te.current) == null || V.close(), m == null || m(I);
2078
- } catch (F) {
2079
- console.error("[MessagingShell] Failed to start conversation:", F);
2140
+ $(O), P(!1), (H = te.current) == null || H.close(), d == null || d(I);
2141
+ } catch (O) {
2142
+ console.error("[MessagingShell] Failed to start conversation:", O);
2080
2143
  }
2081
2144
  },
2082
- [v, m, D]
2083
- ), fe = P(() => {
2145
+ [v, d, D]
2146
+ ), fe = A(() => {
2084
2147
  var I;
2085
- U(!1), (I = te.current) == null || I.close();
2086
- }, []), nt = P(
2148
+ P(!1), (I = te.current) == null || I.close();
2149
+ }, []), at = A(
2087
2150
  (I) => {
2088
2151
  I.target === te.current && fe();
2089
2152
  },
2090
2153
  [fe]
2091
- ), at = P(
2154
+ ), rt = A(
2092
2155
  async (I) => {
2093
- D && console.log("[MessagingShell] Leaving conversation:", I.id), j(null), oe(!1), he.current = null, await le();
2156
+ D && console.log("[MessagingShell] Leaving conversation:", I.id), $(null), oe(!1), he.current = null, await le();
2094
2157
  },
2095
2158
  [le, D]
2096
- ), rt = P(
2159
+ ), ot = A(
2097
2160
  async (I) => {
2098
- D && console.log("[MessagingShell] Blocking participant:", I), j(null), oe(!1), he.current = null, await le();
2161
+ D && console.log("[MessagingShell] Blocking participant:", I), $(null), oe(!1), he.current = null, await le();
2099
2162
  },
2100
2163
  [le, D]
2101
- ), ge = !!W;
2102
- return H ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Z, onBack: Y }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
2164
+ ), ge = !!Y;
2165
+ return V ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Z, onBack: q }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
2103
2166
  Ce,
2104
2167
  {
2105
2168
  message: "Not connected to messaging service",
2106
- onBack: Y
2169
+ onBack: q
2107
2170
  }
2108
2171
  ) }) : ee ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: ee }) }) : /* @__PURE__ */ i(
2109
2172
  "div",
@@ -2120,19 +2183,19 @@ const Ws = ({
2120
2183
  className: R(
2121
2184
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2122
2185
  {
2123
- "!hidden": h === !1 || q,
2186
+ "!hidden": h === !1 || W,
2124
2187
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2125
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && ge,
2188
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !W && ge,
2126
2189
  // Show on mobile when no channel selected, use same wide width on desktop
2127
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !ge
2190
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !W && !ge
2128
2191
  }
2129
2192
  ),
2130
2193
  children: /* @__PURE__ */ e(
2131
2194
  qe,
2132
2195
  {
2133
- onChannelSelect: et,
2134
- selectedChannel: W || void 0,
2135
- filters: Ke,
2196
+ onChannelSelect: tt,
2197
+ selectedChannel: Y || void 0,
2198
+ filters: et,
2136
2199
  customEmptyStateIndicator: x,
2137
2200
  renderMessagePreview: S
2138
2201
  }
@@ -2146,65 +2209,65 @@ const Ws = ({
2146
2209
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2147
2210
  {
2148
2211
  // In direct conversation mode (or waiting for it), always show (full width)
2149
- flex: q || ge || a,
2212
+ flex: W || ge || a,
2150
2213
  // Normal mode: hide on mobile when no channel selected
2151
- "hidden lg:flex": !q && !ge && !a
2214
+ "hidden lg:flex": !W && !ge && !a
2152
2215
  }
2153
2216
  ),
2154
- children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2155
- Je,
2217
+ children: Y ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2218
+ Xe,
2156
2219
  {
2157
- channel: W,
2158
- onBack: tt,
2159
- showBackButton: !q,
2220
+ channel: Y,
2221
+ onBack: st,
2222
+ showBackButton: !W,
2160
2223
  renderMessageInputActions: n,
2161
2224
  renderConversationFooter: o,
2162
2225
  renderChannelBanner: L,
2163
- onLeaveConversation: at,
2164
- onBlockParticipant: rt,
2226
+ onLeaveConversation: rt,
2227
+ onBlockParticipant: ot,
2165
2228
  CustomChannelEmptyState: g,
2166
- showDeleteConversation: Xe,
2167
- onDeleteConversationClick: w,
2229
+ showDeleteConversation: Qe,
2230
+ onDeleteConversationClick: p,
2168
2231
  onBlockParticipantClick: r,
2169
- onReportParticipantClick: y,
2232
+ onReportParticipantClick: w,
2170
2233
  dmAgentEnabled: _,
2171
2234
  messageMetadata: C,
2172
2235
  onMessageSent: M,
2173
2236
  showStarButton: E,
2174
- chatbotVotingEnabled: p,
2175
- customProfileContent: d,
2237
+ chatbotVotingEnabled: y,
2238
+ customProfileContent: m,
2176
2239
  customChannelActions: u,
2177
2240
  renderMessage: N
2178
2241
  },
2179
- W.id
2242
+ Y.id
2180
2243
  ) }) : a ? (
2181
2244
  // Show loading while creating/loading direct conversation channel
2182
2245
  /* @__PURE__ */ e(Ne, {})
2183
2246
  ) : /* @__PURE__ */ e(
2184
- Qe,
2247
+ Ke,
2185
2248
  {
2186
2249
  hasChannels: ne,
2187
- channelsLoaded: G
2250
+ channelsLoaded: j
2188
2251
  }
2189
2252
  )
2190
2253
  }
2191
2254
  )
2192
2255
  ] }),
2193
- de && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2256
+ me && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2194
2257
  /* @__PURE__ */ e(
2195
2258
  "dialog",
2196
2259
  {
2197
2260
  ref: te,
2198
2261
  className: "mes-dialog",
2199
- onClick: nt,
2262
+ onClick: at,
2200
2263
  onClose: fe,
2201
2264
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2202
- Us,
2265
+ js,
2203
2266
  {
2204
- participantSource: de,
2205
- onSelectParticipant: st,
2267
+ participantSource: me,
2268
+ onSelectParticipant: nt,
2206
2269
  onClose: fe,
2207
- existingParticipantIds: O,
2270
+ existingParticipantIds: F,
2208
2271
  participantLabel: ue,
2209
2272
  searchPlaceholder: `Search ${ue}...`
2210
2273
  },
@@ -2215,7 +2278,7 @@ const Ws = ({
2215
2278
  ]
2216
2279
  }
2217
2280
  );
2218
- }, Fs = ({
2281
+ }, Hs = ({
2219
2282
  question: t,
2220
2283
  onClick: s,
2221
2284
  loading: n = !1,
@@ -2237,23 +2300,23 @@ const Ws = ({
2237
2300
  ),
2238
2301
  children: t
2239
2302
  }
2240
- ), qs = ({
2303
+ ), en = ({
2241
2304
  faqs: t,
2242
2305
  onFaqClick: s,
2243
2306
  loadingFaqId: n,
2244
2307
  headerText: o,
2245
2308
  className: l,
2246
- avatarImage: m,
2309
+ avatarImage: d,
2247
2310
  avatarName: a
2248
2311
  }) => {
2249
2312
  const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
2250
2313
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2251
- (m || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2314
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2252
2315
  se,
2253
2316
  {
2254
2317
  id: a || "account",
2255
2318
  name: a || "Account",
2256
- image: m,
2319
+ image: d,
2257
2320
  size: 24,
2258
2321
  shape: "circle"
2259
2322
  }
@@ -2266,7 +2329,7 @@ const Ws = ({
2266
2329
  children: [
2267
2330
  o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2268
2331
  c.map((g) => /* @__PURE__ */ e(
2269
- Fs,
2332
+ Hs,
2270
2333
  {
2271
2334
  question: g.question,
2272
2335
  onClick: () => s(g.id),
@@ -2278,18 +2341,18 @@ const Ws = ({
2278
2341
  }
2279
2342
  )
2280
2343
  ] }) });
2281
- }, Ys = (t, s = {}) => {
2282
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = T([]), [a, c] = T(!1), [g, h] = T(null), [b, x] = T(n), [w, r] = T(!0), [y, _] = T(), C = P(async (S = !1, L) => {
2344
+ }, tn = (t, s = {}) => {
2345
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = T([]), [a, c] = T(!1), [g, h] = T(null), [b, x] = T(n), [p, r] = T(!0), [w, _] = T(), C = A(async (S = !1, L) => {
2283
2346
  if (a) return;
2284
- const d = L !== void 0 ? L : b;
2347
+ const m = L !== void 0 ? L : b;
2285
2348
  c(!0), h(null);
2286
2349
  try {
2287
2350
  const u = await t.loadParticipants({
2288
- search: d || void 0,
2351
+ search: m || void 0,
2289
2352
  limit: o,
2290
- cursor: S ? void 0 : y
2353
+ cursor: S ? void 0 : w
2291
2354
  });
2292
- m(
2355
+ d(
2293
2356
  (N) => S ? u.participants : [...N, ...u.participants]
2294
2357
  ), r(u.hasMore), _(u.nextCursor);
2295
2358
  } catch (u) {
@@ -2298,42 +2361,42 @@ const Ws = ({
2298
2361
  } finally {
2299
2362
  c(!1);
2300
2363
  }
2301
- }, [t, b, y, o, a]), M = P(() => {
2302
- w && !a && C(!1);
2303
- }, [w, a, C]), E = P((S) => {
2364
+ }, [t, b, w, o, a]), M = A(() => {
2365
+ p && !a && C(!1);
2366
+ }, [p, a, C]), E = A((S) => {
2304
2367
  x(S), _(void 0), C(!0, S);
2305
- }, [C]), p = P(() => {
2368
+ }, [C]), y = A(() => {
2306
2369
  _(void 0), C(!0);
2307
2370
  }, [C]);
2308
- return X(() => {
2371
+ return K(() => {
2309
2372
  C(!0);
2310
2373
  }, [t.loadParticipants]), {
2311
2374
  participants: l,
2312
2375
  loading: a,
2313
2376
  error: g,
2314
2377
  searchQuery: b,
2315
- hasMore: w,
2378
+ hasMore: p,
2316
2379
  totalCount: t.totalCount,
2317
2380
  loadMore: M,
2318
2381
  search: E,
2319
- refresh: p
2382
+ refresh: y
2320
2383
  };
2321
2384
  };
2322
2385
  export {
2323
2386
  xe as ActionButton,
2324
2387
  se as Avatar,
2325
- Ts as ChannelEmptyState,
2388
+ Os as ChannelEmptyState,
2326
2389
  qe as ChannelList,
2327
- Je as ChannelView,
2328
- qs as FaqList,
2329
- Fs as FaqListItem,
2330
- bs as MessageVoteButtons,
2331
- Hs as MessagingProvider,
2332
- Ws as MessagingShell,
2333
- Us as ParticipantPicker,
2334
- ns as formatRelativeTime,
2335
- fs as useMessageVote,
2336
- Kt as useMessaging,
2337
- Ys as useParticipants
2390
+ Xe as ChannelView,
2391
+ en as FaqList,
2392
+ Hs as FaqListItem,
2393
+ Ns as MessageVoteButtons,
2394
+ Ks as MessagingProvider,
2395
+ Qs as MessagingShell,
2396
+ js as ParticipantPicker,
2397
+ rs as formatRelativeTime,
2398
+ xs as useMessageVote,
2399
+ ts as useMessaging,
2400
+ tn as useParticipants
2338
2401
  };
2339
2402
  //# sourceMappingURL=index.js.map