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