@linktr.ee/messaging-react 1.20.0 โ 1.21.0-rc-1771296053
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.d.ts +7 -1
- package/dist/index.js +645 -639
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +7 -0
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/types.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
|
|
2
2
|
import D from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
3
|
+
import j, { createContext as Qe, useContext as Xe, useCallback as F, useState as M, useRef as W, useEffect as q, useMemo as be } from "react";
|
|
4
|
+
import { StreamChatService as Ke } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as es, ChannelList as ss, DateSeparator as ts, useChannelStateContext as we, useChatContext as Fe, areMessageUIPropsEqual as ns, useMessageReminder as rs, useComponentContext as as, Attachment as ls, EditMessageModal as os, MessageBlocked as is, MessageBouncePrompt as cs, MessageDeleted as ds, MessageIsThreadReplyInChannelButtonIndicator as us, MessageRepliesCountButton as ms, ReminderNotification as hs, StreamedMessageText as fs, messageHasAttachments as gs, messageHasReactions as xs, isDateSeparatorMessage as bs, isMessageBlocked as Cs, isMessageBounced as Ns, MessageBounceModal as vs, Poll as ws, MessageText as ps, MessageErrorIcon as ys, useMessageContext as Es, useMessageComposer as Is, useStateStore as _s, MessageInput as Ss, useMessageInputContext as Ms, useMessageComposerHasSendableData as ks, SimpleAttachmentSelector as Rs, QuotedMessagePreview as Ds, AttachmentPreviewList as Ts, TextareaComposer as Fs, MessageTimestamp as Ls, Channel as Ps, WithComponents as Os, Window as Us, MessageList as Bs } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as js, XIcon as pe, ArrowUpIcon as As, ArrowLeftIcon as Ie, StarIcon as _e, DotsThreeIcon as Se, SpinnerGapIcon as ue, SignOutIcon as $s, ProhibitInsetIcon as Me, FlagIcon as zs, MagnifyingGlassIcon as Hs, ChatCircleDotsIcon as ke } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as Re } from "stream-chat";
|
|
8
|
-
const Le =
|
|
8
|
+
const Le = Qe({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const Le = Je({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), fe = () =>
|
|
18
|
+
}), fe = () => Xe(Le), Rt = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -23,9 +23,9 @@ const Le = Je({
|
|
|
23
23
|
capabilities: o = {},
|
|
24
24
|
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const r =
|
|
27
|
-
(m, ...
|
|
28
|
-
c && console.log(`๐ฅ [MessagingProvider] ${m}`, ...
|
|
26
|
+
const r = F(
|
|
27
|
+
(m, ...C) => {
|
|
28
|
+
c && console.log(`๐ฅ [MessagingProvider] ${m}`, ...C);
|
|
29
29
|
},
|
|
30
30
|
[c]
|
|
31
31
|
);
|
|
@@ -35,27 +35,27 @@ const Le = Je({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [
|
|
38
|
+
const [u, b] = M(null), [h, _] = M(null), [x, g] = M(!1), [l, y] = M(!1), [E, w] = M(null), p = W(!1), f = W({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: a,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: o
|
|
43
|
-
}), N =
|
|
43
|
+
}), N = W(0);
|
|
44
44
|
N.current++, r("๐ RENDER INFO", {
|
|
45
45
|
renderCount: N.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: f.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: f.current.apiKey !== a,
|
|
50
|
+
serviceConfigChanged: f.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: f.current.capabilities !== o
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), f.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: a,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: o
|
|
58
|
-
},
|
|
58
|
+
}, q(() => {
|
|
59
59
|
const m = N.current;
|
|
60
60
|
if (r("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: m,
|
|
@@ -64,8 +64,8 @@ const Le = Je({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: f.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: f.current.apiKey === a
|
|
69
69
|
}
|
|
70
70
|
}), !a || !n) {
|
|
71
71
|
r("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
@@ -77,42 +77,42 @@ const Le = Je({
|
|
|
77
77
|
r("๐ CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: m,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: f.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const C = new Ke({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: a,
|
|
85
85
|
debug: c
|
|
86
86
|
});
|
|
87
|
-
return b(
|
|
87
|
+
return b(C), r("โ
SERVICE SET", {
|
|
88
88
|
renderCount: m,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!C
|
|
90
90
|
}), () => {
|
|
91
91
|
r("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), C.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [a, n, c, r]);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
97
|
+
const v = W(null);
|
|
98
|
+
q(() => {
|
|
99
|
+
var C, k;
|
|
100
100
|
if (r("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!
|
|
101
|
+
hasService: !!u,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
104
|
+
isConnecting: p.current,
|
|
105
|
+
isConnected: x,
|
|
106
|
+
dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
|
|
107
|
+
}), !u || !s) {
|
|
108
108
|
r("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (p.current) {
|
|
112
112
|
r("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((C = v.current) == null ? void 0 : C.serviceId) === u && ((k = v.current) == null ? void 0 : k.userId) === s.id) {
|
|
116
116
|
r(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,114 +120,114 @@ const Le = Je({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
r("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
r("๐ STARTING USER CONNECTION", { userId: s.id }), p.current = !0, y(!0), w(null);
|
|
124
124
|
try {
|
|
125
125
|
r("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const T = await u.connectUser(s);
|
|
127
|
+
_(T), g(!0), v.current = { serviceId: u, userId: s.id }, r("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: T.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (T) {
|
|
132
|
+
const S = T instanceof Error ? T.message : "Connection failed";
|
|
133
|
+
w(S), r("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: S
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
y(!1), p.current = !1, r("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: x
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
146
|
-
isConnected:
|
|
144
|
+
}, [u, s, r, x]), q(() => (r("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!u,
|
|
146
|
+
isConnected: x
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
u && x ? (r(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
152
|
-
hasService: !!
|
|
153
|
-
isConnected:
|
|
151
|
+
), v.current = null, u.disconnectUser().catch(console.error)) : r("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!u,
|
|
153
|
+
isConnected: x
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const
|
|
155
|
+
}), [u, x, r]);
|
|
156
|
+
const R = F(async () => {
|
|
157
157
|
if (r("๐ REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!
|
|
158
|
+
hasService: !!u,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
160
|
+
}), !u || !s) {
|
|
161
161
|
r("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
r("๐ STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
r("๐ STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
|
|
165
165
|
try {
|
|
166
|
-
r("๐ DISCONNECTING FOR REFRESH"), await
|
|
167
|
-
const m = await
|
|
168
|
-
|
|
166
|
+
r("๐ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), r("๐ RECONNECTING FOR REFRESH");
|
|
167
|
+
const m = await u.connectUser(s);
|
|
168
|
+
_(m), g(!0), w(null), r("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (m) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const C = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
w(C), r("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: C
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
y(!1), r("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
178
|
+
}, [u, s, r]), d = j.useMemo(() => (r("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
|
+
hasService: !!u,
|
|
180
|
+
hasClient: !!h,
|
|
181
|
+
isConnected: x,
|
|
182
182
|
isLoading: l,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!E,
|
|
184
184
|
capabilitiesKeys: Object.keys(o)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
186
|
+
service: u,
|
|
187
|
+
client: h,
|
|
188
|
+
isConnected: x,
|
|
189
189
|
isLoading: l,
|
|
190
|
-
error:
|
|
190
|
+
error: E,
|
|
191
191
|
capabilities: o,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: R,
|
|
193
193
|
debug: c
|
|
194
194
|
}), [
|
|
195
|
-
d,
|
|
196
195
|
u,
|
|
197
|
-
|
|
196
|
+
h,
|
|
197
|
+
x,
|
|
198
198
|
l,
|
|
199
|
-
|
|
199
|
+
E,
|
|
200
200
|
o,
|
|
201
|
-
|
|
201
|
+
R,
|
|
202
202
|
c,
|
|
203
203
|
r
|
|
204
204
|
]);
|
|
205
205
|
return r("๐ RENDER END", {
|
|
206
206
|
renderCount: N.current,
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(Le.Provider, { value:
|
|
210
|
-
|
|
207
|
+
willRenderChat: !!(h && x),
|
|
208
|
+
contextValueReady: !!d
|
|
209
|
+
}), /* @__PURE__ */ e(Le.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
|
|
210
|
+
es,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: h,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, Gs = () => fe(), Vs = (t, s) => {
|
|
220
220
|
const n = new Date(
|
|
221
221
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
222
|
), o = new Date(
|
|
223
223
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
225
|
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
226
|
-
},
|
|
226
|
+
}, Ws = (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 a =
|
|
230
|
+
const a = Vs(t, s);
|
|
231
231
|
return a === 0 ? t.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit",
|
|
@@ -265,7 +265,7 @@ const Le = Je({
|
|
|
265
265
|
"๐"
|
|
266
266
|
// Melon
|
|
267
267
|
];
|
|
268
|
-
function
|
|
268
|
+
function qs(t) {
|
|
269
269
|
let s = 0;
|
|
270
270
|
for (let n = 0; n < t.length; n++) {
|
|
271
271
|
const a = t.charCodeAt(n);
|
|
@@ -273,8 +273,8 @@ function Ws(t) {
|
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
276
|
+
function Zs(t) {
|
|
277
|
+
const n = qs(t) % De.length;
|
|
278
278
|
return De[n];
|
|
279
279
|
}
|
|
280
280
|
const Q = ({
|
|
@@ -284,7 +284,7 @@ const Q = ({
|
|
|
284
284
|
className: a,
|
|
285
285
|
shape: o = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const c =
|
|
287
|
+
const c = Zs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", b = o === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
@@ -310,29 +310,29 @@ const Q = ({
|
|
|
310
310
|
"aria-hidden": "true",
|
|
311
311
|
className: D(
|
|
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: c
|
|
316
316
|
}
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, Ys = () => /* @__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
|
+
) }), Js = (t) => {
|
|
327
327
|
var s;
|
|
328
328
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
329
|
-
},
|
|
329
|
+
}, Qs = (t) => {
|
|
330
330
|
var s;
|
|
331
331
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
332
332
|
}, ye = (t) => {
|
|
333
333
|
var s;
|
|
334
334
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
335
|
-
}, Pe = (t) =>
|
|
335
|
+
}, Pe = (t) => Js(t) || Qs(t), Xs = (t) => {
|
|
336
336
|
var s;
|
|
337
337
|
return Pe(t) && !((s = t.text) != null && s.trim());
|
|
338
338
|
}, Te = ({
|
|
@@ -346,17 +346,17 @@ const Q = ({
|
|
|
346
346
|
if (n) {
|
|
347
347
|
const c = (o = t.metadata) == null ? void 0 : o.amount_text;
|
|
348
348
|
if (!c) return null;
|
|
349
|
-
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
349
|
+
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
|
|
350
350
|
return /* @__PURE__ */ i("div", { className: r, children: [
|
|
351
|
-
/* @__PURE__ */ e(
|
|
352
|
-
/* @__PURE__ */ e("span", { children:
|
|
351
|
+
/* @__PURE__ */ e(js, { size: s ? 14 : 12 }),
|
|
352
|
+
/* @__PURE__ */ e("span", { children: u })
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
return /* @__PURE__ */ i("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(Ys, {}) }),
|
|
357
357
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
358
358
|
] });
|
|
359
|
-
}, Oe =
|
|
359
|
+
}, Oe = j.memo(
|
|
360
360
|
({
|
|
361
361
|
channel: t,
|
|
362
362
|
selectedChannel: s,
|
|
@@ -365,31 +365,31 @@ const Q = ({
|
|
|
365
365
|
unread: o,
|
|
366
366
|
renderMessagePreview: c
|
|
367
367
|
}) => {
|
|
368
|
-
var N,
|
|
369
|
-
const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id),
|
|
368
|
+
var N, v, R, d, m, C;
|
|
369
|
+
const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
|
|
370
370
|
t && n(t);
|
|
371
|
-
},
|
|
372
|
-
(
|
|
373
|
-
var
|
|
374
|
-
return ((
|
|
371
|
+
}, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
|
|
372
|
+
(k) => {
|
|
373
|
+
var T, S;
|
|
374
|
+
return ((T = k.user) == null ? void 0 : T.id) && k.user.id !== ((S = t == null ? void 0 : t._client) == null ? void 0 : S.userID);
|
|
375
375
|
}
|
|
376
|
-
),
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
return
|
|
381
|
-
})(),
|
|
376
|
+
), _ = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", x = (R = h == null ? void 0 : h.user) == null ? void 0 : R.image, g = (m = (d = t == null ? void 0 : t.state) == null ? void 0 : d.messages) == null ? void 0 : m[t.state.messages.length - 1], y = (() => {
|
|
377
|
+
var T;
|
|
378
|
+
if (g != null && g.text) return g.text;
|
|
379
|
+
const k = (T = g == null ? void 0 : g.attachments) == null ? void 0 : T[0];
|
|
380
|
+
return k ? k.og_scrape_url ? k.og_scrape_url : k.type === "image" ? "๐ท Sent an image" : k.type === "video" ? "๐ฅ Sent a video" : k.type === "audio" ? "๐ต Sent audio" : k.type === "file" ? "๐ Sent a file" : "๐ Sent an attachment" : "No messages yet";
|
|
381
|
+
})(), E = g != null && g.created_at ? Ws(new Date(g.created_at)) : "", w = g ? ye(g) : !1, p = c ? c(g, y) : `${w ? "โจ " : ""}${y}`, f = o ?? 0;
|
|
382
382
|
return a && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
383
383
|
channelId: t == null ? void 0 : t.id,
|
|
384
384
|
isSelected: r,
|
|
385
|
-
participantName:
|
|
386
|
-
unreadCount:
|
|
387
|
-
hasTimestamp: !!
|
|
385
|
+
participantName: _,
|
|
386
|
+
unreadCount: f,
|
|
387
|
+
hasTimestamp: !!E
|
|
388
388
|
}), /* @__PURE__ */ e(
|
|
389
389
|
"button",
|
|
390
390
|
{
|
|
391
391
|
type: "button",
|
|
392
|
-
onClick:
|
|
392
|
+
onClick: u,
|
|
393
393
|
className: D(
|
|
394
394
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
395
395
|
{
|
|
@@ -401,9 +401,9 @@ const Q = ({
|
|
|
401
401
|
/* @__PURE__ */ e(
|
|
402
402
|
Q,
|
|
403
403
|
{
|
|
404
|
-
id: ((
|
|
405
|
-
name:
|
|
406
|
-
image:
|
|
404
|
+
id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
|
|
405
|
+
name: _,
|
|
406
|
+
image: x,
|
|
407
407
|
size: 44,
|
|
408
408
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
409
409
|
}
|
|
@@ -417,14 +417,14 @@ const Q = ({
|
|
|
417
417
|
"text-sm font-medium truncate",
|
|
418
418
|
r ? "text-primary" : "text-charcoal"
|
|
419
419
|
),
|
|
420
|
-
children:
|
|
420
|
+
children: _
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
|
|
423
|
+
E && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: E })
|
|
424
424
|
] }),
|
|
425
425
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
426
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
427
|
-
|
|
426
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: p }),
|
|
427
|
+
f > 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: f > 99 ? "99+" : f })
|
|
428
428
|
] })
|
|
429
429
|
] })
|
|
430
430
|
] })
|
|
@@ -433,7 +433,7 @@ const Q = ({
|
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
435
|
Oe.displayName = "CustomChannelPreview";
|
|
436
|
-
const Ue =
|
|
436
|
+
const Ue = j.memo(
|
|
437
437
|
({
|
|
438
438
|
onChannelSelect: t,
|
|
439
439
|
selectedChannel: s,
|
|
@@ -442,24 +442,24 @@ const Ue = B.memo(
|
|
|
442
442
|
customEmptyStateIndicator: o,
|
|
443
443
|
renderMessagePreview: c
|
|
444
444
|
}) => {
|
|
445
|
-
const r =
|
|
445
|
+
const r = j.useRef(0);
|
|
446
446
|
r.current++;
|
|
447
|
-
const { debug:
|
|
448
|
-
|
|
447
|
+
const { debug: u = !1 } = fe();
|
|
448
|
+
u && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
449
449
|
renderCount: r.current,
|
|
450
450
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
451
451
|
filters: n
|
|
452
452
|
});
|
|
453
|
-
const b =
|
|
453
|
+
const b = j.useMemo(() => (_) => /* @__PURE__ */ e(
|
|
454
454
|
Oe,
|
|
455
455
|
{
|
|
456
|
-
...
|
|
456
|
+
..._,
|
|
457
457
|
selectedChannel: s,
|
|
458
458
|
onChannelSelect: t,
|
|
459
|
-
debug:
|
|
459
|
+
debug: u,
|
|
460
460
|
renderMessagePreview: c
|
|
461
461
|
}
|
|
462
|
-
), [s, t,
|
|
462
|
+
), [s, t, u, c]);
|
|
463
463
|
return /* @__PURE__ */ e(
|
|
464
464
|
"div",
|
|
465
465
|
{
|
|
@@ -468,7 +468,7 @@ const Ue = B.memo(
|
|
|
468
468
|
a
|
|
469
469
|
),
|
|
470
470
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
471
|
-
|
|
471
|
+
ss,
|
|
472
472
|
{
|
|
473
473
|
filters: n,
|
|
474
474
|
sort: { last_message_at: -1 },
|
|
@@ -525,15 +525,15 @@ function Be({ label: t, className: s, children: n, ...a }) {
|
|
|
525
525
|
function je({ onClick: t }) {
|
|
526
526
|
return /* @__PURE__ */ e(Be, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
function
|
|
528
|
+
const Ks = (t) => /* @__PURE__ */ e(ts, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
|
|
529
|
+
function et(t) {
|
|
530
530
|
return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function st(t) {
|
|
533
533
|
const { channel: s } = we(), { client: n } = Fe("useMessageVote"), a = be(
|
|
534
|
-
() =>
|
|
534
|
+
() => et(t.own_reactions),
|
|
535
535
|
[t.own_reactions]
|
|
536
|
-
), o =
|
|
536
|
+
), o = F(async () => {
|
|
537
537
|
if (n != null && n.userID)
|
|
538
538
|
try {
|
|
539
539
|
a === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
|
|
@@ -543,7 +543,7 @@ function et(t) {
|
|
|
543
543
|
);
|
|
544
544
|
} catch {
|
|
545
545
|
}
|
|
546
|
-
}, [s, n == null ? void 0 : n.userID, t.id, a]), c =
|
|
546
|
+
}, [s, n == null ? void 0 : n.userID, t.id, a]), c = F(async () => {
|
|
547
547
|
if (n != null && n.userID)
|
|
548
548
|
try {
|
|
549
549
|
a === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
|
|
@@ -556,7 +556,7 @@ function et(t) {
|
|
|
556
556
|
}, [s, n == null ? void 0 : n.userID, t.id, a]);
|
|
557
557
|
return { selected: a, voteUp: o, voteDown: c };
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
560
560
|
"path",
|
|
561
561
|
{
|
|
562
562
|
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
@@ -566,7 +566,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
566
566
|
strokeLinejoin: "round",
|
|
567
567
|
fill: t ? "currentColor" : "none"
|
|
568
568
|
}
|
|
569
|
-
) }),
|
|
569
|
+
) }), nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
570
570
|
"path",
|
|
571
571
|
{
|
|
572
572
|
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
@@ -576,7 +576,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
576
576
|
strokeLinejoin: "round",
|
|
577
577
|
fill: t ? "currentColor" : "none"
|
|
578
578
|
}
|
|
579
|
-
) }),
|
|
579
|
+
) }), rt = ({
|
|
580
580
|
selected: t,
|
|
581
581
|
onVoteUp: s,
|
|
582
582
|
onVoteDown: n
|
|
@@ -589,7 +589,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
589
589
|
onClick: s,
|
|
590
590
|
"aria-label": "Helpful",
|
|
591
591
|
"aria-pressed": t === "up",
|
|
592
|
-
children: /* @__PURE__ */ e(
|
|
592
|
+
children: /* @__PURE__ */ e(tt, { filled: t === "up" })
|
|
593
593
|
}
|
|
594
594
|
),
|
|
595
595
|
/* @__PURE__ */ e(
|
|
@@ -600,11 +600,11 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
600
600
|
onClick: n,
|
|
601
601
|
"aria-label": "Not helpful",
|
|
602
602
|
"aria-pressed": t === "down",
|
|
603
|
-
children: /* @__PURE__ */ e(
|
|
603
|
+
children: /* @__PURE__ */ e(nt, { filled: t === "down" })
|
|
604
604
|
}
|
|
605
605
|
)
|
|
606
|
-
] }),
|
|
607
|
-
var re,
|
|
606
|
+
] }), at = (t) => {
|
|
607
|
+
var re, ae;
|
|
608
608
|
const {
|
|
609
609
|
additionalMessageInputProps: s,
|
|
610
610
|
chatbotVotingEnabled: n,
|
|
@@ -612,77 +612,77 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
612
612
|
endOfGroup: o,
|
|
613
613
|
firstOfGroup: c,
|
|
614
614
|
groupedByUser: r,
|
|
615
|
-
handleAction:
|
|
615
|
+
handleAction: u,
|
|
616
616
|
handleOpenThread: b,
|
|
617
|
-
handleRetry:
|
|
618
|
-
highlighted:
|
|
619
|
-
isMessageAIGenerated:
|
|
620
|
-
isMyMessage:
|
|
617
|
+
handleRetry: h,
|
|
618
|
+
highlighted: _,
|
|
619
|
+
isMessageAIGenerated: x,
|
|
620
|
+
isMyMessage: g,
|
|
621
621
|
message: l,
|
|
622
|
-
renderText:
|
|
623
|
-
threadList:
|
|
624
|
-
} = t, { client:
|
|
625
|
-
Attachment: m =
|
|
626
|
-
EditMessageModal:
|
|
627
|
-
MessageBlocked:
|
|
628
|
-
MessageBouncePrompt:
|
|
629
|
-
MessageDeleted:
|
|
630
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
631
|
-
MessageRepliesCountButton:
|
|
632
|
-
ReminderNotification: X =
|
|
633
|
-
StreamedMessageText: K =
|
|
634
|
-
PinIndicator:
|
|
635
|
-
} =
|
|
636
|
-
() =>
|
|
637
|
-
[
|
|
638
|
-
),
|
|
622
|
+
renderText: y,
|
|
623
|
+
threadList: E
|
|
624
|
+
} = t, { client: w } = Fe("CustomMessage"), [p, f] = M(!1), N = rs(l.id), { selected: v, voteUp: R, voteDown: d } = st(l), {
|
|
625
|
+
Attachment: m = ls,
|
|
626
|
+
EditMessageModal: C = os,
|
|
627
|
+
MessageBlocked: k = is,
|
|
628
|
+
MessageBouncePrompt: T = cs,
|
|
629
|
+
MessageDeleted: S = ds,
|
|
630
|
+
MessageIsThreadReplyInChannelButtonIndicator: G = us,
|
|
631
|
+
MessageRepliesCountButton: z = ms,
|
|
632
|
+
ReminderNotification: X = hs,
|
|
633
|
+
StreamedMessageText: K = fs,
|
|
634
|
+
PinIndicator: Y
|
|
635
|
+
} = as("CustomMessage"), ee = gs(l), ne = xs(l), J = be(
|
|
636
|
+
() => x == null ? void 0 : x(l),
|
|
637
|
+
[x, l]
|
|
638
|
+
), V = be(
|
|
639
639
|
() => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
|
|
640
640
|
[l]
|
|
641
641
|
);
|
|
642
|
-
if (
|
|
642
|
+
if (bs(l))
|
|
643
643
|
return null;
|
|
644
644
|
if (l.deleted_at || l.type === "deleted")
|
|
645
|
-
return /* @__PURE__ */ e(
|
|
646
|
-
if (
|
|
647
|
-
return /* @__PURE__ */ e(
|
|
648
|
-
const L = !
|
|
649
|
-
let
|
|
650
|
-
|
|
651
|
-
const
|
|
645
|
+
return /* @__PURE__ */ e(S, { message: l });
|
|
646
|
+
if (Cs(l))
|
|
647
|
+
return /* @__PURE__ */ e(k, {});
|
|
648
|
+
const L = !E && !!l.reply_count, P = !E && l.show_in_channel && l.parent_id, H = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, O = Ns(l);
|
|
649
|
+
let B;
|
|
650
|
+
H ? B = () => h(l) : O && (B = () => f(!0));
|
|
651
|
+
const le = D(
|
|
652
652
|
"str-chat__message str-chat__message-simple",
|
|
653
653
|
`str-chat__message--${l.type}`,
|
|
654
654
|
`str-chat__message--${l.status}`,
|
|
655
|
-
|
|
655
|
+
g() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
656
656
|
l.text ? "str-chat__message--has-text" : "has-no-text",
|
|
657
657
|
{
|
|
658
|
-
"str-chat__message--has-attachment":
|
|
659
|
-
"str-chat__message--highlighted":
|
|
658
|
+
"str-chat__message--has-attachment": ee,
|
|
659
|
+
"str-chat__message--highlighted": _,
|
|
660
660
|
"str-chat__message--pinned pinned-message": l.pinned,
|
|
661
|
-
"str-chat__message--with-reactions":
|
|
662
|
-
"str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((
|
|
663
|
-
"str-chat__message-with-thread-link": L ||
|
|
661
|
+
"str-chat__message--with-reactions": ne,
|
|
662
|
+
"str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((ae = l == null ? void 0 : l.error) == null ? void 0 : ae.status) !== 403,
|
|
663
|
+
"str-chat__message-with-thread-link": L || P,
|
|
664
664
|
"str-chat__virtual-message__wrapper--end": o,
|
|
665
665
|
"str-chat__virtual-message__wrapper--first": c,
|
|
666
666
|
"str-chat__virtual-message__wrapper--group": r
|
|
667
667
|
}
|
|
668
|
-
),
|
|
668
|
+
), Z = l.poll_id && w.polls.fromState(l.poll_id), se = Xs(l);
|
|
669
669
|
return /* @__PURE__ */ i(ve, { children: [
|
|
670
670
|
a && /* @__PURE__ */ e(
|
|
671
|
-
|
|
671
|
+
C,
|
|
672
672
|
{
|
|
673
673
|
additionalMessageInputProps: s
|
|
674
674
|
}
|
|
675
675
|
),
|
|
676
|
-
|
|
677
|
-
|
|
676
|
+
p && /* @__PURE__ */ e(
|
|
677
|
+
vs,
|
|
678
678
|
{
|
|
679
|
-
MessageBouncePrompt:
|
|
680
|
-
onClose: () =>
|
|
681
|
-
open:
|
|
679
|
+
MessageBouncePrompt: T,
|
|
680
|
+
onClose: () => f(!1),
|
|
681
|
+
open: p
|
|
682
682
|
}
|
|
683
683
|
),
|
|
684
|
-
/* @__PURE__ */ i("div", { className:
|
|
685
|
-
|
|
684
|
+
/* @__PURE__ */ i("div", { className: le, children: [
|
|
685
|
+
Y && /* @__PURE__ */ e(Y, {}),
|
|
686
686
|
!!N && /* @__PURE__ */ e(X, { reminder: N }),
|
|
687
687
|
l.user && /* @__PURE__ */ e(
|
|
688
688
|
Q,
|
|
@@ -697,74 +697,74 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
697
697
|
"div",
|
|
698
698
|
{
|
|
699
699
|
className: D("str-chat__message-inner", {
|
|
700
|
-
"str-chat__simple-message--error-failed":
|
|
700
|
+
"str-chat__simple-message--error-failed": H || O
|
|
701
701
|
}),
|
|
702
702
|
"data-testid": "message-inner",
|
|
703
|
-
onClick:
|
|
704
|
-
onKeyDown:
|
|
705
|
-
role:
|
|
706
|
-
tabIndex:
|
|
703
|
+
onClick: B,
|
|
704
|
+
onKeyDown: B,
|
|
705
|
+
role: B ? "button" : void 0,
|
|
706
|
+
tabIndex: B ? 0 : void 0,
|
|
707
707
|
style: {
|
|
708
708
|
// Force margins to 0 to prevent hover layout shift
|
|
709
709
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
710
710
|
marginInlineEnd: 0,
|
|
711
711
|
marginInlineStart: 0
|
|
712
712
|
},
|
|
713
|
-
children:
|
|
713
|
+
children: se ? (
|
|
714
714
|
/* Tip-only messages render as a standalone bubble */
|
|
715
715
|
/* @__PURE__ */ e(Te, { message: l, standalone: !0 })
|
|
716
716
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
717
717
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
Z && /* @__PURE__ */ e(ws, { poll: Z }),
|
|
719
|
+
V != null && V.length && !l.quoted_message ? /* @__PURE__ */ e(
|
|
720
720
|
m,
|
|
721
721
|
{
|
|
722
|
-
actionHandler:
|
|
723
|
-
attachments:
|
|
722
|
+
actionHandler: u,
|
|
723
|
+
attachments: V
|
|
724
724
|
}
|
|
725
725
|
) : null,
|
|
726
|
-
|
|
726
|
+
J ? /* @__PURE__ */ e(
|
|
727
727
|
K,
|
|
728
728
|
{
|
|
729
729
|
message: l,
|
|
730
|
-
renderText:
|
|
730
|
+
renderText: y
|
|
731
731
|
}
|
|
732
|
-
) : /* @__PURE__ */ e(
|
|
733
|
-
/* @__PURE__ */ e(
|
|
732
|
+
) : /* @__PURE__ */ e(ps, { message: l, renderText: y }),
|
|
733
|
+
/* @__PURE__ */ e(ys, {})
|
|
734
734
|
] }),
|
|
735
735
|
/* @__PURE__ */ e(Te, { message: l }),
|
|
736
736
|
n && ye(l) && /* @__PURE__ */ e(
|
|
737
|
-
|
|
737
|
+
rt,
|
|
738
738
|
{
|
|
739
|
-
selected:
|
|
740
|
-
onVoteUp:
|
|
741
|
-
onVoteDown:
|
|
739
|
+
selected: v,
|
|
740
|
+
onVoteUp: R,
|
|
741
|
+
onVoteDown: d
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
] })
|
|
745
745
|
}
|
|
746
746
|
),
|
|
747
747
|
L && /* @__PURE__ */ e(
|
|
748
|
-
|
|
748
|
+
z,
|
|
749
749
|
{
|
|
750
750
|
onClick: b,
|
|
751
751
|
reply_count: l.reply_count
|
|
752
752
|
}
|
|
753
753
|
),
|
|
754
|
-
|
|
754
|
+
P && /* @__PURE__ */ e(G, {})
|
|
755
755
|
] }, l.id)
|
|
756
756
|
] });
|
|
757
|
-
},
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
),
|
|
761
|
-
const s =
|
|
762
|
-
return /* @__PURE__ */ e(
|
|
763
|
-
},
|
|
757
|
+
}, lt = j.memo(
|
|
758
|
+
at,
|
|
759
|
+
ns
|
|
760
|
+
), ot = (t) => {
|
|
761
|
+
const s = Es("CustomMessage");
|
|
762
|
+
return /* @__PURE__ */ e(lt, { ...s, ...t });
|
|
763
|
+
}, it = (t) => ({
|
|
764
764
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
765
765
|
(s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
|
|
766
766
|
)
|
|
767
|
-
}),
|
|
767
|
+
}), ct = ({
|
|
768
768
|
link: t,
|
|
769
769
|
onDismiss: s
|
|
770
770
|
}) => {
|
|
@@ -804,32 +804,32 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
804
804
|
]
|
|
805
805
|
}
|
|
806
806
|
);
|
|
807
|
-
},
|
|
808
|
-
const { linkPreviewsManager: t } =
|
|
807
|
+
}, dt = () => {
|
|
808
|
+
const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
|
|
809
809
|
t.state,
|
|
810
|
-
|
|
810
|
+
it
|
|
811
811
|
), n = (o) => {
|
|
812
812
|
t.dismissPreview(o);
|
|
813
813
|
};
|
|
814
814
|
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
|
|
815
|
-
|
|
815
|
+
ct,
|
|
816
816
|
{
|
|
817
817
|
link: o,
|
|
818
818
|
onDismiss: n
|
|
819
819
|
},
|
|
820
820
|
o.og_scrape_url
|
|
821
821
|
)) }) : null;
|
|
822
|
-
},
|
|
823
|
-
const { handleSubmit: t } =
|
|
822
|
+
}, ut = () => {
|
|
823
|
+
const { handleSubmit: t } = Ms(), s = ks();
|
|
824
824
|
return /* @__PURE__ */ i(ve, { children: [
|
|
825
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
825
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Rs, {}) }),
|
|
826
826
|
/* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
827
|
-
/* @__PURE__ */ e(Rs, {}),
|
|
828
|
-
/* @__PURE__ */ e(ct, {}),
|
|
829
827
|
/* @__PURE__ */ e(Ds, {}),
|
|
828
|
+
/* @__PURE__ */ e(dt, {}),
|
|
829
|
+
/* @__PURE__ */ e(Ts, {}),
|
|
830
830
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
831
831
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
832
|
-
|
|
832
|
+
Fs,
|
|
833
833
|
{
|
|
834
834
|
className: "w-full resize-none outline-none leading-6",
|
|
835
835
|
autoFocus: !0,
|
|
@@ -845,18 +845,18 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
845
845
|
disabled: !s,
|
|
846
846
|
onClick: t,
|
|
847
847
|
type: "button",
|
|
848
|
-
children: /* @__PURE__ */ e(
|
|
848
|
+
children: /* @__PURE__ */ e(As, { className: "size-4" })
|
|
849
849
|
}
|
|
850
850
|
)
|
|
851
851
|
] })
|
|
852
852
|
] })
|
|
853
853
|
] });
|
|
854
|
-
},
|
|
854
|
+
}, mt = ({
|
|
855
855
|
renderActions: t
|
|
856
856
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
857
857
|
t && (t == null ? void 0 : t()),
|
|
858
|
-
/* @__PURE__ */ e(
|
|
859
|
-
] }),
|
|
858
|
+
/* @__PURE__ */ e(Ss, { Input: ut })
|
|
859
|
+
] }), ht = (t) => {
|
|
860
860
|
const s = t.message.hide_date === !0;
|
|
861
861
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
862
862
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
@@ -864,9 +864,9 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
864
864
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
865
865
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
866
866
|
] }),
|
|
867
|
-
!s && /* @__PURE__ */ e(
|
|
867
|
+
!s && /* @__PURE__ */ e(Ls, { message: t.message })
|
|
868
868
|
] });
|
|
869
|
-
},
|
|
869
|
+
}, ft = () => null, gt = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
870
870
|
"div",
|
|
871
871
|
{
|
|
872
872
|
className: D("flex items-center justify-center h-full", t),
|
|
@@ -909,45 +909,45 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
909
909
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
910
910
|
]
|
|
911
911
|
}
|
|
912
|
-
), he =
|
|
913
|
-
/* @__PURE__ */ e(
|
|
912
|
+
), he = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
913
|
+
/* @__PURE__ */ e(gt, { className: "w-6 h-6" }),
|
|
914
914
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
915
915
|
] }) }));
|
|
916
916
|
he.displayName = "LoadingState";
|
|
917
|
-
const
|
|
917
|
+
const xt = ({
|
|
918
918
|
onBack: t,
|
|
919
919
|
showBackButton: s,
|
|
920
920
|
onShowInfo: n,
|
|
921
921
|
canShowInfo: a,
|
|
922
922
|
showStarButton: o = !1
|
|
923
923
|
}) => {
|
|
924
|
-
var
|
|
925
|
-
const { channel: c } = we(), r =
|
|
924
|
+
var g, l, y, E, w, p;
|
|
925
|
+
const { channel: c } = we(), r = j.useMemo(() => Object.values(c.state.members || {}).find(
|
|
926
926
|
(N) => {
|
|
927
|
-
var
|
|
928
|
-
return ((
|
|
927
|
+
var v;
|
|
928
|
+
return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== c._client.userID;
|
|
929
929
|
}
|
|
930
|
-
), [c._client.userID, c.state.members]),
|
|
931
|
-
!!((
|
|
930
|
+
), [c._client.userID, c.state.members]), u = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (y = r == null ? void 0 : r.user) == null ? void 0 : y.image, [h, _] = M(
|
|
931
|
+
!!((E = c.state.membership) != null && E.pinned_at)
|
|
932
932
|
);
|
|
933
|
-
|
|
934
|
-
const
|
|
935
|
-
var
|
|
936
|
-
|
|
937
|
-
N != null && N.member ? !!N.member.pinned_at : !!((
|
|
933
|
+
q(() => {
|
|
934
|
+
const f = (N) => {
|
|
935
|
+
var v;
|
|
936
|
+
_(
|
|
937
|
+
N != null && N.member ? !!N.member.pinned_at : !!((v = c.state.membership) != null && v.pinned_at)
|
|
938
938
|
);
|
|
939
939
|
};
|
|
940
|
-
return c.on("member.updated",
|
|
941
|
-
c.off("member.updated",
|
|
940
|
+
return c.on("member.updated", f), () => {
|
|
941
|
+
c.off("member.updated", f);
|
|
942
942
|
};
|
|
943
943
|
}, [c]);
|
|
944
|
-
const
|
|
944
|
+
const x = async () => {
|
|
945
945
|
try {
|
|
946
|
-
|
|
947
|
-
} catch (
|
|
946
|
+
h ? await c.unpin() : await c.pin();
|
|
947
|
+
} catch (f) {
|
|
948
948
|
console.error(
|
|
949
949
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
950
|
-
|
|
950
|
+
f
|
|
951
951
|
);
|
|
952
952
|
}
|
|
953
953
|
};
|
|
@@ -970,30 +970,30 @@ const gt = ({
|
|
|
970
970
|
/* @__PURE__ */ e(
|
|
971
971
|
Q,
|
|
972
972
|
{
|
|
973
|
-
id: ((
|
|
974
|
-
name:
|
|
973
|
+
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || c.id || "unknown",
|
|
974
|
+
name: u,
|
|
975
975
|
image: b,
|
|
976
976
|
size: 40
|
|
977
977
|
}
|
|
978
978
|
),
|
|
979
|
-
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children:
|
|
979
|
+
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
|
|
980
980
|
] }),
|
|
981
981
|
/* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
|
|
982
982
|
o && /* @__PURE__ */ e(
|
|
983
983
|
"button",
|
|
984
984
|
{
|
|
985
985
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
986
|
-
onClick:
|
|
986
|
+
onClick: x,
|
|
987
987
|
type: "button",
|
|
988
|
-
"aria-label":
|
|
988
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
989
989
|
children: /* @__PURE__ */ e(
|
|
990
990
|
_e,
|
|
991
991
|
{
|
|
992
992
|
className: D("size-5", {
|
|
993
|
-
"text-yellow-600":
|
|
994
|
-
"text-black/90": !
|
|
993
|
+
"text-yellow-600": h,
|
|
994
|
+
"text-black/90": !h
|
|
995
995
|
}),
|
|
996
|
-
weight:
|
|
996
|
+
weight: h ? "duotone" : "regular"
|
|
997
997
|
}
|
|
998
998
|
)
|
|
999
999
|
}
|
|
@@ -1025,30 +1025,30 @@ const gt = ({
|
|
|
1025
1025
|
/* @__PURE__ */ e(
|
|
1026
1026
|
Q,
|
|
1027
1027
|
{
|
|
1028
|
-
id: ((
|
|
1029
|
-
name:
|
|
1028
|
+
id: ((p = r == null ? void 0 : r.user) == null ? void 0 : p.id) || c.id || "unknown",
|
|
1029
|
+
name: u,
|
|
1030
1030
|
image: b,
|
|
1031
1031
|
size: 40
|
|
1032
1032
|
}
|
|
1033
1033
|
),
|
|
1034
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children:
|
|
1034
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
|
|
1035
1035
|
] }),
|
|
1036
1036
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1037
1037
|
o && /* @__PURE__ */ e(
|
|
1038
1038
|
"button",
|
|
1039
1039
|
{
|
|
1040
1040
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1041
|
-
onClick:
|
|
1041
|
+
onClick: x,
|
|
1042
1042
|
type: "button",
|
|
1043
|
-
"aria-label":
|
|
1043
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1044
1044
|
children: /* @__PURE__ */ e(
|
|
1045
1045
|
_e,
|
|
1046
1046
|
{
|
|
1047
1047
|
className: D("size-5", {
|
|
1048
|
-
"text-yellow-600":
|
|
1049
|
-
"text-black/90": !
|
|
1048
|
+
"text-yellow-600": h,
|
|
1049
|
+
"text-black/90": !h
|
|
1050
1050
|
}),
|
|
1051
|
-
weight:
|
|
1051
|
+
weight: h ? "duotone" : "regular"
|
|
1052
1052
|
}
|
|
1053
1053
|
)
|
|
1054
1054
|
}
|
|
@@ -1066,7 +1066,7 @@ const gt = ({
|
|
|
1066
1066
|
] })
|
|
1067
1067
|
] })
|
|
1068
1068
|
] });
|
|
1069
|
-
},
|
|
1069
|
+
}, bt = ({
|
|
1070
1070
|
dialogRef: t,
|
|
1071
1071
|
onClose: s,
|
|
1072
1072
|
participant: n,
|
|
@@ -1074,79 +1074,79 @@ const gt = ({
|
|
|
1074
1074
|
followerStatusLabel: o,
|
|
1075
1075
|
onLeaveConversation: c,
|
|
1076
1076
|
onBlockParticipant: r,
|
|
1077
|
-
showDeleteConversation:
|
|
1077
|
+
showDeleteConversation: u = !0,
|
|
1078
1078
|
onDeleteConversationClick: b,
|
|
1079
|
-
onBlockParticipantClick:
|
|
1080
|
-
onReportParticipantClick:
|
|
1079
|
+
onBlockParticipantClick: h,
|
|
1080
|
+
onReportParticipantClick: _
|
|
1081
1081
|
}) => {
|
|
1082
|
-
var X, K,
|
|
1083
|
-
const { service:
|
|
1082
|
+
var X, K, Y, ee, ne, J, V;
|
|
1083
|
+
const { service: x, debug: g } = fe(), [l, y] = M(!1), [E, w] = M(!1), [p, f] = M(!1), N = F(async () => {
|
|
1084
1084
|
var L;
|
|
1085
|
-
if (!(!
|
|
1085
|
+
if (!(!x || !((L = n == null ? void 0 : n.user) != null && L.id)))
|
|
1086
1086
|
try {
|
|
1087
|
-
const
|
|
1088
|
-
(
|
|
1089
|
-
var
|
|
1090
|
-
return
|
|
1087
|
+
const H = (await x.getBlockedUsers()).some(
|
|
1088
|
+
(O) => {
|
|
1089
|
+
var B;
|
|
1090
|
+
return O.blocked_user_id === ((B = n == null ? void 0 : n.user) == null ? void 0 : B.id);
|
|
1091
1091
|
}
|
|
1092
1092
|
);
|
|
1093
|
-
|
|
1094
|
-
} catch (
|
|
1093
|
+
y(H);
|
|
1094
|
+
} catch (P) {
|
|
1095
1095
|
console.error(
|
|
1096
1096
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1097
|
-
|
|
1097
|
+
P
|
|
1098
1098
|
);
|
|
1099
1099
|
}
|
|
1100
|
-
}, [
|
|
1101
|
-
|
|
1100
|
+
}, [x, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
|
|
1101
|
+
q(() => {
|
|
1102
1102
|
N();
|
|
1103
1103
|
}, [N]);
|
|
1104
|
-
const
|
|
1104
|
+
const v = async () => {
|
|
1105
1105
|
var L;
|
|
1106
|
-
if (!
|
|
1107
|
-
b == null || b(),
|
|
1106
|
+
if (!E) {
|
|
1107
|
+
b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
|
|
1108
1108
|
try {
|
|
1109
|
-
const
|
|
1110
|
-
await a.hide(
|
|
1111
|
-
} catch (
|
|
1112
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
1109
|
+
const P = ((L = a._client) == null ? void 0 : L.userID) ?? null;
|
|
1110
|
+
await a.hide(P, !1), c && await c(a), s();
|
|
1111
|
+
} catch (P) {
|
|
1112
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", P);
|
|
1113
1113
|
} finally {
|
|
1114
|
-
|
|
1114
|
+
w(!1);
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
|
-
},
|
|
1118
|
-
var L,
|
|
1119
|
-
if (!(
|
|
1120
|
-
|
|
1117
|
+
}, R = async () => {
|
|
1118
|
+
var L, P, H;
|
|
1119
|
+
if (!(p || !x)) {
|
|
1120
|
+
h == null || h(), g && console.log("[ChannelInfoDialog] Block member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
|
|
1121
1121
|
try {
|
|
1122
|
-
await
|
|
1123
|
-
} catch (
|
|
1124
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
1122
|
+
await x.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
1123
|
+
} catch (O) {
|
|
1124
|
+
console.error("[ChannelInfoDialog] Failed to block member", O);
|
|
1125
1125
|
} finally {
|
|
1126
|
-
|
|
1126
|
+
f(!1);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
},
|
|
1130
|
-
var L,
|
|
1131
|
-
if (!(
|
|
1132
|
-
|
|
1129
|
+
}, d = async () => {
|
|
1130
|
+
var L, P, H;
|
|
1131
|
+
if (!(p || !x)) {
|
|
1132
|
+
h == null || h(), g && console.log("[ChannelInfoDialog] Unblock member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
|
|
1133
1133
|
try {
|
|
1134
|
-
await
|
|
1135
|
-
} catch (
|
|
1136
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
1134
|
+
await x.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
1135
|
+
} catch (O) {
|
|
1136
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", O);
|
|
1137
1137
|
} finally {
|
|
1138
|
-
|
|
1138
|
+
f(!1);
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
1141
|
}, m = () => {
|
|
1142
|
-
|
|
1142
|
+
_ == null || _(), s(), window.open(
|
|
1143
1143
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1144
1144
|
"_blank",
|
|
1145
1145
|
"noopener,noreferrer"
|
|
1146
1146
|
);
|
|
1147
1147
|
};
|
|
1148
1148
|
if (!n) return null;
|
|
1149
|
-
const
|
|
1149
|
+
const C = ((K = n.user) == null ? void 0 : K.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", k = (ee = n.user) == null ? void 0 : ee.image, T = (ne = n.user) == null ? void 0 : ne.email, S = (J = n.user) == null ? void 0 : J.username, G = T || (S ? `linktr.ee/${S}` : void 0), z = ((V = n.user) == null ? void 0 : V.id) || "unknown";
|
|
1150
1150
|
return (
|
|
1151
1151
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1152
1152
|
/* @__PURE__ */ e(
|
|
@@ -1173,16 +1173,16 @@ const gt = ({
|
|
|
1173
1173
|
/* @__PURE__ */ e(
|
|
1174
1174
|
Q,
|
|
1175
1175
|
{
|
|
1176
|
-
id:
|
|
1177
|
-
name:
|
|
1178
|
-
image:
|
|
1176
|
+
id: z,
|
|
1177
|
+
name: C,
|
|
1178
|
+
image: k,
|
|
1179
1179
|
size: 88,
|
|
1180
1180
|
shape: "circle"
|
|
1181
1181
|
}
|
|
1182
1182
|
),
|
|
1183
1183
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1184
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1185
|
-
|
|
1184
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
|
|
1185
|
+
G && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: G }),
|
|
1186
1186
|
o && /* @__PURE__ */ e(
|
|
1187
1187
|
"span",
|
|
1188
1188
|
{
|
|
@@ -1202,14 +1202,14 @@ const gt = ({
|
|
|
1202
1202
|
}
|
|
1203
1203
|
),
|
|
1204
1204
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1205
|
-
|
|
1205
|
+
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1206
1206
|
de,
|
|
1207
1207
|
{
|
|
1208
|
-
onClick:
|
|
1209
|
-
disabled:
|
|
1210
|
-
"aria-busy":
|
|
1208
|
+
onClick: v,
|
|
1209
|
+
disabled: E,
|
|
1210
|
+
"aria-busy": E,
|
|
1211
1211
|
children: [
|
|
1212
|
-
|
|
1212
|
+
E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
|
|
1213
1213
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1214
1214
|
]
|
|
1215
1215
|
}
|
|
@@ -1217,28 +1217,28 @@ const gt = ({
|
|
|
1217
1217
|
/* @__PURE__ */ e("li", { children: l ? /* @__PURE__ */ i(
|
|
1218
1218
|
de,
|
|
1219
1219
|
{
|
|
1220
|
-
onClick:
|
|
1221
|
-
disabled:
|
|
1222
|
-
"aria-busy":
|
|
1220
|
+
onClick: d,
|
|
1221
|
+
disabled: p,
|
|
1222
|
+
"aria-busy": p,
|
|
1223
1223
|
children: [
|
|
1224
|
-
|
|
1224
|
+
p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
|
|
1225
1225
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1226
1226
|
]
|
|
1227
1227
|
}
|
|
1228
1228
|
) : /* @__PURE__ */ i(
|
|
1229
1229
|
de,
|
|
1230
1230
|
{
|
|
1231
|
-
onClick:
|
|
1232
|
-
disabled:
|
|
1233
|
-
"aria-busy":
|
|
1231
|
+
onClick: R,
|
|
1232
|
+
disabled: p,
|
|
1233
|
+
"aria-busy": p,
|
|
1234
1234
|
children: [
|
|
1235
|
-
|
|
1235
|
+
p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
|
|
1236
1236
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1237
1237
|
]
|
|
1238
1238
|
}
|
|
1239
1239
|
) }),
|
|
1240
1240
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
|
|
1241
|
-
/* @__PURE__ */ e(
|
|
1241
|
+
/* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
|
|
1242
1242
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1243
1243
|
] }) })
|
|
1244
1244
|
] })
|
|
@@ -1247,7 +1247,7 @@ const gt = ({
|
|
|
1247
1247
|
}
|
|
1248
1248
|
)
|
|
1249
1249
|
);
|
|
1250
|
-
},
|
|
1250
|
+
}, Ct = ({
|
|
1251
1251
|
onBack: t,
|
|
1252
1252
|
showBackButton: s,
|
|
1253
1253
|
renderMessageInputActions: n,
|
|
@@ -1255,49 +1255,51 @@ const gt = ({
|
|
|
1255
1255
|
onBlockParticipant: o,
|
|
1256
1256
|
showDeleteConversation: c = !0,
|
|
1257
1257
|
onDeleteConversationClick: r,
|
|
1258
|
-
onBlockParticipantClick:
|
|
1258
|
+
onBlockParticipantClick: u,
|
|
1259
1259
|
onReportParticipantClick: b,
|
|
1260
|
-
showStarButton:
|
|
1261
|
-
chatbotVotingEnabled:
|
|
1260
|
+
showStarButton: h = !1,
|
|
1261
|
+
chatbotVotingEnabled: _ = !1,
|
|
1262
|
+
renderChannelBanner: x
|
|
1262
1263
|
}) => {
|
|
1263
|
-
const { channel:
|
|
1264
|
-
(
|
|
1265
|
-
var
|
|
1266
|
-
return ((
|
|
1264
|
+
const { channel: g } = we(), l = W(null), y = j.useMemo(() => Object.values(g.state.members || {}).find(
|
|
1265
|
+
(N) => {
|
|
1266
|
+
var v;
|
|
1267
|
+
return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== g._client.userID;
|
|
1267
1268
|
}
|
|
1268
|
-
), [
|
|
1269
|
-
const
|
|
1270
|
-
if (
|
|
1271
|
-
return String(
|
|
1272
|
-
if (
|
|
1273
|
-
return
|
|
1274
|
-
}, [
|
|
1275
|
-
var
|
|
1276
|
-
(
|
|
1277
|
-
}, []),
|
|
1278
|
-
var
|
|
1279
|
-
(
|
|
1269
|
+
), [g._client.userID, g.state.members]), E = j.useMemo(() => {
|
|
1270
|
+
const f = g.data ?? {};
|
|
1271
|
+
if (f.followerStatus)
|
|
1272
|
+
return String(f.followerStatus);
|
|
1273
|
+
if (f.isFollower !== void 0)
|
|
1274
|
+
return f.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1275
|
+
}, [g.data]), w = F(() => {
|
|
1276
|
+
var f;
|
|
1277
|
+
(f = l.current) == null || f.showModal();
|
|
1278
|
+
}, []), p = F(() => {
|
|
1279
|
+
var f;
|
|
1280
|
+
(f = l.current) == null || f.close();
|
|
1280
1281
|
}, []);
|
|
1281
1282
|
return /* @__PURE__ */ i(ve, { children: [
|
|
1282
1283
|
/* @__PURE__ */ e(
|
|
1283
|
-
|
|
1284
|
+
Os,
|
|
1284
1285
|
{
|
|
1285
1286
|
overrides: {
|
|
1286
|
-
Message: (
|
|
1287
|
+
Message: (f) => /* @__PURE__ */ e(ot, { ...f, chatbotVotingEnabled: _ })
|
|
1287
1288
|
},
|
|
1288
|
-
children: /* @__PURE__ */ i(
|
|
1289
|
+
children: /* @__PURE__ */ i(Us, { children: [
|
|
1289
1290
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1290
|
-
|
|
1291
|
+
xt,
|
|
1291
1292
|
{
|
|
1292
1293
|
onBack: t,
|
|
1293
1294
|
showBackButton: s,
|
|
1294
|
-
onShowInfo:
|
|
1295
|
-
canShowInfo: !!
|
|
1296
|
-
showStarButton:
|
|
1295
|
+
onShowInfo: w,
|
|
1296
|
+
canShowInfo: !!y,
|
|
1297
|
+
showStarButton: h
|
|
1297
1298
|
}
|
|
1298
1299
|
) }),
|
|
1300
|
+
x == null ? void 0 : x(),
|
|
1299
1301
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1300
|
-
|
|
1302
|
+
Bs,
|
|
1301
1303
|
{
|
|
1302
1304
|
hideDeletedMessages: !0,
|
|
1303
1305
|
hideNewMessageSeparator: !1,
|
|
@@ -1305,32 +1307,32 @@ const gt = ({
|
|
|
1305
1307
|
}
|
|
1306
1308
|
) }),
|
|
1307
1309
|
/* @__PURE__ */ e(
|
|
1308
|
-
|
|
1310
|
+
mt,
|
|
1309
1311
|
{
|
|
1310
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1312
|
+
renderActions: () => n == null ? void 0 : n(g)
|
|
1311
1313
|
}
|
|
1312
1314
|
)
|
|
1313
1315
|
] })
|
|
1314
1316
|
}
|
|
1315
1317
|
),
|
|
1316
1318
|
/* @__PURE__ */ e(
|
|
1317
|
-
|
|
1319
|
+
bt,
|
|
1318
1320
|
{
|
|
1319
|
-
dialogRef:
|
|
1320
|
-
onClose:
|
|
1321
|
-
participant:
|
|
1322
|
-
channel:
|
|
1323
|
-
followerStatusLabel:
|
|
1321
|
+
dialogRef: l,
|
|
1322
|
+
onClose: p,
|
|
1323
|
+
participant: y,
|
|
1324
|
+
channel: g,
|
|
1325
|
+
followerStatusLabel: E,
|
|
1324
1326
|
onLeaveConversation: a,
|
|
1325
1327
|
onBlockParticipant: o,
|
|
1326
1328
|
showDeleteConversation: c,
|
|
1327
1329
|
onDeleteConversationClick: r,
|
|
1328
|
-
onBlockParticipantClick:
|
|
1330
|
+
onBlockParticipantClick: u,
|
|
1329
1331
|
onReportParticipantClick: b
|
|
1330
1332
|
}
|
|
1331
1333
|
)
|
|
1332
1334
|
] });
|
|
1333
|
-
}, Ae =
|
|
1335
|
+
}, Ae = j.memo(
|
|
1334
1336
|
({
|
|
1335
1337
|
channel: t,
|
|
1336
1338
|
onBack: s,
|
|
@@ -1339,36 +1341,37 @@ const gt = ({
|
|
|
1339
1341
|
onLeaveConversation: o,
|
|
1340
1342
|
onBlockParticipant: c,
|
|
1341
1343
|
className: r,
|
|
1342
|
-
CustomChannelEmptyState:
|
|
1344
|
+
CustomChannelEmptyState: u = ft,
|
|
1343
1345
|
showDeleteConversation: b = !0,
|
|
1344
|
-
onDeleteConversationClick:
|
|
1345
|
-
onBlockParticipantClick:
|
|
1346
|
-
onReportParticipantClick:
|
|
1347
|
-
dmAgentEnabled:
|
|
1346
|
+
onDeleteConversationClick: h,
|
|
1347
|
+
onBlockParticipantClick: _,
|
|
1348
|
+
onReportParticipantClick: x,
|
|
1349
|
+
dmAgentEnabled: g,
|
|
1348
1350
|
messageMetadata: l,
|
|
1349
|
-
onMessageSent:
|
|
1350
|
-
showStarButton:
|
|
1351
|
-
chatbotVotingEnabled:
|
|
1351
|
+
onMessageSent: y,
|
|
1352
|
+
showStarButton: E = !1,
|
|
1353
|
+
chatbotVotingEnabled: w = !1,
|
|
1354
|
+
renderChannelBanner: p
|
|
1352
1355
|
}) => {
|
|
1353
|
-
const
|
|
1354
|
-
async (
|
|
1355
|
-
var
|
|
1356
|
-
const
|
|
1357
|
-
...
|
|
1358
|
-
...
|
|
1356
|
+
const f = F(
|
|
1357
|
+
async (N, v, R) => {
|
|
1358
|
+
var S;
|
|
1359
|
+
const d = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, m = g && !d, C = {
|
|
1360
|
+
...v,
|
|
1361
|
+
...m && { silent: !0 },
|
|
1359
1362
|
...l && {
|
|
1360
1363
|
metadata: {
|
|
1361
|
-
...
|
|
1364
|
+
...v.metadata ?? {},
|
|
1362
1365
|
...l
|
|
1363
1366
|
}
|
|
1364
1367
|
}
|
|
1365
|
-
},
|
|
1366
|
-
...
|
|
1367
|
-
...
|
|
1368
|
-
},
|
|
1369
|
-
return
|
|
1368
|
+
}, k = {
|
|
1369
|
+
...R,
|
|
1370
|
+
...m && { skip_push: !0 }
|
|
1371
|
+
}, T = await t.sendMessage(C, k);
|
|
1372
|
+
return y == null || y(T), T;
|
|
1370
1373
|
},
|
|
1371
|
-
[t,
|
|
1374
|
+
[t, g, l, y]
|
|
1372
1375
|
);
|
|
1373
1376
|
return /* @__PURE__ */ e(
|
|
1374
1377
|
"div",
|
|
@@ -1378,29 +1381,30 @@ const gt = ({
|
|
|
1378
1381
|
r
|
|
1379
1382
|
),
|
|
1380
1383
|
children: /* @__PURE__ */ e(
|
|
1381
|
-
|
|
1384
|
+
Ps,
|
|
1382
1385
|
{
|
|
1383
1386
|
channel: t,
|
|
1384
|
-
MessageSystem:
|
|
1385
|
-
EmptyStateIndicator:
|
|
1387
|
+
MessageSystem: ht,
|
|
1388
|
+
EmptyStateIndicator: u,
|
|
1386
1389
|
LoadingIndicator: he,
|
|
1387
|
-
DateSeparator:
|
|
1388
|
-
doSendMessageRequest:
|
|
1390
|
+
DateSeparator: Ks,
|
|
1391
|
+
doSendMessageRequest: f,
|
|
1389
1392
|
children: /* @__PURE__ */ e(
|
|
1390
|
-
|
|
1393
|
+
Ct,
|
|
1391
1394
|
{
|
|
1392
1395
|
onBack: s,
|
|
1393
1396
|
showBackButton: n,
|
|
1394
1397
|
renderMessageInputActions: a,
|
|
1395
1398
|
onLeaveConversation: o,
|
|
1396
1399
|
onBlockParticipant: c,
|
|
1397
|
-
CustomChannelEmptyState:
|
|
1400
|
+
CustomChannelEmptyState: u,
|
|
1398
1401
|
showDeleteConversation: b,
|
|
1399
|
-
onDeleteConversationClick:
|
|
1400
|
-
onBlockParticipantClick:
|
|
1401
|
-
onReportParticipantClick:
|
|
1402
|
-
showStarButton:
|
|
1403
|
-
chatbotVotingEnabled:
|
|
1402
|
+
onDeleteConversationClick: h,
|
|
1403
|
+
onBlockParticipantClick: _,
|
|
1404
|
+
onReportParticipantClick: x,
|
|
1405
|
+
showStarButton: E,
|
|
1406
|
+
chatbotVotingEnabled: w,
|
|
1407
|
+
renderChannelBanner: p
|
|
1404
1408
|
}
|
|
1405
1409
|
)
|
|
1406
1410
|
}
|
|
@@ -1410,15 +1414,15 @@ const gt = ({
|
|
|
1410
1414
|
}
|
|
1411
1415
|
);
|
|
1412
1416
|
Ae.displayName = "ChannelView";
|
|
1413
|
-
function
|
|
1417
|
+
function Nt({
|
|
1414
1418
|
searchQuery: t,
|
|
1415
1419
|
setSearchQuery: s,
|
|
1416
1420
|
placeholder: n
|
|
1417
1421
|
}) {
|
|
1418
|
-
const a =
|
|
1422
|
+
const a = W(null);
|
|
1419
1423
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1420
1424
|
/* @__PURE__ */ e(
|
|
1421
|
-
|
|
1425
|
+
Hs,
|
|
1422
1426
|
{
|
|
1423
1427
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1424
1428
|
weight: "bold"
|
|
@@ -1449,7 +1453,7 @@ function Ct({
|
|
|
1449
1453
|
)
|
|
1450
1454
|
] });
|
|
1451
1455
|
}
|
|
1452
|
-
const
|
|
1456
|
+
const vt = ({
|
|
1453
1457
|
participantSource: t,
|
|
1454
1458
|
onSelectParticipant: s,
|
|
1455
1459
|
onClose: n,
|
|
@@ -1458,56 +1462,56 @@ const Nt = ({
|
|
|
1458
1462
|
searchPlaceholder: c = "Search participants...",
|
|
1459
1463
|
className: r
|
|
1460
1464
|
}) => {
|
|
1461
|
-
const { debug:
|
|
1465
|
+
const { debug: u } = fe(), [b, h] = M(""), [_, x] = M([]), [g, l] = M(!1), [y, E] = M(null), [w, p] = M(
|
|
1462
1466
|
null
|
|
1463
|
-
),
|
|
1464
|
-
|
|
1467
|
+
), f = W(!1);
|
|
1468
|
+
q(() => {
|
|
1465
1469
|
if (t.loading) {
|
|
1466
|
-
|
|
1470
|
+
u && console.log(
|
|
1467
1471
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1468
1472
|
);
|
|
1469
1473
|
return;
|
|
1470
1474
|
}
|
|
1471
|
-
if (
|
|
1475
|
+
if (f.current) return;
|
|
1472
1476
|
(async () => {
|
|
1473
|
-
|
|
1477
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), E(null);
|
|
1474
1478
|
try {
|
|
1475
1479
|
const m = await t.loadParticipants({
|
|
1476
1480
|
search: "",
|
|
1477
1481
|
// Load all participants initially
|
|
1478
1482
|
limit: 100
|
|
1479
1483
|
});
|
|
1480
|
-
|
|
1484
|
+
x(m.participants), f.current = !0, u && console.log(
|
|
1481
1485
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1482
1486
|
m.participants.length
|
|
1483
1487
|
);
|
|
1484
1488
|
} catch (m) {
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1489
|
+
const C = m instanceof Error ? m.message : "Failed to load participants";
|
|
1490
|
+
E(C), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1487
1491
|
} finally {
|
|
1488
1492
|
l(!1);
|
|
1489
1493
|
}
|
|
1490
1494
|
})();
|
|
1491
|
-
}, [t.loading,
|
|
1492
|
-
const N =
|
|
1493
|
-
var
|
|
1495
|
+
}, [t.loading, u]);
|
|
1496
|
+
const N = _.filter((d) => !a.has(d.id)).filter((d) => {
|
|
1497
|
+
var C;
|
|
1494
1498
|
if (!b) return !0;
|
|
1495
1499
|
const m = b.toLowerCase();
|
|
1496
|
-
return
|
|
1497
|
-
}),
|
|
1498
|
-
async (
|
|
1499
|
-
if (!
|
|
1500
|
-
|
|
1500
|
+
return d.name.toLowerCase().includes(m) || ((C = d.email) == null ? void 0 : C.toLowerCase().includes(m)) || !1;
|
|
1501
|
+
}), v = F(
|
|
1502
|
+
async (d) => {
|
|
1503
|
+
if (!w) {
|
|
1504
|
+
p(d.id);
|
|
1501
1505
|
try {
|
|
1502
|
-
await s(
|
|
1506
|
+
await s(d);
|
|
1503
1507
|
} catch (m) {
|
|
1504
|
-
console.error("[ParticipantPicker] Failed to start chat:", m),
|
|
1508
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), p(null);
|
|
1505
1509
|
}
|
|
1506
1510
|
}
|
|
1507
1511
|
},
|
|
1508
|
-
[s,
|
|
1509
|
-
),
|
|
1510
|
-
(
|
|
1512
|
+
[s, w]
|
|
1513
|
+
), R = (d, m) => {
|
|
1514
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), v(m));
|
|
1511
1515
|
};
|
|
1512
1516
|
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
|
|
1513
1517
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
@@ -1524,21 +1528,21 @@ const Nt = ({
|
|
|
1524
1528
|
t.totalCount !== void 0 && ` โข ${t.totalCount} ${o} total`
|
|
1525
1529
|
] }),
|
|
1526
1530
|
/* @__PURE__ */ e(
|
|
1527
|
-
|
|
1531
|
+
Nt,
|
|
1528
1532
|
{
|
|
1529
1533
|
searchQuery: b,
|
|
1530
|
-
setSearchQuery:
|
|
1534
|
+
setSearchQuery: h,
|
|
1531
1535
|
placeholder: c
|
|
1532
1536
|
}
|
|
1533
1537
|
)
|
|
1534
1538
|
] }),
|
|
1535
|
-
|
|
1539
|
+
y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1536
1540
|
"Error loading ",
|
|
1537
1541
|
o,
|
|
1538
1542
|
": ",
|
|
1539
|
-
|
|
1543
|
+
y
|
|
1540
1544
|
] }),
|
|
1541
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1545
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g && N.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1542
1546
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1543
1547
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1544
1548
|
"Loading ",
|
|
@@ -1547,46 +1551,46 @@ const Nt = ({
|
|
|
1547
1551
|
] })
|
|
1548
1552
|
] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1549
1553
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ke, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1550
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` :
|
|
1551
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" :
|
|
1554
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : _.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
|
|
1555
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : _.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
|
|
1552
1556
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1553
|
-
N.map((
|
|
1554
|
-
const m =
|
|
1557
|
+
N.map((d) => {
|
|
1558
|
+
const m = d.name || d.email || d.id, C = d.email && d.name ? d.email : d.phone;
|
|
1555
1559
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1556
1560
|
"button",
|
|
1557
1561
|
{
|
|
1558
1562
|
type: "button",
|
|
1559
|
-
onClick: () =>
|
|
1560
|
-
onKeyDown: (
|
|
1563
|
+
onClick: () => v(d),
|
|
1564
|
+
onKeyDown: (k) => R(k, d),
|
|
1561
1565
|
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",
|
|
1562
1566
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1563
1567
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1564
1568
|
/* @__PURE__ */ e(
|
|
1565
1569
|
Q,
|
|
1566
1570
|
{
|
|
1567
|
-
id:
|
|
1571
|
+
id: d.id,
|
|
1568
1572
|
name: m,
|
|
1569
|
-
image:
|
|
1573
|
+
image: d.image,
|
|
1570
1574
|
size: 40
|
|
1571
1575
|
}
|
|
1572
1576
|
),
|
|
1573
1577
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1574
1578
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1575
|
-
|
|
1579
|
+
C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
|
|
1576
1580
|
] })
|
|
1577
1581
|
] }),
|
|
1578
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1582
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === d.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
|
|
1579
1583
|
] })
|
|
1580
1584
|
}
|
|
1581
|
-
) },
|
|
1585
|
+
) }, d.id);
|
|
1582
1586
|
}),
|
|
1583
|
-
|
|
1587
|
+
g && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1584
1588
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1585
1589
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1586
1590
|
] }) })
|
|
1587
1591
|
] }) })
|
|
1588
1592
|
] });
|
|
1589
|
-
},
|
|
1593
|
+
}, wt = ({ className: t }) => /* @__PURE__ */ i(
|
|
1590
1594
|
"svg",
|
|
1591
1595
|
{
|
|
1592
1596
|
width: "140",
|
|
@@ -1720,9 +1724,9 @@ const Nt = ({
|
|
|
1720
1724
|
] })
|
|
1721
1725
|
]
|
|
1722
1726
|
}
|
|
1723
|
-
), $e =
|
|
1727
|
+
), $e = j.memo(
|
|
1724
1728
|
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
1725
|
-
/* @__PURE__ */ e(
|
|
1729
|
+
/* @__PURE__ */ e(wt, {}),
|
|
1726
1730
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1727
1731
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1728
1732
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
@@ -1730,7 +1734,7 @@ const Nt = ({
|
|
|
1730
1734
|
] }) })
|
|
1731
1735
|
);
|
|
1732
1736
|
$e.displayName = "EmptyState";
|
|
1733
|
-
const me =
|
|
1737
|
+
const me = j.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
1734
1738
|
/* @__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: "โ ๏ธ" }) }),
|
|
1735
1739
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1736
1740
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1745,7 +1749,7 @@ const me = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1745
1749
|
)
|
|
1746
1750
|
] }) }));
|
|
1747
1751
|
me.displayName = "ErrorState";
|
|
1748
|
-
const
|
|
1752
|
+
const Dt = ({
|
|
1749
1753
|
capabilities: t = {},
|
|
1750
1754
|
className: s,
|
|
1751
1755
|
renderMessageInputActions: n,
|
|
@@ -1753,114 +1757,115 @@ const Rt = ({
|
|
|
1753
1757
|
onParticipantSelect: o,
|
|
1754
1758
|
initialParticipantFilter: c,
|
|
1755
1759
|
initialParticipantData: r,
|
|
1756
|
-
CustomChannelEmptyState:
|
|
1760
|
+
CustomChannelEmptyState: u,
|
|
1757
1761
|
showChannelList: b = !0,
|
|
1758
|
-
filters:
|
|
1759
|
-
channelListCustomEmptyStateIndicator:
|
|
1760
|
-
onDeleteConversationClick:
|
|
1761
|
-
onBlockParticipantClick:
|
|
1762
|
+
filters: h,
|
|
1763
|
+
channelListCustomEmptyStateIndicator: _,
|
|
1764
|
+
onDeleteConversationClick: x,
|
|
1765
|
+
onBlockParticipantClick: g,
|
|
1762
1766
|
onReportParticipantClick: l,
|
|
1763
|
-
dmAgentEnabled:
|
|
1764
|
-
messageMetadata:
|
|
1765
|
-
onMessageSent:
|
|
1766
|
-
showStarButton:
|
|
1767
|
-
chatbotVotingEnabled:
|
|
1768
|
-
renderMessagePreview: N
|
|
1767
|
+
dmAgentEnabled: y,
|
|
1768
|
+
messageMetadata: E,
|
|
1769
|
+
onMessageSent: w,
|
|
1770
|
+
showStarButton: p = !1,
|
|
1771
|
+
chatbotVotingEnabled: f = !1,
|
|
1772
|
+
renderMessagePreview: N,
|
|
1773
|
+
renderChannelBanner: v
|
|
1769
1774
|
}) => {
|
|
1770
1775
|
const {
|
|
1771
|
-
service:
|
|
1772
|
-
client:
|
|
1773
|
-
isConnected:
|
|
1774
|
-
isLoading:
|
|
1775
|
-
error:
|
|
1776
|
-
refreshConnection:
|
|
1777
|
-
debug:
|
|
1778
|
-
} =
|
|
1779
|
-
participantSource:
|
|
1780
|
-
participantLabel:
|
|
1781
|
-
showDeleteConversation:
|
|
1782
|
-
} = t,
|
|
1783
|
-
const
|
|
1776
|
+
service: R,
|
|
1777
|
+
client: d,
|
|
1778
|
+
isConnected: m,
|
|
1779
|
+
isLoading: C,
|
|
1780
|
+
error: k,
|
|
1781
|
+
refreshConnection: T,
|
|
1782
|
+
debug: S
|
|
1783
|
+
} = Gs(), [G, z] = M(null), [X, K] = M(!1), [Y, ee] = M(!1), [ne, J] = M(!1), [V, L] = M(/* @__PURE__ */ new Set()), [P, H] = M(0), [O, B] = M(!1), [le, Z] = M(null), se = W(null), {
|
|
1784
|
+
participantSource: re,
|
|
1785
|
+
participantLabel: ae = "participants",
|
|
1786
|
+
showDeleteConversation: ze = !0
|
|
1787
|
+
} = t, He = j.useMemo(() => {
|
|
1788
|
+
const I = d == null ? void 0 : d.userID;
|
|
1784
1789
|
return {
|
|
1785
1790
|
...{
|
|
1786
1791
|
type: "messaging",
|
|
1787
1792
|
last_message_at: { $exists: !0 },
|
|
1788
|
-
...
|
|
1789
|
-
members: { $in: [
|
|
1793
|
+
...I && {
|
|
1794
|
+
members: { $in: [I] },
|
|
1790
1795
|
hidden: !1
|
|
1791
1796
|
}
|
|
1792
1797
|
},
|
|
1793
|
-
...
|
|
1798
|
+
...h
|
|
1794
1799
|
};
|
|
1795
|
-
}, [
|
|
1796
|
-
if (!
|
|
1797
|
-
const
|
|
1798
|
-
if (
|
|
1800
|
+
}, [h, d == null ? void 0 : d.userID]), oe = W(null), te = F(async () => {
|
|
1801
|
+
if (!d || !m) return;
|
|
1802
|
+
const I = d.userID;
|
|
1803
|
+
if (I)
|
|
1799
1804
|
try {
|
|
1800
|
-
|
|
1801
|
-
const
|
|
1805
|
+
S && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
1806
|
+
const $ = await d.queryChannels(
|
|
1802
1807
|
{
|
|
1803
1808
|
type: "messaging",
|
|
1804
|
-
members: { $in: [
|
|
1809
|
+
members: { $in: [I] }
|
|
1805
1810
|
},
|
|
1806
1811
|
{},
|
|
1807
1812
|
{ limit: 100 }
|
|
1808
|
-
),
|
|
1809
|
-
|
|
1813
|
+
), U = /* @__PURE__ */ new Set();
|
|
1814
|
+
$.forEach((A) => {
|
|
1810
1815
|
const ge = A.state.members;
|
|
1811
|
-
Object.values(ge).forEach((
|
|
1816
|
+
Object.values(ge).forEach((Je) => {
|
|
1812
1817
|
var Ee;
|
|
1813
|
-
const xe = (Ee =
|
|
1814
|
-
xe && xe !==
|
|
1818
|
+
const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
|
|
1819
|
+
xe && xe !== I && U.add(xe);
|
|
1815
1820
|
});
|
|
1816
|
-
}),
|
|
1817
|
-
channelCount:
|
|
1818
|
-
memberCount:
|
|
1821
|
+
}), L((A) => A.size === U.size && [...A].every((ge) => U.has(ge)) ? A : U), K($.length > 0), ee(!0), oe.current = I, S && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1822
|
+
channelCount: $.length,
|
|
1823
|
+
memberCount: U.size
|
|
1819
1824
|
});
|
|
1820
|
-
} catch (
|
|
1821
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1825
|
+
} catch ($) {
|
|
1826
|
+
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
1822
1827
|
}
|
|
1823
|
-
}, [
|
|
1824
|
-
|
|
1825
|
-
if (!
|
|
1826
|
-
const
|
|
1827
|
-
|
|
1828
|
-
}, [
|
|
1829
|
-
if (!c || !
|
|
1828
|
+
}, [d, m, S]);
|
|
1829
|
+
q(() => {
|
|
1830
|
+
if (!d || !m) return;
|
|
1831
|
+
const I = d.userID;
|
|
1832
|
+
I && oe.current !== I && te();
|
|
1833
|
+
}, [d, m, te]), q(() => {
|
|
1834
|
+
if (!c || !d || !m) return;
|
|
1830
1835
|
(async () => {
|
|
1831
|
-
const
|
|
1832
|
-
if (
|
|
1836
|
+
const $ = d.userID;
|
|
1837
|
+
if ($)
|
|
1833
1838
|
try {
|
|
1834
|
-
|
|
1839
|
+
S && console.log(
|
|
1835
1840
|
"[MessagingShell] Loading initial conversation with:",
|
|
1836
1841
|
c
|
|
1837
1842
|
);
|
|
1838
|
-
const
|
|
1843
|
+
const U = await d.queryChannels(
|
|
1839
1844
|
{
|
|
1840
1845
|
type: "messaging",
|
|
1841
|
-
members: { $eq: [
|
|
1846
|
+
members: { $eq: [$, c] }
|
|
1842
1847
|
},
|
|
1843
1848
|
{},
|
|
1844
1849
|
{ limit: 1 }
|
|
1845
1850
|
);
|
|
1846
|
-
if (
|
|
1847
|
-
|
|
1851
|
+
if (U.length > 0)
|
|
1852
|
+
z(U[0]), B(!0), Z(null), a && a(U[0]), S && console.log(
|
|
1848
1853
|
"[MessagingShell] Initial conversation loaded:",
|
|
1849
|
-
|
|
1854
|
+
U[0].id
|
|
1850
1855
|
);
|
|
1851
|
-
else if (r &&
|
|
1852
|
-
|
|
1856
|
+
else if (r && R) {
|
|
1857
|
+
S && console.log(
|
|
1853
1858
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1854
1859
|
r
|
|
1855
1860
|
);
|
|
1856
1861
|
try {
|
|
1857
|
-
const A = await
|
|
1862
|
+
const A = await R.startChannelWithParticipant({
|
|
1858
1863
|
id: r.id,
|
|
1859
1864
|
name: r.name,
|
|
1860
1865
|
email: r.email,
|
|
1861
1866
|
phone: r.phone
|
|
1862
1867
|
});
|
|
1863
|
-
|
|
1868
|
+
z(A), B(!0), Z(null), a && a(A), S && console.log(
|
|
1864
1869
|
"[MessagingShell] Channel created and loaded:",
|
|
1865
1870
|
A.id
|
|
1866
1871
|
);
|
|
@@ -1868,90 +1873,90 @@ const Rt = ({
|
|
|
1868
1873
|
console.error(
|
|
1869
1874
|
"[MessagingShell] Failed to create conversation:",
|
|
1870
1875
|
A
|
|
1871
|
-
),
|
|
1876
|
+
), Z("Failed to create conversation");
|
|
1872
1877
|
}
|
|
1873
1878
|
} else
|
|
1874
|
-
|
|
1879
|
+
Z(
|
|
1875
1880
|
"No conversation found with this account"
|
|
1876
|
-
),
|
|
1881
|
+
), S && console.log(
|
|
1877
1882
|
"[MessagingShell] No conversation found for:",
|
|
1878
1883
|
c
|
|
1879
1884
|
);
|
|
1880
|
-
} catch (
|
|
1885
|
+
} catch (U) {
|
|
1881
1886
|
console.error(
|
|
1882
1887
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1883
|
-
|
|
1884
|
-
),
|
|
1888
|
+
U
|
|
1889
|
+
), Z("Failed to load conversation");
|
|
1885
1890
|
}
|
|
1886
1891
|
})();
|
|
1887
1892
|
}, [
|
|
1888
1893
|
c,
|
|
1889
1894
|
r,
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1895
|
+
d,
|
|
1896
|
+
m,
|
|
1897
|
+
R,
|
|
1898
|
+
S,
|
|
1894
1899
|
a
|
|
1895
1900
|
]);
|
|
1896
|
-
const
|
|
1897
|
-
(
|
|
1898
|
-
|
|
1901
|
+
const Ge = F(
|
|
1902
|
+
(I) => {
|
|
1903
|
+
z(I), a == null || a(I);
|
|
1899
1904
|
},
|
|
1900
1905
|
[a]
|
|
1901
|
-
),
|
|
1902
|
-
|
|
1903
|
-
}, [
|
|
1904
|
-
async (
|
|
1905
|
-
var
|
|
1906
|
-
if (
|
|
1906
|
+
), Ve = F(() => {
|
|
1907
|
+
O || z(null);
|
|
1908
|
+
}, [O]), We = F(
|
|
1909
|
+
async (I) => {
|
|
1910
|
+
var $;
|
|
1911
|
+
if (R)
|
|
1907
1912
|
try {
|
|
1908
|
-
|
|
1913
|
+
S && console.log(
|
|
1909
1914
|
"[MessagingShell] Starting conversation with:",
|
|
1910
|
-
|
|
1915
|
+
I.id
|
|
1911
1916
|
);
|
|
1912
|
-
const
|
|
1913
|
-
id:
|
|
1914
|
-
name:
|
|
1915
|
-
email:
|
|
1916
|
-
phone:
|
|
1917
|
+
const U = await R.startChannelWithParticipant({
|
|
1918
|
+
id: I.id,
|
|
1919
|
+
name: I.name,
|
|
1920
|
+
email: I.email,
|
|
1921
|
+
phone: I.phone
|
|
1917
1922
|
});
|
|
1918
1923
|
try {
|
|
1919
|
-
await
|
|
1924
|
+
await U.show();
|
|
1920
1925
|
} catch (A) {
|
|
1921
1926
|
console.warn("[MessagingShell] Failed to unhide channel:", A);
|
|
1922
1927
|
}
|
|
1923
|
-
|
|
1924
|
-
} catch (
|
|
1925
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
1928
|
+
z(U), J(!1), ($ = se.current) == null || $.close(), o == null || o(I);
|
|
1929
|
+
} catch (U) {
|
|
1930
|
+
console.error("[MessagingShell] Failed to start conversation:", U);
|
|
1926
1931
|
}
|
|
1927
1932
|
},
|
|
1928
|
-
[
|
|
1929
|
-
), ie =
|
|
1930
|
-
var
|
|
1931
|
-
|
|
1932
|
-
}, []),
|
|
1933
|
-
(
|
|
1934
|
-
|
|
1933
|
+
[R, o, S]
|
|
1934
|
+
), ie = F(() => {
|
|
1935
|
+
var I;
|
|
1936
|
+
J(!1), (I = se.current) == null || I.close();
|
|
1937
|
+
}, []), qe = F(
|
|
1938
|
+
(I) => {
|
|
1939
|
+
I.target === se.current && ie();
|
|
1935
1940
|
},
|
|
1936
1941
|
[ie]
|
|
1937
|
-
),
|
|
1938
|
-
async (
|
|
1939
|
-
|
|
1942
|
+
), Ze = F(
|
|
1943
|
+
async (I) => {
|
|
1944
|
+
S && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), B(!1), oe.current = null, await te();
|
|
1940
1945
|
},
|
|
1941
|
-
[
|
|
1942
|
-
),
|
|
1943
|
-
async (
|
|
1944
|
-
|
|
1946
|
+
[te, S]
|
|
1947
|
+
), Ye = F(
|
|
1948
|
+
async (I) => {
|
|
1949
|
+
S && console.log("[MessagingShell] Blocking participant:", I), z(null), B(!1), oe.current = null, await te();
|
|
1945
1950
|
},
|
|
1946
|
-
[
|
|
1947
|
-
), ce = !!
|
|
1948
|
-
return
|
|
1951
|
+
[te, S]
|
|
1952
|
+
), ce = !!G;
|
|
1953
|
+
return C ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : k ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: k, onBack: T }) }) : !m || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
1949
1954
|
me,
|
|
1950
1955
|
{
|
|
1951
1956
|
message: "Not connected to messaging service",
|
|
1952
|
-
onBack:
|
|
1957
|
+
onBack: T
|
|
1953
1958
|
}
|
|
1954
|
-
) }) :
|
|
1959
|
+
) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: le }) }) : /* @__PURE__ */ i(
|
|
1955
1960
|
"div",
|
|
1956
1961
|
{
|
|
1957
1962
|
className: D(
|
|
@@ -1966,20 +1971,20 @@ const Rt = ({
|
|
|
1966
1971
|
className: D(
|
|
1967
1972
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1968
1973
|
{
|
|
1969
|
-
"!hidden": b === !1 ||
|
|
1974
|
+
"!hidden": b === !1 || O,
|
|
1970
1975
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
1971
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !
|
|
1976
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !O && ce,
|
|
1972
1977
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
1973
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !
|
|
1978
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !O && !ce
|
|
1974
1979
|
}
|
|
1975
1980
|
),
|
|
1976
1981
|
children: /* @__PURE__ */ e(
|
|
1977
1982
|
Ue,
|
|
1978
1983
|
{
|
|
1979
|
-
onChannelSelect:
|
|
1980
|
-
selectedChannel:
|
|
1981
|
-
filters:
|
|
1982
|
-
customEmptyStateIndicator:
|
|
1984
|
+
onChannelSelect: Ge,
|
|
1985
|
+
selectedChannel: G || void 0,
|
|
1986
|
+
filters: He,
|
|
1987
|
+
customEmptyStateIndicator: _,
|
|
1983
1988
|
renderMessagePreview: N
|
|
1984
1989
|
}
|
|
1985
1990
|
)
|
|
@@ -1992,71 +1997,72 @@ const Rt = ({
|
|
|
1992
1997
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1993
1998
|
{
|
|
1994
1999
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
1995
|
-
flex:
|
|
2000
|
+
flex: O || ce || c,
|
|
1996
2001
|
// Normal mode: hide on mobile when no channel selected
|
|
1997
|
-
"hidden lg:flex": !
|
|
2002
|
+
"hidden lg:flex": !O && !ce && !c
|
|
1998
2003
|
}
|
|
1999
2004
|
),
|
|
2000
|
-
children:
|
|
2005
|
+
children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2001
2006
|
Ae,
|
|
2002
2007
|
{
|
|
2003
|
-
channel:
|
|
2004
|
-
onBack:
|
|
2005
|
-
showBackButton: !
|
|
2008
|
+
channel: G,
|
|
2009
|
+
onBack: Ve,
|
|
2010
|
+
showBackButton: !O,
|
|
2006
2011
|
renderMessageInputActions: n,
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2012
|
+
renderChannelBanner: v,
|
|
2013
|
+
onLeaveConversation: Ze,
|
|
2014
|
+
onBlockParticipant: Ye,
|
|
2015
|
+
CustomChannelEmptyState: u,
|
|
2016
|
+
showDeleteConversation: ze,
|
|
2017
|
+
onDeleteConversationClick: x,
|
|
2018
|
+
onBlockParticipantClick: g,
|
|
2013
2019
|
onReportParticipantClick: l,
|
|
2014
|
-
dmAgentEnabled:
|
|
2015
|
-
messageMetadata:
|
|
2016
|
-
onMessageSent:
|
|
2017
|
-
showStarButton:
|
|
2018
|
-
chatbotVotingEnabled:
|
|
2020
|
+
dmAgentEnabled: y,
|
|
2021
|
+
messageMetadata: E,
|
|
2022
|
+
onMessageSent: w,
|
|
2023
|
+
showStarButton: p,
|
|
2024
|
+
chatbotVotingEnabled: f
|
|
2019
2025
|
},
|
|
2020
|
-
|
|
2026
|
+
G.id
|
|
2021
2027
|
) }) : c ? (
|
|
2022
2028
|
// Show loading while creating/loading direct conversation channel
|
|
2023
2029
|
/* @__PURE__ */ e(he, {})
|
|
2024
2030
|
) : /* @__PURE__ */ e(
|
|
2025
2031
|
$e,
|
|
2026
2032
|
{
|
|
2027
|
-
hasChannels:
|
|
2028
|
-
channelsLoaded:
|
|
2033
|
+
hasChannels: X,
|
|
2034
|
+
channelsLoaded: Y
|
|
2029
2035
|
}
|
|
2030
2036
|
)
|
|
2031
2037
|
}
|
|
2032
2038
|
)
|
|
2033
2039
|
] }),
|
|
2034
|
-
|
|
2040
|
+
re && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2035
2041
|
/* @__PURE__ */ e(
|
|
2036
2042
|
"dialog",
|
|
2037
2043
|
{
|
|
2038
|
-
ref:
|
|
2044
|
+
ref: se,
|
|
2039
2045
|
className: "mes-dialog",
|
|
2040
|
-
onClick:
|
|
2046
|
+
onClick: qe,
|
|
2041
2047
|
onClose: ie,
|
|
2042
2048
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2043
|
-
|
|
2049
|
+
vt,
|
|
2044
2050
|
{
|
|
2045
|
-
participantSource:
|
|
2046
|
-
onSelectParticipant:
|
|
2051
|
+
participantSource: re,
|
|
2052
|
+
onSelectParticipant: We,
|
|
2047
2053
|
onClose: ie,
|
|
2048
|
-
existingParticipantIds:
|
|
2049
|
-
participantLabel:
|
|
2050
|
-
searchPlaceholder: `Search ${
|
|
2054
|
+
existingParticipantIds: V,
|
|
2055
|
+
participantLabel: ae,
|
|
2056
|
+
searchPlaceholder: `Search ${ae}...`
|
|
2051
2057
|
},
|
|
2052
|
-
|
|
2058
|
+
P
|
|
2053
2059
|
) })
|
|
2054
2060
|
}
|
|
2055
2061
|
)
|
|
2056
2062
|
]
|
|
2057
2063
|
}
|
|
2058
2064
|
);
|
|
2059
|
-
},
|
|
2065
|
+
}, pt = ({
|
|
2060
2066
|
question: t,
|
|
2061
2067
|
onClick: s,
|
|
2062
2068
|
loading: n = !1,
|
|
@@ -2078,7 +2084,7 @@ const Rt = ({
|
|
|
2078
2084
|
),
|
|
2079
2085
|
children: t
|
|
2080
2086
|
}
|
|
2081
|
-
),
|
|
2087
|
+
), Tt = ({
|
|
2082
2088
|
faqs: t,
|
|
2083
2089
|
onFaqClick: s,
|
|
2084
2090
|
loadingFaqId: n,
|
|
@@ -2087,8 +2093,8 @@ const Rt = ({
|
|
|
2087
2093
|
avatarImage: c,
|
|
2088
2094
|
avatarName: r
|
|
2089
2095
|
}) => {
|
|
2090
|
-
const
|
|
2091
|
-
return
|
|
2096
|
+
const u = t.filter((b) => b.enabled).sort((b, h) => (b.order ?? 0) - (h.order ?? 0));
|
|
2097
|
+
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2092
2098
|
(c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2093
2099
|
Q,
|
|
2094
2100
|
{
|
|
@@ -2106,8 +2112,8 @@ const Rt = ({
|
|
|
2106
2112
|
style: { backgroundColor: "#F1F0EE" },
|
|
2107
2113
|
children: [
|
|
2108
2114
|
a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
2109
|
-
|
|
2110
|
-
|
|
2115
|
+
u.map((b) => /* @__PURE__ */ e(
|
|
2116
|
+
pt,
|
|
2111
2117
|
{
|
|
2112
2118
|
question: b.question,
|
|
2113
2119
|
onClick: () => s(b.id),
|
|
@@ -2119,61 +2125,61 @@ const Rt = ({
|
|
|
2119
2125
|
}
|
|
2120
2126
|
)
|
|
2121
2127
|
] }) });
|
|
2122
|
-
},
|
|
2123
|
-
const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] =
|
|
2128
|
+
}, Ft = (t, s = {}) => {
|
|
2129
|
+
const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = M([]), [r, u] = M(!1), [b, h] = M(null), [_, x] = M(n), [g, l] = M(!0), [y, E] = M(), w = F(async (v = !1, R) => {
|
|
2124
2130
|
if (r) return;
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2131
|
+
const d = R !== void 0 ? R : _;
|
|
2132
|
+
u(!0), h(null);
|
|
2127
2133
|
try {
|
|
2128
2134
|
const m = await t.loadParticipants({
|
|
2129
|
-
search:
|
|
2135
|
+
search: d || void 0,
|
|
2130
2136
|
limit: a,
|
|
2131
|
-
cursor:
|
|
2137
|
+
cursor: v ? void 0 : y
|
|
2132
2138
|
});
|
|
2133
2139
|
c(
|
|
2134
|
-
(
|
|
2135
|
-
), l(m.hasMore),
|
|
2140
|
+
(C) => v ? m.participants : [...C, ...m.participants]
|
|
2141
|
+
), l(m.hasMore), E(m.nextCursor);
|
|
2136
2142
|
} catch (m) {
|
|
2137
|
-
const
|
|
2138
|
-
|
|
2143
|
+
const C = m instanceof Error ? m.message : "Failed to load participants";
|
|
2144
|
+
h(C), console.error("[useParticipants] Load error:", m);
|
|
2139
2145
|
} finally {
|
|
2140
|
-
|
|
2146
|
+
u(!1);
|
|
2141
2147
|
}
|
|
2142
|
-
}, [t,
|
|
2143
|
-
|
|
2144
|
-
}, [
|
|
2145
|
-
|
|
2146
|
-
}, [
|
|
2147
|
-
|
|
2148
|
-
}, [
|
|
2149
|
-
return
|
|
2150
|
-
|
|
2148
|
+
}, [t, _, y, a, r]), p = F(() => {
|
|
2149
|
+
g && !r && w(!1);
|
|
2150
|
+
}, [g, r, w]), f = F((v) => {
|
|
2151
|
+
x(v), E(void 0), w(!0, v);
|
|
2152
|
+
}, [w]), N = F(() => {
|
|
2153
|
+
E(void 0), w(!0);
|
|
2154
|
+
}, [w]);
|
|
2155
|
+
return q(() => {
|
|
2156
|
+
w(!0);
|
|
2151
2157
|
}, [t.loadParticipants]), {
|
|
2152
2158
|
participants: o,
|
|
2153
2159
|
loading: r,
|
|
2154
2160
|
error: b,
|
|
2155
|
-
searchQuery:
|
|
2156
|
-
hasMore:
|
|
2161
|
+
searchQuery: _,
|
|
2162
|
+
hasMore: g,
|
|
2157
2163
|
totalCount: t.totalCount,
|
|
2158
|
-
loadMore:
|
|
2159
|
-
search:
|
|
2164
|
+
loadMore: p,
|
|
2165
|
+
search: f,
|
|
2160
2166
|
refresh: N
|
|
2161
2167
|
};
|
|
2162
2168
|
};
|
|
2163
2169
|
export {
|
|
2164
2170
|
Q as Avatar,
|
|
2165
|
-
|
|
2171
|
+
ft as ChannelEmptyState,
|
|
2166
2172
|
Ue as ChannelList,
|
|
2167
2173
|
Ae as ChannelView,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2174
|
+
Tt as FaqList,
|
|
2175
|
+
pt as FaqListItem,
|
|
2176
|
+
rt as MessageVoteButtons,
|
|
2177
|
+
Rt as MessagingProvider,
|
|
2178
|
+
Dt as MessagingShell,
|
|
2179
|
+
vt as ParticipantPicker,
|
|
2180
|
+
Ws as formatRelativeTime,
|
|
2181
|
+
st as useMessageVote,
|
|
2182
|
+
Gs as useMessaging,
|
|
2183
|
+
Ft as useParticipants
|
|
2178
2184
|
};
|
|
2179
2185
|
//# sourceMappingURL=index.js.map
|