@linktr.ee/messaging-react 1.8.6 → 1.8.8-rc-1764074720

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,10 +1,10 @@
1
- import { jsx as e, jsxs as u, Fragment as se } from "react/jsx-runtime";
2
- import S from "classnames";
3
- import q, { createContext as ke, useContext as Re, useCallback as P, useState as w, useRef as z, useEffect as $ } from "react";
4
- import { StreamChatService as Fe } from "@linktr.ee/messaging-core";
5
- import { Chat as Te, ChannelList as De, MessageInput as pe, useMessageInputContext as Me, useMessageComposerHasSendableData as Pe, SimpleAttachmentSelector as Ue, QuotedMessagePreview as Oe, LinkPreviewList as Le, AttachmentPreviewList as _e, TextareaComposer as je, Channel as Ae, useChannelStateContext as fe, Window as Be, MessageList as ze } from "stream-chat-react";
6
- import { XIcon as he, ArrowUpIcon as $e, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as He, ProhibitInsetIcon as ce, FlagIcon as Ge, MagnifyingGlassIcon as Ve, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
7
- const ge = ke({
1
+ import { jsx as e, jsxs as c, Fragment as se } from "react/jsx-runtime";
2
+ import R from "classnames";
3
+ import Y, { createContext as Re, useContext as Fe, useCallback as P, useState as y, useRef as $, useEffect as H } from "react";
4
+ import { StreamChatService as Te } from "@linktr.ee/messaging-core";
5
+ import { Chat as De, ChannelList as pe, MessageInput as Me, useMessageInputContext as Pe, useMessageComposerHasSendableData as Ue, SimpleAttachmentSelector as Oe, QuotedMessagePreview as Le, LinkPreviewList as _e, AttachmentPreviewList as je, TextareaComposer as Ae, Channel as Be, useChannelStateContext as fe, Window as ze, MessageList as $e } from "stream-chat-react";
6
+ import { XIcon as he, ArrowUpIcon as He, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as Ge, ProhibitInsetIcon as ce, FlagIcon as Ve, MagnifyingGlassIcon as We, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
7
+ const ge = Re({
8
8
  service: null,
9
9
  client: null,
10
10
  isConnected: !1,
@@ -15,109 +15,109 @@ const ge = ke({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ne = () => Re(ge), Ns = ({
18
+ }), ne = () => Fe(ge), bs = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
- capabilities: a = {},
23
+ capabilities: i = {},
24
24
  customization: d = {},
25
- debug: i = !1
25
+ debug: a = !1
26
26
  }) => {
27
27
  const l = P(
28
- (b, ...D) => {
29
- i && console.log(`🔥 [MessagingProvider] ${b}`, ...D);
28
+ (x, ...D) => {
29
+ a && console.log(`🔥 [MessagingProvider] ${x}`, ...D);
30
30
  },
31
- [i]
31
+ [a]
32
32
  );
33
33
  l("🔄 RENDER START", {
34
34
  userId: s == null ? void 0 : s.id,
35
35
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
36
36
  serviceConfig: !!n,
37
- capabilities: Object.keys(a),
37
+ capabilities: Object.keys(i),
38
38
  customization: Object.keys(d)
39
39
  });
40
- const [o, E] = w(null), [v, m] = w(null), [h, T] = w(!1), [x, C] = w(!1), [f, R] = w(null), I = z(!1), y = z({
40
+ const [o, w] = y(null), [I, N] = y(null), [m, S] = y(!1), [g, b] = y(!1), [E, v] = y(null), F = $(!1), C = $({
41
41
  userId: s == null ? void 0 : s.id,
42
42
  apiKey: r,
43
43
  serviceConfig: n,
44
- capabilities: a,
44
+ capabilities: i,
45
45
  customization: d
46
- }), F = z(0);
47
- F.current++, l("📊 RENDER INFO", {
48
- renderCount: F.current,
46
+ }), T = $(0);
47
+ T.current++, l("📊 RENDER INFO", {
48
+ renderCount: T.current,
49
49
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
50
50
  propChanges: {
51
- userChanged: y.current.userId !== (s == null ? void 0 : s.id),
52
- apiKeyChanged: y.current.apiKey !== r,
53
- serviceConfigChanged: y.current.serviceConfig !== n,
54
- capabilitiesChanged: y.current.capabilities !== a,
55
- customizationChanged: y.current.customization !== d
51
+ userChanged: C.current.userId !== (s == null ? void 0 : s.id),
52
+ apiKeyChanged: C.current.apiKey !== r,
53
+ serviceConfigChanged: C.current.serviceConfig !== n,
54
+ capabilitiesChanged: C.current.capabilities !== i,
55
+ customizationChanged: C.current.customization !== d
56
56
  }
57
- }), y.current = {
57
+ }), C.current = {
58
58
  userId: s == null ? void 0 : s.id,
59
59
  apiKey: r,
60
60
  serviceConfig: n,
61
- capabilities: a,
61
+ capabilities: i,
62
62
  customization: d
63
- }, $(() => {
64
- const b = F.current;
63
+ }, H(() => {
64
+ const x = T.current;
65
65
  if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
66
- renderCount: b,
66
+ renderCount: x,
67
67
  apiKey: !!r,
68
68
  serviceConfig: !!n,
69
69
  dependencies: {
70
70
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
71
71
  serviceConfigRef: n,
72
- serviceConfigStable: y.current.serviceConfig === n,
73
- apiKeyStable: y.current.apiKey === r
72
+ serviceConfigStable: C.current.serviceConfig === n,
73
+ apiKeyStable: C.current.apiKey === r
74
74
  }
75
75
  }), !r || !n) {
76
76
  l("⚠️ SERVICE INIT SKIPPED", {
77
- renderCount: b,
77
+ renderCount: x,
78
78
  reason: "Missing apiKey or serviceConfig"
79
79
  });
80
80
  return;
81
81
  }
82
82
  l("🚀 CREATING NEW SERVICE", {
83
- renderCount: b,
83
+ renderCount: x,
84
84
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
85
- serviceConfigChanged: y.current.serviceConfig !== n
85
+ serviceConfigChanged: C.current.serviceConfig !== n
86
86
  });
87
- const D = new Fe({
87
+ const D = new Te({
88
88
  ...n,
89
89
  apiKey: r,
90
- debug: i
90
+ debug: a
91
91
  });
92
- return E(D), l("✅ SERVICE SET", {
93
- renderCount: b,
92
+ return w(D), l("✅ SERVICE SET", {
93
+ renderCount: x,
94
94
  serviceInstance: !!D
95
95
  }), () => {
96
96
  l("🧹 SERVICE CLEANUP", {
97
- renderCount: b,
97
+ renderCount: x,
98
98
  reason: "Effect cleanup"
99
99
  }), D.disconnectUser().catch(console.error);
100
100
  };
101
- }, [r, n, i, l]);
102
- const M = z(null);
103
- $(() => {
104
- var D, W;
101
+ }, [r, n, a, l]);
102
+ const p = $(null);
103
+ H(() => {
104
+ var D, q;
105
105
  if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
106
106
  hasService: !!o,
107
107
  hasUser: !!s,
108
108
  userId: s == null ? void 0 : s.id,
109
- isConnecting: I.current,
110
- isConnected: h,
109
+ isConnecting: F.current,
110
+ isConnected: m,
111
111
  dependencies: { service: !!o, userId: s == null ? void 0 : s.id }
112
112
  }), !o || !s) {
113
113
  l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
114
114
  return;
115
115
  }
116
- if (I.current) {
116
+ if (F.current) {
117
117
  l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
118
118
  return;
119
119
  }
120
- if (((D = M.current) == null ? void 0 : D.serviceId) === o && ((W = M.current) == null ? void 0 : W.userId) === s.id) {
120
+ if (((D = p.current) == null ? void 0 : D.serviceId) === o && ((q = p.current) == null ? void 0 : q.userId) === s.id) {
121
121
  l(
122
122
  "⚠️ USER CONNECTION SKIPPED",
123
123
  "Already connected this user with this service"
@@ -125,40 +125,40 @@ const ge = ke({
125
125
  return;
126
126
  }
127
127
  (async () => {
128
- l("🚀 STARTING USER CONNECTION", { userId: s.id }), I.current = !0, C(!0), R(null);
128
+ l("🚀 STARTING USER CONNECTION", { userId: s.id }), F.current = !0, b(!0), v(null);
129
129
  try {
130
130
  l("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
131
- const p = await o.connectUser(s);
132
- m(p), T(!0), M.current = { serviceId: o, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
131
+ const _ = await o.connectUser(s);
132
+ N(_), S(!0), p.current = { serviceId: o, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
133
133
  userId: s.id,
134
- clientId: p.userID
134
+ clientId: _.userID
135
135
  });
136
- } catch (p) {
137
- const A = p instanceof Error ? p.message : "Connection failed";
138
- R(A), l("❌ USER CONNECTION ERROR", {
136
+ } catch (_) {
137
+ const O = _ instanceof Error ? _.message : "Connection failed";
138
+ v(O), l("❌ USER CONNECTION ERROR", {
139
139
  userId: s.id,
140
- error: A
140
+ error: O
141
141
  });
142
142
  } finally {
143
- C(!1), I.current = !1, l("🔄 USER CONNECTION FINISHED", {
143
+ b(!1), F.current = !1, l("🔄 USER CONNECTION FINISHED", {
144
144
  userId: s.id,
145
- isConnected: h
145
+ isConnected: m
146
146
  });
147
147
  }
148
148
  })();
149
- }, [o, s, l, h]), $(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
149
+ }, [o, s, l, m]), H(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
150
150
  hasService: !!o,
151
- isConnected: h
151
+ isConnected: m
152
152
  }), () => {
153
- o && h ? (l(
153
+ o && m ? (l(
154
154
  "🧹 CLEANUP EFFECT TRIGGERED",
155
155
  "Cleaning up connection on unmount"
156
- ), M.current = null, o.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
156
+ ), p.current = null, o.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
157
157
  hasService: !!o,
158
- isConnected: h
158
+ isConnected: m
159
159
  });
160
- }), [o, h, l]);
161
- const c = P(async () => {
160
+ }), [o, m, l]);
161
+ const u = P(async () => {
162
162
  if (l("🔄 REFRESH CONNECTION CALLED", {
163
163
  hasService: !!o,
164
164
  hasUser: !!s
@@ -166,67 +166,67 @@ const ge = ke({
166
166
  l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
167
167
  return;
168
168
  }
169
- l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), C(!0);
169
+ l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), b(!0);
170
170
  try {
171
171
  l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
172
- const b = await o.connectUser(s);
173
- m(b), T(!0), R(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
174
- } catch (b) {
175
- const D = b instanceof Error ? b.message : "Refresh failed";
176
- R(D), l("❌ CONNECTION REFRESH ERROR", {
172
+ const x = await o.connectUser(s);
173
+ N(x), S(!0), v(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
174
+ } catch (x) {
175
+ const D = x instanceof Error ? x.message : "Refresh failed";
176
+ v(D), l("❌ CONNECTION REFRESH ERROR", {
177
177
  userId: s.id,
178
178
  error: D
179
179
  });
180
180
  } finally {
181
- C(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
181
+ b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
182
182
  }
183
- }, [o, s, l]), g = q.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
183
+ }, [o, s, l]), f = Y.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
184
184
  hasService: !!o,
185
- hasClient: !!v,
186
- isConnected: h,
187
- isLoading: x,
188
- hasError: !!f,
189
- capabilitiesKeys: Object.keys(a),
185
+ hasClient: !!I,
186
+ isConnected: m,
187
+ isLoading: g,
188
+ hasError: !!E,
189
+ capabilitiesKeys: Object.keys(i),
190
190
  customizationKeys: Object.keys(d)
191
191
  }), {
192
192
  service: o,
193
- client: v,
194
- isConnected: h,
195
- isLoading: x,
196
- error: f,
197
- capabilities: a,
193
+ client: I,
194
+ isConnected: m,
195
+ isLoading: g,
196
+ error: E,
197
+ capabilities: i,
198
198
  customization: d,
199
- refreshConnection: c,
200
- debug: i
199
+ refreshConnection: u,
200
+ debug: a
201
201
  }), [
202
202
  o,
203
- v,
204
- h,
205
- x,
206
- f,
207
- a,
208
- d,
209
- c,
203
+ I,
204
+ m,
205
+ g,
206
+ E,
210
207
  i,
208
+ d,
209
+ u,
210
+ a,
211
211
  l
212
212
  ]);
213
213
  return l("🔄 RENDER END", {
214
- renderCount: F.current,
215
- willRenderChat: !!(v && h),
216
- contextValueReady: !!g
217
- }), /* @__PURE__ */ e(ge.Provider, { value: g, children: v && h ? /* @__PURE__ */ e(Te, { client: v, children: t }) : t });
218
- }, We = () => ne(), qe = (t, s) => {
214
+ renderCount: T.current,
215
+ willRenderChat: !!(I && m),
216
+ contextValueReady: !!f
217
+ }), /* @__PURE__ */ e(ge.Provider, { value: f, children: I && m ? /* @__PURE__ */ e(De, { client: I, children: t }) : t });
218
+ }, qe = () => ne(), Ye = (t, s) => {
219
219
  const n = new Date(
220
220
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
221
- ), a = new Date(
221
+ ), i = new Date(
222
222
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
223
223
  ).getTime() - n.getTime();
224
- return Math.floor(a / (1e3 * 60 * 60 * 24));
225
- }, Ye = (t) => {
224
+ return Math.floor(i / (1e3 * 60 * 60 * 24));
225
+ }, Je = (t) => {
226
226
  const s = /* @__PURE__ */ new Date();
227
227
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
228
228
  return "Just now";
229
- const r = qe(t, s);
229
+ const r = Ye(t, s);
230
230
  return r === 0 ? t.toLocaleTimeString([], {
231
231
  hour: "numeric",
232
232
  minute: "2-digit"
@@ -263,7 +263,7 @@ const ge = ke({
263
263
  "🍈"
264
264
  // Melon
265
265
  ];
266
- function Je(t) {
266
+ function Qe(t) {
267
267
  let s = 0;
268
268
  for (let n = 0; n < t.length; n++) {
269
269
  const r = t.charCodeAt(n);
@@ -271,21 +271,21 @@ function Je(t) {
271
271
  }
272
272
  return Math.abs(s);
273
273
  }
274
- function Qe(t) {
275
- const n = Je(t) % ue.length;
274
+ function Xe(t) {
275
+ const n = Qe(t) % ue.length;
276
276
  return ue[n];
277
277
  }
278
- const Y = ({
278
+ const J = ({
279
279
  id: t,
280
280
  image: s,
281
281
  size: n = 40,
282
282
  className: r
283
283
  }) => {
284
- const a = Qe(t), i = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg";
284
+ const i = Xe(t), a = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg";
285
285
  return /* @__PURE__ */ e(
286
286
  "div",
287
287
  {
288
- className: S("flex-shrink-0 overflow-hidden", r),
288
+ className: R("flex-shrink-0 overflow-hidden", r),
289
289
  style: {
290
290
  width: `${n}px`,
291
291
  height: `${n}px`,
@@ -304,126 +304,128 @@ const Y = ({
304
304
  "div",
305
305
  {
306
306
  "aria-hidden": "true",
307
- className: S(
307
+ className: R(
308
308
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
309
- i
309
+ a
310
310
  ),
311
- children: a
311
+ children: i
312
312
  }
313
313
  )
314
314
  }
315
315
  );
316
- }, Xe = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
317
- var f, R, I, y, F, M;
318
- const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), i = () => {
316
+ }, Ze = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: i }) => {
317
+ var E, v, F, C, T, p;
318
+ const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
319
319
  t && n(t);
320
- }, o = Object.values(((f = t == null ? void 0 : t.state) == null ? void 0 : f.members) || {}).find(
321
- (c) => {
322
- var g, b;
323
- return ((g = c.user) == null ? void 0 : g.id) && c.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
320
+ }, o = Object.values(((E = t == null ? void 0 : t.state) == null ? void 0 : E.members) || {}).find(
321
+ (u) => {
322
+ var f, x;
323
+ return ((f = u.user) == null ? void 0 : f.id) && u.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
324
324
  }
325
- ), E = ((R = o == null ? void 0 : o.user) == null ? void 0 : R.name) || "Conversation", v = (I = o == null ? void 0 : o.user) == null ? void 0 : I.image, m = (F = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages) == null ? void 0 : F[t.state.messages.length - 1], T = (() => {
326
- var g;
327
- if (m != null && m.text) return m.text;
328
- const c = (g = m == null ? void 0 : m.attachments) == null ? void 0 : g[0];
329
- return c != null && c.asset_url ? c.asset_url : c != null && c.image_url ? c.image_url : c != null && c.og_scrape_url ? c.og_scrape_url : c != null && c.thumb_url ? c.thumb_url : "No messages yet";
330
- })(), x = m != null && m.created_at ? Ye(new Date(m.created_at)) : "", C = a ?? 0;
325
+ ), w = ((v = o == null ? void 0 : o.user) == null ? void 0 : v.name) || "Conversation", I = (F = o == null ? void 0 : o.user) == null ? void 0 : F.image, N = (T = (C = t == null ? void 0 : t.state) == null ? void 0 : C.messages) == null ? void 0 : T[t.state.messages.length - 1], S = (() => {
326
+ var f;
327
+ if (N != null && N.text) return N.text;
328
+ const u = (f = N == null ? void 0 : N.attachments) == null ? void 0 : f[0];
329
+ return u != null && u.asset_url ? u.asset_url : u != null && u.image_url ? u.image_url : u != null && u.og_scrape_url ? u.og_scrape_url : u != null && u.thumb_url ? u.thumb_url : "No messages yet";
330
+ })(), g = N != null && N.created_at ? Je(new Date(N.created_at)) : "", b = i ?? 0;
331
331
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
332
332
  channelId: t == null ? void 0 : t.id,
333
333
  isSelected: d,
334
- participantName: E,
335
- unreadCount: C,
336
- hasTimestamp: !!x
334
+ participantName: w,
335
+ unreadCount: b,
336
+ hasTimestamp: !!g
337
337
  }), /* @__PURE__ */ e(
338
338
  "button",
339
339
  {
340
340
  type: "button",
341
- onClick: i,
342
- className: S(
341
+ onClick: a,
342
+ className: R(
343
343
  "group w-full px-4 py-3 transition-colors border-b border-sand text-left max-w-full overflow-hidden focus-ring",
344
344
  {
345
345
  "bg-primary-alt/10 border-l-4 border-l-primary": d,
346
346
  "hover:bg-sand": !d
347
347
  }
348
348
  ),
349
- children: /* @__PURE__ */ u("div", { className: "flex items-start gap-3", children: [
349
+ children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
350
350
  /* @__PURE__ */ e(
351
- Y,
351
+ J,
352
352
  {
353
- id: ((M = o == null ? void 0 : o.user) == null ? void 0 : M.id) || t.id || "unknown",
354
- name: E,
355
- image: v,
353
+ id: ((p = o == null ? void 0 : o.user) == null ? void 0 : p.id) || t.id || "unknown",
354
+ name: w,
355
+ image: I,
356
356
  size: 44,
357
357
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
358
358
  }
359
359
  ),
360
- /* @__PURE__ */ u("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
361
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2", children: [
360
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
361
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
362
362
  /* @__PURE__ */ e(
363
363
  "h3",
364
364
  {
365
- className: S(
365
+ className: R(
366
366
  "text-sm font-medium truncate",
367
367
  d ? "text-primary" : "text-charcoal"
368
368
  ),
369
- children: E
369
+ children: w
370
370
  }
371
371
  ),
372
- x && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: x })
372
+ g && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: g })
373
373
  ] }),
374
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
375
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: T }),
376
- C > 0 && /* @__PURE__ */ e("span", { className: "bg-primary text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: C > 99 ? "99+" : C })
374
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
375
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: S }),
376
+ b > 0 && /* @__PURE__ */ e("span", { className: "bg-primary text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: b > 99 ? "99+" : b })
377
377
  ] })
378
378
  ] })
379
379
  ] })
380
380
  }
381
381
  );
382
- }, Ze = ({
382
+ }, Ke = ({
383
383
  onChannelSelect: t,
384
384
  selectedChannel: s,
385
385
  filters: n,
386
- className: r
386
+ className: r,
387
+ customEmptyStateIndicator: i
387
388
  }) => {
388
- const a = q.useRef(0);
389
- a.current++;
390
- const { debug: d = !1 } = ne();
391
- return d && console.log("📺 [ChannelList] 🔄 RENDER START", {
392
- renderCount: a.current,
389
+ const d = Y.useRef(0);
390
+ d.current++;
391
+ const { debug: a = !1 } = ne();
392
+ return a && console.log("📺 [ChannelList] 🔄 RENDER START", {
393
+ renderCount: d.current,
393
394
  selectedChannelId: s == null ? void 0 : s.id,
394
395
  filters: n
395
396
  }), /* @__PURE__ */ e(
396
397
  "div",
397
398
  {
398
- className: S(
399
+ className: R(
399
400
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
400
401
  r
401
402
  ),
402
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (d && console.log("📺 [ChannelList] 🎬 RENDERING STREAM CHANNEL LIST", {
403
- renderCount: a.current,
403
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (a && console.log("📺 [ChannelList] 🎬 RENDERING STREAM CHANNEL LIST", {
404
+ renderCount: d.current,
404
405
  filters: n
405
406
  }), /* @__PURE__ */ e(
406
- De,
407
+ pe,
407
408
  {
408
409
  filters: n,
409
410
  sort: { last_message_at: -1 },
410
411
  options: { limit: 30 },
411
- Preview: (i) => {
412
- var l, o;
413
- return d && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
414
- channelId: (l = i.channel) == null ? void 0 : l.id,
412
+ Preview: (l) => {
413
+ var o, w;
414
+ return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
415
+ channelId: (o = l.channel) == null ? void 0 : o.id,
415
416
  selectedChannelId: s == null ? void 0 : s.id,
416
- isSelected: (s == null ? void 0 : s.id) === ((o = i.channel) == null ? void 0 : o.id)
417
+ isSelected: (s == null ? void 0 : s.id) === ((w = l.channel) == null ? void 0 : w.id)
417
418
  }), /* @__PURE__ */ e(
418
- Xe,
419
+ Ze,
419
420
  {
420
- ...i,
421
+ ...l,
421
422
  selectedChannel: s,
422
423
  onChannelSelect: t,
423
- debug: d
424
+ debug: a
424
425
  }
425
426
  );
426
- }
427
+ },
428
+ EmptyStateIndicator: i
427
429
  },
428
430
  JSON.stringify(n)
429
431
  )) })
@@ -438,7 +440,7 @@ const Y = ({
438
440
  "button",
439
441
  {
440
442
  type: "button",
441
- className: S(
443
+ className: R(
442
444
  "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",
443
445
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
444
446
  s
@@ -448,11 +450,11 @@ const Y = ({
448
450
  }
449
451
  );
450
452
  function xe({ label: t, className: s, children: n, ...r }) {
451
- return /* @__PURE__ */ u(
453
+ return /* @__PURE__ */ c(
452
454
  "button",
453
455
  {
454
456
  type: "button",
455
- className: S(
457
+ className: R(
456
458
  "rounded-full p-2 transition-colors focus-ring",
457
459
  {
458
460
  "cursor-not-allowed opacity-50": r.disabled,
@@ -471,17 +473,17 @@ function xe({ label: t, className: s, children: n, ...r }) {
471
473
  function Ne({ onClick: t }) {
472
474
  return /* @__PURE__ */ e(xe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(he, { className: "h-5 w-5 text-stone", weight: "bold" }) });
473
475
  }
474
- const Ke = () => {
475
- const { handleSubmit: t } = Me(), s = Pe();
476
- return /* @__PURE__ */ u(se, { children: [
477
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ue, {}) }),
478
- /* @__PURE__ */ u("div", { className: "central-container w-full p-2 bg-white rounded-lg 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: [
479
- /* @__PURE__ */ e(Oe, {}),
476
+ const es = () => {
477
+ const { handleSubmit: t } = Pe(), s = Ue();
478
+ return /* @__PURE__ */ c(se, { children: [
479
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Oe, {}) }),
480
+ /* @__PURE__ */ c("div", { className: "central-container w-full p-2 bg-white rounded-lg 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: [
480
481
  /* @__PURE__ */ e(Le, {}),
481
482
  /* @__PURE__ */ e(_e, {}),
482
- /* @__PURE__ */ u("div", { className: "flex", children: [
483
+ /* @__PURE__ */ e(je, {}),
484
+ /* @__PURE__ */ c("div", { className: "flex", children: [
483
485
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4", children: /* @__PURE__ */ e(
484
- je,
486
+ Ae,
485
487
  {
486
488
  className: "align-middle w-full resize-none outline-none",
487
489
  maxRows: 4
@@ -496,34 +498,34 @@ const Ke = () => {
496
498
  disabled: !s,
497
499
  onClick: t,
498
500
  type: "button",
499
- children: /* @__PURE__ */ e($e, { className: "size-4" })
501
+ children: /* @__PURE__ */ e(He, { className: "size-4" })
500
502
  }
501
503
  )
502
504
  ] })
503
505
  ] })
504
506
  ] });
505
- }, es = ({
507
+ }, ss = ({
506
508
  renderActions: t
507
- }) => /* @__PURE__ */ u("div", { className: "message-input flex items-center gap-2 p-4", children: [
509
+ }) => /* @__PURE__ */ c("div", { className: "message-input flex items-center gap-2 p-4", children: [
508
510
  t && (t == null ? void 0 : t()),
509
- /* @__PURE__ */ e(pe, { Input: Ke })
510
- ] }), be = () => /* @__PURE__ */ e("div", { className: "messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
511
+ /* @__PURE__ */ e(Me, { Input: es })
512
+ ] }), be = () => /* @__PURE__ */ e("div", { className: "messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
511
513
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "No messages yet 👀" }),
512
514
  /* @__PURE__ */ e("p", { className: "text-stone text-xs", children: "Share to social media to generate more conversations" })
513
- ] }) }), ss = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
514
- var o, E, v, m, h;
515
- const { channel: a } = fe(), d = q.useMemo(() => Object.values(a.state.members || {}).find(
516
- (x) => {
517
- var C;
518
- return ((C = x.user) == null ? void 0 : C.id) && x.user.id !== a._client.userID;
515
+ ] }) }), ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
516
+ var o, w, I, N, m;
517
+ const { channel: i } = fe(), d = Y.useMemo(() => Object.values(i.state.members || {}).find(
518
+ (g) => {
519
+ var b;
520
+ return ((b = g.user) == null ? void 0 : b.id) && g.user.id !== i._client.userID;
519
521
  }
520
- ), [a._client.userID, a.state.members]), i = ((o = d == null ? void 0 : d.user) == null ? void 0 : o.name) || ((E = d == null ? void 0 : d.user) == null ? void 0 : E.id) || "Unknown member", l = (v = d == null ? void 0 : d.user) == null ? void 0 : v.image;
521
- return /* @__PURE__ */ u("div", { className: "@container", children: [
522
- /* @__PURE__ */ u("div", { className: "flex justify-between items-center @md:hidden", children: [
522
+ ), [i._client.userID, i.state.members]), a = ((o = d == null ? void 0 : d.user) == null ? void 0 : o.name) || ((w = d == null ? void 0 : d.user) == null ? void 0 : w.id) || "Unknown member", l = (I = d == null ? void 0 : d.user) == null ? void 0 : I.image;
523
+ return /* @__PURE__ */ c("div", { className: "@container", children: [
524
+ /* @__PURE__ */ c("div", { className: "flex justify-between items-center @md:hidden", children: [
523
525
  /* @__PURE__ */ e(
524
526
  "button",
525
527
  {
526
- className: S(
528
+ className: R(
527
529
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
528
530
  !s && "invisible"
529
531
  ),
@@ -532,22 +534,22 @@ const Ke = () => {
532
534
  children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
533
535
  }
534
536
  ),
535
- /* @__PURE__ */ u("div", { className: "flex flex-col gap-1 items-center", children: [
537
+ /* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
536
538
  /* @__PURE__ */ e(
537
- Y,
539
+ J,
538
540
  {
539
- id: ((m = d == null ? void 0 : d.user) == null ? void 0 : m.id) || a.id || "unknown",
540
- name: i,
541
+ id: ((N = d == null ? void 0 : d.user) == null ? void 0 : N.id) || i.id || "unknown",
542
+ name: a,
541
543
  image: l,
542
544
  size: 40
543
545
  }
544
546
  ),
545
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: i })
547
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
546
548
  ] }),
547
549
  /* @__PURE__ */ e(
548
550
  "button",
549
551
  {
550
- className: S(
552
+ className: R(
551
553
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
552
554
  ),
553
555
  onClick: n || (() => {
@@ -556,8 +558,8 @@ const Ke = () => {
556
558
  }
557
559
  )
558
560
  ] }),
559
- /* @__PURE__ */ u("div", { className: "hidden @md:flex items-center justify-between gap-3 min-h-12", children: [
560
- /* @__PURE__ */ u("div", { className: "flex items-center gap-4 min-w-0", children: [
561
+ /* @__PURE__ */ c("div", { className: "hidden @md:flex items-center justify-between gap-3 min-h-12", children: [
562
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
561
563
  s && t && /* @__PURE__ */ e(
562
564
  "button",
563
565
  {
@@ -569,20 +571,20 @@ const Ke = () => {
569
571
  }
570
572
  ),
571
573
  /* @__PURE__ */ e(
572
- Y,
574
+ J,
573
575
  {
574
- id: ((h = d == null ? void 0 : d.user) == null ? void 0 : h.id) || a.id || "unknown",
575
- name: i,
576
+ id: ((m = d == null ? void 0 : d.user) == null ? void 0 : m.id) || i.id || "unknown",
577
+ name: a,
576
578
  image: l,
577
579
  size: 40
578
580
  }
579
581
  ),
580
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: i }) })
582
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
581
583
  ] }),
582
584
  r && n && /* @__PURE__ */ e(
583
585
  "button",
584
586
  {
585
- className: S(
587
+ className: R(
586
588
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
587
589
  ),
588
590
  onClick: n,
@@ -591,80 +593,80 @@ const Ke = () => {
591
593
  )
592
594
  ] })
593
595
  ] });
594
- }, ns = ({
596
+ }, ts = ({
595
597
  isOpen: t,
596
598
  onClose: s,
597
599
  participant: n,
598
600
  channel: r,
599
- followerStatusLabel: a,
601
+ followerStatusLabel: i,
600
602
  onLeaveConversation: d,
601
- onBlockParticipant: i
603
+ onBlockParticipant: a
602
604
  }) => {
603
- var p, A, J, H, G, Q, V;
604
- const { service: l, debug: o } = ne(), E = z(null), [v, m] = w(!1), [h, T] = w(!1), [x, C] = w(!1);
605
- $(() => {
606
- const k = E.current;
605
+ var _, O, W, Q, G, V, X;
606
+ const { service: l, debug: o } = ne(), w = $(null), [I, N] = y(!1), [m, S] = y(!1), [g, b] = y(!1);
607
+ H(() => {
608
+ const k = w.current;
607
609
  k && (t ? k.showModal() : k.close());
608
610
  }, [t]);
609
- const f = P(async () => {
611
+ const E = P(async () => {
610
612
  var k;
611
613
  if (!(!l || !((k = n == null ? void 0 : n.user) != null && k.id)))
612
614
  try {
613
- const _ = (await l.getBlockedUsers()).some(
615
+ const A = (await l.getBlockedUsers()).some(
614
616
  (j) => {
615
- var X;
616
- return j.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
617
+ var B;
618
+ return j.blocked_user_id === ((B = n == null ? void 0 : n.user) == null ? void 0 : B.id);
617
619
  }
618
620
  );
619
- m(_);
620
- } catch (O) {
621
+ N(A);
622
+ } catch (M) {
621
623
  console.error(
622
624
  "[ChannelInfoDialog] Failed to check blocked status:",
623
- O
625
+ M
624
626
  );
625
627
  }
626
- }, [l, (p = n == null ? void 0 : n.user) == null ? void 0 : p.id]);
627
- $(() => {
628
- t && f();
629
- }, [t, f]);
630
- const R = async () => {
628
+ }, [l, (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id]);
629
+ H(() => {
630
+ t && E();
631
+ }, [t, E]);
632
+ const v = async () => {
631
633
  var k;
632
- if (!h) {
633
- o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), T(!0);
634
+ if (!m) {
635
+ o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
634
636
  try {
635
- const O = ((k = r._client) == null ? void 0 : k.userID) ?? null;
636
- await r.hide(O, !1), d && await d(r), s();
637
- } catch (O) {
638
- console.error("[ChannelInfoDialog] Failed to leave conversation", O);
637
+ const M = ((k = r._client) == null ? void 0 : k.userID) ?? null;
638
+ await r.hide(M, !1), d && await d(r), s();
639
+ } catch (M) {
640
+ console.error("[ChannelInfoDialog] Failed to leave conversation", M);
639
641
  } finally {
640
- T(!1);
642
+ S(!1);
641
643
  }
642
644
  }
643
- }, I = async () => {
644
- var k, O, _;
645
- if (!(x || !l)) {
646
- o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), C(!0);
645
+ }, F = async () => {
646
+ var k, M, A;
647
+ if (!(g || !l)) {
648
+ o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), b(!0);
647
649
  try {
648
- await l.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), i && await i((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), s();
650
+ await l.blockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
649
651
  } catch (j) {
650
652
  console.error("[ChannelInfoDialog] Failed to block member", j);
651
653
  } finally {
652
- C(!1);
654
+ b(!1);
653
655
  }
654
656
  }
655
- }, y = async () => {
656
- var k, O, _;
657
- if (!(x || !l)) {
658
- o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), C(!0);
657
+ }, C = async () => {
658
+ var k, M, A;
659
+ if (!(g || !l)) {
660
+ o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), b(!0);
659
661
  try {
660
- await l.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), i && await i((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), s();
662
+ await l.unBlockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
661
663
  } catch (j) {
662
664
  console.error("[ChannelInfoDialog] Failed to unblock member", j);
663
665
  } finally {
664
- C(!1);
666
+ b(!1);
665
667
  }
666
668
  }
667
- }, F = () => {
669
+ }, T = () => {
668
670
  s(), window.open(
669
671
  "https://linktr.ee/s/about/trust-center/report",
670
672
  "_blank",
@@ -672,99 +674,99 @@ const Ke = () => {
672
674
  );
673
675
  };
674
676
  if (!n) return null;
675
- const M = ((A = n.user) == null ? void 0 : A.name) || ((J = n.user) == null ? void 0 : J.id) || "Unknown member", c = (H = n.user) == null ? void 0 : H.image, g = (G = n.user) == null ? void 0 : G.email, b = (Q = n.user) == null ? void 0 : Q.username, D = g || (b ? `linktr.ee/${b}` : void 0), W = ((V = n.user) == null ? void 0 : V.id) || "unknown";
677
+ const p = ((O = n.user) == null ? void 0 : O.name) || ((W = n.user) == null ? void 0 : W.id) || "Unknown member", u = (Q = n.user) == null ? void 0 : Q.image, f = (G = n.user) == null ? void 0 : G.email, x = (V = n.user) == null ? void 0 : V.username, D = f || (x ? `linktr.ee/${x}` : void 0), q = ((X = n.user) == null ? void 0 : X.id) || "unknown";
676
678
  return (
677
679
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
678
680
  /* @__PURE__ */ e(
679
681
  "dialog",
680
682
  {
681
- ref: E,
683
+ ref: w,
682
684
  className: "mes-dialog",
683
685
  onClose: s,
684
686
  onClick: (k) => {
685
- k.target === E.current && s();
687
+ k.target === w.current && s();
686
688
  },
687
- children: /* @__PURE__ */ u("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
688
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
689
+ children: /* @__PURE__ */ c("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
690
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
689
691
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
690
692
  /* @__PURE__ */ e(Ne, { onClick: s })
691
693
  ] }),
692
- /* @__PURE__ */ u("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
694
+ /* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
693
695
  /* @__PURE__ */ e(
694
696
  "div",
695
697
  {
696
698
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
697
699
  style: { backgroundColor: "#FBFAF9" },
698
- children: /* @__PURE__ */ u("div", { className: "flex items-center gap-3 w-full", children: [
700
+ children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
699
701
  /* @__PURE__ */ e(
700
- Y,
702
+ J,
701
703
  {
702
- id: W,
703
- name: M,
704
- image: c,
704
+ id: q,
705
+ name: p,
706
+ image: u,
705
707
  size: 88,
706
708
  className: "!rounded-full"
707
709
  }
708
710
  ),
709
- /* @__PURE__ */ u("div", { className: "flex flex-col min-w-0 flex-1", children: [
710
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
711
+ /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
712
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: p }),
711
713
  D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
712
- a && /* @__PURE__ */ e(
714
+ i && /* @__PURE__ */ e(
713
715
  "span",
714
716
  {
715
717
  className: "mt-1 rounded-full text-xs font-normal w-fit",
716
718
  style: {
717
719
  padding: "4px 8px",
718
- backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
719
- color: a === "Subscribed to you" ? "#008236" : "#78716C",
720
+ backgroundColor: i === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
721
+ color: i === "Subscribed to you" ? "#008236" : "#78716C",
720
722
  lineHeight: "133.333%",
721
723
  letterSpacing: "0.21px"
722
724
  },
723
- children: a
725
+ children: i
724
726
  }
725
727
  )
726
728
  ] })
727
729
  ] })
728
730
  }
729
731
  ),
730
- /* @__PURE__ */ u("ul", { className: "flex flex-col gap-2 mt-2", children: [
731
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(
732
+ /* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
733
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
732
734
  K,
733
735
  {
734
- onClick: R,
735
- disabled: h,
736
- "aria-busy": h,
736
+ onClick: v,
737
+ disabled: m,
738
+ "aria-busy": m,
737
739
  children: [
738
- h ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
740
+ m ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ge, { className: "h-5 w-5" }),
739
741
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
740
742
  ]
741
743
  }
742
744
  ) }),
743
- /* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ u(
745
+ /* @__PURE__ */ e("li", { children: I ? /* @__PURE__ */ c(
744
746
  K,
745
747
  {
746
- onClick: y,
747
- disabled: x,
748
- "aria-busy": x,
748
+ onClick: C,
749
+ disabled: g,
750
+ "aria-busy": g,
749
751
  children: [
750
- x ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
752
+ g ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
751
753
  /* @__PURE__ */ e("span", { children: "Unblock" })
752
754
  ]
753
755
  }
754
- ) : /* @__PURE__ */ u(
756
+ ) : /* @__PURE__ */ c(
755
757
  K,
756
758
  {
757
- onClick: I,
758
- disabled: x,
759
- "aria-busy": x,
759
+ onClick: F,
760
+ disabled: g,
761
+ "aria-busy": g,
760
762
  children: [
761
- x ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
763
+ g ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
762
764
  /* @__PURE__ */ e("span", { children: "Block" })
763
765
  ]
764
766
  }
765
767
  ) }),
766
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(K, { variant: "danger", onClick: F, children: [
767
- /* @__PURE__ */ e(Ge, { className: "h-5 w-5" }),
768
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(K, { variant: "danger", onClick: T, children: [
769
+ /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
768
770
  /* @__PURE__ */ e("span", { children: "Report" })
769
771
  ] }) })
770
772
  ] })
@@ -773,100 +775,107 @@ const Ke = () => {
773
775
  }
774
776
  )
775
777
  );
776
- }, ts = ({
778
+ }, rs = ({
777
779
  onBack: t,
778
780
  showBackButton: s,
779
781
  renderMessageInputActions: n,
780
782
  onLeaveConversation: r,
781
- onBlockParticipant: a,
783
+ onBlockParticipant: i,
782
784
  CustomChannelEmptyState: d = be
783
785
  }) => {
784
- var h, T;
785
- const { channel: i } = fe(), [l, o] = w(!1), E = (((T = (h = i == null ? void 0 : i.state) == null ? void 0 : h.messages) == null ? void 0 : T.length) ?? 0) > 0, v = q.useMemo(() => Object.values(i.state.members || {}).find(
786
- (C) => {
787
- var f;
788
- return ((f = C.user) == null ? void 0 : f.id) && C.user.id !== i._client.userID;
786
+ var m, S;
787
+ const { channel: a } = fe(), [l, o] = y(!1), w = (((S = (m = a == null ? void 0 : a.state) == null ? void 0 : m.messages) == null ? void 0 : S.length) ?? 0) > 0, I = Y.useMemo(() => Object.values(a.state.members || {}).find(
788
+ (b) => {
789
+ var E;
790
+ return ((E = b.user) == null ? void 0 : E.id) && b.user.id !== a._client.userID;
789
791
  }
790
- ), [i._client.userID, i.state.members]), m = q.useMemo(() => {
791
- const x = i.data ?? {};
792
- if (x.followerStatus)
793
- return String(x.followerStatus);
794
- if (x.isFollower !== void 0)
795
- return x.isFollower ? "Subscribed to you" : "Not subscribed";
796
- }, [i.data]);
797
- return /* @__PURE__ */ u(se, { children: [
798
- /* @__PURE__ */ u(Be, { children: [
792
+ ), [a._client.userID, a.state.members]), N = Y.useMemo(() => {
793
+ const g = a.data ?? {};
794
+ if (g.followerStatus)
795
+ return String(g.followerStatus);
796
+ if (g.isFollower !== void 0)
797
+ return g.isFollower ? "Subscribed to you" : "Not subscribed";
798
+ }, [a.data]);
799
+ return /* @__PURE__ */ c(se, { children: [
800
+ /* @__PURE__ */ c(ze, { children: [
799
801
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
800
- ss,
802
+ ns,
801
803
  {
802
804
  onBack: t,
803
805
  showBackButton: s,
804
806
  onShowInfo: () => o(!0),
805
- canShowInfo: !!v
807
+ canShowInfo: !!I
806
808
  }
807
809
  ) }),
808
- /* @__PURE__ */ u("div", { className: "flex-1 overflow-hidden relative", children: [
809
- /* @__PURE__ */ e(ze, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 }),
810
- !E && d && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(d, {}) })
810
+ /* @__PURE__ */ c("div", { className: "flex-1 overflow-hidden relative", children: [
811
+ /* @__PURE__ */ e(
812
+ $e,
813
+ {
814
+ hideDeletedMessages: !0,
815
+ hideNewMessageSeparator: !1,
816
+ messageActions: []
817
+ }
818
+ ),
819
+ !w && d && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(d, {}) })
811
820
  ] }),
812
821
  /* @__PURE__ */ e(
813
- es,
822
+ ss,
814
823
  {
815
- renderActions: () => n == null ? void 0 : n(i)
824
+ renderActions: () => n == null ? void 0 : n(a)
816
825
  }
817
826
  )
818
827
  ] }),
819
828
  /* @__PURE__ */ e(
820
- ns,
829
+ ts,
821
830
  {
822
831
  isOpen: l,
823
832
  onClose: () => o(!1),
824
- participant: v,
825
- channel: i,
826
- followerStatusLabel: m,
833
+ participant: I,
834
+ channel: a,
835
+ followerStatusLabel: N,
827
836
  onLeaveConversation: r,
828
- onBlockParticipant: a
837
+ onBlockParticipant: i
829
838
  }
830
839
  )
831
840
  ] });
832
- }, rs = ({
841
+ }, ls = ({
833
842
  channel: t,
834
843
  onBack: s,
835
844
  showBackButton: n = !1,
836
845
  renderMessageInputActions: r,
837
- onLeaveConversation: a,
846
+ onLeaveConversation: i,
838
847
  onBlockParticipant: d,
839
- className: i,
848
+ className: a,
840
849
  CustomChannelEmptyState: l = be
841
850
  }) => /* @__PURE__ */ e(
842
851
  "div",
843
852
  {
844
- className: S(
853
+ className: R(
845
854
  "messaging-channel-view h-full flex flex-col bg-[#FBFAF9]",
846
- i
855
+ a
847
856
  ),
848
- children: /* @__PURE__ */ e(Ae, { channel: t, children: /* @__PURE__ */ e(
849
- ts,
857
+ children: /* @__PURE__ */ e(Be, { channel: t, children: /* @__PURE__ */ e(
858
+ rs,
850
859
  {
851
860
  onBack: s,
852
861
  showBackButton: n,
853
862
  renderMessageInputActions: r,
854
- onLeaveConversation: a,
863
+ onLeaveConversation: i,
855
864
  onBlockParticipant: d,
856
865
  CustomChannelEmptyState: l
857
866
  }
858
867
  ) })
859
868
  }
860
869
  );
861
- function ls({
870
+ function os({
862
871
  searchQuery: t,
863
872
  setSearchQuery: s,
864
873
  placeholder: n
865
874
  }) {
866
- const r = z(null);
867
- return /* @__PURE__ */ u("div", { className: "relative", children: [
875
+ const r = $(null);
876
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
868
877
  /* @__PURE__ */ e(
869
- Ve,
878
+ We,
870
879
  {
871
880
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
872
881
  weight: "bold"
@@ -879,7 +888,7 @@ function ls({
879
888
  type: "text",
880
889
  placeholder: n,
881
890
  value: t,
882
- onChange: (a) => s(a.target.value),
891
+ onChange: (i) => s(i.target.value),
883
892
  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"
884
893
  }
885
894
  ),
@@ -888,8 +897,8 @@ function ls({
888
897
  {
889
898
  label: "Clear search",
890
899
  onClick: () => {
891
- var a;
892
- s(""), (a = r.current) == null || a.focus();
900
+ var i;
901
+ s(""), (i = r.current) == null || i.focus();
893
902
  },
894
903
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
895
904
  children: /* @__PURE__ */ e(he, { className: "h-4 w-4", weight: "bold" })
@@ -897,156 +906,156 @@ function ls({
897
906
  )
898
907
  ] });
899
908
  }
900
- const os = ({
909
+ const as = ({
901
910
  participantSource: t,
902
911
  onSelectParticipant: s,
903
912
  onClose: n,
904
913
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
905
- participantLabel: a = "participants",
914
+ participantLabel: i = "participants",
906
915
  searchPlaceholder: d = "Search participants...",
907
- className: i
916
+ className: a
908
917
  }) => {
909
- const { debug: l } = ne(), [o, E] = w(""), [v, m] = w([]), [h, T] = w(!1), [x, C] = w(null), [f, R] = w(
918
+ const { debug: l } = ne(), [o, w] = y(""), [I, N] = y([]), [m, S] = y(!1), [g, b] = y(null), [E, v] = y(
910
919
  null
911
- ), I = z(!1);
912
- $(() => {
920
+ ), F = $(!1);
921
+ H(() => {
913
922
  if (t.loading) {
914
923
  l && console.log(
915
924
  "[ParticipantPicker] Waiting for participant source to finish loading..."
916
925
  );
917
926
  return;
918
927
  }
919
- if (I.current) return;
928
+ if (F.current) return;
920
929
  (async () => {
921
- l && console.log("[ParticipantPicker] Loading initial participants..."), T(!0), C(null);
930
+ l && console.log("[ParticipantPicker] Loading initial participants..."), S(!0), b(null);
922
931
  try {
923
- const g = await t.loadParticipants({
932
+ const f = await t.loadParticipants({
924
933
  search: "",
925
934
  // Load all participants initially
926
935
  limit: 100
927
936
  });
928
- m(g.participants), I.current = !0, l && console.log(
937
+ N(f.participants), F.current = !0, l && console.log(
929
938
  "[ParticipantPicker] Participants loaded successfully:",
930
- g.participants.length
939
+ f.participants.length
931
940
  );
932
- } catch (g) {
933
- const b = g instanceof Error ? g.message : "Failed to load participants";
934
- C(b), console.error("[ParticipantPicker] Failed to load participants:", g);
941
+ } catch (f) {
942
+ const x = f instanceof Error ? f.message : "Failed to load participants";
943
+ b(x), console.error("[ParticipantPicker] Failed to load participants:", f);
935
944
  } finally {
936
- T(!1);
945
+ S(!1);
937
946
  }
938
947
  })();
939
948
  }, [t.loading, l]);
940
- const y = v.filter((c) => !r.has(c.id)).filter((c) => {
941
- var b;
949
+ const C = I.filter((u) => !r.has(u.id)).filter((u) => {
950
+ var x;
942
951
  if (!o) return !0;
943
- const g = o.toLowerCase();
944
- return c.name.toLowerCase().includes(g) || ((b = c.email) == null ? void 0 : b.toLowerCase().includes(g)) || !1;
945
- }), F = P(
946
- async (c) => {
947
- if (!f) {
948
- R(c.id);
952
+ const f = o.toLowerCase();
953
+ return u.name.toLowerCase().includes(f) || ((x = u.email) == null ? void 0 : x.toLowerCase().includes(f)) || !1;
954
+ }), T = P(
955
+ async (u) => {
956
+ if (!E) {
957
+ v(u.id);
949
958
  try {
950
- await s(c);
951
- } catch (g) {
952
- console.error("[ParticipantPicker] Failed to start chat:", g), R(null);
959
+ await s(u);
960
+ } catch (f) {
961
+ console.error("[ParticipantPicker] Failed to start chat:", f), v(null);
953
962
  }
954
963
  }
955
964
  },
956
- [s, f]
957
- ), M = (c, g) => {
958
- (c.key === "Enter" || c.key === " ") && (c.preventDefault(), F(g));
965
+ [s, E]
966
+ ), p = (u, f) => {
967
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), T(f));
959
968
  };
960
- return /* @__PURE__ */ u("div", { className: S("flex flex-col h-full", i), children: [
961
- /* @__PURE__ */ u("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
962
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between mb-3", children: [
969
+ return /* @__PURE__ */ c("div", { className: R("flex flex-col h-full", a), children: [
970
+ /* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
971
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
963
972
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
964
973
  /* @__PURE__ */ e(Ne, { onClick: n })
965
974
  ] }),
966
- /* @__PURE__ */ u("p", { className: "text-xs text-stone mb-3", children: [
975
+ /* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
967
976
  "Select a ",
968
- a.slice(0, -1),
977
+ i.slice(0, -1),
969
978
  " to start messaging (",
970
- y.length,
979
+ C.length,
971
980
  " available)",
972
- t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
981
+ t.totalCount !== void 0 && ` • ${t.totalCount} ${i} total`
973
982
  ] }),
974
983
  /* @__PURE__ */ e(
975
- ls,
984
+ os,
976
985
  {
977
986
  searchQuery: o,
978
- setSearchQuery: E,
987
+ setSearchQuery: w,
979
988
  placeholder: d
980
989
  }
981
990
  )
982
991
  ] }),
983
- x && /* @__PURE__ */ u("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
992
+ g && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
984
993
  "Error loading ",
985
- a,
994
+ i,
986
995
  ": ",
987
- x
996
+ g
988
997
  ] }),
989
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: h && y.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
998
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: m && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
990
999
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
991
- /* @__PURE__ */ u("span", { className: "text-sm text-stone", children: [
1000
+ /* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
992
1001
  "Loading ",
993
- a,
1002
+ i,
994
1003
  "..."
995
1004
  ] })
996
- ] }) }) : y.length === 0 ? /* @__PURE__ */ u("div", { className: "p-6 text-center", children: [
1005
+ ] }) }) : C.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
997
1006
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(de, { className: "h-8 w-8 text-charcoal" }) }),
998
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: o ? `No ${a} found` : v.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
999
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: o ? "Try a different search term" : v.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1000
- ] }) : /* @__PURE__ */ u("ul", { className: "space-y-0", children: [
1001
- y.map((c) => {
1002
- const g = c.name || c.email || c.id, b = c.email && c.name ? c.email : c.phone;
1007
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: o ? `No ${i} found` : I.length > 0 ? `Already chatting with all ${i}` : `No ${i} yet` }),
1008
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: o ? "Try a different search term" : I.length > 0 ? `You have existing conversations with all your ${i}` : `${i.charAt(0).toUpperCase() + i.slice(1)} will appear here` })
1009
+ ] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
1010
+ C.map((u) => {
1011
+ const f = u.name || u.email || u.id, x = u.email && u.name ? u.email : u.phone;
1003
1012
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1004
1013
  "button",
1005
1014
  {
1006
1015
  type: "button",
1007
- onClick: () => F(c),
1008
- onKeyDown: (D) => M(D, c),
1016
+ onClick: () => T(u),
1017
+ onKeyDown: (D) => p(D, u),
1009
1018
  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",
1010
- children: /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
1011
- /* @__PURE__ */ u("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1019
+ children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1020
+ /* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1012
1021
  /* @__PURE__ */ e(
1013
- Y,
1022
+ J,
1014
1023
  {
1015
- id: c.id,
1016
- name: g,
1017
- image: c.image,
1024
+ id: u.id,
1025
+ name: f,
1026
+ image: u.image,
1018
1027
  size: 40
1019
1028
  }
1020
1029
  ),
1021
- /* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
1022
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: g }),
1023
- b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1030
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
1031
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: f }),
1032
+ x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
1024
1033
  ] })
1025
1034
  ] }),
1026
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: f === c.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
1035
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: E === u.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
1027
1036
  ] })
1028
1037
  }
1029
- ) }, c.id);
1038
+ ) }, u.id);
1030
1039
  }),
1031
- h && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
1040
+ m && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1032
1041
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1033
1042
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1034
1043
  ] }) })
1035
1044
  ] }) })
1036
1045
  ] });
1037
- }, as = ({ hasChannels: t, onStartConversation: s, participantLabel: n }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
1046
+ }, is = ({ hasChannels: t, onStartConversation: s, participantLabel: n }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1038
1047
  /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-primary-alt/10 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "💬" }) }),
1039
1048
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal", children: "Welcome to Messages" }),
1040
- /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t ? /* @__PURE__ */ u(se, { children: [
1049
+ /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t ? /* @__PURE__ */ c(se, { children: [
1041
1050
  "Choose a conversation from the list or",
1042
1051
  " ",
1043
- s && /* @__PURE__ */ u(me, { onClick: s, children: [
1052
+ s && /* @__PURE__ */ c(me, { onClick: s, children: [
1044
1053
  "start a new conversation with a ",
1045
1054
  n.slice(0, -1),
1046
1055
  "."
1047
1056
  ] })
1048
- ] }) : s && /* @__PURE__ */ u(se, { children: [
1049
- /* @__PURE__ */ u(me, { onClick: s, children: [
1057
+ ] }) : s && /* @__PURE__ */ c(se, { children: [
1058
+ /* @__PURE__ */ c(me, { onClick: s, children: [
1050
1059
  "Start a new conversation with one of your ",
1051
1060
  n
1052
1061
  ] }),
@@ -1064,7 +1073,7 @@ const os = ({
1064
1073
  className: "inline-flex items-center gap-1 text-sm font-medium text-primary hover:text-primary-alt focus:outline-none focus:ring-2 focus:ring-primary",
1065
1074
  children: s
1066
1075
  }
1067
- ), le = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
1076
+ ), le = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1068
1077
  /* @__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: "⚠️" }) }),
1069
1078
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1070
1079
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1077,12 +1086,12 @@ const os = ({
1077
1086
  children: "Go Back"
1078
1087
  }
1079
1088
  )
1080
- ] }) }), is = ({ className: t, message: s }) => /* @__PURE__ */ u(
1089
+ ] }) }), cs = ({ className: t, message: s }) => /* @__PURE__ */ c(
1081
1090
  "div",
1082
1091
  {
1083
- className: S("flex items-center justify-center h-full", t),
1092
+ className: R("flex items-center justify-center h-full", t),
1084
1093
  children: [
1085
- /* @__PURE__ */ u("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1094
+ /* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1086
1095
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
1087
1096
  "animateTransform",
1088
1097
  {
@@ -1120,86 +1129,87 @@ const os = ({
1120
1129
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1121
1130
  ]
1122
1131
  }
1123
- ), cs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ u("div", { className: "flex items-center", children: [
1124
- /* @__PURE__ */ e(is, { className: "w-6 h-6" }),
1132
+ ), ds = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1133
+ /* @__PURE__ */ e(cs, { className: "w-6 h-6" }),
1125
1134
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1126
- ] }) }), bs = ({
1135
+ ] }) }), vs = ({
1127
1136
  capabilities: t = {},
1128
1137
  className: s,
1129
1138
  renderMessageInputActions: n,
1130
1139
  onChannelSelect: r,
1131
- onParticipantSelect: a,
1140
+ onParticipantSelect: i,
1132
1141
  initialParticipantFilter: d,
1133
- initialParticipantData: i,
1142
+ initialParticipantData: a,
1134
1143
  CustomChannelEmptyState: l,
1135
1144
  showChannelList: o = !0,
1136
- filters: E
1145
+ filters: w,
1146
+ channelListCustomEmptyStateIndicator: I
1137
1147
  }) => {
1138
1148
  const {
1139
- service: v,
1149
+ service: N,
1140
1150
  client: m,
1141
- isConnected: h,
1142
- isLoading: T,
1143
- error: x,
1144
- refreshConnection: C,
1145
- debug: f
1146
- } = We(), [R, I] = w(null), [y, F] = w(!1), [M, c] = w(!1), [g, b] = w(/* @__PURE__ */ new Set()), [D, W] = w(0), [p, A] = w(!1), [J, H] = w(null), G = z(null), {
1147
- showStartConversation: Q = !1,
1148
- participantSource: V,
1149
- participantLabel: k = "participants"
1150
- } = t, O = q.useMemo(() => {
1151
- const N = m == null ? void 0 : m.userID;
1151
+ isConnected: S,
1152
+ isLoading: g,
1153
+ error: b,
1154
+ refreshConnection: E,
1155
+ debug: v
1156
+ } = qe(), [F, C] = y(null), [T, p] = y(!1), [u, f] = y(!1), [x, D] = y(/* @__PURE__ */ new Set()), [q, _] = y(0), [O, W] = y(!1), [Q, G] = y(null), V = $(null), {
1157
+ showStartConversation: X = !1,
1158
+ participantSource: k,
1159
+ participantLabel: M = "participants"
1160
+ } = t, A = Y.useMemo(() => {
1161
+ const h = m == null ? void 0 : m.userID;
1152
1162
  return {
1153
1163
  ...{
1154
1164
  type: "messaging",
1155
1165
  last_message_at: { $exists: !0 },
1156
- ...N && {
1157
- members: { $in: [N] },
1166
+ ...h && {
1167
+ members: { $in: [h] },
1158
1168
  hidden: !1
1159
1169
  }
1160
1170
  },
1161
- ...E
1171
+ ...w
1162
1172
  };
1163
- }, [E, m == null ? void 0 : m.userID]), _ = z(null), j = P(async () => {
1164
- if (!m || !h) return;
1165
- const N = m.userID;
1166
- if (N)
1173
+ }, [w, m == null ? void 0 : m.userID]), j = $(null), B = P(async () => {
1174
+ if (!m || !S) return;
1175
+ const h = m.userID;
1176
+ if (h)
1167
1177
  try {
1168
- f && console.log("[MessagingShell] Syncing channels for user:", N);
1178
+ v && console.log("[MessagingShell] Syncing channels for user:", h);
1169
1179
  const L = await m.queryChannels(
1170
1180
  {
1171
1181
  type: "messaging",
1172
- members: { $in: [N] }
1182
+ members: { $in: [h] }
1173
1183
  },
1174
1184
  {},
1175
1185
  { limit: 100 }
1176
1186
  ), U = /* @__PURE__ */ new Set();
1177
- L.forEach((B) => {
1178
- const Ie = B.state.members;
1179
- Object.values(Ie).forEach((Se) => {
1187
+ L.forEach((z) => {
1188
+ const Se = z.state.members;
1189
+ Object.values(Se).forEach((ke) => {
1180
1190
  var oe;
1181
- const re = (oe = Se.user) == null ? void 0 : oe.id;
1182
- re && re !== N && U.add(re);
1191
+ const re = (oe = ke.user) == null ? void 0 : oe.id;
1192
+ re && re !== h && U.add(re);
1183
1193
  });
1184
- }), b(U), F(L.length > 0), _.current = N, f && console.log("[MessagingShell] Channels synced successfully:", {
1194
+ }), D(U), p(L.length > 0), j.current = h, v && console.log("[MessagingShell] Channels synced successfully:", {
1185
1195
  channelCount: L.length,
1186
1196
  memberCount: U.size
1187
1197
  });
1188
1198
  } catch (L) {
1189
1199
  console.error("[MessagingShell] Failed to sync channels:", L);
1190
1200
  }
1191
- }, [m, h, f]);
1192
- $(() => {
1193
- if (!m || !h) return;
1194
- const N = m.userID;
1195
- N && _.current !== N && j();
1196
- }, [m, h, j]), $(() => {
1197
- if (!d || !m || !h) return;
1201
+ }, [m, S, v]);
1202
+ H(() => {
1203
+ if (!m || !S) return;
1204
+ const h = m.userID;
1205
+ h && j.current !== h && B();
1206
+ }, [m, S, B]), H(() => {
1207
+ if (!d || !m || !S) return;
1198
1208
  (async () => {
1199
1209
  const L = m.userID;
1200
1210
  if (L)
1201
1211
  try {
1202
- f && console.log(
1212
+ v && console.log(
1203
1213
  "[MessagingShell] Loading initial conversation with:",
1204
1214
  d
1205
1215
  );
@@ -1212,36 +1222,36 @@ const os = ({
1212
1222
  { limit: 1 }
1213
1223
  );
1214
1224
  if (U.length > 0)
1215
- I(U[0]), A(!0), H(null), r && r(U[0]), f && console.log(
1225
+ C(U[0]), W(!0), G(null), r && r(U[0]), v && console.log(
1216
1226
  "[MessagingShell] Initial conversation loaded:",
1217
1227
  U[0].id
1218
1228
  );
1219
- else if (i && v) {
1220
- f && console.log(
1229
+ else if (a && N) {
1230
+ v && console.log(
1221
1231
  "[MessagingShell] No conversation found, creating one for:",
1222
- i
1232
+ a
1223
1233
  );
1224
1234
  try {
1225
- const B = await v.startChannelWithParticipant({
1226
- id: i.id,
1227
- name: i.name,
1228
- email: i.email,
1229
- phone: i.phone
1235
+ const z = await N.startChannelWithParticipant({
1236
+ id: a.id,
1237
+ name: a.name,
1238
+ email: a.email,
1239
+ phone: a.phone
1230
1240
  });
1231
- I(B), A(!0), H(null), r && r(B), f && console.log(
1241
+ C(z), W(!0), G(null), r && r(z), v && console.log(
1232
1242
  "[MessagingShell] Channel created and loaded:",
1233
- B.id
1243
+ z.id
1234
1244
  );
1235
- } catch (B) {
1245
+ } catch (z) {
1236
1246
  console.error(
1237
1247
  "[MessagingShell] Failed to create conversation:",
1238
- B
1239
- ), H("Failed to create conversation");
1248
+ z
1249
+ ), G("Failed to create conversation");
1240
1250
  }
1241
1251
  } else
1242
- H(
1252
+ G(
1243
1253
  "No conversation found with this account"
1244
- ), f && console.log(
1254
+ ), v && console.log(
1245
1255
  "[MessagingShell] No conversation found for:",
1246
1256
  d
1247
1257
  );
@@ -1249,103 +1259,104 @@ const os = ({
1249
1259
  console.error(
1250
1260
  "[MessagingShell] Failed to load initial conversation:",
1251
1261
  U
1252
- ), H("Failed to load conversation");
1262
+ ), G("Failed to load conversation");
1253
1263
  }
1254
1264
  })();
1255
1265
  }, [
1256
1266
  d,
1257
- i,
1267
+ a,
1258
1268
  m,
1259
- h,
1269
+ S,
1270
+ N,
1260
1271
  v,
1261
- f,
1262
1272
  r
1263
1273
  ]);
1264
- const X = P(
1265
- (N) => {
1266
- I(N), r == null || r(N);
1274
+ const ve = P(
1275
+ (h) => {
1276
+ C(h), r == null || r(h);
1267
1277
  },
1268
1278
  [r]
1269
- ), ve = P(() => {
1270
- p || I(null);
1271
- }, [p]), Ce = P(() => {
1272
- var N;
1273
- V && (W((L) => L + 1), c(!0), (N = G.current) == null || N.showModal());
1274
- }, [V]), we = P(
1275
- async (N) => {
1279
+ ), Ce = P(() => {
1280
+ O || C(null);
1281
+ }, [O]), we = P(() => {
1282
+ var h;
1283
+ k && (_((L) => L + 1), f(!0), (h = V.current) == null || h.showModal());
1284
+ }, [k]), Ee = P(
1285
+ async (h) => {
1276
1286
  var L;
1277
- if (v)
1287
+ if (N)
1278
1288
  try {
1279
- f && console.log(
1289
+ v && console.log(
1280
1290
  "[MessagingShell] Starting conversation with:",
1281
- N.id
1291
+ h.id
1282
1292
  );
1283
- const U = await v.startChannelWithParticipant({
1284
- id: N.id,
1285
- name: N.name,
1286
- email: N.email,
1287
- phone: N.phone
1293
+ const U = await N.startChannelWithParticipant({
1294
+ id: h.id,
1295
+ name: h.name,
1296
+ email: h.email,
1297
+ phone: h.phone
1288
1298
  });
1289
1299
  try {
1290
1300
  await U.show();
1291
- } catch (B) {
1292
- console.warn("[MessagingShell] Failed to unhide channel:", B);
1301
+ } catch (z) {
1302
+ console.warn("[MessagingShell] Failed to unhide channel:", z);
1293
1303
  }
1294
- I(U), c(!1), (L = G.current) == null || L.close(), a == null || a(N);
1304
+ C(U), f(!1), (L = V.current) == null || L.close(), i == null || i(h);
1295
1305
  } catch (U) {
1296
1306
  console.error("[MessagingShell] Failed to start conversation:", U);
1297
1307
  }
1298
1308
  },
1299
- [v, a, f]
1309
+ [N, i, v]
1300
1310
  ), te = P(() => {
1301
- var N;
1302
- c(!1), (N = G.current) == null || N.close();
1303
- }, []), Ee = P(
1304
- async (N) => {
1305
- f && console.log("[MessagingShell] Leaving conversation:", N.id), I(null), A(!1), _.current = null, await j();
1311
+ var h;
1312
+ f(!1), (h = V.current) == null || h.close();
1313
+ }, []), ye = P(
1314
+ async (h) => {
1315
+ v && console.log("[MessagingShell] Leaving conversation:", h.id), C(null), W(!1), j.current = null, await B();
1306
1316
  },
1307
- [j, f]
1308
- ), ye = P(
1309
- async (N) => {
1310
- f && console.log("[MessagingShell] Blocking participant:", N), I(null), A(!1), _.current = null, await j();
1317
+ [B, v]
1318
+ ), Ie = P(
1319
+ async (h) => {
1320
+ v && console.log("[MessagingShell] Blocking participant:", h), C(null), W(!1), j.current = null, await B();
1311
1321
  },
1312
- [j, f]
1313
- ), Z = !!R;
1314
- return T ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(cs, {}) }) : x ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(le, { message: x, onBack: C }) }) : !h || !m ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(
1322
+ [B, v]
1323
+ ), Z = !!F;
1324
+ return g ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(ds, {}) }) : b ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(le, { message: b, onBack: E }) }) : !S || !m ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1315
1325
  le,
1316
1326
  {
1317
1327
  message: "Not connected to messaging service",
1318
- onBack: C
1328
+ onBack: E
1319
1329
  }
1320
- ) }) : J ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ u(
1330
+ ) }) : Q ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(le, { message: Q }) }) : /* @__PURE__ */ c(
1321
1331
  "div",
1322
1332
  {
1323
- className: S(
1333
+ className: R(
1324
1334
  "messaging-shell h-full bg-white overflow-hidden",
1325
1335
  s
1326
1336
  ),
1327
1337
  children: [
1328
- /* @__PURE__ */ u("div", { className: "flex h-full min-h-0", children: [
1338
+ /* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
1329
1339
  /* @__PURE__ */ e(
1330
1340
  "div",
1331
1341
  {
1332
- className: S(
1342
+ className: R(
1333
1343
  "messaging-channel-list-sidebar min-h-0 min-w-0 bg-white lg:bg-chalk lg:flex lg:flex-col lg:border-r lg:border-sand",
1334
1344
  {
1335
1345
  // Explicitly hidden via prop or in direct conversation mode
1336
- "!hidden": o === !1 || p,
1346
+ "!hidden": o === !1 || O,
1337
1347
  // Normal mode: hide on mobile when channel selected, show on desktop
1338
- "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": o !== !1 && !p && Z,
1348
+ "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": o !== !1 && !O && Z,
1339
1349
  // Normal mode: show when no channel selected
1340
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": o !== !1 && !p && !Z
1350
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": o !== !1 && !O && !Z
1341
1351
  }
1342
1352
  ),
1343
1353
  children: /* @__PURE__ */ e(
1344
- Ze,
1354
+ Ke,
1345
1355
  {
1346
- onChannelSelect: X,
1347
- selectedChannel: R || void 0,
1348
- filters: O
1356
+ onChannelSelect: ve,
1357
+ selectedChannel: F || void 0,
1358
+ filters: A,
1359
+ customEmptyStateIndicator: I
1349
1360
  }
1350
1361
  )
1351
1362
  }
@@ -1353,66 +1364,66 @@ const os = ({
1353
1364
  /* @__PURE__ */ e(
1354
1365
  "div",
1355
1366
  {
1356
- className: S(
1367
+ className: R(
1357
1368
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1358
1369
  {
1359
1370
  // In direct conversation mode, always show (full width)
1360
- flex: p || Z,
1371
+ flex: O || Z,
1361
1372
  // Normal mode: hide on mobile when no channel selected
1362
- "hidden lg:flex": !p && !Z
1373
+ "hidden lg:flex": !O && !Z
1363
1374
  }
1364
1375
  ),
1365
- children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1366
- rs,
1376
+ children: F ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1377
+ ls,
1367
1378
  {
1368
- channel: R,
1369
- onBack: ve,
1370
- showBackButton: !p,
1379
+ channel: F,
1380
+ onBack: Ce,
1381
+ showBackButton: !O,
1371
1382
  renderMessageInputActions: n,
1372
- onLeaveConversation: Ee,
1373
- onBlockParticipant: ye,
1383
+ onLeaveConversation: ye,
1384
+ onBlockParticipant: Ie,
1374
1385
  CustomChannelEmptyState: l
1375
1386
  },
1376
- R.id
1387
+ F.id
1377
1388
  ) }) : /* @__PURE__ */ e(
1378
- as,
1389
+ is,
1379
1390
  {
1380
- hasChannels: y,
1381
- onStartConversation: Q ? Ce : void 0,
1382
- participantLabel: k
1391
+ hasChannels: T,
1392
+ onStartConversation: X ? we : void 0,
1393
+ participantLabel: M
1383
1394
  }
1384
1395
  )
1385
1396
  }
1386
1397
  )
1387
1398
  ] }),
1388
- V && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1399
+ k && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1389
1400
  /* @__PURE__ */ e(
1390
1401
  "dialog",
1391
1402
  {
1392
- ref: G,
1403
+ ref: V,
1393
1404
  className: "mes-dialog",
1394
- onClick: (N) => {
1395
- N.target === G.current && te();
1405
+ onClick: (h) => {
1406
+ h.target === V.current && te();
1396
1407
  },
1397
1408
  onClose: te,
1398
1409
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1399
- os,
1410
+ as,
1400
1411
  {
1401
- participantSource: V,
1402
- onSelectParticipant: we,
1412
+ participantSource: k,
1413
+ onSelectParticipant: Ee,
1403
1414
  onClose: te,
1404
- existingParticipantIds: g,
1405
- participantLabel: k,
1406
- searchPlaceholder: `Search ${k}...`
1415
+ existingParticipantIds: x,
1416
+ participantLabel: M,
1417
+ searchPlaceholder: `Search ${M}...`
1407
1418
  },
1408
- D
1419
+ q
1409
1420
  ) })
1410
1421
  }
1411
1422
  )
1412
1423
  ]
1413
1424
  }
1414
1425
  );
1415
- }, ds = ({
1426
+ }, us = ({
1416
1427
  question: t,
1417
1428
  onClick: s,
1418
1429
  loading: n = !1,
@@ -1424,7 +1435,7 @@ const os = ({
1424
1435
  onClick: s,
1425
1436
  disabled: n,
1426
1437
  style: { backgroundColor: "#E6E5E3" },
1427
- className: S(
1438
+ className: R(
1428
1439
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1429
1440
  {
1430
1441
  "hover:brightness-95 active:brightness-90": !n,
@@ -1434,27 +1445,27 @@ const os = ({
1434
1445
  ),
1435
1446
  children: t
1436
1447
  }
1437
- ), vs = ({
1448
+ ), Cs = ({
1438
1449
  faqs: t,
1439
1450
  onFaqClick: s,
1440
1451
  loadingFaqId: n,
1441
1452
  headerText: r,
1442
- className: a,
1453
+ className: i,
1443
1454
  avatarImage: d,
1444
- avatarName: i
1455
+ avatarName: a
1445
1456
  }) => {
1446
- const l = t.filter((o) => o.enabled).sort((o, E) => (o.order ?? 0) - (E.order ?? 0));
1447
- return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: S("px-4 py-6", a), children: /* @__PURE__ */ u("div", { className: "flex gap-3 items-end", children: [
1448
- (d || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1449
- Y,
1457
+ const l = t.filter((o) => o.enabled).sort((o, w) => (o.order ?? 0) - (w.order ?? 0));
1458
+ return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: R("px-4 py-6", i), children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
1459
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1460
+ J,
1450
1461
  {
1451
- id: i || "account",
1452
- name: i || "Account",
1462
+ id: a || "account",
1463
+ name: a || "Account",
1453
1464
  image: d,
1454
1465
  size: 24
1455
1466
  }
1456
1467
  ) }),
1457
- /* @__PURE__ */ u(
1468
+ /* @__PURE__ */ c(
1458
1469
  "div",
1459
1470
  {
1460
1471
  className: "flex-1 rounded-lg p-4 space-y-3",
@@ -1462,7 +1473,7 @@ const os = ({
1462
1473
  children: [
1463
1474
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1464
1475
  l.map((o) => /* @__PURE__ */ e(
1465
- ds,
1476
+ us,
1466
1477
  {
1467
1478
  question: o.question,
1468
1479
  onClick: () => s(o.id),
@@ -1474,59 +1485,59 @@ const os = ({
1474
1485
  }
1475
1486
  )
1476
1487
  ] }) });
1477
- }, Cs = (t, s = {}) => {
1478
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, d] = w([]), [i, l] = w(!1), [o, E] = w(null), [v, m] = w(n), [h, T] = w(!0), [x, C] = w(), f = P(async (F = !1, M) => {
1479
- if (i) return;
1480
- const c = M !== void 0 ? M : v;
1481
- l(!0), E(null);
1488
+ }, ws = (t, s = {}) => {
1489
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [i, d] = y([]), [a, l] = y(!1), [o, w] = y(null), [I, N] = y(n), [m, S] = y(!0), [g, b] = y(), E = P(async (T = !1, p) => {
1490
+ if (a) return;
1491
+ const u = p !== void 0 ? p : I;
1492
+ l(!0), w(null);
1482
1493
  try {
1483
- const g = await t.loadParticipants({
1484
- search: c || void 0,
1494
+ const f = await t.loadParticipants({
1495
+ search: u || void 0,
1485
1496
  limit: r,
1486
- cursor: F ? void 0 : x
1497
+ cursor: T ? void 0 : g
1487
1498
  });
1488
1499
  d(
1489
- (b) => F ? g.participants : [...b, ...g.participants]
1490
- ), T(g.hasMore), C(g.nextCursor);
1491
- } catch (g) {
1492
- const b = g instanceof Error ? g.message : "Failed to load participants";
1493
- E(b), console.error("[useParticipants] Load error:", g);
1500
+ (x) => T ? f.participants : [...x, ...f.participants]
1501
+ ), S(f.hasMore), b(f.nextCursor);
1502
+ } catch (f) {
1503
+ const x = f instanceof Error ? f.message : "Failed to load participants";
1504
+ w(x), console.error("[useParticipants] Load error:", f);
1494
1505
  } finally {
1495
1506
  l(!1);
1496
1507
  }
1497
- }, [t, v, x, r, i]), R = P(() => {
1498
- h && !i && f(!1);
1499
- }, [h, i, f]), I = P((F) => {
1500
- m(F), C(void 0), f(!0, F);
1501
- }, [f]), y = P(() => {
1502
- C(void 0), f(!0);
1503
- }, [f]);
1504
- return $(() => {
1505
- f(!0);
1508
+ }, [t, I, g, r, a]), v = P(() => {
1509
+ m && !a && E(!1);
1510
+ }, [m, a, E]), F = P((T) => {
1511
+ N(T), b(void 0), E(!0, T);
1512
+ }, [E]), C = P(() => {
1513
+ b(void 0), E(!0);
1514
+ }, [E]);
1515
+ return H(() => {
1516
+ E(!0);
1506
1517
  }, [t.loadParticipants]), {
1507
- participants: a,
1508
- loading: i,
1518
+ participants: i,
1519
+ loading: a,
1509
1520
  error: o,
1510
- searchQuery: v,
1511
- hasMore: h,
1521
+ searchQuery: I,
1522
+ hasMore: m,
1512
1523
  totalCount: t.totalCount,
1513
- loadMore: R,
1514
- search: I,
1515
- refresh: y
1524
+ loadMore: v,
1525
+ search: F,
1526
+ refresh: C
1516
1527
  };
1517
1528
  };
1518
1529
  export {
1519
- Y as Avatar,
1530
+ J as Avatar,
1520
1531
  be as ChannelEmptyState,
1521
- Ze as ChannelList,
1522
- rs as ChannelView,
1523
- vs as FaqList,
1524
- ds as FaqListItem,
1525
- Ns as MessagingProvider,
1526
- bs as MessagingShell,
1527
- os as ParticipantPicker,
1528
- Ye as formatRelativeTime,
1529
- We as useMessaging,
1530
- Cs as useParticipants
1532
+ Ke as ChannelList,
1533
+ ls as ChannelView,
1534
+ Cs as FaqList,
1535
+ us as FaqListItem,
1536
+ bs as MessagingProvider,
1537
+ vs as MessagingShell,
1538
+ as as ParticipantPicker,
1539
+ Je as formatRelativeTime,
1540
+ qe as useMessaging,
1541
+ ws as useParticipants
1531
1542
  };
1532
1543
  //# sourceMappingURL=index.js.map