@linktr.ee/messaging-react 1.12.7 → 1.12.8-rc-1765974383

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 o, Fragment as ve } from "react/jsx-runtime";
2
- import p from "classnames";
3
- import U, { createContext as Pe, useContext as Oe, useCallback as M, useState as y, useRef as z, useEffect as G } from "react";
4
- import { StreamChatService as je } from "@linktr.ee/messaging-core";
5
- import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as we, Window as Xe, MessageList as Ke } from "stream-chat-react";
6
- import { XIcon as me, ArrowUpIcon as es, ArrowLeftIcon as fe, DotsThreeIcon as ge, SpinnerGapIcon as re, SignOutIcon as ss, ProhibitInsetIcon as xe, FlagIcon as ts, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as be } from "stream-chat";
8
- const ye = Pe({
1
+ import { jsx as e, jsxs as i, Fragment as Ne } from "react/jsx-runtime";
2
+ import _ from "classnames";
3
+ import P, { createContext as Be, useContext as $e, useCallback as T, useState as p, useRef as W, useEffect as q, useMemo as we } from "react";
4
+ import { StreamChatService as Ae } from "@linktr.ee/messaging-core";
5
+ import { Chat as je, ChannelList as ze, areMessageUIPropsEqual as Ge, useChatContext as He, useTranslationContext as Ve, useMessageReminder as We, useComponentContext as Ze, Attachment as qe, Avatar as Ye, EditMessageModal as Je, MessageOptions as Qe, MessageBlocked as Xe, MessageBouncePrompt as Ke, MessageDeleted as es, MessageIsThreadReplyInChannelButtonIndicator as ss, MessageRepliesCountButton as ts, MessageStatus as ns, MessageTimestamp as Me, ReactionsList as rs, ReminderNotification as as, StreamedMessageText as ls, messageHasAttachments as os, messageHasReactions as is, isDateSeparatorMessage as cs, isMessageBlocked as ds, isMessageBounced as ms, isMessageEdited as us, MessageBounceModal as hs, Poll as fs, MessageText as gs, MessageErrorIcon as xs, MessageEditedTimestamp as Cs, useMessageContext as Ns, useMessageComposer as bs, useStateStore as vs, MessageInput as ws, useMessageInputContext as ys, useMessageComposerHasSendableData as ps, SimpleAttachmentSelector as Es, QuotedMessagePreview as Is, AttachmentPreviewList as _s, TextareaComposer as Ss, Channel as Ms, useChannelStateContext as ke, WithComponents as ks, Window as Rs, MessageList as Ds } from "stream-chat-react";
6
+ import { XIcon as be, CoinVerticalIcon as Ts, ArrowUpIcon as Fs, StarFourIcon as Ls, ArrowLeftIcon as ye, DotsThreeIcon as pe, SpinnerGapIcon as me, SignOutIcon as Os, ProhibitInsetIcon as Ee, FlagIcon as Ps, MagnifyingGlassIcon as Us, ChatCircleDotsIcon as Ie } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as _e } from "stream-chat";
8
+ const Re = Be({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,49 +15,49 @@ const ye = Pe({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), oe = () => Oe(ye), _s = ({
18
+ }), fe = () => $e(Re), Nt = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
- capabilities: a = {},
24
- debug: i = !1
23
+ capabilities: o = {},
24
+ debug: c = !1
25
25
  }) => {
26
- const l = M(
27
- (u, ...b) => {
28
- i && console.log(`🔥 [MessagingProvider] ${u}`, ...b);
26
+ const a = T(
27
+ (u, ...v) => {
28
+ c && console.log(`🔥 [MessagingProvider] ${u}`, ...v);
29
29
  },
30
- [i]
30
+ [c]
31
31
  );
32
- l("🔄 RENDER START", {
32
+ a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
34
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
- capabilities: Object.keys(a)
36
+ capabilities: Object.keys(o)
37
37
  });
38
- const [m, h] = y(null), [g, w] = y(null), [f, S] = y(!1), [_, v] = y(!1), [c, N] = y(null), E = z(!1), I = z({
38
+ const [h, g] = p(null), [x, w] = p(null), [f, l] = p(!1), [D, y] = p(!1), [d, N] = p(null), E = W(!1), I = W({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
- capabilities: a
43
- }), k = z(0);
44
- k.current++, l("📊 RENDER INFO", {
45
- renderCount: k.current,
42
+ capabilities: o
43
+ }), S = W(0);
44
+ S.current++, a("📊 RENDER INFO", {
45
+ renderCount: S.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
49
  apiKeyChanged: I.current.apiKey !== r,
50
50
  serviceConfigChanged: I.current.serviceConfig !== n,
51
- capabilitiesChanged: I.current.capabilities !== a
51
+ capabilitiesChanged: I.current.capabilities !== o
52
52
  }
53
53
  }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
- capabilities: a
58
- }, G(() => {
59
- const u = k.current;
60
- if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
57
+ capabilities: o
58
+ }, q(() => {
59
+ const u = S.current;
60
+ if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
@@ -68,166 +68,166 @@ const ye = Pe({
68
68
  apiKeyStable: I.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
- l("⚠️ SERVICE INIT SKIPPED", {
71
+ a("⚠️ SERVICE INIT SKIPPED", {
72
72
  renderCount: u,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- l("🚀 CREATING NEW SERVICE", {
77
+ a("🚀 CREATING NEW SERVICE", {
78
78
  renderCount: u,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const b = new je({
82
+ const v = new Ae({
83
83
  ...n,
84
84
  apiKey: r,
85
- debug: i
85
+ debug: c
86
86
  });
87
- return h(b), l("✅ SERVICE SET", {
87
+ return g(v), a("✅ SERVICE SET", {
88
88
  renderCount: u,
89
- serviceInstance: !!b
89
+ serviceInstance: !!v
90
90
  }), () => {
91
- l("🧹 SERVICE CLEANUP", {
91
+ a("🧹 SERVICE CLEANUP", {
92
92
  renderCount: u,
93
93
  reason: "Effect cleanup"
94
- }), b.disconnectUser().catch(console.error);
94
+ }), v.disconnectUser().catch(console.error);
95
95
  };
96
- }, [r, n, i, l]);
97
- const x = z(null);
98
- G(() => {
99
- var b, B;
100
- if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!m,
96
+ }, [r, n, c, a]);
97
+ const C = W(null);
98
+ q(() => {
99
+ var v, j;
100
+ if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
+ hasService: !!h,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
104
  isConnecting: E.current,
105
105
  isConnected: f,
106
- dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
- }), !m || !s) {
108
- l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
106
+ dependencies: { service: !!h, userId: s == null ? void 0 : s.id }
107
+ }), !h || !s) {
108
+ a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
111
  if (E.current) {
112
- l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
112
+ a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((b = x.current) == null ? void 0 : b.serviceId) === m && ((B = x.current) == null ? void 0 : B.userId) === s.id) {
116
- l(
115
+ if (((v = C.current) == null ? void 0 : v.serviceId) === h && ((j = C.current) == null ? void 0 : j.userId) === s.id) {
116
+ a(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
119
119
  );
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- l("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, v(!0), N(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, y(!0), N(null);
124
124
  try {
125
- l("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const j = await m.connectUser(s);
127
- w(j), S(!0), x.current = { serviceId: m, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
125
+ a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
+ const $ = await h.connectUser(s);
127
+ w($), l(!0), C.current = { serviceId: h, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: j.userID
129
+ clientId: $.userID
130
130
  });
131
- } catch (j) {
132
- const W = j instanceof Error ? j.message : "Connection failed";
133
- N(W), l("❌ USER CONNECTION ERROR", {
131
+ } catch ($) {
132
+ const Z = $ instanceof Error ? $.message : "Connection failed";
133
+ N(Z), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: W
135
+ error: Z
136
136
  });
137
137
  } finally {
138
- v(!1), E.current = !1, l("🔄 USER CONNECTION FINISHED", {
138
+ y(!1), E.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [m, s, l, f]), G(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
145
- hasService: !!m,
144
+ }, [h, s, a, f]), q(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!h,
146
146
  isConnected: f
147
147
  }), () => {
148
- m && f ? (l(
148
+ h && f ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), x.current = null, m.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
152
- hasService: !!m,
151
+ ), C.current = null, h.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!h,
153
153
  isConnected: f
154
154
  });
155
- }), [m, f, l]);
156
- const R = M(async () => {
157
- if (l("🔄 REFRESH CONNECTION CALLED", {
158
- hasService: !!m,
155
+ }), [h, f, a]);
156
+ const M = T(async () => {
157
+ if (a("🔄 REFRESH CONNECTION CALLED", {
158
+ hasService: !!h,
159
159
  hasUser: !!s
160
- }), !m || !s) {
161
- l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
160
+ }), !h || !s) {
161
+ a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
165
165
  try {
166
- l("🔌 DISCONNECTING FOR REFRESH"), await m.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
167
- const u = await m.connectUser(s);
168
- w(u), S(!0), N(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
166
+ a("🔌 DISCONNECTING FOR REFRESH"), await h.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
+ const u = await h.connectUser(s);
168
+ w(u), l(!0), N(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
- const b = u instanceof Error ? u.message : "Refresh failed";
171
- N(b), l("❌ CONNECTION REFRESH ERROR", {
170
+ const v = u instanceof Error ? u.message : "Refresh failed";
171
+ N(v), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: b
173
+ error: v
174
174
  });
175
175
  } finally {
176
- v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ y(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [m, s, l]), d = U.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!m,
180
- hasClient: !!g,
178
+ }, [h, s, a]), m = P.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!h,
180
+ hasClient: !!x,
181
181
  isConnected: f,
182
- isLoading: _,
183
- hasError: !!c,
184
- capabilitiesKeys: Object.keys(a)
182
+ isLoading: D,
183
+ hasError: !!d,
184
+ capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
- service: m,
187
- client: g,
186
+ service: h,
187
+ client: x,
188
188
  isConnected: f,
189
- isLoading: _,
190
- error: c,
191
- capabilities: a,
192
- refreshConnection: R,
193
- debug: i
189
+ isLoading: D,
190
+ error: d,
191
+ capabilities: o,
192
+ refreshConnection: M,
193
+ debug: c
194
194
  }), [
195
- m,
196
- g,
195
+ h,
196
+ x,
197
197
  f,
198
- _,
198
+ D,
199
+ d,
200
+ o,
201
+ M,
199
202
  c,
200
- a,
201
- R,
202
- i,
203
- l
203
+ a
204
204
  ]);
205
- return l("🔄 RENDER END", {
206
- renderCount: k.current,
207
- willRenderChat: !!(g && f),
208
- contextValueReady: !!d
209
- }), /* @__PURE__ */ e(ye.Provider, { value: d, children: g && f ? /* @__PURE__ */ e(
210
- Ae,
205
+ return a("🔄 RENDER END", {
206
+ renderCount: S.current,
207
+ willRenderChat: !!(x && f),
208
+ contextValueReady: !!m
209
+ }), /* @__PURE__ */ e(Re.Provider, { value: m, children: x && f ? /* @__PURE__ */ e(
210
+ je,
211
211
  {
212
- client: g,
212
+ client: x,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, rs = () => oe(), ls = (t, s) => {
219
+ }, Bs = () => fe(), $s = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
- ), a = new Date(
222
+ ), o = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
- return Math.floor(a / (1e3 * 60 * 60 * 24));
226
- }, as = (t) => {
225
+ return Math.floor(o / (1e3 * 60 * 60 * 24));
226
+ }, As = (t) => {
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
229
  return "Just now";
230
- const r = ls(t, s);
230
+ const r = $s(t, s);
231
231
  return r === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
@@ -237,7 +237,7 @@ const ye = Pe({
237
237
  day: "numeric",
238
238
  year: "2-digit"
239
239
  });
240
- }, Ce = [
240
+ }, Se = [
241
241
  "🍎",
242
242
  // Apple
243
243
  "🍌",
@@ -265,7 +265,7 @@ const ye = Pe({
265
265
  "🍈"
266
266
  // Melon
267
267
  ];
268
- function os(t) {
268
+ function js(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
271
  const r = t.charCodeAt(n);
@@ -273,29 +273,29 @@ function os(t) {
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
276
- function is(t) {
277
- const n = os(t) % Ce.length;
278
- return Ce[n];
276
+ function zs(t) {
277
+ const n = js(t) % Se.length;
278
+ return Se[n];
279
279
  }
280
- const q = ({
280
+ const ne = ({
281
281
  id: t,
282
282
  image: s,
283
283
  size: n = 40,
284
284
  className: r,
285
- shape: a = "squircle"
285
+ shape: o = "squircle"
286
286
  }) => {
287
- const i = is(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = a === "circle" ? { borderRadius: "50%" } : {
287
+ const c = zs(t), h = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", g = o === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: p("flex-shrink-0 overflow-hidden", r),
294
+ className: _("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
298
- ...h
298
+ ...g
299
299
  },
300
300
  children: s ? /* @__PURE__ */ e(
301
301
  "img",
@@ -308,77 +308,77 @@ const q = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: p(
311
+ className: _(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- m
313
+ h
314
314
  ),
315
- children: i
315
+ children: c
316
316
  }
317
317
  )
318
318
  }
319
319
  );
320
- }, Ee = U.memo(
321
- ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
322
- var N, E, I, k, x, R;
323
- const i = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
320
+ }, De = P.memo(
321
+ ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: o }) => {
322
+ var N, E, I, S, C, M;
323
+ const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
324
324
  t && n(t);
325
- }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
326
- (d) => {
327
- var u, b;
328
- return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
325
+ }, g = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
326
+ (m) => {
327
+ var u, v;
328
+ return ((u = m.user) == null ? void 0 : u.id) && m.user.id !== ((v = t == null ? void 0 : t._client) == null ? void 0 : v.userID);
329
329
  }
330
- ), g = ((E = h == null ? void 0 : h.user) == null ? void 0 : E.name) || "Conversation", w = (I = h == null ? void 0 : h.user) == null ? void 0 : I.image, f = (x = (k = t == null ? void 0 : t.state) == null ? void 0 : k.messages) == null ? void 0 : x[t.state.messages.length - 1], _ = (() => {
330
+ ), x = ((E = g == null ? void 0 : g.user) == null ? void 0 : E.name) || "Conversation", w = (I = g == null ? void 0 : g.user) == null ? void 0 : I.image, f = (C = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : C[t.state.messages.length - 1], D = (() => {
331
331
  var u;
332
332
  if (f != null && f.text) return f.text;
333
- const d = (u = f == null ? void 0 : f.attachments) == null ? void 0 : u[0];
334
- return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "📷 Sent an image" : d.type === "video" ? "🎥 Sent a video" : d.type === "audio" ? "🎵 Sent audio" : d.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
335
- })(), v = f != null && f.created_at ? as(new Date(f.created_at)) : "", c = a ?? 0;
333
+ const m = (u = f == null ? void 0 : f.attachments) == null ? void 0 : u[0];
334
+ return m ? m.og_scrape_url ? m.og_scrape_url : m.type === "image" ? "📷 Sent an image" : m.type === "video" ? "🎥 Sent a video" : m.type === "audio" ? "🎵 Sent audio" : m.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
335
+ })(), y = f != null && f.created_at ? As(new Date(f.created_at)) : "", d = o ?? 0;
336
336
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
337
337
  channelId: t == null ? void 0 : t.id,
338
- isSelected: i,
339
- participantName: g,
340
- unreadCount: c,
341
- hasTimestamp: !!v
338
+ isSelected: c,
339
+ participantName: x,
340
+ unreadCount: d,
341
+ hasTimestamp: !!y
342
342
  }), /* @__PURE__ */ e(
343
343
  "button",
344
344
  {
345
345
  type: "button",
346
- onClick: l,
347
- className: p(
346
+ onClick: a,
347
+ className: _(
348
348
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
349
349
  {
350
- "bg-primary-alt/10 border-l-4 border-l-primary": i,
351
- "hover:bg-sand": !i
350
+ "bg-primary-alt/10 border-l-4 border-l-primary": c,
351
+ "hover:bg-sand": !c
352
352
  }
353
353
  ),
354
- children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
354
+ children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
355
355
  /* @__PURE__ */ e(
356
- q,
356
+ ne,
357
357
  {
358
- id: ((R = h == null ? void 0 : h.user) == null ? void 0 : R.id) || t.id || "unknown",
359
- name: g,
358
+ id: ((M = g == null ? void 0 : g.user) == null ? void 0 : M.id) || t.id || "unknown",
359
+ name: x,
360
360
  image: w,
361
361
  size: 44,
362
362
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
363
363
  }
364
364
  ),
365
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
366
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2", children: [
365
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
366
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
367
367
  /* @__PURE__ */ e(
368
368
  "h3",
369
369
  {
370
- className: p(
370
+ className: _(
371
371
  "text-sm font-medium truncate",
372
- i ? "text-primary" : "text-charcoal"
372
+ c ? "text-primary" : "text-charcoal"
373
373
  ),
374
- children: g
374
+ children: x
375
375
  }
376
376
  ),
377
- v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
377
+ y && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: y })
378
378
  ] }),
379
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
380
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: _ }),
381
- c > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: c > 99 ? "99+" : c })
379
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
380
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: D }),
381
+ d > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: d > 99 ? "99+" : d })
382
382
  ] })
383
383
  ] })
384
384
  ] })
@@ -386,36 +386,36 @@ const q = ({
386
386
  );
387
387
  }
388
388
  );
389
- Ee.displayName = "CustomChannelPreview";
390
- const Ie = U.memo(
389
+ De.displayName = "CustomChannelPreview";
390
+ const Te = P.memo(
391
391
  ({
392
392
  onChannelSelect: t,
393
393
  selectedChannel: s,
394
394
  filters: n,
395
395
  className: r,
396
- customEmptyStateIndicator: a
396
+ customEmptyStateIndicator: o
397
397
  }) => {
398
- const i = U.useRef(0);
399
- i.current++;
400
- const { debug: l = !1 } = oe();
401
- l && console.log("📺 [ChannelList] 🔄 RENDER START", {
402
- renderCount: i.current,
398
+ const c = P.useRef(0);
399
+ c.current++;
400
+ const { debug: a = !1 } = fe();
401
+ a && console.log("📺 [ChannelList] 🔄 RENDER START", {
402
+ renderCount: c.current,
403
403
  selectedChannelId: s == null ? void 0 : s.id,
404
404
  filters: n
405
405
  });
406
- const m = U.useMemo(() => (g) => /* @__PURE__ */ e(
407
- Ee,
406
+ const h = P.useMemo(() => (x) => /* @__PURE__ */ e(
407
+ De,
408
408
  {
409
- ...g,
409
+ ...x,
410
410
  selectedChannel: s,
411
411
  onChannelSelect: t,
412
- debug: l
412
+ debug: a
413
413
  }
414
- ), [s, t, l]);
414
+ ), [s, t, a]);
415
415
  return /* @__PURE__ */ e(
416
416
  "div",
417
417
  {
418
- className: p(
418
+ className: _(
419
419
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
420
420
  r
421
421
  ),
@@ -425,8 +425,8 @@ const Ie = U.memo(
425
425
  filters: n,
426
426
  sort: { last_message_at: -1 },
427
427
  options: { limit: 30 },
428
- Preview: m,
429
- EmptyStateIndicator: a
428
+ Preview: h,
429
+ EmptyStateIndicator: o
430
430
  },
431
431
  JSON.stringify(n)
432
432
  ) })
@@ -434,8 +434,8 @@ const Ie = U.memo(
434
434
  );
435
435
  }
436
436
  );
437
- Ie.displayName = "ChannelList";
438
- const ne = ({
437
+ Te.displayName = "ChannelList";
438
+ const de = ({
439
439
  variant: t = "default",
440
440
  className: s,
441
441
  children: n,
@@ -444,7 +444,7 @@ const ne = ({
444
444
  "button",
445
445
  {
446
446
  type: "button",
447
- className: p(
447
+ className: _(
448
448
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
449
449
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
450
450
  s
@@ -453,12 +453,12 @@ const ne = ({
453
453
  children: n
454
454
  }
455
455
  );
456
- function Se({ label: t, className: s, children: n, ...r }) {
457
- return /* @__PURE__ */ o(
456
+ function Fe({ label: t, className: s, children: n, ...r }) {
457
+ return /* @__PURE__ */ i(
458
458
  "button",
459
459
  {
460
460
  type: "button",
461
- className: p(
461
+ className: _(
462
462
  "rounded-full p-2 transition-colors focus-ring",
463
463
  {
464
464
  "cursor-not-allowed opacity-50": r.disabled,
@@ -474,19 +474,207 @@ function Se({ label: t, className: s, children: n, ...r }) {
474
474
  }
475
475
  );
476
476
  }
477
- function pe({ onClick: t }) {
478
- return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(me, { className: "h-5 w-5 text-stone", weight: "bold" }) });
477
+ function Le({ onClick: t }) {
478
+ return /* @__PURE__ */ e(Fe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(be, { className: "h-5 w-5 text-stone", weight: "bold" }) });
479
479
  }
480
- const cs = (t) => ({
480
+ const Gs = () => /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
481
+ "path",
482
+ {
483
+ d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
484
+ fill: "currentColor"
485
+ }
486
+ ) }), Hs = (t, s) => {
487
+ try {
488
+ const n = t % 1 !== 0;
489
+ return new Intl.NumberFormat(void 0, {
490
+ style: "currency",
491
+ currency: s || "USD",
492
+ minimumFractionDigits: n ? 2 : 0,
493
+ maximumFractionDigits: 2,
494
+ currencyDisplay: "narrowSymbol"
495
+ }).format(t);
496
+ } catch {
497
+ return `${t} ${s}`;
498
+ }
499
+ }, Vs = {
500
+ tip: {
501
+ label: (t, s) => `Sent with ${Hs(t, s)} tip`,
502
+ icon: /* @__PURE__ */ e(Ts, { size: 12 })
503
+ },
504
+ "paid-priority": {
505
+ label: () => "Priority",
506
+ icon: /* @__PURE__ */ e(Gs, {})
507
+ }
508
+ }, Ws = ({ message: t }) => {
509
+ const s = t.tag_type;
510
+ if (!s || s === "tip" && !t.amount)
511
+ return null;
512
+ const n = Vs[s];
513
+ return /* @__PURE__ */ i("div", { className: `message-tag message-tag--${s}`, children: [
514
+ /* @__PURE__ */ e("span", { className: "message-tag__icon", children: n.icon }),
515
+ /* @__PURE__ */ e("span", { className: "message-tag__label", children: n.label(t.amount ?? 0, t.currency ?? "") })
516
+ ] });
517
+ }, Zs = (t) => {
518
+ var L, R;
519
+ const {
520
+ additionalMessageInputProps: s,
521
+ editing: n,
522
+ endOfGroup: r,
523
+ firstOfGroup: o,
524
+ groupedByUser: c,
525
+ handleAction: a,
526
+ handleOpenThread: h,
527
+ handleRetry: g,
528
+ highlighted: x,
529
+ isMessageAIGenerated: w,
530
+ isMyMessage: f,
531
+ message: l,
532
+ onUserClick: D,
533
+ onUserHover: y,
534
+ renderText: d,
535
+ threadList: N
536
+ } = t, { client: E } = He("CustomMessage"), { t: I } = Ve("CustomMessage"), [S, C] = p(!1), [M, m] = p(!1), u = We(l.id), {
537
+ Attachment: v = qe,
538
+ Avatar: j = Ye,
539
+ EditMessageModal: $ = Je,
540
+ MessageOptions: Z = Qe,
541
+ MessageActions: Y = Z,
542
+ MessageBlocked: re = Xe,
543
+ MessageBouncePrompt: ee = Ke,
544
+ MessageDeleted: se = es,
545
+ MessageIsThreadReplyInChannelButtonIndicator: ae = ss,
546
+ MessageRepliesCountButton: U = ts,
547
+ MessageStatus: G = ns,
548
+ MessageTimestamp: J = Me,
549
+ ReactionsList: z = rs,
550
+ ReminderNotification: k = as,
551
+ StreamedMessageText: F = ls,
552
+ PinIndicator: B
553
+ } = Ze("CustomMessage"), H = os(l), Q = is(l), X = we(
554
+ () => w == null ? void 0 : w(l),
555
+ [w, l]
556
+ ), A = we(
557
+ () => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
558
+ [l]
559
+ );
560
+ if (cs(l))
561
+ return null;
562
+ if (l.deleted_at || l.type === "deleted")
563
+ return /* @__PURE__ */ e(se, { message: l });
564
+ if (ds(l))
565
+ return /* @__PURE__ */ e(re, {});
566
+ const ge = !c || r, oe = !N && !!l.reply_count, ie = !N && l.show_in_channel && l.parent_id, K = l.status === "failed" && ((L = l.error) == null ? void 0 : L.status) !== 403, ce = ms(l), le = us(l) && !X;
567
+ let V;
568
+ K ? V = () => g(l) : ce ? V = () => C(!0) : le && (V = () => m((O) => !O));
569
+ const te = _(
570
+ "str-chat__message str-chat__message-simple",
571
+ `str-chat__message--${l.type}`,
572
+ `str-chat__message--${l.status}`,
573
+ f() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
574
+ l.text ? "str-chat__message--has-text" : "has-no-text",
575
+ {
576
+ "str-chat__message--has-attachment": H,
577
+ "str-chat__message--highlighted": x,
578
+ "str-chat__message--pinned pinned-message": l.pinned,
579
+ "str-chat__message--with-reactions": Q,
580
+ "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((R = l == null ? void 0 : l.error) == null ? void 0 : R.status) !== 403,
581
+ "str-chat__message-with-thread-link": oe || ie,
582
+ "str-chat__virtual-message__wrapper--end": r,
583
+ "str-chat__virtual-message__wrapper--first": o,
584
+ "str-chat__virtual-message__wrapper--group": c
585
+ }
586
+ ), b = l.poll_id && E.polls.fromState(l.poll_id);
587
+ return /* @__PURE__ */ i(Ne, { children: [
588
+ n && /* @__PURE__ */ e(
589
+ $,
590
+ {
591
+ additionalMessageInputProps: s
592
+ }
593
+ ),
594
+ S && /* @__PURE__ */ e(
595
+ hs,
596
+ {
597
+ MessageBouncePrompt: ee,
598
+ onClose: () => C(!1),
599
+ open: S
600
+ }
601
+ ),
602
+ /* @__PURE__ */ i("div", { className: te, children: [
603
+ B && /* @__PURE__ */ e(B, {}),
604
+ !!u && /* @__PURE__ */ e(k, { reminder: u }),
605
+ l.user && /* @__PURE__ */ e(
606
+ j,
607
+ {
608
+ image: l.user.image,
609
+ name: l.user.name || l.user.id,
610
+ onClick: D,
611
+ onMouseOver: y,
612
+ user: l.user
613
+ }
614
+ ),
615
+ /* @__PURE__ */ i(
616
+ "div",
617
+ {
618
+ className: _("str-chat__message-inner", {
619
+ "str-chat__simple-message--error-failed": K || ce
620
+ }),
621
+ "data-testid": "message-inner",
622
+ onClick: V,
623
+ onKeyDown: V,
624
+ role: V ? "button" : void 0,
625
+ tabIndex: V ? 0 : void 0,
626
+ children: [
627
+ /* @__PURE__ */ e(Y, {}),
628
+ /* @__PURE__ */ e("div", { className: "str-chat__message-reactions-host", children: Q && /* @__PURE__ */ e(z, { reverse: !0 }) }),
629
+ /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
630
+ b && /* @__PURE__ */ e(fs, { poll: b }),
631
+ A != null && A.length && !l.quoted_message ? /* @__PURE__ */ e(
632
+ v,
633
+ {
634
+ actionHandler: a,
635
+ attachments: A
636
+ }
637
+ ) : null,
638
+ /* @__PURE__ */ e(Ws, { message: l }),
639
+ X ? /* @__PURE__ */ e(F, { message: l, renderText: d }) : /* @__PURE__ */ e(gs, { message: l, renderText: d }),
640
+ /* @__PURE__ */ e(xs, {})
641
+ ] })
642
+ ]
643
+ }
644
+ ),
645
+ oe && /* @__PURE__ */ e(
646
+ U,
647
+ {
648
+ onClick: h,
649
+ reply_count: l.reply_count
650
+ }
651
+ ),
652
+ ie && /* @__PURE__ */ e(ae, {}),
653
+ ge && /* @__PURE__ */ i("div", { className: "str-chat__message-metadata", children: [
654
+ /* @__PURE__ */ e(G, {}),
655
+ !f() && !!l.user && /* @__PURE__ */ e("span", { className: "str-chat__message-simple-name", children: l.user.name || l.user.id }),
656
+ /* @__PURE__ */ e(J, { customClass: "str-chat__message-simple-timestamp" }),
657
+ le && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: I("Edited") }),
658
+ le && /* @__PURE__ */ e(Cs, { calendar: !0, open: M })
659
+ ] })
660
+ ] }, l.id)
661
+ ] });
662
+ }, qs = P.memo(
663
+ Zs,
664
+ Ge
665
+ ), Ys = (t) => {
666
+ const s = Ns("CustomMessage");
667
+ return /* @__PURE__ */ e(qs, { ...s, ...t });
668
+ }, Js = (t) => ({
481
669
  linkPreviews: Array.from(t.previews.values()).filter(
482
- (s) => be.previewIsLoaded(s) || be.previewIsLoading(s)
670
+ (s) => _e.previewIsLoaded(s) || _e.previewIsLoading(s)
483
671
  )
484
- }), ds = ({
672
+ }), Qs = ({
485
673
  link: t,
486
674
  onDismiss: s
487
675
  }) => {
488
- const { og_scrape_url: n, title: r, image_url: a } = t;
489
- return /* @__PURE__ */ o(
676
+ const { og_scrape_url: n, title: r, image_url: o } = t;
677
+ return /* @__PURE__ */ i(
490
678
  "a",
491
679
  {
492
680
  href: n,
@@ -494,10 +682,10 @@ const cs = (t) => ({
494
682
  rel: "noopener noreferrer",
495
683
  className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
496
684
  children: [
497
- a && /* @__PURE__ */ e(
685
+ o && /* @__PURE__ */ e(
498
686
  "img",
499
687
  {
500
- src: a,
688
+ src: o,
501
689
  alt: r || "",
502
690
  className: "h-[148px] w-full rounded-[20px] object-cover"
503
691
  }
@@ -506,47 +694,47 @@ const cs = (t) => ({
506
694
  "button",
507
695
  {
508
696
  type: "button",
509
- onClick: (l) => {
510
- l.preventDefault(), s(n);
697
+ onClick: (a) => {
698
+ a.preventDefault(), s(n);
511
699
  },
512
700
  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",
513
701
  "aria-label": "Close link preview",
514
- children: /* @__PURE__ */ e(me, { className: "size-4 text-black/90" })
702
+ children: /* @__PURE__ */ e(be, { className: "size-4 text-black/90" })
515
703
  }
516
704
  ),
517
- /* @__PURE__ */ o("div", { className: "p-2", children: [
705
+ /* @__PURE__ */ i("div", { className: "p-2", children: [
518
706
  r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
519
707
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
520
708
  ] })
521
709
  ]
522
710
  }
523
711
  );
524
- }, us = () => {
525
- const { linkPreviewsManager: t } = Be(), { linkPreviews: s } = $e(
712
+ }, Xs = () => {
713
+ const { linkPreviewsManager: t } = bs(), { linkPreviews: s } = vs(
526
714
  t.state,
527
- cs
528
- ), n = (a) => {
529
- t.dismissPreview(a);
715
+ Js
716
+ ), n = (o) => {
717
+ t.dismissPreview(o);
530
718
  };
531
- return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((a) => /* @__PURE__ */ e(
532
- ds,
719
+ return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
720
+ Qs,
533
721
  {
534
- link: a,
722
+ link: o,
535
723
  onDismiss: n
536
724
  },
537
- a.og_scrape_url
725
+ o.og_scrape_url
538
726
  )) }) : null;
539
- }, ms = () => {
540
- const { handleSubmit: t } = He(), s = Ve();
541
- return /* @__PURE__ */ o(ve, { children: [
542
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(We, {}) }),
543
- /* @__PURE__ */ o("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: [
544
- /* @__PURE__ */ e(Ze, {}),
545
- /* @__PURE__ */ e(us, {}),
546
- /* @__PURE__ */ e(qe, {}),
547
- /* @__PURE__ */ o("div", { className: "flex", children: [
727
+ }, Ks = () => {
728
+ const { handleSubmit: t } = ys(), s = ps();
729
+ return /* @__PURE__ */ i(Ne, { children: [
730
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Es, {}) }),
731
+ /* @__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: [
732
+ /* @__PURE__ */ e(Is, {}),
733
+ /* @__PURE__ */ e(Xs, {}),
734
+ /* @__PURE__ */ e(_s, {}),
735
+ /* @__PURE__ */ i("div", { className: "flex", children: [
548
736
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
549
- Ye,
737
+ Ss,
550
738
  {
551
739
  className: "w-full resize-none outline-none leading-6",
552
740
  maxRows: 4
@@ -561,33 +749,43 @@ const cs = (t) => ({
561
749
  disabled: !s,
562
750
  onClick: t,
563
751
  type: "button",
564
- children: /* @__PURE__ */ e(es, { className: "size-4" })
752
+ children: /* @__PURE__ */ e(Fs, { className: "size-4" })
565
753
  }
566
754
  )
567
755
  ] })
568
756
  ] })
569
757
  ] });
570
- }, hs = ({
758
+ }, et = ({
571
759
  renderActions: t
572
- }) => /* @__PURE__ */ o("div", { className: "message-input flex items-center gap-2 p-4", children: [
760
+ }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
573
761
  t && (t == null ? void 0 : t()),
574
- /* @__PURE__ */ e(Ge, { Input: ms })
575
- ] }), fs = (t) => {
576
- const s = t.message.hide_date === !0;
577
- return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
578
- /* @__PURE__ */ o("div", { className: "str-chat__message--system__text", children: [
579
- /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
580
- /* @__PURE__ */ e("p", { children: t.message.text }),
581
- /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
582
- ] }),
583
- !s && /* @__PURE__ */ e(Je, { message: t.message })
584
- ] });
585
- }, gs = () => null, xs = ({ className: t, message: s }) => /* @__PURE__ */ o(
762
+ /* @__PURE__ */ e(ws, { Input: Ks })
763
+ ] }), st = (t) => {
764
+ const s = t.message.hide_date === !0, n = t.message.system_type === "priority";
765
+ return /* @__PURE__ */ i(
766
+ "div",
767
+ {
768
+ className: _("str-chat__message--system", {
769
+ "str-chat__message--system--priority": n
770
+ }),
771
+ "data-testid": "message-system",
772
+ children: [
773
+ n && /* @__PURE__ */ e(Ls, { size: 18, className: "mx-auto mb-2 mt-3" }),
774
+ /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
775
+ /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
776
+ /* @__PURE__ */ e("p", { children: t.message.text }),
777
+ /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
778
+ ] }),
779
+ !s && /* @__PURE__ */ e(Me, { message: t.message })
780
+ ]
781
+ }
782
+ );
783
+ }, tt = () => null, nt = ({ className: t, message: s }) => /* @__PURE__ */ i(
586
784
  "div",
587
785
  {
588
- className: p("flex items-center justify-center h-full", t),
786
+ className: _("flex items-center justify-center h-full", t),
589
787
  children: [
590
- /* @__PURE__ */ o("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
788
+ /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
591
789
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
592
790
  "animateTransform",
593
791
  {
@@ -625,25 +823,25 @@ const cs = (t) => ({
625
823
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
626
824
  ]
627
825
  }
628
- ), ae = U.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ o("div", { className: "flex items-center", children: [
629
- /* @__PURE__ */ e(xs, { className: "w-6 h-6" }),
826
+ ), he = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
827
+ /* @__PURE__ */ e(nt, { className: "w-6 h-6" }),
630
828
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
631
829
  ] }) }));
632
- ae.displayName = "LoadingState";
633
- const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
634
- var h, g, w, f, S;
635
- const { channel: a } = we(), i = U.useMemo(() => Object.values(a.state.members || {}).find(
636
- (v) => {
637
- var c;
638
- return ((c = v.user) == null ? void 0 : c.id) && v.user.id !== a._client.userID;
830
+ he.displayName = "LoadingState";
831
+ const rt = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
832
+ var g, x, w, f, l;
833
+ const { channel: o } = ke(), c = P.useMemo(() => Object.values(o.state.members || {}).find(
834
+ (y) => {
835
+ var d;
836
+ return ((d = y.user) == null ? void 0 : d.id) && y.user.id !== o._client.userID;
639
837
  }
640
- ), [a._client.userID, a.state.members]), l = ((h = i == null ? void 0 : i.user) == null ? void 0 : h.name) || ((g = i == null ? void 0 : i.user) == null ? void 0 : g.id) || "Unknown member", m = (w = i == null ? void 0 : i.user) == null ? void 0 : w.image;
641
- return /* @__PURE__ */ o("div", { className: "@container", children: [
642
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center @lg:hidden", children: [
838
+ ), [o._client.userID, o.state.members]), a = ((g = c == null ? void 0 : c.user) == null ? void 0 : g.name) || ((x = c == null ? void 0 : c.user) == null ? void 0 : x.id) || "Unknown member", h = (w = c == null ? void 0 : c.user) == null ? void 0 : w.image;
839
+ return /* @__PURE__ */ i("div", { className: "@container", children: [
840
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
643
841
  /* @__PURE__ */ e(
644
842
  "button",
645
843
  {
646
- className: p(
844
+ className: _(
647
845
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
648
846
  !s && "invisible"
649
847
  ),
@@ -651,36 +849,36 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
651
849
  }),
652
850
  type: "button",
653
851
  "aria-label": "Back to conversations",
654
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
852
+ children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
655
853
  }
656
854
  ),
657
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-1 items-center", children: [
855
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
658
856
  /* @__PURE__ */ e(
659
- q,
857
+ ne,
660
858
  {
661
- id: ((f = i == null ? void 0 : i.user) == null ? void 0 : f.id) || a.id || "unknown",
662
- name: l,
663
- image: m,
859
+ id: ((f = c == null ? void 0 : c.user) == null ? void 0 : f.id) || o.id || "unknown",
860
+ name: a,
861
+ image: h,
664
862
  size: 40
665
863
  }
666
864
  ),
667
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: l })
865
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
668
866
  ] }),
669
867
  /* @__PURE__ */ e(
670
868
  "button",
671
869
  {
672
- className: p(
870
+ className: _(
673
871
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
674
872
  ),
675
873
  onClick: n,
676
874
  type: "button",
677
875
  "aria-label": "Show info",
678
- children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
876
+ children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
679
877
  }
680
878
  )
681
879
  ] }),
682
- /* @__PURE__ */ o("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
683
- /* @__PURE__ */ o("div", { className: "flex items-center gap-4 min-w-0", children: [
880
+ /* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
881
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
684
882
  s && t && /* @__PURE__ */ e(
685
883
  "button",
686
884
  {
@@ -688,100 +886,100 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
688
886
  onClick: t,
689
887
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
690
888
  "aria-label": "Back to conversations",
691
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
889
+ children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
692
890
  }
693
891
  ),
694
892
  /* @__PURE__ */ e(
695
- q,
893
+ ne,
696
894
  {
697
- id: ((S = i == null ? void 0 : i.user) == null ? void 0 : S.id) || a.id || "unknown",
698
- name: l,
699
- image: m,
895
+ id: ((l = c == null ? void 0 : c.user) == null ? void 0 : l.id) || o.id || "unknown",
896
+ name: a,
897
+ image: h,
700
898
  size: 40
701
899
  }
702
900
  ),
703
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: l }) })
901
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
704
902
  ] }),
705
903
  r && n && /* @__PURE__ */ e(
706
904
  "button",
707
905
  {
708
- className: p(
906
+ className: _(
709
907
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
710
908
  ),
711
909
  onClick: n,
712
- children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
910
+ children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
713
911
  }
714
912
  )
715
913
  ] })
716
914
  ] });
717
- }, bs = ({
915
+ }, at = ({
718
916
  dialogRef: t,
719
917
  onClose: s,
720
918
  participant: n,
721
919
  channel: r,
722
- followerStatusLabel: a,
723
- onLeaveConversation: i,
724
- onBlockParticipant: l,
725
- showDeleteConversation: m = !0,
726
- onDeleteConversationClick: h,
727
- onBlockParticipantClick: g,
920
+ followerStatusLabel: o,
921
+ onLeaveConversation: c,
922
+ onBlockParticipant: a,
923
+ showDeleteConversation: h = !0,
924
+ onDeleteConversationClick: g,
925
+ onBlockParticipantClick: x,
728
926
  onReportParticipantClick: w
729
927
  }) => {
730
- var Q, X, ce, O, H, J, $;
731
- const { service: f, debug: S } = oe(), [_, v] = y(!1), [c, N] = y(!1), [E, I] = y(!1), k = M(async () => {
732
- var D;
733
- if (!(!f || !((D = n == null ? void 0 : n.user) != null && D.id)))
928
+ var ee, se, ae, U, G, J, z;
929
+ const { service: f, debug: l } = fe(), [D, y] = p(!1), [d, N] = p(!1), [E, I] = p(!1), S = T(async () => {
930
+ var k;
931
+ if (!(!f || !((k = n == null ? void 0 : n.user) != null && k.id)))
734
932
  try {
735
- const A = (await f.getBlockedUsers()).some(
736
- (V) => {
737
- var K;
738
- return V.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
933
+ const B = (await f.getBlockedUsers()).some(
934
+ (H) => {
935
+ var Q;
936
+ return H.blocked_user_id === ((Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id);
739
937
  }
740
938
  );
741
- v(A);
742
- } catch (T) {
939
+ y(B);
940
+ } catch (F) {
743
941
  console.error(
744
942
  "[ChannelInfoDialog] Failed to check blocked status:",
745
- T
943
+ F
746
944
  );
747
945
  }
748
- }, [f, (Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id]);
749
- G(() => {
750
- k();
751
- }, [k]);
752
- const x = async () => {
753
- var D;
754
- if (!c) {
755
- h == null || h(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
946
+ }, [f, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
947
+ q(() => {
948
+ S();
949
+ }, [S]);
950
+ const C = async () => {
951
+ var k;
952
+ if (!d) {
953
+ g == null || g(), l && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
756
954
  try {
757
- const T = ((D = r._client) == null ? void 0 : D.userID) ?? null;
758
- await r.hide(T, !1), i && await i(r), s();
759
- } catch (T) {
760
- console.error("[ChannelInfoDialog] Failed to leave conversation", T);
955
+ const F = ((k = r._client) == null ? void 0 : k.userID) ?? null;
956
+ await r.hide(F, !1), c && await c(r), s();
957
+ } catch (F) {
958
+ console.error("[ChannelInfoDialog] Failed to leave conversation", F);
761
959
  } finally {
762
960
  N(!1);
763
961
  }
764
962
  }
765
- }, R = async () => {
766
- var D, T, A;
963
+ }, M = async () => {
964
+ var k, F, B;
767
965
  if (!(E || !f)) {
768
- g == null || g(), S && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), I(!0);
966
+ x == null || x(), l && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), I(!0);
769
967
  try {
770
- await f.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
771
- } catch (V) {
772
- console.error("[ChannelInfoDialog] Failed to block member", V);
968
+ await f.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
969
+ } catch (H) {
970
+ console.error("[ChannelInfoDialog] Failed to block member", H);
773
971
  } finally {
774
972
  I(!1);
775
973
  }
776
974
  }
777
- }, d = async () => {
778
- var D, T, A;
975
+ }, m = async () => {
976
+ var k, F, B;
779
977
  if (!(E || !f)) {
780
- g == null || g(), S && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), I(!0);
978
+ x == null || x(), l && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), I(!0);
781
979
  try {
782
- await f.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
783
- } catch (V) {
784
- console.error("[ChannelInfoDialog] Failed to unblock member", V);
980
+ await f.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
981
+ } catch (H) {
982
+ console.error("[ChannelInfoDialog] Failed to unblock member", H);
785
983
  } finally {
786
984
  I(!1);
787
985
  }
@@ -794,7 +992,7 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
794
992
  );
795
993
  };
796
994
  if (!n) return null;
797
- const b = ((X = n.user) == null ? void 0 : X.name) || ((ce = n.user) == null ? void 0 : ce.id) || "Unknown member", B = (O = n.user) == null ? void 0 : O.image, j = (H = n.user) == null ? void 0 : H.email, W = (J = n.user) == null ? void 0 : J.username, Y = j || (W ? `linktr.ee/${W}` : void 0), ie = (($ = n.user) == null ? void 0 : $.id) || "unknown";
995
+ const v = ((se = n.user) == null ? void 0 : se.name) || ((ae = n.user) == null ? void 0 : ae.id) || "Unknown member", j = (U = n.user) == null ? void 0 : U.image, $ = (G = n.user) == null ? void 0 : G.email, Z = (J = n.user) == null ? void 0 : J.username, Y = $ || (Z ? `linktr.ee/${Z}` : void 0), re = ((z = n.user) == null ? void 0 : z.id) || "unknown";
798
996
  return (
799
997
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
800
998
  /* @__PURE__ */ e(
@@ -803,90 +1001,90 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
803
1001
  ref: t,
804
1002
  className: "mes-dialog group",
805
1003
  onClose: s,
806
- onClick: (D) => {
807
- D.target === t.current && s();
1004
+ onClick: (k) => {
1005
+ k.target === t.current && s();
808
1006
  },
809
- children: /* @__PURE__ */ o("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: [
810
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1007
+ 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: [
1008
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
811
1009
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
812
- /* @__PURE__ */ e(pe, { onClick: s })
1010
+ /* @__PURE__ */ e(Le, { onClick: s })
813
1011
  ] }),
814
- /* @__PURE__ */ o("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1012
+ /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
815
1013
  /* @__PURE__ */ e(
816
1014
  "div",
817
1015
  {
818
1016
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
819
1017
  style: { backgroundColor: "#FBFAF9" },
820
- children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3 w-full", children: [
1018
+ children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
821
1019
  /* @__PURE__ */ e(
822
- q,
1020
+ ne,
823
1021
  {
824
- id: ie,
825
- name: b,
826
- image: B,
1022
+ id: re,
1023
+ name: v,
1024
+ image: j,
827
1025
  size: 88,
828
1026
  shape: "circle"
829
1027
  }
830
1028
  ),
831
- /* @__PURE__ */ o("div", { className: "flex flex-col min-w-0 flex-1", children: [
832
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: b }),
1029
+ /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1030
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
833
1031
  Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
834
- a && /* @__PURE__ */ e(
1032
+ o && /* @__PURE__ */ e(
835
1033
  "span",
836
1034
  {
837
1035
  className: "mt-1 rounded-full text-xs font-normal w-fit",
838
1036
  style: {
839
1037
  padding: "4px 8px",
840
- backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
841
- color: a === "Subscribed to you" ? "#008236" : "#78716C",
1038
+ backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1039
+ color: o === "Subscribed to you" ? "#008236" : "#78716C",
842
1040
  lineHeight: "133.333%",
843
1041
  letterSpacing: "0.21px"
844
1042
  },
845
- children: a
1043
+ children: o
846
1044
  }
847
1045
  )
848
1046
  ] })
849
1047
  ] })
850
1048
  }
851
1049
  ),
852
- /* @__PURE__ */ o("ul", { className: "flex flex-col gap-2 mt-2", children: [
853
- m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
854
- ne,
1050
+ /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
1051
+ h && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1052
+ de,
855
1053
  {
856
- onClick: x,
857
- disabled: c,
858
- "aria-busy": c,
1054
+ onClick: C,
1055
+ disabled: d,
1056
+ "aria-busy": d,
859
1057
  children: [
860
- c ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
1058
+ d ? /* @__PURE__ */ e(me, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Os, { className: "h-5 w-5" }),
861
1059
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
862
1060
  ]
863
1061
  }
864
1062
  ) }),
865
- /* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ o(
866
- ne,
1063
+ /* @__PURE__ */ e("li", { children: D ? /* @__PURE__ */ i(
1064
+ de,
867
1065
  {
868
- onClick: d,
1066
+ onClick: m,
869
1067
  disabled: E,
870
1068
  "aria-busy": E,
871
1069
  children: [
872
- E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
1070
+ E ? /* @__PURE__ */ e(me, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ee, { className: "h-5 w-5" }),
873
1071
  /* @__PURE__ */ e("span", { children: "Unblock" })
874
1072
  ]
875
1073
  }
876
- ) : /* @__PURE__ */ o(
877
- ne,
1074
+ ) : /* @__PURE__ */ i(
1075
+ de,
878
1076
  {
879
- onClick: R,
1077
+ onClick: M,
880
1078
  disabled: E,
881
1079
  "aria-busy": E,
882
1080
  children: [
883
- E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
1081
+ E ? /* @__PURE__ */ e(me, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ee, { className: "h-5 w-5" }),
884
1082
  /* @__PURE__ */ e("span", { children: "Block" })
885
1083
  ]
886
1084
  }
887
1085
  ) }),
888
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(ne, { variant: "danger", onClick: u, children: [
889
- /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
1086
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: u, children: [
1087
+ /* @__PURE__ */ e(Ps, { className: "h-5 w-5" }),
890
1088
  /* @__PURE__ */ e("span", { children: "Report" })
891
1089
  ] }) })
892
1090
  ] })
@@ -895,117 +1093,125 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
895
1093
  }
896
1094
  )
897
1095
  );
898
- }, Cs = ({
1096
+ }, lt = ({
899
1097
  onBack: t,
900
1098
  showBackButton: s,
901
1099
  renderMessageInputActions: n,
902
1100
  onLeaveConversation: r,
903
- onBlockParticipant: a,
904
- showDeleteConversation: i = !0,
905
- onDeleteConversationClick: l,
906
- onBlockParticipantClick: m,
907
- onReportParticipantClick: h
1101
+ onBlockParticipant: o,
1102
+ showDeleteConversation: c = !0,
1103
+ onDeleteConversationClick: a,
1104
+ onBlockParticipantClick: h,
1105
+ onReportParticipantClick: g
908
1106
  }) => {
909
- const { channel: g } = we(), w = z(null), f = U.useMemo(() => Object.values(g.state.members || {}).find(
1107
+ const { channel: x } = ke(), w = W(null), f = P.useMemo(() => Object.values(x.state.members || {}).find(
910
1108
  (N) => {
911
1109
  var E;
912
- return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
1110
+ return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== x._client.userID;
913
1111
  }
914
- ), [g._client.userID, g.state.members]), S = U.useMemo(() => {
915
- const c = g.data ?? {};
916
- if (c.followerStatus)
917
- return String(c.followerStatus);
918
- if (c.isFollower !== void 0)
919
- return c.isFollower ? "Subscribed to you" : "Not subscribed";
920
- }, [g.data]), _ = M(() => {
921
- var c;
922
- (c = w.current) == null || c.showModal();
923
- }, []), v = M(() => {
924
- var c;
925
- (c = w.current) == null || c.close();
1112
+ ), [x._client.userID, x.state.members]), l = P.useMemo(() => {
1113
+ const d = x.data ?? {};
1114
+ if (d.followerStatus)
1115
+ return String(d.followerStatus);
1116
+ if (d.isFollower !== void 0)
1117
+ return d.isFollower ? "Subscribed to you" : "Not subscribed";
1118
+ }, [x.data]), D = T(() => {
1119
+ var d;
1120
+ (d = w.current) == null || d.showModal();
1121
+ }, []), y = T(() => {
1122
+ var d;
1123
+ (d = w.current) == null || d.close();
926
1124
  }, []);
927
- return /* @__PURE__ */ o(ve, { children: [
928
- /* @__PURE__ */ o(Xe, { children: [
929
- /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
930
- Ns,
931
- {
932
- onBack: t,
933
- showBackButton: s,
934
- onShowInfo: _,
935
- canShowInfo: !!f
936
- }
937
- ) }),
938
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
939
- Ke,
940
- {
941
- hideDeletedMessages: !0,
942
- hideNewMessageSeparator: !1,
943
- messageActions: []
944
- }
945
- ) }),
946
- /* @__PURE__ */ e(
947
- hs,
948
- {
949
- renderActions: () => n == null ? void 0 : n(g)
950
- }
951
- )
952
- ] }),
1125
+ return /* @__PURE__ */ i(Ne, { children: [
953
1126
  /* @__PURE__ */ e(
954
- bs,
1127
+ ks,
1128
+ {
1129
+ overrides: {
1130
+ Message: (d) => /* @__PURE__ */ e(Ys, { ...d })
1131
+ },
1132
+ children: /* @__PURE__ */ i(Rs, { children: [
1133
+ /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1134
+ rt,
1135
+ {
1136
+ onBack: t,
1137
+ showBackButton: s,
1138
+ onShowInfo: D,
1139
+ canShowInfo: !!f
1140
+ }
1141
+ ) }),
1142
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1143
+ Ds,
1144
+ {
1145
+ hideDeletedMessages: !0,
1146
+ hideNewMessageSeparator: !1,
1147
+ messageActions: void 0
1148
+ }
1149
+ ) }),
1150
+ /* @__PURE__ */ e(
1151
+ et,
1152
+ {
1153
+ renderActions: () => n == null ? void 0 : n(x)
1154
+ }
1155
+ )
1156
+ ] })
1157
+ }
1158
+ ),
1159
+ /* @__PURE__ */ e(
1160
+ at,
955
1161
  {
956
1162
  dialogRef: w,
957
- onClose: v,
1163
+ onClose: y,
958
1164
  participant: f,
959
- channel: g,
960
- followerStatusLabel: S,
1165
+ channel: x,
1166
+ followerStatusLabel: l,
961
1167
  onLeaveConversation: r,
962
- onBlockParticipant: a,
963
- showDeleteConversation: i,
964
- onDeleteConversationClick: l,
965
- onBlockParticipantClick: m,
966
- onReportParticipantClick: h
1168
+ onBlockParticipant: o,
1169
+ showDeleteConversation: c,
1170
+ onDeleteConversationClick: a,
1171
+ onBlockParticipantClick: h,
1172
+ onReportParticipantClick: g
967
1173
  }
968
1174
  )
969
1175
  ] });
970
- }, ke = U.memo(
1176
+ }, Oe = P.memo(
971
1177
  ({
972
1178
  channel: t,
973
1179
  onBack: s,
974
1180
  showBackButton: n = !1,
975
1181
  renderMessageInputActions: r,
976
- onLeaveConversation: a,
977
- onBlockParticipant: i,
978
- className: l,
979
- CustomChannelEmptyState: m = gs,
980
- showDeleteConversation: h = !0,
981
- onDeleteConversationClick: g,
1182
+ onLeaveConversation: o,
1183
+ onBlockParticipant: c,
1184
+ className: a,
1185
+ CustomChannelEmptyState: h = tt,
1186
+ showDeleteConversation: g = !0,
1187
+ onDeleteConversationClick: x,
982
1188
  onBlockParticipantClick: w,
983
1189
  onReportParticipantClick: f
984
1190
  }) => /* @__PURE__ */ e(
985
1191
  "div",
986
1192
  {
987
- className: p(
1193
+ className: _(
988
1194
  "messaging-channel-view h-full flex flex-col",
989
- l
1195
+ a
990
1196
  ),
991
1197
  children: /* @__PURE__ */ e(
992
- Qe,
1198
+ Ms,
993
1199
  {
994
1200
  channel: t,
995
- MessageSystem: fs,
996
- EmptyStateIndicator: m,
997
- LoadingIndicator: ae,
1201
+ MessageSystem: st,
1202
+ EmptyStateIndicator: h,
1203
+ LoadingIndicator: he,
998
1204
  children: /* @__PURE__ */ e(
999
- Cs,
1205
+ lt,
1000
1206
  {
1001
1207
  onBack: s,
1002
1208
  showBackButton: n,
1003
1209
  renderMessageInputActions: r,
1004
- onLeaveConversation: a,
1005
- onBlockParticipant: i,
1006
- CustomChannelEmptyState: m,
1007
- showDeleteConversation: h,
1008
- onDeleteConversationClick: g,
1210
+ onLeaveConversation: o,
1211
+ onBlockParticipant: c,
1212
+ CustomChannelEmptyState: h,
1213
+ showDeleteConversation: g,
1214
+ onDeleteConversationClick: x,
1009
1215
  onBlockParticipantClick: w,
1010
1216
  onReportParticipantClick: f
1011
1217
  }
@@ -1015,16 +1221,16 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1015
1221
  }
1016
1222
  )
1017
1223
  );
1018
- ke.displayName = "ChannelView";
1019
- function vs({
1224
+ Oe.displayName = "ChannelView";
1225
+ function ot({
1020
1226
  searchQuery: t,
1021
1227
  setSearchQuery: s,
1022
1228
  placeholder: n
1023
1229
  }) {
1024
- const r = z(null);
1025
- return /* @__PURE__ */ o("div", { className: "relative", children: [
1230
+ const r = W(null);
1231
+ return /* @__PURE__ */ i("div", { className: "relative", children: [
1026
1232
  /* @__PURE__ */ e(
1027
- ns,
1233
+ Us,
1028
1234
  {
1029
1235
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1030
1236
  weight: "bold"
@@ -1037,162 +1243,162 @@ function vs({
1037
1243
  type: "text",
1038
1244
  placeholder: n,
1039
1245
  value: t,
1040
- onChange: (a) => s(a.target.value),
1246
+ onChange: (o) => s(o.target.value),
1041
1247
  className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
1042
1248
  }
1043
1249
  ),
1044
1250
  t && /* @__PURE__ */ e(
1045
- Se,
1251
+ Fe,
1046
1252
  {
1047
1253
  label: "Clear search",
1048
1254
  onClick: () => {
1049
- var a;
1050
- s(""), (a = r.current) == null || a.focus();
1255
+ var o;
1256
+ s(""), (o = r.current) == null || o.focus();
1051
1257
  },
1052
1258
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1053
- children: /* @__PURE__ */ e(me, { className: "h-4 w-4", weight: "bold" })
1259
+ children: /* @__PURE__ */ e(be, { className: "h-4 w-4", weight: "bold" })
1054
1260
  }
1055
1261
  )
1056
1262
  ] });
1057
1263
  }
1058
- const ws = ({
1264
+ const it = ({
1059
1265
  participantSource: t,
1060
1266
  onSelectParticipant: s,
1061
1267
  onClose: n,
1062
1268
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
1063
- participantLabel: a = "participants",
1064
- searchPlaceholder: i = "Search participants...",
1065
- className: l
1269
+ participantLabel: o = "participants",
1270
+ searchPlaceholder: c = "Search participants...",
1271
+ className: a
1066
1272
  }) => {
1067
- const { debug: m } = oe(), [h, g] = y(""), [w, f] = y([]), [S, _] = y(!1), [v, c] = y(null), [N, E] = y(
1273
+ const { debug: h } = fe(), [g, x] = p(""), [w, f] = p([]), [l, D] = p(!1), [y, d] = p(null), [N, E] = p(
1068
1274
  null
1069
- ), I = z(!1);
1070
- G(() => {
1275
+ ), I = W(!1);
1276
+ q(() => {
1071
1277
  if (t.loading) {
1072
- m && console.log(
1278
+ h && console.log(
1073
1279
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1074
1280
  );
1075
1281
  return;
1076
1282
  }
1077
1283
  if (I.current) return;
1078
1284
  (async () => {
1079
- m && console.log("[ParticipantPicker] Loading initial participants..."), _(!0), c(null);
1285
+ h && console.log("[ParticipantPicker] Loading initial participants..."), D(!0), d(null);
1080
1286
  try {
1081
1287
  const u = await t.loadParticipants({
1082
1288
  search: "",
1083
1289
  // Load all participants initially
1084
1290
  limit: 100
1085
1291
  });
1086
- f(u.participants), I.current = !0, m && console.log(
1292
+ f(u.participants), I.current = !0, h && console.log(
1087
1293
  "[ParticipantPicker] Participants loaded successfully:",
1088
1294
  u.participants.length
1089
1295
  );
1090
1296
  } catch (u) {
1091
- const b = u instanceof Error ? u.message : "Failed to load participants";
1092
- c(b), console.error("[ParticipantPicker] Failed to load participants:", u);
1297
+ const v = u instanceof Error ? u.message : "Failed to load participants";
1298
+ d(v), console.error("[ParticipantPicker] Failed to load participants:", u);
1093
1299
  } finally {
1094
- _(!1);
1300
+ D(!1);
1095
1301
  }
1096
1302
  })();
1097
- }, [t.loading, m]);
1098
- const k = w.filter((d) => !r.has(d.id)).filter((d) => {
1099
- var b;
1100
- if (!h) return !0;
1101
- const u = h.toLowerCase();
1102
- return d.name.toLowerCase().includes(u) || ((b = d.email) == null ? void 0 : b.toLowerCase().includes(u)) || !1;
1103
- }), x = M(
1104
- async (d) => {
1303
+ }, [t.loading, h]);
1304
+ const S = w.filter((m) => !r.has(m.id)).filter((m) => {
1305
+ var v;
1306
+ if (!g) return !0;
1307
+ const u = g.toLowerCase();
1308
+ return m.name.toLowerCase().includes(u) || ((v = m.email) == null ? void 0 : v.toLowerCase().includes(u)) || !1;
1309
+ }), C = T(
1310
+ async (m) => {
1105
1311
  if (!N) {
1106
- E(d.id);
1312
+ E(m.id);
1107
1313
  try {
1108
- await s(d);
1314
+ await s(m);
1109
1315
  } catch (u) {
1110
1316
  console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
1111
1317
  }
1112
1318
  }
1113
1319
  },
1114
1320
  [s, N]
1115
- ), R = (d, u) => {
1116
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), x(u));
1321
+ ), M = (m, u) => {
1322
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), C(u));
1117
1323
  };
1118
- return /* @__PURE__ */ o("div", { className: p("flex flex-col h-full", l), children: [
1119
- /* @__PURE__ */ o("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1120
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-3", children: [
1324
+ return /* @__PURE__ */ i("div", { className: _("flex flex-col h-full", a), children: [
1325
+ /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1326
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1121
1327
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1122
- /* @__PURE__ */ e(pe, { onClick: n })
1328
+ /* @__PURE__ */ e(Le, { onClick: n })
1123
1329
  ] }),
1124
- /* @__PURE__ */ o("p", { className: "text-xs text-stone mb-3", children: [
1330
+ /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1125
1331
  "Select a ",
1126
- a.slice(0, -1),
1332
+ o.slice(0, -1),
1127
1333
  " to start messaging (",
1128
- k.length,
1334
+ S.length,
1129
1335
  " available)",
1130
- t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
1336
+ t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
1131
1337
  ] }),
1132
1338
  /* @__PURE__ */ e(
1133
- vs,
1339
+ ot,
1134
1340
  {
1135
- searchQuery: h,
1136
- setSearchQuery: g,
1137
- placeholder: i
1341
+ searchQuery: g,
1342
+ setSearchQuery: x,
1343
+ placeholder: c
1138
1344
  }
1139
1345
  )
1140
1346
  ] }),
1141
- v && /* @__PURE__ */ o("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1347
+ y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1142
1348
  "Error loading ",
1143
- a,
1349
+ o,
1144
1350
  ": ",
1145
- v
1351
+ y
1146
1352
  ] }),
1147
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && k.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1353
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: l && S.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: [
1148
1354
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1149
- /* @__PURE__ */ o("span", { className: "text-sm text-stone", children: [
1355
+ /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1150
1356
  "Loading ",
1151
- a,
1357
+ o,
1152
1358
  "..."
1153
1359
  ] })
1154
- ] }) }) : k.length === 0 ? /* @__PURE__ */ o("div", { className: "p-6 text-center", children: [
1155
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
1156
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : w.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1157
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1158
- ] }) : /* @__PURE__ */ o("ul", { className: "space-y-0", children: [
1159
- k.map((d) => {
1160
- const u = d.name || d.email || d.id, b = d.email && d.name ? d.email : d.phone;
1360
+ ] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1361
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ie, { className: "h-8 w-8 text-charcoal" }) }),
1362
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${o} found` : w.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1363
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1364
+ ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1365
+ S.map((m) => {
1366
+ const u = m.name || m.email || m.id, v = m.email && m.name ? m.email : m.phone;
1161
1367
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1162
1368
  "button",
1163
1369
  {
1164
1370
  type: "button",
1165
- onClick: () => x(d),
1166
- onKeyDown: (B) => R(B, d),
1371
+ onClick: () => C(m),
1372
+ onKeyDown: (j) => M(j, m),
1167
1373
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
1168
- children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
1169
- /* @__PURE__ */ o("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1374
+ children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1375
+ /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1170
1376
  /* @__PURE__ */ e(
1171
- q,
1377
+ ne,
1172
1378
  {
1173
- id: d.id,
1379
+ id: m.id,
1174
1380
  name: u,
1175
- image: d.image,
1381
+ image: m.image,
1176
1382
  size: 40
1177
1383
  }
1178
1384
  ),
1179
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
1385
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1180
1386
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1181
- b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1387
+ v && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: v })
1182
1388
  ] })
1183
1389
  ] }),
1184
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === d.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
1390
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === m.id ? /* @__PURE__ */ e(me, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ie, { className: "h-5 w-5 text-stone" }) })
1185
1391
  ] })
1186
1392
  }
1187
- ) }, d.id);
1393
+ ) }, m.id);
1188
1394
  }),
1189
- S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1395
+ l && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1190
1396
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1191
1397
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1192
1398
  ] }) })
1193
1399
  ] }) })
1194
1400
  ] });
1195
- }, ys = ({ className: t }) => /* @__PURE__ */ o(
1401
+ }, ct = ({ className: t }) => /* @__PURE__ */ i(
1196
1402
  "svg",
1197
1403
  {
1198
1404
  width: "140",
@@ -1202,7 +1408,7 @@ const ws = ({
1202
1408
  xmlns: "http://www.w3.org/2000/svg",
1203
1409
  className: t,
1204
1410
  children: [
1205
- /* @__PURE__ */ o("g", { clipPath: "url(#clip0_empty_state)", children: [
1411
+ /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1206
1412
  /* @__PURE__ */ e(
1207
1413
  "path",
1208
1414
  {
@@ -1231,7 +1437,7 @@ const ws = ({
1231
1437
  fill: "white"
1232
1438
  }
1233
1439
  ),
1234
- /* @__PURE__ */ o("g", { filter: "url(#filter0_empty_state)", children: [
1440
+ /* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
1235
1441
  /* @__PURE__ */ e(
1236
1442
  "path",
1237
1443
  {
@@ -1271,8 +1477,8 @@ const ws = ({
1271
1477
  }
1272
1478
  )
1273
1479
  ] }),
1274
- /* @__PURE__ */ o("defs", { children: [
1275
- /* @__PURE__ */ o(
1480
+ /* @__PURE__ */ i("defs", { children: [
1481
+ /* @__PURE__ */ i(
1276
1482
  "filter",
1277
1483
  {
1278
1484
  id: "filter0_empty_state",
@@ -1326,17 +1532,17 @@ const ws = ({
1326
1532
  ] })
1327
1533
  ]
1328
1534
  }
1329
- ), Re = U.memo(
1330
- ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1331
- /* @__PURE__ */ e(ys, {}),
1332
- s && !t && /* @__PURE__ */ o("div", { className: "mt-8", children: [
1535
+ ), Pe = P.memo(
1536
+ ({ 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: [
1537
+ /* @__PURE__ */ e(ct, {}),
1538
+ s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1333
1539
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1334
1540
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1335
1541
  ] })
1336
1542
  ] }) })
1337
1543
  );
1338
- Re.displayName = "EmptyState";
1339
- const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ o("div", { className: "text-center max-w-sm", children: [
1544
+ Pe.displayName = "EmptyState";
1545
+ const ue = P.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: [
1340
1546
  /* @__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: "⚠️" }) }),
1341
1547
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1342
1548
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1350,235 +1556,235 @@ const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1350
1556
  }
1351
1557
  )
1352
1558
  ] }) }));
1353
- le.displayName = "ErrorState";
1354
- const Fs = ({
1559
+ ue.displayName = "ErrorState";
1560
+ const bt = ({
1355
1561
  capabilities: t = {},
1356
1562
  className: s,
1357
1563
  renderMessageInputActions: n,
1358
1564
  onChannelSelect: r,
1359
- onParticipantSelect: a,
1360
- initialParticipantFilter: i,
1361
- initialParticipantData: l,
1362
- CustomChannelEmptyState: m,
1363
- showChannelList: h = !0,
1364
- filters: g,
1565
+ onParticipantSelect: o,
1566
+ initialParticipantFilter: c,
1567
+ initialParticipantData: a,
1568
+ CustomChannelEmptyState: h,
1569
+ showChannelList: g = !0,
1570
+ filters: x,
1365
1571
  channelListCustomEmptyStateIndicator: w,
1366
1572
  onDeleteConversationClick: f,
1367
- onBlockParticipantClick: S,
1368
- onReportParticipantClick: _
1573
+ onBlockParticipantClick: l,
1574
+ onReportParticipantClick: D
1369
1575
  }) => {
1370
1576
  const {
1371
- service: v,
1372
- client: c,
1577
+ service: y,
1578
+ client: d,
1373
1579
  isConnected: N,
1374
1580
  isLoading: E,
1375
1581
  error: I,
1376
- refreshConnection: k,
1377
- debug: x
1378
- } = rs(), [R, d] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [ie, Q] = y(/* @__PURE__ */ new Set()), [X, ce] = y(0), [O, H] = y(!1), [J, $] = y(null), D = z(null), {
1379
- participantSource: T,
1380
- participantLabel: A = "participants",
1381
- showDeleteConversation: V = !0
1382
- } = t, K = U.useMemo(() => {
1383
- const C = c == null ? void 0 : c.userID;
1582
+ refreshConnection: S,
1583
+ debug: C
1584
+ } = Bs(), [M, m] = p(null), [u, v] = p(!1), [j, $] = p(!1), [Z, Y] = p(!1), [re, ee] = p(/* @__PURE__ */ new Set()), [se, ae] = p(0), [U, G] = p(!1), [J, z] = p(null), k = W(null), {
1585
+ participantSource: F,
1586
+ participantLabel: B = "participants",
1587
+ showDeleteConversation: H = !0
1588
+ } = t, Q = P.useMemo(() => {
1589
+ const b = d == null ? void 0 : d.userID;
1384
1590
  return {
1385
1591
  ...{
1386
1592
  type: "messaging",
1387
1593
  last_message_at: { $exists: !0 },
1388
- ...C && {
1389
- members: { $in: [C] },
1594
+ ...b && {
1595
+ members: { $in: [b] },
1390
1596
  hidden: !1
1391
1597
  }
1392
1598
  },
1393
- ...g
1599
+ ...x
1394
1600
  };
1395
- }, [g, c == null ? void 0 : c.userID]), ee = z(null), Z = M(async () => {
1396
- if (!c || !N) return;
1397
- const C = c.userID;
1398
- if (C)
1601
+ }, [x, d == null ? void 0 : d.userID]), X = W(null), A = T(async () => {
1602
+ if (!d || !N) return;
1603
+ const b = d.userID;
1604
+ if (b)
1399
1605
  try {
1400
- x && console.log("[MessagingShell] Syncing channels for user:", C);
1401
- const P = await c.queryChannels(
1606
+ C && console.log("[MessagingShell] Syncing channels for user:", b);
1607
+ const L = await d.queryChannels(
1402
1608
  {
1403
1609
  type: "messaging",
1404
- members: { $in: [C] }
1610
+ members: { $in: [b] }
1405
1611
  },
1406
1612
  {},
1407
1613
  { limit: 100 }
1408
- ), F = /* @__PURE__ */ new Set();
1409
- P.forEach((L) => {
1410
- const de = L.state.members;
1411
- Object.values(de).forEach((Ue) => {
1412
- var he;
1413
- const ue = (he = Ue.user) == null ? void 0 : he.id;
1414
- ue && ue !== C && F.add(ue);
1614
+ ), R = /* @__PURE__ */ new Set();
1615
+ L.forEach((O) => {
1616
+ const xe = O.state.members;
1617
+ Object.values(xe).forEach((Ue) => {
1618
+ var ve;
1619
+ const Ce = (ve = Ue.user) == null ? void 0 : ve.id;
1620
+ Ce && Ce !== b && R.add(Ce);
1415
1621
  });
1416
- }), Q((L) => L.size === F.size && [...L].every((de) => F.has(de)) ? L : F), b(P.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
1417
- channelCount: P.length,
1418
- memberCount: F.size
1622
+ }), ee((O) => O.size === R.size && [...O].every((xe) => R.has(xe)) ? O : R), v(L.length > 0), $(!0), X.current = b, C && console.log("[MessagingShell] Channels synced successfully:", {
1623
+ channelCount: L.length,
1624
+ memberCount: R.size
1419
1625
  });
1420
- } catch (P) {
1421
- console.error("[MessagingShell] Failed to sync channels:", P);
1626
+ } catch (L) {
1627
+ console.error("[MessagingShell] Failed to sync channels:", L);
1422
1628
  }
1423
- }, [c, N, x]);
1424
- G(() => {
1425
- if (!c || !N) return;
1426
- const C = c.userID;
1427
- C && ee.current !== C && Z();
1428
- }, [c, N, Z]), G(() => {
1429
- if (!i || !c || !N) return;
1629
+ }, [d, N, C]);
1630
+ q(() => {
1631
+ if (!d || !N) return;
1632
+ const b = d.userID;
1633
+ b && X.current !== b && A();
1634
+ }, [d, N, A]), q(() => {
1635
+ if (!c || !d || !N) return;
1430
1636
  (async () => {
1431
- const P = c.userID;
1432
- if (P)
1637
+ const L = d.userID;
1638
+ if (L)
1433
1639
  try {
1434
- x && console.log(
1640
+ C && console.log(
1435
1641
  "[MessagingShell] Loading initial conversation with:",
1436
- i
1642
+ c
1437
1643
  );
1438
- const F = await c.queryChannels(
1644
+ const R = await d.queryChannels(
1439
1645
  {
1440
1646
  type: "messaging",
1441
- members: { $eq: [P, i] }
1647
+ members: { $eq: [L, c] }
1442
1648
  },
1443
1649
  {},
1444
1650
  { limit: 1 }
1445
1651
  );
1446
- if (F.length > 0)
1447
- d(F[0]), H(!0), $(null), r && r(F[0]), x && console.log(
1652
+ if (R.length > 0)
1653
+ m(R[0]), G(!0), z(null), r && r(R[0]), C && console.log(
1448
1654
  "[MessagingShell] Initial conversation loaded:",
1449
- F[0].id
1655
+ R[0].id
1450
1656
  );
1451
- else if (l && v) {
1452
- x && console.log(
1657
+ else if (a && y) {
1658
+ C && console.log(
1453
1659
  "[MessagingShell] No conversation found, creating one for:",
1454
- l
1660
+ a
1455
1661
  );
1456
1662
  try {
1457
- const L = await v.startChannelWithParticipant({
1458
- id: l.id,
1459
- name: l.name,
1460
- email: l.email,
1461
- phone: l.phone
1663
+ const O = await y.startChannelWithParticipant({
1664
+ id: a.id,
1665
+ name: a.name,
1666
+ email: a.email,
1667
+ phone: a.phone
1462
1668
  });
1463
- d(L), H(!0), $(null), r && r(L), x && console.log(
1669
+ m(O), G(!0), z(null), r && r(O), C && console.log(
1464
1670
  "[MessagingShell] Channel created and loaded:",
1465
- L.id
1671
+ O.id
1466
1672
  );
1467
- } catch (L) {
1673
+ } catch (O) {
1468
1674
  console.error(
1469
1675
  "[MessagingShell] Failed to create conversation:",
1470
- L
1471
- ), $("Failed to create conversation");
1676
+ O
1677
+ ), z("Failed to create conversation");
1472
1678
  }
1473
1679
  } else
1474
- $(
1680
+ z(
1475
1681
  "No conversation found with this account"
1476
- ), x && console.log(
1682
+ ), C && console.log(
1477
1683
  "[MessagingShell] No conversation found for:",
1478
- i
1684
+ c
1479
1685
  );
1480
- } catch (F) {
1686
+ } catch (R) {
1481
1687
  console.error(
1482
1688
  "[MessagingShell] Failed to load initial conversation:",
1483
- F
1484
- ), $("Failed to load conversation");
1689
+ R
1690
+ ), z("Failed to load conversation");
1485
1691
  }
1486
1692
  })();
1487
1693
  }, [
1488
- i,
1489
- l,
1490
1694
  c,
1695
+ a,
1696
+ d,
1491
1697
  N,
1492
- v,
1493
- x,
1698
+ y,
1699
+ C,
1494
1700
  r
1495
1701
  ]);
1496
- const De = M(
1497
- (C) => {
1498
- d(C), r == null || r(C);
1702
+ const ge = T(
1703
+ (b) => {
1704
+ m(b), r == null || r(b);
1499
1705
  },
1500
1706
  [r]
1501
- ), Me = M(() => {
1502
- O || d(null);
1503
- }, [O]), _e = M(
1504
- async (C) => {
1505
- var P;
1506
- if (v)
1707
+ ), oe = T(() => {
1708
+ U || m(null);
1709
+ }, [U]), ie = T(
1710
+ async (b) => {
1711
+ var L;
1712
+ if (y)
1507
1713
  try {
1508
- x && console.log(
1714
+ C && console.log(
1509
1715
  "[MessagingShell] Starting conversation with:",
1510
- C.id
1716
+ b.id
1511
1717
  );
1512
- const F = await v.startChannelWithParticipant({
1513
- id: C.id,
1514
- name: C.name,
1515
- email: C.email,
1516
- phone: C.phone
1718
+ const R = await y.startChannelWithParticipant({
1719
+ id: b.id,
1720
+ name: b.name,
1721
+ email: b.email,
1722
+ phone: b.phone
1517
1723
  });
1518
1724
  try {
1519
- await F.show();
1520
- } catch (L) {
1521
- console.warn("[MessagingShell] Failed to unhide channel:", L);
1725
+ await R.show();
1726
+ } catch (O) {
1727
+ console.warn("[MessagingShell] Failed to unhide channel:", O);
1522
1728
  }
1523
- d(F), Y(!1), (P = D.current) == null || P.close(), a == null || a(C);
1524
- } catch (F) {
1525
- console.error("[MessagingShell] Failed to start conversation:", F);
1729
+ m(R), Y(!1), (L = k.current) == null || L.close(), o == null || o(b);
1730
+ } catch (R) {
1731
+ console.error("[MessagingShell] Failed to start conversation:", R);
1526
1732
  }
1527
1733
  },
1528
- [v, a, x]
1529
- ), se = M(() => {
1530
- var C;
1531
- Y(!1), (C = D.current) == null || C.close();
1532
- }, []), Fe = M(
1533
- (C) => {
1534
- C.target === D.current && se();
1734
+ [y, o, C]
1735
+ ), K = T(() => {
1736
+ var b;
1737
+ Y(!1), (b = k.current) == null || b.close();
1738
+ }, []), ce = T(
1739
+ (b) => {
1740
+ b.target === k.current && K();
1535
1741
  },
1536
- [se]
1537
- ), Te = M(
1538
- async (C) => {
1539
- x && console.log("[MessagingShell] Leaving conversation:", C.id), d(null), H(!1), ee.current = null, await Z();
1742
+ [K]
1743
+ ), le = T(
1744
+ async (b) => {
1745
+ C && console.log("[MessagingShell] Leaving conversation:", b.id), m(null), G(!1), X.current = null, await A();
1540
1746
  },
1541
- [Z, x]
1542
- ), Le = M(
1543
- async (C) => {
1544
- x && console.log("[MessagingShell] Blocking participant:", C), d(null), H(!1), ee.current = null, await Z();
1747
+ [A, C]
1748
+ ), V = T(
1749
+ async (b) => {
1750
+ C && console.log("[MessagingShell] Blocking participant:", b), m(null), G(!1), X.current = null, await A();
1545
1751
  },
1546
- [Z, x]
1547
- ), te = !!R;
1548
- return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !c ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1549
- le,
1752
+ [A, C]
1753
+ ), te = !!M;
1754
+ return E ? /* @__PURE__ */ e("div", { className: _("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : I ? /* @__PURE__ */ e("div", { className: _("h-full", s), children: /* @__PURE__ */ e(ue, { message: I, onBack: S }) }) : !N || !d ? /* @__PURE__ */ e("div", { className: _("h-full", s), children: /* @__PURE__ */ e(
1755
+ ue,
1550
1756
  {
1551
1757
  message: "Not connected to messaging service",
1552
- onBack: k
1758
+ onBack: S
1553
1759
  }
1554
- ) }) : J ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ o(
1760
+ ) }) : J ? /* @__PURE__ */ e("div", { className: _("h-full", s), children: /* @__PURE__ */ e(ue, { message: J }) }) : /* @__PURE__ */ i(
1555
1761
  "div",
1556
1762
  {
1557
- className: p(
1763
+ className: _(
1558
1764
  "messaging-shell h-full bg-background-primary overflow-hidden",
1559
1765
  s
1560
1766
  ),
1561
1767
  children: [
1562
- /* @__PURE__ */ o("div", { className: "flex h-full min-h-0", children: [
1768
+ /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1563
1769
  /* @__PURE__ */ e(
1564
1770
  "div",
1565
1771
  {
1566
- className: p(
1772
+ className: _(
1567
1773
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1568
1774
  {
1569
- "!hidden": h === !1 || O,
1775
+ "!hidden": g === !1 || U,
1570
1776
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1571
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !O && te,
1777
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !U && te,
1572
1778
  // Show on mobile when no channel selected, use same wide width on desktop
1573
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !te
1779
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !U && !te
1574
1780
  }
1575
1781
  ),
1576
1782
  children: /* @__PURE__ */ e(
1577
- Ie,
1783
+ Te,
1578
1784
  {
1579
- onChannelSelect: De,
1580
- selectedChannel: R || void 0,
1581
- filters: K,
1785
+ onChannelSelect: ge,
1786
+ selectedChannel: M || void 0,
1787
+ filters: Q,
1582
1788
  customEmptyStateIndicator: w
1583
1789
  }
1584
1790
  )
@@ -1587,70 +1793,70 @@ const Fs = ({
1587
1793
  /* @__PURE__ */ e(
1588
1794
  "div",
1589
1795
  {
1590
- className: p(
1796
+ className: _(
1591
1797
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1592
1798
  {
1593
1799
  // In direct conversation mode (or waiting for it), always show (full width)
1594
- flex: O || te || i,
1800
+ flex: U || te || c,
1595
1801
  // Normal mode: hide on mobile when no channel selected
1596
- "hidden lg:flex": !O && !te && !i
1802
+ "hidden lg:flex": !U && !te && !c
1597
1803
  }
1598
1804
  ),
1599
- children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1600
- ke,
1805
+ children: M ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1806
+ Oe,
1601
1807
  {
1602
- channel: R,
1603
- onBack: Me,
1604
- showBackButton: !O,
1808
+ channel: M,
1809
+ onBack: oe,
1810
+ showBackButton: !U,
1605
1811
  renderMessageInputActions: n,
1606
- onLeaveConversation: Te,
1607
- onBlockParticipant: Le,
1608
- CustomChannelEmptyState: m,
1609
- showDeleteConversation: V,
1812
+ onLeaveConversation: le,
1813
+ onBlockParticipant: V,
1814
+ CustomChannelEmptyState: h,
1815
+ showDeleteConversation: H,
1610
1816
  onDeleteConversationClick: f,
1611
- onBlockParticipantClick: S,
1612
- onReportParticipantClick: _
1817
+ onBlockParticipantClick: l,
1818
+ onReportParticipantClick: D
1613
1819
  },
1614
- R.id
1615
- ) }) : i ? (
1820
+ M.id
1821
+ ) }) : c ? (
1616
1822
  // Show loading while creating/loading direct conversation channel
1617
- /* @__PURE__ */ e(ae, {})
1823
+ /* @__PURE__ */ e(he, {})
1618
1824
  ) : /* @__PURE__ */ e(
1619
- Re,
1825
+ Pe,
1620
1826
  {
1621
1827
  hasChannels: u,
1622
- channelsLoaded: B
1828
+ channelsLoaded: j
1623
1829
  }
1624
1830
  )
1625
1831
  }
1626
1832
  )
1627
1833
  ] }),
1628
- T && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1834
+ F && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1629
1835
  /* @__PURE__ */ e(
1630
1836
  "dialog",
1631
1837
  {
1632
- ref: D,
1838
+ ref: k,
1633
1839
  className: "mes-dialog",
1634
- onClick: Fe,
1635
- onClose: se,
1840
+ onClick: ce,
1841
+ onClose: K,
1636
1842
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1637
- ws,
1843
+ it,
1638
1844
  {
1639
- participantSource: T,
1640
- onSelectParticipant: _e,
1641
- onClose: se,
1642
- existingParticipantIds: ie,
1643
- participantLabel: A,
1644
- searchPlaceholder: `Search ${A}...`
1845
+ participantSource: F,
1846
+ onSelectParticipant: ie,
1847
+ onClose: K,
1848
+ existingParticipantIds: re,
1849
+ participantLabel: B,
1850
+ searchPlaceholder: `Search ${B}...`
1645
1851
  },
1646
- X
1852
+ se
1647
1853
  ) })
1648
1854
  }
1649
1855
  )
1650
1856
  ]
1651
1857
  }
1652
1858
  );
1653
- }, Es = ({
1859
+ }, dt = ({
1654
1860
  question: t,
1655
1861
  onClick: s,
1656
1862
  loading: n = !1,
@@ -1662,7 +1868,7 @@ const Fs = ({
1662
1868
  onClick: s,
1663
1869
  disabled: n,
1664
1870
  style: { backgroundColor: "#E6E5E3" },
1665
- className: p(
1871
+ className: _(
1666
1872
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1667
1873
  {
1668
1874
  "hover:brightness-95 active:brightness-90": !n,
@@ -1672,100 +1878,100 @@ const Fs = ({
1672
1878
  ),
1673
1879
  children: t
1674
1880
  }
1675
- ), Ts = ({
1881
+ ), vt = ({
1676
1882
  faqs: t,
1677
1883
  onFaqClick: s,
1678
1884
  loadingFaqId: n,
1679
1885
  headerText: r,
1680
- className: a,
1681
- avatarImage: i,
1682
- avatarName: l
1886
+ className: o,
1887
+ avatarImage: c,
1888
+ avatarName: a
1683
1889
  }) => {
1684
- const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
1685
- return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ o("div", { className: "flex gap-3 items-end", children: [
1686
- (i || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1687
- q,
1890
+ const h = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
1891
+ return h.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1892
+ (c || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1893
+ ne,
1688
1894
  {
1689
- id: l || "account",
1690
- name: l || "Account",
1691
- image: i,
1895
+ id: a || "account",
1896
+ name: a || "Account",
1897
+ image: c,
1692
1898
  size: 24,
1693
1899
  shape: "circle"
1694
1900
  }
1695
1901
  ) }),
1696
- /* @__PURE__ */ o(
1902
+ /* @__PURE__ */ i(
1697
1903
  "div",
1698
1904
  {
1699
1905
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1700
1906
  style: { backgroundColor: "#F1F0EE" },
1701
1907
  children: [
1702
1908
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1703
- m.map((h) => /* @__PURE__ */ e(
1704
- Es,
1909
+ h.map((g) => /* @__PURE__ */ e(
1910
+ dt,
1705
1911
  {
1706
- question: h.question,
1707
- onClick: () => s(h.id),
1708
- loading: n === h.id
1912
+ question: g.question,
1913
+ onClick: () => s(g.id),
1914
+ loading: n === g.id
1709
1915
  },
1710
- h.id
1916
+ g.id
1711
1917
  ))
1712
1918
  ]
1713
1919
  }
1714
1920
  )
1715
1921
  ] }) });
1716
- }, Ls = (t, s = {}) => {
1717
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, i] = y([]), [l, m] = y(!1), [h, g] = y(null), [w, f] = y(n), [S, _] = y(!0), [v, c] = y(), N = M(async (x = !1, R) => {
1718
- if (l) return;
1719
- const d = R !== void 0 ? R : w;
1720
- m(!0), g(null);
1922
+ }, wt = (t, s = {}) => {
1923
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [o, c] = p([]), [a, h] = p(!1), [g, x] = p(null), [w, f] = p(n), [l, D] = p(!0), [y, d] = p(), N = T(async (C = !1, M) => {
1924
+ if (a) return;
1925
+ const m = M !== void 0 ? M : w;
1926
+ h(!0), x(null);
1721
1927
  try {
1722
1928
  const u = await t.loadParticipants({
1723
- search: d || void 0,
1929
+ search: m || void 0,
1724
1930
  limit: r,
1725
- cursor: x ? void 0 : v
1931
+ cursor: C ? void 0 : y
1726
1932
  });
1727
- i(
1728
- (b) => x ? u.participants : [...b, ...u.participants]
1729
- ), _(u.hasMore), c(u.nextCursor);
1933
+ c(
1934
+ (v) => C ? u.participants : [...v, ...u.participants]
1935
+ ), D(u.hasMore), d(u.nextCursor);
1730
1936
  } catch (u) {
1731
- const b = u instanceof Error ? u.message : "Failed to load participants";
1732
- g(b), console.error("[useParticipants] Load error:", u);
1937
+ const v = u instanceof Error ? u.message : "Failed to load participants";
1938
+ x(v), console.error("[useParticipants] Load error:", u);
1733
1939
  } finally {
1734
- m(!1);
1940
+ h(!1);
1735
1941
  }
1736
- }, [t, w, v, r, l]), E = M(() => {
1737
- S && !l && N(!1);
1738
- }, [S, l, N]), I = M((x) => {
1739
- f(x), c(void 0), N(!0, x);
1740
- }, [N]), k = M(() => {
1741
- c(void 0), N(!0);
1942
+ }, [t, w, y, r, a]), E = T(() => {
1943
+ l && !a && N(!1);
1944
+ }, [l, a, N]), I = T((C) => {
1945
+ f(C), d(void 0), N(!0, C);
1946
+ }, [N]), S = T(() => {
1947
+ d(void 0), N(!0);
1742
1948
  }, [N]);
1743
- return G(() => {
1949
+ return q(() => {
1744
1950
  N(!0);
1745
1951
  }, [t.loadParticipants]), {
1746
- participants: a,
1747
- loading: l,
1748
- error: h,
1952
+ participants: o,
1953
+ loading: a,
1954
+ error: g,
1749
1955
  searchQuery: w,
1750
- hasMore: S,
1956
+ hasMore: l,
1751
1957
  totalCount: t.totalCount,
1752
1958
  loadMore: E,
1753
1959
  search: I,
1754
- refresh: k
1960
+ refresh: S
1755
1961
  };
1756
1962
  };
1757
1963
  export {
1758
- q as Avatar,
1759
- gs as ChannelEmptyState,
1760
- Ie as ChannelList,
1761
- ke as ChannelView,
1762
- Ts as FaqList,
1763
- Es as FaqListItem,
1764
- _s as MessagingProvider,
1765
- Fs as MessagingShell,
1766
- ws as ParticipantPicker,
1767
- as as formatRelativeTime,
1768
- rs as useMessaging,
1769
- Ls as useParticipants
1964
+ ne as Avatar,
1965
+ tt as ChannelEmptyState,
1966
+ Te as ChannelList,
1967
+ Oe as ChannelView,
1968
+ vt as FaqList,
1969
+ dt as FaqListItem,
1970
+ Nt as MessagingProvider,
1971
+ bt as MessagingShell,
1972
+ it as ParticipantPicker,
1973
+ As as formatRelativeTime,
1974
+ Bs as useMessaging,
1975
+ wt as useParticipants
1770
1976
  };
1771
1977
  //# sourceMappingURL=index.js.map